From 886a1ab15d1a94eb5a545b562fb57d7496c3e1d2 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 15 May 2013 00:28:55 +0200 Subject: [PATCH 001/326] 'bind' default for clean templates --- compiler/ccgcalls.nim | 2 +- compiler/semtempl.nim | 47 ++++++++++++++++++++++++++++++++++++++++--- lib/pure/sockets.nim | 2 +- lib/system.nim | 3 ++- todo.txt | 3 +-- 5 files changed, 49 insertions(+), 8 deletions(-) diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index b8b7f4c44d..1d6df3c15a 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -163,7 +163,7 @@ proc genClosureCall(p: BProc, le, ri: PNode, d: var TLoc) = app(pl, genArgNoParam(p, ri.sons[i])) if i < length - 1: app(pl, ~", ") - template genCallPattern = + template genCallPattern {.dirty.} = lineF(p, cpsStmts, CallPattern & ";$n", op.r, pl, pl.addComma, rawProc) let rawProc = getRawProcType(p, typ) diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 68abc9aa64..66cc3a983d 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -14,7 +14,7 @@ discard """ template `||` (a, b: expr): expr = let aa = a - (if aa: aa else: b) + if aa: aa else: b var a, b: T @@ -156,6 +156,37 @@ proc addLocalDecl(c: var TemplCtx, n: var PNode, k: TSymKind) = else: n = semTemplBody(c, n) +proc semTemplSymbol(c: PContext, n: PNode, s: PSym): PNode = + incl(s.flags, sfUsed) + case s.kind + of skUnknown: + # Introduced in this pass! Leave it as an identifier. + result = n + of skProc, skMethod, skIterator, skConverter, skTemplate, skMacro: + result = symChoice(c, n, s, scOpen) + of skGenericParam: + result = newSymNodeTypeDesc(s, n.info) + of skParam: + result = n + of skType: + if (s.typ != nil) and (s.typ.kind != tyGenericParam): + result = newSymNodeTypeDesc(s, n.info) + else: + result = n + else: result = newSymNode(s, n.info) + +proc semRoutineInTemplName(c: var TemplCtx, n: PNode): PNode = + result = n + if n.kind == nkIdent: + let s = QualifiedLookUp(c.c, n, {}) + if s != nil: + if s.owner == c.owner and (s.kind == skParam or sfGenSym in s.flags): + incl(s.flags, sfUsed) + result = newSymNode(s, n.info) + else: + for i in countup(0, safeLen(n) - 1): + result.sons[i] = semRoutineInTemplName(c, n.sons[i]) + proc semRoutineInTemplBody(c: var TemplCtx, n: PNode, k: TSymKind): PNode = result = n checkSonsLen(n, bodyPos + 1) @@ -170,14 +201,14 @@ proc semRoutineInTemplBody(c: var TemplCtx, n: PNode, k: TSymKind): PNode = else: n.sons[namePos] = ident else: - n.sons[namePos] = semTemplBody(c, n.sons[namePos]) + n.sons[namePos] = semRoutineInTemplName(c, n.sons[namePos]) openScope(c) for i in patternPos..bodyPos: n.sons[i] = semTemplBody(c, n.sons[i]) closeScope(c) proc semTemplSomeDecl(c: var TemplCtx, n: PNode, symKind: TSymKind) = - for i in countup(ord(symkind == skConditional), sonsLen(n) - 1): + for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue if (a.kind != nkIdentDefs) and (a.kind != nkVarTuple): IllFormedAst(a) @@ -200,11 +231,15 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = result = newSymNode(s, n.info) elif Contains(c.toBind, s.id): result = symChoice(c.c, n, s, scClosed) + elif Contains(c.toMixin, s.name.id): + result = symChoice(c.c, n, s, scForceOpen) elif s.owner == c.owner and sfGenSym in s.flags: # template tmp[T](x: var seq[T]) = # var yz: T incl(s.flags, sfUsed) result = newSymNode(s, n.info) + else: + result = semTemplSymbol(c.c, n, s) of nkBind: result = semTemplBody(c, n.sons[0]) of nkBindStmt: @@ -310,6 +345,10 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = result = semRoutineInTemplBody(c, n, skMacro) of nkConverterDef: result = semRoutineInTemplBody(c, n, skConverter) + of nkPragmaExpr: + result.sons[0] = semTemplBody(c, n.sons[0]) + of nkPragma: + discard else: # dotExpr is ambiguous: note that we explicitely allow 'x.TemplateParam', # so we use the generic code for nkDotExpr too @@ -318,6 +357,8 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = if s != nil: if Contains(c.toBind, s.id): return symChoice(c.c, n, s, scClosed) + elif Contains(c.toMixin, s.name.id): + return symChoice(c.c, n, s, scForceOpen) result = n for i in countup(0, sonsLen(n) - 1): result.sons[i] = semTemplBody(c, n.sons[i]) diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index 2d602c86e6..17e4d31186 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -1028,7 +1028,7 @@ proc readIntoBuf(socket: TSocket, flags: int32): int = socket.bufLen = result socket.currPos = 0 -template retRead(flags, readBytes: int) = +template retRead(flags, readBytes: int) {.dirty.} = let res = socket.readIntoBuf(flags.int32) if res <= 0: if readBytes > 0: diff --git a/lib/system.nim b/lib/system.nim index 4cdc212b90..1e284f68ae 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -194,7 +194,8 @@ when not defined(JS) and not defined(NimrodVM): data: array[0..100_000_000, char] NimString = ptr NimStringDesc - template space(s: PGenericSeq): int = s.reserved and not seqShallowFlag + template space(s: PGenericSeq): int {.dirty.} = + s.reserved and not seqShallowFlag include "system/hti" diff --git a/todo.txt b/todo.txt index d1dbf8b744..f18bdc5850 100644 --- a/todo.txt +++ b/todo.txt @@ -1,8 +1,7 @@ version 0.9.2 ============= -- make 'bind' default for templates and introduce 'mixin'; - special rule for ``[]=`` +- special rule for ``[]=`` - ``=`` should be overloadable; requires specialization for ``=``; general lift mechanism in the compiler is already implemented for 'fields' - mocking support with ``tyProxy`` that does: fallback for ``.`` operator From 064df34ae4134490c5be048becd0fa5294f82194 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 16 May 2013 08:54:58 +0200 Subject: [PATCH 002/326] made some tests green --- tests/reject/teffects5.nim | 2 +- tests/reject/tenummix.nim | 2 +- tests/run/tcurrncy.nim | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/reject/teffects5.nim b/tests/reject/teffects5.nim index 42be115c3d..d630a6fc4b 100644 --- a/tests/reject/teffects5.nim +++ b/tests/reject/teffects5.nim @@ -1,5 +1,5 @@ discard """ - errormsg: 'type mismatch' + errormsg: "type mismatch" line: 7 """ diff --git a/tests/reject/tenummix.nim b/tests/reject/tenummix.nim index 22c07f14a8..f58e7989de 100644 --- a/tests/reject/tenummix.nim +++ b/tests/reject/tenummix.nim @@ -1,6 +1,6 @@ discard """ file: "system.nim" - line: 695 + line: 696 errormsg: "type mismatch" """ diff --git a/tests/run/tcurrncy.nim b/tests/run/tcurrncy.nim index d04620cfb9..78dbc2a891 100644 --- a/tests/run/tcurrncy.nim +++ b/tests/run/tcurrncy.nim @@ -10,7 +10,7 @@ template Additive(typ: typeDesc): stmt = proc `+` *(x: typ): typ {.borrow.} proc `-` *(x: typ): typ {.borrow.} -template Multiplicative(typ, base: typeDesc): stmt = +template Multiplicative(typ, base: typeDesc): stmt {.immediate.} = proc `*` *(x: typ, y: base): typ {.borrow.} proc `*` *(x: base, y: typ): typ {.borrow.} proc `div` *(x: typ, y: base): typ {.borrow.} From 52d1a637b95f7cea95ad6e9591a941ef1be113cb Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 15 Oct 2013 07:53:10 +0200 Subject: [PATCH 003/326] fixed definition of culong on win64 --- lib/system.nim | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 1749125192..9beead0b7e 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -999,11 +999,17 @@ type ## platform-dependant in general. when defined(windows): - type clong* {.importc: "long", nodecl.} = int32 - ## This is the same as the type ``long`` in *C*. + type + clong* {.importc: "long", nodecl.} = int32 + ## This is the same as the type ``long`` in *C*. + culong* {.importc: "unsigned long", nodecl.} = uint32 + ## This is the same as the type ``unsigned long`` in *C*. else: - type clong* {.importc: "long", nodecl.} = int - ## This is the same as the type ``long`` in *C*. + type + clong* {.importc: "long", nodecl.} = int + ## This is the same as the type ``long`` in *C*. + culong* {.importc: "unsigned long", nodecl.} = uint + ## This is the same as the type ``unsigned long`` in *C*. type # these work for most platforms: cchar* {.importc: "char", nodecl.} = char @@ -1032,8 +1038,6 @@ type # these work for most platforms: ## This is the same as the type ``unsigned short`` in *C*. cuint* {.importc: "int", nodecl.} = uint32 ## This is the same as the type ``unsigned int`` in *C*. - culong* {.importc: "unsigned long", nodecl.} = uint - ## This is the same as the type ``unsigned long`` in *C*. culonglong* {.importc: "unsigned long long", nodecl.} = uint64 ## This is the same as the type ``unsigned long long`` in *C*. @@ -1042,10 +1046,10 @@ type # these work for most platforms: ## high value is large enough to disable bounds checking in practice. ## Use `cstringArrayToSeq` to convert it into a ``seq[string]``. - 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`` + 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`` proc toFloat*(i: int): float {. magic: "ToFloat", noSideEffect, importc: "toFloat".} From 5659a1662e755baac1de555e33f2e8c13e30f2e2 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 15 Oct 2013 07:57:32 +0200 Subject: [PATCH 004/326] attempt to improve line information for '!=' etc. templates --- compiler/evaltempl.nim | 45 ++++++++++++------------------------------ 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/compiler/evaltempl.nim b/compiler/evaltempl.nim index 05be0e9d3f..4bff9ae5e2 100644 --- a/compiler/evaltempl.nim +++ b/compiler/evaltempl.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2012 Andreas Rumpf +# (c) Copyright 2013 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -16,9 +16,14 @@ import type TemplCtx {.pure, final.} = object owner, genSymOwner: PSym + instLines: bool # use the instantiation lines numbers mapping: TIdTable # every gensym'ed symbol needs to be mapped to some # new symbol +proc copyNode(ctx: TemplCtx, a, b: PNode): PNode = + result = copyNode(a) + if ctx.instLines: result.info = b.info + proc evalTemplateAux(templ, actual: PNode, c: var TemplCtx, result: PNode) = case templ.kind of nkSym: @@ -37,43 +42,17 @@ proc evalTemplateAux(templ, actual: PNode, c: var TemplCtx, result: PNode) = x = copySym(s, false) x.owner = c.genSymOwner IdTablePut(c.mapping, s, x) - result.add newSymNode(x, templ.info) + result.add newSymNode(x, if c.instLines: actual.info else: templ.info) else: - result.add copyNode(templ) + result.add copyNode(c, templ, actual) of nkNone..nkIdent, nkType..nkNilLit: # atom - result.add copyNode(templ) + result.add copyNode(c, templ, actual) else: - var res = copyNode(templ) + var res = copyNode(c, templ, actual) for i in countup(0, sonsLen(templ) - 1): evalTemplateAux(templ.sons[i], actual, c, res) result.add res -when false: - proc evalTemplateAux(templ, actual: PNode, c: var TemplCtx): PNode = - case templ.kind - of nkSym: - var s = templ.sym - if s.owner.id == c.owner.id: - if s.kind == skParam: - result = copyTree(actual.sons[s.position]) - else: - InternalAssert sfGenSym in s.flags - var x = PSym(IdTableGet(c.mapping, s)) - if x == nil: - x = copySym(s, false) - x.owner = c.genSymOwner - IdTablePut(c.mapping, s, x) - result = newSymNode(x, templ.info) - else: - result = copyNode(templ) - of nkNone..nkIdent, nkType..nkNilLit: # atom - result = copyNode(templ) - else: - result = copyNode(templ) - newSons(result, sonsLen(templ)) - for i in countup(0, sonsLen(templ) - 1): - result.sons[i] = evalTemplateAux(templ.sons[i], actual, c) - proc evalTemplateArgs(n: PNode, s: PSym): PNode = # if the template has zero arguments, it can be called without ``()`` # `n` is then a nkSym or something similar @@ -118,7 +97,9 @@ proc evalTemplate*(n: PNode, tmpl, genSymOwner: PSym): PNode = renderTree(result, {renderNoComments})) else: result = copyNode(body) - #evalTemplateAux(body, args, ctx, result) + ctx.instLines = body.kind notin {nkStmtList, nkStmtListExpr, + nkBlockStmt, nkBlockExpr} + if ctx.instLines: result.info = n.info for i in countup(0, safeLen(body) - 1): evalTemplateAux(body.sons[i], args, ctx, result) From 6a9baf3fd7842027a30ee4856d40841610dccc13 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 15 Oct 2013 08:06:54 +0200 Subject: [PATCH 005/326] compiler bootstraps with new VM --- compiler/main.nim | 2 +- compiler/sem.nim | 43 +++++++++++------------ compiler/semdata.nim | 2 +- compiler/semexprs.nim | 6 ++-- compiler/semmagic.nim | 17 +++++++++ compiler/semstmts.nim | 4 +-- compiler/vm.nim | 80 +++++++++++++++++++++++++++++-------------- compiler/vmdef.nim | 18 ++++++++++ compiler/vmgen.nim | 23 +++++++++---- todo.txt | 5 +-- web/news.txt | 5 ++- 11 files changed, 141 insertions(+), 64 deletions(-) diff --git a/compiler/main.nim b/compiler/main.nim index 7cfc6d4068..7124b69846 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -14,7 +14,7 @@ import os, condsyms, rodread, rodwrite, times, wordrecg, sem, semdata, idents, passes, docgen, extccomp, cgen, jsgen, json, nversion, - platform, nimconf, importer, passaux, depends, evals, types, idgen, + platform, nimconf, importer, passaux, depends, vm, vmdef, types, idgen, tables, docgen2, service, parser, modules, ccgutils, sigmatch, ropes, lists, pretty diff --git a/compiler/sem.nim b/compiler/sem.nim index 71951dd3f7..89f87acaa7 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -14,7 +14,7 @@ import wordrecg, ropes, msgs, os, condsyms, idents, renderer, types, platform, math, magicsys, parser, nversion, nimsets, semfold, importer, procfind, lookups, rodread, pragmas, passes, semdata, semtypinst, sigmatch, - semthreads, intsets, transf, evals, idgen, aliases, cgmeth, lambdalifting, + semthreads, intsets, transf, vmdef, vm, idgen, aliases, cgmeth, lambdalifting, evaltempl, patterns, parampatterns, sempass2 # implementation @@ -149,25 +149,26 @@ proc symNodeFromType(c: PContext, t: PType, info: TLineInfo): PNode = result = newSymNode(symFromType(t, info), info) result.typ = makeTypeDesc(c, t) -proc createEvalContext(c: PContext, mode: TEvalMode): PEvalContext = - result = newEvalContext(c.module, mode) - result.getType = proc (n: PNode): PNode = - var e = tryExpr(c, n) - if e == nil: - result = symNodeFromType(c, errorType(c), n.info) - elif e.typ == nil: - result = newSymNode(getSysSym"void") - else: - result = symNodeFromType(c, e.typ, n.info) +when false: + proc createEvalContext(c: PContext, mode: TEvalMode): PEvalContext = + result = newEvalContext(c.module, mode) + result.getType = proc (n: PNode): PNode = + var e = tryExpr(c, n) + if e == nil: + result = symNodeFromType(c, errorType(c), n.info) + elif e.typ == nil: + result = newSymNode(getSysSym"void") + else: + result = symNodeFromType(c, e.typ, n.info) - result.handleIsOperator = proc (n: PNode): PNode = - result = IsOpImpl(c, n) + result.handleIsOperator = proc (n: PNode): PNode = + result = IsOpImpl(c, n) -proc evalConstExpr(c: PContext, module: PSym, e: PNode): PNode = - result = evalConstExprAux(c.createEvalContext(emConst), module, nil, e) + proc evalConstExpr(c: PContext, module: PSym, e: PNode): PNode = + result = evalConstExprAux(c.createEvalContext(emConst), module, nil, e) -proc evalStaticExpr(c: PContext, module: PSym, e: PNode, prc: PSym): PNode = - result = evalConstExprAux(c.createEvalContext(emStatic), module, prc, e) + proc evalStaticExpr(c: PContext, module: PSym, e: PNode, prc: PSym): PNode = + result = evalConstExprAux(c.createEvalContext(emStatic), module, prc, e) proc semConstExpr(c: PContext, n: PNode): PNode = var e = semExprWithType(c, n) @@ -176,7 +177,7 @@ proc semConstExpr(c: PContext, n: PNode): PNode = return n result = getConstExpr(c.module, e) if result == nil: - result = evalConstExpr(c, c.module, e) + result = evalConstExpr(c.module, e) if result == nil or result.kind == nkEmpty: if e.info != n.info: pushInfoContext(n.info) @@ -222,10 +223,10 @@ proc semMacroExpr(c: PContext, n, nOrig: PNode, sym: PSym, if sym == c.p.owner: GlobalError(n.info, errRecursiveDependencyX, sym.name.s) - if c.evalContext == nil: - c.evalContext = c.createEvalContext(emStatic) + #if c.evalContext == nil: + # c.evalContext = c.createEvalContext(emStatic) - result = evalMacroCall(c.evalContext, n, nOrig, sym) + result = evalMacroCall(c.module, n, nOrig, sym) if semCheck: result = semAfterMacroCall(c, result, sym) proc forceBool(c: PContext, n: PNode): PNode = diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 121bf297da..9ab365c9d5 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -13,7 +13,7 @@ import strutils, lists, intsets, options, lexer, ast, astalgo, trees, treetab, wordrecg, ropes, msgs, platform, os, condsyms, idents, renderer, types, extccomp, math, - magicsys, nversion, nimsets, parser, times, passes, rodread, evals + magicsys, nversion, nimsets, parser, times, passes, rodread, vmdef type TOptionEntry* = object of lists.TListEntry # entries to put on a diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 47e07d402f..b5d3ced66f 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -631,18 +631,18 @@ proc evalAtCompileTime(c: PContext, n: PNode): PNode = call.add(a) #echo "NOW evaluating at compile time: ", call.renderTree if sfCompileTime in callee.flags: - result = evalStaticExpr(c, c.module, call, c.p.owner) + result = evalStaticExpr(c.module, call, c.p.owner) if result.isNil: LocalError(n.info, errCannotInterpretNodeX, renderTree(call)) else: - result = evalConstExpr(c, c.module, call) + result = evalConstExpr(c.module, call) if result.isNil: result = n #if result != n: # echo "SUCCESS evaluated at compile time: ", call.renderTree proc semStaticExpr(c: PContext, n: PNode): PNode = let a = semExpr(c, n.sons[0]) - result = evalStaticExpr(c, c.module, a, c.p.owner) + result = evalStaticExpr(c.module, a, c.p.owner) if result.isNil: LocalError(n.info, errCannotInterpretNodeX, renderTree(n)) result = emptyNode diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 88567b10a7..44e1066789 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -32,6 +32,23 @@ proc semInstantiationInfo(c: PContext, n: PNode): PNode = result.add(filename) result.add(line) + +proc evalTypeTrait(trait, operand: PNode, context: PSym): PNode = + InternalAssert operand.kind == nkSym + + let typ = operand.sym.typ.skipTypes({tyTypeDesc}) + case trait.sym.name.s.normalize + of "name": + result = newStrNode(nkStrLit, typ.typeToString(preferName)) + result.typ = newType(tyString, context) + result.info = trait.info + of "arity": + result = newIntNode(nkIntLit, typ.n.len-1) + result.typ = newType(tyInt, context) + result.info = trait.info + else: + internalAssert false + proc semTypeTraits(c: PContext, n: PNode): PNode = checkMinSonsLen(n, 2) internalAssert n.sons[1].kind == nkSym diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index ed6787a167..4fc69043bf 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1152,14 +1152,14 @@ proc setLine(n: PNode, info: TLineInfo) = proc semPragmaBlock(c: PContext, n: PNode): PNode = let pragmaList = n.sons[0] pragma(c, nil, pragmaList, exprPragmas) - result = semStmt(c, n.sons[1]) + result = semExpr(c, n.sons[1]) for i in 0 .. 100: + inc(evalMacroCounter) + if evalMacroCounter > 100: GlobalError(n.info, errTemplateInstantiationTooNested) + setupGlobalCtx(module) + var c = globalCtx c.callsite = nOrig - let body = optBody(c, sym) - let start = genStmt(c, body) + let start = genProc(c, sym) var tos = PStackFrame(prc: sym, comesFrom: 0, next: nil) newSeq(tos.slots, c.prc.maxSlots) @@ -917,8 +944,9 @@ proc evalMacroCall(c: PEvalContext, n, nOrig: PNode, sym: PSym): PNode = tos.slots[0] = newNodeIT(nkNilLit, n.info, sym.typ.sons[0]) # setup parameters: for i in 1 .. < L: tos.slots[i] = setupMacroParam(n.sons[i]) - rawExecute(c, start, tos) - result = tos.slots[0] + # temporary storage: + for i in L .. = 0: InternalError(n.info, "not unused") + if x >= 0: + #debug(n) + InternalError(n.info, "not unused") proc genConv(c: PCtx; n, arg: PNode; dest: var TDest; opc=opcConv) = let tmp = c.genx(arg) @@ -508,7 +510,7 @@ proc genCard(c: PCtx; n: PNode; dest: var TDest) = let tmp = c.genx(n.sons[1]) if dest < 0: dest = c.getTemp(n.typ) c.genSetType(n.sons[1], tmp) - c.gABC(n, opc, dest, tmp) + c.gABC(n, opcCard, dest, tmp) c.freeTemp(tmp) proc genMagic(c: PCtx; n: PNode; dest: var TDest) = @@ -701,7 +703,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = of mTypeTrait: let tmp = c.genx(n.sons[1]) if dest < 0: dest = c.getTemp(n.typ) - c.gABx(n, opcSetType, tmp, c.genType(n.sons[1])) + c.gABx(n, opcSetType, tmp, c.genType(n.sons[1].typ)) c.gABC(n, opcTypeTrait, dest, tmp) c.freeTemp(tmp) of mIs: @@ -1259,7 +1261,14 @@ proc optimizeJumps(c: PCtx; start: int) = proc genProc(c: PCtx; s: PSym): int = let x = s.ast.sons[optimizedCodePos] if x.kind == nkEmpty: - c.removeLastEof + #echo "GENERATING CODE FOR ", s.name.s + let last = c.code.len-1 + var eofInstr: TInstr + if last >= 0 and c.code[last].opcode == opcEof: + eofInstr = c.code[last] + c.code.setLen(last) + c.debug.setLen(last) + #c.removeLastEof result = c.code.len+1 # skip the jump instruction s.ast.sons[optimizedCodePos] = newIntNode(nkIntLit, result) # thanks to the jmp we can add top level statements easily and also nest @@ -1275,9 +1284,9 @@ proc genProc(c: PCtx; s: PSym): int = # generate final 'return' statement: c.gABC(body, opcRet) c.patch(procStart) - c.gABC(body, opcEof) + + c.gABC(body, opcEof, eofInstr.regA) s.position = c.prc.maxSlots c.prc = oldPrc - #c.echoCode else: result = x.intVal.int diff --git a/todo.txt b/todo.txt index da7585500d..647f5e2c17 100644 --- a/todo.txt +++ b/todo.txt @@ -2,8 +2,9 @@ version 0.9.4 ============= - new VM: - - implement the glue to replace evals.nim - - implement missing magics + - new VM requires lambda lifting + - codegen for computed goto still wrong + - test and activate the jump optimizer - implement overflow checking - implement the FFI diff --git a/web/news.txt b/web/news.txt index 1b492fa971..7bb0676ee1 100644 --- a/web/news.txt +++ b/web/news.txt @@ -41,6 +41,9 @@ Compiler Additions over the generated code. - The compiler now supports a ``computedGoto`` pragma to support very fast dispatching for interpreters and the like. +- The old evaluation engine has been replaced by a proper register based + virtual machine. This fixes numerous bugs for ``nimrod i`` and for macro + evaluation. Language Additions @@ -55,7 +58,7 @@ Language Additions OOP-like syntactic sugar. - Added ``delegator pragma`` for handling calls to missing procs and fields at compile-time. -- Support for user-defined type classes have been added. +- Support for user-defined type classes has been added. Tools improvements From 3d18053370580916d190c98540a2e3d0ff66f9c3 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 16 Oct 2013 16:41:24 +0200 Subject: [PATCH 006/326] some complex macros work --- compiler/vm.nim | 69 +++++++++++++++++++++++++++++----------------- compiler/vmdef.nim | 30 ++++++++++---------- compiler/vmgen.nim | 30 ++++++++++++++------ 3 files changed, 80 insertions(+), 49 deletions(-) diff --git a/compiler/vm.nim b/compiler/vm.nim index dd8b8d8f28..b2c8482875 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -96,19 +96,24 @@ template decodeBx(k: expr) {.immediate, dirty.} = template move(a, b: expr) = system.shallowCopy(a, b) # XXX fix minor 'shallowCopy' overloading bug in compiler -proc asgnRef(x, y: PNode) = - myreset(x) - x.kind = y.kind - x.typ = y.typ - case x.kind - of nkCharLit..nkInt64Lit: x.intVal = y.intVal - of nkFloatLit..nkFloat64Lit: x.floatVal = y.floatVal - of nkStrLit..nkTripleStrLit: x.strVal = y.strVal - of nkIdent: x.ident = y.ident - of nkSym: x.sym = y.sym - else: - if x.kind notin {nkEmpty..nkNilLit}: - move(x.sons, y.sons) +when false: + proc asgnRef(x, y: PNode) = + myreset(x) + x.kind = y.kind + x.typ = y.typ + case x.kind + of nkCharLit..nkInt64Lit: x.intVal = y.intVal + of nkFloatLit..nkFloat64Lit: x.floatVal = y.floatVal + of nkStrLit..nkTripleStrLit: x.strVal = y.strVal + of nkIdent: x.ident = y.ident + of nkSym: x.sym = y.sym + else: + if x.kind notin {nkEmpty..nkNilLit}: + move(x.sons, y.sons) +else: + # this seems to be the best way to model the reference semantics + # of PNimrodNode: + template asgnRef(x, y: expr) = x = y proc asgnComplex(x, y: PNode) = myreset(x) @@ -279,7 +284,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcAsgnRef: asgnRef(regs[ra], regs[instr.regB]) of opcWrGlobalRef: - asgnRef(c.globals[instr.regBx-wordExcess-1], regs[ra]) + asgnRef(c.globals.sons[instr.regBx-wordExcess-1], regs[ra]) of opcWrGlobal: asgnComplex(c.globals.sons[instr.regBx-wordExcess-1], regs[ra]) of opcLdArr: @@ -470,24 +475,24 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra].intVal = not regs[rb].intVal of opcEqStr: decodeBC(nkIntLit) - regs[ra].intVal = Ord(regs[rb].strVal == regs[rc].strVal) + regs[ra].intVal = ord(regs[rb].strVal == regs[rc].strVal) of opcLeStr: decodeBC(nkIntLit) - regs[ra].intVal = Ord(regs[rb].strVal <= regs[rc].strVal) + regs[ra].intVal = ord(regs[rb].strVal <= regs[rc].strVal) of opcLtStr: decodeBC(nkIntLit) - regs[ra].intVal = Ord(regs[rb].strVal < regs[rc].strVal) + regs[ra].intVal = ord(regs[rb].strVal < regs[rc].strVal) of opcLeSet: decodeBC(nkIntLit) - regs[ra].intVal = Ord(containsSets(regs[rb], regs[rc])) + regs[ra].intVal = ord(containsSets(regs[rb], regs[rc])) of opcEqSet: decodeBC(nkIntLit) - regs[ra].intVal = Ord(equalSets(regs[rb], regs[rc])) + regs[ra].intVal = ord(equalSets(regs[rb], regs[rc])) of opcLtSet: decodeBC(nkIntLit) let a = regs[rb] let b = regs[rc] - regs[ra].intVal = Ord(containsSets(a, b) and not equalSets(a, b)) + regs[ra].intVal = ord(containsSets(a, b) and not equalSets(a, b)) of opcMulSet: decodeBC(nkCurly) move(regs[ra].sons, nimsets.intersectSets(regs[rb], regs[rc]).sons) @@ -652,9 +657,21 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra] = copyTree(c.globals.sons[rb]) else: asgnComplex(regs[ra], c.globals.sons[rb]) - of opcRepr, opcSetLenStr, opcSetLenSeq, + of opcRepr: + decodeB(nkStrLit) + regs[ra].strVal = renderTree(regs[rb], {renderNoComments}) + of opcQuit: + if c.mode in {emRepl, emStatic}: + Message(c.debug[pc], hintQuitCalled) + quit(int(getOrdValue(regs[ra]))) + else: + return nil + of opcSetLenStr: + decodeB(nkStrLit) + regs[ra].strVal.setLen(regs[rb].getOrdValue.int) + of opcSetLenSeq, opcSwap, opcIsNil, opcOf, - opcCast, opcQuit, opcReset: + opcCast, opcReset: internalError(c.debug[pc], "too implement") of opcNBindSym: # trivial implementation: @@ -670,7 +687,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra].sons[regs[rb].intVal.int] = regs[rc] of opcNAdd: declBC() - regs[rb].add(regs[rb]) + regs[rb].add(regs[rc]) regs[ra] = regs[rb] of opcNAddMultiple: declBC() @@ -904,6 +921,7 @@ const evalPass* = makePass(myOpen, nil, myProcess, myProcess) proc evalConstExprAux(module, prc: PSym, n: PNode, mode: TEvalMode): PNode = setupGlobalCtx(module) var c = globalCtx + c.mode = mode let start = genExpr(c, n) assert c.code[start].opcode != opcEof var tos = PStackFrame(prc: prc, comesFrom: 0, next: nil) @@ -935,7 +953,8 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = let start = genProc(c, sym) var tos = PStackFrame(prc: sym, comesFrom: 0, next: nil) - newSeq(tos.slots, c.prc.maxSlots) + let maxSlots = sym.position + newSeq(tos.slots, maxSlots) # setup arguments: var L = n.safeLen if L == 0: L = 1 @@ -945,7 +964,7 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = # setup parameters: for i in 1 .. < L: tos.slots[i] = setupMacroParam(n.sons[i]) # temporary storage: - for i in L .. Date: Wed, 16 Oct 2013 17:26:07 +0200 Subject: [PATCH 007/326] opcLdGlobal bugfix --- compiler/vm.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/vm.nim b/compiler/vm.nim index b2c8482875..943324de1a 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -652,7 +652,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = else: asgnComplex(regs[ra], c.constants.sons[rb]) of opcLdGlobal: - let rb = instr.regBx - wordExcess + let rb = instr.regBx - wordExcess - 1 if regs[ra].isNil: regs[ra] = copyTree(c.globals.sons[rb]) else: From 6fbc96fec49d8376911dcf7a827b802bc942ca70 Mon Sep 17 00:00:00 2001 From: Mark Flamer Date: Tue, 22 Oct 2013 14:24:32 -0700 Subject: [PATCH 008/326] LockFree Hash Table 0.1 --- lib/pure/collections/LockFreeHash.nim | 581 ++++++++++++++++++++++++++ lib/pure/collections/baseutils.nim | 41 ++ lib/system/atomics.nim | 239 ++++++++--- 3 files changed, 811 insertions(+), 50 deletions(-) create mode 100644 lib/pure/collections/LockFreeHash.nim create mode 100644 lib/pure/collections/baseutils.nim diff --git a/lib/pure/collections/LockFreeHash.nim b/lib/pure/collections/LockFreeHash.nim new file mode 100644 index 0000000000..d3a91763a4 --- /dev/null +++ b/lib/pure/collections/LockFreeHash.nim @@ -0,0 +1,581 @@ +#nimrod c -t:-march=i686 --cpu:amd64 --threads:on -d:release lockfreehash.nim + +import baseutils, unsigned, math, hashes + + + +const + minTableSize = 8 + reProbeLimit = 12 + minCopyWork = 4096 + intSize = sizeof(int) + + + +when sizeof(int) == 4: # 32bit + type + TRaw = range[0..1073741823] + ## The range of uint values that can be stored directly in a value slot + ## when on a 32 bit platform + +elif sizeof(int) == 8: # 64bit + type + TRaw = range[0..4611686018427387903] + ## The range of uint values that can be stored directly in a value slot + ## when on a 64 bit platform +else: echo("unsupported platform") + +type + TEntry = tuple + key: int + value: int + + TEntryArr = ptr array[0..10_000_000, TEntry] + + PConcTable[K,V] = ptr object {.pure.} + len: int + used: int + active: int + copyIdx: int + copyDone: int + next: PConcTable[K,V] + data: TEntryArr + + +proc setVal[K,V](table: var PConcTable[K,V], key: int, val: int, + expVal: int, match: bool): int + +#------------------------------------------------------------------------------ + +# Create a new table +proc newLFTable*[K,V](size: int = minTableSize): PConcTable[K,V] = + let + dataLen = max(nextPowerOfTwo(size), minTableSize) + dataSize = dataLen*sizeof(TEntry) + dataMem = allocShared0(dataSize) + tableSize = 7 * intSize + tableMem = allocShared0(tableSize) + table = cast[PConcTable[K,V]](tableMem) + table.len = dataLen + table.used = 0 + table.active = 0 + table.copyIdx = 0 + table.copyDone = 0 + table.next = nil + table.data = cast[TEntryArr](dataMem) + result = table + +#------------------------------------------------------------------------------ + +# Delete a table +proc deleteConcTable[K,V](tbl: PConcTable[K,V]) = + deallocShared(tbl.data) + deallocShared(tbl) + +#------------------------------------------------------------------------------ + +proc `[]`[K,V](table: var PConcTable[K,V], i: int): var TEntry {.inline.} = + table.data[i] + +#------------------------------------------------------------------------------ +# State flags stored in ptr + + +proc pack[T](x: T): int {.inline.} = + result = (cast[int](x) shl 2) + #echo("packKey ",cast[int](x) , " -> ", result) + +# Pop the flags off returning a 4 byte aligned ptr to our Key or Val +proc pop(x: int): int {.inline.} = + result = x and 0xFFFFFFFC'i32 + +# Pop the raw value off of our Key or Val +proc popRaw(x: int): int {.inline.} = + result = x shr 2 + +# Pop the flags off returning a 4 byte aligned ptr to our Key or Val +proc popPtr[V](x: int): ptr V {.inline.} = + result = cast[ptr V](pop(x)) + #echo("popPtr " & $x & " -> " & $cast[int](result)) + +# Ghost (sentinel) +# K or V is no longer valid use new table +const Ghost = 0xFFFFFFFC +proc isGhost(x: int): bool {.inline.} = + result = x == 0xFFFFFFFC + +# Tombstone +# applied to V = K is dead +proc isTomb(x: int): bool {.inline.} = + result = (x and 0x00000002) != 0 + +proc setTomb(x: int): int {.inline.} = + result = x or 0x00000002 + +# Prime +# K or V is in new table copied from old +proc isPrime(x: int): bool {.inline.} = + result = (x and 0x00000001) != 0 + +proc setPrime(x: int): int {.inline.} = + result = x or 0x00000001 + +#------------------------------------------------------------------------------ + +##This is for i32 only need to override for i64 +proc hashInt(x: int):int {.inline.} = + var h = uint32(x) #shr 2'u32 + h = h xor (h shr 16'u32) + h *= 0x85ebca6b'u32 + h = h xor (h shr 13'u32) + h *= 0xc2b2ae35'u32 + h = h xor (h shr 16'u32) + result = int(h) + +#------------------------------------------------------------------------------ + +proc resize[K,V](self: PConcTable[K,V]): PConcTable[K,V] = + var next = atomic_load_n(self.next.addr, ATOMIC_RELAXED) + #echo("next = " & $cast[int](next)) + if next != nil: + #echo("A new table already exists, copy in progress") + return next + var + oldLen = atomic_load_n(self.len.addr, ATOMIC_RELAXED) + newTable = newLFTable[K,V](oldLen*2) + success = atomic_compare_exchange_n(self.next.addr, next.addr, newTable, + false, ATOMIC_RELAXED, ATOMIC_RELAXED) + if not success: + echo("someone beat us to it! delete table we just created and return his " & $cast[int](next)) + deleteConcTable(newTable) + return next + else: + echo("Created New Table! " & $cast[int](newTable) & " Size = " & $newTable.len) + return newTable + + +#------------------------------------------------------------------------------ +#proc keyEQ[K](key1: ptr K, key2: ptr K): bool {.inline.} = +proc keyEQ[K](key1: int, key2: int): bool {.inline.} = + result = false + when K is TRaw: + if key1 == key2: + result = true + else: + var + p1 = popPtr[K](key1) + p2 = popPtr[K](key2) + if p1 != nil and p2 != nil: + if cast[int](p1) == cast[int](p2): + return true + if p1[] == p2[]: + return true + +#------------------------------------------------------------------------------ + +#proc tableFull(self: var PConcTable[K,V]) : bool {.inline.} = + + +#------------------------------------------------------------------------------ + +proc copySlot[K,V](idx: int, oldTbl: var PConcTable[K,V], newTbl: var PConcTable[K,V]): bool = + #echo("Copy idx " & $idx) + var + oldVal = 0 + oldkey = 0 + ok = false + result = false + #Block the key so no other threads waste time here + while not ok: + ok = atomic_compare_exchange_n(oldTbl[idx].key.addr, oldKey.addr, + setTomb(oldKey), false, ATOMIC_RELAXED, ATOMIC_RELAXED) + #echo("oldKey was = " & $oldKey & " set it to tomb " & $setTomb(oldKey)) + #Prevent new values from appearing in the old table by priming + oldVal = atomic_load_n(oldTbl[idx].value.addr, ATOMIC_RELAXED) + while not isPrime(oldVal): + var box = if oldVal == NULL or isTomb(oldVal) : oldVal.setTomb.setPrime + else: oldVal.setPrime + if atomic_compare_exchange_n(oldTbl[idx].value.addr, oldVal.addr, + box, false, ATOMIC_RELAXED, ATOMIC_RELAXED): + if isPrime(box) and isTomb(box): + return true + oldVal = box + break + #echo("oldVal was = ", oldVal, " set it to prime ", box) + if isPrime(oldVal) and isTomb(oldVal): + #when not (K is TRaw): + # deallocShared(popPtr[K](oldKey)) + return false + if isTomb(oldVal): + echo("oldVal is Tomb!!!, should not happen") + if pop(oldVal) != NULL: + result = setVal(newTbl, pop(oldKey), pop(oldVal), NULL, true) == NULL + if result: + #echo("Copied a Slot! idx= " & $idx & " key= " & $oldKey & " val= " & $oldVal) + else: + #echo("copy slot failed") + # Our copy is done so we disable the old slot + while not ok: + ok = atomic_compare_exchange_n(oldTbl[idx].value.addr, oldVal.addr, + oldVal.setTomb.setPrime , false, ATOMIC_RELAXED, ATOMIC_RELAXED) + #echo("disabled old slot") + #echo"---------------------" + +#------------------------------------------------------------------------------ + +proc promote[K,V](table: var PConcTable[K,V]) = + var + newData = atomic_load_n(table.next.data.addr, ATOMIC_RELAXED) + newLen = atomic_load_n(table.next.len.addr, ATOMIC_RELAXED) + newUsed = atomic_load_n(table.next.used.addr, ATOMIC_RELAXED) + + deallocShared(table.data) + atomic_store_n(table.data.addr, newData, ATOMIC_RELAXED) + atomic_store_n(table.len.addr, newLen, ATOMIC_RELAXED) + atomic_store_n(table.used.addr, newUsed, ATOMIC_RELAXED) + atomic_store_n(table.copyIdx.addr, 0, ATOMIC_RELAXED) + atomic_store_n(table.copyDone.addr, 0, ATOMIC_RELAXED) + deallocShared(table.next) + atomic_store_n(table.next.addr, nil, ATOMIC_RELAXED) + echo("new table swapped!") + +#------------------------------------------------------------------------------ + +proc checkAndPromote[K,V](table: var PConcTable[K,V], workDone: int): bool = + var + oldLen = atomic_load_n(table.len.addr, ATOMIC_RELAXED) + copyDone = atomic_load_n(table.copyDone.addr, ATOMIC_RELAXED) + ok: bool + result = false + if workDone > 0: + #echo("len to copy =" & $oldLen) + #echo("copyDone + workDone = " & $copyDone & " + " & $workDone) + while not ok: + ok = atomic_compare_exchange_n(table.copyDone.addr, copyDone.addr, + copyDone + workDone, false, ATOMIC_RELAXED, ATOMIC_RELAXED) + #if ok: echo("set copyDone") + # If the copy is done we can promote this table + if copyDone + workDone >= oldLen: + # Swap new data + #echo("work is done!") + table.promote + result = true + +#------------------------------------------------------------------------------ + +proc copySlotAndCheck[K,V](table: var PConcTable[K,V], idx: int): + PConcTable[K,V] = + var + newTable = cast[PConcTable[K,V]](atomic_load_n(table.next.addr, ATOMIC_RELAXED)) + result = newTable + if newTable != nil and copySlot(idx, table, newTable): + #echo("copied a single slot, idx = " & $idx) + if checkAndPromote(table, 1): return table + + +#------------------------------------------------------------------------------ + +proc helpCopy[K,V](table: var PConcTable[K,V]): PConcTable[K,V] = + var + newTable = cast[PConcTable[K,V]](atomic_load_n(table.next.addr, ATOMIC_RELAXED)) + result = newTable + if newTable != nil: + var + oldLen = atomic_load_n(table.len.addr, ATOMIC_RELAXED) + copyDone = atomic_load_n(table.copyDone.addr, ATOMIC_RELAXED) + copyIdx = 0 + work = min(oldLen, minCopyWork) + #panicStart = -1 + workDone = 0 + if copyDone < oldLen: + var ok: bool + while not ok: + ok = atomic_compare_exchange_n(table.copyIdx.addr, copyIdx.addr, + copyIdx + work, false, ATOMIC_RELAXED, ATOMIC_RELAXED) + #echo("copy idx = ", copyIdx) + for i in 0..work-1: + var idx = (copyIdx + i) and (oldLen - 1) + if copySlot(idx, table, newTable): + workDone += 1 + if workDone > 0: + #echo("did work ", workDone, " on thread ", cast[int](myThreadID[pointer]())) + if checkAndPromote(table, workDone): return table + # In case a thread finished all the work then got stalled before promotion + if checkAndPromote(table, 0): return table + + + +#------------------------------------------------------------------------------ + +proc setVal[K,V](table: var PConcTable[K,V], key: int, val: int, + expVal: int, match: bool): int = + #echo("-try set- in table ", " key = ", (popPtr[K](key)[]), " val = ", val) + when K is TRaw: + var idx = hashInt(key) + else: + var idx = popPtr[K](key)[].hash + var + nextTable: PConcTable[K,V] + probes = 1 + # spin until we find a key slot or build and jump to next table + while true: + idx = idx and (table.len - 1) + #echo("try set idx = " & $idx & "for" & $key) + var + probedKey = NULL + openKey = atomic_compare_exchange_n(table[idx].key.addr, probedKey.addr, + key, false, ATOMIC_RELAXED, ATOMIC_RELAXED) + if openKey: + if val.isTomb: + #echo("val was tomb, bail, no reason to set an open slot to tomb") + return val + #increment used slots + #echo("found an open slot, total used = " & + #$atomic_add_fetch(table.used.addr, 1, ATOMIC_RELAXED)) + discard atomic_add_fetch(table.used.addr, 1, ATOMIC_RELAXED) + break # We found an open slot + #echo("set idx ", idx, " key = ", key, " probed = ", probedKey) + if keyEQ[K](probedKey, key): + #echo("we found the matching slot") + break # We found a matching slot + if (not(expVal != NULL and match)) and (probes >= reProbeLimit or key.isTomb): + if key.isTomb: echo("Key is Tombstone") + #if probes >= reProbeLimit: echo("Too much probing " & $probes) + #echo("try to resize") + #create next bigger table + nextTable = resize(table) + #help do some copying + #echo("help copy old table to new") + nextTable = helpCopy(table) + #now setVal in the new table instead + #echo("jumping to next table to set val") + return setVal(nextTable, key, val, expVal, match) + else: + idx += 1 + probes += 1 + # Done spinning for a new slot + var oldVal = atomic_load_n(table[idx].value.addr, ATOMIC_RELAXED) + if val == oldVal: + #echo("this val is alredy in the slot") + return oldVal + nextTable = atomic_load_n(table.next.addr, ATOMIC_SEQ_CST) + if nextTable == nil and + ((oldVal == NULL and + (probes >= reProbeLimit or table.used / table.len > 0.8)) or + (isPrime(oldVal))): + if table.used / table.len > 0.8: echo("resize because usage ratio = " & + $(table.used / table.len)) + if isPrime(oldVal): echo("old val isPrime, should be a rare mem ordering event") + nextTable = resize(table) + if nextTable != nil: + #echo("tomb old slot then set in new table") + nextTable = copySlotAndCheck(table,idx) + return setVal(nextTable, key, val, expVal, match) + # Finaly ready to add new val to table + while true: + if match and oldVal != expVal: + #echo("set failed, no match oldVal= " & $oldVal & " expVal= " & $expVal) + return oldVal + if atomic_compare_exchange_n(table[idx].value.addr, oldVal.addr, + val, false, ATOMIC_RELEASE, ATOMIC_RELAXED): + #echo("val set at table " & $cast[int](table)) + if expVal != NULL: + if (oldVal == NULL or isTomb(oldVal)) and not isTomb(val): + discard atomic_add_fetch(table.active.addr, 1, ATOMIC_RELAXED) + elif not (oldVal == NULL or isTomb(oldVal)) and isTomb(val): + discard atomic_add_fetch(table.active.addr, -1, ATOMIC_RELAXED) + if oldVal == NULL and expVal != NULL: + return setTomb(oldVal) + else: return oldVal + if isPrime(oldVal): + nextTable = copySlotAndCheck(table, idx) + return setVal(nextTable, key, val, expVal, match) + +#------------------------------------------------------------------------------ + +proc getVal[K,V](table: var PConcTable[K,V], key: int): int = + #echo("-try get- key = " & $key) + when K is TRaw: + var idx = hashInt(key) + else: + var idx = popPtr[K](key)[].hash + #echo("get idx ", idx) + var + probes = 0 + val: int + while true: + idx = idx and (table.len - 1) + var + newTable: PConcTable[K,V] # = atomic_load_n(table.next.addr, ATOMIC_ACQUIRE) + probedKey = atomic_load_n(table[idx].key.addr, ATOMIC_SEQ_CST) + if keyEQ[K](probedKey, key): + #echo("found key after ", probes+1) + val = atomic_load_n(table[idx].value.addr, ATOMIC_ACQUIRE) + if not isPrime(val): + if isTomb(val): + #echo("val was tomb but not prime") + return NULL + else: + #echo("-GotIt- idx = ", idx, " key = ", key, " val ", val ) + return val + else: + newTable = copySlotAndCheck(table, idx) + return getVal(newTable, key) + else: + #echo("probe ", probes, " idx = ", idx, " key = ", key, " found ", probedKey ) + if probes >= reProbeLimit*4 or key.isTomb: + if newTable == nil: + #echo("too many probes and no new table ", key, " ", idx ) + return NULL + else: + newTable = helpCopy(table) + return getVal(newTable, key) + idx += 1 + probes += 1 + +#------------------------------------------------------------------------------ + +#proc set*(table: var PConcTable[TRaw,TRaw], key: TRaw, val: TRaw) = +# discard setVal(table, pack(key), pack(key), NULL, false) + +#proc set*[V](table: var PConcTable[TRaw,V], key: TRaw, val: ptr V) = +# discard setVal(table, pack(key), cast[int](val), NULL, false) + +proc set*[K,V](table: var PConcTable[K,V], key: var K, val: var V) = + when not (K is TRaw): + var newKey = cast[int](copyShared(key)) + else: + var newKey = pack(key) + when not (V is TRaw): + var newVal = cast[int](copyShared(val)) + else: + var newVal = pack(val) + var oldPtr = pop(setVal(table, newKey, newVal, NULL, false)) + #echo("oldPtr = ", cast[int](oldPtr), " newPtr = ", cast[int](newPtr)) + when not (V is TRaw): + if newVal != oldPtr and oldPtr != NULL: + deallocShared(cast[ptr V](oldPtr)) + + + +proc get*[K,V](table: var PConcTable[K,V], key: var K): V = + when not (V is TRaw): + when not (K is TRaw): + return popPtr[V](getVal(table, cast[int](key.addr)))[] + else: + return popPtr[V](getVal(table, pack(key)))[] + else: + when not (K is TRaw): + return popRaw(getVal(table, cast[int](key.addr))) + else: + return popRaw(getVal(table, pack(key))) + + + + + + + + + + + +#proc `[]`[K,V](table: var PConcTable[K,V], key: K): PEntry[K,V] {.inline.} = +# getVal(table, key) + +#proc `[]=`[K,V](table: var PConcTable[K,V], key: K, val: V): PEntry[K,V] {.inline.} = +# setVal(table, key, val) + + + + + + +#Tests ---------------------------- +when isMainModule: + import locks, times, mersenne + + const + numTests = 100000 + numThreads = 10 + + + + type + TTestObj = tuple + thr: int + f0: int + f1: int + + TData = tuple[k: string,v: TTestObj] + PDataArr = array[0..numTests-1, TData] + Dict = PConcTable[string,TTestObj] + + var + thr: array[0..numThreads-1, TThread[Dict]] + + table = newLFTable[string,TTestObj](8) + rand = newMersenneTwister(2525) + + proc createSampleData(len: int): PDataArr = + #result = cast[PDataArr](allocShared0(sizeof(TData)*numTests)) + for i in 0..len-1: + result[i].k = "mark" & $(i+1) + #echo("mark" & $(i+1), " ", hash("mark" & $(i+1))) + result[i].v.thr = 0 + result[i].v.f0 = i+1 + result[i].v.f1 = 0 + #echo("key = " & $(i+1) & " Val ptr = " & $cast[int](result[i].v.addr)) + + + + proc threadProc(tp: Dict) {.thread.} = + var t = cpuTime(); + for i in 1..numTests: + var key = "mark" & $(i) + var got = table.get(key) + got.thr = cast[int](myThreadID[pointer]()) + got.f1 = got.f1 + 1 + table.set(key, got) + t = cpuTime() - t + echo t + + + var testData = createSampleData(numTests) + + for i in 0..numTests-1: + table.set(testData[i].k, testData[i].v) + + var i = 0 + while i < numThreads: + createThread(thr[i], threadProc, table) + i += 1 + + joinThreads(thr) + + + + + + var fails = 0 + + for i in 0..numTests-1: + var got = table.get(testData[i].k) + if got.f0 != i+1 or got.f1 != numThreads: + fails += 1 + echo(got) + + echo("Failed read or write = ", fails) + + + #for i in 1..numTests: + # echo(i, " = ", hashInt(i) and 8191) + + deleteConcTable(table) + + + + + + + diff --git a/lib/pure/collections/baseutils.nim b/lib/pure/collections/baseutils.nim new file mode 100644 index 0000000000..565a89ccbf --- /dev/null +++ b/lib/pure/collections/baseutils.nim @@ -0,0 +1,41 @@ + + + +#------------------------------------------------------------------------------ +## Useful Constants +const NULL* = 0 + + +#------------------------------------------------------------------------------ +## Memory Utility Functions + +proc newHeap*[T](): ptr T = + result = cast[ptr T](alloc0(sizeof(T))) + +proc copyNew*[T](x: var T): ptr T = + var + size = sizeof(T) + mem = alloc(size) + copyMem(mem, x.addr, size) + return cast[ptr T](mem) + +proc copyTo*[T](val: var T, dest: int) = + copyMem(pointer(dest), val.addr, sizeof(T)) + +proc allocType*[T](): pointer = alloc(sizeof(T)) + +proc newShared*[T](): ptr T = + result = cast[ptr T](allocShared0(sizeof(T))) + +proc copyShared*[T](x: var T): ptr T = + var + size = sizeof(T) + mem = allocShared(size) + copyMem(mem, x.addr, size) + return cast[ptr T](mem) + +#------------------------------------------------------------------------------ +## Pointer arithmetic + +proc `+`*(p: pointer, i: int): pointer {.inline.} = + cast[pointer](cast[int](p) + i) \ No newline at end of file diff --git a/lib/system/atomics.nim b/lib/system/atomics.nim index 623f8d0d2b..36185e0a89 100644 --- a/lib/system/atomics.nim +++ b/lib/system/atomics.nim @@ -9,68 +9,207 @@ # Atomic operations for Nimrod. -when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport and - not defined(windows): - proc sync_add_and_fetch(p: var int, val: int): int {. - importc: "__sync_add_and_fetch", nodecl.} - proc sync_sub_and_fetch(p: var int, val: int): int {. - importc: "__sync_sub_and_fetch", nodecl.} +when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: + + type + AtomMemModel* = enum + ATOMIC_RELAXED, + ## No barriers or synchronization. + ATOMIC_CONSUME, + ## Data dependency only for both barrier and synchronization with another thread. + ATOMIC_ACQUIRE, + ## Barrier to hoisting of code and synchronizes with release (or stronger) + ## semantic stores from another thread. + ATOMIC_RELEASE, + ## Barrier to sinking of code and synchronizes with acquire (or stronger) + ## semantic loads from another thread. + ATOMIC_ACQ_REL, + ## Full barrier in both directions and synchronizes with acquire loads + ## and release stores in another thread. + ATOMIC_SEQ_CST + ## Full barrier in both directions and synchronizes with acquire loads + ## and release stores in all threads. + + TAtomType* = TNumber|pointer|ptr|char + ## Type Class representing valid types for use with atomic procs + + proc atomic_load_n*[T: TAtomType](p: ptr T, mem: AtomMemModel): T {. + importc: "__atomic_load_n", nodecl.} + ## This proc implements an atomic load operation. It returns the contents at p. + ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_ACQUIRE, ATOMIC_CONSUME. + + proc atomic_load*[T: TAtomType](p: ptr T, ret: ptr T, mem: AtomMemModel) {. + importc: "__atomic_load", nodecl.} + ## This is the generic version of an atomic load. It returns the contents at p in ret. + + proc atomic_store_n*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel) {. + importc: "__atomic_store_n", nodecl.} + ## This proc implements an atomic store operation. It writes val at p. + ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, and ATOMIC_RELEASE. + + proc atomic_store*[T: TAtomType](p: ptr T, val: ptr T, mem: AtomMemModel) {. + importc: "__atomic_store", nodecl.} + ## This is the generic version of an atomic store. It stores the value of val at p + + proc atomic_exchange_n*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_exchange_n", nodecl.} + ## This proc implements an atomic exchange operation. It writes val at p, + ## and returns the previous contents at p. + ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_ACQUIRE, ATOMIC_RELEASE, ATOMIC_ACQ_REL + + proc atomic_exchange*[T: TAtomType](p: ptr T, val: ptr T, ret: ptr T, mem: AtomMemModel) {. + importc: "__atomic_exchange", nodecl.} + ## This is the generic version of an atomic exchange. It stores the contents at val at p. + ## The original value at p is copied into ret. + + proc atomic_compare_exchange_n*[T: TAtomType](p: ptr T, expected: ptr T, desired: T, + weak: bool, success_memmodel: AtomMemModel, failure_memmodel: AtomMemModel): bool {. + importc: "__atomic_compare_exchange_n ", nodecl.} + ## This proc implements an atomic compare and exchange operation. This compares the + ## contents at p with the contents at expected and if equal, writes desired at p. + ## If they are not equal, the current contents at p is written into expected. + ## Weak is true for weak compare_exchange, and false for the strong variation. + ## Many targets only offer the strong variation and ignore the parameter. + ## When in doubt, use the strong variation. + ## True is returned if desired is written at p and the execution is considered + ## to conform to the memory model specified by success_memmodel. There are no + ## restrictions on what memory model can be used here. False is returned otherwise, + ## and the execution is considered to conform to failure_memmodel. This memory model + ## cannot be __ATOMIC_RELEASE nor __ATOMIC_ACQ_REL. It also cannot be a stronger model + ## than that specified by success_memmodel. + + proc atomic_compare_exchange*[T: TAtomType](p: ptr T, expected: ptr T, desired: ptr T, + weak: bool, success_memmodel: AtomMemModel, failure_memmodel: AtomMemModel): bool {. + importc: "__atomic_compare_exchange_n ", nodecl.} + ## This proc implements the generic version of atomic_compare_exchange. + ## The proc is virtually identical to atomic_compare_exchange_n, except the desired + ## value is also a pointer. + + ## Perform the operation return the new value, all memory models are valid + proc atomic_add_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_add_fetch", nodecl.} + proc atomic_sub_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_sub_fetch", nodecl.} + proc atomic_or_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_or_fetch ", nodecl.} + proc atomic_and_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_and_fetch", nodecl.} + proc atomic_xor_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_xor_fetch", nodecl.} + proc atomic_nand_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_nand_fetch ", nodecl.} + + ## Perform the operation return the old value, all memory models are valid + proc atomic_fetch_add*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_add ", nodecl.} + proc atomic_fetch_sub*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_sub ", nodecl.} + proc atomic_fetch_or*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_or ", nodecl.} + proc atomic_fetch_and*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_and ", nodecl.} + proc atomic_fetch_xor*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_xor ", nodecl.} + proc atomic_fetch_nand*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_nand", nodecl.} + + proc atomic_test_and_set*(p: pointer, mem: AtomMemModel): bool {. + importc: "__atomic_test_and_set ", nodecl.} + ## This built-in function performs an atomic test-and-set operation on the byte at p. + ## The byte is set to some implementation defined nonzero “set†value and the return + ## value is true if and only if the previous contents were “setâ€. + ## All memory models are valid. + + proc atomic_clear*(p: pointer, mem: AtomMemModel) {. + importc: "__atomic_clear", nodecl.} + ## This built-in function performs an atomic clear operation at p. + ## After the operation, at p contains 0. + ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_RELEASE + + proc atomic_thread_fence*(mem: AtomMemModel) {. + importc: "__atomic_thread_fence ", nodecl.} + ## This built-in function acts as a synchronization fence between threads based + ## on the specified memory model. All memory orders are valid. + + proc atomic_signal_fence*(mem: AtomMemModel) {. + importc: "__atomic_signal_fence ", nodecl.} + ## This built-in function acts as a synchronization fence between a thread and + ## signal handlers based in the same thread. All memory orders are valid. + + proc atomic_always_lock_free*(size: int, p: pointer): bool {. + importc: "__atomic_always_lock_free ", nodecl.} + ## This built-in function returns true if objects of size bytes always generate + ## lock free atomic instructions for the target architecture. size must resolve + ## to a compile-time constant and the result also resolves to a compile-time constant. + ## ptr is an optional pointer to the object that may be used to determine alignment. + ## A value of 0 indicates typical alignment should be used. The compiler may also + ## ignore this parameter. + + proc atomic_is_lock_free*(size: int, p: pointer): bool {. + importc: "__atomic_is_lock_free ", nodecl.} + ## This built-in function returns true if objects of size bytes always generate + ## lock free atomic instructions for the target architecture. If it is not known + ## to be lock free a call is made to a runtime routine named __atomic_is_lock_free. + ## ptr is an optional pointer to the object that may be used to determine alignment. + ## A value of 0 indicates typical alignment should be used. The compiler may also + ## ignore this parameter. + + + elif defined(vcc) and hasThreadSupport: - proc sync_add_and_fetch(p: var int, val: int): int {. + proc add_and_fetch*(p: ptr int, val: int): int {. importc: "NimXadd", nodecl.} else: - proc sync_add_and_fetch(p: var int, val: int): int {.inline.} = - inc(p, val) - result = p + proc add_and_fetch*(p: ptr int, val: int): int {.inline.} = + inc(p[], val) + result = p[] -proc atomicInc(memLoc: var int, x: int = 1): int = - when hasThreadSupport: - result = sync_add_and_fetch(memLoc, x) + + + +# atomic compare and swap (CAS) funcitons to implement lock-free algorithms + +#if defined(windows) and not defined(gcc) and hasThreadSupport: +# proc InterlockedCompareExchangePointer(mem: ptr pointer, +# newValue: pointer, comparand: pointer) : pointer {.nodecl, +# importc: "InterlockedCompareExchangePointer", header:"windows.h".} + +# proc compareAndSwap*[T](mem: ptr T, +# expected: T, newValue: T): bool {.inline.}= +# ## Returns true if successfully set value at mem to newValue when value +# ## at mem == expected +# return InterlockedCompareExchangePointer(addr(mem), +# addr(newValue), addr(expected))[] == expected + +#elif not hasThreadSupport: +# proc compareAndSwap*[T](mem: ptr T, +# expected: T, newValue: T): bool {.inline.} = +# ## Returns true if successfully set value at mem to newValue when value +# ## at mem == expected +# var oldval = mem[] +# if oldval == expected: +# mem[] = newValue +# return true +# return false + + +# Some convenient functions +proc atomicInc*(memLoc: var int, x: int = 1): int = + when defined(gcc) and hasThreadSupport: + result = atomic_add_fetch(memLoc.addr, x, ATOMIC_RELAXED) else: inc(memLoc, x) result = memLoc -proc atomicDec(memLoc: var int, x: int = 1): int = - when hasThreadSupport: - when defined(sync_sub_and_fetch): - result = sync_sub_and_fetch(memLoc, x) +proc atomicDec*(memLoc: var int, x: int = 1): int = + when defined(gcc) and hasThreadSupport: + when defined(atomic_sub_fetch): + result = atomic_sub_fetch(memLoc.addr, x, ATOMIC_RELAXED) else: - result = sync_add_and_fetch(memLoc, -x) + result = atomic_add_fetch(memLoc.addr, -x, ATOMIC_RELAXED) else: dec(memLoc, x) result = memLoc -# atomic compare and swap (CAS) funcitons to implement lock-free algorithms - -when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: - proc compareAndSwap*[T: ptr|ref|pointer](mem: var T, expected: T, newValue: T): bool {.nodecl, - importc: " __sync_bool_compare_and_swap".} - ## Returns true if successfully set value at mem to newValue when value - ## at mem == expected - -elif defined(windows) and hasThreadSupport: - proc InterlockedCompareExchangePointer(mem: ptr pointer, - newValue: pointer, comparand: pointer) : pointer {.nodecl, - importc: "InterlockedCompareExchangePointer", header:"windows.h".} - - - proc compareAndSwap*[T: ptr|ref|pointer](mem: var T, - expected: T, newValue: T): bool {.inline.}= - ## Returns true if successfully set value at mem to newValue when value - ## at mem == expected - return InterlockedCompareExchangePointer(addr(mem), - newValue, expected) == expected - -elif not hasThreadSupport: - proc compareAndSwap*[T: ptr|ref|pointer](mem: var T, - expected: T, newValue: T): bool {.inline.} = - ## Returns true if successfully set value at mem to newValue when value - ## at mem == expected - var oldval = mem - if oldval == expected: - mem = newValue - return true - return false - From 7832f25abf25cbdffa483845ebfd6f774fcb8e84 Mon Sep 17 00:00:00 2001 From: Mark Flamer Date: Tue, 22 Oct 2013 15:02:54 -0700 Subject: [PATCH 009/326] Mersenne twister random number generator --- lib/pure/mersenne.nim | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lib/pure/mersenne.nim diff --git a/lib/pure/mersenne.nim b/lib/pure/mersenne.nim new file mode 100644 index 0000000000..2b12cce734 --- /dev/null +++ b/lib/pure/mersenne.nim @@ -0,0 +1,39 @@ +import unsigned + +type + TMersenneTwister* = object + mt: array[0..623, uint32] + index: int + +proc newMersenneTwister*(seed: int): TMersenneTwister = + result.index = 0 + result.mt[0]= uint32(seed) + for i in 1..623'u32: + result.mt[i]= (0x6c078965'u32 * (result.mt[i-1] xor (result.mt[i-1] shr 30'u32)) + i) + +proc generateNumbers(m: var TMersenneTwister) = + for i in 0..623: + var y = (m.mt[i] and 0x80000000'u32) + (m.mt[(i+1) mod 624] and 0x7fffffff'u32) + m.mt[i] = m.mt[(i+397) mod 624] xor uint32(y shr 1'u32) + if (y mod 2'u32) != 0: + m.mt[i] = m.mt[i] xor 0x9908b0df'u32 + +proc getNum*(m: var TMersenneTwister): int = + if m.index == 0: + generateNumbers(m) + var y = m.mt[m.index] + y = y xor (y shr 11'u32) + y = y xor ((7'u32 shl y) and 0x9d2c5680'u32) + y = y xor ((15'u32 shl y) and 0xefc60000'u32) + y = y xor (y shr 18'u32) + m.index = (m.index+1) mod 624 + return int(y) + + + +# Test +when isMainModule: + var mt = newMersenneTwister(2525) + + for i in 0..99: + echo mt.getNum \ No newline at end of file From 6ea538cec3f2da832873252d0ec3810b9dbfede4 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 25 Oct 2013 13:30:34 +0200 Subject: [PATCH 010/326] computed goto now works; some progress on the new VM --- compiler/ccgstmts.nim | 19 +++++++++++++++++-- compiler/vm.nim | 17 ++++++++++++++--- compiler/vmdeps.nim | 2 +- tests/compile/tcomputedgoto.nim | 31 ++++++++++++++++--------------- todo.txt | 7 +++++-- 5 files changed, 53 insertions(+), 23 deletions(-) diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 75cabf4143..d71d65cebf 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -322,8 +322,20 @@ proc genComputedGoto(p: BProc; n: PNode) = gotoArray.appf("&&TMP$#, ", (id+i).toRope) gotoArray.appf("&&TMP$#};$n", (id+arraySize).toRope) line(p, cpsLocals, gotoArray) + + let topBlock = p.blocks.len-1 + let oldBody = p.blocks[topBlock].sections[cpsStmts] + p.blocks[topBlock].sections[cpsStmts] = nil + for j in casePos+1 .. = 0) of opcSetLenSeq, - opcSwap, opcIsNil, opcOf, + opcSwap, opcIsNil, opcCast, opcReset: internalError(c.debug[pc], "too implement") of opcNBindSym: @@ -868,6 +873,10 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra].strVal = typ.typeToString(preferExported) inc pc +proc fixType(result, n: PNode) {.inline.} = + # XXX do it deeply for complex values + if result.typ.isNil: result.typ = n.typ + proc execute(c: PCtx, start: int): PNode = var tos = PStackFrame(prc: nil, comesFrom: 0, next: nil) newSeq(tos.slots, c.prc.maxSlots) @@ -885,6 +894,7 @@ proc evalExpr*(c: PCtx, n: PNode): PNode = let start = genExpr(c, n) assert c.code[start].opcode != opcEof result = execute(c, start) + fixType(result, n) # for now we share the 'globals' environment. XXX Coming soon: An API for # storing&loading the 'globals' environment to get what a component system @@ -928,6 +938,7 @@ proc evalConstExprAux(module, prc: PSym, n: PNode, mode: TEvalMode): PNode = newSeq(tos.slots, c.prc.maxSlots) for i in 0 .. Date: Fri, 25 Oct 2013 19:04:10 -0700 Subject: [PATCH 011/326] fix for Issue #629 Recursive generic types not working --- compiler/types.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/types.nim b/compiler/types.nim index 66748c3081..eeb68aefac 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -825,6 +825,8 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = of dcEqOrDistinctOf: while a.kind == tyDistinct: a = a.sons[0] if a.kind != b.kind: return false + if x.Kind == tyGenericInst or y.Kind == tyGenericInst: + c.cmp = dcEqIgnoreDistinct case a.Kind of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCString, tyInt..tyBigNum, tyStmt: From b4e25a6372ffed291ccbba6874723baa55fa0bf9 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 29 Oct 2013 01:07:59 +0100 Subject: [PATCH 012/326] new VM is getting stable --- compiler/astalgo.nim | 2 +- compiler/vm.nim | 280 ++++++++++++++++++++++++++---------------- compiler/vmdef.nim | 4 +- compiler/vmgen.nim | 21 ++-- koch.nim | 9 ++ lib/core/macros.nim | 8 +- lib/pure/strutils.nim | 2 +- todo.txt | 4 +- 8 files changed, 206 insertions(+), 124 deletions(-) diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 6c48dd00fa..4f869cfcac 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -216,7 +216,7 @@ proc makeYamlString*(s: string): PRope = const MaxLineLength = 64 result = nil var res = "\"" - for i in countup(0, len(s) - 1): + for i in countup(0, if s.isNil: -1 else: (len(s)-1)): if (i + 1) mod MaxLineLength == 0: add(res, '\"') add(res, "\n") diff --git a/compiler/vm.nim b/compiler/vm.nim index ad390e53ca..49314e899f 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -68,6 +68,19 @@ proc myreset(n: PNode) = reset(n[]) n.info = oldInfo +proc skipMeta(n: PNode): PNode = (if n.kind != nkMetaNode: n else: n.sons[0]) + +proc setMeta(n, child: PNode) = + assert n.kind == nkMetaNode + let child = child.skipMeta + if n.sons.isNil: n.sons = @[child] + else: n.sons[0] = child + +proc uast(n: PNode): PNode {.inline.} = + # "underlying ast" + assert n.kind == nkMetaNode + n.sons[0] + template ensureKind(k: expr) {.immediate, dirty.} = if regs[ra].kind != k: myreset(regs[ra]) @@ -98,28 +111,32 @@ template decodeBx(k: expr) {.immediate, dirty.} = template move(a, b: expr) = system.shallowCopy(a, b) # XXX fix minor 'shallowCopy' overloading bug in compiler -when false: - proc asgnRef(x, y: PNode) = +proc moveConst(x, y: PNode) = + if x.kind != y.kind: myreset(x) x.kind = y.kind - x.typ = y.typ - case x.kind - of nkCharLit..nkInt64Lit: x.intVal = y.intVal - of nkFloatLit..nkFloat64Lit: x.floatVal = y.floatVal - of nkStrLit..nkTripleStrLit: x.strVal = y.strVal - of nkIdent: x.ident = y.ident - of nkSym: x.sym = y.sym - else: - if x.kind notin {nkEmpty..nkNilLit}: - move(x.sons, y.sons) -else: - # this seems to be the best way to model the reference semantics - # of PNimrodNode: - template asgnRef(x, y: expr) = x = y + x.typ = y.typ + case x.kind + of nkCharLit..nkInt64Lit: x.intVal = y.intVal + of nkFloatLit..nkFloat64Lit: x.floatVal = y.floatVal + of nkStrLit..nkTripleStrLit: move(x.strVal, y.strVal) + of nkIdent: x.ident = y.ident + of nkSym: x.sym = y.sym + of nkMetaNode: + if x.sons.isNil: x.sons = @[y.sons[0]] + else: x.sons[0] = y.sons[0] + else: + if x.kind notin {nkEmpty..nkNilLit}: + move(x.sons, y.sons) + +# this seems to be the best way to model the reference semantics +# of PNimrodNode: +template asgnRef(x, y: expr) = moveConst(x, y) proc asgnComplex(x, y: PNode) = - myreset(x) - x.kind = y.kind + if x.kind != y.kind: + myreset(x) + x.kind = y.kind x.typ = y.typ case x.kind of nkCharLit..nkInt64Lit: x.intVal = y.intVal @@ -127,6 +144,9 @@ proc asgnComplex(x, y: PNode) = of nkStrLit..nkTripleStrLit: x.strVal = y.strVal of nkIdent: x.ident = y.ident of nkSym: x.sym = y.sym + of nkMetaNode: + if x.sons.isNil: x.sons = @[y.sons[0]] + else: x.sons[0] = y.sons[0] else: if x.kind notin {nkEmpty..nkNilLit}: let y = y.copyTree @@ -286,16 +306,17 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcAsgnRef: asgnRef(regs[ra], regs[instr.regB]) of opcWrGlobalRef: - asgnRef(c.globals.sons[instr.regBx-wordExcess-1], regs[ra]) + asgnRef(c.globals.sons[instr.regBx-wordExcess-1], regs[ra].skipMeta) of opcWrGlobal: - asgnComplex(c.globals.sons[instr.regBx-wordExcess-1], regs[ra]) + asgnComplex(c.globals.sons[instr.regBx-wordExcess-1], regs[ra].skipMeta) of opcLdArr: # a = b[c] let rb = instr.regB let rc = instr.regC let idx = regs[rc].intVal # XXX what if the array is not 0-based? -> codegen should insert a sub - regs[ra] = regs[rb].sons[idx.int] + assert regs[rb].kind != nkMetaNode + asgnComplex(regs[ra], regs[rb].sons[idx.int]) of opcLdStrIdx: decodeBC(nkIntLit) let idx = regs[rc].intVal @@ -305,12 +326,12 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = let rb = instr.regB let rc = instr.regC let idx = regs[rb].intVal - asgnComplex(regs[ra].sons[idx.int], regs[rc]) + asgnComplex(regs[ra].sons[idx.int], regs[rc].skipMeta) of opcWrArrRef: let rb = instr.regB let rc = instr.regC let idx = regs[rb].intVal - asgnRef(regs[ra].sons[idx.int], regs[rc]) + asgnRef(regs[ra].sons[idx.int], regs[rc].skipMeta) of opcLdObj: # a = b.c let rb = instr.regB @@ -322,11 +343,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # a.b = c let rb = instr.regB let rc = instr.regC - asgnComplex(regs[ra].sons[rb], regs[rc]) + asgnComplex(regs[ra].sons[rb], regs[rc].skipMeta) of opcWrObjRef: let rb = instr.regB let rc = instr.regC - asgnRef(regs[ra].sons[rb], regs[rc]) + asgnRef(regs[ra].sons[rb], regs[rc].skipMeta) of opcWrStrIdx: decodeBC(nkStrLit) let idx = regs[rb].intVal.int @@ -341,6 +362,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = if regs[rb].kind == nkNilLit: stackTrace(c, tos, pc, errNilAccess) assert regs[rb].kind == nkRefTy + # XXX this is not correct regs[ra] = regs[rb].sons[0] of opcAddInt: decodeBC(nkIntLit) @@ -357,8 +379,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcLenSeq: decodeBImm(nkIntLit) #assert regs[rb].kind == nkBracket - # also used by mNLen - regs[ra].intVal = regs[rb].len - imm + # also used by mNLen: + regs[ra].intVal = regs[rb].skipMeta.len - imm of opcLenStr: decodeBImm(nkIntLit) assert regs[rb].kind == nkStrLit @@ -366,6 +388,12 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcIncl: decodeB(nkCurly) if not inSet(regs[ra], regs[rb]): addSon(regs[ra], copyTree(regs[rb])) + of opcInclRange: + decodeBC(nkCurly) + var r = newNode(nkRange) + r.add regs[rb] + r.add regs[rc] + addSon(regs[ra], r.copyTree) of opcExcl: decodeB(nkCurly) var b = newNodeIT(nkCurly, regs[rb].info, regs[rb].typ) @@ -456,6 +484,9 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra].intVal = ord((regs[rb].kind == nkNilLit and regs[rc].kind == nkNilLit) or regs[rb].sons == regs[rc].sons) + of opcEqNimrodNode: + decodeBC(nkIntLit) + regs[ra].intVal = ord(regs[rb].uast == regs[rc].uast) of opcXor: decodeBC(nkIntLit) regs[ra].intVal = ord(regs[rb].intVal != regs[rc].intVal) @@ -529,7 +560,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = writeln(stdout, "") of opcContainsSet: decodeBC(nkIntLit) - regs[ra].intVal = Ord(inSet(regs[rb], regs[rc])) + regs[ra].intVal = ord(inSet(regs[rb], regs[rc])) of opcSubStr: decodeBC(nkStrLit) inc pc @@ -581,18 +612,18 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = let rbx = instr.regBx - wordExcess - 1 # -1 for the following 'inc pc' inc pc, rbx of opcBranch: - # we know the next instruction is a 'jmp': + # we know the next instruction is a 'fjmp': let branch = c.constants[instr.regBx-wordExcess] var cond = false for j in countup(0, sonsLen(branch) - 2): if overlap(regs[ra], branch.sons[j]): cond = true break - assert c.code[pc+1].opcode == opcJmp + assert c.code[pc+1].opcode == opcFJmp inc pc # we skip this instruction so that the final 'inc(pc)' skips # the following jump - if cond: + if not cond: let instr2 = c.code[pc] let rbx = instr2.regBx - wordExcess - 1 # -1 for the following 'inc pc' inc pc, rbx @@ -646,7 +677,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = let typ = c.types[instr.regBx - wordExcess] regs[ra] = getNullValue(typ, c.debug[pc]) of opcLdConst: - regs[ra] = c.constants.sons[instr.regBx - wordExcess] + let rb = instr.regBx - wordExcess + if regs[ra].isNil: + regs[ra] = copyTree(c.constants.sons[rb]) + else: + moveConst(regs[ra], c.constants.sons[rb]) of opcAsgnConst: let rb = instr.regBx - wordExcess if regs[ra].isNil: @@ -661,7 +696,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = asgnComplex(regs[ra], c.globals.sons[rb]) of opcRepr: decodeB(nkStrLit) - regs[ra].strVal = renderTree(regs[rb], {renderNoComments}) + regs[ra].strVal = renderTree(regs[rb].skipMeta, {renderNoComments}) of opcQuit: if c.mode in {emRepl, emStatic}: Message(c.debug[pc], hintQuitCalled) @@ -674,62 +709,71 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcOf: decodeBC(nkIntLit) regs[ra].intVal = ord(inheritanceDiff(regs[rb].typ, regs[rc].typ) >= 0) - of opcSetLenSeq, - opcSwap, opcIsNil, - opcCast, opcReset: + of opcSetLenSeq: + decodeB(nkBracket) + let newLen = regs[rb].getOrdValue.int + setLen(regs[ra].sons, newLen) + of opcSwap, opcCast, opcReset: internalError(c.debug[pc], "too implement") + of opcIsNil: + decodeB(nkIntLit) + regs[ra].intVal = ord(regs[rb].skipMeta.kind == nkNilLit) of opcNBindSym: # trivial implementation: - let rb = instr.regB - regs[ra] = regs[rb].sons[1] + decodeB(nkMetaNode) + setMeta(regs[ra], regs[rb].skipMeta.sons[1]) of opcNChild: - let rb = instr.regB - let rc = instr.regC - regs[ra] = regs[rb].sons[regs[rc].intVal.int] + decodeBC(nkMetaNode) + setMeta(regs[ra], regs[rb].uast.sons[regs[rc].intVal.int]) of opcNSetChild: - let rb = instr.regB - let rc = instr.regC - regs[ra].sons[regs[rb].intVal.int] = regs[rc] + decodeBC(nkMetaNode) + regs[ra].uast.sons[regs[rb].intVal.int] = regs[rc].uast of opcNAdd: - declBC() - regs[rb].add(regs[rc]) - regs[ra] = regs[rb] + decodeBC(nkMetaNode) + var u = regs[rb].uast + u.add(regs[rc].uast) + setMeta(regs[ra], u) of opcNAddMultiple: - declBC() + decodeBC(nkMetaNode) let x = regs[rc] + var u = regs[rb].uast # XXX can be optimized: - for i in 0.. ord(high(TNodeKind)): internalError(c.debug[pc], - "request to create a NimNode with invalid kind") - regs[ra] = newNodeI(TNodeKind(int(k)), - if regs[rc].kind == nkNilLit: c.debug[pc] else: regs[rc].info) + "request to create a NimNode of invalid kind") + let cc = regs[rc].skipMeta + setMeta(regs[ra], newNodeI(TNodeKind(int(k)), + if cc.kind == nkNilLit: c.debug[pc] else: cc.info)) of opcNCopyNimNode: - let rb = instr.regB - regs[ra] = copyNode(regs[rb]) + decodeB(nkMetaNode) + setMeta(regs[ra], copyNode(regs[rb])) of opcNCopyNimTree: - let rb = instr.regB - regs[ra] = copyTree(regs[rb]) + decodeB(nkMetaNode) + setMeta(regs[ra], copyTree(regs[rb])) of opcNDel: - let rb = instr.regB - let rc = instr.regC + decodeBC(nkMetaNode) + let bb = regs[rb].intVal.int for i in countup(0, regs[rc].intVal.int-1): - delSon(regs[ra], regs[rb].intVal.int) + delSon(regs[ra].uast, bb) of opcGenSym: - let k = regs[instr.regB].intVal - let b = regs[instr.regC] - let name = if b.strVal.len == 0: ":tmp" else: b.strVal + decodeBC(nkMetaNode) + let k = regs[rb].intVal + let name = if regs[rc].strVal.len == 0: ":tmp" else: regs[rc].strVal if k < 0 or k > ord(high(TSymKind)): internalError(c.debug[pc], "request to create symbol of invalid kind") - regs[ra] = newSymNode(newSym(k.TSymKind, name.getIdent, c.module, - c.debug[pc])) - incl(regs[ra].sym.flags, sfGenSym) + var sym = newSym(k.TSymKind, name.getIdent, c.module, c.debug[pc]) + incl(sym.flags, sfGenSym) + setMeta(regs[ra], newSymNode(sym)) of opcTypeTrait: # XXX only supports 'name' for now; we can use regC to encode the # type trait operation @@ -894,7 +948,9 @@ proc evalExpr*(c: PCtx, n: PNode): PNode = let start = genExpr(c, n) assert c.code[start].opcode != opcEof result = execute(c, start) - fixType(result, n) + if not result.isNil: + result = result.skipMeta + fixType(result, n) # for now we share the 'globals' environment. XXX Coming soon: An API for # storing&loading the 'globals' environment to get what a component system @@ -949,6 +1005,9 @@ proc evalStaticExpr*(module: PSym, e: PNode, prc: PSym): PNode = proc setupMacroParam(x: PNode): PNode = result = x if result.kind in {nkHiddenSubConv, nkHiddenStdConv}: result = result.sons[1] + let y = result + result = newNode(nkMetaNode) + result.add y var evalMacroCounter: int @@ -979,4 +1038,7 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = result = rawExecute(c, start, tos) if cyclicTree(result): GlobalError(n.info, errCyclicTree) dec(evalMacroCounter) + if result != nil: + internalAssert result.kind == nkMetaNode + result = result.sons[0] c.callsite = nil diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index fabce58d7b..f91b8a8215 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -51,11 +51,11 @@ type opcLenSeq, opcLenStr, - opcIncl, opcExcl, opcCard, opcMulInt, opcDivInt, opcModInt, + opcIncl, opcInclRange, opcExcl, opcCard, opcMulInt, opcDivInt, opcModInt, opcAddFloat, opcSubFloat, opcMulFloat, opcDivFloat, opcShrInt, opcShlInt, opcBitandInt, opcBitorInt, opcBitxorInt, opcAddu, opcSubu, opcMulu, opcDivu, opcModu, opcEqInt, opcLeInt, opcLtInt, opcEqFloat, - opcLeFloat, opcLtFloat, opcLeu, opcLtu, opcEqRef, opcXor, + opcLeFloat, opcLtFloat, opcLeu, opcLtu, opcEqRef, opcEqNimrodNode, opcXor, opcNot, opcUnaryMinusInt, opcUnaryMinusFloat, opcBitnotInt, opcEqStr, opcLeStr, opcLtStr, opcEqSet, opcLeSet, opcLtSet, opcMulSet, opcPlusSet, opcMinusSet, opcSymdiffSet, opcConcatStr, diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 4296609cb4..40116de1db 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -277,9 +277,9 @@ proc genAndOr(c: PCtx; n: PNode; opc: TOpcode; dest: var TDest) = # asgn dest, b # L1: if dest < 0: dest = getTemp(c, n.typ) - c.gen(n.sons[0], dest) - let L1 = c.xjmp(n, opc) c.gen(n.sons[1], dest) + let L1 = c.xjmp(n, opc, dest) + c.gen(n.sons[2], dest) c.patch(L1) proc rawGenLiteral(c: PCtx; n: PNode): int = @@ -758,7 +758,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = of mStrToIdent: genUnaryABC(c, n, dest, opcStrToIdent) of mIdentToStr: genUnaryABC(c, n, dest, opcIdentToStr) of mEqIdent: genBinaryABC(c, n, dest, opcEqIdent) - of mEqNimrodNode: genBinaryABC(c, n, dest, opcEqRef) + of mEqNimrodNode: genBinaryABC(c, n, dest, opcEqNimrodNode) of mNLineInfo: genUnaryABC(c, n, dest, opcNLineInfo) of mNHint: unused(n, dest) @@ -1040,9 +1040,16 @@ proc genSetConstr(c: PCtx, n: PNode, dest: var TDest) = if dest < 0: dest = c.getTemp(n.typ) c.gABx(n, opcLdNull, dest, c.genType(n.typ)) for x in n: - let a = c.genx(x) - c.gABC(n, opcIncl, dest, a) - c.freeTemp(a) + if x.kind == nkRange: + let a = c.genx(x.sons[0]) + let b = c.genx(x.sons[1]) + c.gABC(n, opcInclRange, dest, a, b) + c.freeTemp(b) + c.freeTemp(a) + else: + let a = c.genx(x) + c.gABC(n, opcIncl, dest, a) + c.freeTemp(a) proc genObjConstr(c: PCtx, n: PNode, dest: var TDest) = if dest < 0: dest = c.getTemp(n.typ) @@ -1297,8 +1304,6 @@ proc genProc(c: PCtx; s: PSym): int = c.gABC(body, opcEof, eofInstr.regA) s.position = c.prc.maxSlots c.prc = oldPrc - #if s.name.s == "xmlConstructor": - # echoCode(c) else: c.prc.maxSlots = s.position result = x.intVal.int diff --git a/koch.nim b/koch.nim index 97fcf5b2c9..26dde73eab 100644 --- a/koch.nim +++ b/koch.nim @@ -45,6 +45,7 @@ Possible Commands: tests run the testsuite update updates nimrod to the latest version from github (compile koch with -d:withUpdate to enable) + temp options creates a temporary compiler for testing Boot options: -d:release produce a release version of the compiler -d:tinyc include the Tiny C backend (not supported on Windows) @@ -268,6 +269,13 @@ proc tests(args: string) = exec(getCurrentDir() / "tests/tester".exe & " run") exec(getCurrentDir() / "tests/tester".exe & " merge") +proc temp(args: string) = + var output = "compiler" / "nimrod".exe + var finalDest = "bin" / "nimrod".exe + exec("nimrod c compiler" / "nimrod") + copyExe(output, finalDest) + if args.len > 0: exec(finalDest & " " & args) + proc showHelp() = quit(HelpText % [NimrodVersion & repeatChar(44-len(NimrodVersion)), CompileDate, CompileTime]) @@ -291,6 +299,7 @@ of cmdArgument: update(op.cmdLineRest) else: quit "this Koch has not been compiled with -d:withUpdate" + of "temp": temp(op.cmdLineRest) else: showHelp() of cmdEnd: showHelp() diff --git a/lib/core/macros.nim b/lib/core/macros.nim index fc93a157d6..0ac3d9b1be 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -158,7 +158,13 @@ proc `intVal=`*(n: PNimrodNode, val: biggestInt) {.magic: "NSetIntVal".} proc `floatVal=`*(n: PNimrodNode, val: biggestFloat) {.magic: "NSetFloatVal".} proc `symbol=`*(n: PNimrodNode, val: PNimrodSymbol) {.magic: "NSetSymbol".} proc `ident=`*(n: PNimrodNode, val: TNimrodIdent) {.magic: "NSetIdent".} -proc `typ=`*(n: PNimrodNode, typ: typedesc) {.magic: "NSetType".} +#proc `typ=`*(n: PNimrodNode, typ: typedesc) {.magic: "NSetType".} +# this is not sound! Unfortunately forbidding 'typ=' is not enough, as you +# can easily do: +# let bracket = semCheck([1, 2]) +# let fake = semCheck(2.0) +# bracket[0] = fake # constructs a mixed array with ints and floats! + proc `strVal=`*(n: PNimrodNode, val: string) {.magic: "NSetStrVal".} proc newNimNode*(kind: TNimrodNodeKind, diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index a4aa815787..98d1f16d2c 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -93,7 +93,7 @@ proc normalize*(s: string): string {.noSideEffect, procvar, var j = 0 for i in 0..len(s) - 1: if s[i] in {'A'..'Z'}: - result[j] = Chr(Ord(s[i]) + (Ord('a') - Ord('A'))) + result[j] = chr(ord(s[i]) + (ord('a') - ord('A'))) inc j elif s[i] != '_': result[j] = s[i] diff --git a/todo.txt b/todo.txt index 1dcaa8ff6e..1fb8748a66 100644 --- a/todo.txt +++ b/todo.txt @@ -2,8 +2,8 @@ version 0.9.4 ============= - new VM: - - get rid of nkIntLit..nkUInt64Lit, - nkFloatLit..nkFloat128Lit, nkStrLit..nkTripleStrLit? + compiling htmlgen (txmlgen) makes the compiler go into an infinite loop + tcntseq - new VM requires lambda lifting - implement overflow checking - implement the FFI From be452636239d1508b867e2b0624f3f07f7867e0b Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 29 Oct 2013 16:47:40 +0100 Subject: [PATCH 013/326] jump optimizer works --- compiler/vmdef.nim | 2 ++ compiler/vmgen.nim | 27 ++++++++++++++++----------- koch.nim | 2 +- todo.txt | 4 +--- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index f91b8a8215..16ba1ed8ea 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -201,3 +201,5 @@ template regA*(x: TInstr): TRegister {.immediate.} = TRegister(x.uint32 shr 8'u3 template regB*(x: TInstr): TRegister {.immediate.} = TRegister(x.uint32 shr 16'u32 and 0xff'u32) template regC*(x: TInstr): TRegister {.immediate.} = TRegister(x.uint32 shr 24'u32) template regBx*(x: TInstr): int {.immediate.} = (x.uint32 shr 16'u32).int + +template jmpDiff*(x: TInstr): int {.immediate.} = regBx(x) - wordExcess diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 40116de1db..175cae2f50 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1243,12 +1243,11 @@ proc optimizeJumps(c: PCtx; start: int) = case opc of opcTJmp, opcFJmp: var reg = c.code[i].regA - var d = i + c.code[i].regBx - var iters = maxIterations - while iters > 0: + var d = i + c.code[i].jmpDiff + for iters in countdown(maxIterations, 0): case c.code[d].opcode of opcJmp: - d = d + c.code[d].regBx + d = d + c.code[d].jmpDiff of opcTJmp, opcFJmp: if c.code[d].regA != reg: break # tjmp x, 23 @@ -1256,22 +1255,26 @@ proc optimizeJumps(c: PCtx; start: int) = # tjmp x, 12 # -- we know 'x' is true, and so can jump to 12+13: if c.code[d].opcode == opc: - d = d + c.code[d].regBx + d = d + c.code[d].jmpDiff else: # tjmp x, 23 # fjmp x, 22 # We know 'x' is true so skip to the next instruction: d = d + 1 else: break - dec iters - c.finalJumpTarget(i, d - i) + if d != i + c.code[i].jmpDiff: + c.finalJumpTarget(i, d - i) of opcJmp: - var d = i + c.code[i].regBx + var d = i + c.code[i].jmpDiff var iters = maxIterations while c.code[d].opcode == opcJmp and iters > 0: - d = d + c.code[d].regBx + d = d + c.code[d].jmpDiff dec iters - c.finalJumpTarget(i, d - i) + if c.code[d].opcode == opcRet: + # optimize 'jmp to ret' to 'ret' here + c.code[i] = c.code[d] + elif d != i + c.code[i].jmpDiff: + c.finalJumpTarget(i, d - i) else: discard proc genProc(c: PCtx; s: PSym): int = @@ -1300,9 +1303,11 @@ proc genProc(c: PCtx; s: PSym): int = # generate final 'return' statement: c.gABC(body, opcRet) c.patch(procStart) - c.gABC(body, opcEof, eofInstr.regA) + c.optimizeJumps(result) s.position = c.prc.maxSlots + #if s.name.s == "temp": + # c.echoCode c.prc = oldPrc else: c.prc.maxSlots = s.position diff --git a/koch.nim b/koch.nim index 26dde73eab..6e0d5bdf2e 100644 --- a/koch.nim +++ b/koch.nim @@ -271,7 +271,7 @@ proc tests(args: string) = proc temp(args: string) = var output = "compiler" / "nimrod".exe - var finalDest = "bin" / "nimrod".exe + var finalDest = "bin" / "nimrod_temp".exe exec("nimrod c compiler" / "nimrod") copyExe(output, finalDest) if args.len > 0: exec(finalDest & " " & args) diff --git a/todo.txt b/todo.txt index 1fb8748a66..1a75ab66f4 100644 --- a/todo.txt +++ b/todo.txt @@ -2,12 +2,10 @@ version 0.9.4 ============= - new VM: - compiling htmlgen (txmlgen) makes the compiler go into an infinite loop - tcntseq + - tcntseq fails - new VM requires lambda lifting - implement overflow checking - implement the FFI - - test and activate the jump optimizer - make 'bind' default for templates and introduce 'mixin' - special rule for ``[]=`` From 4330c986db6b0a5023a64444bbd64dc0b585b628 Mon Sep 17 00:00:00 2001 From: Mark Flamer Date: Tue, 29 Oct 2013 20:48:37 -0700 Subject: [PATCH 014/326] better fix for Issue #629 Recursive generic types not working --- compiler/types.nim | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/compiler/types.nim b/compiler/types.nim index eeb68aefac..058eb77ed6 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -808,11 +808,11 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = if containsOrIncl(c, a, b): return true proc sameFlags(a, b: PType): bool {.inline.} = - result = eqTypeFlags*a.flags == eqTypeFlags*b.flags - + result = eqTypeFlags*a.flags == eqTypeFlags*b.flags + if x == y: return true var a = skipTypes(x, {tyGenericInst}) - var b = skipTypes(y, {tyGenericInst}) + var b = skipTypes(y, {tyGenericInst}) assert(a != nil) assert(b != nil) if a.kind != b.kind: @@ -824,9 +824,7 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = if a.kind != b.kind: return false of dcEqOrDistinctOf: while a.kind == tyDistinct: a = a.sons[0] - if a.kind != b.kind: return false - if x.Kind == tyGenericInst or y.Kind == tyGenericInst: - c.cmp = dcEqIgnoreDistinct + if a.kind != b.kind: return false case a.Kind of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCString, tyInt..tyBigNum, tyStmt: @@ -839,15 +837,20 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = result = sameObjectStructures(a, b, c) and sameFlags(a, b) of tyDistinct: CycleCheck() - if c.cmp == dcEq: result = sameTypeAux(a, b, c) and sameFlags(a, b) - else: result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) + if c.cmp == dcEq: + result = false + if a.sym != nil and b.sym != nil: + if a.sym.name == b.sym.name: + result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) + else: + result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) of tyEnum, tyForward, tyProxy: # XXX generic enums do not make much sense, but require structural checking result = a.id == b.id and sameFlags(a, b) of tyTuple: CycleCheck() result = sameTuple(a, b, c) and sameFlags(a, b) - of tyGenericInst: + of tyGenericInst: result = sameTypeAux(lastSon(a), lastSon(b), c) of tyTypeDesc: if c.cmp == dcEqIgnoreDistinct: result = false @@ -860,7 +863,7 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr, tyArray, tyProc, tyConst, tyMutable, tyVarargs, tyIter, tyOrdinal, tyTypeClass: - CycleCheck() + CycleCheck() result = sameChildrenAux(a, b, c) and sameFlags(a, b) if result and (a.kind == tyProc): result = a.callConv == b.callConv @@ -869,7 +872,7 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = result = SameTypeOrNilAux(a.sons[0], b.sons[0], c) and SameValue(a.n.sons[0], b.n.sons[0]) and SameValue(a.n.sons[1], b.n.sons[1]) - of tyNone: result = false + of tyNone: result = false proc sameType*(x, y: PType): bool = var c = initSameTypeClosure() From 6901a8cb13d19a3d251911af240c5f2a54809eba Mon Sep 17 00:00:00 2001 From: onionhammer Date: Wed, 30 Oct 2013 09:08:05 -0500 Subject: [PATCH 015/326] Added base64 encode overload for arrays of integers/bytes --- lib/pure/base64.nim | 242 +++++++++++++++++++++++--------------------- 1 file changed, 126 insertions(+), 116 deletions(-) diff --git a/lib/pure/base64.nim b/lib/pure/base64.nim index 6853135513..4e59a6ca63 100644 --- a/lib/pure/base64.nim +++ b/lib/pure/base64.nim @@ -1,117 +1,127 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2010 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -## This module implements a base64 encoder and decoder. - -const - cb64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" - -proc encode*(s: string, lineLen = 75, newLine="\13\10"): string = - ## encodes `s` into base64 representation. After `lineLen` characters, a - ## `newline` is added. - var total = ((len(s) + 2) div 3) * 4 - var numLines = (total + lineLen - 1) div lineLen +# +# +# Nimrod's Runtime Library +# (c) Copyright 2010 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## This module implements a base64 encoder and decoder. + +const + cb64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + +template encodeInternal(s: expr, lineLen: int, newLine: string): stmt {.immediate.} = + ## encodes `s` into base64 representation. After `lineLen` characters, a + ## `newline` is added. + var total = ((len(s) + 2) div 3) * 4 + var numLines = (total + lineLen - 1) div lineLen if numLines > 0: inc(total, (numLines-1) * newLine.len) - - result = newString(total) - var i = 0 - var r = 0 - var currLine = 0 - while i < s.len - 2: - var a = ord(s[i]) - var b = ord(s[i+1]) - var c = ord(s[i+2]) - result[r] = cb64[a shr 2] - result[r+1] = cb64[((a and 3) shl 4) or ((b and 0xF0) shr 4)] - result[r+2] = cb64[((b and 0x0F) shl 2) or ((c and 0xC0) shr 6)] - result[r+3] = cb64[c and 0x3F] - inc(r, 4) - inc(i, 3) - inc(currLine, 4) - if currLine >= lineLen and i != s.len-2: - for x in items(newLine): - result[r] = x - inc(r) - currLine = 0 - - if i < s.len-1: - var a = ord(s[i]) - var b = ord(s[i+1]) - result[r] = cb64[a shr 2] - result[r+1] = cb64[((a and 3) shl 4) or ((b and 0xF0) shr 4)] - result[r+2] = cb64[((b and 0x0F) shl 2)] - result[r+3] = '=' - if r+4 != result.len: - setLen(result, r+4) - elif i < s.len: - var a = ord(s[i]) - result[r] = cb64[a shr 2] - result[r+1] = cb64[(a and 3) shl 4] - result[r+2] = '=' - result[r+3] = '=' - if r+4 != result.len: - setLen(result, r+4) - else: - assert(r == result.len) - -proc decodeByte(b: char): int {.inline.} = - case b - of '+': result = ord('>') - of '0'..'9': result = ord(b) + 4 - of 'A'..'Z': result = ord(b) - ord('A') - of 'a'..'z': result = ord(b) - 71 - else: result = 63 - -proc decode*(s: string): string = - ## decodes a string in base64 representation back into its original form. - ## Whitespace is skipped. - const Whitespace = {' ', '\t', '\v', '\r', '\l', '\f'} - var total = ((len(s) + 3) div 4) * 3 - # total is an upper bound, as we will skip arbitrary whitespace: - result = newString(total) - - var i = 0 - var r = 0 - while true: - while s[i] in Whitespace: inc(i) - if i < s.len-3: - var a = s[i].decodeByte - var b = s[i+1].decodeByte - var c = s[i+2].decodeByte - var d = s[i+3].decodeByte - - result[r] = chr((a shl 2) and 0xff or ((b shr 4) and 0x03)) - result[r+1] = chr((b shl 4) and 0xff or ((c shr 2) and 0x0F)) - result[r+2] = chr((c shl 6) and 0xff or (d and 0x3F)) - inc(r, 3) - inc(i, 4) - else: break - assert i == s.len - # adjust the length: - if i > 0 and s[i-1] == '=': - dec(r) - if i > 1 and s[i-2] == '=': dec(r) - setLen(result, r) - -when isMainModule: - assert encode("leasure.") == "bGVhc3VyZS4=" - assert encode("easure.") == "ZWFzdXJlLg==" - assert encode("asure.") == "YXN1cmUu" - assert encode("sure.") == "c3VyZS4=" - - const longText = """Man is distinguished, not only by his reason, but by this - singular passion from other animals, which is a lust of the mind, - that by a perseverance of delight in the continued and indefatigable - generation of knowledge, exceeds the short vehemence of any carnal - pleasure.""" - const tests = ["", "abc", "xyz", "man", "leasure.", "sure.", "easure.", - "asure.", longText] - for t in items(tests): - assert decode(encode(t)) == t - + + result = newString(total) + var i = 0 + var r = 0 + var currLine = 0 + while i < s.len - 2: + var a = ord(s[i]) + var b = ord(s[i+1]) + var c = ord(s[i+2]) + result[r] = cb64[a shr 2] + result[r+1] = cb64[((a and 3) shl 4) or ((b and 0xF0) shr 4)] + result[r+2] = cb64[((b and 0x0F) shl 2) or ((c and 0xC0) shr 6)] + result[r+3] = cb64[c and 0x3F] + inc(r, 4) + inc(i, 3) + inc(currLine, 4) + if currLine >= lineLen and i != s.len-2: + for x in items(newLine): + result[r] = x + inc(r) + currLine = 0 + + if i < s.len-1: + var a = ord(s[i]) + var b = ord(s[i+1]) + result[r] = cb64[a shr 2] + result[r+1] = cb64[((a and 3) shl 4) or ((b and 0xF0) shr 4)] + result[r+2] = cb64[((b and 0x0F) shl 2)] + result[r+3] = '=' + if r+4 != result.len: + setLen(result, r+4) + elif i < s.len: + var a = ord(s[i]) + result[r] = cb64[a shr 2] + result[r+1] = cb64[(a and 3) shl 4] + result[r+2] = '=' + result[r+3] = '=' + if r+4 != result.len: + setLen(result, r+4) + else: + assert(r == result.len) + +proc encode*[T:TInteger|char](s: openarray[T], lineLen = 75, newLine="\13\10"): string = + ## encodes `s` into base64 representation. After `lineLen` characters, a + ## `newline` is added. + encodeInternal(s, lineLen, newLine) + +proc encode*(s: string, lineLen = 75, newLine="\13\10"): string = + ## encodes `s` into base64 representation. After `lineLen` characters, a + ## `newline` is added. + encodeInternal(s, lineLen, newLine) + +proc decodeByte(b: char): int {.inline.} = + case b + of '+': result = ord('>') + of '0'..'9': result = ord(b) + 4 + of 'A'..'Z': result = ord(b) - ord('A') + of 'a'..'z': result = ord(b) - 71 + else: result = 63 + +proc decode*(s: string): string = + ## decodes a string in base64 representation back into its original form. + ## Whitespace is skipped. + const Whitespace = {' ', '\t', '\v', '\r', '\l', '\f'} + var total = ((len(s) + 3) div 4) * 3 + # total is an upper bound, as we will skip arbitrary whitespace: + result = newString(total) + + var i = 0 + var r = 0 + while true: + while s[i] in Whitespace: inc(i) + if i < s.len-3: + var a = s[i].decodeByte + var b = s[i+1].decodeByte + var c = s[i+2].decodeByte + var d = s[i+3].decodeByte + + result[r] = chr((a shl 2) and 0xff or ((b shr 4) and 0x03)) + result[r+1] = chr((b shl 4) and 0xff or ((c shr 2) and 0x0F)) + result[r+2] = chr((c shl 6) and 0xff or (d and 0x3F)) + inc(r, 3) + inc(i, 4) + else: break + assert i == s.len + # adjust the length: + if i > 0 and s[i-1] == '=': + dec(r) + if i > 1 and s[i-2] == '=': dec(r) + setLen(result, r) + +when isMainModule: + assert encode("leasure.") == "bGVhc3VyZS4=" + assert encode("easure.") == "ZWFzdXJlLg==" + assert encode("asure.") == "YXN1cmUu" + assert encode("sure.") == "c3VyZS4=" + + const longText = """Man is distinguished, not only by his reason, but by this + singular passion from other animals, which is a lust of the mind, + that by a perseverance of delight in the continued and indefatigable + generation of knowledge, exceeds the short vehemence of any carnal + pleasure.""" + const tests = ["", "abc", "xyz", "man", "leasure.", "sure.", "easure.", + "asure.", longText] + for t in items(tests): + assert decode(encode(t)) == t + From f8206cb357d71d1aa274dddb8f2976c396c7de4b Mon Sep 17 00:00:00 2001 From: Mark Flamer Date: Wed, 30 Oct 2013 16:08:54 -0700 Subject: [PATCH 016/326] better better fix for Issue #629 Recursive generic types not working --- compiler/types.nim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/types.nim b/compiler/types.nim index 058eb77ed6..4dec9ea2fc 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -838,11 +838,10 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = of tyDistinct: CycleCheck() if c.cmp == dcEq: - result = false - if a.sym != nil and b.sym != nil: - if a.sym.name == b.sym.name: - result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) - else: + if sameFlags(a, b): + IfFastObjectTypeCheckFailed(a, b): + result = sameTypeAux(a.sons[0], b.sons[0], c) + else: result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) of tyEnum, tyForward, tyProxy: # XXX generic enums do not make much sense, but require structural checking From eb72857ea229aa1a65f9dc0962840ede2a9e68ed Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 31 Oct 2013 22:30:59 +0100 Subject: [PATCH 017/326] added $ for oids --- lib/pure/oids.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pure/oids.nim b/lib/pure/oids.nim index 0fd1d8cd25..fbe0dda958 100644 --- a/lib/pure/oids.nim +++ b/lib/pure/oids.nim @@ -1,7 +1,7 @@ # # # Nimrod's Runtime Library -# (c) Copyright 2012 Andreas Rumpf +# (c) Copyright 2013 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -52,6 +52,10 @@ proc oidToString*(oid: TOid, str: cstring) = inc(i) str[24] = '\0' +proc `$`*(oid: TOid): string = + result = newString(25) + oidToString(oid, result) + var incr: int fuzz: int32 From f73cec7f0198fdebe118585b05557e4a53d08aea Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 31 Oct 2013 22:32:27 +0100 Subject: [PATCH 018/326] GC: even more stress testing --- doc/gc.txt | 2 +- lib/system/alloc.nim | 15 ++++++++++++--- lib/system/gc.nim | 21 ++++++++++++++++----- lib/system/mmdisp.nim | 1 + 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/doc/gc.txt b/doc/gc.txt index 854f9ce2af..13498afaa1 100644 --- a/doc/gc.txt +++ b/doc/gc.txt @@ -13,7 +13,7 @@ Introduction This document describes how the GC works and how to tune it for (soft) `realtime systems`:idx:. -The basic algorithm is *Deferrent Reference Counting* with cycle detection. +The basic algorithm is *Deferred Reference Counting* with cycle detection. References on the stack are not counted for better performance (and easier C code generation). The GC **never** scans the whole heap but it may scan the delta-subgraph of the heap that changed since its last run. diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 744c26d36c..2bab792126 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -520,11 +520,18 @@ proc allocInv(a: TMemRegion): bool = for s in low(a.freeSmallChunks)..high(a.freeSmallChunks): var c = a.freeSmallChunks[s] while c != nil: - if c.next == c: return false - if c.size != s * MemAlign: return false + if c.next == c: + echo "[SYSASSERT] c.next == c" + return false + if c.size != s * MemAlign: + echo "[SYSASSERT] c.size != s * MemAlign" + return false var it = c.freeList while it != nil: - if it.zeroField != 0: return false + if it.zeroField != 0: + echo "[SYSASSERT] it.zeroField != 0" + cprintf("%ld %p\n", it.zeroField, it) + return false it = it.next c = c.next result = true @@ -591,6 +598,7 @@ proc rawAlloc(a: var TMemRegion, requestedSize: int): pointer = add(a, a.root, cast[TAddress](result), cast[TAddress](result)+%size) sysAssert(isAccessible(a, result), "rawAlloc 14") sysAssert(allocInv(a), "rawAlloc: end") + when logAlloc: cprintf("rawAlloc: %ld %p\n", requestedSize, result) proc rawAlloc0(a: var TMemRegion, requestedSize: int): pointer = result = rawAlloc(a, requestedSize) @@ -638,6 +646,7 @@ proc rawDealloc(a: var TMemRegion, p: pointer) = del(a, a.root, cast[int](addr(c.data))) freeBigChunk(a, c) sysAssert(allocInv(a), "rawDealloc: end") + when logAlloc: cprintf("rawDealloc: %p\n", p) proc isAllocatedPtr(a: TMemRegion, p: pointer): bool = if isAccessible(a, p): diff --git a/lib/system/gc.nim b/lib/system/gc.nim index c5d4d2aa2d..48705db96a 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -9,7 +9,7 @@ # Garbage Collector # -# The basic algorithm is *Deferrent Reference Counting* with cycle detection. +# The basic algorithm is *Deferred Reference Counting* with cycle detection. # This is achieved by combining a Deutsch-Bobrow garbage collector # together with Christoper's partial mark-sweep garbage collector. # @@ -407,12 +407,17 @@ proc addNewObjToZCT(res: PCell, gch: var TGcHeap) {.inline.} = return add(gch.zct, res) +{.push stackTrace: off, profiler:off.} +proc gcInvariant*(msg: string) = + sysAssert(allocInv(gch.region), msg) +{.pop.} + proc rawNewObj(typ: PNimType, size: int, gch: var TGcHeap): pointer = # generates a new object and sets its reference counter to 0 + sysAssert(allocInv(gch.region), "rawNewObj begin") acquire(gch) gcAssert(typ.kind in {tyRef, tyString, tySequence}, "newObj: 1") collectCT(gch) - sysAssert(allocInv(gch.region), "rawNewObj begin") var res = cast[PCell](rawAlloc(gch.region, size + sizeof(TCell))) gcAssert((cast[TAddress](res) and (MemAlign-1)) == 0, "newObj: 2") # now it is buffered in the ZCT @@ -517,7 +522,9 @@ proc growObj(old: pointer, newsize: int, gch: var TGcHeap): pointer = writeCell("growObj new cell", res) gcTrace(ol, csZctFreed) gcTrace(res, csAllocated) - when reallyDealloc: rawDealloc(gch.region, ol) + when reallyDealloc: + sysAssert(allocInv(gch.region), "growObj before dealloc") + rawDealloc(gch.region, ol) else: sysAssert(ol.typ != nil, "growObj: 5") zeroMem(ol, sizeof(TCell)) @@ -537,7 +544,9 @@ proc freeCyclicCell(gch: var TGcHeap, c: PCell) = prepareDealloc(c) gcTrace(c, csCycFreed) when logGC: writeCell("cycle collector dealloc cell", c) - when reallyDealloc: rawDealloc(gch.region, c) + when reallyDealloc: + sysAssert(allocInv(gch.region), "free cyclic cell") + rawDealloc(gch.region, c) else: gcAssert(c.typ != nil, "freeCyclicCell") zeroMem(c, sizeof(TCell)) @@ -910,7 +919,9 @@ proc collectZCT(gch: var TGcHeap): bool = # access invalid memory. This is done by prepareDealloc(): prepareDealloc(c) forAllChildren(c, waZctDecRef) - when reallyDealloc: rawDealloc(gch.region, c) + when reallyDealloc: + sysAssert(allocInv(gch.region), "collectZCT: rawDealloc") + rawDealloc(gch.region, c) else: sysAssert(c.typ != nil, "collectZCT 2") zeroMem(c, sizeof(TCell)) diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index c9801abade..118272ee31 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -28,6 +28,7 @@ const reallyOsDealloc = true coalescRight = true coalescLeft = true + logAlloc = false type PPointer = ptr pointer From 45f9c5b9426460427d5523128d4662cfc0f8392f Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 3 Nov 2013 10:16:31 +0100 Subject: [PATCH 019/326] Adds link to stackoverflow nimrod tag in support section. --- readme.md | 8 +++++--- readme.txt | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index f74f812839..c49e24f4e3 100644 --- a/readme.md +++ b/readme.md @@ -47,9 +47,11 @@ The above steps can be performed on Windows in a similar fashion, the instead of ``build.sh``. ## Getting help -A [forum](http://forum.nimrod-code.org/) is available if you have any questions, -and you can also get help in the IRC channel -on [Freenode](irc://irc.freenode.net/nimrod) in #nimrod. +A [forum](http://forum.nimrod-code.org/) is available if you have any +questions, and you can also get help in the IRC channel on +[Freenode](irc://irc.freenode.net/nimrod) in #nimrod. If you ask questions on +[StackOverflow use the nimrod +tag](http://stackoverflow.com/questions/tagged/nimrod). ## License The compiler and the standard library are licensed under the MIT license, diff --git a/readme.txt b/readme.txt index f74f812839..c49e24f4e3 100644 --- a/readme.txt +++ b/readme.txt @@ -47,9 +47,11 @@ The above steps can be performed on Windows in a similar fashion, the instead of ``build.sh``. ## Getting help -A [forum](http://forum.nimrod-code.org/) is available if you have any questions, -and you can also get help in the IRC channel -on [Freenode](irc://irc.freenode.net/nimrod) in #nimrod. +A [forum](http://forum.nimrod-code.org/) is available if you have any +questions, and you can also get help in the IRC channel on +[Freenode](irc://irc.freenode.net/nimrod) in #nimrod. If you ask questions on +[StackOverflow use the nimrod +tag](http://stackoverflow.com/questions/tagged/nimrod). ## License The compiler and the standard library are licensed under the MIT license, From 7b1ebe896c80e966110d93a3fb1a9fc95be4f4b1 Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Sun, 3 Nov 2013 13:01:21 -0600 Subject: [PATCH 020/326] a few typos --- doc/tut1.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/tut1.txt b/doc/tut1.txt index 0cc9b05c11..5c1cdb52e5 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -610,7 +610,7 @@ allow to silently throw away a return value: discard yes("May I ask a pointless question?") -The return value can be ignored implicitely if the called proc/iterator has +The return value can be ignored implicitly if the called proc/iterator has been declared with the ``discardable`` pragma: .. code-block:: nimrod @@ -1077,7 +1077,7 @@ can also be used to include elements (and ranges of elements): TCharSet = set[char] var x: TCharSet - x = {'a'..'z', '0'..'9'} # This constructs a set that conains the + x = {'a'..'z', '0'..'9'} # This constructs a set that contains the # letters from 'a' to 'z' and the digits # from '0' to '9' @@ -1201,7 +1201,7 @@ to specify a range from zero to the specified index minus one: Sequences --------- `Sequences`:idx: are similar to arrays but of dynamic length which may change -during runtime (like strings). Since sequences are resizeable they are always +during runtime (like strings). Since sequences are resizable they are always allocated on the heap and garbage collected. Sequences are always indexed with an ``int`` starting at position 0. @@ -1547,7 +1547,7 @@ exported symbols. An alternative that only imports listed symbols is the Include statement ----------------- -The `include`:idx: statement does something fundametally different than +The `include`:idx: statement does something fundamentally different than importing a module: it merely includes the contents of a file. The ``include`` statement is useful to split up a large module into several files: From 9061b8961eb5cefd31eba9314a5932f35f524eac Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 5 Nov 2013 21:55:46 +0200 Subject: [PATCH 021/326] failing test for static params --- tests/run/tstaticparams.nim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/run/tstaticparams.nim b/tests/run/tstaticparams.nim index 2327483563..f2d6e1dd65 100644 --- a/tests/run/tstaticparams.nim +++ b/tests/run/tstaticparams.nim @@ -10,6 +10,10 @@ type TBar[T; I: expr[int]] = object data: array[I, T] + TA1[T; I: expr[int]] = array[I, T] + TA2[T; I: expr[int]] = array[0..I, T] + TA3[T; I: expr[int]] = array[I-1, T] + proc takeFoo(x: TFoo) = echo "abracadabra" echo TFoo.Val @@ -20,3 +24,8 @@ takeFoo(x) var y: TBar[float, 4] echo high(y.data) +var + t1: TA1 + t2: TA2 + t3: TA3 + From 27ec76dd3a6e3690e8bb0813a9267172ee19b34d Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 6 Nov 2013 08:37:20 +0100 Subject: [PATCH 022/326] VM now supports lambda lifting --- compiler/ast.nim | 3 +- compiler/lambdalifting.nim | 4 ++- compiler/transf.nim | 5 +--- compiler/vm.nim | 60 ++++++++++++++++++++++++++++---------- compiler/vmgen.nim | 27 ++++++++++++----- todo.txt | 1 - 6 files changed, 71 insertions(+), 29 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 2a7d8a5512..9d85e8ff26 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -357,6 +357,7 @@ type nfSem # node has been checked for semantics nfDelegate # the call can use a delegator nfExprCall # this is an attempt to call a regular expression + nfIsRef # this node is a 'ref' node; used for the VM TNodeFlags* = set[TNodeFlag] TTypeFlag* = enum # keep below 32 for efficiency reasons (now: 23) @@ -785,7 +786,7 @@ const ExportableSymKinds* = {skVar, skConst, skProc, skMethod, skType, skIterator, skMacro, skTemplate, skConverter, skEnumField, skLet, skStub} PersistentNodeFlags*: TNodeFlags = {nfBase2, nfBase8, nfBase16, - nfAllConst, nfDelegate} + nfAllConst, nfDelegate, nfIsRef} namePos* = 0 patternPos* = 1 # empty except for term rewriting macros genericParamsPos* = 2 diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 96eb3a5f44..11188267d9 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -207,7 +207,7 @@ proc newCall(a, b: PSym): PNode = proc addHiddenParam(routine: PSym, param: PSym) = var params = routine.ast.sons[paramsPos] - param.position = params.len + param.position = params.len-1 addSon(params, newSymNode(param)) incl(routine.typ.flags, tfCapturesEnv) #echo "produced environment: ", param.id, " for ", routine.name.s @@ -549,6 +549,8 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = if x != nil: n.sons[i] = x proc liftLambdas*(fn: PSym, body: PNode): PNode = + # XXX gCmd == cmdCompileToJS does not suffice! The compiletime stuff needs + # the transformation even when compiling to JS ... if body.kind == nkEmpty or gCmd == cmdCompileToJS: # ignore forward declaration: result = body diff --git a/compiler/transf.nim b/compiler/transf.nim index 206c21c3d0..77642a3b85 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -735,12 +735,9 @@ proc transformBody*(module: PSym, n: PNode, prc: PSym): PNode = if nfTransf in n.flags or prc.kind in {skTemplate}: result = n else: - #when useEffectSystem: trackProc(prc, n) var c = openTransf(module, "") result = processTransf(c, n, prc) - if prc.kind != skMacro: - # XXX no closures yet for macros: - result = liftLambdas(prc, result) + result = liftLambdas(prc, result) if prc.kind == skIterator and prc.typ.callConv == ccClosure: result = lambdalifting.liftIterator(prc, result) incl(result.flags, nfTransf) diff --git a/compiler/vm.nim b/compiler/vm.nim index 49314e899f..c70f8b41e9 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -133,6 +133,27 @@ proc moveConst(x, y: PNode) = # of PNimrodNode: template asgnRef(x, y: expr) = moveConst(x, y) +proc copyValue(src: PNode): PNode = + if src == nil or nfIsRef in src.flags: + return src + result = newNode(src.kind) + result.info = src.info + result.typ = src.typ + result.flags = src.flags * PersistentNodeFlags + when defined(useNodeIds): + if result.id == nodeIdToDebug: + echo "COMES FROM ", src.id + case src.Kind + of nkCharLit..nkUInt64Lit: result.intVal = src.intVal + of nkFloatLit..nkFloat128Lit: result.floatVal = src.floatVal + of nkSym: result.sym = src.sym + of nkIdent: result.ident = src.ident + of nkStrLit..nkTripleStrLit: result.strVal = src.strVal + else: + newSeq(result.sons, sonsLen(src)) + for i in countup(0, sonsLen(src) - 1): + result.sons[i] = copyValue(src.sons[i]) + proc asgnComplex(x, y: PNode) = if x.kind != y.kind: myreset(x) @@ -149,7 +170,7 @@ proc asgnComplex(x, y: PNode) = else: x.sons[0] = y.sons[0] else: if x.kind notin {nkEmpty..nkNilLit}: - let y = y.copyTree + let y = y.copyValue for i in countup(0, sonsLen(y) - 1): addSon(x, y.sons[i]) template getstr(a: expr): expr = @@ -306,9 +327,9 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcAsgnRef: asgnRef(regs[ra], regs[instr.regB]) of opcWrGlobalRef: - asgnRef(c.globals.sons[instr.regBx-wordExcess-1], regs[ra].skipMeta) + asgnRef(c.globals.sons[instr.regBx-wordExcess-1], regs[ra]) of opcWrGlobal: - asgnComplex(c.globals.sons[instr.regBx-wordExcess-1], regs[ra].skipMeta) + asgnComplex(c.globals.sons[instr.regBx-wordExcess-1], regs[ra]) of opcLdArr: # a = b[c] let rb = instr.regB @@ -326,12 +347,12 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = let rb = instr.regB let rc = instr.regC let idx = regs[rb].intVal - asgnComplex(regs[ra].sons[idx.int], regs[rc].skipMeta) + asgnComplex(regs[ra].sons[idx.int], regs[rc]) of opcWrArrRef: let rb = instr.regB let rc = instr.regC let idx = regs[rb].intVal - asgnRef(regs[ra].sons[idx.int], regs[rc].skipMeta) + asgnRef(regs[ra].sons[idx.int], regs[rc]) of opcLdObj: # a = b.c let rb = instr.regB @@ -343,11 +364,16 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # a.b = c let rb = instr.regB let rc = instr.regC - asgnComplex(regs[ra].sons[rb], regs[rc].skipMeta) + #if regs[ra].isNil or regs[ra].sons.isNil or rb >= len(regs[ra]): + # debug regs[ra] + # debug regs[rc] + # echo "RB ", rb + # internalError(c.debug[pc], "argl") + asgnComplex(regs[ra].sons[rb], regs[rc]) of opcWrObjRef: let rb = instr.regB let rc = instr.regC - asgnRef(regs[ra].sons[rb], regs[rc].skipMeta) + asgnRef(regs[ra].sons[rb], regs[rc]) of opcWrStrIdx: decodeBC(nkStrLit) let idx = regs[rb].intVal.int @@ -580,7 +606,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # dest = call regStart, n; where regStart = fn, arg1, ... let rb = instr.regB let rc = instr.regC - let prc = regs[rb].sym + let isClosure = regs[rb].kind == nkPar + let prc = if not isClosure: regs[rb].sym else: regs[rb].sons[0].sym let newPc = compile(c, prc) #echo "new pc ", newPc, " calling: ", prc.name.s var newFrame = PStackFrame(prc: prc, comesFrom: pc, next: tos) @@ -590,8 +617,10 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # pass every parameter by var (the language definition allows this): for i in 1 .. rc-1: newFrame.slots[i] = regs[rb+i] + if isClosure: + newFrame.slots[rc] = regs[rb].sons[1] # allocate the temporaries: - for i in rc .. ord(high(TNodeKind)): + if k < 0 or k > ord(high(TNodeKind)) or k == ord(nkMetaNode): internalError(c.debug[pc], "request to create a NimNode of invalid kind") let cc = regs[rc].skipMeta setMeta(regs[ra], newNodeI(TNodeKind(int(k)), if cc.kind == nkNilLit: c.debug[pc] else: cc.info)) + regs[ra].sons[0].flags.incl nfIsRef of opcNCopyNimNode: decodeB(nkMetaNode) setMeta(regs[ra], copyNode(regs[rb])) @@ -1006,6 +1036,7 @@ proc setupMacroParam(x: PNode): PNode = result = x if result.kind in {nkHiddenSubConv, nkHiddenStdConv}: result = result.sons[1] let y = result + y.flags.incl nfIsRef result = newNode(nkMetaNode) result.add y @@ -1039,6 +1070,5 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = if cyclicTree(result): GlobalError(n.info, errCyclicTree) dec(evalMacroCounter) if result != nil: - internalAssert result.kind == nkMetaNode - result = result.sons[0] + result = result.skipMeta c.callsite = nil diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 175cae2f50..332184e0d3 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -948,8 +948,15 @@ proc getNullValue(typ: PType, info: TLineInfo): PNode = of tyFloat..tyFloat128: result = newNodeIt(nkFloatLit, info, t) of tyVar, tyPointer, tyPtr, tyCString, tySequence, tyString, tyExpr, - tyStmt, tyTypeDesc, tyProc, tyRef: + tyStmt, tyTypeDesc, tyRef: result = newNodeIT(nkNilLit, info, t) + of tyProc: + if t.callConv != ccClosure: + result = newNodeIT(nkNilLit, info, t) + else: + result = newNodeIT(nkPar, info, t) + result.add(newNodeIT(nkNilLit, info, t)) + result.add(newNodeIT(nkNilLit, info, t)) of tyObject: result = newNodeIT(nkPar, info, t) getNullValueAux(t.n, result) @@ -1071,7 +1078,8 @@ proc genObjConstr(c: PCtx, n: PNode, dest: var TDest) = proc genTupleConstr(c: PCtx, n: PNode, dest: var TDest) = if dest < 0: dest = c.getTemp(n.typ) - var idx = getTemp(c, getSysType(tyInt)) + c.gABx(n, opcLdNull, dest, c.genType(n.typ)) + # XXX x = (x.old, 22) produces wrong code ... stupid self assignments for i in 0.. = 0 and c.code[last].opcode == opcEof: @@ -1299,6 +1306,11 @@ proc genProc(c: PCtx; s: PSym): int = c.prc = p # iterate over the parameters and allocate space for them: genParams(c, s.typ.n) + if tfCapturesEnv in s.typ.flags: + #let env = s.ast.sons[paramsPos].lastSon.sym + #assert env.position == 2 + c.prc.slots[c.prc.maxSlots] = (inUse: true, kind: slotFixedLet) + inc c.prc.maxSlots gen(c, body) # generate final 'return' statement: c.gABC(body, opcRet) @@ -1306,8 +1318,9 @@ proc genProc(c: PCtx; s: PSym): int = c.gABC(body, opcEof, eofInstr.regA) c.optimizeJumps(result) s.position = c.prc.maxSlots - #if s.name.s == "temp": + #if s.name.s == "innerProc": # c.echoCode + # echo renderTree(body) c.prc = oldPrc else: c.prc.maxSlots = s.position diff --git a/todo.txt b/todo.txt index 1a75ab66f4..94b3d51350 100644 --- a/todo.txt +++ b/todo.txt @@ -3,7 +3,6 @@ version 0.9.4 - new VM: - tcntseq fails - - new VM requires lambda lifting - implement overflow checking - implement the FFI From 4cda0861f507c414bfd622a1f759353c2c623941 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 7 Nov 2013 00:25:54 +0100 Subject: [PATCH 023/326] tcnstseq works again --- compiler/lambdalifting.nim | 2 ++ compiler/sem.nim | 5 +++++ compiler/semstmts.nim | 4 +++- compiler/vm.nim | 2 +- todo.txt | 1 - 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 11188267d9..dd48a0bc3f 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -207,6 +207,8 @@ proc newCall(a, b: PSym): PNode = proc addHiddenParam(routine: PSym, param: PSym) = var params = routine.ast.sons[paramsPos] + # -1 is correct here as param.position is 0 based but we have at position 0 + # some nkEffect node: param.position = params.len-1 addSon(params, newSymNode(param)) incl(routine.typ.flags, tfCapturesEnv) diff --git a/compiler/sem.nim b/compiler/sem.nim index 89f87acaa7..ee3df9f6a4 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -187,6 +187,11 @@ proc semConstExpr(c: PContext, n: PNode): PNode = LocalError(e.info, errConstExprExpected) # error correction: result = e + else: + # recompute the types as 'eval' isn't guaranteed to construct types nor + # that the types are sound: + result = semExprWithType(c, result) + result = fitNode(c, e.typ, result) include hlo, seminst, semcall diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 4fc69043bf..4411029899 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -421,7 +421,9 @@ proc semConst(c: PContext, n: PNode): PNode = def = fitRemoveHiddenConv(c, typ, def) else: typ = def.typ - if typ == nil: continue + if typ == nil: + LocalError(a.sons[2].info, errConstExprExpected) + continue if not typeAllowed(typ, skConst): LocalError(a.info, errXisNoType, typeToString(typ)) continue diff --git a/compiler/vm.nim b/compiler/vm.nim index c70f8b41e9..1596e4220f 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -959,7 +959,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = proc fixType(result, n: PNode) {.inline.} = # XXX do it deeply for complex values - if result.typ.isNil: result.typ = n.typ + #if result.typ.isNil: result.typ = n.typ proc execute(c: PCtx, start: int): PNode = var tos = PStackFrame(prc: nil, comesFrom: 0, next: nil) diff --git a/todo.txt b/todo.txt index 94b3d51350..91df38a146 100644 --- a/todo.txt +++ b/todo.txt @@ -2,7 +2,6 @@ version 0.9.4 ============= - new VM: - - tcntseq fails - implement overflow checking - implement the FFI From 0ff1ba0a6da48cf5710f82dbfdbc1654da25598b Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Fri, 8 Nov 2013 12:20:45 +0100 Subject: [PATCH 024/326] Links algorithm module from library index. --- doc/lib.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/lib.txt b/doc/lib.txt index 1b004aa9d1..92a4a7c83c 100644 --- a/doc/lib.txt +++ b/doc/lib.txt @@ -64,6 +64,8 @@ Core Collections and algorithms -------------------------- +* `algorithm `_ + Implements some common generic algorithms like sort or binary search. * `tables `_ Nimrod hash table support. Contains tables, ordered tables and count tables. * `sets `_ From 31dd66acbf53b619c6b15a49fe80bffa4a44b3fd Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 13 Nov 2013 02:24:08 +0200 Subject: [PATCH 025/326] support for multiple test variables and var qualifiers in user-defined type classes --- compiler/ast.nim | 2 -- compiler/parser.nim | 15 ++++++++++++++- compiler/semexprs.nim | 4 ++-- compiler/semtypes.nim | 3 +-- compiler/sigmatch.nim | 21 +++++++++++++++++---- lib/system/gc2.nim | 3 +-- 6 files changed, 35 insertions(+), 13 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 2a7d8a5512..5a5d87d061 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -712,7 +712,6 @@ type # -1 means that the size is unkwown align*: int # the type's alignment requirements loc*: TLoc - testeeName*: PIdent # the test variable in user-defined type classes TPair*{.final.} = object key*, val*: PObject @@ -1088,7 +1087,6 @@ proc assignType(dest, src: PType) = dest.size = src.size dest.align = src.align dest.destructor = src.destructor - dest.testeeName = src.testeeName # this fixes 'type TLock = TSysLock': if src.sym != nil: if dest.sym != nil: diff --git a/compiler/parser.nim b/compiler/parser.nim index e8439466ab..fd51b04ecd 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -1624,10 +1624,23 @@ proc parseObject(p: var TParser): PNode = return addSon(result, parseObjectPart(p)) +proc parseTypeClassParam(p: var TParser): PNode = + if p.tok.tokType == tkVar: + getTok(p) + result = newNode(nkVarTy) + result.addSon(p.parseSymbol) + else: + result = p.parseSymbol + proc parseTypeClass(p: var TParser): PNode = result = newNodeP(nkTypeClassTy, p) getTok(p) - addSon(result, p.parseSymbol) + var args = newNode(nkArgList) + addSon(result, args) + addSon(args, p.parseTypeClassParam) + while p.tok.TokType == tkComma: + getTok(p) + addSon(args, p.parseTypeClassParam) if p.tok.tokType == tkCurlyDotLe and p.validInd: addSon(result, parsePragma(p)) else: diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 47e07d402f..fdc050260b 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -299,7 +299,7 @@ proc semOf(c: PContext, n: PNode): PNode = n.typ = getSysType(tyBool) result = n -proc IsOpImpl(c: PContext, n: PNode): PNode = +proc isOpImpl(c: PContext, n: PNode): PNode = InternalAssert n.sonsLen == 3 and n[1].kind == nkSym and n[1].sym.kind == skType and n[2].kind in {nkStrLit..nkTripleStrLit, nkType} @@ -353,7 +353,7 @@ proc semIs(c: PContext, n: PNode): PNode = let t1 = n[1].typ.sons[0] # BUGFIX: don't evaluate this too early: ``T is void`` - if not containsGenericType(t1): result = IsOpImpl(c, n) + if not containsGenericType(t1): result = isOpImpl(c, n) proc semOpAux(c: PContext, n: PNode) = const flags = {efDetermineType} diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index b9893d0370..92f47f5854 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -876,8 +876,7 @@ proc freshType(res, prev: PType): PType {.inline.} = proc semTypeClass(c: PContext, n: PNode, prev: PType): PType = # if n.sonsLen == 0: return newConstraint(c, tyTypeClass) result = newOrPrevType(tyTypeClass, prev, c) - result.testeeName = considerAcc(n[0]) - result.n = n[3] + result.n = n let pragmas = n[1] diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 318acc660d..78ae61d0f4 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -751,11 +751,24 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, # pushInfoContext(arg.info) openScope(c) - var testee = newSym(skParam, f.testeeName, f.sym, f.sym.info) - testee.typ = a - addDecl(c, testee) + for param in f.n[0]: + var + dummyName: PNode + dummyType: PType + + if param.kind == nkVarTy: + dummyName = param[0] + dummyType = makeVarType(c, a) + else: + dummyName = param + dummyType = a - for stmt in f.n: + InternalAssert dummyName.kind == nkIdent + var dummyParam = newSym(skParam, dummyName.ident, f.sym, f.sym.info) + dummyParam.typ = dummyType + addDecl(c, dummyParam) + + for stmt in f.n[3]: var e = c.semTryExpr(c, copyTree(stmt)) if e == nil: let expStr = renderTree(stmt, {renderNoComments}) diff --git a/lib/system/gc2.nim b/lib/system/gc2.nim index 05c2913719..31c99a601c 100644 --- a/lib/system/gc2.nim +++ b/lib/system/gc2.nim @@ -387,8 +387,7 @@ template `--`(rc: TRefCount): expr = rc <% rcIncrement template `--` (rc: TRefCount, heapType: THeapType): expr = - (when heapType == SharedHeap: atomicDec(rc, rcIncrement) <% rcIncrement - else: --rc) + (when heapType == SharedHeap: atomicDec(rc, rcIncrement) <% rcIncrement else: --rc) template doDecRef(cc: PCell, heapType = LocalHeap, From b5965d05a200dc4eaa62de2ee379b631952be554 Mon Sep 17 00:00:00 2001 From: Erik O'Leary Date: Wed, 13 Nov 2013 13:20:45 -0600 Subject: [PATCH 026/326] Added timestamp to TIRCEvent --- lib/pure/irc.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pure/irc.nim b/lib/pure/irc.nim index 74ad7e26a9..ee85d9c691 100644 --- a/lib/pure/irc.nim +++ b/lib/pure/irc.nim @@ -98,6 +98,7 @@ type params*: seq[string] ## Parameters of the IRC message origin*: string ## The channel/user that this msg originated from raw*: string ## Raw IRC message + timestamp*: TTime ## UNIX epoch time the message was received proc send*(irc: PIRC, message: string, sendImmediately = false) = ## Sends ``message`` as a raw command. It adds ``\c\L`` for you. @@ -160,9 +161,10 @@ proc isNumber(s: string): bool = result = i == s.len and s.len > 0 proc parseMessage(msg: string): TIRCEvent = - result.typ = EvMsg - result.cmd = MUnknown - result.raw = msg + result.typ = EvMsg + result.cmd = MUnknown + result.raw = msg + result.timestamp = times.getTime() var i = 0 # Process the prefix if msg[i] == ':': From d77370694c213e6a5fd13421fabc2d201bf0c22d Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Thu, 14 Nov 2013 12:32:35 -0500 Subject: [PATCH 027/326] Prevent lambdas from crashing if given implicit generic parameters. --- compiler/semstmts.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index ed6787a167..3752739bf5 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -879,8 +879,9 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode = openScope(c) if n.sons[genericParamsPos].kind != nkEmpty: illFormedAst(n) # process parameters: - if n.sons[paramsPos].kind != nkEmpty: - semParamList(c, n.sons[ParamsPos], nil, s) + if n.sons[paramsPos].kind != nkEmpty: + var gp = newNodeI(nkGenericParams, n.info) + semParamList(c, n.sons[ParamsPos], gp, s) ParamsTypeCheck(c, s.typ) else: s.typ = newTypeS(tyProc, c) From 1a6742e651f65ed2d2b2584b7c6c634a485b9cac Mon Sep 17 00:00:00 2001 From: Erik O'Leary Date: Fri, 15 Nov 2013 10:47:25 -0600 Subject: [PATCH 028/326] Fixed http header parsing issue If second half of http header line was empty, server would crash with EInvalidIndex https://gist.github.com/onionhammer/7487452 --- lib/pure/httpserver.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pure/httpserver.nim b/lib/pure/httpserver.nim index 043e713a61..901fdc779d 100644 --- a/lib/pure/httpserver.nim +++ b/lib/pure/httpserver.nim @@ -401,8 +401,9 @@ proc nextAsync(s: PAsyncHTTPServer) = var value = "" i = header.parseUntil(key, ':') inc(i) # skip : - i += header.skipWhiteSpace(i) - i += header.parseUntil(value, {'\c', '\L'}, i) + if i < header.len: + i += header.skipWhiteSpace(i) + i += header.parseUntil(value, {'\c', '\L'}, i) s.headers[key] = value else: s.client.close() From 38eb67de835db986105a7340def055cad704f697 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Fri, 15 Nov 2013 23:04:21 +0100 Subject: [PATCH 029/326] Expands tutorial macro section with step by step guide. --- doc/tut2.txt | 265 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 258 insertions(+), 7 deletions(-) diff --git a/doc/tut2.txt b/doc/tut2.txt index e1e36bfc41..4d8d0be157 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -699,15 +699,22 @@ once. Macros ====== -Macros enable advanced compile-time code transformations, but they -cannot change Nimrod's syntax. However, this is no real restriction because -Nimrod's syntax is flexible enough anyway. +Macros enable advanced compile-time code transformations, but they cannot +change Nimrod's syntax. However, this is no real restriction because Nimrod's +syntax is flexible enough anyway. Macros have to be implemented in pure Nimrod +code if `foreign function interface (FFI) +`_ is not enabled in the compiler, but +other than that restriction (which at some point in the future will go away) +you can write any kind of Nimrod code and the compiler will run it at compile +time. -To write a macro, one needs to know how the Nimrod concrete syntax is converted -to an abstract syntax tree (AST). The AST is documented in the -`macros `_ module. +There are two ways to write a macro, either *generating* Nimrod source code and +letting the compiler parse it, or creating manually an abstract syntax tree +(AST) which you feed to the compiler. In order to build the AST one needs to +know how the Nimrod concrete syntax is converted to an abstract syntax tree +(AST). The AST is documented in the `macros `_ module. -There are two ways to invoke a macro: +Once your macro is finished, there are two ways to invoke it: (1) invoking a macro like a procedure call (`expression macros`:idx:) (2) invoking a macro with the special ``macrostmt`` syntax (`statement macros`:idx:) @@ -796,3 +803,247 @@ Term rewriting macros Term rewriting macros can be used to enhance the compilation process with user defined optimizations; see this `document `_ for further information. + + +Building your first macro +------------------------- + +To give a footstart to writing macros we will show now how to turn your typical +dynamic code into something that compiles statically. For the exercise we will +use the following snippet of code as the starting point: + +.. code-block:: nimrod + + import strutils, tables + + proc readCfgAtRuntime(cfgFilename: string): TTable[string, string] = + let + inputString = readFile(cfgFilename) + var + rawLines = split(inputString, {char(0x0a), char(0x0d)}) + source = "" + + result = initTable[string, string]() + for line in rawLines: + var chunks = split(line, ',') + if chunks.len != 2: + quit("Input needs comma split values, got: " & line) + result[chunks[0]] = chunks[1] + + if result.len < 1: quit("Input file empty!") + + let info = readCfgAtRuntime("data.cfg") + + when isMainModule: + echo info["licenseOwner"] + echo info["licenseKey"] + echo info["version"] + +Presumably this snippet of code could be used in a commercial software, reading +a configuration file to display information about the person who bought the +software. This external file would be generated by an online web shopping cart +to be included along the program containing the license information:: + + version,1.1 + licenseOwner,Hyori Lee + licenseKey,M1Tl3PjBWO2CC48m + +The ``readCfgAtRuntime`` proc will open the given filename and return a +``TTable`` from the `tables module `_. The parsing of the file is +done (without much care for handling invalid data or corner cases) using the +``split`` proc from the `strutils module `_. There are many +things which can fail; mind the purpose is explaining how to make this run at +compile time, not how to properly implement a DRM scheme. + +The reimplementation of this code as a compile time proc will allow us to get +rid of the ``data.cfg`` file we would need to distribute along the binary, plus +if the information is really constant, it doesn't make from a logical point of +view to have it *mutable* in a global variable, it would be better if it was a +constant. Finally, and likely the most valuable feature, we can implement some +verification at compile time. You could think if this as a better *unit +testing*, since it is impossible to obtain a binary unless everything is +correct, preventing you to ship to users a broken program which won't start +because a small critical file is missing or its contents changed by mistake to +something invalid. + + +Generating source code +++++++++++++++++++++++ + +Our first attempt will start by modifying the program to generate a compile +time string with the *generated source code*, which we then pass to the +``parseStmt`` proc from the `macros module `_. Here is the +modified source code implementing the macro: + +.. code-block:: nimrod + import macros, strutils + + macro readCfgAndBuildSource(cfgFilename: string): stmt = + let + inputString = slurp(cfgFilename.strVal) + var + rawLines = split(inputString, {char(0x0a), char(0x0d)}) + source = "" + + for line in rawLines: + var chunks = split(line, ',') + if chunks.len != 2: + error("Input needs comma split values, got: " & line) + source &= "const cfg" & chunks[0] & "= \"" & chunks[1] & "\"\n" + + if source.len < 1: error("Input file empty!") + result = parseStmt(source) + + readCfgAndBuildSource("data.cfg") + + when isMainModule: + echo cfglicenseOwner + echo cfglicenseKey + echo cfgversion + +The good news is not much has changed! First, we need to change the handling of +the input parameter. In the dynamic version the ``readCfgAtRuntime`` proc +receives a string parameter. However, in the macro version it is also declared +as string, but this is the *outside* interface of the macro. When the macro is +run, it actually gets a ``PNimrodNode`` object instead of a string, and we have +to call the ``strVal`` proc from the `macros module `_ to obtain +the string being passed in to the macro. + +Second, we cannot use the ``readFile`` proc from the `system module +`_ due to FFI restriction at compile time. If we try to use this +proc, or any other which depends on FFI, the compiler will error with the +message ``cannot evaluate`` and a dump of the macro's source code, along with a +stack trace where the compiler reached before bailing out. We can get around +this limitation by using the ``slurp`` proc from the `system module +`_, which was precisely made for compilation time (just like +``gorge`` which executes an external program and captures its output). + +The interesting thing is that our macro does not return a runtime ``TTable`` +object. Instead, it builds up Nimrod source code into the ``source`` variable. +For each line of the configuration file a ``const`` variable will be generated. +To avoid conflicts we prefix these variables with ``cfg``. In essence, what the +compiler is doing is replacing the line calling the macro with the following +snippet of code: + +.. code-block:: nimrod + const cfgversion= "1.1" + const cfglicenseOwner= "Hyori Lee" + const cfglicenseKey= "M1Tl3PjBWO2CC48m" + +You can verify this yourself adding the line ``echo source`` somewhere at the +end of the macro and compiling the program. Another difference is that instead +of calling the usual ``quit`` proc to abort (which we could still call) this +version calls the ``error`` proc. The ``error`` proc has the same behavior as +``quit`` but will dump also the source and file line information where the +error happened, making it easier for the programmer to find where compilation +failed. In this situation it would point to the line invoking the macro, but +**not** the line of ``data.cfg`` we are processing, that's something the macro +itself would need to control. + + +Generating AST by hand +++++++++++++++++++++++ + +To generate an AST we would need to intimately know the structures used by the +Nimrod compiler exposed in the `macros module `_, which at first +look seems a daunting task. But we can use a helper shortcut the ``dumpTree`` +macro, which is used as a statement macro instead of an expression macro. +Since we know that we want to generate a bunch of ``const`` symbols we can +create the following source file and compile it to see what the compiler +*expects* from us: + +.. code-block:: nimrod + import macros + + dumpTree: + const cfgversion: string = "1.1" + const cfglicenseOwner= "Hyori Lee" + const cfglicenseKey= "M1Tl3PjBWO2CC48m" + +During compilation of the source code we should see the following lines in the +output (again, since this is a macro, compilation is enough, you don't have to +run any binary):: + + StmtList + ConstSection + ConstDef + Ident !"cfgversion" + Ident !"string" + StrLit 1.1 + ConstSection + ConstDef + Ident !"cfglicenseOwner" + Empty + StrLit Hyori Lee + ConstSection + ConstDef + Ident !"cfglicenseKey" + Empty + StrLit M1Tl3PjBWO2CC48m + +With this output we have a better idea of what kind of input the compiler +expects. We need to generate a list of statements. For each constant the source +code generates a ``ConstSection`` and a ``ConstDef``. If we were to move all +the constants to a single ``const`` block we would see only a single +``ConstSection`` with three children. + +Maybe you didn't notice, but in the ``dumpTree`` example the first constant +explicitly specifies the type of the constant. That's why in the tree output +the two last constants have their second child ``Empty`` but the first has a +string identifier. So basically a ``const`` definition is made up from an +identifier, optionally a type (can be an *empty* node) and the value. Armed +with this knowledge, let's look at the finished version of the AST building +macro: + +.. code-block:: nimrod + import macros, strutils + + macro readCfgAndBuildAST(cfgFilename: string): stmt = + let + inputString = slurp(cfgFilename.strVal) + var + rawLines = split(inputString, {char(0x0a), char(0x0d)}) + + result = newNimNode(nnkStmtList) + for line in rawLines: + var chunks = split(line, ',') + if chunks.len != 2: + error("Input needs comma split values, got: " & line) + var + section = newNimNode(nnkConstSection) + constDef = newNimNode(nnkConstDef) + constDef.add(newIdentNode("cfg" & chunks[0])) + constDef.add(newEmptyNode()) + constDef.add(newStrLitNode(chunks[1])) + section.add(constDef) + result.add(section) + + if result.len < 1: error("Input file empty!") + + readCfgAndBuildAST("data.cfg") + + when isMainModule: + echo cfglicenseOwner + echo cfglicenseKey + echo cfgversion + +Since we are building on the previous example generating source code, we will +only mention the differences to it. Instead of creating a temporary ``string`` +variable and writing into it source code as if it were written *by hand*, we +use the ``result`` variable directly and create a statement list node +(``nnkStmtList``) which will hold our children. + +For each input line we have to create a constant definition (``nnkConstDef``) +and wrap it inside a constant section (``nnkConstSection``). Once these +variables are created, we fill them hierarchichally like the previous AST dump +tree showed: the constant definition is a child of the section definition, and +the constant definition has an identifier node, an empty node (we let the +compiler figure out the type), and a string literal with the value. + +A last tip when writing a macro: if you are not sure the AST you are building +looks ok, you may be tempted to use the ``dumpTree`` macro. But you can't use +it *inside* the macro you are writting/debugging. Instead ``echo`` the string +generated by ``treeRepr``. If at the end of the this example you add ``echo +treeRepr(result)`` you should get the same output as using the ``dumpTree`` +macro, but of course you can call that at any point of the macro where you +might be having troubles. From 4cea15d2748de610715311497110136ba11c7ce9 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 17 Nov 2013 16:28:42 +0200 Subject: [PATCH 030/326] improvements for the `is` operator; implemented the type lifting rule in user-defined type classes --- compiler/semdata.nim | 1 + compiler/semexprs.nim | 14 ++++++++++++-- compiler/sigmatch.nim | 29 +++++++++++++++++++---------- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 121bf297da..31d2ce6bda 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -60,6 +60,7 @@ type threadEntries*: TSymSeq # list of thread entries to check AmbiguousSymbols*: TIntSet # ids of all ambiguous symbols (cannot # store this info in the syms themselves!) + InTypeClass*: int # > 0 if we are in a user-defined type class InGenericContext*: int # > 0 if we are in a generic type InUnrolledContext*: int # > 0 if we are unrolling a loop InCompilesContext*: int # > 0 if we are in a ``compiles`` magic diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index fdc050260b..2cb6f20477 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -321,10 +321,19 @@ proc isOpImpl(c: PContext, n: PNode): PNode = else: var match: bool let t2 = n[2].typ - if t2.kind == tyTypeClass: + case t2.kind + of tyTypeClass: var m: TCandidate InitCandidate(m, t2) match = matchUserTypeClass(c, m, emptyNode, t2, t1) != nil + of tyOrdinal: + var m: TCandidate + InitCandidate(m, t2) + match = isOrdinalType(t1) + of tySequence, tyArray, tySet: + var m: TCandidate + InitCandidate(m, t2) + match = typeRel(m, t2, t1) != isNone else: match = sameType(t1, t2) @@ -763,7 +772,8 @@ proc afterCallActions(c: PContext; n, orig: PNode, flags: TExprFlags): PNode = analyseIfAddressTakenInCall(c, result) if callee.magic != mNone: result = magicsAfterOverloadResolution(c, result, flags) - result = evalAtCompileTime(c, result) + if c.InTypeClass == 0: + result = evalAtCompileTime(c, result) proc semDirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = # this seems to be a hotspot in the compiler! diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 78ae61d0f4..1d502a205a 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -202,7 +202,7 @@ proc describeArgs*(c: PContext, n: PNode, startIdx = 1): string = add(result, argTypeToString(arg)) if i != sonsLen(n) - 1: add(result, ", ") -proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation +proc typeRel*(c: var TCandidate, f, a: PType): TTypeRelation proc concreteType(c: TCandidate, t: PType): PType = case t.kind of tyArrayConstr: @@ -750,6 +750,11 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, # pushInfoContext(arg.info) openScope(c) + inc c.InTypeClass + + finally: + dec c.InTypeClass + closeScope(c) for param in f.n[0]: var @@ -764,7 +769,7 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, dummyType = a InternalAssert dummyName.kind == nkIdent - var dummyParam = newSym(skParam, dummyName.ident, f.sym, f.sym.info) + var dummyParam = newSym(skType, dummyName.ident, f.sym, f.sym.info) dummyParam.typ = dummyType addDecl(c, dummyParam) @@ -780,23 +785,27 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, of nkTypeSection: nil of nkConstDef: nil else: - if e.typ.kind == tyBool: + if e.typ != nil and e.typ.kind == tyBool: let verdict = c.semConstExpr(c, e) if verdict.intVal == 0: let expStr = renderTree(stmt, {renderNoComments}) m.errors.safeAdd(expStr & " doesn't hold for " & a.typeToString) return nil - - closeScope(c) - + result = arg put(m.bindings, f, a) -proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, a: PType, +proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, argSemantized, argOrig: PNode): PNode = - var arg = argSemantized - var r: TTypeRelation - let fMaybeExpr = f.skipTypes({tyDistinct}) + var + r: TTypeRelation + arg = argSemantized + + let + a = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) + else: argType + fMaybeExpr = f.skipTypes({tyDistinct}) + case fMaybeExpr.kind of tyExpr: if fMaybeExpr.sonsLen == 0: From d037aec415c79c8778b1c81d11ff3442e262895a Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 17 Nov 2013 21:31:05 +0100 Subject: [PATCH 031/326] Fixes times.toSeconds to handle hours and minutes correctly. --- lib/pure/times.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 80a5ad8d35..e967ef683e 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -246,7 +246,8 @@ proc toSeconds(a: TTimeInfo, interval: TTimeInterval): float = else: curMonth.inc() result += float(newinterv.days * 24 * 60 * 60) - result += float(newinterv.minutes * 60 * 60) + result += float(newinterv.hours * 60 * 60) + result += float(newinterv.minutes * 60) result += float(newinterv.seconds) result += newinterv.miliseconds / 1000 From a068aaed3c5ddaf05a104f3f2d0f512bab2861c6 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 17 Nov 2013 22:50:26 +0200 Subject: [PATCH 032/326] simple unit test and better documentation for the user defined type classes --- compiler/msgs.nim | 55 ++++++++++++++++++++++------------ compiler/sem.nim | 3 +- compiler/semdata.nim | 3 +- compiler/semexprs.nim | 12 ++++---- compiler/semstmts.nim | 16 ++++++---- compiler/sigmatch.nim | 22 +++++--------- doc/manual.txt | 31 ++++++++++++------- tests/run/tusertypeclasses.nim | 28 +++++++++++++++++ 8 files changed, 113 insertions(+), 57 deletions(-) create mode 100644 tests/run/tusertypeclasses.nim diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 5363442b40..895ba71f30 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -436,7 +436,14 @@ type # only 8 bytes. line*, col*: int16 fileIndex*: int32 - + + TErrorOutput* = enum + eStdOut + eStdErr + eInMemory + + TErrorOutputs* = set[TErrorOutput] + ERecoverableError* = object of EInvalidValue ESuggestDone* = object of EBase @@ -534,13 +541,27 @@ var gHintCounter*: int = 0 gWarnCounter*: int = 0 gErrorMax*: int = 1 # stop after gErrorMax errors - gSilence*: int # == 0 if we produce any output at all when useCaas: var stdoutSocket*: TSocket +proc UnknownLineInfo*(): TLineInfo = + result.line = int16(-1) + result.col = int16(-1) + result.fileIndex = -1 + +var + msgContext: seq[TLineInfo] = @[] + lastError = UnknownLineInfo() + bufferedMsgs*: seq[string] + + errorOutputs* = {eStdOut, eStdErr} + +proc clearBufferedMsgs* = + bufferedMsgs = nil + proc SuggestWriteln*(s: string) = - if gSilence == 0: + if eStdOut in errorOutputs: when useCaas: if isNil(stdoutSocket): Writeln(stdout, s) else: @@ -548,6 +569,9 @@ proc SuggestWriteln*(s: string) = stdoutSocket.send(s & "\c\L") else: Writeln(stdout, s) + + if eInMemory in errorOutputs: + bufferedMsgs.safeAdd(s) proc SuggestQuit*() = if not isServing: @@ -570,14 +594,6 @@ const RawWarningFormat* = "Warning: $1" RawHintFormat* = "Hint: $1" -proc UnknownLineInfo*(): TLineInfo = - result.line = int16(-1) - result.col = int16(-1) - result.fileIndex = -1 - -var - msgContext: seq[TLineInfo] = @[] - proc getInfoContextLen*(): int = return msgContext.len proc setInfoContextLen*(L: int) = setLen(msgContext, L) @@ -642,14 +658,18 @@ proc addCheckpoint*(filename: string, line: int) = proc OutWriteln*(s: string) = ## Writes to stdout. Always. - if gSilence == 0: Writeln(stdout, s) + if eStdOut in errorOutputs: Writeln(stdout, s) proc MsgWriteln*(s: string) = ## Writes to stdout. If --stdout option is given, writes to stderr instead. - if gSilence == 0: - if gCmd == cmdIdeTools and optCDebug notin gGlobalOptions: return - if optStdout in gGlobalOptions: Writeln(stderr, s) - else: Writeln(stdout, s) + if gCmd == cmdIdeTools and optCDebug notin gGlobalOptions: return + + if optStdout in gGlobalOptions: + if eStdErr in errorOutputs: Writeln(stderr, s) + else: + if eStdOut in errorOutputs: Writeln(stdout, s) + + if eInMemory in errorOutputs: bufferedMsgs.safeAdd(s) proc coordToStr(coord: int): string = if coord == -1: result = "???" @@ -736,9 +756,6 @@ proc rawMessage*(msg: TMsgKind, args: openarray[string]) = proc rawMessage*(msg: TMsgKind, arg: string) = rawMessage(msg, [arg]) -var - lastError = UnknownLineInfo() - proc writeSurroundingSrc(info: TLineInfo) = const indent = " " MsgWriteln(indent & info.sourceLine.ropeToStr) diff --git a/compiler/sem.nim b/compiler/sem.nim index 71951dd3f7..ea53afbeb4 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -36,7 +36,8 @@ proc semParamList(c: PContext, n, genericParams: PNode, s: PSym) proc addParams(c: PContext, n: PNode, kind: TSymKind) proc maybeAddResult(c: PContext, s: PSym, n: PNode) proc instGenericContainer(c: PContext, n: PNode, header: PType): PType -proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode +proc tryExpr(c: PContext, n: PNode, + flags: TExprFlags = {}, bufferErrors = false): PNode proc fixImmediateParams(n: PNode): PNode proc activate(c: PContext, n: PNode) proc semQuoteAst(c: PContext, n: PNode): PNode diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 31d2ce6bda..d02359d4ce 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -73,7 +73,8 @@ type libs*: TLinkedList # all libs used by this module semConstExpr*: proc (c: PContext, n: PNode): PNode {.nimcall.} # for the pragmas semExpr*: proc (c: PContext, n: PNode, flags: TExprFlags = {}): PNode {.nimcall.} - semTryExpr*: proc (c: PContext, n: PNode, flags: TExprFlags = {}): PNode {.nimcall.} + semTryExpr*: proc (c: PContext, n: PNode,flags: TExprFlags = {}, + bufferErrors = false): PNode {.nimcall.} semOperand*: proc (c: PContext, n: PNode, flags: TExprFlags = {}): PNode {.nimcall.} semConstBoolExpr*: proc (c: PContext, n: PNode): PNode {.nimcall.} # XXX bite the bullet semOverloadedCall*: proc (c: PContext, n, nOrig: PNode, diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 2cb6f20477..337224aef9 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -824,7 +824,7 @@ proc buildEchoStmt(c: PContext, n: PNode): PNode = proc semExprNoType(c: PContext, n: PNode): PNode = result = semExpr(c, n, {efWantStmt}) - discardCheck(result) + discardCheck(c, result) proc isTypeExpr(n: PNode): bool = case n.kind @@ -1218,7 +1218,7 @@ proc semProcBody(c: PContext, n: PNode): PNode = a.sons[1] = result result = semAsgn(c, a) else: - discardCheck(result) + discardCheck(c, result) closeScope(c) proc SemYieldVarResult(c: PContext, n: PNode, restype: PType) = @@ -1439,12 +1439,12 @@ proc semQuoteAst(c: PContext, n: PNode): PNode = newNode(nkCall, n.info, quotes)]) result = semExpandToAst(c, result) -proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = +proc tryExpr(c: PContext, n: PNode, + flags: TExprFlags = {}, bufferErrors = false): PNode = # watch out, hacks ahead: let oldErrorCount = msgs.gErrorCounter let oldErrorMax = msgs.gErrorMax inc c.InCompilesContext - inc msgs.gSilence # do not halt after first error: msgs.gErrorMax = high(int) @@ -1453,6 +1453,8 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = openScope(c) let oldOwnerLen = len(gOwners) let oldGenerics = c.generics + let oldErrorOutputs = errorOutputs + errorOutputs = if bufferErrors: {eInMemory} else: {} let oldContextLen = msgs.getInfoContextLen() let oldInGenericContext = c.InGenericContext @@ -1475,7 +1477,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = setlen(gOwners, oldOwnerLen) c.currentScope = oldScope dec c.InCompilesContext - dec msgs.gSilence + errorOutputs = oldErrorOutputs msgs.gErrorCounter = oldErrorCount msgs.gErrorMax = oldErrorMax diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index ed6787a167..f514a93d7f 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -132,7 +132,7 @@ proc fixNilType(n: PNode) = for it in n: fixNilType(it) n.typ = nil -proc discardCheck(result: PNode) = +proc discardCheck(c: PContext, result: PNode) = if result.typ != nil and result.typ.kind notin {tyStmt, tyEmpty}: if result.kind == nkNilLit: result.typ = nil @@ -142,6 +142,10 @@ proc discardCheck(result: PNode) = while n.kind in skipForDiscardable: n = n.lastSon n.typ = nil + elif c.InTypeClass > 0 and result.typ.kind == tyBool: + let verdict = semConstExpr(c, result) + if verdict.intVal == 0: + localError(result.info, "type class predicate failed.") elif result.typ.kind != tyError and gCmd != cmdInteractive: if result.typ.kind == tyNil: fixNilType(result) @@ -169,7 +173,7 @@ proc semIf(c: PContext, n: PNode): PNode = typ = commonType(typ, it.sons[0].typ) else: illFormedAst(it) if isEmptyType(typ) or typ.kind == tyNil or not hasElse: - for it in n: discardCheck(it.lastSon) + for it in n: discardCheck(c, it.lastSon) result.kind = nkIfStmt # propagate any enforced VoidContext: if typ == EnforceVoidContext: result.typ = EnforceVoidContext @@ -230,7 +234,7 @@ proc semCase(c: PContext, n: PNode): PNode = localError(n.info, errNotAllCasesCovered) closeScope(c) if isEmptyType(typ) or typ.kind == tyNil or not hasElse: - for i in 1..n.len-1: discardCheck(n.sons[i].lastSon) + for i in 1..n.len-1: discardCheck(c, n.sons[i].lastSon) # propagate any enforced VoidContext: if typ == EnforceVoidContext: result.typ = EnforceVoidContext @@ -275,8 +279,8 @@ proc semTry(c: PContext, n: PNode): PNode = typ = commonType(typ, a.sons[length-1].typ) dec c.p.inTryStmt if isEmptyType(typ) or typ.kind == tyNil: - discardCheck(n.sons[0]) - for i in 1..n.len-1: discardCheck(n.sons[i].lastSon) + discardCheck(c, n.sons[0]) + for i in 1..n.len-1: discardCheck(c, n.sons[i].lastSon) if typ == EnforceVoidContext: result.typ = EnforceVoidContext else: @@ -1221,7 +1225,7 @@ proc semStmtList(c: PContext, n: PNode): PNode = voidContext = true n.typ = EnforceVoidContext if i != last or voidContext: - discardCheck(n.sons[i]) + discardCheck(c, n.sons[i]) else: n.typ = n.sons[i].typ if not isEmptyType(n.typ): diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 1d502a205a..00f3b2b107 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -85,6 +85,7 @@ proc initCandidate*(c: var TCandidate, callee: PSym, binding: PNode, c.calleeSym = callee c.calleeScope = calleeScope initIdTable(c.bindings) + c.errors = nil if binding != nil and callee.kind in RoutineKinds: var typeParams = callee.ast[genericParamsPos] for i in 1..min(sonsLen(typeParams), sonsLen(binding)-1): @@ -774,23 +775,16 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, addDecl(c, dummyParam) for stmt in f.n[3]: - var e = c.semTryExpr(c, copyTree(stmt)) - if e == nil: - let expStr = renderTree(stmt, {renderNoComments}) - m.errors.safeAdd("can't compile " & expStr & " for " & a.typeToString) - return nil + var e = c.semTryExpr(c, copyTree(stmt), bufferErrors = false) + m.errors = bufferedMsgs + clearBufferedMsgs() + if e == nil: return nil + case e.kind - of nkReturnStmt: - nil + of nkReturnStmt: nil of nkTypeSection: nil of nkConstDef: nil - else: - if e.typ != nil and e.typ.kind == tyBool: - let verdict = c.semConstExpr(c, e) - if verdict.intVal == 0: - let expStr = renderTree(stmt, {renderNoComments}) - m.errors.safeAdd(expStr & " doesn't hold for " & a.typeToString) - return nil + else: nil result = arg put(m.bindings, f, a) diff --git a/doc/manual.txt b/doc/manual.txt index c63df03040..dabff3d69d 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -3289,27 +3289,36 @@ Declarative type classes are written in the following form: for value in c: type(value) is T - -The identifiers following the `generic` keyword are treated as variables of -the matched type and the body of the type class consists of arbitrary code that -must be valid under these circumstances. - -Specifically, the type class will be matched if: +The type class will be matched if: a) all of the expressions within the body can be compiled for the tested type b) all statically evaluatable boolean expressions in the body must be true -Please note that the ``is`` operator allows you to easily verify the precise type -signatures of the required operations, but since type inference and default -parameters are still applied in the provided block, it's also possible to encode -usage protocols that doesn't reveal implementation details. +The identifiers following the `generic` keyword represent instances of the +currently matched type. These instances can act both as variables of the type, +when used in contexts, where a value is expected, and as the type itself, when +used in a contexts, where a type is expected. + +Please note that the ``is`` operator allows you to easily verify the precise +type signatures of the required operations, but since type inference and +default parameters are still applied in the provided block, it's also possible +to encode usage protocols that doesn't reveal implementation details. + +As a special rule providing further convenience when writing type classes, any +type value appearing in a callable expression will be treated as a variable of +the designated type for overload resolution purposes, unless the type value was +passed in its explicit ``typedesc[T]`` form: + +.. code-block:: nimrod + type + OutputStream = generic S + write(var S, string) Much like generics, the user defined type classes will be instantiated exactly once for each tested type and any static code included within them will also be executed once. - Return Type Inference --------------------- diff --git a/tests/run/tusertypeclasses.nim b/tests/run/tusertypeclasses.nim new file mode 100644 index 0000000000..4c2f07b853 --- /dev/null +++ b/tests/run/tusertypeclasses.nim @@ -0,0 +1,28 @@ +discard """ + output: "Sortable\nSortable\nContainer" +""" + +import typetraits + +type + TObj = object + x: int + + Sortable = generic x, y + (x < y) is bool + + ObjectContainer = generic C + C.len is ordinal + for v in items(C): + v.type is tuple|object + +proc foo(c: ObjectContainer) = + echo "Container" + +proc foo(x: Sortable) = + echo "Sortable" + +foo 10 +foo "test" +foo(@[TObj(x: 10), TObj(x: 20)]) + From f279d465d0a9499825efba93ee189b5cc279e064 Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Thu, 14 Nov 2013 12:32:35 -0500 Subject: [PATCH 033/326] Prevent lambdas from crashing if given implicit generic parameters. Fixes issues #599 and #641 (and possibly other generic-related issues) --- compiler/semstmts.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index ed6787a167..3752739bf5 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -879,8 +879,9 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode = openScope(c) if n.sons[genericParamsPos].kind != nkEmpty: illFormedAst(n) # process parameters: - if n.sons[paramsPos].kind != nkEmpty: - semParamList(c, n.sons[ParamsPos], nil, s) + if n.sons[paramsPos].kind != nkEmpty: + var gp = newNodeI(nkGenericParams, n.info) + semParamList(c, n.sons[ParamsPos], gp, s) ParamsTypeCheck(c, s.typ) else: s.typ = newTypeS(tyProc, c) From 619356dd0886e764945faadccc62281ff6b85aa5 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 19 Nov 2013 14:06:39 +0100 Subject: [PATCH 034/326] bugfix: '$' for TPort --- lib/pure/sockets.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index 99117ea4e8..66bb1e6a9e 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -154,9 +154,8 @@ proc newTSocket(fd: TSocketHandle, isBuff: bool): TSocket = proc `==`*(a, b: TPort): bool {.borrow.} ## ``==`` for ports. -proc `$`*(p: TPort): string = +proc `$`*(p: TPort): string {.borrow.} ## returns the port number as a string - result = $ze(int16(p)) proc ntohl*(x: int32): int32 = ## Converts 32-bit integers from network to host byte order. From 80377c20f972ecb7f8d296e5cff1de0c6800d70a Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 19 Nov 2013 14:35:03 +0100 Subject: [PATCH 035/326] fixes #678 --- lib/packages/docutils/rst.nim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index 91664cd509..6dd407155c 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -868,6 +868,12 @@ proc parseLine(p: var TRstParser, father: PRstNode) = case p.tok[p.idx].kind of tkWhite, tkWord, tkOther, tkPunct: parseInline(p, father) else: break + +proc parseUntilNewline(p: var TRstParser, father: PRstNode) = + while True: + case p.tok[p.idx].kind + of tkWhite, tkWord, tkAdornment, tkOther, tkPunct: parseInline(p, father) + of tkEof, tkIndent: break proc parseSection(p: var TRstParser, result: PRstNode) proc parseField(p: var TRstParser): PRstNode = @@ -1078,7 +1084,7 @@ proc parseParagraph(p: var TRstParser, result: PRstNode) = proc parseHeadline(p: var TRstParser): PRstNode = result = newRstNode(rnHeadline) - parseLine(p, result) + parseUntilNewLine(p, result) assert(p.tok[p.idx].kind == tkIndent) assert(p.tok[p.idx + 1].kind == tkAdornment) var c = p.tok[p.idx + 1].symbol[0] @@ -1172,7 +1178,7 @@ proc parseOverline(p: var TRstParser): PRstNode = inc(p.idx, 2) result = newRstNode(rnOverline) while true: - parseLine(p, result) + parseUntilNewline(p, result) if p.tok[p.idx].kind == tkIndent: inc(p.idx) if p.tok[p.idx - 1].ival > currInd(p): From 98cf1c412afad4f2830ac3d807f1f017b09b953b Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 19 Nov 2013 14:39:27 +0100 Subject: [PATCH 036/326] garbage-in-garbage-out principle for unicode errors; fixes #674 --- lib/pure/unicode.nim | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim index 142178a868..4aacb2f717 100644 --- a/lib/pure/unicode.nim +++ b/lib/pure/unicode.nim @@ -55,31 +55,31 @@ template fastRuneAt*(s: string, i: int, result: expr, doInc = true) = result = TRune(ord(s[i])) when doInc: inc(i) elif ord(s[i]) shr 5 == 0b110: - assert(ord(s[i+1]) shr 6 == 0b10) + # assert(ord(s[i+1]) shr 6 == 0b10) result = TRune((ord(s[i]) and (ones(5))) shl 6 or (ord(s[i+1]) and ones(6))) when doInc: inc(i, 2) elif ord(s[i]) shr 4 == 0b1110: - assert(ord(s[i+1]) shr 6 == 0b10) - assert(ord(s[i+2]) shr 6 == 0b10) + # assert(ord(s[i+1]) shr 6 == 0b10) + # assert(ord(s[i+2]) shr 6 == 0b10) result = TRune((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))) when doInc: inc(i, 3) 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) + # 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 = TRune((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))) when doInc: inc(i, 4) elif ord(s[i]) shr 2 == 0b111110: - assert(ord(s[i+1]) shr 6 == 0b10) - assert(ord(s[i+2]) shr 6 == 0b10) - assert(ord(s[i+3]) shr 6 == 0b10) - assert(ord(s[i+4]) shr 6 == 0b10) + # assert(ord(s[i+1]) shr 6 == 0b10) + # assert(ord(s[i+2]) shr 6 == 0b10) + # assert(ord(s[i+3]) shr 6 == 0b10) + # assert(ord(s[i+4]) shr 6 == 0b10) result = TRune((ord(s[i]) and ones(2)) shl 24 or (ord(s[i+1]) and ones(6)) shl 18 or (ord(s[i+2]) and ones(6)) shl 12 or @@ -87,11 +87,11 @@ template fastRuneAt*(s: string, i: int, result: expr, doInc = true) = (ord(s[i+4]) and ones(6))) when doInc: inc(i, 5) elif ord(s[i]) shr 1 == 0b1111110: - assert(ord(s[i+1]) shr 6 == 0b10) - assert(ord(s[i+2]) shr 6 == 0b10) - assert(ord(s[i+3]) shr 6 == 0b10) - assert(ord(s[i+4]) shr 6 == 0b10) - assert(ord(s[i+5]) shr 6 == 0b10) + # assert(ord(s[i+1]) shr 6 == 0b10) + # assert(ord(s[i+2]) shr 6 == 0b10) + # assert(ord(s[i+3]) shr 6 == 0b10) + # assert(ord(s[i+4]) shr 6 == 0b10) + # assert(ord(s[i+5]) shr 6 == 0b10) result = TRune((ord(s[i]) and ones(1)) shl 30 or (ord(s[i+1]) and ones(6)) shl 24 or (ord(s[i+2]) and ones(6)) shl 18 or From cd1f96d421931f2eb359afe5f0e03312a2481971 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 19 Nov 2013 15:11:44 +0100 Subject: [PATCH 037/326] fixes #663 --- compiler/semstmts.nim | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 6702075daa..da8ba50a86 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1109,24 +1109,24 @@ proc finishMethod(c: PContext, s: PSym) = methodDef(s, false) proc semMethod(c: PContext, n: PNode): PNode = - if not isTopLevel(c): LocalError(n.info, errXOnlyAtModuleScope, "method") + if not isTopLevel(c): localError(n.info, errXOnlyAtModuleScope, "method") result = semProcAux(c, n, skMethod, methodPragmas) var s = result.sons[namePos].sym - if not isGenericRoutine(s): + if not isGenericRoutine(s) and result.sons[bodyPos].kind != nkEmpty: if hasObjParam(s): - methodDef(s, false) + methodDef(s, fromCache=false) else: - LocalError(n.info, errXNeedsParamObjectType, "method") + localError(n.info, errXNeedsParamObjectType, "method") proc semConverterDef(c: PContext, n: PNode): PNode = - if not isTopLevel(c): LocalError(n.info, errXOnlyAtModuleScope, "converter") + if not isTopLevel(c): localError(n.info, errXOnlyAtModuleScope, "converter") checkSonsLen(n, bodyPos + 1) result = semProcAux(c, n, skConverter, converterPragmas) var s = result.sons[namePos].sym var t = s.typ - if t.sons[0] == nil: LocalError(n.info, errXNeedsReturnType, "converter") - if sonsLen(t) != 2: LocalError(n.info, errXRequiresOneArgument, "converter") + if t.sons[0] == nil: localError(n.info, errXNeedsReturnType, "converter") + if sonsLen(t) != 2: localError(n.info, errXRequiresOneArgument, "converter") addConverter(c, s) proc semMacroDef(c: PContext, n: PNode): PNode = @@ -1134,9 +1134,9 @@ proc semMacroDef(c: PContext, n: PNode): PNode = result = semProcAux(c, n, skMacro, macroPragmas) var s = result.sons[namePos].sym var t = s.typ - if t.sons[0] == nil: LocalError(n.info, errXNeedsReturnType, "macro") + if t.sons[0] == nil: localError(n.info, errXNeedsReturnType, "macro") if n.sons[bodyPos].kind == nkEmpty: - LocalError(n.info, errImplOfXexpected, s.name.s) + localError(n.info, errImplOfXexpected, s.name.s) proc evalInclude(c: PContext, n: PNode): PNode = result = newNodeI(nkStmtList, n.info) From d0f7db08287a69e07c4090e28a90a28e9bfa1f0a Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 19 Nov 2013 15:41:20 +0100 Subject: [PATCH 038/326] always call the linker; fixes #660 --- compiler/extccomp.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index d7f3386e3f..13eb972f6c 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -583,7 +583,7 @@ proc CallCCompiler*(projectfile: string) = else: rawMessage(errGenerated, " execution of an external program failed; " & "rerun with --parallelBuild:1 to see the error message") - if optNoLinking notin gGlobalOptions and cmds.len > 0: + if optNoLinking notin gGlobalOptions: # call the linker: var it = PStrEntry(toLink.head) var objfiles = "" From c3e7a970c6f331e730243cc9234b83faa9c7b611 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Tue, 19 Nov 2013 22:33:02 +0100 Subject: [PATCH 039/326] Modifies example to use splitLines. --- doc/tut2.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/tut2.txt b/doc/tut2.txt index 4d8d0be157..3e10d172c6 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -820,11 +820,12 @@ use the following snippet of code as the starting point: let inputString = readFile(cfgFilename) var - rawLines = split(inputString, {char(0x0a), char(0x0d)}) source = "" result = initTable[string, string]() - for line in rawLines: + for line in inputString.splitLines: + # Ignore empty lines + if line.len < 1: continue var chunks = split(line, ',') if chunks.len != 2: quit("Input needs comma split values, got: " & line) @@ -882,10 +883,11 @@ modified source code implementing the macro: let inputString = slurp(cfgFilename.strVal) var - rawLines = split(inputString, {char(0x0a), char(0x0d)}) source = "" - for line in rawLines: + for line in inputString.splitLines: + # Ignore empty lines + if line.len < 1: continue var chunks = split(line, ',') if chunks.len != 2: error("Input needs comma split values, got: " & line) @@ -1001,11 +1003,11 @@ macro: macro readCfgAndBuildAST(cfgFilename: string): stmt = let inputString = slurp(cfgFilename.strVal) - var - rawLines = split(inputString, {char(0x0a), char(0x0d)}) result = newNimNode(nnkStmtList) - for line in rawLines: + for line in inputString.splitLines: + # Ignore empty lines + if line.len < 1: continue var chunks = split(line, ',') if chunks.len != 2: error("Input needs comma split values, got: " & line) From 3a494f5d8d28414fc8df091c53b43ca666d229a2 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Tue, 19 Nov 2013 22:35:05 +0100 Subject: [PATCH 040/326] Corrects grammar and span of italics in text. --- doc/tut2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tut2.txt b/doc/tut2.txt index 3e10d172c6..f66a5135d1 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -861,7 +861,7 @@ rid of the ``data.cfg`` file we would need to distribute along the binary, plus if the information is really constant, it doesn't make from a logical point of view to have it *mutable* in a global variable, it would be better if it was a constant. Finally, and likely the most valuable feature, we can implement some -verification at compile time. You could think if this as a better *unit +verification at compile time. You could think of this as a *better unit testing*, since it is impossible to obtain a binary unless everything is correct, preventing you to ship to users a broken program which won't start because a small critical file is missing or its contents changed by mistake to From b893bd074f9e90f517c3f84037f92f89ab6fbad3 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Thu, 21 Nov 2013 22:47:02 +0000 Subject: [PATCH 041/326] Modified website links in readme. --- readme.md | 4 ++-- readme.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index c49e24f4e3..8d42c66db8 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ the C source of an older version of the compiler are needed to bootstrap the latest version. The C sources are available in a separate repo [here](http://github.com/nimrod-code/csources). Pre-compiled snapshots of the compiler are also available on -[Nimbuild](http://build.nimrod-code.org/). Your platform however may not +[Nimbuild](http://build.nimrod-lang.org/). Your platform however may not currently be built for. The compiler currently supports the following platform and architecture @@ -47,7 +47,7 @@ The above steps can be performed on Windows in a similar fashion, the instead of ``build.sh``. ## Getting help -A [forum](http://forum.nimrod-code.org/) is available if you have any +A [forum](http://forum.nimrod-lang.org/) is available if you have any questions, and you can also get help in the IRC channel on [Freenode](irc://irc.freenode.net/nimrod) in #nimrod. If you ask questions on [StackOverflow use the nimrod diff --git a/readme.txt b/readme.txt index c49e24f4e3..8d42c66db8 100644 --- a/readme.txt +++ b/readme.txt @@ -9,7 +9,7 @@ the C source of an older version of the compiler are needed to bootstrap the latest version. The C sources are available in a separate repo [here](http://github.com/nimrod-code/csources). Pre-compiled snapshots of the compiler are also available on -[Nimbuild](http://build.nimrod-code.org/). Your platform however may not +[Nimbuild](http://build.nimrod-lang.org/). Your platform however may not currently be built for. The compiler currently supports the following platform and architecture @@ -47,7 +47,7 @@ The above steps can be performed on Windows in a similar fashion, the instead of ``build.sh``. ## Getting help -A [forum](http://forum.nimrod-code.org/) is available if you have any +A [forum](http://forum.nimrod-lang.org/) is available if you have any questions, and you can also get help in the IRC channel on [Freenode](irc://irc.freenode.net/nimrod) in #nimrod. If you ask questions on [StackOverflow use the nimrod From 936c71df70c0ec2c3c9a2373a57e5a6c835a01e0 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Fri, 22 Nov 2013 22:54:24 +0100 Subject: [PATCH 042/326] Clarifies wording of newSeq proc docstrings. --- lib/system.nim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index b2d19a885f..7917f7d5bf 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -374,10 +374,10 @@ proc newSeq*[T](s: var seq[T], len: int) {.magic: "NewSeq", noSideEffect.} ## This is equivalent to ``s = @[]; setlen(s, len)``, but more ## efficient since no reallocation is needed. ## - ## Note that the sequence will be filled with uninitialized entries, which - ## can be a problem for sequences containing strings. After the creation of - ## the sequence you should assign entries to the sequence instead of adding - ## them. Example: + ## Note that the sequence will be filled with zeroed entries, which can be a + ## problem for sequences containing strings since their value will be + ## ``nil``. After the creation of the sequence you should assign entries to + ## the sequence instead of adding them. Example: ## ## .. code-block:: nimrod ## var inputStrings : seq[string] @@ -390,10 +390,10 @@ proc newSeq*[T](s: var seq[T], len: int) {.magic: "NewSeq", noSideEffect.} proc newSeq*[T](len = 0): seq[T] = ## creates a new sequence of type ``seq[T]`` with length ``len``. ## - ## Note that the sequence will be filled with uninitialized entries, which - ## can be a problem for sequences containing strings. After the creation of - ## the sequence you should assign entries to the sequence instead of adding - ## them. Example: + ## Note that the sequence will be filled with zeroed entries, which can be a + ## problem for sequences containing strings since their value will be + ## ``nil``. After the creation of the sequence you should assign entries to + ## the sequence instead of adding them. Example: ## ## .. code-block:: nimrod ## var inputStrings = newSeq[string](3) From 9035d15ed22de1f80486d94ec63e720a4d04cbc0 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 25 Nov 2013 13:04:11 +0100 Subject: [PATCH 043/326] next steps for FFI support --- compiler/commands.nim | 6 +- compiler/evalffi.nim | 43 ++++++++++++++ compiler/nimrod.cfg | 3 + compiler/vm.nim | 58 ++++++++++++------- compiler/vmdef.nim | 1 + compiler/vmgen.nim | 42 +++++++++++--- config/nimrod.cfg | 1 + lib/pure/strutils.nim | 4 +- lib/wrappers/{ => libffi}/libffi.nim | 84 ++++++++++++++++++---------- 9 files changed, 179 insertions(+), 63 deletions(-) rename lib/wrappers/{ => libffi}/libffi.nim (63%) diff --git a/compiler/commands.nim b/compiler/commands.nim index d3266930b1..a02728dacd 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -398,13 +398,13 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = if pass in {passCmd2, passPP}: extccomp.addLinkOption(arg) of "cincludes": expectArg(switch, arg, pass, info) - if pass in {passCmd2, passPP}: cIncludes.add arg + if pass in {passCmd2, passPP}: cIncludes.add arg.processPath of "clibdir": expectArg(switch, arg, pass, info) - if pass in {passCmd2, passPP}: cLibs.add arg + if pass in {passCmd2, passPP}: cLibs.add arg.processPath of "clib": expectArg(switch, arg, pass, info) - if pass in {passCmd2, passPP}: cLinkedLibs.add arg + if pass in {passCmd2, passPP}: cLinkedLibs.add arg.processPath of "header": headerFile = arg incl(gGlobalOptions, optGenIndex) diff --git a/compiler/evalffi.nim b/compiler/evalffi.nim index 21a131996a..92b79f9b65 100644 --- a/compiler/evalffi.nim +++ b/compiler/evalffi.nim @@ -441,3 +441,46 @@ proc callForeignFunction*(call: PNode): PNode = for i in 1 .. call.len-1: call.sons[i] = unpack(args[i-1], typ.sons[i], call[i]) dealloc args[i-1] + +proc callForeignFunction*(fn: PNode, fntyp: PType, + args: var TNodeSeq, start, len: int, + info: TLineInfo): PNode = + internalAssert fn.kind == nkPtrLit + + var cif: TCif + var sig: TParamList + for i in 0..len-1: + var aTyp = args[i+start].typ + if aTyp.isNil: + internalAssert i+1 < fntyp.len + aTyp = fntyp.sons[i+1] + args[i+start].typ = aTyp + sig[i] = mapType(aTyp) + if sig[i].isNil: globalError(info, "cannot map FFI type") + + if prep_cif(cif, mapCallConv(fntyp.callConv, info), cuint(len), + mapType(fntyp.sons[0]), sig) != OK: + globalError(info, "error in FFI call") + + var cargs: TArgList + let fn = cast[pointer](fn.intVal) + for i in 0 .. len-1: + let t = args[i+start].typ + cargs[i] = alloc0(packSize(args[i+start], t)) + pack(args[i+start], t, cargs[i]) + let retVal = if isEmptyType(fntyp.sons[0]): pointer(nil) + else: alloc(fntyp.sons[0].getSize.int) + + libffi.call(cif, fn, retVal, cargs) + + if retVal.isNil: + result = emptyNode + else: + result = unpack(retVal, fntyp.sons[0], nil) + result.info = info + + if retVal != nil: dealloc retVal + for i in 0 .. len-1: + let t = args[i+start].typ + args[i+start] = unpack(cargs[i], t, args[i+start]) + dealloc cargs[i] diff --git a/compiler/nimrod.cfg b/compiler/nimrod.cfg index ac8f732f1f..0affe86d95 100644 --- a/compiler/nimrod.cfg +++ b/compiler/nimrod.cfg @@ -12,3 +12,6 @@ path:"$lib/packages/docutils" define:booting +@if windows: + cincludes: "$lib/wrappers/libffi/common" +@end diff --git a/compiler/vm.nim b/compiler/vm.nim index 1596e4220f..019397bbcf 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -14,10 +14,13 @@ import ast except getstr import strutils, astalgo, msgs, vmdef, vmgen, nimsets, types, passes, unsigned, - parser, vmdeps, idents, trees, renderer + parser, vmdeps, idents, trees, renderer, options from semfold import leValueConv, ordinalValToString +when hasFFI: + import evalffi + type PStackFrame* = ref TStackFrame TStackFrame* = object @@ -608,24 +611,39 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = let rc = instr.regC let isClosure = regs[rb].kind == nkPar let prc = if not isClosure: regs[rb].sym else: regs[rb].sons[0].sym - let newPc = compile(c, prc) - #echo "new pc ", newPc, " calling: ", prc.name.s - var newFrame = PStackFrame(prc: prc, comesFrom: pc, next: tos) - newSeq(newFrame.slots, prc.position) - if not isEmptyType(prc.typ.sons[0]): - newFrame.slots[0] = getNullValue(prc.typ.sons[0], prc.info) - # pass every parameter by var (the language definition allows this): - for i in 1 .. rc-1: - newFrame.slots[i] = regs[rb+i] - if isClosure: - newFrame.slots[rc] = regs[rb].sons[1] - # allocate the temporaries: - for i in rc+ord(isClosure) .. = fntyp.len: + internalAssert tfVarargs in fntyp.flags + c.gABx(n, opcSetType, r, c.genType(n.sons[i].typ)) if dest < 0: c.gABC(n, opcIndCall, 0, x, n.len) else: @@ -884,13 +892,26 @@ proc genLit(c: PCtx; n: PNode; dest: var TDest) = let lit = genLiteral(c, n) c.gABx(n, opc, dest, lit) +proc importcSym(c: PCtx; info: TLineInfo; s: PSym) = + when hasFFI: + if allowFFI in c.features: + c.globals.add(importcSymbol(s)) + s.position = c.globals.len + else: + localError(info, errGenerated, "VM is not allowed to 'importc'") + else: + localError(info, errGenerated, + "cannot 'importc' variable at compile time") + proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = let s = n.sym if sfGlobal in s.flags: if dest < 0: dest = c.getTemp(s.typ) if s.position == 0: - c.globals.add(s.ast) - s.position = c.globals.len + if sfImportc in s.flags: c.importcSym(n.info, s) + else: + c.globals.add(s.ast) + s.position = c.globals.len # XXX var g = codeHere() ? c.gABx(n, opcLdGlobal, dest, s.position) else: @@ -1003,9 +1024,11 @@ proc genVarSection(c: PCtx; n: PNode) = let s = a.sons[0].sym if sfGlobal in s.flags: if s.position == 0: - let sa = if s.ast.isNil: getNullValue(s.typ, a.info) else: s.ast - c.globals.add(sa) - s.position = c.globals.len + if sfImportc in s.flags: c.importcSym(a.info, s) + else: + let sa = if s.ast.isNil: getNullValue(s.typ, a.info) else: s.ast + c.globals.add(sa) + s.position = c.globals.len if a.sons[2].kind == nkEmpty: when false: withTemp(tmp, s.typ): @@ -1103,6 +1126,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = of skVar, skForVar, skTemp, skLet, skParam, skResult: genRdVar(c, n, dest) of skProc, skConverter, skMacro, skMethod, skIterator: + if sfImportc in s.flags: c.importcSym(n.info, s) genLit(c, n, dest) of skConst: gen(c, s.ast, dest) @@ -1317,11 +1341,11 @@ proc genProc(c: PCtx; s: PSym): int = c.patch(procStart) c.gABC(body, opcEof, eofInstr.regA) c.optimizeJumps(result) - s.position = c.prc.maxSlots + s.offset = c.prc.maxSlots #if s.name.s == "innerProc": # c.echoCode # echo renderTree(body) c.prc = oldPrc else: - c.prc.maxSlots = s.position + c.prc.maxSlots = s.offset result = x.intVal.int diff --git a/config/nimrod.cfg b/config/nimrod.cfg index 77cc742b22..fbbf8efbb0 100644 --- a/config/nimrod.cfg +++ b/config/nimrod.cfg @@ -27,6 +27,7 @@ path="$lib/wrappers/readline" path="$lib/wrappers/sdl" path="$lib/wrappers/x11" path="$lib/wrappers/zip" +path="$lib/wrappers/libffi" path="$lib/windows" path="$lib/posix" path="$lib/js" diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 98d1f16d2c..79525aa18a 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -1020,8 +1020,8 @@ proc editDistance*(a, b: string): int {.noSideEffect, # floating point formating: -proc c_sprintf(buf, frmt: CString) {.nodecl, importc: "sprintf", varargs, - noSideEffect.} +proc c_sprintf(buf, frmt: CString) {.header: "", importc: "sprintf", + varargs, noSideEffect.} type TFloatFormat* = enum ## the different modes of floating point formating diff --git a/lib/wrappers/libffi.nim b/lib/wrappers/libffi/libffi.nim similarity index 63% rename from lib/wrappers/libffi.nim rename to lib/wrappers/libffi/libffi.nim index 514ce024fd..5ce9cc2e20 100644 --- a/lib/wrappers/libffi.nim +++ b/lib/wrappers/libffi/libffi.nim @@ -26,12 +26,40 @@ {.deadCodeElim: on.} -when defined(windows): - const libffidll* = "libffi.dll" -elif defined(macosx): - const libffidll* = "libffi.dylib" -else: - const libffidll* = "libffi.so" +when defined(windows): + # on Windows we don't use a DLL but instead embed libffi directly: + {.pragma: mylib, header: r"ffi.h".} + + {.compile: r"common\callproc.c".} + {.compile: r"common\malloc_closure.c".} + {.compile: r"common\raw_api.c".} + when defined(vcc): + #{.compile: "libffi_msvc\ffi.h".} + # Date: Tue, 26 Nov 2013 13:34:54 +0100 Subject: [PATCH 044/326] Adds to tutorial info about unpacking tuples. --- doc/tut1.txt | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/doc/tut1.txt b/doc/tut1.txt index 5c1cdb52e5..b46fb2c686 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -189,9 +189,18 @@ to a storage location: var x = "abc" # introduces a new variable `x` and assigns a value to it x = "xyz" # assigns a new value to `x` -``=`` is the *assignment operator*. The assignment operator cannot -be overloaded, overwritten or forbidden, but this might change in a future -version of Nimrod. +``=`` is the *assignment operator*. The assignment operator cannot be +overloaded, overwritten or forbidden, but this might change in a future version +of Nimrod. You can declare multiple variables with a single assignment +statement and all the variables will have the same value: + +.. code-block:: + var x, y = 3 # assigns 3 to the variables `x` and `y` + echo "x ", x # outputs "x 3" + echo "y ", y # outputs "y 3" + x = 42 # changes `x` to 42 without changing `y` + echo "x ", x # outputs "x 42" + echo "y ", y # outputs "y 3" Constants @@ -1352,6 +1361,31 @@ Even though you don't need to declare a type for a tuple to use it, tuples created with different field names will be considered different objects despite having the same field types. +Tuples can be *unpacked* during variable assignment. This can be handy to +assign directly the fields of the tuples to individually named variables. An +example of this is the ``splitFile`` proc from the `os module `_ which +returns the directory, name and extension of a path at the same time. For tuple +unpacking to work you have to use parenthesis around the values you want to +assign the unpacking to, otherwise you will be assigning the same value to all +the individual variables! Example: + +.. code-block:: nimrod + + import os + + let + path = "usr/local/nimrodc.html" + (dir, name, ext) = splitFile(path) + baddir, badname, badext = splitFile(path) + echo dir # outputs `usr/local` + echo name # outputs `nimrodc` + echo ext # outputs `.html` + # All the following output the same line: + # `(dir: usr/local, name: nimrodc, ext: .html)` + echo baddir + echo badname + echo badext + Reference and pointer types --------------------------- From f10a23e669cb6f17098b3d38c6bb5236ff91f9e9 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 27 Nov 2013 09:44:53 +0100 Subject: [PATCH 045/326] removed 'system.eval' --- lib/core/macros.nim | 2 +- lib/system.nim | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/core/macros.nim b/lib/core/macros.nim index fc93a157d6..d01d4ebee4 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -494,7 +494,7 @@ const from strutils import cmpIgnoreStyle, format -proc ExpectKind*(n: PNimrodNode; k: set[TNimrodNodeKind]) {.compileTime.} = +proc expectKind*(n: PNimrodNode; k: set[TNimrodNodeKind]) {.compileTime.} = assert n.kind in k, "Expected one of $1, got $2".format(k, n.kind) proc newProc*(name = newEmptyNode(); params: openarray[PNimrodNode] = []; diff --git a/lib/system.nim b/lib/system.nim index 34b67267f8..5bd230e4c0 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2619,12 +2619,13 @@ type PNimrodNode* {.magic: "PNimrodNode".} = ref TNimrodNode ## represents a Nimrod AST node. Macros operate on this type. -template eval*(blk: stmt): stmt = - ## executes a block of code at compile time just as if it was a macro - ## optionally, the block can return an AST tree that will replace the - ## eval expression - macro payload: stmt {.gensym.} = blk - payload() +when false: + template eval*(blk: stmt): stmt = + ## executes a block of code at compile time just as if it was a macro + ## optionally, the block can return an AST tree that will replace the + ## eval expression + macro payload: stmt {.gensym.} = blk + payload() when hostOS != "standalone": proc insert*(x: var string, item: string, i = 0) {.noSideEffect.} = From 2dcbc6493a8bcebc7dc9364b4a834853e1263639 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 29 Nov 2013 20:42:12 +0100 Subject: [PATCH 046/326] fixes #686 --- compiler/sem.nim | 30 +++---- compiler/semexprs.nim | 14 ++-- tests/compile/tgeneric.nim | 8 ++ tests/run/tdrdobbs_examples.nim | 134 ++++++++++++++++++++++++++++++++ 4 files changed, 166 insertions(+), 20 deletions(-) create mode 100644 tests/run/tdrdobbs_examples.nim diff --git a/compiler/sem.nim b/compiler/sem.nim index ea53afbeb4..eda4442529 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -140,26 +140,27 @@ proc IsOpImpl(c: PContext, n: PNode): PNode proc semMacroExpr(c: PContext, n, nOrig: PNode, sym: PSym, semCheck: bool = true): PNode -proc symFromType(t: PType, info: TLineInfo): PSym = - if t.sym != nil: return t.sym - result = newSym(skType, getIdent"AnonType", t.owner, info) - result.flags.incl sfAnon - result.typ = t +when false: + proc symFromType(t: PType, info: TLineInfo): PSym = + if t.sym != nil: return t.sym + result = newSym(skType, getIdent"AnonType", t.owner, info) + result.flags.incl sfAnon + result.typ = t -proc symNodeFromType(c: PContext, t: PType, info: TLineInfo): PNode = - result = newSymNode(symFromType(t, info), info) - result.typ = makeTypeDesc(c, t) + proc symNodeFromType(c: PContext, t: PType, info: TLineInfo): PNode = + result = newSymNode(symFromType(t, info), info) + result.typ = makeTypeDesc(c, t) proc createEvalContext(c: PContext, mode: TEvalMode): PEvalContext = result = newEvalContext(c.module, mode) result.getType = proc (n: PNode): PNode = - var e = tryExpr(c, n) - if e == nil: - result = symNodeFromType(c, errorType(c), n.info) - elif e.typ == nil: + result = tryExpr(c, n) + if result == nil: + result = newSymNode(errorSym(c, n)) + elif result.typ == nil: result = newSymNode(getSysSym"void") else: - result = symNodeFromType(c, e.typ, n.info) + result.typ = makeTypeDesc(c, result.typ) result.handleIsOperator = proc (n: PNode): PNode = result = IsOpImpl(c, n) @@ -210,7 +211,8 @@ proc semAfterMacroCall(c: PContext, n: PNode, s: PSym): PNode = of tyTypeDesc: if n.kind == nkStmtList: result.kind = nkStmtListType var typ = semTypeNode(c, result, nil) - result = symNodeFromType(c, typ, n.info) + result.typ = makeTypeDesc(c, typ) + #result = symNodeFromType(c, typ, n.info) else: result = semExpr(c, result) result = fitNode(c, s.typ.sons[0], result) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 337224aef9..775d4e7a05 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -191,7 +191,7 @@ proc isCastable(dst, src: PType): bool = proc isSymChoice(n: PNode): bool {.inline.} = result = n.kind in nkSymChoices -proc semConv(c: PContext, n: PNode, s: PSym): PNode = +proc semConv(c: PContext, n: PNode): PNode = if sonsLen(n) != 2: LocalError(n.info, errConvNeedsOneArg) return n @@ -738,8 +738,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = elif t != nil and t.kind == tyTypeDesc: if n.len == 1: return semObjConstr(c, n, flags) let destType = t.skipTypes({tyTypeDesc, tyGenericInst}) - result = semConv(c, n, symFromType(destType, n.info)) - return + return semConv(c, n) else: result = overloadedCallOpr(c, n) # Now that nkSym does not imply an iteration over the proc/iterator space, @@ -1048,7 +1047,9 @@ proc semSubscript(c: PContext, n: PNode, flags: TExprFlags): PNode = # The result so far is a tyTypeDesc bound # a tyGenericBody. The line below will substitute # it with the instantiated type. - result = symNodeFromType(c, semTypeNode(c, n, nil), n.info) + result = n + result.typ = makeTypeDesc(c, semTypeNode(c, n, nil)) + #result = symNodeFromType(c, semTypeNode(c, n, nil), n.info) of tyTuple: checkSonsLen(n, 2) n.sons[0] = makeDeref(n.sons[0]) @@ -1883,7 +1884,8 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result = semExpr(c, n.sons[0], flags) of nkTypeOfExpr, nkTupleTy, nkRefTy..nkEnumTy: var typ = semTypeNode(c, n, nil).skipTypes({tyTypeDesc}) - result = symNodeFromType(c, typ, n.info) + result.typ = makeTypeDesc(c, typ) + #result = symNodeFromType(c, typ, n.info) of nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit: # check if it is an expression macro: checkMinSonsLen(n, 1) @@ -1906,7 +1908,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of skType: # XXX think about this more (``set`` procs) if n.len == 2: - result = semConv(c, n, s) + result = semConv(c, n) elif n.len == 1: result = semObjConstr(c, n, flags) elif Contains(c.AmbiguousSymbols, s.id): diff --git a/tests/compile/tgeneric.nim b/tests/compile/tgeneric.nim index 8bda15c427..9292b729fa 100644 --- a/tests/compile/tgeneric.nim +++ b/tests/compile/tgeneric.nim @@ -8,4 +8,12 @@ proc foo(models: seq[TTable[string, float]]): seq[float] = for model in models.items: result.add model["foobar"] +# bug #686 +type TType[T; A] = array[A, T] + +proc foo[T](p: TType[T, range[0..1]]) = + echo "foo" +proc foo[T](p: TType[T, range[0..2]]) = + echo "bar" + diff --git a/tests/run/tdrdobbs_examples.nim b/tests/run/tdrdobbs_examples.nim new file mode 100644 index 0000000000..d1e0585d23 --- /dev/null +++ b/tests/run/tdrdobbs_examples.nim @@ -0,0 +1,134 @@ +discard """ + output: '''108 +11 -1 1936 +4.000000000000002-e001 +true +truefalse''' +""" + +proc `++`(x: var int; y: int = 1; z: int = 0) = + x = x + y + z + +var g = 70 +++g +g ++ 7 +g.`++`(10, 20) +echo g + + +#let lv = stdin.readline +#var vv = stdin.readline +#vv = "abc" # valid, reassignment allowed +#lv = "abc" # fails at compile time + +#proc square(x: int): int = x*x + +template square(x: int): int = + # ensure 'x' is only evaluated once: + let y = x + y * y + +proc mostSignificantBit(n: int): int = + # naive algorithm: + var n = n + while n != 0: + n = n shr 1 + result += 1 + result -= 1 + +const msb3999 = mostSignificantBit(3999) + +echo msb3999, " ", mostSignificantBit(0), " ", square(44) + +proc filter[T](a: openarray[T], predicate: proc (x: T): bool): seq[T] = + result = @[] # @[] constructs the empty seq + for x in a: + if predicate(x): result.add(x) + +proc map[T, S](a: openarray[T], fn: proc (x: T): S): seq[S] = + newSeq(result, a.len) + for i in 0 .. Date: Sat, 30 Nov 2013 03:15:14 +0100 Subject: [PATCH 047/326] fixes #681 --- compiler/sem.nim | 20 +++++++++++++++++++- tests/run/tvarious1.nim | 14 +++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/compiler/sem.nim b/compiler/sem.nim index eda4442529..3ace623bca 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -90,6 +90,24 @@ proc commonType*(x, y: PType): PType = let idx = ord(b.kind in {tyArray, tyArrayConstr}) if a.sons[idx].kind == tyEmpty: return y #elif b.sons[idx].kind == tyEmpty: return x + elif a.kind == tyRange and b.kind == tyRange: + # consider: (range[0..3], range[0..4]) here. We should make that + # range[0..4]. But then why is (range[0..4], 6) not range[0..6]? + # But then why is (2,4) not range[2..4]? But I think this would break + # too much code. So ... it's the same range or the base type. This means + # type(if b: 0 else 1) == int and not range[0..1]. For now. In the long + # run people expect ranges to work properly within a tuple. + if not sameType(a, b): + result = skipTypes(a, {tyRange}).skipIntLit + when false: + if a.kind != tyRange and b.kind == tyRange: + # XXX This really needs a better solution, but a proper fix now breaks + # code. + result = a #.skipIntLit + elif a.kind == tyRange and b.kind != tyRange: + result = b #.skipIntLit + elif a.kind in IntegralTypes and a.n != nil: + result = a #.skipIntLit else: var k = tyNone if a.kind in {tyRef, tyPtr}: @@ -103,7 +121,7 @@ proc commonType*(x, y: PType): PType = if result.isNil: return x if k != tyNone: let r = result - result = NewType(k, r.owner) + result = newType(k, r.owner) result.addSonSkipIntLit(r) proc isTopLevel(c: PContext): bool {.inline.} = diff --git a/tests/run/tvarious1.nim b/tests/run/tvarious1.nim index 9dd4af606c..6e4612ae30 100644 --- a/tests/run/tvarious1.nim +++ b/tests/run/tvarious1.nim @@ -2,7 +2,8 @@ discard """ file: "tlenopenarray.nim" output: '''1 0 -Whopie''' +Whopie +12''' """ echo len([1_000_000]) #OUT 1 @@ -27,3 +28,14 @@ var w = TWidget(names: initQueue[string]()) add(w.names, "Whopie") for n in w.names: echo(n) + +# bug #681 + +type TSomeRange = object + hour: range[0..23] + +var value: string +var val12 = TSomeRange(hour: 12) + +value = $(if val12.hour > 12: val12.hour - 12 else: val12.hour) +echo value From 0d193a446b8c1078bde6a150503a7b006ffba72e Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 30 Nov 2013 03:28:31 +0100 Subject: [PATCH 048/326] updated fsmonitor module --- lib/pure/fsmonitor.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pure/fsmonitor.nim b/lib/pure/fsmonitor.nim index a554cf963b..d6584c1a0f 100644 --- a/lib/pure/fsmonitor.nim +++ b/lib/pure/fsmonitor.nim @@ -64,10 +64,10 @@ const proc newMonitor*(): PFSMonitor = ## Creates a new file system monitor. new(result) - result.fd = inotifyInit() result.targets = initTable[cint, string]() + result.fd = inotifyInit() if result.fd < 0: - OSError() + OSError(OSLastError()) proc add*(monitor: PFSMonitor, target: string, filters = {MonitorAll}): cint {.discardable.} = @@ -93,7 +93,7 @@ proc add*(monitor: PFSMonitor, target: string, result = inotifyAddWatch(monitor.fd, target, INFilter.uint32) if result < 0: - OSError() + OSError(OSLastError()) monitor.targets.add(result, target) proc del*(monitor: PFSMonitor, wd: cint) = @@ -101,7 +101,7 @@ proc del*(monitor: PFSMonitor, wd: cint) = ## ## If ``wd`` is not a part of ``monitor`` an EOS error is raised. if inotifyRmWatch(monitor.fd, wd) < 0: - OSError() + OSError(OSLastError()) proc getEvent(m: PFSMonitor, fd: cint): seq[TMonitorEvent] = result = @[] @@ -184,7 +184,7 @@ proc FSMonitorRead(h: PObject) = proc toDelegate(m: PFSMonitor): PDelegate = result = newDelegate() result.deleVal = m - result.fd = m.fd + result.fd = (type(result.fd))(m.fd) result.mode = fmRead result.handleRead = FSMonitorRead result.open = true From f91a34c9e6ab91b57627803631cf099cd11e32ab Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sat, 30 Nov 2013 21:03:41 +0100 Subject: [PATCH 049/326] Adds an example to htmlparser showing how to save changes. --- lib/pure/htmlparser.nim | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim index d60d2e5830..c39f5ff97d 100644 --- a/lib/pure/htmlparser.nim +++ b/lib/pure/htmlparser.nim @@ -17,11 +17,37 @@ ## ## echo loadHtml("mydirty.html") ## -## ## Every tag in the resulting tree is in lower case. ## ## **Note:** The resulting ``PXmlNode`` already uses the ``clientData`` field, ## so it cannot be used by clients of this library. +## +## Example: Transforming hyperlinks +## ================================ +## +## This code demonstrates how you can iterate over all the tags in an HTML file +## and write back the modified version. In this case we look for hyperlinks +## ending with the extension ``.rst`` and convert them to ``.html``. +## +## .. code-block:: nimrod +## +## import htmlparser +## import xmltree # To use '$' for PXmlNode +## import strtabs # To access PXmlAttributes +## import os # To use splitFile +## import strutils # To use cmpIgnoreCase +## +## proc transformHyperlinks() = +## let html = loadHTML("input.html") +## +## for a in html.findAll("a"): +## let href = a.attrs["href"] +## if not href.isNil: +## let (dir, filename, ext) = splitFile(href) +## if cmpIgnoreCase(ext, ".rst") == 0: +## a.attrs["href"] = dir / filename & ".html" +## +## writeFile("output.html", $html) import strutils, streams, parsexml, xmltree, unicode, strtabs From f59e502382b09e17dd3d30ad249c0b58dd7811f3 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 1 Dec 2013 14:04:15 +0100 Subject: [PATCH 050/326] better error message for implicitly available modules --- lib/system/channels.nim | 3 +++ lib/system/threads.nim | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/system/channels.nim b/lib/system/channels.nim index d0294322a2..9c3cc93e0b 100644 --- a/lib/system/channels.nim +++ b/lib/system/channels.nim @@ -13,6 +13,9 @@ ## ## **Note:** The current implementation of message passing is slow and does ## not work with cyclic data structures. + +when not defined(NimString): + {.error: "You must not import this module explicitly".} type pbytes = ptr array[0.. 0xffff, byte] diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 7d74de92d2..104ca63c16 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -39,6 +39,9 @@ ## createThread(thr[i], threadFunc, (i*10, i*10+5)) ## joinThreads(thr) +when not defined(NimString): + {.error: "You must not import this module explicitly".} + const maxRegisters = 256 # don't think there is an arch with more registers useStackMaskHack = false ## use the stack mask hack for better performance From 5dcfa97fb959eda3cb8a41e2bd39e998c30052c8 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 1 Dec 2013 17:02:56 +0100 Subject: [PATCH 051/326] fixes #696 --- compiler/semstmts.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index da8ba50a86..a1805fdec0 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1087,6 +1087,8 @@ proc semIterator(c: PContext, n: PNode): PNode = # -- at least for 0.9.2. if s.typ.callConv == ccClosure: incl(s.typ.flags, tfCapturesEnv) + else: + s.typ.callConv = ccInline when false: if s.typ.callConv != ccInline: s.typ.callConv = ccClosure From d1284ff33d936ed9ab67db2cb85571d3c37e8feb Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 1 Dec 2013 21:07:50 +0100 Subject: [PATCH 052/326] Mentions tuple unpacking only works in var/let blocks. --- doc/tut1.txt | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/doc/tut1.txt b/doc/tut1.txt index b46fb2c686..2070c69d60 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -1361,13 +1361,13 @@ Even though you don't need to declare a type for a tuple to use it, tuples created with different field names will be considered different objects despite having the same field types. -Tuples can be *unpacked* during variable assignment. This can be handy to -assign directly the fields of the tuples to individually named variables. An -example of this is the ``splitFile`` proc from the `os module `_ which -returns the directory, name and extension of a path at the same time. For tuple -unpacking to work you have to use parenthesis around the values you want to -assign the unpacking to, otherwise you will be assigning the same value to all -the individual variables! Example: +Tuples can be *unpacked* during variable assignment (and only then!). This can +be handy to assign directly the fields of the tuples to individually named +variables. An example of this is the ``splitFile`` proc from the `os module +`_ which returns the directory, name and extension of a path at the +same time. For tuple unpacking to work you have to use parenthesis around the +values you want to assign the unpacking to, otherwise you will be assigning the +same value to all the individual variables! Example: .. code-block:: nimrod @@ -1386,6 +1386,20 @@ the individual variables! Example: echo badname echo badext +Tuple unpacking **only** works in ``var`` or ``let`` blocks. The following code +won't compile: + +.. code-block:: nimrod + + import os + + var + path = "usr/local/nimrodc.html" + dir, name, ext = "" + + (dir, name, ext) = splitFile(path) + # --> Error: '(dir, name, ext)' cannot be assigned to + Reference and pointer types --------------------------- From 944b4685b9cff18fc865e4c16d2bce9bf89e29c0 Mon Sep 17 00:00:00 2001 From: fowlmouth Date: Sun, 1 Dec 2013 21:10:06 -0600 Subject: [PATCH 053/326] removed x11 --- examples/x11ex.nim | 71 - lib/wrappers/x11/cursorfont.nim | 110 -- lib/wrappers/x11/keysym.nim | 1926 ------------------------- lib/wrappers/x11/x.nim | 401 ------ lib/wrappers/x11/x11pragma.nim | 20 - lib/wrappers/x11/xatom.nim | 81 -- lib/wrappers/x11/xcms.nim | 396 ----- lib/wrappers/x11/xf86dga.nim | 235 --- lib/wrappers/x11/xf86vmode.nim | 229 --- lib/wrappers/x11/xi.nim | 307 ---- lib/wrappers/x11/xinerama.nim | 25 - lib/wrappers/x11/xkb.nim | 2387 ------------------------------- lib/wrappers/x11/xkblib.nim | 661 --------- lib/wrappers/x11/xlib.nim | 2027 -------------------------- lib/wrappers/x11/xrandr.nim | 194 --- lib/wrappers/x11/xrender.nim | 241 ---- lib/wrappers/x11/xresource.nim | 200 --- lib/wrappers/x11/xshm.nim | 77 - lib/wrappers/x11/xutil.nim | 412 ------ lib/wrappers/x11/xv.nim | 84 -- lib/wrappers/x11/xvlib.nim | 234 --- 21 files changed, 10318 deletions(-) delete mode 100644 examples/x11ex.nim delete mode 100644 lib/wrappers/x11/cursorfont.nim delete mode 100644 lib/wrappers/x11/keysym.nim delete mode 100644 lib/wrappers/x11/x.nim delete mode 100644 lib/wrappers/x11/x11pragma.nim delete mode 100644 lib/wrappers/x11/xatom.nim delete mode 100644 lib/wrappers/x11/xcms.nim delete mode 100644 lib/wrappers/x11/xf86dga.nim delete mode 100644 lib/wrappers/x11/xf86vmode.nim delete mode 100644 lib/wrappers/x11/xi.nim delete mode 100644 lib/wrappers/x11/xinerama.nim delete mode 100644 lib/wrappers/x11/xkb.nim delete mode 100644 lib/wrappers/x11/xkblib.nim delete mode 100644 lib/wrappers/x11/xlib.nim delete mode 100644 lib/wrappers/x11/xrandr.nim delete mode 100644 lib/wrappers/x11/xrender.nim delete mode 100644 lib/wrappers/x11/xresource.nim delete mode 100644 lib/wrappers/x11/xshm.nim delete mode 100644 lib/wrappers/x11/xutil.nim delete mode 100644 lib/wrappers/x11/xv.nim delete mode 100644 lib/wrappers/x11/xvlib.nim diff --git a/examples/x11ex.nim b/examples/x11ex.nim deleted file mode 100644 index 6c63d0a01a..0000000000 --- a/examples/x11ex.nim +++ /dev/null @@ -1,71 +0,0 @@ -import xlib, xutil, x, keysym - -const - WINDOW_WIDTH = 400 - WINDOW_HEIGHT = 300 - -var - width, height: cuint - display: PDisplay - screen: cint - depth: int - win: TWindow - sizeHints: TXSizeHints - -proc create_window = - width = WINDOW_WIDTH - height = WINDOW_HEIGHT - - display = XOpenDisplay(nil) - if display == nil: - echo("Verbindung zum X-Server fehlgeschlagen") - quit(1) - - screen = XDefaultScreen(display) - depth = XDefaultDepth(display, screen) - var rootwin = XRootWindow(display, screen) - win = XCreateSimpleWindow(display, rootwin, 100, 10, - width, height, 5, - XBlackPixel(display, screen), - XWhitePixel(display, screen)) - size_hints.flags = PSize or PMinSize or PMaxSize - size_hints.min_width = width.cint - size_hints.max_width = width.cint - size_hints.min_height = height.cint - size_hints.max_height = height.cint - discard XSetStandardProperties(display, win, "Simple Window", "window", - 0, nil, 0, addr(size_hints)) - discard XSelectInput(display, win, ButtonPressMask or KeyPressMask or - PointerMotionMask) - discard XMapWindow(display, win) - -proc close_window = - discard XDestroyWindow(display, win) - discard XCloseDisplay(display) - -var - xev: TXEvent - -proc process_event = - var key: TKeySym - case int(xev.theType) - of KeyPress: - key = XLookupKeysym(cast[ptr TXKeyEvent](addr(xev)), 0) - if key.int != 0: - echo("keyboard event") - of ButtonPressMask, PointerMotionMask: - Echo("Mouse event") - else: nil - -proc eventloop = - discard XFlush(display) - var num_events = int(XPending(display)) - while num_events != 0: - dec(num_events) - discard XNextEvent(display, addr(xev)) - process_event() - -create_window() -while true: - eventloop() -close_window() diff --git a/lib/wrappers/x11/cursorfont.nim b/lib/wrappers/x11/cursorfont.nim deleted file mode 100644 index b262ad7c11..0000000000 --- a/lib/wrappers/x11/cursorfont.nim +++ /dev/null @@ -1,110 +0,0 @@ -# $Xorg: cursorfont.h,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $ -# -# -#Copyright 1987, 1998 The Open Group -# -#Permission to use, copy, modify, distribute, and sell this software and its -#documentation for any purpose is hereby granted without fee, provided that -#the above copyright notice appear in all copies and that both that -#copyright notice and this permission notice appear in supporting -#documentation. -# -#The above copyright notice and this permission notice shall be included -#in all copies or substantial portions of the Software. -# -#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -#OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -#IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -#OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -#ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -#OTHER DEALINGS IN THE SOFTWARE. -# -#Except as contained in this notice, the name of The Open Group shall -#not be used in advertising or otherwise to promote the sale, use or -#other dealings in this Software without prior written authorization -#from The Open Group. -# -# - -const - XC_num_glyphs* = 154 - XC_X_cursor* = 0 - XC_arrow* = 2 - XC_based_arrow_down* = 4 - XC_based_arrow_up* = 6 - XC_boat* = 8 - XC_bogosity* = 10 - XC_bottom_left_corner* = 12 - XC_bottom_right_corner* = 14 - XC_bottom_side* = 16 - XC_bottom_tee* = 18 - XC_box_spiral* = 20 - XC_center_ptr* = 22 - XC_circle* = 24 - XC_clock* = 26 - XC_coffee_mug* = 28 - XC_cross* = 30 - XC_cross_reverse* = 32 - XC_crosshair* = 34 - XC_diamond_cross* = 36 - XC_dot* = 38 - XC_dotbox* = 40 - XC_double_arrow* = 42 - XC_draft_large* = 44 - XC_draft_small* = 46 - XC_draped_box* = 48 - XC_exchange* = 50 - XC_fleur* = 52 - XC_gobbler* = 54 - XC_gumby* = 56 - XC_hand1* = 58 - XC_hand2* = 60 - XC_heart* = 62 - XC_icon* = 64 - XC_iron_cross* = 66 - XC_left_ptr* = 68 - XC_left_side* = 70 - XC_left_tee* = 72 - XC_leftbutton* = 74 - XC_ll_angle* = 76 - XC_lr_angle* = 78 - XC_man* = 80 - XC_middlebutton* = 82 - XC_mouse* = 84 - XC_pencil* = 86 - XC_pirate* = 88 - XC_plus* = 90 - XC_question_arrow* = 92 - XC_right_ptr* = 94 - XC_right_side* = 96 - XC_right_tee* = 98 - XC_rightbutton* = 100 - XC_rtl_logo* = 102 - XC_sailboat* = 104 - XC_sb_down_arrow* = 106 - XC_sb_h_double_arrow* = 108 - XC_sb_left_arrow* = 110 - XC_sb_right_arrow* = 112 - XC_sb_up_arrow* = 114 - XC_sb_v_double_arrow* = 116 - XC_shuttle* = 118 - XC_sizing* = 120 - XC_spider* = 122 - XC_spraycan* = 124 - XC_star* = 126 - XC_target* = 128 - XC_tcross* = 130 - XC_top_left_arrow* = 132 - XC_top_left_corner* = 134 - XC_top_right_corner* = 136 - XC_top_side* = 138 - XC_top_tee* = 140 - XC_trek* = 142 - XC_ul_angle* = 144 - XC_umbrella* = 146 - XC_ur_angle* = 148 - XC_watch* = 150 - XC_xterm* = 152 - -# implementation diff --git a/lib/wrappers/x11/keysym.nim b/lib/wrappers/x11/keysym.nim deleted file mode 100644 index c001ab6224..0000000000 --- a/lib/wrappers/x11/keysym.nim +++ /dev/null @@ -1,1926 +0,0 @@ -# -#Converted from X11/keysym.h and X11/keysymdef.h -# -#Capital letter consts renamed from XK_... to XKc_... -# (since Pascal isn't case-sensitive) -# -#i.e. -#C Pascal -#XK_a XK_a -#XK_A XKc_A -# - -#* default keysyms * -import x - -const - XK_VoidSymbol*: TKeySym = 0x00FFFFFF # void symbol - -when defined(XK_MISCELLANY) or true: - const - #* - # * TTY Functions, cleverly chosen to map to ascii, for convenience of - # * programming, but could have been arbitrary (at the cost of lookup - # * tables in client code. - # * - XK_BackSpace*: TKeySym = 0x0000FF08 # back space, back char - XK_Tab*: TKeySym = 0x0000FF09 - XK_Linefeed*: TKeySym = 0x0000FF0A # Linefeed, LF - XK_Clear*: TKeySym = 0x0000FF0B - XK_Return*: TKeySym = 0x0000FF0D # Return, enter - XK_Pause*: TKeySym = 0x0000FF13 # Pause, hold - XK_Scroll_Lock*: TKeySym = 0x0000FF14 - XK_Sys_Req*: TKeySym = 0x0000FF15 - XK_Escape*: TKeySym = 0x0000FF1B - XK_Delete*: TKeySym = 0x0000FFFF # Delete, rubout \ - # International & multi-key character composition - XK_Multi_key*: TKeySym = 0x0000FF20 # Multi-key character compose - XK_Codeinput*: TKeySym = 0x0000FF37 - XK_SingleCandidate*: TKeySym = 0x0000FF3C - XK_MultipleCandidate*: TKeySym = 0x0000FF3D - XK_PreviousCandidate*: TKeySym = 0x0000FF3E # Japanese keyboard support - XK_Kanji*: TKeySym = 0x0000FF21 # Kanji, Kanji convert - XK_Muhenkan*: TKeySym = 0x0000FF22 # Cancel Conversion - XK_Henkan_Mode*: TKeySym = 0x0000FF23 # Start/Stop Conversion - XK_Henkan*: TKeySym = 0x0000FF23 # Alias for Henkan_Mode - XK_Romaji*: TKeySym = 0x0000FF24 # to Romaji - XK_Hiragana*: TKeySym = 0x0000FF25 # to Hiragana - XK_Katakana*: TKeySym = 0x0000FF26 # to Katakana - XK_Hiragana_Katakana*: TKeySym = 0x0000FF27 # Hiragana/Katakana toggle - XK_Zenkaku*: TKeySym = 0x0000FF28 # to Zenkaku - XK_Hankaku*: TKeySym = 0x0000FF29 # to Hankaku - XK_Zenkaku_Hankaku*: TKeySym = 0x0000FF2A # Zenkaku/Hankaku toggle - XK_Touroku*: TKeySym = 0x0000FF2B # Add to Dictionary - XK_Massyo*: TKeySym = 0x0000FF2C # Delete from Dictionary - XK_Kana_Lock*: TKeySym = 0x0000FF2D # Kana Lock - XK_Kana_Shift*: TKeySym = 0x0000FF2E # Kana Shift - XK_Eisu_Shift*: TKeySym = 0x0000FF2F # Alphanumeric Shift - XK_Eisu_toggle*: TKeySym = 0x0000FF30 # Alphanumeric toggle - XK_Kanji_Bangou*: TKeySym = 0x0000FF37 # Codeinput - XK_Zen_Koho*: TKeySym = 0x0000FF3D # Multiple/All Candidate(s) - XK_Mae_Koho*: TKeySym = 0x0000FF3E # Previous Candidate \ - # = $FF31 thru = $FF3F are under XK_KOREAN - # Cursor control & motion - XK_Home*: TKeySym = 0x0000FF50 - XK_Left*: TKeySym = 0x0000FF51 # Move left, left arrow - XK_Up*: TKeySym = 0x0000FF52 # Move up, up arrow - XK_Right*: TKeySym = 0x0000FF53 # Move right, right arrow - XK_Down*: TKeySym = 0x0000FF54 # Move down, down arrow - XK_Prior*: TKeySym = 0x0000FF55 # Prior, previous - XK_Page_Up*: TKeySym = 0x0000FF55 - XK_Next*: TKeySym = 0x0000FF56 # Next - XK_Page_Down*: TKeySym = 0x0000FF56 - XK_End*: TKeySym = 0x0000FF57 # EOL - XK_Begin*: TKeySym = 0x0000FF58 # BOL \ - # Misc Functions - XK_Select*: TKeySym = 0x0000FF60 # Select, mark - XK_Print*: TKeySym = 0x0000FF61 - XK_Execute*: TKeySym = 0x0000FF62 # Execute, run, do - XK_Insert*: TKeySym = 0x0000FF63 # Insert, insert here - XK_Undo*: TKeySym = 0x0000FF65 # Undo, oops - XK_Redo*: TKeySym = 0x0000FF66 # redo, again - XK_Menu*: TKeySym = 0x0000FF67 - XK_Find*: TKeySym = 0x0000FF68 # Find, search - XK_Cancel*: TKeySym = 0x0000FF69 # Cancel, stop, abort, exit - XK_Help*: TKeySym = 0x0000FF6A # Help - XK_Break*: TKeySym = 0x0000FF6B - XK_Mode_switch*: TKeySym = 0x0000FF7E # Character set switch - XK_script_switch*: TKeySym = 0x0000FF7E # Alias for mode_switch - XK_Num_Lock*: TKeySym = 0x0000FF7F # Keypad Functions, keypad numbers cleverly chosen to map to ascii - XK_KP_Space*: TKeySym = 0x0000FF80 # space - XK_KP_Tab*: TKeySym = 0x0000FF89 - XK_KP_Enter*: TKeySym = 0x0000FF8D # enter - XK_KP_F1*: TKeySym = 0x0000FF91 # PF1, KP_A, ... - XK_KP_F2*: TKeySym = 0x0000FF92 - XK_KP_F3*: TKeySym = 0x0000FF93 - XK_KP_F4*: TKeySym = 0x0000FF94 - XK_KP_Home*: TKeySym = 0x0000FF95 - XK_KP_Left*: TKeySym = 0x0000FF96 - XK_KP_Up*: TKeySym = 0x0000FF97 - XK_KP_Right*: TKeySym = 0x0000FF98 - XK_KP_Down*: TKeySym = 0x0000FF99 - XK_KP_Prior*: TKeySym = 0x0000FF9A - XK_KP_Page_Up*: TKeySym = 0x0000FF9A - XK_KP_Next*: TKeySym = 0x0000FF9B - XK_KP_Page_Down*: TKeySym = 0x0000FF9B - XK_KP_End*: TKeySym = 0x0000FF9C - XK_KP_Begin*: TKeySym = 0x0000FF9D - XK_KP_Insert*: TKeySym = 0x0000FF9E - XK_KP_Delete*: TKeySym = 0x0000FF9F - XK_KP_Equal*: TKeySym = 0x0000FFBD # equals - XK_KP_Multiply*: TKeySym = 0x0000FFAA - XK_KP_Add*: TKeySym = 0x0000FFAB - XK_KP_Separator*: TKeySym = 0x0000FFAC # separator, often comma - XK_KP_Subtract*: TKeySym = 0x0000FFAD - XK_KP_Decimal*: TKeySym = 0x0000FFAE - XK_KP_Divide*: TKeySym = 0x0000FFAF - XK_KP_0*: TKeySym = 0x0000FFB0 - XK_KP_1*: TKeySym = 0x0000FFB1 - XK_KP_2*: TKeySym = 0x0000FFB2 - XK_KP_3*: TKeySym = 0x0000FFB3 - XK_KP_4*: TKeySym = 0x0000FFB4 - XK_KP_5*: TKeySym = 0x0000FFB5 - XK_KP_6*: TKeySym = 0x0000FFB6 - XK_KP_7*: TKeySym = 0x0000FFB7 - XK_KP_8*: TKeySym = 0x0000FFB8 - XK_KP_9*: TKeySym = 0x0000FFB9 #*\ - # * Auxilliary Functions; note the duplicate definitions for left and right - # * function keys; Sun keyboards and a few other manufactures have such - # * function key groups on the left and/or right sides of the keyboard. - # * We've not found a keyboard with more than 35 function keys total. - # * - XK_F1*: TKeySym = 0x0000FFBE - XK_F2*: TKeySym = 0x0000FFBF - XK_F3*: TKeySym = 0x0000FFC0 - XK_F4*: TKeySym = 0x0000FFC1 - XK_F5*: TKeySym = 0x0000FFC2 - XK_F6*: TKeySym = 0x0000FFC3 - XK_F7*: TKeySym = 0x0000FFC4 - XK_F8*: TKeySym = 0x0000FFC5 - XK_F9*: TKeySym = 0x0000FFC6 - XK_F10*: TKeySym = 0x0000FFC7 - XK_F11*: TKeySym = 0x0000FFC8 - XK_L1*: TKeySym = 0x0000FFC8 - XK_F12*: TKeySym = 0x0000FFC9 - XK_L2*: TKeySym = 0x0000FFC9 - XK_F13*: TKeySym = 0x0000FFCA - XK_L3*: TKeySym = 0x0000FFCA - XK_F14*: TKeySym = 0x0000FFCB - XK_L4*: TKeySym = 0x0000FFCB - XK_F15*: TKeySym = 0x0000FFCC - XK_L5*: TKeySym = 0x0000FFCC - XK_F16*: TKeySym = 0x0000FFCD - XK_L6*: TKeySym = 0x0000FFCD - XK_F17*: TKeySym = 0x0000FFCE - XK_L7*: TKeySym = 0x0000FFCE - XK_F18*: TKeySym = 0x0000FFCF - XK_L8*: TKeySym = 0x0000FFCF - XK_F19*: TKeySym = 0x0000FFD0 - XK_L9*: TKeySym = 0x0000FFD0 - XK_F20*: TKeySym = 0x0000FFD1 - XK_L10*: TKeySym = 0x0000FFD1 - XK_F21*: TKeySym = 0x0000FFD2 - XK_R1*: TKeySym = 0x0000FFD2 - XK_F22*: TKeySym = 0x0000FFD3 - XK_R2*: TKeySym = 0x0000FFD3 - XK_F23*: TKeySym = 0x0000FFD4 - XK_R3*: TKeySym = 0x0000FFD4 - XK_F24*: TKeySym = 0x0000FFD5 - XK_R4*: TKeySym = 0x0000FFD5 - XK_F25*: TKeySym = 0x0000FFD6 - XK_R5*: TKeySym = 0x0000FFD6 - XK_F26*: TKeySym = 0x0000FFD7 - XK_R6*: TKeySym = 0x0000FFD7 - XK_F27*: TKeySym = 0x0000FFD8 - XK_R7*: TKeySym = 0x0000FFD8 - XK_F28*: TKeySym = 0x0000FFD9 - XK_R8*: TKeySym = 0x0000FFD9 - XK_F29*: TKeySym = 0x0000FFDA - XK_R9*: TKeySym = 0x0000FFDA - XK_F30*: TKeySym = 0x0000FFDB - XK_R10*: TKeySym = 0x0000FFDB - XK_F31*: TKeySym = 0x0000FFDC - XK_R11*: TKeySym = 0x0000FFDC - XK_F32*: TKeySym = 0x0000FFDD - XK_R12*: TKeySym = 0x0000FFDD - XK_F33*: TKeySym = 0x0000FFDE - XK_R13*: TKeySym = 0x0000FFDE - XK_F34*: TKeySym = 0x0000FFDF - XK_R14*: TKeySym = 0x0000FFDF - XK_F35*: TKeySym = 0x0000FFE0 - XK_R15*: TKeySym = 0x0000FFE0 # Modifiers - XK_Shift_L*: TKeySym = 0x0000FFE1 # Left shift - XK_Shift_R*: TKeySym = 0x0000FFE2 # Right shift - XK_Control_L*: TKeySym = 0x0000FFE3 # Left control - XK_Control_R*: TKeySym = 0x0000FFE4 # Right control - XK_Caps_Lock*: TKeySym = 0x0000FFE5 # Caps lock - XK_Shift_Lock*: TKeySym = 0x0000FFE6 # Shift lock - XK_Meta_L*: TKeySym = 0x0000FFE7 # Left meta - XK_Meta_R*: TKeySym = 0x0000FFE8 # Right meta - XK_Alt_L*: TKeySym = 0x0000FFE9 # Left alt - XK_Alt_R*: TKeySym = 0x0000FFEA # Right alt - XK_Super_L*: TKeySym = 0x0000FFEB # Left super - XK_Super_R*: TKeySym = 0x0000FFEC # Right super - XK_Hyper_L*: TKeySym = 0x0000FFED # Left hyper - XK_Hyper_R*: TKeySym = 0x0000FFEE # Right hyper -# XK_MISCELLANY -#* -# * ISO 9995 Function and Modifier Keys -# * Byte 3 = = $FE -# * - -when defined(XK_XKB_KEYS) or true: - const - XK_ISO_Lock*: TKeySym = 0x0000FE01 - XK_ISO_Level2_Latch*: TKeySym = 0x0000FE02 - XK_ISO_Level3_Shift*: TKeySym = 0x0000FE03 - XK_ISO_Level3_Latch*: TKeySym = 0x0000FE04 - XK_ISO_Level3_Lock*: TKeySym = 0x0000FE05 - XK_ISO_Group_Shift*: TKeySym = 0x0000FF7E # Alias for mode_switch - XK_ISO_Group_Latch*: TKeySym = 0x0000FE06 - XK_ISO_Group_Lock*: TKeySym = 0x0000FE07 - XK_ISO_Next_Group*: TKeySym = 0x0000FE08 - XK_ISO_Next_Group_Lock*: TKeySym = 0x0000FE09 - XK_ISO_Prev_Group*: TKeySym = 0x0000FE0A - XK_ISO_Prev_Group_Lock*: TKeySym = 0x0000FE0B - XK_ISO_First_Group*: TKeySym = 0x0000FE0C - XK_ISO_First_Group_Lock*: TKeySym = 0x0000FE0D - XK_ISO_Last_Group*: TKeySym = 0x0000FE0E - XK_ISO_Last_Group_Lock*: TKeySym = 0x0000FE0F - XK_ISO_Left_Tab*: TKeySym = 0x0000FE20 - XK_ISO_Move_Line_Up*: TKeySym = 0x0000FE21 - XK_ISO_Move_Line_Down*: TKeySym = 0x0000FE22 - XK_ISO_Partial_Line_Up*: TKeySym = 0x0000FE23 - XK_ISO_Partial_Line_Down*: TKeySym = 0x0000FE24 - XK_ISO_Partial_Space_Left*: TKeySym = 0x0000FE25 - XK_ISO_Partial_Space_Right*: TKeySym = 0x0000FE26 - XK_ISO_Set_Margin_Left*: TKeySym = 0x0000FE27 - XK_ISO_Set_Margin_Right*: TKeySym = 0x0000FE28 - XK_ISO_Release_Margin_Left*: TKeySym = 0x0000FE29 - XK_ISO_Release_Margin_Right*: TKeySym = 0x0000FE2A - XK_ISO_Release_Both_Margins*: TKeySym = 0x0000FE2B - XK_ISO_Fast_Cursor_Left*: TKeySym = 0x0000FE2C - XK_ISO_Fast_Cursor_Right*: TKeySym = 0x0000FE2D - XK_ISO_Fast_Cursor_Up*: TKeySym = 0x0000FE2E - XK_ISO_Fast_Cursor_Down*: TKeySym = 0x0000FE2F - XK_ISO_Continuous_Underline*: TKeySym = 0x0000FE30 - XK_ISO_Discontinuous_Underline*: TKeySym = 0x0000FE31 - XK_ISO_Emphasize*: TKeySym = 0x0000FE32 - XK_ISO_Center_Object*: TKeySym = 0x0000FE33 - XK_ISO_Enter*: TKeySym = 0x0000FE34 - XK_dead_grave*: TKeySym = 0x0000FE50 - XK_dead_acute*: TKeySym = 0x0000FE51 - XK_dead_circumflex*: TKeySym = 0x0000FE52 - XK_dead_tilde*: TKeySym = 0x0000FE53 - XK_dead_macron*: TKeySym = 0x0000FE54 - XK_dead_breve*: TKeySym = 0x0000FE55 - XK_dead_abovedot*: TKeySym = 0x0000FE56 - XK_dead_diaeresis*: TKeySym = 0x0000FE57 - XK_dead_abovering*: TKeySym = 0x0000FE58 - XK_dead_doubleacute*: TKeySym = 0x0000FE59 - XK_dead_caron*: TKeySym = 0x0000FE5A - XK_dead_cedilla*: TKeySym = 0x0000FE5B - XK_dead_ogonek*: TKeySym = 0x0000FE5C - XK_dead_iota*: TKeySym = 0x0000FE5D - XK_dead_voiced_sound*: TKeySym = 0x0000FE5E - XK_dead_semivoiced_sound*: TKeySym = 0x0000FE5F - XK_dead_belowdot*: TKeySym = 0x0000FE60 - XK_dead_hook*: TKeySym = 0x0000FE61 - XK_dead_horn*: TKeySym = 0x0000FE62 - XK_First_Virtual_Screen*: TKeySym = 0x0000FED0 - XK_Prev_Virtual_Screen*: TKeySym = 0x0000FED1 - XK_Next_Virtual_Screen*: TKeySym = 0x0000FED2 - XK_Last_Virtual_Screen*: TKeySym = 0x0000FED4 - XK_Terminate_Server*: TKeySym = 0x0000FED5 - XK_AccessX_Enable*: TKeySym = 0x0000FE70 - XK_AccessX_Feedback_Enable*: TKeySym = 0x0000FE71 - XK_RepeatKeys_Enable*: TKeySym = 0x0000FE72 - XK_SlowKeys_Enable*: TKeySym = 0x0000FE73 - XK_BounceKeys_Enable*: TKeySym = 0x0000FE74 - XK_StickyKeys_Enable*: TKeySym = 0x0000FE75 - XK_MouseKeys_Enable*: TKeySym = 0x0000FE76 - XK_MouseKeys_Accel_Enable*: TKeySym = 0x0000FE77 - XK_Overlay1_Enable*: TKeySym = 0x0000FE78 - XK_Overlay2_Enable*: TKeySym = 0x0000FE79 - XK_AudibleBell_Enable*: TKeySym = 0x0000FE7A - XK_Pointer_Left*: TKeySym = 0x0000FEE0 - XK_Pointer_Right*: TKeySym = 0x0000FEE1 - XK_Pointer_Up*: TKeySym = 0x0000FEE2 - XK_Pointer_Down*: TKeySym = 0x0000FEE3 - XK_Pointer_UpLeft*: TKeySym = 0x0000FEE4 - XK_Pointer_UpRight*: TKeySym = 0x0000FEE5 - XK_Pointer_DownLeft*: TKeySym = 0x0000FEE6 - XK_Pointer_DownRight*: TKeySym = 0x0000FEE7 - XK_Pointer_Button_Dflt*: TKeySym = 0x0000FEE8 - XK_Pointer_Button1*: TKeySym = 0x0000FEE9 - XK_Pointer_Button2*: TKeySym = 0x0000FEEA - XK_Pointer_Button3*: TKeySym = 0x0000FEEB - XK_Pointer_Button4*: TKeySym = 0x0000FEEC - XK_Pointer_Button5*: TKeySym = 0x0000FEED - XK_Pointer_DblClick_Dflt*: TKeySym = 0x0000FEEE - XK_Pointer_DblClick1*: TKeySym = 0x0000FEEF - XK_Pointer_DblClick2*: TKeySym = 0x0000FEF0 - XK_Pointer_DblClick3*: TKeySym = 0x0000FEF1 - XK_Pointer_DblClick4*: TKeySym = 0x0000FEF2 - XK_Pointer_DblClick5*: TKeySym = 0x0000FEF3 - XK_Pointer_Drag_Dflt*: TKeySym = 0x0000FEF4 - XK_Pointer_Drag1*: TKeySym = 0x0000FEF5 - XK_Pointer_Drag2*: TKeySym = 0x0000FEF6 - XK_Pointer_Drag3*: TKeySym = 0x0000FEF7 - XK_Pointer_Drag4*: TKeySym = 0x0000FEF8 - XK_Pointer_Drag5*: TKeySym = 0x0000FEFD - XK_Pointer_EnableKeys*: TKeySym = 0x0000FEF9 - XK_Pointer_Accelerate*: TKeySym = 0x0000FEFA - XK_Pointer_DfltBtnNext*: TKeySym = 0x0000FEFB - XK_Pointer_DfltBtnPrev*: TKeySym = 0x0000FEFC - #* - # * 3270 Terminal Keys - # * Byte 3 = = $FD - # * - -when defined(XK_3270) or true: - const - XK_3270_Duplicate*: TKeySym = 0x0000FD01 - XK_3270_FieldMark*: TKeySym = 0x0000FD02 - XK_3270_Right2*: TKeySym = 0x0000FD03 - XK_3270_Left2*: TKeySym = 0x0000FD04 - XK_3270_BackTab*: TKeySym = 0x0000FD05 - XK_3270_EraseEOF*: TKeySym = 0x0000FD06 - XK_3270_EraseInput*: TKeySym = 0x0000FD07 - XK_3270_Reset*: TKeySym = 0x0000FD08 - XK_3270_Quit*: TKeySym = 0x0000FD09 - XK_3270_PA1*: TKeySym = 0x0000FD0A - XK_3270_PA2*: TKeySym = 0x0000FD0B - XK_3270_PA3*: TKeySym = 0x0000FD0C - XK_3270_Test*: TKeySym = 0x0000FD0D - XK_3270_Attn*: TKeySym = 0x0000FD0E - XK_3270_CursorBlink*: TKeySym = 0x0000FD0F - XK_3270_AltCursor*: TKeySym = 0x0000FD10 - XK_3270_KeyClick*: TKeySym = 0x0000FD11 - XK_3270_Jump*: TKeySym = 0x0000FD12 - XK_3270_Ident*: TKeySym = 0x0000FD13 - XK_3270_Rule*: TKeySym = 0x0000FD14 - XK_3270_Copy*: TKeySym = 0x0000FD15 - XK_3270_Play*: TKeySym = 0x0000FD16 - XK_3270_Setup*: TKeySym = 0x0000FD17 - XK_3270_Record*: TKeySym = 0x0000FD18 - XK_3270_ChangeScreen*: TKeySym = 0x0000FD19 - XK_3270_DeleteWord*: TKeySym = 0x0000FD1A - XK_3270_ExSelect*: TKeySym = 0x0000FD1B - XK_3270_CursorSelect*: TKeySym = 0x0000FD1C - XK_3270_PrintScreen*: TKeySym = 0x0000FD1D - XK_3270_Enter*: TKeySym = 0x0000FD1E -#* -# * Latin 1 -# * Byte 3 = 0 -# * - -when defined(XK_LATIN1) or true: - const - XK_space*: TKeySym = 0x00000020 - XK_exclam*: TKeySym = 0x00000021 - XK_quotedbl*: TKeySym = 0x00000022 - XK_numbersign*: TKeySym = 0x00000023 - XK_dollar*: TKeySym = 0x00000024 - XK_percent*: TKeySym = 0x00000025 - XK_ampersand*: TKeySym = 0x00000026 - XK_apostrophe*: TKeySym = 0x00000027 - XK_quoteright*: TKeySym = 0x00000027 # deprecated - XK_parenleft*: TKeySym = 0x00000028 - XK_parenright*: TKeySym = 0x00000029 - XK_asterisk*: TKeySym = 0x0000002A - XK_plus*: TKeySym = 0x0000002B - XK_comma*: TKeySym = 0x0000002C - XK_minus*: TKeySym = 0x0000002D - XK_period*: TKeySym = 0x0000002E - XK_slash*: TKeySym = 0x0000002F - XK_0*: TKeySym = 0x00000030 - XK_1*: TKeySym = 0x00000031 - XK_2*: TKeySym = 0x00000032 - XK_3*: TKeySym = 0x00000033 - XK_4*: TKeySym = 0x00000034 - XK_5*: TKeySym = 0x00000035 - XK_6*: TKeySym = 0x00000036 - XK_7*: TKeySym = 0x00000037 - XK_8*: TKeySym = 0x00000038 - XK_9*: TKeySym = 0x00000039 - XK_colon*: TKeySym = 0x0000003A - XK_semicolon*: TKeySym = 0x0000003B - XK_less*: TKeySym = 0x0000003C - XK_equal*: TKeySym = 0x0000003D - XK_greater*: TKeySym = 0x0000003E - XK_question*: TKeySym = 0x0000003F - XK_at*: TKeySym = 0x00000040 - XKc_A*: TKeySym = 0x00000041 - XKc_B*: TKeySym = 0x00000042 - XKc_C*: TKeySym = 0x00000043 - XKc_D*: TKeySym = 0x00000044 - XKc_E*: TKeySym = 0x00000045 - XKc_F*: TKeySym = 0x00000046 - XKc_G*: TKeySym = 0x00000047 - XKc_H*: TKeySym = 0x00000048 - XKc_I*: TKeySym = 0x00000049 - XKc_J*: TKeySym = 0x0000004A - XKc_K*: TKeySym = 0x0000004B - XKc_L*: TKeySym = 0x0000004C - XKc_M*: TKeySym = 0x0000004D - XKc_N*: TKeySym = 0x0000004E - XKc_O*: TKeySym = 0x0000004F - XKc_P*: TKeySym = 0x00000050 - XKc_Q*: TKeySym = 0x00000051 - XKc_R*: TKeySym = 0x00000052 - XKc_S*: TKeySym = 0x00000053 - XKc_T*: TKeySym = 0x00000054 - XKc_U*: TKeySym = 0x00000055 - XKc_V*: TKeySym = 0x00000056 - XKc_W*: TKeySym = 0x00000057 - XKc_X*: TKeySym = 0x00000058 - XKc_Y*: TKeySym = 0x00000059 - XKc_Z*: TKeySym = 0x0000005A - XK_bracketleft*: TKeySym = 0x0000005B - XK_backslash*: TKeySym = 0x0000005C - XK_bracketright*: TKeySym = 0x0000005D - XK_asciicircum*: TKeySym = 0x0000005E - XK_underscore*: TKeySym = 0x0000005F - XK_grave*: TKeySym = 0x00000060 - XK_quoteleft*: TKeySym = 0x00000060 # deprecated - XK_a*: TKeySym = 0x00000061 - XK_b*: TKeySym = 0x00000062 - XK_c*: TKeySym = 0x00000063 - XK_d*: TKeySym = 0x00000064 - XK_e*: TKeySym = 0x00000065 - XK_f*: TKeySym = 0x00000066 - XK_g*: TKeySym = 0x00000067 - XK_h*: TKeySym = 0x00000068 - XK_i*: TKeySym = 0x00000069 - XK_j*: TKeySym = 0x0000006A - XK_k*: TKeySym = 0x0000006B - XK_l*: TKeySym = 0x0000006C - XK_m*: TKeySym = 0x0000006D - XK_n*: TKeySym = 0x0000006E - XK_o*: TKeySym = 0x0000006F - XK_p*: TKeySym = 0x00000070 - XK_q*: TKeySym = 0x00000071 - XK_r*: TKeySym = 0x00000072 - XK_s*: TKeySym = 0x00000073 - XK_t*: TKeySym = 0x00000074 - XK_u*: TKeySym = 0x00000075 - XK_v*: TKeySym = 0x00000076 - XK_w*: TKeySym = 0x00000077 - XK_x*: TKeySym = 0x00000078 - XK_y*: TKeySym = 0x00000079 - XK_z*: TKeySym = 0x0000007A - XK_braceleft*: TKeySym = 0x0000007B - XK_bar*: TKeySym = 0x0000007C - XK_braceright*: TKeySym = 0x0000007D - XK_asciitilde*: TKeySym = 0x0000007E - XK_nobreakspace*: TKeySym = 0x000000A0 - XK_exclamdown*: TKeySym = 0x000000A1 - XK_cent*: TKeySym = 0x000000A2 - XK_sterling*: TKeySym = 0x000000A3 - XK_currency*: TKeySym = 0x000000A4 - XK_yen*: TKeySym = 0x000000A5 - XK_brokenbar*: TKeySym = 0x000000A6 - XK_section*: TKeySym = 0x000000A7 - XK_diaeresis*: TKeySym = 0x000000A8 - XK_copyright*: TKeySym = 0x000000A9 - XK_ordfeminine*: TKeySym = 0x000000AA - XK_guillemotleft*: TKeySym = 0x000000AB # left angle quotation mark - XK_notsign*: TKeySym = 0x000000AC - XK_hyphen*: TKeySym = 0x000000AD - XK_registered*: TKeySym = 0x000000AE - XK_macron*: TKeySym = 0x000000AF - XK_degree*: TKeySym = 0x000000B0 - XK_plusminus*: TKeySym = 0x000000B1 - XK_twosuperior*: TKeySym = 0x000000B2 - XK_threesuperior*: TKeySym = 0x000000B3 - XK_acute*: TKeySym = 0x000000B4 - XK_mu*: TKeySym = 0x000000B5 - XK_paragraph*: TKeySym = 0x000000B6 - XK_periodcentered*: TKeySym = 0x000000B7 - XK_cedilla*: TKeySym = 0x000000B8 - XK_onesuperior*: TKeySym = 0x000000B9 - XK_masculine*: TKeySym = 0x000000BA - XK_guillemotright*: TKeySym = 0x000000BB # right angle quotation mark - XK_onequarter*: TKeySym = 0x000000BC - XK_onehalf*: TKeySym = 0x000000BD - XK_threequarters*: TKeySym = 0x000000BE - XK_questiondown*: TKeySym = 0x000000BF - XKc_Agrave*: TKeySym = 0x000000C0 - XKc_Aacute*: TKeySym = 0x000000C1 - XKc_Acircumflex*: TKeySym = 0x000000C2 - XKc_Atilde*: TKeySym = 0x000000C3 - XKc_Adiaeresis*: TKeySym = 0x000000C4 - XKc_Aring*: TKeySym = 0x000000C5 - XKc_AE*: TKeySym = 0x000000C6 - XKc_Ccedilla*: TKeySym = 0x000000C7 - XKc_Egrave*: TKeySym = 0x000000C8 - XKc_Eacute*: TKeySym = 0x000000C9 - XKc_Ecircumflex*: TKeySym = 0x000000CA - XKc_Ediaeresis*: TKeySym = 0x000000CB - XKc_Igrave*: TKeySym = 0x000000CC - XKc_Iacute*: TKeySym = 0x000000CD - XKc_Icircumflex*: TKeySym = 0x000000CE - XKc_Idiaeresis*: TKeySym = 0x000000CF - XKc_ETH*: TKeySym = 0x000000D0 - XKc_Ntilde*: TKeySym = 0x000000D1 - XKc_Ograve*: TKeySym = 0x000000D2 - XKc_Oacute*: TKeySym = 0x000000D3 - XKc_Ocircumflex*: TKeySym = 0x000000D4 - XKc_Otilde*: TKeySym = 0x000000D5 - XKc_Odiaeresis*: TKeySym = 0x000000D6 - XK_multiply*: TKeySym = 0x000000D7 - XKc_Ooblique*: TKeySym = 0x000000D8 - XKc_Oslash*: TKeySym = XKc_Ooblique - XKc_Ugrave*: TKeySym = 0x000000D9 - XKc_Uacute*: TKeySym = 0x000000DA - XKc_Ucircumflex*: TKeySym = 0x000000DB - XKc_Udiaeresis*: TKeySym = 0x000000DC - XKc_Yacute*: TKeySym = 0x000000DD - XKc_THORN*: TKeySym = 0x000000DE - XK_ssharp*: TKeySym = 0x000000DF - XK_agrave*: TKeySym = 0x000000E0 - XK_aacute*: TKeySym = 0x000000E1 - XK_acircumflex*: TKeySym = 0x000000E2 - XK_atilde*: TKeySym = 0x000000E3 - XK_adiaeresis*: TKeySym = 0x000000E4 - XK_aring*: TKeySym = 0x000000E5 - XK_ae*: TKeySym = 0x000000E6 - XK_ccedilla*: TKeySym = 0x000000E7 - XK_egrave*: TKeySym = 0x000000E8 - XK_eacute*: TKeySym = 0x000000E9 - XK_ecircumflex*: TKeySym = 0x000000EA - XK_ediaeresis*: TKeySym = 0x000000EB - XK_igrave*: TKeySym = 0x000000EC - XK_iacute*: TKeySym = 0x000000ED - XK_icircumflex*: TKeySym = 0x000000EE - XK_idiaeresis*: TKeySym = 0x000000EF - XK_eth*: TKeySym = 0x000000F0 - XK_ntilde*: TKeySym = 0x000000F1 - XK_ograve*: TKeySym = 0x000000F2 - XK_oacute*: TKeySym = 0x000000F3 - XK_ocircumflex*: TKeySym = 0x000000F4 - XK_otilde*: TKeySym = 0x000000F5 - XK_odiaeresis*: TKeySym = 0x000000F6 - XK_division*: TKeySym = 0x000000F7 - XK_oslash*: TKeySym = 0x000000F8 - XK_ooblique*: TKeySym = XK_oslash - XK_ugrave*: TKeySym = 0x000000F9 - XK_uacute*: TKeySym = 0x000000FA - XK_ucircumflex*: TKeySym = 0x000000FB - XK_udiaeresis*: TKeySym = 0x000000FC - XK_yacute*: TKeySym = 0x000000FD - XK_thorn*: TKeySym = 0x000000FE - XK_ydiaeresis*: TKeySym = 0x000000FF -# XK_LATIN1 -#* -# * Latin 2 -# * Byte 3 = 1 -# * - -when defined(XK_LATIN2) or true: - const - XKc_Aogonek*: TKeySym = 0x000001A1 - XK_breve*: TKeySym = 0x000001A2 - XKc_Lstroke*: TKeySym = 0x000001A3 - XKc_Lcaron*: TKeySym = 0x000001A5 - XKc_Sacute*: TKeySym = 0x000001A6 - XKc_Scaron*: TKeySym = 0x000001A9 - XKc_Scedilla*: TKeySym = 0x000001AA - XKc_Tcaron*: TKeySym = 0x000001AB - XKc_Zacute*: TKeySym = 0x000001AC - XKc_Zcaron*: TKeySym = 0x000001AE - XKc_Zabovedot*: TKeySym = 0x000001AF - XK_aogonek*: TKeySym = 0x000001B1 - XK_ogonek*: TKeySym = 0x000001B2 - XK_lstroke*: TKeySym = 0x000001B3 - XK_lcaron*: TKeySym = 0x000001B5 - XK_sacute*: TKeySym = 0x000001B6 - XK_caron*: TKeySym = 0x000001B7 - XK_scaron*: TKeySym = 0x000001B9 - XK_scedilla*: TKeySym = 0x000001BA - XK_tcaron*: TKeySym = 0x000001BB - XK_zacute*: TKeySym = 0x000001BC - XK_doubleacute*: TKeySym = 0x000001BD - XK_zcaron*: TKeySym = 0x000001BE - XK_zabovedot*: TKeySym = 0x000001BF - XKc_Racute*: TKeySym = 0x000001C0 - XKc_Abreve*: TKeySym = 0x000001C3 - XKc_Lacute*: TKeySym = 0x000001C5 - XKc_Cacute*: TKeySym = 0x000001C6 - XKc_Ccaron*: TKeySym = 0x000001C8 - XKc_Eogonek*: TKeySym = 0x000001CA - XKc_Ecaron*: TKeySym = 0x000001CC - XKc_Dcaron*: TKeySym = 0x000001CF - XKc_Dstroke*: TKeySym = 0x000001D0 - XKc_Nacute*: TKeySym = 0x000001D1 - XKc_Ncaron*: TKeySym = 0x000001D2 - XKc_Odoubleacute*: TKeySym = 0x000001D5 - XKc_Rcaron*: TKeySym = 0x000001D8 - XKc_Uring*: TKeySym = 0x000001D9 - XKc_Udoubleacute*: TKeySym = 0x000001DB - XKc_Tcedilla*: TKeySym = 0x000001DE - XK_racute*: TKeySym = 0x000001E0 - XK_abreve*: TKeySym = 0x000001E3 - XK_lacute*: TKeySym = 0x000001E5 - XK_cacute*: TKeySym = 0x000001E6 - XK_ccaron*: TKeySym = 0x000001E8 - XK_eogonek*: TKeySym = 0x000001EA - XK_ecaron*: TKeySym = 0x000001EC - XK_dcaron*: TKeySym = 0x000001EF - XK_dstroke*: TKeySym = 0x000001F0 - XK_nacute*: TKeySym = 0x000001F1 - XK_ncaron*: TKeySym = 0x000001F2 - XK_odoubleacute*: TKeySym = 0x000001F5 - XK_udoubleacute*: TKeySym = 0x000001FB - XK_rcaron*: TKeySym = 0x000001F8 - XK_uring*: TKeySym = 0x000001F9 - XK_tcedilla*: TKeySym = 0x000001FE - XK_abovedot*: TKeySym = 0x000001FF -# XK_LATIN2 -#* -# * Latin 3 -# * Byte 3 = 2 -# * - -when defined(XK_LATIN3) or true: - const - XKc_Hstroke*: TKeySym = 0x000002A1 - XKc_Hcircumflex*: TKeySym = 0x000002A6 - XKc_Iabovedot*: TKeySym = 0x000002A9 - XKc_Gbreve*: TKeySym = 0x000002AB - XKc_Jcircumflex*: TKeySym = 0x000002AC - XK_hstroke*: TKeySym = 0x000002B1 - XK_hcircumflex*: TKeySym = 0x000002B6 - XK_idotless*: TKeySym = 0x000002B9 - XK_gbreve*: TKeySym = 0x000002BB - XK_jcircumflex*: TKeySym = 0x000002BC - XKc_Cabovedot*: TKeySym = 0x000002C5 - XKc_Ccircumflex*: TKeySym = 0x000002C6 - XKc_Gabovedot*: TKeySym = 0x000002D5 - XKc_Gcircumflex*: TKeySym = 0x000002D8 - XKc_Ubreve*: TKeySym = 0x000002DD - XKc_Scircumflex*: TKeySym = 0x000002DE - XK_cabovedot*: TKeySym = 0x000002E5 - XK_ccircumflex*: TKeySym = 0x000002E6 - XK_gabovedot*: TKeySym = 0x000002F5 - XK_gcircumflex*: TKeySym = 0x000002F8 - XK_ubreve*: TKeySym = 0x000002FD - XK_scircumflex*: TKeySym = 0x000002FE -# XK_LATIN3 -#* -# * Latin 4 -# * Byte 3 = 3 -# * - -when defined(XK_LATIN4) or true: - const - XK_kra*: TKeySym = 0x000003A2 - XK_kappa*: TKeySym = 0x000003A2 # deprecated - XKc_Rcedilla*: TKeySym = 0x000003A3 - XKc_Itilde*: TKeySym = 0x000003A5 - XKc_Lcedilla*: TKeySym = 0x000003A6 - XKc_Emacron*: TKeySym = 0x000003AA - XKc_Gcedilla*: TKeySym = 0x000003AB - XKc_Tslash*: TKeySym = 0x000003AC - XK_rcedilla*: TKeySym = 0x000003B3 - XK_itilde*: TKeySym = 0x000003B5 - XK_lcedilla*: TKeySym = 0x000003B6 - XK_emacron*: TKeySym = 0x000003BA - XK_gcedilla*: TKeySym = 0x000003BB - XK_tslash*: TKeySym = 0x000003BC - XKc_ENG*: TKeySym = 0x000003BD - XK_eng*: TKeySym = 0x000003BF - XKc_Amacron*: TKeySym = 0x000003C0 - XKc_Iogonek*: TKeySym = 0x000003C7 - XKc_Eabovedot*: TKeySym = 0x000003CC - XKc_Imacron*: TKeySym = 0x000003CF - XKc_Ncedilla*: TKeySym = 0x000003D1 - XKc_Omacron*: TKeySym = 0x000003D2 - XKc_Kcedilla*: TKeySym = 0x000003D3 - XKc_Uogonek*: TKeySym = 0x000003D9 - XKc_Utilde*: TKeySym = 0x000003DD - XKc_Umacron*: TKeySym = 0x000003DE - XK_amacron*: TKeySym = 0x000003E0 - XK_iogonek*: TKeySym = 0x000003E7 - XK_eabovedot*: TKeySym = 0x000003EC - XK_imacron*: TKeySym = 0x000003EF - XK_ncedilla*: TKeySym = 0x000003F1 - XK_omacron*: TKeySym = 0x000003F2 - XK_kcedilla*: TKeySym = 0x000003F3 - XK_uogonek*: TKeySym = 0x000003F9 - XK_utilde*: TKeySym = 0x000003FD - XK_umacron*: TKeySym = 0x000003FE -# XK_LATIN4 -#* -# * Latin-8 -# * Byte 3 = 18 -# * - -when defined(XK_LATIN8) or true: - const - XKc_Babovedot*: TKeySym = 0x000012A1 - XK_babovedot*: TKeySym = 0x000012A2 - XKc_Dabovedot*: TKeySym = 0x000012A6 - XKc_Wgrave*: TKeySym = 0x000012A8 - XKc_Wacute*: TKeySym = 0x000012AA - XK_dabovedot*: TKeySym = 0x000012AB - XKc_Ygrave*: TKeySym = 0x000012AC - XKc_Fabovedot*: TKeySym = 0x000012B0 - XK_fabovedot*: TKeySym = 0x000012B1 - XKc_Mabovedot*: TKeySym = 0x000012B4 - XK_mabovedot*: TKeySym = 0x000012B5 - XKc_Pabovedot*: TKeySym = 0x000012B7 - XK_wgrave*: TKeySym = 0x000012B8 - XK_pabovedot*: TKeySym = 0x000012B9 - XK_wacute*: TKeySym = 0x000012BA - XKc_Sabovedot*: TKeySym = 0x000012BB - XK_ygrave*: TKeySym = 0x000012BC - XKc_Wdiaeresis*: TKeySym = 0x000012BD - XK_wdiaeresis*: TKeySym = 0x000012BE - XK_sabovedot*: TKeySym = 0x000012BF - XKc_Wcircumflex*: TKeySym = 0x000012D0 - XKc_Tabovedot*: TKeySym = 0x000012D7 - XKc_Ycircumflex*: TKeySym = 0x000012DE - XK_wcircumflex*: TKeySym = 0x000012F0 - XK_tabovedot*: TKeySym = 0x000012F7 - XK_ycircumflex*: TKeySym = 0x000012FE -# XK_LATIN8 -#* -# * Latin-9 (a.k.a. Latin-0) -# * Byte 3 = 19 -# * - -when defined(XK_LATIN9) or true: - const - XKc_OE*: TKeySym = 0x000013BC - XK_oe*: TKeySym = 0x000013BD - XKc_Ydiaeresis*: TKeySym = 0x000013BE -# XK_LATIN9 -#* -# * Katakana -# * Byte 3 = 4 -# * - -when defined(XK_KATAKANA) or true: - const - XK_overline*: TKeySym = 0x0000047E - XK_kana_fullstop*: TKeySym = 0x000004A1 - XK_kana_openingbracket*: TKeySym = 0x000004A2 - XK_kana_closingbracket*: TKeySym = 0x000004A3 - XK_kana_comma*: TKeySym = 0x000004A4 - XK_kana_conjunctive*: TKeySym = 0x000004A5 - XK_kana_middledot*: TKeySym = 0x000004A5 # deprecated - XKc_kana_WO*: TKeySym = 0x000004A6 - XK_kana_a*: TKeySym = 0x000004A7 - XK_kana_i*: TKeySym = 0x000004A8 - XK_kana_u*: TKeySym = 0x000004A9 - XK_kana_e*: TKeySym = 0x000004AA - XK_kana_o*: TKeySym = 0x000004AB - XK_kana_ya*: TKeySym = 0x000004AC - XK_kana_yu*: TKeySym = 0x000004AD - XK_kana_yo*: TKeySym = 0x000004AE - XK_kana_tsu*: TKeySym = 0x000004AF - XK_kana_tu*: TKeySym = 0x000004AF # deprecated - XK_prolongedsound*: TKeySym = 0x000004B0 - XKc_kana_A*: TKeySym = 0x000004B1 - XKc_kana_I*: TKeySym = 0x000004B2 - XKc_kana_U*: TKeySym = 0x000004B3 - XKc_kana_E*: TKeySym = 0x000004B4 - XKc_kana_O*: TKeySym = 0x000004B5 - XKc_kana_KA*: TKeySym = 0x000004B6 - XKc_kana_KI*: TKeySym = 0x000004B7 - XKc_kana_KU*: TKeySym = 0x000004B8 - XKc_kana_KE*: TKeySym = 0x000004B9 - XKc_kana_KO*: TKeySym = 0x000004BA - XKc_kana_SA*: TKeySym = 0x000004BB - XKc_kana_SHI*: TKeySym = 0x000004BC - XKc_kana_SU*: TKeySym = 0x000004BD - XKc_kana_SE*: TKeySym = 0x000004BE - XKc_kana_SO*: TKeySym = 0x000004BF - XKc_kana_TA*: TKeySym = 0x000004C0 - XKc_kana_CHI*: TKeySym = 0x000004C1 - XKc_kana_TI*: TKeySym = 0x000004C1 # deprecated - XKc_kana_TSU*: TKeySym = 0x000004C2 - XKc_kana_TU*: TKeySym = 0x000004C2 # deprecated - XKc_kana_TE*: TKeySym = 0x000004C3 - XKc_kana_TO*: TKeySym = 0x000004C4 - XKc_kana_NA*: TKeySym = 0x000004C5 - XKc_kana_NI*: TKeySym = 0x000004C6 - XKc_kana_NU*: TKeySym = 0x000004C7 - XKc_kana_NE*: TKeySym = 0x000004C8 - XKc_kana_NO*: TKeySym = 0x000004C9 - XKc_kana_HA*: TKeySym = 0x000004CA - XKc_kana_HI*: TKeySym = 0x000004CB - XKc_kana_FU*: TKeySym = 0x000004CC - XKc_kana_HU*: TKeySym = 0x000004CC # deprecated - XKc_kana_HE*: TKeySym = 0x000004CD - XKc_kana_HO*: TKeySym = 0x000004CE - XKc_kana_MA*: TKeySym = 0x000004CF - XKc_kana_MI*: TKeySym = 0x000004D0 - XKc_kana_MU*: TKeySym = 0x000004D1 - XKc_kana_ME*: TKeySym = 0x000004D2 - XKc_kana_MO*: TKeySym = 0x000004D3 - XKc_kana_YA*: TKeySym = 0x000004D4 - XKc_kana_YU*: TKeySym = 0x000004D5 - XKc_kana_YO*: TKeySym = 0x000004D6 - XKc_kana_RA*: TKeySym = 0x000004D7 - XKc_kana_RI*: TKeySym = 0x000004D8 - XKc_kana_RU*: TKeySym = 0x000004D9 - XKc_kana_RE*: TKeySym = 0x000004DA - XKc_kana_RO*: TKeySym = 0x000004DB - XKc_kana_WA*: TKeySym = 0x000004DC - XKc_kana_N*: TKeySym = 0x000004DD - XK_voicedsound*: TKeySym = 0x000004DE - XK_semivoicedsound*: TKeySym = 0x000004DF - XK_kana_switch*: TKeySym = 0x0000FF7E # Alias for mode_switch -# XK_KATAKANA -#* -# * Arabic -# * Byte 3 = 5 -# * - -when defined(XK_ARABIC) or true: - const - XK_Farsi_0*: TKeySym = 0x00000590 - XK_Farsi_1*: TKeySym = 0x00000591 - XK_Farsi_2*: TKeySym = 0x00000592 - XK_Farsi_3*: TKeySym = 0x00000593 - XK_Farsi_4*: TKeySym = 0x00000594 - XK_Farsi_5*: TKeySym = 0x00000595 - XK_Farsi_6*: TKeySym = 0x00000596 - XK_Farsi_7*: TKeySym = 0x00000597 - XK_Farsi_8*: TKeySym = 0x00000598 - XK_Farsi_9*: TKeySym = 0x00000599 - XK_Arabic_percent*: TKeySym = 0x000005A5 - XK_Arabic_superscript_alef*: TKeySym = 0x000005A6 - XK_Arabic_tteh*: TKeySym = 0x000005A7 - XK_Arabic_peh*: TKeySym = 0x000005A8 - XK_Arabic_tcheh*: TKeySym = 0x000005A9 - XK_Arabic_ddal*: TKeySym = 0x000005AA - XK_Arabic_rreh*: TKeySym = 0x000005AB - XK_Arabic_comma*: TKeySym = 0x000005AC - XK_Arabic_fullstop*: TKeySym = 0x000005AE - XK_Arabic_0*: TKeySym = 0x000005B0 - XK_Arabic_1*: TKeySym = 0x000005B1 - XK_Arabic_2*: TKeySym = 0x000005B2 - XK_Arabic_3*: TKeySym = 0x000005B3 - XK_Arabic_4*: TKeySym = 0x000005B4 - XK_Arabic_5*: TKeySym = 0x000005B5 - XK_Arabic_6*: TKeySym = 0x000005B6 - XK_Arabic_7*: TKeySym = 0x000005B7 - XK_Arabic_8*: TKeySym = 0x000005B8 - XK_Arabic_9*: TKeySym = 0x000005B9 - XK_Arabic_semicolon*: TKeySym = 0x000005BB - XK_Arabic_question_mark*: TKeySym = 0x000005BF - XK_Arabic_hamza*: TKeySym = 0x000005C1 - XK_Arabic_maddaonalef*: TKeySym = 0x000005C2 - XK_Arabic_hamzaonalef*: TKeySym = 0x000005C3 - XK_Arabic_hamzaonwaw*: TKeySym = 0x000005C4 - XK_Arabic_hamzaunderalef*: TKeySym = 0x000005C5 - XK_Arabic_hamzaonyeh*: TKeySym = 0x000005C6 - XK_Arabic_alef*: TKeySym = 0x000005C7 - XK_Arabic_beh*: TKeySym = 0x000005C8 - XK_Arabic_tehmarbuta*: TKeySym = 0x000005C9 - XK_Arabic_teh*: TKeySym = 0x000005CA - XK_Arabic_theh*: TKeySym = 0x000005CB - XK_Arabic_jeem*: TKeySym = 0x000005CC - XK_Arabic_hah*: TKeySym = 0x000005CD - XK_Arabic_khah*: TKeySym = 0x000005CE - XK_Arabic_dal*: TKeySym = 0x000005CF - XK_Arabic_thal*: TKeySym = 0x000005D0 - XK_Arabic_ra*: TKeySym = 0x000005D1 - XK_Arabic_zain*: TKeySym = 0x000005D2 - XK_Arabic_seen*: TKeySym = 0x000005D3 - XK_Arabic_sheen*: TKeySym = 0x000005D4 - XK_Arabic_sad*: TKeySym = 0x000005D5 - XK_Arabic_dad*: TKeySym = 0x000005D6 - XK_Arabic_tah*: TKeySym = 0x000005D7 - XK_Arabic_zah*: TKeySym = 0x000005D8 - XK_Arabic_ain*: TKeySym = 0x000005D9 - XK_Arabic_ghain*: TKeySym = 0x000005DA - XK_Arabic_tatweel*: TKeySym = 0x000005E0 - XK_Arabic_feh*: TKeySym = 0x000005E1 - XK_Arabic_qaf*: TKeySym = 0x000005E2 - XK_Arabic_kaf*: TKeySym = 0x000005E3 - XK_Arabic_lam*: TKeySym = 0x000005E4 - XK_Arabic_meem*: TKeySym = 0x000005E5 - XK_Arabic_noon*: TKeySym = 0x000005E6 - XK_Arabic_ha*: TKeySym = 0x000005E7 - XK_Arabic_heh*: TKeySym = 0x000005E7 # deprecated - XK_Arabic_waw*: TKeySym = 0x000005E8 - XK_Arabic_alefmaksura*: TKeySym = 0x000005E9 - XK_Arabic_yeh*: TKeySym = 0x000005EA - XK_Arabic_fathatan*: TKeySym = 0x000005EB - XK_Arabic_dammatan*: TKeySym = 0x000005EC - XK_Arabic_kasratan*: TKeySym = 0x000005ED - XK_Arabic_fatha*: TKeySym = 0x000005EE - XK_Arabic_damma*: TKeySym = 0x000005EF - XK_Arabic_kasra*: TKeySym = 0x000005F0 - XK_Arabic_shadda*: TKeySym = 0x000005F1 - XK_Arabic_sukun*: TKeySym = 0x000005F2 - XK_Arabic_madda_above*: TKeySym = 0x000005F3 - XK_Arabic_hamza_above*: TKeySym = 0x000005F4 - XK_Arabic_hamza_below*: TKeySym = 0x000005F5 - XK_Arabic_jeh*: TKeySym = 0x000005F6 - XK_Arabic_veh*: TKeySym = 0x000005F7 - XK_Arabic_keheh*: TKeySym = 0x000005F8 - XK_Arabic_gaf*: TKeySym = 0x000005F9 - XK_Arabic_noon_ghunna*: TKeySym = 0x000005FA - XK_Arabic_heh_doachashmee*: TKeySym = 0x000005FB - XK_Farsi_yeh*: TKeySym = 0x000005FC - XK_Arabic_farsi_yeh*: TKeySym = XK_Farsi_yeh - XK_Arabic_yeh_baree*: TKeySym = 0x000005FD - XK_Arabic_heh_goal*: TKeySym = 0x000005FE - XK_Arabic_switch*: TKeySym = 0x0000FF7E # Alias for mode_switch -# XK_ARABIC -#* -# * Cyrillic -# * Byte 3 = 6 -# * - -when defined(XK_CYRILLIC) or true: - const - XKc_Cyrillic_GHE_bar*: TKeySym = 0x00000680 - XK_Cyrillic_ghe_bar*: TKeySym = 0x00000690 - XKc_Cyrillic_ZHE_descender*: TKeySym = 0x00000681 - XK_Cyrillic_zhe_descender*: TKeySym = 0x00000691 - XKc_Cyrillic_KA_descender*: TKeySym = 0x00000682 - XK_Cyrillic_ka_descender*: TKeySym = 0x00000692 - XKc_Cyrillic_KA_vertstroke*: TKeySym = 0x00000683 - XK_Cyrillic_ka_vertstroke*: TKeySym = 0x00000693 - XKc_Cyrillic_EN_descender*: TKeySym = 0x00000684 - XK_Cyrillic_en_descender*: TKeySym = 0x00000694 - XKc_Cyrillic_U_straight*: TKeySym = 0x00000685 - XK_Cyrillic_u_straight*: TKeySym = 0x00000695 - XKc_Cyrillic_U_straight_bar*: TKeySym = 0x00000686 - XK_Cyrillic_u_straight_bar*: TKeySym = 0x00000696 - XKc_Cyrillic_HA_descender*: TKeySym = 0x00000687 - XK_Cyrillic_ha_descender*: TKeySym = 0x00000697 - XKc_Cyrillic_CHE_descender*: TKeySym = 0x00000688 - XK_Cyrillic_che_descender*: TKeySym = 0x00000698 - XKc_Cyrillic_CHE_vertstroke*: TKeySym = 0x00000689 - XK_Cyrillic_che_vertstroke*: TKeySym = 0x00000699 - XKc_Cyrillic_SHHA*: TKeySym = 0x0000068A - XK_Cyrillic_shha*: TKeySym = 0x0000069A - XKc_Cyrillic_SCHWA*: TKeySym = 0x0000068C - XK_Cyrillic_schwa*: TKeySym = 0x0000069C - XKc_Cyrillic_I_macron*: TKeySym = 0x0000068D - XK_Cyrillic_i_macron*: TKeySym = 0x0000069D - XKc_Cyrillic_O_bar*: TKeySym = 0x0000068E - XK_Cyrillic_o_bar*: TKeySym = 0x0000069E - XKc_Cyrillic_U_macron*: TKeySym = 0x0000068F - XK_Cyrillic_u_macron*: TKeySym = 0x0000069F - XK_Serbian_dje*: TKeySym = 0x000006A1 - XK_Macedonia_gje*: TKeySym = 0x000006A2 - XK_Cyrillic_io*: TKeySym = 0x000006A3 - XK_Ukrainian_ie*: TKeySym = 0x000006A4 - XK_Ukranian_je*: TKeySym = 0x000006A4 # deprecated - XK_Macedonia_dse*: TKeySym = 0x000006A5 - XK_Ukrainian_i*: TKeySym = 0x000006A6 - XK_Ukranian_i*: TKeySym = 0x000006A6 # deprecated - XK_Ukrainian_yi*: TKeySym = 0x000006A7 - XK_Ukranian_yi*: TKeySym = 0x000006A7 # deprecated - XK_Cyrillic_je*: TKeySym = 0x000006A8 - XK_Serbian_je*: TKeySym = 0x000006A8 # deprecated - XK_Cyrillic_lje*: TKeySym = 0x000006A9 - XK_Serbian_lje*: TKeySym = 0x000006A9 # deprecated - XK_Cyrillic_nje*: TKeySym = 0x000006AA - XK_Serbian_nje*: TKeySym = 0x000006AA # deprecated - XK_Serbian_tshe*: TKeySym = 0x000006AB - XK_Macedonia_kje*: TKeySym = 0x000006AC - XK_Ukrainian_ghe_with_upturn*: TKeySym = 0x000006AD - XK_Byelorussian_shortu*: TKeySym = 0x000006AE - XK_Cyrillic_dzhe*: TKeySym = 0x000006AF - XK_Serbian_dze*: TKeySym = 0x000006AF # deprecated - XK_numerosign*: TKeySym = 0x000006B0 - XKc_Serbian_DJE*: TKeySym = 0x000006B1 - XKc_Macedonia_GJE*: TKeySym = 0x000006B2 - XKc_Cyrillic_IO*: TKeySym = 0x000006B3 - XKc_Ukrainian_IE*: TKeySym = 0x000006B4 - XKc_Ukranian_JE*: TKeySym = 0x000006B4 # deprecated - XKc_Macedonia_DSE*: TKeySym = 0x000006B5 - XKc_Ukrainian_I*: TKeySym = 0x000006B6 - XKc_Ukranian_I*: TKeySym = 0x000006B6 # deprecated - XKc_Ukrainian_YI*: TKeySym = 0x000006B7 - XKc_Ukranian_YI*: TKeySym = 0x000006B7 # deprecated - XKc_Cyrillic_JE*: TKeySym = 0x000006B8 - XKc_Serbian_JE*: TKeySym = 0x000006B8 # deprecated - XKc_Cyrillic_LJE*: TKeySym = 0x000006B9 - XKc_Serbian_LJE*: TKeySym = 0x000006B9 # deprecated - XKc_Cyrillic_NJE*: TKeySym = 0x000006BA - XKc_Serbian_NJE*: TKeySym = 0x000006BA # deprecated - XKc_Serbian_TSHE*: TKeySym = 0x000006BB - XKc_Macedonia_KJE*: TKeySym = 0x000006BC - XKc_Ukrainian_GHE_WITH_UPTURN*: TKeySym = 0x000006BD - XKc_Byelorussian_SHORTU*: TKeySym = 0x000006BE - XKc_Cyrillic_DZHE*: TKeySym = 0x000006BF - XKc_Serbian_DZE*: TKeySym = 0x000006BF # deprecated - XK_Cyrillic_yu*: TKeySym = 0x000006C0 - XK_Cyrillic_a*: TKeySym = 0x000006C1 - XK_Cyrillic_be*: TKeySym = 0x000006C2 - XK_Cyrillic_tse*: TKeySym = 0x000006C3 - XK_Cyrillic_de*: TKeySym = 0x000006C4 - XK_Cyrillic_ie*: TKeySym = 0x000006C5 - XK_Cyrillic_ef*: TKeySym = 0x000006C6 - XK_Cyrillic_ghe*: TKeySym = 0x000006C7 - XK_Cyrillic_ha*: TKeySym = 0x000006C8 - XK_Cyrillic_i*: TKeySym = 0x000006C9 - XK_Cyrillic_shorti*: TKeySym = 0x000006CA - XK_Cyrillic_ka*: TKeySym = 0x000006CB - XK_Cyrillic_el*: TKeySym = 0x000006CC - XK_Cyrillic_em*: TKeySym = 0x000006CD - XK_Cyrillic_en*: TKeySym = 0x000006CE - XK_Cyrillic_o*: TKeySym = 0x000006CF - XK_Cyrillic_pe*: TKeySym = 0x000006D0 - XK_Cyrillic_ya*: TKeySym = 0x000006D1 - XK_Cyrillic_er*: TKeySym = 0x000006D2 - XK_Cyrillic_es*: TKeySym = 0x000006D3 - XK_Cyrillic_te*: TKeySym = 0x000006D4 - XK_Cyrillic_u*: TKeySym = 0x000006D5 - XK_Cyrillic_zhe*: TKeySym = 0x000006D6 - XK_Cyrillic_ve*: TKeySym = 0x000006D7 - XK_Cyrillic_softsign*: TKeySym = 0x000006D8 - XK_Cyrillic_yeru*: TKeySym = 0x000006D9 - XK_Cyrillic_ze*: TKeySym = 0x000006DA - XK_Cyrillic_sha*: TKeySym = 0x000006DB - XK_Cyrillic_e*: TKeySym = 0x000006DC - XK_Cyrillic_shcha*: TKeySym = 0x000006DD - XK_Cyrillic_che*: TKeySym = 0x000006DE - XK_Cyrillic_hardsign*: TKeySym = 0x000006DF - XKc_Cyrillic_YU*: TKeySym = 0x000006E0 - XKc_Cyrillic_A*: TKeySym = 0x000006E1 - XKc_Cyrillic_BE*: TKeySym = 0x000006E2 - XKc_Cyrillic_TSE*: TKeySym = 0x000006E3 - XKc_Cyrillic_DE*: TKeySym = 0x000006E4 - XKc_Cyrillic_IE*: TKeySym = 0x000006E5 - XKc_Cyrillic_EF*: TKeySym = 0x000006E6 - XKc_Cyrillic_GHE*: TKeySym = 0x000006E7 - XKc_Cyrillic_HA*: TKeySym = 0x000006E8 - XKc_Cyrillic_I*: TKeySym = 0x000006E9 - XKc_Cyrillic_SHORTI*: TKeySym = 0x000006EA - XKc_Cyrillic_KA*: TKeySym = 0x000006EB - XKc_Cyrillic_EL*: TKeySym = 0x000006EC - XKc_Cyrillic_EM*: TKeySym = 0x000006ED - XKc_Cyrillic_EN*: TKeySym = 0x000006EE - XKc_Cyrillic_O*: TKeySym = 0x000006EF - XKc_Cyrillic_PE*: TKeySym = 0x000006F0 - XKc_Cyrillic_YA*: TKeySym = 0x000006F1 - XKc_Cyrillic_ER*: TKeySym = 0x000006F2 - XKc_Cyrillic_ES*: TKeySym = 0x000006F3 - XKc_Cyrillic_TE*: TKeySym = 0x000006F4 - XKc_Cyrillic_U*: TKeySym = 0x000006F5 - XKc_Cyrillic_ZHE*: TKeySym = 0x000006F6 - XKc_Cyrillic_VE*: TKeySym = 0x000006F7 - XKc_Cyrillic_SOFTSIGN*: TKeySym = 0x000006F8 - XKc_Cyrillic_YERU*: TKeySym = 0x000006F9 - XKc_Cyrillic_ZE*: TKeySym = 0x000006FA - XKc_Cyrillic_SHA*: TKeySym = 0x000006FB - XKc_Cyrillic_E*: TKeySym = 0x000006FC - XKc_Cyrillic_SHCHA*: TKeySym = 0x000006FD - XKc_Cyrillic_CHE*: TKeySym = 0x000006FE - XKc_Cyrillic_HARDSIGN*: TKeySym = 0x000006FF -# XK_CYRILLIC -#* -# * Greek -# * Byte 3 = 7 -# * - -when defined(XK_GREEK) or true: - const - XKc_Greek_ALPHAaccent*: TKeySym = 0x000007A1 - XKc_Greek_EPSILONaccent*: TKeySym = 0x000007A2 - XKc_Greek_ETAaccent*: TKeySym = 0x000007A3 - XKc_Greek_IOTAaccent*: TKeySym = 0x000007A4 - XKc_Greek_IOTAdieresis*: TKeySym = 0x000007A5 - XKc_Greek_IOTAdiaeresis*: TKeySym = XKc_Greek_IOTAdieresis # old typo - XKc_Greek_OMICRONaccent*: TKeySym = 0x000007A7 - XKc_Greek_UPSILONaccent*: TKeySym = 0x000007A8 - XKc_Greek_UPSILONdieresis*: TKeySym = 0x000007A9 - XKc_Greek_OMEGAaccent*: TKeySym = 0x000007AB - XK_Greek_accentdieresis*: TKeySym = 0x000007AE - XK_Greek_horizbar*: TKeySym = 0x000007AF - XK_Greek_alphaaccent*: TKeySym = 0x000007B1 - XK_Greek_epsilonaccent*: TKeySym = 0x000007B2 - XK_Greek_etaaccent*: TKeySym = 0x000007B3 - XK_Greek_iotaaccent*: TKeySym = 0x000007B4 - XK_Greek_iotadieresis*: TKeySym = 0x000007B5 - XK_Greek_iotaaccentdieresis*: TKeySym = 0x000007B6 - XK_Greek_omicronaccent*: TKeySym = 0x000007B7 - XK_Greek_upsilonaccent*: TKeySym = 0x000007B8 - XK_Greek_upsilondieresis*: TKeySym = 0x000007B9 - XK_Greek_upsilonaccentdieresis*: TKeySym = 0x000007BA - XK_Greek_omegaaccent*: TKeySym = 0x000007BB - XKc_Greek_ALPHA*: TKeySym = 0x000007C1 - XKc_Greek_BETA*: TKeySym = 0x000007C2 - XKc_Greek_GAMMA*: TKeySym = 0x000007C3 - XKc_Greek_DELTA*: TKeySym = 0x000007C4 - XKc_Greek_EPSILON*: TKeySym = 0x000007C5 - XKc_Greek_ZETA*: TKeySym = 0x000007C6 - XKc_Greek_ETA*: TKeySym = 0x000007C7 - XKc_Greek_THETA*: TKeySym = 0x000007C8 - XKc_Greek_IOTA*: TKeySym = 0x000007C9 - XKc_Greek_KAPPA*: TKeySym = 0x000007CA - XKc_Greek_LAMDA*: TKeySym = 0x000007CB - XKc_Greek_LAMBDA*: TKeySym = 0x000007CB - XKc_Greek_MU*: TKeySym = 0x000007CC - XKc_Greek_NU*: TKeySym = 0x000007CD - XKc_Greek_XI*: TKeySym = 0x000007CE - XKc_Greek_OMICRON*: TKeySym = 0x000007CF - XKc_Greek_PI*: TKeySym = 0x000007D0 - XKc_Greek_RHO*: TKeySym = 0x000007D1 - XKc_Greek_SIGMA*: TKeySym = 0x000007D2 - XKc_Greek_TAU*: TKeySym = 0x000007D4 - XKc_Greek_UPSILON*: TKeySym = 0x000007D5 - XKc_Greek_PHI*: TKeySym = 0x000007D6 - XKc_Greek_CHI*: TKeySym = 0x000007D7 - XKc_Greek_PSI*: TKeySym = 0x000007D8 - XKc_Greek_OMEGA*: TKeySym = 0x000007D9 - XK_Greek_alpha*: TKeySym = 0x000007E1 - XK_Greek_beta*: TKeySym = 0x000007E2 - XK_Greek_gamma*: TKeySym = 0x000007E3 - XK_Greek_delta*: TKeySym = 0x000007E4 - XK_Greek_epsilon*: TKeySym = 0x000007E5 - XK_Greek_zeta*: TKeySym = 0x000007E6 - XK_Greek_eta*: TKeySym = 0x000007E7 - XK_Greek_theta*: TKeySym = 0x000007E8 - XK_Greek_iota*: TKeySym = 0x000007E9 - XK_Greek_kappa*: TKeySym = 0x000007EA - XK_Greek_lamda*: TKeySym = 0x000007EB - XK_Greek_lambda*: TKeySym = 0x000007EB - XK_Greek_mu*: TKeySym = 0x000007EC - XK_Greek_nu*: TKeySym = 0x000007ED - XK_Greek_xi*: TKeySym = 0x000007EE - XK_Greek_omicron*: TKeySym = 0x000007EF - XK_Greek_pi*: TKeySym = 0x000007F0 - XK_Greek_rho*: TKeySym = 0x000007F1 - XK_Greek_sigma*: TKeySym = 0x000007F2 - XK_Greek_finalsmallsigma*: TKeySym = 0x000007F3 - XK_Greek_tau*: TKeySym = 0x000007F4 - XK_Greek_upsilon*: TKeySym = 0x000007F5 - XK_Greek_phi*: TKeySym = 0x000007F6 - XK_Greek_chi*: TKeySym = 0x000007F7 - XK_Greek_psi*: TKeySym = 0x000007F8 - XK_Greek_omega*: TKeySym = 0x000007F9 - XK_Greek_switch*: TKeySym = 0x0000FF7E # Alias for mode_switch -# XK_GREEK -#* -# * Technical -# * Byte 3 = 8 -# * - -when defined(XK_TECHNICAL) or true: - const - XK_leftradical*: TKeySym = 0x000008A1 - XK_topleftradical*: TKeySym = 0x000008A2 - XK_horizconnector*: TKeySym = 0x000008A3 - XK_topintegral*: TKeySym = 0x000008A4 - XK_botintegral*: TKeySym = 0x000008A5 - XK_vertconnector*: TKeySym = 0x000008A6 - XK_topleftsqbracket*: TKeySym = 0x000008A7 - XK_botleftsqbracket*: TKeySym = 0x000008A8 - XK_toprightsqbracket*: TKeySym = 0x000008A9 - XK_botrightsqbracket*: TKeySym = 0x000008AA - XK_topleftparens*: TKeySym = 0x000008AB - XK_botleftparens*: TKeySym = 0x000008AC - XK_toprightparens*: TKeySym = 0x000008AD - XK_botrightparens*: TKeySym = 0x000008AE - XK_leftmiddlecurlybrace*: TKeySym = 0x000008AF - XK_rightmiddlecurlybrace*: TKeySym = 0x000008B0 - XK_topleftsummation*: TKeySym = 0x000008B1 - XK_botleftsummation*: TKeySym = 0x000008B2 - XK_topvertsummationconnector*: TKeySym = 0x000008B3 - XK_botvertsummationconnector*: TKeySym = 0x000008B4 - XK_toprightsummation*: TKeySym = 0x000008B5 - XK_botrightsummation*: TKeySym = 0x000008B6 - XK_rightmiddlesummation*: TKeySym = 0x000008B7 - XK_lessthanequal*: TKeySym = 0x000008BC - XK_notequal*: TKeySym = 0x000008BD - XK_greaterthanequal*: TKeySym = 0x000008BE - XK_integral*: TKeySym = 0x000008BF - XK_therefore*: TKeySym = 0x000008C0 - XK_variation*: TKeySym = 0x000008C1 - XK_infinity*: TKeySym = 0x000008C2 - XK_nabla*: TKeySym = 0x000008C5 - XK_approximate*: TKeySym = 0x000008C8 - XK_similarequal*: TKeySym = 0x000008C9 - XK_ifonlyif*: TKeySym = 0x000008CD - XK_implies*: TKeySym = 0x000008CE - XK_identical*: TKeySym = 0x000008CF - XK_radical*: TKeySym = 0x000008D6 - XK_includedin*: TKeySym = 0x000008DA - XK_includes*: TKeySym = 0x000008DB - XK_intersection*: TKeySym = 0x000008DC - XK_union*: TKeySym = 0x000008DD - XK_logicaland*: TKeySym = 0x000008DE - XK_logicalor*: TKeySym = 0x000008DF - XK_partialderivative*: TKeySym = 0x000008EF - XK_function*: TKeySym = 0x000008F6 - XK_leftarrow*: TKeySym = 0x000008FB - XK_uparrow*: TKeySym = 0x000008FC - XK_rightarrow*: TKeySym = 0x000008FD - XK_downarrow*: TKeySym = 0x000008FE -# XK_TECHNICAL -#* -# * Special -# * Byte 3 = 9 -# * - -when defined(XK_SPECIAL): - const - XK_blank*: TKeySym = 0x000009DF - XK_soliddiamond*: TKeySym = 0x000009E0 - XK_checkerboard*: TKeySym = 0x000009E1 - XK_ht*: TKeySym = 0x000009E2 - XK_ff*: TKeySym = 0x000009E3 - XK_cr*: TKeySym = 0x000009E4 - XK_lf*: TKeySym = 0x000009E5 - XK_nl*: TKeySym = 0x000009E8 - XK_vt*: TKeySym = 0x000009E9 - XK_lowrightcorner*: TKeySym = 0x000009EA - XK_uprightcorner*: TKeySym = 0x000009EB - XK_upleftcorner*: TKeySym = 0x000009EC - XK_lowleftcorner*: TKeySym = 0x000009ED - XK_crossinglines*: TKeySym = 0x000009EE - XK_horizlinescan1*: TKeySym = 0x000009EF - XK_horizlinescan3*: TKeySym = 0x000009F0 - XK_horizlinescan5*: TKeySym = 0x000009F1 - XK_horizlinescan7*: TKeySym = 0x000009F2 - XK_horizlinescan9*: TKeySym = 0x000009F3 - XK_leftt*: TKeySym = 0x000009F4 - XK_rightt*: TKeySym = 0x000009F5 - XK_bott*: TKeySym = 0x000009F6 - XK_topt*: TKeySym = 0x000009F7 - XK_vertbar*: TKeySym = 0x000009F8 -# XK_SPECIAL -#* -# * Publishing -# * Byte 3 = a -# * - -when defined(XK_PUBLISHING) or true: - const - XK_emspace*: TKeySym = 0x00000AA1 - XK_enspace*: TKeySym = 0x00000AA2 - XK_em3space*: TKeySym = 0x00000AA3 - XK_em4space*: TKeySym = 0x00000AA4 - XK_digitspace*: TKeySym = 0x00000AA5 - XK_punctspace*: TKeySym = 0x00000AA6 - XK_thinspace*: TKeySym = 0x00000AA7 - XK_hairspace*: TKeySym = 0x00000AA8 - XK_emdash*: TKeySym = 0x00000AA9 - XK_endash*: TKeySym = 0x00000AAA - XK_signifblank*: TKeySym = 0x00000AAC - XK_ellipsis*: TKeySym = 0x00000AAE - XK_doubbaselinedot*: TKeySym = 0x00000AAF - XK_onethird*: TKeySym = 0x00000AB0 - XK_twothirds*: TKeySym = 0x00000AB1 - XK_onefifth*: TKeySym = 0x00000AB2 - XK_twofifths*: TKeySym = 0x00000AB3 - XK_threefifths*: TKeySym = 0x00000AB4 - XK_fourfifths*: TKeySym = 0x00000AB5 - XK_onesixth*: TKeySym = 0x00000AB6 - XK_fivesixths*: TKeySym = 0x00000AB7 - XK_careof*: TKeySym = 0x00000AB8 - XK_figdash*: TKeySym = 0x00000ABB - XK_leftanglebracket*: TKeySym = 0x00000ABC - XK_decimalpoint*: TKeySym = 0x00000ABD - XK_rightanglebracket*: TKeySym = 0x00000ABE - XK_marker*: TKeySym = 0x00000ABF - XK_oneeighth*: TKeySym = 0x00000AC3 - XK_threeeighths*: TKeySym = 0x00000AC4 - XK_fiveeighths*: TKeySym = 0x00000AC5 - XK_seveneighths*: TKeySym = 0x00000AC6 - XK_trademark*: TKeySym = 0x00000AC9 - XK_signaturemark*: TKeySym = 0x00000ACA - XK_trademarkincircle*: TKeySym = 0x00000ACB - XK_leftopentriangle*: TKeySym = 0x00000ACC - XK_rightopentriangle*: TKeySym = 0x00000ACD - XK_emopencircle*: TKeySym = 0x00000ACE - XK_emopenrectangle*: TKeySym = 0x00000ACF - XK_leftsinglequotemark*: TKeySym = 0x00000AD0 - XK_rightsinglequotemark*: TKeySym = 0x00000AD1 - XK_leftdoublequotemark*: TKeySym = 0x00000AD2 - XK_rightdoublequotemark*: TKeySym = 0x00000AD3 - XK_prescription*: TKeySym = 0x00000AD4 - XK_minutes*: TKeySym = 0x00000AD6 - XK_seconds*: TKeySym = 0x00000AD7 - XK_latincross*: TKeySym = 0x00000AD9 - XK_hexagram*: TKeySym = 0x00000ADA - XK_filledrectbullet*: TKeySym = 0x00000ADB - XK_filledlefttribullet*: TKeySym = 0x00000ADC - XK_filledrighttribullet*: TKeySym = 0x00000ADD - XK_emfilledcircle*: TKeySym = 0x00000ADE - XK_emfilledrect*: TKeySym = 0x00000ADF - XK_enopencircbullet*: TKeySym = 0x00000AE0 - XK_enopensquarebullet*: TKeySym = 0x00000AE1 - XK_openrectbullet*: TKeySym = 0x00000AE2 - XK_opentribulletup*: TKeySym = 0x00000AE3 - XK_opentribulletdown*: TKeySym = 0x00000AE4 - XK_openstar*: TKeySym = 0x00000AE5 - XK_enfilledcircbullet*: TKeySym = 0x00000AE6 - XK_enfilledsqbullet*: TKeySym = 0x00000AE7 - XK_filledtribulletup*: TKeySym = 0x00000AE8 - XK_filledtribulletdown*: TKeySym = 0x00000AE9 - XK_leftpointer*: TKeySym = 0x00000AEA - XK_rightpointer*: TKeySym = 0x00000AEB - XK_club*: TKeySym = 0x00000AEC - XK_diamond*: TKeySym = 0x00000AED - XK_heart*: TKeySym = 0x00000AEE - XK_maltesecross*: TKeySym = 0x00000AF0 - XK_dagger*: TKeySym = 0x00000AF1 - XK_doubledagger*: TKeySym = 0x00000AF2 - XK_checkmark*: TKeySym = 0x00000AF3 - XK_ballotcross*: TKeySym = 0x00000AF4 - XK_musicalsharp*: TKeySym = 0x00000AF5 - XK_musicalflat*: TKeySym = 0x00000AF6 - XK_malesymbol*: TKeySym = 0x00000AF7 - XK_femalesymbol*: TKeySym = 0x00000AF8 - XK_telephone*: TKeySym = 0x00000AF9 - XK_telephonerecorder*: TKeySym = 0x00000AFA - XK_phonographcopyright*: TKeySym = 0x00000AFB - XK_caret*: TKeySym = 0x00000AFC - XK_singlelowquotemark*: TKeySym = 0x00000AFD - XK_doublelowquotemark*: TKeySym = 0x00000AFE - XK_cursor*: TKeySym = 0x00000AFF -# XK_PUBLISHING -#* -# * APL -# * Byte 3 = b -# * - -when defined(XK_APL) or true: - const - XK_leftcaret*: TKeySym = 0x00000BA3 - XK_rightcaret*: TKeySym = 0x00000BA6 - XK_downcaret*: TKeySym = 0x00000BA8 - XK_upcaret*: TKeySym = 0x00000BA9 - XK_overbar*: TKeySym = 0x00000BC0 - XK_downtack*: TKeySym = 0x00000BC2 - XK_upshoe*: TKeySym = 0x00000BC3 - XK_downstile*: TKeySym = 0x00000BC4 - XK_underbar*: TKeySym = 0x00000BC6 - XK_jot*: TKeySym = 0x00000BCA - XK_quad*: TKeySym = 0x00000BCC - XK_uptack*: TKeySym = 0x00000BCE - XK_circle*: TKeySym = 0x00000BCF - XK_upstile*: TKeySym = 0x00000BD3 - XK_downshoe*: TKeySym = 0x00000BD6 - XK_rightshoe*: TKeySym = 0x00000BD8 - XK_leftshoe*: TKeySym = 0x00000BDA - XK_lefttack*: TKeySym = 0x00000BDC - XK_righttack*: TKeySym = 0x00000BFC -# XK_APL -#* -# * Hebrew -# * Byte 3 = c -# * - -when defined(XK_HEBREW) or true: - const - XK_hebrew_doublelowline*: TKeySym = 0x00000CDF - XK_hebrew_aleph*: TKeySym = 0x00000CE0 - XK_hebrew_bet*: TKeySym = 0x00000CE1 - XK_hebrew_beth*: TKeySym = 0x00000CE1 # deprecated - XK_hebrew_gimel*: TKeySym = 0x00000CE2 - XK_hebrew_gimmel*: TKeySym = 0x00000CE2 # deprecated - XK_hebrew_dalet*: TKeySym = 0x00000CE3 - XK_hebrew_daleth*: TKeySym = 0x00000CE3 # deprecated - XK_hebrew_he*: TKeySym = 0x00000CE4 - XK_hebrew_waw*: TKeySym = 0x00000CE5 - XK_hebrew_zain*: TKeySym = 0x00000CE6 - XK_hebrew_zayin*: TKeySym = 0x00000CE6 # deprecated - XK_hebrew_chet*: TKeySym = 0x00000CE7 - XK_hebrew_het*: TKeySym = 0x00000CE7 # deprecated - XK_hebrew_tet*: TKeySym = 0x00000CE8 - XK_hebrew_teth*: TKeySym = 0x00000CE8 # deprecated - XK_hebrew_yod*: TKeySym = 0x00000CE9 - XK_hebrew_finalkaph*: TKeySym = 0x00000CEA - XK_hebrew_kaph*: TKeySym = 0x00000CEB - XK_hebrew_lamed*: TKeySym = 0x00000CEC - XK_hebrew_finalmem*: TKeySym = 0x00000CED - XK_hebrew_mem*: TKeySym = 0x00000CEE - XK_hebrew_finalnun*: TKeySym = 0x00000CEF - XK_hebrew_nun*: TKeySym = 0x00000CF0 - XK_hebrew_samech*: TKeySym = 0x00000CF1 - XK_hebrew_samekh*: TKeySym = 0x00000CF1 # deprecated - XK_hebrew_ayin*: TKeySym = 0x00000CF2 - XK_hebrew_finalpe*: TKeySym = 0x00000CF3 - XK_hebrew_pe*: TKeySym = 0x00000CF4 - XK_hebrew_finalzade*: TKeySym = 0x00000CF5 - XK_hebrew_finalzadi*: TKeySym = 0x00000CF5 # deprecated - XK_hebrew_zade*: TKeySym = 0x00000CF6 - XK_hebrew_zadi*: TKeySym = 0x00000CF6 # deprecated - XK_hebrew_qoph*: TKeySym = 0x00000CF7 - XK_hebrew_kuf*: TKeySym = 0x00000CF7 # deprecated - XK_hebrew_resh*: TKeySym = 0x00000CF8 - XK_hebrew_shin*: TKeySym = 0x00000CF9 - XK_hebrew_taw*: TKeySym = 0x00000CFA - XK_hebrew_taf*: TKeySym = 0x00000CFA # deprecated - XK_Hebrew_switch*: TKeySym = 0x0000FF7E # Alias for mode_switch -# XK_HEBREW -#* -# * Thai -# * Byte 3 = d -# * - -when defined(XK_THAI) or true: - const - XK_Thai_kokai*: TKeySym = 0x00000DA1 - XK_Thai_khokhai*: TKeySym = 0x00000DA2 - XK_Thai_khokhuat*: TKeySym = 0x00000DA3 - XK_Thai_khokhwai*: TKeySym = 0x00000DA4 - XK_Thai_khokhon*: TKeySym = 0x00000DA5 - XK_Thai_khorakhang*: TKeySym = 0x00000DA6 - XK_Thai_ngongu*: TKeySym = 0x00000DA7 - XK_Thai_chochan*: TKeySym = 0x00000DA8 - XK_Thai_choching*: TKeySym = 0x00000DA9 - XK_Thai_chochang*: TKeySym = 0x00000DAA - XK_Thai_soso*: TKeySym = 0x00000DAB - XK_Thai_chochoe*: TKeySym = 0x00000DAC - XK_Thai_yoying*: TKeySym = 0x00000DAD - XK_Thai_dochada*: TKeySym = 0x00000DAE - XK_Thai_topatak*: TKeySym = 0x00000DAF - XK_Thai_thothan*: TKeySym = 0x00000DB0 - XK_Thai_thonangmontho*: TKeySym = 0x00000DB1 - XK_Thai_thophuthao*: TKeySym = 0x00000DB2 - XK_Thai_nonen*: TKeySym = 0x00000DB3 - XK_Thai_dodek*: TKeySym = 0x00000DB4 - XK_Thai_totao*: TKeySym = 0x00000DB5 - XK_Thai_thothung*: TKeySym = 0x00000DB6 - XK_Thai_thothahan*: TKeySym = 0x00000DB7 - XK_Thai_thothong*: TKeySym = 0x00000DB8 - XK_Thai_nonu*: TKeySym = 0x00000DB9 - XK_Thai_bobaimai*: TKeySym = 0x00000DBA - XK_Thai_popla*: TKeySym = 0x00000DBB - XK_Thai_phophung*: TKeySym = 0x00000DBC - XK_Thai_fofa*: TKeySym = 0x00000DBD - XK_Thai_phophan*: TKeySym = 0x00000DBE - XK_Thai_fofan*: TKeySym = 0x00000DBF - XK_Thai_phosamphao*: TKeySym = 0x00000DC0 - XK_Thai_moma*: TKeySym = 0x00000DC1 - XK_Thai_yoyak*: TKeySym = 0x00000DC2 - XK_Thai_rorua*: TKeySym = 0x00000DC3 - XK_Thai_ru*: TKeySym = 0x00000DC4 - XK_Thai_loling*: TKeySym = 0x00000DC5 - XK_Thai_lu*: TKeySym = 0x00000DC6 - XK_Thai_wowaen*: TKeySym = 0x00000DC7 - XK_Thai_sosala*: TKeySym = 0x00000DC8 - XK_Thai_sorusi*: TKeySym = 0x00000DC9 - XK_Thai_sosua*: TKeySym = 0x00000DCA - XK_Thai_hohip*: TKeySym = 0x00000DCB - XK_Thai_lochula*: TKeySym = 0x00000DCC - XK_Thai_oang*: TKeySym = 0x00000DCD - XK_Thai_honokhuk*: TKeySym = 0x00000DCE - XK_Thai_paiyannoi*: TKeySym = 0x00000DCF - XK_Thai_saraa*: TKeySym = 0x00000DD0 - XK_Thai_maihanakat*: TKeySym = 0x00000DD1 - XK_Thai_saraaa*: TKeySym = 0x00000DD2 - XK_Thai_saraam*: TKeySym = 0x00000DD3 - XK_Thai_sarai*: TKeySym = 0x00000DD4 - XK_Thai_saraii*: TKeySym = 0x00000DD5 - XK_Thai_saraue*: TKeySym = 0x00000DD6 - XK_Thai_sarauee*: TKeySym = 0x00000DD7 - XK_Thai_sarau*: TKeySym = 0x00000DD8 - XK_Thai_sarauu*: TKeySym = 0x00000DD9 - XK_Thai_phinthu*: TKeySym = 0x00000DDA - XK_Thai_maihanakat_maitho*: TKeySym = 0x00000DDE - XK_Thai_baht*: TKeySym = 0x00000DDF - XK_Thai_sarae*: TKeySym = 0x00000DE0 - XK_Thai_saraae*: TKeySym = 0x00000DE1 - XK_Thai_sarao*: TKeySym = 0x00000DE2 - XK_Thai_saraaimaimuan*: TKeySym = 0x00000DE3 - XK_Thai_saraaimaimalai*: TKeySym = 0x00000DE4 - XK_Thai_lakkhangyao*: TKeySym = 0x00000DE5 - XK_Thai_maiyamok*: TKeySym = 0x00000DE6 - XK_Thai_maitaikhu*: TKeySym = 0x00000DE7 - XK_Thai_maiek*: TKeySym = 0x00000DE8 - XK_Thai_maitho*: TKeySym = 0x00000DE9 - XK_Thai_maitri*: TKeySym = 0x00000DEA - XK_Thai_maichattawa*: TKeySym = 0x00000DEB - XK_Thai_thanthakhat*: TKeySym = 0x00000DEC - XK_Thai_nikhahit*: TKeySym = 0x00000DED - XK_Thai_leksun*: TKeySym = 0x00000DF0 - XK_Thai_leknung*: TKeySym = 0x00000DF1 - XK_Thai_leksong*: TKeySym = 0x00000DF2 - XK_Thai_leksam*: TKeySym = 0x00000DF3 - XK_Thai_leksi*: TKeySym = 0x00000DF4 - XK_Thai_lekha*: TKeySym = 0x00000DF5 - XK_Thai_lekhok*: TKeySym = 0x00000DF6 - XK_Thai_lekchet*: TKeySym = 0x00000DF7 - XK_Thai_lekpaet*: TKeySym = 0x00000DF8 - XK_Thai_lekkao*: TKeySym = 0x00000DF9 -# XK_THAI -#* -# * Korean -# * Byte 3 = e -# * - -when defined(XK_KOREAN) or true: - const - XK_Hangul*: TKeySym = 0x0000FF31 # Hangul start/stop(toggle) - XK_Hangul_Start*: TKeySym = 0x0000FF32 # Hangul start - XK_Hangul_End*: TKeySym = 0x0000FF33 # Hangul end, English start - XK_Hangul_Hanja*: TKeySym = 0x0000FF34 # Start Hangul->Hanja Conversion - XK_Hangul_Jamo*: TKeySym = 0x0000FF35 # Hangul Jamo mode - XK_Hangul_Romaja*: TKeySym = 0x0000FF36 # Hangul Romaja mode - XK_Hangul_Codeinput*: TKeySym = 0x0000FF37 # Hangul code input mode - XK_Hangul_Jeonja*: TKeySym = 0x0000FF38 # Jeonja mode - XK_Hangul_Banja*: TKeySym = 0x0000FF39 # Banja mode - XK_Hangul_PreHanja*: TKeySym = 0x0000FF3A # Pre Hanja conversion - XK_Hangul_PostHanja*: TKeySym = 0x0000FF3B # Post Hanja conversion - XK_Hangul_SingleCandidate*: TKeySym = 0x0000FF3C # Single candidate - XK_Hangul_MultipleCandidate*: TKeySym = 0x0000FF3D # Multiple candidate - XK_Hangul_PreviousCandidate*: TKeySym = 0x0000FF3E # Previous candidate - XK_Hangul_Special*: TKeySym = 0x0000FF3F # Special symbols - XK_Hangul_switch*: TKeySym = 0x0000FF7E # Alias for mode_switch \ - # Hangul Consonant Characters - XK_Hangul_Kiyeog*: TKeySym = 0x00000EA1 - XK_Hangul_SsangKiyeog*: TKeySym = 0x00000EA2 - XK_Hangul_KiyeogSios*: TKeySym = 0x00000EA3 - XK_Hangul_Nieun*: TKeySym = 0x00000EA4 - XK_Hangul_NieunJieuj*: TKeySym = 0x00000EA5 - XK_Hangul_NieunHieuh*: TKeySym = 0x00000EA6 - XK_Hangul_Dikeud*: TKeySym = 0x00000EA7 - XK_Hangul_SsangDikeud*: TKeySym = 0x00000EA8 - XK_Hangul_Rieul*: TKeySym = 0x00000EA9 - XK_Hangul_RieulKiyeog*: TKeySym = 0x00000EAA - XK_Hangul_RieulMieum*: TKeySym = 0x00000EAB - XK_Hangul_RieulPieub*: TKeySym = 0x00000EAC - XK_Hangul_RieulSios*: TKeySym = 0x00000EAD - XK_Hangul_RieulTieut*: TKeySym = 0x00000EAE - XK_Hangul_RieulPhieuf*: TKeySym = 0x00000EAF - XK_Hangul_RieulHieuh*: TKeySym = 0x00000EB0 - XK_Hangul_Mieum*: TKeySym = 0x00000EB1 - XK_Hangul_Pieub*: TKeySym = 0x00000EB2 - XK_Hangul_SsangPieub*: TKeySym = 0x00000EB3 - XK_Hangul_PieubSios*: TKeySym = 0x00000EB4 - XK_Hangul_Sios*: TKeySym = 0x00000EB5 - XK_Hangul_SsangSios*: TKeySym = 0x00000EB6 - XK_Hangul_Ieung*: TKeySym = 0x00000EB7 - XK_Hangul_Jieuj*: TKeySym = 0x00000EB8 - XK_Hangul_SsangJieuj*: TKeySym = 0x00000EB9 - XK_Hangul_Cieuc*: TKeySym = 0x00000EBA - XK_Hangul_Khieuq*: TKeySym = 0x00000EBB - XK_Hangul_Tieut*: TKeySym = 0x00000EBC - XK_Hangul_Phieuf*: TKeySym = 0x00000EBD - XK_Hangul_Hieuh*: TKeySym = 0x00000EBE # Hangul Vowel Characters - XK_Hangul_A*: TKeySym = 0x00000EBF - XK_Hangul_AE*: TKeySym = 0x00000EC0 - XK_Hangul_YA*: TKeySym = 0x00000EC1 - XK_Hangul_YAE*: TKeySym = 0x00000EC2 - XK_Hangul_EO*: TKeySym = 0x00000EC3 - XK_Hangul_E*: TKeySym = 0x00000EC4 - XK_Hangul_YEO*: TKeySym = 0x00000EC5 - XK_Hangul_YE*: TKeySym = 0x00000EC6 - XK_Hangul_O*: TKeySym = 0x00000EC7 - XK_Hangul_WA*: TKeySym = 0x00000EC8 - XK_Hangul_WAE*: TKeySym = 0x00000EC9 - XK_Hangul_OE*: TKeySym = 0x00000ECA - XK_Hangul_YO*: TKeySym = 0x00000ECB - XK_Hangul_U*: TKeySym = 0x00000ECC - XK_Hangul_WEO*: TKeySym = 0x00000ECD - XK_Hangul_WE*: TKeySym = 0x00000ECE - XK_Hangul_WI*: TKeySym = 0x00000ECF - XK_Hangul_YU*: TKeySym = 0x00000ED0 - XK_Hangul_EU*: TKeySym = 0x00000ED1 - XK_Hangul_YI*: TKeySym = 0x00000ED2 - XK_Hangul_I*: TKeySym = 0x00000ED3 # Hangul syllable-final (JongSeong) Characters - XK_Hangul_J_Kiyeog*: TKeySym = 0x00000ED4 - XK_Hangul_J_SsangKiyeog*: TKeySym = 0x00000ED5 - XK_Hangul_J_KiyeogSios*: TKeySym = 0x00000ED6 - XK_Hangul_J_Nieun*: TKeySym = 0x00000ED7 - XK_Hangul_J_NieunJieuj*: TKeySym = 0x00000ED8 - XK_Hangul_J_NieunHieuh*: TKeySym = 0x00000ED9 - XK_Hangul_J_Dikeud*: TKeySym = 0x00000EDA - XK_Hangul_J_Rieul*: TKeySym = 0x00000EDB - XK_Hangul_J_RieulKiyeog*: TKeySym = 0x00000EDC - XK_Hangul_J_RieulMieum*: TKeySym = 0x00000EDD - XK_Hangul_J_RieulPieub*: TKeySym = 0x00000EDE - XK_Hangul_J_RieulSios*: TKeySym = 0x00000EDF - XK_Hangul_J_RieulTieut*: TKeySym = 0x00000EE0 - XK_Hangul_J_RieulPhieuf*: TKeySym = 0x00000EE1 - XK_Hangul_J_RieulHieuh*: TKeySym = 0x00000EE2 - XK_Hangul_J_Mieum*: TKeySym = 0x00000EE3 - XK_Hangul_J_Pieub*: TKeySym = 0x00000EE4 - XK_Hangul_J_PieubSios*: TKeySym = 0x00000EE5 - XK_Hangul_J_Sios*: TKeySym = 0x00000EE6 - XK_Hangul_J_SsangSios*: TKeySym = 0x00000EE7 - XK_Hangul_J_Ieung*: TKeySym = 0x00000EE8 - XK_Hangul_J_Jieuj*: TKeySym = 0x00000EE9 - XK_Hangul_J_Cieuc*: TKeySym = 0x00000EEA - XK_Hangul_J_Khieuq*: TKeySym = 0x00000EEB - XK_Hangul_J_Tieut*: TKeySym = 0x00000EEC - XK_Hangul_J_Phieuf*: TKeySym = 0x00000EED - XK_Hangul_J_Hieuh*: TKeySym = 0x00000EEE # Ancient Hangul Consonant Characters - XK_Hangul_RieulYeorinHieuh*: TKeySym = 0x00000EEF - XK_Hangul_SunkyeongeumMieum*: TKeySym = 0x00000EF0 - XK_Hangul_SunkyeongeumPieub*: TKeySym = 0x00000EF1 - XK_Hangul_PanSios*: TKeySym = 0x00000EF2 - XK_Hangul_KkogjiDalrinIeung*: TKeySym = 0x00000EF3 - XK_Hangul_SunkyeongeumPhieuf*: TKeySym = 0x00000EF4 - XK_Hangul_YeorinHieuh*: TKeySym = 0x00000EF5 # Ancient Hangul Vowel Characters - XK_Hangul_AraeA*: TKeySym = 0x00000EF6 - XK_Hangul_AraeAE*: TKeySym = 0x00000EF7 # Ancient Hangul syllable-final (JongSeong) Characters - XK_Hangul_J_PanSios*: TKeySym = 0x00000EF8 - XK_Hangul_J_KkogjiDalrinIeung*: TKeySym = 0x00000EF9 - XK_Hangul_J_YeorinHieuh*: TKeySym = 0x00000EFA # Korean currency symbol - XK_Korean_Won*: TKeySym = 0x00000EFF -# XK_KOREAN -#* -# * Armenian -# * Byte 3 = = $14 -# * - -when defined(XK_ARMENIAN) or true: - const - XK_Armenian_eternity*: TKeySym = 0x000014A1 - XK_Armenian_ligature_ew*: TKeySym = 0x000014A2 - XK_Armenian_full_stop*: TKeySym = 0x000014A3 - XK_Armenian_verjaket*: TKeySym = 0x000014A3 - XK_Armenian_parenright*: TKeySym = 0x000014A4 - XK_Armenian_parenleft*: TKeySym = 0x000014A5 - XK_Armenian_guillemotright*: TKeySym = 0x000014A6 - XK_Armenian_guillemotleft*: TKeySym = 0x000014A7 - XK_Armenian_em_dash*: TKeySym = 0x000014A8 - XK_Armenian_dot*: TKeySym = 0x000014A9 - XK_Armenian_mijaket*: TKeySym = 0x000014A9 - XK_Armenian_separation_mark*: TKeySym = 0x000014AA - XK_Armenian_but*: TKeySym = 0x000014AA - XK_Armenian_comma*: TKeySym = 0x000014AB - XK_Armenian_en_dash*: TKeySym = 0x000014AC - XK_Armenian_hyphen*: TKeySym = 0x000014AD - XK_Armenian_yentamna*: TKeySym = 0x000014AD - XK_Armenian_ellipsis*: TKeySym = 0x000014AE - XK_Armenian_exclam*: TKeySym = 0x000014AF - XK_Armenian_amanak*: TKeySym = 0x000014AF - XK_Armenian_accent*: TKeySym = 0x000014B0 - XK_Armenian_shesht*: TKeySym = 0x000014B0 - XK_Armenian_question*: TKeySym = 0x000014B1 - XK_Armenian_paruyk*: TKeySym = 0x000014B1 - XKc_Armenian_AYB*: TKeySym = 0x000014B2 - XK_Armenian_ayb*: TKeySym = 0x000014B3 - XKc_Armenian_BEN*: TKeySym = 0x000014B4 - XK_Armenian_ben*: TKeySym = 0x000014B5 - XKc_Armenian_GIM*: TKeySym = 0x000014B6 - XK_Armenian_gim*: TKeySym = 0x000014B7 - XKc_Armenian_DA*: TKeySym = 0x000014B8 - XK_Armenian_da*: TKeySym = 0x000014B9 - XKc_Armenian_YECH*: TKeySym = 0x000014BA - XK_Armenian_yech*: TKeySym = 0x000014BB - XKc_Armenian_ZA*: TKeySym = 0x000014BC - XK_Armenian_za*: TKeySym = 0x000014BD - XKc_Armenian_E*: TKeySym = 0x000014BE - XK_Armenian_e*: TKeySym = 0x000014BF - XKc_Armenian_AT*: TKeySym = 0x000014C0 - XK_Armenian_at*: TKeySym = 0x000014C1 - XKc_Armenian_TO*: TKeySym = 0x000014C2 - XK_Armenian_to*: TKeySym = 0x000014C3 - XKc_Armenian_ZHE*: TKeySym = 0x000014C4 - XK_Armenian_zhe*: TKeySym = 0x000014C5 - XKc_Armenian_INI*: TKeySym = 0x000014C6 - XK_Armenian_ini*: TKeySym = 0x000014C7 - XKc_Armenian_LYUN*: TKeySym = 0x000014C8 - XK_Armenian_lyun*: TKeySym = 0x000014C9 - XKc_Armenian_KHE*: TKeySym = 0x000014CA - XK_Armenian_khe*: TKeySym = 0x000014CB - XKc_Armenian_TSA*: TKeySym = 0x000014CC - XK_Armenian_tsa*: TKeySym = 0x000014CD - XKc_Armenian_KEN*: TKeySym = 0x000014CE - XK_Armenian_ken*: TKeySym = 0x000014CF - XKc_Armenian_HO*: TKeySym = 0x000014D0 - XK_Armenian_ho*: TKeySym = 0x000014D1 - XKc_Armenian_DZA*: TKeySym = 0x000014D2 - XK_Armenian_dza*: TKeySym = 0x000014D3 - XKc_Armenian_GHAT*: TKeySym = 0x000014D4 - XK_Armenian_ghat*: TKeySym = 0x000014D5 - XKc_Armenian_TCHE*: TKeySym = 0x000014D6 - XK_Armenian_tche*: TKeySym = 0x000014D7 - XKc_Armenian_MEN*: TKeySym = 0x000014D8 - XK_Armenian_men*: TKeySym = 0x000014D9 - XKc_Armenian_HI*: TKeySym = 0x000014DA - XK_Armenian_hi*: TKeySym = 0x000014DB - XKc_Armenian_NU*: TKeySym = 0x000014DC - XK_Armenian_nu*: TKeySym = 0x000014DD - XKc_Armenian_SHA*: TKeySym = 0x000014DE - XK_Armenian_sha*: TKeySym = 0x000014DF - XKc_Armenian_VO*: TKeySym = 0x000014E0 - XK_Armenian_vo*: TKeySym = 0x000014E1 - XKc_Armenian_CHA*: TKeySym = 0x000014E2 - XK_Armenian_cha*: TKeySym = 0x000014E3 - XKc_Armenian_PE*: TKeySym = 0x000014E4 - XK_Armenian_pe*: TKeySym = 0x000014E5 - XKc_Armenian_JE*: TKeySym = 0x000014E6 - XK_Armenian_je*: TKeySym = 0x000014E7 - XKc_Armenian_RA*: TKeySym = 0x000014E8 - XK_Armenian_ra*: TKeySym = 0x000014E9 - XKc_Armenian_SE*: TKeySym = 0x000014EA - XK_Armenian_se*: TKeySym = 0x000014EB - XKc_Armenian_VEV*: TKeySym = 0x000014EC - XK_Armenian_vev*: TKeySym = 0x000014ED - XKc_Armenian_TYUN*: TKeySym = 0x000014EE - XK_Armenian_tyun*: TKeySym = 0x000014EF - XKc_Armenian_RE*: TKeySym = 0x000014F0 - XK_Armenian_re*: TKeySym = 0x000014F1 - XKc_Armenian_TSO*: TKeySym = 0x000014F2 - XK_Armenian_tso*: TKeySym = 0x000014F3 - XKc_Armenian_VYUN*: TKeySym = 0x000014F4 - XK_Armenian_vyun*: TKeySym = 0x000014F5 - XKc_Armenian_PYUR*: TKeySym = 0x000014F6 - XK_Armenian_pyur*: TKeySym = 0x000014F7 - XKc_Armenian_KE*: TKeySym = 0x000014F8 - XK_Armenian_ke*: TKeySym = 0x000014F9 - XKc_Armenian_O*: TKeySym = 0x000014FA - XK_Armenian_o*: TKeySym = 0x000014FB - XKc_Armenian_FE*: TKeySym = 0x000014FC - XK_Armenian_fe*: TKeySym = 0x000014FD - XK_Armenian_apostrophe*: TKeySym = 0x000014FE - XK_Armenian_section_sign*: TKeySym = 0x000014FF -# XK_ARMENIAN -#* -# * Georgian -# * Byte 3 = = $15 -# * - -when defined(XK_GEORGIAN) or true: - const - XK_Georgian_an*: TKeySym = 0x000015D0 - XK_Georgian_ban*: TKeySym = 0x000015D1 - XK_Georgian_gan*: TKeySym = 0x000015D2 - XK_Georgian_don*: TKeySym = 0x000015D3 - XK_Georgian_en*: TKeySym = 0x000015D4 - XK_Georgian_vin*: TKeySym = 0x000015D5 - XK_Georgian_zen*: TKeySym = 0x000015D6 - XK_Georgian_tan*: TKeySym = 0x000015D7 - XK_Georgian_in*: TKeySym = 0x000015D8 - XK_Georgian_kan*: TKeySym = 0x000015D9 - XK_Georgian_las*: TKeySym = 0x000015DA - XK_Georgian_man*: TKeySym = 0x000015DB - XK_Georgian_nar*: TKeySym = 0x000015DC - XK_Georgian_on*: TKeySym = 0x000015DD - XK_Georgian_par*: TKeySym = 0x000015DE - XK_Georgian_zhar*: TKeySym = 0x000015DF - XK_Georgian_rae*: TKeySym = 0x000015E0 - XK_Georgian_san*: TKeySym = 0x000015E1 - XK_Georgian_tar*: TKeySym = 0x000015E2 - XK_Georgian_un*: TKeySym = 0x000015E3 - XK_Georgian_phar*: TKeySym = 0x000015E4 - XK_Georgian_khar*: TKeySym = 0x000015E5 - XK_Georgian_ghan*: TKeySym = 0x000015E6 - XK_Georgian_qar*: TKeySym = 0x000015E7 - XK_Georgian_shin*: TKeySym = 0x000015E8 - XK_Georgian_chin*: TKeySym = 0x000015E9 - XK_Georgian_can*: TKeySym = 0x000015EA - XK_Georgian_jil*: TKeySym = 0x000015EB - XK_Georgian_cil*: TKeySym = 0x000015EC - XK_Georgian_char*: TKeySym = 0x000015ED - XK_Georgian_xan*: TKeySym = 0x000015EE - XK_Georgian_jhan*: TKeySym = 0x000015EF - XK_Georgian_hae*: TKeySym = 0x000015F0 - XK_Georgian_he*: TKeySym = 0x000015F1 - XK_Georgian_hie*: TKeySym = 0x000015F2 - XK_Georgian_we*: TKeySym = 0x000015F3 - XK_Georgian_har*: TKeySym = 0x000015F4 - XK_Georgian_hoe*: TKeySym = 0x000015F5 - XK_Georgian_fi*: TKeySym = 0x000015F6 -# XK_GEORGIAN -#* -# * Azeri (and other Turkic or Caucasian languages of ex-USSR) -# * Byte 3 = = $16 -# * - -when defined(XK_CAUCASUS) or true: - # latin - const - XKc_Ccedillaabovedot*: TKeySym = 0x000016A2 - XKc_Xabovedot*: TKeySym = 0x000016A3 - XKc_Qabovedot*: TKeySym = 0x000016A5 - XKc_Ibreve*: TKeySym = 0x000016A6 - XKc_IE*: TKeySym = 0x000016A7 - XKc_UO*: TKeySym = 0x000016A8 - XKc_Zstroke*: TKeySym = 0x000016A9 - XKc_Gcaron*: TKeySym = 0x000016AA - XKc_Obarred*: TKeySym = 0x000016AF - XK_ccedillaabovedot*: TKeySym = 0x000016B2 - XK_xabovedot*: TKeySym = 0x000016B3 - XKc_Ocaron*: TKeySym = 0x000016B4 - XK_qabovedot*: TKeySym = 0x000016B5 - XK_ibreve*: TKeySym = 0x000016B6 - XK_ie*: TKeySym = 0x000016B7 - XK_uo*: TKeySym = 0x000016B8 - XK_zstroke*: TKeySym = 0x000016B9 - XK_gcaron*: TKeySym = 0x000016BA - XK_ocaron*: TKeySym = 0x000016BD - XK_obarred*: TKeySym = 0x000016BF - XKc_SCHWA*: TKeySym = 0x000016C6 - XK_schwa*: TKeySym = 0x000016F6 # those are not really Caucasus, but I put them here for now\ - # For Inupiak - XKc_Lbelowdot*: TKeySym = 0x000016D1 - XKc_Lstrokebelowdot*: TKeySym = 0x000016D2 - XK_lbelowdot*: TKeySym = 0x000016E1 - XK_lstrokebelowdot*: TKeySym = 0x000016E2 # For Guarani - XKc_Gtilde*: TKeySym = 0x000016D3 - XK_gtilde*: TKeySym = 0x000016E3 -# XK_CAUCASUS -#* -# * Vietnamese -# * Byte 3 = = $1e -# * - -when defined(XK_VIETNAMESE) or true: - const - XKc_Abelowdot*: TKeySym = 0x00001EA0 - XK_abelowdot*: TKeySym = 0x00001EA1 - XKc_Ahook*: TKeySym = 0x00001EA2 - XK_ahook*: TKeySym = 0x00001EA3 - XKc_Acircumflexacute*: TKeySym = 0x00001EA4 - XK_acircumflexacute*: TKeySym = 0x00001EA5 - XKc_Acircumflexgrave*: TKeySym = 0x00001EA6 - XK_acircumflexgrave*: TKeySym = 0x00001EA7 - XKc_Acircumflexhook*: TKeySym = 0x00001EA8 - XK_acircumflexhook*: TKeySym = 0x00001EA9 - XKc_Acircumflextilde*: TKeySym = 0x00001EAA - XK_acircumflextilde*: TKeySym = 0x00001EAB - XKc_Acircumflexbelowdot*: TKeySym = 0x00001EAC - XK_acircumflexbelowdot*: TKeySym = 0x00001EAD - XKc_Abreveacute*: TKeySym = 0x00001EAE - XK_abreveacute*: TKeySym = 0x00001EAF - XKc_Abrevegrave*: TKeySym = 0x00001EB0 - XK_abrevegrave*: TKeySym = 0x00001EB1 - XKc_Abrevehook*: TKeySym = 0x00001EB2 - XK_abrevehook*: TKeySym = 0x00001EB3 - XKc_Abrevetilde*: TKeySym = 0x00001EB4 - XK_abrevetilde*: TKeySym = 0x00001EB5 - XKc_Abrevebelowdot*: TKeySym = 0x00001EB6 - XK_abrevebelowdot*: TKeySym = 0x00001EB7 - XKc_Ebelowdot*: TKeySym = 0x00001EB8 - XK_ebelowdot*: TKeySym = 0x00001EB9 - XKc_Ehook*: TKeySym = 0x00001EBA - XK_ehook*: TKeySym = 0x00001EBB - XKc_Etilde*: TKeySym = 0x00001EBC - XK_etilde*: TKeySym = 0x00001EBD - XKc_Ecircumflexacute*: TKeySym = 0x00001EBE - XK_ecircumflexacute*: TKeySym = 0x00001EBF - XKc_Ecircumflexgrave*: TKeySym = 0x00001EC0 - XK_ecircumflexgrave*: TKeySym = 0x00001EC1 - XKc_Ecircumflexhook*: TKeySym = 0x00001EC2 - XK_ecircumflexhook*: TKeySym = 0x00001EC3 - XKc_Ecircumflextilde*: TKeySym = 0x00001EC4 - XK_ecircumflextilde*: TKeySym = 0x00001EC5 - XKc_Ecircumflexbelowdot*: TKeySym = 0x00001EC6 - XK_ecircumflexbelowdot*: TKeySym = 0x00001EC7 - XKc_Ihook*: TKeySym = 0x00001EC8 - XK_ihook*: TKeySym = 0x00001EC9 - XKc_Ibelowdot*: TKeySym = 0x00001ECA - XK_ibelowdot*: TKeySym = 0x00001ECB - XKc_Obelowdot*: TKeySym = 0x00001ECC - XK_obelowdot*: TKeySym = 0x00001ECD - XKc_Ohook*: TKeySym = 0x00001ECE - XK_ohook*: TKeySym = 0x00001ECF - XKc_Ocircumflexacute*: TKeySym = 0x00001ED0 - XK_ocircumflexacute*: TKeySym = 0x00001ED1 - XKc_Ocircumflexgrave*: TKeySym = 0x00001ED2 - XK_ocircumflexgrave*: TKeySym = 0x00001ED3 - XKc_Ocircumflexhook*: TKeySym = 0x00001ED4 - XK_ocircumflexhook*: TKeySym = 0x00001ED5 - XKc_Ocircumflextilde*: TKeySym = 0x00001ED6 - XK_ocircumflextilde*: TKeySym = 0x00001ED7 - XKc_Ocircumflexbelowdot*: TKeySym = 0x00001ED8 - XK_ocircumflexbelowdot*: TKeySym = 0x00001ED9 - XKc_Ohornacute*: TKeySym = 0x00001EDA - XK_ohornacute*: TKeySym = 0x00001EDB - XKc_Ohorngrave*: TKeySym = 0x00001EDC - XK_ohorngrave*: TKeySym = 0x00001EDD - XKc_Ohornhook*: TKeySym = 0x00001EDE - XK_ohornhook*: TKeySym = 0x00001EDF - XKc_Ohorntilde*: TKeySym = 0x00001EE0 - XK_ohorntilde*: TKeySym = 0x00001EE1 - XKc_Ohornbelowdot*: TKeySym = 0x00001EE2 - XK_ohornbelowdot*: TKeySym = 0x00001EE3 - XKc_Ubelowdot*: TKeySym = 0x00001EE4 - XK_ubelowdot*: TKeySym = 0x00001EE5 - XKc_Uhook*: TKeySym = 0x00001EE6 - XK_uhook*: TKeySym = 0x00001EE7 - XKc_Uhornacute*: TKeySym = 0x00001EE8 - XK_uhornacute*: TKeySym = 0x00001EE9 - XKc_Uhorngrave*: TKeySym = 0x00001EEA - XK_uhorngrave*: TKeySym = 0x00001EEB - XKc_Uhornhook*: TKeySym = 0x00001EEC - XK_uhornhook*: TKeySym = 0x00001EED - XKc_Uhorntilde*: TKeySym = 0x00001EEE - XK_uhorntilde*: TKeySym = 0x00001EEF - XKc_Uhornbelowdot*: TKeySym = 0x00001EF0 - XK_uhornbelowdot*: TKeySym = 0x00001EF1 - XKc_Ybelowdot*: TKeySym = 0x00001EF4 - XK_ybelowdot*: TKeySym = 0x00001EF5 - XKc_Yhook*: TKeySym = 0x00001EF6 - XK_yhook*: TKeySym = 0x00001EF7 - XKc_Ytilde*: TKeySym = 0x00001EF8 - XK_ytilde*: TKeySym = 0x00001EF9 - XKc_Ohorn*: TKeySym = 0x00001EFA # U+01a0 - XK_ohorn*: TKeySym = 0x00001EFB # U+01a1 - XKc_Uhorn*: TKeySym = 0x00001EFC # U+01af - XK_uhorn*: TKeySym = 0x00001EFD # U+01b0 - XK_combining_tilde*: TKeySym = 0x00001E9F # U+0303 - XK_combining_grave*: TKeySym = 0x00001EF2 # U+0300 - XK_combining_acute*: TKeySym = 0x00001EF3 # U+0301 - XK_combining_hook*: TKeySym = 0x00001EFE # U+0309 - XK_combining_belowdot*: TKeySym = 0x00001EFF # U+0323 -# XK_VIETNAMESE - -when defined(XK_CURRENCY) or true: - const - XK_EcuSign*: TKeySym = 0x000020A0 - XK_ColonSign*: TKeySym = 0x000020A1 - XK_CruzeiroSign*: TKeySym = 0x000020A2 - XK_FFrancSign*: TKeySym = 0x000020A3 - XK_LiraSign*: TKeySym = 0x000020A4 - XK_MillSign*: TKeySym = 0x000020A5 - XK_NairaSign*: TKeySym = 0x000020A6 - XK_PesetaSign*: TKeySym = 0x000020A7 - XK_RupeeSign*: TKeySym = 0x000020A8 - XK_WonSign*: TKeySym = 0x000020A9 - XK_NewSheqelSign*: TKeySym = 0x000020AA - XK_DongSign*: TKeySym = 0x000020AB - XK_EuroSign*: TKeySym = 0x000020AC -# implementation diff --git a/lib/wrappers/x11/x.nim b/lib/wrappers/x11/x.nim deleted file mode 100644 index 2eefe311ff..0000000000 --- a/lib/wrappers/x11/x.nim +++ /dev/null @@ -1,401 +0,0 @@ - -# -# Automatically converted by H2Pas 0.99.15 from x.h -# The following command line parameters were used: -# -p -# -T -# -S -# -d -# -c -# x.h -# -# Pointers to basic pascal types, inserted by h2pas conversion program. -import unsigned - -const - X_PROTOCOL* = 11 - X_PROTOCOL_REVISION* = 0 - -type - PXID* = ptr TXID - TXID* = culong - PMask* = ptr TMask - TMask* = culong - PPAtom* = ptr PAtom - PAtom* = ptr TAtom - TAtom* = culong - PVisualID* = ptr TVisualID - TVisualID* = culong - PTime* = ptr TTime - TTime* = culong - PPWindow* = ptr PWindow - PWindow* = ptr TWindow - TWindow* = TXID - PDrawable* = ptr TDrawable - TDrawable* = TXID - PFont* = ptr TFont - TFont* = TXID - PPixmap* = ptr TPixmap - TPixmap* = TXID - PCursor* = ptr TCursor - TCursor* = TXID - PColormap* = ptr TColormap - TColormap* = TXID - PGContext* = ptr TGContext - TGContext* = TXID - PKeySym* = ptr TKeySym - TKeySym* = TXID - PKeyCode* = ptr TKeyCode - TKeyCode* = cuchar - -proc `==`*(a, b: TAtom): bool = - return unsigned.`==`(a,b) - -const - None* = 0 - ParentRelative* = 1 - CopyFromParent* = 0 - PointerWindow* = 0 - InputFocus* = 1 - PointerRoot* = 1 - AnyPropertyType* = 0 - AnyKey* = 0 - AnyButton* = 0 - AllTemporary* = 0 - CurrentTime* = 0 - NoSymbol* = 0 - NoEventMask* = 0 - KeyPressMask* = 1 shl 0 - KeyReleaseMask* = 1 shl 1 - ButtonPressMask* = 1 shl 2 - ButtonReleaseMask* = 1 shl 3 - EnterWindowMask* = 1 shl 4 - LeaveWindowMask* = 1 shl 5 - PointerMotionMask* = 1 shl 6 - PointerMotionHintMask* = 1 shl 7 - Button1MotionMask* = 1 shl 8 - Button2MotionMask* = 1 shl 9 - Button3MotionMask* = 1 shl 10 - Button4MotionMask* = 1 shl 11 - Button5MotionMask* = 1 shl 12 - ButtonMotionMask* = 1 shl 13 - KeymapStateMask* = 1 shl 14 - ExposureMask* = 1 shl 15 - VisibilityChangeMask* = 1 shl 16 - StructureNotifyMask* = 1 shl 17 - ResizeRedirectMask* = 1 shl 18 - SubstructureNotifyMask* = 1 shl 19 - SubstructureRedirectMask* = 1 shl 20 - FocusChangeMask* = 1 shl 21 - PropertyChangeMask* = 1 shl 22 - ColormapChangeMask* = 1 shl 23 - OwnerGrabButtonMask* = 1 shl 24 - KeyPress* = 2 - KeyRelease* = 3 - ButtonPress* = 4 - ButtonRelease* = 5 - MotionNotify* = 6 - EnterNotify* = 7 - LeaveNotify* = 8 - FocusIn* = 9 - FocusOut* = 10 - KeymapNotify* = 11 - Expose* = 12 - GraphicsExpose* = 13 - NoExpose* = 14 - VisibilityNotify* = 15 - CreateNotify* = 16 - DestroyNotify* = 17 - UnmapNotify* = 18 - MapNotify* = 19 - MapRequest* = 20 - ReparentNotify* = 21 - ConfigureNotify* = 22 - ConfigureRequest* = 23 - GravityNotify* = 24 - ResizeRequest* = 25 - CirculateNotify* = 26 - CirculateRequest* = 27 - PropertyNotify* = 28 - SelectionClear* = 29 - SelectionRequest* = 30 - SelectionNotify* = 31 - ColormapNotify* = 32 - ClientMessage* = 33 - MappingNotify* = 34 - LASTEvent* = 35 - ShiftMask* = 1 shl 0 - LockMask* = 1 shl 1 - ControlMask* = 1 shl 2 - Mod1Mask* = 1 shl 3 - Mod2Mask* = 1 shl 4 - Mod3Mask* = 1 shl 5 - Mod4Mask* = 1 shl 6 - Mod5Mask* = 1 shl 7 - ShiftMapIndex* = 0 - LockMapIndex* = 1 - ControlMapIndex* = 2 - Mod1MapIndex* = 3 - Mod2MapIndex* = 4 - Mod3MapIndex* = 5 - Mod4MapIndex* = 6 - Mod5MapIndex* = 7 - Button1Mask* = 1 shl 8 - Button2Mask* = 1 shl 9 - Button3Mask* = 1 shl 10 - Button4Mask* = 1 shl 11 - Button5Mask* = 1 shl 12 - AnyModifier* = 1 shl 15 - Button1* = 1 - Button2* = 2 - Button3* = 3 - Button4* = 4 - Button5* = 5 - NotifyNormal* = 0 - NotifyGrab* = 1 - NotifyUngrab* = 2 - NotifyWhileGrabbed* = 3 - NotifyHint* = 1 - NotifyAncestor* = 0 - NotifyVirtual* = 1 - NotifyInferior* = 2 - NotifyNonlinear* = 3 - NotifyNonlinearVirtual* = 4 - NotifyPointer* = 5 - NotifyPointerRoot* = 6 - NotifyDetailNone* = 7 - VisibilityUnobscured* = 0 - VisibilityPartiallyObscured* = 1 - VisibilityFullyObscured* = 2 - PlaceOnTop* = 0 - PlaceOnBottom* = 1 - FamilyInternet* = 0 - FamilyDECnet* = 1 - FamilyChaos* = 2 - FamilyInternet6* = 6 - FamilyServerInterpreted* = 5 - PropertyNewValue* = 0 - PropertyDelete* = 1 - ColormapUninstalled* = 0 - ColormapInstalled* = 1 - GrabModeSync* = 0 - GrabModeAsync* = 1 - GrabSuccess* = 0 - AlreadyGrabbed* = 1 - GrabInvalidTime* = 2 - GrabNotViewable* = 3 - GrabFrozen* = 4 - AsyncPointer* = 0 - SyncPointer* = 1 - ReplayPointer* = 2 - AsyncKeyboard* = 3 - SyncKeyboard* = 4 - ReplayKeyboard* = 5 - AsyncBoth* = 6 - SyncBoth* = 7 - RevertToNone* = None - RevertToPointerRoot* = PointerRoot - RevertToParent* = 2 - Success* = 0 - BadRequest* = 1 - BadValue* = 2 - BadWindow* = 3 - BadPixmap* = 4 - BadAtom* = 5 - BadCursor* = 6 - BadFont* = 7 - BadMatch* = 8 - BadDrawable* = 9 - BadAccess* = 10 - BadAlloc* = 11 - BadColor* = 12 - BadGC* = 13 - BadIDChoice* = 14 - BadName* = 15 - BadLength* = 16 - BadImplementation* = 17 - FirstExtensionError* = 128 - LastExtensionError* = 255 - InputOutput* = 1 - InputOnly* = 2 - CWBackPixmap* = 1 shl 0 - CWBackPixel* = 1 shl 1 - CWBorderPixmap* = 1 shl 2 - CWBorderPixel* = 1 shl 3 - CWBitGravity* = 1 shl 4 - CWWinGravity* = 1 shl 5 - CWBackingStore* = 1 shl 6 - CWBackingPlanes* = 1 shl 7 - CWBackingPixel* = 1 shl 8 - CWOverrideRedirect* = 1 shl 9 - CWSaveUnder* = 1 shl 10 - CWEventMask* = 1 shl 11 - CWDontPropagate* = 1 shl 12 - CWColormap* = 1 shl 13 - CWCursor* = 1 shl 14 - CWX* = 1 shl 0 - CWY* = 1 shl 1 - CWWidth* = 1 shl 2 - CWHeight* = 1 shl 3 - CWBorderWidth* = 1 shl 4 - CWSibling* = 1 shl 5 - CWStackMode* = 1 shl 6 - ForgetGravity* = 0 - NorthWestGravity* = 1 - NorthGravity* = 2 - NorthEastGravity* = 3 - WestGravity* = 4 - CenterGravity* = 5 - EastGravity* = 6 - SouthWestGravity* = 7 - SouthGravity* = 8 - SouthEastGravity* = 9 - StaticGravity* = 10 - UnmapGravity* = 0 - NotUseful* = 0 - WhenMapped* = 1 - Always* = 2 - IsUnmapped* = 0 - IsUnviewable* = 1 - IsViewable* = 2 - SetModeInsert* = 0 - SetModeDelete* = 1 - DestroyAll* = 0 - RetainPermanent* = 1 - RetainTemporary* = 2 - Above* = 0 - Below* = 1 - TopIf* = 2 - BottomIf* = 3 - Opposite* = 4 - RaiseLowest* = 0 - LowerHighest* = 1 - PropModeReplace* = 0 - PropModePrepend* = 1 - PropModeAppend* = 2 - GXclear* = 0x00000000 - GXand* = 0x00000001 - GXandReverse* = 0x00000002 - GXcopy* = 0x00000003 - GXandInverted* = 0x00000004 - GXnoop* = 0x00000005 - GXxor* = 0x00000006 - GXor* = 0x00000007 - GXnor* = 0x00000008 - GXequiv* = 0x00000009 - GXinvert* = 0x0000000A - GXorReverse* = 0x0000000B - GXcopyInverted* = 0x0000000C - GXorInverted* = 0x0000000D - GXnand* = 0x0000000E - GXset* = 0x0000000F - LineSolid* = 0 - LineOnOffDash* = 1 - LineDoubleDash* = 2 - CapNotLast* = 0 - CapButt* = 1 - CapRound* = 2 - CapProjecting* = 3 - JoinMiter* = 0 - JoinRound* = 1 - JoinBevel* = 2 - FillSolid* = 0 - FillTiled* = 1 - FillStippled* = 2 - FillOpaqueStippled* = 3 - EvenOddRule* = 0 - WindingRule* = 1 - ClipByChildren* = 0 - IncludeInferiors* = 1 - Unsorted* = 0 - YSorted* = 1 - YXSorted* = 2 - YXBanded* = 3 - CoordModeOrigin* = 0 - CoordModePrevious* = 1 - Complex* = 0 - Nonconvex* = 1 - Convex* = 2 - ArcChord* = 0 - ArcPieSlice* = 1 - GCFunction* = 1 shl 0 - GCPlaneMask* = 1 shl 1 - GCForeground* = 1 shl 2 - GCBackground* = 1 shl 3 - GCLineWidth* = 1 shl 4 - GCLineStyle* = 1 shl 5 - GCCapStyle* = 1 shl 6 - GCJoinStyle* = 1 shl 7 - GCFillStyle* = 1 shl 8 - GCFillRule* = 1 shl 9 - GCTile* = 1 shl 10 - GCStipple* = 1 shl 11 - GCTileStipXOrigin* = 1 shl 12 - GCTileStipYOrigin* = 1 shl 13 - GCFont* = 1 shl 14 - GCSubwindowMode* = 1 shl 15 - GCGraphicsExposures* = 1 shl 16 - GCClipXOrigin* = 1 shl 17 - GCClipYOrigin* = 1 shl 18 - GCClipMask* = 1 shl 19 - GCDashOffset* = 1 shl 20 - GCDashList* = 1 shl 21 - GCArcMode* = 1 shl 22 - GCLastBit* = 22 - FontLeftToRight* = 0 - FontRightToLeft* = 1 - FontChange* = 255 - XYBitmap* = 0 - XYPixmap* = 1 - ZPixmap* = 2 - AllocNone* = 0 - AllocAll* = 1 - DoRed* = 1 shl 0 - DoGreen* = 1 shl 1 - DoBlue* = 1 shl 2 - CursorShape* = 0 - TileShape* = 1 - StippleShape* = 2 - AutoRepeatModeOff* = 0 - AutoRepeatModeOn* = 1 - AutoRepeatModeDefault* = 2 - LedModeOff* = 0 - LedModeOn* = 1 - KBKeyClickPercent* = 1 shl 0 - KBBellPercent* = 1 shl 1 - KBBellPitch* = 1 shl 2 - KBBellDuration* = 1 shl 3 - KBLed* = 1 shl 4 - KBLedMode* = 1 shl 5 - KBKey* = 1 shl 6 - KBAutoRepeatMode* = 1 shl 7 - MappingSuccess* = 0 - MappingBusy* = 1 - MappingFailed* = 2 - MappingModifier* = 0 - MappingKeyboard* = 1 - MappingPointer* = 2 - DontPreferBlanking* = 0 - PreferBlanking* = 1 - DefaultBlanking* = 2 - DisableScreenSaver* = 0 - DisableScreenInterval* = 0 - DontAllowExposures* = 0 - AllowExposures* = 1 - DefaultExposures* = 2 - ScreenSaverReset* = 0 - ScreenSaverActive* = 1 - HostInsert* = 0 - HostDelete* = 1 - EnableAccess* = 1 - DisableAccess* = 0 - StaticGray* = 0 - GrayScale* = 1 - StaticColor* = 2 - PseudoColor* = 3 - TrueColor* = 4 - DirectColor* = 5 - LSBFirst* = 0 - MSBFirst* = 1 - -# implementation diff --git a/lib/wrappers/x11/x11pragma.nim b/lib/wrappers/x11/x11pragma.nim deleted file mode 100644 index bc88fb0047..0000000000 --- a/lib/wrappers/x11/x11pragma.nim +++ /dev/null @@ -1,20 +0,0 @@ -# included from xlib bindings - - -when defined(use_pkg_config) or defined(use_pkg_config_static): - {.pragma: libx11, cdecl, importc.} - {.pragma: libx11c, cdecl.} - when defined(use_pkg_config_static): - {.passl: gorge("pkg-config x11 --static --libs").} - else: - {.passl: gorge("pkg-config x11 --libs").} -else: - when defined(macosx): - const - libX11* = "libX11.dylib" - else: - const - libX11* = "libX11.so" - - {.pragma: libx11, cdecl, dynlib: libX11, importc.} - {.pragma: libx11c, cdecl, dynlib: libX11.} diff --git a/lib/wrappers/x11/xatom.nim b/lib/wrappers/x11/xatom.nim deleted file mode 100644 index b2e1dca916..0000000000 --- a/lib/wrappers/x11/xatom.nim +++ /dev/null @@ -1,81 +0,0 @@ -# -# THIS IS A GENERATED FILE -# -# Do not change! Changing this file implies a protocol change! -# - -import - X - -const - XA_PRIMARY* = TAtom(1) - XA_SECONDARY* = TAtom(2) - XA_ARC* = TAtom(3) - XA_ATOM* = TAtom(4) - XA_BITMAP* = TAtom(5) - XA_CARDINAL* = TAtom(6) - XA_COLORMAP* = TAtom(7) - XA_CURSOR* = TAtom(8) - XA_CUT_BUFFER0* = TAtom(9) - XA_CUT_BUFFER1* = TAtom(10) - XA_CUT_BUFFER2* = TAtom(11) - XA_CUT_BUFFER3* = TAtom(12) - XA_CUT_BUFFER4* = TAtom(13) - XA_CUT_BUFFER5* = TAtom(14) - XA_CUT_BUFFER6* = TAtom(15) - XA_CUT_BUFFER7* = TAtom(16) - XA_DRAWABLE* = TAtom(17) - XA_FONT* = TAtom(18) - XA_INTEGER* = TAtom(19) - XA_PIXMAP* = TAtom(20) - XA_POINT* = TAtom(21) - XA_RECTANGLE* = TAtom(22) - XA_RESOURCE_MANAGER* = TAtom(23) - XA_RGB_COLOR_MAP* = TAtom(24) - XA_RGB_BEST_MAP* = TAtom(25) - XA_RGB_BLUE_MAP* = TAtom(26) - XA_RGB_DEFAULT_MAP* = TAtom(27) - XA_RGB_GRAY_MAP* = TAtom(28) - XA_RGB_GREEN_MAP* = TAtom(29) - XA_RGB_RED_MAP* = TAtom(30) - XA_STRING* = TAtom(31) - XA_VISUALID* = TAtom(32) - XA_WINDOW* = TAtom(33) - XA_WM_COMMAND* = TAtom(34) - XA_WM_HINTS* = TAtom(35) - XA_WM_CLIENT_MACHINE* = TAtom(36) - XA_WM_ICON_NAME* = TAtom(37) - XA_WM_ICON_SIZE* = TAtom(38) - XA_WM_NAME* = TAtom(39) - XA_WM_NORMAL_HINTS* = TAtom(40) - XA_WM_SIZE_HINTS* = TAtom(41) - XA_WM_ZOOM_HINTS* = TAtom(42) - XA_MIN_SPACE* = TAtom(43) - XA_NORM_SPACE* = TAtom(44) - XA_MAX_SPACE* = TAtom(45) - XA_END_SPACE* = TAtom(46) - XA_SUPERSCRIPT_X* = TAtom(47) - XA_SUPERSCRIPT_Y* = TAtom(48) - XA_SUBSCRIPT_X* = TAtom(49) - XA_SUBSCRIPT_Y* = TAtom(50) - XA_UNDERLINE_POSITION* = TAtom(51) - XA_UNDERLINE_THICKNESS* = TAtom(52) - XA_STRIKEOUT_ASCENT* = TAtom(53) - XA_STRIKEOUT_DESCENT* = TAtom(54) - XA_ITALIC_ANGLE* = TAtom(55) - XA_X_HEIGHT* = TAtom(56) - XA_QUAD_WIDTH* = TAtom(57) - XA_WEIGHT* = TAtom(58) - XA_POINT_SIZE* = TAtom(59) - XA_RESOLUTION* = TAtom(60) - XA_COPYRIGHT* = TAtom(61) - XA_NOTICE* = TAtom(62) - XA_FONT_NAME* = TAtom(63) - XA_FAMILY_NAME* = TAtom(64) - XA_FULL_NAME* = TAtom(65) - XA_CAP_HEIGHT* = TAtom(66) - XA_WM_CLASS* = TAtom(67) - XA_WM_TRANSIENT_FOR* = TAtom(68) - XA_LAST_PREDEFINED* = TAtom(68) - -# implementation diff --git a/lib/wrappers/x11/xcms.nim b/lib/wrappers/x11/xcms.nim deleted file mode 100644 index 57aad6ae06..0000000000 --- a/lib/wrappers/x11/xcms.nim +++ /dev/null @@ -1,396 +0,0 @@ - -import - x, xlib - -#const -# libX11* = "X11" - -# -# Automatically converted by H2Pas 0.99.15 from xcms.h -# The following command line parameters were used: -# -p -# -T -# -S -# -d -# -c -# xcms.h -# - -const - XcmsFailure* = 0 - XcmsSuccess* = 1 - XcmsSuccessWithCompression* = 2 - -type - PXcmsColorFormat* = ptr TXcmsColorFormat - TXcmsColorFormat* = int32 - -proc XcmsUndefinedFormat*(): TXcmsColorFormat -proc XcmsCIEXYZFormat*(): TXcmsColorFormat -proc XcmsCIEuvYFormat*(): TXcmsColorFormat -proc XcmsCIExyYFormat*(): TXcmsColorFormat -proc XcmsCIELabFormat*(): TXcmsColorFormat -proc XcmsCIELuvFormat*(): TXcmsColorFormat -proc XcmsTekHVCFormat*(): TXcmsColorFormat -proc XcmsRGBFormat*(): TXcmsColorFormat -proc XcmsRGBiFormat*(): TXcmsColorFormat -const - XcmsInitNone* = 0x00000000 - XcmsInitSuccess* = 0x00000001 - XcmsInitFailure* = 0x000000FF - -when defined(MACROS): - proc DisplayOfCCC*(ccc: int32): int32 - proc ScreenNumberOfCCC*(ccc: int32): int32 - proc VisualOfCCC*(ccc: int32): int32 - proc ClientWhitePointOfCCC*(ccc: int32): int32 - proc ScreenWhitePointOfCCC*(ccc: int32): int32 - proc FunctionSetOfCCC*(ccc: int32): int32 -type - PXcmsFloat* = ptr TXcmsFloat - TXcmsFloat* = float64 - PXcmsRGB* = ptr TXcmsRGB - TXcmsRGB*{.final.} = object - red*: int16 - green*: int16 - blue*: int16 - - PXcmsRGBi* = ptr TXcmsRGBi - TXcmsRGBi*{.final.} = object - red*: TXcmsFloat - green*: TXcmsFloat - blue*: TXcmsFloat - - PXcmsCIEXYZ* = ptr TXcmsCIEXYZ - TXcmsCIEXYZ*{.final.} = object - X*: TXcmsFloat - Y*: TXcmsFloat - Z*: TXcmsFloat - - PXcmsCIEuvY* = ptr TXcmsCIEuvY - TXcmsCIEuvY*{.final.} = object - u_prime*: TXcmsFloat - v_prime*: TXcmsFloat - Y*: TXcmsFloat - - PXcmsCIExyY* = ptr TXcmsCIExyY - TXcmsCIExyY*{.final.} = object - x*: TXcmsFloat - y*: TXcmsFloat - theY*: TXcmsFloat - - PXcmsCIELab* = ptr TXcmsCIELab - TXcmsCIELab*{.final.} = object - L_star*: TXcmsFloat - a_star*: TXcmsFloat - b_star*: TXcmsFloat - - PXcmsCIELuv* = ptr TXcmsCIELuv - TXcmsCIELuv*{.final.} = object - L_star*: TXcmsFloat - u_star*: TXcmsFloat - v_star*: TXcmsFloat - - PXcmsTekHVC* = ptr TXcmsTekHVC - TXcmsTekHVC*{.final.} = object - H*: TXcmsFloat - V*: TXcmsFloat - C*: TXcmsFloat - - PXcmsPad* = ptr TXcmsPad - TXcmsPad*{.final.} = object - pad0*: TXcmsFloat - pad1*: TXcmsFloat - pad2*: TXcmsFloat - pad3*: TXcmsFloat - - PXcmsColor* = ptr TXcmsColor - TXcmsColor*{.final.} = object # spec : record - # case longint of - # 0 : ( RGB : TXcmsRGB ); - # 1 : ( RGBi : TXcmsRGBi ); - # 2 : ( CIEXYZ : TXcmsCIEXYZ ); - # 3 : ( CIEuvY : TXcmsCIEuvY ); - # 4 : ( CIExyY : TXcmsCIExyY ); - # 5 : ( CIELab : TXcmsCIELab ); - # 6 : ( CIELuv : TXcmsCIELuv ); - # 7 : ( TekHVC : TXcmsTekHVC ); - # 8 : ( Pad : TXcmsPad ); - # end; - pad*: TXcmsPad - pixel*: int32 - format*: TXcmsColorFormat - - PXcmsPerScrnInfo* = ptr TXcmsPerScrnInfo - TXcmsPerScrnInfo*{.final.} = object - screenWhitePt*: TXcmsColor - functionSet*: TXPointer - screenData*: TXPointer - state*: int8 - pad*: array[0..2, char] - - PXcmsCCC* = ptr TXcmsCCC - TXcmsCompressionProc* = proc (para1: PXcmsCCC, para2: PXcmsColor, - para3: int32, para4: int32, para5: PBool): TStatus{. - cdecl.} - TXcmsWhiteAdjustProc* = proc (para1: PXcmsCCC, para2: PXcmsColor, - para3: PXcmsColor, para4: TXcmsColorFormat, - para5: PXcmsColor, para6: int32, para7: PBool): TStatus{. - cdecl.} - TXcmsCCC*{.final.} = object - dpy*: PDisplay - screenNumber*: int32 - visual*: PVisual - clientWhitePt*: TXcmsColor - gamutCompProc*: TXcmsCompressionProc - gamutCompClientData*: TXPointer - whitePtAdjProc*: TXcmsWhiteAdjustProc - whitePtAdjClientData*: TXPointer - pPerScrnInfo*: PXcmsPerScrnInfo - - TXcmsCCCRec* = TXcmsCCC - PXcmsCCCRec* = ptr TXcmsCCCRec - TXcmsScreenInitProc* = proc (para1: PDisplay, para2: int32, - para3: PXcmsPerScrnInfo): TStatus{.cdecl.} - TXcmsScreenFreeProc* = proc (para1: TXPointer){.cdecl.} - TXcmsConversionProc* = proc (){.cdecl.} - PXcmsFuncListPtr* = ptr TXcmsFuncListPtr - TXcmsFuncListPtr* = TXcmsConversionProc - TXcmsParseStringProc* = proc (para1: cstring, para2: PXcmsColor): int32{.cdecl.} - PXcmsColorSpace* = ptr TXcmsColorSpace - TXcmsColorSpace*{.final.} = object - prefix*: cstring - id*: TXcmsColorFormat - parseString*: TXcmsParseStringProc - to_CIEXYZ*: TXcmsFuncListPtr - from_CIEXYZ*: TXcmsFuncListPtr - inverse_flag*: int32 - - PXcmsFunctionSet* = ptr TXcmsFunctionSet - TXcmsFunctionSet*{.final.} = object # error - #extern Status XcmsAddColorSpace ( - #in declaration at line 323 - DDColorSpaces*: ptr PXcmsColorSpace - screenInitProc*: TXcmsScreenInitProc - screenFreeProc*: TXcmsScreenFreeProc - - -proc XcmsAddFunctionSet*(para1: PXcmsFunctionSet): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsAllocColor*(para1: PDisplay, para2: TColormap, para3: PXcmsColor, - para4: TXcmsColorFormat): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsAllocNamedColor*(para1: PDisplay, para2: TColormap, para3: cstring, - para4: PXcmsColor, para5: PXcmsColor, - para6: TXcmsColorFormat): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsCCCOfColormap*(para1: PDisplay, para2: TColormap): TXcmsCCC{.cdecl, - dynlib: libX11, importc.} -proc XcmsCIELabClipab*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsCIELabClipL*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsCIELabClipLab*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsCIELabQueryMaxC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsCIELabQueryMaxL*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsCIELabQueryMaxLC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsCIELabQueryMinL*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsCIELabToCIEXYZ*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIELabWhiteShiftColors*(para1: TXcmsCCC, para2: PXcmsColor, - para3: PXcmsColor, para4: TXcmsColorFormat, - para5: PXcmsColor, para6: int32, para7: PBool): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsCIELuvClipL*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsCIELuvClipLuv*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsCIELuvClipuv*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsCIELuvQueryMaxC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsCIELuvQueryMaxL*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsCIELuvQueryMaxLC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsCIELuvQueryMinL*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsCIELuvToCIEuvY*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIELuvWhiteShiftColors*(para1: TXcmsCCC, para2: PXcmsColor, - para3: PXcmsColor, para4: TXcmsColorFormat, - para5: PXcmsColor, para6: int32, para7: PBool): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsCIEXYZToCIELab*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIEXYZToCIEuvY*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIEXYZToCIExyY*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIEXYZToRGBi*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: PBool): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIEuvYToCIELuv*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIEuvYToCIEXYZ*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIEuvYToTekHVC*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsCIExyYToCIEXYZ*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsClientWhitePointOfCCC*(para1: TXcmsCCC): PXcmsColor{.cdecl, - dynlib: libX11, importc.} -proc XcmsConvertColors*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: TXcmsColorFormat, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsCreateCCC*(para1: PDisplay, para2: int32, para3: PVisual, - para4: PXcmsColor, para5: TXcmsCompressionProc, - para6: TXPointer, para7: TXcmsWhiteAdjustProc, - para8: TXPointer): TXcmsCCC{.cdecl, dynlib: libX11, importc.} -proc XcmsDefaultCCC*(para1: PDisplay, para2: int32): TXcmsCCC{.cdecl, - dynlib: libX11, importc.} -proc XcmsDisplayOfCCC*(para1: TXcmsCCC): PDisplay{.cdecl, dynlib: libX11, - importc.} -proc XcmsFormatOfPrefix*(para1: cstring): TXcmsColorFormat{.cdecl, - dynlib: libX11, importc.} -proc XcmsFreeCCC*(para1: TXcmsCCC){.cdecl, dynlib: libX11, importc.} -proc XcmsLookupColor*(para1: PDisplay, para2: TColormap, para3: cstring, - para4: PXcmsColor, para5: PXcmsColor, - para6: TXcmsColorFormat): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsPrefixOfFormat*(para1: TXcmsColorFormat): cstring{.cdecl, - dynlib: libX11, importc.} -proc XcmsQueryBlack*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsQueryBlue*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsQueryColor*(para1: PDisplay, para2: TColormap, para3: PXcmsColor, - para4: TXcmsColorFormat): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsQueryColors*(para1: PDisplay, para2: TColormap, para3: PXcmsColor, - para4: int32, para5: TXcmsColorFormat): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsQueryGreen*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsQueryRed*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsQueryWhite*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsRGBiToCIEXYZ*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: PBool): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsRGBiToRGB*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: PBool): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsRGBToRGBi*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: PBool): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsScreenNumberOfCCC*(para1: TXcmsCCC): int32{.cdecl, dynlib: libX11, - importc.} -proc XcmsScreenWhitePointOfCCC*(para1: TXcmsCCC): PXcmsColor{.cdecl, - dynlib: libX11, importc.} -proc XcmsSetCCCOfColormap*(para1: PDisplay, para2: TColormap, para3: TXcmsCCC): TXcmsCCC{. - cdecl, dynlib: libX11, importc.} -proc XcmsSetCompressionProc*(para1: TXcmsCCC, para2: TXcmsCompressionProc, - para3: TXPointer): TXcmsCompressionProc{.cdecl, - dynlib: libX11, importc.} -proc XcmsSetWhiteAdjustProc*(para1: TXcmsCCC, para2: TXcmsWhiteAdjustProc, - para3: TXPointer): TXcmsWhiteAdjustProc{.cdecl, - dynlib: libX11, importc.} -proc XcmsSetWhitePoint*(para1: TXcmsCCC, para2: PXcmsColor): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsStoreColor*(para1: PDisplay, para2: TColormap, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsStoreColors*(para1: PDisplay, para2: TColormap, para3: PXcmsColor, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsTekHVCClipC*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsTekHVCClipV*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsTekHVCClipVC*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32, - para4: int32, para5: PBool): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XcmsTekHVCQueryMaxC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsTekHVCQueryMaxV*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsTekHVCQueryMaxVC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: PXcmsColor): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsTekHVCQueryMaxVSamples*(para1: TXcmsCCC, para2: TXcmsFloat, - para3: PXcmsColor, para4: int32): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsTekHVCQueryMinV*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat, - para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XcmsTekHVCToCIEuvY*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor, - para4: int32): TStatus{.cdecl, dynlib: libX11, importc.} -proc XcmsTekHVCWhiteShiftColors*(para1: TXcmsCCC, para2: PXcmsColor, - para3: PXcmsColor, para4: TXcmsColorFormat, - para5: PXcmsColor, para6: int32, para7: PBool): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XcmsVisualOfCCC*(para1: TXcmsCCC): PVisual{.cdecl, dynlib: libX11, importc.} -# implementation - -proc XcmsUndefinedFormat(): TXcmsColorFormat = - result = 0x00000000'i32 - -proc XcmsCIEXYZFormat(): TXcmsColorFormat = - result = 0x00000001'i32 - -proc XcmsCIEuvYFormat(): TXcmsColorFormat = - result = 0x00000002'i32 - -proc XcmsCIExyYFormat(): TXcmsColorFormat = - result = 0x00000003'i32 - -proc XcmsCIELabFormat(): TXcmsColorFormat = - result = 0x00000004'i32 - -proc XcmsCIELuvFormat(): TXcmsColorFormat = - result = 0x00000005'i32 - -proc XcmsTekHVCFormat(): TXcmsColorFormat = - result = 0x00000006'i32 - -proc XcmsRGBFormat(): TXcmsColorFormat = - result = 0x80000000'i32 - -proc XcmsRGBiFormat(): TXcmsColorFormat = - result = 0x80000001'i32 - -when defined(MACROS): - proc DisplayOfCCC(ccc: int32): int32 = - result = ccc.dpy - - proc ScreenNumberOfCCC(ccc: int32): int32 = - result = ccc.screenNumber - - proc VisualOfCCC(ccc: int32): int32 = - result = ccc.visual - - proc ClientWhitePointOfCCC(ccc: int32): int32 = - result = addr(ccc.clientWhitePt) - - proc ScreenWhitePointOfCCC(ccc: int32): int32 = - result = addr(ccc.pPerScrnInfo.screenWhitePt) - - proc FunctionSetOfCCC(ccc: int32): int32 = - result = ccc.pPerScrnInfo.functionSet diff --git a/lib/wrappers/x11/xf86dga.nim b/lib/wrappers/x11/xf86dga.nim deleted file mode 100644 index 376f118615..0000000000 --- a/lib/wrappers/x11/xf86dga.nim +++ /dev/null @@ -1,235 +0,0 @@ -# -# Copyright (c) 1999 XFree86 Inc -# -# $XFree86: xc/include/extensions/xf86dga.h,v 3.20 1999/10/13 04:20:48 dawes Exp $ - -import - x, xlib - -const - libXxf86dga* = "libXxf86dga.so" - -#type -# cfloat* = float32 - -# $XFree86: xc/include/extensions/xf86dga1.h,v 1.2 1999/04/17 07:05:41 dawes Exp $ -# -# -#Copyright (c) 1995 Jon Tombs -#Copyright (c) 1995 XFree86 Inc -# -# -#************************************************************************ -# -# THIS IS THE OLD DGA API AND IS OBSOLETE. PLEASE DO NOT USE IT ANYMORE -# -#************************************************************************ - -type - PPcchar* = ptr ptr cstring - -const - X_XF86DGAQueryVersion* = 0 - X_XF86DGAGetVideoLL* = 1 - X_XF86DGADirectVideo* = 2 - X_XF86DGAGetViewPortSize* = 3 - X_XF86DGASetViewPort* = 4 - X_XF86DGAGetVidPage* = 5 - X_XF86DGASetVidPage* = 6 - X_XF86DGAInstallColormap* = 7 - X_XF86DGAQueryDirectVideo* = 8 - X_XF86DGAViewPortChanged* = 9 - XF86DGADirectPresent* = 0x00000001 - XF86DGADirectGraphics* = 0x00000002 - XF86DGADirectMouse* = 0x00000004 - XF86DGADirectKeyb* = 0x00000008 - XF86DGAHasColormap* = 0x00000100 - XF86DGADirectColormap* = 0x00000200 - -proc XF86DGAQueryVersion*(dpy: PDisplay, majorVersion: Pcint, - minorVersion: Pcint): TBool{.CDecl, - dynlib: libXxf86dga, importc.} -proc XF86DGAQueryExtension*(dpy: PDisplay, event_base: Pcint, error_base: Pcint): TBool{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGAGetVideoLL*(dpy: PDisplay, screen: cint, base_addr: Pcint, - width: Pcint, bank_size: Pcint, ram_size: Pcint): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGAGetVideo*(dpy: PDisplay, screen: cint, base_addr: PPcchar, - width: Pcint, bank_size: Pcint, ram_size: Pcint): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGADirectVideo*(dpy: PDisplay, screen: cint, enable: cint): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGADirectVideoLL*(dpy: PDisplay, screen: cint, enable: cint): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGAGetViewPortSize*(dpy: PDisplay, screen: cint, width: Pcint, - height: Pcint): TStatus{.CDecl, - dynlib: libXxf86dga, importc.} -proc XF86DGASetViewPort*(dpy: PDisplay, screen: cint, x: cint, y: cint): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGAGetVidPage*(dpy: PDisplay, screen: cint, vid_page: Pcint): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGASetVidPage*(dpy: PDisplay, screen: cint, vid_page: cint): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGAInstallColormap*(dpy: PDisplay, screen: cint, Colormap: TColormap): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGAForkApp*(screen: cint): cint{.CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGAQueryDirectVideo*(dpy: PDisplay, screen: cint, flags: Pcint): TStatus{. - CDecl, dynlib: libXxf86dga, importc.} -proc XF86DGAViewPortChanged*(dpy: PDisplay, screen: cint, n: cint): TBool{. - CDecl, dynlib: libXxf86dga, importc.} -const - X_XDGAQueryVersion* = 0 # 1 through 9 are in xf86dga1.pp - # 10 and 11 are reserved to avoid conflicts with rogue DGA extensions - X_XDGAQueryModes* = 12 - X_XDGASetMode* = 13 - X_XDGASetViewport* = 14 - X_XDGAInstallColormap* = 15 - X_XDGASelectInput* = 16 - X_XDGAFillRectangle* = 17 - X_XDGACopyArea* = 18 - X_XDGACopyTransparentArea* = 19 - X_XDGAGetViewportStatus* = 20 - X_XDGASync* = 21 - X_XDGAOpenFramebuffer* = 22 - X_XDGACloseFramebuffer* = 23 - X_XDGASetClientVersion* = 24 - X_XDGAChangePixmapMode* = 25 - X_XDGACreateColormap* = 26 - XDGAConcurrentAccess* = 0x00000001 - XDGASolidFillRect* = 0x00000002 - XDGABlitRect* = 0x00000004 - XDGABlitTransRect* = 0x00000008 - XDGAPixmap* = 0x00000010 - XDGAInterlaced* = 0x00010000 - XDGADoublescan* = 0x00020000 - XDGAFlipImmediate* = 0x00000001 - XDGAFlipRetrace* = 0x00000002 - XDGANeedRoot* = 0x00000001 - XF86DGANumberEvents* = 7 - XDGAPixmapModeLarge* = 0 - XDGAPixmapModeSmall* = 1 - XF86DGAClientNotLocal* = 0 - XF86DGANoDirectVideoMode* = 1 - XF86DGAScreenNotActive* = 2 - XF86DGADirectNotActivated* = 3 - XF86DGAOperationNotSupported* = 4 - XF86DGANumberErrors* = (XF86DGAOperationNotSupported + 1) - -type - PXDGAMode* = ptr TXDGAMode - TXDGAMode*{.final.} = object - num*: cint # A unique identifier for the mode (num > 0) - name*: cstring # name of mode given in the XF86Config - verticalRefresh*: cfloat - flags*: cint # DGA_CONCURRENT_ACCESS, etc... - imageWidth*: cint # linear accessible portion (pixels) - imageHeight*: cint - pixmapWidth*: cint # Xlib accessible portion (pixels) - pixmapHeight*: cint # both fields ignored if no concurrent access - bytesPerScanline*: cint - byteOrder*: cint # MSBFirst, LSBFirst - depth*: cint - bitsPerPixel*: cint - redMask*: culong - greenMask*: culong - blueMask*: culong - visualClass*: cshort - viewportWidth*: cint - viewportHeight*: cint - xViewportStep*: cint # viewport position granularity - yViewportStep*: cint - maxViewportX*: cint # max viewport origin - maxViewportY*: cint - viewportFlags*: cint # types of page flipping possible - reserved1*: cint - reserved2*: cint - - PXDGADevice* = ptr TXDGADevice - TXDGADevice*{.final.} = object - mode*: TXDGAMode - data*: Pcuchar - pixmap*: TPixmap - - PXDGAButtonEvent* = ptr TXDGAButtonEvent - TXDGAButtonEvent*{.final.} = object - theType*: cint - serial*: culong - display*: PDisplay - screen*: cint - time*: TTime - state*: cuint - button*: cuint - - PXDGAKeyEvent* = ptr TXDGAKeyEvent - TXDGAKeyEvent*{.final.} = object - theType*: cint - serial*: culong - display*: PDisplay - screen*: cint - time*: TTime - state*: cuint - keycode*: cuint - - PXDGAMotionEvent* = ptr TXDGAMotionEvent - TXDGAMotionEvent*{.final.} = object - theType*: cint - serial*: culong - display*: PDisplay - screen*: cint - time*: TTime - state*: cuint - dx*: cint - dy*: cint - - PXDGAEvent* = ptr TXDGAEvent - TXDGAEvent*{.final.} = object - pad*: array[0..23, clong] # sorry you have to cast if you want access - #Case LongInt Of - # 0 : (_type : cint); - # 1 : (xbutton : TXDGAButtonEvent); - # 2 : (xkey : TXDGAKeyEvent); - # 3 : (xmotion : TXDGAMotionEvent); - # 4 : (pad : Array[0..23] Of clong); - - -proc XDGAQueryExtension*(dpy: PDisplay, eventBase: Pcint, erroBase: Pcint): TBool{. - CDecl, dynlib: libXxf86dga, importc.} -proc XDGAQueryVersion*(dpy: PDisplay, majorVersion: Pcint, minorVersion: Pcint): TBool{. - CDecl, dynlib: libXxf86dga, importc.} -proc XDGAQueryModes*(dpy: PDisplay, screen: cint, num: Pcint): PXDGAMode{.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGASetMode*(dpy: PDisplay, screen: cint, mode: cint): PXDGADevice{.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGAOpenFramebuffer*(dpy: PDisplay, screen: cint): TBool{.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGACloseFramebuffer*(dpy: PDisplay, screen: cint){.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGASetViewport*(dpy: PDisplay, screen: cint, x: cint, y: cint, flags: cint){. - CDecl, dynlib: libXxf86dga, importc.} -proc XDGAInstallColormap*(dpy: PDisplay, screen: cint, cmap: TColormap){.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGACreateColormap*(dpy: PDisplay, screen: cint, device: PXDGADevice, - alloc: cint): TColormap{.CDecl, dynlib: libXxf86dga, - importc.} -proc XDGASelectInput*(dpy: PDisplay, screen: cint, event_mask: clong){.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGAFillRectangle*(dpy: PDisplay, screen: cint, x: cint, y: cint, - width: cuint, height: cuint, color: culong){.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGACopyArea*(dpy: PDisplay, screen: cint, srcx: cint, srcy: cint, - width: cuint, height: cuint, dstx: cint, dsty: cint){.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGACopyTransparentArea*(dpy: PDisplay, screen: cint, srcx: cint, - srcy: cint, width: cuint, height: cuint, - dstx: cint, dsty: cint, key: culong){.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGAGetViewportStatus*(dpy: PDisplay, screen: cint): cint{.CDecl, - dynlib: libXxf86dga, importc.} -proc XDGASync*(dpy: PDisplay, screen: cint){.CDecl, dynlib: libXxf86dga, importc.} -proc XDGASetClientVersion*(dpy: PDisplay): TBool{.CDecl, dynlib: libXxf86dga, - importc.} -proc XDGAChangePixmapMode*(dpy: PDisplay, screen: cint, x: Pcint, y: Pcint, - mode: cint){.CDecl, dynlib: libXxf86dga, importc.} -proc XDGAKeyEventToXKeyEvent*(dk: PXDGAKeyEvent, xk: PXKeyEvent){.CDecl, - dynlib: libXxf86dga, importc.} -# implementation diff --git a/lib/wrappers/x11/xf86vmode.nim b/lib/wrappers/x11/xf86vmode.nim deleted file mode 100644 index 18a922cab2..0000000000 --- a/lib/wrappers/x11/xf86vmode.nim +++ /dev/null @@ -1,229 +0,0 @@ -# $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $ -# -# -#Copyright 1995 Kaleb S. KEITHLEY -# -#Permission is hereby granted, free of charge, to any person obtaining -#a copy of this software and associated documentation files (the -#"Software"), to deal in the Software without restriction, including -#without limitation the rights to use, copy, modify, merge, publish, -#distribute, sublicense, and/or sell copies of the Software, and to -#permit persons to whom the Software is furnished to do so, subject to -#the following conditions: -# -#The above copyright notice and this permission notice shall be -#included in all copies or substantial portions of the Software. -# -#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -#EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -#IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES -#OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -#ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -#OTHER DEALINGS IN THE SOFTWARE. -# -#Except as contained in this notice, the name of Kaleb S. KEITHLEY -#shall not be used in advertising or otherwise to promote the sale, use -#or other dealings in this Software without prior written authorization -#from Kaleb S. KEITHLEY -# -# -# $Xorg: xf86vmode.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $ -# THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION - -import - x, xlib - -const - libXxf86vm* = "libXxf86vm.so" - -type - PINT32* = ptr int32 - -const - X_XF86VidModeQueryVersion* = 0 - X_XF86VidModeGetModeLine* = 1 - X_XF86VidModeModModeLine* = 2 - X_XF86VidModeSwitchMode* = 3 - X_XF86VidModeGetMonitor* = 4 - X_XF86VidModeLockModeSwitch* = 5 - X_XF86VidModeGetAllModeLines* = 6 - X_XF86VidModeAddModeLine* = 7 - X_XF86VidModeDeleteModeLine* = 8 - X_XF86VidModeValidateModeLine* = 9 - X_XF86VidModeSwitchToMode* = 10 - X_XF86VidModeGetViewPort* = 11 - X_XF86VidModeSetViewPort* = 12 # new for version 2.x of this extension - X_XF86VidModeGetDotClocks* = 13 - X_XF86VidModeSetClientVersion* = 14 - X_XF86VidModeSetGamma* = 15 - X_XF86VidModeGetGamma* = 16 - X_XF86VidModeGetGammaRamp* = 17 - X_XF86VidModeSetGammaRamp* = 18 - X_XF86VidModeGetGammaRampSize* = 19 - X_XF86VidModeGetPermissions* = 20 - CLKFLAG_PROGRAMABLE* = 1 - -when defined(XF86VIDMODE_EVENTS): - const - XF86VidModeNotify* = 0 - XF86VidModeNumberEvents* = (XF86VidModeNotify + 1) - XF86VidModeNotifyMask* = 0x00000001 - XF86VidModeNonEvent* = 0 - XF86VidModeModeChange* = 1 -else: - const - XF86VidModeNumberEvents* = 0 -const - XF86VidModeBadClock* = 0 - XF86VidModeBadHTimings* = 1 - XF86VidModeBadVTimings* = 2 - XF86VidModeModeUnsuitable* = 3 - XF86VidModeExtensionDisabled* = 4 - XF86VidModeClientNotLocal* = 5 - XF86VidModeZoomLocked* = 6 - XF86VidModeNumberErrors* = (XF86VidModeZoomLocked + 1) - XF86VM_READ_PERMISSION* = 1 - XF86VM_WRITE_PERMISSION* = 2 - -type - PXF86VidModeModeLine* = ptr TXF86VidModeModeLine - TXF86VidModeModeLine*{.final.} = object - hdisplay*: cushort - hsyncstart*: cushort - hsyncend*: cushort - htotal*: cushort - hskew*: cushort - vdisplay*: cushort - vsyncstart*: cushort - vsyncend*: cushort - vtotal*: cushort - flags*: cuint - privsize*: cint - c_private*: PINT32 - - PPPXF86VidModeModeInfo* = ptr PPXF86VidModeModeInfo - PPXF86VidModeModeInfo* = ptr PXF86VidModeModeInfo - PXF86VidModeModeInfo* = ptr TXF86VidModeModeInfo - TXF86VidModeModeInfo*{.final.} = object - dotclock*: cuint - hdisplay*: cushort - hsyncstart*: cushort - hsyncend*: cushort - htotal*: cushort - hskew*: cushort - vdisplay*: cushort - vsyncstart*: cushort - vsyncend*: cushort - vtotal*: cushort - flags*: cuint - privsize*: cint - c_private*: PINT32 - - PXF86VidModeSyncRange* = ptr TXF86VidModeSyncRange - TXF86VidModeSyncRange*{.final.} = object - hi*: cfloat - lo*: cfloat - - PXF86VidModeMonitor* = ptr TXF86VidModeMonitor - TXF86VidModeMonitor*{.final.} = object - vendor*: cstring - model*: cstring - EMPTY*: cfloat - nhsync*: cuchar - hsync*: PXF86VidModeSyncRange - nvsync*: cuchar - vsync*: PXF86VidModeSyncRange - - PXF86VidModeNotifyEvent* = ptr TXF86VidModeNotifyEvent - TXF86VidModeNotifyEvent*{.final.} = object - theType*: cint # of event - serial*: culong # # of last request processed by server - send_event*: TBool # true if this came from a SendEvent req - display*: PDisplay # Display the event was read from - root*: TWindow # root window of event screen - state*: cint # What happened - kind*: cint # What happened - forced*: TBool # extents of new region - time*: TTime # event timestamp - - PXF86VidModeGamma* = ptr TXF86VidModeGamma - TXF86VidModeGamma*{.final.} = object - red*: cfloat # Red Gamma value - green*: cfloat # Green Gamma value - blue*: cfloat # Blue Gamma value - - -when defined(MACROS): - proc XF86VidModeSelectNextMode*(disp: PDisplay, scr: cint): TBool - proc XF86VidModeSelectPrevMode*(disp: PDisplay, scr: cint): TBool -proc XF86VidModeQueryVersion*(dpy: PDisplay, majorVersion: Pcint, - minorVersion: Pcint): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeQueryExtension*(dpy: PDisplay, event_base: Pcint, - error_base: Pcint): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeSetClientVersion*(dpy: PDisplay): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeGetModeLine*(dpy: PDisplay, screen: cint, dotclock: Pcint, - modeline: PXF86VidModeModeLine): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeGetAllModeLines*(dpy: PDisplay, screen: cint, modecount: Pcint, - modelinesPtr: PPPXF86VidModeModeInfo): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeAddModeLine*(dpy: PDisplay, screen: cint, - new_modeline: PXF86VidModeModeInfo, - after_modeline: PXF86VidModeModeInfo): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeDeleteModeLine*(dpy: PDisplay, screen: cint, - modeline: PXF86VidModeModeInfo): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeModModeLine*(dpy: PDisplay, screen: cint, - modeline: PXF86VidModeModeLine): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeValidateModeLine*(dpy: PDisplay, screen: cint, - modeline: PXF86VidModeModeInfo): TStatus{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeSwitchMode*(dpy: PDisplay, screen: cint, zoom: cint): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeSwitchToMode*(dpy: PDisplay, screen: cint, - modeline: PXF86VidModeModeInfo): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeLockModeSwitch*(dpy: PDisplay, screen: cint, lock: cint): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeGetMonitor*(dpy: PDisplay, screen: cint, - monitor: PXF86VidModeMonitor): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeGetViewPort*(dpy: PDisplay, screen: cint, x_return: Pcint, - y_return: Pcint): TBool{.CDecl, dynlib: libXxf86vm, - importc.} -proc XF86VidModeSetViewPort*(dpy: PDisplay, screen: cint, x: cint, y: cint): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeGetDotClocks*(dpy: PDisplay, screen: cint, flags_return: Pcint, - number_of_clocks_return: Pcint, - max_dot_clock_return: Pcint, clocks_return: PPcint): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeGetGamma*(dpy: PDisplay, screen: cint, Gamma: PXF86VidModeGamma): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeSetGamma*(dpy: PDisplay, screen: cint, Gamma: PXF86VidModeGamma): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeSetGammaRamp*(dpy: PDisplay, screen: cint, size: cint, - red_array: Pcushort, green_array: Pcushort, - blue_array: Pcushort): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeGetGammaRamp*(dpy: PDisplay, screen: cint, size: cint, - red_array: Pcushort, green_array: Pcushort, - blue_array: Pcushort): TBool{.CDecl, - dynlib: libXxf86vm, importc.} -proc XF86VidModeGetGammaRampSize*(dpy: PDisplay, screen: cint, size: Pcint): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -proc XF86VidModeGetPermissions*(dpy: PDisplay, screen: cint, permissions: Pcint): TBool{. - CDecl, dynlib: libXxf86vm, importc.} -# implementation - -when defined(MACROS): - proc XF86VidModeSelectNextMode(disp: PDisplay, scr: cint): TBool = - XF86VidModeSelectNextMode = XF86VidModeSwitchMode(disp, scr, 1) - - proc XF86VidModeSelectPrevMode(disp: PDisplay, scr: cint): TBool = - XF86VidModeSelectPrevMode = XF86VidModeSwitchMode(disp, scr, - 1) diff --git a/lib/wrappers/x11/xi.nim b/lib/wrappers/x11/xi.nim deleted file mode 100644 index d1b9f78462..0000000000 --- a/lib/wrappers/x11/xi.nim +++ /dev/null @@ -1,307 +0,0 @@ -# -# $Xorg: XI.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ -# -#************************************************************ -# -#Copyright 1989, 1998 The Open Group -# -#Permission to use, copy, modify, distribute, and sell this software and its -#documentation for any purpose is hereby granted without fee, provided that -#the above copyright notice appear in all copies and that both that -#copyright notice and this permission notice appear in supporting -#documentation. -# -#The above copyright notice and this permission notice shall be included in -#all copies or substantial portions of the Software. -# -#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -#OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -#AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -#CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -#Except as contained in this notice, the name of The Open Group shall not be -#used in advertising or otherwise to promote the sale, use or other dealings -#in this Software without prior written authorization from The Open Group. -# -#Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. -# -# All Rights Reserved -# -#Permission to use, copy, modify, and distribute this software and its -#documentation for any purpose and without fee is hereby granted, -#provided that the above copyright notice appear in all copies and that -#both that copyright notice and this permission notice appear in -#supporting documentation, and that the name of Hewlett-Packard not be -#used in advertising or publicity pertaining to distribution of the -#software without specific, written prior permission. -# -#HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -#ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -#HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -#ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -#WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -#ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -#SOFTWARE. -# -#********************************************************/ -# $XFree86: xc/include/extensions/XI.h,v 1.5 2001/12/14 19:53:28 dawes Exp $ -# -# Definitions used by the server, library and client -# -# Pascal Convertion was made by Ido Kannner - kanerido@actcom.net.il -# -#Histroy: -# 2004/10/15 - Fixed a bug of accessing second based records by removing "paced record" and chnaged it to -# "reocrd" only. -# 2004/10/07 - Removed the "uses X;" line. The unit does not need it. -# 2004/10/03 - Conversion from C header to Pascal unit. -# - -const - sz_xGetExtensionVersionReq* = 8 - sz_xGetExtensionVersionReply* = 32 - sz_xListInputDevicesReq* = 4 - sz_xListInputDevicesReply* = 32 - sz_xOpenDeviceReq* = 8 - sz_xOpenDeviceReply* = 32 - sz_xCloseDeviceReq* = 8 - sz_xSetDeviceModeReq* = 8 - sz_xSetDeviceModeReply* = 32 - sz_xSelectExtensionEventReq* = 12 - sz_xGetSelectedExtensionEventsReq* = 8 - sz_xGetSelectedExtensionEventsReply* = 32 - sz_xChangeDeviceDontPropagateListReq* = 12 - sz_xGetDeviceDontPropagateListReq* = 8 - sz_xGetDeviceDontPropagateListReply* = 32 - sz_xGetDeviceMotionEventsReq* = 16 - sz_xGetDeviceMotionEventsReply* = 32 - sz_xChangeKeyboardDeviceReq* = 8 - sz_xChangeKeyboardDeviceReply* = 32 - sz_xChangePointerDeviceReq* = 8 - sz_xChangePointerDeviceReply* = 32 - sz_xGrabDeviceReq* = 20 - sz_xGrabDeviceReply* = 32 - sz_xUngrabDeviceReq* = 12 - sz_xGrabDeviceKeyReq* = 20 - sz_xGrabDeviceKeyReply* = 32 - sz_xUngrabDeviceKeyReq* = 16 - sz_xGrabDeviceButtonReq* = 20 - sz_xGrabDeviceButtonReply* = 32 - sz_xUngrabDeviceButtonReq* = 16 - sz_xAllowDeviceEventsReq* = 12 - sz_xGetDeviceFocusReq* = 8 - sz_xGetDeviceFocusReply* = 32 - sz_xSetDeviceFocusReq* = 16 - sz_xGetFeedbackControlReq* = 8 - sz_xGetFeedbackControlReply* = 32 - sz_xChangeFeedbackControlReq* = 12 - sz_xGetDeviceKeyMappingReq* = 8 - sz_xGetDeviceKeyMappingReply* = 32 - sz_xChangeDeviceKeyMappingReq* = 8 - sz_xGetDeviceModifierMappingReq* = 8 - sz_xSetDeviceModifierMappingReq* = 8 - sz_xSetDeviceModifierMappingReply* = 32 - sz_xGetDeviceButtonMappingReq* = 8 - sz_xGetDeviceButtonMappingReply* = 32 - sz_xSetDeviceButtonMappingReq* = 8 - sz_xSetDeviceButtonMappingReply* = 32 - sz_xQueryDeviceStateReq* = 8 - sz_xQueryDeviceStateReply* = 32 - sz_xSendExtensionEventReq* = 16 - sz_xDeviceBellReq* = 8 - sz_xSetDeviceValuatorsReq* = 8 - sz_xSetDeviceValuatorsReply* = 32 - sz_xGetDeviceControlReq* = 8 - sz_xGetDeviceControlReply* = 32 - sz_xChangeDeviceControlReq* = 8 - sz_xChangeDeviceControlReply* = 32 - -const - INAME* = "XInputExtension" - -const - XI_KEYBOARD* = "KEYBOARD" - XI_MOUSE* = "MOUSE" - XI_TABLET* = "TABLET" - XI_TOUCHSCREEN* = "TOUCHSCREEN" - XI_TOUCHPAD* = "TOUCHPAD" - XI_BARCODE* = "BARCODE" - XI_BUTTONBOX* = "BUTTONBOX" - XI_KNOB_BOX* = "KNOB_BOX" - XI_ONE_KNOB* = "ONE_KNOB" - XI_NINE_KNOB* = "NINE_KNOB" - XI_TRACKBALL* = "TRACKBALL" - XI_QUADRATURE* = "QUADRATURE" - XI_ID_MODULE* = "ID_MODULE" - XI_SPACEBALL* = "SPACEBALL" - XI_DATAGLOVE* = "DATAGLOVE" - XI_EYETRACKER* = "EYETRACKER" - XI_CURSORKEYS* = "CURSORKEYS" - XI_FOOTMOUSE* = "FOOTMOUSE" - -const - Dont_Check* = 0 - XInput_Initial_Release* = 1 - XInput_Add_XDeviceBell* = 2 - XInput_Add_XSetDeviceValuators* = 3 - XInput_Add_XChangeDeviceControl* = 4 - -const - XI_Absent* = 0 - XI_Present* = 1 - -const - XI_Initial_Release_Major* = 1 - XI_Initial_Release_Minor* = 0 - -const - XI_Add_XDeviceBell_Major* = 1 - XI_Add_XDeviceBell_Minor* = 1 - -const - XI_Add_XSetDeviceValuators_Major* = 1 - XI_Add_XSetDeviceValuators_Minor* = 2 - -const - XI_Add_XChangeDeviceControl_Major* = 1 - XI_Add_XChangeDeviceControl_Minor* = 3 - -const - DEVICE_RESOLUTION* = 1 - -const - NoSuchExtension* = 1 - -const - COUNT* = 0 - CREATE* = 1 - -const - NewPointer* = 0 - NewKeyboard* = 1 - -const - XPOINTER* = 0 - XKEYBOARD* = 1 - -const - UseXKeyboard* = 0x000000FF - -const - IsXPointer* = 0 - IsXKeyboard* = 1 - IsXExtensionDevice* = 2 - -const - AsyncThisDevice* = 0 - SyncThisDevice* = 1 - ReplayThisDevice* = 2 - AsyncOtherDevices* = 3 - AsyncAll* = 4 - SyncAll* = 5 - -const - FollowKeyboard* = 3 - RevertToFollowKeyboard* = 3 - -const - DvAccelNum* = int(1) shl 0 - DvAccelDenom* = int(1) shl 1 - DvThreshold* = int(1) shl 2 - -const - DvKeyClickPercent* = int(1) shl 0 - DvPercent* = int(1) shl 1 - DvPitch* = int(1) shl 2 - DvDuration* = int(1) shl 3 - DvLed* = int(1) shl 4 - DvLedMode* = int(1) shl 5 - DvKey* = int(1) shl 6 - DvAutoRepeatMode* = 1 shl 7 - -const - DvString* = int(1) shl 0 - -const - DvInteger* = int(1) shl 0 - -const - DeviceMode* = int(1) shl 0 - Relative* = 0 - Absolute* = 1 # Merged from Metrolink tree for XINPUT stuff - TS_Raw* = 57 - TS_Scaled* = 58 - SendCoreEvents* = 59 - DontSendCoreEvents* = 60 # End of merged section - -const - ProximityState* = int(1) shl 1 - InProximity* = int(0) shl 1 - OutOfProximity* = int(1) shl 1 - -const - AddToList* = 0 - DeleteFromList* = 1 - -const - KeyClass* = 0 - ButtonClass* = 1 - ValuatorClass* = 2 - FeedbackClass* = 3 - ProximityClass* = 4 - FocusClass* = 5 - OtherClass* = 6 - -const - KbdFeedbackClass* = 0 - PtrFeedbackClass* = 1 - StringFeedbackClass* = 2 - IntegerFeedbackClass* = 3 - LedFeedbackClass* = 4 - BellFeedbackClass* = 5 - -const - devicePointerMotionHint* = 0 - deviceButton1Motion* = 1 - deviceButton2Motion* = 2 - deviceButton3Motion* = 3 - deviceButton4Motion* = 4 - deviceButton5Motion* = 5 - deviceButtonMotion* = 6 - deviceButtonGrab* = 7 - deviceOwnerGrabButton* = 8 - noExtensionEvent* = 9 - -const - XI_BadDevice* = 0 - XI_BadEvent* = 1 - XI_BadMode* = 2 - XI_DeviceBusy* = 3 - XI_BadClass* = 4 # Make XEventClass be a CARD32 for 64 bit servers. Don't affect client - # definition of XEventClass since that would be a library interface change. - # See the top of X.h for more _XSERVER64 magic. - # - -when defined(XSERVER64): - type - XEventClass* = CARD32 -else: - type - XEventClass* = int32 -#****************************************************************** -# * -# * Extension version structure. -# * -# - -type - PXExtensionVersion* = ptr TXExtensionVersion - TXExtensionVersion*{.final.} = object - present*: int16 - major_version*: int16 - minor_version*: int16 - - -# implementation diff --git a/lib/wrappers/x11/xinerama.nim b/lib/wrappers/x11/xinerama.nim deleted file mode 100644 index 96f5d7da3b..0000000000 --- a/lib/wrappers/x11/xinerama.nim +++ /dev/null @@ -1,25 +0,0 @@ -# Converted from X11/Xinerama.h -import - xlib - -const - xineramaLib = "libXinerama.so" - -type - PXineramaScreenInfo* = ptr TXineramaScreenInfo - TXineramaScreenInfo*{.final.} = object - screen_number*: cint - x_org*: int16 - y_org*: int16 - width*: int16 - height*: int16 - - -proc XineramaQueryExtension*(dpy: PDisplay, event_base: Pcint, error_base: Pcint): TBool{. - cdecl, dynlib: xineramaLib, importc.} -proc XineramaQueryVersion*(dpy: PDisplay, major: Pcint, minor: Pcint): TStatus{. - cdecl, dynlib: xineramaLib, importc.} -proc XineramaIsActive*(dpy: PDisplay): TBool{.cdecl, dynlib: xineramaLib, importc.} -proc XineramaQueryScreens*(dpy: PDisplay, number: Pcint): PXineramaScreenInfo{. - cdecl, dynlib: xineramaLib, importc.} - diff --git a/lib/wrappers/x11/xkb.nim b/lib/wrappers/x11/xkb.nim deleted file mode 100644 index 86296430ac..0000000000 --- a/lib/wrappers/x11/xkb.nim +++ /dev/null @@ -1,2387 +0,0 @@ -# -# $Xorg: XKB.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ -#************************************************************ -# $Xorg: XKBstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ -#************************************************************ -# $Xorg: XKBgeom.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ -#************************************************************ -# -#Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. -# -#Permission to use, copy, modify, and distribute this -#software and its documentation for any purpose and without -#fee is hereby granted, provided that the above copyright -#notice appear in all copies and that both that copyright -#notice and this permission notice appear in supporting -#documentation, and that the name of Silicon Graphics not be -#used in advertising or publicity pertaining to distribution -#of the software without specific prior written permission. -#Silicon Graphics makes no representation about the suitability -#of this software for any purpose. It is provided "as is" -#without any express or implied warranty. -# -#SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -#SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -#AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -#GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -#DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -#DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -#OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -#THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -#******************************************************** -# $XFree86: xc/include/extensions/XKB.h,v 1.5 2002/11/20 04:49:01 dawes Exp $ -# $XFree86: xc/include/extensions/XKBgeom.h,v 3.9 2002/09/18 17:11:40 tsi Exp $ -# -# Pascal Convertion was made by Ido Kannner - kanerido@actcom.net.il -# -#Thanks: -# I want to thanks to oliebol for putting up with all of the problems that was found -# while translating this code. ;) -# -# I want to thanks #fpc channel in freenode irc, for helping me, and to put up with my -# wierd questions ;) -# -# Thanks for mmc in #xlib on freenode irc And so for the channel itself for the helping me to -# understanding some of the problems I had converting this headers and pointing me to resources -# that helped translating this headers. -# -# Ido -# -#History: -# 2004/10/15 - Fixed a bug of accessing second based records by removing "paced record" and -# chnaged it to "reocrd" only. -# 2004/10/04 - 06 - Convertion from the c header of XKBgeom.h. -# 2004/10/03 - Removed the XKBstr_UNIT compiler decleration. Afther the joined files, -# There is no need for it anymore. -# - There is a need to define (for now) XKBgeom (compiler define) in order -# to use the code of it. At this moment, I did not yet converted it to Pascal. -# -# 2004/09/17 - 10/04 - Convertion from the c header of XKBstr. -# -# 2004/10/03 - Joined xkbstr.pas into xkb.pas because of the circular calls problems. -# - Added the history of xkbstr.pas above this addition. -# -# 2004/09/17 - Fixed a wrong convertion number of XkbPerKeyBitArraySize, insted -# of float, it's now converted into integer (as it should have been). -# -# 2004/09/15 - 16 - Convertion from the c header of XKB.h. -# - -import - X, Xlib - -include "x11pragma.nim" - -proc XkbCharToInt*(v: int8): int16 -proc XkbIntTo2Chars*(i: int16, h, L: var int8) -proc Xkb2CharsToInt*(h, L: int8): int16 - # - # Common data structures and access macros - # -type - PWord* = ptr array[0..64_000, int16] - PByte* = ptr byte - PXkbStatePtr* = ptr TXkbStateRec - TXkbStateRec*{.final.} = object - group*: int8 - locked_group*: int8 - base_group*: int16 - latched_group*: int16 - mods*: int8 - base_mods*: int8 - latched_mods*: int8 - locked_mods*: int8 - compat_state*: int8 - grab_mods*: int8 - compat_grab_mods*: int8 - lookup_mods*: int8 - compat_lookup_mods*: int8 - ptr_buttons*: int16 - - -proc XkbModLocks*(s: PXkbStatePtr): int8 -proc XkbStateMods*(s: PXkbStatePtr): int16 -proc XkbGroupLock*(s: PXkbStatePtr): int8 -proc XkbStateGroup*(s: PXkbStatePtr): int16 -proc XkbStateFieldFromRec*(s: PXkbStatePtr): int -proc XkbGrabStateFromRec*(s: PXkbStatePtr): int -type - PXkbModsPtr* = ptr TXkbModsRec - TXkbModsRec*{.final.} = object - mask*: int8 # effective mods - real_mods*: int8 - vmods*: int16 - - -type - PXkbKTMapEntryPtr* = ptr TXkbKTMapEntryRec - TXkbKTMapEntryRec*{.final.} = object - active*: bool - level*: int8 - mods*: TXkbModsRec - - -type - PXkbKeyTypePtr* = ptr TXkbKeyTypeRec - TXkbKeyTypeRec*{.final.} = object - mods*: TXkbModsRec - num_levels*: int8 - map_count*: int8 - map*: PXkbKTMapEntryPtr - preserve*: PXkbModsPtr - name*: TAtom - level_names*: TAtom - - -proc XkbNumGroups*(g: int16): int16 -proc XkbOutOfRangeGroupInfo*(g: int16): int16 -proc XkbOutOfRangeGroupAction*(g: int16): int16 -proc XkbOutOfRangeGroupNumber*(g: int16): int16 -proc XkbSetGroupInfo*(g, w, n: int16): int16 -proc XkbSetNumGroups*(g, n: int16): int16 - # - # Structures and access macros used primarily by the server - # -type - PXkbBehavior* = ptr TXkbBehavior - TXkbBehavior*{.final.} = object - theType*: int8 - data*: int8 - - -type - PXkbModAction* = ptr TXkbModAction - TXkbModAction*{.final.} = object - theType*: int8 - flags*: int8 - mask*: int8 - real_mods*: int8 - vmods1*: int8 - vmods2*: int8 - - -proc XkbModActionVMods*(a: PXkbModAction): int16 -proc XkbSetModActionVMods*(a: PXkbModAction, v: int8) -type - PXkbGroupAction* = ptr TXkbGroupAction - TXkbGroupAction*{.final.} = object - theType*: int8 - flags*: int8 - group_XXX*: int8 - - -proc XkbSAGroup*(a: PXkbGroupAction): int8 -proc XkbSASetGroupProc*(a: PXkbGroupAction, g: int8) -type - PXkbISOAction* = ptr TXkbISOAction - TXkbISOAction*{.final.} = object - theType*: int8 - flags*: int8 - mask*: int8 - real_mods*: int8 - group_XXX*: int8 - affect*: int8 - vmods1*: int8 - vmods2*: int8 - - -type - PXkbPtrAction* = ptr TXkbPtrAction - TXkbPtrAction*{.final.} = object - theType*: int8 - flags*: int8 - high_XXX*: int8 - low_XXX*: int8 - high_YYY*: int8 - low_YYY*: int8 - - -proc XkbPtrActionX*(a: PXkbPtrAction): int16 -proc XkbPtrActionY*(a: PXkbPtrAction): int16 -proc XkbSetPtrActionX*(a: PXkbPtrAction, x: int8) -proc XkbSetPtrActionY*(a: PXkbPtrAction, y: int8) -type - PXkbPtrBtnAction* = ptr TXkbPtrBtnAction - TXkbPtrBtnAction*{.final.} = object - theType*: int8 - flags*: int8 - count*: int8 - button*: int8 - - -type - PXkbPtrDfltAction* = ptr TXkbPtrDfltAction - TXkbPtrDfltAction*{.final.} = object - theType*: int8 - flags*: int8 - affect*: int8 - valueXXX*: int8 - - -proc XkbSAPtrDfltValue*(a: PXkbPtrDfltAction): int8 -proc XkbSASetPtrDfltValue*(a: PXkbPtrDfltAction, c: pointer) -type - PXkbSwitchScreenAction* = ptr TXkbSwitchScreenAction - TXkbSwitchScreenAction*{.final.} = object - theType*: int8 - flags*: int8 - screenXXX*: int8 - - -proc XkbSAScreen*(a: PXkbSwitchScreenAction): int8 -proc XkbSASetScreen*(a: PXkbSwitchScreenAction, s: pointer) -type - PXkbCtrlsAction* = ptr TXkbCtrlsAction - TXkbCtrlsAction*{.final.} = object - theType*: int8 - flags*: int8 - ctrls3*: int8 - ctrls2*: int8 - ctrls1*: int8 - ctrls0*: int8 - - -proc XkbActionSetCtrls*(a: PXkbCtrlsAction, c: int8) -proc XkbActionCtrls*(a: PXkbCtrlsAction): int16 -type - PXkbMessageAction* = ptr TXkbMessageAction - TXkbMessageAction*{.final.} = object - theType*: int8 - flags*: int8 - message*: array[0..5, char] - - -type - PXkbRedirectKeyAction* = ptr TXkbRedirectKeyAction - TXkbRedirectKeyAction*{.final.} = object - theType*: int8 - new_key*: int8 - mods_mask*: int8 - mods*: int8 - vmods_mask0*: int8 - vmods_mask1*: int8 - vmods0*: int8 - vmods1*: int8 - - -proc XkbSARedirectVMods*(a: PXkbRedirectKeyAction): int16 -proc XkbSARedirectSetVMods*(a: PXkbRedirectKeyAction, m: int8) -proc XkbSARedirectVModsMask*(a: PXkbRedirectKeyAction): int16 -proc XkbSARedirectSetVModsMask*(a: PXkbRedirectKeyAction, m: int8) -type - PXkbDeviceBtnAction* = ptr TXkbDeviceBtnAction - TXkbDeviceBtnAction*{.final.} = object - theType*: int8 - flags*: int8 - count*: int8 - button*: int8 - device*: int8 - - -type - PXkbDeviceValuatorAction* = ptr TXkbDeviceValuatorAction - TXkbDeviceValuatorAction*{.final.} = object # - # Macros to classify key actions - # - theType*: int8 - device*: int8 - v1_what*: int8 - v1_ndx*: int8 - v1_value*: int8 - v2_what*: int8 - v2_ndx*: int8 - v2_value*: int8 - - -const - XkbAnyActionDataSize* = 7 - -type - PXkbAnyAction* = ptr TXkbAnyAction - TXkbAnyAction*{.final.} = object - theType*: int8 - data*: array[0..XkbAnyActionDataSize - 1, int8] - - -proc XkbIsModAction*(a: PXkbAnyAction): bool -proc XkbIsGroupAction*(a: PXkbAnyAction): bool -proc XkbIsPtrAction*(a: PXkbAnyAction): bool -type - PXkbAction* = ptr TXkbAction - TXkbAction*{.final.} = object # - # XKB request codes, used in: - # - xkbReqType field of all requests - # - requestMinor field of some events - # - any*: TXkbAnyAction - mods*: TXkbModAction - group*: TXkbGroupAction - iso*: TXkbISOAction - thePtr*: TXkbPtrAction - btn*: TXkbPtrBtnAction - dflt*: TXkbPtrDfltAction - screen*: TXkbSwitchScreenAction - ctrls*: TXkbCtrlsAction - msg*: TXkbMessageAction - redirect*: TXkbRedirectKeyAction - devbtn*: TXkbDeviceBtnAction - devval*: TXkbDeviceValuatorAction - theType*: int8 - - -const - X_kbUseExtension* = 0 - X_kbSelectEvents* = 1 - X_kbBell* = 3 - X_kbGetState* = 4 - X_kbLatchLockState* = 5 - X_kbGetControls* = 6 - X_kbSetControls* = 7 - X_kbGetMap* = 8 - X_kbSetMap* = 9 - X_kbGetCompatMap* = 10 - X_kbSetCompatMap* = 11 - X_kbGetIndicatorState* = 12 - X_kbGetIndicatorMap* = 13 - X_kbSetIndicatorMap* = 14 - X_kbGetNamedIndicator* = 15 - X_kbSetNamedIndicator* = 16 - X_kbGetNames* = 17 - X_kbSetNames* = 18 - X_kbGetGeometry* = 19 - X_kbSetGeometry* = 20 - X_kbPerClientFlags* = 21 - X_kbListComponents* = 22 - X_kbGetKbdByName* = 23 - X_kbGetDeviceInfo* = 24 - X_kbSetDeviceInfo* = 25 - X_kbSetDebuggingFlags* = 101 # - # In the X sense, XKB reports only one event. - # The type field of all XKB events is XkbEventCode - # - -const - XkbEventCode* = 0 - XkbNumberEvents* = XkbEventCode + 1 # - # XKB has a minor event code so it can use one X event code for - # multiple purposes. - # - reported in the xkbType field of all XKB events. - # - XkbSelectEventDetails: Indicates the event for which event details - # are being changed - # - -const - XkbNewKeyboardNotify* = 0 - XkbMapNotify* = 1 - XkbStateNotify* = 2 - XkbControlsNotify* = 3 - XkbIndicatorStateNotify* = 4 - XkbIndicatorMapNotify* = 5 - XkbNamesNotify* = 6 - XkbCompatMapNotify* = 7 - XkbBellNotify* = 8 - XkbActionMessage* = 9 - XkbAccessXNotify* = 10 - XkbExtensionDeviceNotify* = 11 # - # Event Mask: - # - XkbSelectEvents: Specifies event interest. - # - -const - XkbNewKeyboardNotifyMask* = int(1) shl 0 - XkbMapNotifyMask* = int(1) shl 1 - XkbStateNotifyMask* = int(1) shl 2 - XkbControlsNotifyMask* = int(1) shl 3 - XkbIndicatorStateNotifyMask* = int(1) shl 4 - XkbIndicatorMapNotifyMask* = int(1) shl 5 - XkbNamesNotifyMask* = int(1) shl 6 - XkbCompatMapNotifyMask* = int(1) shl 7 - XkbBellNotifyMask* = int(1) shl 8 - XkbActionMessageMask* = int(1) shl 9 - XkbAccessXNotifyMask* = int(1) shl 10 - XkbExtensionDeviceNotifyMask* = int(1) shl 11 - XkbAllEventsMask* = 0x00000FFF # - # NewKeyboardNotify event details: - # - -const - XkbNKN_KeycodesMask* = int(1) shl 0 - XkbNKN_GeometryMask* = int(1) shl 1 - XkbNKN_DeviceIDMask* = int(1) shl 2 - XkbAllNewKeyboardEventsMask* = 0x00000007 # - # AccessXNotify event types: - # - The 'what' field of AccessXNotify events reports the - # reason that the event was generated. - # - -const - XkbAXN_SKPress* = 0 - XkbAXN_SKAccept* = 1 - XkbAXN_SKReject* = 2 - XkbAXN_SKRelease* = 3 - XkbAXN_BKAccept* = 4 - XkbAXN_BKReject* = 5 - XkbAXN_AXKWarning* = 6 # - # AccessXNotify details: - # - Used as an event detail mask to limit the conditions under which - # AccessXNotify events are reported - # - -const - XkbAXN_SKPressMask* = int(1) shl 0 - XkbAXN_SKAcceptMask* = int(1) shl 1 - XkbAXN_SKRejectMask* = int(1) shl 2 - XkbAXN_SKReleaseMask* = int(1) shl 3 - XkbAXN_BKAcceptMask* = int(1) shl 4 - XkbAXN_BKRejectMask* = int(1) shl 5 - XkbAXN_AXKWarningMask* = int(1) shl 6 - XkbAllAccessXEventsMask* = 0x0000000F # - # State detail mask: - # - The 'changed' field of StateNotify events reports which of - # the keyboard state components have changed. - # - Used as an event detail mask to limit the conditions under - # which StateNotify events are reported. - # - -const - XkbModifierStateMask* = int(1) shl 0 - XkbModifierBaseMask* = int(1) shl 1 - XkbModifierLatchMask* = int(1) shl 2 - XkbModifierLockMask* = int(1) shl 3 - XkbGroupStateMask* = int(1) shl 4 - XkbGroupBaseMask* = int(1) shl 5 - XkbGroupLatchMask* = int(1) shl 6 - XkbGroupLockMask* = int(1) shl 7 - XkbCompatStateMask* = int(1) shl 8 - XkbGrabModsMask* = int(1) shl 9 - XkbCompatGrabModsMask* = int(1) shl 10 - XkbLookupModsMask* = int(1) shl 11 - XkbCompatLookupModsMask* = int(1) shl 12 - XkbPointerButtonMask* = int(1) shl 13 - XkbAllStateComponentsMask* = 0x00003FFF # - # Controls detail masks: - # The controls specified in XkbAllControlsMask: - # - The 'changed' field of ControlsNotify events reports which of - # the keyboard controls have changed. - # - The 'changeControls' field of the SetControls request specifies - # the controls for which values are to be changed. - # - Used as an event detail mask to limit the conditions under - # which ControlsNotify events are reported. - # - # The controls specified in the XkbAllBooleanCtrlsMask: - # - The 'enabledControls' field of ControlsNotify events reports the - # current status of the boolean controls. - # - The 'enabledControlsChanges' field of ControlsNotify events reports - # any boolean controls that have been turned on or off. - # - The 'affectEnabledControls' and 'enabledControls' fields of the - # kbSetControls request change the set of enabled controls. - # - The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of - # an XkbControlsRec specify the controls to be changed if the keyboard - # times out and the values to which they should be changed. - # - The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags - # request specifies the specify the controls to be reset when the - # client exits and the values to which they should be reset. - # - The 'ctrls' field of an indicator map specifies the controls - # that drive the indicator. - # - Specifies the boolean controls affected by the SetControls and - # LockControls key actions. - # - -const - XkbRepeatKeysMask* = int(1) shl 0 - XkbSlowKeysMask* = int(1) shl 1 - XkbBounceKeysMask* = int(1) shl 2 - XkbStickyKeysMask* = int(1) shl 3 - XkbMouseKeysMask* = int(1) shl 4 - XkbMouseKeysAccelMask* = int(1) shl 5 - XkbAccessXKeysMask* = int(1) shl 6 - XkbAccessXTimeoutMask* = int(1) shl 7 - XkbAccessXFeedbackMask* = int(1) shl 8 - XkbAudibleBellMask* = int(1) shl 9 - XkbOverlay1Mask* = int(1) shl 10 - XkbOverlay2Mask* = int(1) shl 11 - XkbIgnoreGroupLockMask* = int(1) shl 12 - XkbGroupsWrapMask* = int(1) shl 27 - XkbInternalModsMask* = int(1) shl 28 - XkbIgnoreLockModsMask* = int(1) shl 29 - XkbPerKeyRepeatMask* = int(1) shl 30 - XkbControlsEnabledMask* = int(1) shl 31 - XkbAccessXOptionsMask* = XkbStickyKeysMask or XkbAccessXFeedbackMask - XkbAllBooleanCtrlsMask* = 0x00001FFF - XkbAllControlsMask* = 0xF8001FFF # - # Compatibility Map Compontents: - # - Specifies the components to be allocated in XkbAllocCompatMap. - # - -const - XkbSymInterpMask* = 1 shl 0 - XkbGroupCompatMask* = 1 shl 1 - XkbAllCompatMask* = 0x00000003 # - # Assorted constants and limits. - # - -const - XkbAllIndicatorsMask* = 0xFFFFFFFF # - # Map components masks: - # Those in AllMapComponentsMask: - # - Specifies the individual fields to be loaded or changed for the - # GetMap and SetMap requests. - # Those in ClientInfoMask: - # - Specifies the components to be allocated by XkbAllocClientMap. - # Those in ServerInfoMask: - # - Specifies the components to be allocated by XkbAllocServerMap. - # - -const - XkbKeyTypesMask* = 1 shl 0 - XkbKeySymsMask* = 1 shl 1 - XkbModifierMapMask* = 1 shl 2 - XkbExplicitComponentsMask* = 1 shl 3 - XkbKeyActionsMask* = 1 shl 4 - XkbKeyBehaviorsMask* = 1 shl 5 - XkbVirtualModsMask* = 1 shl 6 - XkbVirtualModMapMask* = 1 shl 7 - XkbAllClientInfoMask* = XkbKeyTypesMask or XkbKeySymsMask or - XkbModifierMapMask - XkbAllServerInfoMask* = XkbExplicitComponentsMask or XkbKeyActionsMask or - XkbKeyBehaviorsMask or XkbVirtualModsMask or XkbVirtualModMapMask - XkbAllMapComponentsMask* = XkbAllClientInfoMask or XkbAllServerInfoMask # - # Names component mask: - # - Specifies the names to be loaded or changed for the GetNames and - # SetNames requests. - # - Specifies the names that have changed in a NamesNotify event. - # - Specifies the names components to be allocated by XkbAllocNames. - # - -const - XkbKeycodesNameMask* = 1 shl 0 - XkbGeometryNameMask* = 1 shl 1 - XkbSymbolsNameMask* = 1 shl 2 - XkbPhysSymbolsNameMask* = 1 shl 3 - XkbTypesNameMask* = 1 shl 4 - XkbCompatNameMask* = 1 shl 5 - XkbKeyTypeNamesMask* = 1 shl 6 - XkbKTLevelNamesMask* = 1 shl 7 - XkbIndicatorNamesMask* = 1 shl 8 - XkbKeyNamesMask* = 1 shl 9 - XkbKeyAliasesMask* = 1 shl 10 - XkbVirtualModNamesMask* = 1 shl 11 - XkbGroupNamesMask* = 1 shl 12 - XkbRGNamesMask* = 1 shl 13 - XkbComponentNamesMask* = 0x0000003F - XkbAllNamesMask* = 0x00003FFF # - # Miscellaneous event details: - # - event detail masks for assorted events that don't reall - # have any details. - # - -const - XkbAllStateEventsMask* = XkbAllStateComponentsMask - XkbAllMapEventsMask* = XkbAllMapComponentsMask - XkbAllControlEventsMask* = XkbAllControlsMask - XkbAllIndicatorEventsMask* = XkbAllIndicatorsMask - XkbAllNameEventsMask* = XkbAllNamesMask - XkbAllCompatMapEventsMask* = XkbAllCompatMask - XkbAllBellEventsMask* = int(1) shl 0 - XkbAllActionMessagesMask* = int(1) shl 0 # - # XKB reports one error: BadKeyboard - # A further reason for the error is encoded into to most significant - # byte of the resourceID for the error: - # XkbErr_BadDevice - the device in question was not found - # XkbErr_BadClass - the device was found but it doesn't belong to - # the appropriate class. - # XkbErr_BadId - the device was found and belongs to the right - # class, but not feedback with a matching id was - # found. - # The low byte of the resourceID for this error contains the device - # id, class specifier or feedback id that failed. - # - -const - XkbKeyboard* = 0 - XkbNumberErrors* = 1 - XkbErr_BadDevice* = 0x000000FF - XkbErr_BadClass* = 0x000000FE - XkbErr_BadId* = 0x000000FD # - # Keyboard Components Mask: - # - Specifies the components that follow a GetKeyboardByNameReply - # - -const - XkbClientMapMask* = int(1) shl 0 - XkbServerMapMask* = int(1) shl 1 - XkbCompatMapMask* = int(1) shl 2 - XkbIndicatorMapMask* = int(1) shl 3 - XkbNamesMask* = int(1) shl 4 - XkbGeometryMask* = int(1) shl 5 - XkbControlsMask* = int(1) shl 6 - XkbAllComponentsMask* = 0x0000007F # - # AccessX Options Mask - # - The 'accessXOptions' field of an XkbControlsRec specifies the - # AccessX options that are currently in effect. - # - The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues' - # fields of an XkbControlsRec specify the Access X options to be - # changed if the keyboard times out and the values to which they - # should be changed. - # - -const - XkbAX_SKPressFBMask* = int(1) shl 0 - XkbAX_SKAcceptFBMask* = int(1) shl 1 - XkbAX_FeatureFBMask* = int(1) shl 2 - XkbAX_SlowWarnFBMask* = int(1) shl 3 - XkbAX_IndicatorFBMask* = int(1) shl 4 - XkbAX_StickyKeysFBMask* = int(1) shl 5 - XkbAX_TwoKeysMask* = int(1) shl 6 - XkbAX_LatchToLockMask* = int(1) shl 7 - XkbAX_SKReleaseFBMask* = int(1) shl 8 - XkbAX_SKRejectFBMask* = int(1) shl 9 - XkbAX_BKRejectFBMask* = int(1) shl 10 - XkbAX_DumbBellFBMask* = int(1) shl 11 - XkbAX_FBOptionsMask* = 0x00000F3F - XkbAX_SKOptionsMask* = 0x000000C0 - XkbAX_AllOptionsMask* = 0x00000FFF # - # XkbUseCoreKbd is used to specify the core keyboard without having - # to look up its X input extension identifier. - # XkbUseCorePtr is used to specify the core pointer without having - # to look up its X input extension identifier. - # XkbDfltXIClass is used to specify "don't care" any place that the - # XKB protocol is looking for an X Input Extension - # device class. - # XkbDfltXIId is used to specify "don't care" any place that the - # XKB protocol is looking for an X Input Extension - # feedback identifier. - # XkbAllXIClasses is used to get information about all device indicators, - # whether they're part of the indicator feedback class - # or the keyboard feedback class. - # XkbAllXIIds is used to get information about all device indicator - # feedbacks without having to list them. - # XkbXINone is used to indicate that no class or id has been specified. - # XkbLegalXILedClass(c) True if 'c' specifies a legal class with LEDs - # XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells - # XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device - # XkbExplicitXIClass(c) True if 'c' explicitly specifies a device class - # XkbExplicitXIId(c) True if 'i' explicitly specifies a device id - # XkbSingleXIClass(c) True if 'c' specifies exactly one device class, - # including the default. - # XkbSingleXIId(i) True if 'i' specifies exactly one device - # identifier, including the default. - # - -const - XkbUseCoreKbd* = 0x00000100 - XkbUseCorePtr* = 0x00000200 - XkbDfltXIClass* = 0x00000300 - XkbDfltXIId* = 0x00000400 - XkbAllXIClasses* = 0x00000500 - XkbAllXIIds* = 0x00000600 - XkbXINone* = 0x0000FF00 - -proc XkbLegalXILedClass*(c: int): bool -proc XkbLegalXIBellClass*(c: int): bool -proc XkbExplicitXIDevice*(c: int): bool -proc XkbExplicitXIClass*(c: int): bool -proc XkbExplicitXIId*(c: int): bool -proc XkbSingleXIClass*(c: int): bool -proc XkbSingleXIId*(c: int): bool -const - XkbNoModifier* = 0x000000FF - XkbNoShiftLevel* = 0x000000FF - XkbNoShape* = 0x000000FF - XkbNoIndicator* = 0x000000FF - XkbNoModifierMask* = 0 - XkbAllModifiersMask* = 0x000000FF - XkbAllVirtualModsMask* = 0x0000FFFF - XkbNumKbdGroups* = 4 - XkbMaxKbdGroup* = XkbNumKbdGroups - 1 - XkbMaxMouseKeysBtn* = 4 # - # Group Index and Mask: - # - Indices into the kt_index array of a key type. - # - Mask specifies types to be changed for XkbChangeTypesOfKey - # - -const - XkbGroup1Index* = 0 - XkbGroup2Index* = 1 - XkbGroup3Index* = 2 - XkbGroup4Index* = 3 - XkbAnyGroup* = 254 - XkbAllGroups* = 255 - XkbGroup1Mask* = 1 shl 0 - XkbGroup2Mask* = 1 shl 1 - XkbGroup3Mask* = 1 shl 2 - XkbGroup4Mask* = 1 shl 3 - XkbAnyGroupMask* = 1 shl 7 - XkbAllGroupsMask* = 0x0000000F # - # BuildCoreState: Given a keyboard group and a modifier state, - # construct the value to be reported an event. - # GroupForCoreState: Given the state reported in an event, - # determine the keyboard group. - # IsLegalGroup: Returns TRUE if 'g' is a valid group index. - # - -proc XkbBuildCoreState*(m, g: int): int -proc XkbGroupForCoreState*(s: int): int -proc XkbIsLegalGroup*(g: int): bool - # - # GroupsWrap values: - # - The 'groupsWrap' field of an XkbControlsRec specifies the - # treatment of out of range groups. - # - Bits 6 and 7 of the group info field of a key symbol map - # specify the interpretation of out of range groups for the - # corresponding key. - # -const - XkbWrapIntoRange* = 0x00000000 - XkbClampIntoRange* = 0x00000040 - XkbRedirectIntoRange* = 0x00000080 # - # Action flags: Reported in the 'flags' field of most key actions. - # Interpretation depends on the type of the action; not all actions - # accept all flags. - # - # Option Used for Actions - # ------ ---------------- - # ClearLocks SetMods, LatchMods, SetGroup, LatchGroup - # LatchToLock SetMods, LatchMods, SetGroup, LatchGroup - # LockNoLock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn - # LockNoUnlock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn - # UseModMapMods SetMods, LatchMods, LockMods, ISOLock - # GroupAbsolute SetGroup, LatchGroup, LockGroup, ISOLock - # UseDfltButton PtrBtn, LockPtrBtn - # NoAcceleration MovePtr - # MoveAbsoluteX MovePtr - # MoveAbsoluteY MovePtr - # ISODfltIsGroup ISOLock - # ISONoAffectMods ISOLock - # ISONoAffectGroup ISOLock - # ISONoAffectPtr ISOLock - # ISONoAffectCtrls ISOLock - # MessageOnPress ActionMessage - # MessageOnRelease ActionMessage - # MessageGenKeyEvent ActionMessage - # AffectDfltBtn SetPtrDflt - # DfltBtnAbsolute SetPtrDflt - # SwitchApplication SwitchScreen - # SwitchAbsolute SwitchScreen - # - -const - XkbSA_ClearLocks* = int(1) shl 0 - XkbSA_LatchToLock* = int(1) shl 1 - XkbSA_LockNoLock* = int(1) shl 0 - XkbSA_LockNoUnlock* = int(1) shl 1 - XkbSA_UseModMapMods* = int(1) shl 2 - XkbSA_GroupAbsolute* = int(1) shl 2 - XkbSA_UseDfltButton* = 0 - XkbSA_NoAcceleration* = int(1) shl 0 - XkbSA_MoveAbsoluteX* = int(1) shl 1 - XkbSA_MoveAbsoluteY* = int(1) shl 2 - XkbSA_ISODfltIsGroup* = int(1) shl 7 - XkbSA_ISONoAffectMods* = int(1) shl 6 - XkbSA_ISONoAffectGroup* = int(1) shl 5 - XkbSA_ISONoAffectPtr* = int(1) shl 4 - XkbSA_ISONoAffectCtrls* = int(1) shl 3 - XkbSA_ISOAffectMask* = 0x00000078 - XkbSA_MessageOnPress* = int(1) shl 0 - XkbSA_MessageOnRelease* = int(1) shl 1 - XkbSA_MessageGenKeyEvent* = int(1) shl 2 - XkbSA_AffectDfltBtn* = 1 - XkbSA_DfltBtnAbsolute* = int(1) shl 2 - XkbSA_SwitchApplication* = int(1) shl 0 - XkbSA_SwitchAbsolute* = int(1) shl 2 # - # The following values apply to the SA_DeviceValuator - # action only. Valuator operations specify the action - # to be taken. Values specified in the action are - # multiplied by 2^scale before they are applied. - # - -const - XkbSA_IgnoreVal* = 0x00000000 - XkbSA_SetValMin* = 0x00000010 - XkbSA_SetValCenter* = 0x00000020 - XkbSA_SetValMax* = 0x00000030 - XkbSA_SetValRelative* = 0x00000040 - XkbSA_SetValAbsolute* = 0x00000050 - XkbSA_ValOpMask* = 0x00000070 - XkbSA_ValScaleMask* = 0x00000007 - -proc XkbSA_ValOp*(a: int): int -proc XkbSA_ValScale*(a: int): int - # - # Action types: specifies the type of a key action. Reported in the - # type field of all key actions. - # -const - XkbSA_NoAction* = 0x00000000 - XkbSA_SetMods* = 0x00000001 - XkbSA_LatchMods* = 0x00000002 - XkbSA_LockMods* = 0x00000003 - XkbSA_SetGroup* = 0x00000004 - XkbSA_LatchGroup* = 0x00000005 - XkbSA_LockGroup* = 0x00000006 - XkbSA_MovePtr* = 0x00000007 - XkbSA_PtrBtn* = 0x00000008 - XkbSA_LockPtrBtn* = 0x00000009 - XkbSA_SetPtrDflt* = 0x0000000A - XkbSA_ISOLock* = 0x0000000B - XkbSA_Terminate* = 0x0000000C - XkbSA_SwitchScreen* = 0x0000000D - XkbSA_SetControls* = 0x0000000E - XkbSA_LockControls* = 0x0000000F - XkbSA_ActionMessage* = 0x00000010 - XkbSA_RedirectKey* = 0x00000011 - XkbSA_DeviceBtn* = 0x00000012 - XkbSA_LockDeviceBtn* = 0x00000013 - XkbSA_DeviceValuator* = 0x00000014 - XkbSA_LastAction* = XkbSA_DeviceValuator - XkbSA_NumActions* = XkbSA_LastAction + 1 - -const - XkbSA_XFree86Private* = 0x00000086 -# -# Specifies the key actions that clear latched groups or modifiers. -# - -const ##define XkbSA_BreakLatch \ - # ((1<>13)&0x3) - Result = (s shr 13) and 0x00000003 - -proc XkbIsLegalGroup(g: int): bool = - ##define XkbIsLegalGroup(g) (((g)>=0)&&((g)= 0) and (g < XkbNumKbdGroups) - -proc XkbSA_ValOp(a: int): int = - ##define XkbSA_ValOp(a) ((a)&XkbSA_ValOpMask) - Result = a and XkbSA_ValOpMask - -proc XkbSA_ValScale(a: int): int = - ##define XkbSA_ValScale(a) ((a)&XkbSA_ValScaleMask) - Result = a and XkbSA_ValScaleMask - -proc XkbIsModAction(a: PXkbAnyAction): bool = - ##define XkbIsModAction(a) (((a)->type>=Xkb_SASetMods)&&((a)->type<=XkbSA_LockMods)) - Result = (ze(a.theType) >= XkbSA_SetMods) and (ze(a.theType) <= XkbSA_LockMods) - -proc XkbIsGroupAction(a: PXkbAnyAction): bool = - ##define XkbIsGroupAction(a) (((a)->type>=XkbSA_SetGroup)&&((a)->type<=XkbSA_LockGroup)) - Result = (ze(a.theType) >= XkbSA_SetGroup) or (ze(a.theType) <= XkbSA_LockGroup) - -proc XkbIsPtrAction(a: PXkbAnyAction): bool = - ##define XkbIsPtrAction(a) (((a)->type>=XkbSA_MovePtr)&&((a)->type<=XkbSA_SetPtrDflt)) - Result = (ze(a.theType) >= XkbSA_MovePtr) and - (ze(a.theType) <= XkbSA_SetPtrDflt) - -proc XkbIsLegalKeycode(k: int): bool = - ##define XkbIsLegalKeycode(k) (((k)>=XkbMinLegalKeyCode)&&((k)<=XkbMaxLegalKeyCode)) - Result = (k >= XkbMinLegalKeyCode) and (k <= XkbMaxLegalKeyCode) - -proc XkbShiftLevel(n: int8): int8 = - ##define XkbShiftLevel(n) ((n)-1) - Result = n - 1'i8 - -proc XkbShiftLevelMask(n: int8): int8 = - ##define XkbShiftLevelMask(n) (1<<((n)-1)) - Result = 1'i8 shl (n - 1'i8) - -proc XkbCharToInt(v: int8): int16 = - ##define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f)) - if ((v and 0x80'i8) != 0'i8): Result = v or (not 0xFF'i16) - else: Result = int16(v and 0x7F'i8) - -proc XkbIntTo2Chars(i: int16, h, L: var int8) = - ##define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff))) - h = toU8((i shr 8'i16) and 0x00FF'i16) - L = toU8(i and 0xFF'i16) - -proc Xkb2CharsToInt(h, L: int8): int16 = - when defined(cpu64): - ##define Xkb2CharsToInt(h,l) ((h)&0x80?(int)(((h)<<8)|(l)|(~0xffff)): (int)(((h)<<8)|(l)&0x7fff)) - if (h and 0x80'i8) != 0'i8: - Result = toU16((ze(h) shl 8) or ze(L) or not 0x0000FFFF) - else: - Result = toU16((ze(h) shl 8) or ze(L) and 0x00007FFF) - else: - ##define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l))) - Result = toU16(ze(h) shl 8 or ze(L)) - -proc XkbModLocks(s: PXkbStatePtr): int8 = - ##define XkbModLocks(s) ((s)->locked_mods) - Result = s.locked_mods - -proc XkbStateMods(s: PXkbStatePtr): int16 = - ##define XkbStateMods(s) ((s)->base_mods|(s)->latched_mods|XkbModLocks(s)) - Result = s.base_mods or s.latched_mods or XkbModLocks(s) - -proc XkbGroupLock(s: PXkbStatePtr): int8 = - ##define XkbGroupLock(s) ((s)->locked_group) - Result = s.locked_group - -proc XkbStateGroup(s: PXkbStatePtr): int16 = - ##define XkbStateGroup(s) ((s)->base_group+(s)->latched_group+XkbGroupLock(s)) - Result = S.base_group + (s.latched_group) + XkbGroupLock(s) - -proc XkbStateFieldFromRec(s: PXkbStatePtr): int = - ##define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group) - Result = XkbBuildCoreState(s.lookup_mods, s.group) - -proc XkbGrabStateFromRec(s: PXkbStatePtr): int = - ##define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group) - Result = XkbBuildCoreState(s.grab_mods, s.group) - -proc XkbNumGroups(g: int16): int16 = - ##define XkbNumGroups(g) ((g)&0x0f) - Result = g and 0x0000000F'i16 - -proc XkbOutOfRangeGroupInfo(g: int16): int16 = - ##define XkbOutOfRangeGroupInfo(g) ((g)&0xf0) - Result = g and 0x000000F0'i16 - -proc XkbOutOfRangeGroupAction(g: int16): int16 = - ##define XkbOutOfRangeGroupAction(g) ((g)&0xc0) - Result = g and 0x000000C0'i16 - -proc XkbOutOfRangeGroupNumber(g: int16): int16 = - ##define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4) - Result = (g and 0x00000030'i16) shr 4'i16 - -proc XkbSetGroupInfo(g, w, n: int16): int16 = - ##define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f)) - Result = (w and 0x000000C0'i16) or - ((n and 3'i16) shl 4'i16) or (g and 0x0000000F'i16) - -proc XkbSetNumGroups(g, n: int16): int16 = - ##define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f)) - Result = (g and 0x000000F0'i16) or (n and 0x0000000F'i16) - -proc XkbModActionVMods(a: PXkbModAction): int16 = - ##define XkbModActionVMods(a) ((short)(((a)->vmods1<<8)|((a)->vmods2))) - Result = toU16((ze(a.vmods1) shl 8) or ze(a.vmods2)) - -proc XkbSetModActionVMods(a: PXkbModAction, v: int8) = - ##define XkbSetModActionVMods(a,v) (((a)->vmods1=(((v)>>8)&0xff)),(a)->vmods2=((v)&0xff)) - a.vmods1 = toU8((ze(v) shr 8) and 0x000000FF) - a.vmods2 = toU8(ze(v) and 0x000000FF) - -proc XkbSAGroup(a: PXkbGroupAction): int8 = - ##define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX)) - Result = int8(XkbCharToInt(a.group_XXX)) - -proc XkbSASetGroupProc(a: PXkbGroupAction, g: int8) = - ##define XkbSASetGroup(a,g) ((a)->group_XXX=(g)) - a.group_XXX = g - -proc XkbPtrActionX(a: PXkbPtrAction): int16 = - ##define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX)) - Result = int16(Xkb2CharsToInt(a.high_XXX, a.low_XXX)) - -proc XkbPtrActionY(a: PXkbPtrAction): int16 = - ##define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY)) - Result = int16(Xkb2CharsToInt(a.high_YYY, a.low_YYY)) - -proc XkbSetPtrActionX(a: PXkbPtrAction, x: int8) = - ##define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX)) - XkbIntTo2Chars(x, a.high_XXX, a.low_XXX) - -proc XkbSetPtrActionY(a: PXkbPtrAction, y: int8) = - ##define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY)) - XkbIntTo2Chars(y, a.high_YYY, a.low_YYY) - -proc XkbSAPtrDfltValue(a: PXkbPtrDfltAction): int8 = - ##define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX)) - Result = int8(XkbCharToInt(a.valueXXX)) - -proc XkbSASetPtrDfltValue(a: PXkbPtrDfltAction, c: pointer) = - ##define XkbSASetPtrDfltValue(a,c) ((a)->valueXXX= ((c)&0xff)) - a.valueXXX = toU8(cast[int](c)) - -proc XkbSAScreen(a: PXkbSwitchScreenAction): int8 = - ##define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX)) - Result = toU8(XkbCharToInt(a.screenXXX)) - -proc XkbSASetScreen(a: PXkbSwitchScreenAction, s: pointer) = - ##define XkbSASetScreen(a,s) ((a)->screenXXX= ((s)&0xff)) - a.screenXXX = toU8(cast[int](s)) - -proc XkbActionSetCtrls(a: PXkbCtrlsAction, c: int8) = - ##define XkbActionSetCtrls(a,c) (((a)->ctrls3=(((c)>>24)&0xff)),((a)->ctrls2=(((c)>>16)&0xff)), - # ((a)->ctrls1=(((c)>>8)&0xff)),((a)->ctrls0=((c)&0xff))) - a.ctrls3 = toU8((ze(c) shr 24) and 0x000000FF) - a.ctrls2 = toU8((ze(c) shr 16) and 0x000000FF) - a.ctrls1 = toU8((ze(c) shr 8) and 0x000000FF) - a.ctrls0 = toU8(ze(c) and 0x000000FF) - -proc XkbActionCtrls(a: PXkbCtrlsAction): int16 = - ##define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|(((unsigned int)(a)->ctrls2)<<16)| - # (((unsigned int)(a)->ctrls1)<<8)|((unsigned int)((a)->ctrls0))) - Result = toU16((ze(a.ctrls3) shl 24) or (ze(a.ctrls2) shl 16) or - (ze(a.ctrls1) shl 8) or ze(a.ctrls0)) - -proc XkbSARedirectVMods(a: PXkbRedirectKeyAction): int16 = - ##define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|((unsigned int)(a)->vmods0)) - Result = toU16((ze(a.vmods1) shl 8) or ze(a.vmods0)) - -proc XkbSARedirectSetVMods(a: PXkbRedirectKeyAction, m: int8) = - ##define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),((a)->vmods_mask0=((m)&0xff))) - a.vmods_mask1 = toU8((ze(m) shr 8) and 0x000000FF) - a.vmods_mask0 = toU8(ze(m) or 0x000000FF) - -proc XkbSARedirectVModsMask(a: PXkbRedirectKeyAction): int16 = - ##define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)| - # ((unsigned int)(a)->vmods_mask0)) - Result = toU16((ze(a.vmods_mask1) shl 8) or ze(a.vmods_mask0)) - -proc XkbSARedirectSetVModsMask(a: PXkbRedirectKeyAction, m: int8) = - ##define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),((a)->vmods_mask0=((m)&0xff))) - a.vmods_mask1 = toU8(ze(m) shr 8 and 0x000000FF) - a.vmods_mask0 = toU8(ze(m) and 0x000000FF) - -proc XkbAX_AnyFeedback(c: PXkbControlsPtr): int16 = - ##define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask) - Result = toU16(ze(c.enabled_ctrls) and XkbAccessXFeedbackMask) - -proc XkbAX_NeedOption(c: PXkbControlsPtr, w: int16): int16 = - ##define XkbAX_NeedOption(c,w) ((c)->ax_options&(w)) - Result = toU16(ze(c.ax_options) and ze(w)) - -proc XkbAX_NeedFeedback(c: PXkbControlsPtr, w: int16): bool = - ##define XkbAX_NeedFeedback(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w)) - Result = (XkbAX_AnyFeedback(c) > 0'i16) and (XkbAX_NeedOption(c, w) > 0'i16) - -proc XkbSMKeyActionsPtr(m: PXkbServerMapPtr, k: int16): PXkbAction = - ##define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]]) - Result = addr(m.acts[ze(m.key_acts[ze(k)])]) - -proc XkbCMKeyGroupInfo(m: PXkbClientMapPtr, k: int16): int8 = - ##define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info) - Result = m.key_sym_map[ze(k)].group_info - -proc XkbCMKeyNumGroups(m: PXkbClientMapPtr, k: int16): int8 = - ##define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info)) - Result = toU8(XkbNumGroups(m.key_sym_map[ze(k)].group_info)) - -proc XkbCMKeyGroupWidth(m: PXkbClientMapPtr, k: int16, g: int8): int8 = - ##define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels) - Result = XkbCMKeyType(m, k, g).num_levels - -proc XkbCMKeyGroupsWidth(m: PXkbClientMapPtr, K: int16): int8 = - ##define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width) - Result = m.key_sym_map[ze(k)].width - -proc XkbCMKeyTypeIndex(m: PXkbClientMapPtr, k: int16, g: int8): int8 = - ##define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3]) - Result = m.key_sym_map[ze(k)].kt_index[ze(g) and 0x00000003] - -proc XkbCMKeyType(m: PXkbClientMapPtr, k: int16, g: int8): PXkbKeyTypePtr = - ##define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)]) - Result = addr(m.types[ze(XkbCMKeyTypeIndex(m, k, g))]) - -proc XkbCMKeyNumSyms(m: PXkbClientMapPtr, k: int16): int16 = - ##define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k)) - Result = toU16(ze(XkbCMKeyGroupsWidth(m, k)) or ze(XkbCMKeyNumGroups(m, k))) - -proc XkbCMKeySymsOffset(m: PXkbClientMapPtr, k: int16): int8 = - ##define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset) - Result = m.key_sym_map[ze(k)].offset - -proc XkbCMKeySymsPtr*(m: PXkbClientMapPtr, k: int16): PKeySym = - ##define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)]) - Result = addr(m.syms[ze(XkbCMKeySymsOffset(m, k))]) - -proc XkbIM_IsAuto(i: PXkbIndicatorMapPtr): bool = - ##define XkbIM_IsAuto(i) ((((i)->flags&XkbIM_NoAutomatic)==0)&&(((i)->which_groups&&(i)->groups)|| - # ((i)->which_mods&&(i)->mods.mask)|| ((i)->ctrls))) - Result = ((ze(i.flags) and XkbIM_NoAutomatic) == 0) and - (((i.which_groups > 0'i8) and (i.groups > 0'i8)) or - ((i.which_mods > 0'i8) and (i.mods.mask > 0'i8)) or (i.ctrls > 0'i8)) - -proc XkbIM_InUse(i: PXkbIndicatorMapPtr): bool = - ##define XkbIM_InUse(i) (((i)->flags)||((i)->which_groups)||((i)->which_mods)||((i)->ctrls)) - Result = (i.flags > 0'i8) or (i.which_groups > 0'i8) or (i.which_mods > 0'i8) or - (i.ctrls > 0'i8) - -proc XkbKeyKeyTypeIndex(d: PXkbDescPtr, k: int16, g: int8): int8 = - ##define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g)) - Result = XkbCMKeyTypeIndex(d.map, k, g) - -proc XkbKeyKeyType(d: PXkbDescPtr, k: int16, g: int8): PXkbKeyTypePtr = - ##define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g)) - Result = XkbCMKeyType(d.map, k, g) - -proc XkbKeyGroupWidth(d: PXkbDescPtr, k: int16, g: int8): int8 = - ##define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g)) - Result = XkbCMKeyGroupWidth(d.map, k, g) - -proc XkbKeyGroupsWidth(d: PXkbDescPtr, k: int16): int8 = - ##define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k)) - Result = XkbCMKeyGroupsWidth(d.map, k) - -proc XkbKeyGroupInfo(d: PXkbDescPtr, k: int16): int8 = - ##define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k))) - Result = XkbCMKeyGroupInfo(d.map, k) - -proc XkbKeyNumGroups(d: PXkbDescPtr, k: int16): int8 = - ##define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k))) - Result = XkbCMKeyNumGroups(d.map, k) - -proc XkbKeyNumSyms(d: PXkbDescPtr, k: int16): int16 = - ##define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k))) - Result = XkbCMKeyNumSyms(d.map, k) - -proc XkbKeySymsPtr*(d: PXkbDescPtr, k: int16): PKeySym = - ##define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k))) - Result = XkbCMKeySymsPtr(d.map, k) - -proc XkbKeySym(d: PXkbDescPtr, k: int16, n: int16): TKeySym = - ##define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n]) - Result = cast[ptr array[0..0xffff, TKeySym]](XkbKeySymsPtr(d, k))[ze(n)] # XXX: this seems strange! - -proc XkbKeySymEntry(d: PXkbDescPtr, k: int16, sl: int16, g: int8): TKeySym = - ##define XkbKeySymEntry(d,k,sl,g) (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl)))) - Result = XkbKeySym(d, k, toU16(ze(XkbKeyGroupsWidth(d, k)) * ze(g) + ze(sl))) - -proc XkbKeyAction(d: PXkbDescPtr, k: int16, n: int16): PXkbAction = - ##define XkbKeyAction(d,k,n) (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL) - #if (XkbKeyHasActions(d, k)): - # Result = XkbKeyActionsPtr(d, k)[ze(n)] #Buggy !!! - assert(false) - result = nil - -proc XkbKeyActionEntry(d: PXkbDescPtr, k: int16, sl: int16, g: int8): int8 = - ##define XkbKeyActionEntry(d,k,sl,g) (XkbKeyHasActions(d,k) ? - # XkbKeyAction(d, k, ((XkbKeyGroupsWidth(d, k) * (g))+(sl))):NULL) - if XkbKeyHasActions(d, k): - Result = XkbKeyGroupsWidth(d, k) *% g +% toU8(sl) - else: - Result = 0'i8 - -proc XkbKeyHasActions(d: PXkbDescPtr, k: int16): bool = - ##define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0) - Result = d.server.key_acts[ze(k)] != 0'i16 - -proc XkbKeyNumActions(d: PXkbDescPtr, k: int16): int16 = - ##define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1) - if (XkbKeyHasActions(d, k)): Result = XkbKeyNumSyms(d, k) - else: Result = 1'i16 - -proc XkbKeyActionsPtr(d: PXkbDescPtr, k: int16): PXkbAction = - ##define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k)) - Result = XkbSMKeyActionsPtr(d.server, k) - -proc XkbKeycodeInRange(d: PXkbDescPtr, k: int16): bool = - ##define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&& ((k)<=(d)->max_key_code)) - Result = (char(toU8(k)) >= d.min_key_code) and (char(toU8(k)) <= d.max_key_code) - -proc XkbNumKeys(d: PXkbDescPtr): int8 = - ##define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1) - Result = toU8(ord(d.max_key_code) - ord(d.min_key_code) + 1) - -proc XkbXI_DevHasBtnActs(d: PXkbDeviceInfoPtr): bool = - ##define XkbXI_DevHasBtnActs(d) (((d)->num_btns>0)&&((d)->btn_acts!=NULL)) - Result = (d.num_btns > 0'i16) and (not (d.btn_acts == nil)) - -proc XkbXI_LegalDevBtn(d: PXkbDeviceInfoPtr, b: int16): bool = - ##define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d)&&((b)<(d)->num_btns)) - Result = XkbXI_DevHasBtnActs(d) and (b <% d.num_btns) - -proc XkbXI_DevHasLeds(d: PXkbDeviceInfoPtr): bool = - ##define XkbXI_DevHasLeds(d) (((d)->num_leds>0)&&((d)->leds!=NULL)) - Result = (d.num_leds > 0'i16) and (not (d.leds == nil)) - -proc XkbBoundsWidth(b: PXkbBoundsPtr): int16 = - ##define XkbBoundsWidth(b) (((b)->x2)-((b)->x1)) - Result = (b.x2) - b.x1 - -proc XkbBoundsHeight(b: PXkbBoundsPtr): int16 = - ##define XkbBoundsHeight(b) (((b)->y2)-((b)->y1)) - Result = (b.y2) - b.y1 - -proc XkbOutlineIndex(s: PXkbShapePtr, o: PXkbOutlinePtr): int32 = - ##define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0])) - Result = int32((cast[TAddress](o) - cast[TAddress](addr(s.outlines[0]))) div sizeof(PXkbOutlinePtr)) - -proc XkbShapeDoodadColor(g: PXkbGeometryPtr, d: PXkbShapeDoodadPtr): PXkbColorPtr = - ##define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) - Result = addr((g.colors[ze(d.color_ndx)])) - -proc XkbShapeDoodadShape(g: PXkbGeometryPtr, d: PXkbShapeDoodadPtr): PXkbShapePtr = - ##define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) - Result = addr(g.shapes[ze(d.shape_ndx)]) - -proc XkbSetShapeDoodadColor(g: PXkbGeometryPtr, d: PXkbShapeDoodadPtr, - c: PXkbColorPtr) = - ##define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) - d.color_ndx = toU16((cast[TAddress](c) - cast[TAddress](addr(g.colors[0]))) div sizeof(TXkbColorRec)) - -proc XkbSetShapeDoodadShape(g: PXkbGeometryPtr, d: PXkbShapeDoodadPtr, - s: PXkbShapePtr) = - ##define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0]) - d.shape_ndx = toU16((cast[TAddress](s) - cast[TAddress](addr(g.shapes[0]))) div sizeof(TXkbShapeRec)) - -proc XkbTextDoodadColor(g: PXkbGeometryPtr, d: PXkbTextDoodadPtr): PXkbColorPtr = - ##define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) - Result = addr(g.colors[ze(d.color_ndx)]) - -proc XkbSetTextDoodadColor(g: PXkbGeometryPtr, d: PXkbTextDoodadPtr, - c: PXkbColorPtr) = - ##define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) - d.color_ndx = toU16((cast[TAddress](c) - cast[TAddress](addr(g.colors[0]))) div sizeof(TXkbColorRec)) - -proc XkbIndicatorDoodadShape(g: PXkbGeometryPtr, d: PXkbIndicatorDoodadPtr): PXkbShapeDoodadPtr = - ##define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) - Result = cast[PXkbShapeDoodadPtr](addr(g.shapes[ze(d.shape_ndx)])) - -proc XkbIndicatorDoodadOnColor(g: PXkbGeometryPtr, d: PXkbIndicatorDoodadPtr): PXkbColorPtr = - ##define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx]) - Result = addr(g.colors[ze(d.on_color_ndx)]) - -proc XkbIndicatorDoodadOffColor(g: PXkbGeometryPtr, d: PXkbIndicatorDoodadPtr): PXkbColorPtr = - ##define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx]) - Result = addr(g.colors[ze(d.off_color_ndx)]) - -proc XkbSetIndicatorDoodadOnColor(g: PXkbGeometryPtr, d: PXkbIndicatorDoodadPtr, - c: PXkbColorPtr) = - ##define XkbSetIndicatorDoodadOnColor(g,d,c) ((d)->on_color_ndx= (c)-&(g)->colors[0]) - d.on_color_ndx = toU16((cast[TAddress](c) - cast[TAddress](addr(g.colors[0]))) div sizeof(TXkbColorRec)) - -proc XkbSetIndicatorDoodadOffColor(g: PXkbGeometryPtr, - d: PXkbIndicatorDoodadPtr, c: PXkbColorPtr) = - ##define XkbSetIndicatorDoodadOffColor(g,d,c) ((d)->off_color_ndx= (c)-&(g)->colors[0]) - d.off_color_ndx = toU16((cast[TAddress](c) - cast[TAddress](addr(g.colors[0]))) div sizeof(TxkbColorRec)) - -proc XkbSetIndicatorDoodadShape(g: PXkbGeometryPtr, d: PXkbIndicatorDoodadPtr, - s: PXkbShapeDoodadPtr) = - ##define XkbSetIndicatorDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0]) - d.shape_ndx = toU16((cast[TAddress](s) - (cast[TAddress](addr(g.shapes[0])))) div sizeof(TXkbShapeRec)) - -proc XkbLogoDoodadColor(g: PXkbGeometryPtr, d: PXkbLogoDoodadPtr): PXkbColorPtr = - ##define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) - Result = addr(g.colors[ze(d.color_ndx)]) - -proc XkbLogoDoodadShape(g: PXkbGeometryPtr, d: PXkbLogoDoodadPtr): PXkbShapeDoodadPtr = - ##define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) - Result = cast[PXkbShapeDoodadPtr](addr(g.shapes[ze(d.shape_ndx)])) - -proc XkbSetLogoDoodadColor(g: PXkbGeometryPtr, d: PXkbLogoDoodadPtr, - c: PXkbColorPtr) = - ##define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) - d.color_ndx = toU16((cast[TAddress](c) - cast[TAddress](addr(g.colors[0]))) div sizeof(TXkbColorRec)) - -proc XkbSetLogoDoodadShape(g: PXkbGeometryPtr, d: PXkbLogoDoodadPtr, - s: PXkbShapeDoodadPtr) = - ##define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0]) - d.shape_ndx = toU16((cast[TAddress](s) - cast[TAddress](addr(g.shapes[0]))) div sizeof(TXkbShapeRec)) - -proc XkbKeyShape(g: PXkbGeometryPtr, k: PXkbKeyPtr): PXkbShapeDoodadPtr = - ##define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx]) - Result = cast[PXkbShapeDoodadPtr](addr(g.shapes[ze(k.shape_ndx)])) - -proc XkbKeyColor(g: PXkbGeometryPtr, k: PXkbKeyPtr): PXkbColorPtr = - ##define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx]) - Result = addr(g.colors[ze(k.color_ndx)]) - -proc XkbSetKeyShape(g: PXkbGeometryPtr, k: PXkbKeyPtr, s: PXkbShapeDoodadPtr) = - ##define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0]) - k.shape_ndx = toU8((cast[TAddress](s) - cast[TAddress](addr(g.shapes[0]))) div sizeof(TXkbShapeRec)) - -proc XkbSetKeyColor(g: PXkbGeometryPtr, k: PXkbKeyPtr, c: PXkbColorPtr) = - ##define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0]) - k.color_ndx = toU8((cast[TAddress](c) - cast[TAddress](addr(g.colors[0]))) div sizeof(TxkbColorRec)) - -proc XkbGeomColorIndex(g: PXkbGeometryPtr, c: PXkbColorPtr): int32 = - ##define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0])) - Result = toU16((cast[TAddress](c) - (cast[TAddress](addr(g.colors[0])))) div sizeof(TxkbColorRec)) diff --git a/lib/wrappers/x11/xkblib.nim b/lib/wrappers/x11/xkblib.nim deleted file mode 100644 index 1b450f2894..0000000000 --- a/lib/wrappers/x11/xkblib.nim +++ /dev/null @@ -1,661 +0,0 @@ -# $Xorg: XKBlib.h,v 1.6 2000/08/17 19:45:03 cpqbld Exp $ -#************************************************************ -#Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. -# -#Permission to use, copy, modify, and distribute this -#software and its documentation for any purpose and without -#fee is hereby granted, provided that the above copyright -#notice appear in all copies and that both that copyright -#notice and this permission notice appear in supporting -#documentation, and that the name of Silicon Graphics not be -#used in advertising or publicity pertaining to distribution -#of the software without specific prior written permission. -#Silicon Graphics makes no representation about the suitability -#of this software for any purpose. It is provided "as is" -#without any express or implied warranty. -# -#SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -#SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -#AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -#GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -#DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING `from` LOSS OF USE, -#DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -#OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -#THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -#********************************************************/ -# $XFree86: xc/lib/X11/XKBlib.h,v 3.3 2001/08/01 00:44:38 tsi Exp $ -# -# Pascal Convertion was made by Ido Kannner - kanerido@actcom.net.il -# -#Thanks: -# I want to thanks to oliebol for putting up with all of the problems that was found -# while translating this code. ;) -# -# I want to thanks #fpc channel in freenode irc, for helping me, and to put up with my -# wierd questions ;) -# -# Thanks for mmc in #xlib on freenode irc And so for the channel itself for the helping me to -# understanding some of the problems I had converting this headers and pointing me to resources -# that helped translating this headers. -# -# Ido -# -#History: -# 2004/10/15 - Fixed a bug of accessing second based records by removing "paced record" and -# chnaged it to "reocrd" only. -# 2004/10/10 - Added to TXkbGetAtomNameFunc and TXkbInternAtomFunc the cdecl call. -# 2004/10/06 - 09 - Convertion `from` the c header of XKBlib.h -# -# - -import - X, Xlib, XKB - - -include "x11pragma.nim" - - -type - PXkbAnyEvent* = ptr TXkbAnyEvent - TXkbAnyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds; - xkb_type*: int16 # XKB event minor code - device*: int16 # device ID - - -type - PXkbNewKeyboardNotifyEvent* = ptr TXkbNewKeyboardNotifyEvent - TXkbNewKeyboardNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbNewKeyboardNotify - device*: int16 # device ID - old_device*: int16 # device ID of previous keyboard - min_key_code*: int16 # minimum key code - max_key_code*: int16 # maximum key code - old_min_key_code*: int16 # min key code of previous kbd - old_max_key_code*: int16 # max key code of previous kbd - changed*: int16 # changed aspects of the keyboard - req_major*: int8 # major and minor opcode of req - req_minor*: int8 # that caused change, if applicable - - -type - PXkbMapNotifyEvent* = ptr TXkbMapNotifyEvent - TXkbMapNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbMapNotify - device*: int16 # device ID - changed*: int16 # fields which have been changed - flags*: int16 # reserved - first_type*: int16 # first changed key type - num_types*: int16 # number of changed key types - min_key_code*: TKeyCode - max_key_code*: TKeyCode - first_key_sym*: TKeyCode - first_key_act*: TKeyCode - first_key_behavior*: TKeyCode - first_key_explicit*: TKeyCode - first_modmap_key*: TKeyCode - first_vmodmap_key*: TKeyCode - num_key_syms*: int16 - num_key_acts*: int16 - num_key_behaviors*: int16 - num_key_explicit*: int16 - num_modmap_keys*: int16 - num_vmodmap_keys*: int16 - vmods*: int16 # mask of changed virtual mods - - -type - PXkbStateNotifyEvent* = ptr TXkbStateNotifyEvent - TXkbStateNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbStateNotify - device*: int16 # device ID - changed*: int16 # mask of changed state components - group*: int16 # keyboard group - base_group*: int16 # base keyboard group - latched_group*: int16 # latched keyboard group - locked_group*: int16 # locked keyboard group - mods*: int16 # modifier state - base_mods*: int16 # base modifier state - latched_mods*: int16 # latched modifiers - locked_mods*: int16 # locked modifiers - compat_state*: int16 # compatibility state - grab_mods*: int8 # mods used for grabs - compat_grab_mods*: int8 # grab mods for non-XKB clients - lookup_mods*: int8 # mods sent to clients - compat_lookup_mods*: int8 # mods sent to non-XKB clients - ptr_buttons*: int16 # pointer button state - keycode*: TKeyCode # keycode that caused the change - event_type*: int8 # KeyPress or KeyRelease - req_major*: int8 # Major opcode of request - req_minor*: int8 # Minor opcode of request - - -type - PXkbControlsNotifyEvent* = ptr TXkbControlsNotifyEvent - TXkbControlsNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbControlsNotify - device*: int16 # device ID - changed_ctrls*: int16 # controls with changed sub-values - enabled_ctrls*: int16 # controls currently enabled - enabled_ctrl_changes*: int16 # controls just {en,dis}abled - num_groups*: int16 # total groups on keyboard - keycode*: TKeyCode # key that caused change or 0 - event_type*: int8 # type of event that caused change - req_major*: int8 # if keycode==0, major and minor - req_minor*: int8 # opcode of req that caused change - - -type - PXkbIndicatorNotifyEvent* = ptr TXkbIndicatorNotifyEvent - TXkbIndicatorNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbIndicatorNotify - device*: int16 # device - changed*: int16 # indicators with new state or map - state*: int16 # current state of all indicators - - -type - PXkbNamesNotifyEvent* = ptr TXkbNamesNotifyEvent - TXkbNamesNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbNamesNotify - device*: int16 # device ID - changed*: int32 # names that have changed - first_type*: int16 # first key type with new name - num_types*: int16 # number of key types with new names - first_lvl*: int16 # first key type new new level names - num_lvls*: int16 # # of key types w/new level names - num_aliases*: int16 # total number of key aliases - num_radio_groups*: int16 # total number of radio groups - changed_vmods*: int16 # virtual modifiers with new names - changed_groups*: int16 # groups with new names - changed_indicators*: int16 # indicators with new names - first_key*: int16 # first key with new name - num_keys*: int16 # number of keys with new names - - -type - PXkbCompatMapNotifyEvent* = ptr TXkbCompatMapNotifyEvent - TXkbCompatMapNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbCompatMapNotify - device*: int16 # device ID - changed_groups*: int16 # groups with new compat maps - first_si*: int16 # first new symbol interp - num_si*: int16 # number of new symbol interps - num_total_si*: int16 # total # of symbol interps - - -type - PXkbBellNotifyEvent* = ptr TXkbBellNotifyEvent - TXkbBellNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbBellNotify - device*: int16 # device ID - percent*: int16 # requested volume as a % of maximum - pitch*: int16 # requested pitch in Hz - duration*: int16 # requested duration in useconds - bell_class*: int16 # (input extension) feedback class - bell_id*: int16 # (input extension) ID of feedback - name*: TAtom # "name" of requested bell - window*: TWindow # window associated with event - event_only*: bool # "event only" requested - - -type - PXkbActionMessageEvent* = ptr TXkbActionMessageEvent - TXkbActionMessageEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbActionMessage - device*: int16 # device ID - keycode*: TKeyCode # key that generated the event - press*: bool # true if act caused by key press - key_event_follows*: bool # true if key event also generated - group*: int16 # effective group - mods*: int16 # effective mods - message*: array[0..XkbActionMessageLength, Char] # message -- leave space for NUL - - -type - PXkbAccessXNotifyEvent* = ptr TXkbAccessXNotifyEvent - TXkbAccessXNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbAccessXNotify - device*: int16 # device ID - detail*: int16 # XkbAXN_* - keycode*: int16 # key of event - sk_delay*: int16 # current slow keys delay - debounce_delay*: int16 # current debounce delay - - -type - PXkbExtensionDeviceNotifyEvent* = ptr TXkbExtensionDeviceNotifyEvent - TXkbExtensionDeviceNotifyEvent*{.final.} = object - theType*: int16 # XkbAnyEvent - serial*: int32 # of last req processed by server - send_event*: bool # is this `from` a SendEvent request? - display*: PDisplay # Display the event was read `from` - time*: TTime # milliseconds - xkb_type*: int16 # XkbExtensionDeviceNotify - device*: int16 # device ID - reason*: int16 # reason for the event - supported*: int16 # mask of supported features - unsupported*: int16 # mask of unsupported features - # that some app tried to use - first_btn*: int16 # first button that changed - num_btns*: int16 # range of buttons changed - leds_defined*: int16 # indicators with names or maps - led_state*: int16 # current state of the indicators - led_class*: int16 # feedback class for led changes - led_id*: int16 # feedback id for led changes - - -type - PXkbEvent* = ptr TXkbEvent - TXkbEvent*{.final.} = object - theType*: int16 - any*: TXkbAnyEvent - new_kbd*: TXkbNewKeyboardNotifyEvent - map*: TXkbMapNotifyEvent - state*: TXkbStateNotifyEvent - ctrls*: TXkbControlsNotifyEvent - indicators*: TXkbIndicatorNotifyEvent - names*: TXkbNamesNotifyEvent - compat*: TXkbCompatMapNotifyEvent - bell*: TXkbBellNotifyEvent - message*: TXkbActionMessageEvent - accessx*: TXkbAccessXNotifyEvent - device*: TXkbExtensionDeviceNotifyEvent - core*: TXEvent - - -type - PXkbKbdDpyStatePtr* = ptr TXkbKbdDpyStateRec - TXkbKbdDpyStateRec*{.final.} = object # XkbOpenDisplay error codes - -const - XkbOD_Success* = 0 - XkbOD_BadLibraryVersion* = 1 - XkbOD_ConnectionRefused* = 2 - XkbOD_NonXkbServer* = 3 - XkbOD_BadServerVersion* = 4 # Values for XlibFlags - -const - XkbLC_ForceLatin1Lookup* = 1 shl 0 - XkbLC_ConsumeLookupMods* = 1 shl 1 - XkbLC_AlwaysConsumeShiftAndLock* = 1 shl 2 - XkbLC_IgnoreNewKeyboards* = 1 shl 3 - XkbLC_ControlFallback* = 1 shl 4 - XkbLC_ConsumeKeysOnComposeFail* = 1 shl 29 - XkbLC_ComposeLED* = 1 shl 30 - XkbLC_BeepOnComposeFail* = 1 shl 31 - XkbLC_AllComposeControls* = 0xC0000000 - XkbLC_AllControls* = 0xC000001F - -proc XkbIgnoreExtension*(ignore: bool): bool{.libx11c, - importc: "XkbIgnoreExtension".} -proc XkbOpenDisplay*(name: cstring, ev_rtrn, err_rtrn, major_rtrn, minor_rtrn, - reason: ptr int16): PDisplay{.libx11c, importc: "XkbOpenDisplay".} -proc XkbQueryExtension*(dpy: PDisplay, opcodeReturn, eventBaseReturn, - errorBaseReturn, majorRtrn, minorRtrn: ptr int16): bool{. - libx11c, importc: "XkbQueryExtension".} -proc XkbUseExtension*(dpy: PDisplay, major_rtrn, minor_rtrn: ptr int16): bool{. - libx11c, importc: "XkbUseExtension".} -proc XkbLibraryVersion*(libMajorRtrn, libMinorRtrn: ptr int16): bool{.libx11c, importc: "XkbLibraryVersion".} -proc XkbSetXlibControls*(dpy: PDisplay, affect, values: int16): int16{.libx11c, importc: "XkbSetXlibControls".} -proc XkbGetXlibControls*(dpy: PDisplay): int16{.libx11c, - importc: "XkbGetXlibControls".} -type - TXkbInternAtomFunc* = proc (dpy: PDisplay, name: cstring, only_if_exists: bool): TAtom{. - cdecl.} - -type - TXkbGetAtomNameFunc* = proc (dpy: PDisplay, atom: TAtom): cstring{.cdecl.} - -proc XkbSetAtomFuncs*(getAtom: TXkbInternAtomFunc, getName: TXkbGetAtomNameFunc){. - libx11c, importc: "XkbSetAtomFuncs".} -proc XkbKeycodeToKeysym*(dpy: PDisplay, kc: TKeyCode, group, level: int16): TKeySym{. - libx11c, importc: "XkbKeycodeToKeysym".} -proc XkbKeysymToModifiers*(dpy: PDisplay, ks: TKeySym): int16{.libx11c, importc: "XkbKeysymToModifiers".} -proc XkbLookupKeySym*(dpy: PDisplay, keycode: TKeyCode, - modifiers, modifiers_return: int16, keysym_return: PKeySym): bool{. - libx11c, importc: "XkbLookupKeySym".} -proc XkbLookupKeyBinding*(dpy: PDisplay, sym_rtrn: TKeySym, mods: int16, - buffer: cstring, nbytes: int16, extra_rtrn: ptr int16): int16{. - libx11c, importc: "XkbLookupKeyBinding".} -proc XkbTranslateKeyCode*(xkb: PXkbDescPtr, keycode: TKeyCode, - modifiers, modifiers_return: int16, - keysym_return: PKeySym): bool{.libx11c, - importc: "XkbTranslateKeyCode".} -proc XkbTranslateKeySym*(dpy: PDisplay, sym_return: TKeySym, modifiers: int16, - buffer: cstring, nbytes: int16, extra_rtrn: ptr int16): int16{. - libx11c, importc: "XkbTranslateKeySym".} -proc XkbSetAutoRepeatRate*(dpy: PDisplay, deviceSpec, delay, interval: int16): bool{. - libx11c, importc: "XkbSetAutoRepeatRate".} -proc XkbGetAutoRepeatRate*(dpy: PDisplay, deviceSpec: int16, - delayRtrn, intervalRtrn: PWord): bool{.libx11c, importc: "XkbGetAutoRepeatRate".} -proc XkbChangeEnabledControls*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{. - libx11c, importc: "XkbChangeEnabledControls".} -proc XkbDeviceBell*(dpy: PDisplay, win: TWindow, - deviceSpec, bellClass, bellID, percent: int16, name: TAtom): bool{. - libx11c, importc: "XkbDeviceBell".} -proc XkbForceDeviceBell*(dpy: PDisplay, - deviceSpec, bellClass, bellID, percent: int16): bool{. - libx11c, importc: "XkbForceDeviceBell".} -proc XkbDeviceBellEvent*(dpy: PDisplay, win: TWindow, - deviceSpec, bellClass, bellID, percent: int16, - name: TAtom): bool{.libx11c, - importc: "XkbDeviceBellEvent".} -proc XkbBell*(dpy: PDisplay, win: TWindow, percent: int16, name: TAtom): bool{. - libx11c, importc: "XkbBell".} -proc XkbForceBell*(dpy: PDisplay, percent: int16): bool{.libx11c, - importc: "XkbForceBell".} -proc XkbBellEvent*(dpy: PDisplay, win: TWindow, percent: int16, name: TAtom): bool{. - libx11c, importc: "XkbBellEvent".} -proc XkbSelectEvents*(dpy: PDisplay, deviceID, affect, values: int16): bool{. - libx11c, importc: "XkbSelectEvents".} -proc XkbSelectEventDetails*(dpy: PDisplay, deviceID, eventType: int16, - affect, details: int32): bool{.libx11c, importc: "XkbSelectEventDetails".} -proc XkbNoteMapChanges*(old: PXkbMapChangesPtr, new: PXkbMapNotifyEvent, - wanted: int16){.libx11c, - importc: "XkbNoteMapChanges".} -proc XkbNoteNameChanges*(old: PXkbNameChangesPtr, new: PXkbNamesNotifyEvent, - wanted: int16){.libx11c, - importc: "XkbNoteNameChanges".} -proc XkbGetIndicatorState*(dpy: PDisplay, deviceSpec: int16, pStateRtrn: PWord): TStatus{. - libx11c, importc: "XkbGetIndicatorState".} -proc XkbGetDeviceIndicatorState*(dpy: PDisplay, - deviceSpec, ledClass, ledID: int16, - pStateRtrn: PWord): TStatus{.libx11c, importc: "XkbGetDeviceIndicatorState".} -proc XkbGetIndicatorMap*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetIndicatorMap".} -proc XkbSetIndicatorMap*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): bool{. - libx11c, importc: "XkbSetIndicatorMap".} -proc XkbNoteIndicatorMapChanges*(o, n: PXkbIndicatorChangesPtr, w: int16) -proc XkbNoteIndicatorStateChanges*(o, n: PXkbIndicatorChangesPtr, w: int16) -proc XkbGetIndicatorMapChanges*(d: PDisplay, x: PXkbDescPtr, - c: PXkbIndicatorChangesPtr): TStatus -proc XkbChangeIndicatorMaps*(d: PDisplay, x: PXkbDescPtr, - c: PXkbIndicatorChangesPtr): bool -proc XkbGetNamedIndicator*(dpy: PDisplay, name: TAtom, pNdxRtrn: ptr int16, - pStateRtrn: ptr bool, pMapRtrn: PXkbIndicatorMapPtr, - pRealRtrn: ptr bool): bool{.libx11c, - importc: "XkbGetNamedIndicator".} -proc XkbGetNamedDeviceIndicator*(dpy: PDisplay, - deviceSpec, ledClass, ledID: int16, - name: TAtom, pNdxRtrn: ptr int16, - pStateRtrn: ptr bool, - pMapRtrn: PXkbIndicatorMapPtr, - pRealRtrn: ptr bool): bool{.libx11c, importc: "XkbGetNamedDeviceIndicator".} -proc XkbSetNamedIndicator*(dpy: PDisplay, name: TAtom, - changeState, state, createNewMap: bool, - pMap: PXkbIndicatorMapPtr): bool{.libx11c, importc: "XkbSetNamedIndicator".} -proc XkbSetNamedDeviceIndicator*(dpy: PDisplay, - deviceSpec, ledClass, ledID: int16, - name: TAtom, - changeState, state, createNewMap: bool, - pMap: PXkbIndicatorMapPtr): bool{.libx11c, importc: "XkbSetNamedDeviceIndicator".} -proc XkbLockModifiers*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{. - libx11c, importc: "XkbLockModifiers".} -proc XkbLatchModifiers*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{. - libx11c, importc: "XkbLatchModifiers".} -proc XkbLockGroup*(dpy: PDisplay, deviceSpec, group: int16): bool{.libx11c, importc: "XkbLockGroup".} -proc XkbLatchGroup*(dpy: PDisplay, deviceSpec, group: int16): bool{.libx11c, importc: "XkbLatchGroup".} -proc XkbSetServerInternalMods*(dpy: PDisplay, deviceSpec, affectReal, - realValues, affectVirtual, virtualValues: int16): bool{.libx11c, importc: "XkbSetServerInternalMods".} -proc XkbSetIgnoreLockMods*(dpy: PDisplay, deviceSpec, affectReal, realValues, - affectVirtual, virtualValues: int16): bool{.libx11c, - importc: "XkbSetIgnoreLockMods".} -proc XkbVirtualModsToReal*(dpy: PDisplay, virtual_mask: int16, mask_rtrn: PWord): bool{. - libx11c, importc: "XkbVirtualModsToReal".} -proc XkbComputeEffectiveMap*(xkb: PXkbDescPtr, theType: PXkbKeyTypePtr, - map_rtrn: PByte): bool{.libx11c, - importc: "XkbComputeEffectiveMap".} -proc XkbInitCanonicalKeyTypes*(xkb: PXkbDescPtr, which: int16, keypadVMod: int16): TStatus{. - libx11c, importc: "XkbInitCanonicalKeyTypes".} -proc XkbAllocKeyboard*(): PXkbDescPtr{.libx11c, - importc: "XkbAllocKeyboard".} -proc XkbFreeKeyboard*(xkb: PXkbDescPtr, which: int16, freeDesc: bool){.libx11c, importc: "XkbFreeKeyboard".} -proc XkbAllocClientMap*(xkb: PXkbDescPtr, which, nTypes: int16): TStatus{.libx11c, importc: "XkbAllocClientMap".} -proc XkbAllocServerMap*(xkb: PXkbDescPtr, which, nActions: int16): TStatus{. - libx11c, importc: "XkbAllocServerMap".} -proc XkbFreeClientMap*(xkb: PXkbDescPtr, what: int16, freeMap: bool){.libx11c, importc: "XkbFreeClientMap".} -proc XkbFreeServerMap*(xkb: PXkbDescPtr, what: int16, freeMap: bool){.libx11c, importc: "XkbFreeServerMap".} -proc XkbAddKeyType*(xkb: PXkbDescPtr, name: TAtom, map_count: int16, - want_preserve: bool, num_lvls: int16): PXkbKeyTypePtr{. - libx11c, importc: "XkbAddKeyType".} -proc XkbAllocIndicatorMaps*(xkb: PXkbDescPtr): TStatus{.libx11c, - importc: "XkbAllocIndicatorMaps".} -proc XkbFreeIndicatorMaps*(xkb: PXkbDescPtr){.libx11c, - importc: "XkbFreeIndicatorMaps".} -proc XkbGetMap*(dpy: PDisplay, which, deviceSpec: int16): PXkbDescPtr{.libx11c, importc: "XkbGetMap".} -proc XkbGetUpdatedMap*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetUpdatedMap".} -proc XkbGetMapChanges*(dpy: PDisplay, xkb: PXkbDescPtr, - changes: PXkbMapChangesPtr): TStatus{.libx11c, importc: "XkbGetMapChanges".} -proc XkbRefreshKeyboardMapping*(event: PXkbMapNotifyEvent): TStatus{.libx11c, importc: "XkbRefreshKeyboardMapping".} -proc XkbGetKeyTypes*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetKeyTypes".} -proc XkbGetKeySyms*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetKeySyms".} -proc XkbGetKeyActions*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetKeyActions".} -proc XkbGetKeyBehaviors*(dpy: PDisplay, firstKey, nKeys: int16, - desc: PXkbDescPtr): TStatus{.libx11c, - importc: "XkbGetKeyBehaviors".} -proc XkbGetVirtualMods*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetVirtualMods".} -proc XkbGetKeyExplicitComponents*(dpy: PDisplay, firstKey, nKeys: int16, - desc: PXkbDescPtr): TStatus{.libx11c, importc: "XkbGetKeyExplicitComponents".} -proc XkbGetKeyModifierMap*(dpy: PDisplay, firstKey, nKeys: int16, - desc: PXkbDescPtr): TStatus{.libx11c, - importc: "XkbGetKeyModifierMap".} -proc XkbAllocControls*(xkb: PXkbDescPtr, which: int16): TStatus{.libx11c, importc: "XkbAllocControls".} -proc XkbFreeControls*(xkb: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeControls".} -proc XkbGetControls*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetControls".} -proc XkbSetControls*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): bool{. - libx11c, importc: "XkbSetControls".} -proc XkbNoteControlsChanges*(old: PXkbControlsChangesPtr, - new: PXkbControlsNotifyEvent, wanted: int16){. - libx11c, importc: "XkbNoteControlsChanges".} -proc XkbGetControlsChanges*(d: PDisplay, x: PXkbDescPtr, - c: PXkbControlsChangesPtr): TStatus -proc XkbChangeControls*(d: PDisplay, x: PXkbDescPtr, c: PXkbControlsChangesPtr): bool -proc XkbAllocCompatMap*(xkb: PXkbDescPtr, which, nInterpret: int16): TStatus{. - libx11c, importc: "XkbAllocCompatMap".} -proc XkbFreeCompatMap*(xkib: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeCompatMap".} -proc XkbGetCompatMap*(dpy: PDisplay, which: int16, xkb: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetCompatMap".} -proc XkbSetCompatMap*(dpy: PDisplay, which: int16, xkb: PXkbDescPtr, - updateActions: bool): bool{.libx11c, - importc: "XkbSetCompatMap".} -proc XkbAddSymInterpret*(xkb: PXkbDescPtr, si: PXkbSymInterpretPtr, - updateMap: bool, changes: PXkbChangesPtr): PXkbSymInterpretPtr{. - libx11c, importc: "XkbAddSymInterpret".} -proc XkbAllocNames*(xkb: PXkbDescPtr, which: int16, - nTotalRG, nTotalAliases: int16): TStatus{.libx11c, importc: "XkbAllocNames".} -proc XkbGetNames*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): TStatus{. - libx11c, importc: "XkbGetNames".} -proc XkbSetNames*(dpy: PDisplay, which, firstType, nTypes: int16, - desc: PXkbDescPtr): bool{.libx11c, - importc: "XkbSetNames".} -proc XkbChangeNames*(dpy: PDisplay, xkb: PXkbDescPtr, - changes: PXkbNameChangesPtr): bool{.libx11c, - importc: "XkbChangeNames".} -proc XkbFreeNames*(xkb: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeNames".} -proc XkbGetState*(dpy: PDisplay, deviceSpec: int16, rtrnState: PXkbStatePtr): TStatus{. - libx11c, importc: "XkbGetState".} -proc XkbSetMap*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): bool{.libx11c, importc: "XkbSetMap".} -proc XkbChangeMap*(dpy: PDisplay, desc: PXkbDescPtr, changes: PXkbMapChangesPtr): bool{. - libx11c, importc: "XkbChangeMap".} -proc XkbSetDetectableAutoRepeat*(dpy: PDisplay, detectable: bool, - supported: ptr bool): bool{.libx11c, importc: "XkbSetDetectableAutoRepeat".} -proc XkbGetDetectableAutoRepeat*(dpy: PDisplay, supported: ptr bool): bool{. - libx11c, importc: "XkbGetDetectableAutoRepeat".} -proc XkbSetAutoResetControls*(dpy: PDisplay, changes: int16, - auto_ctrls, auto_values: PWord): bool{.libx11c, importc: "XkbSetAutoResetControls".} -proc XkbGetAutoResetControls*(dpy: PDisplay, auto_ctrls, auto_ctrl_values: PWord): bool{. - libx11c, importc: "XkbGetAutoResetControls".} -proc XkbSetPerClientControls*(dpy: PDisplay, change: int16, values: PWord): bool{. - libx11c, importc: "XkbSetPerClientControls".} -proc XkbGetPerClientControls*(dpy: PDisplay, ctrls: PWord): bool{.libx11c, importc: "XkbGetPerClientControls".} -proc XkbCopyKeyType*(`from`, into: PXkbKeyTypePtr): TStatus{.libx11c, importc: "XkbCopyKeyType".} -proc XkbCopyKeyTypes*(`from`, into: PXkbKeyTypePtr, num_types: int16): TStatus{. - libx11c, importc: "XkbCopyKeyTypes".} -proc XkbResizeKeyType*(xkb: PXkbDescPtr, type_ndx, map_count: int16, - want_preserve: bool, new_num_lvls: int16): TStatus{. - libx11c, importc: "XkbResizeKeyType".} -proc XkbResizeKeySyms*(desc: PXkbDescPtr, forKey, symsNeeded: int16): PKeySym{. - libx11c, importc: "XkbResizeKeySyms".} -proc XkbResizeKeyActions*(desc: PXkbDescPtr, forKey, actsNeeded: int16): PXkbAction{. - libx11c, importc: "XkbResizeKeyActions".} -proc XkbChangeTypesOfKey*(xkb: PXkbDescPtr, key, num_groups: int16, - groups: int16, newTypes: ptr int16, - pChanges: PXkbMapChangesPtr): TStatus{.libx11c, importc: "XkbChangeTypesOfKey".} - -proc XkbListComponents*(dpy: PDisplay, deviceSpec: int16, - ptrns: PXkbComponentNamesPtr, max_inout: ptr int16): PXkbComponentListPtr{. - libx11c, importc: "XkbListComponents".} -proc XkbFreeComponentList*(list: PXkbComponentListPtr){.libx11c, - importc: "XkbFreeComponentList".} -proc XkbGetKeyboard*(dpy: PDisplay, which, deviceSpec: int16): PXkbDescPtr{. - libx11c, importc: "XkbGetKeyboard".} -proc XkbGetKeyboardByName*(dpy: PDisplay, deviceSpec: int16, - names: PXkbComponentNamesPtr, want, need: int16, - load: bool): PXkbDescPtr{.libx11c, - importc: "XkbGetKeyboardByName".} - -proc XkbKeyTypesForCoreSymbols*(xkb: PXkbDescPtr, - map_width: int16, # keyboard device - core_syms: PKeySym, # always mapWidth symbols - protected: int16, # explicit key types - types_inout: ptr int16, # always four type indices - xkb_syms_rtrn: PKeySym): int16{.libx11c, importc: "XkbKeyTypesForCoreSymbols".} - # must have enough space -proc XkbApplyCompatMapToKey*(xkb: PXkbDescPtr, - key: TKeyCode, # key to be updated - changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbApplyCompatMapToKey".} - # resulting changes to map -proc XkbUpdateMapFromCore*(xkb: PXkbDescPtr, - first_key: TKeyCode, # first changed key - num_keys, - map_width: int16, - core_keysyms: PKeySym, # symbols `from` core keymap - changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbUpdateMapFromCore".} - -proc XkbAddDeviceLedInfo*(devi: PXkbDeviceInfoPtr, ledClass, ledId: int16): PXkbDeviceLedInfoPtr{. - libx11c, importc: "XkbAddDeviceLedInfo".} -proc XkbResizeDeviceButtonActions*(devi: PXkbDeviceInfoPtr, newTotal: int16): TStatus{. - libx11c, importc: "XkbResizeDeviceButtonActions".} -proc XkbAllocDeviceInfo*(deviceSpec, nButtons, szLeds: int16): PXkbDeviceInfoPtr{. - libx11c, importc: "XkbAllocDeviceInfo".} -proc XkbFreeDeviceInfo*(devi: PXkbDeviceInfoPtr, which: int16, freeDevI: bool){. - libx11c, importc: "XkbFreeDeviceInfo".} -proc XkbNoteDeviceChanges*(old: PXkbDeviceChangesPtr, - new: PXkbExtensionDeviceNotifyEvent, wanted: int16){. - libx11c, importc: "XkbNoteDeviceChanges".} -proc XkbGetDeviceInfo*(dpy: PDisplay, which, deviceSpec, ledClass, ledID: int16): PXkbDeviceInfoPtr{. - libx11c, importc: "XkbGetDeviceInfo".} -proc XkbGetDeviceInfoChanges*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, - changes: PXkbDeviceChangesPtr): TStatus{.libx11c, importc: "XkbGetDeviceInfoChanges".} -proc XkbGetDeviceButtonActions*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, - all: bool, first, nBtns: int16): TStatus{.libx11c, importc: "XkbGetDeviceButtonActions".} -proc XkbGetDeviceLedInfo*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, - ledClass, ledId, which: int16): TStatus{.libx11c, importc: "XkbGetDeviceLedInfo".} -proc XkbSetDeviceInfo*(dpy: PDisplay, which: int16, devi: PXkbDeviceInfoPtr): bool{. - libx11c, importc: "XkbSetDeviceInfo".} -proc XkbChangeDeviceInfo*(dpy: PDisplay, desc: PXkbDeviceInfoPtr, - changes: PXkbDeviceChangesPtr): bool{.libx11c, importc: "XkbChangeDeviceInfo".} -proc XkbSetDeviceLedInfo*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, - ledClass, ledID, which: int16): bool{.libx11c, importc: "XkbSetDeviceLedInfo".} -proc XkbSetDeviceButtonActions*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, - first, nBtns: int16): bool{.libx11c, importc: "XkbSetDeviceButtonActions".} - -proc XkbToControl*(c: int8): int8{.libx11c, - importc: "XkbToControl".} - -proc XkbSetDebuggingFlags*(dpy: PDisplay, mask, flags: int16, msg: cstring, - ctrls_mask, ctrls, rtrn_flags, rtrn_ctrls: int16): bool{. - libx11c, importc: "XkbSetDebuggingFlags".} -proc XkbApplyVirtualModChanges*(xkb: PXkbDescPtr, changed: int16, - changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbApplyVirtualModChanges".} - -# implementation - -proc XkbNoteIndicatorMapChanges(o, n: PXkbIndicatorChangesPtr, w: int16) = - ##define XkbNoteIndicatorMapChanges(o,n,w) ((o)->map_changes|=((n)->map_changes&(w))) - o.map_changes = o.map_changes or (n.map_changes and w) - -proc XkbNoteIndicatorStateChanges(o, n: PXkbIndicatorChangesPtr, w: int16) = - ##define XkbNoteIndicatorStateChanges(o,n,w) ((o)->state_changes|=((n)->state_changes&(w))) - o.state_changes = o.state_changes or (n.state_changes and (w)) - -proc XkbGetIndicatorMapChanges(d: PDisplay, x: PXkbDescPtr, - c: PXkbIndicatorChangesPtr): TStatus = - ##define XkbGetIndicatorMapChanges(d,x,c) (XkbGetIndicatorMap((d),(c)->map_changes,x) - Result = XkbGetIndicatorMap(d, c.map_changes, x) - -proc XkbChangeIndicatorMaps(d: PDisplay, x: PXkbDescPtr, - c: PXkbIndicatorChangesPtr): bool = - ##define XkbChangeIndicatorMaps(d,x,c) (XkbSetIndicatorMap((d),(c)->map_changes,x)) - Result = XkbSetIndicatorMap(d, c.map_changes, x) - -proc XkbGetControlsChanges(d: PDisplay, x: PXkbDescPtr, - c: PXkbControlsChangesPtr): TStatus = - ##define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x) - Result = XkbGetControls(d, c.changed_ctrls, x) - -proc XkbChangeControls(d: PDisplay, x: PXkbDescPtr, c: PXkbControlsChangesPtr): bool = - ##define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x) - Result = XkbSetControls(d, c.changed_ctrls, x) diff --git a/lib/wrappers/x11/xlib.nim b/lib/wrappers/x11/xlib.nim deleted file mode 100644 index 5ccacdd451..0000000000 --- a/lib/wrappers/x11/xlib.nim +++ /dev/null @@ -1,2027 +0,0 @@ - -import - x - -include "x11pragma.nim" - -type - cunsigned* = cint - Pcint* = ptr cint - PPcint* = ptr Pcint - PPcuchar* = ptr ptr cuchar - PWideChar* = ptr int16 - PPChar* = ptr cstring - PPPChar* = ptr ptr cstring - Pculong* = ptr culong - Pcuchar* = cstring - Pcuint* = ptr cuint - Pcushort* = ptr uint16 -# Automatically converted by H2Pas 0.99.15 from xlib.h -# The following command line parameters were used: -# -p -# -T -# -S -# -d -# -c -# xlib.h - -const - XlibSpecificationRelease* = 6 - -type - PXPointer* = ptr TXPointer - TXPointer* = ptr char - PBool* = ptr TBool - TBool* = int #cint? - PStatus* = ptr TStatus - TStatus* = cint - -const - QueuedAlready* = 0 - QueuedAfterReading* = 1 - QueuedAfterFlush* = 2 - -type - PPXExtData* = ptr PXExtData - PXExtData* = ptr TXExtData - TXExtData*{.final.} = object - number*: cint - next*: PXExtData - free_private*: proc (extension: PXExtData): cint{.cdecl.} - private_data*: TXPointer - - PXExtCodes* = ptr TXExtCodes - TXExtCodes*{.final.} = object - extension*: cint - major_opcode*: cint - first_event*: cint - first_error*: cint - - PXPixmapFormatValues* = ptr TXPixmapFormatValues - TXPixmapFormatValues*{.final.} = object - depth*: cint - bits_per_pixel*: cint - scanline_pad*: cint - - PXGCValues* = ptr TXGCValues - TXGCValues*{.final.} = object - function*: cint - plane_mask*: culong - foreground*: culong - background*: culong - line_width*: cint - line_style*: cint - cap_style*: cint - join_style*: cint - fill_style*: cint - fill_rule*: cint - arc_mode*: cint - tile*: TPixmap - stipple*: TPixmap - ts_x_origin*: cint - ts_y_origin*: cint - font*: TFont - subwindow_mode*: cint - graphics_exposures*: TBool - clip_x_origin*: cint - clip_y_origin*: cint - clip_mask*: TPixmap - dash_offset*: cint - dashes*: cchar - - PXGC* = ptr TXGC - TXGC*{.final.} = object - TGC* = PXGC - PGC* = ptr TGC - PVisual* = ptr TVisual - TVisual*{.final.} = object - ext_data*: PXExtData - visualid*: TVisualID - c_class*: cint - red_mask*, green_mask*, blue_mask*: culong - bits_per_rgb*: cint - map_entries*: cint - - PDepth* = ptr TDepth - TDepth*{.final.} = object - depth*: cint - nvisuals*: cint - visuals*: PVisual - - PXDisplay* = ptr TXDisplay - TXDisplay*{.final.} = object - PScreen* = ptr TScreen - TScreen*{.final.} = object - ext_data*: PXExtData - display*: PXDisplay - root*: TWindow - width*, height*: cint - mwidth*, mheight*: cint - ndepths*: cint - depths*: PDepth - root_depth*: cint - root_visual*: PVisual - default_gc*: TGC - cmap*: TColormap - white_pixel*: culong - black_pixel*: culong - max_maps*, min_maps*: cint - backing_store*: cint - save_unders*: TBool - root_input_mask*: clong - - PScreenFormat* = ptr TScreenFormat - TScreenFormat*{.final.} = object - ext_data*: PXExtData - depth*: cint - bits_per_pixel*: cint - scanline_pad*: cint - - PXSetWindowAttributes* = ptr TXSetWindowAttributes - TXSetWindowAttributes*{.final.} = object - background_pixmap*: TPixmap - background_pixel*: culong - border_pixmap*: TPixmap - border_pixel*: culong - bit_gravity*: cint - win_gravity*: cint - backing_store*: cint - backing_planes*: culong - backing_pixel*: culong - save_under*: TBool - event_mask*: clong - do_not_propagate_mask*: clong - override_redirect*: TBool - colormap*: TColormap - cursor*: TCursor - - PXWindowAttributes* = ptr TXWindowAttributes - TXWindowAttributes*{.final.} = object - x*, y*: cint - width*, height*: cint - border_width*: cint - depth*: cint - visual*: PVisual - root*: TWindow - c_class*: cint - bit_gravity*: cint - win_gravity*: cint - backing_store*: cint - backing_planes*: culong - backing_pixel*: culong - save_under*: TBool - colormap*: TColormap - map_installed*: TBool - map_state*: cint - all_event_masks*: clong - your_event_mask*: clong - do_not_propagate_mask*: clong - override_redirect*: TBool - screen*: PScreen - - PXHostAddress* = ptr TXHostAddress - TXHostAddress*{.final.} = object - family*: cint - len*: cint - address*: cstring - - PXServerInterpretedAddress* = ptr TXServerInterpretedAddress - TXServerInterpretedAddress*{.final.} = object - typelength*: cint - valuelength*: cint - theType*: cstring - value*: cstring - - PXImage* = ptr TXImage - TF*{.final.} = object - create_image*: proc (para1: PXDisplay, para2: PVisual, para3: cuint, - para4: cint, para5: cint, para6: cstring, para7: cuint, - para8: cuint, para9: cint, para10: cint): PXImage{. - cdecl.} - destroy_image*: proc (para1: PXImage): cint{.cdecl.} - get_pixel*: proc (para1: PXImage, para2: cint, para3: cint): culong{.cdecl.} - put_pixel*: proc (para1: PXImage, para2: cint, para3: cint, para4: culong): cint{. - cdecl.} - sub_image*: proc (para1: PXImage, para2: cint, para3: cint, para4: cuint, - para5: cuint): PXImage{.cdecl.} - add_pixel*: proc (para1: PXImage, para2: clong): cint{.cdecl.} - - TXImage*{.final.} = object - width*, height*: cint - xoffset*: cint - format*: cint - data*: cstring - byte_order*: cint - bitmap_unit*: cint - bitmap_bit_order*: cint - bitmap_pad*: cint - depth*: cint - bytes_per_line*: cint - bits_per_pixel*: cint - red_mask*: culong - green_mask*: culong - blue_mask*: culong - obdata*: TXPointer - f*: TF - - PXWindowChanges* = ptr TXWindowChanges - TXWindowChanges*{.final.} = object - x*, y*: cint - width*, height*: cint - border_width*: cint - sibling*: TWindow - stack_mode*: cint - - PXColor* = ptr TXColor - TXColor*{.final.} = object - pixel*: culong - red*, green*, blue*: cushort - flags*: cchar - pad*: cchar - - PXSegment* = ptr TXSegment - TXSegment*{.final.} = object - x1*, y1*, x2*, y2*: cshort - - PXPoint* = ptr TXPoint - TXPoint*{.final.} = object - x*, y*: cshort - - PXRectangle* = ptr TXRectangle - TXRectangle*{.final.} = object - x*, y*: cshort - width*, height*: cushort - - PXArc* = ptr TXArc - TXArc*{.final.} = object - x*, y*: cshort - width*, height*: cushort - angle1*, angle2*: cshort - - PXKeyboardControl* = ptr TXKeyboardControl - TXKeyboardControl*{.final.} = object - key_click_percent*: cint - bell_percent*: cint - bell_pitch*: cint - bell_duration*: cint - led*: cint - led_mode*: cint - key*: cint - auto_repeat_mode*: cint - - PXKeyboardState* = ptr TXKeyboardState - TXKeyboardState*{.final.} = object - key_click_percent*: cint - bell_percent*: cint - bell_pitch*, bell_duration*: cuint - led_mask*: culong - global_auto_repeat*: cint - auto_repeats*: array[0..31, cchar] - - PXTimeCoord* = ptr TXTimeCoord - TXTimeCoord*{.final.} = object - time*: TTime - x*, y*: cshort - - PXModifierKeymap* = ptr TXModifierKeymap - TXModifierKeymap*{.final.} = object - max_keypermod*: cint - modifiermap*: PKeyCode - - PDisplay* = ptr TDisplay - TDisplay* = TXDisplay - PXPrivate* = ptr TXPrivate - TXPrivate*{.final.} = object - PXrmHashBucketRec* = ptr TXrmHashBucketRec - TXrmHashBucketRec*{.final.} = object - PXPrivDisplay* = ptr TXPrivDisplay - TXPrivDisplay*{.final.} = object - ext_data*: PXExtData - private1*: PXPrivate - fd*: cint - private2*: cint - proto_major_version*: cint - proto_minor_version*: cint - vendor*: cstring - private3*: TXID - private4*: TXID - private5*: TXID - private6*: cint - resource_alloc*: proc (para1: PXDisplay): TXID{.cdecl.} - byte_order*: cint - bitmap_unit*: cint - bitmap_pad*: cint - bitmap_bit_order*: cint - nformats*: cint - pixmap_format*: PScreenFormat - private8*: cint - release*: cint - private9*, private10*: PXPrivate - qlen*: cint - last_request_read*: culong - request*: culong - private11*: TXPointer - private12*: TXPointer - private13*: TXPointer - private14*: TXPointer - max_request_size*: cunsigned - db*: PXrmHashBucketRec - private15*: proc (para1: PXDisplay): cint{.cdecl.} - display_name*: cstring - default_screen*: cint - nscreens*: cint - screens*: PScreen - motion_buffer*: culong - private16*: culong - min_keycode*: cint - max_keycode*: cint - private17*: TXPointer - private18*: TXPointer - private19*: cint - xdefaults*: cstring - - PXKeyEvent* = ptr TXKeyEvent - TXKeyEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - root*: TWindow - subwindow*: TWindow - time*: TTime - x*, y*: cint - x_root*, y_root*: cint - state*: cuint - keycode*: cuint - same_screen*: TBool - - PXKeyPressedEvent* = ptr TXKeyPressedEvent - TXKeyPressedEvent* = TXKeyEvent - PXKeyReleasedEvent* = ptr TXKeyReleasedEvent - TXKeyReleasedEvent* = TXKeyEvent - PXButtonEvent* = ptr TXButtonEvent - TXButtonEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - root*: TWindow - subwindow*: TWindow - time*: TTime - x*, y*: cint - x_root*, y_root*: cint - state*: cuint - button*: cuint - same_screen*: TBool - - PXButtonPressedEvent* = ptr TXButtonPressedEvent - TXButtonPressedEvent* = TXButtonEvent - PXButtonReleasedEvent* = ptr TXButtonReleasedEvent - TXButtonReleasedEvent* = TXButtonEvent - PXMotionEvent* = ptr TXMotionEvent - TXMotionEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - root*: TWindow - subwindow*: TWindow - time*: TTime - x*, y*: cint - x_root*, y_root*: cint - state*: cuint - is_hint*: cchar - same_screen*: TBool - - PXPointerMovedEvent* = ptr TXPointerMovedEvent - TXPointerMovedEvent* = TXMotionEvent - PXCrossingEvent* = ptr TXCrossingEvent - TXCrossingEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - root*: TWindow - subwindow*: TWindow - time*: TTime - x*, y*: cint - x_root*, y_root*: cint - mode*: cint - detail*: cint - same_screen*: TBool - focus*: TBool - state*: cuint - - PXEnterWindowEvent* = ptr TXEnterWindowEvent - TXEnterWindowEvent* = TXCrossingEvent - PXLeaveWindowEvent* = ptr TXLeaveWindowEvent - TXLeaveWindowEvent* = TXCrossingEvent - PXFocusChangeEvent* = ptr TXFocusChangeEvent - TXFocusChangeEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - mode*: cint - detail*: cint - - PXFocusInEvent* = ptr TXFocusInEvent - TXFocusInEvent* = TXFocusChangeEvent - PXFocusOutEvent* = ptr TXFocusOutEvent - TXFocusOutEvent* = TXFocusChangeEvent - PXKeymapEvent* = ptr TXKeymapEvent - TXKeymapEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - key_vector*: array[0..31, cchar] - - PXExposeEvent* = ptr TXExposeEvent - TXExposeEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - x*, y*: cint - width*, height*: cint - count*: cint - - PXGraphicsExposeEvent* = ptr TXGraphicsExposeEvent - TXGraphicsExposeEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - drawable*: TDrawable - x*, y*: cint - width*, height*: cint - count*: cint - major_code*: cint - minor_code*: cint - - PXNoExposeEvent* = ptr TXNoExposeEvent - TXNoExposeEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - drawable*: TDrawable - major_code*: cint - minor_code*: cint - - PXVisibilityEvent* = ptr TXVisibilityEvent - TXVisibilityEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - state*: cint - - PXCreateWindowEvent* = ptr TXCreateWindowEvent - TXCreateWindowEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - parent*: TWindow - window*: TWindow - x*, y*: cint - width*, height*: cint - border_width*: cint - override_redirect*: TBool - - PXDestroyWindowEvent* = ptr TXDestroyWindowEvent - TXDestroyWindowEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - event*: TWindow - window*: TWindow - - PXUnmapEvent* = ptr TXUnmapEvent - TXUnmapEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - event*: TWindow - window*: TWindow - from_configure*: TBool - - PXMapEvent* = ptr TXMapEvent - TXMapEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - event*: TWindow - window*: TWindow - override_redirect*: TBool - - PXMapRequestEvent* = ptr TXMapRequestEvent - TXMapRequestEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - parent*: TWindow - window*: TWindow - - PXReparentEvent* = ptr TXReparentEvent - TXReparentEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - event*: TWindow - window*: TWindow - parent*: TWindow - x*, y*: cint - override_redirect*: TBool - - PXConfigureEvent* = ptr TXConfigureEvent - TXConfigureEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - event*: TWindow - window*: TWindow - x*, y*: cint - width*, height*: cint - border_width*: cint - above*: TWindow - override_redirect*: TBool - - PXGravityEvent* = ptr TXGravityEvent - TXGravityEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - event*: TWindow - window*: TWindow - x*, y*: cint - - PXResizeRequestEvent* = ptr TXResizeRequestEvent - TXResizeRequestEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - width*, height*: cint - - PXConfigureRequestEvent* = ptr TXConfigureRequestEvent - TXConfigureRequestEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - parent*: TWindow - window*: TWindow - x*, y*: cint - width*, height*: cint - border_width*: cint - above*: TWindow - detail*: cint - value_mask*: culong - - PXCirculateEvent* = ptr TXCirculateEvent - TXCirculateEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - event*: TWindow - window*: TWindow - place*: cint - - PXCirculateRequestEvent* = ptr TXCirculateRequestEvent - TXCirculateRequestEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - parent*: TWindow - window*: TWindow - place*: cint - - PXPropertyEvent* = ptr TXPropertyEvent - TXPropertyEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - atom*: TAtom - time*: TTime - state*: cint - - PXSelectionClearEvent* = ptr TXSelectionClearEvent - TXSelectionClearEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - selection*: TAtom - time*: TTime - - PXSelectionRequestEvent* = ptr TXSelectionRequestEvent - TXSelectionRequestEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - owner*: TWindow - requestor*: TWindow - selection*: TAtom - target*: TAtom - property*: TAtom - time*: TTime - - PXSelectionEvent* = ptr TXSelectionEvent - TXSelectionEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - requestor*: TWindow - selection*: TAtom - target*: TAtom - property*: TAtom - time*: TTime - - PXColormapEvent* = ptr TXColormapEvent - TXColormapEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - colormap*: TColormap - c_new*: TBool - state*: cint - - PXClientMessageEvent* = ptr TXClientMessageEvent - TXClientMessageEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - message_type*: TAtom - format*: cint - data*: array[0..4, clong] # using clong here to be 32/64-bit dependent - # as the original C union - - PXMappingEvent* = ptr TXMappingEvent - TXMappingEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - request*: cint - first_keycode*: cint - count*: cint - - PXErrorEvent* = ptr TXErrorEvent - TXErrorEvent*{.final.} = object - theType*: cint - display*: PDisplay - resourceid*: TXID - serial*: culong - error_code*: cuchar - request_code*: cuchar - minor_code*: cuchar - - PXAnyEvent* = ptr TXAnyEvent - TXAnyEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - window*: TWindow - - PXEvent* = ptr TXEvent - TXEvent*{.final.} = object - theType*: cint - pad*: array[0..22, clong] # - # case longint of - # 0 : ( theType : cint ); - # 1 : ( xany : TXAnyEvent ); - # 2 : ( xkey : TXKeyEvent ); - # 3 : ( xbutton : TXButtonEvent ); - # 4 : ( xmotion : TXMotionEvent ); - # 5 : ( xcrossing : TXCrossingEvent ); - # 6 : ( xfocus : TXFocusChangeEvent ); - # 7 : ( xexpose : TXExposeEvent ); - # 8 : ( xgraphicsexpose : TXGraphicsExposeEvent ); - # 9 : ( xnoexpose : TXNoExposeEvent ); - # 10 : ( xvisibility : TXVisibilityEvent ); - # 11 : ( xcreatewindow : TXCreateWindowEvent ); - # 12 : ( xdestroywindow : TXDestroyWindowEvent ); - # 13 : ( xunmap : TXUnmapEvent ); - # 14 : ( xmap : TXMapEvent ); - # 15 : ( xmaprequest : TXMapRequestEvent ); - # 16 : ( xreparent : TXReparentEvent ); - # 17 : ( xconfigure : TXConfigureEvent ); - # 18 : ( xgravity : TXGravityEvent ); - # 19 : ( xresizerequest : TXResizeRequestEvent ); - # 20 : ( xconfigurerequest : TXConfigureRequestEvent ); - # 21 : ( xcirculate : TXCirculateEvent ); - # 22 : ( xcirculaterequest : TXCirculateRequestEvent ); - # 23 : ( xproperty : TXPropertyEvent ); - # 24 : ( xselectionclear : TXSelectionClearEvent ); - # 25 : ( xselectionrequest : TXSelectionRequestEvent ); - # 26 : ( xselection : TXSelectionEvent ); - # 27 : ( xcolormap : TXColormapEvent ); - # 28 : ( xclient : TXClientMessageEvent ); - # 29 : ( xmapping : TXMappingEvent ); - # 30 : ( xerror : TXErrorEvent ); - # 31 : ( xkeymap : TXKeymapEvent ); - # 32 : ( pad : array[0..23] of clong ); - # - - -proc xclient*(e: PXEvent): PXClientMessageEvent = - ## Treats XEvent as XClientMessageEvent - return cast[PXClientMessageEvent](e) - -proc xclient*(e: var TXEvent): PXClientMessageEvent = - return xclient(PXEvent(e.addr)) - -type - PXCharStruct* = ptr TXCharStruct - TXCharStruct*{.final.} = object - lbearing*: cshort - rbearing*: cshort - width*: cshort - ascent*: cshort - descent*: cshort - attributes*: cushort - - PXFontProp* = ptr TXFontProp - TXFontProp*{.final.} = object - name*: TAtom - card32*: culong - - PPPXFontStruct* = ptr PPXFontStruct - PPXFontStruct* = ptr PXFontStruct - PXFontStruct* = ptr TXFontStruct - TXFontStruct*{.final.} = object - ext_data*: PXExtData - fid*: TFont - direction*: cunsigned - min_char_or_byte2*: cunsigned - max_char_or_byte2*: cunsigned - min_byte1*: cunsigned - max_byte1*: cunsigned - all_chars_exist*: TBool - default_char*: cunsigned - n_properties*: cint - properties*: PXFontProp - min_bounds*: TXCharStruct - max_bounds*: TXCharStruct - per_char*: PXCharStruct - ascent*: cint - descent*: cint - - PXTextItem* = ptr TXTextItem - TXTextItem*{.final.} = object - chars*: cstring - nchars*: cint - delta*: cint - font*: TFont - - PXChar2b* = ptr TXChar2b - TXChar2b*{.final.} = object - byte1*: cuchar - byte2*: cuchar - - PXTextItem16* = ptr TXTextItem16 - TXTextItem16*{.final.} = object - chars*: PXChar2b - nchars*: cint - delta*: cint - font*: TFont - - PXEDataObject* = ptr TXEDataObject - TXEDataObject*{.final.} = object - display*: PDisplay #case longint of - # 0 : ( display : PDisplay ); - # 1 : ( gc : TGC ); - # 2 : ( visual : PVisual ); - # 3 : ( screen : PScreen ); - # 4 : ( pixmap_format : PScreenFormat ); - # 5 : ( font : PXFontStruct ); - - PXFontSetExtents* = ptr TXFontSetExtents - TXFontSetExtents*{.final.} = object - max_ink_extent*: TXRectangle - max_logical_extent*: TXRectangle - - PXOM* = ptr TXOM - TXOM*{.final.} = object - PXOC* = ptr TXOC - TXOC*{.final.} = object - TXFontSet* = PXOC - PXFontSet* = ptr TXFontSet - PXmbTextItem* = ptr TXmbTextItem - TXmbTextItem*{.final.} = object - chars*: cstring - nchars*: cint - delta*: cint - font_set*: TXFontSet - - PXwcTextItem* = ptr TXwcTextItem - TXwcTextItem*{.final.} = object - chars*: PWideChar #wchar_t* - nchars*: cint - delta*: cint - font_set*: TXFontSet - - -const - XNRequiredCharSet* = "requiredCharSet" - XNQueryOrientation* = "queryOrientation" - XNBaseFontName* = "baseFontName" - XNOMAutomatic* = "omAutomatic" - XNMissingCharSet* = "missingCharSet" - XNDefaultString* = "defaultString" - XNOrientation* = "orientation" - XNDirectionalDependentDrawing* = "directionalDependentDrawing" - XNContextualDrawing* = "contextualDrawing" - XNFontInfo* = "fontInfo" - -type - PXOMCharSetList* = ptr TXOMCharSetList - TXOMCharSetList*{.final.} = object - charset_count*: cint - charset_list*: PPChar - - PXOrientation* = ptr TXOrientation - TXOrientation* = enum - XOMOrientation_LTR_TTB, XOMOrientation_RTL_TTB, XOMOrientation_TTB_LTR, - XOMOrientation_TTB_RTL, XOMOrientation_Context - PXOMOrientation* = ptr TXOMOrientation - TXOMOrientation*{.final.} = object - num_orientation*: cint - orientation*: PXOrientation - - PXOMFontInfo* = ptr TXOMFontInfo - TXOMFontInfo*{.final.} = object - num_font*: cint - font_struct_list*: ptr PXFontStruct - font_name_list*: PPChar - - PXIM* = ptr TXIM - TXIM*{.final.} = object - PXIC* = ptr TXIC - TXIC*{.final.} = object - TXIMProc* = proc (para1: TXIM, para2: TXPointer, para3: TXPointer){.cdecl.} - TXICProc* = proc (para1: TXIC, para2: TXPointer, para3: TXPointer): TBool{. - cdecl.} - TXIDProc* = proc (para1: PDisplay, para2: TXPointer, para3: TXPointer){.cdecl.} - PXIMStyle* = ptr TXIMStyle - TXIMStyle* = culong - PXIMStyles* = ptr TXIMStyles - TXIMStyles*{.final.} = object - count_styles*: cushort - supported_styles*: PXIMStyle - - -const - XIMPreeditArea* = 0x00000001 - XIMPreeditCallbacks* = 0x00000002 - XIMPreeditPosition* = 0x00000004 - XIMPreeditNothing* = 0x00000008 - XIMPreeditNone* = 0x00000010 - XIMStatusArea* = 0x00000100 - XIMStatusCallbacks* = 0x00000200 - XIMStatusNothing* = 0x00000400 - XIMStatusNone* = 0x00000800 - XNVaNestedList* = "XNVaNestedList" - XNQueryInputStyle* = "queryInputStyle" - XNClientWindow* = "clientWindow" - XNInputStyle* = "inputStyle" - XNFocusWindow* = "focusWindow" - XNResourceName* = "resourceName" - XNResourceClass* = "resourceClass" - XNGeometryCallback* = "geometryCallback" - XNDestroyCallback* = "destroyCallback" - XNFilterEvents* = "filterEvents" - XNPreeditStartCallback* = "preeditStartCallback" - XNPreeditDoneCallback* = "preeditDoneCallback" - XNPreeditDrawCallback* = "preeditDrawCallback" - XNPreeditCaretCallback* = "preeditCaretCallback" - XNPreeditStateNotifyCallback* = "preeditStateNotifyCallback" - XNPreeditAttributes* = "preeditAttributes" - XNStatusStartCallback* = "statusStartCallback" - XNStatusDoneCallback* = "statusDoneCallback" - XNStatusDrawCallback* = "statusDrawCallback" - XNStatusAttributes* = "statusAttributes" - XNArea* = "area" - XNAreaNeeded* = "areaNeeded" - XNSpotLocation* = "spotLocation" - XNColormap* = "colorMap" - XNStdColormap* = "stdColorMap" - XNForeground* = "foreground" - XNBackground* = "background" - XNBackgroundPixmap* = "backgroundPixmap" - XNFontSet* = "fontSet" - XNLineSpace* = "lineSpace" - XNCursor* = "cursor" - XNQueryIMValuesList* = "queryIMValuesList" - XNQueryICValuesList* = "queryICValuesList" - XNVisiblePosition* = "visiblePosition" - XNR6PreeditCallback* = "r6PreeditCallback" - XNStringConversionCallback* = "stringConversionCallback" - XNStringConversion* = "stringConversion" - XNResetState* = "resetState" - XNHotKey* = "hotKey" - XNHotKeyState* = "hotKeyState" - XNPreeditState* = "preeditState" - XNSeparatorofNestedList* = "separatorofNestedList" - XBufferOverflow* = - (1) - XLookupNone* = 1 - XLookupChars* = 2 - XLookupKeySymVal* = 3 - XLookupBoth* = 4 - -type - PXVaNestedList* = ptr TXVaNestedList - TXVaNestedList* = pointer - PXIMCallback* = ptr TXIMCallback - TXIMCallback*{.final.} = object - client_data*: TXPointer - callback*: TXIMProc - - PXICCallback* = ptr TXICCallback - TXICCallback*{.final.} = object - client_data*: TXPointer - callback*: TXICProc - - PXIMFeedback* = ptr TXIMFeedback - TXIMFeedback* = culong - -const - XIMReverse* = 1 - XIMUnderline* = 1 shl 1 - XIMHighlight* = 1 shl 2 - XIMPrimary* = 1 shl 5 - XIMSecondary* = 1 shl 6 - XIMTertiary* = 1 shl 7 - XIMVisibleToForward* = 1 shl 8 - XIMVisibleToBackword* = 1 shl 9 - XIMVisibleToCenter* = 1 shl 10 - -type - PXIMText* = ptr TXIMText - TXIMText*{.final.} = object - len*: cushort - feedback*: PXIMFeedback - encoding_is_wchar*: TBool - multi_byte*: cstring - - PXIMPreeditState* = ptr TXIMPreeditState - TXIMPreeditState* = culong - -const - XIMPreeditUnKnown* = 0 - XIMPreeditEnable* = 1 - XIMPreeditDisable* = 1 shl 1 - -type - PXIMPreeditStateNotifyCallbackStruct* = ptr TXIMPreeditStateNotifyCallbackStruct - TXIMPreeditStateNotifyCallbackStruct*{.final.} = object - state*: TXIMPreeditState - - PXIMResetState* = ptr TXIMResetState - TXIMResetState* = culong - -const - XIMInitialState* = 1 - XIMPreserveState* = 1 shl 1 - -type - PXIMStringConversionFeedback* = ptr TXIMStringConversionFeedback - TXIMStringConversionFeedback* = culong - -const - XIMStringConversionLeftEdge* = 0x00000001 - XIMStringConversionRightEdge* = 0x00000002 - XIMStringConversionTopEdge* = 0x00000004 - XIMStringConversionBottomEdge* = 0x00000008 - XIMStringConversionConcealed* = 0x00000010 - XIMStringConversionWrapped* = 0x00000020 - -type - PXIMStringConversionText* = ptr TXIMStringConversionText - TXIMStringConversionText*{.final.} = object - len*: cushort - feedback*: PXIMStringConversionFeedback - encoding_is_wchar*: TBool - mbs*: cstring - - PXIMStringConversionPosition* = ptr TXIMStringConversionPosition - TXIMStringConversionPosition* = cushort - PXIMStringConversionType* = ptr TXIMStringConversionType - TXIMStringConversionType* = cushort - -const - XIMStringConversionBuffer* = 0x00000001 - XIMStringConversionLine* = 0x00000002 - XIMStringConversionWord* = 0x00000003 - XIMStringConversionChar* = 0x00000004 - -type - PXIMStringConversionOperation* = ptr TXIMStringConversionOperation - TXIMStringConversionOperation* = cushort - -const - XIMStringConversionSubstitution* = 0x00000001 - XIMStringConversionRetrieval* = 0x00000002 - -type - PXIMCaretDirection* = ptr TXIMCaretDirection - TXIMCaretDirection* = enum - XIMForwardChar, XIMBackwardChar, XIMForwardWord, XIMBackwardWord, - XIMCaretUp, XIMCaretDown, XIMNextLine, XIMPreviousLine, XIMLineStart, - XIMLineEnd, XIMAbsolutePosition, XIMDontChange - PXIMStringConversionCallbackStruct* = ptr TXIMStringConversionCallbackStruct - TXIMStringConversionCallbackStruct*{.final.} = object - position*: TXIMStringConversionPosition - direction*: TXIMCaretDirection - operation*: TXIMStringConversionOperation - factor*: cushort - text*: PXIMStringConversionText - - PXIMPreeditDrawCallbackStruct* = ptr TXIMPreeditDrawCallbackStruct - TXIMPreeditDrawCallbackStruct*{.final.} = object - caret*: cint - chg_first*: cint - chg_length*: cint - text*: PXIMText - - PXIMCaretStyle* = ptr TXIMCaretStyle - TXIMCaretStyle* = enum - XIMIsInvisible, XIMIsPrimary, XIMIsSecondary - PXIMPreeditCaretCallbackStruct* = ptr TXIMPreeditCaretCallbackStruct - TXIMPreeditCaretCallbackStruct*{.final.} = object - position*: cint - direction*: TXIMCaretDirection - style*: TXIMCaretStyle - - PXIMStatusDataType* = ptr TXIMStatusDataType - TXIMStatusDataType* = enum - XIMTextType, XIMBitmapType - PXIMStatusDrawCallbackStruct* = ptr TXIMStatusDrawCallbackStruct - TXIMStatusDrawCallbackStruct*{.final.} = object - theType*: TXIMStatusDataType - bitmap*: TPixmap - - PXIMHotKeyTrigger* = ptr TXIMHotKeyTrigger - TXIMHotKeyTrigger*{.final.} = object - keysym*: TKeySym - modifier*: cint - modifier_mask*: cint - - PXIMHotKeyTriggers* = ptr TXIMHotKeyTriggers - TXIMHotKeyTriggers*{.final.} = object - num_hot_key*: cint - key*: PXIMHotKeyTrigger - - PXIMHotKeyState* = ptr TXIMHotKeyState - TXIMHotKeyState* = culong - -const - XIMHotKeyStateON* = 0x00000001 - XIMHotKeyStateOFF* = 0x00000002 - -type - PXIMValuesList* = ptr TXIMValuesList - TXIMValuesList*{.final.} = object - count_values*: cushort - supported_values*: PPChar - - -type - funcdisp* = proc (display: PDisplay): cint{.cdecl.} - funcifevent* = proc (display: PDisplay, event: PXEvent, p: TXPointer): TBool{. - cdecl.} - chararr32* = array[0..31, char] - -const - AllPlanes*: culong = culong(not 0) - -proc XLoadQueryFont*(para1: PDisplay, para2: cstring): PXFontStruct{.libx11.} -proc XQueryFont*(para1: PDisplay, para2: TXID): PXFontStruct{.libx11.} -proc XGetMotionEvents*(para1: PDisplay, para2: TWindow, para3: TTime, - para4: TTime, para5: Pcint): PXTimeCoord{.libx11.} -proc XDeleteModifiermapEntry*(para1: PXModifierKeymap, para2: TKeyCode, - para3: cint): PXModifierKeymap{.libx11.} -proc XGetModifierMapping*(para1: PDisplay): PXModifierKeymap{.libx11.} -proc XInsertModifiermapEntry*(para1: PXModifierKeymap, para2: TKeyCode, - para3: cint): PXModifierKeymap{.libx11.} -proc XNewModifiermap*(para1: cint): PXModifierKeymap{.libx11.} -proc XCreateImage*(para1: PDisplay, para2: PVisual, para3: cuint, para4: cint, - para5: cint, para6: cstring, para7: cuint, para8: cuint, - para9: cint, para10: cint): PXImage{.libx11.} -proc XInitImage*(para1: PXImage): TStatus{.libx11.} -proc XGetImage*(para1: PDisplay, para2: TDrawable, para3: cint, para4: cint, - para5: cuint, para6: cuint, para7: culong, para8: cint): PXImage{. - libx11.} -proc XGetSubImage*(para1: PDisplay, para2: TDrawable, para3: cint, para4: cint, - para5: cuint, para6: cuint, para7: culong, para8: cint, - para9: PXImage, para10: cint, para11: cint): PXImage{.libx11.} -proc XOpenDisplay*(para1: cstring): PDisplay{.libx11.} -proc XrmInitialize*(){.libx11.} -proc XFetchBytes*(para1: PDisplay, para2: Pcint): cstring{.libx11.} -proc XFetchBuffer*(para1: PDisplay, para2: Pcint, para3: cint): cstring{.libx11.} -proc XGetAtomName*(para1: PDisplay, para2: TAtom): cstring{.libx11.} -proc XGetAtomNames*(para1: PDisplay, para2: PAtom, para3: cint, para4: PPchar): TStatus{. - libx11.} -proc XGetDefault*(para1: PDisplay, para2: cstring, para3: cstring): cstring{. - libx11.} -proc XDisplayName*(para1: cstring): cstring{.libx11.} -proc XKeysymToString*(para1: TKeySym): cstring{.libx11.} -proc XSynchronize*(para1: PDisplay, para2: TBool): funcdisp{.libx11.} -proc XSetAfterFunction*(para1: PDisplay, para2: funcdisp): funcdisp{.libx11.} -proc XInternAtom*(para1: PDisplay, para2: cstring, para3: TBool): TAtom{.libx11.} -proc XInternAtoms*(para1: PDisplay, para2: PPchar, para3: cint, para4: TBool, - para5: PAtom): TStatus{.libx11.} -proc XCopyColormapAndFree*(para1: PDisplay, para2: TColormap): TColormap{.libx11.} -proc XCreateColormap*(para1: PDisplay, para2: TWindow, para3: PVisual, - para4: cint): TColormap{.libx11.} -proc XCreatePixmapCursor*(para1: PDisplay, para2: TPixmap, para3: TPixmap, - para4: PXColor, para5: PXColor, para6: cuint, - para7: cuint): TCursor{.libx11.} -proc XCreateGlyphCursor*(para1: PDisplay, para2: TFont, para3: TFont, - para4: cuint, para5: cuint, para6: PXColor, - para7: PXColor): TCursor{.libx11.} -proc XCreateFontCursor*(para1: PDisplay, para2: cuint): TCursor{.libx11.} -proc XLoadFont*(para1: PDisplay, para2: cstring): TFont{.libx11.} -proc XCreateGC*(para1: PDisplay, para2: TDrawable, para3: culong, - para4: PXGCValues): TGC{.libx11.} -proc XGContextFromGC*(para1: TGC): TGContext{.libx11.} -proc XFlushGC*(para1: PDisplay, para2: TGC){.libx11.} -proc XCreatePixmap*(para1: PDisplay, para2: TDrawable, para3: cuint, - para4: cuint, para5: cuint): TPixmap{.libx11.} -proc XCreateBitmapFromData*(para1: PDisplay, para2: TDrawable, para3: cstring, - para4: cuint, para5: cuint): TPixmap{.libx11.} -proc XCreatePixmapFromBitmapData*(para1: PDisplay, para2: TDrawable, - para3: cstring, para4: cuint, para5: cuint, - para6: culong, para7: culong, para8: cuint): TPixmap{. - libx11.} -proc XCreateSimpleWindow*(para1: PDisplay, para2: TWindow, para3: cint, - para4: cint, para5: cuint, para6: cuint, para7: cuint, - para8: culong, para9: culong): TWindow{.libx11.} -proc XGetSelectionOwner*(para1: PDisplay, para2: TAtom): TWindow{.libx11.} -proc XCreateWindow*(para1: PDisplay, para2: TWindow, para3: cint, para4: cint, - para5: cuint, para6: cuint, para7: cuint, para8: cint, - para9: cuint, para10: PVisual, para11: culong, - para12: PXSetWindowAttributes): TWindow{.libx11.} -proc XListInstalledColormaps*(para1: PDisplay, para2: TWindow, para3: Pcint): PColormap{. - libx11.} -proc XListFonts*(para1: PDisplay, para2: cstring, para3: cint, para4: Pcint): PPChar{. - libx11.} -proc XListFontsWithInfo*(para1: PDisplay, para2: cstring, para3: cint, - para4: Pcint, para5: PPXFontStruct): PPChar{.libx11.} -proc XGetFontPath*(para1: PDisplay, para2: Pcint): PPChar{.libx11.} -proc XListExtensions*(para1: PDisplay, para2: Pcint): PPChar{.libx11.} -proc XListProperties*(para1: PDisplay, para2: TWindow, para3: Pcint): PAtom{. - libx11.} -proc XListHosts*(para1: PDisplay, para2: Pcint, para3: PBool): PXHostAddress{. - libx11.} -proc XKeycodeToKeysym*(para1: PDisplay, para2: TKeyCode, para3: cint): TKeySym{. - libx11.} -proc XLookupKeysym*(para1: PXKeyEvent, para2: cint): TKeySym{.libx11.} -proc XGetKeyboardMapping*(para1: PDisplay, para2: TKeyCode, para3: cint, - para4: Pcint): PKeySym{.libx11.} -proc XStringToKeysym*(para1: cstring): TKeySym{.libx11.} -proc XMaxRequestSize*(para1: PDisplay): clong{.libx11.} -proc XExtendedMaxRequestSize*(para1: PDisplay): clong{.libx11.} -proc XResourceManagerString*(para1: PDisplay): cstring{.libx11.} -proc XScreenResourceString*(para1: PScreen): cstring{.libx11.} -proc XDisplayMotionBufferSize*(para1: PDisplay): culong{.libx11.} -proc XVisualIDFromVisual*(para1: PVisual): TVisualID{.libx11.} -proc XInitThreads*(): TStatus{.libx11.} -proc XLockDisplay*(para1: PDisplay){.libx11.} -proc XUnlockDisplay*(para1: PDisplay){.libx11.} -proc XInitExtension*(para1: PDisplay, para2: cstring): PXExtCodes{.libx11.} -proc XAddExtension*(para1: PDisplay): PXExtCodes{.libx11.} -proc XFindOnExtensionList*(para1: PPXExtData, para2: cint): PXExtData{.libx11.} -proc XEHeadOfExtensionList*(para1: TXEDataObject): PPXExtData{.libx11.} -proc XRootWindow*(para1: PDisplay, para2: cint): TWindow{.libx11.} -proc XDefaultRootWindow*(para1: PDisplay): TWindow{.libx11.} -proc XRootWindowOfScreen*(para1: PScreen): TWindow{.libx11.} -proc XDefaultVisual*(para1: PDisplay, para2: cint): PVisual{.libx11.} -proc XDefaultVisualOfScreen*(para1: PScreen): PVisual{.libx11.} -proc XDefaultGC*(para1: PDisplay, para2: cint): TGC{.libx11.} -proc XDefaultGCOfScreen*(para1: PScreen): TGC{.libx11.} -proc XBlackPixel*(para1: PDisplay, para2: cint): culong{.libx11.} -proc XWhitePixel*(para1: PDisplay, para2: cint): culong{.libx11.} -proc XAllPlanes*(): culong{.libx11.} -proc XBlackPixelOfScreen*(para1: PScreen): culong{.libx11.} -proc XWhitePixelOfScreen*(para1: PScreen): culong{.libx11.} -proc XNextRequest*(para1: PDisplay): culong{.libx11.} -proc XLastKnownRequestProcessed*(para1: PDisplay): culong{.libx11.} -proc XServerVendor*(para1: PDisplay): cstring{.libx11.} -proc XDisplayString*(para1: PDisplay): cstring{.libx11.} -proc XDefaultColormap*(para1: PDisplay, para2: cint): TColormap{.libx11.} -proc XDefaultColormapOfScreen*(para1: PScreen): TColormap{.libx11.} -proc XDisplayOfScreen*(para1: PScreen): PDisplay{.libx11.} -proc XScreenOfDisplay*(para1: PDisplay, para2: cint): PScreen{.libx11.} -proc XDefaultScreenOfDisplay*(para1: PDisplay): PScreen{.libx11.} -proc XEventMaskOfScreen*(para1: PScreen): clong{.libx11.} -proc XScreenNumberOfScreen*(para1: PScreen): cint{.libx11.} -type - TXErrorHandler* = proc (para1: PDisplay, para2: PXErrorEvent): cint{.cdecl.} - -proc XSetErrorHandler*(para1: TXErrorHandler): TXErrorHandler{.libx11.} -type - TXIOErrorHandler* = proc (para1: PDisplay): cint{.cdecl.} - -proc XSetIOErrorHandler*(para1: TXIOErrorHandler): TXIOErrorHandler{.libx11.} -proc XListPixmapFormats*(para1: PDisplay, para2: Pcint): PXPixmapFormatValues{. - libx11.} -proc XListDepths*(para1: PDisplay, para2: cint, para3: Pcint): Pcint{.libx11.} -proc XReconfigureWMWindow*(para1: PDisplay, para2: TWindow, para3: cint, - para4: cuint, para5: PXWindowChanges): TStatus{. - libx11.} -proc XGetWMProtocols*(para1: PDisplay, para2: TWindow, para3: PPAtom, - para4: Pcint): TStatus{.libx11.} -proc XSetWMProtocols*(para1: PDisplay, para2: TWindow, para3: PAtom, para4: cint): TStatus{. - libx11.} -proc XIconifyWindow*(para1: PDisplay, para2: TWindow, para3: cint): TStatus{. - libx11.} -proc XWithdrawWindow*(para1: PDisplay, para2: TWindow, para3: cint): TStatus{. - libx11.} -proc XGetCommand*(para1: PDisplay, para2: TWindow, para3: PPPchar, para4: Pcint): TStatus{. - libx11.} -proc XGetWMColormapWindows*(para1: PDisplay, para2: TWindow, para3: PPWindow, - para4: Pcint): TStatus{.libx11.} -proc XSetWMColormapWindows*(para1: PDisplay, para2: TWindow, para3: PWindow, - para4: cint): TStatus{.libx11.} -proc XFreeStringList*(para1: PPchar){.libx11.} -proc XSetTransientForHint*(para1: PDisplay, para2: TWindow, para3: TWindow): cint{. - libx11.} -proc XActivateScreenSaver*(para1: PDisplay): cint{.libx11.} -proc XAddHost*(para1: PDisplay, para2: PXHostAddress): cint{.libx11.} -proc XAddHosts*(para1: PDisplay, para2: PXHostAddress, para3: cint): cint{. - libx11.} -proc XAddToExtensionList*(para1: PPXExtData, para2: PXExtData): cint{.libx11.} -proc XAddToSaveSet*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XAllocColor*(para1: PDisplay, para2: TColormap, para3: PXColor): TStatus{. - libx11.} -proc XAllocColorCells*(para1: PDisplay, para2: TColormap, para3: TBool, - para4: Pculong, para5: cuint, para6: Pculong, - para7: cuint): TStatus{.libx11.} -proc XAllocColorPlanes*(para1: PDisplay, para2: TColormap, para3: TBool, - para4: Pculong, para5: cint, para6: cint, para7: cint, - para8: cint, para9: Pculong, para10: Pculong, - para11: Pculong): TStatus{.libx11.} -proc XAllocNamedColor*(para1: PDisplay, para2: TColormap, para3: cstring, - para4: PXColor, para5: PXColor): TStatus{.libx11.} -proc XAllowEvents*(para1: PDisplay, para2: cint, para3: TTime): cint{.libx11.} -proc XAutoRepeatOff*(para1: PDisplay): cint{.libx11.} -proc XAutoRepeatOn*(para1: PDisplay): cint{.libx11.} -proc XBell*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XBitmapBitOrder*(para1: PDisplay): cint{.libx11.} -proc XBitmapPad*(para1: PDisplay): cint{.libx11.} -proc XBitmapUnit*(para1: PDisplay): cint{.libx11.} -proc XCellsOfScreen*(para1: PScreen): cint{.libx11.} -proc XChangeActivePointerGrab*(para1: PDisplay, para2: cuint, para3: TCursor, - para4: TTime): cint{.libx11.} -proc XChangeGC*(para1: PDisplay, para2: TGC, para3: culong, para4: PXGCValues): cint{. - libx11.} -proc XChangeKeyboardControl*(para1: PDisplay, para2: culong, - para3: PXKeyboardControl): cint{.libx11.} -proc XChangeKeyboardMapping*(para1: PDisplay, para2: cint, para3: cint, - para4: PKeySym, para5: cint): cint{.libx11.} -proc XChangePointerControl*(para1: PDisplay, para2: TBool, para3: TBool, - para4: cint, para5: cint, para6: cint): cint{.libx11.} -proc XChangeProperty*(para1: PDisplay, para2: TWindow, para3: TAtom, - para4: TAtom, para5: cint, para6: cint, para7: Pcuchar, - para8: cint): cint{.libx11.} -proc XChangeSaveSet*(para1: PDisplay, para2: TWindow, para3: cint): cint{.libx11.} -proc XChangeWindowAttributes*(para1: PDisplay, para2: TWindow, para3: culong, - para4: PXSetWindowAttributes): cint{.libx11.} -proc XCheckIfEvent*(para1: PDisplay, para2: PXEvent, para3: funcifevent, - para4: TXPointer): TBool{.libx11.} -proc XCheckMaskEvent*(para1: PDisplay, para2: clong, para3: PXEvent): TBool{. - libx11.} -proc XCheckTypedEvent*(para1: PDisplay, para2: cint, para3: PXEvent): TBool{. - libx11.} -proc XCheckTypedWindowEvent*(para1: PDisplay, para2: TWindow, para3: cint, - para4: PXEvent): TBool{.libx11.} -proc XCheckWindowEvent*(para1: PDisplay, para2: TWindow, para3: clong, - para4: PXEvent): TBool{.libx11.} -proc XCirculateSubwindows*(para1: PDisplay, para2: TWindow, para3: cint): cint{. - libx11.} -proc XCirculateSubwindowsDown*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XCirculateSubwindowsUp*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XClearArea*(para1: PDisplay, para2: TWindow, para3: cint, para4: cint, - para5: cuint, para6: cuint, para7: TBool): cint{.libx11.} -proc XClearWindow*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XCloseDisplay*(para1: PDisplay): cint{.libx11.} -proc XConfigureWindow*(para1: PDisplay, para2: TWindow, para3: cuint, - para4: PXWindowChanges): cint{.libx11.} -proc XConnectionNumber*(para1: PDisplay): cint{.libx11.} -proc XConvertSelection*(para1: PDisplay, para2: TAtom, para3: TAtom, - para4: TAtom, para5: TWindow, para6: TTime): cint{. - libx11.} -proc XCopyArea*(para1: PDisplay, para2: TDrawable, para3: TDrawable, para4: TGC, - para5: cint, para6: cint, para7: cuint, para8: cuint, - para9: cint, para10: cint): cint{.libx11.} -proc XCopyGC*(para1: PDisplay, para2: TGC, para3: culong, para4: TGC): cint{. - libx11.} -proc XCopyPlane*(para1: PDisplay, para2: TDrawable, para3: TDrawable, - para4: TGC, para5: cint, para6: cint, para7: cuint, - para8: cuint, para9: cint, para10: cint, para11: culong): cint{. - libx11.} -proc XDefaultDepth*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XDefaultDepthOfScreen*(para1: PScreen): cint{.libx11.} -proc XDefaultScreen*(para1: PDisplay): cint{.libx11.} -proc XDefineCursor*(para1: PDisplay, para2: TWindow, para3: TCursor): cint{. - libx11.} -proc XDeleteProperty*(para1: PDisplay, para2: TWindow, para3: TAtom): cint{. - libx11.} -proc XDestroyWindow*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XDestroySubwindows*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XDoesBackingStore*(para1: PScreen): cint{.libx11.} -proc XDoesSaveUnders*(para1: PScreen): TBool{.libx11.} -proc XDisableAccessControl*(para1: PDisplay): cint{.libx11.} -proc XDisplayCells*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XDisplayHeight*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XDisplayHeightMM*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XDisplayKeycodes*(para1: PDisplay, para2: Pcint, para3: Pcint): cint{. - libx11.} -proc XDisplayPlanes*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XDisplayWidth*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XDisplayWidthMM*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XDrawArc*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: cuint, para7: cuint, para8: cint, para9: cint): cint{. - libx11.} -proc XDrawArcs*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: PXArc, - para5: cint): cint{.libx11.} -proc XDrawImageString*(para1: PDisplay, para2: TDrawable, para3: TGC, - para4: cint, para5: cint, para6: cstring, para7: cint): cint{. - libx11.} -proc XDrawImageString16*(para1: PDisplay, para2: TDrawable, para3: TGC, - para4: cint, para5: cint, para6: PXChar2b, para7: cint): cint{. - libx11.} -proc XDrawLine*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: cint, para7: cint): cint{.libx11.} -proc XDrawLines*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: PXPoint, - para5: cint, para6: cint): cint{.libx11.} -proc XDrawPoint*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint): cint{.libx11.} -proc XDrawPoints*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: PXPoint, - para5: cint, para6: cint): cint{.libx11.} -proc XDrawRectangle*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: cuint, para7: cuint): cint{.libx11.} -proc XDrawRectangles*(para1: PDisplay, para2: TDrawable, para3: TGC, - para4: PXRectangle, para5: cint): cint{.libx11.} -proc XDrawSegments*(para1: PDisplay, para2: TDrawable, para3: TGC, - para4: PXSegment, para5: cint): cint{.libx11.} -proc XDrawString*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: cstring, para7: cint): cint{.libx11.} -proc XDrawString16*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: PXChar2b, para7: cint): cint{.libx11.} -proc XDrawText*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: PXTextItem, para7: cint): cint{.libx11.} -proc XDrawText16*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: PXTextItem16, para7: cint): cint{.libx11.} -proc XEnableAccessControl*(para1: PDisplay): cint{.libx11.} -proc XEventsQueued*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XFetchName*(para1: PDisplay, para2: TWindow, para3: PPchar): TStatus{. - libx11.} -proc XFillArc*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: cuint, para7: cuint, para8: cint, para9: cint): cint{. - libx11.} -proc XFillArcs*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: PXArc, - para5: cint): cint{.libx11.} -proc XFillPolygon*(para1: PDisplay, para2: TDrawable, para3: TGC, - para4: PXPoint, para5: cint, para6: cint, para7: cint): cint{. - libx11.} -proc XFillRectangle*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: cuint, para7: cuint): cint{.libx11.} -proc XFillRectangles*(para1: PDisplay, para2: TDrawable, para3: TGC, - para4: PXRectangle, para5: cint): cint{.libx11.} -proc XFlush*(para1: PDisplay): cint{.libx11.} -proc XForceScreenSaver*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XFree*(para1: pointer): cint{.libx11.} -proc XFreeColormap*(para1: PDisplay, para2: TColormap): cint{.libx11.} -proc XFreeColors*(para1: PDisplay, para2: TColormap, para3: Pculong, - para4: cint, para5: culong): cint{.libx11.} -proc XFreeCursor*(para1: PDisplay, para2: TCursor): cint{.libx11.} -proc XFreeExtensionList*(para1: PPchar): cint{.libx11.} -proc XFreeFont*(para1: PDisplay, para2: PXFontStruct): cint{.libx11.} -proc XFreeFontInfo*(para1: PPchar, para2: PXFontStruct, para3: cint): cint{. - libx11.} -proc XFreeFontNames*(para1: PPchar): cint{.libx11.} -proc XFreeFontPath*(para1: PPchar): cint{.libx11.} -proc XFreeGC*(para1: PDisplay, para2: TGC): cint{.libx11.} -proc XFreeModifiermap*(para1: PXModifierKeymap): cint{.libx11.} -proc XFreePixmap*(para1: PDisplay, para2: TPixmap): cint{.libx11.} -proc XGeometry*(para1: PDisplay, para2: cint, para3: cstring, para4: cstring, - para5: cuint, para6: cuint, para7: cuint, para8: cint, - para9: cint, para10: Pcint, para11: Pcint, para12: Pcint, - para13: Pcint): cint{.libx11.} -proc XGetErrorDatabaseText*(para1: PDisplay, para2: cstring, para3: cstring, - para4: cstring, para5: cstring, para6: cint): cint{. - libx11.} -proc XGetErrorText*(para1: PDisplay, para2: cint, para3: cstring, para4: cint): cint{. - libx11.} -proc XGetFontProperty*(para1: PXFontStruct, para2: TAtom, para3: Pculong): TBool{. - libx11.} -proc XGetGCValues*(para1: PDisplay, para2: TGC, para3: culong, para4: PXGCValues): TStatus{. - libx11.} -proc XGetGeometry*(para1: PDisplay, para2: TDrawable, para3: PWindow, - para4: Pcint, para5: Pcint, para6: Pcuint, para7: Pcuint, - para8: Pcuint, para9: Pcuint): TStatus{.libx11.} -proc XGetIconName*(para1: PDisplay, para2: TWindow, para3: PPchar): TStatus{. - libx11.} -proc XGetInputFocus*(para1: PDisplay, para2: PWindow, para3: Pcint): cint{. - libx11.} -proc XGetKeyboardControl*(para1: PDisplay, para2: PXKeyboardState): cint{.libx11.} -proc XGetPointerControl*(para1: PDisplay, para2: Pcint, para3: Pcint, - para4: Pcint): cint{.libx11.} -proc XGetPointerMapping*(para1: PDisplay, para2: Pcuchar, para3: cint): cint{. - libx11.} -proc XGetScreenSaver*(para1: PDisplay, para2: Pcint, para3: Pcint, para4: Pcint, - para5: Pcint): cint{.libx11.} -proc XGetTransientForHint*(para1: PDisplay, para2: TWindow, para3: PWindow): TStatus{. - libx11.} -proc XGetWindowProperty*(para1: PDisplay, para2: TWindow, para3: TAtom, - para4: clong, para5: clong, para6: TBool, para7: TAtom, - para8: PAtom, para9: Pcint, para10: Pculong, - para11: Pculong, para12: PPcuchar): cint{.libx11.} -proc XGetWindowAttributes*(para1: PDisplay, para2: TWindow, - para3: PXWindowAttributes): TStatus{.libx11.} -proc XGrabButton*(para1: PDisplay, para2: cuint, para3: cuint, para4: TWindow, - para5: TBool, para6: cuint, para7: cint, para8: cint, - para9: TWindow, para10: TCursor): cint{.libx11.} -proc XGrabKey*(para1: PDisplay, para2: cint, para3: cuint, para4: TWindow, - para5: TBool, para6: cint, para7: cint): cint{.libx11.} -proc XGrabKeyboard*(para1: PDisplay, para2: TWindow, para3: TBool, para4: cint, - para5: cint, para6: TTime): cint{.libx11.} -proc XGrabPointer*(para1: PDisplay, para2: TWindow, para3: TBool, para4: cuint, - para5: cint, para6: cint, para7: TWindow, para8: TCursor, - para9: TTime): cint{.libx11.} -proc XGrabServer*(para1: PDisplay): cint{.libx11.} -proc XHeightMMOfScreen*(para1: PScreen): cint{.libx11.} -proc XHeightOfScreen*(para1: PScreen): cint{.libx11.} -proc XIfEvent*(para1: PDisplay, para2: PXEvent, para3: funcifevent, - para4: TXPointer): cint{.libx11.} -proc XImageByteOrder*(para1: PDisplay): cint{.libx11.} -proc XInstallColormap*(para1: PDisplay, para2: TColormap): cint{.libx11.} -proc XKeysymToKeycode*(para1: PDisplay, para2: TKeySym): TKeyCode{.libx11.} -proc XKillClient*(para1: PDisplay, para2: TXID): cint{.libx11.} -proc XLookupColor*(para1: PDisplay, para2: TColormap, para3: cstring, - para4: PXColor, para5: PXColor): TStatus{.libx11.} -proc XLowerWindow*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XMapRaised*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XMapSubwindows*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XMapWindow*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XMaskEvent*(para1: PDisplay, para2: clong, para3: PXEvent): cint{.libx11.} -proc XMaxCmapsOfScreen*(para1: PScreen): cint{.libx11.} -proc XMinCmapsOfScreen*(para1: PScreen): cint{.libx11.} -proc XMoveResizeWindow*(para1: PDisplay, para2: TWindow, para3: cint, - para4: cint, para5: cuint, para6: cuint): cint{.libx11.} -proc XMoveWindow*(para1: PDisplay, para2: TWindow, para3: cint, para4: cint): cint{. - libx11.} -proc XNextEvent*(para1: PDisplay, para2: PXEvent): cint{.libx11.} -proc XNoOp*(para1: PDisplay): cint{.libx11.} -proc XParseColor*(para1: PDisplay, para2: TColormap, para3: cstring, - para4: PXColor): TStatus{.libx11.} -proc XParseGeometry*(para1: cstring, para2: Pcint, para3: Pcint, para4: Pcuint, - para5: Pcuint): cint{.libx11.} -proc XPeekEvent*(para1: PDisplay, para2: PXEvent): cint{.libx11.} -proc XPeekIfEvent*(para1: PDisplay, para2: PXEvent, para3: funcifevent, - para4: TXPointer): cint{.libx11.} -proc XPending*(para1: PDisplay): cint{.libx11.} -proc XPlanesOfScreen*(para1: PScreen): cint{.libx11.} -proc XProtocolRevision*(para1: PDisplay): cint{.libx11.} -proc XProtocolVersion*(para1: PDisplay): cint{.libx11.} -proc XPutBackEvent*(para1: PDisplay, para2: PXEvent): cint{.libx11.} -proc XPutImage*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: PXImage, - para5: cint, para6: cint, para7: cint, para8: cint, - para9: cuint, para10: cuint): cint{.libx11.} -proc XQLength*(para1: PDisplay): cint{.libx11.} -proc XQueryBestCursor*(para1: PDisplay, para2: TDrawable, para3: cuint, - para4: cuint, para5: Pcuint, para6: Pcuint): TStatus{. - libx11.} -proc XQueryBestSize*(para1: PDisplay, para2: cint, para3: TDrawable, - para4: cuint, para5: cuint, para6: Pcuint, para7: Pcuint): TStatus{. - libx11.} -proc XQueryBestStipple*(para1: PDisplay, para2: TDrawable, para3: cuint, - para4: cuint, para5: Pcuint, para6: Pcuint): TStatus{. - libx11.} -proc XQueryBestTile*(para1: PDisplay, para2: TDrawable, para3: cuint, - para4: cuint, para5: Pcuint, para6: Pcuint): TStatus{. - libx11.} -proc XQueryColor*(para1: PDisplay, para2: TColormap, para3: PXColor): cint{. - libx11.} -proc XQueryColors*(para1: PDisplay, para2: TColormap, para3: PXColor, - para4: cint): cint{.libx11.} -proc XQueryExtension*(para1: PDisplay, para2: cstring, para3: Pcint, - para4: Pcint, para5: Pcint): TBool{.libx11.} - #? -proc XQueryKeymap*(para1: PDisplay, para2: chararr32): cint{.libx11.} -proc XQueryPointer*(para1: PDisplay, para2: TWindow, para3: PWindow, - para4: PWindow, para5: Pcint, para6: Pcint, para7: Pcint, - para8: Pcint, para9: Pcuint): TBool{.libx11.} -proc XQueryTextExtents*(para1: PDisplay, para2: TXID, para3: cstring, - para4: cint, para5: Pcint, para6: Pcint, para7: Pcint, - para8: PXCharStruct): cint{.libx11.} -proc XQueryTextExtents16*(para1: PDisplay, para2: TXID, para3: PXChar2b, - para4: cint, para5: Pcint, para6: Pcint, para7: Pcint, - para8: PXCharStruct): cint{.libx11.} -proc XQueryTree*(para1: PDisplay, para2: TWindow, para3: PWindow, - para4: PWindow, para5: PPWindow, para6: Pcuint): TStatus{. - libx11.} -proc XRaiseWindow*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XReadBitmapFile*(para1: PDisplay, para2: TDrawable, para3: cstring, - para4: Pcuint, para5: Pcuint, para6: PPixmap, - para7: Pcint, para8: Pcint): cint{.libx11.} -proc XReadBitmapFileData*(para1: cstring, para2: Pcuint, para3: Pcuint, - para4: PPcuchar, para5: Pcint, para6: Pcint): cint{. - libx11.} -proc XRebindKeysym*(para1: PDisplay, para2: TKeySym, para3: PKeySym, - para4: cint, para5: Pcuchar, para6: cint): cint{.libx11.} -proc XRecolorCursor*(para1: PDisplay, para2: TCursor, para3: PXColor, - para4: PXColor): cint{.libx11.} -proc XRefreshKeyboardMapping*(para1: PXMappingEvent): cint{.libx11.} -proc XRemoveFromSaveSet*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XRemoveHost*(para1: PDisplay, para2: PXHostAddress): cint{.libx11.} -proc XRemoveHosts*(para1: PDisplay, para2: PXHostAddress, para3: cint): cint{. - libx11.} -proc XReparentWindow*(para1: PDisplay, para2: TWindow, para3: TWindow, - para4: cint, para5: cint): cint{.libx11.} -proc XResetScreenSaver*(para1: PDisplay): cint{.libx11.} -proc XResizeWindow*(para1: PDisplay, para2: TWindow, para3: cuint, para4: cuint): cint{. - libx11.} -proc XRestackWindows*(para1: PDisplay, para2: PWindow, para3: cint): cint{. - libx11.} -proc XRotateBuffers*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XRotateWindowProperties*(para1: PDisplay, para2: TWindow, para3: PAtom, - para4: cint, para5: cint): cint{.libx11.} -proc XScreenCount*(para1: PDisplay): cint{.libx11.} -proc XSelectInput*(para1: PDisplay, para2: TWindow, para3: clong): cint{.libx11.} -proc XSendEvent*(para1: PDisplay, para2: TWindow, para3: TBool, para4: clong, - para5: PXEvent): TStatus{.libx11.} -proc XSetAccessControl*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XSetArcMode*(para1: PDisplay, para2: TGC, para3: cint): cint{.libx11.} -proc XSetBackground*(para1: PDisplay, para2: TGC, para3: culong): cint{.libx11.} -proc XSetClipMask*(para1: PDisplay, para2: TGC, para3: TPixmap): cint{.libx11.} -proc XSetClipOrigin*(para1: PDisplay, para2: TGC, para3: cint, para4: cint): cint{. - libx11.} -proc XSetClipRectangles*(para1: PDisplay, para2: TGC, para3: cint, para4: cint, - para5: PXRectangle, para6: cint, para7: cint): cint{. - libx11.} -proc XSetCloseDownMode*(para1: PDisplay, para2: cint): cint{.libx11.} -proc XSetCommand*(para1: PDisplay, para2: TWindow, para3: PPchar, para4: cint): cint{. - libx11.} -proc XSetDashes*(para1: PDisplay, para2: TGC, para3: cint, para4: cstring, - para5: cint): cint{.libx11.} -proc XSetFillRule*(para1: PDisplay, para2: TGC, para3: cint): cint{.libx11.} -proc XSetFillStyle*(para1: PDisplay, para2: TGC, para3: cint): cint{.libx11.} -proc XSetFont*(para1: PDisplay, para2: TGC, para3: TFont): cint{.libx11.} -proc XSetFontPath*(para1: PDisplay, para2: PPchar, para3: cint): cint{.libx11.} -proc XSetForeground*(para1: PDisplay, para2: TGC, para3: culong): cint{.libx11.} -proc XSetFunction*(para1: PDisplay, para2: TGC, para3: cint): cint{.libx11.} -proc XSetGraphicsExposures*(para1: PDisplay, para2: TGC, para3: TBool): cint{. - libx11.} -proc XSetIconName*(para1: PDisplay, para2: TWindow, para3: cstring): cint{. - libx11.} -proc XSetInputFocus*(para1: PDisplay, para2: TWindow, para3: cint, para4: TTime): cint{. - libx11.} -proc XSetLineAttributes*(para1: PDisplay, para2: TGC, para3: cuint, para4: cint, - para5: cint, para6: cint): cint{.libx11.} -proc XSetModifierMapping*(para1: PDisplay, para2: PXModifierKeymap): cint{. - libx11.} -proc XSetPlaneMask*(para1: PDisplay, para2: TGC, para3: culong): cint{.libx11.} -proc XSetPointerMapping*(para1: PDisplay, para2: Pcuchar, para3: cint): cint{. - libx11.} -proc XSetScreenSaver*(para1: PDisplay, para2: cint, para3: cint, para4: cint, - para5: cint): cint{.libx11.} -proc XSetSelectionOwner*(para1: PDisplay, para2: TAtom, para3: TWindow, - para4: TTime): cint{.libx11.} -proc XSetState*(para1: PDisplay, para2: TGC, para3: culong, para4: culong, - para5: cint, para6: culong): cint{.libx11.} -proc XSetStipple*(para1: PDisplay, para2: TGC, para3: TPixmap): cint{.libx11.} -proc XSetSubwindowMode*(para1: PDisplay, para2: TGC, para3: cint): cint{.libx11.} -proc XSetTSOrigin*(para1: PDisplay, para2: TGC, para3: cint, para4: cint): cint{. - libx11.} -proc XSetTile*(para1: PDisplay, para2: TGC, para3: TPixmap): cint{.libx11.} -proc XSetWindowBackground*(para1: PDisplay, para2: TWindow, para3: culong): cint{. - libx11.} -proc XSetWindowBackgroundPixmap*(para1: PDisplay, para2: TWindow, para3: TPixmap): cint{. - libx11.} -proc XSetWindowBorder*(para1: PDisplay, para2: TWindow, para3: culong): cint{. - libx11.} -proc XSetWindowBorderPixmap*(para1: PDisplay, para2: TWindow, para3: TPixmap): cint{. - libx11.} -proc XSetWindowBorderWidth*(para1: PDisplay, para2: TWindow, para3: cuint): cint{. - libx11.} -proc XSetWindowColormap*(para1: PDisplay, para2: TWindow, para3: TColormap): cint{. - libx11.} -proc XStoreBuffer*(para1: PDisplay, para2: cstring, para3: cint, para4: cint): cint{. - libx11.} -proc XStoreBytes*(para1: PDisplay, para2: cstring, para3: cint): cint{.libx11.} -proc XStoreColor*(para1: PDisplay, para2: TColormap, para3: PXColor): cint{. - libx11.} -proc XStoreColors*(para1: PDisplay, para2: TColormap, para3: PXColor, - para4: cint): cint{.libx11.} -proc XStoreName*(para1: PDisplay, para2: TWindow, para3: cstring): cint{.libx11.} -proc XStoreNamedColor*(para1: PDisplay, para2: TColormap, para3: cstring, - para4: culong, para5: cint): cint{.libx11.} -proc XSync*(para1: PDisplay, para2: TBool): cint{.libx11.} -proc XTextExtents*(para1: PXFontStruct, para2: cstring, para3: cint, - para4: Pcint, para5: Pcint, para6: Pcint, para7: PXCharStruct): cint{. - libx11.} -proc XTextExtents16*(para1: PXFontStruct, para2: PXChar2b, para3: cint, - para4: Pcint, para5: Pcint, para6: Pcint, - para7: PXCharStruct): cint{.libx11.} -proc XTextWidth*(para1: PXFontStruct, para2: cstring, para3: cint): cint{.libx11.} -proc XTextWidth16*(para1: PXFontStruct, para2: PXChar2b, para3: cint): cint{. - libx11.} -proc XTranslateCoordinates*(para1: PDisplay, para2: TWindow, para3: TWindow, - para4: cint, para5: cint, para6: Pcint, - para7: Pcint, para8: PWindow): TBool{.libx11.} -proc XUndefineCursor*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XUngrabButton*(para1: PDisplay, para2: cuint, para3: cuint, para4: TWindow): cint{. - libx11.} -proc XUngrabKey*(para1: PDisplay, para2: cint, para3: cuint, para4: TWindow): cint{. - libx11.} -proc XUngrabKeyboard*(para1: PDisplay, para2: TTime): cint{.libx11.} -proc XUngrabPointer*(para1: PDisplay, para2: TTime): cint{.libx11.} -proc XUngrabServer*(para1: PDisplay): cint{.libx11.} -proc XUninstallColormap*(para1: PDisplay, para2: TColormap): cint{.libx11.} -proc XUnloadFont*(para1: PDisplay, para2: TFont): cint{.libx11.} -proc XUnmapSubwindows*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XUnmapWindow*(para1: PDisplay, para2: TWindow): cint{.libx11.} -proc XVendorRelease*(para1: PDisplay): cint{.libx11.} -proc XWarpPointer*(para1: PDisplay, para2: TWindow, para3: TWindow, para4: cint, - para5: cint, para6: cuint, para7: cuint, para8: cint, - para9: cint): cint{.libx11.} -proc XWidthMMOfScreen*(para1: PScreen): cint{.libx11.} -proc XWidthOfScreen*(para1: PScreen): cint{.libx11.} -proc XWindowEvent*(para1: PDisplay, para2: TWindow, para3: clong, para4: PXEvent): cint{. - libx11.} -proc XWriteBitmapFile*(para1: PDisplay, para2: cstring, para3: TPixmap, - para4: cuint, para5: cuint, para6: cint, para7: cint): cint{. - libx11.} -proc XSupportsLocale*(): TBool{.libx11.} -proc XSetLocaleModifiers*(para1: cstring): cstring{.libx11.} -proc XOpenOM*(para1: PDisplay, para2: PXrmHashBucketRec, para3: cstring, - para4: cstring): TXOM{.libx11.} -proc XCloseOM*(para1: TXOM): TStatus{.libx11.} -proc XSetOMValues*(para1: TXOM): cstring{.varargs, libx11.} -proc XGetOMValues*(para1: TXOM): cstring{.varargs, libx11.} -proc XDisplayOfOM*(para1: TXOM): PDisplay{.libx11.} -proc XLocaleOfOM*(para1: TXOM): cstring{.libx11.} -proc XCreateOC*(para1: TXOM): TXOC{.varargs, libx11.} -proc XDestroyOC*(para1: TXOC){.libx11.} -proc XOMOfOC*(para1: TXOC): TXOM{.libx11.} -proc XSetOCValues*(para1: TXOC): cstring{.varargs, libx11.} -proc XGetOCValues*(para1: TXOC): cstring{.varargs, libx11.} -proc XCreateFontSet*(para1: PDisplay, para2: cstring, para3: PPPchar, - para4: Pcint, para5: PPchar): TXFontSet{.libx11.} -proc XFreeFontSet*(para1: PDisplay, para2: TXFontSet){.libx11.} -proc XFontsOfFontSet*(para1: TXFontSet, para2: PPPXFontStruct, para3: PPPchar): cint{. - libx11.} -proc XBaseFontNameListOfFontSet*(para1: TXFontSet): cstring{.libx11.} -proc XLocaleOfFontSet*(para1: TXFontSet): cstring{.libx11.} -proc XContextDependentDrawing*(para1: TXFontSet): TBool{.libx11.} -proc XDirectionalDependentDrawing*(para1: TXFontSet): TBool{.libx11.} -proc XContextualDrawing*(para1: TXFontSet): TBool{.libx11.} -proc XExtentsOfFontSet*(para1: TXFontSet): PXFontSetExtents{.libx11.} -proc XmbTextEscapement*(para1: TXFontSet, para2: cstring, para3: cint): cint{. - libx11.} -proc XwcTextEscapement*(para1: TXFontSet, para2: PWideChar, para3: cint): cint{. - libx11.} -proc Xutf8TextEscapement*(para1: TXFontSet, para2: cstring, para3: cint): cint{. - libx11.} -proc XmbTextExtents*(para1: TXFontSet, para2: cstring, para3: cint, - para4: PXRectangle, para5: PXRectangle): cint{.libx11.} -proc XwcTextExtents*(para1: TXFontSet, para2: PWideChar, para3: cint, - para4: PXRectangle, para5: PXRectangle): cint{.libx11.} -proc Xutf8TextExtents*(para1: TXFontSet, para2: cstring, para3: cint, - para4: PXRectangle, para5: PXRectangle): cint{.libx11.} -proc XmbTextPerCharExtents*(para1: TXFontSet, para2: cstring, para3: cint, - para4: PXRectangle, para5: PXRectangle, para6: cint, - para7: Pcint, para8: PXRectangle, para9: PXRectangle): TStatus{. - libx11.} -proc XwcTextPerCharExtents*(para1: TXFontSet, para2: PWideChar, para3: cint, - para4: PXRectangle, para5: PXRectangle, para6: cint, - para7: Pcint, para8: PXRectangle, para9: PXRectangle): TStatus{. - libx11.} -proc Xutf8TextPerCharExtents*(para1: TXFontSet, para2: cstring, para3: cint, - para4: PXRectangle, para5: PXRectangle, - para6: cint, para7: Pcint, para8: PXRectangle, - para9: PXRectangle): TStatus{.libx11.} -proc XmbDrawText*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: PXmbTextItem, para7: cint){.libx11.} -proc XwcDrawText*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: PXwcTextItem, para7: cint){.libx11.} -proc Xutf8DrawText*(para1: PDisplay, para2: TDrawable, para3: TGC, para4: cint, - para5: cint, para6: PXmbTextItem, para7: cint){.libx11.} -proc XmbDrawString*(para1: PDisplay, para2: TDrawable, para3: TXFontSet, - para4: TGC, para5: cint, para6: cint, para7: cstring, - para8: cint){.libx11.} -proc XwcDrawString*(para1: PDisplay, para2: TDrawable, para3: TXFontSet, - para4: TGC, para5: cint, para6: cint, para7: PWideChar, - para8: cint){.libx11.} -proc Xutf8DrawString*(para1: PDisplay, para2: TDrawable, para3: TXFontSet, - para4: TGC, para5: cint, para6: cint, para7: cstring, - para8: cint){.libx11.} -proc XmbDrawImageString*(para1: PDisplay, para2: TDrawable, para3: TXFontSet, - para4: TGC, para5: cint, para6: cint, para7: cstring, - para8: cint){.libx11.} -proc XwcDrawImageString*(para1: PDisplay, para2: TDrawable, para3: TXFontSet, - para4: TGC, para5: cint, para6: cint, para7: PWideChar, - para8: cint){.libx11.} -proc Xutf8DrawImageString*(para1: PDisplay, para2: TDrawable, para3: TXFontSet, - para4: TGC, para5: cint, para6: cint, para7: cstring, - para8: cint){.libx11.} -proc XOpenIM*(para1: PDisplay, para2: PXrmHashBucketRec, para3: cstring, - para4: cstring): TXIM{.libx11.} -proc XCloseIM*(para1: TXIM): TStatus{.libx11.} -proc XGetIMValues*(para1: TXIM): cstring{.varargs, libx11.} -proc XSetIMValues*(para1: TXIM): cstring{.varargs, libx11.} -proc XDisplayOfIM*(para1: TXIM): PDisplay{.libx11.} -proc XLocaleOfIM*(para1: TXIM): cstring{.libx11.} -proc XCreateIC*(para1: TXIM): TXIC{.varargs, libx11.} -proc XDestroyIC*(para1: TXIC){.libx11.} -proc XSetICFocus*(para1: TXIC){.libx11.} -proc XUnsetICFocus*(para1: TXIC){.libx11.} -proc XwcResetIC*(para1: TXIC): PWideChar{.libx11.} -proc XmbResetIC*(para1: TXIC): cstring{.libx11.} -proc Xutf8ResetIC*(para1: TXIC): cstring{.libx11.} -proc XSetICValues*(para1: TXIC): cstring{.varargs, libx11.} -proc XGetICValues*(para1: TXIC): cstring{.varargs, libx11.} -proc XIMOfIC*(para1: TXIC): TXIM{.libx11.} -proc XFilterEvent*(para1: PXEvent, para2: TWindow): TBool{.libx11.} -proc XmbLookupString*(para1: TXIC, para2: PXKeyPressedEvent, para3: cstring, - para4: cint, para5: PKeySym, para6: PStatus): cint{.libx11.} -proc XwcLookupString*(para1: TXIC, para2: PXKeyPressedEvent, para3: PWideChar, - para4: cint, para5: PKeySym, para6: PStatus): cint{.libx11.} -proc Xutf8LookupString*(para1: TXIC, para2: PXKeyPressedEvent, para3: cstring, - para4: cint, para5: PKeySym, para6: PStatus): cint{. - libx11.} -proc XVaCreateNestedList*(unused: cint): TXVaNestedList{.varargs, libx11.} -proc XRegisterIMInstantiateCallback*(para1: PDisplay, para2: PXrmHashBucketRec, - para3: cstring, para4: cstring, - para5: TXIDProc, para6: TXPointer): TBool{. - libx11.} -proc XUnregisterIMInstantiateCallback*(para1: PDisplay, - para2: PXrmHashBucketRec, para3: cstring, - para4: cstring, para5: TXIDProc, - para6: TXPointer): TBool{.libx11.} -type - TXConnectionWatchProc* = proc (para1: PDisplay, para2: TXPointer, para3: cint, - para4: TBool, para5: PXPointer){.cdecl.} - -proc XInternalConnectionNumbers*(para1: PDisplay, para2: PPcint, para3: Pcint): TStatus{. - libx11.} -proc XProcessInternalConnection*(para1: PDisplay, para2: cint){.libx11.} -proc XAddConnectionWatch*(para1: PDisplay, para2: TXConnectionWatchProc, - para3: TXPointer): TStatus{.libx11.} -proc XRemoveConnectionWatch*(para1: PDisplay, para2: TXConnectionWatchProc, - para3: TXPointer){.libx11.} -proc XSetAuthorization*(para1: cstring, para2: cint, para3: cstring, para4: cint){. - libx11.} - # - # _Xmbtowc? - # _Xwctomb? - # -#when defined(MACROS): -proc ConnectionNumber*(dpy: PDisplay): cint -proc RootWindow*(dpy: PDisplay, scr: cint): TWindow -proc DefaultScreen*(dpy: PDisplay): cint -proc DefaultRootWindow*(dpy: PDisplay): TWindow -proc DefaultVisual*(dpy: PDisplay, scr: cint): PVisual -proc DefaultGC*(dpy: PDisplay, scr: cint): TGC -proc BlackPixel*(dpy: PDisplay, scr: cint): culong -proc WhitePixel*(dpy: PDisplay, scr: cint): culong -proc QLength*(dpy: PDisplay): cint -proc DisplayWidth*(dpy: PDisplay, scr: cint): cint -proc DisplayHeight*(dpy: PDisplay, scr: cint): cint -proc DisplayWidthMM*(dpy: PDisplay, scr: cint): cint -proc DisplayHeightMM*(dpy: PDisplay, scr: cint): cint -proc DisplayPlanes*(dpy: PDisplay, scr: cint): cint -proc DisplayCells*(dpy: PDisplay, scr: cint): cint -proc ScreenCount*(dpy: PDisplay): cint -proc ServerVendor*(dpy: PDisplay): cstring -proc ProtocolVersion*(dpy: PDisplay): cint -proc ProtocolRevision*(dpy: PDisplay): cint -proc VendorRelease*(dpy: PDisplay): cint -proc DisplayString*(dpy: PDisplay): cstring -proc DefaultDepth*(dpy: PDisplay, scr: cint): cint -proc DefaultColormap*(dpy: PDisplay, scr: cint): TColormap -proc BitmapUnit*(dpy: PDisplay): cint -proc BitmapBitOrder*(dpy: PDisplay): cint -proc BitmapPad*(dpy: PDisplay): cint -proc ImageByteOrder*(dpy: PDisplay): cint -proc NextRequest*(dpy: PDisplay): culong -proc LastKnownRequestProcessed*(dpy: PDisplay): culong -proc ScreenOfDisplay*(dpy: PDisplay, scr: cint): PScreen -proc DefaultScreenOfDisplay*(dpy: PDisplay): PScreen -proc DisplayOfScreen*(s: PScreen): PDisplay -proc RootWindowOfScreen*(s: PScreen): TWindow -proc BlackPixelOfScreen*(s: PScreen): culong -proc WhitePixelOfScreen*(s: PScreen): culong -proc DefaultColormapOfScreen*(s: PScreen): TColormap -proc DefaultDepthOfScreen*(s: PScreen): cint -proc DefaultGCOfScreen*(s: PScreen): TGC -proc DefaultVisualOfScreen*(s: PScreen): PVisual -proc WidthOfScreen*(s: PScreen): cint -proc HeightOfScreen*(s: PScreen): cint -proc WidthMMOfScreen*(s: PScreen): cint -proc HeightMMOfScreen*(s: PScreen): cint -proc PlanesOfScreen*(s: PScreen): cint -proc CellsOfScreen*(s: PScreen): cint -proc MinCmapsOfScreen*(s: PScreen): cint -proc MaxCmapsOfScreen*(s: PScreen): cint -proc DoesSaveUnders*(s: PScreen): TBool -proc DoesBackingStore*(s: PScreen): cint -proc EventMaskOfScreen*(s: PScreen): clong -proc XAllocID*(dpy: PDisplay): TXID -# implementation - -#when defined(MACROS): -template privDisp : expr = cast[PXPrivDisplay](dpy) - -proc ConnectionNumber(dpy: PDisplay): cint = - privDisp.fd - -proc RootWindow(dpy: PDisplay, scr: cint): TWindow = - ScreenOfDisplay(dpy, scr).root - -proc DefaultScreen(dpy: PDisplay): cint = - privDisp.default_screen - -proc DefaultRootWindow(dpy: PDisplay): TWindow = - ScreenOfDisplay(dpy, DefaultScreen(dpy)).root - -proc DefaultVisual(dpy: PDisplay, scr: cint): PVisual = - ScreenOfDisplay(dpy, scr).root_visual - -proc DefaultGC(dpy: PDisplay, scr: cint): TGC = - ScreenOfDisplay(dpy, scr).default_gc - -proc BlackPixel(dpy: PDisplay, scr: cint): culong = - ScreenOfDisplay(dpy, scr).black_pixel - -proc WhitePixel(dpy: PDisplay, scr: cint): culong = - ScreenOfDisplay(dpy, scr).white_pixel - -proc QLength(dpy: PDisplay): cint = - privDisp.qlen - -proc DisplayWidth(dpy: PDisplay, scr: cint): cint = - ScreenOfDisplay(dpy, scr).width - -proc DisplayHeight(dpy: PDisplay, scr: cint): cint = - ScreenOfDisplay(dpy, scr).height - -proc DisplayWidthMM(dpy: PDisplay, scr: cint): cint = - ScreenOfDisplay(dpy, scr).mwidth - -proc DisplayHeightMM(dpy: PDisplay, scr: cint): cint = - ScreenOfDisplay(dpy, scr).mheight - -proc DisplayPlanes(dpy: PDisplay, scr: cint): cint = - ScreenOfDisplay(dpy, scr).root_depth - -proc DisplayCells(dpy: PDisplay, scr: cint): cint = - DefaultVisual(dpy, scr).map_entries - -proc ScreenCount(dpy: PDisplay): cint = - privDisp.nscreens - -proc ServerVendor(dpy: PDisplay): cstring = - privDisp.vendor - -proc ProtocolVersion(dpy: PDisplay): cint = - privDisp.proto_major_version - -proc ProtocolRevision(dpy: PDisplay): cint = - privDisp.proto_minor_version - -proc VendorRelease(dpy: PDisplay): cint = - privDisp.release - -proc DisplayString(dpy: PDisplay): cstring = - privDisp.display_name - -proc DefaultDepth(dpy: PDisplay, scr: cint): cint = - ScreenOfDisplay(dpy, scr).root_depth - -proc DefaultColormap(dpy: PDisplay, scr: cint): TColormap = - ScreenOfDisplay(dpy, scr).cmap - -proc BitmapUnit(dpy: PDisplay): cint = - privDisp.bitmap_unit - -proc BitmapBitOrder(dpy: PDisplay): cint = - privDisp.bitmap_bit_order - -proc BitmapPad(dpy: PDisplay): cint = - privDisp.bitmap_pad - -proc ImageByteOrder(dpy: PDisplay): cint = - privDisp.byte_order - -import unsigned -proc NextRequest(dpy: PDisplay): culong = - privDisp.request + 1.culong - -proc LastKnownRequestProcessed(dpy: PDisplay): culong = - privDisp.last_request_read - -# from fowltek/pointer_arithm, required for ScreenOfDisplay() -proc offset[A] (some: ptr A; b: int): ptr A = - cast[ptr A](cast[int](some) + (b * sizeof(A))) -proc ScreenOfDisplay(dpy: PDisplay, scr: cint): PScreen = - #addr(((privDisp.screens)[scr])) - privDisp.screens.offset(scr.int) - -proc DefaultScreenOfDisplay(dpy: PDisplay): PScreen = - ScreenOfDisplay(dpy, DefaultScreen(dpy)) - -proc DisplayOfScreen(s: PScreen): PDisplay = - s.display - -proc RootWindowOfScreen(s: PScreen): TWindow = - s.root - -proc BlackPixelOfScreen(s: PScreen): culong = - s.black_pixel - -proc WhitePixelOfScreen(s: PScreen): culong = - s.white_pixel - -proc DefaultColormapOfScreen(s: PScreen): TColormap = - s.cmap - -proc DefaultDepthOfScreen(s: PScreen): cint = - s.root_depth - -proc DefaultGCOfScreen(s: PScreen): TGC = - s.default_gc - -proc DefaultVisualOfScreen(s: PScreen): PVisual = - s.root_visual - -proc WidthOfScreen(s: PScreen): cint = - s.width - -proc HeightOfScreen(s: PScreen): cint = - s.height - -proc WidthMMOfScreen(s: PScreen): cint = - s.mwidth - -proc HeightMMOfScreen(s: PScreen): cint = - s.mheight - -proc PlanesOfScreen(s: PScreen): cint = - s.root_depth - -proc CellsOfScreen(s: PScreen): cint = - DefaultVisualOfScreen(s).map_entries - -proc MinCmapsOfScreen(s: PScreen): cint = - s.min_maps - -proc MaxCmapsOfScreen(s: PScreen): cint = - s.max_maps - -proc DoesSaveUnders(s: PScreen): TBool = - s.save_unders - -proc DoesBackingStore(s: PScreen): cint = - s.backing_store - -proc EventMaskOfScreen(s: PScreen): clong = - s.root_input_mask - -proc XAllocID(dpy: PDisplay): TXID = - privDisp.resource_alloc(dpy) diff --git a/lib/wrappers/x11/xrandr.nim b/lib/wrappers/x11/xrandr.nim deleted file mode 100644 index ee6f1705b8..0000000000 --- a/lib/wrappers/x11/xrandr.nim +++ /dev/null @@ -1,194 +0,0 @@ -# -# $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $ -# -# Copyright (C) 2000 Compaq Computer Corporation, Inc. -# Copyright (C) 2002 Hewlett-Packard Company, Inc. -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of Compaq not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. HP makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ -# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# Author: Jim Gettys, HP Labs, HP. -# - -import - x, xlib - -const - libXrandr* = "libXrandr.so" - -# * $XFree86: xc/include/extensions/randr.h,v 1.4 2001/11/24 07:24:58 keithp Exp $ -# * -# * Copyright (C) 2000, Compaq Computer Corporation, -# * Copyright (C) 2002, Hewlett Packard, Inc. -# * -# * Permission to use, copy, modify, distribute, and sell this software and its -# * documentation for any purpose is hereby granted without fee, provided that -# * the above copyright notice appear in all copies and that both that -# * copyright notice and this permission notice appear in supporting -# * documentation, and that the name of Compaq or HP not be used in advertising -# * or publicity pertaining to distribution of the software without specific, -# * written prior permission. HP makes no representations about the -# * suitability of this software for any purpose. It is provided "as is" -# * without express or implied warranty. -# * -# * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL -# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP -# * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -# * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -# * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# * -# * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. -# * - -type - PRotation* = ptr TRotation - TRotation* = cushort - PSizeID* = ptr TSizeID - TSizeID* = cushort - PSubpixelOrder* = ptr TSubpixelOrder - TSubpixelOrder* = cushort - -const - RANDR_NAME* = "RANDR" - RANDR_MAJOR* = 1 - RANDR_MINOR* = 1 - RRNumberErrors* = 0 - RRNumberEvents* = 1 - constX_RRQueryVersion* = 0 # we skip 1 to make old clients fail pretty immediately - X_RROldGetScreenInfo* = 1 - X_RR1_0SetScreenConfig* = 2 # V1.0 apps share the same set screen config request id - constX_RRSetScreenConfig* = 2 - X_RROldScreenChangeSelectInput* = 3 # 3 used to be ScreenChangeSelectInput; deprecated - constX_RRSelectInput* = 4 - constX_RRGetScreenInfo* = 5 # used in XRRSelectInput - RRScreenChangeNotifyMask* = 1 shl 0 - RRScreenChangeNotify* = 0 # used in the rotation field; rotation and reflection in 0.1 proto. - RR_Rotate_0* = 1 - RR_Rotate_90* = 2 - RR_Rotate_180* = 4 - RR_Rotate_270* = 8 # new in 1.0 protocol, to allow reflection of screen - RR_Reflect_X* = 16 - RR_Reflect_Y* = 32 - RRSetConfigSuccess* = 0 - RRSetConfigInvalidConfigTime* = 1 - RRSetConfigInvalidTime* = 2 - RRSetConfigFailed* = 3 - -type - PXRRScreenSize* = ptr TXRRScreenSize - TXRRScreenSize*{.final.} = object # - # Events. - # - width*, height*: cint - mwidth*, mheight*: cint - - TXRRScreenChangeNotifyEvent*{.final.} = object # internal representation is private to the library - typ*: cint # event base - serial*: culong # # of last request processed by server - send_event*: TBool # true if this came from a SendEvent request - display*: PDisplay # Display the event was read from - window*: TWindow # window which selected for this event - root*: TWindow # Root window for changed screen - timestamp*: TTime # when the screen change occurred - config_timestamp*: TTime # when the last configuration change - size_index*: TSizeID - subpixel_order*: TSubpixelOrder - rotation*: TRotation - width*: cint - height*: cint - mwidth*: cint - mheight*: cint - - PXRRScreenConfiguration* = ptr TXRRScreenConfiguration - TXRRScreenConfiguration*{.final.} = object - -proc XRRQueryExtension*(dpy: PDisplay, event_basep, error_basep: Pcint): TBool{. - cdecl, dynlib: libXrandr, importc.} -proc XRRQueryVersion*(dpy: PDisplay, major_versionp: Pcint, - minor_versionp: Pcint): TStatus{.cdecl, dynlib: libXrandr, - importc.} -proc XRRGetScreenInfo*(dpy: PDisplay, draw: TDrawable): PXRRScreenConfiguration{. - cdecl, dynlib: libXrandr, importc.} -proc XRRFreeScreenConfigInfo*(config: PXRRScreenConfiguration){.cdecl, - dynlib: libXrandr, importc.} - # - # Note that screen configuration changes are only permitted if the client can - # prove it has up to date configuration information. We are trying to - # insist that it become possible for screens to change dynamically, so - # we want to ensure the client knows what it is talking about when requesting - # changes. - # -proc XRRSetScreenConfig*(dpy: PDisplay, config: PXRRScreenConfiguration, - draw: TDrawable, size_index: cint, rotation: TRotation, - timestamp: TTime): TStatus{.cdecl, dynlib: libXrandr, - importc.} - # added in v1.1, sorry for the lame name -proc XRRSetScreenConfigAndRate*(dpy: PDisplay, config: PXRRScreenConfiguration, - draw: TDrawable, size_index: cint, - rotation: TRotation, rate: cshort, - timestamp: TTime): TStatus{.cdecl, - dynlib: libXrandr, importc.} -proc XRRConfigRotations*(config: PXRRScreenConfiguration, - current_rotation: PRotation): TRotation{.cdecl, - dynlib: libXrandr, importc.} -proc XRRConfigTimes*(config: PXRRScreenConfiguration, config_timestamp: PTime): TTime{. - cdecl, dynlib: libXrandr, importc.} -proc XRRConfigSizes*(config: PXRRScreenConfiguration, nsizes: Pcint): PXRRScreenSize{. - cdecl, dynlib: libXrandr, importc.} -proc XRRConfigRates*(config: PXRRScreenConfiguration, sizeID: cint, - nrates: Pcint): ptr int16{.cdecl, dynlib: libXrandr, importc.} -proc XRRConfigCurrentConfiguration*(config: PXRRScreenConfiguration, - rotation: PRotation): TSizeID{.cdecl, - dynlib: libXrandr, importc.} -proc XRRConfigCurrentRate*(config: PXRRScreenConfiguration): cshort{.cdecl, - dynlib: libXrandr, importc.} -proc XRRRootToScreen*(dpy: PDisplay, root: TWindow): cint{.cdecl, - dynlib: libXrandr, importc.} - # - # returns the screen configuration for the specified screen; does a lazy - # evalution to delay getting the information, and caches the result. - # These routines should be used in preference to XRRGetScreenInfo - # to avoid unneeded round trips to the X server. These are new - # in protocol version 0.1. - # -proc XRRScreenConfig*(dpy: PDisplay, screen: cint): PXRRScreenConfiguration{. - cdecl, dynlib: libXrandr, importc.} -proc XRRConfig*(screen: PScreen): PXRRScreenConfiguration{.cdecl, - dynlib: libXrandr, importc.} -proc XRRSelectInput*(dpy: PDisplay, window: TWindow, mask: cint){.cdecl, - dynlib: libXrandr, importc.} - # - # the following are always safe to call, even if RandR is not implemented - # on a screen - # -proc XRRRotations*(dpy: PDisplay, screen: cint, current_rotation: PRotation): TRotation{. - cdecl, dynlib: libXrandr, importc.} -proc XRRSizes*(dpy: PDisplay, screen: cint, nsizes: Pcint): PXRRScreenSize{. - cdecl, dynlib: libXrandr, importc.} -proc XRRRates*(dpy: PDisplay, screen: cint, sizeID: cint, nrates: Pcint): ptr int16{. - cdecl, dynlib: libXrandr, importc.} -proc XRRTimes*(dpy: PDisplay, screen: cint, config_timestamp: PTime): TTime{. - cdecl, dynlib: libXrandr, importc.} - # - # intended to take RRScreenChangeNotify, or - # ConfigureNotify (on the root window) - # returns 1 if it is an event type it understands, 0 if not - # -proc XRRUpdateConfiguration*(event: PXEvent): cint{.cdecl, dynlib: libXrandr, - importc.} -# implementation diff --git a/lib/wrappers/x11/xrender.nim b/lib/wrappers/x11/xrender.nim deleted file mode 100644 index c4b2b364dd..0000000000 --- a/lib/wrappers/x11/xrender.nim +++ /dev/null @@ -1,241 +0,0 @@ - -import - x, xlib - -when defined(use_pkg_config) or defined(use_pkg_config_static): - {.pragma: libxrender, cdecl, importc.} - when defined(use_pkg_config): - {.passl: gorge("pkg-config xrender --libs").} - else: - {.passl: gorge("pkg-config xrender --static --libs").} -else: - when defined(macosx): - const - libXrender* = "libXrender.dylib" - else: - const - libXrender* = "libXrender.so" - - - {.pragma: libxrender, dynlib: libXrender, cdecl, importc.} -#const -# libXrender* = "libXrender.so" - -# -# Automatically converted by H2Pas 0.99.15 from xrender.h -# The following command line parameters were used: -# -p -# -T -# -S -# -d -# -c -# xrender.h -# - -type - PGlyph* = ptr TGlyph - TGlyph* = int32 - PGlyphSet* = ptr TGlyphSet - TGlyphSet* = int32 - PPicture* = ptr TPicture - TPicture* = int32 - PPictFormat* = ptr TPictFormat - TPictFormat* = int32 - -const - RENDER_NAME* = "RENDER" - RENDER_MAJOR* = 0 - RENDER_MINOR* = 0 - constX_RenderQueryVersion* = 0 - X_RenderQueryPictFormats* = 1 - X_RenderQueryPictIndexValues* = 2 - X_RenderQueryDithers* = 3 - constX_RenderCreatePicture* = 4 - constX_RenderChangePicture* = 5 - X_RenderSetPictureClipRectangles* = 6 - constX_RenderFreePicture* = 7 - constX_RenderComposite* = 8 - X_RenderScale* = 9 - X_RenderTrapezoids* = 10 - X_RenderTriangles* = 11 - X_RenderTriStrip* = 12 - X_RenderTriFan* = 13 - X_RenderColorTrapezoids* = 14 - X_RenderColorTriangles* = 15 - X_RenderTransform* = 16 - constX_RenderCreateGlyphSet* = 17 - constX_RenderReferenceGlyphSet* = 18 - constX_RenderFreeGlyphSet* = 19 - constX_RenderAddGlyphs* = 20 - constX_RenderAddGlyphsFromPicture* = 21 - constX_RenderFreeGlyphs* = 22 - constX_RenderCompositeGlyphs8* = 23 - constX_RenderCompositeGlyphs16* = 24 - constX_RenderCompositeGlyphs32* = 25 - BadPictFormat* = 0 - BadPicture* = 1 - BadPictOp* = 2 - BadGlyphSet* = 3 - BadGlyph* = 4 - RenderNumberErrors* = BadGlyph + 1 - PictTypeIndexed* = 0 - PictTypeDirect* = 1 - PictOpClear* = 0 - PictOpSrc* = 1 - PictOpDst* = 2 - PictOpOver* = 3 - PictOpOverReverse* = 4 - PictOpIn* = 5 - PictOpInReverse* = 6 - PictOpOut* = 7 - PictOpOutReverse* = 8 - PictOpAtop* = 9 - PictOpAtopReverse* = 10 - PictOpXor* = 11 - PictOpAdd* = 12 - PictOpSaturate* = 13 - PictOpMaximum* = 13 - PolyEdgeSharp* = 0 - PolyEdgeSmooth* = 1 - PolyModePrecise* = 0 - PolyModeImprecise* = 1 - CPRepeat* = 1 shl 0 - CPAlphaMap* = 1 shl 1 - CPAlphaXOrigin* = 1 shl 2 - CPAlphaYOrigin* = 1 shl 3 - CPClipXOrigin* = 1 shl 4 - CPClipYOrigin* = 1 shl 5 - CPClipMask* = 1 shl 6 - CPGraphicsExposure* = 1 shl 7 - CPSubwindowMode* = 1 shl 8 - CPPolyEdge* = 1 shl 9 - CPPolyMode* = 1 shl 10 - CPDither* = 1 shl 11 - CPLastBit* = 11 - -type - PXRenderDirectFormat* = ptr TXRenderDirectFormat - TXRenderDirectFormat*{.final.} = object - red*: int16 - redMask*: int16 - green*: int16 - greenMask*: int16 - blue*: int16 - blueMask*: int16 - alpha*: int16 - alphaMask*: int16 - - PXRenderPictFormat* = ptr TXRenderPictFormat - TXRenderPictFormat*{.final.} = object - id*: TPictFormat - thetype*: int32 - depth*: int32 - direct*: TXRenderDirectFormat - colormap*: TColormap - - -const - PictFormatID* = 1 shl 0 - PictFormatType* = 1 shl 1 - PictFormatDepth* = 1 shl 2 - PictFormatRed* = 1 shl 3 - PictFormatRedMask* = 1 shl 4 - PictFormatGreen* = 1 shl 5 - PictFormatGreenMask* = 1 shl 6 - PictFormatBlue* = 1 shl 7 - PictFormatBlueMask* = 1 shl 8 - PictFormatAlpha* = 1 shl 9 - PictFormatAlphaMask* = 1 shl 10 - PictFormatColormap* = 1 shl 11 - -type - PXRenderVisual* = ptr TXRenderVisual - TXRenderVisual*{.final.} = object - visual*: PVisual - format*: PXRenderPictFormat - - PXRenderDepth* = ptr TXRenderDepth - TXRenderDepth*{.final.} = object - depth*: int32 - nvisuals*: int32 - visuals*: PXRenderVisual - - PXRenderScreen* = ptr TXRenderScreen - TXRenderScreen*{.final.} = object - depths*: PXRenderDepth - ndepths*: int32 - fallback*: PXRenderPictFormat - - PXRenderInfo* = ptr TXRenderInfo - TXRenderInfo*{.final.} = object - format*: PXRenderPictFormat - nformat*: int32 - screen*: PXRenderScreen - nscreen*: int32 - depth*: PXRenderDepth - ndepth*: int32 - visual*: PXRenderVisual - nvisual*: int32 - - PXRenderPictureAttributes* = ptr TXRenderPictureAttributes - TXRenderPictureAttributes*{.final.} = object - repeat*: TBool - alpha_map*: TPicture - alpha_x_origin*: int32 - alpha_y_origin*: int32 - clip_x_origin*: int32 - clip_y_origin*: int32 - clip_mask*: TPixmap - graphics_exposures*: TBool - subwindow_mode*: int32 - poly_edge*: int32 - poly_mode*: int32 - dither*: TAtom - - PXGlyphInfo* = ptr TXGlyphInfo - TXGlyphInfo*{.final.} = object - width*: int16 - height*: int16 - x*: int16 - y*: int16 - xOff*: int16 - yOff*: int16 - - -proc XRenderQueryExtension*(dpy: PDisplay, event_basep: ptr int32, - error_basep: ptr int32): TBool{.libxrender.} -proc XRenderQueryVersion*(dpy: PDisplay, major_versionp: ptr int32, - minor_versionp: ptr int32): TStatus{.libxrender.} -proc XRenderQueryFormats*(dpy: PDisplay): TStatus{.libxrender.} -proc XRenderFindVisualFormat*(dpy: PDisplay, visual: PVisual): PXRenderPictFormat{. - libxrender.} -proc XRenderFindFormat*(dpy: PDisplay, mask: int32, - `template`: PXRenderPictFormat, count: int32): PXRenderPictFormat{. - libxrender.} -proc XRenderCreatePicture*(dpy: PDisplay, drawable: TDrawable, - format: PXRenderPictFormat, valuemask: int32, - attributes: PXRenderPictureAttributes): TPicture{. - libxrender.} -proc XRenderChangePicture*(dpy: PDisplay, picture: TPicture, valuemask: int32, - attributes: PXRenderPictureAttributes){.libxrender.} -proc XRenderFreePicture*(dpy: PDisplay, picture: TPicture){.libxrender.} -proc XRenderComposite*(dpy: PDisplay, op: int32, src: TPicture, mask: TPicture, - dst: TPicture, src_x: int32, src_y: int32, mask_x: int32, - mask_y: int32, dst_x: int32, dst_y: int32, width: int32, - height: int32){.libxrender.} -proc XRenderCreateGlyphSet*(dpy: PDisplay, format: PXRenderPictFormat): TGlyphSet{. - libxrender.} -proc XRenderReferenceGlyphSet*(dpy: PDisplay, existing: TGlyphSet): TGlyphSet{. - libxrender.} -proc XRenderFreeGlyphSet*(dpy: PDisplay, glyphset: TGlyphSet){.libxrender.} -proc XRenderAddGlyphs*(dpy: PDisplay, glyphset: TGlyphSet, gids: PGlyph, - glyphs: PXGlyphInfo, nglyphs: int32, images: cstring, - nbyte_images: int32){.libxrender.} -proc XRenderFreeGlyphs*(dpy: PDisplay, glyphset: TGlyphSet, gids: PGlyph, - nglyphs: int32){.libxrender.} -proc XRenderCompositeString8*(dpy: PDisplay, op: int32, src: TPicture, - dst: TPicture, maskFormat: PXRenderPictFormat, - glyphset: TGlyphSet, xSrc: int32, ySrc: int32, - xDst: int32, yDst: int32, str: cstring, - nchar: int32){.libxrender.} -# implementation diff --git a/lib/wrappers/x11/xresource.nim b/lib/wrappers/x11/xresource.nim deleted file mode 100644 index f553b44137..0000000000 --- a/lib/wrappers/x11/xresource.nim +++ /dev/null @@ -1,200 +0,0 @@ - -import - x, xlib - -#const -# libX11* = "libX11.so" - -# -# Automatically converted by H2Pas 0.99.15 from xresource.h -# The following command line parameters were used: -# -p -# -T -# -S -# -d -# -c -# xresource.h -# - -proc Xpermalloc*(para1: int32): cstring{.cdecl, dynlib: libX11, importc.} -type - PXrmQuark* = ptr TXrmQuark - TXrmQuark* = int32 - TXrmQuarkList* = PXrmQuark - PXrmQuarkList* = ptr TXrmQuarkList - -proc NULLQUARK*(): TXrmQuark -type - PXrmString* = ptr TXrmString - TXrmString* = ptr char - -proc NULLSTRING*(): TXrmString -proc XrmStringToQuark*(para1: cstring): TXrmQuark{.cdecl, dynlib: libX11, - importc.} -proc XrmPermStringToQuark*(para1: cstring): TXrmQuark{.cdecl, dynlib: libX11, - importc.} -proc XrmQuarkToString*(para1: TXrmQuark): TXrmString{.cdecl, dynlib: libX11, - importc.} -proc XrmUniqueQuark*(): TXrmQuark{.cdecl, dynlib: libX11, importc.} -when defined(MACROS): - proc XrmStringsEqual*(a1, a2: cstring): bool -type - PXrmBinding* = ptr TXrmBinding - TXrmBinding* = enum - XrmBindTightly, XrmBindLoosely - TXrmBindingList* = PXrmBinding - PXrmBindingList* = ptr TXrmBindingList - -proc XrmStringToQuarkList*(para1: cstring, para2: TXrmQuarkList){.cdecl, - dynlib: libX11, importc.} -proc XrmStringToBindingQuarkList*(para1: cstring, para2: TXrmBindingList, - para3: TXrmQuarkList){.cdecl, dynlib: libX11, - importc.} -type - PXrmName* = ptr TXrmName - TXrmName* = TXrmQuark - PXrmNameList* = ptr TXrmNameList - TXrmNameList* = TXrmQuarkList - -when defined(MACROS): - proc XrmNameToString*(name: int32): TXrmString - proc XrmStringToName*(str: cstring): int32 - proc XrmStringToNameList*(str: cstring, name: PXrmQuark) -type - PXrmClass* = ptr TXrmClass - TXrmClass* = TXrmQuark - PXrmClassList* = ptr TXrmClassList - TXrmClassList* = TXrmQuarkList - -when defined(MACROS): - proc XrmClassToString*(c_class: int32): TXrmString - proc XrmStringToClass*(c_class: cstring): int32 - proc XrmStringToClassList*(str: cstring, c_class: PXrmQuark) -type - PXrmRepresentation* = ptr TXrmRepresentation - TXrmRepresentation* = TXrmQuark - -when defined(MACROS): - proc XrmStringToRepresentation*(str: cstring): int32 - proc XrmRepresentationToString*(thetype: int32): TXrmString -type - PXrmValue* = ptr TXrmValue - TXrmValue*{.final.} = object - size*: int32 - address*: TXPointer - - TXrmValuePtr* = PXrmValue - PXrmValuePtr* = ptr TXrmValuePtr - PXrmHashBucketRec* = ptr TXrmHashBucketRec - TXrmHashBucketRec*{.final.} = object - TXrmHashBucket* = PXrmHashBucketRec - PXrmHashBucket* = ptr TXrmHashBucket - PXrmHashTable* = ptr TXrmHashTable - TXrmHashTable* = ptr TXrmHashBucket - TXrmDatabase* = PXrmHashBucketRec - PXrmDatabase* = ptr TXrmDatabase - -proc XrmDestroyDatabase*(para1: TXrmDatabase){.cdecl, dynlib: libX11, importc.} -proc XrmQPutResource*(para1: PXrmDatabase, para2: TXrmBindingList, - para3: TXrmQuarkList, para4: TXrmRepresentation, - para5: PXrmValue){.cdecl, dynlib: libX11, importc.} -proc XrmPutResource*(para1: PXrmDatabase, para2: cstring, para3: cstring, - para4: PXrmValue){.cdecl, dynlib: libX11, importc.} -proc XrmQPutStringResource*(para1: PXrmDatabase, para2: TXrmBindingList, - para3: TXrmQuarkList, para4: cstring){.cdecl, - dynlib: libX11, importc.} -proc XrmPutStringResource*(para1: PXrmDatabase, para2: cstring, para3: cstring){. - cdecl, dynlib: libX11, importc.} -proc XrmPutLineResource*(para1: PXrmDatabase, para2: cstring){.cdecl, - dynlib: libX11, importc.} -proc XrmQGetResource*(para1: TXrmDatabase, para2: TXrmNameList, - para3: TXrmClassList, para4: PXrmRepresentation, - para5: PXrmValue): TBool{.cdecl, dynlib: libX11, importc.} -proc XrmGetResource*(para1: TXrmDatabase, para2: cstring, para3: cstring, - para4: PPchar, para5: PXrmValue): TBool{.cdecl, - dynlib: libX11, importc.} - # There is no definition of TXrmSearchList - #function XrmQGetSearchList(para1:TXrmDatabase; para2:TXrmNameList; para3:TXrmClassList; para4:TXrmSearchList; para5:longint):TBool;cdecl;external libX11; - #function XrmQGetSearchResource(para1:TXrmSearchList; para2:TXrmName; para3:TXrmClass; para4:PXrmRepresentation; para5:PXrmValue):TBool;cdecl;external libX11; -proc XrmSetDatabase*(para1: PDisplay, para2: TXrmDatabase){.cdecl, - dynlib: libX11, importc.} -proc XrmGetDatabase*(para1: PDisplay): TXrmDatabase{.cdecl, dynlib: libX11, - importc.} -proc XrmGetFileDatabase*(para1: cstring): TXrmDatabase{.cdecl, dynlib: libX11, - importc.} -proc XrmCombineFileDatabase*(para1: cstring, para2: PXrmDatabase, para3: TBool): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XrmGetStringDatabase*(para1: cstring): TXrmDatabase{.cdecl, dynlib: libX11, - importc.} -proc XrmPutFileDatabase*(para1: TXrmDatabase, para2: cstring){.cdecl, - dynlib: libX11, importc.} -proc XrmMergeDatabases*(para1: TXrmDatabase, para2: PXrmDatabase){.cdecl, - dynlib: libX11, importc.} -proc XrmCombineDatabase*(para1: TXrmDatabase, para2: PXrmDatabase, para3: TBool){. - cdecl, dynlib: libX11, importc.} -const - XrmEnumAllLevels* = 0 - XrmEnumOneLevel* = 1 - -type - funcbool* = proc (): TBool {.cdecl.} - -proc XrmEnumerateDatabase*(para1: TXrmDatabase, para2: TXrmNameList, - para3: TXrmClassList, para4: int32, para5: funcbool, - para6: TXPointer): TBool{.cdecl, dynlib: libX11, - importc.} -proc XrmLocaleOfDatabase*(para1: TXrmDatabase): cstring{.cdecl, dynlib: libX11, - importc.} -type - PXrmOptionKind* = ptr TXrmOptionKind - TXrmOptionKind* = enum - XrmoptionNoArg, XrmoptionIsArg, XrmoptionStickyArg, XrmoptionSepArg, - XrmoptionResArg, XrmoptionSkipArg, XrmoptionSkipLine, XrmoptionSkipNArgs - PXrmOptionDescRec* = ptr TXrmOptionDescRec - TXrmOptionDescRec*{.final.} = object - option*: cstring - specifier*: cstring - argKind*: TXrmOptionKind - value*: TXPointer - - TXrmOptionDescList* = PXrmOptionDescRec - PXrmOptionDescList* = ptr TXrmOptionDescList - -proc XrmParseCommand*(para1: PXrmDatabase, para2: TXrmOptionDescList, - para3: int32, para4: cstring, para5: ptr int32, - para6: PPchar){.cdecl, dynlib: libX11, importc.} -# implementation - -proc NULLQUARK(): TXrmQuark = - result = TXrmQuark(0) - -proc NULLSTRING(): TXrmString = - result = nil - -when defined(MACROS): - proc XrmStringsEqual(a1, a2: cstring): bool = - result = (strcomp(a1, a2)) == 0 - - proc XrmNameToString(name: int32): TXrmString = - result = XrmQuarkToString(name) - - proc XrmStringToName(str: cstring): int32 = - result = XrmStringToQuark(str) - - proc XrmStringToNameList(str: cstring, name: PXrmQuark) = - XrmStringToQuarkList(str, name) - - proc XrmClassToString(c_class: int32): TXrmString = - result = XrmQuarkToString(c_class) - - proc XrmStringToClass(c_class: cstring): int32 = - result = XrmStringToQuark(c_class) - - proc XrmStringToClassList(str: cstring, c_class: PXrmQuark) = - XrmStringToQuarkList(str, c_class) - - proc XrmStringToRepresentation(str: cstring): int32 = - result = XrmStringToQuark(str) - - proc XrmRepresentationToString(thetype: int32): TXrmString = - result = XrmQuarkToString(thetype) diff --git a/lib/wrappers/x11/xshm.nim b/lib/wrappers/x11/xshm.nim deleted file mode 100644 index e56bd87b1f..0000000000 --- a/lib/wrappers/x11/xshm.nim +++ /dev/null @@ -1,77 +0,0 @@ - -import - x, xlib - -#const -# libX11* = "libX11.so" - -# -# Automatically converted by H2Pas 0.99.15 from xshm.h -# The following command line parameters were used: -# -p -# -T -# -S -# -d -# -c -# xshm.h -# - -const - constX_ShmQueryVersion* = 0 - constX_ShmAttach* = 1 - constX_ShmDetach* = 2 - constX_ShmPutImage* = 3 - constX_ShmGetImage* = 4 - constX_ShmCreatePixmap* = 5 - ShmCompletion* = 0 - ShmNumberEvents* = ShmCompletion + 1 - BadShmSeg* = 0 - ShmNumberErrors* = BadShmSeg + 1 - -type - PShmSeg* = ptr TShmSeg - TShmSeg* = culong - PXShmCompletionEvent* = ptr TXShmCompletionEvent - TXShmCompletionEvent*{.final.} = object - theType*: cint - serial*: culong - send_event*: TBool - display*: PDisplay - drawable*: TDrawable - major_code*: cint - minor_code*: cint - shmseg*: TShmSeg - offset*: culong - - PXShmSegmentInfo* = ptr TXShmSegmentInfo - TXShmSegmentInfo*{.final.} = object - shmseg*: TShmSeg - shmid*: cint - shmaddr*: cstring - readOnly*: TBool - - -proc XShmQueryExtension*(para1: PDisplay): TBool{.cdecl, dynlib: libX11, importc.} -proc XShmGetEventBase*(para1: PDisplay): cint{.cdecl, dynlib: libX11, importc.} -proc XShmQueryVersion*(para1: PDisplay, para2: Pcint, para3: Pcint, para4: PBool): TBool{. - cdecl, dynlib: libX11, importc.} -proc XShmPixmapFormat*(para1: PDisplay): cint{.cdecl, dynlib: libX11, importc.} -proc XShmAttach*(para1: PDisplay, para2: PXShmSegmentInfo): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XShmDetach*(para1: PDisplay, para2: PXShmSegmentInfo): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XShmPutImage*(para1: PDisplay, para2: TDrawable, para3: TGC, - para4: PXImage, para5: cint, para6: cint, para7: cint, - para8: cint, para9: cuint, para10: cuint, para11: TBool): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XShmGetImage*(para1: PDisplay, para2: TDrawable, para3: PXImage, - para4: cint, para5: cint, para6: culong): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XShmCreateImage*(para1: PDisplay, para2: PVisual, para3: cuint, - para4: cint, para5: cstring, para6: PXShmSegmentInfo, - para7: cuint, para8: cuint): PXImage{.cdecl, - dynlib: libX11, importc.} -proc XShmCreatePixmap*(para1: PDisplay, para2: TDrawable, para3: cstring, - para4: PXShmSegmentInfo, para5: cuint, para6: cuint, - para7: cuint): TPixmap{.cdecl, dynlib: libX11, importc.} -# implementation diff --git a/lib/wrappers/x11/xutil.nim b/lib/wrappers/x11/xutil.nim deleted file mode 100644 index 9a3435aa5d..0000000000 --- a/lib/wrappers/x11/xutil.nim +++ /dev/null @@ -1,412 +0,0 @@ - -import - x, xlib, keysym, unsigned - -#const -# libX11* = "libX11.so" - -# -# Automatically converted by H2Pas 0.99.15 from xutil.h -# The following command line parameters were used: -# -p -# -T -# -S -# -d -# -c -# xutil.h -# - -const - NoValue* = 0x00000000 - XValue* = 0x00000001 - YValue* = 0x00000002 - WidthValue* = 0x00000004 - HeightValue* = 0x00000008 - AllValues* = 0x0000000F - XNegative* = 0x00000010 - YNegative* = 0x00000020 - -type - TCPoint*{.final.} = object - x*: cint - y*: cint - - PXSizeHints* = ptr TXSizeHints - TXSizeHints*{.final.} = object - flags*: clong - x*, y*: cint - width*, height*: cint - min_width*, min_height*: cint - max_width*, max_height*: cint - width_inc*, height_inc*: cint - min_aspect*, max_aspect*: TCPoint - base_width*, base_height*: cint - win_gravity*: cint - - -const - USPosition* = 1 shl 0 - USSize* = 1 shl 1 - PPosition* = 1 shl 2 - PSize* = 1 shl 3 - PMinSize* = 1 shl 4 - PMaxSize* = 1 shl 5 - PResizeInc* = 1 shl 6 - PAspect* = 1 shl 7 - PBaseSize* = 1 shl 8 - PWinGravity* = 1 shl 9 - PAllHints* = PPosition or PSize or PMinSize or PMaxSize or PResizeInc or - PAspect - -type - PXWMHints* = ptr TXWMHints - TXWMHints*{.final.} = object - flags*: clong - input*: TBool - initial_state*: cint - icon_pixmap*: TPixmap - icon_window*: TWindow - icon_x*, icon_y*: cint - icon_mask*: TPixmap - window_group*: TXID - - -const - InputHint* = 1 shl 0 - StateHint* = 1 shl 1 - IconPixmapHint* = 1 shl 2 - IconWindowHint* = 1 shl 3 - IconPositionHint* = 1 shl 4 - IconMaskHint* = 1 shl 5 - WindowGroupHint* = 1 shl 6 - AllHints* = InputHint or StateHint or IconPixmapHint or IconWindowHint or - IconPositionHint or IconMaskHint or WindowGroupHint - XUrgencyHint* = 1 shl 8 - WithdrawnState* = 0 - NormalState* = 1 - IconicState* = 3 - DontCareState* = 0 - ZoomState* = 2 - InactiveState* = 4 - -type - PXTextProperty* = ptr TXTextProperty - TXTextProperty*{.final.} = object - value*: pcuchar - encoding*: TAtom - format*: cint - nitems*: culong - - -const - XNoMemory* = - 1 - XLocaleNotSupported* = - 2 - XConverterNotFound* = - 3 - -type - PXICCEncodingStyle* = ptr TXICCEncodingStyle - TXICCEncodingStyle* = enum - XStringStyle, XCompoundTextStyle, XTextStyle, XStdICCTextStyle, - XUTF8StringStyle - PPXIconSize* = ptr PXIconSize - PXIconSize* = ptr TXIconSize - TXIconSize*{.final.} = object - min_width*, min_height*: cint - max_width*, max_height*: cint - width_inc*, height_inc*: cint - - PXClassHint* = ptr TXClassHint - TXClassHint*{.final.} = object - res_name*: cstring - res_class*: cstring - - -type - PXComposeStatus* = ptr TXComposeStatus - TXComposeStatus*{.final.} = object - compose_ptr*: TXPointer - chars_matched*: cint - - -type - PXRegion* = ptr TXRegion - TXRegion*{.final.} = object - TRegion* = PXRegion - PRegion* = ptr TRegion - -const - RectangleOut* = 0 - RectangleIn* = 1 - RectanglePart* = 2 - -type - PXVisualInfo* = ptr TXVisualInfo - TXVisualInfo*{.final.} = object - visual*: PVisual - visualid*: TVisualID - screen*: cint - depth*: cint - class*: cint - red_mask*: culong - green_mask*: culong - blue_mask*: culong - colormap_size*: cint - bits_per_rgb*: cint - - -const - VisualNoMask* = 0x00000000 - VisualIDMask* = 0x00000001 - VisualScreenMask* = 0x00000002 - VisualDepthMask* = 0x00000004 - VisualClassMask* = 0x00000008 - VisualRedMaskMask* = 0x00000010 - VisualGreenMaskMask* = 0x00000020 - VisualBlueMaskMask* = 0x00000040 - VisualColormapSizeMask* = 0x00000080 - VisualBitsPerRGBMask* = 0x00000100 - VisualAllMask* = 0x000001FF - -type - PPXStandardColormap* = ptr PXStandardColormap - PXStandardColormap* = ptr TXStandardColormap - TXStandardColormap*{.final.} = object - colormap*: TColormap - red_max*: culong - red_mult*: culong - green_max*: culong - green_mult*: culong - blue_max*: culong - blue_mult*: culong - base_pixel*: culong - visualid*: TVisualID - killid*: TXID - - -const - BitmapSuccess* = 0 - BitmapOpenFailed* = 1 - BitmapFileInvalid* = 2 - BitmapNoMemory* = 3 - XCSUCCESS* = 0 - XCNOMEM* = 1 - XCNOENT* = 2 - ReleaseByFreeingColormap*: TXID = TXID(1) - -type - PXContext* = ptr TXContext - TXContext* = cint - -proc XAllocClassHint*(): PXClassHint{.cdecl, dynlib: libX11, importc.} -proc XAllocIconSize*(): PXIconSize{.cdecl, dynlib: libX11, importc.} -proc XAllocSizeHints*(): PXSizeHints{.cdecl, dynlib: libX11, importc.} -proc XAllocStandardColormap*(): PXStandardColormap{.cdecl, dynlib: libX11, - importc.} -proc XAllocWMHints*(): PXWMHints{.cdecl, dynlib: libX11, importc.} -proc XClipBox*(para1: TRegion, para2: PXRectangle): cint{.cdecl, dynlib: libX11, - importc.} -proc XCreateRegion*(): TRegion{.cdecl, dynlib: libX11, importc.} -proc XDefaultString*(): cstring{.cdecl, dynlib: libX11, importc.} -proc XDeleteContext*(para1: PDisplay, para2: TXID, para3: TXContext): cint{. - cdecl, dynlib: libX11, importc.} -proc XDestroyRegion*(para1: TRegion): cint{.cdecl, dynlib: libX11, importc.} -proc XEmptyRegion*(para1: TRegion): cint{.cdecl, dynlib: libX11, importc.} -proc XEqualRegion*(para1: TRegion, para2: TRegion): cint{.cdecl, dynlib: libX11, - importc.} -proc XFindContext*(para1: PDisplay, para2: TXID, para3: TXContext, - para4: PXPointer): cint{.cdecl, dynlib: libX11, importc.} -proc XGetClassHint*(para1: PDisplay, para2: TWindow, para3: PXClassHint): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XGetIconSizes*(para1: PDisplay, para2: TWindow, para3: PPXIconSize, - para4: Pcint): TStatus{.cdecl, dynlib: libX11, importc.} -proc XGetNormalHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XGetRGBColormaps*(para1: PDisplay, para2: TWindow, - para3: PPXStandardColormap, para4: Pcint, para5: TAtom): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XGetSizeHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints, - para4: TAtom): TStatus{.cdecl, dynlib: libX11, importc.} -proc XGetStandardColormap*(para1: PDisplay, para2: TWindow, - para3: PXStandardColormap, para4: TAtom): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XGetTextProperty*(para1: PDisplay, para2: TWindow, para3: PXTextProperty, - para4: TAtom): TStatus{.cdecl, dynlib: libX11, importc.} -proc XGetVisualInfo*(para1: PDisplay, para2: clong, para3: PXVisualInfo, - para4: Pcint): PXVisualInfo{.cdecl, dynlib: libX11, importc.} -proc XGetWMClientMachine*(para1: PDisplay, para2: TWindow, para3: PXTextProperty): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XGetWMHints*(para1: PDisplay, para2: TWindow): PXWMHints{.cdecl, - dynlib: libX11, importc.} -proc XGetWMIconName*(para1: PDisplay, para2: TWindow, para3: PXTextProperty): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XGetWMName*(para1: PDisplay, para2: TWindow, para3: PXTextProperty): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XGetWMNormalHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints, - para4: ptr int): TStatus{.cdecl, dynlib: libX11, importc.} -proc XGetWMSizeHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints, - para4: ptr int, para5: TAtom): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XGetZoomHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints): TStatus{. - cdecl, dynlib: libX11, importc.} -proc XIntersectRegion*(para1: TRegion, para2: TRegion, para3: TRegion): cint{. - cdecl, dynlib: libX11, importc.} -proc XConvertCase*(para1: TKeySym, para2: PKeySym, para3: PKeySym){.cdecl, - dynlib: libX11, importc.} -proc XLookupString*(para1: PXKeyEvent, para2: cstring, para3: cint, - para4: PKeySym, para5: PXComposeStatus): cint{.cdecl, - dynlib: libX11, importc.} -proc XMatchVisualInfo*(para1: PDisplay, para2: cint, para3: cint, para4: cint, - para5: PXVisualInfo): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XOffsetRegion*(para1: TRegion, para2: cint, para3: cint): cint{.cdecl, - dynlib: libX11, importc.} -proc XPointInRegion*(para1: TRegion, para2: cint, para3: cint): TBool{.cdecl, - dynlib: libX11, importc.} -proc XPolygonRegion*(para1: PXPoint, para2: cint, para3: cint): TRegion{.cdecl, - dynlib: libX11, importc.} -proc XRectInRegion*(para1: TRegion, para2: cint, para3: cint, para4: cuint, - para5: cuint): cint{.cdecl, dynlib: libX11, importc.} -proc XSaveContext*(para1: PDisplay, para2: TXID, para3: TXContext, - para4: cstring): cint{.cdecl, dynlib: libX11, importc.} -proc XSetClassHint*(para1: PDisplay, para2: TWindow, para3: PXClassHint): cint{. - cdecl, dynlib: libX11, importc.} -proc XSetIconSizes*(para1: PDisplay, para2: TWindow, para3: PXIconSize, - para4: cint): cint{.cdecl, dynlib: libX11, importc.} -proc XSetNormalHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints): cint{. - cdecl, dynlib: libX11, importc.} -proc XSetRGBColormaps*(para1: PDisplay, para2: TWindow, - para3: PXStandardColormap, para4: cint, para5: TAtom){. - cdecl, dynlib: libX11, importc.} -proc XSetSizeHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints, - para4: TAtom): cint{.cdecl, dynlib: libX11, importc.} -proc XSetStandardProperties*(para1: PDisplay, para2: TWindow, para3: cstring, - para4: cstring, para5: TPixmap, para6: PPchar, - para7: cint, para8: PXSizeHints): cint{.cdecl, - dynlib: libX11, importc.} -proc XSetTextProperty*(para1: PDisplay, para2: TWindow, para3: PXTextProperty, - para4: TAtom){.cdecl, dynlib: libX11, importc.} -proc XSetWMClientMachine*(para1: PDisplay, para2: TWindow, para3: PXTextProperty){. - cdecl, dynlib: libX11, importc.} -proc XSetWMHints*(para1: PDisplay, para2: TWindow, para3: PXWMHints): cint{. - cdecl, dynlib: libX11, importc.} -proc XSetWMIconName*(para1: PDisplay, para2: TWindow, para3: PXTextProperty){. - cdecl, dynlib: libX11, importc.} -proc XSetWMName*(para1: PDisplay, para2: TWindow, para3: PXTextProperty){.cdecl, - dynlib: libX11, importc.} -proc XSetWMNormalHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints){. - cdecl, dynlib: libX11, importc.} -proc XSetWMProperties*(para1: PDisplay, para2: TWindow, para3: PXTextProperty, - para4: PXTextProperty, para5: PPchar, para6: cint, - para7: PXSizeHints, para8: PXWMHints, para9: PXClassHint){. - cdecl, dynlib: libX11, importc.} -proc XmbSetWMProperties*(para1: PDisplay, para2: TWindow, para3: cstring, - para4: cstring, para5: PPchar, para6: cint, - para7: PXSizeHints, para8: PXWMHints, - para9: PXClassHint){.cdecl, dynlib: libX11, importc.} -proc Xutf8SetWMProperties*(para1: PDisplay, para2: TWindow, para3: cstring, - para4: cstring, para5: PPchar, para6: cint, - para7: PXSizeHints, para8: PXWMHints, - para9: PXClassHint){.cdecl, dynlib: libX11, importc.} -proc XSetWMSizeHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints, - para4: TAtom){.cdecl, dynlib: libX11, importc.} -proc XSetRegion*(para1: PDisplay, para2: TGC, para3: TRegion): cint{.cdecl, - dynlib: libX11, importc.} -proc XSetStandardColormap*(para1: PDisplay, para2: TWindow, - para3: PXStandardColormap, para4: TAtom){.cdecl, - dynlib: libX11, importc.} -proc XSetZoomHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints): cint{. - cdecl, dynlib: libX11, importc.} -proc XShrinkRegion*(para1: TRegion, para2: cint, para3: cint): cint{.cdecl, - dynlib: libX11, importc.} -proc XStringListToTextProperty*(para1: PPchar, para2: cint, - para3: PXTextProperty): TStatus{.cdecl, - dynlib: libX11, importc.} -proc XSubtractRegion*(para1: TRegion, para2: TRegion, para3: TRegion): cint{. - cdecl, dynlib: libX11, importc.} -proc XmbTextListToTextProperty*(para1: PDisplay, para2: PPchar, para3: cint, - para4: TXICCEncodingStyle, para5: PXTextProperty): cint{. - cdecl, dynlib: libX11, importc.} -proc XwcTextListToTextProperty*(para1: PDisplay, para2: ptr ptr int16, para3: cint, - para4: TXICCEncodingStyle, para5: PXTextProperty): cint{. - cdecl, dynlib: libX11, importc.} -proc Xutf8TextListToTextProperty*(para1: PDisplay, para2: PPchar, para3: cint, - para4: TXICCEncodingStyle, - para5: PXTextProperty): cint{.cdecl, - dynlib: libX11, importc.} -proc XwcFreeStringList*(para1: ptr ptr int16){.cdecl, dynlib: libX11, importc.} -proc XTextPropertyToStringList*(para1: PXTextProperty, para2: PPPchar, - para3: Pcint): TStatus{.cdecl, dynlib: libX11, - importc.} -proc XmbTextPropertyToTextList*(para1: PDisplay, para2: PXTextProperty, - para3: PPPchar, para4: Pcint): cint{.cdecl, - dynlib: libX11, importc.} -proc XwcTextPropertyToTextList*(para1: PDisplay, para2: PXTextProperty, - para3: ptr ptr ptr int16, para4: Pcint): cint{.cdecl, - dynlib: libX11, importc.} -proc Xutf8TextPropertyToTextList*(para1: PDisplay, para2: PXTextProperty, - para3: PPPchar, para4: Pcint): cint{.cdecl, - dynlib: libX11, importc.} -proc XUnionRectWithRegion*(para1: PXRectangle, para2: TRegion, para3: TRegion): cint{. - cdecl, dynlib: libX11, importc.} -proc XUnionRegion*(para1: TRegion, para2: TRegion, para3: TRegion): cint{.cdecl, - dynlib: libX11, importc.} -proc XWMGeometry*(para1: PDisplay, para2: cint, para3: cstring, para4: cstring, - para5: cuint, para6: PXSizeHints, para7: Pcint, para8: Pcint, - para9: Pcint, para10: Pcint, para11: Pcint): cint{.cdecl, - dynlib: libX11, importc.} -proc XXorRegion*(para1: TRegion, para2: TRegion, para3: TRegion): cint{.cdecl, - dynlib: libX11, importc.} -#when defined(MACROS): -proc XDestroyImage*(ximage: PXImage): cint -proc XGetPixel*(ximage: PXImage, x, y: cint): culong -proc XPutPixel*(ximage: PXImage, x, y: cint, pixel: culong): cint -proc XSubImage*(ximage: PXImage, x, y: cint, width, height: cuint): PXImage -proc XAddPixel*(ximage: PXImage, value: clong): cint -proc IsKeypadKey*(keysym: TKeySym): bool -proc IsPrivateKeypadKey*(keysym: TKeySym): bool -proc IsCursorKey*(keysym: TKeySym): bool -proc IsPFKey*(keysym: TKeySym): bool -proc IsFunctionKey*(keysym: TKeySym): bool -proc IsMiscFunctionKey*(keysym: TKeySym): bool -proc IsModifierKey*(keysym: TKeySym): bool - #function XUniqueContext : TXContext; - #function XStringToContext(_string : Pchar) : TXContext; -# implementation - -#when defined(MACROS): -proc XDestroyImage(ximage: PXImage): cint = - ximage.f.destroy_image(ximage) - -proc XGetPixel(ximage: PXImage, x, y: cint): culong = - ximage.f.get_pixel(ximage, x, y) - -proc XPutPixel(ximage: PXImage, x, y: cint, pixel: culong): cint = - ximage.f.put_pixel(ximage, x, y, pixel) - -proc XSubImage(ximage: PXImage, x, y: cint, width, height: cuint): PXImage = - ximage.f.sub_image(ximage, x, y, width, height) - -proc XAddPixel(ximage: PXImage, value: clong): cint = - ximage.f.add_pixel(ximage, value) - -proc IsKeypadKey(keysym: TKeySym): bool = - (keysym >= XK_KP_Space) and (keysym <= XK_KP_Equal) - -proc IsPrivateKeypadKey(keysym: TKeySym): bool = - (keysym >= 0x11000000.TKeySym) and (keysym <= 0x1100FFFF.TKeySym) - -proc IsCursorKey(keysym: TKeySym): bool = - (keysym >= XK_Home) and (keysym < XK_Select) - -proc IsPFKey(keysym: TKeySym): bool = - (keysym >= XK_KP_F1) and (keysym <= XK_KP_F4) - -proc IsFunctionKey(keysym: TKeySym): bool = - (keysym >= XK_F1) and (keysym <= XK_F35) - -proc IsMiscFunctionKey(keysym: TKeySym): bool = - (keysym >= XK_Select) and (keysym <= XK_Break) - -proc IsModifierKey(keysym: TKeySym): bool = - ((keysym >= XK_Shift_L) And (keysym <= XK_Hyper_R)) Or - (keysym == XK_Mode_switch) Or (keysym == XK_Num_Lock) diff --git a/lib/wrappers/x11/xv.nim b/lib/wrappers/x11/xv.nim deleted file mode 100644 index 45ab614183..0000000000 --- a/lib/wrappers/x11/xv.nim +++ /dev/null @@ -1,84 +0,0 @@ -#*********************************************************** -#Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -#and the Massachusetts Institute of Technology, Cambridge, Massachusetts. -# -# All Rights Reserved -# -#Permission to use, copy, modify, and distribute this software and its -#documentation for any purpose and without fee is hereby granted, -#provided that the above copyright notice appear in all copies and that -#both that copyright notice and this permission notice appear in -#supporting documentation, and that the names of Digital or MIT not be -#used in advertising or publicity pertaining to distribution of the -#software without specific, written prior permission. -# -#DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -#ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -#DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -#ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -#WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -#ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -#SOFTWARE. -# -#****************************************************************** -# $XFree86: xc/include/extensions/Xv.h,v 1.3 1999/05/23 06:33:22 dawes Exp $ - -import - x - -const - XvName* = "libXVideo.so" - XvVersion* = 2 - XvRevision* = 2 # Symbols - -type - TXvPortID* = TXID - TXvEncodingID* = TXID - -const - XvNone* = 0 - XvInput* = 0 - XvOutput* = 1 - XvInputMask* = 1 shl XvInput - XvOutputMask* = 1 shl XvOutput - XvVideoMask* = 0x00000004 - XvStillMask* = 0x00000008 - XvImageMask* = 0x00000010 # These two are not client viewable - XvPixmapMask* = 0x00010000 - XvWindowMask* = 0x00020000 - XvGettable* = 0x00000001 - XvSettable* = 0x00000002 - XvRGB* = 0 - XvYUV* = 1 - XvPacked* = 0 - XvPlanar* = 1 - XvTopToBottom* = 0 - XvBottomToTop* = 1 # Events - XvVideoNotify* = 0 - XvPortNotify* = 1 - XvNumEvents* = 2 # Video Notify Reasons - XvStarted* = 0 - XvStopped* = 1 - XvBusy* = 2 - XvPreempted* = 3 - XvHardError* = 4 - XvLastReason* = 4 - XvNumReasons* = XvLastReason + 1 - XvStartedMask* = 1 shl XvStarted - XvStoppedMask* = 1 shl XvStopped - XvBusyMask* = 1 shl XvBusy - XvPreemptedMask* = 1 shl XvPreempted - XvHardErrorMask* = 1 shl XvHardError - XvAnyReasonMask* = (1 shl XvNumReasons) - 1 - XvNoReasonMask* = 0 # Errors - XvBadPort* = 0 - XvBadEncoding* = 1 - XvBadControl* = 2 - XvNumErrors* = 3 # Status - XvBadExtension* = 1 - XvAlreadyGrabbed* = 2 - XvInvalidTime* = 3 - XvBadReply* = 4 - XvBadAlloc* = 5 - -# implementation diff --git a/lib/wrappers/x11/xvlib.nim b/lib/wrappers/x11/xvlib.nim deleted file mode 100644 index 19fd0d0005..0000000000 --- a/lib/wrappers/x11/xvlib.nim +++ /dev/null @@ -1,234 +0,0 @@ -#*********************************************************** -#Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -#and the Massachusetts Institute of Technology, Cambridge, Massachusetts. -# -# All Rights Reserved -# -#Permission to use, copy, modify, and distribute this software and its -#documentation for any purpose and without fee is hereby granted, -#provided that the above copyright notice appear in all copies and that -#both that copyright notice and this permission notice appear in -#supporting documentation, and that the names of Digital or MIT not be -#used in advertising or publicity pertaining to distribution of the -#software without specific, written prior permission. -# -#DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -#ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -#DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -#ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -#WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -#ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -#SOFTWARE. -# -#****************************************************************** -# $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $ -#* -#** File: -#** -#** Xvlib.h --- Xv library public header file -#** -#** Author: -#** -#** David Carver (Digital Workstation Engineering/Project Athena) -#** -#** Revisions: -#** -#** 26.06.91 Carver -#** - changed XvFreeAdaptors to XvFreeAdaptorInfo -#** - changed XvFreeEncodings to XvFreeEncodingInfo -#** -#** 11.06.91 Carver -#** - changed SetPortControl to SetPortAttribute -#** - changed GetPortControl to GetPortAttribute -#** - changed QueryBestSize -#** -#** 05.15.91 Carver -#** - version 2.0 upgrade -#** -#** 01.24.91 Carver -#** - version 1.4 upgrade -#** -#* - -import - x, xlib, xshm, xv - -const - libXv* = "libXv.so" - -type - PXvRational* = ptr TXvRational - TXvRational*{.final.} = object - numerator*: cint - denominator*: cint - - PXvAttribute* = ptr TXvAttribute - TXvAttribute*{.final.} = object - flags*: cint # XvGettable, XvSettable - min_value*: cint - max_value*: cint - name*: cstring - - PPXvEncodingInfo* = ptr PXvEncodingInfo - PXvEncodingInfo* = ptr TXvEncodingInfo - TXvEncodingInfo*{.final.} = object - encoding_id*: TXvEncodingID - name*: cstring - width*: culong - height*: culong - rate*: TXvRational - num_encodings*: culong - - PXvFormat* = ptr TXvFormat - TXvFormat*{.final.} = object - depth*: cchar - visual_id*: culong - - PPXvAdaptorInfo* = ptr PXvAdaptorInfo - PXvAdaptorInfo* = ptr TXvAdaptorInfo - TXvAdaptorInfo*{.final.} = object - base_id*: TXvPortID - num_ports*: culong - thetype*: cchar - name*: cstring - num_formats*: culong - formats*: PXvFormat - num_adaptors*: culong - - PXvVideoNotifyEvent* = ptr TXvVideoNotifyEvent - TXvVideoNotifyEvent*{.final.} = object - theType*: cint - serial*: culong # # of last request processed by server - send_event*: TBool # true if this came from a SendEvent request - display*: PDisplay # Display the event was read from - drawable*: TDrawable # drawable - reason*: culong # what generated this event - port_id*: TXvPortID # what port - time*: TTime # milliseconds - - PXvPortNotifyEvent* = ptr TXvPortNotifyEvent - TXvPortNotifyEvent*{.final.} = object - theType*: cint - serial*: culong # # of last request processed by server - send_event*: TBool # true if this came from a SendEvent request - display*: PDisplay # Display the event was read from - port_id*: TXvPortID # what port - time*: TTime # milliseconds - attribute*: TAtom # atom that identifies attribute - value*: clong # value of attribute - - PXvEvent* = ptr TXvEvent - TXvEvent*{.final.} = object - pad*: array[0..23, clong] #case longint of - # 0 : ( - # theType : cint; - # ); - # 1 : ( - # xvvideo : TXvVideoNotifyEvent; - # ); - # 2 : ( - # xvport : TXvPortNotifyEvent; - # ); - # 3 : ( - # - # ); - - PXvImageFormatValues* = ptr TXvImageFormatValues - TXvImageFormatValues*{.final.} = object - id*: cint # Unique descriptor for the format - theType*: cint # XvRGB, XvYUV - byte_order*: cint # LSBFirst, MSBFirst - guid*: array[0..15, cchar] # Globally Unique IDentifier - bits_per_pixel*: cint - format*: cint # XvPacked, XvPlanar - num_planes*: cint # for RGB formats only - depth*: cint - red_mask*: cuint - green_mask*: cuint - blue_mask*: cuint # for YUV formats only - y_sample_bits*: cuint - u_sample_bits*: cuint - v_sample_bits*: cuint - horz_y_period*: cuint - horz_u_period*: cuint - horz_v_period*: cuint - vert_y_period*: cuint - vert_u_period*: cuint - vert_v_period*: cuint - component_order*: array[0..31, char] # eg. UYVY - scanline_order*: cint # XvTopToBottom, XvBottomToTop - - PXvImage* = ptr TXvImage - TXvImage*{.final.} = object - id*: cint - width*, height*: cint - data_size*: cint # bytes - num_planes*: cint - pitches*: pcint # bytes - offsets*: pcint # bytes - data*: pointer - obdata*: TXPointer - - -proc XvQueryExtension*(display: PDisplay, p_version, p_revision, p_requestBase, - p_eventBase, p_errorBase: pcuint): cint{.cdecl, dynlib: libXv, importc.} -proc XvQueryAdaptors*(display: PDisplay, window: TWindow, p_nAdaptors: pcuint, - p_pAdaptors: PPXvAdaptorInfo): cint{.cdecl, dynlib: libXv, - importc.} -proc XvQueryEncodings*(display: PDisplay, port: TXvPortID, p_nEncoding: pcuint, - p_pEncoding: PPXvEncodingInfo): cint{.cdecl, - dynlib: libXv, importc.} -proc XvPutVideo*(display: PDisplay, port: TXvPortID, d: TDrawable, gc: TGC, - vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{. - cdecl, dynlib: libXv, importc.} -proc XvPutStill*(display: PDisplay, port: TXvPortID, d: TDrawable, gc: TGC, - vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{. - cdecl, dynlib: libXv, importc.} -proc XvGetVideo*(display: PDisplay, port: TXvPortID, d: TDrawable, gc: TGC, - vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{. - cdecl, dynlib: libXv, importc.} -proc XvGetStill*(display: PDisplay, port: TXvPortID, d: TDrawable, gc: TGC, - vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{. - cdecl, dynlib: libXv, importc.} -proc XvStopVideo*(display: PDisplay, port: TXvPortID, drawable: TDrawable): cint{. - cdecl, dynlib: libXv, importc.} -proc XvGrabPort*(display: PDisplay, port: TXvPortID, time: TTime): cint{.cdecl, - dynlib: libXv, importc.} -proc XvUngrabPort*(display: PDisplay, port: TXvPortID, time: TTime): cint{. - cdecl, dynlib: libXv, importc.} -proc XvSelectVideoNotify*(display: PDisplay, drawable: TDrawable, onoff: TBool): cint{. - cdecl, dynlib: libXv, importc.} -proc XvSelectPortNotify*(display: PDisplay, port: TXvPortID, onoff: TBool): cint{. - cdecl, dynlib: libXv, importc.} -proc XvSetPortAttribute*(display: PDisplay, port: TXvPortID, attribute: TAtom, - value: cint): cint{.cdecl, dynlib: libXv, importc.} -proc XvGetPortAttribute*(display: PDisplay, port: TXvPortID, attribute: TAtom, - p_value: pcint): cint{.cdecl, dynlib: libXv, importc.} -proc XvQueryBestSize*(display: PDisplay, port: TXvPortID, motion: TBool, - vid_w, vid_h, drw_w, drw_h: cuint, - p_actual_width, p_actual_height: pcuint): cint{.cdecl, - dynlib: libXv, importc.} -proc XvQueryPortAttributes*(display: PDisplay, port: TXvPortID, number: pcint): PXvAttribute{. - cdecl, dynlib: libXv, importc.} -proc XvFreeAdaptorInfo*(adaptors: PXvAdaptorInfo){.cdecl, dynlib: libXv, importc.} -proc XvFreeEncodingInfo*(encodings: PXvEncodingInfo){.cdecl, dynlib: libXv, - importc.} -proc XvListImageFormats*(display: PDisplay, port_id: TXvPortID, - count_return: pcint): PXvImageFormatValues{.cdecl, - dynlib: libXv, importc.} -proc XvCreateImage*(display: PDisplay, port: TXvPortID, id: cint, data: pointer, - width, height: cint): PXvImage{.cdecl, dynlib: libXv, - importc.} -proc XvPutImage*(display: PDisplay, id: TXvPortID, d: TDrawable, gc: TGC, - image: PXvImage, src_x, src_y: cint, src_w, src_h: cuint, - dest_x, dest_y: cint, dest_w, dest_h: cuint): cint{.cdecl, - dynlib: libXv, importc.} -proc XvShmPutImage*(display: PDisplay, id: TXvPortID, d: TDrawable, gc: TGC, - image: PXvImage, src_x, src_y: cint, src_w, src_h: cuint, - dest_x, dest_y: cint, dest_w, dest_h: cuint, - send_event: TBool): cint{.cdecl, dynlib: libXv, importc.} -proc XvShmCreateImage*(display: PDisplay, port: TXvPortID, id: cint, - data: pointer, width, height: cint, - shminfo: PXShmSegmentInfo): PXvImage{.cdecl, - dynlib: libXv, importc.} -# implementation From ee520689d7e79f87078e3a764db182f647ac612a Mon Sep 17 00:00:00 2001 From: fowlmouth Date: Sun, 1 Dec 2013 21:15:48 -0600 Subject: [PATCH 054/326] removed gtk2 --- examples/gtk/ex1.nim | 14 - examples/gtk/ex2.nim | 22 - examples/gtk/ex3.nim | 34 - examples/gtk/ex4.nim | 29 - examples/gtk/ex5.nim | 24 - examples/gtk/ex6.nim | 50 - examples/gtk/ex7.nim | 46 - examples/gtk/ex8.nim | 29 - examples/gtk/ex9.nim | 49 - lib/wrappers/gtk/atk.nim | 1308 --- lib/wrappers/gtk/gdk2.nim | 3873 ------- lib/wrappers/gtk/gdk2pixbuf.nim | 271 - lib/wrappers/gtk/gdkglext.nim | 554 - lib/wrappers/gtk/glib2.nim | 4540 -------- lib/wrappers/gtk/gtk2.nim | 17064 ------------------------------ lib/wrappers/gtk/gtkglext.nim | 53 - lib/wrappers/gtk/gtkhtml.nim | 523 - lib/wrappers/gtk/libglade2.nim | 111 - lib/wrappers/gtk/pango.nim | 1160 -- lib/wrappers/gtk/pangoutils.nim | 42 - 20 files changed, 29796 deletions(-) delete mode 100644 examples/gtk/ex1.nim delete mode 100644 examples/gtk/ex2.nim delete mode 100644 examples/gtk/ex3.nim delete mode 100644 examples/gtk/ex4.nim delete mode 100644 examples/gtk/ex5.nim delete mode 100644 examples/gtk/ex6.nim delete mode 100644 examples/gtk/ex7.nim delete mode 100644 examples/gtk/ex8.nim delete mode 100644 examples/gtk/ex9.nim delete mode 100644 lib/wrappers/gtk/atk.nim delete mode 100644 lib/wrappers/gtk/gdk2.nim delete mode 100644 lib/wrappers/gtk/gdk2pixbuf.nim delete mode 100644 lib/wrappers/gtk/gdkglext.nim delete mode 100644 lib/wrappers/gtk/glib2.nim delete mode 100644 lib/wrappers/gtk/gtk2.nim delete mode 100644 lib/wrappers/gtk/gtkglext.nim delete mode 100644 lib/wrappers/gtk/gtkhtml.nim delete mode 100644 lib/wrappers/gtk/libglade2.nim delete mode 100644 lib/wrappers/gtk/pango.nim delete mode 100644 lib/wrappers/gtk/pangoutils.nim diff --git a/examples/gtk/ex1.nim b/examples/gtk/ex1.nim deleted file mode 100644 index deabffa3ed..0000000000 --- a/examples/gtk/ex1.nim +++ /dev/null @@ -1,14 +0,0 @@ -import - cairo, glib2, gtk2 - -proc destroy(widget: pWidget, data: pgpointer) {.cdecl.} = - main_quit() - -var - window: pWidget -nimrod_init() -window = window_new(WINDOW_TOPLEVEL) -discard signal_connect(window, "destroy", - SIGNAL_FUNC(ex1.destroy), nil) -show(window) -main() diff --git a/examples/gtk/ex2.nim b/examples/gtk/ex2.nim deleted file mode 100644 index fab64cef57..0000000000 --- a/examples/gtk/ex2.nim +++ /dev/null @@ -1,22 +0,0 @@ - -import - glib2, gtk2 - -proc destroy(widget: pWidget, data: pgpointer){.cdecl.} = - main_quit() - -var - window: PWidget - button: PWidget - -nimrod_init() -window = window_new(WINDOW_TOPLEVEL) -button = button_new("Click me") -set_border_width(PContainer(Window), 5) -add(PContainer(window), button) -discard signal_connect(window, "destroy", - SIGNAL_FUNC(ex2.destroy), nil) -show(button) -show(window) -main() - diff --git a/examples/gtk/ex3.nim b/examples/gtk/ex3.nim deleted file mode 100644 index 3b39c07ce7..0000000000 --- a/examples/gtk/ex3.nim +++ /dev/null @@ -1,34 +0,0 @@ - -import - glib2, gtk2 - -proc newbutton(ALabel: cstring): PWidget = - Result = button_new(ALabel) - show(result) - -proc destroy(widget: pWidget, data: pgpointer){.cdecl.} = - main_quit() - -nimrod_init() -var window = window_new(WINDOW_TOPLEVEL) # Box to divide window in 2 halves: -var totalbox = vbox_new(true, 10) -show(totalbox) # A box for each half of the screen: -var hbox = hbox_new(false, 5) -show(hbox) -var vbox = vbox_new(true, 5) -show(vbox) # Put boxes in their halves -pack_start(totalbox, hbox, true, true, 0) -pack_start(totalbox, vbox, true, true, 0) # Now fill boxes with buttons. - -pack_start(hbox, newbutton("Button 1"), false, false, 0) -pack_start(hbox, newbutton("Button 2"), false, false, 0) -pack_start(hbox, newbutton("Button 3"), false, false, 0) # Vertical box -pack_start(vbox, newbutton("Button A"), true, true, 0) -pack_start(vbox, newbutton("Button B"), true, true, 0) -pack_start(vbox, newbutton("Button C"), true, true, 0) # Put totalbox in window -set_border_width(PCONTAINER(Window), 5) -add(PContainer(window), totalbox) -discard signal_connect(window, "destroy", SIGNAL_FUNC(ex3.destroy), nil) -show(window) -main() - diff --git a/examples/gtk/ex4.nim b/examples/gtk/ex4.nim deleted file mode 100644 index 2964042de4..0000000000 --- a/examples/gtk/ex4.nim +++ /dev/null @@ -1,29 +0,0 @@ - -import - glib2, gtk2 - -proc newbutton(ALabel: cstring): PWidget = - Result = button_new(ALabel) - show(result) - -proc destroy(widget: pWidget, data: pgpointer){.cdecl.} = - main_quit() - -nimrod_init() -var window = window_new(WINDOW_TOPLEVEL) -var Maintable = table_new(6, 6, True) - -proc AddToTable(Widget: PWidget, Left, Right, Top, Bottom: guint) = - attach_defaults(MainTable, Widget, Left, right, top, bottom) - -show(MainTable) -AddToTable(newbutton("1,1 At 1,1"), 1, 2, 1, 2) -AddToTable(newbutton("2,2 At 3,1"), 3, 5, 1, 3) -AddToTable(newbutton("4,1 At 4,1"), 1, 5, 4, 5) # Put all in window -set_border_width(Window, 5) -add(window, maintable) -discard signal_connect(window, "destroy", - SignalFunc(ex4.destroy), nil) -show(window) -main() - diff --git a/examples/gtk/ex5.nim b/examples/gtk/ex5.nim deleted file mode 100644 index 841ebc681f..0000000000 --- a/examples/gtk/ex5.nim +++ /dev/null @@ -1,24 +0,0 @@ - -import - glib2, gtk2 - -proc destroy(widget: pWidget, data: pgpointer){.cdecl.} = - main_quit() - -proc widgetDestroy(w: PWidget) {.cdecl.} = - destroy(w) - -nimrod_init() -var window = window_new(WINDOW_TOPLEVEL) -var button = button_new("Click me") -set_border_width(Window, 5) -add(window, button) -discard signal_connect(window, "destroy", - SIGNAL_FUNC(ex5.destroy), nil) -discard signal_connect_object(button, "clicked", - SIGNAL_FUNC(widgetDestroy), - window) -show(button) -show(window) -main() - diff --git a/examples/gtk/ex6.nim b/examples/gtk/ex6.nim deleted file mode 100644 index 7374b19cda..0000000000 --- a/examples/gtk/ex6.nim +++ /dev/null @@ -1,50 +0,0 @@ - -import - glib2, gtk2 - -type - TButtonSignalState = object - Obj: gtk2.PObject - SignalID: int32 - Disable: bool - - PButtonSignalState = ptr TButtonSignalState - -proc destroy(widget: pWidget, data: pgpointer){.cdecl.} = - main_quit() - -proc widgetDestroy(w: PWidget) {.cdecl.} = destroy(w) - -proc disablesignal(widget: pWidget, data: pgpointer){.cdecl.} = - var s = cast[PButtonSignalState](Data) - if s.Disable: - signal_handler_block(s.Obj, s.SignalID) - else: - signal_handler_unblock(s.Obj, s.SignalID) - s.disable = not s.disable - -var - QuitState: TButtonSignalState - -nimrod_init() -var window = window_new(WINDOW_TOPLEVEL) -var quitbutton = button_new("Quit program") -var disablebutton = button_new("Disable button") -var windowbox = vbox_new(TRUE, 10) -pack_start(windowbox, disablebutton, True, false, 0) -pack_start(windowbox, quitbutton, True, false, 0) -set_border_width(Window, 10) -add(window, windowbox) -discard signal_connect(window, "destroy", SIGNAL_FUNC(ex6.destroy), nil) -QuitState.Obj = QuitButton -quitState.SignalID = signal_connect_object(QuitState.Obj, "clicked", - SIGNAL_FUNC(widgetDestroy), window).int32 -QuitState.Disable = True -discard signal_connect(disablebutton, "clicked", - SIGNAL_FUNC(disablesignal), addr(QuitState)) -show(quitbutton) -show(disablebutton) -show(windowbox) -show(window) -main() - diff --git a/examples/gtk/ex7.nim b/examples/gtk/ex7.nim deleted file mode 100644 index 852d80a41c..0000000000 --- a/examples/gtk/ex7.nim +++ /dev/null @@ -1,46 +0,0 @@ - -import - gdk2, glib2, gtk2 - -proc destroy(widget: pWidget, data: pgpointer){.cdecl.} = - main_quit() - -const - Inside: cstring = "Mouse is over label" - OutSide: cstring = "Mouse is not over label" - -var - OverLabel: bool - -nimrod_init() -var window = window_new(gtk2.WINDOW_TOPLEVEL) -var stackbox = vbox_new(TRUE, 10) -var box1 = event_box_new() -var label1 = label_new("Move mouse over label") -add(box1, label1) -var box2 = event_box_new() -var label2 = label_new(OutSide) -add(box2, label2) -pack_start(stackbox, box1, TRUE, TRUE, 0) -pack_start(stackbox, box2, TRUE, TRUE, 0) -set_border_width(Window, 5) -add(window, stackbox) -discard signal_connect(window, "destroy", - SIGNAL_FUNC(ex7.destroy), nil) -overlabel = False - - -proc ChangeLabel(P: PWidget, Event: gdk2.PEventCrossing, - Data: var bool){.cdecl.} = - if not Data: set_text(Label1, Inside) - else: set_text(Label2, Outside) - Data = not Data - - -discard signal_connect(box1, "enter_notify_event", - SIGNAL_FUNC(ChangeLabel), addr(Overlabel)) -discard signal_connect(box1, "leave_notify_event", - SIGNAL_FUNC(ChangeLabel), addr(Overlabel)) -show_all(window) -main() - diff --git a/examples/gtk/ex8.nim b/examples/gtk/ex8.nim deleted file mode 100644 index 242a15393c..0000000000 --- a/examples/gtk/ex8.nim +++ /dev/null @@ -1,29 +0,0 @@ - -import - glib2, gtk2 - -proc destroy(widget: pWidget, data: pgpointer){.cdecl.} = - main_quit() - -nimrod_init() -var window = window_new(WINDOW_TOPLEVEL) -var stackbox = vbox_new(TRUE, 10) -var label1 = label_new("Red label text") -var labelstyle = copy(get_style(label1)) -LabelStyle.fg[STATE_NORMAL].pixel = 0 -LabelStyle.fg[STATE_NORMAL].red = -1'i16 -LabelStyle.fg[STATE_NORMAL].blue = 0'i16 -LabelStyle.fg[STATE_NORMAL].green = 0'i16 -set_style(label1, labelstyle) -# Uncomment this to see the effect of setting the default style. -# set_default_style(labelstyle) -var label2 = label_new("Black label text") -pack_start(stackbox, label1, TRUE, TRUE, 0) -pack_start(stackbox, label2, TRUE, TRUE, 0) -set_border_width(Window, 5) -add(window, stackbox) -discard signal_connect(window, "destroy", - SIGNAL_FUNC(ex8.destroy), nil) -show_all(window) -main() - diff --git a/examples/gtk/ex9.nim b/examples/gtk/ex9.nim deleted file mode 100644 index 1481e6be16..0000000000 --- a/examples/gtk/ex9.nim +++ /dev/null @@ -1,49 +0,0 @@ - -import - gdk2, glib2, gtk2 - -proc destroy(widget: pWidget, data: pgpointer){.cdecl.} = - main_quit() - -const - Inside: cstring = "Mouse is over label" - OutSide: cstring = "Mouse is not over label" - -var - OverButton: bool - -nimrod_init() -var window = window_new(gtk2.WINDOW_TOPLEVEL) -var stackbox = vbox_new(TRUE, 10) -var button1 = button_new("Move mouse over button") -var buttonstyle = copy(get_style(Button1)) -ButtonStyle.bg[STATE_PRELIGHT].pixel = 0 -ButtonStyle.bg[STATE_PRELIGHT].red = -1'i16 -ButtonStyle.bg[STATE_PRELIGHT].blue = 0'i16 -ButtonStyle.bg[STATE_PRELIGHT].green = 0'i16 -set_style(button1, buttonstyle) -var button2 = button_new() -var ALabel = label_new(Outside) - - -proc ChangeLabel(P: PWidget, Event: gdk2.PEventCrossing, - Data: var bool){.cdecl.} = - if Not Data: set_text(ALabel, Inside) - else: set_text(ALabel, Outside) - Data = Not Data - - -add(button2, ALAbel) -pack_start(stackbox, button1, TRUE, TRUE, 0) -pack_start(stackbox, button2, TRUE, TRUE, 0) -set_border_width(Window, 5) -add(window, stackbox) -discard signal_connect(window, "destroy", - SIGNAL_FUNC(ex9.destroy), nil) -overbutton = False -discard signal_connect(button1, "enter_notify_event", - SIGNAL_FUNC(ChangeLabel), addr(OverButton)) -discard signal_connect(button1, "leave_notify_event", - SIGNAL_FUNC(ChangeLabel), addr(OverButton)) -show_all(window) -main() diff --git a/lib/wrappers/gtk/atk.nim b/lib/wrappers/gtk/atk.nim deleted file mode 100644 index f59d95f870..0000000000 --- a/lib/wrappers/gtk/atk.nim +++ /dev/null @@ -1,1308 +0,0 @@ -{.deadCodeElim: on.} -import - glib2 - -when defined(windows): - const - lib = "libatk-1.0-0.dll" -elif defined(macosx): - const - lib = "libatk-1.0.dylib" -else: - const - lib = "libatk-1.0.so" -type - PImplementor* = pointer - PAction* = pointer - PComponent* = pointer - PDocument* = pointer - PEditableText* = pointer - PHypertext* = pointer - PImage* = pointer - PSelection* = pointer - PStreamableContent* = pointer - PTable* = pointer - PText* = pointer - PValue* = pointer - PRelationSet* = ptr TRelationSet - PStateSet* = ptr TStateSet - PAttributeSet* = ptr TAttributeSet - PCoordType* = ptr TCoordType - TCoordType* = enum - XY_SCREEN, XY_WINDOW - PRole* = ptr TRole - TRole* = enum - ROLE_INVALID, ROLE_ACCEL_LABEL, ROLE_ALERT, ROLE_ANIMATION, ROLE_ARROW, - ROLE_CALENDAR, ROLE_CANVAS, ROLE_CHECK_BOX, ROLE_CHECK_MENU_ITEM, - ROLE_COLOR_CHOOSER, ROLE_COLUMN_HEADER, ROLE_COMBO_BOX, ROLE_DATE_EDITOR, - ROLE_DESKTOP_ICON, ROLE_DESKTOP_FRAME, ROLE_DIAL, ROLE_DIALOG, - ROLE_DIRECTORY_PANE, ROLE_DRAWING_AREA, ROLE_FILE_CHOOSER, ROLE_FILLER, - ROLE_FONT_CHOOSER, ROLE_FRAME, ROLE_GLASS_PANE, ROLE_HTML_CONTAINER, - ROLE_ICON, ROLE_IMAGE, ROLE_INTERNAL_FRAME, ROLE_LABEL, ROLE_LAYERED_PANE, - ROLE_LIST, ROLE_LIST_ITEM, ROLE_MENU, ROLE_MENU_BAR, ROLE_MENU_ITEM, - ROLE_OPTION_PANE, ROLE_PAGE_TAB, ROLE_PAGE_TAB_LIST, ROLE_PANEL, - ROLE_PASSWORD_TEXT, ROLE_POPUP_MENU, ROLE_PROGRESS_BAR, ROLE_PUSH_BUTTON, - ROLE_RADIO_BUTTON, ROLE_RADIO_MENU_ITEM, ROLE_ROOT_PANE, ROLE_ROW_HEADER, - ROLE_SCROLL_BAR, ROLE_SCROLL_PANE, ROLE_SEPARATOR, ROLE_SLIDER, - ROLE_SPLIT_PANE, ROLE_SPIN_BUTTON, ROLE_STATUSBAR, ROLE_TABLE, - ROLE_TABLE_CELL, ROLE_TABLE_COLUMN_HEADER, ROLE_TABLE_ROW_HEADER, - ROLE_TEAR_OFF_MENU_ITEM, ROLE_TERMINAL, ROLE_TEXT, ROLE_TOGGLE_BUTTON, - ROLE_TOOL_BAR, ROLE_TOOL_TIP, ROLE_TREE, ROLE_TREE_TABLE, ROLE_UNKNOWN, - ROLE_VIEWPORT, ROLE_WINDOW, ROLE_LAST_DEFINED - PLayer* = ptr TLayer - TLayer* = enum - LAYER_INVALID, LAYER_BACKGROUND, LAYER_CANVAS, LAYER_WIDGET, LAYER_MDI, - LAYER_POPUP, LAYER_OVERLAY - PPropertyValues* = ptr TPropertyValues - TPropertyValues*{.final, pure.} = object - property_name*: cstring - old_value*: TGValue - new_value*: TGValue - - TFunction* = proc (data: gpointer): gboolean{.cdecl.} - PObject* = ptr TObject - PPAtkObject* = ptr PObject - TObject* = object of TGObject - description*: cstring - name*: cstring - accessible_parent*: PObject - role*: TRole - relation_set*: PRelationSet - layer*: TLayer - - TPropertyChangeHandler* = proc (para1: PObject, para2: PPropertyValues){.cdecl.} - PObjectClass* = ptr TObjectClass - TObjectClass* = object of TGObjectClass - get_name*: proc (accessible: PObject): cstring{.cdecl.} - get_description*: proc (accessible: PObject): cstring{.cdecl.} - get_parent*: proc (accessible: PObject): PObject{.cdecl.} - get_n_children*: proc (accessible: PObject): gint{.cdecl.} - ref_child*: proc (accessible: PObject, i: gint): PObject{.cdecl.} - get_index_in_parent*: proc (accessible: PObject): gint{.cdecl.} - ref_relation_set*: proc (accessible: PObject): PRelationSet{.cdecl.} - get_role*: proc (accessible: PObject): TRole{.cdecl.} - get_layer*: proc (accessible: PObject): TLayer{.cdecl.} - get_mdi_zorder*: proc (accessible: PObject): gint{.cdecl.} - ref_state_set*: proc (accessible: PObject): PStateSet{.cdecl.} - set_name*: proc (accessible: PObject, name: cstring){.cdecl.} - set_description*: proc (accessible: PObject, description: cstring){.cdecl.} - set_parent*: proc (accessible: PObject, parent: PObject){.cdecl.} - set_role*: proc (accessible: PObject, role: TRole){.cdecl.} - connect_property_change_handler*: proc (accessible: PObject, - handler: TPropertyChangeHandler): guint{.cdecl.} - remove_property_change_handler*: proc (accessible: PObject, - handler_id: guint){.cdecl.} - initialize*: proc (accessible: PObject, data: gpointer){.cdecl.} - children_changed*: proc (accessible: PObject, change_index: guint, - changed_child: gpointer){.cdecl.} - focus_event*: proc (accessible: PObject, focus_in: gboolean){.cdecl.} - property_change*: proc (accessible: PObject, values: PPropertyValues){.cdecl.} - state_change*: proc (accessible: PObject, name: cstring, state_set: gboolean){. - cdecl.} - visible_data_changed*: proc (accessible: PObject){.cdecl.} - pad1*: TFunction - pad2*: TFunction - pad3*: TFunction - pad4*: TFunction - - PImplementorIface* = ptr TImplementorIface - TImplementorIface* = object of TGTypeInterface - ref_accessible*: proc (implementor: PImplementor): PObject{.cdecl.} - - PActionIface* = ptr TActionIface - TActionIface* = object of TGTypeInterface - do_action*: proc (action: PAction, i: gint): gboolean{.cdecl.} - get_n_actions*: proc (action: PAction): gint{.cdecl.} - get_description*: proc (action: PAction, i: gint): cstring{.cdecl.} - get_name*: proc (action: PAction, i: gint): cstring{.cdecl.} - get_keybinding*: proc (action: PAction, i: gint): cstring{.cdecl.} - set_description*: proc (action: PAction, i: gint, desc: cstring): gboolean{. - cdecl.} - pad1*: TFunction - pad2*: TFunction - - TFocusHandler* = proc (para1: PObject, para2: gboolean){.cdecl.} - PComponentIface* = ptr TComponentIface - TComponentIface* = object of TGTypeInterface - add_focus_handler*: proc (component: PComponent, handler: TFocusHandler): guint{. - cdecl.} - contains*: proc (component: PComponent, x: gint, y: gint, - coord_type: TCoordType): gboolean{.cdecl.} - ref_accessible_at_point*: proc (component: PComponent, x: gint, y: gint, - coord_type: TCoordType): PObject{.cdecl.} - get_extents*: proc (component: PComponent, x: Pgint, y: Pgint, width: Pgint, - height: Pgint, coord_type: TCoordType){.cdecl.} - get_position*: proc (component: PComponent, x: Pgint, y: Pgint, - coord_type: TCoordType){.cdecl.} - get_size*: proc (component: PComponent, width: Pgint, height: Pgint){.cdecl.} - grab_focus*: proc (component: PComponent): gboolean{.cdecl.} - remove_focus_handler*: proc (component: PComponent, handler_id: guint){. - cdecl.} - set_extents*: proc (component: PComponent, x: gint, y: gint, width: gint, - height: gint, coord_type: TCoordType): gboolean{.cdecl.} - set_position*: proc (component: PComponent, x: gint, y: gint, - coord_type: TCoordType): gboolean{.cdecl.} - set_size*: proc (component: PComponent, width: gint, height: gint): gboolean{. - cdecl.} - get_layer*: proc (component: PComponent): TLayer{.cdecl.} - get_mdi_zorder*: proc (component: PComponent): gint{.cdecl.} - pad1*: TFunction - pad2*: TFunction - - PDocumentIface* = ptr TDocumentIface - TDocumentIface* = object of TGTypeInterface - get_document_type*: proc (document: PDocument): cstring{.cdecl.} - get_document*: proc (document: PDocument): gpointer{.cdecl.} - pad1*: TFunction - pad2*: TFunction - pad3*: TFunction - pad4*: TFunction - pad5*: TFunction - pad6*: TFunction - pad7*: TFunction - pad8*: TFunction - - PEditableTextIface* = ptr TEditableTextIface - TEditableTextIface* = object of TGTypeInterface - set_run_attributes*: proc (text: PEditableText, attrib_set: PAttributeSet, - start_offset: gint, end_offset: gint): gboolean{. - cdecl.} - set_text_contents*: proc (text: PEditableText, `string`: cstring){.cdecl.} - insert_text*: proc (text: PEditableText, `string`: cstring, length: gint, - position: Pgint){.cdecl.} - copy_text*: proc (text: PEditableText, start_pos: gint, end_pos: gint){. - cdecl.} - cut_text*: proc (text: PEditableText, start_pos: gint, end_pos: gint){.cdecl.} - delete_text*: proc (text: PEditableText, start_pos: gint, end_pos: gint){. - cdecl.} - paste_text*: proc (text: PEditableText, position: gint){.cdecl.} - pad1*: TFunction - pad2*: TFunction - - PGObjectAccessible* = ptr TGObjectAccessible - TGObjectAccessible* = object of TObject - PGObjectAccessibleClass* = ptr TGObjectAccessibleClass - TGObjectAccessibleClass* = object of TObjectClass - pad5*: TFunction - pad6*: TFunction - - PHyperlink* = ptr THyperlink - THyperlink* = object of TGObject - PHyperlinkClass* = ptr THyperlinkClass - THyperlinkClass* = object of TGObjectClass - get_uri*: proc (link: PHyperlink, i: gint): cstring{.cdecl.} - get_object*: proc (link: PHyperlink, i: gint): PObject{.cdecl.} - get_end_index*: proc (link: PHyperlink): gint{.cdecl.} - get_start_index*: proc (link: PHyperlink): gint{.cdecl.} - is_valid*: proc (link: PHyperlink): gboolean{.cdecl.} - get_n_anchors*: proc (link: PHyperlink): gint{.cdecl.} - pad7*: TFunction - pad8*: TFunction - pad9*: TFunction - pad10*: TFunction - - PHypertextIface* = ptr THypertextIface - THypertextIface* = object of TGTypeInterface - get_link*: proc (hypertext: PHypertext, link_index: gint): PHyperlink{.cdecl.} - get_n_links*: proc (hypertext: PHypertext): gint{.cdecl.} - get_link_index*: proc (hypertext: PHypertext, char_index: gint): gint{.cdecl.} - pad11*: TFunction - pad12*: TFunction - pad13*: TFunction - pad14*: TFunction - - PImageIface* = ptr TImageIface - TImageIface* = object of TGTypeInterface - get_image_position*: proc (image: PImage, x: Pgint, y: Pgint, - coord_type: TCoordType){.cdecl.} - get_image_description*: proc (image: PImage): cstring{.cdecl.} - get_image_size*: proc (image: PImage, width: Pgint, height: Pgint){.cdecl.} - set_image_description*: proc (image: PImage, description: cstring): gboolean{. - cdecl.} - pad15*: TFunction - pad16*: TFunction - - PObjectFactory* = ptr TObjectFactory - TObjectFactory* = object of TGObject - PObjectFactoryClass* = ptr TObjectFactoryClass - TObjectFactoryClass* = object of TGObjectClass - create_accessible*: proc (obj: PGObject): PObject{.cdecl.} - invalidate*: proc (factory: PObjectFactory){.cdecl.} - get_accessible_type*: proc (): GType{.cdecl.} - pad17*: TFunction - pad18*: TFunction - - PRegistry* = ptr TRegistry - TRegistry* = object of TGObject - factory_type_registry*: PGHashTable - factory_singleton_cache*: PGHashTable - - PRegistryClass* = ptr TRegistryClass - TRegistryClass* = object of TGObjectClass - PRelationType* = ptr TRelationType - TRelationType* = enum - RELATION_NULL, RELATION_CONTROLLED_BY, RELATION_CONTROLLER_FOR, - RELATION_LABEL_FOR, RELATION_LABELLED_BY, RELATION_MEMBER_OF, - RELATION_NODE_CHILD_OF, RELATION_LAST_DEFINED - PRelation* = ptr TRelation - PGPtrArray = pointer - TRelation* = object of TGObject - target*: PGPtrArray - relationship*: TRelationType - - PRelationClass* = ptr TRelationClass - TRelationClass* = object of TGObjectClass - TRelationSet* = object of TGObject - relations*: PGPtrArray - - PRelationSetClass* = ptr TRelationSetClass - TRelationSetClass* = object of TGObjectClass - pad19*: TFunction - pad20*: TFunction - - PSelectionIface* = ptr TSelectionIface - TSelectionIface* = object of TGTypeInterface - add_selection*: proc (selection: PSelection, i: gint): gboolean{.cdecl.} - clear_selection*: proc (selection: PSelection): gboolean{.cdecl.} - ref_selection*: proc (selection: PSelection, i: gint): PObject{.cdecl.} - get_selection_count*: proc (selection: PSelection): gint{.cdecl.} - is_child_selected*: proc (selection: PSelection, i: gint): gboolean{.cdecl.} - remove_selection*: proc (selection: PSelection, i: gint): gboolean{.cdecl.} - select_all_selection*: proc (selection: PSelection): gboolean{.cdecl.} - selection_changed*: proc (selection: PSelection){.cdecl.} - pad1*: TFunction - pad2*: TFunction - - PStateType* = ptr TStateType - TStateType* = enum - STATE_INVALID, STATE_ACTIVE, STATE_ARMED, STATE_BUSY, STATE_CHECKED, - STATE_DEFUNCT, STATE_EDITABLE, STATE_ENABLED, STATE_EXPANDABLE, - STATE_EXPANDED, STATE_FOCUSABLE, STATE_FOCUSED, STATE_HORIZONTAL, - STATE_ICONIFIED, STATE_MODAL, STATE_MULTI_LINE, STATE_MULTISELECTABLE, - STATE_OPAQUE, STATE_PRESSED, STATE_RESIZABLE, STATE_SELECTABLE, - STATE_SELECTED, STATE_SENSITIVE, STATE_SHOWING, STATE_SINGLE_LINE, - STATE_STALE, STATE_TRANSIENT, STATE_VERTICAL, STATE_VISIBLE, - STATE_LAST_DEFINED - PState* = ptr TState - TState* = guint64 - TStateSet* = object of TGObject - PStateSetClass* = ptr TStateSetClass - TStateSetClass* = object of TGObjectClass - PStreamableContentIface* = ptr TStreamableContentIface - TStreamableContentIface* = object of TGTypeInterface - get_n_mime_types*: proc (streamable: PStreamableContent): gint{.cdecl.} - get_mime_type*: proc (streamable: PStreamableContent, i: gint): cstring{. - cdecl.} - get_stream*: proc (streamable: PStreamableContent, mime_type: cstring): PGIOChannel{. - cdecl.} - pad21*: TFunction - pad22*: TFunction - pad23*: TFunction - pad24*: TFunction - - PTableIface* = ptr TTableIface - TTableIface* = object of TGTypeInterface - ref_at*: proc (table: PTable, row: gint, column: gint): PObject{.cdecl.} - get_index_at*: proc (table: PTable, row: gint, column: gint): gint{.cdecl.} - get_column_at_index*: proc (table: PTable, index: gint): gint{.cdecl.} - get_row_at_index*: proc (table: PTable, index: gint): gint{.cdecl.} - get_n_columns*: proc (table: PTable): gint{.cdecl.} - get_n_rows*: proc (table: PTable): gint{.cdecl.} - get_column_extent_at*: proc (table: PTable, row: gint, column: gint): gint{. - cdecl.} - get_row_extent_at*: proc (table: PTable, row: gint, column: gint): gint{. - cdecl.} - get_caption*: proc (table: PTable): PObject{.cdecl.} - get_column_description*: proc (table: PTable, column: gint): cstring{.cdecl.} - get_column_header*: proc (table: PTable, column: gint): PObject{.cdecl.} - get_row_description*: proc (table: PTable, row: gint): cstring{.cdecl.} - get_row_header*: proc (table: PTable, row: gint): PObject{.cdecl.} - get_summary*: proc (table: PTable): PObject{.cdecl.} - set_caption*: proc (table: PTable, caption: PObject){.cdecl.} - set_column_description*: proc (table: PTable, column: gint, - description: cstring){.cdecl.} - set_column_header*: proc (table: PTable, column: gint, header: PObject){. - cdecl.} - set_row_description*: proc (table: PTable, row: gint, description: cstring){. - cdecl.} - set_row_header*: proc (table: PTable, row: gint, header: PObject){.cdecl.} - set_summary*: proc (table: PTable, accessible: PObject){.cdecl.} - get_selected_columns*: proc (table: PTable, selected: PPgint): gint{.cdecl.} - get_selected_rows*: proc (table: PTable, selected: PPgint): gint{.cdecl.} - is_column_selected*: proc (table: PTable, column: gint): gboolean{.cdecl.} - is_row_selected*: proc (table: PTable, row: gint): gboolean{.cdecl.} - is_selected*: proc (table: PTable, row: gint, column: gint): gboolean{.cdecl.} - add_row_selection*: proc (table: PTable, row: gint): gboolean{.cdecl.} - remove_row_selection*: proc (table: PTable, row: gint): gboolean{.cdecl.} - add_column_selection*: proc (table: PTable, column: gint): gboolean{.cdecl.} - remove_column_selection*: proc (table: PTable, column: gint): gboolean{. - cdecl.} - row_inserted*: proc (table: PTable, row: gint, num_inserted: gint){.cdecl.} - column_inserted*: proc (table: PTable, column: gint, num_inserted: gint){. - cdecl.} - row_deleted*: proc (table: PTable, row: gint, num_deleted: gint){.cdecl.} - column_deleted*: proc (table: PTable, column: gint, num_deleted: gint){. - cdecl.} - row_reordered*: proc (table: PTable){.cdecl.} - column_reordered*: proc (table: PTable){.cdecl.} - model_changed*: proc (table: PTable){.cdecl.} - pad25*: TFunction - pad26*: TFunction - pad27*: TFunction - pad28*: TFunction - - TAttributeSet* = TGSList - PAttribute* = ptr TAttribute - TAttribute*{.final, pure.} = object - name*: cstring - value*: cstring - - PTextAttribute* = ptr TTextAttribute - TTextAttribute* = enum - TEXT_ATTR_INVALID, TEXT_ATTR_LEFT_MARGIN, TEXT_ATTR_RIGHT_MARGIN, - TEXT_ATTR_INDENT, TEXT_ATTR_INVISIBLE, TEXT_ATTR_EDITABLE, - TEXT_ATTR_PIXELS_ABOVE_LINES, TEXT_ATTR_PIXELS_BELOW_LINES, - TEXT_ATTR_PIXELS_INSIDE_WRAP, TEXT_ATTR_BG_FULL_HEIGHT, TEXT_ATTR_RISE, - TEXT_ATTR_UNDERLINE, TEXT_ATTR_STRIKETHROUGH, TEXT_ATTR_SIZE, - TEXT_ATTR_SCALE, TEXT_ATTR_WEIGHT, TEXT_ATTR_LANGUAGE, - TEXT_ATTR_FAMILY_NAME, TEXT_ATTR_BG_COLOR, TEXT_ATTR_FG_COLOR, - TEXT_ATTR_BG_STIPPLE, TEXT_ATTR_FG_STIPPLE, TEXT_ATTR_WRAP_MODE, - TEXT_ATTR_DIRECTION, TEXT_ATTR_JUSTIFICATION, TEXT_ATTR_STRETCH, - TEXT_ATTR_VARIANT, TEXT_ATTR_STYLE, TEXT_ATTR_LAST_DEFINED - PTextBoundary* = ptr TTextBoundary - TTextBoundary* = enum - TEXT_BOUNDARY_CHAR, TEXT_BOUNDARY_WORD_START, TEXT_BOUNDARY_WORD_END, - TEXT_BOUNDARY_SENTENCE_START, TEXT_BOUNDARY_SENTENCE_END, - TEXT_BOUNDARY_LINE_START, TEXT_BOUNDARY_LINE_END - PTextIface* = ptr TTextIface - TTextIface* = object of TGTypeInterface - get_text*: proc (text: PText, start_offset: gint, end_offset: gint): cstring{. - cdecl.} - get_text_after_offset*: proc (text: PText, offset: gint, - boundary_type: TTextBoundary, - start_offset: Pgint, end_offset: Pgint): cstring{. - cdecl.} - get_text_at_offset*: proc (text: PText, offset: gint, - boundary_type: TTextBoundary, - start_offset: Pgint, end_offset: Pgint): cstring{. - cdecl.} - get_character_at_offset*: proc (text: PText, offset: gint): gunichar{.cdecl.} - get_text_before_offset*: proc (text: PText, offset: gint, - boundary_type: TTextBoundary, - start_offset: Pgint, end_offset: Pgint): cstring{. - cdecl.} - get_caret_offset*: proc (text: PText): gint{.cdecl.} - get_run_attributes*: proc (text: PText, offset: gint, start_offset: Pgint, - end_offset: Pgint): PAttributeSet{.cdecl.} - get_default_attributes*: proc (text: PText): PAttributeSet{.cdecl.} - get_character_extents*: proc (text: PText, offset: gint, x: Pgint, y: Pgint, - width: Pgint, height: Pgint, - coords: TCoordType){.cdecl.} - get_character_count*: proc (text: PText): gint{.cdecl.} - get_offset_at_point*: proc (text: PText, x: gint, y: gint, - coords: TCoordType): gint{.cdecl.} - get_n_selections*: proc (text: PText): gint{.cdecl.} - get_selection*: proc (text: PText, selection_num: gint, start_offset: Pgint, - end_offset: Pgint): cstring{.cdecl.} - add_selection*: proc (text: PText, start_offset: gint, end_offset: gint): gboolean{. - cdecl.} - remove_selection*: proc (text: PText, selection_num: gint): gboolean{.cdecl.} - set_selection*: proc (text: PText, selection_num: gint, start_offset: gint, - end_offset: gint): gboolean{.cdecl.} - set_caret_offset*: proc (text: PText, offset: gint): gboolean{.cdecl.} - text_changed*: proc (text: PText, position: gint, length: gint){.cdecl.} - text_caret_moved*: proc (text: PText, location: gint){.cdecl.} - text_selection_changed*: proc (text: PText){.cdecl.} - pad29*: TFunction - pad30*: TFunction - pad31*: TFunction - pad32*: TFunction - - TEventListener* = proc (para1: PObject){.cdecl.} - TEventListenerInitProc* = proc (){.cdecl.} - TEventListenerInit* = proc (para1: TEventListenerInitProc){.cdecl.} - PKeyEventStruct* = ptr TKeyEventStruct - TKeyEventStruct*{.final, pure.} = object - `type`*: gint - state*: guint - keyval*: guint - length*: gint - string*: cstring - keycode*: guint16 - timestamp*: guint32 - - TKeySnoopFunc* = proc (event: PKeyEventStruct, func_data: gpointer): gint{. - cdecl.} - PKeyEventType* = ptr TKeyEventType - TKeyEventType* = enum - KEY_EVENT_PRESS, KEY_EVENT_RELEASE, KEY_EVENT_LAST_DEFINED - PUtil* = ptr TUtil - TUtil* = object of TGObject - PUtilClass* = ptr TUtilClass - TUtilClass* = 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: TKeySnoopFunc, data: gpointer): guint{. - cdecl.} - remove_key_event_listener*: proc (listener_id: guint){.cdecl.} - get_root*: proc (): PObject{.cdecl.} - get_toolkit_name*: proc (): cstring{.cdecl.} - get_toolkit_version*: proc (): cstring{.cdecl.} - - PValueIface* = ptr TValueIface - TValueIface* = object of TGTypeInterface - get_current_value*: proc (obj: PValue, value: PGValue){.cdecl.} - get_maximum_value*: proc (obj: PValue, value: PGValue){.cdecl.} - get_minimum_value*: proc (obj: PValue, value: PGValue){.cdecl.} - set_current_value*: proc (obj: PValue, value: PGValue): gboolean{.cdecl.} - pad33*: TFunction - pad34*: TFunction - - -proc role_register*(name: cstring): TRole{.cdecl, dynlib: lib, - importc: "atk_role_register".} -proc object_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_object_get_type".} -proc TYPE_OBJECT*(): GType -proc `OBJECT`*(obj: pointer): PObject -proc OBJECT_CLASS*(klass: pointer): PObjectClass -proc IS_OBJECT*(obj: pointer): bool -proc IS_OBJECT_CLASS*(klass: pointer): bool -proc OBJECT_GET_CLASS*(obj: pointer): PObjectClass -proc TYPE_IMPLEMENTOR*(): GType -proc IS_IMPLEMENTOR*(obj: pointer): bool -proc IMPLEMENTOR*(obj: pointer): PImplementor -proc IMPLEMENTOR_GET_IFACE*(obj: pointer): PImplementorIface -proc implementor_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_implementor_get_type".} -proc ref_accessible*(implementor: PImplementor): PObject{.cdecl, - dynlib: lib, importc: "atk_implementor_ref_accessible".} -proc get_name*(accessible: PObject): cstring{.cdecl, dynlib: lib, - importc: "atk_object_get_name".} -proc get_description*(accessible: PObject): cstring{.cdecl, dynlib: lib, - importc: "atk_object_get_description".} -proc get_parent*(accessible: PObject): PObject{.cdecl, dynlib: lib, - importc: "atk_object_get_parent".} -proc get_n_accessible_children*(accessible: PObject): gint{.cdecl, - dynlib: lib, importc: "atk_object_get_n_accessible_children".} -proc ref_accessible_child*(accessible: PObject, i: gint): PObject{.cdecl, - dynlib: lib, importc: "atk_object_ref_accessible_child".} -proc ref_relation_set*(accessible: PObject): PRelationSet{.cdecl, - dynlib: lib, importc: "atk_object_ref_relation_set".} -proc get_role*(accessible: PObject): TRole{.cdecl, dynlib: lib, - importc: "atk_object_get_role".} -proc get_layer*(accessible: PObject): TLayer{.cdecl, dynlib: lib, - importc: "atk_object_get_layer".} -proc get_mdi_zorder*(accessible: PObject): gint{.cdecl, dynlib: lib, - importc: "atk_object_get_mdi_zorder".} -proc ref_state_set*(accessible: PObject): PStateSet{.cdecl, dynlib: lib, - importc: "atk_object_ref_state_set".} -proc get_index_in_parent*(accessible: PObject): gint{.cdecl, dynlib: lib, - importc: "atk_object_get_index_in_parent".} -proc set_name*(accessible: PObject, name: cstring){.cdecl, dynlib: lib, - importc: "atk_object_set_name".} -proc set_description*(accessible: PObject, description: cstring){.cdecl, - dynlib: lib, importc: "atk_object_set_description".} -proc set_parent*(accessible: PObject, parent: PObject){.cdecl, - dynlib: lib, importc: "atk_object_set_parent".} -proc set_role*(accessible: PObject, role: TRole){.cdecl, dynlib: lib, - importc: "atk_object_set_role".} -proc connect_property_change_handler*(accessible: PObject, - handler: TPropertyChangeHandler): guint{.cdecl, dynlib: lib, - importc: "atk_object_connect_property_change_handler".} -proc remove_property_change_handler*(accessible: PObject, - handler_id: guint){.cdecl, dynlib: lib, - importc: "atk_object_remove_property_change_handler".} -proc notify_state_change*(accessible: PObject, state: TState, - value: gboolean){.cdecl, dynlib: lib, - importc: "atk_object_notify_state_change".} -proc initialize*(accessible: PObject, data: gpointer){.cdecl, - dynlib: lib, importc: "atk_object_initialize".} -proc role_get_name*(role: TRole): cstring{.cdecl, dynlib: lib, - importc: "atk_role_get_name".} -proc role_for_name*(name: cstring): TRole{.cdecl, dynlib: lib, - importc: "atk_role_for_name".} -proc TYPE_ACTION*(): GType -proc IS_ACTION*(obj: pointer): bool -proc ACTION*(obj: pointer): PAction -proc ACTION_GET_IFACE*(obj: pointer): PActionIface -proc action_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_action_get_type".} -proc do_action*(action: PAction, i: gint): gboolean{.cdecl, dynlib: lib, - importc: "atk_action_do_action".} -proc get_n_actions*(action: PAction): gint{.cdecl, dynlib: lib, - importc: "atk_action_get_n_actions".} -proc get_description*(action: PAction, i: gint): cstring{.cdecl, - dynlib: lib, importc: "atk_action_get_description".} -proc get_name*(action: PAction, i: gint): cstring{.cdecl, dynlib: lib, - importc: "atk_action_get_name".} -proc get_keybinding*(action: PAction, i: gint): cstring{.cdecl, - dynlib: lib, importc: "atk_action_get_keybinding".} -proc set_description*(action: PAction, i: gint, desc: cstring): gboolean{. - cdecl, dynlib: lib, importc: "atk_action_set_description".} -proc TYPE_COMPONENT*(): GType -proc IS_COMPONENT*(obj: pointer): bool -proc COMPONENT*(obj: pointer): PComponent -proc COMPONENT_GET_IFACE*(obj: pointer): PComponentIface -proc component_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_component_get_type".} -proc add_focus_handler*(component: PComponent, handler: TFocusHandler): guint{. - cdecl, dynlib: lib, importc: "atk_component_add_focus_handler".} -proc contains*(component: PComponent, x, y: gint, - coord_type: TCoordType): gboolean{.cdecl, dynlib: lib, - importc: "atk_component_contains".} -proc ref_accessible_at_point*(component: PComponent, x, y: gint, - coord_type: TCoordType): PObject{.cdecl, - dynlib: lib, importc: "atk_component_ref_accessible_at_point".} -proc get_extents*(component: PComponent, x, y, width, height: Pgint, - coord_type: TCoordType){.cdecl, dynlib: lib, - importc: "atk_component_get_extents".} -proc get_position*(component: PComponent, x: Pgint, y: Pgint, - coord_type: TCoordType){.cdecl, dynlib: lib, - importc: "atk_component_get_position".} -proc get_size*(component: PComponent, width: Pgint, height: Pgint){. - cdecl, dynlib: lib, importc: "atk_component_get_size".} -proc get_layer*(component: PComponent): TLayer{.cdecl, dynlib: lib, - importc: "atk_component_get_layer".} -proc get_mdi_zorder*(component: PComponent): gint{.cdecl, dynlib: lib, - importc: "atk_component_get_mdi_zorder".} -proc grab_focus*(component: PComponent): gboolean{.cdecl, dynlib: lib, - importc: "atk_component_grab_focus".} -proc remove_focus_handler*(component: PComponent, handler_id: guint){. - cdecl, dynlib: lib, importc: "atk_component_remove_focus_handler".} -proc set_extents*(component: PComponent, x: gint, y: gint, - width: gint, height: gint, coord_type: TCoordType): gboolean{. - cdecl, dynlib: lib, importc: "atk_component_set_extents".} -proc set_position*(component: PComponent, x: gint, y: gint, - coord_type: TCoordType): gboolean{.cdecl, - dynlib: lib, importc: "atk_component_set_position".} -proc set_size*(component: PComponent, width: gint, height: gint): gboolean{. - cdecl, dynlib: lib, importc: "atk_component_set_size".} -proc TYPE_DOCUMENT*(): GType -proc IS_DOCUMENT*(obj: pointer): bool -proc DOCUMENT*(obj: pointer): PDocument -proc DOCUMENT_GET_IFACE*(obj: pointer): PDocumentIface -proc document_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_document_get_type".} -proc get_document_type*(document: PDocument): cstring{.cdecl, - dynlib: lib, importc: "atk_document_get_document_type".} -proc get_document*(document: PDocument): gpointer{.cdecl, dynlib: lib, - importc: "atk_document_get_document".} -proc TYPE_EDITABLE_TEXT*(): GType -proc IS_EDITABLE_TEXT*(obj: pointer): bool -proc EDITABLE_TEXT*(obj: pointer): PEditableText -proc EDITABLE_TEXT_GET_IFACE*(obj: pointer): PEditableTextIface -proc editable_text_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_editable_text_get_type".} -proc set_run_attributes*(text: PEditableText, - attrib_set: PAttributeSet, - start_offset: gint, end_offset: gint): gboolean{. - cdecl, dynlib: lib, importc: "atk_editable_text_set_run_attributes".} -proc set_text_contents*(text: PEditableText, string: cstring){. - cdecl, dynlib: lib, importc: "atk_editable_text_set_text_contents".} -proc insert_text*(text: PEditableText, `string`: cstring, - length: gint, position: Pgint){.cdecl, - dynlib: lib, importc: "atk_editable_text_insert_text".} -proc copy_text*(text: PEditableText, start_pos: gint, - end_pos: gint){.cdecl, dynlib: lib, - importc: "atk_editable_text_copy_text".} -proc cut_text*(text: PEditableText, start_pos: gint, end_pos: gint){. - cdecl, dynlib: lib, importc: "atk_editable_text_cut_text".} -proc delete_text*(text: PEditableText, start_pos: gint, - end_pos: gint){.cdecl, dynlib: lib, - importc: "atk_editable_text_delete_text".} -proc paste_text*(text: PEditableText, position: gint){.cdecl, - dynlib: lib, importc: "atk_editable_text_paste_text".} -proc TYPE_GOBJECT_ACCESSIBLE*(): GType -proc GOBJECT_ACCESSIBLE*(obj: pointer): PGObjectAccessible -proc GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): PGObjectAccessibleClass -proc IS_GOBJECT_ACCESSIBLE*(obj: pointer): bool -proc IS_GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): bool -proc GOBJECT_ACCESSIBLE_GET_CLASS*(obj: pointer): PGObjectAccessibleClass -proc gobject_accessible_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_gobject_accessible_get_type".} -proc accessible_for_object*(obj: PGObject): PObject{.cdecl, dynlib: lib, - importc: "atk_gobject_accessible_for_object".} -proc get_object*(obj: PGObjectAccessible): PGObject{.cdecl, - dynlib: lib, importc: "atk_gobject_accessible_get_object".} -proc TYPE_HYPERLINK*(): GType -proc HYPERLINK*(obj: pointer): PHyperlink -proc HYPERLINK_CLASS*(klass: pointer): PHyperlinkClass -proc IS_HYPERLINK*(obj: pointer): bool -proc IS_HYPERLINK_CLASS*(klass: pointer): bool -proc HYPERLINK_GET_CLASS*(obj: pointer): PHyperlinkClass -proc hyperlink_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_hyperlink_get_type".} -proc get_uri*(link: PHyperlink, i: gint): cstring{.cdecl, dynlib: lib, - importc: "atk_hyperlink_get_uri".} -proc get_object*(link: PHyperlink, i: gint): PObject{.cdecl, - dynlib: lib, importc: "atk_hyperlink_get_object".} -proc get_end_index*(link: PHyperlink): gint{.cdecl, dynlib: lib, - importc: "atk_hyperlink_get_end_index".} -proc get_start_index*(link: PHyperlink): gint{.cdecl, dynlib: lib, - importc: "atk_hyperlink_get_start_index".} -proc is_valid*(link: PHyperlink): gboolean{.cdecl, dynlib: lib, - importc: "atk_hyperlink_is_valid".} -proc get_n_anchors*(link: PHyperlink): gint{.cdecl, dynlib: lib, - importc: "atk_hyperlink_get_n_anchors".} -proc TYPE_HYPERTEXT*(): GType -proc IS_HYPERTEXT*(obj: pointer): bool -proc HYPERTEXT*(obj: pointer): PHypertext -proc HYPERTEXT_GET_IFACE*(obj: pointer): PHypertextIface -proc hypertext_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_hypertext_get_type".} -proc get_link*(hypertext: PHypertext, link_index: gint): PHyperlink{. - cdecl, dynlib: lib, importc: "atk_hypertext_get_link".} -proc get_n_links*(hypertext: PHypertext): gint{.cdecl, dynlib: lib, - importc: "atk_hypertext_get_n_links".} -proc get_link_index*(hypertext: PHypertext, char_index: gint): gint{. - cdecl, dynlib: lib, importc: "atk_hypertext_get_link_index".} -proc TYPE_IMAGE*(): GType -proc IS_IMAGE*(obj: pointer): bool -proc IMAGE*(obj: pointer): PImage -proc IMAGE_GET_IFACE*(obj: pointer): PImageIface -proc image_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_image_get_type".} -proc get_image_description*(image: PImage): cstring{.cdecl, dynlib: lib, - importc: "atk_image_get_image_description".} -proc get_image_size*(image: PImage, width: Pgint, height: Pgint){.cdecl, - dynlib: lib, importc: "atk_image_get_image_size".} -proc set_image_description*(image: PImage, description: cstring): gboolean{. - cdecl, dynlib: lib, importc: "atk_image_set_image_description".} -proc get_image_position*(image: PImage, x: Pgint, y: Pgint, - coord_type: TCoordType){.cdecl, dynlib: lib, - importc: "atk_image_get_image_position".} -proc TYPE_OBJECT_FACTORY*(): GType -proc OBJECT_FACTORY*(obj: pointer): PObjectFactory -proc OBJECT_FACTORY_CLASS*(klass: pointer): PObjectFactoryClass -proc IS_OBJECT_FACTORY*(obj: pointer): bool -proc IS_OBJECT_FACTORY_CLASS*(klass: pointer): bool -proc OBJECT_FACTORY_GET_CLASS*(obj: pointer): PObjectFactoryClass -proc object_factory_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_object_factory_get_type".} -proc create_accessible*(factory: PObjectFactory, obj: PGObject): PObject{. - cdecl, dynlib: lib, importc: "atk_object_factory_create_accessible".} -proc invalidate*(factory: PObjectFactory){.cdecl, dynlib: lib, - importc: "atk_object_factory_invalidate".} -proc get_accessible_type*(factory: PObjectFactory): GType{.cdecl, - dynlib: lib, importc: "atk_object_factory_get_accessible_type".} -proc TYPE_REGISTRY*(): GType -proc REGISTRY*(obj: pointer): PRegistry -proc REGISTRY_CLASS*(klass: pointer): PRegistryClass -proc IS_REGISTRY*(obj: pointer): bool -proc IS_REGISTRY_CLASS*(klass: pointer): bool -proc REGISTRY_GET_CLASS*(obj: pointer): PRegistryClass -proc registry_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_registry_get_type".} -proc set_factory_type*(registry: PRegistry, `type`: GType, - factory_type: GType){.cdecl, dynlib: lib, - importc: "atk_registry_set_factory_type".} -proc get_factory_type*(registry: PRegistry, `type`: GType): GType{. - cdecl, dynlib: lib, importc: "atk_registry_get_factory_type".} -proc get_factory*(registry: PRegistry, `type`: GType): PObjectFactory{. - cdecl, dynlib: lib, importc: "atk_registry_get_factory".} -proc get_default_registry*(): PRegistry{.cdecl, dynlib: lib, - importc: "atk_get_default_registry".} -proc TYPE_RELATION*(): GType -proc RELATION*(obj: pointer): PRelation -proc RELATION_CLASS*(klass: pointer): PRelationClass -proc IS_RELATION*(obj: pointer): bool -proc IS_RELATION_CLASS*(klass: pointer): bool -proc RELATION_GET_CLASS*(obj: pointer): PRelationClass -proc relation_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_relation_get_type".} -proc relation_type_register*(name: cstring): TRelationType{.cdecl, dynlib: lib, - importc: "atk_relation_type_register".} -proc relation_type_get_name*(`type`: TRelationType): cstring{.cdecl, - dynlib: lib, importc: "atk_relation_type_get_name".} -proc relation_type_for_name*(name: cstring): TRelationType{.cdecl, dynlib: lib, - importc: "atk_relation_type_for_name".} -proc relation_new*(targets: PPAtkObject, n_targets: gint, - relationship: TRelationType): PRelation{.cdecl, dynlib: lib, - importc: "atk_relation_new".} -proc get_relation_type*(relation: PRelation): TRelationType{.cdecl, - dynlib: lib, importc: "atk_relation_get_relation_type".} -proc get_target*(relation: PRelation): PGPtrArray{.cdecl, dynlib: lib, - importc: "atk_relation_get_target".} -proc TYPE_RELATION_SET*(): GType -proc RELATION_SET*(obj: pointer): PRelationSet -proc RELATION_SET_CLASS*(klass: pointer): PRelationSetClass -proc IS_RELATION_SET*(obj: pointer): bool -proc IS_RELATION_SET_CLASS*(klass: pointer): bool -proc RELATION_SET_GET_CLASS*(obj: pointer): PRelationSetClass -proc relation_set_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_relation_set_get_type".} -proc relation_set_new*(): PRelationSet{.cdecl, dynlib: lib, - importc: "atk_relation_set_new".} -proc contains*(RelationSet: PRelationSet, - relationship: TRelationType): gboolean{.cdecl, - dynlib: lib, importc: "atk_relation_set_contains".} -proc remove*(RelationSet: PRelationSet, relation: PRelation){. - cdecl, dynlib: lib, importc: "atk_relation_set_remove".} -proc add*(RelationSet: PRelationSet, relation: PRelation){.cdecl, - dynlib: lib, importc: "atk_relation_set_add".} -proc get_n_relations*(RelationSet: PRelationSet): gint{.cdecl, - dynlib: lib, importc: "atk_relation_set_get_n_relations".} -proc get_relation*(RelationSet: PRelationSet, i: gint): PRelation{. - cdecl, dynlib: lib, importc: "atk_relation_set_get_relation".} -proc get_relation_by_type*(RelationSet: PRelationSet, - relationship: TRelationType): PRelation{. - cdecl, dynlib: lib, importc: "atk_relation_set_get_relation_by_type".} -proc TYPE_SELECTION*(): GType -proc IS_SELECTION*(obj: pointer): bool -proc SELECTION*(obj: pointer): PSelection -proc SELECTION_GET_IFACE*(obj: pointer): PSelectionIface -proc selection_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_selection_get_type".} -proc add_selection*(selection: PSelection, i: gint): gboolean{.cdecl, - dynlib: lib, importc: "atk_selection_add_selection".} -proc clear_selection*(selection: PSelection): gboolean{.cdecl, - dynlib: lib, importc: "atk_selection_clear_selection".} -proc ref_selection*(selection: PSelection, i: gint): PObject{.cdecl, - dynlib: lib, importc: "atk_selection_ref_selection".} -proc get_selection_count*(selection: PSelection): gint{.cdecl, - dynlib: lib, importc: "atk_selection_get_selection_count".} -proc is_child_selected*(selection: PSelection, i: gint): gboolean{. - cdecl, dynlib: lib, importc: "atk_selection_is_child_selected".} -proc remove_selection*(selection: PSelection, i: gint): gboolean{. - cdecl, dynlib: lib, importc: "atk_selection_remove_selection".} -proc select_all_selection*(selection: PSelection): gboolean{.cdecl, - dynlib: lib, importc: "atk_selection_select_all_selection".} -proc state_type_register*(name: cstring): TStateType{.cdecl, dynlib: lib, - importc: "atk_state_type_register".} -proc state_type_get_name*(`type`: TStateType): cstring{.cdecl, dynlib: lib, - importc: "atk_state_type_get_name".} -proc state_type_for_name*(name: cstring): TStateType{.cdecl, dynlib: lib, - importc: "atk_state_type_for_name".} -proc TYPE_STATE_SET*(): GType -proc STATE_SET*(obj: pointer): PStateSet -proc STATE_SET_CLASS*(klass: pointer): PStateSetClass -proc IS_STATE_SET*(obj: pointer): bool -proc IS_STATE_SET_CLASS*(klass: pointer): bool -proc STATE_SET_GET_CLASS*(obj: pointer): PStateSetClass -proc state_set_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_state_set_get_type".} -proc state_set_new*(): PStateSet{.cdecl, dynlib: lib, - importc: "atk_state_set_new".} -proc is_empty*(StateSet: PStateSet): gboolean{.cdecl, dynlib: lib, - importc: "atk_state_set_is_empty".} -proc add_state*(StateSet: PStateSet, `type`: TStateType): gboolean{. - cdecl, dynlib: lib, importc: "atk_state_set_add_state".} -proc add_states*(StateSet: PStateSet, types: PStateType, n_types: gint){. - cdecl, dynlib: lib, importc: "atk_state_set_add_states".} -proc clear_states*(StateSet: PStateSet){.cdecl, dynlib: lib, - importc: "atk_state_set_clear_states".} -proc contains_state*(StateSet: PStateSet, `type`: TStateType): gboolean{. - cdecl, dynlib: lib, importc: "atk_state_set_contains_state".} -proc contains_states*(StateSet: PStateSet, types: PStateType, - n_types: gint): gboolean{.cdecl, dynlib: lib, - importc: "atk_state_set_contains_states".} -proc remove_state*(StateSet: PStateSet, `type`: TStateType): gboolean{. - cdecl, dynlib: lib, importc: "atk_state_set_remove_state".} -proc and_sets*(StateSet: PStateSet, compare_set: PStateSet): PStateSet{. - cdecl, dynlib: lib, importc: "atk_state_set_and_sets".} -proc or_sets*(StateSet: PStateSet, compare_set: PStateSet): PStateSet{. - cdecl, dynlib: lib, importc: "atk_state_set_or_sets".} -proc xor_sets*(StateSet: PStateSet, compare_set: PStateSet): PStateSet{. - cdecl, dynlib: lib, importc: "atk_state_set_xor_sets".} -proc TYPE_STREAMABLE_CONTENT*(): GType -proc IS_STREAMABLE_CONTENT*(obj: pointer): bool -proc STREAMABLE_CONTENT*(obj: pointer): PStreamableContent -proc STREAMABLE_CONTENT_GET_IFACE*(obj: pointer): PStreamableContentIface -proc streamable_content_get_type*(): GType{.cdecl, dynlib: lib, - importc: "atk_streamable_content_get_type".} -proc get_n_mime_types*(streamable: PStreamableContent): gint{. - cdecl, dynlib: lib, importc: "atk_streamable_content_get_n_mime_types".} -proc get_mime_type*(streamable: PStreamableContent, i: gint): cstring{. - cdecl, dynlib: lib, importc: "atk_streamable_content_get_mime_type".} -proc get_stream*(streamable: PStreamableContent, - mime_type: cstring): PGIOChannel{.cdecl, - dynlib: lib, importc: "atk_streamable_content_get_stream".} -proc TYPE_TABLE*(): GType -proc IS_TABLE*(obj: pointer): bool -proc TABLE*(obj: pointer): PTable -proc TABLE_GET_IFACE*(obj: pointer): PTableIface -proc table_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_table_get_type".} -proc ref_at*(table: PTable, row, column: gint): PObject{.cdecl, - dynlib: lib, importc: "atk_table_ref_at".} -proc get_index_at*(table: PTable, row, column: gint): gint{.cdecl, - dynlib: lib, importc: "atk_table_get_index_at".} -proc get_column_at_index*(table: PTable, index: gint): gint{.cdecl, - dynlib: lib, importc: "atk_table_get_column_at_index".} -proc get_row_at_index*(table: PTable, index: gint): gint{.cdecl, - dynlib: lib, importc: "atk_table_get_row_at_index".} -proc get_n_columns*(table: PTable): gint{.cdecl, dynlib: lib, - importc: "atk_table_get_n_columns".} -proc get_n_rows*(table: PTable): gint{.cdecl, dynlib: lib, - importc: "atk_table_get_n_rows".} -proc get_column_extent_at*(table: PTable, row: gint, column: gint): gint{. - cdecl, dynlib: lib, importc: "atk_table_get_column_extent_at".} -proc get_row_extent_at*(table: PTable, row: gint, column: gint): gint{. - cdecl, dynlib: lib, importc: "atk_table_get_row_extent_at".} -proc get_caption*(table: PTable): PObject{.cdecl, dynlib: lib, - importc: "atk_table_get_caption".} -proc get_column_description*(table: PTable, column: gint): cstring{.cdecl, - dynlib: lib, importc: "atk_table_get_column_description".} -proc get_column_header*(table: PTable, column: gint): PObject{.cdecl, - dynlib: lib, importc: "atk_table_get_column_header".} -proc get_row_description*(table: PTable, row: gint): cstring{.cdecl, - dynlib: lib, importc: "atk_table_get_row_description".} -proc get_row_header*(table: PTable, row: gint): PObject{.cdecl, - dynlib: lib, importc: "atk_table_get_row_header".} -proc get_summary*(table: PTable): PObject{.cdecl, dynlib: lib, - importc: "atk_table_get_summary".} -proc set_caption*(table: PTable, caption: PObject){.cdecl, dynlib: lib, - importc: "atk_table_set_caption".} -proc set_column_description*(table: PTable, column: gint, - description: cstring){.cdecl, dynlib: lib, - importc: "atk_table_set_column_description".} -proc set_column_header*(table: PTable, column: gint, header: PObject){. - cdecl, dynlib: lib, importc: "atk_table_set_column_header".} -proc set_row_description*(table: PTable, row: gint, description: cstring){. - cdecl, dynlib: lib, importc: "atk_table_set_row_description".} -proc set_row_header*(table: PTable, row: gint, header: PObject){.cdecl, - dynlib: lib, importc: "atk_table_set_row_header".} -proc set_summary*(table: PTable, accessible: PObject){.cdecl, dynlib: lib, - importc: "atk_table_set_summary".} -proc get_selected_columns*(table: PTable, selected: PPgint): gint{.cdecl, - dynlib: lib, importc: "atk_table_get_selected_columns".} -proc get_selected_rows*(table: PTable, selected: PPgint): gint{.cdecl, - dynlib: lib, importc: "atk_table_get_selected_rows".} -proc is_column_selected*(table: PTable, column: gint): gboolean{.cdecl, - dynlib: lib, importc: "atk_table_is_column_selected".} -proc is_row_selected*(table: PTable, row: gint): gboolean{.cdecl, - dynlib: lib, importc: "atk_table_is_row_selected".} -proc is_selected*(table: PTable, row: gint, column: gint): gboolean{. - cdecl, dynlib: lib, importc: "atk_table_is_selected".} -proc add_row_selection*(table: PTable, row: gint): gboolean{.cdecl, - dynlib: lib, importc: "atk_table_add_row_selection".} -proc remove_row_selection*(table: PTable, row: gint): gboolean{.cdecl, - dynlib: lib, importc: "atk_table_remove_row_selection".} -proc add_column_selection*(table: PTable, column: gint): gboolean{.cdecl, - dynlib: lib, importc: "atk_table_add_column_selection".} -proc remove_column_selection*(table: PTable, column: gint): gboolean{. - cdecl, dynlib: lib, importc: "atk_table_remove_column_selection".} -proc text_attribute_register*(name: cstring): TTextAttribute{.cdecl, - dynlib: lib, importc: "atk_text_attribute_register".} -proc TYPE_TEXT*(): GType -proc IS_TEXT*(obj: pointer): bool -proc TEXT*(obj: pointer): PText -proc TEXT_GET_IFACE*(obj: pointer): PTextIface -proc text_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_text_get_type".} -proc get_text*(text: PText, start_offset: gint, end_offset: gint): cstring{. - cdecl, dynlib: lib, importc: "atk_text_get_text".} -proc get_character_at_offset*(text: PText, offset: gint): gunichar{.cdecl, - dynlib: lib, importc: "atk_text_get_character_at_offset".} -proc get_text_after_offset*(text: PText, offset: gint, - boundary_type: TTextBoundary, - start_offset: Pgint, end_offset: Pgint): cstring{. - cdecl, dynlib: lib, importc: "atk_text_get_text_after_offset".} -proc get_text_at_offset*(text: PText, offset: gint, - boundary_type: TTextBoundary, start_offset: Pgint, - end_offset: Pgint): cstring{.cdecl, dynlib: lib, - importc: "atk_text_get_text_at_offset".} -proc get_text_before_offset*(text: PText, offset: gint, - boundary_type: TTextBoundary, - start_offset: Pgint, end_offset: Pgint): cstring{. - cdecl, dynlib: lib, importc: "atk_text_get_text_before_offset".} -proc get_caret_offset*(text: PText): gint{.cdecl, dynlib: lib, - importc: "atk_text_get_caret_offset".} -proc get_character_extents*(text: PText, offset: gint, x: Pgint, y: Pgint, - width: Pgint, height: Pgint, coords: TCoordType){. - cdecl, dynlib: lib, importc: "atk_text_get_character_extents".} -proc get_run_attributes*(text: PText, offset: gint, start_offset: Pgint, - end_offset: Pgint): PAttributeSet{.cdecl, - dynlib: lib, importc: "atk_text_get_run_attributes".} -proc get_default_attributes*(text: PText): PAttributeSet{.cdecl, - dynlib: lib, importc: "atk_text_get_default_attributes".} -proc get_character_count*(text: PText): gint{.cdecl, dynlib: lib, - importc: "atk_text_get_character_count".} -proc get_offset_at_point*(text: PText, x: gint, y: gint, coords: TCoordType): gint{. - cdecl, dynlib: lib, importc: "atk_text_get_offset_at_point".} -proc get_n_selections*(text: PText): gint{.cdecl, dynlib: lib, - importc: "atk_text_get_n_selections".} -proc get_selection*(text: PText, selection_num: gint, start_offset: Pgint, - end_offset: Pgint): cstring{.cdecl, dynlib: lib, - importc: "atk_text_get_selection".} -proc add_selection*(text: PText, start_offset: gint, end_offset: gint): gboolean{. - cdecl, dynlib: lib, importc: "atk_text_add_selection".} -proc remove_selection*(text: PText, selection_num: gint): gboolean{.cdecl, - dynlib: lib, importc: "atk_text_remove_selection".} -proc set_selection*(text: PText, selection_num: gint, start_offset: gint, - end_offset: gint): gboolean{.cdecl, dynlib: lib, - importc: "atk_text_set_selection".} -proc set_caret_offset*(text: PText, offset: gint): gboolean{.cdecl, - dynlib: lib, importc: "atk_text_set_caret_offset".} -proc free*(attrib_set: PAttributeSet){.cdecl, dynlib: lib, - importc: "atk_attribute_set_free".} -proc text_attribute_get_name*(attr: TTextAttribute): cstring{.cdecl, - dynlib: lib, importc: "atk_text_attribute_get_name".} -proc text_attribute_for_name*(name: cstring): TTextAttribute{.cdecl, - dynlib: lib, importc: "atk_text_attribute_for_name".} -proc text_attribute_get_value*(attr: TTextAttribute, index: gint): cstring{. - cdecl, dynlib: lib, importc: "atk_text_attribute_get_value".} -proc TYPE_UTIL*(): GType -proc IS_UTIL*(obj: pointer): bool -proc UTIL*(obj: pointer): PUtil -proc UTIL_CLASS*(klass: pointer): PUtilClass -proc IS_UTIL_CLASS*(klass: pointer): bool -proc UTIL_GET_CLASS*(obj: pointer): PUtilClass -proc util_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_util_get_type".} -proc add_focus_tracker*(focus_tracker: TEventListener): guint{.cdecl, - dynlib: lib, importc: "atk_add_focus_tracker".} -proc remove_focus_tracker*(tracker_id: guint){.cdecl, dynlib: lib, - importc: "atk_remove_focus_tracker".} -proc focus_tracker_init*(add_function: TEventListenerInit){.cdecl, dynlib: lib, - importc: "atk_focus_tracker_init".} -proc focus_tracker_notify*(anObject: PObject){.cdecl, dynlib: lib, - importc: "atk_focus_tracker_notify".} -proc add_global_event_listener*(listener: TGSignalEmissionHook, - event_type: cstring): guint{.cdecl, dynlib: lib, - importc: "atk_add_global_event_listener".} -proc remove_global_event_listener*(listener_id: guint){.cdecl, dynlib: lib, - importc: "atk_remove_global_event_listener".} -proc add_key_event_listener*(listener: TKeySnoopFunc, data: gpointer): guint{. - cdecl, dynlib: lib, importc: "atk_add_key_event_listener".} -proc remove_key_event_listener*(listener_id: guint){.cdecl, dynlib: lib, - importc: "atk_remove_key_event_listener".} -proc get_root*(): PObject{.cdecl, dynlib: lib, importc: "atk_get_root".} -proc get_toolkit_name*(): cstring{.cdecl, dynlib: lib, - importc: "atk_get_toolkit_name".} -proc get_toolkit_version*(): cstring{.cdecl, dynlib: lib, - importc: "atk_get_toolkit_version".} -proc TYPE_VALUE*(): GType -proc IS_VALUE*(obj: pointer): bool -proc VALUE*(obj: pointer): PValue -proc VALUE_GET_IFACE*(obj: pointer): PValueIface -proc value_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_value_get_type".} -proc get_current_value*(obj: PValue, value: PGValue){.cdecl, dynlib: lib, - importc: "atk_value_get_current_value".} -proc get_maximum_value*(obj: PValue, value: PGValue){.cdecl, dynlib: lib, - importc: "atk_value_get_maximum_value".} -proc get_minimum_value*(obj: PValue, value: PGValue){.cdecl, dynlib: lib, - importc: "atk_value_get_minimum_value".} -proc set_current_value*(obj: PValue, value: PGValue): gboolean{.cdecl, - dynlib: lib, importc: "atk_value_set_current_value".} -proc TYPE_OBJECT*(): GType = - result = object_get_type() - -proc `OBJECT`*(obj: pointer): PObject = - result = cast[PObject](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_OBJECT())) - -proc OBJECT_CLASS*(klass: pointer): PObjectClass = - result = cast[PObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_OBJECT())) - -proc IS_OBJECT*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_OBJECT()) - -proc IS_OBJECT_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_OBJECT()) - -proc OBJECT_GET_CLASS*(obj: pointer): PObjectClass = - result = cast[PObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_OBJECT())) - -proc TYPE_IMPLEMENTOR*(): GType = - result = implementor_get_type() - -proc IS_IMPLEMENTOR*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_IMPLEMENTOR()) - -proc IMPLEMENTOR*(obj: pointer): PImplementor = - result = PImplementor(G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_IMPLEMENTOR())) - -proc IMPLEMENTOR_GET_IFACE*(obj: pointer): PImplementorIface = - result = cast[PImplementorIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_IMPLEMENTOR())) - -proc TYPE_ACTION*(): GType = - result = action_get_type() - -proc IS_ACTION*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_ACTION()) - -proc ACTION*(obj: pointer): PAction = - result = PAction(G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_ACTION())) - -proc ACTION_GET_IFACE*(obj: pointer): PActionIface = - result = cast[PActionIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_ACTION())) - -proc TYPE_COMPONENT*(): GType = - result = component_get_type() - -proc IS_COMPONENT*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_COMPONENT()) - -proc COMPONENT*(obj: pointer): PComponent = - result = PComponent(G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_COMPONENT())) - -proc COMPONENT_GET_IFACE*(obj: pointer): PComponentIface = - result = cast[PComponentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_COMPONENT())) - -proc TYPE_DOCUMENT*(): GType = - result = document_get_type() - -proc IS_DOCUMENT*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_DOCUMENT()) - -proc DOCUMENT*(obj: pointer): PDocument = - result = cast[PDocument](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_DOCUMENT())) - -proc DOCUMENT_GET_IFACE*(obj: pointer): PDocumentIface = - result = cast[PDocumentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_DOCUMENT())) - -proc TYPE_EDITABLE_TEXT*(): GType = - result = editable_text_get_type() - -proc IS_EDITABLE_TEXT*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_EDITABLE_TEXT()) - -proc EDITABLE_TEXT*(obj: pointer): PEditableText = - result = cast[PEditableText](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_EDITABLE_TEXT())) - -proc EDITABLE_TEXT_GET_IFACE*(obj: pointer): PEditableTextIface = - result = cast[PEditableTextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_EDITABLE_TEXT())) - -proc TYPE_GOBJECT_ACCESSIBLE*(): GType = - result = gobject_accessible_get_type() - -proc GOBJECT_ACCESSIBLE*(obj: pointer): PGObjectAccessible = - result = cast[PGObjectAccessible](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_GOBJECT_ACCESSIBLE())) - -proc GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): PGObjectAccessibleClass = - result = cast[PGObjectAccessibleClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_GOBJECT_ACCESSIBLE())) - -proc IS_GOBJECT_ACCESSIBLE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_GOBJECT_ACCESSIBLE()) - -proc IS_GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GOBJECT_ACCESSIBLE()) - -proc GOBJECT_ACCESSIBLE_GET_CLASS*(obj: pointer): PGObjectAccessibleClass = - result = cast[PGObjectAccessibleClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_GOBJECT_ACCESSIBLE())) - -proc TYPE_HYPERLINK*(): GType = - result = hyperlink_get_type() - -proc HYPERLINK*(obj: pointer): PHyperlink = - result = cast[PHyperlink](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_HYPERLINK())) - -proc HYPERLINK_CLASS*(klass: pointer): PHyperlinkClass = - result = cast[PHyperlinkClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_HYPERLINK())) - -proc IS_HYPERLINK*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_HYPERLINK()) - -proc IS_HYPERLINK_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_HYPERLINK()) - -proc HYPERLINK_GET_CLASS*(obj: pointer): PHyperlinkClass = - result = cast[PHyperlinkClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_HYPERLINK())) - -proc TYPE_HYPERTEXT*(): GType = - result = hypertext_get_type() - -proc IS_HYPERTEXT*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_HYPERTEXT()) - -proc HYPERTEXT*(obj: pointer): PHypertext = - result = cast[PHypertext](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_HYPERTEXT())) - -proc HYPERTEXT_GET_IFACE*(obj: pointer): PHypertextIface = - result = cast[PHypertextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_HYPERTEXT())) - -proc TYPE_IMAGE*(): GType = - result = image_get_type() - -proc IS_IMAGE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_IMAGE()) - -proc IMAGE*(obj: pointer): PImage = - result = cast[PImage](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_IMAGE())) - -proc IMAGE_GET_IFACE*(obj: pointer): PImageIface = - result = cast[PImageIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_IMAGE())) - -proc TYPE_OBJECT_FACTORY*(): GType = - result = object_factory_get_type() - -proc OBJECT_FACTORY*(obj: pointer): PObjectFactory = - result = cast[PObjectFactory](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_OBJECT_FACTORY())) - -proc OBJECT_FACTORY_CLASS*(klass: pointer): PObjectFactoryClass = - result = cast[PObjectFactoryClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_OBJECT_FACTORY())) - -proc IS_OBJECT_FACTORY*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_OBJECT_FACTORY()) - -proc IS_OBJECT_FACTORY_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_OBJECT_FACTORY()) - -proc OBJECT_FACTORY_GET_CLASS*(obj: pointer): PObjectFactoryClass = - result = cast[PObjectFactoryClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_OBJECT_FACTORY())) - -proc TYPE_REGISTRY*(): GType = - result = registry_get_type() - -proc REGISTRY*(obj: pointer): PRegistry = - result = cast[PRegistry](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_REGISTRY())) - -proc REGISTRY_CLASS*(klass: pointer): PRegistryClass = - result = cast[PRegistryClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_REGISTRY())) - -proc IS_REGISTRY*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_REGISTRY()) - -proc IS_REGISTRY_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_REGISTRY()) - -proc REGISTRY_GET_CLASS*(obj: pointer): PRegistryClass = - result = cast[PRegistryClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_REGISTRY())) - -proc TYPE_RELATION*(): GType = - result = relation_get_type() - -proc RELATION*(obj: pointer): PRelation = - result = cast[PRelation](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_RELATION())) - -proc RELATION_CLASS*(klass: pointer): PRelationClass = - result = cast[PRelationClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_RELATION())) - -proc IS_RELATION*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_RELATION()) - -proc IS_RELATION_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_RELATION()) - -proc RELATION_GET_CLASS*(obj: pointer): PRelationClass = - result = cast[PRelationClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_RELATION())) - -proc TYPE_RELATION_SET*(): GType = - result = relation_set_get_type() - -proc RELATION_SET*(obj: pointer): PRelationSet = - result = cast[PRelationSet](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_RELATION_SET())) - -proc RELATION_SET_CLASS*(klass: pointer): PRelationSetClass = - result = cast[PRelationSetClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_RELATION_SET())) - -proc IS_RELATION_SET*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_RELATION_SET()) - -proc IS_RELATION_SET_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_RELATION_SET()) - -proc RELATION_SET_GET_CLASS*(obj: pointer): PRelationSetClass = - result = cast[PRelationSetClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_RELATION_SET())) - -proc TYPE_SELECTION*(): GType = - result = selection_get_type() - -proc IS_SELECTION*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_SELECTION()) - -proc SELECTION*(obj: pointer): PSelection = - result = cast[PSelection](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_SELECTION())) - -proc SELECTION_GET_IFACE*(obj: pointer): PSelectionIface = - result = cast[PSelectionIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_SELECTION())) - -proc TYPE_STATE_SET*(): GType = - result = state_set_get_type() - -proc STATE_SET*(obj: pointer): PStateSet = - result = cast[PStateSet](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_STATE_SET())) - -proc STATE_SET_CLASS*(klass: pointer): PStateSetClass = - result = cast[PStateSetClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_STATE_SET())) - -proc IS_STATE_SET*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_STATE_SET()) - -proc IS_STATE_SET_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_STATE_SET()) - -proc STATE_SET_GET_CLASS*(obj: pointer): PStateSetClass = - result = cast[PStateSetClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_STATE_SET())) - -proc TYPE_STREAMABLE_CONTENT*(): GType = - result = streamable_content_get_type() - -proc IS_STREAMABLE_CONTENT*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_STREAMABLE_CONTENT()) - -proc STREAMABLE_CONTENT*(obj: pointer): PStreamableContent = - result = cast[PStreamableContent](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_STREAMABLE_CONTENT())) - -proc STREAMABLE_CONTENT_GET_IFACE*(obj: pointer): PStreamableContentIface = - result = cast[PStreamableContentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_STREAMABLE_CONTENT())) - -proc TYPE_TABLE*(): GType = - result = table_get_type() - -proc IS_TABLE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TABLE()) - -proc TABLE*(obj: pointer): PTable = - result = cast[PTable](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TABLE())) - -proc TABLE_GET_IFACE*(obj: pointer): PTableIface = - result = cast[PTableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_TABLE())) - -proc TYPE_TEXT*(): GType = - result = text_get_type() - -proc IS_TEXT*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT()) - -proc TEXT*(obj: pointer): PText = - result = cast[PText](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TEXT())) - -proc TEXT_GET_IFACE*(obj: pointer): PTextIface = - result = cast[PTextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_TEXT())) - -proc TYPE_UTIL*(): GType = - result = util_get_type() - -proc IS_UTIL*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_UTIL()) - -proc UTIL*(obj: pointer): PUtil = - result = cast[PUtil](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_UTIL())) - -proc UTIL_CLASS*(klass: pointer): PUtilClass = - result = cast[PUtilClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_UTIL())) - -proc IS_UTIL_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_UTIL()) - -proc UTIL_GET_CLASS*(obj: pointer): PUtilClass = - result = cast[PUtilClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_UTIL())) - -proc TYPE_VALUE*(): GType = - result = value_get_type() - -proc IS_VALUE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_VALUE()) - -proc VALUE*(obj: pointer): PValue = - result = cast[PValue](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_VALUE())) - -proc VALUE_GET_IFACE*(obj: pointer): PValueIface = - result = cast[PValueIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_VALUE())) diff --git a/lib/wrappers/gtk/gdk2.nim b/lib/wrappers/gtk/gdk2.nim deleted file mode 100644 index d84f7ccc3c..0000000000 --- a/lib/wrappers/gtk/gdk2.nim +++ /dev/null @@ -1,3873 +0,0 @@ -{.deadCodeElim: on.} -import - glib2, gdk2pixbuf, pango - -when defined(win32): - const - lib = "libgdk-win32-2.0-0.dll" -elif defined(macosx): - # 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 - lib = "libgdk-x11-2.0.dylib" -else: - const - lib = "libgdk-x11-2.0.so(|.0)" -const - NUMPTSTOBUFFER* = 200 - MAX_TIMECOORD_AXES* = 128 - -type - PDeviceClass* = ptr TDeviceClass - TDeviceClass* = object of TGObjectClass - PVisualClass* = ptr TVisualClass - TVisualClass* = object of TGObjectClass - PColor* = ptr TColor - TColor*{.final, pure.} = object - pixel*: guint32 - red*: guint16 - green*: guint16 - blue*: guint16 - - PColormap* = ptr TColormap - PDrawable* = ptr TDrawable - TDrawable* = object of TGObject - PWindow* = ptr TWindow - TWindow* = TDrawable - PPixmap* = ptr TPixmap - TPixmap* = TDrawable - PBitmap* = ptr TBitmap - TBitmap* = TDrawable - PFontType* = ptr TFontType - TFontType* = enum - FONT_FONT, FONT_FONTSET - PFont* = ptr TFont - TFont*{.final, pure.} = object - `type`*: TFontType - ascent*: gint - descent*: gint - - PFunction* = ptr TFunction - TFunction* = enum - funcCOPY, funcINVERT, funcXOR, funcCLEAR, funcAND, - funcAND_REVERSE, funcAND_INVERT, funcNOOP, funcOR, funcEQUIV, - funcOR_REVERSE, funcCOPY_INVERT, funcOR_INVERT, funcNAND, funcNOR, funcSET - PCapStyle* = ptr TCapStyle - TCapStyle* = enum - CAP_NOT_LAST, CAP_BUTT, CAP_ROUND, CAP_PROJECTING - PFill* = ptr TFill - TFill* = enum - SOLID, TILED, STIPPLED, OPAQUE_STIPPLED - PJoinStyle* = ptr TJoinStyle - TJoinStyle* = enum - JOIN_MITER, JOIN_ROUND, JOIN_BEVEL - PLineStyle* = ptr TLineStyle - TLineStyle* = enum - LINE_SOLID, LINE_ON_OFF_DASH, LINE_DOUBLE_DASH - PSubwindowMode* = ptr TSubwindowMode - TSubwindowMode* = int - PGCValuesMask* = ptr TGCValuesMask - TGCValuesMask* = int32 - PGCValues* = ptr TGCValues - TGCValues*{.final, pure.} = object - foreground*: TColor - background*: TColor - font*: PFont - `function`*: TFunction - fill*: TFill - tile*: PPixmap - stipple*: PPixmap - clip_mask*: PPixmap - subwindow_mode*: TSubwindowMode - ts_x_origin*: gint - ts_y_origin*: gint - clip_x_origin*: gint - clip_y_origin*: gint - graphics_exposures*: gint - line_width*: gint - line_style*: TLineStyle - cap_style*: TCapStyle - join_style*: TJoinStyle - - PGC* = ptr TGC - TGC* = object of TGObject - clip_x_origin*: gint - clip_y_origin*: gint - ts_x_origin*: gint - ts_y_origin*: gint - colormap*: PColormap - - PImageType* = ptr TImageType - TImageType* = enum - IMAGE_NORMAL, IMAGE_SHARED, IMAGE_FASTEST - PImage* = ptr TImage - PDevice* = ptr TDevice - PTimeCoord* = ptr TTimeCoord - PPTimeCoord* = ptr PTimeCoord - PRgbDither* = ptr TRgbDither - TRgbDither* = enum - RGB_DITHER_NONE, RGB_DITHER_NORMAL, RGB_DITHER_MAX - PDisplay* = ptr TDisplay - PScreen* = ptr TScreen - TScreen* = object of TGObject - PInputCondition* = ptr TInputCondition - TInputCondition* = int32 - PStatus* = ptr TStatus - TStatus* = int32 - TPoint*{.final, pure.} = object - x*: gint - y*: gint - - PPoint* = ptr TPoint - PPPoint* = ptr PPoint - PSpan* = ptr TSpan - PWChar* = ptr TWChar - TWChar* = guint32 - PSegment* = ptr TSegment - TSegment*{.final, pure.} = object - x1*: gint - y1*: gint - x2*: gint - y2*: gint - - PRectangle* = ptr TRectangle - TRectangle*{.final, pure.} = object - x*: gint - y*: gint - width*: gint - height*: gint - - PAtom* = ptr TAtom - TAtom* = gulong - PByteOrder* = ptr TByteOrder - TByteOrder* = enum - LSB_FIRST, MSB_FIRST - PModifierType* = ptr TModifierType - TModifierType* = gint - PVisualType* = ptr TVisualType - TVisualType* = enum - VISUAL_STATIC_GRAY, VISUAL_GRAYSCALE, VISUAL_STATIC_COLOR, - VISUAL_PSEUDO_COLOR, VISUAL_TRUE_COLOR, VISUAL_DIRECT_COLOR - PVisual* = ptr TVisual - TVisual* = object of TGObject - TheType*: TVisualType - depth*: gint - byte_order*: TByteOrder - 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*: PScreen - - PColormapClass* = ptr TColormapClass - TColormapClass* = object of TGObjectClass - TColormap* = object of TGObject - size*: gint - colors*: PColor - visual*: PVisual - windowing_data*: gpointer - screen*: PScreen - - PCursorType* = ptr TCursorType - TCursorType* = gint - PCursor* = ptr TCursor - TCursor*{.final, pure.} = object - `type`*: TCursorType - ref_count*: guint - - PDragAction* = ptr TDragAction - TDragAction* = int32 - PDragProtocol* = ptr TDragProtocol - TDragProtocol* = enum - DRAG_PROTO_MOTIF, DRAG_PROTO_XDND, DRAG_PROTO_ROOTWIN, DRAG_PROTO_NONE, - DRAG_PROTO_WIN32_DROPFILES, DRAG_PROTO_OLE2, DRAG_PROTO_LOCAL - PDragContext* = ptr TDragContext - TDragContext* = object of TGObject - protocol*: TDragProtocol - is_source*: gboolean - source_window*: PWindow - dest_window*: PWindow - targets*: PGList - actions*: TDragAction - suggested_action*: TDragAction - action*: TDragAction - start_time*: guint32 - windowing_data*: gpointer - - PDragContextClass* = ptr TDragContextClass - TDragContextClass* = object of TGObjectClass - PRegionBox* = ptr TRegionBox - TRegionBox* = TSegment - PRegion* = ptr TRegion - TRegion*{.final, pure.} = object - size*: int32 - numRects*: int32 - rects*: PRegionBox - extents*: TRegionBox - - PPOINTBLOCK* = ptr TPOINTBLOCK - TPOINTBLOCK*{.final, pure.} = object - pts*: array[0..(NUMPTSTOBUFFER) - 1, TPoint] - next*: PPOINTBLOCK - - PDrawableClass* = ptr TDrawableClass - TDrawableClass* = object of TGObjectClass - create_gc*: proc (drawable: PDrawable, values: PGCValues, - mask: TGCValuesMask): PGC{.cdecl.} - draw_rectangle*: proc (drawable: PDrawable, gc: PGC, filled: gint, x: gint, - y: gint, width: gint, height: gint){.cdecl.} - draw_arc*: proc (drawable: PDrawable, gc: PGC, filled: gint, x: gint, - y: gint, width: gint, height: gint, angle1: gint, - angle2: gint){.cdecl.} - draw_polygon*: proc (drawable: PDrawable, gc: PGC, filled: gint, - points: PPoint, npoints: gint){.cdecl.} - draw_text*: proc (drawable: PDrawable, font: PFont, gc: PGC, x: gint, - y: gint, text: cstring, text_length: gint){.cdecl.} - draw_text_wc*: proc (drawable: PDrawable, font: PFont, gc: PGC, x: gint, - y: gint, text: PWChar, text_length: gint){.cdecl.} - draw_drawable*: proc (drawable: PDrawable, gc: PGC, src: PDrawable, - xsrc: gint, ysrc: gint, xdest: gint, ydest: gint, - width: gint, height: gint){.cdecl.} - draw_points*: proc (drawable: PDrawable, gc: PGC, points: PPoint, - npoints: gint){.cdecl.} - draw_segments*: proc (drawable: PDrawable, gc: PGC, segs: PSegment, - nsegs: gint){.cdecl.} - draw_lines*: proc (drawable: PDrawable, gc: PGC, points: PPoint, - npoints: gint){.cdecl.} - draw_glyphs*: proc (drawable: PDrawable, gc: PGC, font: PFont, x: gint, - y: gint, glyphs: PGlyphString){.cdecl.} - draw_image*: proc (drawable: PDrawable, gc: PGC, image: PImage, xsrc: gint, - ysrc: gint, xdest: gint, ydest: gint, width: gint, - height: gint){.cdecl.} - get_depth*: proc (drawable: PDrawable): gint{.cdecl.} - get_size*: proc (drawable: PDrawable, width: Pgint, height: Pgint){.cdecl.} - set_colormap*: proc (drawable: PDrawable, cmap: PColormap){.cdecl.} - get_colormap*: proc (drawable: PDrawable): PColormap{.cdecl.} - get_visual*: proc (drawable: PDrawable): PVisual{.cdecl.} - get_screen*: proc (drawable: PDrawable): PScreen{.cdecl.} - get_image*: proc (drawable: PDrawable, x: gint, y: gint, width: gint, - height: gint): PImage{.cdecl.} - get_clip_region*: proc (drawable: PDrawable): PRegion{.cdecl.} - get_visible_region*: proc (drawable: PDrawable): PRegion{.cdecl.} - get_composite_drawable*: proc (drawable: PDrawable, x: gint, y: gint, - width: gint, height: gint, - composite_x_offset: Pgint, - composite_y_offset: Pgint): PDrawable{.cdecl.} - `draw_pixbuf`*: proc (drawable: PDrawable, gc: PGC, pixbuf: PPixbuf, - src_x: gint, src_y: gint, dest_x: gint, dest_y: gint, - width: gint, height: gint, dither: TRgbDither, - x_dither: gint, y_dither: gint){.cdecl.} - `copy_to_image`*: proc (drawable: PDrawable, image: PImage, src_x: gint, - src_y: gint, dest_x: gint, dest_y: gint, - width: gint, height: gint): PImage{.cdecl.} - `reserved1`: proc (){.cdecl.} - `reserved2`: proc (){.cdecl.} - `reserved3`: proc (){.cdecl.} - `reserved4`: proc (){.cdecl.} - `reserved5`: proc (){.cdecl.} - `reserved6`: proc (){.cdecl.} - `reserved7`: proc (){.cdecl.} - `reserved9`: proc (){.cdecl.} - `reserved10`: proc (){.cdecl.} - `reserved11`: proc (){.cdecl.} - `reserved12`: proc (){.cdecl.} - `reserved13`: proc (){.cdecl.} - `reserved14`: proc (){.cdecl.} - `reserved15`: proc (){.cdecl.} - `reserved16`: proc (){.cdecl.} - - PEvent* = ptr TEvent - TEventFunc* = proc (event: PEvent, data: gpointer){.cdecl.} - PXEvent* = ptr TXEvent - TXEvent* = proc () {.cdecl.} - PFilterReturn* = ptr TFilterReturn - TFilterReturn* = enum - FILTER_CONTINUE, FILTER_TRANSLATE, FILTER_REMOVE - TFilterFunc* = proc (xevent: PXEvent, event: PEvent, data: gpointer): TFilterReturn{. - cdecl.} - PEventType* = ptr TEventType - TEventType* = gint - PEventMask* = ptr TEventMask - TEventMask* = gint32 - PVisibilityState* = ptr TVisibilityState - TVisibilityState* = enum - VISIBILITY_UNOBSCURED, VISIBILITY_PARTIAL, VISIBILITY_FULLY_OBSCURED - PScrollDirection* = ptr TScrollDirection - TScrollDirection* = enum - SCROLL_UP, SCROLL_DOWN, SCROLL_LEFT, SCROLL_RIGHT - PNotifyType* = ptr TNotifyType - TNotifyType* = int - PCrossingMode* = ptr TCrossingMode - TCrossingMode* = enum - CROSSING_NORMAL, CROSSING_GRAB, CROSSING_UNGRAB - PPropertyState* = ptr TPropertyState - TPropertyState* = enum - PROPERTY_NEW_VALUE, PROPERTY_STATE_DELETE - PWindowState* = ptr TWindowState - TWindowState* = gint - PSettingAction* = ptr TSettingAction - TSettingAction* = enum - SETTING_ACTION_NEW, SETTING_ACTION_CHANGED, SETTING_ACTION_DELETED - PEventAny* = ptr TEventAny - TEventAny*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - - PEventExpose* = ptr TEventExpose - TEventExpose*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - area*: TRectangle - region*: PRegion - count*: gint - - PEventNoExpose* = ptr TEventNoExpose - TEventNoExpose*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - - PEventVisibility* = ptr TEventVisibility - TEventVisibility*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - state*: TVisibilityState - - PEventMotion* = ptr TEventMotion - TEventMotion*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - time*: guint32 - x*: gdouble - y*: gdouble - axes*: Pgdouble - state*: guint - is_hint*: gint16 - device*: PDevice - x_root*: gdouble - y_root*: gdouble - - PEventButton* = ptr TEventButton - TEventButton*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - time*: guint32 - x*: gdouble - y*: gdouble - axes*: Pgdouble - state*: guint - button*: guint - device*: PDevice - x_root*: gdouble - y_root*: gdouble - - PEventScroll* = ptr TEventScroll - TEventScroll*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - time*: guint32 - x*: gdouble - y*: gdouble - state*: guint - direction*: TScrollDirection - device*: PDevice - x_root*: gdouble - y_root*: gdouble - - PEventKey* = ptr TEventKey - TEventKey*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - time*: guint32 - state*: guint - keyval*: guint - length*: gint - `string`*: cstring - hardware_keycode*: guint16 - group*: guint8 - - PEventCrossing* = ptr TEventCrossing - TEventCrossing*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - subwindow*: PWindow - time*: guint32 - x*: gdouble - y*: gdouble - x_root*: gdouble - y_root*: gdouble - mode*: TCrossingMode - detail*: TNotifyType - focus*: gboolean - state*: guint - - PEventFocus* = ptr TEventFocus - TEventFocus*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - `in`*: gint16 - - PEventConfigure* = ptr TEventConfigure - TEventConfigure*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - x*: gint - y*: gint - width*: gint - height*: gint - - PEventProperty* = ptr TEventProperty - TEventProperty*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - atom*: TAtom - time*: guint32 - state*: guint - - TNativeWindow* = pointer - PEventSelection* = ptr TEventSelection - TEventSelection*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - selection*: TAtom - target*: TAtom - `property`*: TAtom - time*: guint32 - requestor*: TNativeWindow - - PEventProximity* = ptr TEventProximity - TEventProximity*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - time*: guint32 - device*: PDevice - - PmatDUMMY* = ptr TmatDUMMY - TmatDUMMY*{.final, pure.} = object - b*: array[0..19, char] - - PEventClient* = ptr TEventClient - TEventClient*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - message_type*: TAtom - data_format*: gushort - b*: array[0..19, char] - - PEventSetting* = ptr TEventSetting - TEventSetting*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - action*: TSettingAction - name*: cstring - - PEventWindowState* = ptr TEventWindowState - TEventWindowState*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - changed_mask*: TWindowState - new_window_state*: TWindowState - - PEventDND* = ptr TEventDND - TEventDND*{.final, pure.} = object - `type`*: TEventType - window*: PWindow - send_event*: gint8 - context*: PDragContext - time*: guint32 - x_root*: gshort - y_root*: gshort - - TEvent*{.final, pure.} = object - data*: array[0..255, char] # union of - # `type`: TEventType - # any: TEventAny - # expose: TEventExpose - # no_expose: TEventNoExpose - # visibility: TEventVisibility - # motion: TEventMotion - # button: TEventButton - # scroll: TEventScroll - # key: TEventKey - # crossing: TEventCrossing - # focus_change: TEventFocus - # configure: TEventConfigure - # `property`: TEventProperty - # selection: TEventSelection - # proximity: TEventProximity - # client: TEventClient - # dnd: TEventDND - # window_state: TEventWindowState - # setting: TEventSetting - - PGCClass* = ptr TGCClass - TGCClass* = object of TGObjectClass - get_values*: proc (gc: PGC, values: PGCValues){.cdecl.} - set_values*: proc (gc: PGC, values: PGCValues, mask: TGCValuesMask){.cdecl.} - set_dashes*: proc (gc: PGC, dash_offset: gint, dash_list: openarray[gint8]){. - cdecl.} - `reserved1`*: proc (){.cdecl.} - `reserved2`*: proc (){.cdecl.} - `reserved3`*: proc (){.cdecl.} - `reserved4`*: proc (){.cdecl.} - - PImageClass* = ptr TImageClass - TImageClass* = object of TGObjectClass - TImage* = object of TGObject - `type`*: TImageType - visual*: PVisual - byte_order*: TByteOrder - width*: gint - height*: gint - depth*: guint16 - bpp*: guint16 - bpl*: guint16 - bits_per_pixel*: guint16 - mem*: gpointer - colormap*: PColormap - windowing_data*: gpointer - - PExtensionMode* = ptr TExtensionMode - TExtensionMode* = enum - EXTENSION_EVENTS_NONE, EXTENSION_EVENTS_ALL, EXTENSION_EVENTS_CURSOR - PInputSource* = ptr TInputSource - TInputSource* = enum - SOURCE_MOUSE, SOURCE_PEN, SOURCE_ERASER, SOURCE_CURSOR - PInputMode* = ptr TInputMode - TInputMode* = enum - MODE_DISABLED, MODE_SCREEN, MODE_WINDOW - PAxisUse* = ptr TAxisUse - TAxisUse* = int32 - PDeviceKey* = ptr TDeviceKey - TDeviceKey*{.final, pure.} = object - keyval*: guint - modifiers*: TModifierType - - PDeviceAxis* = ptr TDeviceAxis - TDeviceAxis*{.final, pure.} = object - use*: TAxisUse - min*: gdouble - max*: gdouble - - TDevice* = object of TGObject - name*: cstring - source*: TInputSource - mode*: TInputMode - has_cursor*: gboolean - num_axes*: gint - axes*: PDeviceAxis - num_keys*: gint - keys*: PDeviceKey - - TTimeCoord*{.final, pure.} = object - time*: guint32 - axes*: array[0..(MAX_TIMECOORD_AXES) - 1, gdouble] - - PKeymapKey* = ptr TKeymapKey - TKeymapKey*{.final, pure.} = object - keycode*: guint - group*: gint - level*: gint - - PKeymap* = ptr TKeymap - TKeymap* = object of TGObject - display*: PDisplay - - PKeymapClass* = ptr TKeymapClass - TKeymapClass* = object of TGObjectClass - direction_changed*: proc (keymap: PKeymap){.cdecl.} - - PAttrStipple* = ptr TAttrStipple - TAttrStipple*{.final, pure.} = object - attr*: TAttribute - stipple*: PBitmap - - PAttrEmbossed* = ptr TAttrEmbossed - TAttrEmbossed*{.final, pure.} = object - attr*: TAttribute - embossed*: gboolean - - PPixmapObject* = ptr TPixmapObject - TPixmapObject* = object of TDrawable - impl*: PDrawable - depth*: gint - - PPixmapObjectClass* = ptr TPixmapObjectClass - TPixmapObjectClass* = object of TDrawableClass - PPropMode* = ptr TPropMode - TPropMode* = enum - PROP_MODE_REPLACE, PROP_MODE_PREPEND, PROP_MODE_APPEND - PFillRule* = ptr TFillRule - TFillRule* = enum - EVEN_ODD_RULE, WINDING_RULE - POverlapType* = ptr TOverlapType - TOverlapType* = enum - OVERLAP_RECTANGLE_IN, OVERLAP_RECTANGLE_OUT, OVERLAP_RECTANGLE_PART - TSpanFunc* = proc (span: PSpan, data: gpointer){.cdecl.} - PRgbCmap* = ptr TRgbCmap - TRgbCmap*{.final, pure.} = object - colors*: array[0..255, guint32] - n_colors*: gint - info_list*: PGSList - - TDisplay* = object of TGObject - queued_events*: PGList - queued_tail*: PGList - button_click_time*: array[0..1, guint32] - button_window*: array[0..1, PWindow] - button_number*: array[0..1, guint] - double_click_time*: guint - - PDisplayClass* = ptr TDisplayClass - TDisplayClass* = object of TGObjectClass - get_display_name*: proc (display: PDisplay): cstring{.cdecl.} - get_n_screens*: proc (display: PDisplay): gint{.cdecl.} - get_screen*: proc (display: PDisplay, screen_num: gint): PScreen{.cdecl.} - get_default_screen*: proc (display: PDisplay): PScreen{.cdecl.} - - PScreenClass* = ptr TScreenClass - TScreenClass* = object of TGObjectClass - get_display*: proc (screen: PScreen): PDisplay{.cdecl.} - get_width*: proc (screen: PScreen): gint{.cdecl.} - get_height*: proc (screen: PScreen): gint{.cdecl.} - get_width_mm*: proc (screen: PScreen): gint{.cdecl.} - get_height_mm*: proc (screen: PScreen): gint{.cdecl.} - get_root_depth*: proc (screen: PScreen): gint{.cdecl.} - get_screen_num*: proc (screen: PScreen): gint{.cdecl.} - get_root_window*: proc (screen: PScreen): PWindow{.cdecl.} - get_default_colormap*: proc (screen: PScreen): PColormap{.cdecl.} - set_default_colormap*: proc (screen: PScreen, colormap: PColormap){.cdecl.} - get_window_at_pointer*: proc (screen: PScreen, win_x: Pgint, win_y: Pgint): PWindow{. - cdecl.} - get_n_monitors*: proc (screen: PScreen): gint{.cdecl.} - get_monitor_geometry*: proc (screen: PScreen, monitor_num: gint, - dest: PRectangle){.cdecl.} - - PGrabStatus* = ptr TGrabStatus - TGrabStatus* = int - TInputFunction* = proc (data: gpointer, source: gint, - condition: TInputCondition){.cdecl.} - TDestroyNotify* = proc (data: gpointer){.cdecl.} - TSpan*{.final, pure.} = object - x*: gint - y*: gint - width*: gint - - PWindowClass* = ptr TWindowClass - TWindowClass* = enum - INPUT_OUTPUT, INPUT_ONLY - PWindowType* = ptr TWindowType - TWindowType* = enum - WINDOW_ROOT, WINDOW_TOPLEVEL, WINDOW_CHILD, WINDOW_DIALOG, WINDOW_TEMP, - WINDOW_FOREIGN - PWindowAttributesType* = ptr TWindowAttributesType - TWindowAttributesType* = int32 - PWindowHints* = ptr TWindowHints - TWindowHints* = int32 - PWindowTypeHint* = ptr TWindowTypeHint - TWindowTypeHint* = enum - WINDOW_TYPE_HINT_NORMAL, WINDOW_TYPE_HINT_DIALOG, WINDOW_TYPE_HINT_MENU, - WINDOW_TYPE_HINT_TOOLBAR, WINDOW_TYPE_HINT_SPLASHSCREEN, - WINDOW_TYPE_HINT_UTILITY, WINDOW_TYPE_HINT_DOCK, - WINDOW_TYPE_HINT_DESKTOP, WINDOW_TYPE_HINT_DROPDOWN_MENU, - WINDOW_TYPE_HINT_POPUP_MENU, WINDOW_TYPE_HINT_TOOLTIP, - WINDOW_TYPE_HINT_NOTIFICATION, WINDOW_TYPE_HINT_COMBO, - WINDOW_TYPE_HINT_DND - PWMDecoration* = ptr TWMDecoration - TWMDecoration* = int32 - PWMFunction* = ptr TWMFunction - TWMFunction* = int32 - PGravity* = ptr TGravity - TGravity* = int - PWindowEdge* = ptr TWindowEdge - TWindowEdge* = enum - WINDOW_EDGE_NORTH_WEST, WINDOW_EDGE_NORTH, WINDOW_EDGE_NORTH_EAST, - WINDOW_EDGE_WEST, WINDOW_EDGE_EAST, WINDOW_EDGE_SOUTH_WEST, - WINDOW_EDGE_SOUTH, WINDOW_EDGE_SOUTH_EAST - PWindowAttr* = ptr TWindowAttr - TWindowAttr*{.final, pure.} = object - title*: cstring - event_mask*: gint - x*: gint - y*: gint - width*: gint - height*: gint - wclass*: TWindowClass - visual*: PVisual - colormap*: PColormap - window_type*: TWindowType - cursor*: PCursor - wmclass_name*: cstring - wmclass_class*: cstring - override_redirect*: gboolean - - PGeometry* = ptr TGeometry - TGeometry*{.final, pure.} = object - 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*: TGravity - - PPointerHooks* = ptr TPointerHooks - TPointerHooks*{.final, pure.} = object - get_pointer*: proc (window: PWindow, x: Pgint, y: Pgint, mask: PModifierType): PWindow{. - cdecl.} - window_at_pointer*: proc (screen: PScreen, win_x: Pgint, win_y: Pgint): PWindow{. - cdecl.} - - PWindowObject* = ptr TWindowObject - TWindowObject* = object of TDrawable - impl*: PDrawable - parent*: PWindowObject - user_data*: gpointer - x*: gint - y*: gint - extension_events*: gint - filters*: PGList - children*: PGList - bg_color*: TColor - bg_pixmap*: PPixmap - paint_stack*: PGSList - update_area*: PRegion - update_freeze_count*: guint - window_type*: guint8 - depth*: guint8 - resize_count*: guint8 - state*: TWindowState - flag0*: guint16 - event_mask*: TEventMask - - PWindowObjectClass* = ptr TWindowObjectClass - TWindowObjectClass* = object of TDrawableClass - window_invalidate_maybe_recurse_child_func* = proc (para1: PWindow, - para2: gpointer): gboolean {.cdecl.} - -proc TYPE_COLORMAP*(): GType -proc COLORMAP*(anObject: pointer): PColormap -proc COLORMAP_CLASS*(klass: pointer): PColormapClass -proc IS_COLORMAP*(anObject: pointer): bool -proc IS_COLORMAP_CLASS*(klass: pointer): bool -proc COLORMAP_GET_CLASS*(obj: pointer): PColormapClass -proc TYPE_COLOR*(): GType -proc colormap_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_colormap_get_type".} -proc colormap_new*(visual: PVisual, allocate: gboolean): PColormap{.cdecl, - dynlib: lib, importc: "gdk_colormap_new".} -proc alloc_colors*(colormap: PColormap, colors: PColor, ncolors: gint, - writeable: gboolean, best_match: gboolean, - success: Pgboolean): gint{.cdecl, dynlib: lib, - importc: "gdk_colormap_alloc_colors".} -proc alloc_color*(colormap: PColormap, color: PColor, - writeable: gboolean, best_match: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gdk_colormap_alloc_color".} -proc free_colors*(colormap: PColormap, colors: PColor, ncolors: gint){. - cdecl, dynlib: lib, importc: "gdk_colormap_free_colors".} -proc query_color*(colormap: PColormap, pixel: gulong, result: PColor){. - cdecl, dynlib: lib, importc: "gdk_colormap_query_color".} -proc get_visual*(colormap: PColormap): PVisual{.cdecl, dynlib: lib, - importc: "gdk_colormap_get_visual".} -proc copy*(color: PColor): PColor{.cdecl, dynlib: lib, - importc: "gdk_color_copy".} -proc free*(color: PColor){.cdecl, dynlib: lib, importc: "gdk_color_free".} -proc color_parse*(spec: cstring, color: PColor): gint{.cdecl, dynlib: lib, - importc: "gdk_color_parse".} -proc hash*(colora: PColor): guint{.cdecl, dynlib: lib, - importc: "gdk_color_hash".} -proc equal*(colora: PColor, colorb: PColor): gboolean{.cdecl, dynlib: lib, - importc: "gdk_color_equal".} -proc color_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_color_get_type".} -const - CURSOR_IS_PIXMAP* = - (1) - X_CURSOR* = 0 - ARROW* = 2 - BASED_ARROW_DOWN* = 4 - BASED_ARROW_UP* = 6 - BOAT* = 8 - BOGOSITY* = 10 - BOTTOM_LEFT_CORNER* = 12 - BOTTOM_RIGHT_CORNER* = 14 - BOTTOM_SIDE* = 16 - BOTTOM_TEE* = 18 - BOX_SPIRAL* = 20 - CENTER_PTR* = 22 - CIRCLE* = 24 - CLOCK* = 26 - COFFEE_MUG* = 28 - CROSS* = 30 - CROSS_REVERSE* = 32 - CROSSHAIR* = 34 - DIAMOND_CROSS* = 36 - DOT* = 38 - DOTBOX* = 40 - DOUBLE_ARROW* = 42 - DRAFT_LARGE* = 44 - DRAFT_SMALL* = 46 - DRAPED_BOX* = 48 - EXCHANGE* = 50 - FLEUR* = 52 - GOBBLER* = 54 - GUMBY* = 56 - HAND1* = 58 - HAND2* = 60 - HEART* = 62 - ICON* = 64 - IRON_CROSS* = 66 - LEFT_PTR* = 68 - LEFT_SIDE* = 70 - LEFT_TEE* = 72 - LEFTBUTTON* = 74 - LL_ANGLE* = 76 - LR_ANGLE* = 78 - MAN* = 80 - MIDDLEBUTTON* = 82 - MOUSE* = 84 - PENCIL* = 86 - PIRATE* = 88 - PLUS* = 90 - QUESTION_ARROW* = 92 - RIGHT_PTR* = 94 - RIGHT_SIDE* = 96 - RIGHT_TEE* = 98 - RIGHTBUTTON* = 100 - RTL_LOGO* = 102 - SAILBOAT* = 104 - SB_DOWN_ARROW* = 106 - SB_H_DOUBLE_ARROW* = 108 - SB_LEFT_ARROW* = 110 - SB_RIGHT_ARROW* = 112 - SB_UP_ARROW* = 114 - SB_V_DOUBLE_ARROW* = 116 - SHUTTLE* = 118 - SIZING* = 120 - SPIDER* = 122 - SPRAYCAN* = 124 - STAR* = 126 - TARGET* = 128 - TCROSS* = 130 - TOP_LEFT_ARROW* = 132 - TOP_LEFT_CORNER* = 134 - TOP_RIGHT_CORNER* = 136 - TOP_SIDE* = 138 - TOP_TEE* = 140 - TREK* = 142 - UL_ANGLE* = 144 - UMBRELLA* = 146 - UR_ANGLE* = 148 - WATCH* = 150 - XTERM* = 152 - LAST_CURSOR* = XTERM + 1 - -proc TYPE_CURSOR*(): GType -proc cursor_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_cursor_get_type".} -proc cursor_new_for_screen*(screen: PScreen, cursor_type: TCursorType): PCursor{. - cdecl, dynlib: lib, importc: "gdk_cursor_new_for_screen".} -proc cursor_new_from_pixmap*(source: PPixmap, mask: PPixmap, fg: PColor, - bg: PColor, x: gint, y: gint): PCursor{.cdecl, - dynlib: lib, importc: "gdk_cursor_new_from_pixmap".} -proc get_screen*(cursor: PCursor): PScreen{.cdecl, dynlib: lib, - importc: "gdk_cursor_get_screen".} -proc reference*(cursor: PCursor): PCursor{.cdecl, dynlib: lib, - importc: "gdk_cursor_ref".} -proc unref*(cursor: PCursor){.cdecl, dynlib: lib, - importc: "gdk_cursor_unref".} -const - ACTION_DEFAULT* = 1 shl 0 - ACTION_COPY* = 1 shl 1 - ACTION_MOVE* = 1 shl 2 - ACTION_LINK* = 1 shl 3 - ACTION_PRIVATE* = 1 shl 4 - ACTION_ASK* = 1 shl 5 - -proc TYPE_DRAG_CONTEXT*(): GType -proc DRAG_CONTEXT*(anObject: Pointer): PDragContext -proc DRAG_CONTEXT_CLASS*(klass: Pointer): PDragContextClass -proc IS_DRAG_CONTEXT*(anObject: Pointer): bool -proc IS_DRAG_CONTEXT_CLASS*(klass: Pointer): bool -proc DRAG_CONTEXT_GET_CLASS*(obj: Pointer): PDragContextClass -proc drag_context_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_drag_context_get_type".} -proc drag_context_new*(): PDragContext{.cdecl, dynlib: lib, - importc: "gdk_drag_context_new".} -proc status*(context: PDragContext, action: TDragAction, time: guint32){. - cdecl, dynlib: lib, importc: "gdk_drag_status".} -proc drop_reply*(context: PDragContext, ok: gboolean, time: guint32){.cdecl, - dynlib: lib, importc: "gdk_drop_reply".} -proc drop_finish*(context: PDragContext, success: gboolean, time: guint32){. - cdecl, dynlib: lib, importc: "gdk_drop_finish".} -proc get_selection*(context: PDragContext): TAtom{.cdecl, dynlib: lib, - importc: "gdk_drag_get_selection".} -proc drag_begin*(window: PWindow, targets: PGList): PDragContext{.cdecl, - dynlib: lib, importc: "gdk_drag_begin".} -proc drag_get_protocol_for_display*(display: PDisplay, xid: guint32, - protocol: PDragProtocol): guint32{.cdecl, - dynlib: lib, importc: "gdk_drag_get_protocol_for_display".} -proc find_window*(context: PDragContext, drag_window: PWindow, - x_root: gint, y_root: gint, w: var PWindow, - protocol: PDragProtocol){.cdecl, dynlib: lib, - importc: "gdk_drag_find_window".} -proc motion*(context: PDragContext, dest_window: PWindow, - protocol: TDragProtocol, x_root: gint, y_root: gint, - suggested_action: TDragAction, possible_actions: TDragAction, - time: guint32): gboolean{.cdecl, dynlib: lib, - importc: "gdk_drag_motion".} -proc drop*(context: PDragContext, time: guint32){.cdecl, dynlib: lib, - importc: "gdk_drag_drop".} -proc abort*(context: PDragContext, time: guint32){.cdecl, dynlib: lib, - importc: "gdk_drag_abort".} -proc region_EXTENTCHECK*(r1, r2: PRegionBox): bool -proc EXTENTS*(r: PRegionBox, idRect: PRegion) -proc MEMCHECK*(reg: PRegion, ARect, firstrect: var PRegionBox): bool -proc CHECK_PREVIOUS*(Reg: PRegion, R: PRegionBox, - Rx1, Ry1, Rx2, Ry2: gint): bool -proc ADDRECT*(reg: PRegion, r: PRegionBox, rx1, ry1, rx2, ry2: gint) -proc ADDRECTNOX*(reg: PRegion, r: PRegionBox, rx1, ry1, rx2, ry2: gint) -proc EMPTY_REGION*(pReg: PRegion): bool -proc REGION_NOT_EMPTY*(pReg: PRegion): bool -proc region_INBOX*(r: TRegionBox, x, y: gint): bool -proc TYPE_DRAWABLE*(): GType -proc DRAWABLE*(anObject: Pointer): PDrawable -proc DRAWABLE_CLASS*(klass: Pointer): PDrawableClass -proc IS_DRAWABLE*(anObject: Pointer): bool -proc IS_DRAWABLE_CLASS*(klass: Pointer): bool -proc DRAWABLE_GET_CLASS*(obj: Pointer): PDrawableClass -proc drawable_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_drawable_get_type".} -proc get_size*(drawable: PDrawable, width: Pgint, height: Pgint){. - cdecl, dynlib: lib, importc: "gdk_drawable_get_size".} -proc set_colormap*(drawable: PDrawable, colormap: PColormap){.cdecl, - dynlib: lib, importc: "gdk_drawable_set_colormap".} -proc get_colormap*(drawable: PDrawable): PColormap{.cdecl, dynlib: lib, - importc: "gdk_drawable_get_colormap".} -proc get_visual*(drawable: PDrawable): PVisual{.cdecl, dynlib: lib, - importc: "gdk_drawable_get_visual".} -proc get_depth*(drawable: PDrawable): gint{.cdecl, dynlib: lib, - importc: "gdk_drawable_get_depth".} -proc get_screen*(drawable: PDrawable): PScreen{.cdecl, dynlib: lib, - importc: "gdk_drawable_get_screen".} -proc get_display*(drawable: PDrawable): PDisplay{.cdecl, dynlib: lib, - importc: "gdk_drawable_get_display".} -proc point*(drawable: PDrawable, gc: PGC, x: gint, y: gint){.cdecl, - dynlib: lib, importc: "gdk_draw_point".} -proc line*(drawable: PDrawable, gc: PGC, x1: gint, y1: gint, x2: gint, - y2: gint){.cdecl, dynlib: lib, importc: "gdk_draw_line".} -proc rectangle*(drawable: PDrawable, gc: PGC, filled: gint, x: gint, - y: gint, width: gint, height: gint){.cdecl, dynlib: lib, - importc: "gdk_draw_rectangle".} -proc arc*(drawable: PDrawable, gc: PGC, filled: gint, x: gint, y: gint, - width: gint, height: gint, angle1: gint, angle2: gint){.cdecl, - dynlib: lib, importc: "gdk_draw_arc".} -proc polygon*(drawable: PDrawable, gc: PGC, filled: gint, points: PPoint, - npoints: gint){.cdecl, dynlib: lib, - importc: "gdk_draw_polygon".} -proc drawable*(drawable: PDrawable, gc: PGC, src: PDrawable, xsrc: gint, - ysrc: gint, xdest: gint, ydest: gint, width: gint, - height: gint){.cdecl, dynlib: lib, - importc: "gdk_draw_drawable".} -proc image*(drawable: PDrawable, gc: PGC, image: PImage, xsrc: gint, - ysrc: gint, xdest: gint, ydest: gint, width: gint, height: gint){. - cdecl, dynlib: lib, importc: "gdk_draw_image".} -proc points*(drawable: PDrawable, gc: PGC, points: PPoint, npoints: gint){. - cdecl, dynlib: lib, importc: "gdk_draw_points".} -proc segments*(drawable: PDrawable, gc: PGC, segs: PSegment, nsegs: gint){. - cdecl, dynlib: lib, importc: "gdk_draw_segments".} -proc lines*(drawable: PDrawable, gc: PGC, points: PPoint, npoints: gint){. - cdecl, dynlib: lib, importc: "gdk_draw_lines".} -proc glyphs*(drawable: PDrawable, gc: PGC, font: PFont, x: gint, - y: gint, glyphs: PGlyphString){.cdecl, dynlib: lib, - importc: "gdk_draw_glyphs".} -proc layout_line*(drawable: PDrawable, gc: PGC, x: gint, y: gint, - line: PLayoutLine){.cdecl, dynlib: lib, - importc: "gdk_draw_layout_line".} -proc layout*(drawable: PDrawable, gc: PGC, x: gint, y: gint, - layout: PLayout){.cdecl, dynlib: lib, - importc: "gdk_draw_layout".} -proc layout_line*(drawable: PDrawable, gc: PGC, x: gint, - y: gint, line: PLayoutLine, - foreground: PColor, background: PColor){. - cdecl, dynlib: lib, importc: "gdk_draw_layout_line_with_colors".} -proc layout*(drawable: PDrawable, gc: PGC, x: gint, y: gint, - layout: PLayout, foreground: PColor, - background: PColor){.cdecl, dynlib: lib, - importc: "gdk_draw_layout_with_colors".} -proc get_image*(drawable: PDrawable, x: gint, y: gint, width: gint, - height: gint): PImage{.cdecl, dynlib: lib, - importc: "gdk_drawable_get_image".} -proc get_clip_region*(drawable: PDrawable): PRegion{.cdecl, - dynlib: lib, importc: "gdk_drawable_get_clip_region".} -proc get_visible_region*(drawable: PDrawable): PRegion{.cdecl, - dynlib: lib, importc: "gdk_drawable_get_visible_region".} -const - NOTHING* = - (1) - DELETE* = 0 - constDESTROY* = 1 - EXPOSE* = 2 - MOTION_NOTIFY* = 3 - BUTTON_PRESS* = 4 - BUTTON2_PRESS* = 5 - BUTTON3_PRESS* = 6 - BUTTON_RELEASE* = 7 - KEY_PRESS* = 8 - KEY_RELEASE* = 9 - ENTER_NOTIFY* = 10 - LEAVE_NOTIFY* = 11 - FOCUS_CHANGE* = 12 - CONFIGURE* = 13 - MAP* = 14 - UNMAP* = 15 - PROPERTY_NOTIFY* = 16 - SELECTION_CLEAR* = 17 - SELECTION_REQUEST* = 18 - SELECTION_NOTIFY* = 19 - PROXIMITY_IN* = 20 - PROXIMITY_OUT* = 21 - DRAG_ENTER* = 22 - DRAG_LEAVE* = 23 - DRAG_MOTION_EVENT* = 24 - DRAG_STATUS_EVENT* = 25 - DROP_START* = 26 - DROP_FINISHED* = 27 - CLIENT_EVENT* = 28 - VISIBILITY_NOTIFY* = 29 - NO_EXPOSE* = 30 - constSCROLL* = 31 - WINDOW_STATE* = 32 - SETTING* = 33 - NOTIFY_ANCESTOR* = 0 - NOTIFY_VIRTUAL* = 1 - NOTIFY_INFERIOR* = 2 - NOTIFY_NONLINEAR* = 3 - NOTIFY_NONLINEAR_VIRTUAL* = 4 - NOTIFY_UNKNOWN* = 5 - -proc TYPE_EVENT*(): GType -const - G_PRIORITY_DEFAULT* = 0 - PRIORITY_EVENTS* = G_PRIORITY_DEFAULT #GDK_PRIORITY_REDRAW* = G_PRIORITY_HIGH_IDLE + 20 - EXPOSURE_MASK* = 1 shl 1 - POINTER_MOTION_MASK* = 1 shl 2 - POINTER_MOTION_HINT_MASK* = 1 shl 3 - BUTTON_MOTION_MASK* = 1 shl 4 - BUTTON1_MOTION_MASK* = 1 shl 5 - BUTTON2_MOTION_MASK* = 1 shl 6 - BUTTON3_MOTION_MASK* = 1 shl 7 - BUTTON_PRESS_MASK* = 1 shl 8 - BUTTON_RELEASE_MASK* = 1 shl 9 - KEY_PRESS_MASK* = 1 shl 10 - KEY_RELEASE_MASK* = 1 shl 11 - ENTER_NOTIFY_MASK* = 1 shl 12 - LEAVE_NOTIFY_MASK* = 1 shl 13 - FOCUS_CHANGE_MASK* = 1 shl 14 - STRUCTURE_MASK* = 1 shl 15 - PROPERTY_CHANGE_MASK* = 1 shl 16 - VISIBILITY_NOTIFY_MASK* = 1 shl 17 - PROXIMITY_IN_MASK* = 1 shl 18 - PROXIMITY_OUT_MASK* = 1 shl 19 - SUBSTRUCTURE_MASK* = 1 shl 20 - SCROLL_MASK* = 1 shl 21 - ALL_EVENTS_MASK* = 0x003FFFFE - WINDOW_STATE_WITHDRAWN* = 1 shl 0 - WINDOW_STATE_ICONIFIED* = 1 shl 1 - WINDOW_STATE_MAXIMIZED* = 1 shl 2 - WINDOW_STATE_STICKY* = 1 shl 3 - -proc event_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_event_get_type".} -proc events_pending*(): gboolean{.cdecl, dynlib: lib, - importc: "gdk_events_pending".} -proc event_get*(): PEvent{.cdecl, dynlib: lib, importc: "gdk_event_get".} -proc event_peek*(): PEvent{.cdecl, dynlib: lib, importc: "gdk_event_peek".} -proc event_get_graphics_expose*(window: PWindow): PEvent{.cdecl, dynlib: lib, - importc: "gdk_event_get_graphics_expose".} -proc put*(event: PEvent){.cdecl, dynlib: lib, importc: "gdk_event_put".} -proc copy*(event: PEvent): PEvent{.cdecl, dynlib: lib, - importc: "gdk_event_copy".} -proc free*(event: PEvent){.cdecl, dynlib: lib, importc: "gdk_event_free".} -proc get_time*(event: PEvent): guint32{.cdecl, dynlib: lib, - importc: "gdk_event_get_time".} -proc get_state*(event: PEvent, state: PModifierType): gboolean{.cdecl, - dynlib: lib, importc: "gdk_event_get_state".} -proc get_coords*(event: PEvent, x_win: Pgdouble, y_win: Pgdouble): gboolean{. - cdecl, dynlib: lib, importc: "gdk_event_get_coords".} -proc get_root_coords*(event: PEvent, x_root: Pgdouble, y_root: Pgdouble): gboolean{. - cdecl, dynlib: lib, importc: "gdk_event_get_root_coords".} -proc get_axis*(event: PEvent, axis_use: TAxisUse, value: Pgdouble): gboolean{. - cdecl, dynlib: lib, importc: "gdk_event_get_axis".} -proc event_handler_set*(func: TEventFunc, data: gpointer, - notify: TGDestroyNotify){.cdecl, dynlib: lib, - importc: "gdk_event_handler_set".} -proc set_show_events*(show_events: gboolean){.cdecl, dynlib: lib, - importc: "gdk_set_show_events".} -proc get_show_events*(): gboolean{.cdecl, dynlib: lib, - importc: "gdk_get_show_events".} -proc TYPE_FONT*(): GType -proc font_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_font_get_type".} -proc font_load_for_display*(display: PDisplay, font_name: cstring): PFont{. - cdecl, dynlib: lib, importc: "gdk_font_load_for_display".} -proc fontset_load_for_display*(display: PDisplay, fontset_name: cstring): PFont{. - cdecl, dynlib: lib, importc: "gdk_fontset_load_for_display".} -proc font_from_description_for_display*(display: PDisplay, - font_desc: PFontDescription): PFont{. - cdecl, dynlib: lib, importc: "gdk_font_from_description_for_display".} -proc reference*(font: PFont): PFont{.cdecl, dynlib: lib, importc: "gdk_font_ref".} -proc unref*(font: PFont){.cdecl, dynlib: lib, importc: "gdk_font_unref".} -proc id*(font: PFont): gint{.cdecl, dynlib: lib, importc: "gdk_font_id".} -proc equal*(fonta: PFont, fontb: PFont): gboolean{.cdecl, dynlib: lib, - importc: "gdk_font_equal".} -proc string_width*(font: PFont, `string`: cstring): gint{.cdecl, dynlib: lib, - importc: "gdk_string_width".} -proc text_width*(font: PFont, text: cstring, text_length: gint): gint{.cdecl, - dynlib: lib, importc: "gdk_text_width".} -proc text_width_wc*(font: PFont, text: PWChar, text_length: gint): gint{.cdecl, - dynlib: lib, importc: "gdk_text_width_wc".} -proc char_width*(font: PFont, character: gchar): gint{.cdecl, dynlib: lib, - importc: "gdk_char_width".} -proc char_width_wc*(font: PFont, character: TWChar): gint{.cdecl, dynlib: lib, - importc: "gdk_char_width_wc".} -proc string_measure*(font: PFont, `string`: cstring): gint{.cdecl, dynlib: lib, - importc: "gdk_string_measure".} -proc text_measure*(font: PFont, text: cstring, text_length: gint): gint{.cdecl, - dynlib: lib, importc: "gdk_text_measure".} -proc char_measure*(font: PFont, character: gchar): gint{.cdecl, dynlib: lib, - importc: "gdk_char_measure".} -proc string_height*(font: PFont, `string`: cstring): gint{.cdecl, dynlib: lib, - importc: "gdk_string_height".} -proc text_height*(font: PFont, text: cstring, text_length: gint): gint{.cdecl, - dynlib: lib, importc: "gdk_text_height".} -proc char_height*(font: PFont, character: gchar): gint{.cdecl, dynlib: lib, - importc: "gdk_char_height".} -proc text_extents*(font: PFont, text: cstring, text_length: gint, - lbearing: Pgint, rbearing: Pgint, width: Pgint, - ascent: Pgint, descent: Pgint){.cdecl, dynlib: lib, - importc: "gdk_text_extents".} -proc text_extents_wc*(font: PFont, text: PWChar, text_length: gint, - lbearing: Pgint, rbearing: Pgint, width: Pgint, - ascent: Pgint, descent: Pgint){.cdecl, dynlib: lib, - importc: "gdk_text_extents_wc".} -proc string_extents*(font: PFont, `string`: cstring, lbearing: Pgint, - rbearing: Pgint, width: Pgint, ascent: Pgint, - descent: Pgint){.cdecl, dynlib: lib, - importc: "gdk_string_extents".} -proc get_display*(font: PFont): PDisplay{.cdecl, dynlib: lib, - importc: "gdk_font_get_display".} -const - GC_FOREGROUND* = 1 shl 0 - GC_BACKGROUND* = 1 shl 1 - GC_FONT* = 1 shl 2 - GC_FUNCTION* = 1 shl 3 - GC_FILL* = 1 shl 4 - GC_TILE* = 1 shl 5 - GC_STIPPLE* = 1 shl 6 - GC_CLIP_MASK* = 1 shl 7 - GC_SUBWINDOW* = 1 shl 8 - GC_TS_X_ORIGIN* = 1 shl 9 - GC_TS_Y_ORIGIN* = 1 shl 10 - GC_CLIP_X_ORIGIN* = 1 shl 11 - GC_CLIP_Y_ORIGIN* = 1 shl 12 - GC_EXPOSURES* = 1 shl 13 - GC_LINE_WIDTH* = 1 shl 14 - GC_LINE_STYLE* = 1 shl 15 - GC_CAP_STYLE* = 1 shl 16 - GC_JOIN_STYLE* = 1 shl 17 - CLIP_BY_CHILDREN* = 0 - INCLUDE_INFERIORS* = 1 - -proc TYPE_GC*(): GType -proc GC*(anObject: Pointer): PGC -proc GC_CLASS*(klass: Pointer): PGCClass -proc IS_GC*(anObject: Pointer): bool -proc IS_GC_CLASS*(klass: Pointer): bool -proc GC_GET_CLASS*(obj: Pointer): PGCClass -proc gc_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_gc_get_type".} -proc gc_new*(drawable: PDrawable): PGC{.cdecl, dynlib: lib, - importc: "gdk_gc_new".} -proc gc_new*(drawable: PDrawable, values: PGCValues, - values_mask: TGCValuesMask): PGC{.cdecl, dynlib: lib, - importc: "gdk_gc_new_with_values".} -proc get_values*(gc: PGC, values: PGCValues){.cdecl, dynlib: lib, - importc: "gdk_gc_get_values".} -proc set_values*(gc: PGC, values: PGCValues, values_mask: TGCValuesMask){. - cdecl, dynlib: lib, importc: "gdk_gc_set_values".} -proc set_foreground*(gc: PGC, color: PColor){.cdecl, dynlib: lib, - importc: "gdk_gc_set_foreground".} -proc set_background*(gc: PGC, color: PColor){.cdecl, dynlib: lib, - importc: "gdk_gc_set_background".} -proc set_function*(gc: PGC, `function`: TFunction){.cdecl, dynlib: lib, - importc: "gdk_gc_set_function".} -proc set_fill*(gc: PGC, fill: TFill){.cdecl, dynlib: lib, - importc: "gdk_gc_set_fill".} -proc set_tile*(gc: PGC, tile: PPixmap){.cdecl, dynlib: lib, - importc: "gdk_gc_set_tile".} -proc set_stipple*(gc: PGC, stipple: PPixmap){.cdecl, dynlib: lib, - importc: "gdk_gc_set_stipple".} -proc set_ts_origin*(gc: PGC, x: gint, y: gint){.cdecl, dynlib: lib, - importc: "gdk_gc_set_ts_origin".} -proc set_clip_origin*(gc: PGC, x: gint, y: gint){.cdecl, dynlib: lib, - importc: "gdk_gc_set_clip_origin".} -proc set_clip_mask*(gc: PGC, mask: PBitmap){.cdecl, dynlib: lib, - importc: "gdk_gc_set_clip_mask".} -proc set_clip_rectangle*(gc: PGC, rectangle: PRectangle){.cdecl, dynlib: lib, - importc: "gdk_gc_set_clip_rectangle".} -proc set_clip_region*(gc: PGC, region: PRegion){.cdecl, dynlib: lib, - importc: "gdk_gc_set_clip_region".} -proc set_subwindow*(gc: PGC, mode: TSubwindowMode){.cdecl, dynlib: lib, - importc: "gdk_gc_set_subwindow".} -proc set_exposures*(gc: PGC, exposures: gboolean){.cdecl, dynlib: lib, - importc: "gdk_gc_set_exposures".} -proc set_line_attributes*(gc: PGC, line_width: gint, line_style: TLineStyle, - cap_style: TCapStyle, join_style: TJoinStyle){. - cdecl, dynlib: lib, importc: "gdk_gc_set_line_attributes".} -proc set_dashes*(gc: PGC, dash_offset: gint, dash_list: openarray[gint8]){. - cdecl, dynlib: lib, importc: "gdk_gc_set_dashes".} -proc offset*(gc: PGC, x_offset: gint, y_offset: gint){.cdecl, dynlib: lib, - importc: "gdk_gc_offset".} -proc copy*(dst_gc: PGC, src_gc: PGC){.cdecl, dynlib: lib, - importc: "gdk_gc_copy".} -proc set_colormap*(gc: PGC, colormap: PColormap){.cdecl, dynlib: lib, - importc: "gdk_gc_set_colormap".} -proc get_colormap*(gc: PGC): PColormap{.cdecl, dynlib: lib, - importc: "gdk_gc_get_colormap".} -proc set_rgb_fg_color*(gc: PGC, color: PColor){.cdecl, dynlib: lib, - importc: "gdk_gc_set_rgb_fg_color".} -proc set_rgb_bg_color*(gc: PGC, color: PColor){.cdecl, dynlib: lib, - importc: "gdk_gc_set_rgb_bg_color".} -proc get_screen*(gc: PGC): PScreen{.cdecl, dynlib: lib, - importc: "gdk_gc_get_screen".} -proc TYPE_IMAGE*(): GType -proc IMAGE*(anObject: Pointer): PImage -proc IMAGE_CLASS*(klass: Pointer): PImageClass -proc IS_IMAGE*(anObject: Pointer): bool -proc IS_IMAGE_CLASS*(klass: Pointer): bool -proc IMAGE_GET_CLASS*(obj: Pointer): PImageClass -proc image_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_image_get_type".} -proc image_new*(`type`: TImageType, visual: PVisual, width: gint, height: gint): PImage{. - cdecl, dynlib: lib, importc: "gdk_image_new".} -proc put_pixel*(image: PImage, x: gint, y: gint, pixel: guint32){.cdecl, - dynlib: lib, importc: "gdk_image_put_pixel".} -proc get_pixel*(image: PImage, x: gint, y: gint): guint32{.cdecl, - dynlib: lib, importc: "gdk_image_get_pixel".} -proc set_colormap*(image: PImage, colormap: PColormap){.cdecl, - dynlib: lib, importc: "gdk_image_set_colormap".} -proc get_colormap*(image: PImage): PColormap{.cdecl, dynlib: lib, - importc: "gdk_image_get_colormap".} -const - AXIS_IGNORE* = 0 - AXIS_X* = 1 - AXIS_Y* = 2 - AXIS_PRESSURE* = 3 - AXIS_XTILT* = 4 - AXIS_YTILT* = 5 - AXIS_WHEEL* = 6 - AXIS_LAST* = 7 - -proc TYPE_DEVICE*(): GType -proc DEVICE*(anObject: Pointer): PDevice -proc DEVICE_CLASS*(klass: Pointer): PDeviceClass -proc IS_DEVICE*(anObject: Pointer): bool -proc IS_DEVICE_CLASS*(klass: Pointer): bool -proc DEVICE_GET_CLASS*(obj: Pointer): PDeviceClass -proc device_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_device_get_type".} -proc set_source*(device: PDevice, source: TInputSource){.cdecl, - dynlib: lib, importc: "gdk_device_set_source".} -proc set_mode*(device: PDevice, mode: TInputMode): gboolean{.cdecl, - dynlib: lib, importc: "gdk_device_set_mode".} -proc set_key*(device: PDevice, index: guint, keyval: guint, - modifiers: TModifierType){.cdecl, dynlib: lib, - importc: "gdk_device_set_key".} -proc set_axis_use*(device: PDevice, index: guint, use: TAxisUse){.cdecl, - dynlib: lib, importc: "gdk_device_set_axis_use".} -proc get_state*(device: PDevice, window: PWindow, axes: Pgdouble, - mask: PModifierType){.cdecl, dynlib: lib, - importc: "gdk_device_get_state".} -proc get_history*(device: PDevice, window: PWindow, start: guint32, - stop: guint32, s: var PPTimeCoord, n_events: Pgint): gboolean{. - cdecl, dynlib: lib, importc: "gdk_device_get_history".} -proc device_free_history*(events: PPTimeCoord, n_events: gint){.cdecl, - dynlib: lib, importc: "gdk_device_free_history".} -proc get_axis*(device: PDevice, axes: Pgdouble, use: TAxisUse, - value: Pgdouble): gboolean{.cdecl, dynlib: lib, - importc: "gdk_device_get_axis".} -proc input_set_extension_events*(window: PWindow, mask: gint, - mode: TExtensionMode){.cdecl, dynlib: lib, - importc: "gdk_input_set_extension_events".} -proc device_get_core_pointer*(): PDevice{.cdecl, dynlib: lib, - importc: "gdk_device_get_core_pointer".} -proc TYPE_KEYMAP*(): GType -proc KEYMAP*(anObject: Pointer): PKeymap -proc KEYMAP_CLASS*(klass: Pointer): PKeymapClass -proc IS_KEYMAP*(anObject: Pointer): bool -proc IS_KEYMAP_CLASS*(klass: Pointer): bool -proc KEYMAP_GET_CLASS*(obj: Pointer): PKeymapClass -proc keymap_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_keymap_get_type".} -proc keymap_get_for_display*(display: PDisplay): PKeymap{.cdecl, dynlib: lib, - importc: "gdk_keymap_get_for_display".} -proc lookup_key*(keymap: PKeymap, key: PKeymapKey): guint{.cdecl, - dynlib: lib, importc: "gdk_keymap_lookup_key".} -proc translate_keyboard_state*(keymap: PKeymap, hardware_keycode: guint, - state: TModifierType, group: gint, - keyval: Pguint, effective_group: Pgint, - level: Pgint, - consumed_modifiers: PModifierType): gboolean{. - cdecl, dynlib: lib, importc: "gdk_keymap_translate_keyboard_state".} -proc get_entries_for_keyval*(keymap: PKeymap, keyval: guint, - s: var PKeymapKey, n_keys: Pgint): gboolean{. - cdecl, dynlib: lib, importc: "gdk_keymap_get_entries_for_keyval".} -proc get_entries_for_keycode*(keymap: PKeymap, hardware_keycode: guint, - s: var PKeymapKey, sasdf: var Pguint, - n_entries: Pgint): gboolean{.cdecl, - dynlib: lib, importc: "gdk_keymap_get_entries_for_keycode".} -proc get_direction*(keymap: PKeymap): TDirection{.cdecl, - dynlib: lib, importc: "gdk_keymap_get_direction".} -proc keyval_name*(keyval: guint): cstring{.cdecl, dynlib: lib, - importc: "gdk_keyval_name".} -proc keyval_from_name*(keyval_name: cstring): guint{.cdecl, dynlib: lib, - importc: "gdk_keyval_from_name".} -proc keyval_convert_case*(symbol: guint, lower: Pguint, upper: Pguint){.cdecl, - dynlib: lib, importc: "gdk_keyval_convert_case".} -proc keyval_to_upper*(keyval: guint): guint{.cdecl, dynlib: lib, - importc: "gdk_keyval_to_upper".} -proc keyval_to_lower*(keyval: guint): guint{.cdecl, dynlib: lib, - importc: "gdk_keyval_to_lower".} -proc keyval_is_upper*(keyval: guint): gboolean{.cdecl, dynlib: lib, - importc: "gdk_keyval_is_upper".} -proc keyval_is_lower*(keyval: guint): gboolean{.cdecl, dynlib: lib, - importc: "gdk_keyval_is_lower".} -proc keyval_to_unicode*(keyval: guint): guint32{.cdecl, dynlib: lib, - importc: "gdk_keyval_to_unicode".} -proc unicode_to_keyval*(wc: guint32): guint{.cdecl, dynlib: lib, - importc: "gdk_unicode_to_keyval".} -const - KEY_VoidSymbol* = 0x00FFFFFF - KEY_BackSpace* = 0x0000FF08 - KEY_Tab* = 0x0000FF09 - KEY_Linefeed* = 0x0000FF0A - KEY_Clear* = 0x0000FF0B - KEY_Return* = 0x0000FF0D - KEY_Pause* = 0x0000FF13 - KEY_Scroll_Lock* = 0x0000FF14 - KEY_Sys_Req* = 0x0000FF15 - KEY_Escape* = 0x0000FF1B - KEY_Delete* = 0x0000FFFF - KEY_Multi_key* = 0x0000FF20 - KEY_Codeinput* = 0x0000FF37 - KEY_SingleCandidate* = 0x0000FF3C - KEY_MultipleCandidate* = 0x0000FF3D - KEY_PreviousCandidate* = 0x0000FF3E - KEY_Kanji* = 0x0000FF21 - KEY_Muhenkan* = 0x0000FF22 - KEY_Henkan_Mode* = 0x0000FF23 - KEY_Henkan* = 0x0000FF23 - KEY_Romaji* = 0x0000FF24 - KEY_Hiragana* = 0x0000FF25 - KEY_Katakana* = 0x0000FF26 - KEY_Hiragana_Katakana* = 0x0000FF27 - KEY_Zenkaku* = 0x0000FF28 - KEY_Hankaku* = 0x0000FF29 - KEY_Zenkaku_Hankaku* = 0x0000FF2A - KEY_Touroku* = 0x0000FF2B - KEY_Massyo* = 0x0000FF2C - KEY_Kana_Lock* = 0x0000FF2D - KEY_Kana_Shift* = 0x0000FF2E - KEY_Eisu_Shift* = 0x0000FF2F - KEY_Eisu_toggle* = 0x0000FF30 - KEY_Kanji_Bangou* = 0x0000FF37 - KEY_Zen_Koho* = 0x0000FF3D - KEY_Mae_Koho* = 0x0000FF3E - KEY_Home* = 0x0000FF50 - KEY_Left* = 0x0000FF51 - KEY_Up* = 0x0000FF52 - KEY_Right* = 0x0000FF53 - KEY_Down* = 0x0000FF54 - KEY_Prior* = 0x0000FF55 - KEY_Page_Up* = 0x0000FF55 - KEY_Next* = 0x0000FF56 - KEY_Page_Down* = 0x0000FF56 - KEY_End* = 0x0000FF57 - KEY_Begin* = 0x0000FF58 - KEY_Select* = 0x0000FF60 - KEY_Print* = 0x0000FF61 - KEY_Execute* = 0x0000FF62 - KEY_Insert* = 0x0000FF63 - KEY_Undo* = 0x0000FF65 - KEY_Redo* = 0x0000FF66 - KEY_Menu* = 0x0000FF67 - KEY_Find* = 0x0000FF68 - KEY_Cancel* = 0x0000FF69 - KEY_Help* = 0x0000FF6A - KEY_Break* = 0x0000FF6B - KEY_Mode_switch* = 0x0000FF7E - KEY_script_switch* = 0x0000FF7E - KEY_Num_Lock* = 0x0000FF7F - KEY_KP_Space* = 0x0000FF80 - KEY_KP_Tab* = 0x0000FF89 - KEY_KP_Enter* = 0x0000FF8D - KEY_KP_F1* = 0x0000FF91 - KEY_KP_F2* = 0x0000FF92 - KEY_KP_F3* = 0x0000FF93 - KEY_KP_F4* = 0x0000FF94 - KEY_KP_Home* = 0x0000FF95 - KEY_KP_Left* = 0x0000FF96 - KEY_KP_Up* = 0x0000FF97 - KEY_KP_Right* = 0x0000FF98 - KEY_KP_Down* = 0x0000FF99 - KEY_KP_Prior* = 0x0000FF9A - KEY_KP_Page_Up* = 0x0000FF9A - KEY_KP_Next* = 0x0000FF9B - KEY_KP_Page_Down* = 0x0000FF9B - KEY_KP_End* = 0x0000FF9C - KEY_KP_Begin* = 0x0000FF9D - KEY_KP_Insert* = 0x0000FF9E - KEY_KP_Delete* = 0x0000FF9F - KEY_KP_Equal* = 0x0000FFBD - KEY_KP_Multiply* = 0x0000FFAA - KEY_KP_Add* = 0x0000FFAB - KEY_KP_Separator* = 0x0000FFAC - KEY_KP_Subtract* = 0x0000FFAD - KEY_KP_Decimal* = 0x0000FFAE - KEY_KP_Divide* = 0x0000FFAF - KEY_KP_0* = 0x0000FFB0 - KEY_KP_1* = 0x0000FFB1 - KEY_KP_2* = 0x0000FFB2 - KEY_KP_3* = 0x0000FFB3 - KEY_KP_4* = 0x0000FFB4 - KEY_KP_5* = 0x0000FFB5 - KEY_KP_6* = 0x0000FFB6 - KEY_KP_7* = 0x0000FFB7 - KEY_KP_8* = 0x0000FFB8 - KEY_KP_9* = 0x0000FFB9 - KEY_F1* = 0x0000FFBE - KEY_F2* = 0x0000FFBF - KEY_F3* = 0x0000FFC0 - KEY_F4* = 0x0000FFC1 - KEY_F5* = 0x0000FFC2 - KEY_F6* = 0x0000FFC3 - KEY_F7* = 0x0000FFC4 - KEY_F8* = 0x0000FFC5 - KEY_F9* = 0x0000FFC6 - KEY_F10* = 0x0000FFC7 - KEY_F11* = 0x0000FFC8 - KEY_L1* = 0x0000FFC8 - KEY_F12* = 0x0000FFC9 - KEY_L2* = 0x0000FFC9 - KEY_F13* = 0x0000FFCA - KEY_L3* = 0x0000FFCA - KEY_F14* = 0x0000FFCB - KEY_L4* = 0x0000FFCB - KEY_F15* = 0x0000FFCC - KEY_L5* = 0x0000FFCC - KEY_F16* = 0x0000FFCD - KEY_L6* = 0x0000FFCD - KEY_F17* = 0x0000FFCE - KEY_L7* = 0x0000FFCE - KEY_F18* = 0x0000FFCF - KEY_L8* = 0x0000FFCF - KEY_F19* = 0x0000FFD0 - KEY_L9* = 0x0000FFD0 - KEY_F20* = 0x0000FFD1 - KEY_L10* = 0x0000FFD1 - KEY_F21* = 0x0000FFD2 - KEY_R1* = 0x0000FFD2 - KEY_F22* = 0x0000FFD3 - KEY_R2* = 0x0000FFD3 - KEY_F23* = 0x0000FFD4 - KEY_R3* = 0x0000FFD4 - KEY_F24* = 0x0000FFD5 - KEY_R4* = 0x0000FFD5 - KEY_F25* = 0x0000FFD6 - KEY_R5* = 0x0000FFD6 - KEY_F26* = 0x0000FFD7 - KEY_R6* = 0x0000FFD7 - KEY_F27* = 0x0000FFD8 - KEY_R7* = 0x0000FFD8 - KEY_F28* = 0x0000FFD9 - KEY_R8* = 0x0000FFD9 - KEY_F29* = 0x0000FFDA - KEY_R9* = 0x0000FFDA - KEY_F30* = 0x0000FFDB - KEY_R10* = 0x0000FFDB - KEY_F31* = 0x0000FFDC - KEY_R11* = 0x0000FFDC - KEY_F32* = 0x0000FFDD - KEY_R12* = 0x0000FFDD - KEY_F33* = 0x0000FFDE - KEY_R13* = 0x0000FFDE - KEY_F34* = 0x0000FFDF - KEY_R14* = 0x0000FFDF - KEY_F35* = 0x0000FFE0 - KEY_R15* = 0x0000FFE0 - KEY_Shift_L* = 0x0000FFE1 - KEY_Shift_R* = 0x0000FFE2 - KEY_Control_L* = 0x0000FFE3 - KEY_Control_R* = 0x0000FFE4 - KEY_Caps_Lock* = 0x0000FFE5 - KEY_Shift_Lock* = 0x0000FFE6 - KEY_Meta_L* = 0x0000FFE7 - KEY_Meta_R* = 0x0000FFE8 - KEY_Alt_L* = 0x0000FFE9 - KEY_Alt_R* = 0x0000FFEA - KEY_Super_L* = 0x0000FFEB - KEY_Super_R* = 0x0000FFEC - KEY_Hyper_L* = 0x0000FFED - KEY_Hyper_R* = 0x0000FFEE - KEY_ISO_Lock* = 0x0000FE01 - KEY_ISO_Level2_Latch* = 0x0000FE02 - KEY_ISO_Level3_Shift* = 0x0000FE03 - KEY_ISO_Level3_Latch* = 0x0000FE04 - KEY_ISO_Level3_Lock* = 0x0000FE05 - KEY_ISO_Group_Shift* = 0x0000FF7E - KEY_ISO_Group_Latch* = 0x0000FE06 - KEY_ISO_Group_Lock* = 0x0000FE07 - KEY_ISO_Next_Group* = 0x0000FE08 - KEY_ISO_Next_Group_Lock* = 0x0000FE09 - KEY_ISO_Prev_Group* = 0x0000FE0A - KEY_ISO_Prev_Group_Lock* = 0x0000FE0B - KEY_ISO_First_Group* = 0x0000FE0C - KEY_ISO_First_Group_Lock* = 0x0000FE0D - KEY_ISO_Last_Group* = 0x0000FE0E - KEY_ISO_Last_Group_Lock* = 0x0000FE0F - KEY_ISO_Left_Tab* = 0x0000FE20 - KEY_ISO_Move_Line_Up* = 0x0000FE21 - KEY_ISO_Move_Line_Down* = 0x0000FE22 - KEY_ISO_Partial_Line_Up* = 0x0000FE23 - KEY_ISO_Partial_Line_Down* = 0x0000FE24 - KEY_ISO_Partial_Space_Left* = 0x0000FE25 - KEY_ISO_Partial_Space_Right* = 0x0000FE26 - KEY_ISO_Set_Margin_Left* = 0x0000FE27 - KEY_ISO_Set_Margin_Right* = 0x0000FE28 - KEY_ISO_Release_Margin_Left* = 0x0000FE29 - KEY_ISO_Release_Margin_Right* = 0x0000FE2A - KEY_ISO_Release_Both_Margins* = 0x0000FE2B - KEY_ISO_Fast_Cursor_Left* = 0x0000FE2C - KEY_ISO_Fast_Cursor_Right* = 0x0000FE2D - KEY_ISO_Fast_Cursor_Up* = 0x0000FE2E - KEY_ISO_Fast_Cursor_Down* = 0x0000FE2F - KEY_ISO_Continuous_Underline* = 0x0000FE30 - KEY_ISO_Discontinuous_Underline* = 0x0000FE31 - KEY_ISO_Emphasize* = 0x0000FE32 - KEY_ISO_Center_Object* = 0x0000FE33 - KEY_ISO_Enter* = 0x0000FE34 - KEY_dead_grave* = 0x0000FE50 - KEY_dead_acute* = 0x0000FE51 - KEY_dead_circumflex* = 0x0000FE52 - KEY_dead_tilde* = 0x0000FE53 - KEY_dead_macron* = 0x0000FE54 - KEY_dead_breve* = 0x0000FE55 - KEY_dead_abovedot* = 0x0000FE56 - KEY_dead_diaeresis* = 0x0000FE57 - KEY_dead_abovering* = 0x0000FE58 - KEY_dead_doubleacute* = 0x0000FE59 - KEY_dead_caron* = 0x0000FE5A - KEY_dead_cedilla* = 0x0000FE5B - KEY_dead_ogonek* = 0x0000FE5C - KEY_dead_iota* = 0x0000FE5D - KEY_dead_voiced_sound* = 0x0000FE5E - KEY_dead_semivoiced_sound* = 0x0000FE5F - KEY_dead_belowdot* = 0x0000FE60 - KEY_First_Virtual_Screen* = 0x0000FED0 - KEY_Prev_Virtual_Screen* = 0x0000FED1 - KEY_Next_Virtual_Screen* = 0x0000FED2 - KEY_Last_Virtual_Screen* = 0x0000FED4 - KEY_Terminate_Server* = 0x0000FED5 - KEY_AccessX_Enable* = 0x0000FE70 - KEY_AccessX_Feedback_Enable* = 0x0000FE71 - KEY_RepeatKeys_Enable* = 0x0000FE72 - KEY_SlowKeys_Enable* = 0x0000FE73 - KEY_BounceKeys_Enable* = 0x0000FE74 - KEY_StickyKeys_Enable* = 0x0000FE75 - KEY_MouseKeys_Enable* = 0x0000FE76 - KEY_MouseKeys_Accel_Enable* = 0x0000FE77 - KEY_Overlay1_Enable* = 0x0000FE78 - KEY_Overlay2_Enable* = 0x0000FE79 - KEY_AudibleBell_Enable* = 0x0000FE7A - KEY_Pointer_Left* = 0x0000FEE0 - KEY_Pointer_Right* = 0x0000FEE1 - KEY_Pointer_Up* = 0x0000FEE2 - KEY_Pointer_Down* = 0x0000FEE3 - KEY_Pointer_UpLeft* = 0x0000FEE4 - KEY_Pointer_UpRight* = 0x0000FEE5 - KEY_Pointer_DownLeft* = 0x0000FEE6 - KEY_Pointer_DownRight* = 0x0000FEE7 - KEY_Pointer_Button_Dflt* = 0x0000FEE8 - KEY_Pointer_Button1* = 0x0000FEE9 - KEY_Pointer_Button2* = 0x0000FEEA - KEY_Pointer_Button3* = 0x0000FEEB - KEY_Pointer_Button4* = 0x0000FEEC - KEY_Pointer_Button5* = 0x0000FEED - KEY_Pointer_DblClick_Dflt* = 0x0000FEEE - KEY_Pointer_DblClick1* = 0x0000FEEF - KEY_Pointer_DblClick2* = 0x0000FEF0 - KEY_Pointer_DblClick3* = 0x0000FEF1 - KEY_Pointer_DblClick4* = 0x0000FEF2 - KEY_Pointer_DblClick5* = 0x0000FEF3 - KEY_Pointer_Drag_Dflt* = 0x0000FEF4 - KEY_Pointer_Drag1* = 0x0000FEF5 - KEY_Pointer_Drag2* = 0x0000FEF6 - KEY_Pointer_Drag3* = 0x0000FEF7 - KEY_Pointer_Drag4* = 0x0000FEF8 - KEY_Pointer_Drag5* = 0x0000FEFD - KEY_Pointer_EnableKeys* = 0x0000FEF9 - KEY_Pointer_Accelerate* = 0x0000FEFA - KEY_Pointer_DfltBtnNext* = 0x0000FEFB - KEY_Pointer_DfltBtnPrev* = 0x0000FEFC - KEY_3270_Duplicate* = 0x0000FD01 - KEY_3270_FieldMark* = 0x0000FD02 - KEY_3270_Right2* = 0x0000FD03 - KEY_3270_Left2* = 0x0000FD04 - KEY_3270_BackTab* = 0x0000FD05 - KEY_3270_EraseEOF* = 0x0000FD06 - KEY_3270_EraseInput* = 0x0000FD07 - KEY_3270_Reset* = 0x0000FD08 - KEY_3270_Quit* = 0x0000FD09 - KEY_3270_PA1* = 0x0000FD0A - KEY_3270_PA2* = 0x0000FD0B - KEY_3270_PA3* = 0x0000FD0C - KEY_3270_Test* = 0x0000FD0D - KEY_3270_Attn* = 0x0000FD0E - KEY_3270_CursorBlink* = 0x0000FD0F - KEY_3270_AltCursor* = 0x0000FD10 - KEY_3270_KeyClick* = 0x0000FD11 - KEY_3270_Jump* = 0x0000FD12 - KEY_3270_Ident* = 0x0000FD13 - KEY_3270_Rule* = 0x0000FD14 - KEY_3270_Copy* = 0x0000FD15 - KEY_3270_Play* = 0x0000FD16 - KEY_3270_Setup* = 0x0000FD17 - KEY_3270_Record* = 0x0000FD18 - KEY_3270_ChangeScreen* = 0x0000FD19 - KEY_3270_DeleteWord* = 0x0000FD1A - KEY_3270_ExSelect* = 0x0000FD1B - KEY_3270_CursorSelect* = 0x0000FD1C - KEY_3270_PrintScreen* = 0x0000FD1D - KEY_3270_Enter* = 0x0000FD1E - KEY_space* = 0x00000020 - KEY_exclam* = 0x00000021 - KEY_quotedbl* = 0x00000022 - KEY_numbersign* = 0x00000023 - KEY_dollar* = 0x00000024 - KEY_percent* = 0x00000025 - KEY_ampersand* = 0x00000026 - KEY_apostrophe* = 0x00000027 - KEY_quoteright* = 0x00000027 - KEY_parenleft* = 0x00000028 - KEY_parenright* = 0x00000029 - KEY_asterisk* = 0x0000002A - KEY_plus* = 0x0000002B - KEY_comma* = 0x0000002C - KEY_minus* = 0x0000002D - KEY_period* = 0x0000002E - KEY_slash* = 0x0000002F - KEY_0* = 0x00000030 - KEY_1* = 0x00000031 - KEY_2* = 0x00000032 - KEY_3* = 0x00000033 - KEY_4* = 0x00000034 - KEY_5* = 0x00000035 - KEY_6* = 0x00000036 - KEY_7* = 0x00000037 - KEY_8* = 0x00000038 - KEY_9* = 0x00000039 - KEY_colon* = 0x0000003A - KEY_semicolon* = 0x0000003B - KEY_less* = 0x0000003C - KEY_equal* = 0x0000003D - KEY_greater* = 0x0000003E - KEY_question* = 0x0000003F - KEY_at* = 0x00000040 - KEY_CAPITAL_A* = 0x00000041 - KEY_CAPITAL_B* = 0x00000042 - KEY_CAPITAL_C* = 0x00000043 - KEY_CAPITAL_D* = 0x00000044 - KEY_CAPITAL_E* = 0x00000045 - KEY_CAPITAL_F* = 0x00000046 - KEY_CAPITAL_G* = 0x00000047 - KEY_CAPITAL_H* = 0x00000048 - KEY_CAPITAL_I* = 0x00000049 - KEY_CAPITAL_J* = 0x0000004A - KEY_CAPITAL_K* = 0x0000004B - KEY_CAPITAL_L* = 0x0000004C - KEY_CAPITAL_M* = 0x0000004D - KEY_CAPITAL_N* = 0x0000004E - KEY_CAPITAL_O* = 0x0000004F - KEY_CAPITAL_P* = 0x00000050 - KEY_CAPITAL_Q* = 0x00000051 - KEY_CAPITAL_R* = 0x00000052 - KEY_CAPITAL_S* = 0x00000053 - KEY_CAPITAL_T* = 0x00000054 - KEY_CAPITAL_U* = 0x00000055 - KEY_CAPITAL_V* = 0x00000056 - KEY_CAPITAL_W* = 0x00000057 - KEY_CAPITAL_X* = 0x00000058 - KEY_CAPITAL_Y* = 0x00000059 - KEY_CAPITAL_Z* = 0x0000005A - KEY_bracketleft* = 0x0000005B - KEY_backslash* = 0x0000005C - KEY_bracketright* = 0x0000005D - KEY_asciicircum* = 0x0000005E - KEY_underscore* = 0x0000005F - KEY_grave* = 0x00000060 - KEY_quoteleft* = 0x00000060 - KEY_a* = 0x00000061 - KEY_b* = 0x00000062 - KEY_c* = 0x00000063 - KEY_d* = 0x00000064 - KEY_e* = 0x00000065 - KEY_f* = 0x00000066 - KEY_g* = 0x00000067 - KEY_h* = 0x00000068 - KEY_i* = 0x00000069 - KEY_j* = 0x0000006A - KEY_k* = 0x0000006B - KEY_l* = 0x0000006C - KEY_m* = 0x0000006D - KEY_n* = 0x0000006E - KEY_o* = 0x0000006F - KEY_p* = 0x00000070 - KEY_q* = 0x00000071 - KEY_r* = 0x00000072 - KEY_s* = 0x00000073 - KEY_t* = 0x00000074 - KEY_u* = 0x00000075 - KEY_v* = 0x00000076 - KEY_w* = 0x00000077 - KEY_x* = 0x00000078 - KEY_y* = 0x00000079 - KEY_z* = 0x0000007A - KEY_braceleft* = 0x0000007B - KEY_bar* = 0x0000007C - KEY_braceright* = 0x0000007D - KEY_asciitilde* = 0x0000007E - KEY_nobreakspace* = 0x000000A0 - KEY_exclamdown* = 0x000000A1 - KEY_cent* = 0x000000A2 - KEY_sterling* = 0x000000A3 - KEY_currency* = 0x000000A4 - KEY_yen* = 0x000000A5 - KEY_brokenbar* = 0x000000A6 - KEY_section* = 0x000000A7 - KEY_diaeresis* = 0x000000A8 - KEY_copyright* = 0x000000A9 - KEY_ordfeminine* = 0x000000AA - KEY_guillemotleft* = 0x000000AB - KEY_notsign* = 0x000000AC - KEY_hyphen* = 0x000000AD - KEY_registered* = 0x000000AE - KEY_macron* = 0x000000AF - KEY_degree* = 0x000000B0 - KEY_plusminus* = 0x000000B1 - KEY_twosuperior* = 0x000000B2 - KEY_threesuperior* = 0x000000B3 - KEY_acute* = 0x000000B4 - KEY_mu* = 0x000000B5 - KEY_paragraph* = 0x000000B6 - KEY_periodcentered* = 0x000000B7 - KEY_cedilla* = 0x000000B8 - KEY_onesuperior* = 0x000000B9 - KEY_masculine* = 0x000000BA - KEY_guillemotright* = 0x000000BB - KEY_onequarter* = 0x000000BC - KEY_onehalf* = 0x000000BD - KEY_threequarters* = 0x000000BE - KEY_questiondown* = 0x000000BF - KEY_CAPITAL_Agrave* = 0x000000C0 - KEY_CAPITAL_Aacute* = 0x000000C1 - KEY_CAPITAL_Acircumflex* = 0x000000C2 - KEY_CAPITAL_Atilde* = 0x000000C3 - KEY_CAPITAL_Adiaeresis* = 0x000000C4 - KEY_CAPITAL_Aring* = 0x000000C5 - KEY_CAPITAL_AE* = 0x000000C6 - KEY_CAPITAL_Ccedilla* = 0x000000C7 - KEY_CAPITAL_Egrave* = 0x000000C8 - KEY_CAPITAL_Eacute* = 0x000000C9 - KEY_CAPITAL_Ecircumflex* = 0x000000CA - KEY_CAPITAL_Ediaeresis* = 0x000000CB - KEY_CAPITAL_Igrave* = 0x000000CC - KEY_CAPITAL_Iacute* = 0x000000CD - KEY_CAPITAL_Icircumflex* = 0x000000CE - KEY_CAPITAL_Idiaeresis* = 0x000000CF - KEY_CAPITAL_ETH* = 0x000000D0 - KEY_CAPITAL_Ntilde* = 0x000000D1 - KEY_CAPITAL_Ograve* = 0x000000D2 - KEY_CAPITAL_Oacute* = 0x000000D3 - KEY_CAPITAL_Ocircumflex* = 0x000000D4 - KEY_CAPITAL_Otilde* = 0x000000D5 - KEY_CAPITAL_Odiaeresis* = 0x000000D6 - KEY_multiply* = 0x000000D7 - KEY_Ooblique* = 0x000000D8 - KEY_CAPITAL_Ugrave* = 0x000000D9 - KEY_CAPITAL_Uacute* = 0x000000DA - KEY_CAPITAL_Ucircumflex* = 0x000000DB - KEY_CAPITAL_Udiaeresis* = 0x000000DC - KEY_CAPITAL_Yacute* = 0x000000DD - KEY_CAPITAL_THORN* = 0x000000DE - KEY_ssharp* = 0x000000DF - KEY_agrave* = 0x000000E0 - KEY_aacute* = 0x000000E1 - KEY_acircumflex* = 0x000000E2 - KEY_atilde* = 0x000000E3 - KEY_adiaeresis* = 0x000000E4 - KEY_aring* = 0x000000E5 - KEY_ae* = 0x000000E6 - KEY_ccedilla* = 0x000000E7 - KEY_egrave* = 0x000000E8 - KEY_eacute* = 0x000000E9 - KEY_ecircumflex* = 0x000000EA - KEY_ediaeresis* = 0x000000EB - KEY_igrave* = 0x000000EC - KEY_iacute* = 0x000000ED - KEY_icircumflex* = 0x000000EE - KEY_idiaeresis* = 0x000000EF - KEY_eth* = 0x000000F0 - KEY_ntilde* = 0x000000F1 - KEY_ograve* = 0x000000F2 - KEY_oacute* = 0x000000F3 - KEY_ocircumflex* = 0x000000F4 - KEY_otilde* = 0x000000F5 - KEY_odiaeresis* = 0x000000F6 - KEY_division* = 0x000000F7 - KEY_oslash* = 0x000000F8 - KEY_ugrave* = 0x000000F9 - KEY_uacute* = 0x000000FA - KEY_ucircumflex* = 0x000000FB - KEY_udiaeresis* = 0x000000FC - KEY_yacute* = 0x000000FD - KEY_thorn* = 0x000000FE - KEY_ydiaeresis* = 0x000000FF - KEY_CAPITAL_Aogonek* = 0x000001A1 - KEY_breve* = 0x000001A2 - KEY_CAPITAL_Lstroke* = 0x000001A3 - KEY_CAPITAL_Lcaron* = 0x000001A5 - KEY_CAPITAL_Sacute* = 0x000001A6 - KEY_CAPITAL_Scaron* = 0x000001A9 - KEY_CAPITAL_Scedilla* = 0x000001AA - KEY_CAPITAL_Tcaron* = 0x000001AB - KEY_CAPITAL_Zacute* = 0x000001AC - KEY_CAPITAL_Zcaron* = 0x000001AE - KEY_CAPITAL_Zabovedot* = 0x000001AF - KEY_aogonek* = 0x000001B1 - KEY_ogonek* = 0x000001B2 - KEY_lstroke* = 0x000001B3 - KEY_lcaron* = 0x000001B5 - KEY_sacute* = 0x000001B6 - KEY_caron* = 0x000001B7 - KEY_scaron* = 0x000001B9 - KEY_scedilla* = 0x000001BA - KEY_tcaron* = 0x000001BB - KEY_zacute* = 0x000001BC - KEY_doubleacute* = 0x000001BD - KEY_zcaron* = 0x000001BE - KEY_zabovedot* = 0x000001BF - KEY_CAPITAL_Racute* = 0x000001C0 - KEY_CAPITAL_Abreve* = 0x000001C3 - KEY_CAPITAL_Lacute* = 0x000001C5 - KEY_CAPITAL_Cacute* = 0x000001C6 - KEY_CAPITAL_Ccaron* = 0x000001C8 - KEY_CAPITAL_Eogonek* = 0x000001CA - KEY_CAPITAL_Ecaron* = 0x000001CC - KEY_CAPITAL_Dcaron* = 0x000001CF - KEY_CAPITAL_Dstroke* = 0x000001D0 - KEY_CAPITAL_Nacute* = 0x000001D1 - KEY_CAPITAL_Ncaron* = 0x000001D2 - KEY_CAPITAL_Odoubleacute* = 0x000001D5 - KEY_CAPITAL_Rcaron* = 0x000001D8 - KEY_CAPITAL_Uring* = 0x000001D9 - KEY_CAPITAL_Udoubleacute* = 0x000001DB - KEY_CAPITAL_Tcedilla* = 0x000001DE - KEY_racute* = 0x000001E0 - KEY_abreve* = 0x000001E3 - KEY_lacute* = 0x000001E5 - KEY_cacute* = 0x000001E6 - KEY_ccaron* = 0x000001E8 - KEY_eogonek* = 0x000001EA - KEY_ecaron* = 0x000001EC - KEY_dcaron* = 0x000001EF - KEY_dstroke* = 0x000001F0 - KEY_nacute* = 0x000001F1 - KEY_ncaron* = 0x000001F2 - KEY_odoubleacute* = 0x000001F5 - KEY_udoubleacute* = 0x000001FB - KEY_rcaron* = 0x000001F8 - KEY_uring* = 0x000001F9 - KEY_tcedilla* = 0x000001FE - KEY_abovedot* = 0x000001FF - KEY_CAPITAL_Hstroke* = 0x000002A1 - KEY_CAPITAL_Hcircumflex* = 0x000002A6 - KEY_CAPITAL_Iabovedot* = 0x000002A9 - KEY_CAPITAL_Gbreve* = 0x000002AB - KEY_CAPITAL_Jcircumflex* = 0x000002AC - KEY_hstroke* = 0x000002B1 - KEY_hcircumflex* = 0x000002B6 - KEY_idotless* = 0x000002B9 - KEY_gbreve* = 0x000002BB - KEY_jcircumflex* = 0x000002BC - KEY_CAPITAL_Cabovedot* = 0x000002C5 - KEY_CAPITAL_Ccircumflex* = 0x000002C6 - KEY_CAPITAL_Gabovedot* = 0x000002D5 - KEY_CAPITAL_Gcircumflex* = 0x000002D8 - KEY_CAPITAL_Ubreve* = 0x000002DD - KEY_CAPITAL_Scircumflex* = 0x000002DE - KEY_cabovedot* = 0x000002E5 - KEY_ccircumflex* = 0x000002E6 - KEY_gabovedot* = 0x000002F5 - KEY_gcircumflex* = 0x000002F8 - KEY_ubreve* = 0x000002FD - KEY_scircumflex* = 0x000002FE - KEY_kra* = 0x000003A2 - KEY_kappa* = 0x000003A2 - KEY_CAPITAL_Rcedilla* = 0x000003A3 - KEY_CAPITAL_Itilde* = 0x000003A5 - KEY_CAPITAL_Lcedilla* = 0x000003A6 - KEY_CAPITAL_Emacron* = 0x000003AA - KEY_CAPITAL_Gcedilla* = 0x000003AB - KEY_CAPITAL_Tslash* = 0x000003AC - KEY_rcedilla* = 0x000003B3 - KEY_itilde* = 0x000003B5 - KEY_lcedilla* = 0x000003B6 - KEY_emacron* = 0x000003BA - KEY_gcedilla* = 0x000003BB - KEY_tslash* = 0x000003BC - KEY_CAPITAL_ENG* = 0x000003BD - KEY_eng* = 0x000003BF - KEY_CAPITAL_Amacron* = 0x000003C0 - KEY_CAPITAL_Iogonek* = 0x000003C7 - KEY_CAPITAL_Eabovedot* = 0x000003CC - KEY_CAPITAL_Imacron* = 0x000003CF - KEY_CAPITAL_Ncedilla* = 0x000003D1 - KEY_CAPITAL_Omacron* = 0x000003D2 - KEY_CAPITAL_Kcedilla* = 0x000003D3 - KEY_CAPITAL_Uogonek* = 0x000003D9 - KEY_CAPITAL_Utilde* = 0x000003DD - KEY_CAPITAL_Umacron* = 0x000003DE - KEY_amacron* = 0x000003E0 - KEY_iogonek* = 0x000003E7 - KEY_eabovedot* = 0x000003EC - KEY_imacron* = 0x000003EF - KEY_ncedilla* = 0x000003F1 - KEY_omacron* = 0x000003F2 - KEY_kcedilla* = 0x000003F3 - KEY_uogonek* = 0x000003F9 - KEY_utilde* = 0x000003FD - KEY_umacron* = 0x000003FE - KEY_CAPITAL_OE* = 0x000013BC - KEY_oe* = 0x000013BD - KEY_CAPITAL_Ydiaeresis* = 0x000013BE - KEY_overline* = 0x0000047E - KEY_kana_fullstop* = 0x000004A1 - KEY_kana_openingbracket* = 0x000004A2 - KEY_kana_closingbracket* = 0x000004A3 - KEY_kana_comma* = 0x000004A4 - KEY_kana_conjunctive* = 0x000004A5 - KEY_kana_middledot* = 0x000004A5 - KEY_kana_WO* = 0x000004A6 - KEY_kana_a* = 0x000004A7 - KEY_kana_i* = 0x000004A8 - KEY_kana_u* = 0x000004A9 - KEY_kana_e* = 0x000004AA - KEY_kana_o* = 0x000004AB - KEY_kana_ya* = 0x000004AC - KEY_kana_yu* = 0x000004AD - KEY_kana_yo* = 0x000004AE - KEY_kana_tsu* = 0x000004AF - KEY_kana_tu* = 0x000004AF - KEY_prolongedsound* = 0x000004B0 - KEY_kana_CAPITAL_A* = 0x000004B1 - KEY_kana_CAPITAL_I* = 0x000004B2 - KEY_kana_CAPITAL_U* = 0x000004B3 - KEY_kana_CAPITAL_E* = 0x000004B4 - KEY_kana_CAPITAL_O* = 0x000004B5 - KEY_kana_KA* = 0x000004B6 - KEY_kana_KI* = 0x000004B7 - KEY_kana_KU* = 0x000004B8 - KEY_kana_KE* = 0x000004B9 - KEY_kana_KO* = 0x000004BA - KEY_kana_SA* = 0x000004BB - KEY_kana_SHI* = 0x000004BC - KEY_kana_SU* = 0x000004BD - KEY_kana_SE* = 0x000004BE - KEY_kana_SO* = 0x000004BF - KEY_kana_TA* = 0x000004C0 - KEY_kana_CHI* = 0x000004C1 - KEY_kana_TI* = 0x000004C1 - KEY_kana_CAPITAL_TSU* = 0x000004C2 - KEY_kana_CAPITAL_TU* = 0x000004C2 - KEY_kana_TE* = 0x000004C3 - KEY_kana_TO* = 0x000004C4 - KEY_kana_NA* = 0x000004C5 - KEY_kana_NI* = 0x000004C6 - KEY_kana_NU* = 0x000004C7 - KEY_kana_NE* = 0x000004C8 - KEY_kana_NO* = 0x000004C9 - KEY_kana_HA* = 0x000004CA - KEY_kana_HI* = 0x000004CB - KEY_kana_FU* = 0x000004CC - KEY_kana_HU* = 0x000004CC - KEY_kana_HE* = 0x000004CD - KEY_kana_HO* = 0x000004CE - KEY_kana_MA* = 0x000004CF - KEY_kana_MI* = 0x000004D0 - KEY_kana_MU* = 0x000004D1 - KEY_kana_ME* = 0x000004D2 - KEY_kana_MO* = 0x000004D3 - KEY_kana_CAPITAL_YA* = 0x000004D4 - KEY_kana_CAPITAL_YU* = 0x000004D5 - KEY_kana_CAPITAL_YO* = 0x000004D6 - KEY_kana_RA* = 0x000004D7 - KEY_kana_RI* = 0x000004D8 - KEY_kana_RU* = 0x000004D9 - KEY_kana_RE* = 0x000004DA - KEY_kana_RO* = 0x000004DB - KEY_kana_WA* = 0x000004DC - KEY_kana_N* = 0x000004DD - KEY_voicedsound* = 0x000004DE - KEY_semivoicedsound* = 0x000004DF - KEY_kana_switch* = 0x0000FF7E - KEY_Arabic_comma* = 0x000005AC - KEY_Arabic_semicolon* = 0x000005BB - KEY_Arabic_question_mark* = 0x000005BF - KEY_Arabic_hamza* = 0x000005C1 - KEY_Arabic_maddaonalef* = 0x000005C2 - KEY_Arabic_hamzaonalef* = 0x000005C3 - KEY_Arabic_hamzaonwaw* = 0x000005C4 - KEY_Arabic_hamzaunderalef* = 0x000005C5 - KEY_Arabic_hamzaonyeh* = 0x000005C6 - KEY_Arabic_alef* = 0x000005C7 - KEY_Arabic_beh* = 0x000005C8 - KEY_Arabic_tehmarbuta* = 0x000005C9 - KEY_Arabic_teh* = 0x000005CA - KEY_Arabic_theh* = 0x000005CB - KEY_Arabic_jeem* = 0x000005CC - KEY_Arabic_hah* = 0x000005CD - KEY_Arabic_khah* = 0x000005CE - KEY_Arabic_dal* = 0x000005CF - KEY_Arabic_thal* = 0x000005D0 - KEY_Arabic_ra* = 0x000005D1 - KEY_Arabic_zain* = 0x000005D2 - KEY_Arabic_seen* = 0x000005D3 - KEY_Arabic_sheen* = 0x000005D4 - KEY_Arabic_sad* = 0x000005D5 - KEY_Arabic_dad* = 0x000005D6 - KEY_Arabic_tah* = 0x000005D7 - KEY_Arabic_zah* = 0x000005D8 - KEY_Arabic_ain* = 0x000005D9 - KEY_Arabic_ghain* = 0x000005DA - KEY_Arabic_tatweel* = 0x000005E0 - KEY_Arabic_feh* = 0x000005E1 - KEY_Arabic_qaf* = 0x000005E2 - KEY_Arabic_kaf* = 0x000005E3 - KEY_Arabic_lam* = 0x000005E4 - KEY_Arabic_meem* = 0x000005E5 - KEY_Arabic_noon* = 0x000005E6 - KEY_Arabic_ha* = 0x000005E7 - KEY_Arabic_heh* = 0x000005E7 - KEY_Arabic_waw* = 0x000005E8 - KEY_Arabic_alefmaksura* = 0x000005E9 - KEY_Arabic_yeh* = 0x000005EA - KEY_Arabic_fathatan* = 0x000005EB - KEY_Arabic_dammatan* = 0x000005EC - KEY_Arabic_kasratan* = 0x000005ED - KEY_Arabic_fatha* = 0x000005EE - KEY_Arabic_damma* = 0x000005EF - KEY_Arabic_kasra* = 0x000005F0 - KEY_Arabic_shadda* = 0x000005F1 - KEY_Arabic_sukun* = 0x000005F2 - KEY_Arabic_switch* = 0x0000FF7E - KEY_Serbian_dje* = 0x000006A1 - KEY_Macedonia_gje* = 0x000006A2 - KEY_Cyrillic_io* = 0x000006A3 - KEY_Ukrainian_ie* = 0x000006A4 - KEY_Ukranian_je* = 0x000006A4 - KEY_Macedonia_dse* = 0x000006A5 - KEY_Ukrainian_i* = 0x000006A6 - KEY_Ukranian_i* = 0x000006A6 - KEY_Ukrainian_yi* = 0x000006A7 - KEY_Ukranian_yi* = 0x000006A7 - KEY_Cyrillic_je* = 0x000006A8 - KEY_Serbian_je* = 0x000006A8 - KEY_Cyrillic_lje* = 0x000006A9 - KEY_Serbian_lje* = 0x000006A9 - KEY_Cyrillic_nje* = 0x000006AA - KEY_Serbian_nje* = 0x000006AA - KEY_Serbian_tshe* = 0x000006AB - KEY_Macedonia_kje* = 0x000006AC - KEY_Byelorussian_shortu* = 0x000006AE - KEY_Cyrillic_dzhe* = 0x000006AF - KEY_Serbian_dze* = 0x000006AF - KEY_numerosign* = 0x000006B0 - KEY_Serbian_CAPITAL_DJE* = 0x000006B1 - KEY_Macedonia_CAPITAL_GJE* = 0x000006B2 - KEY_Cyrillic_CAPITAL_IO* = 0x000006B3 - KEY_Ukrainian_CAPITAL_IE* = 0x000006B4 - KEY_Ukranian_CAPITAL_JE* = 0x000006B4 - KEY_Macedonia_CAPITAL_DSE* = 0x000006B5 - KEY_Ukrainian_CAPITAL_I* = 0x000006B6 - KEY_Ukranian_CAPITAL_I* = 0x000006B6 - KEY_Ukrainian_CAPITAL_YI* = 0x000006B7 - KEY_Ukranian_CAPITAL_YI* = 0x000006B7 - KEY_Cyrillic_CAPITAL_JE* = 0x000006B8 - KEY_Serbian_CAPITAL_JE* = 0x000006B8 - KEY_Cyrillic_CAPITAL_LJE* = 0x000006B9 - KEY_Serbian_CAPITAL_LJE* = 0x000006B9 - KEY_Cyrillic_CAPITAL_NJE* = 0x000006BA - KEY_Serbian_CAPITAL_NJE* = 0x000006BA - KEY_Serbian_CAPITAL_TSHE* = 0x000006BB - KEY_Macedonia_CAPITAL_KJE* = 0x000006BC - KEY_Byelorussian_CAPITAL_SHORTU* = 0x000006BE - KEY_Cyrillic_CAPITAL_DZHE* = 0x000006BF - KEY_Serbian_CAPITAL_DZE* = 0x000006BF - KEY_Cyrillic_yu* = 0x000006C0 - KEY_Cyrillic_a* = 0x000006C1 - KEY_Cyrillic_be* = 0x000006C2 - KEY_Cyrillic_tse* = 0x000006C3 - KEY_Cyrillic_de* = 0x000006C4 - KEY_Cyrillic_ie* = 0x000006C5 - KEY_Cyrillic_ef* = 0x000006C6 - KEY_Cyrillic_ghe* = 0x000006C7 - KEY_Cyrillic_ha* = 0x000006C8 - KEY_Cyrillic_i* = 0x000006C9 - KEY_Cyrillic_shorti* = 0x000006CA - KEY_Cyrillic_ka* = 0x000006CB - KEY_Cyrillic_el* = 0x000006CC - KEY_Cyrillic_em* = 0x000006CD - KEY_Cyrillic_en* = 0x000006CE - KEY_Cyrillic_o* = 0x000006CF - KEY_Cyrillic_pe* = 0x000006D0 - KEY_Cyrillic_ya* = 0x000006D1 - KEY_Cyrillic_er* = 0x000006D2 - KEY_Cyrillic_es* = 0x000006D3 - KEY_Cyrillic_te* = 0x000006D4 - KEY_Cyrillic_u* = 0x000006D5 - KEY_Cyrillic_zhe* = 0x000006D6 - KEY_Cyrillic_ve* = 0x000006D7 - KEY_Cyrillic_softsign* = 0x000006D8 - KEY_Cyrillic_yeru* = 0x000006D9 - KEY_Cyrillic_ze* = 0x000006DA - KEY_Cyrillic_sha* = 0x000006DB - KEY_Cyrillic_e* = 0x000006DC - KEY_Cyrillic_shcha* = 0x000006DD - KEY_Cyrillic_che* = 0x000006DE - KEY_Cyrillic_hardsign* = 0x000006DF - KEY_Cyrillic_CAPITAL_YU* = 0x000006E0 - KEY_Cyrillic_CAPITAL_A* = 0x000006E1 - KEY_Cyrillic_CAPITAL_BE* = 0x000006E2 - KEY_Cyrillic_CAPITAL_TSE* = 0x000006E3 - KEY_Cyrillic_CAPITAL_DE* = 0x000006E4 - KEY_Cyrillic_CAPITAL_IE* = 0x000006E5 - KEY_Cyrillic_CAPITAL_EF* = 0x000006E6 - KEY_Cyrillic_CAPITAL_GHE* = 0x000006E7 - KEY_Cyrillic_CAPITAL_HA* = 0x000006E8 - KEY_Cyrillic_CAPITAL_I* = 0x000006E9 - KEY_Cyrillic_CAPITAL_SHORTI* = 0x000006EA - KEY_Cyrillic_CAPITAL_KA* = 0x000006EB - KEY_Cyrillic_CAPITAL_EL* = 0x000006EC - KEY_Cyrillic_CAPITAL_EM* = 0x000006ED - KEY_Cyrillic_CAPITAL_EN* = 0x000006EE - KEY_Cyrillic_CAPITAL_O* = 0x000006EF - KEY_Cyrillic_CAPITAL_PE* = 0x000006F0 - KEY_Cyrillic_CAPITAL_YA* = 0x000006F1 - KEY_Cyrillic_CAPITAL_ER* = 0x000006F2 - KEY_Cyrillic_CAPITAL_ES* = 0x000006F3 - KEY_Cyrillic_CAPITAL_TE* = 0x000006F4 - KEY_Cyrillic_CAPITAL_U* = 0x000006F5 - KEY_Cyrillic_CAPITAL_ZHE* = 0x000006F6 - KEY_Cyrillic_CAPITAL_VE* = 0x000006F7 - KEY_Cyrillic_CAPITAL_SOFTSIGN* = 0x000006F8 - KEY_Cyrillic_CAPITAL_YERU* = 0x000006F9 - KEY_Cyrillic_CAPITAL_ZE* = 0x000006FA - KEY_Cyrillic_CAPITAL_SHA* = 0x000006FB - KEY_Cyrillic_CAPITAL_E* = 0x000006FC - KEY_Cyrillic_CAPITAL_SHCHA* = 0x000006FD - KEY_Cyrillic_CAPITAL_CHE* = 0x000006FE - KEY_Cyrillic_CAPITAL_HARDSIGN* = 0x000006FF - KEY_Greek_CAPITAL_ALPHAaccent* = 0x000007A1 - KEY_Greek_CAPITAL_EPSILONaccent* = 0x000007A2 - KEY_Greek_CAPITAL_ETAaccent* = 0x000007A3 - KEY_Greek_CAPITAL_IOTAaccent* = 0x000007A4 - KEY_Greek_CAPITAL_IOTAdiaeresis* = 0x000007A5 - KEY_Greek_CAPITAL_OMICRONaccent* = 0x000007A7 - KEY_Greek_CAPITAL_UPSILONaccent* = 0x000007A8 - KEY_Greek_CAPITAL_UPSILONdieresis* = 0x000007A9 - KEY_Greek_CAPITAL_OMEGAaccent* = 0x000007AB - KEY_Greek_accentdieresis* = 0x000007AE - KEY_Greek_horizbar* = 0x000007AF - KEY_Greek_alphaaccent* = 0x000007B1 - KEY_Greek_epsilonaccent* = 0x000007B2 - KEY_Greek_etaaccent* = 0x000007B3 - KEY_Greek_iotaaccent* = 0x000007B4 - KEY_Greek_iotadieresis* = 0x000007B5 - KEY_Greek_iotaaccentdieresis* = 0x000007B6 - KEY_Greek_omicronaccent* = 0x000007B7 - KEY_Greek_upsilonaccent* = 0x000007B8 - KEY_Greek_upsilondieresis* = 0x000007B9 - KEY_Greek_upsilonaccentdieresis* = 0x000007BA - KEY_Greek_omegaaccent* = 0x000007BB - KEY_Greek_CAPITAL_ALPHA* = 0x000007C1 - KEY_Greek_CAPITAL_BETA* = 0x000007C2 - KEY_Greek_CAPITAL_GAMMA* = 0x000007C3 - KEY_Greek_CAPITAL_DELTA* = 0x000007C4 - KEY_Greek_CAPITAL_EPSILON* = 0x000007C5 - KEY_Greek_CAPITAL_ZETA* = 0x000007C6 - KEY_Greek_CAPITAL_ETA* = 0x000007C7 - KEY_Greek_CAPITAL_THETA* = 0x000007C8 - KEY_Greek_CAPITAL_IOTA* = 0x000007C9 - KEY_Greek_CAPITAL_KAPPA* = 0x000007CA - KEY_Greek_CAPITAL_LAMDA* = 0x000007CB - KEY_Greek_CAPITAL_LAMBDA* = 0x000007CB - KEY_Greek_CAPITAL_MU* = 0x000007CC - KEY_Greek_CAPITAL_NU* = 0x000007CD - KEY_Greek_CAPITAL_XI* = 0x000007CE - KEY_Greek_CAPITAL_OMICRON* = 0x000007CF - KEY_Greek_CAPITAL_PI* = 0x000007D0 - KEY_Greek_CAPITAL_RHO* = 0x000007D1 - KEY_Greek_CAPITAL_SIGMA* = 0x000007D2 - KEY_Greek_CAPITAL_TAU* = 0x000007D4 - KEY_Greek_CAPITAL_UPSILON* = 0x000007D5 - KEY_Greek_CAPITAL_PHI* = 0x000007D6 - KEY_Greek_CAPITAL_CHI* = 0x000007D7 - KEY_Greek_CAPITAL_PSI* = 0x000007D8 - KEY_Greek_CAPITAL_OMEGA* = 0x000007D9 - KEY_Greek_alpha* = 0x000007E1 - KEY_Greek_beta* = 0x000007E2 - KEY_Greek_gamma* = 0x000007E3 - KEY_Greek_delta* = 0x000007E4 - KEY_Greek_epsilon* = 0x000007E5 - KEY_Greek_zeta* = 0x000007E6 - KEY_Greek_eta* = 0x000007E7 - KEY_Greek_theta* = 0x000007E8 - KEY_Greek_iota* = 0x000007E9 - KEY_Greek_kappa* = 0x000007EA - KEY_Greek_lamda* = 0x000007EB - KEY_Greek_lambda* = 0x000007EB - KEY_Greek_mu* = 0x000007EC - KEY_Greek_nu* = 0x000007ED - KEY_Greek_xi* = 0x000007EE - KEY_Greek_omicron* = 0x000007EF - KEY_Greek_pi* = 0x000007F0 - KEY_Greek_rho* = 0x000007F1 - KEY_Greek_sigma* = 0x000007F2 - KEY_Greek_finalsmallsigma* = 0x000007F3 - KEY_Greek_tau* = 0x000007F4 - KEY_Greek_upsilon* = 0x000007F5 - KEY_Greek_phi* = 0x000007F6 - KEY_Greek_chi* = 0x000007F7 - KEY_Greek_psi* = 0x000007F8 - KEY_Greek_omega* = 0x000007F9 - KEY_Greek_switch* = 0x0000FF7E - KEY_leftradical* = 0x000008A1 - KEY_topleftradical* = 0x000008A2 - KEY_horizconnector* = 0x000008A3 - KEY_topintegral* = 0x000008A4 - KEY_botintegral* = 0x000008A5 - KEY_vertconnector* = 0x000008A6 - KEY_topleftsqbracket* = 0x000008A7 - KEY_botleftsqbracket* = 0x000008A8 - KEY_toprightsqbracket* = 0x000008A9 - KEY_botrightsqbracket* = 0x000008AA - KEY_topleftparens* = 0x000008AB - KEY_botleftparens* = 0x000008AC - KEY_toprightparens* = 0x000008AD - KEY_botrightparens* = 0x000008AE - KEY_leftmiddlecurlybrace* = 0x000008AF - KEY_rightmiddlecurlybrace* = 0x000008B0 - KEY_topleftsummation* = 0x000008B1 - KEY_botleftsummation* = 0x000008B2 - KEY_topvertsummationconnector* = 0x000008B3 - KEY_botvertsummationconnector* = 0x000008B4 - KEY_toprightsummation* = 0x000008B5 - KEY_botrightsummation* = 0x000008B6 - KEY_rightmiddlesummation* = 0x000008B7 - KEY_lessthanequal* = 0x000008BC - KEY_notequal* = 0x000008BD - KEY_greaterthanequal* = 0x000008BE - KEY_integral* = 0x000008BF - KEY_therefore* = 0x000008C0 - KEY_variation* = 0x000008C1 - KEY_infinity* = 0x000008C2 - KEY_nabla* = 0x000008C5 - KEY_approximate* = 0x000008C8 - KEY_similarequal* = 0x000008C9 - KEY_ifonlyif* = 0x000008CD - KEY_implies* = 0x000008CE - KEY_identical* = 0x000008CF - KEY_radical* = 0x000008D6 - KEY_includedin* = 0x000008DA - KEY_includes* = 0x000008DB - KEY_intersection* = 0x000008DC - KEY_union* = 0x000008DD - KEY_logicaland* = 0x000008DE - KEY_logicalor* = 0x000008DF - KEY_partialderivative* = 0x000008EF - KEY_function* = 0x000008F6 - KEY_leftarrow* = 0x000008FB - KEY_uparrow* = 0x000008FC - KEY_rightarrow* = 0x000008FD - KEY_downarrow* = 0x000008FE - KEY_blank* = 0x000009DF - KEY_soliddiamond* = 0x000009E0 - KEY_checkerboard* = 0x000009E1 - KEY_ht* = 0x000009E2 - KEY_ff* = 0x000009E3 - KEY_cr* = 0x000009E4 - KEY_lf* = 0x000009E5 - KEY_nl* = 0x000009E8 - KEY_vt* = 0x000009E9 - KEY_lowrightcorner* = 0x000009EA - KEY_uprightcorner* = 0x000009EB - KEY_upleftcorner* = 0x000009EC - KEY_lowleftcorner* = 0x000009ED - KEY_crossinglines* = 0x000009EE - KEY_horizlinescan1* = 0x000009EF - KEY_horizlinescan3* = 0x000009F0 - KEY_horizlinescan5* = 0x000009F1 - KEY_horizlinescan7* = 0x000009F2 - KEY_horizlinescan9* = 0x000009F3 - KEY_leftt* = 0x000009F4 - KEY_rightt* = 0x000009F5 - KEY_bott* = 0x000009F6 - KEY_topt* = 0x000009F7 - KEY_vertbar* = 0x000009F8 - KEY_emspace* = 0x00000AA1 - KEY_enspace* = 0x00000AA2 - KEY_em3space* = 0x00000AA3 - KEY_em4space* = 0x00000AA4 - KEY_digitspace* = 0x00000AA5 - KEY_punctspace* = 0x00000AA6 - KEY_thinspace* = 0x00000AA7 - KEY_hairspace* = 0x00000AA8 - KEY_emdash* = 0x00000AA9 - KEY_endash* = 0x00000AAA - KEY_signifblank* = 0x00000AAC - KEY_ellipsis* = 0x00000AAE - KEY_doubbaselinedot* = 0x00000AAF - KEY_onethird* = 0x00000AB0 - KEY_twothirds* = 0x00000AB1 - KEY_onefifth* = 0x00000AB2 - KEY_twofifths* = 0x00000AB3 - KEY_threefifths* = 0x00000AB4 - KEY_fourfifths* = 0x00000AB5 - KEY_onesixth* = 0x00000AB6 - KEY_fivesixths* = 0x00000AB7 - KEY_careof* = 0x00000AB8 - KEY_figdash* = 0x00000ABB - KEY_leftanglebracket* = 0x00000ABC - KEY_decimalpoint* = 0x00000ABD - KEY_rightanglebracket* = 0x00000ABE - KEY_marker* = 0x00000ABF - KEY_oneeighth* = 0x00000AC3 - KEY_threeeighths* = 0x00000AC4 - KEY_fiveeighths* = 0x00000AC5 - KEY_seveneighths* = 0x00000AC6 - KEY_trademark* = 0x00000AC9 - KEY_signaturemark* = 0x00000ACA - KEY_trademarkincircle* = 0x00000ACB - KEY_leftopentriangle* = 0x00000ACC - KEY_rightopentriangle* = 0x00000ACD - KEY_emopencircle* = 0x00000ACE - KEY_emopenrectangle* = 0x00000ACF - KEY_leftsinglequotemark* = 0x00000AD0 - KEY_rightsinglequotemark* = 0x00000AD1 - KEY_leftdoublequotemark* = 0x00000AD2 - KEY_rightdoublequotemark* = 0x00000AD3 - KEY_prescription* = 0x00000AD4 - KEY_minutes* = 0x00000AD6 - KEY_seconds* = 0x00000AD7 - KEY_latincross* = 0x00000AD9 - KEY_hexagram* = 0x00000ADA - KEY_filledrectbullet* = 0x00000ADB - KEY_filledlefttribullet* = 0x00000ADC - KEY_filledrighttribullet* = 0x00000ADD - KEY_emfilledcircle* = 0x00000ADE - KEY_emfilledrect* = 0x00000ADF - KEY_enopencircbullet* = 0x00000AE0 - KEY_enopensquarebullet* = 0x00000AE1 - KEY_openrectbullet* = 0x00000AE2 - KEY_opentribulletup* = 0x00000AE3 - KEY_opentribulletdown* = 0x00000AE4 - KEY_openstar* = 0x00000AE5 - KEY_enfilledcircbullet* = 0x00000AE6 - KEY_enfilledsqbullet* = 0x00000AE7 - KEY_filledtribulletup* = 0x00000AE8 - KEY_filledtribulletdown* = 0x00000AE9 - KEY_leftpointer* = 0x00000AEA - KEY_rightpointer* = 0x00000AEB - KEY_club* = 0x00000AEC - KEY_diamond* = 0x00000AED - KEY_heart* = 0x00000AEE - KEY_maltesecross* = 0x00000AF0 - KEY_dagger* = 0x00000AF1 - KEY_doubledagger* = 0x00000AF2 - KEY_checkmark* = 0x00000AF3 - KEY_ballotcross* = 0x00000AF4 - KEY_musicalsharp* = 0x00000AF5 - KEY_musicalflat* = 0x00000AF6 - KEY_malesymbol* = 0x00000AF7 - KEY_femalesymbol* = 0x00000AF8 - KEY_telephone* = 0x00000AF9 - KEY_telephonerecorder* = 0x00000AFA - KEY_phonographcopyright* = 0x00000AFB - KEY_caret* = 0x00000AFC - KEY_singlelowquotemark* = 0x00000AFD - KEY_doublelowquotemark* = 0x00000AFE - KEY_cursor* = 0x00000AFF - KEY_leftcaret* = 0x00000BA3 - KEY_rightcaret* = 0x00000BA6 - KEY_downcaret* = 0x00000BA8 - KEY_upcaret* = 0x00000BA9 - KEY_overbar* = 0x00000BC0 - KEY_downtack* = 0x00000BC2 - KEY_upshoe* = 0x00000BC3 - KEY_downstile* = 0x00000BC4 - KEY_underbar* = 0x00000BC6 - KEY_jot* = 0x00000BCA - KEY_quad* = 0x00000BCC - KEY_uptack* = 0x00000BCE - KEY_circle* = 0x00000BCF - KEY_upstile* = 0x00000BD3 - KEY_downshoe* = 0x00000BD6 - KEY_rightshoe* = 0x00000BD8 - KEY_leftshoe* = 0x00000BDA - KEY_lefttack* = 0x00000BDC - KEY_righttack* = 0x00000BFC - KEY_hebrew_doublelowline* = 0x00000CDF - KEY_hebrew_aleph* = 0x00000CE0 - KEY_hebrew_bet* = 0x00000CE1 - KEY_hebrew_beth* = 0x00000CE1 - KEY_hebrew_gimel* = 0x00000CE2 - KEY_hebrew_gimmel* = 0x00000CE2 - KEY_hebrew_dalet* = 0x00000CE3 - KEY_hebrew_daleth* = 0x00000CE3 - KEY_hebrew_he* = 0x00000CE4 - KEY_hebrew_waw* = 0x00000CE5 - KEY_hebrew_zain* = 0x00000CE6 - KEY_hebrew_zayin* = 0x00000CE6 - KEY_hebrew_chet* = 0x00000CE7 - KEY_hebrew_het* = 0x00000CE7 - KEY_hebrew_tet* = 0x00000CE8 - KEY_hebrew_teth* = 0x00000CE8 - KEY_hebrew_yod* = 0x00000CE9 - KEY_hebrew_finalkaph* = 0x00000CEA - KEY_hebrew_kaph* = 0x00000CEB - KEY_hebrew_lamed* = 0x00000CEC - KEY_hebrew_finalmem* = 0x00000CED - KEY_hebrew_mem* = 0x00000CEE - KEY_hebrew_finalnun* = 0x00000CEF - KEY_hebrew_nun* = 0x00000CF0 - KEY_hebrew_samech* = 0x00000CF1 - KEY_hebrew_samekh* = 0x00000CF1 - KEY_hebrew_ayin* = 0x00000CF2 - KEY_hebrew_finalpe* = 0x00000CF3 - KEY_hebrew_pe* = 0x00000CF4 - KEY_hebrew_finalzade* = 0x00000CF5 - KEY_hebrew_finalzadi* = 0x00000CF5 - KEY_hebrew_zade* = 0x00000CF6 - KEY_hebrew_zadi* = 0x00000CF6 - KEY_hebrew_qoph* = 0x00000CF7 - KEY_hebrew_kuf* = 0x00000CF7 - KEY_hebrew_resh* = 0x00000CF8 - KEY_hebrew_shin* = 0x00000CF9 - KEY_hebrew_taw* = 0x00000CFA - KEY_hebrew_taf* = 0x00000CFA - KEY_Hebrew_switch* = 0x0000FF7E - KEY_Thai_kokai* = 0x00000DA1 - KEY_Thai_khokhai* = 0x00000DA2 - KEY_Thai_khokhuat* = 0x00000DA3 - KEY_Thai_khokhwai* = 0x00000DA4 - KEY_Thai_khokhon* = 0x00000DA5 - KEY_Thai_khorakhang* = 0x00000DA6 - KEY_Thai_ngongu* = 0x00000DA7 - KEY_Thai_chochan* = 0x00000DA8 - KEY_Thai_choching* = 0x00000DA9 - KEY_Thai_chochang* = 0x00000DAA - KEY_Thai_soso* = 0x00000DAB - KEY_Thai_chochoe* = 0x00000DAC - KEY_Thai_yoying* = 0x00000DAD - KEY_Thai_dochada* = 0x00000DAE - KEY_Thai_topatak* = 0x00000DAF - KEY_Thai_thothan* = 0x00000DB0 - KEY_Thai_thonangmontho* = 0x00000DB1 - KEY_Thai_thophuthao* = 0x00000DB2 - KEY_Thai_nonen* = 0x00000DB3 - KEY_Thai_dodek* = 0x00000DB4 - KEY_Thai_totao* = 0x00000DB5 - KEY_Thai_thothung* = 0x00000DB6 - KEY_Thai_thothahan* = 0x00000DB7 - KEY_Thai_thothong* = 0x00000DB8 - KEY_Thai_nonu* = 0x00000DB9 - KEY_Thai_bobaimai* = 0x00000DBA - KEY_Thai_popla* = 0x00000DBB - KEY_Thai_phophung* = 0x00000DBC - KEY_Thai_fofa* = 0x00000DBD - KEY_Thai_phophan* = 0x00000DBE - KEY_Thai_fofan* = 0x00000DBF - KEY_Thai_phosamphao* = 0x00000DC0 - KEY_Thai_moma* = 0x00000DC1 - KEY_Thai_yoyak* = 0x00000DC2 - KEY_Thai_rorua* = 0x00000DC3 - KEY_Thai_ru* = 0x00000DC4 - KEY_Thai_loling* = 0x00000DC5 - KEY_Thai_lu* = 0x00000DC6 - KEY_Thai_wowaen* = 0x00000DC7 - KEY_Thai_sosala* = 0x00000DC8 - KEY_Thai_sorusi* = 0x00000DC9 - KEY_Thai_sosua* = 0x00000DCA - KEY_Thai_hohip* = 0x00000DCB - KEY_Thai_lochula* = 0x00000DCC - KEY_Thai_oang* = 0x00000DCD - KEY_Thai_honokhuk* = 0x00000DCE - KEY_Thai_paiyannoi* = 0x00000DCF - KEY_Thai_saraa* = 0x00000DD0 - KEY_Thai_maihanakat* = 0x00000DD1 - KEY_Thai_saraaa* = 0x00000DD2 - KEY_Thai_saraam* = 0x00000DD3 - KEY_Thai_sarai* = 0x00000DD4 - KEY_Thai_saraii* = 0x00000DD5 - KEY_Thai_saraue* = 0x00000DD6 - KEY_Thai_sarauee* = 0x00000DD7 - KEY_Thai_sarau* = 0x00000DD8 - KEY_Thai_sarauu* = 0x00000DD9 - KEY_Thai_phinthu* = 0x00000DDA - KEY_Thai_maihanakat_maitho* = 0x00000DDE - KEY_Thai_baht* = 0x00000DDF - KEY_Thai_sarae* = 0x00000DE0 - KEY_Thai_saraae* = 0x00000DE1 - KEY_Thai_sarao* = 0x00000DE2 - KEY_Thai_saraaimaimuan* = 0x00000DE3 - KEY_Thai_saraaimaimalai* = 0x00000DE4 - KEY_Thai_lakkhangyao* = 0x00000DE5 - KEY_Thai_maiyamok* = 0x00000DE6 - KEY_Thai_maitaikhu* = 0x00000DE7 - KEY_Thai_maiek* = 0x00000DE8 - KEY_Thai_maitho* = 0x00000DE9 - KEY_Thai_maitri* = 0x00000DEA - KEY_Thai_maichattawa* = 0x00000DEB - KEY_Thai_thanthakhat* = 0x00000DEC - KEY_Thai_nikhahit* = 0x00000DED - KEY_Thai_leksun* = 0x00000DF0 - KEY_Thai_leknung* = 0x00000DF1 - KEY_Thai_leksong* = 0x00000DF2 - KEY_Thai_leksam* = 0x00000DF3 - KEY_Thai_leksi* = 0x00000DF4 - KEY_Thai_lekha* = 0x00000DF5 - KEY_Thai_lekhok* = 0x00000DF6 - KEY_Thai_lekchet* = 0x00000DF7 - KEY_Thai_lekpaet* = 0x00000DF8 - KEY_Thai_lekkao* = 0x00000DF9 - KEY_Hangul* = 0x0000FF31 - KEY_Hangul_Start* = 0x0000FF32 - KEY_Hangul_End* = 0x0000FF33 - KEY_Hangul_Hanja* = 0x0000FF34 - KEY_Hangul_Jamo* = 0x0000FF35 - KEY_Hangul_Romaja* = 0x0000FF36 - KEY_Hangul_Codeinput* = 0x0000FF37 - KEY_Hangul_Jeonja* = 0x0000FF38 - KEY_Hangul_Banja* = 0x0000FF39 - KEY_Hangul_PreHanja* = 0x0000FF3A - KEY_Hangul_PostHanja* = 0x0000FF3B - KEY_Hangul_SingleCandidate* = 0x0000FF3C - KEY_Hangul_MultipleCandidate* = 0x0000FF3D - KEY_Hangul_PreviousCandidate* = 0x0000FF3E - KEY_Hangul_Special* = 0x0000FF3F - KEY_Hangul_switch* = 0x0000FF7E - KEY_Hangul_Kiyeog* = 0x00000EA1 - KEY_Hangul_SsangKiyeog* = 0x00000EA2 - KEY_Hangul_KiyeogSios* = 0x00000EA3 - KEY_Hangul_Nieun* = 0x00000EA4 - KEY_Hangul_NieunJieuj* = 0x00000EA5 - KEY_Hangul_NieunHieuh* = 0x00000EA6 - KEY_Hangul_Dikeud* = 0x00000EA7 - KEY_Hangul_SsangDikeud* = 0x00000EA8 - KEY_Hangul_Rieul* = 0x00000EA9 - KEY_Hangul_RieulKiyeog* = 0x00000EAA - KEY_Hangul_RieulMieum* = 0x00000EAB - KEY_Hangul_RieulPieub* = 0x00000EAC - KEY_Hangul_RieulSios* = 0x00000EAD - KEY_Hangul_RieulTieut* = 0x00000EAE - KEY_Hangul_RieulPhieuf* = 0x00000EAF - KEY_Hangul_RieulHieuh* = 0x00000EB0 - KEY_Hangul_Mieum* = 0x00000EB1 - KEY_Hangul_Pieub* = 0x00000EB2 - KEY_Hangul_SsangPieub* = 0x00000EB3 - KEY_Hangul_PieubSios* = 0x00000EB4 - KEY_Hangul_Sios* = 0x00000EB5 - KEY_Hangul_SsangSios* = 0x00000EB6 - KEY_Hangul_Ieung* = 0x00000EB7 - KEY_Hangul_Jieuj* = 0x00000EB8 - KEY_Hangul_SsangJieuj* = 0x00000EB9 - KEY_Hangul_Cieuc* = 0x00000EBA - KEY_Hangul_Khieuq* = 0x00000EBB - KEY_Hangul_Tieut* = 0x00000EBC - KEY_Hangul_Phieuf* = 0x00000EBD - KEY_Hangul_Hieuh* = 0x00000EBE - KEY_Hangul_A* = 0x00000EBF - KEY_Hangul_AE* = 0x00000EC0 - KEY_Hangul_YA* = 0x00000EC1 - KEY_Hangul_YAE* = 0x00000EC2 - KEY_Hangul_EO* = 0x00000EC3 - KEY_Hangul_E* = 0x00000EC4 - KEY_Hangul_YEO* = 0x00000EC5 - KEY_Hangul_YE* = 0x00000EC6 - KEY_Hangul_O* = 0x00000EC7 - KEY_Hangul_WA* = 0x00000EC8 - KEY_Hangul_WAE* = 0x00000EC9 - KEY_Hangul_OE* = 0x00000ECA - KEY_Hangul_YO* = 0x00000ECB - KEY_Hangul_U* = 0x00000ECC - KEY_Hangul_WEO* = 0x00000ECD - KEY_Hangul_WE* = 0x00000ECE - KEY_Hangul_WI* = 0x00000ECF - KEY_Hangul_YU* = 0x00000ED0 - KEY_Hangul_EU* = 0x00000ED1 - KEY_Hangul_YI* = 0x00000ED2 - KEY_Hangul_I* = 0x00000ED3 - KEY_Hangul_J_Kiyeog* = 0x00000ED4 - KEY_Hangul_J_SsangKiyeog* = 0x00000ED5 - KEY_Hangul_J_KiyeogSios* = 0x00000ED6 - KEY_Hangul_J_Nieun* = 0x00000ED7 - KEY_Hangul_J_NieunJieuj* = 0x00000ED8 - KEY_Hangul_J_NieunHieuh* = 0x00000ED9 - KEY_Hangul_J_Dikeud* = 0x00000EDA - KEY_Hangul_J_Rieul* = 0x00000EDB - KEY_Hangul_J_RieulKiyeog* = 0x00000EDC - KEY_Hangul_J_RieulMieum* = 0x00000EDD - KEY_Hangul_J_RieulPieub* = 0x00000EDE - KEY_Hangul_J_RieulSios* = 0x00000EDF - KEY_Hangul_J_RieulTieut* = 0x00000EE0 - KEY_Hangul_J_RieulPhieuf* = 0x00000EE1 - KEY_Hangul_J_RieulHieuh* = 0x00000EE2 - KEY_Hangul_J_Mieum* = 0x00000EE3 - KEY_Hangul_J_Pieub* = 0x00000EE4 - KEY_Hangul_J_PieubSios* = 0x00000EE5 - KEY_Hangul_J_Sios* = 0x00000EE6 - KEY_Hangul_J_SsangSios* = 0x00000EE7 - KEY_Hangul_J_Ieung* = 0x00000EE8 - KEY_Hangul_J_Jieuj* = 0x00000EE9 - KEY_Hangul_J_Cieuc* = 0x00000EEA - KEY_Hangul_J_Khieuq* = 0x00000EEB - KEY_Hangul_J_Tieut* = 0x00000EEC - KEY_Hangul_J_Phieuf* = 0x00000EED - KEY_Hangul_J_Hieuh* = 0x00000EEE - KEY_Hangul_RieulYeorinHieuh* = 0x00000EEF - KEY_Hangul_SunkyeongeumMieum* = 0x00000EF0 - KEY_Hangul_SunkyeongeumPieub* = 0x00000EF1 - KEY_Hangul_PanSios* = 0x00000EF2 - KEY_Hangul_KkogjiDalrinIeung* = 0x00000EF3 - KEY_Hangul_SunkyeongeumPhieuf* = 0x00000EF4 - KEY_Hangul_YeorinHieuh* = 0x00000EF5 - KEY_Hangul_AraeA* = 0x00000EF6 - KEY_Hangul_AraeAE* = 0x00000EF7 - KEY_Hangul_J_PanSios* = 0x00000EF8 - KEY_Hangul_J_KkogjiDalrinIeung* = 0x00000EF9 - KEY_Hangul_J_YeorinHieuh* = 0x00000EFA - KEY_Korean_Won* = 0x00000EFF - KEY_EcuSign* = 0x000020A0 - KEY_ColonSign* = 0x000020A1 - KEY_CruzeiroSign* = 0x000020A2 - KEY_FFrancSign* = 0x000020A3 - KEY_LiraSign* = 0x000020A4 - KEY_MillSign* = 0x000020A5 - KEY_NairaSign* = 0x000020A6 - KEY_PesetaSign* = 0x000020A7 - KEY_RupeeSign* = 0x000020A8 - KEY_WonSign* = 0x000020A9 - KEY_NewSheqelSign* = 0x000020AA - KEY_DongSign* = 0x000020AB - KEY_EuroSign* = 0x000020AC - -proc pango_context_get_for_screen*(screen: PScreen): PContext{.cdecl, - dynlib: lib, importc: "gdk_pango_context_get_for_screen".} -proc pango_context_set_colormap*(context: PContext, colormap: PColormap){. - cdecl, dynlib: lib, importc: "gdk_pango_context_set_colormap".} -proc pango_layout_line_get_clip_region*(line: PLayoutLine, x_origin: gint, - y_origin: gint, index_ranges: Pgint, - n_ranges: gint): PRegion{.cdecl, - dynlib: lib, importc: "gdk_pango_layout_line_get_clip_region".} -proc pango_layout_get_clip_region*(layout: PLayout, x_origin: gint, - y_origin: gint, index_ranges: Pgint, - n_ranges: gint): PRegion{.cdecl, dynlib: lib, - importc: "gdk_pango_layout_get_clip_region".} -proc pango_attr_stipple_new*(stipple: PBitmap): PAttribute{.cdecl, - dynlib: lib, importc: "gdk_pango_attr_stipple_new".} -proc pango_attr_embossed_new*(embossed: gboolean): PAttribute{.cdecl, - dynlib: lib, importc: "gdk_pango_attr_embossed_new".} -proc render_threshold_alpha*(pixbuf: PPixbuf, bitmap: PBitmap, - src_x: int32, src_y: int32, dest_x: int32, - dest_y: int32, width: int32, height: int32, - alpha_threshold: int32){.cdecl, dynlib: lib, - importc: "gdk_pixbuf_render_threshold_alpha".} -proc render_to_drawable*(pixbuf: PPixbuf, drawable: PDrawable, gc: PGC, - src_x: int32, src_y: int32, dest_x: int32, - dest_y: int32, width: int32, height: int32, - dither: TRgbDither, x_dither: int32, - y_dither: int32){.cdecl, dynlib: lib, - importc: "gdk_pixbuf_render_to_drawable".} -proc render_to_drawable_alpha*(pixbuf: PPixbuf, drawable: PDrawable, - src_x: int32, src_y: int32, dest_x: int32, - dest_y: int32, width: int32, - height: int32, - alpha_mode: TPixbufAlphaMode, - alpha_threshold: int32, - dither: TRgbDither, x_dither: int32, - y_dither: int32){.cdecl, dynlib: lib, - importc: "gdk_pixbuf_render_to_drawable_alpha".} -proc render_pixmap_and_mask_for_colormap*(pixbuf: PPixbuf, - colormap: PColormap, n: var PPixmap, nasdfdsafw4e: var PBitmap, - alpha_threshold: int32){.cdecl, dynlib: lib, importc: "gdk_pixbuf_render_pixmap_and_mask_for_colormap".} -proc get_from_drawable*(dest: PPixbuf, src: PDrawable, cmap: PColormap, - src_x: int32, src_y: int32, dest_x: int32, - dest_y: int32, width: int32, height: int32): PPixbuf{. - cdecl, dynlib: lib, importc: "gdk_pixbuf_get_from_drawable".} -proc get_from_image*(dest: PPixbuf, src: PImage, cmap: PColormap, - src_x: int32, src_y: int32, dest_x: int32, - dest_y: int32, width: int32, height: int32): PPixbuf{. - cdecl, dynlib: lib, importc: "gdk_pixbuf_get_from_image".} -proc TYPE_PIXMAP*(): GType -proc PIXMAP*(anObject: Pointer): PPixmap -proc PIXMAP_CLASS*(klass: Pointer): PPixmapObjectClass -proc IS_PIXMAP*(anObject: Pointer): bool -proc IS_PIXMAP_CLASS*(klass: Pointer): bool -proc PIXMAP_GET_CLASS*(obj: Pointer): PPixmapObjectClass -proc PIXMAP_OBJECT*(anObject: Pointer): PPixmapObject -proc pixmap_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_pixmap_get_type".} -proc pixmap_new*(window: PWindow, width: gint, height: gint, depth: gint): PPixmap{. - cdecl, dynlib: lib, importc: "gdk_pixmap_new".} -proc bitmap_create_from_data*(window: PWindow, data: cstring, width: gint, - height: gint): PBitmap{.cdecl, dynlib: lib, - importc: "gdk_bitmap_create_from_data".} -proc pixmap_create_from_data*(window: PWindow, data: cstring, width: gint, - height: gint, depth: gint, fg: PColor, bg: PColor): PPixmap{. - cdecl, dynlib: lib, importc: "gdk_pixmap_create_from_data".} -proc pixmap_create_from_xpm*(window: PWindow, k: var PBitmap, - transparent_color: PColor, filename: cstring): PPixmap{. - cdecl, dynlib: lib, importc: "gdk_pixmap_create_from_xpm".} -proc pixmap_colormap_create_from_xpm*(window: PWindow, colormap: PColormap, - k: var PBitmap, transparent_color: PColor, - filename: cstring): PPixmap{.cdecl, - dynlib: lib, importc: "gdk_pixmap_colormap_create_from_xpm".} -proc pixmap_create_from_xpm_d*(window: PWindow, k: var PBitmap, - transparent_color: PColor, data: PPgchar): PPixmap{. - cdecl, dynlib: lib, importc: "gdk_pixmap_create_from_xpm_d".} -proc pixmap_colormap_create_from_xpm_d*(window: PWindow, colormap: PColormap, - k: var PBitmap, - transparent_color: PColor, data: PPgchar): PPixmap{. - cdecl, dynlib: lib, importc: "gdk_pixmap_colormap_create_from_xpm_d".} -proc pixmap_foreign_new_for_display*(display: PDisplay, anid: TNativeWindow): PPixmap{. - cdecl, dynlib: lib, importc: "gdk_pixmap_foreign_new_for_display".} -proc pixmap_lookup_for_display*(display: PDisplay, anid: TNativeWindow): PPixmap{. - cdecl, dynlib: lib, importc: "gdk_pixmap_lookup_for_display".} -proc atom_intern*(atom_name: cstring, only_if_exists: gboolean): TAtom{.cdecl, - dynlib: lib, importc: "gdk_atom_intern".} -proc atom_name*(atom: TAtom): cstring{.cdecl, dynlib: lib, - importc: "gdk_atom_name".} -proc property_get*(window: PWindow, `property`: TAtom, `type`: TAtom, - offset: gulong, length: gulong, pdelete: gint, - actual_property_type: PAtom, actual_format: Pgint, - actual_length: Pgint, data: PPguchar): gboolean{.cdecl, - dynlib: lib, importc: "gdk_property_get".} -proc property_change*(window: PWindow, `property`: TAtom, `type`: TAtom, - format: gint, mode: TPropMode, data: Pguchar, - nelements: gint){.cdecl, dynlib: lib, - importc: "gdk_property_change".} -proc property_delete*(window: PWindow, `property`: TAtom){.cdecl, dynlib: lib, - importc: "gdk_property_delete".} -proc text_property_to_text_list_for_display*(display: PDisplay, encoding: TAtom, - format: gint, text: Pguchar, length: gint, t: var PPgchar): gint{.cdecl, - dynlib: lib, importc: "gdk_text_property_to_text_list_for_display".} -proc text_property_to_utf8_list_for_display*(display: PDisplay, encoding: TAtom, - format: gint, text: Pguchar, length: gint, t: var PPgchar): gint{.cdecl, - dynlib: lib, importc: "gdk_text_property_to_utf8_list_for_display".} -proc utf8_to_string_target*(str: cstring): cstring{.cdecl, dynlib: lib, - importc: "gdk_utf8_to_string_target".} -proc string_to_compound_text_for_display*(display: PDisplay, str: cstring, - encoding: PAtom, format: Pgint, ctext: PPguchar, length: Pgint): gint{. - cdecl, dynlib: lib, importc: "gdk_string_to_compound_text_for_display".} -proc utf8_to_compound_text_for_display*(display: PDisplay, str: cstring, - encoding: PAtom, format: Pgint, - ctext: PPguchar, length: Pgint): gboolean{. - cdecl, dynlib: lib, importc: "gdk_utf8_to_compound_text_for_display".} -proc free_text_list*(list: PPgchar){.cdecl, dynlib: lib, - importc: "gdk_free_text_list".} -proc free_compound_text*(ctext: Pguchar){.cdecl, dynlib: lib, - importc: "gdk_free_compound_text".} -proc region_new*(): PRegion{.cdecl, dynlib: lib, importc: "gdk_region_new".} -proc region_polygon*(points: PPoint, npoints: gint, fill_rule: TFillRule): PRegion{. - cdecl, dynlib: lib, importc: "gdk_region_polygon".} -proc copy*(region: PRegion): PRegion{.cdecl, dynlib: lib, - importc: "gdk_region_copy".} -proc region_rectangle*(rectangle: PRectangle): PRegion{.cdecl, dynlib: lib, - importc: "gdk_region_rectangle".} -proc destroy*(region: PRegion){.cdecl, dynlib: lib, - importc: "gdk_region_destroy".} -proc get_clipbox*(region: PRegion, rectangle: PRectangle){.cdecl, - dynlib: lib, importc: "gdk_region_get_clipbox".} -proc get_rectangles*(region: PRegion, s: var PRectangle, - n_rectangles: Pgint){.cdecl, dynlib: lib, - importc: "gdk_region_get_rectangles".} -proc empty*(region: PRegion): gboolean{.cdecl, dynlib: lib, - importc: "gdk_region_empty".} -proc equal*(region1: PRegion, region2: PRegion): gboolean{.cdecl, - dynlib: lib, importc: "gdk_region_equal".} -proc point_in*(region: PRegion, x: int32, y: int32): gboolean{.cdecl, - dynlib: lib, importc: "gdk_region_point_in".} -proc rect_in*(region: PRegion, rect: PRectangle): TOverlapType{.cdecl, - dynlib: lib, importc: "gdk_region_rect_in".} -proc offset*(region: PRegion, dx: gint, dy: gint){.cdecl, dynlib: lib, - importc: "gdk_region_offset".} -proc shrink*(region: PRegion, dx: gint, dy: gint){.cdecl, dynlib: lib, - importc: "gdk_region_shrink".} -proc union*(region: PRegion, rect: PRectangle){.cdecl, - dynlib: lib, importc: "gdk_region_union_with_rect".} -proc intersect*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib, - importc: "gdk_region_intersect".} -proc union*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib, - importc: "gdk_region_union".} -proc subtract*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib, - importc: "gdk_region_subtract".} -proc `xor`*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib, - importc: "gdk_region_xor".} -proc spans_intersect_foreach*(region: PRegion, spans: PSpan, - n_spans: int32, sorted: gboolean, - `function`: TSpanFunc, data: gpointer){. - cdecl, dynlib: lib, importc: "gdk_region_spans_intersect_foreach".} -proc rgb_find_color*(colormap: PColormap, color: PColor){.cdecl, dynlib: lib, - importc: "gdk_rgb_find_color".} -proc rgb_image*(drawable: PDrawable, gc: PGC, x: gint, y: gint, - width: gint, height: gint, dith: TRgbDither, - rgb_buf: Pguchar, rowstride: gint){.cdecl, dynlib: lib, - importc: "gdk_draw_rgb_image".} -proc rgb_image_dithalign*(drawable: PDrawable, gc: PGC, x: gint, y: gint, - width: gint, height: gint, dith: TRgbDither, - rgb_buf: Pguchar, rowstride: gint, xdith: gint, - ydith: gint){.cdecl, dynlib: lib, - importc: "gdk_draw_rgb_image_dithalign".} -proc rgb_32_image*(drawable: PDrawable, gc: PGC, x: gint, y: gint, - width: gint, height: gint, dith: TRgbDither, - buf: Pguchar, rowstride: gint){.cdecl, dynlib: lib, - importc: "gdk_draw_rgb_32_image".} -proc rgb_32_image_dithalign*(drawable: PDrawable, gc: PGC, x: gint, - y: gint, width: gint, height: gint, - dith: TRgbDither, buf: Pguchar, - rowstride: gint, xdith: gint, ydith: gint){. - cdecl, dynlib: lib, importc: "gdk_draw_rgb_32_image_dithalign".} -proc gray_image*(drawable: PDrawable, gc: PGC, x: gint, y: gint, - width: gint, height: gint, dith: TRgbDither, buf: Pguchar, - rowstride: gint){.cdecl, dynlib: lib, - importc: "gdk_draw_gray_image".} -proc indexed_image*(drawable: PDrawable, gc: PGC, x: gint, y: gint, - width: gint, height: gint, dith: TRgbDither, - buf: Pguchar, rowstride: gint, cmap: PRgbCmap){.cdecl, - dynlib: lib, importc: "gdk_draw_indexed_image".} -proc rgb_cmap_new*(colors: Pguint32, n_colors: gint): PRgbCmap{.cdecl, - dynlib: lib, importc: "gdk_rgb_cmap_new".} -proc free*(cmap: PRgbCmap){.cdecl, dynlib: lib, - importc: "gdk_rgb_cmap_free".} -proc rgb_set_verbose*(verbose: gboolean){.cdecl, dynlib: lib, - importc: "gdk_rgb_set_verbose".} -proc rgb_set_install*(install: gboolean){.cdecl, dynlib: lib, - importc: "gdk_rgb_set_install".} -proc rgb_set_min_colors*(min_colors: gint){.cdecl, dynlib: lib, - importc: "gdk_rgb_set_min_colors".} -proc TYPE_DISPLAY*(): GType -proc DISPLAY_OBJECT*(anObject: pointer): PDisplay -proc DISPLAY_CLASS*(klass: pointer): PDisplayClass -proc IS_DISPLAY*(anObject: pointer): bool -proc IS_DISPLAY_CLASS*(klass: pointer): bool -proc DISPLAY_GET_CLASS*(obj: pointer): PDisplayClass -proc display_open*(display_name: cstring): PDisplay{.cdecl, dynlib: lib, - importc: "gdk_display_open".} -proc get_name*(display: PDisplay): cstring{.cdecl, dynlib: lib, - importc: "gdk_display_get_name".} -proc get_n_screens*(display: PDisplay): gint{.cdecl, dynlib: lib, - importc: "gdk_display_get_n_screens".} -proc get_screen*(display: PDisplay, screen_num: gint): PScreen{.cdecl, - dynlib: lib, importc: "gdk_display_get_screen".} -proc get_default_screen*(display: PDisplay): PScreen{.cdecl, - dynlib: lib, importc: "gdk_display_get_default_screen".} -proc pointer_ungrab*(display: PDisplay, time: guint32){.cdecl, - dynlib: lib, importc: "gdk_display_pointer_ungrab".} -proc keyboard_ungrab*(display: PDisplay, time: guint32){.cdecl, - dynlib: lib, importc: "gdk_display_keyboard_ungrab".} -proc pointer_is_grabbed*(display: PDisplay): gboolean{.cdecl, - dynlib: lib, importc: "gdk_display_pointer_is_grabbed".} -proc beep*(display: PDisplay){.cdecl, dynlib: lib, - importc: "gdk_display_beep".} -proc sync*(display: PDisplay){.cdecl, dynlib: lib, - importc: "gdk_display_sync".} -proc close*(display: PDisplay){.cdecl, dynlib: lib, - importc: "gdk_display_close".} -proc list_devices*(display: PDisplay): PGList{.cdecl, dynlib: lib, - importc: "gdk_display_list_devices".} -proc get_event*(display: PDisplay): PEvent{.cdecl, dynlib: lib, - importc: "gdk_display_get_event".} -proc peek_event*(display: PDisplay): PEvent{.cdecl, dynlib: lib, - importc: "gdk_display_peek_event".} -proc put_event*(display: PDisplay, event: PEvent){.cdecl, dynlib: lib, - importc: "gdk_display_put_event".} -proc add_client_message_filter*(display: PDisplay, message_type: TAtom, - func: TFilterFunc, data: gpointer){. - cdecl, dynlib: lib, importc: "gdk_display_add_client_message_filter".} -proc set_double_click_time*(display: PDisplay, msec: guint){.cdecl, - dynlib: lib, importc: "gdk_display_set_double_click_time".} -proc set_sm_client_id*(display: PDisplay, sm_client_id: cstring){.cdecl, - dynlib: lib, importc: "gdk_display_set_sm_client_id".} -proc set_default_display*(display: PDisplay){.cdecl, dynlib: lib, - importc: "gdk_set_default_display".} -proc get_default_display*(): PDisplay{.cdecl, dynlib: lib, - importc: "gdk_get_default_display".} -proc TYPE_SCREEN*(): GType -proc SCREEN*(anObject: Pointer): PScreen -proc SCREEN_CLASS*(klass: Pointer): PScreenClass -proc IS_SCREEN*(anObject: Pointer): bool -proc IS_SCREEN_CLASS*(klass: Pointer): bool -proc SCREEN_GET_CLASS*(obj: Pointer): PScreenClass -proc get_default_colormap*(screen: PScreen): PColormap{.cdecl, - dynlib: lib, importc: "gdk_screen_get_default_colormap".} -proc set_default_colormap*(screen: PScreen, colormap: PColormap){.cdecl, - dynlib: lib, importc: "gdk_screen_set_default_colormap".} -proc get_system_colormap*(screen: PScreen): PColormap{.cdecl, - dynlib: lib, importc: "gdk_screen_get_system_colormap".} -proc get_system_visual*(screen: PScreen): PVisual{.cdecl, dynlib: lib, - importc: "gdk_screen_get_system_visual".} -proc get_rgb_colormap*(screen: PScreen): PColormap{.cdecl, dynlib: lib, - importc: "gdk_screen_get_rgb_colormap".} -proc get_rgb_visual*(screen: PScreen): PVisual{.cdecl, dynlib: lib, - importc: "gdk_screen_get_rgb_visual".} -proc get_root_window*(screen: PScreen): PWindow{.cdecl, dynlib: lib, - importc: "gdk_screen_get_root_window".} -proc get_display*(screen: PScreen): PDisplay{.cdecl, dynlib: lib, - importc: "gdk_screen_get_display".} -proc get_number*(screen: PScreen): gint{.cdecl, dynlib: lib, - importc: "gdk_screen_get_number".} -proc get_window_at_pointer*(screen: PScreen, win_x: Pgint, win_y: Pgint): PWindow{. - cdecl, dynlib: lib, importc: "gdk_screen_get_window_at_pointer".} -proc get_width*(screen: PScreen): gint{.cdecl, dynlib: lib, - importc: "gdk_screen_get_width".} -proc get_height*(screen: PScreen): gint{.cdecl, dynlib: lib, - importc: "gdk_screen_get_height".} -proc get_width_mm*(screen: PScreen): gint{.cdecl, dynlib: lib, - importc: "gdk_screen_get_width_mm".} -proc get_height_mm*(screen: PScreen): gint{.cdecl, dynlib: lib, - importc: "gdk_screen_get_height_mm".} -proc close*(screen: PScreen){.cdecl, dynlib: lib, - importc: "gdk_screen_close".} -proc list_visuals*(screen: PScreen): PGList{.cdecl, dynlib: lib, - importc: "gdk_screen_list_visuals".} -proc get_toplevel_windows*(screen: PScreen): PGList{.cdecl, dynlib: lib, - importc: "gdk_screen_get_toplevel_windows".} -proc get_n_monitors*(screen: PScreen): gint{.cdecl, dynlib: lib, - importc: "gdk_screen_get_n_monitors".} -proc get_monitor_geometry*(screen: PScreen, monitor_num: gint, - dest: PRectangle){.cdecl, dynlib: lib, - importc: "gdk_screen_get_monitor_geometry".} -proc get_monitor_at_point*(screen: PScreen, x: gint, y: gint): gint{. - cdecl, dynlib: lib, importc: "gdk_screen_get_monitor_at_point".} -proc get_monitor_at_window*(screen: PScreen, window: PWindow): gint{. - cdecl, dynlib: lib, importc: "gdk_screen_get_monitor_at_window".} -proc broadcast_client_message*(screen: PScreen, event: PEvent){.cdecl, - dynlib: lib, importc: "gdk_screen_broadcast_client_message".} -proc get_default_screen*(): PScreen{.cdecl, dynlib: lib, - importc: "gdk_get_default_screen".} -proc get_setting*(screen: PScreen, name: cstring, value: PGValue): gboolean{. - cdecl, dynlib: lib, importc: "gdk_screen_get_setting".} -proc SELECTION_PRIMARY*(): TAtom -proc SELECTION_SECONDARY*(): TAtom -proc SELECTION_CLIPBOARD*(): TAtom -proc TARGET_BITMAP*(): TAtom -proc TARGET_COLORMAP*(): TAtom -proc TARGET_DRAWABLE*(): TAtom -proc TARGET_PIXMAP*(): TAtom -proc TARGET_STRING*(): TAtom -proc SELECTION_TYPE_ATOM*(): TAtom -proc SELECTION_TYPE_BITMAP*(): TAtom -proc SELECTION_TYPE_COLORMAP*(): TAtom -proc SELECTION_TYPE_DRAWABLE*(): TAtom -proc SELECTION_TYPE_INTEGER*(): TAtom -proc SELECTION_TYPE_PIXMAP*(): TAtom -proc SELECTION_TYPE_WINDOW*(): TAtom -proc SELECTION_TYPE_STRING*(): TAtom -proc selection_owner_set_for_display*(display: PDisplay, owner: PWindow, - selection: TAtom, time: guint32, - send_event: gboolean): gboolean{.cdecl, - dynlib: lib, importc: "gdk_selection_owner_set_for_display".} -proc selection_owner_get_for_display*(display: PDisplay, selection: TAtom): PWindow{. - cdecl, dynlib: lib, importc: "gdk_selection_owner_get_for_display".} -proc selection_convert*(requestor: PWindow, selection: TAtom, target: TAtom, - time: guint32){.cdecl, dynlib: lib, - importc: "gdk_selection_convert".} -proc selection_property_get*(requestor: PWindow, data: PPguchar, - prop_type: PAtom, prop_format: Pgint): gboolean{. - cdecl, dynlib: lib, importc: "gdk_selection_property_get".} -proc selection_send_notify_for_display*(display: PDisplay, requestor: guint32, - selection: TAtom, target: TAtom, - `property`: TAtom, time: guint32){. - cdecl, dynlib: lib, importc: "gdk_selection_send_notify_for_display".} -const - CURRENT_TIME* = 0 - PARENT_RELATIVE* = 1 - OK* = 0 - ERROR* = - (1) - ERROR_PARAM* = - (2) - ERROR_FILE* = - (3) - ERROR_MEM* = - (4) - SHIFT_MASK* = 1 shl 0 - LOCK_MASK* = 1 shl 1 - CONTROL_MASK* = 1 shl 2 - MOD1_MASK* = 1 shl 3 - MOD2_MASK* = 1 shl 4 - MOD3_MASK* = 1 shl 5 - MOD4_MASK* = 1 shl 6 - MOD5_MASK* = 1 shl 7 - BUTTON1_MASK* = 1 shl 8 - BUTTON2_MASK* = 1 shl 9 - BUTTON3_MASK* = 1 shl 10 - BUTTON4_MASK* = 1 shl 11 - BUTTON5_MASK* = 1 shl 12 - RELEASE_MASK* = 1 shl 30 - MODIFIER_MASK* = ord(RELEASE_MASK) or 0x00001FFF - INPUT_READ* = 1 shl 0 - INPUT_WRITE* = 1 shl 1 - INPUT_EXCEPTION* = 1 shl 2 - GRAB_SUCCESS* = 0 - GRAB_ALREADY_GRABBED* = 1 - GRAB_INVALID_TIME* = 2 - GRAB_NOT_VIEWABLE* = 3 - GRAB_FROZEN* = 4 - -proc ATOM_TO_POINTER*(atom: TAtom): Pointer -proc POINTER_TO_ATOM*(p: Pointer): TAtom -proc `MAKE_ATOM`*(val: guint): TAtom -proc NONE*(): TAtom -proc TYPE_VISUAL*(): GType -proc VISUAL*(anObject: Pointer): PVisual -proc VISUAL_CLASS*(klass: Pointer): PVisualClass -proc IS_VISUAL*(anObject: Pointer): bool -proc IS_VISUAL_CLASS*(klass: Pointer): bool -proc VISUAL_GET_CLASS*(obj: Pointer): PVisualClass -proc visual_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_visual_get_type".} -const - WA_TITLE* = 1 shl 1 - WA_X* = 1 shl 2 - WA_Y* = 1 shl 3 - WA_CURSOR* = 1 shl 4 - WA_COLORMAP* = 1 shl 5 - WA_VISUAL* = 1 shl 6 - WA_WMCLASS* = 1 shl 7 - WA_NOREDIR* = 1 shl 8 - HINT_POS* = 1 shl 0 - HINT_MIN_SIZE* = 1 shl 1 - HINT_MAX_SIZE* = 1 shl 2 - HINT_BASE_SIZE* = 1 shl 3 - HINT_ASPECT* = 1 shl 4 - HINT_RESIZE_INC* = 1 shl 5 - HINT_WIN_GRAVITY* = 1 shl 6 - HINT_USER_POS* = 1 shl 7 - HINT_USER_SIZE* = 1 shl 8 - DECOR_ALL* = 1 shl 0 - DECOR_BORDER* = 1 shl 1 - DECOR_RESIZEH* = 1 shl 2 - DECOR_TITLE* = 1 shl 3 - DECOR_MENU* = 1 shl 4 - DECOR_MINIMIZE* = 1 shl 5 - DECOR_MAXIMIZE* = 1 shl 6 - FUNC_ALL* = 1 shl 0 - FUNC_RESIZE* = 1 shl 1 - FUNC_MOVE* = 1 shl 2 - FUNC_MINIMIZE* = 1 shl 3 - FUNC_MAXIMIZE* = 1 shl 4 - FUNC_CLOSE* = 1 shl 5 - GRAVITY_NORTH_WEST* = 1 - GRAVITY_NORTH* = 2 - GRAVITY_NORTH_EAST* = 3 - GRAVITY_WEST* = 4 - GRAVITY_CENTER* = 5 - GRAVITY_EAST* = 6 - GRAVITY_SOUTH_WEST* = 7 - GRAVITY_SOUTH* = 8 - GRAVITY_SOUTH_EAST* = 9 - GRAVITY_STATIC* = 10 - -proc TYPE_WINDOW*(): GType -proc WINDOW*(anObject: Pointer): PWindow -proc WINDOW_CLASS*(klass: Pointer): PWindowObjectClass -proc IS_WINDOW*(anObject: Pointer): bool -proc IS_WINDOW_CLASS*(klass: Pointer): bool -proc WINDOW_GET_CLASS*(obj: Pointer): PWindowObjectClass -proc WINDOW_OBJECT*(anObject: Pointer): PWindowObject -const - bm_TWindowObject_guffaw_gravity* = 0x0001'i16 - bp_TWindowObject_guffaw_gravity* = 0'i16 - bm_TWindowObject_input_only* = 0x0002'i16 - bp_TWindowObject_input_only* = 1'i16 - bm_TWindowObject_modal_hint* = 0x0004'i16 - bp_TWindowObject_modal_hint* = 2'i16 - bm_TWindowObject_destroyed* = 0x0018'i16 - bp_TWindowObject_destroyed* = 3'i16 - -proc WindowObject_guffaw_gravity*(a: PWindowObject): guint -proc WindowObject_set_guffaw_gravity*(a: PWindowObject, - `guffaw_gravity`: guint) -proc WindowObject_input_only*(a: PWindowObject): guint -proc WindowObject_set_input_only*(a: PWindowObject, `input_only`: guint) -proc WindowObject_modal_hint*(a: PWindowObject): guint -proc WindowObject_set_modal_hint*(a: PWindowObject, `modal_hint`: guint) -proc WindowObject_destroyed*(a: PWindowObject): guint -proc WindowObject_set_destroyed*(a: PWindowObject, `destroyed`: guint) -proc window_object_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_window_object_get_type".} -proc new*(parent: PWindow, attributes: PWindowAttr, attributes_mask: gint): PWindow{. - cdecl, dynlib: lib, importc: "gdk_window_new".} -proc destroy*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_destroy".} -proc get_window_type*(window: PWindow): TWindowType{.cdecl, dynlib: lib, - importc: "gdk_window_get_window_type".} -proc window_at_pointer*(win_x: Pgint, win_y: Pgint): PWindow{.cdecl, - dynlib: lib, importc: "gdk_window_at_pointer".} -proc show*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_show".} -proc hide*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_hide".} -proc withdraw*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_withdraw".} -proc show_unraised*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_show_unraised".} -proc move*(window: PWindow, x: gint, y: gint){.cdecl, dynlib: lib, - importc: "gdk_window_move".} -proc resize*(window: PWindow, width: gint, height: gint){.cdecl, - dynlib: lib, importc: "gdk_window_resize".} -proc move_resize*(window: PWindow, x: gint, y: gint, width: gint, - height: gint){.cdecl, dynlib: lib, - importc: "gdk_window_move_resize".} -proc reparent*(window: PWindow, new_parent: PWindow, x: gint, y: gint){. - cdecl, dynlib: lib, importc: "gdk_window_reparent".} -proc clear*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_clear".} -proc clear_area*(window: PWindow, x: gint, y: gint, width: gint, - height: gint){.cdecl, dynlib: lib, - importc: "gdk_window_clear_area".} -proc clear_area_e*(window: PWindow, x: gint, y: gint, width: gint, - height: gint){.cdecl, dynlib: lib, - importc: "gdk_window_clear_area_e".} -proc `raise`*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_raise".} -proc lower*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_lower".} -proc focus*(window: PWindow, timestamp: guint32){.cdecl, dynlib: lib, - importc: "gdk_window_focus".} -proc set_user_data*(window: PWindow, user_data: gpointer){.cdecl, - dynlib: lib, importc: "gdk_window_set_user_data".} -proc set_override_redirect*(window: PWindow, override_redirect: gboolean){. - cdecl, dynlib: lib, importc: "gdk_window_set_override_redirect".} -proc add_filter*(window: PWindow, `function`: TFilterFunc, data: gpointer){. - cdecl, dynlib: lib, importc: "gdk_window_add_filter".} -proc remove_filter*(window: PWindow, `function`: TFilterFunc, - data: gpointer){.cdecl, dynlib: lib, - importc: "gdk_window_remove_filter".} -proc scroll*(window: PWindow, dx: gint, dy: gint){.cdecl, dynlib: lib, - importc: "gdk_window_scroll".} -proc shape_combine_mask*(window: PWindow, mask: PBitmap, x: gint, y: gint){. - cdecl, dynlib: lib, importc: "gdk_window_shape_combine_mask".} -proc shape_combine_region*(window: PWindow, shape_region: PRegion, - offset_x: gint, offset_y: gint){.cdecl, - dynlib: lib, importc: "gdk_window_shape_combine_region".} -proc set_child_shapes*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_set_child_shapes".} -proc merge_child_shapes*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_merge_child_shapes".} -proc is_visible*(window: PWindow): gboolean{.cdecl, dynlib: lib, - importc: "gdk_window_is_visible".} -proc is_viewable*(window: PWindow): gboolean{.cdecl, dynlib: lib, - importc: "gdk_window_is_viewable".} -proc get_state*(window: PWindow): TWindowState{.cdecl, dynlib: lib, - importc: "gdk_window_get_state".} -proc set_static_gravities*(window: PWindow, use_static: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gdk_window_set_static_gravities".} -proc window_foreign_new_for_display*(display: PDisplay, anid: TNativeWindow): PWindow{. - cdecl, dynlib: lib, importc: "gdk_window_foreign_new_for_display".} -proc window_lookup_for_display*(display: PDisplay, anid: TNativeWindow): PWindow{. - cdecl, dynlib: lib, importc: "gdk_window_lookup_for_display".} -proc set_type_hint*(window: PWindow, hint: TWindowTypeHint){.cdecl, - dynlib: lib, importc: "gdk_window_set_type_hint".} -proc set_modal_hint*(window: PWindow, modal: gboolean){.cdecl, - dynlib: lib, importc: "gdk_window_set_modal_hint".} -proc set_geometry_hints*(window: PWindow, geometry: PGeometry, - geom_mask: TWindowHints){.cdecl, dynlib: lib, - importc: "gdk_window_set_geometry_hints".} -proc set_sm_client_id*(sm_client_id: cstring){.cdecl, dynlib: lib, - importc: "gdk_set_sm_client_id".} -proc begin_paint_rect*(window: PWindow, rectangle: PRectangle){.cdecl, - dynlib: lib, importc: "gdk_window_begin_paint_rect".} -proc begin_paint_region*(window: PWindow, region: PRegion){.cdecl, - dynlib: lib, importc: "gdk_window_begin_paint_region".} -proc end_paint*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_end_paint".} -proc set_title*(window: PWindow, title: cstring){.cdecl, dynlib: lib, - importc: "gdk_window_set_title".} -proc set_role*(window: PWindow, role: cstring){.cdecl, dynlib: lib, - importc: "gdk_window_set_role".} -proc set_transient_for*(window: PWindow, parent: PWindow){.cdecl, - dynlib: lib, importc: "gdk_window_set_transient_for".} -proc set_background*(window: PWindow, color: PColor){.cdecl, dynlib: lib, - importc: "gdk_window_set_background".} -proc set_back_pixmap*(window: PWindow, pixmap: PPixmap, - parent_relative: gboolean){.cdecl, dynlib: lib, - importc: "gdk_window_set_back_pixmap".} -proc set_cursor*(window: PWindow, cursor: PCursor){.cdecl, dynlib: lib, - importc: "gdk_window_set_cursor".} -proc get_user_data*(window: PWindow, data: gpointer){.cdecl, dynlib: lib, - importc: "gdk_window_get_user_data".} -proc get_geometry*(window: PWindow, x: Pgint, y: Pgint, width: Pgint, - height: Pgint, depth: Pgint){.cdecl, dynlib: lib, - importc: "gdk_window_get_geometry".} -proc get_position*(window: PWindow, x: Pgint, y: Pgint){.cdecl, - dynlib: lib, importc: "gdk_window_get_position".} -proc get_origin*(window: PWindow, x: Pgint, y: Pgint): gint{.cdecl, - dynlib: lib, importc: "gdk_window_get_origin".} -proc get_root_origin*(window: PWindow, x: Pgint, y: Pgint){.cdecl, - dynlib: lib, importc: "gdk_window_get_root_origin".} -proc get_frame_extents*(window: PWindow, rect: PRectangle){.cdecl, - dynlib: lib, importc: "gdk_window_get_frame_extents".} -proc get_pointer*(window: PWindow, x: Pgint, y: Pgint, - mask: PModifierType): PWindow{.cdecl, dynlib: lib, - importc: "gdk_window_get_pointer".} -proc get_parent*(window: PWindow): PWindow{.cdecl, dynlib: lib, - importc: "gdk_window_get_parent".} -proc get_toplevel*(window: PWindow): PWindow{.cdecl, dynlib: lib, - importc: "gdk_window_get_toplevel".} -proc get_children*(window: PWindow): PGList{.cdecl, dynlib: lib, - importc: "gdk_window_get_children".} -proc peek_children*(window: PWindow): PGList{.cdecl, dynlib: lib, - importc: "gdk_window_peek_children".} -proc get_events*(window: PWindow): TEventMask{.cdecl, dynlib: lib, - importc: "gdk_window_get_events".} -proc set_events*(window: PWindow, event_mask: TEventMask){.cdecl, - dynlib: lib, importc: "gdk_window_set_events".} -proc set_icon_list*(window: PWindow, pixbufs: PGList){.cdecl, - dynlib: lib, importc: "gdk_window_set_icon_list".} -proc set_icon*(window: PWindow, icon_window: PWindow, pixmap: PPixmap, - mask: PBitmap){.cdecl, dynlib: lib, - importc: "gdk_window_set_icon".} -proc set_icon_name*(window: PWindow, name: cstring){.cdecl, dynlib: lib, - importc: "gdk_window_set_icon_name".} -proc set_group*(window: PWindow, leader: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_set_group".} -proc set_decorations*(window: PWindow, decorations: TWMDecoration){. - cdecl, dynlib: lib, importc: "gdk_window_set_decorations".} -proc get_decorations*(window: PWindow, decorations: PWMDecoration): gboolean{. - cdecl, dynlib: lib, importc: "gdk_window_get_decorations".} -proc set_functions*(window: PWindow, functions: TWMFunction){.cdecl, - dynlib: lib, importc: "gdk_window_set_functions".} -proc iconify*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_iconify".} -proc deiconify*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_deiconify".} -proc stick*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_stick".} -proc unstick*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_unstick".} -proc maximize*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_maximize".} -proc unmaximize*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_unmaximize".} -proc register_dnd*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_register_dnd".} -proc begin_resize_drag*(window: PWindow, edge: TWindowEdge, button: gint, - root_x: gint, root_y: gint, timestamp: guint32){. - cdecl, dynlib: lib, importc: "gdk_window_begin_resize_drag".} -proc begin_move_drag*(window: PWindow, button: gint, root_x: gint, - root_y: gint, timestamp: guint32){.cdecl, - dynlib: lib, importc: "gdk_window_begin_move_drag".} -proc invalidate_rect*(window: PWindow, rect: PRectangle, - invalidate_children: gboolean){.cdecl, dynlib: lib, - importc: "gdk_window_invalidate_rect".} -proc invalidate_region*(window: PWindow, region: PRegion, - invalidate_children: gboolean){.cdecl, - dynlib: lib, importc: "gdk_window_invalidate_region".} -proc invalidate_maybe_recurse*(window: PWindow, region: PRegion, - child_func: window_invalidate_maybe_recurse_child_func, user_data: gpointer){. - cdecl, dynlib: lib, importc: "gdk_window_invalidate_maybe_recurse".} -proc get_update_area*(window: PWindow): PRegion{.cdecl, dynlib: lib, - importc: "gdk_window_get_update_area".} -proc freeze_updates*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_freeze_updates".} -proc thaw_updates*(window: PWindow){.cdecl, dynlib: lib, - importc: "gdk_window_thaw_updates".} -proc window_process_all_updates*(){.cdecl, dynlib: lib, - importc: "gdk_window_process_all_updates".} -proc process_updates*(window: PWindow, update_children: gboolean){.cdecl, - dynlib: lib, importc: "gdk_window_process_updates".} -proc window_set_debug_updates*(setting: gboolean){.cdecl, dynlib: lib, - importc: "gdk_window_set_debug_updates".} -proc window_constrain_size*(geometry: PGeometry, flags: guint, width: gint, - height: gint, new_width: Pgint, new_height: Pgint){. - cdecl, dynlib: lib, importc: "gdk_window_constrain_size".} -proc get_internal_paint_info*(window: PWindow, e: var PDrawable, - x_offset: Pgint, y_offset: Pgint){.cdecl, - dynlib: lib, importc: "gdk_window_get_internal_paint_info".} -proc set_pointer_hooks*(new_hooks: PPointerHooks): PPointerHooks{.cdecl, - dynlib: lib, importc: "gdk_set_pointer_hooks".} -proc get_default_root_window*(): PWindow{.cdecl, dynlib: lib, - importc: "gdk_get_default_root_window".} -proc parse_args*(argc: Pgint, v: var PPgchar){.cdecl, dynlib: lib, - importc: "gdk_parse_args".} -proc init*(argc: Pgint, v: var PPgchar){.cdecl, dynlib: lib, importc: "gdk_init".} -proc init_check*(argc: Pgint, v: var PPgchar): gboolean{.cdecl, dynlib: lib, - importc: "gdk_init_check".} -when not defined(DISABLE_DEPRECATED): - proc exit*(error_code: gint){.cdecl, dynlib: lib, importc: "gdk_exit".} -proc set_locale*(): cstring{.cdecl, dynlib: lib, importc: "gdk_set_locale".} -proc get_program_class*(): cstring{.cdecl, dynlib: lib, - importc: "gdk_get_program_class".} -proc set_program_class*(program_class: cstring){.cdecl, dynlib: lib, - importc: "gdk_set_program_class".} -proc error_trap_push*(){.cdecl, dynlib: lib, importc: "gdk_error_trap_push".} -proc error_trap_pop*(): gint{.cdecl, dynlib: lib, importc: "gdk_error_trap_pop".} -when not defined(DISABLE_DEPRECATED): - proc set_use_xshm*(use_xshm: gboolean){.cdecl, dynlib: lib, - importc: "gdk_set_use_xshm".} - proc get_use_xshm*(): gboolean{.cdecl, dynlib: lib, - importc: "gdk_get_use_xshm".} -proc get_display*(): cstring{.cdecl, dynlib: lib, importc: "gdk_get_display".} -proc get_display_arg_name*(): cstring{.cdecl, dynlib: lib, - importc: "gdk_get_display_arg_name".} -when not defined(DISABLE_DEPRECATED): - proc input_add_full*(source: gint, condition: TInputCondition, - `function`: TInputFunction, data: gpointer, - destroy: TDestroyNotify): gint{.cdecl, dynlib: lib, - importc: "gdk_input_add_full".} - proc input_add*(source: gint, condition: TInputCondition, - `function`: TInputFunction, data: gpointer): gint{.cdecl, - dynlib: lib, importc: "gdk_input_add".} - proc input_remove*(tag: gint){.cdecl, dynlib: lib, importc: "gdk_input_remove".} -proc pointer_grab*(window: PWindow, owner_events: gboolean, - event_mask: TEventMask, confine_to: PWindow, cursor: PCursor, - time: guint32): TGrabStatus{.cdecl, dynlib: lib, - importc: "gdk_pointer_grab".} -proc keyboard_grab*(window: PWindow, owner_events: gboolean, time: guint32): TGrabStatus{. - cdecl, dynlib: lib, importc: "gdk_keyboard_grab".} -when not defined(MULTIHEAD_SAFE): - proc pointer_ungrab*(time: guint32){.cdecl, dynlib: lib, - importc: "gdk_pointer_ungrab".} - proc keyboard_ungrab*(time: guint32){.cdecl, dynlib: lib, - importc: "gdk_keyboard_ungrab".} - proc pointer_is_grabbed*(): gboolean{.cdecl, dynlib: lib, - importc: "gdk_pointer_is_grabbed".} - proc screen_width*(): gint{.cdecl, dynlib: lib, importc: "gdk_screen_width".} - proc screen_height*(): gint{.cdecl, dynlib: lib, importc: "gdk_screen_height".} - proc screen_width_mm*(): gint{.cdecl, dynlib: lib, - importc: "gdk_screen_width_mm".} - proc screen_height_mm*(): gint{.cdecl, dynlib: lib, - importc: "gdk_screen_height_mm".} - proc beep*(){.cdecl, dynlib: lib, importc: "gdk_beep".} -proc flush*(){.cdecl, dynlib: lib, importc: "gdk_flush".} -when not defined(MULTIHEAD_SAFE): - proc set_double_click_time*(msec: guint){.cdecl, dynlib: lib, - importc: "gdk_set_double_click_time".} -proc intersect*(src1: PRectangle, src2: PRectangle, dest: PRectangle): gboolean{. - cdecl, dynlib: lib, importc: "gdk_rectangle_intersect".} -proc union*(src1: PRectangle, src2: PRectangle, dest: PRectangle){. - cdecl, dynlib: lib, importc: "gdk_rectangle_union".} -proc rectangle_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gdk_rectangle_get_type".} -proc TYPE_RECTANGLE*(): GType -proc wcstombs*(src: PWChar): cstring{.cdecl, dynlib: lib, - importc: "gdk_wcstombs".} -proc mbstowcs*(dest: PWChar, src: cstring, dest_max: gint): gint{.cdecl, - dynlib: lib, importc: "gdk_mbstowcs".} -when not defined(MULTIHEAD_SAFE): - proc event_send_client_message*(event: PEvent, xid: guint32): gboolean{.cdecl, - dynlib: lib, importc: "gdk_event_send_client_message".} - proc event_send_clientmessage_toall*(event: PEvent){.cdecl, dynlib: lib, - importc: "gdk_event_send_clientmessage_toall".} -proc event_send_client_message_for_display*(display: PDisplay, event: PEvent, - xid: guint32): gboolean{.cdecl, dynlib: lib, importc: "gdk_event_send_client_message_for_display".} -proc threads_enter*(){.cdecl, dynlib: lib, importc: "gdk_threads_enter".} -proc threads_leave*(){.cdecl, dynlib: lib, importc: "gdk_threads_leave".} -proc threads_init*(){.cdecl, dynlib: lib, importc: "gdk_threads_init".} -proc TYPE_RECTANGLE*(): GType = - result = rectangle_get_type() - -proc TYPE_COLORMAP*(): GType = - result = colormap_get_type() - -proc COLORMAP*(anObject: pointer): PColormap = - result = cast[PColormap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_COLORMAP())) - -proc COLORMAP_CLASS*(klass: pointer): PColormapClass = - result = cast[PColormapClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_COLORMAP())) - -proc IS_COLORMAP*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_COLORMAP()) - -proc IS_COLORMAP_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_COLORMAP()) - -proc COLORMAP_GET_CLASS*(obj: pointer): PColormapClass = - result = cast[PColormapClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_COLORMAP())) - -proc TYPE_COLOR*(): GType = - result = gdk2.color_get_type() - -proc destroy*(cursor: PCursor) = - unref(cursor) - -proc TYPE_CURSOR*(): GType = - result = cursor_get_type() - -proc TYPE_DRAG_CONTEXT*(): GType = - result = drag_context_get_type() - -proc DRAG_CONTEXT*(anObject: Pointer): PDragContext = - result = cast[PDragContext](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_DRAG_CONTEXT())) - -proc DRAG_CONTEXT_CLASS*(klass: Pointer): PDragContextClass = - result = cast[PDragContextClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_DRAG_CONTEXT())) - -proc IS_DRAG_CONTEXT*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_DRAG_CONTEXT()) - -proc IS_DRAG_CONTEXT_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_DRAG_CONTEXT()) - -proc DRAG_CONTEXT_GET_CLASS*(obj: Pointer): PDragContextClass = - result = cast[PDragContextClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_DRAG_CONTEXT())) - -proc region_EXTENTCHECK*(r1, r2: PRegionBox): bool = - result = ((r1.x2) > r2.x1) and ((r1.x1) < r2.x2) and ((r1.y2) > r2.y1) and - ((r1.y1) < r2.y2) - -proc EXTENTS*(r: PRegionBox, idRect: PRegion) = - if ((r.x1) < idRect.extents.x1): - idRect.extents.x1 = r.x1 - if (r.y1) < idRect.extents.y1: - idRect.extents.y1 = r.y1 - if (r.x2) > idRect.extents.x2: - idRect.extents.x2 = r.x2 - -proc MEMCHECK*(reg: PRegion, ARect, firstrect: var PRegionBox): bool = - assert(false) # to implement - -proc CHECK_PREVIOUS*(Reg: PRegion, R: PRegionBox, - Rx1, Ry1, Rx2, Ry2: gint): bool = - assert(false) # to implement - -proc ADDRECT*(reg: PRegion, r: PRegionBox, rx1, ry1, rx2, ry2: gint) = - if (((rx1) < rx2) and ((ry1) < ry2) and - CHECK_PREVIOUS(reg, r, rx1, ry1, rx2, ry2)): - r.x1 = rx1 - r.y1 = ry1 - r.x2 = rx2 - r.y2 = ry2 - -proc ADDRECTNOX*(reg: PRegion, r: PRegionBox, rx1, ry1, rx2, ry2: gint) = - if (((rx1) < rx2) and ((ry1) < ry2) and - CHECK_PREVIOUS(reg, r, rx1, ry1, rx2, ry2)): - r.x1 = rx1 - r.y1 = ry1 - r.x2 = rx2 - r.y2 = ry2 - inc(reg.numRects) - -proc EMPTY_REGION*(pReg: PRegion): bool = - result = pReg.numRects == 0'i32 - -proc REGION_NOT_EMPTY*(pReg: PRegion): bool = - result = pReg.numRects != 0'i32 - -proc region_INBOX*(r: TRegionBox, x, y: gint): bool = - result = ((((r.x2) > x) and ((r.x1) <= x)) and ((r.y2) > y)) and - ((r.y1) <= y) - -proc TYPE_DRAWABLE*(): GType = - result = drawable_get_type() - -proc DRAWABLE*(anObject: Pointer): PDrawable = - result = cast[PDrawable](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_DRAWABLE())) - -proc DRAWABLE_CLASS*(klass: Pointer): PDrawableClass = - result = cast[PDrawableClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_DRAWABLE())) - -proc IS_DRAWABLE*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_DRAWABLE()) - -proc IS_DRAWABLE_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_DRAWABLE()) - -proc DRAWABLE_GET_CLASS*(obj: Pointer): PDrawableClass = - result = cast[PDrawableClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_DRAWABLE())) - -proc pixmap*(drawable: PDrawable, gc: PGC, src: PDrawable, xsrc: gint, - ysrc: gint, xdest: gint, ydest: gint, width: gint, - height: gint) = - drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height) - -proc bitmap*(drawable: PDrawable, gc: PGC, src: PDrawable, xsrc: gint, - ysrc: gint, xdest: gint, ydest: gint, width: gint, - height: gint) = - drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height) - -proc TYPE_EVENT*(): GType = - result = event_get_type() - -proc TYPE_FONT*(): GType = - result = gdk2.font_get_type() - -proc TYPE_GC*(): GType = - result = gc_get_type() - -proc GC*(anObject: Pointer): PGC = - result = cast[PGC](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_GC())) - -proc GC_CLASS*(klass: Pointer): PGCClass = - result = cast[PGCClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_GC())) - -proc IS_GC*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GC()) - -proc IS_GC_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GC()) - -proc GC_GET_CLASS*(obj: Pointer): PGCClass = - result = cast[PGCClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_GC())) - -proc destroy*(gc: PGC) = - g_object_unref(G_OBJECT(gc)) - -proc TYPE_IMAGE*(): GType = - result = image_get_type() - -proc IMAGE*(anObject: Pointer): PImage = - result = cast[PImage](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_IMAGE())) - -proc IMAGE_CLASS*(klass: Pointer): PImageClass = - result = cast[PImageClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_IMAGE())) - -proc IS_IMAGE*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_IMAGE()) - -proc IS_IMAGE_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_IMAGE()) - -proc IMAGE_GET_CLASS*(obj: Pointer): PImageClass = - result = cast[PImageClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_IMAGE())) - -proc destroy*(image: PImage) = - g_object_unref(G_OBJECT(image)) - -proc TYPE_DEVICE*(): GType = - result = device_get_type() - -proc DEVICE*(anObject: Pointer): PDevice = - result = cast[PDevice](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_DEVICE())) - -proc DEVICE_CLASS*(klass: Pointer): PDeviceClass = - result = cast[PDeviceClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_DEVICE())) - -proc IS_DEVICE*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_DEVICE()) - -proc IS_DEVICE_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_DEVICE()) - -proc DEVICE_GET_CLASS*(obj: Pointer): PDeviceClass = - result = cast[PDeviceClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_DEVICE())) - -proc TYPE_KEYMAP*(): GType = - result = keymap_get_type() - -proc KEYMAP*(anObject: Pointer): PKeymap = - result = cast[PKeymap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_KEYMAP())) - -proc KEYMAP_CLASS*(klass: Pointer): PKeymapClass = - result = cast[PKeymapClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_KEYMAP())) - -proc IS_KEYMAP*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_KEYMAP()) - -proc IS_KEYMAP_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_KEYMAP()) - -proc KEYMAP_GET_CLASS*(obj: Pointer): PKeymapClass = - result = cast[PKeymapClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_KEYMAP())) - -proc TYPE_PIXMAP*(): GType = - result = pixmap_get_type() - -proc PIXMAP*(anObject: Pointer): PPixmap = - result = cast[PPixmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_PIXMAP())) - -proc PIXMAP_CLASS*(klass: Pointer): PPixmapObjectClass = - result = cast[PPixmapObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_PIXMAP())) - -proc IS_PIXMAP*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXMAP()) - -proc IS_PIXMAP_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_PIXMAP()) - -proc PIXMAP_GET_CLASS*(obj: Pointer): PPixmapObjectClass = - result = cast[PPixmapObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_PIXMAP())) - -proc PIXMAP_OBJECT*(anObject: Pointer): PPixmapObject = - result = cast[PPixmapObject](PIXMAP(anObject)) - -proc bitmap_ref*(drawable: PDrawable): PDrawable = - result = DRAWABLE(g_object_ref(G_OBJECT(drawable))) - -proc bitmap_unref*(drawable: PDrawable) = - g_object_unref(G_OBJECT(drawable)) - -proc pixmap_ref*(drawable: PDrawable): PDrawable = - result = DRAWABLE(g_object_ref(G_OBJECT(drawable))) - -proc pixmap_unref*(drawable: PDrawable) = - g_object_unref(G_OBJECT(drawable)) - -proc rgb_get_cmap*(): PColormap = - result = nil #gdk_rgb_get_colormap() - -proc TYPE_DISPLAY*(): GType = - nil - #result = nil - -proc DISPLAY_OBJECT*(anObject: pointer): PDisplay = - result = cast[PDisplay](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_DISPLAY())) - -proc DISPLAY_CLASS*(klass: pointer): PDisplayClass = - result = cast[PDisplayClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_DISPLAY())) - -proc IS_DISPLAY*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_DISPLAY()) - -proc IS_DISPLAY_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_DISPLAY()) - -proc DISPLAY_GET_CLASS*(obj: pointer): PDisplayClass = - result = cast[PDisplayClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_DISPLAY())) - -proc TYPE_SCREEN*(): GType = - nil - -proc SCREEN*(anObject: Pointer): PScreen = - result = cast[PScreen](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_SCREEN())) - -proc SCREEN_CLASS*(klass: Pointer): PScreenClass = - result = cast[PScreenClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_SCREEN())) - -proc IS_SCREEN*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_SCREEN()) - -proc IS_SCREEN_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_SCREEN()) - -proc SCREEN_GET_CLASS*(obj: Pointer): PScreenClass = - result = cast[PScreenClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_SCREEN())) - -proc SELECTION_PRIMARY*(): TAtom = - result = `MAKE_ATOM`(1) - -proc SELECTION_SECONDARY*(): TAtom = - result = `MAKE_ATOM`(2) - -proc SELECTION_CLIPBOARD*(): TAtom = - result = `MAKE_ATOM`(69) - -proc TARGET_BITMAP*(): TAtom = - result = `MAKE_ATOM`(5) - -proc TARGET_COLORMAP*(): TAtom = - result = `MAKE_ATOM`(7) - -proc TARGET_DRAWABLE*(): TAtom = - result = `MAKE_ATOM`(17) - -proc TARGET_PIXMAP*(): TAtom = - result = `MAKE_ATOM`(20) - -proc TARGET_STRING*(): TAtom = - result = `MAKE_ATOM`(31) - -proc SELECTION_TYPE_ATOM*(): TAtom = - result = `MAKE_ATOM`(4) - -proc SELECTION_TYPE_BITMAP*(): TAtom = - result = `MAKE_ATOM`(5) - -proc SELECTION_TYPE_COLORMAP*(): TAtom = - result = `MAKE_ATOM`(7) - -proc SELECTION_TYPE_DRAWABLE*(): TAtom = - result = `MAKE_ATOM`(17) - -proc SELECTION_TYPE_INTEGER*(): TAtom = - result = `MAKE_ATOM`(19) - -proc SELECTION_TYPE_PIXMAP*(): TAtom = - result = `MAKE_ATOM`(20) - -proc SELECTION_TYPE_WINDOW*(): TAtom = - result = `MAKE_ATOM`(33) - -proc SELECTION_TYPE_STRING*(): TAtom = - result = `MAKE_ATOM`(31) - -proc ATOM_TO_POINTER*(atom: TAtom): pointer = - result = cast[Pointer](atom) - -proc POINTER_TO_ATOM*(p: Pointer): TAtom = - result = cast[TAtom](p) - -proc `MAKE_ATOM`*(val: guint): TAtom = - result = cast[TAtom](val) - -proc NONE*(): TAtom = - result = `MAKE_ATOM`(0) - -proc TYPE_VISUAL*(): GType = - result = visual_get_type() - -proc VISUAL*(anObject: Pointer): PVisual = - result = cast[PVisual](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_VISUAL())) - -proc VISUAL_CLASS*(klass: Pointer): PVisualClass = - result = cast[PVisualClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_VISUAL())) - -proc IS_VISUAL*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_VISUAL()) - -proc IS_VISUAL_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_VISUAL()) - -proc VISUAL_GET_CLASS*(obj: Pointer): PVisualClass = - result = cast[PVisualClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_VISUAL())) - -proc reference*(v: PVisual) = - discard g_object_ref(v) - -proc unref*(v: PVisual) = - g_object_unref(v) - -proc TYPE_WINDOW*(): GType = - result = window_object_get_type() - -proc WINDOW*(anObject: Pointer): PWindow = - result = cast[PWindow](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_WINDOW())) - -proc WINDOW_CLASS*(klass: Pointer): PWindowObjectClass = - result = cast[PWindowObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_WINDOW())) - -proc IS_WINDOW*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_WINDOW()) - -proc IS_WINDOW_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_WINDOW()) - -proc WINDOW_GET_CLASS*(obj: Pointer): PWindowObjectClass = - result = cast[PWindowObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_WINDOW())) - -proc WINDOW_OBJECT*(anObject: Pointer): PWindowObject = - result = cast[PWindowObject](WINDOW(anObject)) - -proc WindowObject_guffaw_gravity*(a: PWindowObject): guint = - result = (a.flag0 and bm_TWindowObject_guffaw_gravity) shr - bp_TWindowObject_guffaw_gravity - -proc WindowObject_set_guffaw_gravity*(a: PWindowObject, - `guffaw_gravity`: guint) = - a.flag0 = a.flag0 or - (int16(`guffaw_gravity` shl bp_TWindowObject_guffaw_gravity) and - bm_TWindowObject_guffaw_gravity) - -proc WindowObject_input_only*(a: PWindowObject): guint = - result = (a.flag0 and bm_TWindowObject_input_only) shr - bp_TWindowObject_input_only - -proc WindowObject_set_input_only*(a: PWindowObject, `input_only`: guint) = - a.flag0 = a.flag0 or - (int16(`input_only` shl bp_TWindowObject_input_only) and - bm_TWindowObject_input_only) - -proc WindowObject_modal_hint*(a: PWindowObject): guint = - result = (a.flag0 and bm_TWindowObject_modal_hint) shr - bp_TWindowObject_modal_hint - -proc WindowObject_set_modal_hint*(a: PWindowObject, `modal_hint`: guint) = - a.flag0 = a.flag0 or - (int16(`modal_hint` shl bp_TWindowObject_modal_hint) and - bm_TWindowObject_modal_hint) - -proc WindowObject_destroyed*(a: PWindowObject): guint = - result = (a.flag0 and bm_TWindowObject_destroyed) shr - bp_TWindowObject_destroyed - -proc WindowObject_set_destroyed*(a: PWindowObject, `destroyed`: guint) = - a.flag0 = a.flag0 or - (int16(`destroyed` shl bp_TWindowObject_destroyed) and - bm_TWindowObject_destroyed) - -proc ROOT_PARENT*(): PWindow = - result = get_default_root_window() - -proc window_get_size*(drawable: PDrawable, width: Pgint, height: Pgint) = - get_size(drawable, width, height) - -proc get_type*(window: PWindow): TWindowType = - result = get_window_type(window) - -proc window_get_colormap*(drawable: PDrawable): PColormap = - result = get_colormap(drawable) - -proc window_set_colormap*(drawable: PDrawable, colormap: PColormap) = - set_colormap(drawable, colormap) - -proc window_get_visual*(drawable: PDrawable): PVisual = - result = get_visual(drawable) - -proc window_ref*(drawable: PDrawable): PDrawable = - result = DRAWABLE(g_object_ref(G_OBJECT(drawable))) - -proc window_unref*(drawable: PDrawable) = - g_object_unref(G_OBJECT(drawable)) - -proc window_copy_area*(drawable: PDrawable, gc: PGC, x, y: gint, - source_drawable: PDrawable, source_x, source_y: gint, - width, height: gint) = - pixmap(drawable, gc, source_drawable, source_x, source_y, x, y, width, - height) diff --git a/lib/wrappers/gtk/gdk2pixbuf.nim b/lib/wrappers/gtk/gdk2pixbuf.nim deleted file mode 100644 index ee50317f82..0000000000 --- a/lib/wrappers/gtk/gdk2pixbuf.nim +++ /dev/null @@ -1,271 +0,0 @@ -{.deadCodeElim: on.} -import - glib2 - -when defined(win32): - const - pixbuflib = "libgdk_pixbuf-2.0-0.dll" -elif defined(macosx): - const - pixbuflib = "libgdk_pixbuf-2.0.0.dylib" - # 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 - pixbuflib = "libgdk_pixbuf-2.0.so" -type - PPixbuf* = pointer - PPixbufAnimation* = pointer - PPixbufAnimationIter* = pointer - PPixbufAlphaMode* = ptr TPixbufAlphaMode - TPixbufAlphaMode* = enum - PIXBUF_ALPHA_BILEVEL, PIXBUF_ALPHA_FULL - PColorspace* = ptr TColorspace - TColorspace* = enum - COLORSPACE_RGB - TPixbufDestroyNotify* = proc (pixels: Pguchar, data: gpointer){.cdecl.} - PPixbufError* = ptr TPixbufError - TPixbufError* = enum - PIXBUF_ERROR_CORRUPT_IMAGE, PIXBUF_ERROR_INSUFFICIENT_MEMORY, - PIXBUF_ERROR_BAD_OPTION, PIXBUF_ERROR_UNKNOWN_TYPE, - PIXBUF_ERROR_UNSUPPORTED_OPERATION, PIXBUF_ERROR_FAILED - PInterpType* = ptr TInterpType - TInterpType* = enum - INTERP_NEAREST, INTERP_TILES, INTERP_BILINEAR, INTERP_HYPER - -proc TYPE_PIXBUF*(): GType -proc PIXBUF*(anObject: pointer): PPixbuf -proc IS_PIXBUF*(anObject: pointer): bool -proc TYPE_PIXBUF_ANIMATION*(): GType -proc PIXBUF_ANIMATION*(anObject: pointer): PPixbufAnimation -proc IS_PIXBUF_ANIMATION*(anObject: pointer): bool -proc TYPE_PIXBUF_ANIMATION_ITER*(): GType -proc PIXBUF_ANIMATION_ITER*(anObject: pointer): PPixbufAnimationIter -proc IS_PIXBUF_ANIMATION_ITER*(anObject: pointer): bool -proc PIXBUF_ERROR*(): TGQuark -proc pixbuf_error_quark*(): TGQuark{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_error_quark".} -proc pixbuf_get_type*(): GType{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_get_type".} -when not defined(PIXBUF_DISABLE_DEPRECATED): - proc pixbuf_ref*(pixbuf: PPixbuf): PPixbuf{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_ref".} - proc pixbuf_unref*(pixbuf: PPixbuf){.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_unref".} -proc get_colorspace*(pixbuf: PPixbuf): TColorspace{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_get_colorspace".} -proc get_n_channels*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_get_n_channels".} -proc get_has_alpha*(pixbuf: PPixbuf): gboolean{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_get_has_alpha".} -proc get_bits_per_sample*(pixbuf: PPixbuf): int32{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_get_bits_per_sample".} -proc get_pixels*(pixbuf: PPixbuf): Pguchar{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_get_pixels".} -proc get_width*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_get_width".} -proc get_height*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_get_height".} -proc get_rowstride*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_get_rowstride".} -proc pixbuf_new*(colorspace: TColorspace, has_alpha: gboolean, - bits_per_sample: int32, width: int32, height: int32): PPixbuf{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_new".} -proc copy*(pixbuf: PPixbuf): PPixbuf{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_copy".} -proc new_subpixbuf*(src_pixbuf: PPixbuf, src_x: int32, src_y: int32, - width: int32, height: int32): PPixbuf{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_new_subpixbuf".} -proc pixbuf_new_from_file*(filename: cstring, error: pointer): PPixbuf{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file".} -proc pixbuf_new_from_data*(data: Pguchar, colorspace: TColorspace, - has_alpha: gboolean, bits_per_sample: int32, - width: int32, height: int32, rowstride: int32, - destroy_fn: TPixbufDestroyNotify, - destroy_fn_data: gpointer): PPixbuf{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_data".} -proc pixbuf_new_from_xpm_data*(data: PPchar): PPixbuf{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_new_from_xpm_data".} -proc pixbuf_new_from_inline*(data_length: gint, a: var guint8, - copy_pixels: gboolean, error: pointer): PPixbuf{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_inline".} -proc pixbuf_new_from_file_at_size*(filename: cstring, width, height: gint, - error: pointer): PPixbuf{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file_at_size".} -proc pixbuf_new_from_file_at_scale*(filename: cstring, width, height: gint, - preserve_aspect_ratio: gboolean, - error: pointer): PPixbuf{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file_at_scale".} -proc fill*(pixbuf: PPixbuf, pixel: guint32){.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_fill".} -proc save*(pixbuf: PPixbuf, filename: cstring, `type`: cstring, - error: pointer): gboolean{.cdecl, varargs, dynlib: pixbuflib, - importc: "gdk_pixbuf_save".} -proc savev*(pixbuf: PPixbuf, filename: cstring, `type`: cstring, - option_keys: PPchar, option_values: PPchar, error: pointer): gboolean{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_savev".} -proc add_alpha*(pixbuf: PPixbuf, substitute_color: gboolean, r: guchar, - g: guchar, b: guchar): PPixbuf{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_add_alpha".} -proc copy_area*(src_pixbuf: PPixbuf, src_x: int32, src_y: int32, - width: int32, height: int32, dest_pixbuf: PPixbuf, - dest_x: int32, dest_y: int32){.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_copy_area".} -proc saturate_and_pixelate*(src: PPixbuf, dest: PPixbuf, - saturation: gfloat, pixelate: gboolean){. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_saturate_and_pixelate".} -proc scale*(src: PPixbuf, dest: PPixbuf, 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: TInterpType){.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_scale".} -proc composite*(src: PPixbuf, dest: PPixbuf, 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: TInterpType, - overall_alpha: int32){.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_composite".} -proc composite_color*(src: PPixbuf, dest: PPixbuf, 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: TInterpType, - overall_alpha: int32, check_x: int32, - check_y: int32, check_size: int32, color1: guint32, - color2: guint32){.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_composite_color".} -proc scale_simple*(src: PPixbuf, dest_width: int32, dest_height: int32, - interp_type: TInterpType): PPixbuf{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_scale_simple".} -proc composite_color_simple*(src: PPixbuf, dest_width: int32, - dest_height: int32, - interp_type: TInterpType, - overall_alpha: int32, check_size: int32, - color1: guint32, color2: guint32): PPixbuf{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_composite_color_simple".} -proc pixbuf_animation_get_type*(): GType{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_animation_get_type".} -proc pixbuf_animation_new_from_file*(filename: cstring, error: pointer): PPixbufAnimation{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_new_from_file".} -when not defined(PIXBUF_DISABLE_DEPRECATED): - proc pixbuf_animation_ref*(animation: PPixbufAnimation): PPixbufAnimation{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_ref".} - proc pixbuf_animation_unref*(animation: PPixbufAnimation){.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_animation_unref".} -proc get_width*(animation: PPixbufAnimation): int32{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_width".} -proc get_height*(animation: PPixbufAnimation): int32{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_height".} -proc is_static_image*(animation: PPixbufAnimation): gboolean{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_is_static_image".} -proc get_static_image*(animation: PPixbufAnimation): PPixbuf{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_static_image".} -proc get_iter*(animation: PPixbufAnimation, e: var TGTimeVal): PPixbufAnimationIter{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_iter".} -proc pixbuf_animation_iter_get_type*(): GType{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_animation_iter_get_type".} -proc iter_get_delay_time*(iter: PPixbufAnimationIter): int32{. - cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_animation_iter_get_delay_time".} -proc iter_get_pixbuf*(iter: PPixbufAnimationIter): PPixbuf{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_iter_get_pixbuf".} -proc pixbuf_animation_iter_on_currently_loading_frame*( - iter: PPixbufAnimationIter): gboolean{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_animation_iter_on_currently_loading_frame".} -proc iter_advance*(iter: PPixbufAnimationIter, e: var TGTimeVal): gboolean{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_iter_advance".} -proc get_option*(pixbuf: PPixbuf, key: cstring): cstring{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_get_option".} -type - PPixbufLoader* = ptr TPixbufLoader - TPixbufLoader*{.final, pure.} = object - parent_instance*: TGObject - priv*: gpointer - - PPixbufLoaderClass* = ptr TPixbufLoaderClass - TPixbufLoaderClass*{.final, pure.} = object - parent_class*: TGObjectClass - area_prepared*: proc (loader: PPixbufLoader){.cdecl.} - area_updated*: proc (loader: PPixbufLoader, x: int32, y: int32, - width: int32, height: int32){.cdecl.} - closed*: proc (loader: PPixbufLoader){.cdecl.} - - -proc TYPE_PIXBUF_LOADER*(): GType -proc PIXBUF_LOADER*(obj: pointer): PPixbufLoader -proc PIXBUF_LOADER_CLASS*(klass: pointer): PPixbufLoaderClass -proc IS_PIXBUF_LOADER*(obj: pointer): bool -proc IS_PIXBUF_LOADER_CLASS*(klass: pointer): bool -proc PIXBUF_LOADER_GET_CLASS*(obj: pointer): PPixbufLoaderClass -proc pixbuf_loader_get_type*(): GType{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_loader_get_type".} -proc pixbuf_loader_new*(): PPixbufLoader{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_loader_new".} -proc pixbuf_loader_new*(image_type: cstring, error: pointer): PPixbufLoader{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_new_with_type".} -proc write*(loader: PPixbufLoader, buf: Pguchar, count: gsize, - error: pointer): gboolean{.cdecl, dynlib: pixbuflib, - importc: "gdk_pixbuf_loader_write".} -proc get_pixbuf*(loader: PPixbufLoader): PPixbuf{.cdecl, - dynlib: pixbuflib, importc: "gdk_pixbuf_loader_get_pixbuf".} -proc get_animation*(loader: PPixbufLoader): PPixbufAnimation{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_get_animation".} -proc close*(loader: PPixbufLoader, error: pointer): gboolean{. - cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_close".} -proc TYPE_PIXBUF_LOADER*(): GType = - result = pixbuf_loader_get_type() - -proc PIXBUF_LOADER*(obj: pointer): PPixbufLoader = - result = cast[PPixbufLoader](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_PIXBUF_LOADER())) - -proc PIXBUF_LOADER_CLASS*(klass: pointer): PPixbufLoaderClass = - result = cast[PPixbufLoaderClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_PIXBUF_LOADER())) - -proc IS_PIXBUF_LOADER*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_PIXBUF_LOADER()) - -proc IS_PIXBUF_LOADER_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_PIXBUF_LOADER()) - -proc PIXBUF_LOADER_GET_CLASS*(obj: pointer): PPixbufLoaderClass = - result = cast[PPixbufLoaderClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_PIXBUF_LOADER())) - -proc TYPE_PIXBUF*(): GType = - result = pixbuf_get_type() - -proc PIXBUF*(anObject: pointer): PPixbuf = - result = cast[PPixbuf](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_PIXBUF())) - -proc IS_PIXBUF*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF()) - -proc TYPE_PIXBUF_ANIMATION*(): GType = - result = pixbuf_animation_get_type() - -proc PIXBUF_ANIMATION*(anObject: pointer): PPixbufAnimation = - result = cast[PPixbufAnimation](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_PIXBUF_ANIMATION())) - -proc IS_PIXBUF_ANIMATION*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF_ANIMATION()) - -proc TYPE_PIXBUF_ANIMATION_ITER*(): GType = - result = pixbuf_animation_iter_get_type() - -proc PIXBUF_ANIMATION_ITER*(anObject: pointer): PPixbufAnimationIter = - result = cast[PPixbufAnimationIter](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_PIXBUF_ANIMATION_ITER())) - -proc IS_PIXBUF_ANIMATION_ITER*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF_ANIMATION_ITER()) - -proc PIXBUF_ERROR*(): TGQuark = - result = pixbuf_error_quark() diff --git a/lib/wrappers/gtk/gdkglext.nim b/lib/wrappers/gtk/gdkglext.nim deleted file mode 100644 index 0d550c6e27..0000000000 --- a/lib/wrappers/gtk/gdkglext.nim +++ /dev/null @@ -1,554 +0,0 @@ -{.deadCodeElim: on.} -import - Glib2, gdk2 - -when defined(WIN32): - const - GLExtLib = "libgdkglext-win32-1.0-0.dll" -elif defined(macosx): - const - GLExtLib = "libgdkglext-x11-1.0.dylib" -else: - const - GLExtLib = "libgdkglext-x11-1.0.so" -type - TGLConfigAttrib* = int32 - TGLConfigCaveat* = int32 - TGLVisualType* = int32 - TGLTransparentType* = int32 - TGLDrawableTypeMask* = int32 - TGLRenderTypeMask* = int32 - TGLBufferMask* = int32 - TGLConfigError* = int32 - TGLRenderType* = int32 - TGLDrawableAttrib* = int32 - TGLPbufferAttrib* = int32 - TGLEventMask* = int32 - TGLEventType* = int32 - TGLDrawableType* = int32 - TGLProc* = Pointer - PGLConfig* = ptr TGLConfig - PGLContext* = ptr TGLContext - PGLDrawable* = ptr TGLDrawable - PGLPixmap* = ptr TGLPixmap - PGLWindow* = ptr TGLWindow - TGLConfig* = object of TGObject - layer_plane*: gint - n_aux_buffers*: gint - n_sample_buffers*: gint - flag0*: int16 - - PGLConfigClass* = ptr TGLConfigClass - TGLConfigClass* = object of TGObjectClass - TGLContext* = object of TGObject - PGLContextClass* = ptr TGLContextClass - TGLContextClass* = object of TGObjectClass - TGLDrawable* = object of TGObject - PGLDrawableClass* = ptr TGLDrawableClass - TGLDrawableClass* = object of TGTypeInterface - create_new_context*: proc (gldrawable: PGLDrawable, share_list: PGLContext, - direct: gboolean, render_type: int32): PGLContext{. - cdecl.} - make_context_current*: proc (draw: PGLDrawable, a_read: PGLDrawable, - glcontext: PGLContext): gboolean{.cdecl.} - is_double_buffered*: proc (gldrawable: PGLDrawable): gboolean{.cdecl.} - swap_buffers*: proc (gldrawable: PGLDrawable){.cdecl.} - wait_gl*: proc (gldrawable: PGLDrawable){.cdecl.} - wait_gdk*: proc (gldrawable: PGLDrawable){.cdecl.} - gl_begin*: proc (draw: PGLDrawable, a_read: PGLDrawable, - glcontext: PGLContext): gboolean{.cdecl.} - gl_end*: proc (gldrawable: PGLDrawable){.cdecl.} - get_gl_config*: proc (gldrawable: PGLDrawable): PGLConfig{.cdecl.} - get_size*: proc (gldrawable: PGLDrawable, width, height: PGInt){.cdecl.} - - TGLPixmap* = object of TGObject - drawable*: PDrawable - - PGLPixmapClass* = ptr TGLPixmapClass - TGLPixmapClass* = object of TGObjectClass - TGLWindow* = object of TGObject - drawable*: PDrawable - - PGLWindowClass* = ptr TGLWindowClass - TGLWindowClass* = 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 - glext_major_version*{.importc, dynlib: GLExtLib.}: guint - glext_minor_version*{.importc, dynlib: GLExtLib.}: guint - glext_micro_version*{.importc, dynlib: GLExtLib.}: guint - glext_interface_age*{.importc, dynlib: GLExtLib.}: guint - glext_binary_age*{.importc, dynlib: GLExtLib.}: guint - -const - GL_SUCCESS* = 0 - GL_ATTRIB_LIST_NONE* = 0 - GL_USE_GL* = 1 - GL_BUFFER_SIZE* = 2 - GL_LEVEL* = 3 - GL_RGBA* = 4 - GL_DOUBLEBUFFER* = 5 - GL_STEREO* = 6 - GL_AUX_BUFFERS* = 7 - GL_RED_SIZE* = 8 - GL_GREEN_SIZE* = 9 - GL_BLUE_SIZE* = 10 - GL_ALPHA_SIZE* = 11 - GL_DEPTH_SIZE* = 12 - GL_STENCIL_SIZE* = 13 - GL_ACCUM_RED_SIZE* = 14 - GL_ACCUM_GREEN_SIZE* = 15 - GL_ACCUM_BLUE_SIZE* = 16 - GL_ACCUM_ALPHA_SIZE* = 17 - GL_CONFIG_CAVEAT* = 0x00000020 - GL_X_VISUAL_TYPE* = 0x00000022 - GL_TRANSPARENT_TYPE* = 0x00000023 - GL_TRANSPARENT_INDEX_VALUE* = 0x00000024 - GL_TRANSPARENT_RED_VALUE* = 0x00000025 - GL_TRANSPARENT_GREEN_VALUE* = 0x00000026 - GL_TRANSPARENT_BLUE_VALUE* = 0x00000027 - GL_TRANSPARENT_ALPHA_VALUE* = 0x00000028 - GL_DRAWABLE_TYPE* = 0x00008010 - GL_RENDER_TYPE* = 0x00008011 - GL_X_RENDERABLE* = 0x00008012 - GL_FBCONFIG_ID* = 0x00008013 - GL_MAX_PBUFFER_WIDTH* = 0x00008016 - GL_MAX_PBUFFER_HEIGHT* = 0x00008017 - GL_MAX_PBUFFER_PIXELS* = 0x00008018 - GL_VISUAL_ID* = 0x0000800B - GL_SCREEN* = 0x0000800C - GL_SAMPLE_BUFFERS* = 100000 - GL_SAMPLES* = 100001 - GL_DONT_CARE* = 0xFFFFFFFF - GL_NONE* = 0x00008000 - GL_CONFIG_CAVEAT_DONT_CARE* = 0xFFFFFFFF - GL_CONFIG_CAVEAT_NONE* = 0x00008000 - GL_SLOW_CONFIG* = 0x00008001 - GL_NON_CONFORMANT_CONFIG* = 0x0000800D - GL_VISUAL_TYPE_DONT_CARE* = 0xFFFFFFFF - GL_TRUE_COLOR* = 0x00008002 - GL_DIRECT_COLOR* = 0x00008003 - GL_PSEUDO_COLOR* = 0x00008004 - GL_STATIC_COLOR* = 0x00008005 - GL_GRAY_SCALE* = 0x00008006 - GL_STATIC_GRAY* = 0x00008007 - GL_TRANSPARENT_NONE* = 0x00008000 - GL_TRANSPARENT_RGB* = 0x00008008 - GL_TRANSPARENT_INDEX* = 0x00008009 - GL_WINDOW_BIT* = 1 shl 0 - GL_PIXMAP_BIT* = 1 shl 1 - GL_PBUFFER_BIT* = 1 shl 2 - GL_RGBA_BIT* = 1 shl 0 - GL_COLOR_INDEX_BIT* = 1 shl 1 - GL_FRONT_LEFT_BUFFER_BIT* = 1 shl 0 - GL_FRONT_RIGHT_BUFFER_BIT* = 1 shl 1 - GL_BACK_LEFT_BUFFER_BIT* = 1 shl 2 - GL_BACK_RIGHT_BUFFER_BIT* = 1 shl 3 - GL_AUX_BUFFERS_BIT* = 1 shl 4 - GL_DEPTH_BUFFER_BIT* = 1 shl 5 - GL_STENCIL_BUFFER_BIT* = 1 shl 6 - GL_ACCUM_BUFFER_BIT* = 1 shl 7 - GL_BAD_SCREEN* = 1 - GL_BAD_ATTRIBUTE* = 2 - GL_NO_EXTENSION* = 3 - GL_BAD_VISUAL* = 4 - GL_BAD_CONTEXT* = 5 - GL_BAD_VALUE* = 6 - GL_BAD_ENUM* = 7 - GL_RGBA_TYPE* = 0x00008014 - GL_COLOR_INDEX_TYPE* = 0x00008015 - GL_PRESERVED_CONTENTS* = 0x0000801B - GL_LARGEST_PBUFFER* = 0x0000801C - GL_WIDTH* = 0x0000801D - GL_HEIGHT* = 0x0000801E - GL_EVENT_MASK* = 0x0000801F - GL_PBUFFER_PRESERVED_CONTENTS* = 0x0000801B - GL_PBUFFER_LARGEST_PBUFFER* = 0x0000801C - GL_PBUFFER_HEIGHT* = 0x00008040 - GL_PBUFFER_WIDTH* = 0x00008041 - GL_PBUFFER_CLOBBER_MASK* = 1 shl 27 - GL_DAMAGED* = 0x00008020 - GL_SAVED* = 0x00008021 - GL_WINDOW_VALUE* = 0x00008022 - GL_PBUFFER* = 0x00008023 - -proc gl_config_attrib_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_attrib_get_type".} -proc TYPE_GL_CONFIG_ATTRIB*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_attrib_get_type".} -proc gl_config_caveat_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_caveat_get_type".} -proc TYPE_GL_CONFIG_CAVEAT*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_caveat_get_type".} -proc gl_visual_type_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_visual_type_get_type".} -proc TYPE_GL_VISUAL_TYPE*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_visual_type_get_type".} -proc gl_transparent_type_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_transparent_type_get_type".} -proc TYPE_GL_TRANSPARENT_TYPE*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_transparent_type_get_type".} -proc gl_drawable_type_mask_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_type_mask_get_type".} -proc TYPE_GL_DRAWABLE_TYPE_MASK*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_type_mask_get_type".} -proc gl_render_type_mask_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_render_type_mask_get_type".} -proc TYPE_GL_RENDER_TYPE_MASK*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_render_type_mask_get_type".} -proc gl_buffer_mask_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_buffer_mask_get_type".} -proc TYPE_GL_BUFFER_MASK*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_buffer_mask_get_type".} -proc gl_config_error_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_error_get_type".} -proc TYPE_GL_CONFIG_ERROR*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_error_get_type".} -proc gl_render_type_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_render_type_get_type".} -proc TYPE_GL_RENDER_TYPE*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_render_type_get_type".} -proc gl_drawable_attrib_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_attrib_get_type".} -proc TYPE_GL_DRAWABLE_ATTRIB*(): GType{.cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_attrib_get_type".} -proc gl_pbuffer_attrib_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_pbuffer_attrib_get_type".} -proc TYPE_GL_PBUFFER_ATTRIB*(): GType{.cdecl, dynlib: GLExtLib, importc: "gdk_gl_pbuffer_attrib_get_type".} -proc gl_event_mask_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_event_mask_get_type".} -proc TYPE_GL_EVENT_MASK*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_event_mask_get_type".} -proc gl_event_type_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_event_type_get_type".} -proc TYPE_GL_EVENT_TYPE*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_event_type_get_type".} -proc gl_drawable_type_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_type_get_type".} -proc TYPE_GL_DRAWABLE_TYPE*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_type_get_type".} -proc gl_config_mode_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_mode_get_type".} -proc TYPE_GL_CONFIG_MODE*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_mode_get_type".} -proc gl_parse_args*(argc: var int32, argv: ptr cstringArray): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_parse_args".} -proc gl_init_check*(argc: var int32, argv: ptr cstringArray): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_init_check".} -proc gl_init*(argc: var int32, argv: ptr cstringArray){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_init".} -proc gl_query_gl_extension*(extension: cstring): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_query_gl_extension".} -proc gl_get_proc_address*(proc_name: cstring): TGLProc{.cdecl, dynlib: GLExtLib, - 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 - GL_MODE_RGB* = 0 - GL_MODE_RGBA* = 0 - GL_MODE_INDEX* = 1 shl 0 - GL_MODE_SINGLE* = 0 - GL_MODE_DOUBLE* = 1 shl 1 - GL_MODE_STEREO* = 1 shl 2 - GL_MODE_ALPHA* = 1 shl 3 - GL_MODE_DEPTH* = 1 shl 4 - GL_MODE_STENCIL* = 1 shl 5 - GL_MODE_ACCUM* = 1 shl 6 - GL_MODE_MULTISAMPLE* = 1 shl 7 - -type - TGLConfigMode* = int32 - PGLConfigMode* = ptr TGLConfigMode - -proc TYPE_GL_CONFIG*(): GType -proc GL_CONFIG*(anObject: Pointer): PGLConfig -proc GL_CONFIG_CLASS*(klass: Pointer): PGLConfigClass -proc IS_GL_CONFIG*(anObject: Pointer): bool -proc IS_GL_CONFIG_CLASS*(klass: Pointer): bool -proc GL_CONFIG_GET_CLASS*(obj: Pointer): PGLConfigClass -proc gl_config_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_get_type".} -proc get_screen*(glconfig: PGLConfig): PScreen{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_get_screen".} -proc get_attrib*(glconfig: PGLConfig, attribute: int, value: var cint): gboolean{. - cdecl, dynlib: GLExtLib, importc: "gdk_gl_config_get_attrib".} -proc get_colormap*(glconfig: PGLConfig): PColormap{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_get_colormap".} -proc get_visual*(glconfig: PGLConfig): PVisual{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_get_visual".} -proc get_depth*(glconfig: PGLConfig): gint{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_get_depth".} -proc get_layer_plane*(glconfig: PGLConfig): gint{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_get_layer_plane".} -proc get_n_aux_buffers*(glconfig: PGLConfig): gint{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_get_n_aux_buffers".} -proc get_n_sample_buffers*(glconfig: PGLConfig): gint{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_get_n_sample_buffers".} -proc is_rgba*(glconfig: PGLConfig): gboolean{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_config_is_rgba".} -proc is_double_buffered*(glconfig: PGLConfig): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_is_double_buffered".} -proc is_stereo*(glconfig: PGLConfig): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_is_stereo".} -proc has_alpha*(glconfig: PGLConfig): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_has_alpha".} -proc has_depth_buffer*(glconfig: PGLConfig): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_has_depth_buffer".} -proc has_stencil_buffer*(glconfig: PGLConfig): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_has_stencil_buffer".} -proc has_accum_buffer*(glconfig: PGLConfig): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_config_has_accum_buffer".} -proc TYPE_GL_CONTEXT*(): GType -proc GL_CONTEXT*(anObject: Pointer): PGLContext -proc GL_CONTEXT_CLASS*(klass: Pointer): PGLContextClass -proc IS_GL_CONTEXT*(anObject: Pointer): bool -proc IS_GL_CONTEXT_CLASS*(klass: Pointer): bool -proc GL_CONTEXT_GET_CLASS*(obj: Pointer): PGLContextClass -proc gl_context_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_context_get_type".} -proc context_new*(gldrawable: PGLDrawable, share_list: PGLContext, - direct: gboolean, render_type: int32): PGLContext{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_context_new".} -proc destroy*(glcontext: PGLContext){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_context_destroy".} -proc copy*(glcontext: PGLContext, src: PGLContext, mask: int32): gboolean{. - cdecl, dynlib: GLExtLib, importc: "gdk_gl_context_copy".} -proc get_gl_drawable*(glcontext: PGLContext): PGLDrawable{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_context_get_gl_drawable".} -proc get_gl_config*(glcontext: PGLContext): PGLConfig{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_context_get_gl_config".} -proc get_share_list*(glcontext: PGLContext): PGLContext{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_context_get_share_list".} -proc is_direct*(glcontext: PGLContext): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_context_is_direct".} -proc get_render_type*(glcontext: PGLContext): int32{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_context_get_render_type".} -proc gl_context_get_current*(): PGLContext{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_context_get_current".} -proc TYPE_GL_DRAWABLE*(): GType -proc GL_DRAWABLE*(inst: Pointer): PGLDrawable -proc GL_DRAWABLE_CLASS*(vtable: Pointer): PGLDrawableClass -proc IS_GL_DRAWABLE*(inst: Pointer): bool -proc IS_GL_DRAWABLE_CLASS*(vtable: Pointer): bool -proc GL_DRAWABLE_GET_CLASS*(inst: Pointer): PGLDrawableClass -proc gl_drawable_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_get_type".} -proc make_current*(gldrawable: PGLDrawable, glcontext: PGLContext): gboolean{. - cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_make_current".} -proc is_double_buffered*(gldrawable: PGLDrawable): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_drawable_is_double_buffered".} -proc swap_buffers*(gldrawable: PGLDrawable){.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_drawable_swap_buffers".} -proc wait_gl*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_wait_gl".} -proc wait_gdk*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_wait_gdk".} -proc gl_begin*(gldrawable: PGLDrawable, glcontext: PGLContext): gboolean{. - cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_gl_begin".} -proc gl_end*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_gl_end".} -proc get_gl_config*(gldrawable: PGLDrawable): PGLConfig{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_drawable_get_gl_config".} -proc get_size*(gldrawable: PGLDrawable, width, height: PGInt){. - cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_get_size".} -proc gl_drawable_get_current*(): PGLDrawable{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_drawable_get_current".} -proc TYPE_GL_PIXMAP*(): GType -proc GL_PIXMAP*(anObject: Pointer): PGLPixmap -proc GL_PIXMAP_CLASS*(klass: Pointer): PGLPixmapClass -proc IS_GL_PIXMAP*(anObject: Pointer): bool -proc IS_GL_PIXMAP_CLASS*(klass: Pointer): bool -proc GL_PIXMAP_GET_CLASS*(obj: Pointer): PGLPixmapClass -proc gl_pixmap_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_pixmap_get_type".} -proc pixmap_new*(glconfig: PGLConfig, pixmap: PPixmap, attrib_list: ptr int32): PGLPixmap{. - cdecl, dynlib: GLExtLib, importc: "gdk_gl_pixmap_new".} -proc destroy*(glpixmap: PGLPixmap){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_pixmap_destroy".} -proc get_pixmap*(glpixmap: PGLPixmap): PPixmap{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_pixmap_get_pixmap".} -proc set_gl_capability*(pixmap: PPixmap, glconfig: PGLConfig, - attrib_list: ptr int32): PGLPixmap{.cdecl, - dynlib: GLExtLib, importc: "gdk_pixmap_set_gl_capability".} -proc unset_gl_capability*(pixmap: PPixmap){.cdecl, dynlib: GLExtLib, - importc: "gdk_pixmap_unset_gl_capability".} -proc is_gl_capable*(pixmap: PPixmap): gboolean{.cdecl, dynlib: GLExtLib, - importc: "gdk_pixmap_is_gl_capable".} -proc get_gl_pixmap*(pixmap: PPixmap): PGLPixmap{.cdecl, dynlib: GLExtLib, - importc: "gdk_pixmap_get_gl_pixmap".} -proc get_gl_drawable*(pixmap: PPixmap): PGLDrawable -proc TYPE_GL_WINDOW*(): GType -proc GL_WINDOW*(anObject: Pointer): PGLWindow -proc GL_WINDOW_CLASS*(klass: Pointer): PGLWindowClass -proc IS_GL_WINDOW*(anObject: Pointer): bool -proc IS_GL_WINDOW_CLASS*(klass: Pointer): bool -proc GL_WINDOW_GET_CLASS*(obj: Pointer): PGLWindowClass -proc gl_window_get_type*(): GType{.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_window_get_type".} -proc window_new*(glconfig: PGLConfig, window: PWindow, attrib_list: ptr int32): PGLWindow{. - cdecl, dynlib: GLExtLib, importc: "gdk_gl_window_new".} -proc destroy*(glwindow: PGLWindow){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_window_destroy".} -proc get_window*(glwindow: PGLWindow): PWindow{.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_window_get_window".} -proc set_gl_capability*(window: PWindow, glconfig: PGLConfig, - attrib_list: ptr int32): PGLWindow{.cdecl, - dynlib: GLExtLib, importc: "gdk_window_set_gl_capability".} -proc unset_gl_capability*(window: PWindow){.cdecl, dynlib: GLExtLib, - importc: "gdk_window_unset_gl_capability".} -proc is_gl_capable*(window: PWindow): gboolean{.cdecl, dynlib: GLExtLib, - importc: "gdk_window_is_gl_capable".} -proc get_gl_window*(window: PWindow): PGLWindow{.cdecl, dynlib: GLExtLib, - importc: "gdk_window_get_gl_window".} -proc get_gl_drawable*(window: PWindow): PGLDrawable -proc gl_draw_cube*(solid: gboolean, size: float64){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_draw_cube".} -proc gl_draw_sphere*(solid: gboolean, radius: float64, slices: int32, - stacks: int32){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_draw_sphere".} -proc gl_draw_cone*(solid: gboolean, base: float64, height: float64, - slices: int32, stacks: int32){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_draw_cone".} -proc gl_draw_torus*(solid: gboolean, inner_radius: float64, - outer_radius: float64, nsides: int32, rings: int32){.cdecl, - dynlib: GLExtLib, importc: "gdk_gl_draw_torus".} -proc gl_draw_tetrahedron*(solid: gboolean){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_draw_tetrahedron".} -proc gl_draw_octahedron*(solid: gboolean){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_draw_octahedron".} -proc gl_draw_dodecahedron*(solid: gboolean){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_draw_dodecahedron".} -proc gl_draw_icosahedron*(solid: gboolean){.cdecl, dynlib: GLExtLib, - importc: "gdk_gl_draw_icosahedron".} -proc gl_draw_teapot*(solid: gboolean, scale: float64){.cdecl, dynlib: GLExtLib, - 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 TYPE_GL_CONFIG*(): GType = - result = gl_config_get_type() - -proc GL_CONFIG*(anObject: Pointer): PGLConfig = - result = cast[PGLConfig](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_GL_CONFIG())) - -proc GL_CONFIG_CLASS*(klass: Pointer): PGLConfigClass = - result = cast[PGLConfigClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_GL_CONFIG())) - -proc IS_GL_CONFIG*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GL_CONFIG()) - -proc IS_GL_CONFIG_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GL_CONFIG()) - -proc GL_CONFIG_GET_CLASS*(obj: Pointer): PGLConfigClass = - result = cast[PGLConfigClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_GL_CONFIG())) - -proc TYPE_GL_CONTEXT*(): GType = - result = gl_context_get_type() - -proc GL_CONTEXT*(anObject: Pointer): PGLContext = - result = cast[PGLContext](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_GL_CONTEXT())) - -proc GL_CONTEXT_CLASS*(klass: Pointer): PGLContextClass = - result = cast[PGLContextClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_GL_CONTEXT())) - -proc IS_GL_CONTEXT*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GL_CONTEXT()) - -proc IS_GL_CONTEXT_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GL_CONTEXT()) - -proc GL_CONTEXT_GET_CLASS*(obj: Pointer): PGLContextClass = - result = cast[PGLContextClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_GL_CONTEXT())) - -proc TYPE_GL_DRAWABLE*(): GType = - result = gl_drawable_get_type() - -proc GL_DRAWABLE*(inst: Pointer): PGLDrawable = - result = cast[PGLDrawable](G_TYPE_CHECK_INSTANCE_CAST(inst, TYPE_GL_DRAWABLE())) - -proc GL_DRAWABLE_CLASS*(vtable: Pointer): PGLDrawableClass = - result = cast[PGLDrawableClass](G_TYPE_CHECK_CLASS_CAST(vtable, - TYPE_GL_DRAWABLE())) - -proc IS_GL_DRAWABLE*(inst: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(inst, TYPE_GL_DRAWABLE()) - -proc IS_GL_DRAWABLE_CLASS*(vtable: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(vtable, TYPE_GL_DRAWABLE()) - -proc GL_DRAWABLE_GET_CLASS*(inst: Pointer): PGLDrawableClass = - result = cast[PGLDrawableClass](G_TYPE_INSTANCE_GET_INTERFACE(inst, - TYPE_GL_DRAWABLE())) - -proc TYPE_GL_PIXMAP*(): GType = - result = gl_pixmap_get_type() - -proc GL_PIXMAP*(anObject: Pointer): PGLPixmap = - result = cast[PGLPixmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_GL_PIXMAP())) - -proc GL_PIXMAP_CLASS*(klass: Pointer): PGLPixmapClass = - result = cast[PGLPixmapClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_GL_PIXMAP())) - -proc IS_GL_PIXMAP*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GL_PIXMAP()) - -proc IS_GL_PIXMAP_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GL_PIXMAP()) - -proc GL_PIXMAP_GET_CLASS*(obj: Pointer): PGLPixmapClass = - result = cast[PGLPixmapClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_GL_PIXMAP())) - -proc get_gl_drawable*(pixmap: PPixmap): PGLDrawable = - result = GL_DRAWABLE(get_gl_pixmap(pixmap)) - -proc TYPE_GL_WINDOW*(): GType = - result = gl_window_get_type() - -proc GL_WINDOW*(anObject: Pointer): PGLWindow = - result = cast[PGLWindow](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_GL_WINDOW())) - -proc GL_WINDOW_CLASS*(klass: Pointer): PGLWindowClass = - result = cast[PGLWindowClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_GL_WINDOW())) - -proc IS_GL_WINDOW*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GL_WINDOW()) - -proc IS_GL_WINDOW_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GL_WINDOW()) - -proc GL_WINDOW_GET_CLASS*(obj: Pointer): PGLWindowClass = - result = cast[PGLWindowClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_GL_WINDOW())) - -proc get_gl_drawable*(window: PWindow): PGLDrawable = - result = GL_DRAWABLE(get_gl_window(window)) diff --git a/lib/wrappers/gtk/glib2.nim b/lib/wrappers/gtk/glib2.nim deleted file mode 100644 index 3fa672c85d..0000000000 --- a/lib/wrappers/gtk/glib2.nim +++ /dev/null @@ -1,4540 +0,0 @@ -{.deadCodeElim: on.} -when defined(windows): - const - gliblib = "libglib-2.0-0.dll" - gmodulelib = "libgmodule-2.0-0.dll" - gobjectlib = "libgobject-2.0-0.dll" -elif defined(macosx): - const - gliblib = "libglib-2.0.dylib" - gmodulelib = "libgmodule-2.0.dylib" - gobjectlib = "libgobject-2.0.dylib" -else: - const - gliblib = "libglib-2.0.so(|.0)" - gmodulelib = "libgmodule-2.0.so(|.0)" - gobjectlib = "libgobject-2.0.so(|.0)" -# gthreadlib = "libgthread-2.0.so" - -type - PGTypePlugin* = pointer - PGParamSpecPool* = pointer - PPchar* = ptr cstring - PPPchar* = ptr PPchar - PPPgchar* = ptr PPgchar - PPgchar* = ptr cstring - gchar* = char - gshort* = cshort - glong* = clong - gint* = cint - gboolean* = distinct gint - guchar* = char - gushort* = int16 - gulong* = int - guint* = cint - gfloat* = cfloat - gdouble* = cdouble - gpointer* = pointer - Pgshort* = ptr gshort - Pglong* = ptr glong - Pgint* = ptr gint - PPgint* = ptr Pgint - Pgboolean* = ptr gboolean - Pguchar* = ptr guchar - PPguchar* = ptr Pguchar - Pgushort* = ptr gushort - Pgulong* = ptr gulong - Pguint* = ptr guint - Pgfloat* = ptr gfloat - Pgdouble* = ptr gdouble - 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*{.final.} = object - 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*{.final.} = object - v_double*: gdouble - - GType* = gulong - PGType* = ptr GType - PGTypeClass* = ptr TGTypeClass - TGTypeClass*{.final.} = object - g_type*: GType - - PGTypeInstance* = ptr TGTypeInstance - TGTypeInstance*{.final.} = object - g_class*: PGTypeClass - - PGTypeInterface* = ptr TGTypeInterface - TGTypeInterface*{.pure, inheritable.} = object - g_type*: GType - g_instance_type*: GType - - PGTypeQuery* = ptr TGTypeQuery - TGTypeQuery*{.final.} = object - theType*: GType - type_name*: cstring - class_size*: guint - instance_size*: guint - - PGValue* = ptr TGValue - TGValue*{.final.} = object - g_type*: GType - data*: array[0..1, gdouble] - - PGData* = pointer - PPGData* = ptr PGData - PGSList* = ptr TGSList - PPGSList* = ptr PGSList - TGSList*{.final.} = object - data*: gpointer - next*: PGSList - - PGList* = ptr TGList - TGList*{.final.} = object - data*: gpointer - next*: PGList - prev*: PGList - - TGParamFlags* = int32 - PGParamFlags* = ptr TGParamFlags - PGParamSpec* = ptr TGParamSpec - PPGParamSpec* = ptr PGParamSpec - TGParamSpec*{.final.} = object - 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*{.final.} = object - 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*{.final.} = object - 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 - -converter gbool*(nimbool: bool): gboolean = - return ord(nimbool).gboolean - -converter toBool*(gbool: gboolean): bool = - return int(gbool) == 1 - -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) - -const - G_PRIORITY_HIGH_IDLE* = 100 - G_PRIORITY_DEFAULT_IDLE* = 200 - G_PRIORITY_LOW* = 300 - G_PRIORITY_HIGH* = -100 - G_PRIORITY_DEFAULT* = 0 - - -proc G_TYPE_MAKE_FUNDAMENTAL*(x: int): 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 - TGTypeDebugFlags* = int32 - PGTypeDebugFlags* = ptr TGTypeDebugFlags - -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*(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 - TGTypeFlags* = int32 - PGTypeFlags* = ptr TGTypeFlags - -const - G_TYPE_FLAG_ABSTRACT* = 1 shl 4 - G_TYPE_FLAG_VALUE_ABSTRACT* = 1 shl 5 - -type - PGTypeValueTable* = ptr TGTypeValueTable - TGTypeValueTable*{.final.} = object - 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*{.final.} = object - 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*{.final.} = object - type_flags*: TGTypeFundamentalFlags - - PGInterfaceInfo* = ptr TGInterfaceInfo - TGInterfaceInfo*{.final.} = object - 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 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 name_from_instance*(instance: PGTypeInstance): cstring{.cdecl, - dynlib: gobjectlib, importc: "g_type_name_from_instance".} -proc 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 init*(value: PGValue, g_type: GType): PGValue{.cdecl, - dynlib: gobjectlib, importc: "g_value_init".} -proc copy*(src_value: PGValue, dest_value: PGValue){.cdecl, - dynlib: gobjectlib, importc: "g_value_copy".} -proc reset*(value: PGValue): PGValue{.cdecl, dynlib: gobjectlib, - importc: "g_value_reset".} -proc unset*(value: PGValue){.cdecl, dynlib: gobjectlib, - importc: "g_value_unset".} -proc set_instance*(value: PGValue, instance: gpointer){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_instance".} -proc fits_pointer*(value: PGValue): gboolean{.cdecl, dynlib: gobjectlib, - importc: "g_value_fits_pointer".} -proc 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 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*{.final.} = object - n_values*: guint - values*: PGValue - n_prealloced*: guint - - -proc 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 array_free*(value_array: PGValueArray){.cdecl, dynlib: gobjectlib, - importc: "g_value_array_free".} -proc array_copy*(value_array: PGValueArray): PGValueArray{.cdecl, - dynlib: gobjectlib, importc: "g_value_array_copy".} -proc array_prepend*(value_array: PGValueArray, value: PGValue): PGValueArray{. - cdecl, dynlib: gobjectlib, importc: "g_value_array_prepend".} -proc array_append*(value_array: PGValueArray, value: PGValue): PGValueArray{. - cdecl, dynlib: gobjectlib, importc: "g_value_array_append".} -proc array_insert*(value_array: PGValueArray, index: guint, - value: PGValue): PGValueArray{.cdecl, - dynlib: gobjectlib, importc: "g_value_array_insert".} -proc array_remove*(value_array: PGValueArray, index: guint): PGValueArray{. - cdecl, dynlib: gobjectlib, importc: "g_value_array_remove".} -proc array_sort*(value_array: PGValueArray, compare_func: TGCompareFunc): PGValueArray{. - cdecl, dynlib: gobjectlib, importc: "g_value_array_sort".} -proc array_sort*(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 HOLDS_CHAR*(value: PGValue): bool -proc HOLDS_UCHAR*(value: PGValue): bool -proc HOLDS_BOOLEAN*(value: PGValue): bool -proc HOLDS_INT*(value: PGValue): bool -proc HOLDS_UINT*(value: PGValue): bool -proc HOLDS_LONG*(value: PGValue): bool -proc HOLDS_ULONG*(value: PGValue): bool -proc HOLDS_INT64*(value: PGValue): bool -proc HOLDS_UINT64*(value: PGValue): bool -proc HOLDS_FLOAT*(value: PGValue): bool -proc HOLDS_DOUBLE*(value: PGValue): bool -proc HOLDS_STRING*(value: PGValue): bool -proc HOLDS_POINTER*(value: PGValue): bool -proc set_char*(value: PGValue, v_char: gchar){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_char".} -proc get_char*(value: PGValue): gchar{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_char".} -proc set_uchar*(value: PGValue, v_uchar: guchar){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_uchar".} -proc get_uchar*(value: PGValue): guchar{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_uchar".} -proc set_boolean*(value: PGValue, v_boolean: gboolean){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_boolean".} -proc get_boolean*(value: PGValue): gboolean{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_boolean".} -proc set_int*(value: PGValue, v_int: gint){.cdecl, dynlib: gobjectlib, - importc: "g_value_set_int".} -proc get_int*(value: PGValue): gint{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_int".} -proc set_uint*(value: PGValue, v_uint: guint){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_uint".} -proc get_uint*(value: PGValue): guint{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_uint".} -proc set_long*(value: PGValue, v_long: glong){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_long".} -proc get_long*(value: PGValue): glong{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_long".} -proc set_ulong*(value: PGValue, v_ulong: gulong){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_ulong".} -proc get_ulong*(value: PGValue): gulong{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_ulong".} -proc set_int64*(value: PGValue, v_int64: gint64){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_int64".} -proc get_int64*(value: PGValue): gint64{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_int64".} -proc set_uint64*(value: PGValue, v_uint64: guint64){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_uint64".} -proc get_uint64*(value: PGValue): guint64{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_uint64".} -proc set_float*(value: PGValue, v_float: gfloat){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_float".} -proc get_float*(value: PGValue): gfloat{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_float".} -proc set_double*(value: PGValue, v_double: gdouble){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_double".} -proc get_double*(value: PGValue): gdouble{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_double".} -proc set_string*(value: PGValue, v_string: cstring){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_string".} -proc set_static_string*(value: PGValue, v_string: cstring){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_static_string".} -proc get_string*(value: PGValue): cstring{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_string".} -proc dup_string*(value: PGValue): cstring{.cdecl, dynlib: gobjectlib, - importc: "g_value_dup_string".} -proc set_pointer*(value: PGValue, v_pointer: gpointer){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_pointer".} -proc 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 strdup_value_contents*(value: PGValue): cstring{.cdecl, - dynlib: gobjectlib, importc: "g_strdup_value_contents".} -proc set_string_take_ownership*(value: PGValue, v_string: cstring){. - cdecl, dynlib: gobjectlib, importc: "g_value_set_string_take_ownership".} -type - Tgchararray* = gchar - Pgchararray* = ptr Tgchararray - -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 spec_ref*(pspec: PGParamSpec): PGParamSpec{.cdecl, dynlib: gliblib, - importc: "g_param_spec_ref".} -proc spec_unref*(pspec: PGParamSpec){.cdecl, dynlib: gliblib, - importc: "g_param_spec_unref".} -proc spec_sink*(pspec: PGParamSpec){.cdecl, dynlib: gliblib, - importc: "g_param_spec_sink".} -proc spec_get_qdata*(pspec: PGParamSpec, quark: TGQuark): gpointer{. - cdecl, dynlib: gliblib, importc: "g_param_spec_get_qdata".} -proc spec_set_qdata*(pspec: PGParamSpec, quark: TGQuark, data: gpointer){. - cdecl, dynlib: gliblib, importc: "g_param_spec_set_qdata".} -proc spec_set_qdata_full*(pspec: PGParamSpec, quark: TGQuark, - data: gpointer, destroy: TGDestroyNotify){. - cdecl, dynlib: gliblib, importc: "g_param_spec_set_qdata_full".} -proc spec_steal_qdata*(pspec: PGParamSpec, quark: TGQuark): gpointer{. - cdecl, dynlib: gliblib, importc: "g_param_spec_steal_qdata".} -proc value_set_default*(pspec: PGParamSpec, value: PGValue){.cdecl, - dynlib: gliblib, importc: "g_param_value_set_default".} -proc value_defaults*(pspec: PGParamSpec, value: PGValue): gboolean{. - cdecl, dynlib: gliblib, importc: "g_param_value_defaults".} -proc value_validate*(pspec: PGParamSpec, value: PGValue): gboolean{. - cdecl, dynlib: gliblib, importc: "g_param_value_validate".} -proc value_convert*(pspec: PGParamSpec, src_value: PGValue, - dest_value: PGValue, strict_validation: gboolean): gboolean{. - cdecl, dynlib: gliblib, importc: "g_param_value_convert".} -proc values_cmp*(pspec: PGParamSpec, value1: PGValue, value2: PGValue): gint{. - cdecl, dynlib: gliblib, importc: "g_param_values_cmp".} -proc spec_get_name*(pspec: PGParamSpec): cstring{.cdecl, - dynlib: gliblib, importc: "g_param_spec_get_name".} -proc spec_get_nick*(pspec: PGParamSpec): cstring{.cdecl, - dynlib: gliblib, importc: "g_param_spec_get_nick".} -proc spec_get_blurb*(pspec: PGParamSpec): cstring{.cdecl, - dynlib: gliblib, importc: "g_param_spec_get_blurb".} -proc set_param*(value: PGValue, param: PGParamSpec){.cdecl, - dynlib: gliblib, importc: "g_value_set_param".} -proc get_param*(value: PGValue): PGParamSpec{.cdecl, dynlib: gliblib, - importc: "g_value_get_param".} -proc dup_param*(value: PGValue): PGParamSpec{.cdecl, dynlib: gliblib, - importc: "g_value_dup_param".} -proc set_param_take_ownership*(value: PGValue, param: PGParamSpec){. - cdecl, dynlib: gliblib, importc: "g_value_set_param_take_ownership".} -type - PGParamSpecTypeInfo* = ptr TGParamSpecTypeInfo - TGParamSpecTypeInfo*{.final.} = object - 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 spec_pool_insert*(pool: PGParamSpecPool, pspec: PGParamSpec, - owner_type: GType){.cdecl, dynlib: gliblib, - importc: "g_param_spec_pool_insert".} -proc spec_pool_remove*(pool: PGParamSpecPool, pspec: PGParamSpec){. - cdecl, dynlib: gliblib, importc: "g_param_spec_pool_remove".} -proc 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 spec_pool_list_owned*(pool: PGParamSpecPool, owner_type: GType): PGList{. - cdecl, dynlib: gliblib, importc: "g_param_spec_pool_list_owned".} -proc 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*{.final.} = object - 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*{.final.} = object - data*: gpointer - notify*: TGClosureNotify - - -proc G_CLOSURE_NEEDS_MARSHAL*(closure: Pointer): bool -proc N_NOTIFIERS*(cl: PGClosure): int32 -proc CCLOSURE_SWAP_DATA*(cclosure: PGClosure): int32 -proc G_CALLBACK*(f: pointer): TGCallback -const - bm_TGClosure_ref_count* = 0x00007FFF'i32 - bp_TGClosure_ref_count* = 0'i32 - bm_TGClosure_meta_marshal* = 0x00008000'i32 - bp_TGClosure_meta_marshal* = 15'i32 - bm_TGClosure_n_guards* = 0x00010000'i32 - bp_TGClosure_n_guards* = 16'i32 - bm_TGClosure_n_fnotifiers* = 0x00060000'i32 - bp_TGClosure_n_fnotifiers* = 17'i32 - bm_TGClosure_n_inotifiers* = 0x07F80000'i32 - bp_TGClosure_n_inotifiers* = 19'i32 - bm_TGClosure_in_inotify* = 0x08000000'i32 - bp_TGClosure_in_inotify* = 27'i32 - bm_TGClosure_floating* = 0x10000000'i32 - bp_TGClosure_floating* = 28'i32 - bm_TGClosure_derivative_flag* = 0x20000000'i32 - bp_TGClosure_derivative_flag* = 29'i32 - bm_TGClosure_in_marshal* = 0x40000000'i32 - bp_TGClosure_in_marshal* = 30'i32 - bm_TGClosure_is_invalid* = 0x80000000'i32 - bp_TGClosure_is_invalid* = 31'i32 - -proc ref_count*(a: PGClosure): guint -proc set_ref_count*(a: PGClosure, ref_count: guint) -proc meta_marshal*(a: PGClosure): guint -proc set_meta_marshal*(a: PGClosure, meta_marshal: guint) -proc n_guards*(a: PGClosure): guint -proc set_n_guards*(a: PGClosure, n_guards: guint) -proc n_fnotifiers*(a: PGClosure): guint -proc set_n_fnotifiers*(a: PGClosure, n_fnotifiers: guint) -proc n_inotifiers*(a: PGClosure): guint -proc in_inotify*(a: PGClosure): guint -proc set_in_inotify*(a: PGClosure, in_inotify: guint) -proc floating*(a: PGClosure): guint -proc set_floating*(a: PGClosure, floating: guint) -proc derivative_flag*(a: PGClosure): guint -proc set_derivative_flag*(a: PGClosure, derivative_flag: guint) -proc in_marshal*(a: PGClosure): guint -proc set_in_marshal*(a: PGClosure, in_marshal: guint) -proc is_invalid*(a: PGClosure): guint -proc set_is_invalid*(a: PGClosure, is_invalid: guint) -type - PGCClosure* = ptr TGCClosure - TGCClosure*{.final.} = object - 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 reference*(closure: PGClosure): PGClosure{.cdecl, dynlib: gliblib, - importc: "g_closure_ref".} -proc sink*(closure: PGClosure){.cdecl, dynlib: gliblib, - importc: "g_closure_sink".} -proc 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 add_finalize_notifier*(closure: PGClosure, notify_data: gpointer, - notify_func: TGClosureNotify){.cdecl, - dynlib: gliblib, importc: "g_closure_add_finalize_notifier".} -proc remove_finalize_notifier*(closure: PGClosure, - notify_data: gpointer, notify_func: TGClosureNotify){.cdecl, - dynlib: gliblib, importc: "g_closure_remove_finalize_notifier".} -proc add_invalidate_notifier*(closure: PGClosure, - notify_data: gpointer, - notify_func: TGClosureNotify){.cdecl, - dynlib: gliblib, importc: "g_closure_add_invalidate_notifier".} -proc remove_invalidate_notifier*(closure: PGClosure, - notify_data: gpointer, notify_func: TGClosureNotify){.cdecl, - dynlib: gliblib, importc: "g_closure_remove_invalidate_notifier".} -proc 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 set_marshal*(closure: PGClosure, marshal: TGClosureMarshal){. - cdecl, dynlib: gliblib, importc: "g_closure_set_marshal".} -proc set_meta_marshal*(closure: PGClosure, marshal_data: gpointer, - meta_marshal: TGClosureMarshal){.cdecl, - dynlib: gliblib, importc: "g_closure_set_meta_marshal".} -proc invalidate*(closure: PGClosure){.cdecl, dynlib: gliblib, - importc: "g_closure_invalidate".} -proc 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*{.final.} = object - signal_id*: guint - detail*: TGQuark - run_type*: TGSignalFlags - - PGSignalQuery* = ptr TGSignalQuery - TGSignalQuery*{.final.} = object - 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 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 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*{.final.} = object - 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 plugin_use*(plugin: PGTypePlugin){.cdecl, dynlib: gliblib, - importc: "g_type_plugin_use".} -proc plugin_unuse*(plugin: PGTypePlugin){.cdecl, dynlib: gliblib, - importc: "g_type_plugin_unuse".} -proc 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 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, inheritable.} = 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, inheritable.} = 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*{.final.} = object - 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 class_install_property*(oclass: PGObjectClass, property_id: guint, - pspec: PGParamSpec){.cdecl, - dynlib: gobjectlib, importc: "g_object_class_install_property".} -proc class_find_property*(oclass: PGObjectClass, property_name: cstring): PGParamSpec{. - cdecl, dynlib: gobjectlib, importc: "g_object_class_find_property".} -proc class_list_properties*(oclass: PGObjectClass, n_properties: Pguint): PPGParamSpec{. - cdecl, dynlib: gobjectlib, importc: "g_object_class_list_properties".} -proc set_property*(anObject: PGObject, property_name: cstring, - value: PGValue){.cdecl, dynlib: gobjectlib, - importc: "g_object_set_property".} -proc get_property*(anObject: PGObject, property_name: cstring, - value: PGValue){.cdecl, dynlib: gobjectlib, - importc: "g_object_get_property".} -proc freeze_notify*(anObject: PGObject){.cdecl, dynlib: gobjectlib, - importc: "g_object_freeze_notify".} -proc notify*(anObject: PGObject, property_name: cstring){.cdecl, - dynlib: gobjectlib, importc: "g_object_notify".} -proc 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 weak_ref*(anObject: PGObject, notify: TGWeakNotify, data: gpointer){. - cdecl, dynlib: gobjectlib, importc: "g_object_weak_ref".} -proc weak_unref*(anObject: PGObject, notify: TGWeakNotify, - data: gpointer){.cdecl, dynlib: gobjectlib, - importc: "g_object_weak_unref".} -proc add_weak_pointer*(anObject: PGObject, - weak_pointer_location: Pgpointer){.cdecl, - dynlib: gobjectlib, importc: "g_object_add_weak_pointer".} -proc remove_weak_pointer*(anObject: PGObject, - weak_pointer_location: Pgpointer){.cdecl, - dynlib: gobjectlib, importc: "g_object_remove_weak_pointer".} -proc get_qdata*(anObject: PGObject, quark: TGQuark): gpointer{.cdecl, - dynlib: gobjectlib, importc: "g_object_get_qdata".} -proc set_qdata*(anObject: PGObject, quark: TGQuark, data: gpointer){. - cdecl, dynlib: gobjectlib, importc: "g_object_set_qdata".} -proc set_qdata_full*(anObject: PGObject, quark: TGQuark, - data: gpointer, destroy: TGDestroyNotify){.cdecl, - dynlib: gobjectlib, importc: "g_object_set_qdata_full".} -proc steal_qdata*(anObject: PGObject, quark: TGQuark): gpointer{.cdecl, - dynlib: gobjectlib, importc: "g_object_steal_qdata".} -proc get_data*(anObject: PGObject, key: cstring): gpointer{.cdecl, - dynlib: gobjectlib, importc: "g_object_get_data".} -proc set_data*(anObject: PGObject, key: cstring, data: gpointer){. - cdecl, dynlib: gobjectlib, importc: "g_object_set_data".} -proc set_data_full*(anObject: PGObject, key: cstring, data: gpointer, - destroy: TGDestroyNotify){.cdecl, - dynlib: gobjectlib, importc: "g_object_set_data_full".} -proc steal_data*(anObject: PGObject, key: cstring): gpointer{.cdecl, - dynlib: gobjectlib, importc: "g_object_steal_data".} -proc 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 set_object*(value: PGValue, v_object: gpointer){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_object".} -proc get_object*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_object".} -proc 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 run_dispose*(anObject: PGObject){.cdecl, dynlib: gobjectlib, - importc: "g_object_run_dispose".} -proc 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.71828 - G_LN2* = 0.693147 - G_LN10* = 2.30259 - G_PI* = 3.14159 - G_PI_2* = 1.57080 - G_PI_4* = 0.785398 - G_SQRT2* = 1.41421 - 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*{.final.} = object - g_type_class*: TGTypeClass - minimum*: gint - maximum*: gint - n_values*: guint - values*: PGEnumValue - - TGEnumValue*{.final.} = object - value*: gint - value_name*: cstring - value_nick*: cstring - - PGFlagsClass* = ptr TGFlagsClass - PGFlagsValue* = ptr TGFlagsValue - TGFlagsClass*{.final.} = object - g_type_class*: TGTypeClass - mask*: guint - n_values*: guint - values*: PGFlagsValue - - TGFlagsValue*{.final.} = object - 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 get_value*(enum_class: PGEnumClass, value: gint): PGEnumValue{. - cdecl, dynlib: gliblib, importc: "g_enum_get_value".} -proc get_value_by_name*(enum_class: PGEnumClass, name: cstring): PGEnumValue{. - cdecl, dynlib: gliblib, importc: "g_enum_get_value_by_name".} -proc get_value_by_nick*(enum_class: PGEnumClass, nick: cstring): PGEnumValue{. - cdecl, dynlib: gliblib, importc: "g_enum_get_value_by_nick".} -proc get_first_value*(flags_class: PGFlagsClass, value: guint): PGFlagsValue{. - cdecl, dynlib: gliblib, importc: "g_flags_get_first_value".} -proc get_value_by_name*(flags_class: PGFlagsClass, name: cstring): PGFlagsValue{. - cdecl, dynlib: gliblib, importc: "g_flags_get_value_by_name".} -proc get_value_by_nick*(flags_class: PGFlagsClass, nick: cstring): PGFlagsValue{. - cdecl, dynlib: gliblib, importc: "g_flags_get_value_by_nick".} -proc set_enum*(value: PGValue, v_enum: gint){.cdecl, dynlib: gliblib, - importc: "g_value_set_enum".} -proc get_enum*(value: PGValue): gint{.cdecl, dynlib: gliblib, - importc: "g_value_get_enum".} -proc set_flags*(value: PGValue, v_flags: guint){.cdecl, dynlib: gliblib, - importc: "g_value_set_flags".} -proc 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.00000 - G_MAXFLOAT* = 1.70000e+308 - 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* = - 1 - 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*{.final.} = object - 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*{.final.} = object - 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 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*{.final.} = object - 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 table_destroy*(hash_table: PGHashTable){.cdecl, dynlib: gliblib, - importc: "g_hash_table_destroy".} -proc table_insert*(hash_table: PGHashTable, key: gpointer, - value: gpointer){.cdecl, dynlib: gliblib, - importc: "g_hash_table_insert".} -proc table_replace*(hash_table: PGHashTable, key: gpointer, - value: gpointer){.cdecl, dynlib: gliblib, - importc: "g_hash_table_replace".} -proc table_remove*(hash_table: PGHashTable, key: gconstpointer): gboolean{. - cdecl, dynlib: gliblib, importc: "g_hash_table_remove".} -proc table_steal*(hash_table: PGHashTable, key: gconstpointer): gboolean{. - cdecl, dynlib: gliblib, importc: "g_hash_table_steal".} -proc table_lookup*(hash_table: PGHashTable, key: gconstpointer): gpointer{. - cdecl, dynlib: gliblib, importc: "g_hash_table_lookup".} -proc 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 table_foreach*(hash_table: PGHashTable, func: TGHFunc, - user_data: gpointer){.cdecl, dynlib: gliblib, - importc: "g_hash_table_foreach".} -proc table_foreach_remove*(hash_table: PGHashTable, func: TGHRFunc, - user_data: gpointer): guint{.cdecl, - dynlib: gliblib, importc: "g_hash_table_foreach_remove".} -proc table_foreach_steal*(hash_table: PGHashTable, func: TGHRFunc, - user_data: gpointer): guint{.cdecl, - dynlib: gliblib, importc: "g_hash_table_foreach_steal".} -proc 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*{.final.} = object - 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 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 - -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 chunk_destroy*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib, - importc: "g_mem_chunk_destroy".} -proc chunk_alloc*(mem_chunk: PGMemChunk): gpointer{.cdecl, - dynlib: gliblib, importc: "g_mem_chunk_alloc".} -proc chunk_alloc0*(mem_chunk: PGMemChunk): gpointer{.cdecl, - dynlib: gliblib, importc: "g_mem_chunk_alloc0".} -proc chunk_free*(mem_chunk: PGMemChunk, mem: gpointer){.cdecl, - dynlib: gliblib, importc: "g_mem_chunk_free".} -proc chunk_clean*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib, - importc: "g_mem_chunk_clean".} -proc chunk_reset*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib, - importc: "g_mem_chunk_reset".} -proc 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 free*(allocator: PGAllocator){.cdecl, dynlib: gliblib, - importc: "g_allocator_free".} -const - G_ALLOCATOR_LIST* = 1 - G_ALLOCATOR_SLIST* = 2 - G_ALLOCATOR_NODE* = 3 - -proc 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 free*(list: PGSList){.cdecl, dynlib: gliblib, - importc: "g_slist_free".} -proc free_1*(list: PGSList){.cdecl, dynlib: gliblib, - importc: "g_slist_free_1".} -proc append*(list: PGSList, data: gpointer): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_append".} -proc prepend*(list: PGSList, data: gpointer): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_prepend".} -proc insert*(list: PGSList, data: gpointer, position: gint): PGSList{. - cdecl, dynlib: gliblib, importc: "g_slist_insert".} -proc insert_sorted*(list: PGSList, data: gpointer, func: TGCompareFunc): PGSList{. - cdecl, dynlib: gliblib, importc: "g_slist_insert_sorted".} -proc insert_before*(slist: PGSList, sibling: PGSList, data: gpointer): PGSList{. - cdecl, dynlib: gliblib, importc: "g_slist_insert_before".} -proc concat*(list1: PGSList, list2: PGSList): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_concat".} -proc remove*(list: PGSList, data: gconstpointer): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_remove".} -proc remove_all*(list: PGSList, data: gconstpointer): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_remove_all".} -proc remove_link*(list: PGSList, link: PGSList): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_remove_link".} -proc delete_link*(list: PGSList, link: PGSList): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_delete_link".} -proc reverse*(list: PGSList): PGSList{.cdecl, dynlib: gliblib, - importc: "g_slist_reverse".} -proc copy*(list: PGSList): PGSList{.cdecl, dynlib: gliblib, - importc: "g_slist_copy".} -proc nth*(list: PGSList, n: guint): PGSList{.cdecl, dynlib: gliblib, - importc: "g_slist_nth".} -proc find*(list: PGSList, data: gconstpointer): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_find".} -proc find_custom*(list: PGSList, data: gconstpointer, - func: TGCompareFunc): PGSList{.cdecl, dynlib: gliblib, - importc: "g_slist_find_custom".} -proc position*(list: PGSList, llink: PGSList): gint{.cdecl, - dynlib: gliblib, importc: "g_slist_position".} -proc index*(list: PGSList, data: gconstpointer): gint{.cdecl, - dynlib: gliblib, importc: "g_slist_index".} -proc last*(list: PGSList): PGSList{.cdecl, dynlib: gliblib, - importc: "g_slist_last".} -proc length*(list: PGSList): guint{.cdecl, dynlib: gliblib, - importc: "g_slist_length".} -proc foreach*(list: PGSList, func: TGFunc, user_data: gpointer){.cdecl, - dynlib: gliblib, importc: "g_slist_foreach".} -proc sort*(list: PGSList, compare_func: TGCompareFunc): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_sort".} -proc sort*(list: PGSList, compare_func: TGCompareDataFunc, - user_data: gpointer): PGSList{.cdecl, - dynlib: gliblib, importc: "g_slist_sort_with_data".} -proc nth_data*(list: PGSList, n: guint): gpointer{.cdecl, - dynlib: gliblib, importc: "g_slist_nth_data".} -proc next*(slist: PGSList): PGSList -proc 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 free*(list: PGList){.cdecl, dynlib: gliblib, importc: "g_list_free".} -proc free_1*(list: PGList){.cdecl, dynlib: gliblib, - importc: "g_list_free_1".} -proc append*(list: PGList, data: gpointer): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_append".} -proc prepend*(list: PGList, data: gpointer): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_prepend".} -proc insert*(list: PGList, data: gpointer, position: gint): PGList{. - cdecl, dynlib: gliblib, importc: "g_list_insert".} -proc insert_sorted*(list: PGList, data: gpointer, func: TGCompareFunc): PGList{. - cdecl, dynlib: gliblib, importc: "g_list_insert_sorted".} -proc insert_before*(list: PGList, sibling: PGList, data: gpointer): PGList{. - cdecl, dynlib: gliblib, importc: "g_list_insert_before".} -proc concat*(list1: PGList, list2: PGList): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_concat".} -proc remove*(list: PGList, data: gconstpointer): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_remove".} -proc remove_all*(list: PGList, data: gconstpointer): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_remove_all".} -proc remove_link*(list: PGList, llink: PGList): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_remove_link".} -proc delete_link*(list: PGList, link: PGList): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_delete_link".} -proc reverse*(list: PGList): PGList{.cdecl, dynlib: gliblib, - importc: "g_list_reverse".} -proc copy*(list: PGList): PGList{.cdecl, dynlib: gliblib, - importc: "g_list_copy".} -proc nth*(list: PGList, n: guint): PGList{.cdecl, dynlib: gliblib, - importc: "g_list_nth".} -proc nth_prev*(list: PGList, n: guint): PGList{.cdecl, dynlib: gliblib, - importc: "g_list_nth_prev".} -proc find*(list: PGList, data: gconstpointer): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_find".} -proc find_custom*(list: PGList, data: gconstpointer, func: TGCompareFunc): PGList{. - cdecl, dynlib: gliblib, importc: "g_list_find_custom".} -proc position*(list: PGList, llink: PGList): gint{.cdecl, - dynlib: gliblib, importc: "g_list_position".} -proc index*(list: PGList, data: gconstpointer): gint{.cdecl, - dynlib: gliblib, importc: "g_list_index".} -proc last*(list: PGList): PGList{.cdecl, dynlib: gliblib, - importc: "g_list_last".} -proc first*(list: PGList): PGList{.cdecl, dynlib: gliblib, - importc: "g_list_first".} -proc length*(list: PGList): guint{.cdecl, dynlib: gliblib, - importc: "g_list_length".} -proc foreach*(list: PGList, func: TGFunc, user_data: gpointer){.cdecl, - dynlib: gliblib, importc: "g_list_foreach".} -proc sort*(list: PGList, compare_func: TGCompareFunc): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_sort".} -proc sort*(list: PGList, compare_func: TGCompareDataFunc, - user_data: gpointer): PGList{.cdecl, - dynlib: gliblib, importc: "g_list_sort_with_data".} -proc nth_data*(list: PGList, n: guint): gpointer{.cdecl, dynlib: gliblib, - importc: "g_list_nth_data".} -proc previous*(list: PGList): PGList -proc 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 destroy*(cache: PGCache){.cdecl, dynlib: gliblib, - importc: "g_cache_destroy".} -proc insert*(cache: PGCache, key: gpointer): gpointer{.cdecl, - dynlib: gliblib, importc: "g_cache_insert".} -proc remove*(cache: PGCache, value: gconstpointer){.cdecl, - dynlib: gliblib, importc: "g_cache_remove".} -proc key_foreach*(cache: PGCache, func: TGHFunc, user_data: gpointer){. - cdecl, dynlib: gliblib, importc: "g_cache_key_foreach".} -proc 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*{.final.} = object - 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 add_items*(cmp: PGCompletion, items: PGList){.cdecl, - dynlib: gliblib, importc: "g_completion_add_items".} -proc remove_items*(cmp: PGCompletion, items: PGList){.cdecl, - dynlib: gliblib, importc: "g_completion_remove_items".} -proc clear_items*(cmp: PGCompletion){.cdecl, dynlib: gliblib, - importc: "g_completion_clear_items".} -proc complete*(cmp: PGCompletion, prefix: cstring, - new_prefix: PPgchar): PGList{.cdecl, - dynlib: gliblib, importc: "g_completion_complete".} -proc set_compare*(cmp: PGCompletion, - strncmp_func: TGCompletionStrncmpFunc){.cdecl, - dynlib: gliblib, importc: "g_completion_set_compare".} -proc 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*(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*(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*{.final.} = object - 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*{.final.} = object - 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 free*(date: PGDate){.cdecl, dynlib: gliblib, importc: "g_date_free".} -proc 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 get_weekday*(date: PGDate): TGDateWeekday{.cdecl, dynlib: gliblib, - importc: "g_date_get_weekday".} -proc get_month*(date: PGDate): TGDateMonth{.cdecl, dynlib: gliblib, - importc: "g_date_get_month".} -proc get_year*(date: PGDate): TGDateYear{.cdecl, dynlib: gliblib, - importc: "g_date_get_year".} -proc get_day*(date: PGDate): TGDateDay{.cdecl, dynlib: gliblib, - importc: "g_date_get_day".} -proc get_julian*(date: PGDate): guint32{.cdecl, dynlib: gliblib, - importc: "g_date_get_julian".} -proc get_day_of_year*(date: PGDate): guint{.cdecl, dynlib: gliblib, - importc: "g_date_get_day_of_year".} -proc get_monday_week_of_year*(date: PGDate): guint{.cdecl, - dynlib: gliblib, importc: "g_date_get_monday_week_of_year".} -proc get_sunday_week_of_year*(date: PGDate): guint{.cdecl, - dynlib: gliblib, importc: "g_date_get_sunday_week_of_year".} -proc clear*(date: PGDate, n_dates: guint){.cdecl, dynlib: gliblib, - importc: "g_date_clear".} -proc set_parse*(date: PGDate, str: cstring){.cdecl, dynlib: gliblib, - importc: "g_date_set_parse".} -proc set_time*(date: PGDate, time: TGTime){.cdecl, dynlib: gliblib, - importc: "g_date_set_time".} -proc set_month*(date: PGDate, month: TGDateMonth){.cdecl, - dynlib: gliblib, importc: "g_date_set_month".} -proc set_day*(date: PGDate, day: TGDateDay){.cdecl, dynlib: gliblib, - importc: "g_date_set_day".} -proc set_year*(date: PGDate, year: TGDateYear){.cdecl, dynlib: gliblib, - importc: "g_date_set_year".} -proc set_dmy*(date: PGDate, day: TGDateDay, month: TGDateMonth, - y: TGDateYear){.cdecl, dynlib: gliblib, - importc: "g_date_set_dmy".} -proc set_julian*(date: PGDate, julian_date: guint32){.cdecl, - dynlib: gliblib, importc: "g_date_set_julian".} -proc is_first_of_month*(date: PGDate): gboolean{.cdecl, dynlib: gliblib, - importc: "g_date_is_first_of_month".} -proc is_last_of_month*(date: PGDate): gboolean{.cdecl, dynlib: gliblib, - importc: "g_date_is_last_of_month".} -proc add_days*(date: PGDate, n_days: guint){.cdecl, dynlib: gliblib, - importc: "g_date_add_days".} -proc subtract_days*(date: PGDate, n_days: guint){.cdecl, dynlib: gliblib, - importc: "g_date_subtract_days".} -proc add_months*(date: PGDate, n_months: guint){.cdecl, dynlib: gliblib, - importc: "g_date_add_months".} -proc subtract_months*(date: PGDate, n_months: guint){.cdecl, - dynlib: gliblib, importc: "g_date_subtract_months".} -proc add_years*(date: PGDate, n_years: guint){.cdecl, dynlib: gliblib, - importc: "g_date_add_years".} -proc 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 days_between*(date1: PGDate, date2: PGDate): gint{.cdecl, - dynlib: gliblib, importc: "g_date_days_between".} -proc compare*(lhs: PGDate, rhs: PGDate): gint{.cdecl, dynlib: gliblib, - importc: "g_date_compare".} -proc to_struct_tm*(date: PGDate, tm: Ptm){.cdecl, dynlib: gliblib, - importc: "g_date_to_struct_tm".} -proc clamp*(date: PGDate, min_date: PGDate, max_date: PGDate){.cdecl, - dynlib: gliblib, importc: "g_date_clamp".} -proc 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 read_name*(dir: PGDir): cstring{.cdecl, dynlib: gliblib, - importc: "g_dir_read_name".} -proc rewind*(dir: PGDir){.cdecl, dynlib: gliblib, importc: "g_dir_rewind".} -proc 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*{.final.} = object - 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*{.final.} = object - 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'i32 shl 0'i32 - G_HOOK_FLAG_IN_CALL* = 1'i32 shl 1'i32 - G_HOOK_FLAG_MASK* = 0x0000000F'i32 - -const - G_HOOK_FLAG_USER_SHIFT* = 4'i32 - bm_TGHookList_hook_size* = 0x0000FFFF'i32 - bp_TGHookList_hook_size* = 0'i32 - bm_TGHookList_is_setup* = 0x00010000'i32 - bp_TGHookList_is_setup* = 16'i32 - -proc TGHookList_hook_size*(a: PGHookList): guint -proc TGHookList_set_hook_size*(a: PGHookList, `hook_size`: guint) -proc TGHookList_is_setup*(a: PGHookList): guint -proc TGHookList_set_is_setup*(a: PGHookList, `is_setup`: guint) -proc G_HOOK*(hook: pointer): PGHook -proc FLAGS*(hook: PGHook): guint -proc ACTIVE*(hook: PGHook): bool -proc IN_CALL*(hook: PGHook): bool -proc IS_VALID*(hook: PGHook): bool -proc IS_UNLINKED*(hook: PGHook): bool -proc list_init*(hook_list: PGHookList, hook_size: guint){.cdecl, - dynlib: gliblib, importc: "g_hook_list_init".} -proc list_clear*(hook_list: PGHookList){.cdecl, dynlib: gliblib, - importc: "g_hook_list_clear".} -proc alloc*(hook_list: PGHookList): PGHook{.cdecl, dynlib: gliblib, - importc: "g_hook_alloc".} -proc free*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib, - importc: "g_hook_free".} -proc reference*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib, - importc: "g_hook_ref".} -proc unref*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib, - importc: "g_hook_unref".} -proc destroy*(hook_list: PGHookList, hook_id: gulong): gboolean{.cdecl, - dynlib: gliblib, importc: "g_hook_destroy".} -proc destroy_link*(hook_list: PGHookList, hook: PGHook){.cdecl, - dynlib: gliblib, importc: "g_hook_destroy_link".} -proc prepend*(hook_list: PGHookList, hook: PGHook){.cdecl, - dynlib: gliblib, importc: "g_hook_prepend".} -proc insert_before*(hook_list: PGHookList, sibling: PGHook, hook: PGHook){. - cdecl, dynlib: gliblib, importc: "g_hook_insert_before".} -proc insert_sorted*(hook_list: PGHookList, hook: PGHook, - func: TGHookCompareFunc){.cdecl, dynlib: gliblib, - importc: "g_hook_insert_sorted".} -proc get*(hook_list: PGHookList, hook_id: gulong): PGHook{.cdecl, - dynlib: gliblib, importc: "g_hook_get".} -proc find*(hook_list: PGHookList, need_valids: gboolean, - func: TGHookFindFunc, data: gpointer): PGHook{.cdecl, - dynlib: gliblib, importc: "g_hook_find".} -proc find_data*(hook_list: PGHookList, need_valids: gboolean, - data: gpointer): PGHook{.cdecl, dynlib: gliblib, - importc: "g_hook_find_data".} -proc find_func*(hook_list: PGHookList, need_valids: gboolean, - func: gpointer): PGHook{.cdecl, dynlib: gliblib, - importc: "g_hook_find_func".} -proc find_func_data*(hook_list: PGHookList, need_valids: gboolean, - func: gpointer, data: gpointer): PGHook{.cdecl, - dynlib: gliblib, importc: "g_hook_find_func_data".} -proc first_valid*(hook_list: PGHookList, may_be_in_call: gboolean): PGHook{. - cdecl, dynlib: gliblib, importc: "g_hook_first_valid".} -proc next_valid*(hook_list: PGHookList, hook: PGHook, - may_be_in_call: gboolean): PGHook{.cdecl, - dynlib: gliblib, importc: "g_hook_next_valid".} -proc compare_ids*(new_hook: PGHook, sibling: PGHook): gint{.cdecl, - dynlib: gliblib, importc: "g_hook_compare_ids".} -proc append*(hook_list: PGHookList, hook: PGHook) -proc list_invoke_check*(hook_list: PGHookList, may_recurse: gboolean){. - cdecl, dynlib: gliblib, importc: "g_hook_list_invoke_check".} -proc list_marshal*(hook_list: PGHookList, may_recurse: gboolean, - marshaller: TGHookMarshaller, marshal_data: gpointer){. - cdecl, dynlib: gliblib, importc: "g_hook_list_marshal".} -proc 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*{.final.} = object - 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 pool_push*(pool: PGThreadPool, data: gpointer, error: pointer){. - cdecl, dynlib: gliblib, importc: "g_thread_pool_push".} -proc pool_set_max_threads*(pool: PGThreadPool, max_threads: gint, - error: pointer){.cdecl, dynlib: gliblib, - importc: "g_thread_pool_set_max_threads".} -proc pool_get_max_threads*(pool: PGThreadPool): gint{.cdecl, - dynlib: gliblib, importc: "g_thread_pool_get_max_threads".} -proc pool_get_num_threads*(pool: PGThreadPool): guint{.cdecl, - dynlib: gliblib, importc: "g_thread_pool_get_num_threads".} -proc pool_unprocessed*(pool: PGThreadPool): guint{.cdecl, - dynlib: gliblib, importc: "g_thread_pool_unprocessed".} -proc 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 destroy*(timer: PGTimer){.cdecl, dynlib: gliblib, - importc: "g_timer_destroy".} -proc start*(timer: PGTimer){.cdecl, dynlib: gliblib, - importc: "g_timer_start".} -proc stop*(timer: PGTimer){.cdecl, dynlib: gliblib, - importc: "g_timer_stop".} -proc reset*(timer: PGTimer){.cdecl, dynlib: gliblib, - importc: "g_timer_reset".} -proc 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 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 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 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 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 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 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 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*{.final.} = object - 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 chunk_free*(chunk: PGStringChunk){.cdecl, dynlib: gliblib, - importc: "g_string_chunk_free".} -proc chunk_insert*(chunk: PGStringChunk, str: cstring): cstring{.cdecl, - dynlib: gliblib, importc: "g_string_chunk_insert".} -proc 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 free*(str: PGString, free_segment: gboolean): cstring{.cdecl, - dynlib: gliblib, importc: "g_string_free".} -proc equal*(v: PGString, v2: PGString): gboolean{.cdecl, - dynlib: gliblib, importc: "g_string_equal".} -proc hash*(str: PGString): guint{.cdecl, dynlib: gliblib, - importc: "g_string_hash".} -proc assign*(str: PGString, rval: cstring): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_assign".} -proc truncate*(str: PGString, len: gsize): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_truncate".} -proc set_size*(str: PGString, len: gsize): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_set_size".} -proc insert_len*(str: PGString, pos: gssize, val: cstring, len: gssize): PGString{. - cdecl, dynlib: gliblib, importc: "g_string_insert_len".} -proc append*(str: PGString, val: cstring): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_append".} -proc append_len*(str: PGString, val: cstring, len: gssize): PGString{. - cdecl, dynlib: gliblib, importc: "g_string_append_len".} -proc append_c*(str: PGString, c: gchar): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_append_c".} -proc append_unichar*(str: PGString, wc: gunichar): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_append_unichar".} -proc prepend*(str: PGString, val: cstring): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_prepend".} -proc prepend_c*(str: PGString, c: gchar): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_prepend_c".} -proc prepend_unichar*(str: PGString, wc: gunichar): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_prepend_unichar".} -proc prepend_len*(str: PGString, val: cstring, len: gssize): PGString{. - cdecl, dynlib: gliblib, importc: "g_string_prepend_len".} -proc insert*(str: PGString, pos: gssize, val: cstring): PGString{. - cdecl, dynlib: gliblib, importc: "g_string_insert".} -proc insert_c*(str: PGString, pos: gssize, c: gchar): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_insert_c".} -proc insert_unichar*(str: PGString, pos: gssize, wc: gunichar): PGString{. - cdecl, dynlib: gliblib, importc: "g_string_insert_unichar".} -proc erase*(str: PGString, pos: gssize, len: gssize): PGString{.cdecl, - dynlib: gliblib, importc: "g_string_erase".} -proc ascii_down*(str: PGString): PGString{.cdecl, dynlib: gliblib, - importc: "g_string_ascii_down".} -proc ascii_up*(str: PGString): PGString{.cdecl, dynlib: gliblib, - importc: "g_string_ascii_up".} -proc down*(str: PGString): PGString{.cdecl, dynlib: gliblib, - importc: "g_string_down".} -proc 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*{.final.} = object - 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*{.final.} = object - 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* = 0x0001'i16 - bp_TGIOChannel_use_buffer* = 0'i16 - bm_TGIOChannel_do_encode* = 0x0002'i16 - bp_TGIOChannel_do_encode* = 1'i16 - bm_TGIOChannel_close_on_unref* = 0x0004'i16 - bp_TGIOChannel_close_on_unref* = 2'i16 - bm_TGIOChannel_is_readable* = 0x0008'i16 - bp_TGIOChannel_is_readable* = 3'i16 - bm_TGIOChannel_is_writeable* = 0x0010'i16 - bp_TGIOChannel_is_writeable* = 4'i16 - bm_TGIOChannel_is_seekable* = 0x0020'i16 - bp_TGIOChannel_is_seekable* = 5'i16 - -proc TGIOChannel_use_buffer*(a: PGIOChannel): guint -proc TGIOChannel_set_use_buffer*(a: PGIOChannel, `use_buffer`: guint) -proc TGIOChannel_do_encode*(a: PGIOChannel): guint -proc TGIOChannel_set_do_encode*(a: PGIOChannel, `do_encode`: guint) -proc TGIOChannel_close_on_unref*(a: PGIOChannel): guint -proc TGIOChannel_set_close_on_unref*(a: PGIOChannel, `close_on_unref`: guint) -proc TGIOChannel_is_readable*(a: PGIOChannel): guint -proc TGIOChannel_set_is_readable*(a: PGIOChannel, `is_readable`: guint) -proc TGIOChannel_is_writeable*(a: PGIOChannel): guint -proc TGIOChannel_set_is_writeable*(a: PGIOChannel, `is_writeable`: guint) -proc TGIOChannel_is_seekable*(a: PGIOChannel): guint -proc TGIOChannel_set_is_seekable*(a: PGIOChannel, `is_seekable`: guint) -proc channel_init*(channel: PGIOChannel){.cdecl, dynlib: gliblib, - importc: "g_io_channel_init".} -proc channel_ref*(channel: PGIOChannel){.cdecl, dynlib: gliblib, - importc: "g_io_channel_ref".} -proc channel_unref*(channel: PGIOChannel){.cdecl, dynlib: gliblib, - importc: "g_io_channel_unref".} -proc channel_read*(channel: PGIOChannel, buf: cstring, count: gsize, - bytes_read: Pgsize): TGIOError{.cdecl, dynlib: gliblib, - importc: "g_io_channel_read".} -proc channel_write*(channel: PGIOChannel, buf: cstring, count: gsize, - bytes_written: Pgsize): TGIOError{.cdecl, - dynlib: gliblib, importc: "g_io_channel_write".} -proc channel_seek*(channel: PGIOChannel, offset: gint64, - theType: TGSeekType): TGIOError{.cdecl, dynlib: gliblib, - importc: "g_io_channel_seek".} -proc channel_close*(channel: PGIOChannel){.cdecl, dynlib: gliblib, - importc: "g_io_channel_close".} -proc channel_shutdown*(channel: PGIOChannel, flush: gboolean, err: pointer): TGIOStatus{. - cdecl, dynlib: gliblib, importc: "g_io_channel_shutdown".} -proc 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 create_watch*(channel: PGIOChannel, condition: TGIOCondition): PGSource{. - cdecl, dynlib: gliblib, importc: "g_io_create_watch".} -proc add_watch*(channel: PGIOChannel, condition: TGIOCondition, - func: TGIOFunc, user_data: gpointer): guint{.cdecl, - dynlib: gliblib, importc: "g_io_add_watch".} -proc channel_set_buffer_size*(channel: PGIOChannel, size: gsize){.cdecl, - dynlib: gliblib, importc: "g_io_channel_set_buffer_size".} -proc channel_get_buffer_size*(channel: PGIOChannel): gsize{.cdecl, - dynlib: gliblib, importc: "g_io_channel_get_buffer_size".} -proc channel_get_buffer_condition*(channel: PGIOChannel): TGIOCondition{. - cdecl, dynlib: gliblib, importc: "g_io_channel_get_buffer_condition".} -proc channel_set_flags*(channel: PGIOChannel, flags: TGIOFlags, - error: pointer): TGIOStatus{.cdecl, - dynlib: gliblib, importc: "g_io_channel_set_flags".} -proc channel_get_flags*(channel: PGIOChannel): TGIOFlags{.cdecl, - dynlib: gliblib, importc: "g_io_channel_get_flags".} -proc channel_set_line_term*(channel: PGIOChannel, line_term: cstring, - length: gint){.cdecl, dynlib: gliblib, - importc: "g_io_channel_set_line_term".} -proc channel_get_line_term*(channel: PGIOChannel, length: Pgint): cstring{. - cdecl, dynlib: gliblib, importc: "g_io_channel_get_line_term".} -proc channel_set_buffered*(channel: PGIOChannel, buffered: gboolean){. - cdecl, dynlib: gliblib, importc: "g_io_channel_set_buffered".} -proc channel_get_buffered*(channel: PGIOChannel): gboolean{.cdecl, - dynlib: gliblib, importc: "g_io_channel_get_buffered".} -proc channel_set_encoding*(channel: PGIOChannel, encoding: cstring, - error: pointer): TGIOStatus{.cdecl, - dynlib: gliblib, importc: "g_io_channel_set_encoding".} -proc channel_get_encoding*(channel: PGIOChannel): cstring{.cdecl, - dynlib: gliblib, importc: "g_io_channel_get_encoding".} -proc channel_set_close_on_unref*(channel: PGIOChannel, do_close: gboolean){. - cdecl, dynlib: gliblib, importc: "g_io_channel_set_close_on_unref".} -proc channel_get_close_on_unref*(channel: PGIOChannel): gboolean{.cdecl, - dynlib: gliblib, importc: "g_io_channel_get_close_on_unref".} -proc channel_flush*(channel: PGIOChannel, error: pointer): TGIOStatus{. - cdecl, dynlib: gliblib, importc: "g_io_channel_flush".} -proc 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 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 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 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 channel_read_unichar*(channel: PGIOChannel, thechar: Pgunichar, - error: pointer): TGIOStatus{.cdecl, - dynlib: gliblib, importc: "g_io_channel_read_unichar".} -proc 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 channel_write_unichar*(channel: PGIOChannel, thechar: gunichar, - error: pointer): TGIOStatus{.cdecl, - dynlib: gliblib, importc: "g_io_channel_write_unichar".} -proc 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 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){.cdecl, varargs.} - -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*{.final.} = object - 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 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 parse_context_free*(context: PGMarkupParseContext){.cdecl, - dynlib: gliblib, importc: "g_markup_parse_context_free".} -proc parse_context_parse*(context: PGMarkupParseContext, text: cstring, - text_len: gssize, error: pointer): gboolean{. - cdecl, dynlib: gliblib, importc: "g_markup_parse_context_parse".} -proc parse_context_end_parse*(context: PGMarkupParseContext, - error: pointer): gboolean{.cdecl, - dynlib: gliblib, importc: "g_markup_parse_context_end_parse".} -proc 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*{.final.} = object - 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 IS_ROOT*(node: PGNode): bool -proc IS_LEAF*(node: PGNode): bool -proc 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 destroy*(root: PGNode){.cdecl, dynlib: gliblib, - importc: "g_node_destroy".} -proc unlink*(node: PGNode){.cdecl, dynlib: gliblib, - importc: "g_node_unlink".} -proc copy*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, - importc: "g_node_copy".} -proc insert*(parent: PGNode, position: gint, node: PGNode): PGNode{. - cdecl, dynlib: gliblib, importc: "g_node_insert".} -proc insert_before*(parent: PGNode, sibling: PGNode, node: PGNode): PGNode{. - cdecl, dynlib: gliblib, importc: "g_node_insert_before".} -proc insert_after*(parent: PGNode, sibling: PGNode, node: PGNode): PGNode{. - cdecl, dynlib: gliblib, importc: "g_node_insert_after".} -proc prepend*(parent: PGNode, node: PGNode): PGNode{.cdecl, - dynlib: gliblib, importc: "g_node_prepend".} -proc n_nodes*(root: PGNode, flags: TGTraverseFlags): guint{.cdecl, - dynlib: gliblib, importc: "g_node_n_nodes".} -proc get_root*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, - importc: "g_node_get_root".} -proc is_ancestor*(node: PGNode, descendant: PGNode): gboolean{.cdecl, - dynlib: gliblib, importc: "g_node_is_ancestor".} -proc depth*(node: PGNode): guint{.cdecl, dynlib: gliblib, - importc: "g_node_depth".} -proc find*(root: PGNode, order: TGTraverseType, flags: TGTraverseFlags, - data: gpointer): PGNode{.cdecl, dynlib: gliblib, - importc: "g_node_find".} -proc append*(parent: PGNode, node: PGNode): PGNode -proc insert_data*(parent: PGNode, position: gint, data: gpointer): PGNode -proc insert_data_before*(parent: PGNode, sibling: PGNode, data: gpointer): PGNode -proc prepend_data*(parent: PGNode, data: gpointer): PGNode -proc append_data*(parent: PGNode, data: gpointer): PGNode -proc traverse*(root: PGNode, order: TGTraverseType, - flags: TGTraverseFlags, max_depth: gint, - func: TGNodeTraverseFunc, data: gpointer): guint{.cdecl, - dynlib: gliblib, importc: "g_node_traverse".} -proc max_height*(root: PGNode): guint{.cdecl, dynlib: gliblib, - importc: "g_node_max_height".} -proc children_foreach*(node: PGNode, flags: TGTraverseFlags, - func: TGNodeForeachFunc, data: gpointer){.cdecl, - dynlib: gliblib, importc: "g_node_children_foreach".} -proc reverse_children*(node: PGNode){.cdecl, dynlib: gliblib, - importc: "g_node_reverse_children".} -proc n_children*(node: PGNode): guint{.cdecl, dynlib: gliblib, - importc: "g_node_n_children".} -proc nth_child*(node: PGNode, n: guint): PGNode{.cdecl, dynlib: gliblib, - importc: "g_node_nth_child".} -proc last_child*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, - importc: "g_node_last_child".} -proc find_child*(node: PGNode, flags: TGTraverseFlags, data: gpointer): PGNode{. - cdecl, dynlib: gliblib, importc: "g_node_find_child".} -proc child_position*(node: PGNode, child: PGNode): gint{.cdecl, - dynlib: gliblib, importc: "g_node_child_position".} -proc child_index*(node: PGNode, data: gpointer): gint{.cdecl, - dynlib: gliblib, importc: "g_node_child_index".} -proc first_sibling*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, - importc: "g_node_first_sibling".} -proc last_sibling*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, - importc: "g_node_last_sibling".} -proc prev_sibling*(node: PGNode): PGNode -proc next_sibling*(node: PGNode): PGNode -proc 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*(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 destroy*(tree: PGTree){.cdecl, dynlib: gliblib, - importc: "g_tree_destroy".} -proc insert*(tree: PGTree, key: gpointer, value: gpointer){.cdecl, - dynlib: gliblib, importc: "g_tree_insert".} -proc replace*(tree: PGTree, key: gpointer, value: gpointer){.cdecl, - dynlib: gliblib, importc: "g_tree_replace".} -proc remove*(tree: PGTree, key: gconstpointer){.cdecl, dynlib: gliblib, - importc: "g_tree_remove".} -proc steal*(tree: PGTree, key: gconstpointer){.cdecl, dynlib: gliblib, - importc: "g_tree_steal".} -proc lookup*(tree: PGTree, key: gconstpointer): gpointer{.cdecl, - dynlib: gliblib, importc: "g_tree_lookup".} -proc lookup_extended*(tree: PGTree, lookup_key: gconstpointer, - orig_key: Pgpointer, value: Pgpointer): gboolean{. - cdecl, dynlib: gliblib, importc: "g_tree_lookup_extended".} -proc foreach*(tree: PGTree, func: TGTraverseFunc, user_data: gpointer){. - cdecl, dynlib: gliblib, importc: "g_tree_foreach".} -proc search*(tree: PGTree, search_func: TGCompareFunc, - user_data: gconstpointer): gpointer{.cdecl, dynlib: gliblib, - importc: "g_tree_search".} -proc height*(tree: PGTree): gint{.cdecl, dynlib: gliblib, - importc: "g_tree_height".} -proc 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 spec_free*(pspec: PGPatternSpec){.cdecl, dynlib: gliblib, - importc: "g_pattern_spec_free".} -proc spec_equal*(pspec1: PGPatternSpec, pspec2: PGPatternSpec): gboolean{. - cdecl, dynlib: gliblib, importc: "g_pattern_spec_equal".} -proc match*(pspec: PGPatternSpec, string_length: guint, str: cstring, - string_reversed: cstring): gboolean{.cdecl, - dynlib: gliblib, importc: "g_pattern_match".} -proc 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*(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*{.final.} = object - head*: PGList - tail*: PGList - length*: guint - - -proc g_queue_new*(): PGQueue{.cdecl, dynlib: gliblib, importc: "g_queue_new".} -proc free*(queue: PGQueue){.cdecl, dynlib: gliblib, - importc: "g_queue_free".} -proc push_head*(queue: PGQueue, data: gpointer){.cdecl, dynlib: gliblib, - importc: "g_queue_push_head".} -proc push_tail*(queue: PGQueue, data: gpointer){.cdecl, dynlib: gliblib, - importc: "g_queue_push_tail".} -proc pop_head*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib, - importc: "g_queue_pop_head".} -proc pop_tail*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib, - importc: "g_queue_pop_tail".} -proc is_empty*(queue: PGQueue): gboolean{.cdecl, dynlib: gliblib, - importc: "g_queue_is_empty".} -proc peek_head*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib, - importc: "g_queue_peek_head".} -proc peek_tail*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib, - importc: "g_queue_peek_tail".} -proc push_head_link*(queue: PGQueue, link: PGList){.cdecl, - dynlib: gliblib, importc: "g_queue_push_head_link".} -proc push_tail_link*(queue: PGQueue, link: PGList){.cdecl, - dynlib: gliblib, importc: "g_queue_push_tail_link".} -proc pop_head_link*(queue: PGQueue): PGList{.cdecl, dynlib: gliblib, - importc: "g_queue_pop_head_link".} -proc pop_tail_link*(queue: PGQueue): PGList{.cdecl, dynlib: gliblib, - importc: "g_queue_pop_tail_link".} -type - PGRand* = pointer - -proc g_rand_new*(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 free*(rand: PGRand){.cdecl, dynlib: gliblib, importc: "g_rand_free".} -proc set_seed*(rand: PGRand, seed: guint32){.cdecl, dynlib: gliblib, - importc: "g_rand_set_seed".} -proc boolean*(rand: PGRand): gboolean -proc randint*(rand: PGRand): guint32{.cdecl, dynlib: gliblib, - importc: "g_rand_int".} -proc int_range*(rand: PGRand, `begin`: gint32, `end`: gint32): gint32{. - cdecl, dynlib: gliblib, importc: "g_rand_int_range".} -proc double*(rand: PGRand): gdouble{.cdecl, dynlib: gliblib, - importc: "g_rand_double".} -proc 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*{.final.} = object - len*: guint - - PGRelation* = pointer - -proc g_relation_new*(fields: gint): PGRelation{.cdecl, dynlib: gliblib, - importc: "g_relation_new".} -proc destroy*(relation: PGRelation){.cdecl, dynlib: gliblib, - importc: "g_relation_destroy".} -proc index*(relation: PGRelation, field: gint, hash_func: TGHashFunc, - key_equal_func: TGEqualFunc){.cdecl, dynlib: gliblib, - importc: "g_relation_index".} -proc delete*(relation: PGRelation, key: gconstpointer, field: gint): gint{. - cdecl, dynlib: gliblib, importc: "g_relation_delete".} -proc select*(relation: PGRelation, key: gconstpointer, field: gint): PGTuples{. - cdecl, dynlib: gliblib, importc: "g_relation_select".} -proc count*(relation: PGRelation, key: gconstpointer, field: gint): gint{. - cdecl, dynlib: gliblib, importc: "g_relation_count".} -proc print*(relation: PGRelation){.cdecl, dynlib: gliblib, - importc: "g_relation_print".} -proc destroy*(tuples: PGTuples){.cdecl, dynlib: gliblib, - importc: "g_tuples_destroy".} -proc 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*{.final.} = object - v_float*: gdouble - - TGScannerMsgFunc* = proc (scanner: PGScanner, message: cstring, - error: gboolean){.cdecl.} - TGScanner*{.final.} = object - 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*{.final.} = object - 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'i32 - bp_TGScannerConfig_case_sensitive* = 0'i32 - bm_TGScannerConfig_skip_comment_multi* = 0x00000002'i32 - bp_TGScannerConfig_skip_comment_multi* = 1'i32 - bm_TGScannerConfig_skip_comment_single* = 0x00000004'i32 - bp_TGScannerConfig_skip_comment_single* = 2'i32 - bm_TGScannerConfig_scan_comment_multi* = 0x00000008'i32 - bp_TGScannerConfig_scan_comment_multi* = 3'i32 - bm_TGScannerConfig_scan_identifier* = 0x00000010'i32 - bp_TGScannerConfig_scan_identifier* = 4'i32 - bm_TGScannerConfig_scan_identifier_1char* = 0x00000020'i32 - bp_TGScannerConfig_scan_identifier_1char* = 5'i32 - bm_TGScannerConfig_scan_identifier_NULL* = 0x00000040'i32 - bp_TGScannerConfig_scan_identifier_NULL* = 6'i32 - bm_TGScannerConfig_scan_symbols* = 0x00000080'i32 - bp_TGScannerConfig_scan_symbols* = 7'i32 - bm_TGScannerConfig_scan_binary* = 0x00000100'i32 - bp_TGScannerConfig_scan_binary* = 8'i32 - bm_TGScannerConfig_scan_octal* = 0x00000200'i32 - bp_TGScannerConfig_scan_octal* = 9'i32 - bm_TGScannerConfig_scan_float* = 0x00000400'i32 - bp_TGScannerConfig_scan_float* = 10'i32 - bm_TGScannerConfig_scan_hex* = 0x00000800'i32 - bp_TGScannerConfig_scan_hex* = 11'i32 - bm_TGScannerConfig_scan_hex_dollar* = 0x00001000'i32 - bp_TGScannerConfig_scan_hex_dollar* = 12'i32 - bm_TGScannerConfig_scan_string_sq* = 0x00002000'i32 - bp_TGScannerConfig_scan_string_sq* = 13'i32 - bm_TGScannerConfig_scan_string_dq* = 0x00004000'i32 - bp_TGScannerConfig_scan_string_dq* = 14'i32 - bm_TGScannerConfig_numbers_2_int* = 0x00008000'i32 - bp_TGScannerConfig_numbers_2_int* = 15'i32 - bm_TGScannerConfig_int_2_float* = 0x00010000'i32 - bp_TGScannerConfig_int_2_float* = 16'i32 - bm_TGScannerConfig_identifier_2_string* = 0x00020000'i32 - bp_TGScannerConfig_identifier_2_string* = 17'i32 - bm_TGScannerConfig_char_2_token* = 0x00040000'i32 - bp_TGScannerConfig_char_2_token* = 18'i32 - bm_TGScannerConfig_symbol_2_token* = 0x00080000'i32 - bp_TGScannerConfig_symbol_2_token* = 19'i32 - bm_TGScannerConfig_scope_0_fallback* = 0x00100000'i32 - bp_TGScannerConfig_scope_0_fallback* = 20'i32 - -proc TGScannerConfig_case_sensitive*(a: PGScannerConfig): guint -proc TGScannerConfig_set_case_sensitive*(a: PGScannerConfig, - `case_sensitive`: guint) -proc TGScannerConfig_skip_comment_multi*(a: PGScannerConfig): guint -proc TGScannerConfig_set_skip_comment_multi*(a: PGScannerConfig, - `skip_comment_multi`: guint) -proc TGScannerConfig_skip_comment_single*(a: PGScannerConfig): guint -proc TGScannerConfig_set_skip_comment_single*(a: PGScannerConfig, - `skip_comment_single`: guint) -proc TGScannerConfig_scan_comment_multi*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_comment_multi*(a: PGScannerConfig, - `scan_comment_multi`: guint) -proc TGScannerConfig_scan_identifier*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_identifier*(a: PGScannerConfig, - `scan_identifier`: guint) -proc TGScannerConfig_scan_identifier_1char*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_identifier_1char*(a: PGScannerConfig, - `scan_identifier_1char`: guint) -proc TGScannerConfig_scan_identifier_NULL*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_identifier_NULL*(a: PGScannerConfig, - `scan_identifier_NULL`: guint) -proc TGScannerConfig_scan_symbols*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_symbols*(a: PGScannerConfig, - `scan_symbols`: guint) -proc TGScannerConfig_scan_binary*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_binary*(a: PGScannerConfig, - `scan_binary`: guint) -proc TGScannerConfig_scan_octal*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_octal*(a: PGScannerConfig, `scan_octal`: guint) -proc TGScannerConfig_scan_float*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_float*(a: PGScannerConfig, `scan_float`: guint) -proc TGScannerConfig_scan_hex*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_hex*(a: PGScannerConfig, `scan_hex`: guint) -proc TGScannerConfig_scan_hex_dollar*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_hex_dollar*(a: PGScannerConfig, - `scan_hex_dollar`: guint) -proc TGScannerConfig_scan_string_sq*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_string_sq*(a: PGScannerConfig, - `scan_string_sq`: guint) -proc TGScannerConfig_scan_string_dq*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scan_string_dq*(a: PGScannerConfig, - `scan_string_dq`: guint) -proc TGScannerConfig_numbers_2_int*(a: PGScannerConfig): guint -proc TGScannerConfig_set_numbers_2_int*(a: PGScannerConfig, - `numbers_2_int`: guint) -proc TGScannerConfig_int_2_float*(a: PGScannerConfig): guint -proc TGScannerConfig_set_int_2_float*(a: PGScannerConfig, - `int_2_float`: guint) -proc TGScannerConfig_identifier_2_string*(a: PGScannerConfig): guint -proc TGScannerConfig_set_identifier_2_string*(a: PGScannerConfig, - `identifier_2_string`: guint) -proc TGScannerConfig_char_2_token*(a: PGScannerConfig): guint -proc TGScannerConfig_set_char_2_token*(a: PGScannerConfig, - `char_2_token`: guint) -proc TGScannerConfig_symbol_2_token*(a: PGScannerConfig): guint -proc TGScannerConfig_set_symbol_2_token*(a: PGScannerConfig, - `symbol_2_token`: guint) -proc TGScannerConfig_scope_0_fallback*(a: PGScannerConfig): guint -proc TGScannerConfig_set_scope_0_fallback*(a: PGScannerConfig, - `scope_0_fallback`: guint) -proc new*(config_templ: PGScannerConfig): PGScanner{.cdecl, - dynlib: gliblib, importc: "g_scanner_new".} -proc destroy*(scanner: PGScanner){.cdecl, dynlib: gliblib, - importc: "g_scanner_destroy".} -proc input_file*(scanner: PGScanner, input_fd: gint){.cdecl, - dynlib: gliblib, importc: "g_scanner_input_file".} -proc sync_file_offset*(scanner: PGScanner){.cdecl, dynlib: gliblib, - importc: "g_scanner_sync_file_offset".} -proc input_text*(scanner: PGScanner, text: cstring, text_len: guint){. - cdecl, dynlib: gliblib, importc: "g_scanner_input_text".} -proc get_next_token*(scanner: PGScanner): TGTokenType{.cdecl, - dynlib: gliblib, importc: "g_scanner_get_next_token".} -proc peek_next_token*(scanner: PGScanner): TGTokenType{.cdecl, - dynlib: gliblib, importc: "g_scanner_peek_next_token".} -proc cur_token*(scanner: PGScanner): TGTokenType{.cdecl, - dynlib: gliblib, importc: "g_scanner_cur_token".} -proc cur_value*(scanner: PGScanner): TGTokenValue{.cdecl, - dynlib: gliblib, importc: "g_scanner_cur_value".} -proc cur_line*(scanner: PGScanner): guint{.cdecl, dynlib: gliblib, - importc: "g_scanner_cur_line".} -proc cur_position*(scanner: PGScanner): guint{.cdecl, dynlib: gliblib, - importc: "g_scanner_cur_position".} -proc eof*(scanner: PGScanner): gboolean{.cdecl, dynlib: gliblib, - importc: "g_scanner_eof".} -proc set_scope*(scanner: PGScanner, scope_id: guint): guint{.cdecl, - dynlib: gliblib, importc: "g_scanner_set_scope".} -proc scope_add_symbol*(scanner: PGScanner, scope_id: guint, - symbol: cstring, value: gpointer){.cdecl, - dynlib: gliblib, importc: "g_scanner_scope_add_symbol".} -proc scope_remove_symbol*(scanner: PGScanner, scope_id: guint, - symbol: cstring){.cdecl, dynlib: gliblib, - importc: "g_scanner_scope_remove_symbol".} -proc scope_lookup_symbol*(scanner: PGScanner, scope_id: guint, - symbol: cstring): gpointer{.cdecl, - dynlib: gliblib, importc: "g_scanner_scope_lookup_symbol".} -proc scope_foreach_symbol*(scanner: PGScanner, scope_id: guint, - func: TGHFunc, user_data: gpointer){.cdecl, - dynlib: gliblib, importc: "g_scanner_scope_foreach_symbol".} -proc lookup_symbol*(scanner: PGScanner, symbol: cstring): gpointer{. - cdecl, dynlib: gliblib, importc: "g_scanner_lookup_symbol".} -proc 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*(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 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 set_boxed*(value: PGValue, v_boxed: gconstpointer){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_boxed".} -proc set_static_boxed*(value: PGValue, v_boxed: gconstpointer){.cdecl, - dynlib: gobjectlib, importc: "g_value_set_static_boxed".} -proc get_boxed*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib, - importc: "g_value_get_boxed".} -proc 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 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 close*(module: PGModule): gboolean{.cdecl, dynlib: gmodulelib, - importc: "g_module_close".} -proc 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 symbol*(module: PGModule, symbol_name: cstring, symbol: Pgpointer): gboolean{. - cdecl, dynlib: gmodulelib, importc: "g_module_symbol".} -proc 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 0x00FF'i16) shl 8'i16) or - ((val and 0xFF00'i16) shr 8'i16) - -proc GUINT32_SWAP_LE_BE_CONSTANT*(val: guint32): guint32 = - Result = ((val and 0x000000FF'i32) shl 24'i32) or - ((val and 0x0000FF00'i32) shl 8'i32) or - ((val and 0x00FF0000'i32) shr 8'i32) or - ((val and 0xFF000000'i32) shr 24'i32) - -proc GUINT_TO_POINTER*(i: guint): pointer = - Result = cast[Pointer](TAddress(i)) - -when false: - type - PGArray* = pointer - 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 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 = chunk_alloc(chunk) - -proc g_chunk_new0*(chunk: Pointer): Pointer = - result = chunk_alloc0(chunk) - -proc previous*(list: PGList): PGList = - if list != nil: - result = list.prev - else: - result = nil - -proc 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: PGHookList): guint = - result = (a.flag0 and bm_TGHookList_hook_size) shr bp_TGHookList_hook_size - -proc TGHookList_set_hook_size*(a: PGHookList, `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: PGHookList): guint = - result = (a.flag0 and bm_TGHookList_is_setup) shr bp_TGHookList_is_setup - -proc TGHookList_set_is_setup*(a: PGHookList, `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 FLAGS*(hook: PGHook): guint = - result = hook.flags - -proc ACTIVE*(hook: PGHook): bool = - result = (hook.flags and G_HOOK_FLAG_ACTIVE) != 0'i32 - -proc IN_CALL*(hook: PGHook): bool = - result = (hook.flags and G_HOOK_FLAG_IN_CALL) != 0'i32 - -proc IS_VALID*(hook: PGHook): bool = - result = (hook.hook_id != 0) and ACTIVE(hook) - -proc IS_UNLINKED*(hook: PGHook): bool = - result = (hook.next == nil) and (hook.prev == nil) and (hook.hook_id == 0) and - (hook.ref_count == 0'i32) - -proc append*(hook_list: PGHookList, hook: PGHook) = - insert_before(hook_list, nil, hook) - -proc G_IO_CHANNEL_ERROR*(): TGQuark = - result = g_io_channel_error_quark() - -proc TGIOChannel_use_buffer*(a: PGIOChannel): guint = - result = (a.flag0 and bm_TGIOChannel_use_buffer) shr - bp_TGIOChannel_use_buffer - -proc TGIOChannel_set_use_buffer*(a: PGIOChannel, `use_buffer`: guint) = - a.flag0 = a.flag0 or - (int16(`use_buffer` shl bp_TGIOChannel_use_buffer) and - bm_TGIOChannel_use_buffer) - -proc TGIOChannel_do_encode*(a: PGIOChannel): guint = - result = (a.flag0 and bm_TGIOChannel_do_encode) shr - bp_TGIOChannel_do_encode - -proc TGIOChannel_set_do_encode*(a: PGIOChannel, `do_encode`: guint) = - a.flag0 = a.flag0 or - (int16(`do_encode` shl bp_TGIOChannel_do_encode) and - bm_TGIOChannel_do_encode) - -proc TGIOChannel_close_on_unref*(a: PGIOChannel): guint = - result = (a.flag0 and bm_TGIOChannel_close_on_unref) shr - bp_TGIOChannel_close_on_unref - -proc TGIOChannel_set_close_on_unref*(a: PGIOChannel, `close_on_unref`: guint) = - a.flag0 = a.flag0 or - (int16(`close_on_unref` shl bp_TGIOChannel_close_on_unref) and - bm_TGIOChannel_close_on_unref) - -proc TGIOChannel_is_readable*(a: PGIOChannel): guint = - result = (a.flag0 and bm_TGIOChannel_is_readable) shr - bp_TGIOChannel_is_readable - -proc TGIOChannel_set_is_readable*(a: PGIOChannel, `is_readable`: guint) = - a.flag0 = a.flag0 or - (int16(`is_readable` shl bp_TGIOChannel_is_readable) and - bm_TGIOChannel_is_readable) - -proc TGIOChannel_is_writeable*(a: PGIOChannel): guint = - result = (a.flag0 and bm_TGIOChannel_is_writeable) shr - bp_TGIOChannel_is_writeable - -proc TGIOChannel_set_is_writeable*(a: PGIOChannel, `is_writeable`: guint) = - a.flag0 = a.flag0 or - (int16(`is_writeable` shl bp_TGIOChannel_is_writeable) and - bm_TGIOChannel_is_writeable) - -proc TGIOChannel_is_seekable*(a: PGIOChannel): guint = - result = (a.flag0 and bm_TGIOChannel_is_seekable) shr - bp_TGIOChannel_is_seekable - -proc TGIOChannel_set_is_seekable*(a: PGIOChannel, `is_seekable`: guint) = - a.flag0 = a.flag0 or - (int16(`is_seekable` shl bp_TGIOChannel_is_seekable) and - bm_TGIOChannel_is_seekable) - -proc 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 IS_ROOT*(node: PGNode): bool = - result = (node.parent == nil) and (node.next == nil) and (node.prev == nil) - -proc IS_LEAF*(node: PGNode): bool = - result = node.children == nil - -proc append*(parent: PGNode, node: PGNode): PGNode = - result = insert_before(parent, nil, node) - -proc insert_data*(parent: PGNode, position: gint, data: gpointer): PGNode = - result = insert(parent, position, g_node_new(data)) - -proc insert_data_before*(parent: PGNode, sibling: PGNode, - data: gpointer): PGNode = - result = insert_before(parent, sibling, g_node_new(data)) - -proc prepend_data*(parent: PGNode, data: gpointer): PGNode = - result = prepend(parent, g_node_new(data)) - -proc append_data*(parent: PGNode, data: gpointer): PGNode = - result = insert_before(parent, nil, g_node_new(data)) - -proc prev_sibling*(node: PGNode): PGNode = - if node != nil: - result = node.prev - else: - result = nil - -proc next_sibling*(node: PGNode): PGNode = - if node != nil: - result = node.next - else: - result = nil - -proc first_child*(node: PGNode): PGNode = - if node != nil: - result = node.children - else: - result = nil - -proc boolean*(rand: PGRand): gboolean = - result = (int(rand_int(rand)) and (1 shl 15)) != 0 - -proc g_random_boolean*(): gboolean = - result = (int(g_random_int()) and (1 shl 15)) != 0 - -proc TGScannerConfig_case_sensitive*(a: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_case_sensitive) shr - bp_TGScannerConfig_case_sensitive - -proc TGScannerConfig_set_case_sensitive*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_skip_comment_multi) shr - bp_TGScannerConfig_skip_comment_multi - -proc TGScannerConfig_set_skip_comment_multi*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_skip_comment_single) shr - bp_TGScannerConfig_skip_comment_single - -proc TGScannerConfig_set_skip_comment_single*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_comment_multi) shr - bp_TGScannerConfig_scan_comment_multi - -proc TGScannerConfig_set_scan_comment_multi*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_identifier) shr - bp_TGScannerConfig_scan_identifier - -proc TGScannerConfig_set_scan_identifier*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_identifier_1char) shr - bp_TGScannerConfig_scan_identifier_1char - -proc TGScannerConfig_set_scan_identifier_1char*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_identifier_NULL) shr - bp_TGScannerConfig_scan_identifier_NULL - -proc TGScannerConfig_set_scan_identifier_NULL*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_symbols) shr - bp_TGScannerConfig_scan_symbols - -proc TGScannerConfig_set_scan_symbols*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_binary) shr - bp_TGScannerConfig_scan_binary - -proc TGScannerConfig_set_scan_binary*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_octal) shr - bp_TGScannerConfig_scan_octal - -proc TGScannerConfig_set_scan_octal*(a: PGScannerConfig, `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_float) shr - bp_TGScannerConfig_scan_float - -proc TGScannerConfig_set_scan_float*(a: PGScannerConfig, `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_hex) shr - bp_TGScannerConfig_scan_hex - -proc TGScannerConfig_set_scan_hex*(a: PGScannerConfig, `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_hex_dollar) shr - bp_TGScannerConfig_scan_hex_dollar - -proc TGScannerConfig_set_scan_hex_dollar*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_string_sq) shr - bp_TGScannerConfig_scan_string_sq - -proc TGScannerConfig_set_scan_string_sq*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scan_string_dq) shr - bp_TGScannerConfig_scan_string_dq - -proc TGScannerConfig_set_scan_string_dq*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_numbers_2_int) shr - bp_TGScannerConfig_numbers_2_int - -proc TGScannerConfig_set_numbers_2_int*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_int_2_float) shr - bp_TGScannerConfig_int_2_float - -proc TGScannerConfig_set_int_2_float*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_identifier_2_string) shr - bp_TGScannerConfig_identifier_2_string - -proc TGScannerConfig_set_identifier_2_string*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_char_2_token) shr - bp_TGScannerConfig_char_2_token - -proc TGScannerConfig_set_char_2_token*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_symbol_2_token) shr - bp_TGScannerConfig_symbol_2_token - -proc TGScannerConfig_set_symbol_2_token*(a: PGScannerConfig, - `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: PGScannerConfig): guint = - result = (a.flag0 and bm_TGScannerConfig_scope_0_fallback) shr - bp_TGScannerConfig_scope_0_fallback - -proc TGScannerConfig_set_scope_0_fallback*(a: PGScannerConfig, - `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 freeze_symbol_table*(scanner: PGScanner) = - if Scanner == nil: nil - -proc 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: int): 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 N_NOTIFIERS*(cl: PGClosure): int32 = - result = ((meta_marshal(cl) + ((n_guards(cl)) shl 1'i32)) + - (n_fnotifiers(cl))) + (n_inotifiers(cl)) - -proc CCLOSURE_SWAP_DATA*(cclosure: PGClosure): int32 = - result = derivative_flag(cclosure) - -proc G_CALLBACK*(f: pointer): TGCallback = - result = cast[TGCallback](f) - -proc ref_count*(a: PGClosure): guint = - result = (a.flag0 and bm_TGClosure_ref_count) shr bp_TGClosure_ref_count - -proc set_ref_count*(a: PGClosure, `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: PGClosure, `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: PGClosure, `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: PGClosure, `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: PGClosure, `n_inotifiers`: guint) = - a.flag0 = a.flag0 or - ((`n_inotifiers` shl bp_TGClosure_n_inotifiers) and - bm_TGClosure_n_inotifiers) - -proc in_inotify*(a: PGClosure): guint = - result = (a.flag0 and bm_TGClosure_in_inotify) shr bp_TGClosure_in_inotify - -proc set_in_inotify*(a: PGClosure, `in_inotify`: guint) = - a.flag0 = a.flag0 or - ((`in_inotify` shl bp_TGClosure_in_inotify) and bm_TGClosure_in_inotify) - -proc floating*(a: PGClosure): guint = - result = (a.flag0 and bm_TGClosure_floating) shr bp_TGClosure_floating - -proc set_floating*(a: PGClosure, `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: PGClosure, `derivative_flag`: guint) = - a.flag0 = a.flag0 or - ((`derivative_flag` shl bp_TGClosure_derivative_flag) and - bm_TGClosure_derivative_flag) - -proc in_marshal*(a: PGClosure): guint = - result = (a.flag0 and bm_TGClosure_in_marshal) shr bp_TGClosure_in_marshal - -proc set_in_marshal*(a: PGClosure, in_marshal: guint) = - a.flag0 = a.flag0 or - ((in_marshal shl bp_TGClosure_in_marshal) and bm_TGClosure_in_marshal) - -proc is_invalid*(a: PGClosure): guint = - result = (a.flag0 and bm_TGClosure_is_invalid) shr bp_TGClosure_is_invalid - -proc set_is_invalid*(a: PGClosure, 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\x0A") - #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 HOLDS_CHAR*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_CHAR) - -proc HOLDS_UCHAR*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UCHAR) - -proc HOLDS_BOOLEAN*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_BOOLEAN) - -proc HOLDS_INT*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_INT) - -proc HOLDS_UINT*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UINT) - -proc HOLDS_LONG*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_LONG) - -proc HOLDS_ULONG*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_ULONG) - -proc HOLDS_INT64*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_INT64) - -proc HOLDS_UINT64*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UINT64) - -proc HOLDS_FLOAT*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_FLOAT) - -proc HOLDS_DOUBLE*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_DOUBLE) - -proc HOLDS_STRING*(value: PGValue): bool = - result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_STRING) - -proc 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 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() - -proc g_thread_init*(vtable: pointer) {. - cdecl, dynlib: gobjectlib, importc: "g_thread_init".} - -proc g_timeout_add*(interval: guint, function, data: gpointer): guint {. - cdecl, dynlib: gliblib, importc: "g_timeout_add".} - -proc g_timeout_add_full*(priority: guint, interval: guint, function, - data, notify: gpointer): guint {.cdecl, dynlib: gliblib, - importc: "g_timeout_add_full".} - -proc g_idle_add*(function, data: gpointer): guint {. - cdecl, dynlib: gliblib, importc: "g_idle_add".} - -proc g_idle_add_full*(priority: guint, function, - data, notify: gpointer): guint {.cdecl, dynlib: gliblib, - importc: "g_idle_add_full".} - -proc g_source_remove*(tag: guint): gboolean {. - cdecl, dynlib: gliblib, importc: "g_source_remove".} - -proc g_signal_emit_by_name*(instance: gpointer, detailed_signal: cstring) {. - cdecl, varargs, dynlib: gobjectlib, importc.} diff --git a/lib/wrappers/gtk/gtk2.nim b/lib/wrappers/gtk/gtk2.nim deleted file mode 100644 index 63e69130a6..0000000000 --- a/lib/wrappers/gtk/gtk2.nim +++ /dev/null @@ -1,17064 +0,0 @@ -{.deadCodeElim: on.} -import - glib2, atk, pango, gdk2pixbuf, gdk2 - -export gbool, toBool - -when defined(win32): - const - lib = "libgtk-win32-2.0-0.dll" -elif defined(macosx): - const - lib = "libgtk-x11-2.0.dylib" - # 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 - lib = "libgtk-x11-2.0.so(|.0)" - -const - MAX_COMPOSE_LEN* = 7 - -type - PObject* = ptr TObject - PPGtkObject* = ptr PObject - PArg* = ptr TArg - PType* = ptr TType - TType* = GType - PWidget* = ptr TWidget - PMisc* = ptr TMisc - PLabel* = ptr TLabel - PMenu* = ptr TMenu - PAnchorType* = ptr TAnchorType - TAnchorType* = int32 - PArrowType* = ptr TArrowType - TArrowType* = int32 - PAttachOptions* = ptr TAttachOptions - TAttachOptions* = int32 - PButtonBoxStyle* = ptr TButtonBoxStyle - TButtonBoxStyle* = int32 - PCurveType* = ptr TCurveType - TCurveType* = int32 - PDeleteType* = ptr TDeleteType - TDeleteType* = int32 - PDirectionType* = ptr TDirectionType - TDirectionType* = int32 - PExpanderStyle* = ptr TExpanderStyle - TExpanderStyle* = int32 - PPGtkIconSize* = ptr PIconSize - PIconSize* = ptr TIconSize - TIconSize* = int32 - PTextDirection* = ptr TTextDirection - TTextDirection* = int32 - PJustification* = ptr TJustification - TJustification* = int32 - PMenuDirectionType* = ptr TMenuDirectionType - TMenuDirectionType* = int32 - PMetricType* = ptr TMetricType - TMetricType* = int32 - PMovementStep* = ptr TMovementStep - TMovementStep* = int32 - POrientation* = ptr TOrientation - TOrientation* = int32 - PCornerType* = ptr TCornerType - TCornerType* = int32 - PPackType* = ptr TPackType - TPackType* = int32 - PPathPriorityType* = ptr TPathPriorityType - TPathPriorityType* = int32 - PPathType* = ptr TPathType - TPathType* = int32 - PPolicyType* = ptr TPolicyType - TPolicyType* = int32 - PPositionType* = ptr TPositionType - TPositionType* = int32 - PReliefStyle* = ptr TReliefStyle - TReliefStyle* = int32 - PResizeMode* = ptr TResizeMode - TResizeMode* = int32 - PScrollType* = ptr TScrollType - TScrollType* = int32 - PSelectionMode* = ptr TSelectionMode - TSelectionMode* = int32 - PShadowType* = ptr TShadowType - TShadowType* = int32 - PStateType* = ptr TStateType - TStateType* = int32 - PSubmenuDirection* = ptr TSubmenuDirection - TSubmenuDirection* = int32 - PSubmenuPlacement* = ptr TSubmenuPlacement - TSubmenuPlacement* = int32 - PToolbarStyle* = ptr TToolbarStyle - TToolbarStyle* = int32 - PUpdateType* = ptr TUpdateType - TUpdateType* = int32 - PVisibility* = ptr TVisibility - TVisibility* = int32 - PWindowPosition* = ptr TWindowPosition - TWindowPosition* = int32 - PWindowType* = ptr TWindowType - TWindowType* = int32 - PWrapMode* = ptr TWrapMode - TWrapMode* = int32 - PSortType* = ptr TSortType - TSortType* = int32 - PStyle* = ptr TStyle - PPGtkTreeModel* = ptr PTreeModel - PTreeModel* = pointer - PTreePath* = pointer - PTreeIter* = ptr TTreeIter - PSelectionData* = ptr TSelectionData - PTextTagTable* = ptr TTextTagTable - PTextBTreeNode* = pointer - PTextBTree* = pointer - PTextLine* = ptr TTextLine - PTreeViewColumn* = ptr TTreeViewColumn - PTreeView* = ptr TTreeView - TTreeViewColumnDropFunc* = proc (tree_view: PTreeView, - column: PTreeViewColumn, - prev_column: PTreeViewColumn, - next_column: PTreeViewColumn, data: gpointer): gboolean{. - cdecl.} - TTreeViewMappingFunc* = proc (tree_view: PTreeView, path: PTreePath, - user_data: gpointer){.cdecl.} - TTreeViewSearchEqualFunc* = proc (model: PTreeModel, column: gint, - key: cstring, iter: PTreeIter, - search_data: gpointer): gboolean{.cdecl.} - TTreeDestroyCountFunc* = proc (tree_view: PTreeView, path: PTreePath, - children: gint, user_data: gpointer){.cdecl.} - PTreeViewDropPosition* = ptr TTreeViewDropPosition - TTreeViewDropPosition* = enum - TREE_VIEW_DROP_BEFORE, TREE_VIEW_DROP_AFTER, TREE_VIEW_DROP_INTO_OR_BEFORE, - TREE_VIEW_DROP_INTO_OR_AFTER - PObjectFlags* = ptr TObjectFlags - TObjectFlags* = int32 - TObject* = object of TGObject - flags*: guint32 - - PObjectClass* = ptr TObjectClass - TObjectClass* = object of TGObjectClass - set_arg*: proc (anObject: PObject, arg: PArg, arg_id: guint){.cdecl.} - get_arg*: proc (anObject: PObject, arg: PArg, arg_id: guint){.cdecl.} - destroy*: proc (anObject: PObject){.cdecl.} - - PFundamentalType* = ptr TFundamentalType - TFundamentalType* = GType - TFunction* = proc (data: gpointer): gboolean{.cdecl.} - TDestroyNotify* = proc (data: gpointer){.cdecl.} - TCallbackMarshal* = proc (anObject: PObject, data: gpointer, n_args: guint, - args: PArg){.cdecl.} - TSignalFunc* = proc (para1: pointer){.cdecl.} - PSignalMarshaller* = ptr TSignalMarshaller - TSignalMarshaller* = TGSignalCMarshaller - TArgSignalData*{.final, pure.} = object - f*: TSignalFunc - d*: gpointer - - TArg*{.final, pure.} = object - `type`*: TType - name*: cstring - d*: gdouble # was a union type - - PTypeInfo* = ptr TTypeInfo - TTypeInfo*{.final, pure.} = object - 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 - - PEnumValue* = ptr TEnumValue - TEnumValue* = TGEnumValue - PFlagValue* = ptr TFlagValue - TFlagValue* = TGFlagsValue - PWidgetFlags* = ptr TWidgetFlags - TWidgetFlags* = int32 - PWidgetHelpType* = ptr TWidgetHelpType - TWidgetHelpType* = enum - WIDGET_HELP_TOOLTIP, WIDGET_HELP_WHATS_THIS - PAllocation* = ptr TAllocation - TAllocation* = Gdk2.TRectangle - TCallback* = proc (widget: PWidget, data: gpointer){.cdecl.} - PRequisition* = ptr TRequisition - TRequisition*{.final, pure.} = object - width*: gint - height*: gint - - TWidget* = object of TObject - private_flags*: guint16 - state*: guint8 - saved_state*: guint8 - name*: cstring - style*: PStyle - requisition*: TRequisition - allocation*: TAllocation - window*: Gdk2.PWindow - parent*: PWidget - - PWidgetClass* = ptr TWidgetClass - TWidgetClass* = object of TObjectClass - activate_signal*: guint - set_scroll_adjustments_signal*: guint - dispatch_child_properties_changed*: proc (widget: PWidget, n_pspecs: guint, - pspecs: PPGParamSpec){.cdecl.} - show*: proc (widget: PWidget){.cdecl.} - show_all*: proc (widget: PWidget){.cdecl.} - hide*: proc (widget: PWidget){.cdecl.} - hide_all*: proc (widget: PWidget){.cdecl.} - map*: proc (widget: PWidget){.cdecl.} - unmap*: proc (widget: PWidget){.cdecl.} - realize*: proc (widget: PWidget){.cdecl.} - unrealize*: proc (widget: PWidget){.cdecl.} - size_request*: proc (widget: PWidget, requisition: PRequisition){.cdecl.} - size_allocate*: proc (widget: PWidget, allocation: PAllocation){.cdecl.} - state_changed*: proc (widget: PWidget, previous_state: TStateType){.cdecl.} - parent_set*: proc (widget: PWidget, previous_parent: PWidget){.cdecl.} - hierarchy_changed*: proc (widget: PWidget, previous_toplevel: PWidget){. - cdecl.} - style_set*: proc (widget: PWidget, previous_style: PStyle){.cdecl.} - direction_changed*: proc (widget: PWidget, - previous_direction: TTextDirection){.cdecl.} - grab_notify*: proc (widget: PWidget, was_grabbed: gboolean){.cdecl.} - child_notify*: proc (widget: PWidget, pspec: PGParamSpec){.cdecl.} - mnemonic_activate*: proc (widget: PWidget, group_cycling: gboolean): gboolean{. - cdecl.} - grab_focus*: proc (widget: PWidget){.cdecl.} - focus*: proc (widget: PWidget, direction: TDirectionType): gboolean{.cdecl.} - event*: proc (widget: PWidget, event: Gdk2.PEvent): gboolean{.cdecl.} - button_press_event*: proc (widget: PWidget, event: PEventButton): gboolean{. - cdecl.} - button_release_event*: proc (widget: PWidget, event: PEventButton): gboolean{. - cdecl.} - scroll_event*: proc (widget: PWidget, event: PEventScroll): gboolean{. - cdecl.} - motion_notify_event*: proc (widget: PWidget, event: PEventMotion): gboolean{. - cdecl.} - delete_event*: proc (widget: PWidget, event: PEventAny): gboolean{.cdecl.} - destroy_event*: proc (widget: PWidget, event: PEventAny): gboolean{.cdecl.} - expose_event*: proc (widget: PWidget, event: PEventExpose): gboolean{. - cdecl.} - key_press_event*: proc (widget: PWidget, event: PEventKey): gboolean{. - cdecl.} - key_release_event*: proc (widget: PWidget, event: PEventKey): gboolean{. - cdecl.} - enter_notify_event*: proc (widget: PWidget, event: PEventCrossing): gboolean{. - cdecl.} - leave_notify_event*: proc (widget: PWidget, event: PEventCrossing): gboolean{. - cdecl.} - configure_event*: proc (widget: PWidget, event: PEventConfigure): gboolean{. - cdecl.} - focus_in_event*: proc (widget: PWidget, event: PEventFocus): gboolean{. - cdecl.} - focus_out_event*: proc (widget: PWidget, event: PEventFocus): gboolean{. - cdecl.} - map_event*: proc (widget: PWidget, event: PEventAny): gboolean{.cdecl.} - unmap_event*: proc (widget: PWidget, event: PEventAny): gboolean{.cdecl.} - property_notify_event*: proc (widget: PWidget, event: PEventProperty): gboolean{. - cdecl.} - selection_clear_event*: proc (widget: PWidget, event: PEventSelection): gboolean{. - cdecl.} - selection_request_event*: proc (widget: PWidget, event: PEventSelection): gboolean{. - cdecl.} - selection_notify_event*: proc (widget: PWidget, event: PEventSelection): gboolean{. - cdecl.} - proximity_in_event*: proc (widget: PWidget, event: PEventProximity): gboolean{. - cdecl.} - proximity_out_event*: proc (widget: PWidget, event: PEventProximity): gboolean{. - cdecl.} - visibility_notify_event*: proc (widget: PWidget, event: PEventVisibility): gboolean{. - cdecl.} - client_event*: proc (widget: PWidget, event: PEventClient): gboolean{. - cdecl.} - no_expose_event*: proc (widget: PWidget, event: PEventAny): gboolean{. - cdecl.} - window_state_event*: proc (widget: PWidget, event: PEventWindowState): gboolean{. - cdecl.} - selection_get*: proc (widget: PWidget, selection_data: PSelectionData, - info: guint, time: guint){.cdecl.} - selection_received*: proc (widget: PWidget, selection_data: PSelectionData, - time: guint){.cdecl.} - drag_begin*: proc (widget: PWidget, context: PDragContext){.cdecl.} - drag_end*: proc (widget: PWidget, context: PDragContext){.cdecl.} - drag_data_get*: proc (widget: PWidget, context: PDragContext, - selection_data: PSelectionData, info: guint, - time: guint){.cdecl.} - drag_data_delete*: proc (widget: PWidget, context: PDragContext){.cdecl.} - drag_leave*: proc (widget: PWidget, context: PDragContext, time: guint){. - cdecl.} - drag_motion*: proc (widget: PWidget, context: PDragContext, x: gint, - y: gint, time: guint): gboolean{.cdecl.} - drag_drop*: proc (widget: PWidget, context: PDragContext, x: gint, - y: gint, time: guint): gboolean{.cdecl.} - drag_data_received*: proc (widget: PWidget, context: PDragContext, - x: gint, y: gint, selection_data: PSelectionData, - info: guint, time: guint){.cdecl.} - popup_menu*: proc (widget: PWidget): gboolean{.cdecl.} - show_help*: proc (widget: PWidget, help_type: TWidgetHelpType): gboolean{. - cdecl.} - get_accessible*: proc (widget: PWidget): atk.PObject{.cdecl.} - reserved1: proc (){.cdecl.} - reserved2: proc (){.cdecl.} - reserved3: proc (){.cdecl.} - reserved4: proc (){.cdecl.} - reserved5*: proc (){.cdecl.} - reserved6*: proc (){.cdecl.} - reserved7*: proc (){.cdecl.} - reserved8*: proc (){.cdecl.} - - PWidgetAuxInfo* = ptr TWidgetAuxInfo - TWidgetAuxInfo*{.final, pure.} = object - x*: gint - y*: gint - width*: gint - height*: gint - flag0*: guint16 - - PWidgetShapeInfo* = ptr TWidgetShapeInfo - TWidgetShapeInfo*{.final, pure.} = object - offset_x*: gint16 - offset_y*: gint16 - shape_mask*: gdk2.PBitmap - - TMisc* = object of TWidget - xalign*: gfloat - yalign*: gfloat - xpad*: guint16 - ypad*: guint16 - - PMiscClass* = ptr TMiscClass - TMiscClass* = object of TWidgetClass - PAccelFlags* = ptr TAccelFlags - TAccelFlags* = int32 - PAccelGroup* = ptr TAccelGroup - PAccelGroupEntry* = ptr TAccelGroupEntry - TAccelGroupActivate* = proc (accel_group: PAccelGroup, - acceleratable: PGObject, keyval: guint, - modifier: gdk2.TModifierType): gboolean{.cdecl.} - TAccelGroup* = object of TGObject - lock_count*: guint - modifier_mask*: gdk2.TModifierType - acceleratables*: PGSList - n_accels*: guint - priv_accels*: PAccelGroupEntry - - PAccelGroupClass* = ptr TAccelGroupClass - TAccelGroupClass* = object of TGObjectClass - accel_changed*: proc (accel_group: PAccelGroup, keyval: guint, - modifier: gdk2.TModifierType, accel_closure: PGClosure){. - cdecl.} - reserved1: proc (){.cdecl.} - reserved2: proc (){.cdecl.} - reserved3: proc (){.cdecl.} - reserved4: proc (){.cdecl.} - - PAccelKey* = ptr TAccelKey - TAccelKey*{.final, pure.} = object - accel_key*: guint - accel_mods*: gdk2.TModifierType - flag0*: guint16 - - TAccelGroupEntry*{.final, pure.} = object - key*: TAccelKey - closure*: PGClosure - accel_path_quark*: TGQuark - - Taccel_group_find_func* = proc (key: PAccelKey, closure: PGClosure, - data: gpointer): gboolean{.cdecl.} - PContainer* = ptr TContainer - TContainer* = object of TWidget - focus_child*: PWidget - Container_flag0*: int32 - - PContainerClass* = ptr TContainerClass - TContainerClass* = object of TWidgetClass - add*: proc (container: PContainer, widget: PWidget){.cdecl.} - remove*: proc (container: PContainer, widget: PWidget){.cdecl.} - check_resize*: proc (container: PContainer){.cdecl.} - forall*: proc (container: PContainer, include_internals: gboolean, - callback: TCallback, callback_data: gpointer){.cdecl.} - set_focus_child*: proc (container: PContainer, widget: PWidget){.cdecl.} - child_type*: proc (container: PContainer): TType{.cdecl.} - composite_name*: proc (container: PContainer, child: PWidget): cstring{. - cdecl.} - set_child_property*: proc (container: PContainer, child: PWidget, - property_id: guint, value: PGValue, - pspec: PGParamSpec){.cdecl.} - get_child_property*: proc (container: PContainer, child: PWidget, - property_id: guint, value: PGValue, - pspec: PGParamSpec){.cdecl.} - reserved20: proc (){.cdecl.} - reserved21: proc (){.cdecl.} - reserved23: proc (){.cdecl.} - reserved24: proc (){.cdecl.} - - PBin* = ptr TBin - TBin* = object of TContainer - child*: PWidget - - PBinClass* = ptr TBinClass - TBinClass* = object of TContainerClass - PWindowGeometryInfo* = pointer - PWindowGroup* = ptr TWindowGroup - PWindow* = ptr TWindow - TWindow* = object of TBin - title*: cstring - wmclass_name*: cstring - wmclass_class*: cstring - wm_role*: cstring - focus_widget*: PWidget - default_widget*: PWidget - transient_parent*: PWindow - geometry_info*: PWindowGeometryInfo - frame*: gdk2.PWindow - group*: PWindowGroup - configure_request_count*: guint16 - window_flag0*: int32 - frame_left*: guint - frame_top*: guint - frame_right*: guint - frame_bottom*: guint - keys_changed_handler*: guint - mnemonic_modifier*: gdk2.TModifierType - screen*: gdk2.PScreen - - PWindowClass* = ptr TWindowClass - TWindowClass* = object of TBinClass - set_focus*: proc (window: PWindow, focus: PWidget){.cdecl.} - frame_event*: proc (window: PWindow, event: gdk2.PEvent): gboolean{.cdecl.} - activate_focus*: proc (window: PWindow){.cdecl.} - activate_default*: proc (window: PWindow){.cdecl.} - move_focus*: proc (window: PWindow, direction: TDirectionType){.cdecl.} - keys_changed*: proc (window: PWindow){.cdecl.} - reserved30: proc (){.cdecl.} - reserved31: proc (){.cdecl.} - reserved32: proc (){.cdecl.} - reserved33: proc (){.cdecl.} - - TWindowGroup* = object of TGObject - grabs*: PGSList - - PWindowGroupClass* = ptr TWindowGroupClass - TWindowGroupClass* = object of TGObjectClass - reserved40: proc (){.cdecl.} - reserved41: proc (){.cdecl.} - reserved42: proc (){.cdecl.} - reserved43: proc (){.cdecl.} - - TWindowKeysForeachFunc* = proc (window: PWindow, keyval: guint, - modifiers: gdk2.TModifierType, - is_mnemonic: gboolean, data: gpointer){.cdecl.} - PLabelSelectionInfo* = pointer - TLabel* = object of TMisc - `label`*: cstring - Label_flag0*: guint16 - mnemonic_keyval*: guint - text*: cstring - attrs*: pango.PAttrList - effective_attrs*: pango.PAttrList - layout*: pango.PLayout - mnemonic_widget*: PWidget - mnemonic_window*: PWindow - select_info*: PLabelSelectionInfo - - PLabelClass* = ptr TLabelClass - TLabelClass* = object of TMiscClass - move_cursor*: proc (`label`: PLabel, step: TMovementStep, count: gint, - extend_selection: gboolean){.cdecl.} - copy_clipboard*: proc (`label`: PLabel){.cdecl.} - populate_popup*: proc (`label`: PLabel, menu: PMenu){.cdecl.} - reserved50: proc (){.cdecl.} - reserved51: proc (){.cdecl.} - reserved52: proc (){.cdecl.} - reserved53: proc (){.cdecl.} - - PAccelLabel* = ptr TAccelLabel - TAccelLabel* = object of TLabel - queue_id*: guint - accel_padding*: guint - accel_widget*: PWidget - accel_closure*: PGClosure - accel_group*: PAccelGroup - accel_string*: cstring - accel_string_width*: guint16 - - PAccelLabelClass* = ptr TAccelLabelClass - TAccelLabelClass* = object of TLabelClass - signal_quote1*: cstring - signal_quote2*: cstring - mod_name_shift*: cstring - mod_name_control*: cstring - mod_name_alt*: cstring - mod_separator*: cstring - accel_seperator*: cstring - AccelLabelClass_flag0*: guint16 - reserved61: proc (){.cdecl.} - reserved62: proc (){.cdecl.} - reserved63: proc (){.cdecl.} - reserved64: proc (){.cdecl.} - - TAccelMapForeach* = proc (data: gpointer, accel_path: cstring, - accel_key: guint, accel_mods: gdk2.TModifierType, - changed: gboolean){.cdecl.} - PAccessible* = ptr TAccessible - TAccessible* = object of atk.TObject - widget*: PWidget - - PAccessibleClass* = ptr TAccessibleClass - TAccessibleClass* = object of atk.TObjectClass - connect_widget_destroyed*: proc (accessible: PAccessible){.cdecl.} - reserved71: proc (){.cdecl.} - reserved72: proc (){.cdecl.} - reserved73: proc (){.cdecl.} - reserved74: proc (){.cdecl.} - - PAdjustment* = ptr TAdjustment - TAdjustment* = object of TObject - lower*: gdouble - upper*: gdouble - value*: gdouble - step_increment*: gdouble - page_increment*: gdouble - page_size*: gdouble - - PAdjustmentClass* = ptr TAdjustmentClass - TAdjustmentClass* = object of TObjectClass - changed*: proc (adjustment: PAdjustment){.cdecl.} - value_changed*: proc (adjustment: PAdjustment){.cdecl.} - reserved81: proc (){.cdecl.} - reserved82: proc (){.cdecl.} - reserved83: proc (){.cdecl.} - reserved84: proc (){.cdecl.} - - PAlignment* = ptr TAlignment - TAlignment* = object of TBin - xalign*: gfloat - yalign*: gfloat - xscale*: gfloat - yscale*: gfloat - - PAlignmentClass* = ptr TAlignmentClass - TAlignmentClass* = object of TBinClass - PFrame* = ptr TFrame - TFrame* = object of TBin - label_widget*: PWidget - shadow_type*: gint16 - label_xalign*: gfloat - label_yalign*: gfloat - child_allocation*: TAllocation - - PFrameClass* = ptr TFrameClass - TFrameClass* = object of TBinClass - compute_child_allocation*: proc (frame: PFrame, allocation: PAllocation){. - cdecl.} - - PAspectFrame* = ptr TAspectFrame - TAspectFrame* = object of TFrame - xalign*: gfloat - yalign*: gfloat - ratio*: gfloat - obey_child*: gboolean - center_allocation*: TAllocation - - PAspectFrameClass* = ptr TAspectFrameClass - TAspectFrameClass* = object of TFrameClass - PArrow* = ptr TArrow - TArrow* = object of TMisc - arrow_type*: gint16 - shadow_type*: gint16 - - PArrowClass* = ptr TArrowClass - TArrowClass* = object of TMiscClass - PBindingEntry* = ptr TBindingEntry - PBindingSignal* = ptr TBindingSignal - PBindingArg* = ptr TBindingArg - PBindingSet* = ptr TBindingSet - TBindingSet*{.final, pure.} = object - set_name*: cstring - priority*: gint - widget_path_pspecs*: PGSList - widget_class_pspecs*: PGSList - class_branch_pspecs*: PGSList - entries*: PBindingEntry - current*: PBindingEntry - flag0*: guint16 - - TBindingEntry*{.final, pure.} = object - keyval*: guint - modifiers*: gdk2.TModifierType - binding_set*: PBindingSet - flag0*: guint16 - set_next*: PBindingEntry - hash_next*: PBindingEntry - signals*: PBindingSignal - - TBindingSignal*{.final, pure.} = object - next*: PBindingSignal - signal_name*: cstring - n_args*: guint - args*: PBindingArg - - TBindingArg*{.final, pure.} = object - arg_type*: TType - d*: gdouble - - PBox* = ptr TBox - TBox* = object of TContainer - children*: PGList - spacing*: gint16 - box_flag0*: guint16 - - PBoxClass* = ptr TBoxClass - TBoxClass* = object of TContainerClass - PBoxChild* = ptr TBoxChild - TBoxChild*{.final, pure.} = object - widget*: PWidget - padding*: guint16 - flag0*: guint16 - - PButtonBox* = ptr TButtonBox - TButtonBox* = object of TBox - child_min_width*: gint - child_min_height*: gint - child_ipad_x*: gint - child_ipad_y*: gint - layout_style*: TButtonBoxStyle - - PButtonBoxClass* = ptr TButtonBoxClass - TButtonBoxClass* = object of TBoxClass - PButton* = ptr TButton - TButton* = object of TBin - event_window*: gdk2.PWindow - label_text*: cstring - activate_timeout*: guint - button_flag0*: guint16 - - PButtonClass* = ptr TButtonClass - TButtonClass* = object of TBinClass - pressed*: proc (button: PButton){.cdecl.} - released*: proc (button: PButton){.cdecl.} - clicked*: proc (button: PButton){.cdecl.} - enter*: proc (button: PButton){.cdecl.} - leave*: proc (button: PButton){.cdecl.} - activate*: proc (button: PButton){.cdecl.} - reserved101: proc (){.cdecl.} - reserved102: proc (){.cdecl.} - reserved103: proc (){.cdecl.} - reserved104: proc (){.cdecl.} - - PCalendarDisplayOptions* = ptr TCalendarDisplayOptions - TCalendarDisplayOptions* = int32 - PCalendar* = ptr TCalendar - TCalendar* = object of TWidget - header_style*: PStyle - label_style*: PStyle - 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*: TCalendarDisplayOptions - marked_date_color*: array[0..30, gdk2.TColor] - gc*: gdk2.PGC - xor_gc*: gdk2.PGC - focus_row*: gint - focus_col*: gint - highlight_row*: gint - highlight_col*: gint - private_data*: gpointer - grow_space*: array[0..31, gchar] - reserved111: proc (){.cdecl.} - reserved112: proc (){.cdecl.} - reserved113: proc (){.cdecl.} - reserved114: proc (){.cdecl.} - - PCalendarClass* = ptr TCalendarClass - TCalendarClass* = object of TWidgetClass - month_changed*: proc (calendar: PCalendar){.cdecl.} - day_selected*: proc (calendar: PCalendar){.cdecl.} - day_selected_double_click*: proc (calendar: PCalendar){.cdecl.} - prev_month*: proc (calendar: PCalendar){.cdecl.} - next_month*: proc (calendar: PCalendar){.cdecl.} - prev_year*: proc (calendar: PCalendar){.cdecl.} - next_year*: proc (calendar: PCalendar){.cdecl.} - - PCellEditable* = pointer - PCellEditableIface* = ptr TCellEditableIface - TCellEditableIface* = object of TGTypeInterface - editing_done*: proc (cell_editable: PCellEditable){.cdecl.} - remove_widget*: proc (cell_editable: PCellEditable){.cdecl.} - start_editing*: proc (cell_editable: PCellEditable, event: gdk2.PEvent){.cdecl.} - - PCellRendererState* = ptr TCellRendererState - TCellRendererState* = int32 - PCellRendererMode* = ptr TCellRendererMode - TCellRendererMode* = enum - CELL_RENDERER_MODE_INERT, CELL_RENDERER_MODE_ACTIVATABLE, - CELL_RENDERER_MODE_EDITABLE - PCellRenderer* = ptr TCellRenderer - TCellRenderer* = object of TObject - xalign*: gfloat - yalign*: gfloat - width*: gint - height*: gint - xpad*: guint16 - ypad*: guint16 - CellRenderer_flag0*: guint16 - - PCellRendererClass* = ptr TCellRendererClass - TCellRendererClass* = object of TObjectClass - get_size*: proc (cell: PCellRenderer, widget: PWidget, - cell_area: gdk2.PRectangle, x_offset: Pgint, y_offset: Pgint, - width: Pgint, height: Pgint){.cdecl.} - render*: proc (cell: PCellRenderer, window: gdk2.PWindow, widget: PWidget, - background_area: gdk2.PRectangle, cell_area: gdk2.PRectangle, - expose_area: gdk2.PRectangle, flags: TCellRendererState){.cdecl.} - activate*: proc (cell: PCellRenderer, event: gdk2.PEvent, widget: PWidget, - path: cstring, background_area: gdk2.PRectangle, - cell_area: gdk2.PRectangle, flags: TCellRendererState): gboolean{. - cdecl.} - start_editing*: proc (cell: PCellRenderer, event: gdk2.PEvent, - widget: PWidget, path: cstring, - background_area: gdk2.PRectangle, - cell_area: gdk2.PRectangle, flags: TCellRendererState): PCellEditable{. - cdecl.} - reserved121: proc (){.cdecl.} - reserved122: proc (){.cdecl.} - reserved123: proc (){.cdecl.} - reserved124: proc (){.cdecl.} - - PCellRendererText* = ptr TCellRendererText - TCellRendererText* = object of TCellRenderer - text*: cstring - font*: pango.PFontDescription - font_scale*: gdouble - foreground*: pango.TColor - background*: pango.TColor - extra_attrs*: pango.PAttrList - underline_style*: pango.TUnderline - rise*: gint - fixed_height_rows*: gint - CellRendererText_flag0*: guint16 - - PCellRendererTextClass* = ptr TCellRendererTextClass - TCellRendererTextClass* = object of TCellRendererClass - edited*: proc (cell_renderer_text: PCellRendererText, path: cstring, - new_text: cstring){.cdecl.} - reserved131: proc (){.cdecl.} - reserved132: proc (){.cdecl.} - reserved133: proc (){.cdecl.} - reserved134: proc (){.cdecl.} - - PCellRendererToggle* = ptr TCellRendererToggle - TCellRendererToggle* = object of TCellRenderer - CellRendererToggle_flag0*: guint16 - - PCellRendererToggleClass* = ptr TCellRendererToggleClass - TCellRendererToggleClass* = object of TCellRendererClass - toggled*: proc (cell_renderer_toggle: PCellRendererToggle, path: cstring){. - cdecl.} - reserved141: proc (){.cdecl.} - reserved142: proc (){.cdecl.} - reserved143: proc (){.cdecl.} - reserved144: proc (){.cdecl.} - - PCellRendererPixbuf* = ptr TCellRendererPixbuf - TCellRendererPixbuf* = object of TCellRenderer - pixbuf*: gdk2pixbuf.PPixbuf - pixbuf_expander_open*: gdk2pixbuf.PPixbuf - pixbuf_expander_closed*: gdk2pixbuf.PPixbuf - - PCellRendererPixbufClass* = ptr TCellRendererPixbufClass - TCellRendererPixbufClass* = object of TCellRendererClass - reserved151: proc (){.cdecl.} - reserved152: proc (){.cdecl.} - reserved153: proc (){.cdecl.} - reserved154: proc (){.cdecl.} - - PItem* = ptr TItem - TItem* = object of TBin - PItemClass* = ptr TItemClass - TItemClass* = object of TBinClass - select*: proc (item: PItem){.cdecl.} - deselect*: proc (item: PItem){.cdecl.} - toggle*: proc (item: PItem){.cdecl.} - reserved161: proc (){.cdecl.} - reserved162: proc (){.cdecl.} - reserved163: proc (){.cdecl.} - reserved164: proc (){.cdecl.} - - PMenuItem* = ptr TMenuItem - TMenuItem* = object of TItem - submenu*: PWidget - event_window*: gdk2.PWindow - toggle_size*: guint16 - accelerator_width*: guint16 - accel_path*: cstring - MenuItem_flag0*: guint16 - timer*: guint - - PMenuItemClass* = ptr TMenuItemClass - TMenuItemClass* = object of TItemClass - MenuItemClass_flag0*: guint16 - activate*: proc (menu_item: PMenuItem){.cdecl.} - activate_item*: proc (menu_item: PMenuItem){.cdecl.} - toggle_size_request*: proc (menu_item: PMenuItem, requisition: Pgint){.cdecl.} - toggle_size_allocate*: proc (menu_item: PMenuItem, allocation: gint){.cdecl.} - reserved171: proc (){.cdecl.} - reserved172: proc (){.cdecl.} - reserved173: proc (){.cdecl.} - reserved174: proc (){.cdecl.} - - PToggleButton* = ptr TToggleButton - TToggleButton* = object of TButton - ToggleButton_flag0*: guint16 - - PToggleButtonClass* = ptr TToggleButtonClass - TToggleButtonClass* = object of TButtonClass - toggled*: proc (toggle_button: PToggleButton){.cdecl.} - reserved171: proc (){.cdecl.} - reserved172: proc (){.cdecl.} - reserved173: proc (){.cdecl.} - reserved174: proc (){.cdecl.} - - PCheckButton* = ptr TCheckButton - TCheckButton* = object of TToggleButton - PCheckButtonClass* = ptr TCheckButtonClass - TCheckButtonClass* = object of TToggleButtonClass - draw_indicator*: proc (check_button: PCheckButton, area: gdk2.PRectangle){. - cdecl.} - reserved181: proc (){.cdecl.} - reserved182: proc (){.cdecl.} - reserved183: proc (){.cdecl.} - reserved184: proc (){.cdecl.} - - PCheckMenuItem* = ptr TCheckMenuItem - TCheckMenuItem* = object of TMenuItem - CheckMenuItem_flag0*: guint16 - - PCheckMenuItemClass* = ptr TCheckMenuItemClass - TCheckMenuItemClass* = object of TMenuItemClass - toggled*: proc (check_menu_item: PCheckMenuItem){.cdecl.} - draw_indicator*: proc (check_menu_item: PCheckMenuItem, area: gdk2.PRectangle){. - cdecl.} - reserved191: proc (){.cdecl.} - reserved192: proc (){.cdecl.} - reserved193: proc (){.cdecl.} - reserved194: proc (){.cdecl.} - - PClipboard* = pointer - TClipboardReceivedFunc* = proc (clipboard: PClipboard, - selection_data: PSelectionData, data: gpointer){. - cdecl.} - TClipboardTextReceivedFunc* = proc (clipboard: PClipboard, text: cstring, - data: gpointer){.cdecl.} - TClipboardGetFunc* = proc (clipboard: PClipboard, - selection_data: PSelectionData, info: guint, - user_data_or_owner: gpointer){.cdecl.} - TClipboardClearFunc* = proc (clipboard: PClipboard, - user_data_or_owner: gpointer){.cdecl.} - PCList* = ptr TCList - PCListColumn* = ptr TCListColumn - PCListRow* = ptr TCListRow - PCell* = ptr TCell - PCellType* = ptr TCellType - TCellType* = enum - CELL_EMPTY, CELL_TEXT, CELL_PIXMAP, CELL_PIXTEXT, CELL_WIDGET - PCListDragPos* = ptr TCListDragPos - TCListDragPos* = enum - CLIST_DRAG_NONE, CLIST_DRAG_BEFORE, CLIST_DRAG_INTO, CLIST_DRAG_AFTER - PButtonAction* = ptr TButtonAction - TButtonAction* = int32 - TCListCompareFunc* = proc (clist: PCList, ptr1: gconstpointer, - ptr2: gconstpointer): gint{.cdecl.} - PCListCellInfo* = ptr TCListCellInfo - TCListCellInfo*{.final, pure.} = object - row*: gint - column*: gint - - PCListDestInfo* = ptr TCListDestInfo - TCListDestInfo*{.final, pure.} = object - cell*: TCListCellInfo - insert_pos*: TCListDragPos - - TCList* = object of TContainer - CList_flags*: guint16 - row_mem_chunk*: PGMemChunk - cell_mem_chunk*: PGMemChunk - freeze_count*: guint - internal_allocation*: gdk2.TRectangle - rows*: gint - row_height*: gint - row_list*: PGList - row_list_end*: PGList - columns*: gint - column_title_area*: gdk2.TRectangle - title_window*: gdk2.PWindow - column*: PCListColumn - clist_window*: gdk2.PWindow - clist_window_width*: gint - clist_window_height*: gint - hoffset*: gint - voffset*: gint - shadow_type*: TShadowType - selection_mode*: TSelectionMode - 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*: TCListCellInfo - hadjustment*: PAdjustment - vadjustment*: PAdjustment - xor_gc*: gdk2.PGC - fg_gc*: gdk2.PGC - bg_gc*: gdk2.PGC - cursor_drag*: gdk2.PCursor - x_drag*: gint - focus_row*: gint - focus_header_column*: gint - anchor*: gint - anchor_state*: TStateType - drag_pos*: gint - htimer*: gint - vtimer*: gint - sort_type*: TSortType - compare*: TCListCompareFunc - sort_column*: gint - drag_highlight_row*: gint - drag_highlight_pos*: TCListDragPos - - PCListClass* = ptr TCListClass - TCListClass* = object of TContainerClass - set_scroll_adjustments*: proc (clist: PCList, hadjustment: PAdjustment, - vadjustment: PAdjustment){.cdecl.} - refresh*: proc (clist: PCList){.cdecl.} - select_row*: proc (clist: PCList, row: gint, column: gint, event: gdk2.PEvent){. - cdecl.} - unselect_row*: proc (clist: PCList, row: gint, column: gint, - event: gdk2.PEvent){.cdecl.} - row_move*: proc (clist: PCList, source_row: gint, dest_row: gint){.cdecl.} - click_column*: proc (clist: PCList, column: gint){.cdecl.} - resize_column*: proc (clist: PCList, column: gint, width: gint){.cdecl.} - toggle_focus_row*: proc (clist: PCList){.cdecl.} - select_all*: proc (clist: PCList){.cdecl.} - unselect_all*: proc (clist: PCList){.cdecl.} - undo_selection*: proc (clist: PCList){.cdecl.} - start_selection*: proc (clist: PCList){.cdecl.} - end_selection*: proc (clist: PCList){.cdecl.} - extend_selection*: proc (clist: PCList, scroll_type: TScrollType, - position: gfloat, auto_start_selection: gboolean){. - cdecl.} - scroll_horizontal*: proc (clist: PCList, scroll_type: TScrollType, - position: gfloat){.cdecl.} - scroll_vertical*: proc (clist: PCList, scroll_type: TScrollType, - position: gfloat){.cdecl.} - toggle_add_mode*: proc (clist: PCList){.cdecl.} - abort_column_resize*: proc (clist: PCList){.cdecl.} - resync_selection*: proc (clist: PCList, event: gdk2.PEvent){.cdecl.} - selection_find*: proc (clist: PCList, row_number: gint, - row_list_element: PGList): PGList{.cdecl.} - draw_row*: proc (clist: PCList, area: gdk2.PRectangle, row: gint, - clist_row: PCListRow){.cdecl.} - draw_drag_highlight*: proc (clist: PCList, target_row: PCListRow, - target_row_number: gint, drag_pos: TCListDragPos){. - cdecl.} - clear*: proc (clist: PCList){.cdecl.} - fake_unselect_all*: proc (clist: PCList, row: gint){.cdecl.} - sort_list*: proc (clist: PCList){.cdecl.} - insert_row*: proc (clist: PCList, row: gint): gint{.cdecl, varargs.} - remove_row*: proc (clist: PCList, row: gint){.cdecl.} - set_cell_contents*: proc (clist: PCList, clist_row: PCListRow, column: gint, - thetype: TCellType, text: cstring, - spacing: guint8, pixmap: gdk2.PPixmap, - mask: gdk2.PBitmap){.cdecl.} - cell_size_request*: proc (clist: PCList, clist_row: PCListRow, column: gint, - requisition: PRequisition){.cdecl.} - - PGPtrArray = pointer - PGArray = pointer - TCListColumn*{.final, pure.} = object - title*: cstring - area*: gdk2.TRectangle - button*: PWidget - window*: gdk2.PWindow - width*: gint - min_width*: gint - max_width*: gint - justification*: TJustification - flag0*: guint16 - - TCListRow*{.final, pure.} = object - cell*: PCell - state*: TStateType - foreground*: gdk2.TColor - background*: gdk2.TColor - style*: PStyle - data*: gpointer - destroy*: TDestroyNotify - flag0*: guint16 - - PCellText* = ptr TCellText - TCellText*{.final, pure.} = object - `type`*: TCellType - vertical*: gint16 - horizontal*: gint16 - style*: PStyle - text*: cstring - - PCellPixmap* = ptr TCellPixmap - TCellPixmap*{.final, pure.} = object - `type`*: TCellType - vertical*: gint16 - horizontal*: gint16 - style*: PStyle - pixmap*: gdk2.PPixmap - mask*: gdk2.PBitmap - - PCellPixText* = ptr TCellPixText - TCellPixText*{.final, pure.} = object - `type`*: TCellType - vertical*: gint16 - horizontal*: gint16 - style*: PStyle - text*: cstring - spacing*: guint8 - pixmap*: gdk2.PPixmap - mask*: gdk2.PBitmap - - PCellWidget* = ptr TCellWidget - TCellWidget*{.final, pure.} = object - `type`*: TCellType - vertical*: gint16 - horizontal*: gint16 - style*: PStyle - widget*: PWidget - - TCell*{.final, pure.} = object - `type`*: TCellType - vertical*: gint16 - horizontal*: gint16 - style*: PStyle - text*: cstring - spacing*: guint8 - pixmap*: gdk2.PPixmap - mask*: gdk2.PBitmap - - PDialogFlags* = ptr TDialogFlags - TDialogFlags* = int32 - PResponseType* = ptr TResponseType - TResponseType* = int32 - PDialog* = ptr TDialog - TDialog* = object of TWindow - vbox*: PBox - action_area*: PWidget - separator*: PWidget - - PDialogClass* = ptr TDialogClass - TDialogClass* = object of TWindowClass - response*: proc (dialog: PDialog, response_id: gint){.cdecl.} - closeFile*: proc (dialog: PDialog){.cdecl.} - reserved201: proc (){.cdecl.} - reserved202: proc (){.cdecl.} - reserved203: proc (){.cdecl.} - reserved204: proc (){.cdecl.} - - PVBox* = ptr TVBox - TVBox* = object of TBox - PVBoxClass* = ptr TVBoxClass - TVBoxClass* = object of TBoxClass - TColorSelectionChangePaletteFunc* = proc (colors: gdk2.PColor, n_colors: gint){. - cdecl.} - TColorSelectionChangePaletteWithScreenFunc* = proc (screen: gdk2.PScreen, - colors: gdk2.PColor, n_colors: gint){.cdecl.} - PColorSelection* = ptr TColorSelection - TColorSelection* = object of TVBox - private_data*: gpointer - - PColorSelectionClass* = ptr TColorSelectionClass - TColorSelectionClass* = object of TVBoxClass - color_changed*: proc (color_selection: PColorSelection){.cdecl.} - reserved211: proc (){.cdecl.} - reserved212: proc (){.cdecl.} - reserved213: proc (){.cdecl.} - reserved214: proc (){.cdecl.} - - PColorSelectionDialog* = ptr TColorSelectionDialog - TColorSelectionDialog* = object of TDialog - colorsel*: PWidget - ok_button*: PWidget - cancel_button*: PWidget - help_button*: PWidget - - PColorSelectionDialogClass* = ptr TColorSelectionDialogClass - TColorSelectionDialogClass* = object of TDialogClass - reserved221: proc (){.cdecl.} - reserved222: proc (){.cdecl.} - reserved223: proc (){.cdecl.} - reserved224: proc (){.cdecl.} - - PHBox* = ptr THBox - THBox* = object of TBox - PHBoxClass* = ptr THBoxClass - THBoxClass* = object of TBoxClass - PCombo* = ptr TCombo - TCombo* = object of THBox - entry*: PWidget - button*: PWidget - popup*: PWidget - popwin*: PWidget - list*: PWidget - entry_change_id*: guint - list_change_id*: guint - Combo_flag0*: guint16 - current_button*: guint16 - activate_id*: guint - - PComboClass* = ptr TComboClass - TComboClass* = object of THBoxClass - reserved231: proc (){.cdecl.} - reserved232: proc (){.cdecl.} - reserved233: proc (){.cdecl.} - reserved234: proc (){.cdecl.} - - PCTreePos* = ptr TCTreePos - TCTreePos* = enum - CTREE_POS_BEFORE, CTREE_POS_AS_CHILD, CTREE_POS_AFTER - PCTreeLineStyle* = ptr TCTreeLineStyle - TCTreeLineStyle* = enum - CTREE_LINES_NONE, CTREE_LINES_SOLID, CTREE_LINES_DOTTED, CTREE_LINES_TABBED - PCTreeExpanderStyle* = ptr TCTreeExpanderStyle - TCTreeExpanderStyle* = enum - CTREE_EXPANDER_NONE, CTREE_EXPANDER_SQUARE, CTREE_EXPANDER_TRIANGLE, - CTREE_EXPANDER_CIRCULAR - PCTreeExpansionType* = ptr TCTreeExpansionType - TCTreeExpansionType* = enum - CTREE_EXPANSION_EXPAND, CTREE_EXPANSION_EXPAND_RECURSIVE, - CTREE_EXPANSION_COLLAPSE, CTREE_EXPANSION_COLLAPSE_RECURSIVE, - CTREE_EXPANSION_TOGGLE, CTREE_EXPANSION_TOGGLE_RECURSIVE - PCTree* = ptr TCTree - PCTreeNode* = ptr TCTreeNode - TCTreeFunc* = proc (ctree: PCTree, node: PCTreeNode, data: gpointer){.cdecl.} - TCTreeGNodeFunc* = proc (ctree: PCTree, depth: guint, gnode: PGNode, - cnode: PCTreeNode, data: gpointer): gboolean{.cdecl.} - TCTreeCompareDragFunc* = proc (ctree: PCTree, source_node: PCTreeNode, - new_parent: PCTreeNode, new_sibling: PCTreeNode): gboolean{. - cdecl.} - TCTree* = object of TCList - lines_gc*: gdk2.PGC - tree_indent*: gint - tree_spacing*: gint - tree_column*: gint - CTree_flag0*: guint16 - drag_compare*: TCTreeCompareDragFunc - - PCTreeClass* = ptr TCTreeClass - TCTreeClass* = object of TCListClass - tree_select_row*: proc (ctree: PCTree, row: PCTreeNode, column: gint){.cdecl.} - tree_unselect_row*: proc (ctree: PCTree, row: PCTreeNode, column: gint){. - cdecl.} - tree_expand*: proc (ctree: PCTree, node: PCTreeNode){.cdecl.} - tree_collapse*: proc (ctree: PCTree, node: PCTreeNode){.cdecl.} - tree_move*: proc (ctree: PCTree, node: PCTreeNode, new_parent: PCTreeNode, - new_sibling: PCTreeNode){.cdecl.} - change_focus_row_expansion*: proc (ctree: PCTree, - action: TCTreeExpansionType){.cdecl.} - - PCTreeRow* = ptr TCTreeRow - TCTreeRow*{.final, pure.} = object - row*: TCListRow - parent*: PCTreeNode - sibling*: PCTreeNode - children*: PCTreeNode - pixmap_closed*: gdk2.PPixmap - mask_closed*: gdk2.PBitmap - pixmap_opened*: gdk2.PPixmap - mask_opened*: gdk2.PBitmap - level*: guint16 - CTreeRow_flag0*: guint16 - - TCTreeNode*{.final, pure.} = object - list*: TGList - - PDrawingArea* = ptr TDrawingArea - TDrawingArea* = object of TWidget - draw_data*: gpointer - - PDrawingAreaClass* = ptr TDrawingAreaClass - TDrawingAreaClass* = object of TWidgetClass - reserved241: proc (){.cdecl.} - reserved242: proc (){.cdecl.} - reserved243: proc (){.cdecl.} - reserved244: proc (){.cdecl.} - - Tctlpoint* = array[0..1, gfloat] - Pctlpoint* = ptr Tctlpoint - PCurve* = ptr TCurve - TCurve* = object of TDrawingArea - cursor_type*: gint - min_x*: gfloat - max_x*: gfloat - min_y*: gfloat - max_y*: gfloat - pixmap*: gdk2.PPixmap - curve_type*: TCurveType - height*: gint - grab_point*: gint - last*: gint - num_points*: gint - point*: gdk2.PPoint - num_ctlpoints*: gint - ctlpoint*: Pctlpoint - - PCurveClass* = ptr TCurveClass - TCurveClass* = object of TDrawingAreaClass - curve_type_changed*: proc (curve: PCurve){.cdecl.} - reserved251: proc (){.cdecl.} - reserved252: proc (){.cdecl.} - reserved253: proc (){.cdecl.} - reserved254: proc (){.cdecl.} - - PDestDefaults* = ptr TDestDefaults - TDestDefaults* = int32 - PTargetFlags* = ptr TTargetFlags - TTargetFlags* = int32 - PEditable* = pointer - PEditableClass* = ptr TEditableClass - TEditableClass* = object of TGTypeInterface - insert_text*: proc (editable: PEditable, text: cstring, length: gint, - position: Pgint){.cdecl.} - delete_text*: proc (editable: PEditable, start_pos: gint, end_pos: gint){. - cdecl.} - changed*: proc (editable: PEditable){.cdecl.} - do_insert_text*: proc (editable: PEditable, text: cstring, length: gint, - position: Pgint){.cdecl.} - do_delete_text*: proc (editable: PEditable, start_pos: gint, end_pos: gint){. - cdecl.} - get_chars*: proc (editable: PEditable, start_pos: gint, end_pos: gint): cstring{. - cdecl.} - set_selection_bounds*: proc (editable: PEditable, start_pos: gint, - end_pos: gint){.cdecl.} - get_selection_bounds*: proc (editable: PEditable, start_pos: Pgint, - end_pos: Pgint): gboolean{.cdecl.} - set_position*: proc (editable: PEditable, position: gint){.cdecl.} - get_position*: proc (editable: PEditable): gint{.cdecl.} - - PIMContext* = ptr TIMContext - TIMContext* = object of TGObject - PIMContextClass* = ptr TIMContextClass - TIMContextClass* = object of TObjectClass - preedit_start*: proc (context: PIMContext){.cdecl.} - preedit_end*: proc (context: PIMContext){.cdecl.} - preedit_changed*: proc (context: PIMContext){.cdecl.} - commit*: proc (context: PIMContext, str: cstring){.cdecl.} - retrieve_surrounding*: proc (context: PIMContext): gboolean{.cdecl.} - delete_surrounding*: proc (context: PIMContext, offset: gint, n_chars: gint): gboolean{. - cdecl.} - set_client_window*: proc (context: PIMContext, window: gdk2.PWindow){.cdecl.} - get_preedit_string*: proc (context: PIMContext, str: PPgchar, - attrs: var pango.PAttrList, cursor_pos: Pgint){. - cdecl.} - filter_keypress*: proc (context: PIMContext, event: gdk2.PEventKey): gboolean{. - cdecl.} - focus_in*: proc (context: PIMContext){.cdecl.} - focus_out*: proc (context: PIMContext){.cdecl.} - reset*: proc (context: PIMContext){.cdecl.} - set_cursor_location*: proc (context: PIMContext, area: gdk2.PRectangle){.cdecl.} - set_use_preedit*: proc (context: PIMContext, use_preedit: gboolean){.cdecl.} - set_surrounding*: proc (context: PIMContext, text: cstring, len: gint, - cursor_index: gint){.cdecl.} - get_surrounding*: proc (context: PIMContext, text: PPgchar, - cursor_index: Pgint): gboolean{.cdecl.} - reserved261: proc (){.cdecl.} - reserved262: proc (){.cdecl.} - reserved263: proc (){.cdecl.} - reserved264: proc (){.cdecl.} - reserved265: proc (){.cdecl.} - reserved266: proc (){.cdecl.} - - PMenuShell* = ptr TMenuShell - TMenuShell* = object of TContainer - children*: PGList - active_menu_item*: PWidget - parent_menu_shell*: PWidget - button*: guint - activate_time*: guint32 - MenuShell_flag0*: guint16 - - PMenuShellClass* = ptr TMenuShellClass - TMenuShellClass* = object of TContainerClass - MenuShellClass_flag0*: guint16 - deactivate*: proc (menu_shell: PMenuShell){.cdecl.} - selection_done*: proc (menu_shell: PMenuShell){.cdecl.} - move_current*: proc (menu_shell: PMenuShell, direction: TMenuDirectionType){. - cdecl.} - activate_current*: proc (menu_shell: PMenuShell, force_hide: gboolean){. - cdecl.} - cancel*: proc (menu_shell: PMenuShell){.cdecl.} - select_item*: proc (menu_shell: PMenuShell, menu_item: PWidget){.cdecl.} - insert*: proc (menu_shell: PMenuShell, child: PWidget, position: gint){. - cdecl.} - reserved271: proc (){.cdecl.} - reserved272: proc (){.cdecl.} - reserved273: proc (){.cdecl.} - reserved274: proc (){.cdecl.} - - TMenuPositionFunc* = proc (menu: PMenu, x: Pgint, y: Pgint, - push_in: Pgboolean, user_data: gpointer){.cdecl.} - TMenuDetachFunc* = proc (attach_widget: PWidget, menu: PMenu){.cdecl.} - TMenu* = object of TMenuShell - parent_menu_item*: PWidget - old_active_menu_item*: PWidget - accel_group*: PAccelGroup - accel_path*: cstring - position_func*: TMenuPositionFunc - position_func_data*: gpointer - toggle_size*: guint - toplevel*: PWidget - tearoff_window*: PWidget - tearoff_hbox*: PWidget - tearoff_scrollbar*: PWidget - tearoff_adjustment*: PAdjustment - view_window*: gdk2.PWindow - bin_window*: gdk2.PWindow - scroll_offset*: gint - saved_scroll_offset*: gint - scroll_step*: gint - timeout_id*: guint - navigation_region*: gdk2.PRegion - navigation_timeout*: guint - Menu_flag0*: guint16 - - PMenuClass* = ptr TMenuClass - TMenuClass* = object of TMenuShellClass - reserved281: proc (){.cdecl.} - reserved282: proc (){.cdecl.} - reserved283: proc (){.cdecl.} - reserved284: proc (){.cdecl.} - - PEntry* = ptr TEntry - TEntry* = object of TWidget - text*: cstring - Entry_flag0*: guint16 - text_length*: guint16 - text_max_length*: guint16 - text_area*: gdk2.PWindow - im_context*: PIMContext - popup_menu*: PWidget - current_pos*: gint - selection_bound*: gint - cached_layout*: pango.PLayout - 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 - - PEntryClass* = ptr TEntryClass - TEntryClass* = object of TWidgetClass - populate_popup*: proc (entry: PEntry, menu: PMenu){.cdecl.} - activate*: proc (entry: PEntry){.cdecl.} - move_cursor*: proc (entry: PEntry, step: TMovementStep, count: gint, - extend_selection: gboolean){.cdecl.} - insert_at_cursor*: proc (entry: PEntry, str: cstring){.cdecl.} - delete_from_cursor*: proc (entry: PEntry, thetype: TDeleteType, count: gint){. - cdecl.} - cut_clipboard*: proc (entry: PEntry){.cdecl.} - copy_clipboard*: proc (entry: PEntry){.cdecl.} - paste_clipboard*: proc (entry: PEntry){.cdecl.} - toggle_overwrite*: proc (entry: PEntry){.cdecl.} - reserved291: proc (){.cdecl.} - reserved292: proc (){.cdecl.} - reserved293: proc (){.cdecl.} - reserved294: proc (){.cdecl.} - - PEventBox* = ptr TEventBox - TEventBox* = object of TBin - PEventBoxClass* = ptr TEventBoxClass - TEventBoxClass* = object of TBinClass - PFileSelection* = ptr TFileSelection - TFileSelection* = object of TDialog - dir_list*: PWidget - file_list*: PWidget - selection_entry*: PWidget - selection_text*: PWidget - main_vbox*: PWidget - ok_button*: PWidget - cancel_button*: PWidget - help_button*: PWidget - history_pulldown*: PWidget - history_menu*: PWidget - history_list*: PGList - fileop_dialog*: PWidget - fileop_entry*: PWidget - fileop_file*: cstring - cmpl_state*: gpointer - fileop_c_dir*: PWidget - fileop_del_file*: PWidget - fileop_ren_file*: PWidget - button_area*: PWidget - FileSelection_action_area*: PWidget - selected_names*: PGPtrArray - last_selected*: cstring - - PFileSelectionClass* = ptr TFileSelectionClass - TFileSelectionClass* = object of TDialogClass - reserved301: proc (){.cdecl.} - reserved302: proc (){.cdecl.} - reserved303: proc (){.cdecl.} - reserved304: proc (){.cdecl.} - - PFixed* = ptr TFixed - TFixed* = object of TContainer - children*: PGList - - PFixedClass* = ptr TFixedClass - TFixedClass* = object of TContainerClass - PFixedChild* = ptr TFixedChild - TFixedChild*{.final, pure.} = object - widget*: PWidget - x*: gint - y*: gint - - PFontSelection* = ptr TFontSelection - TFontSelection* = object of TVBox - font_entry*: PWidget - family_list*: PWidget - font_style_entry*: PWidget - face_list*: PWidget - size_entry*: PWidget - size_list*: PWidget - pixels_button*: PWidget - points_button*: PWidget - filter_button*: PWidget - preview_entry*: PWidget - family*: pango.PFontFamily - face*: pango.PFontFace - size*: gint - font*: gdk2.PFont - - PFontSelectionClass* = ptr TFontSelectionClass - TFontSelectionClass* = object of TVBoxClass - reserved311: proc (){.cdecl.} - reserved312: proc (){.cdecl.} - reserved313: proc (){.cdecl.} - reserved314: proc (){.cdecl.} - - PFontSelectionDialog* = ptr TFontSelectionDialog - TFontSelectionDialog* = object of TDialog - fontsel*: PWidget - main_vbox*: PWidget - FontSelectionDialog_action_area*: PWidget - ok_button*: PWidget - apply_button*: PWidget - cancel_button*: PWidget - dialog_width*: gint - auto_resize*: gboolean - - PFontSelectionDialogClass* = ptr TFontSelectionDialogClass - TFontSelectionDialogClass* = object of TDialogClass - reserved321: proc (){.cdecl.} - reserved322: proc (){.cdecl.} - reserved323: proc (){.cdecl.} - reserved324: proc (){.cdecl.} - - PGammaCurve* = ptr TGammaCurve - TGammaCurve* = object of TVBox - table*: PWidget - curve*: PWidget - button*: array[0..4, PWidget] - gamma*: gfloat - gamma_dialog*: PWidget - gamma_text*: PWidget - - PGammaCurveClass* = ptr TGammaCurveClass - TGammaCurveClass* = object of TVBoxClass - reserved331: proc (){.cdecl.} - reserved332: proc (){.cdecl.} - reserved333: proc (){.cdecl.} - reserved334: proc (){.cdecl.} - - PHandleBox* = ptr THandleBox - THandleBox* = object of TBin - bin_window*: gdk2.PWindow - float_window*: gdk2.PWindow - shadow_type*: TShadowType - HandleBox_flag0*: guint16 - deskoff_x*: gint - deskoff_y*: gint - attach_allocation*: TAllocation - float_allocation*: TAllocation - - PHandleBoxClass* = ptr THandleBoxClass - THandleBoxClass* = object of TBinClass - child_attached*: proc (handle_box: PHandleBox, child: PWidget){.cdecl.} - child_detached*: proc (handle_box: PHandleBox, child: PWidget){.cdecl.} - reserved341: proc (){.cdecl.} - reserved342: proc (){.cdecl.} - reserved343: proc (){.cdecl.} - reserved344: proc (){.cdecl.} - - PPaned* = ptr TPaned - TPaned* = object of TContainer - child1*: PWidget - child2*: PWidget - handle*: gdk2.PWindow - xor_gc*: gdk2.PGC - cursor_type*: gdk2.TCursorType - handle_pos*: gdk2.TRectangle - child1_size*: gint - last_allocation*: gint - min_position*: gint - max_position*: gint - Paned_flag0*: guint16 - last_child1_focus*: PWidget - last_child2_focus*: PWidget - saved_focus*: PWidget - drag_pos*: gint - original_position*: gint - - PPanedClass* = ptr TPanedClass - TPanedClass* = object of TContainerClass - cycle_child_focus*: proc (paned: PPaned, reverse: gboolean): gboolean{.cdecl.} - toggle_handle_focus*: proc (paned: PPaned): gboolean{.cdecl.} - move_handle*: proc (paned: PPaned, scroll: TScrollType): gboolean{.cdecl.} - cycle_handle_focus*: proc (paned: PPaned, reverse: gboolean): gboolean{. - cdecl.} - accept_position*: proc (paned: PPaned): gboolean{.cdecl.} - cancel_position*: proc (paned: PPaned): gboolean{.cdecl.} - reserved351: proc (){.cdecl.} - reserved352: proc (){.cdecl.} - reserved353: proc (){.cdecl.} - reserved354: proc (){.cdecl.} - - PHButtonBox* = ptr THButtonBox - THButtonBox* = object of TButtonBox - PHButtonBoxClass* = ptr THButtonBoxClass - THButtonBoxClass* = object of TButtonBoxClass - PHPaned* = ptr THPaned - THPaned* = object of TPaned - PHPanedClass* = ptr THPanedClass - THPanedClass* = object of TPanedClass - PRulerMetric* = ptr TRulerMetric - PRuler* = ptr TRuler - TRuler* = object of TWidget - backing_store*: gdk2.PPixmap - non_gr_exp_gc*: gdk2.PGC - metric*: PRulerMetric - xsrc*: gint - ysrc*: gint - slider_size*: gint - lower*: gdouble - upper*: gdouble - position*: gdouble - max_size*: gdouble - - PRulerClass* = ptr TRulerClass - TRulerClass* = object of TWidgetClass - draw_ticks*: proc (ruler: PRuler){.cdecl.} - draw_pos*: proc (ruler: PRuler){.cdecl.} - reserved361: proc (){.cdecl.} - reserved362: proc (){.cdecl.} - reserved363: proc (){.cdecl.} - reserved364: proc (){.cdecl.} - - TRulerMetric*{.final, pure.} = object - metric_name*: cstring - abbrev*: cstring - pixels_per_unit*: gdouble - ruler_scale*: array[0..9, gdouble] - subdivide*: array[0..4, gint] - - PHRuler* = ptr THRuler - THRuler* = object of TRuler - PHRulerClass* = ptr THRulerClass - THRulerClass* = object of TRulerClass - PRcContext* = pointer - PSettings* = ptr TSettings - TSettings* = object of TGObject - queued_settings*: PGData - property_values*: PGValue - rc_context*: PRcContext - screen*: gdk2.PScreen - - PSettingsClass* = ptr TSettingsClass - TSettingsClass* = object of TGObjectClass - PSettingsValue* = ptr TSettingsValue - TSettingsValue*{.final, pure.} = object - origin*: cstring - value*: TGValue - - PRcFlags* = ptr TRcFlags - TRcFlags* = int32 - PRcStyle* = ptr TRcStyle - TRcStyle* = object of TGObject - name*: cstring - bg_pixmap_name*: array[0..4, cstring] - font_desc*: pango.PFontDescription - color_flags*: array[0..4, TRcFlags] - fg*: array[0..4, gdk2.TColor] - bg*: array[0..4, gdk2.TColor] - text*: array[0..4, gdk2.TColor] - base*: array[0..4, gdk2.TColor] - xthickness*: gint - ythickness*: gint - rc_properties*: PGArray - rc_style_lists*: PGSList - icon_factories*: PGSList - RcStyle_flag0*: guint16 - - PRcStyleClass* = ptr TRcStyleClass - TRcStyleClass* = object of TGObjectClass - create_rc_style*: proc (rc_style: PRcStyle): PRcStyle{.cdecl.} - parse*: proc (rc_style: PRcStyle, settings: PSettings, scanner: PGScanner): guint{. - cdecl.} - merge*: proc (dest: PRcStyle, src: PRcStyle){.cdecl.} - create_style*: proc (rc_style: PRcStyle): PStyle{.cdecl.} - reserved371: proc (){.cdecl.} - reserved372: proc (){.cdecl.} - reserved373: proc (){.cdecl.} - reserved374: proc (){.cdecl.} - - PRcTokenType* = ptr TRcTokenType - TRcTokenType* = enum - RC_TOKEN_INVALID, RC_TOKEN_INCLUDE, RC_TOKEN_NORMAL, RC_TOKEN_ACTIVE, - RC_TOKEN_PRELIGHT, RC_TOKEN_SELECTED, RC_TOKEN_INSENSITIVE, RC_TOKEN_FG, - RC_TOKEN_BG, RC_TOKEN_TEXT, RC_TOKEN_BASE, RC_TOKEN_XTHICKNESS, - RC_TOKEN_YTHICKNESS, RC_TOKEN_FONT, RC_TOKEN_FONTSET, RC_TOKEN_FONT_NAME, - RC_TOKEN_BG_PIXMAP, RC_TOKEN_PIXMAP_PATH, RC_TOKEN_STYLE, RC_TOKEN_BINDING, - RC_TOKEN_BIND, RC_TOKEN_WIDGET, RC_TOKEN_WIDGET_CLASS, RC_TOKEN_CLASS, - RC_TOKEN_LOWEST, RC_TOKEN_GTK, RC_TOKEN_APPLICATION, RC_TOKEN_THEME, - RC_TOKEN_RC, RC_TOKEN_HIGHEST, RC_TOKEN_ENGINE, RC_TOKEN_MODULE_PATH, - RC_TOKEN_IM_MODULE_PATH, RC_TOKEN_IM_MODULE_FILE, RC_TOKEN_STOCK, - RC_TOKEN_LTR, RC_TOKEN_RTL, RC_TOKEN_LAST - PRcProperty* = ptr TRcProperty - TRcProperty*{.final, pure.} = object - type_name*: TGQuark - property_name*: TGQuark - origin*: cstring - value*: TGValue - - PIconSource* = pointer - TRcPropertyParser* = proc (pspec: PGParamSpec, rc_string: PGString, - property_value: PGValue): gboolean{.cdecl.} - TStyle* = object of TGObject - fg*: array[0..4, gdk2.TColor] - bg*: array[0..4, gdk2.TColor] - light*: array[0..4, gdk2.TColor] - dark*: array[0..4, gdk2.TColor] - mid*: array[0..4, gdk2.TColor] - text*: array[0..4, gdk2.TColor] - base*: array[0..4, gdk2.TColor] - text_aa*: array[0..4, gdk2.TColor] - black*: gdk2.TColor - white*: gdk2.TColor - font_desc*: pango.PFontDescription - xthickness*: gint - ythickness*: gint - fg_gc*: array[0..4, gdk2.PGC] - bg_gc*: array[0..4, gdk2.PGC] - light_gc*: array[0..4, gdk2.PGC] - dark_gc*: array[0..4, gdk2.PGC] - mid_gc*: array[0..4, gdk2.PGC] - text_gc*: array[0..4, gdk2.PGC] - base_gc*: array[0..4, gdk2.PGC] - text_aa_gc*: array[0..4, gdk2.PGC] - black_gc*: gdk2.PGC - white_gc*: gdk2.PGC - bg_pixmap*: array[0..4, gdk2.PPixmap] - attach_count*: gint - depth*: gint - colormap*: gdk2.PColormap - private_font*: gdk2.PFont - private_font_desc*: pango.PFontDescription - rc_style*: PRcStyle - styles*: PGSList - property_cache*: PGArray - icon_factories*: PGSList - - PStyleClass* = ptr TStyleClass - TStyleClass* = object of TGObjectClass - realize*: proc (style: PStyle){.cdecl.} - unrealize*: proc (style: PStyle){.cdecl.} - copy*: proc (style: PStyle, src: PStyle){.cdecl.} - clone*: proc (style: PStyle): PStyle{.cdecl.} - init_from_rc*: proc (style: PStyle, rc_style: PRcStyle){.cdecl.} - set_background*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType){.cdecl.} - render_icon*: proc (style: PStyle, source: PIconSource, - direction: TTextDirection, state: TStateType, - size: TIconSize, widget: PWidget, detail: cstring): gdk2pixbuf.PPixbuf{. - cdecl.} - draw_hline*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x1: gint, x2: gint, - y: gint){.cdecl.} - draw_vline*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, y1: gint, y2: gint, - x: gint){.cdecl.} - draw_shadow*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint){.cdecl.} - draw_polygon*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - point: gdk2.PPoint, npoints: gint, fill: gboolean){.cdecl.} - draw_arrow*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - arrow_type: TArrowType, fill: gboolean, x: gint, y: gint, - width: gint, height: gint){.cdecl.} - draw_diamond*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint){.cdecl.} - draw_string*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - `string`: cstring){.cdecl.} - draw_box*: proc (style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint){.cdecl.} - draw_flat_box*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint){.cdecl.} - draw_check*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint){.cdecl.} - draw_option*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint){.cdecl.} - draw_tab*: proc (style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint){.cdecl.} - draw_shadow_gap*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, - detail: cstring, x: gint, y: gint, width: gint, - height: gint, gap_side: TPositionType, gap_x: gint, - gap_width: gint){.cdecl.} - draw_box_gap*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint, - gap_side: TPositionType, gap_x: gint, gap_width: gint){. - cdecl.} - draw_extension*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, - detail: cstring, x: gint, y: gint, width: gint, - height: gint, gap_side: TPositionType){.cdecl.} - draw_focus*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint){.cdecl.} - draw_slider*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint, - orientation: TOrientation){.cdecl.} - draw_handle*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint, - orientation: TOrientation){.cdecl.} - draw_expander*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - expander_style: TExpanderStyle){.cdecl.} - draw_layout*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, use_text: gboolean, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, layout: pango.PLayout){.cdecl.} - draw_resize_grip*: proc (style: PStyle, window: gdk2.PWindow, - state_type: TStateType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, - edge: gdk2.TWindowEdge, x: gint, y: gint, - width: gint, height: gint){.cdecl.} - reserved381: proc (){.cdecl.} - reserved382: proc (){.cdecl.} - reserved383: proc (){.cdecl.} - reserved384: proc (){.cdecl.} - reserved385: proc (){.cdecl.} - reserved386: proc (){.cdecl.} - reserved387: proc (){.cdecl.} - reserved388: proc (){.cdecl.} - reserved389: proc (){.cdecl.} - reserved3810: proc (){.cdecl.} - reserved3811: proc (){.cdecl.} - reserved3812: proc (){.cdecl.} - - PBorder* = ptr TBorder - TBorder*{.final, pure.} = object - left*: gint - right*: gint - top*: gint - bottom*: gint - - PRangeLayout* = pointer - PRangeStepTimer* = pointer - PRange* = ptr TRange - TRange* = object of TWidget - adjustment*: PAdjustment - update_policy*: TUpdateType - Range_flag0*: guint16 - min_slider_size*: gint - orientation*: TOrientation - range_rect*: gdk2.TRectangle - slider_start*: gint - slider_end*: gint - round_digits*: gint - flag1*: guint16 - layout*: PRangeLayout - timer*: PRangeStepTimer - slide_initial_slider_position*: gint - slide_initial_coordinate*: gint - update_timeout_id*: guint - event_window*: gdk2.PWindow - - PRangeClass* = ptr TRangeClass - TRangeClass* = object of TWidgetClass - slider_detail*: cstring - stepper_detail*: cstring - value_changed*: proc (range: PRange){.cdecl.} - adjust_bounds*: proc (range: PRange, new_value: gdouble){.cdecl.} - move_slider*: proc (range: PRange, scroll: TScrollType){.cdecl.} - get_range_border*: proc (range: PRange, border: PBorder){.cdecl.} - reserved401: proc (){.cdecl.} - reserved402: proc (){.cdecl.} - reserved403: proc (){.cdecl.} - reserved404: proc (){.cdecl.} - - PScale* = ptr TScale - TScale* = object of TRange - digits*: gint - Scale_flag0*: guint16 - - PScaleClass* = ptr TScaleClass - TScaleClass* = object of TRangeClass - format_value*: proc (scale: PScale, value: gdouble): cstring{.cdecl.} - draw_value*: proc (scale: PScale){.cdecl.} - reserved411: proc (){.cdecl.} - reserved412: proc (){.cdecl.} - reserved413: proc (){.cdecl.} - reserved414: proc (){.cdecl.} - - PHScale* = ptr THScale - THScale* = object of TScale - PHScaleClass* = ptr THScaleClass - THScaleClass* = object of TScaleClass - PScrollbar* = ptr TScrollbar - TScrollbar* = object of TRange - PScrollbarClass* = ptr TScrollbarClass - TScrollbarClass* = object of TRangeClass - reserved421: proc (){.cdecl.} - reserved422: proc (){.cdecl.} - reserved423: proc (){.cdecl.} - reserved424: proc (){.cdecl.} - - PHScrollbar* = ptr THScrollbar - THScrollbar* = object of TScrollbar - PHScrollbarClass* = ptr THScrollbarClass - THScrollbarClass* = object of TScrollbarClass - PSeparator* = ptr TSeparator - TSeparator* = object of TWidget - PSeparatorClass* = ptr TSeparatorClass - TSeparatorClass* = object of TWidgetClass - PHSeparator* = ptr THSeparator - THSeparator* = object of TSeparator - PHSeparatorClass* = ptr THSeparatorClass - THSeparatorClass* = object of TSeparatorClass - PIconFactory* = ptr TIconFactory - TIconFactory* = object of TGObject - icons*: PGHashTable - - PIconFactoryClass* = ptr TIconFactoryClass - TIconFactoryClass* = object of TGObjectClass - reserved431: proc (){.cdecl.} - reserved432: proc (){.cdecl.} - reserved433: proc (){.cdecl.} - reserved434: proc (){.cdecl.} - - PIconSet* = pointer - PImagePixmapData* = ptr TImagePixmapData - TImagePixmapData*{.final, pure.} = object - pixmap*: gdk2.PPixmap - - PImageImageData* = ptr TImageImageData - TImageImageData*{.final, pure.} = object - image*: gdk2.PImage - - PImagePixbufData* = ptr TImagePixbufData - TImagePixbufData*{.final, pure.} = object - pixbuf*: gdk2pixbuf.PPixbuf - - PImageStockData* = ptr TImageStockData - TImageStockData*{.final, pure.} = object - stock_id*: cstring - - PImageIconSetData* = ptr TImageIconSetData - TImageIconSetData*{.final, pure.} = object - icon_set*: PIconSet - - PImageAnimationData* = ptr TImageAnimationData - TImageAnimationData*{.final, pure.} = object - anim*: gdk2pixbuf.PPixbufAnimation - iter*: gdk2pixbuf.PPixbufAnimationIter - frame_timeout*: guint - - PImageType* = ptr TImageType - TImageType* = enum - IMAGE_EMPTY, IMAGE_PIXMAP, IMAGE_IMAGE, IMAGE_PIXBUF, IMAGE_STOCK, - IMAGE_ICON_SET, IMAGE_ANIMATION - PImage* = ptr TImage - TImage* = object of TMisc - storage_type*: TImageType - pixmap*: TImagePixmapData - mask*: gdk2.PBitmap - icon_size*: TIconSize - - PImageClass* = ptr TImageClass - TImageClass* = object of TMiscClass - reserved441: proc (){.cdecl.} - reserved442: proc (){.cdecl.} - reserved443: proc (){.cdecl.} - reserved444: proc (){.cdecl.} - - PImageMenuItem* = ptr TImageMenuItem - TImageMenuItem* = object of TMenuItem - image*: PWidget - - PImageMenuItemClass* = ptr TImageMenuItemClass - TImageMenuItemClass* = object of TMenuItemClass - PIMContextSimple* = ptr TIMContextSimple - TIMContextSimple* = object of TIMContext - tables*: PGSList - compose_buffer*: array[0..(MAX_COMPOSE_LEN + 1) - 1, guint] - tentative_match*: gunichar - tentative_match_len*: gint - IMContextSimple_flag0*: guint16 - - PIMContextSimpleClass* = ptr TIMContextSimpleClass - TIMContextSimpleClass* = object of TIMContextClass - PIMMulticontext* = ptr TIMMulticontext - TIMMulticontext* = object of TIMContext - slave*: PIMContext - client_window*: gdk2.PWindow - context_id*: cstring - - PIMMulticontextClass* = ptr TIMMulticontextClass - TIMMulticontextClass* = object of TIMContextClass - reserved451: proc (){.cdecl.} - reserved452: proc (){.cdecl.} - reserved453: proc (){.cdecl.} - reserved454: proc (){.cdecl.} - - PInputDialog* = ptr TInputDialog - TInputDialog* = object of TDialog - axis_list*: PWidget - axis_listbox*: PWidget - mode_optionmenu*: PWidget - close_button*: PWidget - save_button*: PWidget - axis_items*: array[0..(gdk2.AXIS_LAST) - 1, PWidget] - current_device*: gdk2.PDevice - keys_list*: PWidget - keys_listbox*: PWidget - - PInputDialogClass* = ptr TInputDialogClass - TInputDialogClass* = object of TDialogClass - enable_device*: proc (inputd: PInputDialog, device: gdk2.PDevice){.cdecl.} - disable_device*: proc (inputd: PInputDialog, device: gdk2.PDevice){.cdecl.} - reserved461: proc (){.cdecl.} - reserved462: proc (){.cdecl.} - reserved463: proc (){.cdecl.} - reserved464: proc (){.cdecl.} - - PInvisible* = ptr TInvisible - TInvisible* = object of TWidget - has_user_ref_count*: gboolean - screen*: gdk2.PScreen - - PInvisibleClass* = ptr TInvisibleClass - TInvisibleClass* = object of TWidgetClass - reserved701: proc (){.cdecl.} - reserved702: proc (){.cdecl.} - reserved703: proc (){.cdecl.} - reserved704: proc (){.cdecl.} - - TPrintFunc* = proc (func_data: gpointer, str: cstring){.cdecl.} - PTranslateFunc* = ptr TTranslateFunc - TTranslateFunc* = gchar - TItemFactoryCallback* = proc (){.cdecl.} - TItemFactoryCallback1* = proc (callback_data: gpointer, - callback_action: guint, widget: PWidget){.cdecl.} - PItemFactory* = ptr TItemFactory - TItemFactory* = object of TObject - path*: cstring - accel_group*: PAccelGroup - widget*: PWidget - items*: PGSList - translate_func*: TTranslateFunc - translate_data*: gpointer - translate_notify*: TDestroyNotify - - PItemFactoryClass* = ptr TItemFactoryClass - TItemFactoryClass* = object of TObjectClass - item_ht*: PGHashTable - reserved471: proc (){.cdecl.} - reserved472: proc (){.cdecl.} - reserved473: proc (){.cdecl.} - reserved474: proc (){.cdecl.} - - PItemFactoryEntry* = ptr TItemFactoryEntry - TItemFactoryEntry*{.final, pure.} = object - path*: cstring - accelerator*: cstring - callback*: TItemFactoryCallback - callback_action*: guint - item_type*: cstring - extra_data*: gconstpointer - - PItemFactoryItem* = ptr TItemFactoryItem - TItemFactoryItem*{.final, pure.} = object - path*: cstring - widgets*: PGSList - - PLayout* = ptr TLayout - TLayout* = object of TContainer - children*: PGList - width*: guint - height*: guint - hadjustment*: PAdjustment - vadjustment*: PAdjustment - bin_window*: gdk2.PWindow - visibility*: gdk2.TVisibilityState - scroll_x*: gint - scroll_y*: gint - freeze_count*: guint - - PLayoutClass* = ptr TLayoutClass - TLayoutClass* = object of TContainerClass - set_scroll_adjustments*: proc (layout: PLayout, hadjustment: PAdjustment, - vadjustment: PAdjustment){.cdecl.} - reserved481: proc (){.cdecl.} - reserved482: proc (){.cdecl.} - reserved483: proc (){.cdecl.} - reserved484: proc (){.cdecl.} - - PList* = ptr TList - TList* = object of TContainer - children*: PGList - selection*: PGList - undo_selection*: PGList - undo_unselection*: PGList - last_focus_child*: PWidget - undo_focus_child*: PWidget - htimer*: guint - vtimer*: guint - anchor*: gint - drag_pos*: gint - anchor_state*: TStateType - List_flag0*: guint16 - - PListClass* = ptr TListClass - TListClass* = object of TContainerClass - selection_changed*: proc (list: PList){.cdecl.} - select_child*: proc (list: PList, child: PWidget){.cdecl.} - unselect_child*: proc (list: PList, child: PWidget){.cdecl.} - - TTreeModelForeachFunc* = proc (model: PTreeModel, path: PTreePath, - iter: PTreeIter, data: gpointer): gboolean{. - cdecl.} - PTreeModelFlags* = ptr TTreeModelFlags - TTreeModelFlags* = int32 - TTreeIter*{.final, pure.} = object - stamp*: gint - user_data*: gpointer - user_data2*: gpointer - user_data3*: gpointer - - PTreeModelIface* = ptr TTreeModelIface - TTreeModelIface* = object of TGTypeInterface - row_changed*: proc (tree_model: PTreeModel, path: PTreePath, iter: PTreeIter){. - cdecl.} - row_inserted*: proc (tree_model: PTreeModel, path: PTreePath, - iter: PTreeIter){.cdecl.} - row_has_child_toggled*: proc (tree_model: PTreeModel, path: PTreePath, - iter: PTreeIter){.cdecl.} - row_deleted*: proc (tree_model: PTreeModel, path: PTreePath){.cdecl.} - rows_reordered*: proc (tree_model: PTreeModel, path: PTreePath, - iter: PTreeIter, new_order: Pgint){.cdecl.} - get_flags*: proc (tree_model: PTreeModel): TTreeModelFlags{.cdecl.} - get_n_columns*: proc (tree_model: PTreeModel): gint{.cdecl.} - get_column_type*: proc (tree_model: PTreeModel, index: gint): GType{.cdecl.} - get_iter*: proc (tree_model: PTreeModel, iter: PTreeIter, path: PTreePath): gboolean{. - cdecl.} - get_path*: proc (tree_model: PTreeModel, iter: PTreeIter): PTreePath{.cdecl.} - get_value*: proc (tree_model: PTreeModel, iter: PTreeIter, column: gint, - value: PGValue){.cdecl.} - iter_next*: proc (tree_model: PTreeModel, iter: PTreeIter): gboolean{.cdecl.} - iter_children*: proc (tree_model: PTreeModel, iter: PTreeIter, - parent: PTreeIter): gboolean{.cdecl.} - iter_has_child*: proc (tree_model: PTreeModel, iter: PTreeIter): gboolean{. - cdecl.} - iter_n_children*: proc (tree_model: PTreeModel, iter: PTreeIter): gint{. - cdecl.} - iter_nth_child*: proc (tree_model: PTreeModel, iter: PTreeIter, - parent: PTreeIter, n: gint): gboolean{.cdecl.} - iter_parent*: proc (tree_model: PTreeModel, iter: PTreeIter, - child: PTreeIter): gboolean{.cdecl.} - ref_node*: proc (tree_model: PTreeModel, iter: PTreeIter){.cdecl.} - unref_node*: proc (tree_model: PTreeModel, iter: PTreeIter){.cdecl.} - - PTreeSortable* = pointer - TTreeIterCompareFunc* = proc (model: PTreeModel, a: PTreeIter, b: PTreeIter, - user_data: gpointer): gint{.cdecl.} - PTreeSortableIface* = ptr TTreeSortableIface - TTreeSortableIface* = object of TGTypeInterface - sort_column_changed*: proc (sortable: PTreeSortable){.cdecl.} - get_sort_column_id*: proc (sortable: PTreeSortable, sort_column_id: Pgint, - order: PSortType): gboolean{.cdecl.} - set_sort_column_id*: proc (sortable: PTreeSortable, sort_column_id: gint, - order: TSortType){.cdecl.} - set_sort_func*: proc (sortable: PTreeSortable, sort_column_id: gint, - func: TTreeIterCompareFunc, data: gpointer, - destroy: TDestroyNotify){.cdecl.} - set_default_sort_func*: proc (sortable: PTreeSortable, - func: TTreeIterCompareFunc, data: gpointer, - destroy: TDestroyNotify){.cdecl.} - has_default_sort_func*: proc (sortable: PTreeSortable): gboolean{.cdecl.} - - PTreeModelSort* = ptr TTreeModelSort - TTreeModelSort* = object of TGObject - root*: gpointer - stamp*: gint - child_flags*: guint - child_model*: PTreeModel - zero_ref_count*: gint - sort_list*: PGList - sort_column_id*: gint - order*: TSortType - default_sort_func*: TTreeIterCompareFunc - default_sort_data*: gpointer - default_sort_destroy*: TDestroyNotify - changed_id*: guint - inserted_id*: guint - has_child_toggled_id*: guint - deleted_id*: guint - reordered_id*: guint - - PTreeModelSortClass* = ptr TTreeModelSortClass - TTreeModelSortClass* = object of TGObjectClass - reserved491: proc (){.cdecl.} - reserved492: proc (){.cdecl.} - reserved493: proc (){.cdecl.} - reserved494: proc (){.cdecl.} - - PListStore* = ptr TListStore - TListStore* = object of TGObject - stamp*: gint - root*: gpointer - tail*: gpointer - sort_list*: PGList - n_columns*: gint - sort_column_id*: gint - order*: TSortType - column_headers*: PGType - length*: gint - default_sort_func*: TTreeIterCompareFunc - default_sort_data*: gpointer - default_sort_destroy*: TDestroyNotify - ListStore_flag0*: guint16 - - PListStoreClass* = ptr TListStoreClass - TListStoreClass* = object of TGObjectClass - reserved501: proc (){.cdecl.} - reserved502: proc (){.cdecl.} - reserved503: proc (){.cdecl.} - reserved504: proc (){.cdecl.} - - TModuleInitFunc* = proc (argc: Pgint, argv: PPPgchar){.cdecl.} - TKeySnoopFunc* = proc (grab_widget: PWidget, event: gdk2.PEventKey, - func_data: gpointer): gint{.cdecl.} - PMenuBar* = ptr TMenuBar - TMenuBar* = object of TMenuShell - PMenuBarClass* = ptr TMenuBarClass - TMenuBarClass* = object of TMenuShellClass - reserved511: proc (){.cdecl.} - reserved512: proc (){.cdecl.} - reserved513: proc (){.cdecl.} - reserved514: proc (){.cdecl.} - - PMessageType* = ptr TMessageType - TMessageType* = enum - MESSAGE_INFO, MESSAGE_WARNING, MESSAGE_QUESTION, MESSAGE_ERROR - PButtonsType* = ptr TButtonsType - TButtonsType* = enum - BUTTONS_NONE, BUTTONS_OK, BUTTONS_CLOSE, BUTTONS_CANCEL, BUTTONS_YES_NO, - BUTTONS_OK_CANCEL - PMessageDialog* = ptr TMessageDialog - TMessageDialog* = object of TDialog - image*: PWidget - label*: PWidget - - PMessageDialogClass* = ptr TMessageDialogClass - TMessageDialogClass* = object of TDialogClass - reserved521: proc (){.cdecl.} - reserved522: proc (){.cdecl.} - reserved523: proc (){.cdecl.} - reserved524: proc (){.cdecl.} - - PNotebookPage* = pointer - PNotebookTab* = ptr TNotebookTab - TNotebookTab* = enum - NOTEBOOK_TAB_FIRST, NOTEBOOK_TAB_LAST - PNotebook* = ptr TNotebook - TNotebook* = object of TContainer - cur_page*: PNotebookPage - children*: PGList - first_tab*: PGList - focus_tab*: PGList - menu*: PWidget - event_window*: gdk2.PWindow - timer*: guint32 - tab_hborder*: guint16 - tab_vborder*: guint16 - Notebook_flag0*: guint16 - - PNotebookClass* = ptr TNotebookClass - TNotebookClass* = object of TContainerClass - switch_page*: proc (notebook: PNotebook, page: PNotebookPage, - page_num: guint){.cdecl.} - select_page*: proc (notebook: PNotebook, move_focus: gboolean): gboolean{. - cdecl.} - focus_tab*: proc (notebook: PNotebook, thetype: TNotebookTab): gboolean{. - cdecl.} - change_current_page*: proc (notebook: PNotebook, offset: gint){.cdecl.} - move_focus_out*: proc (notebook: PNotebook, direction: TDirectionType){. - cdecl.} - reserved531: proc (){.cdecl.} - reserved532: proc (){.cdecl.} - reserved533: proc (){.cdecl.} - reserved534: proc (){.cdecl.} - - POldEditable* = ptr TOldEditable - TOldEditable* = object of TWidget - current_pos*: guint - selection_start_pos*: guint - selection_end_pos*: guint - OldEditable_flag0*: guint16 - clipboard_text*: cstring - - TTextFunction* = proc (editable: POldEditable, time: guint32){.cdecl.} - POldEditableClass* = ptr TOldEditableClass - TOldEditableClass* = object of TWidgetClass - activate*: proc (editable: POldEditable){.cdecl.} - set_editable*: proc (editable: POldEditable, is_editable: gboolean){.cdecl.} - move_cursor*: proc (editable: POldEditable, x: gint, y: gint){.cdecl.} - move_word*: proc (editable: POldEditable, n: gint){.cdecl.} - move_page*: proc (editable: POldEditable, x: gint, y: gint){.cdecl.} - move_to_row*: proc (editable: POldEditable, row: gint){.cdecl.} - move_to_column*: proc (editable: POldEditable, row: gint){.cdecl.} - kill_char*: proc (editable: POldEditable, direction: gint){.cdecl.} - kill_word*: proc (editable: POldEditable, direction: gint){.cdecl.} - kill_line*: proc (editable: POldEditable, direction: gint){.cdecl.} - cut_clipboard*: proc (editable: POldEditable){.cdecl.} - copy_clipboard*: proc (editable: POldEditable){.cdecl.} - paste_clipboard*: proc (editable: POldEditable){.cdecl.} - update_text*: proc (editable: POldEditable, start_pos: gint, end_pos: gint){. - cdecl.} - get_chars*: proc (editable: POldEditable, start_pos: gint, end_pos: gint): cstring{. - cdecl.} - set_selection*: proc (editable: POldEditable, start_pos: gint, end_pos: gint){. - cdecl.} - set_position*: proc (editable: POldEditable, position: gint){.cdecl.} - - POptionMenu* = ptr TOptionMenu - TOptionMenu* = object of TButton - menu*: PWidget - menu_item*: PWidget - width*: guint16 - height*: guint16 - - POptionMenuClass* = ptr TOptionMenuClass - TOptionMenuClass* = object of TButtonClass - changed*: proc (option_menu: POptionMenu){.cdecl.} - reserved541: proc (){.cdecl.} - reserved542: proc (){.cdecl.} - reserved543: proc (){.cdecl.} - reserved544: proc (){.cdecl.} - - PPixmap* = ptr TPixmap - TPixmap* = object of TMisc - pixmap*: gdk2.PPixmap - mask*: gdk2.PBitmap - pixmap_insensitive*: gdk2.PPixmap - Pixmap_flag0*: guint16 - - PPixmapClass* = ptr TPixmapClass - TPixmapClass* = object of TMiscClass - PPlug* = ptr TPlug - TPlug* = object of TWindow - socket_window*: gdk2.PWindow - modality_window*: PWidget - modality_group*: PWindowGroup - grabbed_keys*: PGHashTable - Plug_flag0*: guint16 - - PPlugClass* = ptr TPlugClass - TPlugClass* = object of TWindowClass - embedded*: proc (plug: PPlug){.cdecl.} - reserved551: proc (){.cdecl.} - reserved552: proc (){.cdecl.} - reserved553: proc (){.cdecl.} - reserved554: proc (){.cdecl.} - - PPreview* = ptr TPreview - TPreview* = object of TWidget - buffer*: Pguchar - buffer_width*: guint16 - buffer_height*: guint16 - bpp*: guint16 - rowstride*: guint16 - dither*: gdk2.TRgbDither - Preview_flag0*: guint16 - - PPreviewInfo* = ptr TPreviewInfo - TPreviewInfo*{.final, pure.} = object - lookup*: Pguchar - gamma*: gdouble - - PDitherInfo* = ptr TDitherInfo - TDitherInfo*{.final, pure.} = object - c*: array[0..3, guchar] - - PPreviewClass* = ptr TPreviewClass - TPreviewClass* = object of TWidgetClass - info*: TPreviewInfo - - PProgress* = ptr TProgress - TProgress* = object of TWidget - adjustment*: PAdjustment - offscreen_pixmap*: gdk2.PPixmap - format*: cstring - x_align*: gfloat - y_align*: gfloat - Progress_flag0*: guint16 - - PProgressClass* = ptr TProgressClass - TProgressClass* = object of TWidgetClass - paint*: proc (progress: PProgress){.cdecl.} - update*: proc (progress: PProgress){.cdecl.} - act_mode_enter*: proc (progress: PProgress){.cdecl.} - reserved561: proc (){.cdecl.} - reserved562: proc (){.cdecl.} - reserved563: proc (){.cdecl.} - reserved564: proc (){.cdecl.} - - PProgressBarStyle* = ptr TProgressBarStyle - TProgressBarStyle* = enum - PROGRESS_CONTINUOUS, PROGRESS_DISCRETE - PProgressBarOrientation* = ptr TProgressBarOrientation - TProgressBarOrientation* = enum - PROGRESS_LEFT_TO_RIGHT, PROGRESS_RIGHT_TO_LEFT, PROGRESS_BOTTOM_TO_TOP, - PROGRESS_TOP_TO_BOTTOM - PProgressBar* = ptr TProgressBar - TProgressBar* = object of TProgress - bar_style*: TProgressBarStyle - orientation*: TProgressBarOrientation - blocks*: guint - in_block*: gint - activity_pos*: gint - activity_step*: guint - activity_blocks*: guint - pulse_fraction*: gdouble - ProgressBar_flag0*: guint16 - - PProgressBarClass* = ptr TProgressBarClass - TProgressBarClass* = object of TProgressClass - reserved571: proc (){.cdecl.} - reserved572: proc (){.cdecl.} - reserved573: proc (){.cdecl.} - reserved574: proc (){.cdecl.} - - PRadioButton* = ptr TRadioButton - TRadioButton* = object of TCheckButton - group*: PGSList - - PRadioButtonClass* = ptr TRadioButtonClass - TRadioButtonClass* = object of TCheckButtonClass - reserved581: proc (){.cdecl.} - reserved582: proc (){.cdecl.} - reserved583: proc (){.cdecl.} - reserved584: proc (){.cdecl.} - - PRadioMenuItem* = ptr TRadioMenuItem - TRadioMenuItem* = object of TCheckMenuItem - group*: PGSList - - PRadioMenuItemClass* = ptr TRadioMenuItemClass - TRadioMenuItemClass* = object of TCheckMenuItemClass - reserved591: proc (){.cdecl.} - reserved592: proc (){.cdecl.} - reserved593: proc (){.cdecl.} - reserved594: proc (){.cdecl.} - - PScrolledWindow* = ptr TScrolledWindow - TScrolledWindow* = object of TBin - hscrollbar*: PWidget - vscrollbar*: PWidget - ScrolledWindow_flag0*: guint16 - shadow_type*: guint16 - - PScrolledWindowClass* = ptr TScrolledWindowClass - TScrolledWindowClass* = object of TBinClass - scrollbar_spacing*: gint - scroll_child*: proc (scrolled_window: PScrolledWindow, scroll: TScrollType, - horizontal: gboolean){.cdecl.} - move_focus_out*: proc (scrolled_window: PScrolledWindow, - direction: TDirectionType){.cdecl.} - reserved601: proc (){.cdecl.} - reserved602: proc (){.cdecl.} - reserved603: proc (){.cdecl.} - reserved604: proc (){.cdecl.} - - TSelectionData*{.final, pure.} = object - selection*: gdk2.TAtom - target*: gdk2.TAtom - thetype*: gdk2.TAtom - format*: gint - data*: Pguchar - length*: gint - display*: gdk2.PDisplay - - PTargetEntry* = ptr TTargetEntry - TTargetEntry*{.final, pure.} = object - target*: cstring - flags*: guint - info*: guint - - PTargetList* = ptr TTargetList - TTargetList*{.final, pure.} = object - list*: PGList - ref_count*: guint - - PTargetPair* = ptr TTargetPair - TTargetPair*{.final, pure.} = object - target*: gdk2.TAtom - flags*: guint - info*: guint - - PSeparatorMenuItem* = ptr TSeparatorMenuItem - TSeparatorMenuItem* = object of TMenuItem - PSeparatorMenuItemClass* = ptr TSeparatorMenuItemClass - TSeparatorMenuItemClass* = object of TMenuItemClass - PSizeGroup* = ptr TSizeGroup - TSizeGroup* = object of TGObject - widgets*: PGSList - mode*: guint8 - SizeGroup_flag0*: guint16 - requisition*: TRequisition - - PSizeGroupClass* = ptr TSizeGroupClass - TSizeGroupClass* = object of TGObjectClass - reserved611: proc (){.cdecl.} - reserved612: proc (){.cdecl.} - reserved613: proc (){.cdecl.} - reserved614: proc (){.cdecl.} - - PSizeGroupMode* = ptr TSizeGroupMode - TSizeGroupMode* = enum - SIZE_GROUP_NONE, SIZE_GROUP_HORIZONTAL, SIZE_GROUP_VERTICAL, SIZE_GROUP_BOTH - PSocket* = ptr TSocket - TSocket* = object of TContainer - request_width*: guint16 - request_height*: guint16 - current_width*: guint16 - current_height*: guint16 - plug_window*: gdk2.PWindow - plug_widget*: PWidget - xembed_version*: gshort - Socket_flag0*: guint16 - accel_group*: PAccelGroup - toplevel*: PWidget - - PSocketClass* = ptr TSocketClass - TSocketClass* = object of TContainerClass - plug_added*: proc (socket: PSocket){.cdecl.} - plug_removed*: proc (socket: PSocket): gboolean{.cdecl.} - reserved621: proc (){.cdecl.} - reserved622: proc (){.cdecl.} - reserved623: proc (){.cdecl.} - reserved624: proc (){.cdecl.} - - PSpinButtonUpdatePolicy* = ptr TSpinButtonUpdatePolicy - TSpinButtonUpdatePolicy* = enum - UPDATE_ALWAYS, UPDATE_IF_VALID - PSpinType* = ptr TSpinType - TSpinType* = enum - SPIN_STEP_FORWARD, SPIN_STEP_BACKWARD, SPIN_PAGE_FORWARD, - SPIN_PAGE_BACKWARD, SPIN_HOME, SPIN_END, SPIN_USER_DEFINED - PSpinButton* = ptr TSpinButton - TSpinButton* = object of TEntry - adjustment*: PAdjustment - panel*: gdk2.PWindow - timer*: guint32 - climb_rate*: gdouble - timer_step*: gdouble - update_policy*: TSpinButtonUpdatePolicy - SpinButton_flag0*: int32 - - PSpinButtonClass* = ptr TSpinButtonClass - TSpinButtonClass* = object of TEntryClass - input*: proc (spin_button: PSpinButton, new_value: Pgdouble): gint{.cdecl.} - output*: proc (spin_button: PSpinButton): gint{.cdecl.} - value_changed*: proc (spin_button: PSpinButton){.cdecl.} - change_value*: proc (spin_button: PSpinButton, scroll: TScrollType){.cdecl.} - reserved631: proc (){.cdecl.} - reserved632: proc (){.cdecl.} - reserved633: proc (){.cdecl.} - reserved634: proc (){.cdecl.} - - PStockItem* = ptr TStockItem - TStockItem*{.final, pure.} = object - stock_id*: cstring - label*: cstring - modifier*: gdk2.TModifierType - keyval*: guint - translation_domain*: cstring - - PStatusbar* = ptr TStatusbar - TStatusbar* = object of THBox - frame*: PWidget - `label`*: PWidget - messages*: PGSList - keys*: PGSList - seq_context_id*: guint - seq_message_id*: guint - grip_window*: gdk2.PWindow - Statusbar_flag0*: guint16 - - PStatusbarClass* = ptr TStatusbarClass - TStatusbarClass* = object of THBoxClass - messages_mem_chunk*: PGMemChunk - text_pushed*: proc (statusbar: PStatusbar, context_id: guint, text: cstring){. - cdecl.} - text_popped*: proc (statusbar: PStatusbar, context_id: guint, text: cstring){. - cdecl.} - reserved641: proc (){.cdecl.} - reserved642: proc (){.cdecl.} - reserved643: proc (){.cdecl.} - reserved644: proc (){.cdecl.} - - PTableRowCol* = ptr TTableRowCol - PTable* = ptr TTable - TTable* = object of TContainer - children*: PGList - rows*: PTableRowCol - cols*: PTableRowCol - nrows*: guint16 - ncols*: guint16 - column_spacing*: guint16 - row_spacing*: guint16 - Table_flag0*: guint16 - - PTableClass* = ptr TTableClass - TTableClass* = object of TContainerClass - PTableChild* = ptr TTableChild - TTableChild*{.final, pure.} = object - widget*: PWidget - left_attach*: guint16 - right_attach*: guint16 - top_attach*: guint16 - bottom_attach*: guint16 - xpadding*: guint16 - ypadding*: guint16 - TableChild_flag0*: guint16 - - TTableRowCol*{.final, pure.} = object - requisition*: guint16 - allocation*: guint16 - spacing*: guint16 - flag0*: guint16 - - PTearoffMenuItem* = ptr TTearoffMenuItem - TTearoffMenuItem* = object of TMenuItem - TearoffMenuItem_flag0*: guint16 - - PTearoffMenuItemClass* = ptr TTearoffMenuItemClass - TTearoffMenuItemClass* = object of TMenuItemClass - reserved651: proc (){.cdecl.} - reserved652: proc (){.cdecl.} - reserved653: proc (){.cdecl.} - reserved654: proc (){.cdecl.} - - PTextFont* = pointer - PPropertyMark* = ptr TPropertyMark - TPropertyMark*{.final, pure.} = object - `property`*: PGList - offset*: guint - index*: guint - - PText* = ptr TText - TText* = object of TOldEditable - text_area*: gdk2.PWindow - hadj*: PAdjustment - vadj*: PAdjustment - gc*: gdk2.PGC - line_wrap_bitmap*: gdk2.PPixmap - line_arrow_bitmap*: gdk2.PPixmap - 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 - Text_flag0*: guint16 - freeze_count*: guint - text_properties*: PGList - text_properties_end*: PGList - point*: TPropertyMark - scratch_buffer*: Pguchar - scratch_buffer_len*: guint - last_ver_value*: gint - cursor_pos_x*: gint - cursor_pos_y*: gint - cursor_mark*: TPropertyMark - cursor_char*: gdk2.TWChar - cursor_char_offset*: gchar - cursor_virtual_x*: gint - cursor_drawn_level*: gint - current_line*: PGList - tab_stops*: PGList - default_tab_width*: gint - current_font*: PTextFont - timer*: gint - button*: guint - bg_gc*: gdk2.PGC - - PTextClass* = ptr TTextClass - TTextClass* = object of TOldEditableClass - set_scroll_adjustments*: proc (text: PText, hadjustment: PAdjustment, - vadjustment: PAdjustment){.cdecl.} - - PTextSearchFlags* = ptr TTextSearchFlags - TTextSearchFlags* = int32 - PTextIter* = ptr TTextIter - TTextIter*{.final, pure.} = object - 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 - - TTextCharPredicate* = proc (ch: gunichar, user_data: gpointer): gboolean{. - cdecl.} - PTextTagClass* = ptr TTextTagClass - PTextAttributes* = ptr TTextAttributes - PTextTag* = ptr TTextTag - PPGtkTextTag* = ptr PTextTag - TTextTag* = object of TGObject - table*: PTextTagTable - name*: cstring - priority*: int32 - values*: PTextAttributes - TextTag_flag0*: int32 - - TTextTagClass* = object of TGObjectClass - event*: proc (tag: PTextTag, event_object: PGObject, event: gdk2.PEvent, - iter: PTextIter): gboolean{.cdecl.} - reserved661: proc (){.cdecl.} - reserved662: proc (){.cdecl.} - reserved663: proc (){.cdecl.} - reserved664: proc (){.cdecl.} - - PTextAppearance* = ptr TTextAppearance - TTextAppearance*{.final, pure.} = object - bg_color*: gdk2.TColor - fg_color*: gdk2.TColor - bg_stipple*: gdk2.PBitmap - fg_stipple*: gdk2.PBitmap - rise*: gint - padding1*: gpointer - flag0*: guint16 - - TTextAttributes*{.final, pure.} = object - refcount*: guint - appearance*: TTextAppearance - justification*: TJustification - direction*: TTextDirection - font*: pango.PFontDescription - font_scale*: gdouble - left_margin*: gint - indent*: gint - right_margin*: gint - pixels_above_lines*: gint - pixels_below_lines*: gint - pixels_inside_wrap*: gint - tabs*: pango.PTabArray - wrap_mode*: TWrapMode - language*: pango.PLanguage - padding1*: gpointer - flag0*: guint16 - - TTextTagTableForeach* = proc (tag: PTextTag, data: gpointer){.cdecl.} - TTextTagTable* = object of TGObject - hash*: PGHashTable - anonymous*: PGSList - anon_count*: gint - buffers*: PGSList - - PTextTagTableClass* = ptr TTextTagTableClass - TTextTagTableClass* = object of TGObjectClass - tag_changed*: proc (table: PTextTagTable, tag: PTextTag, - size_changed: gboolean){.cdecl.} - tag_added*: proc (table: PTextTagTable, tag: PTextTag){.cdecl.} - tag_removed*: proc (table: PTextTagTable, tag: PTextTag){.cdecl.} - reserved1: proc (){.cdecl.} - reserved2: proc (){.cdecl.} - reserved3: proc (){.cdecl.} - reserved4: proc (){.cdecl.} - - PTextMark* = ptr TTextMark - TTextMark* = object of TGObject - segment*: gpointer - - PTextMarkClass* = ptr TTextMarkClass - TTextMarkClass* = object of TGObjectClass - reserved1: proc (){.cdecl.} - reserved2: proc (){.cdecl.} - reserved3: proc (){.cdecl.} - reserved4: proc (){.cdecl.} - - PTextMarkBody* = ptr TTextMarkBody - TTextMarkBody*{.final, pure.} = object - obj*: PTextMark - name*: cstring - tree*: PTextBTree - line*: PTextLine - flag0*: guint16 - - PTextChildAnchor* = ptr TTextChildAnchor - TTextChildAnchor* = object of TGObject - segment*: gpointer - - PTextChildAnchorClass* = ptr TTextChildAnchorClass - TTextChildAnchorClass* = object of TGObjectClass - reserved1: proc (){.cdecl.} - reserved2: proc (){.cdecl.} - reserved3: proc (){.cdecl.} - reserved4: proc (){.cdecl.} - - PTextPixbuf* = ptr TTextPixbuf - TTextPixbuf*{.final, pure.} = object - pixbuf*: gdk2pixbuf.PPixbuf - - PTextChildBody* = ptr TTextChildBody - TTextChildBody*{.final, pure.} = object - obj*: PTextChildAnchor - widgets*: PGSList - tree*: PTextBTree - line*: PTextLine - - PTextLineSegment* = ptr TTextLineSegment - PTextLineSegmentClass* = ptr TTextLineSegmentClass - PTextTagInfo* = ptr TTextTagInfo - TTextTagInfo*{.final, pure.} = object - tag*: PTextTag - tag_root*: PTextBTreeNode - toggle_count*: gint - - PTextToggleBody* = ptr TTextToggleBody - TTextToggleBody*{.final, pure.} = object - info*: PTextTagInfo - inNodeCounts*: gboolean - - TTextLineSegment*{.final, pure.} = object - `type`*: PTextLineSegmentClass - next*: PTextLineSegment - char_count*: int32 - byte_count*: int32 - body*: TTextChildBody - - PTextSegSplitFunc* = ptr TTextSegSplitFunc - TTextSegSplitFunc* = TTextLineSegment - TTextSegDeleteFunc* = proc (seg: PTextLineSegment, line: PTextLine, - tree_gone: gboolean): gboolean{.cdecl.} - PTextSegCleanupFunc* = ptr TTextSegCleanupFunc - TTextSegCleanupFunc* = TTextLineSegment - TTextSegLineChangeFunc* = proc (seg: PTextLineSegment, line: PTextLine){.cdecl.} - TTextSegCheckFunc* = proc (seg: PTextLineSegment, line: PTextLine){.cdecl.} - TTextLineSegmentClass*{.final, pure.} = object - name*: cstring - leftGravity*: gboolean - splitFunc*: TTextSegSplitFunc - deleteFunc*: TTextSegDeleteFunc - cleanupFunc*: TTextSegCleanupFunc - lineChangeFunc*: TTextSegLineChangeFunc - checkFunc*: TTextSegCheckFunc - - PTextLineData* = ptr TTextLineData - TTextLineData*{.final, pure.} = object - view_id*: gpointer - next*: PTextLineData - height*: gint - flag0*: int32 - - TTextLine*{.final, pure.} = object - parent*: PTextBTreeNode - next*: PTextLine - segments*: PTextLineSegment - views*: PTextLineData - - PTextLogAttrCache* = pointer - PTextBuffer* = ptr TTextBuffer - TTextBuffer* = object of TGObject - tag_table*: PTextTagTable - btree*: PTextBTree - clipboard_contents_buffers*: PGSList - selection_clipboards*: PGSList - log_attr_cache*: PTextLogAttrCache - user_action_count*: guint - TextBuffer_flag0*: guint16 - - PTextBufferClass* = ptr TTextBufferClass - TTextBufferClass* = object of TGObjectClass - insert_text*: proc (buffer: PTextBuffer, pos: PTextIter, text: cstring, - length: gint){.cdecl.} - insert_pixbuf*: proc (buffer: PTextBuffer, pos: PTextIter, - pixbuf: gdk2pixbuf.PPixbuf){.cdecl.} - insert_child_anchor*: proc (buffer: PTextBuffer, pos: PTextIter, - anchor: PTextChildAnchor){.cdecl.} - delete_range*: proc (buffer: PTextBuffer, start: PTextIter, - theEnd: PTextIter){.cdecl.} - changed*: proc (buffer: PTextBuffer){.cdecl.} - modified_changed*: proc (buffer: PTextBuffer){.cdecl.} - mark_set*: proc (buffer: PTextBuffer, location: PTextIter, mark: PTextMark){. - cdecl.} - mark_deleted*: proc (buffer: PTextBuffer, mark: PTextMark){.cdecl.} - apply_tag*: proc (buffer: PTextBuffer, tag: PTextTag, start_char: PTextIter, - end_char: PTextIter){.cdecl.} - remove_tag*: proc (buffer: PTextBuffer, tag: PTextTag, - start_char: PTextIter, end_char: PTextIter){.cdecl.} - begin_user_action*: proc (buffer: PTextBuffer){.cdecl.} - end_user_action*: proc (buffer: PTextBuffer){.cdecl.} - reserved1: proc (){.cdecl.} - reserved2: proc (){.cdecl.} - reserved3: proc (){.cdecl.} - reserved4: proc (){.cdecl.} - reserved5: proc (){.cdecl.} - reserved6: proc (){.cdecl.} - - PTextLineDisplay* = ptr TTextLineDisplay - PTextLayout* = ptr TTextLayout - TTextLayout* = object of TGObject - screen_width*: gint - width*: gint - height*: gint - buffer*: PTextBuffer - default_style*: PTextAttributes - ltr_context*: pango.PContext - rtl_context*: pango.PContext - one_style_cache*: PTextAttributes - one_display_cache*: PTextLineDisplay - wrap_loop_count*: gint - TextLayout_flag0*: guint16 - preedit_string*: cstring - preedit_attrs*: pango.PAttrList - preedit_len*: gint - preedit_cursor*: gint - - PTextLayoutClass* = ptr TTextLayoutClass - TTextLayoutClass* = object of TGObjectClass - invalidated*: proc (layout: PTextLayout){.cdecl.} - changed*: proc (layout: PTextLayout, y: gint, old_height: gint, - new_height: gint){.cdecl.} - wrap*: proc (layout: PTextLayout, line: PTextLine, line_data: PTextLineData): PTextLineData{. - cdecl.} - get_log_attrs*: proc (layout: PTextLayout, line: PTextLine, - attrs: var pango.PLogAttr, n_attrs: Pgint){.cdecl.} - invalidate*: proc (layout: PTextLayout, start: PTextIter, theEnd: PTextIter){. - cdecl.} - free_line_data*: proc (layout: PTextLayout, line: PTextLine, - line_data: PTextLineData){.cdecl.} - allocate_child*: proc (layout: PTextLayout, child: PWidget, x: gint, y: gint){. - cdecl.} - reserved1: proc (){.cdecl.} - reserved2: proc (){.cdecl.} - reserved3: proc (){.cdecl.} - reserved4: proc (){.cdecl.} - - PTextAttrAppearance* = ptr TTextAttrAppearance - TTextAttrAppearance*{.final, pure.} = object - attr*: pango.TAttribute - appearance*: TTextAppearance - - PTextCursorDisplay* = ptr TTextCursorDisplay - TTextCursorDisplay*{.final, pure.} = object - x*: gint - y*: gint - height*: gint - flag0*: guint16 - - TTextLineDisplay*{.final, pure.} = object - layout*: pango.PLayout - cursors*: PGSList - shaped_objects*: PGSList - direction*: TTextDirection - 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*: PTextLine - - PTextWindow* = pointer - PTextPendingScroll* = pointer - PTextWindowType* = ptr TTextWindowType - TTextWindowType* = enum - TEXT_WINDOW_PRIVATE, TEXT_WINDOW_WIDGET, TEXT_WINDOW_TEXT, TEXT_WINDOW_LEFT, - TEXT_WINDOW_RIGHT, TEXT_WINDOW_TOP, TEXT_WINDOW_BOTTOM - PTextView* = ptr TTextView - TTextView* = object of TContainer - layout*: PTextLayout - buffer*: PTextBuffer - selection_drag_handler*: guint - scroll_timeout*: guint - pixels_above_lines*: gint - pixels_below_lines*: gint - pixels_inside_wrap*: gint - wrap_mode*: TWrapMode - justify*: TJustification - left_margin*: gint - right_margin*: gint - indent*: gint - tabs*: pango.PTabArray - TextView_flag0*: guint16 - text_window*: PTextWindow - left_window*: PTextWindow - right_window*: PTextWindow - top_window*: PTextWindow - bottom_window*: PTextWindow - hadjustment*: PAdjustment - vadjustment*: PAdjustment - xoffset*: gint - yoffset*: gint - width*: gint - height*: gint - virtual_cursor_x*: gint - virtual_cursor_y*: gint - first_para_mark*: PTextMark - first_para_pixels*: gint - dnd_mark*: PTextMark - blink_timeout*: guint - first_validate_idle*: guint - incremental_validate_idle*: guint - im_context*: PIMContext - popup_menu*: PWidget - drag_start_x*: gint - drag_start_y*: gint - children*: PGSList - pending_scroll*: PTextPendingScroll - pending_place_cursor_button*: gint - - PTextViewClass* = ptr TTextViewClass - TTextViewClass* = object of TContainerClass - set_scroll_adjustments*: proc (text_view: PTextView, - hadjustment: PAdjustment, - vadjustment: PAdjustment){.cdecl.} - populate_popup*: proc (text_view: PTextView, menu: PMenu){.cdecl.} - move_cursor*: proc (text_view: PTextView, step: TMovementStep, count: gint, - extend_selection: gboolean){.cdecl.} - page_horizontally*: proc (text_view: PTextView, count: gint, - extend_selection: gboolean){.cdecl.} - set_anchor*: proc (text_view: PTextView){.cdecl.} - insert_at_cursor*: proc (text_view: PTextView, str: cstring){.cdecl.} - delete_from_cursor*: proc (text_view: PTextView, thetype: TDeleteType, - count: gint){.cdecl.} - cut_clipboard*: proc (text_view: PTextView){.cdecl.} - copy_clipboard*: proc (text_view: PTextView){.cdecl.} - paste_clipboard*: proc (text_view: PTextView){.cdecl.} - toggle_overwrite*: proc (text_view: PTextView){.cdecl.} - move_focus*: proc (text_view: PTextView, direction: TDirectionType){.cdecl.} - reserved711: proc (){.cdecl.} - reserved712: proc (){.cdecl.} - reserved713: proc (){.cdecl.} - reserved714: proc (){.cdecl.} - reserved715: proc (){.cdecl.} - reserved716: proc (){.cdecl.} - reserved717: proc (){.cdecl.} - reserved718: proc (){.cdecl.} - - PTipsQuery* = ptr TTipsQuery - TTipsQuery* = object of TLabel - TipsQuery_flag0*: guint16 - label_inactive*: cstring - label_no_tip*: cstring - caller*: PWidget - last_crossed*: PWidget - query_cursor*: gdk2.PCursor - - PTipsQueryClass* = ptr TTipsQueryClass - TTipsQueryClass* = object of TLabelClass - start_query*: proc (tips_query: PTipsQuery){.cdecl.} - stop_query*: proc (tips_query: PTipsQuery){.cdecl.} - widget_entered*: proc (tips_query: PTipsQuery, widget: PWidget, - tip_text: cstring, tip_private: cstring){.cdecl.} - widget_selected*: proc (tips_query: PTipsQuery, widget: PWidget, - tip_text: cstring, tip_private: cstring, - event: gdk2.PEventButton): gint{.cdecl.} - reserved721: proc (){.cdecl.} - reserved722: proc (){.cdecl.} - reserved723: proc (){.cdecl.} - reserved724: proc (){.cdecl.} - - PTooltips* = ptr TTooltips - PTooltipsData* = ptr TTooltipsData - TTooltipsData*{.final, pure.} = object - tooltips*: PTooltips - widget*: PWidget - tip_text*: cstring - tip_private*: cstring - - TTooltips* = object of TObject - tip_window*: PWidget - tip_label*: PWidget - active_tips_data*: PTooltipsData - tips_data_list*: PGList - Tooltips_flag0*: int32 - flag1*: guint16 - timer_tag*: gint - last_popdown*: TGTimeVal - - PTooltipsClass* = ptr TTooltipsClass - TTooltipsClass* = object of TObjectClass - reserved1: proc (){.cdecl.} - reserved2: proc (){.cdecl.} - reserved3: proc (){.cdecl.} - reserved4: proc (){.cdecl.} - - PToolbarChildType* = ptr TToolbarChildType - TToolbarChildType* = enum - TOOLBAR_CHILD_SPACE, TOOLBAR_CHILD_BUTTON, TOOLBAR_CHILD_TOGGLEBUTTON, - TOOLBAR_CHILD_RADIOBUTTON, TOOLBAR_CHILD_WIDGET - PToolbarSpaceStyle* = ptr TToolbarSpaceStyle - TToolbarSpaceStyle* = enum - TOOLBAR_SPACE_EMPTY, TOOLBAR_SPACE_LINE - PToolbarChild* = ptr TToolbarChild - TToolbarChild*{.final, pure.} = object - `type`*: TToolbarChildType - widget*: PWidget - icon*: PWidget - label*: PWidget - - PToolbar* = ptr TToolbar - TToolbar* = object of TContainer - num_children*: gint - children*: PGList - orientation*: TOrientation - Toolbar_style*: TToolbarStyle - icon_size*: TIconSize - tooltips*: PTooltips - button_maxw*: gint - button_maxh*: gint - style_set_connection*: guint - icon_size_connection*: guint - Toolbar_flag0*: guint16 - - PToolbarClass* = ptr TToolbarClass - TToolbarClass* = object of TContainerClass - orientation_changed*: proc (toolbar: PToolbar, orientation: TOrientation){. - cdecl.} - style_changed*: proc (toolbar: PToolbar, style: TToolbarStyle){.cdecl.} - reserved731: proc (){.cdecl.} - reserved732: proc (){.cdecl.} - reserved733: proc (){.cdecl.} - reserved734: proc (){.cdecl.} - - PTreeViewMode* = ptr TTreeViewMode - TTreeViewMode* = enum - TREE_VIEW_LINE, TREE_VIEW_ITEM - PTree* = ptr TTree - TTree* = object of TContainer - children*: PGList - root_tree*: PTree - tree_owner*: PWidget - selection*: PGList - level*: guint - indent_value*: guint - current_indent*: guint - Tree_flag0*: guint16 - - PTreeClass* = ptr TTreeClass - TTreeClass* = object of TContainerClass - selection_changed*: proc (tree: PTree){.cdecl.} - select_child*: proc (tree: PTree, child: PWidget){.cdecl.} - unselect_child*: proc (tree: PTree, child: PWidget){.cdecl.} - - PTreeDragSource* = pointer - PTreeDragDest* = pointer - PTreeDragSourceIface* = ptr TTreeDragSourceIface - TTreeDragSourceIface* = object of TGTypeInterface - row_draggable*: proc (drag_source: PTreeDragSource, path: PTreePath): gboolean{. - cdecl.} - drag_data_get*: proc (drag_source: PTreeDragSource, path: PTreePath, - selection_data: PSelectionData): gboolean{.cdecl.} - drag_data_delete*: proc (drag_source: PTreeDragSource, path: PTreePath): gboolean{. - cdecl.} - - PTreeDragDestIface* = ptr TTreeDragDestIface - TTreeDragDestIface* = object of TGTypeInterface - drag_data_received*: proc (drag_dest: PTreeDragDest, dest: PTreePath, - selection_data: PSelectionData): gboolean{.cdecl.} - row_drop_possible*: proc (drag_dest: PTreeDragDest, dest_path: PTreePath, - selection_data: PSelectionData): gboolean{.cdecl.} - - PTreeItem* = ptr TTreeItem - TTreeItem* = object of TItem - subtree*: PWidget - pixmaps_box*: PWidget - plus_pix_widget*: PWidget - minus_pix_widget*: PWidget - pixmaps*: PGList - TreeItem_flag0*: guint16 - - PTreeItemClass* = ptr TTreeItemClass - TTreeItemClass* = object of TItemClass - expand*: proc (tree_item: PTreeItem){.cdecl.} - collapse*: proc (tree_item: PTreeItem){.cdecl.} - - PTreeSelection* = ptr TTreeSelection - TTreeSelectionFunc* = proc (selection: PTreeSelection, model: PTreeModel, - path: PTreePath, - path_currently_selected: gboolean, data: gpointer): gboolean{. - cdecl.} - TTreeSelectionForeachFunc* = proc (model: PTreeModel, path: PTreePath, - iter: PTreeIter, data: gpointer){.cdecl.} - TTreeSelection* = object of TGObject - tree_view*: PTreeView - thetype*: TSelectionMode - user_func*: TTreeSelectionFunc - user_data*: gpointer - destroy*: TDestroyNotify - - PTreeSelectionClass* = ptr TTreeSelectionClass - TTreeSelectionClass* = object of TGObjectClass - changed*: proc (selection: PTreeSelection){.cdecl.} - reserved741: proc (){.cdecl.} - reserved742: proc (){.cdecl.} - reserved743: proc (){.cdecl.} - reserved744: proc (){.cdecl.} - - PTreeStore* = ptr TTreeStore - TTreeStore* = object of TGObject - stamp*: gint - root*: gpointer - last*: gpointer - n_columns*: gint - sort_column_id*: gint - sort_list*: PGList - order*: TSortType - column_headers*: PGType - default_sort_func*: TTreeIterCompareFunc - default_sort_data*: gpointer - default_sort_destroy*: TDestroyNotify - TreeStore_flag0*: guint16 - - PTreeStoreClass* = ptr TTreeStoreClass - TTreeStoreClass* = object of TGObjectClass - reserved751: proc (){.cdecl.} - reserved752: proc (){.cdecl.} - reserved753: proc (){.cdecl.} - reserved754: proc (){.cdecl.} - - PTreeViewColumnSizing* = ptr TTreeViewColumnSizing - TTreeViewColumnSizing* = enum - TREE_VIEW_COLUMN_GROW_ONLY, TREE_VIEW_COLUMN_AUTOSIZE, - TREE_VIEW_COLUMN_FIXED - TTreeCellDataFunc* = proc (tree_column: PTreeViewColumn, cell: PCellRenderer, - tree_model: PTreeModel, iter: PTreeIter, - data: gpointer){.cdecl.} - TTreeViewColumn* = object of TObject - tree_view*: PWidget - button*: PWidget - child*: PWidget - arrow*: PWidget - alignment*: PWidget - window*: gdk2.PWindow - editable_widget*: PCellEditable - xalign*: gfloat - property_changed_signal*: guint - spacing*: gint - column_type*: TTreeViewColumnSizing - 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*: TSortType - TreeViewColumn_flag0*: guint16 - - PTreeViewColumnClass* = ptr TTreeViewColumnClass - TTreeViewColumnClass* = object of TObjectClass - clicked*: proc (tree_column: PTreeViewColumn){.cdecl.} - reserved751: proc (){.cdecl.} - reserved752: proc (){.cdecl.} - reserved753: proc (){.cdecl.} - reserved754: proc (){.cdecl.} - - PRBNodeColor* = ptr TRBNodeColor - TRBNodeColor* = int32 - PRBTree* = ptr TRBTree - PRBNode* = ptr TRBNode - TRBTreeTraverseFunc* = proc (tree: PRBTree, node: PRBNode, data: gpointer){. - cdecl.} - TRBTree*{.final, pure.} = object - root*: PRBNode - `nil`*: PRBNode - parent_tree*: PRBTree - parent_node*: PRBNode - - TRBNode*{.final, pure.} = object - flag0*: guint16 - left*: PRBNode - right*: PRBNode - parent*: PRBNode - count*: gint - offset*: gint - children*: PRBTree - - PTreeRowReference* = pointer - PTreeViewFlags* = ptr TTreeViewFlags - TTreeViewFlags* = int32 - TTreeViewSearchDialogPositionFunc* = proc (tree_view: PTreeView, - search_dialog: PWidget){.cdecl.} - PTreeViewColumnReorder* = ptr TTreeViewColumnReorder - TTreeViewColumnReorder*{.final, pure.} = object - left_align*: gint - right_align*: gint - left_column*: PTreeViewColumn - right_column*: PTreeViewColumn - - PTreeViewPrivate* = ptr TTreeViewPrivate - TTreeViewPrivate*{.final, pure.} = object - model*: PTreeModel - flags*: guint - tree*: PRBTree - button_pressed_node*: PRBNode - button_pressed_tree*: PRBTree - children*: PGList - width*: gint - height*: gint - expander_size*: gint - hadjustment*: PAdjustment - vadjustment*: PAdjustment - bin_window*: gdk2.PWindow - header_window*: gdk2.PWindow - drag_window*: gdk2.PWindow - drag_highlight_window*: gdk2.PWindow - drag_column*: PTreeViewColumn - last_button_press*: PTreeRowReference - last_button_press_2*: PTreeRowReference - top_row*: PTreeRowReference - top_row_dy*: gint - dy*: gint - drag_column_x*: gint - expander_column*: PTreeViewColumn - edited_column*: PTreeViewColumn - presize_handler_timer*: guint - validate_rows_timer*: guint - scroll_sync_timer*: guint - focus_column*: PTreeViewColumn - anchor*: PTreeRowReference - cursor*: PTreeRowReference - drag_pos*: gint - x_drag*: gint - prelight_node*: PRBNode - prelight_tree*: PRBTree - expanded_collapsed_node*: PRBNode - expanded_collapsed_tree*: PRBTree - expand_collapse_timeout*: guint - selection*: PTreeSelection - n_columns*: gint - columns*: PGList - header_height*: gint - column_drop_func*: TTreeViewColumnDropFunc - column_drop_func_data*: gpointer - column_drop_func_data_destroy*: TDestroyNotify - column_drag_info*: PGList - cur_reorder*: PTreeViewColumnReorder - destroy_count_func*: TTreeDestroyCountFunc - destroy_count_data*: gpointer - destroy_count_destroy*: TDestroyNotify - scroll_timeout*: guint - drag_dest_row*: PTreeRowReference - drag_dest_pos*: TTreeViewDropPosition - open_dest_timeout*: guint - pressed_button*: gint - press_start_x*: gint - press_start_y*: gint - scroll_to_path*: PTreeRowReference - scroll_to_column*: PTreeViewColumn - scroll_to_row_align*: gfloat - scroll_to_col_align*: gfloat - flag0*: guint16 - search_column*: gint - search_dialog_position_func*: TTreeViewSearchDialogPositionFunc - search_equal_func*: TTreeViewSearchEqualFunc - search_user_data*: gpointer - search_destroy*: TDestroyNotify - - TTreeView* = object of TContainer - priv*: PTreeViewPrivate - - PTreeViewClass* = ptr TTreeViewClass - TTreeViewClass* = object of TContainerClass - set_scroll_adjustments*: proc (tree_view: PTreeView, - hadjustment: PAdjustment, - vadjustment: PAdjustment){.cdecl.} - row_activated*: proc (tree_view: PTreeView, path: PTreePath, - column: PTreeViewColumn){.cdecl.} - test_expand_row*: proc (tree_view: PTreeView, iter: PTreeIter, - path: PTreePath): gboolean{.cdecl.} - test_collapse_row*: proc (tree_view: PTreeView, iter: PTreeIter, - path: PTreePath): gboolean{.cdecl.} - row_expanded*: proc (tree_view: PTreeView, iter: PTreeIter, path: PTreePath){. - cdecl.} - row_collapsed*: proc (tree_view: PTreeView, iter: PTreeIter, path: PTreePath){. - cdecl.} - columns_changed*: proc (tree_view: PTreeView){.cdecl.} - cursor_changed*: proc (tree_view: PTreeView){.cdecl.} - move_cursor*: proc (tree_view: PTreeView, step: TMovementStep, count: gint): gboolean{. - cdecl.} - select_all*: proc (tree_view: PTreeView){.cdecl.} - unselect_all*: proc (tree_view: PTreeView){.cdecl.} - select_cursor_row*: proc (tree_view: PTreeView, start_editing: gboolean){. - cdecl.} - toggle_cursor_row*: proc (tree_view: PTreeView){.cdecl.} - expand_collapse_cursor_row*: proc (tree_view: PTreeView, logical: gboolean, - expand: gboolean, open_all: gboolean){. - cdecl.} - select_cursor_parent*: proc (tree_view: PTreeView){.cdecl.} - start_interactive_search*: proc (tree_view: PTreeView){.cdecl.} - reserved760: proc (){.cdecl.} - reserved761: proc (){.cdecl.} - reserved762: proc (){.cdecl.} - reserved763: proc (){.cdecl.} - reserved764: proc (){.cdecl.} - - PVButtonBox* = ptr TVButtonBox - TVButtonBox* = object of TButtonBox - PVButtonBoxClass* = ptr TVButtonBoxClass - TVButtonBoxClass* = object of TButtonBoxClass - PViewport* = ptr TViewport - TViewport* = object of TBin - shadow_type*: TShadowType - view_window*: gdk2.PWindow - bin_window*: gdk2.PWindow - hadjustment*: PAdjustment - vadjustment*: PAdjustment - - PViewportClass* = ptr TViewportClass - TViewportClass* = object of TBinClass - set_scroll_adjustments*: proc (viewport: PViewport, - hadjustment: PAdjustment, - vadjustment: PAdjustment){.cdecl.} - - PVPaned* = ptr TVPaned - TVPaned* = object of TPaned - PVPanedClass* = ptr TVPanedClass - TVPanedClass* = object of TPanedClass - PVRuler* = ptr TVRuler - TVRuler* = object of TRuler - PVRulerClass* = ptr TVRulerClass - TVRulerClass* = object of TRulerClass - PVScale* = ptr TVScale - TVScale* = object of TScale - PVScaleClass* = ptr TVScaleClass - TVScaleClass* = object of TScaleClass - PVScrollbar* = ptr TVScrollbar - TVScrollbar* = object of TScrollbar - PVScrollbarClass* = ptr TVScrollbarClass - TVScrollbarClass* = object of TScrollbarClass - PVSeparator* = ptr TVSeparator - TVSeparator* = object of TSeparator - PVSeparatorClass* = ptr TVSeparatorClass - TVSeparatorClass* = object of TSeparatorClass - -const - IN_DESTRUCTION* = 1 shl 0 - FLOATING* = 1 shl 1 - RESERVED_1* = 1 shl 2 - RESERVED_2* = 1 shl 3 - ARG_READABLE* = G_PARAM_READABLE - ARG_WRITABLE* = G_PARAM_WRITABLE - ARG_CONSTRUCT* = G_PARAM_CONSTRUCT - ARG_CONSTRUCT_ONLY* = G_PARAM_CONSTRUCT_ONLY - ARG_CHILD_ARG* = 1 shl 4 - -proc TYPE_OBJECT*(): GType -proc `OBJECT`*(anObject: pointer): PObject -proc OBJECT_CLASS*(klass: pointer): PObjectClass -proc IS_OBJECT*(anObject: pointer): bool -proc IS_OBJECT_CLASS*(klass: pointer): bool -proc OBJECT_GET_CLASS*(anObject: pointer): PObjectClass -proc OBJECT_TYPE*(anObject: pointer): GType -proc OBJECT_TYPE_NAME*(anObject: pointer): cstring -proc OBJECT_FLAGS*(obj: pointer): guint32 -proc OBJECT_FLOATING*(obj: pointer): gboolean -proc OBJECT_SET_FLAGS*(obj: pointer, flag: guint32) -proc OBJECT_UNSET_FLAGS*(obj: pointer, flag: guint32) -proc object_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_object_get_type".} -proc object_new*(thetype: TType, first_property_name: cstring): PObject{.cdecl, - varargs, dynlib: lib, importc: "gtk_object_new".} -proc sink*(anObject: PObject){.cdecl, dynlib: lib, - importc: "gtk_object_sink".} -proc destroy*(anObject: PObject){.cdecl, dynlib: lib, - importc: "gtk_object_destroy".} -const - TYPE_INVALID* = G_TYPE_INVALID - TYPE_NONE* = G_TYPE_NONE - TYPE_ENUM* = G_TYPE_ENUM - TYPE_FLAGS* = G_TYPE_FLAGS - TYPE_CHAR* = G_TYPE_CHAR - TYPE_UCHAR* = G_TYPE_UCHAR - TYPE_BOOL* = G_TYPE_BOOLEAN - TYPE_INT* = G_TYPE_INT - TYPE_UINT* = G_TYPE_UINT - TYPE_LONG* = G_TYPE_LONG - TYPE_ULONG* = G_TYPE_ULONG - TYPE_FLOAT* = G_TYPE_FLOAT - TYPE_DOUBLE* = G_TYPE_DOUBLE - TYPE_STRING* = G_TYPE_STRING - TYPE_BOXED* = G_TYPE_BOXED - TYPE_POINTER* = G_TYPE_POINTER - -proc TYPE_IDENTIFIER*(): GType -proc identifier_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_identifier_get_type".} -proc SIGNAL_FUNC*(f: pointer): TSignalFunc -proc type_class*(thetype: TType): gpointer{.cdecl, dynlib: lib, - importc: "gtk_type_class".} -const - TOPLEVEL* = 1 shl 4 - NO_WINDOW* = 1 shl 5 - constREALIZED* = 1 shl 6 - MAPPED* = 1 shl 7 - constVISIBLE* = 1 shl 8 - SENSITIVE* = 1 shl 9 - PARENT_SENSITIVE* = 1 shl 10 - CAN_FOCUS* = 1 shl 11 - constHAS_FOCUS* = 1 shl 12 - CAN_DEFAULT* = 1 shl 13 - HAS_DEFAULT* = 1 shl 14 - HAS_GRAB* = 1 shl 15 - RC_STYLE* = 1 shl 16 - COMPOSITE_CHILD* = 1 shl 17 - NO_REPARENT* = 1 shl 18 - APP_PAINTABLE* = 1 shl 19 - RECEIVES_DEFAULT* = 1 shl 20 - DOUBLE_BUFFERED* = 1 shl 21 - -const - bm_TGtkWidgetAuxInfo_x_set* = 0x0001'i16 - bp_TGtkWidgetAuxInfo_x_set* = 0'i16 - bm_TGtkWidgetAuxInfo_y_set* = 0x0002'i16 - bp_TGtkWidgetAuxInfo_y_set* = 1'i16 - -proc TYPE_WIDGET*(): GType -proc WIDGET*(widget: pointer): PWidget -proc WIDGET_CLASS*(klass: pointer): PWidgetClass -proc IS_WIDGET*(widget: pointer): bool -proc IS_WIDGET_CLASS*(klass: pointer): bool -proc WIDGET_GET_CLASS*(obj: pointer): PWidgetClass -proc WIDGET_TYPE*(wid: pointer): GType -proc WIDGET_STATE*(wid: pointer): int32 -proc WIDGET_SAVED_STATE*(wid: pointer): int32 -proc WIDGET_FLAGS*(wid: pointer): guint32 -proc WIDGET_TOPLEVEL*(wid: pointer): gboolean -proc WIDGET_NO_WINDOW*(wid: pointer): gboolean -proc WIDGET_REALIZED*(wid: pointer): gboolean -proc WIDGET_MAPPED*(wid: pointer): gboolean -proc WIDGET_VISIBLE*(wid: pointer): gboolean -proc WIDGET_DRAWABLE*(wid: pointer): gboolean -proc WIDGET_SENSITIVE*(wid: pointer): gboolean -proc WIDGET_PARENT_SENSITIVE*(wid: pointer): gboolean -proc WIDGET_IS_SENSITIVE*(wid: pointer): gboolean -proc WIDGET_CAN_FOCUS*(wid: pointer): gboolean -proc WIDGET_HAS_FOCUS*(wid: pointer): gboolean -proc WIDGET_CAN_DEFAULT*(wid: pointer): gboolean -proc WIDGET_HAS_DEFAULT*(wid: pointer): gboolean -proc WIDGET_HAS_GRAB*(wid: pointer): gboolean -proc WIDGET_RC_STYLE*(wid: pointer): gboolean -proc WIDGET_COMPOSITE_CHILD*(wid: pointer): gboolean -proc WIDGET_APP_PAINTABLE*(wid: pointer): gboolean -proc WIDGET_RECEIVES_DEFAULT*(wid: pointer): gboolean -proc WIDGET_DOUBLE_BUFFERED*(wid: pointer): gboolean -proc SET_FLAGS*(wid: PWidget, flags: TWidgetFlags): TWidgetFlags -proc UNSET_FLAGS*(wid: PWidget, flags: TWidgetFlags): TWidgetFlags -proc TYPE_REQUISITION*(): GType -proc x_set*(a: PWidgetAuxInfo): guint -proc set_x_set*(a: PWidgetAuxInfo, x_set: guint) -proc y_set*(a: PWidgetAuxInfo): guint -proc set_y_set*(a: PWidgetAuxInfo, y_set: guint) -proc widget_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_widget_get_type".} -proc reference*(widget: PWidget): PWidget{.cdecl, dynlib: lib, - importc: "gtk_widget_ref".} -proc unref*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_unref".} -proc destroy*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_destroy".} -proc destroyed*(widget: PWidget, r: var PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_destroyed".} -proc unparent*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_unparent".} -proc show*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_show".} -proc show_now*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_show_now".} -proc hide*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_hide".} -proc show_all*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_show_all".} -proc hide_all*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_hide_all".} -proc map*(widget: PWidget){.cdecl, dynlib: lib, importc: "gtk_widget_map".} -proc unmap*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_unmap".} -proc realize*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_realize".} -proc unrealize*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_unrealize".} -proc queue_draw*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_queue_draw".} -proc queue_draw_area*(widget: PWidget, x: gint, y: gint, width: gint, - height: gint){.cdecl, dynlib: lib, - importc: "gtk_widget_queue_draw_area".} -proc queue_resize*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_queue_resize".} -proc size_request*(widget: PWidget, requisition: PRequisition){.cdecl, - dynlib: lib, importc: "gtk_widget_size_request".} -proc size_allocate*(widget: PWidget, allocation: PAllocation){.cdecl, - dynlib: lib, importc: "gtk_widget_size_allocate".} -proc get_child_requisition*(widget: PWidget, requisition: PRequisition){. - cdecl, dynlib: lib, importc: "gtk_widget_get_child_requisition".} -proc add_accelerator*(widget: PWidget, accel_signal: cstring, - accel_group: PAccelGroup, accel_key: guint, - accel_mods: gdk2.TModifierType, - accel_flags: TAccelFlags){.cdecl, dynlib: lib, - importc: "gtk_widget_add_accelerator".} -proc remove_accelerator*(widget: PWidget, accel_group: PAccelGroup, - accel_key: guint, accel_mods: gdk2.TModifierType): gboolean{. - cdecl, dynlib: lib, importc: "gtk_widget_remove_accelerator".} -proc set_accel_path*(widget: PWidget, accel_path: cstring, - accel_group: PAccelGroup){.cdecl, dynlib: lib, - importc: "gtk_widget_set_accel_path".} -proc get_accel_path*(widget: PWidget, locked: Pgboolean): cstring{.cdecl, - dynlib: lib, importc: "_gtk_widget_get_accel_path".} -proc list_accel_closures*(widget: PWidget): PGList{.cdecl, dynlib: lib, - importc: "gtk_widget_list_accel_closures".} -proc mnemonic_activate*(widget: PWidget, group_cycling: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gtk_widget_mnemonic_activate".} -proc event*(widget: PWidget, event: gdk2.PEvent): gboolean{.cdecl, - dynlib: lib, importc: "gtk_widget_event".} -proc send_expose*(widget: PWidget, event: gdk2.PEvent): gint{.cdecl, - dynlib: lib, importc: "gtk_widget_send_expose".} -proc activate*(widget: PWidget): gboolean{.cdecl, dynlib: lib, - importc: "gtk_widget_activate".} -proc set_scroll_adjustments*(widget: PWidget, hadjustment: PAdjustment, - vadjustment: PAdjustment): gboolean{.cdecl, - dynlib: lib, importc: "gtk_widget_set_scroll_adjustments".} -proc reparent*(widget: PWidget, new_parent: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_reparent".} -proc intersect*(widget: PWidget, area: gdk2.PRectangle, - intersection: gdk2.PRectangle): gboolean{.cdecl, - dynlib: lib, importc: "gtk_widget_intersect".} -proc region_intersect*(widget: PWidget, region: gdk2.PRegion): gdk2.PRegion{. - cdecl, dynlib: lib, importc: "gtk_widget_region_intersect".} -proc freeze_child_notify*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_freeze_child_notify".} -proc child_notify*(widget: PWidget, child_property: cstring){.cdecl, - dynlib: lib, importc: "gtk_widget_child_notify".} -proc thaw_child_notify*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_thaw_child_notify".} -proc is_focus*(widget: PWidget): gboolean{.cdecl, dynlib: lib, - importc: "gtk_widget_is_focus".} -proc grab_focus*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_grab_focus".} -proc grab_default*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_grab_default".} -proc set_name*(widget: PWidget, name: cstring){.cdecl, dynlib: lib, - importc: "gtk_widget_set_name".} -proc get_name*(widget: PWidget): cstring{.cdecl, dynlib: lib, - importc: "gtk_widget_get_name".} -proc set_state*(widget: PWidget, state: TStateType){.cdecl, dynlib: lib, - importc: "gtk_widget_set_state".} -proc set_sensitive*(widget: PWidget, sensitive: gboolean){.cdecl, - dynlib: lib, importc: "gtk_widget_set_sensitive".} -proc set_app_paintable*(widget: PWidget, app_paintable: gboolean){.cdecl, - dynlib: lib, importc: "gtk_widget_set_app_paintable".} -proc set_double_buffered*(widget: PWidget, double_buffered: gboolean){. - cdecl, dynlib: lib, importc: "gtk_widget_set_double_buffered".} -proc set_redraw_on_allocate*(widget: PWidget, - redraw_on_allocate: gboolean){.cdecl, - dynlib: lib, importc: "gtk_widget_set_redraw_on_allocate".} -proc set_parent*(widget: PWidget, parent: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_set_parent".} -proc set_parent_window*(widget: PWidget, parent_window: gdk2.PWindow){. - cdecl, dynlib: lib, importc: "gtk_widget_set_parent_window".} -proc set_child_visible*(widget: PWidget, is_visible: gboolean){.cdecl, - dynlib: lib, importc: "gtk_widget_set_child_visible".} -proc get_child_visible*(widget: PWidget): gboolean{.cdecl, dynlib: lib, - importc: "gtk_widget_get_child_visible".} -proc get_parent*(widget: PWidget): PWidget{.cdecl, dynlib: lib, - importc: "gtk_widget_get_parent".} -proc get_parent_window*(widget: PWidget): gdk2.PWindow{.cdecl, dynlib: lib, - importc: "gtk_widget_get_parent_window".} -proc child_focus*(widget: PWidget, direction: TDirectionType): gboolean{. - cdecl, dynlib: lib, importc: "gtk_widget_child_focus".} -proc set_size_request*(widget: PWidget, width: gint, height: gint){. - cdecl, dynlib: lib, importc: "gtk_widget_set_size_request".} -proc get_size_request*(widget: PWidget, width: Pgint, height: Pgint){. - cdecl, dynlib: lib, importc: "gtk_widget_get_size_request".} -proc set_events*(widget: PWidget, events: gint){.cdecl, dynlib: lib, - importc: "gtk_widget_set_events".} -proc add_events*(widget: PWidget, events: gint){.cdecl, dynlib: lib, - importc: "gtk_widget_add_events".} -proc set_extension_events*(widget: PWidget, mode: gdk2.TExtensionMode){. - cdecl, dynlib: lib, importc: "gtk_widget_set_extension_events".} -proc get_extension_events*(widget: PWidget): gdk2.TExtensionMode{.cdecl, - dynlib: lib, importc: "gtk_widget_get_extension_events".} -proc get_toplevel*(widget: PWidget): PWidget{.cdecl, dynlib: lib, - importc: "gtk_widget_get_toplevel".} -proc get_ancestor*(widget: PWidget, widget_type: TType): PWidget{.cdecl, - dynlib: lib, importc: "gtk_widget_get_ancestor".} -proc get_colormap*(widget: PWidget): gdk2.PColormap{.cdecl, dynlib: lib, - importc: "gtk_widget_get_colormap".} -proc get_visual*(widget: PWidget): gdk2.PVisual{.cdecl, dynlib: lib, - importc: "gtk_widget_get_visual".} -proc get_screen*(widget: PWidget): gdk2.PScreen{.cdecl, dynlib: lib, - importc: "gtk_widget_get_screen".} -proc has_screen*(widget: PWidget): gboolean{.cdecl, dynlib: lib, - importc: "gtk_widget_has_screen".} -proc get_display*(widget: PWidget): gdk2.PDisplay{.cdecl, dynlib: lib, - importc: "gtk_widget_get_display".} -proc get_root_window*(widget: PWidget): gdk2.PWindow{.cdecl, dynlib: lib, - importc: "gtk_widget_get_root_window".} -proc get_settings*(widget: PWidget): PSettings{.cdecl, dynlib: lib, - importc: "gtk_widget_get_settings".} -proc get_clipboard*(widget: PWidget, selection: gdk2.TAtom): PClipboard{. - cdecl, dynlib: lib, importc: "gtk_widget_get_clipboard".} -proc get_accessible*(widget: PWidget): atk.PObject{.cdecl, dynlib: lib, - importc: "gtk_widget_get_accessible".} -proc set_colormap*(widget: PWidget, colormap: gdk2.PColormap){.cdecl, - dynlib: lib, importc: "gtk_widget_set_colormap".} -proc get_events*(widget: PWidget): gint{.cdecl, dynlib: lib, - importc: "gtk_widget_get_events".} -proc get_pointer*(widget: PWidget, x: Pgint, y: Pgint){.cdecl, - dynlib: lib, importc: "gtk_widget_get_pointer".} -proc is_ancestor*(widget: PWidget, ancestor: PWidget): gboolean{.cdecl, - dynlib: lib, importc: "gtk_widget_is_ancestor".} -proc translate_coordinates*(src_widget: PWidget, dest_widget: PWidget, - src_x: gint, src_y: gint, dest_x: Pgint, - dest_y: Pgint): gboolean{.cdecl, dynlib: lib, - importc: "gtk_widget_translate_coordinates".} -proc hide_on_delete*(widget: PWidget): gboolean{.cdecl, dynlib: lib, - importc: "gtk_widget_hide_on_delete".} -proc set_style*(widget: PWidget, style: PStyle){.cdecl, dynlib: lib, - importc: "gtk_widget_set_style".} -proc ensure_style*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_ensure_style".} -proc get_style*(widget: PWidget): PStyle{.cdecl, dynlib: lib, - importc: "gtk_widget_get_style".} -proc modify_style*(widget: PWidget, style: PRcStyle){.cdecl, dynlib: lib, - importc: "gtk_widget_modify_style".} -proc get_modifier_style*(widget: PWidget): PRcStyle{.cdecl, dynlib: lib, - importc: "gtk_widget_get_modifier_style".} -proc modify_fg*(widget: PWidget, state: TStateType, color: gdk2.PColor){. - cdecl, dynlib: lib, importc: "gtk_widget_modify_fg".} -proc modify_bg*(widget: PWidget, state: TStateType, color: gdk2.PColor){. - cdecl, dynlib: lib, importc: "gtk_widget_modify_bg".} -proc modify_text*(widget: PWidget, state: TStateType, color: gdk2.PColor){. - cdecl, dynlib: lib, importc: "gtk_widget_modify_text".} -proc modify_base*(widget: PWidget, state: TStateType, color: gdk2.PColor){. - cdecl, dynlib: lib, importc: "gtk_widget_modify_base".} -proc modify_font*(widget: PWidget, font_desc: pango.PFontDescription){. - cdecl, dynlib: lib, importc: "gtk_widget_modify_font".} -proc create_pango_context*(widget: PWidget): pango.PContext{.cdecl, - dynlib: lib, importc: "gtk_widget_create_pango_context".} -proc get_pango_context*(widget: PWidget): pango.PContext{.cdecl, - dynlib: lib, importc: "gtk_widget_get_pango_context".} -proc create_pango_layout*(widget: PWidget, text: cstring): pango.PLayout{. - cdecl, dynlib: lib, importc: "gtk_widget_create_pango_layout".} -proc render_icon*(widget: PWidget, stock_id: cstring, size: TIconSize, - detail: cstring): gdk2pixbuf.PPixbuf{.cdecl, dynlib: lib, - importc: "gtk_widget_render_icon".} -proc set_composite_name*(widget: PWidget, name: cstring){.cdecl, - dynlib: lib, importc: "gtk_widget_set_composite_name".} -proc get_composite_name*(widget: PWidget): cstring{.cdecl, dynlib: lib, - importc: "gtk_widget_get_composite_name".} -proc reset_rc_styles*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_reset_rc_styles".} -proc widget_push_colormap*(cmap: gdk2.PColormap){.cdecl, dynlib: lib, - importc: "gtk_widget_push_colormap".} -proc widget_push_composite_child*(){.cdecl, dynlib: lib, - importc: "gtk_widget_push_composite_child".} -proc widget_pop_composite_child*(){.cdecl, dynlib: lib, - importc: "gtk_widget_pop_composite_child".} -proc widget_pop_colormap*(){.cdecl, dynlib: lib, - importc: "gtk_widget_pop_colormap".} -proc install_style_property*(klass: PWidgetClass, - pspec: PGParamSpec){.cdecl, dynlib: lib, - importc: "gtk_widget_class_install_style_property".} -proc install_style_property_parser*(klass: PWidgetClass, - pspec: PGParamSpec, parser: TRcPropertyParser){.cdecl, dynlib: lib, - importc: "gtk_widget_class_install_style_property_parser".} -proc find_style_property*(klass: PWidgetClass, - property_name: cstring): PGParamSpec{. - cdecl, dynlib: lib, importc: "gtk_widget_class_find_style_property".} -proc list_style_properties*(klass: PWidgetClass, - n_properties: Pguint): PPGParamSpec{.cdecl, dynlib: lib, - importc: "gtk_widget_class_list_style_properties".} -proc style_get_property*(widget: PWidget, property_name: cstring, - value: PGValue){.cdecl, dynlib: lib, - importc: "gtk_widget_style_get_property".} -proc widget_set_default_colormap*(colormap: gdk2.PColormap){.cdecl, dynlib: lib, - importc: "gtk_widget_set_default_colormap".} -proc widget_get_default_style*(): PStyle{.cdecl, dynlib: lib, - importc: "gtk_widget_get_default_style".} -proc set_direction*(widget: PWidget, dir: TTextDirection){.cdecl, - dynlib: lib, importc: "gtk_widget_set_direction".} -proc get_direction*(widget: PWidget): TTextDirection{.cdecl, dynlib: lib, - importc: "gtk_widget_get_direction".} -proc widget_set_default_direction*(dir: TTextDirection){.cdecl, dynlib: lib, - importc: "gtk_widget_set_default_direction".} -proc widget_get_default_direction*(): TTextDirection{.cdecl, dynlib: lib, - importc: "gtk_widget_get_default_direction".} -proc shape_combine_mask*(widget: PWidget, shape_mask: gdk2.PBitmap, - offset_x: gint, offset_y: gint){.cdecl, - dynlib: lib, importc: "gtk_widget_shape_combine_mask".} -proc reset_shapes*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_reset_shapes".} -proc path*(widget: PWidget, path_length: Pguint, path: PPgchar, - path_reversed: PPgchar){.cdecl, dynlib: lib, - importc: "gtk_widget_path".} -proc class_path*(widget: PWidget, path_length: Pguint, path: PPgchar, - path_reversed: PPgchar){.cdecl, dynlib: lib, - importc: "gtk_widget_class_path".} -proc requisition_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_requisition_get_type".} -proc copy*(requisition: PRequisition): PRequisition{.cdecl, - dynlib: lib, importc: "gtk_requisition_copy".} -proc free*(requisition: PRequisition){.cdecl, dynlib: lib, - importc: "gtk_requisition_free".} -proc get_aux_info*(widget: PWidget, create: gboolean): PWidgetAuxInfo{. - cdecl, dynlib: lib, importc: "gtk_widget_get_aux_info".} -proc propagate_hierarchy_changed*(widget: PWidget, - previous_toplevel: PWidget){.cdecl, dynlib: lib, importc: "_gtk_widget_propagate_hierarchy_changed".} -proc widget_peek_colormap*(): gdk2.PColormap{.cdecl, dynlib: lib, - importc: "_gtk_widget_peek_colormap".} -proc TYPE_MISC*(): GType -proc MISC*(obj: pointer): PMisc -proc MISC_CLASS*(klass: pointer): PMiscClass -proc IS_MISC*(obj: pointer): bool -proc IS_MISC_CLASS*(klass: pointer): bool -proc MISC_GET_CLASS*(obj: pointer): PMiscClass -proc misc_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_misc_get_type".} -proc set_alignment*(misc: PMisc, xalign: gfloat, yalign: gfloat){.cdecl, - dynlib: lib, importc: "gtk_misc_set_alignment".} -proc get_alignment*(misc: PMisc, xalign, yalign: var Pgfloat){.cdecl, - dynlib: lib, importc: "gtk_misc_get_alignment".} -proc set_padding*(misc: PMisc, xpad: gint, ypad: gint){.cdecl, dynlib: lib, - importc: "gtk_misc_set_padding".} -proc get_padding*(misc: PMisc, xpad, ypad: var Pgint){.cdecl, dynlib: lib, - importc: "gtk_misc_get_padding".} -const - ACCEL_VISIBLE* = 1 shl 0 - ACCEL_LOCKED* = 1 shl 1 - ACCEL_MASK* = 0x00000007 - bm_TGtkAccelKey_accel_flags* = 0xFFFF'i16 - bp_TGtkAccelKey_accel_flags* = 0'i16 - -proc TYPE_ACCEL_GROUP*(): GType -proc ACCEL_GROUP*(anObject: pointer): PAccelGroup -proc ACCEL_GROUP_CLASS*(klass: pointer): PAccelGroupClass -proc IS_ACCEL_GROUP*(anObject: pointer): bool -proc IS_ACCEL_GROUP_CLASS*(klass: pointer): bool -proc ACCEL_GROUP_GET_CLASS*(obj: pointer): PAccelGroupClass -proc accel_flags*(a: PAccelKey): guint -proc set_accel_flags*(a: PAccelKey, `accel_flags`: guint) -proc accel_group_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_accel_group_get_type".} -proc accel_group_new*(): PAccelGroup{.cdecl, dynlib: lib, - importc: "gtk_accel_group_new".} -proc lock*(accel_group: PAccelGroup){.cdecl, dynlib: lib, - importc: "gtk_accel_group_lock".} -proc unlock*(accel_group: PAccelGroup){.cdecl, dynlib: lib, - importc: "gtk_accel_group_unlock".} -proc connect*(accel_group: PAccelGroup, accel_key: guint, - accel_mods: gdk2.TModifierType, - accel_flags: TAccelFlags, closure: PGClosure){.cdecl, - dynlib: lib, importc: "gtk_accel_group_connect".} -proc connect_by_path*(accel_group: PAccelGroup, accel_path: cstring, - closure: PGClosure){.cdecl, dynlib: lib, - importc: "gtk_accel_group_connect_by_path".} -proc disconnect*(accel_group: PAccelGroup, closure: PGClosure): gboolean{. - cdecl, dynlib: lib, importc: "gtk_accel_group_disconnect".} -proc disconnect_key*(accel_group: PAccelGroup, accel_key: guint, - accel_mods: gdk2.TModifierType): gboolean{.cdecl, - dynlib: lib, importc: "gtk_accel_group_disconnect_key".} -proc attach*(accel_group: PAccelGroup, anObject: PGObject){.cdecl, - dynlib: lib, importc: "_gtk_accel_group_attach".} -proc detach*(accel_group: PAccelGroup, anObject: PGObject){.cdecl, - dynlib: lib, importc: "_gtk_accel_group_detach".} -proc accel_groups_activate*(anObject: PGObject, accel_key: guint, - accel_mods: gdk2.TModifierType): gboolean{.cdecl, - dynlib: lib, importc: "gtk_accel_groups_activate".} -proc accel_groups_from_object*(anObject: PGObject): PGSList{.cdecl, dynlib: lib, - importc: "gtk_accel_groups_from_object".} -proc find*(accel_group: PAccelGroup, - find_func: Taccel_group_find_func, data: gpointer): PAccelKey{. - cdecl, dynlib: lib, importc: "gtk_accel_group_find".} -proc accel_group_from_accel_closure*(closure: PGClosure): PAccelGroup{.cdecl, - dynlib: lib, importc: "gtk_accel_group_from_accel_closure".} -proc accelerator_valid*(keyval: guint, modifiers: gdk2.TModifierType): gboolean{. - cdecl, dynlib: lib, importc: "gtk_accelerator_valid".} -proc accelerator_parse*(accelerator: cstring, accelerator_key: Pguint, - accelerator_mods: gdk2.PModifierType){.cdecl, dynlib: lib, - importc: "gtk_accelerator_parse".} -proc accelerator_name*(accelerator_key: guint, - accelerator_mods: gdk2.TModifierType): cstring{.cdecl, - dynlib: lib, importc: "gtk_accelerator_name".} -proc accelerator_set_default_mod_mask*(default_mod_mask: gdk2.TModifierType){. - cdecl, dynlib: lib, importc: "gtk_accelerator_set_default_mod_mask".} -proc accelerator_get_default_mod_mask*(): guint{.cdecl, dynlib: lib, - importc: "gtk_accelerator_get_default_mod_mask".} -proc query*(accel_group: PAccelGroup, accel_key: guint, - accel_mods: gdk2.TModifierType, n_entries: Pguint): PAccelGroupEntry{. - cdecl, dynlib: lib, importc: "gtk_accel_group_query".} -proc reconnect*(accel_group: PAccelGroup, accel_path_quark: TGQuark){. - cdecl, dynlib: lib, importc: "_gtk_accel_group_reconnect".} -const - bm_TGtkContainer_border_width* = 0x0000FFFF'i32 - bp_TGtkContainer_border_width* = 0'i32 - bm_TGtkContainer_need_resize* = 0x00010000'i32 - bp_TGtkContainer_need_resize* = 16'i32 - bm_TGtkContainer_resize_mode* = 0x00060000'i32 - bp_TGtkContainer_resize_mode* = 17'i32 - bm_TGtkContainer_reallocate_redraws* = 0x00080000'i32 - bp_TGtkContainer_reallocate_redraws* = 19'i32 - bm_TGtkContainer_has_focus_chain* = 0x00100000'i32 - bp_TGtkContainer_has_focus_chain* = 20'i32 - -proc TYPE_CONTAINER*(): GType -proc CONTAINER*(obj: pointer): PContainer -proc CONTAINER_CLASS*(klass: pointer): PContainerClass -proc IS_CONTAINER*(obj: pointer): bool -proc IS_CONTAINER_CLASS*(klass: pointer): bool -proc CONTAINER_GET_CLASS*(obj: pointer): PContainerClass -proc IS_RESIZE_CONTAINER*(widget: pointer): bool -proc border_width*(a: PContainer): guint -proc need_resize*(a: PContainer): guint -proc set_need_resize*(a: PContainer, `need_resize`: guint) -proc resize_mode*(a: PContainer): guint -proc set_resize_mode*(a: PContainer, `resize_mode`: guint) -proc reallocate_redraws*(a: PContainer): guint -proc set_reallocate_redraws*(a: PContainer, `reallocate_redraws`: guint) -proc has_focus_chain*(a: PContainer): guint -proc set_has_focus_chain*(a: PContainer, `has_focus_chain`: guint) -proc container_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_container_get_type".} -proc set_border_width*(container: PContainer, border_width: guint){. - cdecl, dynlib: lib, importc: "gtk_container_set_border_width".} -proc get_border_width*(container: PContainer): guint{.cdecl, - dynlib: lib, importc: "gtk_container_get_border_width".} -proc add*(container: PContainer, widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_container_add".} -proc remove*(container: PContainer, widget: PWidget){.cdecl, - dynlib: lib, importc: "gtk_container_remove".} -proc set_resize_mode*(container: PContainer, resize_mode: TResizeMode){. - cdecl, dynlib: lib, importc: "gtk_container_set_resize_mode".} -proc get_resize_mode*(container: PContainer): TResizeMode{.cdecl, - dynlib: lib, importc: "gtk_container_get_resize_mode".} -proc check_resize*(container: PContainer){.cdecl, dynlib: lib, - importc: "gtk_container_check_resize".} -proc foreach*(container: PContainer, callback: TCallback, - callback_data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_container_foreach".} -proc get_children*(container: PContainer): PGList{.cdecl, dynlib: lib, - importc: "gtk_container_get_children".} -proc propagate_expose*(container: PContainer, child: PWidget, - event: gdk2.PEventExpose){.cdecl, dynlib: lib, - importc: "gtk_container_propagate_expose".} -proc set_focus_chain*(container: PContainer, focusable_widgets: PGList){. - cdecl, dynlib: lib, importc: "gtk_container_set_focus_chain".} -proc get_focus_chain*(container: PContainer, s: var PGList): gboolean{. - cdecl, dynlib: lib, importc: "gtk_container_get_focus_chain".} -proc unset_focus_chain*(container: PContainer){.cdecl, dynlib: lib, - importc: "gtk_container_unset_focus_chain".} -proc set_reallocate_redraws*(container: PContainer, - needs_redraws: gboolean){.cdecl, - dynlib: lib, importc: "gtk_container_set_reallocate_redraws".} -proc set_focus_child*(container: PContainer, child: PWidget){.cdecl, - dynlib: lib, importc: "gtk_container_set_focus_child".} -proc set_focus_vadjustment*(container: PContainer, - adjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_container_set_focus_vadjustment".} -proc get_focus_vadjustment*(container: PContainer): PAdjustment{. - cdecl, dynlib: lib, importc: "gtk_container_get_focus_vadjustment".} -proc set_focus_hadjustment*(container: PContainer, - adjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_container_set_focus_hadjustment".} -proc get_focus_hadjustment*(container: PContainer): PAdjustment{. - cdecl, dynlib: lib, importc: "gtk_container_get_focus_hadjustment".} -proc resize_children*(container: PContainer){.cdecl, dynlib: lib, - importc: "gtk_container_resize_children".} -proc child_type*(container: PContainer): TType{.cdecl, dynlib: lib, - importc: "gtk_container_child_type".} -proc install_child_property*(cclass: PContainerClass, - property_id: guint, pspec: PGParamSpec){.cdecl, dynlib: lib, - importc: "gtk_container_class_install_child_property".} -proc container_class_find_child_property*(cclass: PGObjectClass, - property_name: cstring): PGParamSpec{.cdecl, dynlib: lib, - importc: "gtk_container_class_find_child_property".} -proc container_class_list_child_properties*(cclass: PGObjectClass, - n_properties: Pguint): PPGParamSpec{.cdecl, dynlib: lib, - importc: "gtk_container_class_list_child_properties".} -proc child_set_property*(container: PContainer, child: PWidget, - property_name: cstring, value: PGValue){. - cdecl, dynlib: lib, importc: "gtk_container_child_set_property".} -proc child_get_property*(container: PContainer, child: PWidget, - property_name: cstring, value: PGValue){. - cdecl, dynlib: lib, importc: "gtk_container_child_get_property".} -proc CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID*(anObject: pointer, - property_id: guint, pspec: pointer) -proc forall*(container: PContainer, callback: TCallback, - callback_data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_container_forall".} -proc queue_resize*(container: PContainer){.cdecl, dynlib: lib, - importc: "_gtk_container_queue_resize".} -proc clear_resize_widgets*(container: PContainer){.cdecl, dynlib: lib, - importc: "_gtk_container_clear_resize_widgets".} -proc child_composite_name*(container: PContainer, child: PWidget): cstring{. - cdecl, dynlib: lib, importc: "_gtk_container_child_composite_name".} -proc dequeue_resize_handler*(container: PContainer){.cdecl, - dynlib: lib, importc: "_gtk_container_dequeue_resize_handler".} -proc focus_sort*(container: PContainer, children: PGList, - direction: TDirectionType, old_focus: PWidget): PGList{. - cdecl, dynlib: lib, importc: "_gtk_container_focus_sort".} -proc TYPE_BIN*(): GType -proc BIN*(obj: pointer): PBin -proc BIN_CLASS*(klass: pointer): PBinClass -proc IS_BIN*(obj: pointer): bool -proc IS_BIN_CLASS*(klass: pointer): bool -proc BIN_GET_CLASS*(obj: pointer): PBinClass -proc bin_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_bin_get_type".} -proc get_child*(bin: PBin): PWidget{.cdecl, dynlib: lib, - importc: "gtk_bin_get_child".} -const - bm_TGtkWindow_allow_shrink* = 0x00000001'i32 - bp_TGtkWindow_allow_shrink* = 0'i32 - bm_TGtkWindow_allow_grow* = 0x00000002'i32 - bp_TGtkWindow_allow_grow* = 1'i32 - bm_TGtkWindow_configure_notify_received* = 0x00000004'i32 - bp_TGtkWindow_configure_notify_received* = 2'i32 - bm_TGtkWindow_need_default_position* = 0x00000008'i32 - bp_TGtkWindow_need_default_position* = 3'i32 - bm_TGtkWindow_need_default_size* = 0x00000010'i32 - bp_TGtkWindow_need_default_size* = 4'i32 - bm_TGtkWindow_position* = 0x000000E0'i32 - bp_TGtkWindow_position* = 5'i32 - bm_TGtkWindow_type* = 0x00000F00'i32 - bp_TGtkWindow_type* = 8'i32 - bm_TGtkWindow_has_user_ref_count* = 0x00001000'i32 - bp_TGtkWindow_has_user_ref_count* = 12'i32 - bm_TGtkWindow_has_focus* = 0x00002000'i32 - bp_TGtkWindow_has_focus* = 13'i32 - bm_TGtkWindow_modal* = 0x00004000'i32 - bp_TGtkWindow_modal* = 14'i32 - bm_TGtkWindow_destroy_with_parent* = 0x00008000'i32 - bp_TGtkWindow_destroy_with_parent* = 15'i32 - bm_TGtkWindow_has_frame* = 0x00010000'i32 - bp_TGtkWindow_has_frame* = 16'i32 - bm_TGtkWindow_iconify_initially* = 0x00020000'i32 - bp_TGtkWindow_iconify_initially* = 17'i32 - bm_TGtkWindow_stick_initially* = 0x00040000'i32 - bp_TGtkWindow_stick_initially* = 18'i32 - bm_TGtkWindow_maximize_initially* = 0x00080000'i32 - bp_TGtkWindow_maximize_initially* = 19'i32 - bm_TGtkWindow_decorated* = 0x00100000'i32 - bp_TGtkWindow_decorated* = 20'i32 - bm_TGtkWindow_type_hint* = 0x00E00000'i32 - bp_TGtkWindow_type_hint* = 21'i32 - bm_TGtkWindow_gravity* = 0x1F000000'i32 - bp_TGtkWindow_gravity* = 24'i32 - -proc TYPE_WINDOW*(): GType -proc WINDOW*(obj: pointer): PWindow -proc WINDOW_CLASS*(klass: pointer): PWindowClass -proc IS_WINDOW*(obj: pointer): bool -proc IS_WINDOW_CLASS*(klass: pointer): bool -proc WINDOW_GET_CLASS*(obj: pointer): PWindowClass -proc allow_shrink*(a: gtk2.PWindow): guint -proc set_allow_shrink*(a: gtk2.PWindow, `allow_shrink`: guint) -proc allow_grow*(a: gtk2.PWindow): guint -proc set_allow_grow*(a: gtk2.PWindow, `allow_grow`: guint) -proc configure_notify_received*(a: gtk2.PWindow): guint -proc set_configure_notify_received*(a: gtk2.PWindow, - `configure_notify_received`: guint) -proc need_default_position*(a: gtk2.PWindow): guint -proc set_need_default_position*(a: gtk2.PWindow, `need_default_position`: guint) -proc need_default_size*(a: gtk2.PWindow): guint -proc set_need_default_size*(a: gtk2.PWindow, `need_default_size`: guint) -proc position*(a: gtk2.PWindow): guint -proc get_type*(a: gtk2.PWindow): guint -proc set_type*(a: gtk2.PWindow, `type`: guint) -proc has_user_ref_count*(a: gtk2.PWindow): guint -proc set_has_user_ref_count*(a: gtk2.PWindow, `has_user_ref_count`: guint) -proc has_focus*(a: gtk2.PWindow): guint -proc set_has_focus*(a: gtk2.PWindow, `has_focus`: guint) -proc modal*(a: gtk2.PWindow): guint -proc set_modal*(a: gtk2.PWindow, `modal`: guint) -proc destroy_with_parent*(a: gtk2.PWindow): guint -proc set_destroy_with_parent*(a: gtk2.PWindow, `destroy_with_parent`: guint) -proc has_frame*(a: gtk2.PWindow): guint -proc set_has_frame*(a: gtk2.PWindow, `has_frame`: guint) -proc iconify_initially*(a: gtk2.PWindow): guint -proc set_iconify_initially*(a: gtk2.PWindow, `iconify_initially`: guint) -proc stick_initially*(a: gtk2.PWindow): guint -proc set_stick_initially*(a: gtk2.PWindow, `stick_initially`: guint) -proc maximize_initially*(a: gtk2.PWindow): guint -proc set_maximize_initially*(a: gtk2.PWindow, `maximize_initially`: guint) -proc decorated*(a: gtk2.PWindow): guint -proc set_decorated*(a: gtk2.PWindow, `decorated`: guint) -proc type_hint*(a: gtk2.PWindow): guint -proc set_type_hint*(a: gtk2.PWindow, `type_hint`: guint) -proc gravity*(a: gtk2.PWindow): guint -proc set_gravity*(a: gtk2.PWindow, `gravity`: guint) -proc TYPE_WINDOW_GROUP*(): GType -proc WINDOW_GROUP*(anObject: pointer): PWindowGroup -proc WINDOW_GROUP_CLASS*(klass: pointer): PWindowGroupClass -proc IS_WINDOW_GROUP*(anObject: pointer): bool -proc IS_WINDOW_GROUP_CLASS*(klass: pointer): bool -proc WINDOW_GROUP_GET_CLASS*(obj: pointer): PWindowGroupClass -proc window_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_window_get_type".} -proc window_new*(thetype: TWindowType): PWindow{.cdecl, dynlib: lib, - importc: "gtk_window_new".} -proc set_title*(window: PWindow, title: cstring){.cdecl, dynlib: lib, - importc: "gtk_window_set_title".} -proc get_title*(window: PWindow): cstring{.cdecl, dynlib: lib, - importc: "gtk_window_get_title".} -proc set_wmclass*(window: PWindow, wmclass_name: cstring, - wmclass_class: cstring){.cdecl, dynlib: lib, - importc: "gtk_window_set_wmclass".} -proc set_role*(window: PWindow, role: cstring){.cdecl, dynlib: lib, - importc: "gtk_window_set_role".} -proc get_role*(window: PWindow): cstring{.cdecl, dynlib: lib, - importc: "gtk_window_get_role".} -proc add_accel_group*(window: PWindow, accel_group: PAccelGroup){.cdecl, - dynlib: lib, importc: "gtk_window_add_accel_group".} -proc remove_accel_group*(window: PWindow, accel_group: PAccelGroup){. - cdecl, dynlib: lib, importc: "gtk_window_remove_accel_group".} -proc set_position*(window: PWindow, position: TWindowPosition){.cdecl, - dynlib: lib, importc: "gtk_window_set_position".} -proc activate_focus*(window: PWindow): gboolean{.cdecl, dynlib: lib, - importc: "gtk_window_activate_focus".} -proc set_focus*(window: PWindow, focus: PWidget){.cdecl, dynlib: lib, - importc: "gtk_window_set_focus".} -proc get_focus*(window: PWindow): PWidget{.cdecl, dynlib: lib, - importc: "gtk_window_get_focus".} -proc set_default*(window: PWindow, default_widget: PWidget){.cdecl, - dynlib: lib, importc: "gtk_window_set_default".} -proc activate_default*(window: PWindow): gboolean{.cdecl, dynlib: lib, - importc: "gtk_window_activate_default".} -proc set_transient_for*(window: PWindow, parent: PWindow){.cdecl, - dynlib: lib, importc: "gtk_window_set_transient_for".} -proc get_transient_for*(window: PWindow): PWindow{.cdecl, dynlib: lib, - importc: "gtk_window_get_transient_for".} -proc set_type_hint*(window: PWindow, hint: gdk2.TWindowTypeHint){.cdecl, - dynlib: lib, importc: "gtk_window_set_type_hint".} -proc get_type_hint*(window: PWindow): gdk2.TWindowTypeHint{.cdecl, - dynlib: lib, importc: "gtk_window_get_type_hint".} -proc set_destroy_with_parent*(window: PWindow, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_window_set_destroy_with_parent".} -proc get_destroy_with_parent*(window: PWindow): gboolean{.cdecl, - dynlib: lib, importc: "gtk_window_get_destroy_with_parent".} -proc set_resizable*(window: PWindow, resizable: gboolean){.cdecl, - dynlib: lib, importc: "gtk_window_set_resizable".} -proc get_resizable*(window: PWindow): gboolean{.cdecl, dynlib: lib, - importc: "gtk_window_get_resizable".} -proc set_gravity*(window: PWindow, gravity: gdk2.TGravity){.cdecl, - dynlib: lib, importc: "gtk_window_set_gravity".} -proc get_gravity*(window: PWindow): gdk2.TGravity{.cdecl, dynlib: lib, - importc: "gtk_window_get_gravity".} -proc set_geometry_hints*(window: PWindow, geometry_widget: PWidget, - geometry: gdk2.PGeometry, - geom_mask: gdk2.TWindowHints){.cdecl, dynlib: lib, - importc: "gtk_window_set_geometry_hints".} -proc set_screen*(window: PWindow, screen: gdk2.PScreen){.cdecl, - dynlib: lib, importc: "gtk_window_set_screen".} -proc get_screen*(window: PWindow): gdk2.PScreen{.cdecl, dynlib: lib, - importc: "gtk_window_get_screen".} -proc set_has_frame*(window: PWindow, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_window_set_has_frame".} -proc get_has_frame*(window: PWindow): gboolean{.cdecl, dynlib: lib, - importc: "gtk_window_get_has_frame".} -proc set_frame_dimensions*(window: PWindow, left: gint, top: gint, - right: gint, bottom: gint){.cdecl, - dynlib: lib, importc: "gtk_window_set_frame_dimensions".} -proc get_frame_dimensions*(window: PWindow, left: Pgint, top: Pgint, - right: Pgint, bottom: Pgint){.cdecl, - dynlib: lib, importc: "gtk_window_get_frame_dimensions".} -proc set_decorated*(window: PWindow, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_window_set_decorated".} -proc get_decorated*(window: PWindow): gboolean{.cdecl, dynlib: lib, - importc: "gtk_window_get_decorated".} -proc set_icon_list*(window: PWindow, list: PGList){.cdecl, dynlib: lib, - importc: "gtk_window_set_icon_list".} -proc get_icon_list*(window: PWindow): PGList{.cdecl, dynlib: lib, - importc: "gtk_window_get_icon_list".} -proc set_icon*(window: PWindow, icon: gdk2pixbuf.PPixbuf){.cdecl, dynlib: lib, - importc: "gtk_window_set_icon".} -proc get_icon*(window: PWindow): gdk2pixbuf.PPixbuf{.cdecl, dynlib: lib, - importc: "gtk_window_get_icon".} -proc window_set_default_icon_list*(list: PGList){.cdecl, dynlib: lib, - importc: "gtk_window_set_default_icon_list".} -proc window_get_default_icon_list*(): PGList{.cdecl, dynlib: lib, - importc: "gtk_window_get_default_icon_list".} -proc set_modal*(window: PWindow, modal: gboolean){.cdecl, dynlib: lib, - importc: "gtk_window_set_modal".} -proc get_modal*(window: PWindow): gboolean{.cdecl, dynlib: lib, - importc: "gtk_window_get_modal".} -proc window_list_toplevels*(): PGList{.cdecl, dynlib: lib, - importc: "gtk_window_list_toplevels".} -proc add_mnemonic*(window: PWindow, keyval: guint, target: PWidget){. - cdecl, dynlib: lib, importc: "gtk_window_add_mnemonic".} -proc remove_mnemonic*(window: PWindow, keyval: guint, target: PWidget){. - cdecl, dynlib: lib, importc: "gtk_window_remove_mnemonic".} -proc mnemonic_activate*(window: PWindow, keyval: guint, - modifier: gdk2.TModifierType): gboolean{.cdecl, - dynlib: lib, importc: "gtk_window_mnemonic_activate".} -proc set_mnemonic_modifier*(window: PWindow, modifier: gdk2.TModifierType){. - cdecl, dynlib: lib, importc: "gtk_window_set_mnemonic_modifier".} -proc get_mnemonic_modifier*(window: PWindow): gdk2.TModifierType{.cdecl, - dynlib: lib, importc: "gtk_window_get_mnemonic_modifier".} -proc present*(window: PWindow){.cdecl, dynlib: lib, - importc: "gtk_window_present".} -proc iconify*(window: PWindow){.cdecl, dynlib: lib, - importc: "gtk_window_iconify".} -proc deiconify*(window: PWindow){.cdecl, dynlib: lib, - importc: "gtk_window_deiconify".} -proc stick*(window: PWindow){.cdecl, dynlib: lib, - importc: "gtk_window_stick".} -proc unstick*(window: PWindow){.cdecl, dynlib: lib, - importc: "gtk_window_unstick".} -proc maximize*(window: PWindow){.cdecl, dynlib: lib, - importc: "gtk_window_maximize".} -proc unmaximize*(window: PWindow){.cdecl, dynlib: lib, - importc: "gtk_window_unmaximize".} -proc begin_resize_drag*(window: PWindow, edge: gdk2.TWindowEdge, - button: gint, root_x: gint, root_y: gint, - timestamp: guint32){.cdecl, dynlib: lib, - importc: "gtk_window_begin_resize_drag".} -proc begin_move_drag*(window: PWindow, button: gint, root_x: gint, - root_y: gint, timestamp: guint32){.cdecl, - dynlib: lib, importc: "gtk_window_begin_move_drag".} -proc set_default_size*(window: PWindow, width: gint, height: gint){. - cdecl, dynlib: lib, importc: "gtk_window_set_default_size".} -proc get_default_size*(window: PWindow, width: Pgint, height: Pgint){. - cdecl, dynlib: lib, importc: "gtk_window_get_default_size".} -proc resize*(window: PWindow, width: gint, height: gint){.cdecl, - dynlib: lib, importc: "gtk_window_resize".} -proc get_size*(window: PWindow, width: Pgint, height: Pgint){.cdecl, - dynlib: lib, importc: "gtk_window_get_size".} -proc move*(window: PWindow, x: gint, y: gint){.cdecl, dynlib: lib, - importc: "gtk_window_move".} -proc get_position*(window: PWindow, root_x: Pgint, root_y: Pgint){.cdecl, - dynlib: lib, importc: "gtk_window_get_position".} -proc parse_geometry*(window: PWindow, geometry: cstring): gboolean{. - cdecl, dynlib: lib, importc: "gtk_window_parse_geometry".} -proc reshow_with_initial_size*(window: PWindow){.cdecl, dynlib: lib, - importc: "gtk_window_reshow_with_initial_size".} -proc window_group_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_window_group_get_type".} -proc window_group_new*(): PWindowGroup{.cdecl, dynlib: lib, - importc: "gtk_window_group_new".} -proc add_window*(window_group: PWindowGroup, window: PWindow){. - cdecl, dynlib: lib, importc: "gtk_window_group_add_window".} -proc remove_window*(window_group: PWindowGroup, window: PWindow){. - cdecl, dynlib: lib, importc: "gtk_window_group_remove_window".} -proc window_set_default_icon_name*(name: cstring){.cdecl, dynlib: lib, - importc: "gtk_window_set_default_icon_name".} -proc internal_set_focus*(window: PWindow, focus: PWidget){.cdecl, - dynlib: lib, importc: "_gtk_window_internal_set_focus".} -proc remove_embedded_xid*(window: PWindow, xid: guint){.cdecl, - dynlib: lib, importc: "gtk_window_remove_embedded_xid".} -proc add_embedded_xid*(window: PWindow, xid: guint){.cdecl, dynlib: lib, - importc: "gtk_window_add_embedded_xid".} -proc reposition*(window: PWindow, x: gint, y: gint){.cdecl, dynlib: lib, - importc: "_gtk_window_reposition".} -proc constrain_size*(window: PWindow, width: gint, height: gint, - new_width: Pgint, new_height: Pgint){.cdecl, - dynlib: lib, importc: "_gtk_window_constrain_size".} -proc get_group*(window: PWindow): PWindowGroup{.cdecl, dynlib: lib, - importc: "_gtk_window_get_group".} -proc activate_key*(window: PWindow, event: gdk2.PEventKey): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_window_activate_key".} -proc keys_foreach*(window: PWindow, func: TWindowKeysForeachFunc, - func_data: gpointer){.cdecl, dynlib: lib, - importc: "_gtk_window_keys_foreach".} -proc query_nonaccels*(window: PWindow, accel_key: guint, - accel_mods: gdk2.TModifierType): gboolean{.cdecl, - dynlib: lib, importc: "_gtk_window_query_nonaccels".} -const - bm_TGtkLabel_jtype* = 0x0003'i16 - bp_TGtkLabel_jtype* = 0'i16 - bm_TGtkLabel_wrap* = 0x0004'i16 - bp_TGtkLabel_wrap* = 2'i16 - bm_TGtkLabel_use_underline* = 0x0008'i16 - bp_TGtkLabel_use_underline* = 3'i16 - bm_TGtkLabel_use_markup* = 0x0010'i16 - bp_TGtkLabel_use_markup* = 4'i16 - -proc TYPE_LABEL*(): GType -proc LABEL*(obj: pointer): PLabel -proc LABEL_CLASS*(klass: pointer): PLabelClass -proc IS_LABEL*(obj: pointer): bool -proc IS_LABEL_CLASS*(klass: pointer): bool -proc LABEL_GET_CLASS*(obj: pointer): PLabelClass -proc jtype*(a: PLabel): guint -proc set_jtype*(a: PLabel, `jtype`: guint) -proc wrap*(a: PLabel): guint -proc set_wrap*(a: PLabel, `wrap`: guint) -proc use_underline*(a: PLabel): guint -proc set_use_underline*(a: PLabel, `use_underline`: guint) -proc use_markup*(a: PLabel): guint -proc set_use_markup*(a: PLabel, `use_markup`: guint) -proc label_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_label_get_type".} -proc label_new*(str: cstring): PLabel{.cdecl, dynlib: lib, - importc: "gtk_label_new".} -proc label_new_with_mnemonic*(str: cstring): PLabel{.cdecl, dynlib: lib, - importc: "gtk_label_new_with_mnemonic".} -proc set_text*(`label`: PLabel, str: cstring){.cdecl, dynlib: lib, - importc: "gtk_label_set_text".} -proc get_text*(`label`: PLabel): cstring{.cdecl, dynlib: lib, - importc: "gtk_label_get_text".} -proc set_attributes*(`label`: PLabel, attrs: pango.PAttrList){.cdecl, - dynlib: lib, importc: "gtk_label_set_attributes".} -proc get_attributes*(`label`: PLabel): pango.PAttrList{.cdecl, dynlib: lib, - importc: "gtk_label_get_attributes".} -proc set_label*(`label`: PLabel, str: cstring){.cdecl, dynlib: lib, - importc: "gtk_label_set_label".} -proc get_label*(`label`: PLabel): cstring{.cdecl, dynlib: lib, - importc: "gtk_label_get_label".} -proc set_markup*(`label`: PLabel, str: cstring){.cdecl, dynlib: lib, - importc: "gtk_label_set_markup".} -proc set_use_markup*(`label`: PLabel, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_label_set_use_markup".} -proc get_use_markup*(`label`: PLabel): gboolean{.cdecl, dynlib: lib, - importc: "gtk_label_get_use_markup".} -proc set_use_underline*(`label`: PLabel, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_label_set_use_underline".} -proc get_use_underline*(`label`: PLabel): gboolean{.cdecl, dynlib: lib, - importc: "gtk_label_get_use_underline".} -proc set_markup_with_mnemonic*(`label`: PLabel, str: cstring){.cdecl, - dynlib: lib, importc: "gtk_label_set_markup_with_mnemonic".} -proc get_mnemonic_keyval*(`label`: PLabel): guint{.cdecl, dynlib: lib, - importc: "gtk_label_get_mnemonic_keyval".} -proc set_mnemonic_widget*(`label`: PLabel, widget: PWidget){.cdecl, - dynlib: lib, importc: "gtk_label_set_mnemonic_widget".} -proc get_mnemonic_widget*(`label`: PLabel): PWidget{.cdecl, dynlib: lib, - importc: "gtk_label_get_mnemonic_widget".} -proc set_text_with_mnemonic*(`label`: PLabel, str: cstring){.cdecl, - dynlib: lib, importc: "gtk_label_set_text_with_mnemonic".} -proc set_justify*(`label`: PLabel, jtype: TJustification){.cdecl, - dynlib: lib, importc: "gtk_label_set_justify".} -proc get_justify*(`label`: PLabel): TJustification{.cdecl, dynlib: lib, - importc: "gtk_label_get_justify".} -proc set_pattern*(`label`: PLabel, pattern: cstring){.cdecl, dynlib: lib, - importc: "gtk_label_set_pattern".} -proc set_line_wrap*(`label`: PLabel, wrap: gboolean){.cdecl, dynlib: lib, - importc: "gtk_label_set_line_wrap".} -proc get_line_wrap*(`label`: PLabel): gboolean{.cdecl, dynlib: lib, - importc: "gtk_label_get_line_wrap".} -proc set_selectable*(`label`: PLabel, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_label_set_selectable".} -proc get_selectable*(`label`: PLabel): gboolean{.cdecl, dynlib: lib, - importc: "gtk_label_get_selectable".} -proc select_region*(`label`: PLabel, start_offset: gint, end_offset: gint){. - cdecl, dynlib: lib, importc: "gtk_label_select_region".} -proc get_selection_bounds*(`label`: PLabel, start: Pgint, theEnd: Pgint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_label_get_selection_bounds".} -proc get_layout*(`label`: PLabel): pango.PLayout{.cdecl, dynlib: lib, - importc: "gtk_label_get_layout".} -proc get_layout_offsets*(`label`: PLabel, x: Pgint, y: Pgint){.cdecl, - dynlib: lib, importc: "gtk_label_get_layout_offsets".} -const - bm_TGtkAccelLabelClass_latin1_to_char* = 0x0001'i16 - bp_TGtkAccelLabelClass_latin1_to_char* = 0'i16 - -proc TYPE_ACCEL_LABEL*(): GType -proc ACCEL_LABEL*(obj: pointer): PAccelLabel -proc ACCEL_LABEL_CLASS*(klass: pointer): PAccelLabelClass -proc IS_ACCEL_LABEL*(obj: pointer): bool -proc IS_ACCEL_LABEL_CLASS*(klass: pointer): bool -proc ACCEL_LABEL_GET_CLASS*(obj: pointer): PAccelLabelClass -proc latin1_to_char*(a: PAccelLabelClass): guint -proc set_latin1_to_char*(a: PAccelLabelClass, `latin1_to_char`: guint) -proc accel_label_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_accel_label_get_type".} -proc accel_label_new*(`string`: cstring): PAccelLabel{.cdecl, dynlib: lib, - importc: "gtk_accel_label_new".} -proc get_accel_widget*(accel_label: PAccelLabel): PWidget{.cdecl, - dynlib: lib, importc: "gtk_accel_label_get_accel_widget".} -proc get_accel_width*(accel_label: PAccelLabel): guint{.cdecl, - dynlib: lib, importc: "gtk_accel_label_get_accel_width".} -proc set_accel_widget*(accel_label: PAccelLabel, - accel_widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_accel_label_set_accel_widget".} -proc set_accel_closure*(accel_label: PAccelLabel, - accel_closure: PGClosure){.cdecl, - dynlib: lib, importc: "gtk_accel_label_set_accel_closure".} -proc refetch*(accel_label: PAccelLabel): gboolean{.cdecl, - dynlib: lib, importc: "gtk_accel_label_refetch".} -proc accel_map_add_entry*(accel_path: cstring, accel_key: guint, - accel_mods: gdk2.TModifierType){.cdecl, dynlib: lib, - importc: "gtk_accel_map_add_entry".} -proc accel_map_lookup_entry*(accel_path: cstring, key: PAccelKey): gboolean{. - cdecl, dynlib: lib, importc: "gtk_accel_map_lookup_entry".} -proc accel_map_change_entry*(accel_path: cstring, accel_key: guint, - accel_mods: gdk2.TModifierType, replace: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gtk_accel_map_change_entry".} -proc accel_map_load*(file_name: cstring){.cdecl, dynlib: lib, - importc: "gtk_accel_map_load".} -proc accel_map_save*(file_name: cstring){.cdecl, dynlib: lib, - importc: "gtk_accel_map_save".} -proc accel_map_foreach*(data: gpointer, foreach_func: TAccelMapForeach){.cdecl, - dynlib: lib, importc: "gtk_accel_map_foreach".} -proc accel_map_load_fd*(fd: gint){.cdecl, dynlib: lib, - importc: "gtk_accel_map_load_fd".} -proc accel_map_load_scanner*(scanner: PGScanner){.cdecl, dynlib: lib, - importc: "gtk_accel_map_load_scanner".} -proc accel_map_save_fd*(fd: gint){.cdecl, dynlib: lib, - importc: "gtk_accel_map_save_fd".} -proc accel_map_add_filter*(filter_pattern: cstring){.cdecl, dynlib: lib, - importc: "gtk_accel_map_add_filter".} -proc accel_map_foreach_unfiltered*(data: gpointer, - foreach_func: TAccelMapForeach){.cdecl, - dynlib: lib, importc: "gtk_accel_map_foreach_unfiltered".} -proc accel_map_init*(){.cdecl, dynlib: lib, importc: "_gtk_accel_map_init".} -proc accel_map_add_group*(accel_path: cstring, accel_group: PAccelGroup){.cdecl, - dynlib: lib, importc: "_gtk_accel_map_add_group".} -proc accel_map_remove_group*(accel_path: cstring, accel_group: PAccelGroup){. - cdecl, dynlib: lib, importc: "_gtk_accel_map_remove_group".} -proc accel_path_is_valid*(accel_path: cstring): gboolean{.cdecl, dynlib: lib, - importc: "_gtk_accel_path_is_valid".} -proc TYPE_ACCESSIBLE*(): GType -proc ACCESSIBLE*(obj: pointer): PAccessible -proc ACCESSIBLE_CLASS*(klass: pointer): PAccessibleClass -proc IS_ACCESSIBLE*(obj: pointer): bool -proc IS_ACCESSIBLE_CLASS*(klass: pointer): bool -proc ACCESSIBLE_GET_CLASS*(obj: pointer): PAccessibleClass -proc accessible_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_accessible_get_type".} -proc connect_widget_destroyed*(accessible: PAccessible){.cdecl, - dynlib: lib, importc: "gtk_accessible_connect_widget_destroyed".} -proc TYPE_ADJUSTMENT*(): GType -proc ADJUSTMENT*(obj: pointer): PAdjustment -proc ADJUSTMENT_CLASS*(klass: pointer): PAdjustmentClass -proc IS_ADJUSTMENT*(obj: pointer): bool -proc IS_ADJUSTMENT_CLASS*(klass: pointer): bool -proc ADJUSTMENT_GET_CLASS*(obj: pointer): PAdjustmentClass -proc adjustment_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_adjustment_get_type".} -proc adjustment_new*(value: gdouble, lower: gdouble, upper: gdouble, - step_increment: gdouble, page_increment: gdouble, - page_size: gdouble): PAdjustment{.cdecl, dynlib: lib, - importc: "gtk_adjustment_new".} -proc changed*(adjustment: PAdjustment){.cdecl, dynlib: lib, - importc: "gtk_adjustment_changed".} -proc value_changed*(adjustment: PAdjustment){.cdecl, dynlib: lib, - importc: "gtk_adjustment_value_changed".} -proc clamp_page*(adjustment: PAdjustment, lower: gdouble, - upper: gdouble){.cdecl, dynlib: lib, - importc: "gtk_adjustment_clamp_page".} -proc get_value*(adjustment: PAdjustment): gdouble{.cdecl, - dynlib: lib, importc: "gtk_adjustment_get_value".} -proc set_value*(adjustment: PAdjustment, value: gdouble){.cdecl, - dynlib: lib, importc: "gtk_adjustment_set_value".} -proc get_upper*(adjustment: PAdjustment): gdouble{.cdecl, - dynlib: lib, importc: "gtk_adjustment_get_upper".} -proc get_page_size*(adjustment: PAdjustment): gdouble{.cdecl, - dynlib: lib, importc: "gtk_adjustment_get_page_size".} -proc TYPE_ALIGNMENT*(): GType -proc ALIGNMENT*(obj: pointer): PAlignment -proc ALIGNMENT_CLASS*(klass: pointer): PAlignmentClass -proc IS_ALIGNMENT*(obj: pointer): bool -proc IS_ALIGNMENT_CLASS*(klass: pointer): bool -proc ALIGNMENT_GET_CLASS*(obj: pointer): PAlignmentClass -proc alignment_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_alignment_get_type".} -proc alignment_new*(xalign: gfloat, yalign: gfloat, xscale: gfloat, - yscale: gfloat): PAlignment{.cdecl, dynlib: lib, - importc: "gtk_alignment_new".} -proc set*(alignment: PAlignment, xalign: gfloat, yalign: gfloat, - xscale: gfloat, yscale: gfloat){.cdecl, dynlib: lib, - importc: "gtk_alignment_set".} -proc TYPE_FRAME*(): GType -proc FRAME*(obj: pointer): PFrame -proc FRAME_CLASS*(klass: pointer): PFrameClass -proc IS_FRAME*(obj: pointer): bool -proc IS_FRAME_CLASS*(klass: pointer): bool -proc FRAME_GET_CLASS*(obj: pointer): PFrameClass -proc frame_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_frame_get_type".} -proc frame_new*(`label`: cstring): PFrame{.cdecl, dynlib: lib, - importc: "gtk_frame_new".} -proc set_label*(frame: PFrame, `label`: cstring){.cdecl, dynlib: lib, - importc: "gtk_frame_set_label".} -proc get_label*(frame: PFrame): cstring{.cdecl, dynlib: lib, - importc: "gtk_frame_get_label".} -proc set_label_widget*(frame: PFrame, label_widget: PWidget){.cdecl, - dynlib: lib, importc: "gtk_frame_set_label_widget".} -proc get_label_widget*(frame: PFrame): PWidget{.cdecl, dynlib: lib, - importc: "gtk_frame_get_label_widget".} -proc set_label_align*(frame: PFrame, xalign: gfloat, yalign: gfloat){. - cdecl, dynlib: lib, importc: "gtk_frame_set_label_align".} -proc get_label_align*(frame: PFrame, xalign: Pgfloat, yalign: Pgfloat){. - cdecl, dynlib: lib, importc: "gtk_frame_get_label_align".} -proc set_shadow_type*(frame: PFrame, thetype: TShadowType){.cdecl, - dynlib: lib, importc: "gtk_frame_set_shadow_type".} -proc get_shadow_type*(frame: PFrame): TShadowType{.cdecl, dynlib: lib, - importc: "gtk_frame_get_shadow_type".} -proc TYPE_ASPECT_FRAME*(): GType -proc ASPECT_FRAME*(obj: pointer): PAspectFrame -proc ASPECT_FRAME_CLASS*(klass: pointer): PAspectFrameClass -proc IS_ASPECT_FRAME*(obj: pointer): bool -proc IS_ASPECT_FRAME_CLASS*(klass: pointer): bool -proc ASPECT_FRAME_GET_CLASS*(obj: pointer): PAspectFrameClass -proc aspect_frame_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_aspect_frame_get_type".} -proc aspect_frame_new*(`label`: cstring, xalign: gfloat, yalign: gfloat, - ratio: gfloat, obey_child: gboolean): PAspectFrame{. - cdecl, dynlib: lib, importc: "gtk_aspect_frame_new".} -proc set*(aspect_frame: PAspectFrame, xalign: gfloat, - yalign: gfloat, ratio: gfloat, obey_child: gboolean){. - cdecl, dynlib: lib, importc: "gtk_aspect_frame_set".} -proc TYPE_ARROW*(): GType -proc ARROW*(obj: pointer): PArrow -proc ARROW_CLASS*(klass: pointer): PArrowClass -proc IS_ARROW*(obj: pointer): bool -proc IS_ARROW_CLASS*(klass: pointer): bool -proc ARROW_GET_CLASS*(obj: pointer): PArrowClass -proc arrow_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_arrow_get_type".} -proc arrow_new*(arrow_type: TArrowType, shadow_type: TShadowType): PArrow{. - cdecl, dynlib: lib, importc: "gtk_arrow_new".} -proc set*(arrow: PArrow, arrow_type: TArrowType, shadow_type: TShadowType){. - cdecl, dynlib: lib, importc: "gtk_arrow_set".} -const - bm_TGtkBindingSet_parsed* = 0x0001'i16 - bp_TGtkBindingSet_parsed* = 0'i16 - bm_TGtkBindingEntry_destroyed* = 0x0001'i16 - bp_TGtkBindingEntry_destroyed* = 0'i16 - bm_TGtkBindingEntry_in_emission* = 0x0002'i16 - bp_TGtkBindingEntry_in_emission* = 1'i16 - -proc entry_add*(binding_set: PBindingSet, keyval: guint, - modifiers: gdk2.TModifierType) -proc parsed*(a: PBindingSet): guint -proc set_parsed*(a: PBindingSet, `parsed`: guint) -proc destroyed*(a: PBindingEntry): guint -proc set_destroyed*(a: PBindingEntry, `destroyed`: guint) -proc in_emission*(a: PBindingEntry): guint -proc set_in_emission*(a: PBindingEntry, `in_emission`: guint) -proc binding_set_new*(set_name: cstring): PBindingSet{.cdecl, dynlib: lib, - importc: "gtk_binding_set_new".} -proc binding_set_by_class*(object_class: gpointer): PBindingSet{.cdecl, - dynlib: lib, importc: "gtk_binding_set_by_class".} -proc binding_set_find*(set_name: cstring): PBindingSet{.cdecl, dynlib: lib, - importc: "gtk_binding_set_find".} -proc bindings_activate*(anObject: PObject, keyval: guint, - modifiers: gdk2.TModifierType): gboolean{.cdecl, - dynlib: lib, importc: "gtk_bindings_activate".} -proc activate*(binding_set: PBindingSet, keyval: guint, - modifiers: gdk2.TModifierType, anObject: PObject): gboolean{. - cdecl, dynlib: lib, importc: "gtk_binding_set_activate".} -proc entry_clear*(binding_set: PBindingSet, keyval: guint, - modifiers: gdk2.TModifierType){.cdecl, dynlib: lib, - importc: "gtk_binding_entry_clear".} -proc add_path*(binding_set: PBindingSet, path_type: TPathType, - path_pattern: cstring, priority: TPathPriorityType){. - cdecl, dynlib: lib, importc: "gtk_binding_set_add_path".} -proc entry_remove*(binding_set: PBindingSet, keyval: guint, - modifiers: gdk2.TModifierType){.cdecl, dynlib: lib, - importc: "gtk_binding_entry_remove".} -proc entry_add_signall*(binding_set: PBindingSet, keyval: guint, - modifiers: gdk2.TModifierType, - signal_name: cstring, binding_args: PGSList){. - cdecl, dynlib: lib, importc: "gtk_binding_entry_add_signall".} -proc binding_parse_binding*(scanner: PGScanner): guint{.cdecl, dynlib: lib, - importc: "gtk_binding_parse_binding".} -proc bindings_activate_event*(anObject: PObject, event: gdk2.PEventKey): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_bindings_activate_event".} -proc binding_reset_parsed*(){.cdecl, dynlib: lib, - importc: "_gtk_binding_reset_parsed".} -const - bm_TGtkBox_homogeneous* = 0x0001'i16 - bp_TGtkBox_homogeneous* = 0'i16 - bm_TGtkBoxChild_expand* = 0x0001'i16 - bp_TGtkBoxChild_expand* = 0'i16 - bm_TGtkBoxChild_fill* = 0x0002'i16 - bp_TGtkBoxChild_fill* = 1'i16 - bm_TGtkBoxChild_pack* = 0x0004'i16 - bp_TGtkBoxChild_pack* = 2'i16 - bm_TGtkBoxChild_is_secondary* = 0x0008'i16 - bp_TGtkBoxChild_is_secondary* = 3'i16 - -proc TYPE_BOX*(): GType -proc BOX*(obj: pointer): PBox -proc BOX_CLASS*(klass: pointer): PBoxClass -proc IS_BOX*(obj: pointer): bool -proc IS_BOX_CLASS*(klass: pointer): bool -proc BOX_GET_CLASS*(obj: pointer): PBoxClass -proc homogeneous*(a: PBox): guint -proc set_homogeneous*(a: PBox, `homogeneous`: guint) -proc expand*(a: PBoxChild): guint -proc set_expand*(a: PBoxChild, `expand`: guint) -proc fill*(a: PBoxChild): guint -proc set_fill*(a: PBoxChild, `fill`: guint) -proc pack*(a: PBoxChild): guint -proc set_pack*(a: PBoxChild, `pack`: guint) -proc is_secondary*(a: PBoxChild): guint -proc set_is_secondary*(a: PBoxChild, `is_secondary`: guint) -proc box_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_box_get_type".} -proc pack_start*(box: PBox, child: PWidget, expand: gboolean, - fill: gboolean, padding: guint){.cdecl, dynlib: lib, - importc: "gtk_box_pack_start".} -proc pack_end*(box: PBox, child: PWidget, expand: gboolean, fill: gboolean, - padding: guint){.cdecl, dynlib: lib, - importc: "gtk_box_pack_end".} -proc pack_start_defaults*(box: PBox, widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_box_pack_start_defaults".} -proc pack_end_defaults*(box: PBox, widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_box_pack_end_defaults".} -proc set_homogeneous*(box: PBox, homogeneous: gboolean){.cdecl, dynlib: lib, - importc: "gtk_box_set_homogeneous".} -proc get_homogeneous*(box: PBox): gboolean{.cdecl, dynlib: lib, - importc: "gtk_box_get_homogeneous".} -proc set_spacing*(box: PBox, spacing: gint){.cdecl, dynlib: lib, - importc: "gtk_box_set_spacing".} -proc get_spacing*(box: PBox): gint{.cdecl, dynlib: lib, - importc: "gtk_box_get_spacing".} -proc reorder_child*(box: PBox, child: PWidget, position: gint){.cdecl, - dynlib: lib, importc: "gtk_box_reorder_child".} -proc query_child_packing*(box: PBox, child: PWidget, expand: Pgboolean, - fill: Pgboolean, padding: Pguint, - pack_type: PPackType){.cdecl, dynlib: lib, - importc: "gtk_box_query_child_packing".} -proc set_child_packing*(box: PBox, child: PWidget, expand: gboolean, - fill: gboolean, padding: guint, pack_type: TPackType){. - cdecl, dynlib: lib, importc: "gtk_box_set_child_packing".} -const - BUTTONBOX_DEFAULT* = - (1) - -proc TYPE_BUTTON_BOX*(): GType -proc BUTTON_BOX*(obj: pointer): PButtonBox -proc BUTTON_BOX_CLASS*(klass: pointer): PButtonBoxClass -proc IS_BUTTON_BOX*(obj: pointer): bool -proc IS_BUTTON_BOX_CLASS*(klass: pointer): bool -proc BUTTON_BOX_GET_CLASS*(obj: pointer): PButtonBoxClass -proc button_box_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_button_box_get_type".} -proc get_layout*(widget: PButtonBox): TButtonBoxStyle{.cdecl, - dynlib: lib, importc: "gtk_button_box_get_layout".} -proc set_layout*(widget: PButtonBox, layout_style: TButtonBoxStyle){. - cdecl, dynlib: lib, importc: "gtk_button_box_set_layout".} -proc set_child_secondary*(widget: PButtonBox, child: PWidget, - is_secondary: gboolean){.cdecl, - dynlib: lib, importc: "gtk_button_box_set_child_secondary".} -proc button_box_child_requisition*(widget: PWidget, nvis_children: var int32, - nvis_secondaries: var int32, - width: var int32, height: var int32){.cdecl, - dynlib: lib, importc: "_gtk_button_box_child_requisition".} -const - bm_TGtkButton_constructed* = 0x0001'i16 - bp_TGtkButton_constructed* = 0'i16 - bm_TGtkButton_in_button* = 0x0002'i16 - bp_TGtkButton_in_button* = 1'i16 - bm_TGtkButton_button_down* = 0x0004'i16 - bp_TGtkButton_button_down* = 2'i16 - bm_TGtkButton_relief* = 0x0018'i16 - bp_TGtkButton_relief* = 3'i16 - bm_TGtkButton_use_underline* = 0x0020'i16 - bp_TGtkButton_use_underline* = 5'i16 - bm_TGtkButton_use_stock* = 0x0040'i16 - bp_TGtkButton_use_stock* = 6'i16 - bm_TGtkButton_depressed* = 0x0080'i16 - bp_TGtkButton_depressed* = 7'i16 - bm_TGtkButton_depress_on_activate* = 0x0100'i16 - bp_TGtkButton_depress_on_activate* = 8'i16 - -proc TYPE_BUTTON*(): GType -proc BUTTON*(obj: pointer): PButton -proc BUTTON_CLASS*(klass: pointer): PButtonClass -proc IS_BUTTON*(obj: pointer): bool -proc IS_BUTTON_CLASS*(klass: pointer): bool -proc BUTTON_GET_CLASS*(obj: pointer): PButtonClass -proc constructed*(a: PButton): guint -proc set_constructed*(a: PButton, `constructed`: guint) -proc in_button*(a: PButton): guint -proc set_in_button*(a: PButton, `in_button`: guint) -proc button_down*(a: PButton): guint -proc set_button_down*(a: PButton, `button_down`: guint) -proc relief*(a: PButton): guint -proc use_underline*(a: PButton): guint -proc set_use_underline*(a: PButton, `use_underline`: guint) -proc use_stock*(a: PButton): guint -proc set_use_stock*(a: PButton, `use_stock`: guint) -proc depressed*(a: PButton): guint -proc set_depressed*(a: PButton, `depressed`: guint) -proc depress_on_activate*(a: PButton): guint -proc set_depress_on_activate*(a: PButton, `depress_on_activate`: guint) -proc button_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_button_get_type".} -proc button_new*(): PButton{.cdecl, dynlib: lib, importc: "gtk_button_new".} -proc button_new*(`label`: cstring): PButton{.cdecl, dynlib: lib, - importc: "gtk_button_new_with_label".} -proc button_new_from_stock*(stock_id: cstring): PButton{.cdecl, dynlib: lib, - importc: "gtk_button_new_from_stock".} -proc button_new_with_mnemonic*(`label`: cstring): PButton{.cdecl, dynlib: lib, - importc: "gtk_button_new_with_mnemonic".} -proc pressed*(button: PButton){.cdecl, dynlib: lib, - importc: "gtk_button_pressed".} -proc released*(button: PButton){.cdecl, dynlib: lib, - importc: "gtk_button_released".} -proc clicked*(button: PButton){.cdecl, dynlib: lib, - importc: "gtk_button_clicked".} -proc enter*(button: PButton){.cdecl, dynlib: lib, - importc: "gtk_button_enter".} -proc leave*(button: PButton){.cdecl, dynlib: lib, - importc: "gtk_button_leave".} -proc set_relief*(button: PButton, newstyle: TReliefStyle){.cdecl, - dynlib: lib, importc: "gtk_button_set_relief".} -proc get_relief*(button: PButton): TReliefStyle{.cdecl, dynlib: lib, - importc: "gtk_button_get_relief".} -proc set_label*(button: PButton, `label`: cstring){.cdecl, dynlib: lib, - importc: "gtk_button_set_label".} -proc get_label*(button: PButton): cstring{.cdecl, dynlib: lib, - importc: "gtk_button_get_label".} -proc set_use_underline*(button: PButton, use_underline: gboolean){.cdecl, - dynlib: lib, importc: "gtk_button_set_use_underline".} -proc get_use_underline*(button: PButton): gboolean{.cdecl, dynlib: lib, - importc: "gtk_button_get_use_underline".} -proc set_use_stock*(button: PButton, use_stock: gboolean){.cdecl, - dynlib: lib, importc: "gtk_button_set_use_stock".} -proc get_use_stock*(button: PButton): gboolean{.cdecl, dynlib: lib, - importc: "gtk_button_get_use_stock".} -proc set_depressed*(button: PButton, depressed: gboolean){.cdecl, - dynlib: lib, importc: "_gtk_button_set_depressed".} -proc paint*(button: PButton, area: gdk2.PRectangle, state_type: TStateType, - shadow_type: TShadowType, main_detail: cstring, - default_detail: cstring){.cdecl, dynlib: lib, - importc: "_gtk_button_paint".} -proc set_image*(button: PButton, image: PWidget){.cdecl, dynlib: lib, - importc: "gtk_button_set_image".} -proc get_image*(button: PButton): PWidget{.cdecl, dynlib: lib, - importc: "gtk_button_get_image".} -const - CALENDAR_SHOW_HEADING* = 1 shl 0 - CALENDAR_SHOW_DAY_NAMES* = 1 shl 1 - CALENDAR_NO_MONTH_CHANGE* = 1 shl 2 - CALENDAR_SHOW_WEEK_NUMBERS* = 1 shl 3 - CALENDAR_WEEK_START_MONDAY* = 1 shl 4 - -proc TYPE_CALENDAR*(): GType -proc CALENDAR*(obj: pointer): PCalendar -proc CALENDAR_CLASS*(klass: pointer): PCalendarClass -proc IS_CALENDAR*(obj: pointer): bool -proc IS_CALENDAR_CLASS*(klass: pointer): bool -proc CALENDAR_GET_CLASS*(obj: pointer): PCalendarClass -proc calendar_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_calendar_get_type".} -proc calendar_new*(): PCalendar{.cdecl, dynlib: lib, importc: "gtk_calendar_new".} -proc select_month*(calendar: PCalendar, month: guint, year: guint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_calendar_select_month".} -proc select_day*(calendar: PCalendar, day: guint){.cdecl, dynlib: lib, - importc: "gtk_calendar_select_day".} -proc mark_day*(calendar: PCalendar, day: guint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_calendar_mark_day".} -proc unmark_day*(calendar: PCalendar, day: guint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_calendar_unmark_day".} -proc clear_marks*(calendar: PCalendar){.cdecl, dynlib: lib, - importc: "gtk_calendar_clear_marks".} -proc display_options*(calendar: PCalendar, - flags: TCalendarDisplayOptions){.cdecl, - dynlib: lib, importc: "gtk_calendar_display_options".} -proc get_date*(calendar: PCalendar, year: Pguint, month: Pguint, - day: Pguint){.cdecl, dynlib: lib, - importc: "gtk_calendar_get_date".} -proc freeze*(calendar: PCalendar){.cdecl, dynlib: lib, - importc: "gtk_calendar_freeze".} -proc thaw*(calendar: PCalendar){.cdecl, dynlib: lib, - importc: "gtk_calendar_thaw".} -proc TYPE_CELL_EDITABLE*(): GType -proc CELL_EDITABLE*(obj: pointer): PCellEditable -proc CELL_EDITABLE_CLASS*(obj: pointer): PCellEditableIface -proc IS_CELL_EDITABLE*(obj: pointer): bool -proc CELL_EDITABLE_GET_IFACE*(obj: pointer): PCellEditableIface -proc cell_editable_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_cell_editable_get_type".} -proc start_editing*(cell_editable: PCellEditable, event: gdk2.PEvent){. - cdecl, dynlib: lib, importc: "gtk_cell_editable_start_editing".} -proc editing_done*(cell_editable: PCellEditable){.cdecl, - dynlib: lib, importc: "gtk_cell_editable_editing_done".} -proc remove_widget*(cell_editable: PCellEditable){.cdecl, - dynlib: lib, importc: "gtk_cell_editable_remove_widget".} -const - CELL_RENDERER_SELECTED* = 1 shl 0 - CELL_RENDERER_PRELIT* = 1 shl 1 - CELL_RENDERER_INSENSITIVE* = 1 shl 2 - CELL_RENDERER_SORTED* = 1 shl 3 - -const - bm_TGtkCellRenderer_mode* = 0x0003'i16 - bp_TGtkCellRenderer_mode* = 0'i16 - bm_TGtkCellRenderer_visible* = 0x0004'i16 - bp_TGtkCellRenderer_visible* = 2'i16 - bm_TGtkCellRenderer_is_expander* = 0x0008'i16 - bp_TGtkCellRenderer_is_expander* = 3'i16 - bm_TGtkCellRenderer_is_expanded* = 0x0010'i16 - bp_TGtkCellRenderer_is_expanded* = 4'i16 - bm_TGtkCellRenderer_cell_background_set* = 0x0020'i16 - bp_TGtkCellRenderer_cell_background_set* = 5'i16 - -proc TYPE_CELL_RENDERER*(): GType -proc CELL_RENDERER*(obj: pointer): PCellRenderer -proc CELL_RENDERER_CLASS*(klass: pointer): PCellRendererClass -proc IS_CELL_RENDERER*(obj: pointer): bool -proc IS_CELL_RENDERER_CLASS*(klass: pointer): bool -proc CELL_RENDERER_GET_CLASS*(obj: pointer): PCellRendererClass -proc mode*(a: PCellRenderer): guint -proc set_mode*(a: PCellRenderer, `mode`: guint) -proc visible*(a: PCellRenderer): guint -proc set_visible*(a: PCellRenderer, `visible`: guint) -proc is_expander*(a: PCellRenderer): guint -proc set_is_expander*(a: PCellRenderer, `is_expander`: guint) -proc is_expanded*(a: PCellRenderer): guint -proc set_is_expanded*(a: PCellRenderer, `is_expanded`: guint) -proc cell_background_set*(a: PCellRenderer): guint -proc set_cell_background_set*(a: PCellRenderer, `cell_background_set`: guint) -proc cell_renderer_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_get_type".} -proc get_size*(cell: PCellRenderer, widget: PWidget, - cell_area: gdk2.PRectangle, x_offset: Pgint, - y_offset: Pgint, width: Pgint, height: Pgint){. - cdecl, dynlib: lib, importc: "gtk_cell_renderer_get_size".} -proc render*(cell: PCellRenderer, window: gdk2.PWindow, - widget: PWidget, background_area: gdk2.PRectangle, - cell_area: gdk2.PRectangle, expose_area: gdk2.PRectangle, - flags: TCellRendererState){.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_render".} -proc activate*(cell: PCellRenderer, event: gdk2.PEvent, - widget: PWidget, path: cstring, - background_area: gdk2.PRectangle, - cell_area: gdk2.PRectangle, flags: TCellRendererState): gboolean{. - cdecl, dynlib: lib, importc: "gtk_cell_renderer_activate".} -proc start_editing*(cell: PCellRenderer, event: gdk2.PEvent, - widget: PWidget, path: cstring, - background_area: gdk2.PRectangle, - cell_area: gdk2.PRectangle, - flags: TCellRendererState): PCellEditable{. - cdecl, dynlib: lib, importc: "gtk_cell_renderer_start_editing".} -proc set_fixed_size*(cell: PCellRenderer, width: gint, - height: gint){.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_set_fixed_size".} -proc get_fixed_size*(cell: PCellRenderer, width: Pgint, - height: Pgint){.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_get_fixed_size".} -const - bm_TGtkCellRendererText_strikethrough* = 0x0001'i16 - bp_TGtkCellRendererText_strikethrough* = 0'i16 - bm_TGtkCellRendererText_editable* = 0x0002'i16 - bp_TGtkCellRendererText_editable* = 1'i16 - bm_TGtkCellRendererText_scale_set* = 0x0004'i16 - bp_TGtkCellRendererText_scale_set* = 2'i16 - bm_TGtkCellRendererText_foreground_set* = 0x0008'i16 - bp_TGtkCellRendererText_foreground_set* = 3'i16 - bm_TGtkCellRendererText_background_set* = 0x0010'i16 - bp_TGtkCellRendererText_background_set* = 4'i16 - bm_TGtkCellRendererText_underline_set* = 0x0020'i16 - bp_TGtkCellRendererText_underline_set* = 5'i16 - bm_TGtkCellRendererText_rise_set* = 0x0040'i16 - bp_TGtkCellRendererText_rise_set* = 6'i16 - bm_TGtkCellRendererText_strikethrough_set* = 0x0080'i16 - bp_TGtkCellRendererText_strikethrough_set* = 7'i16 - bm_TGtkCellRendererText_editable_set* = 0x0100'i16 - bp_TGtkCellRendererText_editable_set* = 8'i16 - bm_TGtkCellRendererText_calc_fixed_height* = 0x0200'i16 - bp_TGtkCellRendererText_calc_fixed_height* = 9'i16 - -proc TYPE_CELL_RENDERER_TEXT*(): GType -proc CELL_RENDERER_TEXT*(obj: pointer): PCellRendererText -proc CELL_RENDERER_TEXT_CLASS*(klass: pointer): PCellRendererTextClass -proc IS_CELL_RENDERER_TEXT*(obj: pointer): bool -proc IS_CELL_RENDERER_TEXT_CLASS*(klass: pointer): bool -proc CELL_RENDERER_TEXT_GET_CLASS*(obj: pointer): PCellRendererTextClass -proc strikethrough*(a: PCellRendererText): guint -proc set_strikethrough*(a: PCellRendererText, `strikethrough`: guint) -proc editable*(a: PCellRendererText): guint -proc set_editable*(a: PCellRendererText, `editable`: guint) -proc scale_set*(a: PCellRendererText): guint -proc set_scale_set*(a: PCellRendererText, `scale_set`: guint) -proc foreground_set*(a: PCellRendererText): guint -proc set_foreground_set*(a: PCellRendererText, `foreground_set`: guint) -proc background_set*(a: PCellRendererText): guint -proc set_background_set*(a: PCellRendererText, `background_set`: guint) -proc underline_set*(a: PCellRendererText): guint -proc set_underline_set*(a: PCellRendererText, `underline_set`: guint) -proc rise_set*(a: PCellRendererText): guint -proc set_rise_set*(a: PCellRendererText, `rise_set`: guint) -proc strikethrough_set*(a: PCellRendererText): guint -proc set_strikethrough_set*(a: PCellRendererText, `strikethrough_set`: guint) -proc editable_set*(a: PCellRendererText): guint -proc set_editable_set*(a: PCellRendererText, `editable_set`: guint) -proc calc_fixed_height*(a: PCellRendererText): guint -proc set_calc_fixed_height*(a: PCellRendererText, `calc_fixed_height`: guint) -proc cell_renderer_text_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_text_get_type".} -proc cell_renderer_text_new*(): PCellRenderer{.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_text_new".} -proc text_set_fixed_height_from_font*(renderer: PCellRendererText, - number_of_rows: gint){.cdecl, dynlib: lib, importc: "gtk_cell_renderer_text_set_fixed_height_from_font".} -const - bm_TGtkCellRendererToggle_active* = 0x0001'i16 - bp_TGtkCellRendererToggle_active* = 0'i16 - bm_TGtkCellRendererToggle_activatable* = 0x0002'i16 - bp_TGtkCellRendererToggle_activatable* = 1'i16 - bm_TGtkCellRendererToggle_radio* = 0x0004'i16 - bp_TGtkCellRendererToggle_radio* = 2'i16 - -proc TYPE_CELL_RENDERER_TOGGLE*(): GType -proc CELL_RENDERER_TOGGLE*(obj: pointer): PCellRendererToggle -proc CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): PCellRendererToggleClass -proc IS_CELL_RENDERER_TOGGLE*(obj: pointer): bool -proc IS_CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): bool -proc CELL_RENDERER_TOGGLE_GET_CLASS*(obj: pointer): PCellRendererToggleClass -proc active*(a: PCellRendererToggle): guint -proc set_active*(a: PCellRendererToggle, `active`: guint) -proc activatable*(a: PCellRendererToggle): guint -proc set_activatable*(a: PCellRendererToggle, `activatable`: guint) -proc radio*(a: PCellRendererToggle): guint -proc set_radio*(a: PCellRendererToggle, `radio`: guint) -proc cell_renderer_toggle_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_toggle_get_type".} -proc cell_renderer_toggle_new*(): PCellRenderer{.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_toggle_new".} -proc toggle_get_radio*(toggle: PCellRendererToggle): gboolean{. - cdecl, dynlib: lib, importc: "gtk_cell_renderer_toggle_get_radio".} -proc toggle_set_radio*(toggle: PCellRendererToggle, - radio: gboolean){.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_toggle_set_radio".} -proc toggle_get_active*(toggle: PCellRendererToggle): gboolean{. - cdecl, dynlib: lib, importc: "gtk_cell_renderer_toggle_get_active".} -proc toggle_set_active*(toggle: PCellRendererToggle, - setting: gboolean){.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_toggle_set_active".} -proc TYPE_CELL_RENDERER_PIXBUF*(): GType -proc CELL_RENDERER_PIXBUF*(obj: pointer): PCellRendererPixbuf -proc CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): PCellRendererPixbufClass -proc IS_CELL_RENDERER_PIXBUF*(obj: pointer): bool -proc IS_CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): bool -proc CELL_RENDERER_PIXBUF_GET_CLASS*(obj: pointer): PCellRendererPixbufClass -proc cell_renderer_pixbuf_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_pixbuf_get_type".} -proc cell_renderer_pixbuf_new*(): PCellRenderer{.cdecl, dynlib: lib, - importc: "gtk_cell_renderer_pixbuf_new".} -proc TYPE_ITEM*(): GType -proc ITEM*(obj: pointer): PItem -proc ITEM_CLASS*(klass: pointer): PItemClass -proc IS_ITEM*(obj: pointer): bool -proc IS_ITEM_CLASS*(klass: pointer): bool -proc ITEM_GET_CLASS*(obj: pointer): PItemClass -proc item_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_item_get_type".} -proc select*(item: PItem){.cdecl, dynlib: lib, importc: "gtk_item_select".} -proc deselect*(item: PItem){.cdecl, dynlib: lib, - importc: "gtk_item_deselect".} -proc toggle*(item: PItem){.cdecl, dynlib: lib, importc: "gtk_item_toggle".} -const - bm_TGtkMenuItem_show_submenu_indicator* = 0x0001'i16 - bp_TGtkMenuItem_show_submenu_indicator* = 0'i16 - bm_TGtkMenuItem_submenu_placement* = 0x0002'i16 - bp_TGtkMenuItem_submenu_placement* = 1'i16 - bm_TGtkMenuItem_submenu_direction* = 0x0004'i16 - bp_TGtkMenuItem_submenu_direction* = 2'i16 - bm_TGtkMenuItem_right_justify* = 0x0008'i16 - bp_TGtkMenuItem_right_justify* = 3'i16 - bm_TGtkMenuItem_timer_from_keypress* = 0x0010'i16 - bp_TGtkMenuItem_timer_from_keypress* = 4'i16 - bm_TGtkMenuItemClass_hide_on_activate* = 0x0001'i16 - bp_TGtkMenuItemClass_hide_on_activate* = 0'i16 - -proc TYPE_MENU_ITEM*(): GType -proc MENU_ITEM*(obj: pointer): PMenuItem -proc MENU_ITEM_CLASS*(klass: pointer): PMenuItemClass -proc IS_MENU_ITEM*(obj: pointer): bool -proc IS_MENU_ITEM_CLASS*(klass: pointer): bool -proc MENU_ITEM_GET_CLASS*(obj: pointer): PMenuItemClass -proc show_submenu_indicator*(a: PMenuItem): guint -proc set_show_submenu_indicator*(a: PMenuItem, - `show_submenu_indicator`: guint) -proc submenu_placement*(a: PMenuItem): guint -proc set_submenu_placement*(a: PMenuItem, `submenu_placement`: guint) -proc submenu_direction*(a: PMenuItem): guint -proc set_submenu_direction*(a: PMenuItem, `submenu_direction`: guint) -proc right_justify*(a: PMenuItem): guint -proc set_right_justify*(a: PMenuItem, `right_justify`: guint) -proc timer_from_keypress*(a: PMenuItem): guint -proc set_timer_from_keypress*(a: PMenuItem, `timer_from_keypress`: guint) -proc hide_on_activate*(a: PMenuItemClass): guint -proc set_hide_on_activate*(a: PMenuItemClass, `hide_on_activate`: guint) -proc menu_item_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_menu_item_get_type".} -proc menu_item_new*(): PMenuItem{.cdecl, dynlib: lib, - importc: "gtk_menu_item_new".} -proc menu_item_new*(`label`: cstring): PMenuItem{.cdecl, dynlib: lib, - importc: "gtk_menu_item_new_with_label".} -proc menu_item_new_with_mnemonic*(`label`: cstring): PMenuItem{.cdecl, - dynlib: lib, importc: "gtk_menu_item_new_with_mnemonic".} -proc set_submenu*(menu_item: PMenuItem, submenu: PWidget){.cdecl, - dynlib: lib, importc: "gtk_menu_item_set_submenu".} -proc get_submenu*(menu_item: PMenuItem): PWidget{.cdecl, dynlib: lib, - importc: "gtk_menu_item_get_submenu".} -proc remove_submenu*(menu_item: PMenuItem){.cdecl, dynlib: lib, - importc: "gtk_menu_item_remove_submenu".} -proc select*(menu_item: PMenuItem){.cdecl, dynlib: lib, - importc: "gtk_menu_item_select".} -proc deselect*(menu_item: PMenuItem){.cdecl, dynlib: lib, - importc: "gtk_menu_item_deselect".} -proc activate*(menu_item: PMenuItem){.cdecl, dynlib: lib, - importc: "gtk_menu_item_activate".} -proc toggle_size_request*(menu_item: PMenuItem, requisition: Pgint){. - cdecl, dynlib: lib, importc: "gtk_menu_item_toggle_size_request".} -proc toggle_size_allocate*(menu_item: PMenuItem, allocation: gint){. - cdecl, dynlib: lib, importc: "gtk_menu_item_toggle_size_allocate".} -proc set_right_justified*(menu_item: PMenuItem, - right_justified: gboolean){.cdecl, - dynlib: lib, importc: "gtk_menu_item_set_right_justified".} -proc get_right_justified*(menu_item: PMenuItem): gboolean{.cdecl, - dynlib: lib, importc: "gtk_menu_item_get_right_justified".} -proc set_accel_path*(menu_item: PMenuItem, accel_path: cstring){. - cdecl, dynlib: lib, importc: "gtk_menu_item_set_accel_path".} -proc refresh_accel_path*(menu_item: PMenuItem, prefix: cstring, - accel_group: PAccelGroup, - group_changed: gboolean){.cdecl, dynlib: lib, - importc: "_gtk_menu_item_refresh_accel_path".} -proc menu_item_is_selectable*(menu_item: PWidget): gboolean{.cdecl, dynlib: lib, - importc: "_gtk_menu_item_is_selectable".} -const - bm_TGtkToggleButton_active* = 0x0001'i16 - bp_TGtkToggleButton_active* = 0'i16 - bm_TGtkToggleButton_draw_indicator* = 0x0002'i16 - bp_TGtkToggleButton_draw_indicator* = 1'i16 - bm_TGtkToggleButton_inconsistent* = 0x0004'i16 - bp_TGtkToggleButton_inconsistent* = 2'i16 - -proc TYPE_TOGGLE_BUTTON*(): GType -proc TOGGLE_BUTTON*(obj: pointer): PToggleButton -proc TOGGLE_BUTTON_CLASS*(klass: pointer): PToggleButtonClass -proc IS_TOGGLE_BUTTON*(obj: pointer): bool -proc IS_TOGGLE_BUTTON_CLASS*(klass: pointer): bool -proc TOGGLE_BUTTON_GET_CLASS*(obj: pointer): PToggleButtonClass -proc active*(a: PToggleButton): guint -proc set_active*(a: PToggleButton, `active`: guint) -proc draw_indicator*(a: PToggleButton): guint -proc set_draw_indicator*(a: PToggleButton, `draw_indicator`: guint) -proc inconsistent*(a: PToggleButton): guint -proc set_inconsistent*(a: PToggleButton, `inconsistent`: guint) -proc toggle_button_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_toggle_button_get_type".} -proc toggle_button_new*(): PToggleButton{.cdecl, dynlib: lib, - importc: "gtk_toggle_button_new".} -proc toggle_button_new*(`label`: cstring): PToggleButton{.cdecl, - dynlib: lib, importc: "gtk_toggle_button_new_with_label".} -proc toggle_button_new_with_mnemonic*(`label`: cstring): PToggleButton{.cdecl, - dynlib: lib, importc: "gtk_toggle_button_new_with_mnemonic".} -proc set_mode*(toggle_button: PToggleButton, - draw_indicator: gboolean){.cdecl, dynlib: lib, - importc: "gtk_toggle_button_set_mode".} -proc get_mode*(toggle_button: PToggleButton): gboolean{.cdecl, - dynlib: lib, importc: "gtk_toggle_button_get_mode".} -proc set_active*(toggle_button: PToggleButton, is_active: gboolean){. - cdecl, dynlib: lib, importc: "gtk_toggle_button_set_active".} -proc get_active*(toggle_button: PToggleButton): gboolean{.cdecl, - dynlib: lib, importc: "gtk_toggle_button_get_active".} -proc toggled*(toggle_button: PToggleButton){.cdecl, dynlib: lib, - importc: "gtk_toggle_button_toggled".} -proc set_inconsistent*(toggle_button: PToggleButton, - setting: gboolean){.cdecl, dynlib: lib, - importc: "gtk_toggle_button_set_inconsistent".} -proc get_inconsistent*(toggle_button: PToggleButton): gboolean{. - cdecl, dynlib: lib, importc: "gtk_toggle_button_get_inconsistent".} -proc TYPE_CHECK_BUTTON*(): GType -proc CHECK_BUTTON*(obj: pointer): PCheckButton -proc CHECK_BUTTON_CLASS*(klass: pointer): PCheckButtonClass -proc IS_CHECK_BUTTON*(obj: pointer): bool -proc IS_CHECK_BUTTON_CLASS*(klass: pointer): bool -proc CHECK_BUTTON_GET_CLASS*(obj: pointer): PCheckButtonClass -proc check_button_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_check_button_get_type".} -proc check_button_new*(): PCheckButton{.cdecl, dynlib: lib, - importc: "gtk_check_button_new".} -proc check_button_new*(`label`: cstring): PCheckButton{.cdecl, - dynlib: lib, importc: "gtk_check_button_new_with_label".} -proc check_button_new_with_mnemonic*(`label`: cstring): PCheckButton{.cdecl, - dynlib: lib, importc: "gtk_check_button_new_with_mnemonic".} -proc get_props*(check_button: PCheckButton, indicator_size: Pgint, - indicator_spacing: Pgint){.cdecl, dynlib: lib, - importc: "_gtk_check_button_get_props".} -const - bm_TGtkCheckMenuItem_active* = 0x0001'i16 - bp_TGtkCheckMenuItem_active* = 0'i16 - bm_TGtkCheckMenuItem_always_show_toggle* = 0x0002'i16 - bp_TGtkCheckMenuItem_always_show_toggle* = 1'i16 - bm_TGtkCheckMenuItem_inconsistent* = 0x0004'i16 - bp_TGtkCheckMenuItem_inconsistent* = 2'i16 - -proc TYPE_CHECK_MENU_ITEM*(): GType -proc CHECK_MENU_ITEM*(obj: pointer): PCheckMenuItem -proc CHECK_MENU_ITEM_CLASS*(klass: pointer): PCheckMenuItemClass -proc IS_CHECK_MENU_ITEM*(obj: pointer): bool -proc IS_CHECK_MENU_ITEM_CLASS*(klass: pointer): bool -proc CHECK_MENU_ITEM_GET_CLASS*(obj: pointer): PCheckMenuItemClass -proc active*(a: PCheckMenuItem): guint -proc set_active*(a: PCheckMenuItem, `active`: guint) -proc always_show_toggle*(a: PCheckMenuItem): guint -proc set_always_show_toggle*(a: PCheckMenuItem, `always_show_toggle`: guint) -proc inconsistent*(a: PCheckMenuItem): guint -proc set_inconsistent*(a: PCheckMenuItem, `inconsistent`: guint) -proc check_menu_item_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_check_menu_item_get_type".} -proc check_menu_item_new*(): PCheckMenuItem{.cdecl, dynlib: lib, - importc: "gtk_check_menu_item_new".} -proc check_menu_item_new*(`label`: cstring): PCheckMenuItem{.cdecl, - dynlib: lib, importc: "gtk_check_menu_item_new_with_label".} -proc check_menu_item_new_with_mnemonic*(`label`: cstring): PCheckMenuItem{.cdecl, - dynlib: lib, importc: "gtk_check_menu_item_new_with_mnemonic".} -proc item_set_active*(check_menu_item: PCheckMenuItem, - is_active: gboolean){.cdecl, dynlib: lib, - importc: "gtk_check_menu_item_set_active".} -proc item_get_active*(check_menu_item: PCheckMenuItem): gboolean{. - cdecl, dynlib: lib, importc: "gtk_check_menu_item_get_active".} -proc item_toggled*(check_menu_item: PCheckMenuItem){.cdecl, - dynlib: lib, importc: "gtk_check_menu_item_toggled".} -proc item_set_inconsistent*(check_menu_item: PCheckMenuItem, - setting: gboolean){.cdecl, dynlib: lib, - importc: "gtk_check_menu_item_set_inconsistent".} -proc item_get_inconsistent*(check_menu_item: PCheckMenuItem): gboolean{. - cdecl, dynlib: lib, importc: "gtk_check_menu_item_get_inconsistent".} -proc clipboard_get_for_display*(display: gdk2.PDisplay, selection: gdk2.TAtom): PClipboard{. - cdecl, dynlib: lib, importc: "gtk_clipboard_get_for_display".} -proc get_display*(clipboard: PClipboard): gdk2.PDisplay{.cdecl, - dynlib: lib, importc: "gtk_clipboard_get_display".} -proc set_with_data*(clipboard: PClipboard, targets: PTargetEntry, - n_targets: guint, get_func: TClipboardGetFunc, - clear_func: TClipboardClearFunc, - user_data: gpointer): gboolean{.cdecl, - dynlib: lib, importc: "gtk_clipboard_set_with_data".} -proc set_with_owner*(clipboard: PClipboard, targets: PTargetEntry, - n_targets: guint, get_func: TClipboardGetFunc, - clear_func: TClipboardClearFunc, owner: PGObject): gboolean{. - cdecl, dynlib: lib, importc: "gtk_clipboard_set_with_owner".} -proc get_owner*(clipboard: PClipboard): PGObject{.cdecl, dynlib: lib, - importc: "gtk_clipboard_get_owner".} -proc clear*(clipboard: PClipboard){.cdecl, dynlib: lib, - importc: "gtk_clipboard_clear".} -proc set_text*(clipboard: PClipboard, text: cstring, len: gint){. - cdecl, dynlib: lib, importc: "gtk_clipboard_set_text".} -proc request_contents*(clipboard: PClipboard, target: gdk2.TAtom, - callback: TClipboardReceivedFunc, - user_data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_clipboard_request_contents".} -proc request_text*(clipboard: PClipboard, - callback: TClipboardTextReceivedFunc, - user_data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_clipboard_request_text".} -proc wait_for_contents*(clipboard: PClipboard, target: gdk2.TAtom): PSelectionData{. - cdecl, dynlib: lib, importc: "gtk_clipboard_wait_for_contents".} -proc wait_for_text*(clipboard: PClipboard): cstring{.cdecl, - dynlib: lib, importc: "gtk_clipboard_wait_for_text".} -proc wait_is_text_available*(clipboard: PClipboard): gboolean{.cdecl, - dynlib: lib, importc: "gtk_clipboard_wait_is_text_available".} -const - CLIST_IN_DRAG* = 1 shl 0 - CLIST_ROW_HEIGHT_SET* = 1 shl 1 - CLIST_SHOW_TITLES* = 1 shl 2 - CLIST_ADD_MODE* = 1 shl 4 - CLIST_AUTO_SORT* = 1 shl 5 - CLIST_AUTO_RESIZE_BLOCKED* = 1 shl 6 - CLIST_REORDERABLE* = 1 shl 7 - CLIST_USE_DRAG_ICONS* = 1 shl 8 - CLIST_DRAW_DRAG_LINE* = 1 shl 9 - CLIST_DRAW_DRAG_RECT* = 1 shl 10 - BUTTON_IGNORED* = 0 - BUTTON_SELECTS* = 1 shl 0 - BUTTON_DRAGS* = 1 shl 1 - BUTTON_EXPANDS* = 1 shl 2 - -const - bm_TGtkCListColumn_visible* = 0x0001'i16 - bp_TGtkCListColumn_visible* = 0'i16 - bm_TGtkCListColumn_width_set* = 0x0002'i16 - bp_TGtkCListColumn_width_set* = 1'i16 - bm_TGtkCListColumn_resizeable* = 0x0004'i16 - bp_TGtkCListColumn_resizeable* = 2'i16 - bm_TGtkCListColumn_auto_resize* = 0x0008'i16 - bp_TGtkCListColumn_auto_resize* = 3'i16 - bm_TGtkCListColumn_button_passive* = 0x0010'i16 - bp_TGtkCListColumn_button_passive* = 4'i16 - bm_TGtkCListRow_fg_set* = 0x0001'i16 - bp_TGtkCListRow_fg_set* = 0'i16 - bm_TGtkCListRow_bg_set* = 0x0002'i16 - bp_TGtkCListRow_bg_set* = 1'i16 - bm_TGtkCListRow_selectable* = 0x0004'i16 - bp_TGtkCListRow_selectable* = 2'i16 - -proc TYPE_CLIST*(): GType -proc CLIST*(obj: pointer): PCList -proc CLIST_CLASS*(klass: pointer): PCListClass -proc IS_CLIST*(obj: pointer): bool -proc IS_CLIST_CLASS*(klass: pointer): bool -proc CLIST_GET_CLASS*(obj: pointer): PCListClass -proc CLIST_FLAGS*(clist: pointer): guint16 -proc SET_FLAG*(clist: PCList, flag: guint16) -proc UNSET_FLAG*(clist: PCList, 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: PCListColumn): guint -proc set_visible*(a: PCListColumn, `visible`: guint) -proc width_set*(a: PCListColumn): guint -proc set_width_set*(a: PCListColumn, `width_set`: guint) -proc resizeable*(a: PCListColumn): guint -proc set_resizeable*(a: PCListColumn, `resizeable`: guint) -proc auto_resize*(a: PCListColumn): guint -proc set_auto_resize*(a: PCListColumn, `auto_resize`: guint) -proc button_passive*(a: PCListColumn): guint -proc set_button_passive*(a: PCListColumn, `button_passive`: guint) -proc fg_set*(a: PCListRow): guint -proc set_fg_set*(a: PCListRow, `fg_set`: guint) -proc bg_set*(a: PCListRow): guint -proc set_bg_set*(a: PCListRow, `bg_set`: guint) -proc selectable*(a: PCListRow): guint -proc set_selectable*(a: PCListRow, `selectable`: guint) -proc clist_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_clist_get_type".} -proc clist_new*(columns: gint): PCList{.cdecl, dynlib: lib, - importc: "gtk_clist_new".} -proc set_hadjustment*(clist: PCList, adjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_clist_set_hadjustment".} -proc set_vadjustment*(clist: PCList, adjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_clist_set_vadjustment".} -proc get_hadjustment*(clist: PCList): PAdjustment{.cdecl, dynlib: lib, - importc: "gtk_clist_get_hadjustment".} -proc get_vadjustment*(clist: PCList): PAdjustment{.cdecl, dynlib: lib, - importc: "gtk_clist_get_vadjustment".} -proc set_shadow_type*(clist: PCList, thetype: TShadowType){.cdecl, - dynlib: lib, importc: "gtk_clist_set_shadow_type".} -proc set_selection_mode*(clist: PCList, mode: TSelectionMode){.cdecl, - dynlib: lib, importc: "gtk_clist_set_selection_mode".} -proc set_reorderable*(clist: PCList, reorderable: gboolean){.cdecl, - dynlib: lib, importc: "gtk_clist_set_reorderable".} -proc set_use_drag_icons*(clist: PCList, use_icons: gboolean){.cdecl, - dynlib: lib, importc: "gtk_clist_set_use_drag_icons".} -proc set_button_actions*(clist: PCList, button: guint, - button_actions: guint8){.cdecl, dynlib: lib, - importc: "gtk_clist_set_button_actions".} -proc freeze*(clist: PCList){.cdecl, dynlib: lib, - importc: "gtk_clist_freeze".} -proc thaw*(clist: PCList){.cdecl, dynlib: lib, importc: "gtk_clist_thaw".} -proc column_titles_show*(clist: PCList){.cdecl, dynlib: lib, - importc: "gtk_clist_column_titles_show".} -proc column_titles_hide*(clist: PCList){.cdecl, dynlib: lib, - importc: "gtk_clist_column_titles_hide".} -proc column_title_active*(clist: PCList, column: gint){.cdecl, - dynlib: lib, importc: "gtk_clist_column_title_active".} -proc column_title_passive*(clist: PCList, column: gint){.cdecl, - dynlib: lib, importc: "gtk_clist_column_title_passive".} -proc column_titles_active*(clist: PCList){.cdecl, dynlib: lib, - importc: "gtk_clist_column_titles_active".} -proc column_titles_passive*(clist: PCList){.cdecl, dynlib: lib, - importc: "gtk_clist_column_titles_passive".} -proc set_column_title*(clist: PCList, column: gint, title: cstring){. - cdecl, dynlib: lib, importc: "gtk_clist_set_column_title".} -proc get_column_title*(clist: PCList, column: gint): cstring{.cdecl, - dynlib: lib, importc: "gtk_clist_get_column_title".} -proc set_column_widget*(clist: PCList, column: gint, widget: PWidget){. - cdecl, dynlib: lib, importc: "gtk_clist_set_column_widget".} -proc get_column_widget*(clist: PCList, column: gint): PWidget{.cdecl, - dynlib: lib, importc: "gtk_clist_get_column_widget".} -proc set_column_justification*(clist: PCList, column: gint, - justification: TJustification){.cdecl, - dynlib: lib, importc: "gtk_clist_set_column_justification".} -proc set_column_visibility*(clist: PCList, column: gint, visible: gboolean){. - cdecl, dynlib: lib, importc: "gtk_clist_set_column_visibility".} -proc set_column_resizeable*(clist: PCList, column: gint, - resizeable: gboolean){.cdecl, dynlib: lib, - importc: "gtk_clist_set_column_resizeable".} -proc set_column_auto_resize*(clist: PCList, column: gint, - auto_resize: gboolean){.cdecl, dynlib: lib, - importc: "gtk_clist_set_column_auto_resize".} -proc columns_autosize*(clist: PCList): gint{.cdecl, dynlib: lib, - importc: "gtk_clist_columns_autosize".} -proc optimal_column_width*(clist: PCList, column: gint): gint{.cdecl, - dynlib: lib, importc: "gtk_clist_optimal_column_width".} -proc set_column_width*(clist: PCList, column: gint, width: gint){.cdecl, - dynlib: lib, importc: "gtk_clist_set_column_width".} -proc set_column_min_width*(clist: PCList, column: gint, min_width: gint){. - cdecl, dynlib: lib, importc: "gtk_clist_set_column_min_width".} -proc set_column_max_width*(clist: PCList, column: gint, max_width: gint){. - cdecl, dynlib: lib, importc: "gtk_clist_set_column_max_width".} -proc set_row_height*(clist: PCList, height: guint){.cdecl, dynlib: lib, - importc: "gtk_clist_set_row_height".} -proc moveto*(clist: PCList, row: gint, column: gint, row_align: gfloat, - col_align: gfloat){.cdecl, dynlib: lib, - importc: "gtk_clist_moveto".} -proc row_is_visible*(clist: PCList, row: gint): TVisibility{.cdecl, - dynlib: lib, importc: "gtk_clist_row_is_visible".} -proc get_cell_type*(clist: PCList, row: gint, column: gint): TCellType{. - cdecl, dynlib: lib, importc: "gtk_clist_get_cell_type".} -proc set_text*(clist: PCList, row: gint, column: gint, text: cstring){. - cdecl, dynlib: lib, importc: "gtk_clist_set_text".} -proc get_text*(clist: PCList, row: gint, column: gint, text: PPgchar): gint{. - cdecl, dynlib: lib, importc: "gtk_clist_get_text".} -proc set_pixmap*(clist: PCList, row: gint, column: gint, - pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){.cdecl, - dynlib: lib, importc: "gtk_clist_set_pixmap".} -proc get_pixmap*(clist: PCList, row: gint, column: gint, - pixmap: var gdk2.PPixmap, mask: var gdk2.PBitmap): gint{. - cdecl, dynlib: lib, importc: "gtk_clist_get_pixmap".} -proc set_pixtext*(clist: PCList, row: gint, column: gint, text: cstring, - spacing: guint8, pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){. - cdecl, dynlib: lib, importc: "gtk_clist_set_pixtext".} -proc set_foreground*(clist: PCList, row: gint, color: gdk2.PColor){.cdecl, - dynlib: lib, importc: "gtk_clist_set_foreground".} -proc set_background*(clist: PCList, row: gint, color: gdk2.PColor){.cdecl, - dynlib: lib, importc: "gtk_clist_set_background".} -proc set_cell_style*(clist: PCList, row: gint, column: gint, style: PStyle){. - cdecl, dynlib: lib, importc: "gtk_clist_set_cell_style".} -proc get_cell_style*(clist: PCList, row: gint, column: gint): PStyle{. - cdecl, dynlib: lib, importc: "gtk_clist_get_cell_style".} -proc set_row_style*(clist: PCList, row: gint, style: PStyle){.cdecl, - dynlib: lib, importc: "gtk_clist_set_row_style".} -proc get_row_style*(clist: PCList, row: gint): PStyle{.cdecl, dynlib: lib, - importc: "gtk_clist_get_row_style".} -proc set_shift*(clist: PCList, row: gint, column: gint, vertical: gint, - horizontal: gint){.cdecl, dynlib: lib, - importc: "gtk_clist_set_shift".} -proc set_selectable*(clist: PCList, row: gint, selectable: gboolean){. - cdecl, dynlib: lib, importc: "gtk_clist_set_selectable".} -proc get_selectable*(clist: PCList, row: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_clist_get_selectable".} -proc remove*(clist: PCList, row: gint){.cdecl, dynlib: lib, - importc: "gtk_clist_remove".} -proc set_row_data*(clist: PCList, row: gint, data: gpointer){.cdecl, - dynlib: lib, importc: "gtk_clist_set_row_data".} -proc set_row_data_full*(clist: PCList, row: gint, data: gpointer, - destroy: TDestroyNotify){.cdecl, dynlib: lib, - importc: "gtk_clist_set_row_data_full".} -proc get_row_data*(clist: PCList, row: gint): gpointer{.cdecl, - dynlib: lib, importc: "gtk_clist_get_row_data".} -proc find_row_from_data*(clist: PCList, data: gpointer): gint{.cdecl, - dynlib: lib, importc: "gtk_clist_find_row_from_data".} -proc select_row*(clist: PCList, row: gint, column: gint){.cdecl, - dynlib: lib, importc: "gtk_clist_select_row".} -proc unselect_row*(clist: PCList, row: gint, column: gint){.cdecl, - dynlib: lib, importc: "gtk_clist_unselect_row".} -proc undo_selection*(clist: PCList){.cdecl, dynlib: lib, - importc: "gtk_clist_undo_selection".} -proc clear*(clist: PCList){.cdecl, dynlib: lib, importc: "gtk_clist_clear".} -proc get_selection_info*(clist: PCList, x: gint, y: gint, row: Pgint, - column: Pgint): gint{.cdecl, dynlib: lib, - importc: "gtk_clist_get_selection_info".} -proc select_all*(clist: PCList){.cdecl, dynlib: lib, - importc: "gtk_clist_select_all".} -proc unselect_all*(clist: PCList){.cdecl, dynlib: lib, - importc: "gtk_clist_unselect_all".} -proc swap_rows*(clist: PCList, row1: gint, row2: gint){.cdecl, - dynlib: lib, importc: "gtk_clist_swap_rows".} -proc row_move*(clist: PCList, source_row: gint, dest_row: gint){.cdecl, - dynlib: lib, importc: "gtk_clist_row_move".} -proc set_compare_func*(clist: PCList, cmp_func: TCListCompareFunc){.cdecl, - dynlib: lib, importc: "gtk_clist_set_compare_func".} -proc set_sort_column*(clist: PCList, column: gint){.cdecl, dynlib: lib, - importc: "gtk_clist_set_sort_column".} -proc set_sort_type*(clist: PCList, sort_type: TSortType){.cdecl, - dynlib: lib, importc: "gtk_clist_set_sort_type".} -proc sort*(clist: PCList){.cdecl, dynlib: lib, importc: "gtk_clist_sort".} -proc set_auto_sort*(clist: PCList, auto_sort: gboolean){.cdecl, - dynlib: lib, importc: "gtk_clist_set_auto_sort".} -proc create_cell_layout*(clist: PCList, clist_row: PCListRow, column: gint): pango.PLayout{. - cdecl, dynlib: lib, importc: "_gtk_clist_create_cell_layout".} -const - DIALOG_MODAL* = cint(1 shl 0) - DIALOG_DESTROY_WITH_PARENT* = cint(1 shl 1) - DIALOG_NO_SEPARATOR* = cint(1 shl 2) - RESPONSE_NONE* = - cint(1) - RESPONSE_REJECT* = - cint(2) - RESPONSE_ACCEPT* = - cint(3) - RESPONSE_DELETE_EVENT* = - cint(4) - RESPONSE_OK* = - cint(5) - RESPONSE_CANCEL* = cint(-6) - RESPONSE_CLOSE* = - cint(7) - RESPONSE_YES* = - cint(8) - RESPONSE_NO* = - cint(9) - RESPONSE_APPLY* = - cint(10) - RESPONSE_HELP* = - cint(11) - -proc TYPE_DIALOG*(): GType -proc DIALOG*(obj: pointer): PDialog -proc DIALOG_CLASS*(klass: pointer): PDialogClass -proc IS_DIALOG*(obj: pointer): bool -proc IS_DIALOG_CLASS*(klass: pointer): bool -proc DIALOG_GET_CLASS*(obj: pointer): PDialogClass -proc dialog_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_dialog_get_type".} -proc dialog_new*(): PDialog{.cdecl, dynlib: lib, importc: "gtk_dialog_new".} -proc add_action_widget*(dialog: PDialog, child: PWidget, - response_id: gint){.cdecl, dynlib: lib, - importc: "gtk_dialog_add_action_widget".} -proc add_button*(dialog: PDialog, button_text: cstring, response_id: gint): PWidget{. - cdecl, dynlib: lib, importc: "gtk_dialog_add_button".} -proc set_response_sensitive*(dialog: PDialog, response_id: gint, - setting: gboolean){.cdecl, dynlib: lib, - importc: "gtk_dialog_set_response_sensitive".} -proc set_default_response*(dialog: PDialog, response_id: gint){.cdecl, - dynlib: lib, importc: "gtk_dialog_set_default_response".} -proc set_has_separator*(dialog: PDialog, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_dialog_set_has_separator".} -proc get_has_separator*(dialog: PDialog): gboolean{.cdecl, dynlib: lib, - importc: "gtk_dialog_get_has_separator".} -proc response*(dialog: PDialog, response_id: gint){.cdecl, dynlib: lib, - importc: "gtk_dialog_response".} -proc run*(dialog: PDialog): gint{.cdecl, dynlib: lib, - importc: "gtk_dialog_run".} -proc show_about_dialog*(parent: PWindow, firstPropertyName: cstring){.cdecl, - dynlib: lib, importc: "gtk_show_about_dialog", varargs.} -proc TYPE_VBOX*(): GType -proc VBOX*(obj: pointer): PVBox -proc VBOX_CLASS*(klass: pointer): PVBoxClass -proc IS_VBOX*(obj: pointer): bool -proc IS_VBOX_CLASS*(klass: pointer): bool -proc VBOX_GET_CLASS*(obj: pointer): PVBoxClass -proc vbox_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_vbox_get_type".} -proc vbox_new*(homogeneous: gboolean, spacing: gint): PVBox{.cdecl, dynlib: lib, - importc: "gtk_vbox_new".} -proc TYPE_COLOR_SELECTION*(): GType -proc COLOR_SELECTION*(obj: pointer): PColorSelection -proc COLOR_SELECTION_CLASS*(klass: pointer): PColorSelectionClass -proc IS_COLOR_SELECTION*(obj: pointer): bool -proc IS_COLOR_SELECTION_CLASS*(klass: pointer): bool -proc COLOR_SELECTION_GET_CLASS*(obj: pointer): PColorSelectionClass -proc color_selection_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_color_selection_get_type".} -proc color_selection_new*(): PColorSelection{.cdecl, dynlib: lib, - importc: "gtk_color_selection_new".} -proc get_has_opacity_control*(colorsel: PColorSelection): gboolean{. - cdecl, dynlib: lib, importc: "gtk_color_selection_get_has_opacity_control".} -proc set_has_opacity_control*(colorsel: PColorSelection, - has_opacity: gboolean){.cdecl, dynlib: lib, importc: "gtk_color_selection_set_has_opacity_control".} -proc get_has_palette*(colorsel: PColorSelection): gboolean{. - cdecl, dynlib: lib, importc: "gtk_color_selection_get_has_palette".} -proc set_has_palette*(colorsel: PColorSelection, - has_palette: gboolean){.cdecl, - dynlib: lib, importc: "gtk_color_selection_set_has_palette".} -proc set_current_color*(colorsel: PColorSelection, - color: gdk2.PColor){.cdecl, dynlib: lib, - importc: "gtk_color_selection_set_current_color".} -proc set_current_alpha*(colorsel: PColorSelection, - alpha: guint16){.cdecl, dynlib: lib, - importc: "gtk_color_selection_set_current_alpha".} -proc get_current_color*(colorsel: PColorSelection, - color: gdk2.PColor){.cdecl, dynlib: lib, - importc: "gtk_color_selection_get_current_color".} -proc get_current_alpha*(colorsel: PColorSelection): guint16{. - cdecl, dynlib: lib, importc: "gtk_color_selection_get_current_alpha".} -proc set_previous_color*(colorsel: PColorSelection, - color: gdk2.PColor){.cdecl, dynlib: lib, - importc: "gtk_color_selection_set_previous_color".} -proc set_previous_alpha*(colorsel: PColorSelection, - alpha: guint16){.cdecl, dynlib: lib, - importc: "gtk_color_selection_set_previous_alpha".} -proc get_previous_color*(colorsel: PColorSelection, - color: gdk2.PColor){.cdecl, dynlib: lib, - importc: "gtk_color_selection_get_previous_color".} -proc get_previous_alpha*(colorsel: PColorSelection): guint16{. - cdecl, dynlib: lib, importc: "gtk_color_selection_get_previous_alpha".} -proc is_adjusting*(colorsel: PColorSelection): gboolean{.cdecl, - dynlib: lib, importc: "gtk_color_selection_is_adjusting".} -proc color_selection_palette_from_string*(str: cstring, colors: var gdk2.PColor, - n_colors: Pgint): gboolean{.cdecl, dynlib: lib, importc: "gtk_color_selection_palette_from_string".} -proc color_selection_palette_to_string*(colors: gdk2.PColor, n_colors: gint): cstring{. - cdecl, dynlib: lib, importc: "gtk_color_selection_palette_to_string".} -proc color_selection_set_change_palette_with_screen_hook*( - func: TColorSelectionChangePaletteWithScreenFunc): TColorSelectionChangePaletteWithScreenFunc{. - cdecl, dynlib: lib, - importc: "gtk_color_selection_set_change_palette_with_screen_hook".} -proc TYPE_COLOR_SELECTION_DIALOG*(): GType -proc COLOR_SELECTION_DIALOG*(obj: pointer): PColorSelectionDialog -proc COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): PColorSelectionDialogClass -proc IS_COLOR_SELECTION_DIALOG*(obj: pointer): bool -proc IS_COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): bool -proc COLOR_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PColorSelectionDialogClass -proc color_selection_dialog_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_color_selection_dialog_get_type".} -proc color_selection_dialog_new*(title: cstring): PColorSelectionDialog{.cdecl, - dynlib: lib, importc: "gtk_color_selection_dialog_new".} -proc TYPE_HBOX*(): GType -proc HBOX*(obj: pointer): PHBox -proc HBOX_CLASS*(klass: pointer): PHBoxClass -proc IS_HBOX*(obj: pointer): bool -proc IS_HBOX_CLASS*(klass: pointer): bool -proc HBOX_GET_CLASS*(obj: pointer): PHBoxClass -proc hbox_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_hbox_get_type".} -proc hbox_new*(homogeneous: gboolean, spacing: gint): PHBox{.cdecl, dynlib: lib, - importc: "gtk_hbox_new".} -const - bm_TGtkCombo_value_in_list* = 0x0001'i16 - bp_TGtkCombo_value_in_list* = 0'i16 - bm_TGtkCombo_ok_if_empty* = 0x0002'i16 - bp_TGtkCombo_ok_if_empty* = 1'i16 - bm_TGtkCombo_case_sensitive* = 0x0004'i16 - bp_TGtkCombo_case_sensitive* = 2'i16 - bm_TGtkCombo_use_arrows* = 0x0008'i16 - bp_TGtkCombo_use_arrows* = 3'i16 - bm_TGtkCombo_use_arrows_always* = 0x0010'i16 - bp_TGtkCombo_use_arrows_always* = 4'i16 - -proc TYPE_COMBO*(): GType -proc COMBO*(obj: pointer): PCombo -proc COMBO_CLASS*(klass: pointer): PComboClass -proc IS_COMBO*(obj: pointer): bool -proc IS_COMBO_CLASS*(klass: pointer): bool -proc COMBO_GET_CLASS*(obj: pointer): PComboClass -proc value_in_list*(a: PCombo): guint -proc set_value_in_list*(a: PCombo, `value_in_list`: guint) -proc ok_if_empty*(a: PCombo): guint -proc set_ok_if_empty*(a: PCombo, `ok_if_empty`: guint) -proc case_sensitive*(a: PCombo): guint -proc set_case_sensitive*(a: PCombo, `case_sensitive`: guint) -proc use_arrows*(a: PCombo): guint -proc set_use_arrows*(a: PCombo, `use_arrows`: guint) -proc use_arrows_always*(a: PCombo): guint -proc set_use_arrows_always*(a: PCombo, `use_arrows_always`: guint) -proc combo_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_combo_get_type".} -proc combo_new*(): PCombo{.cdecl, dynlib: lib, importc: "gtk_combo_new".} -proc set_value_in_list*(combo: PCombo, val: gboolean, - ok_if_empty: gboolean){.cdecl, dynlib: lib, - importc: "gtk_combo_set_value_in_list".} -proc set_use_arrows*(combo: PCombo, val: gboolean){.cdecl, dynlib: lib, - importc: "gtk_combo_set_use_arrows".} -proc set_use_arrows_always*(combo: PCombo, val: gboolean){.cdecl, - dynlib: lib, importc: "gtk_combo_set_use_arrows_always".} -proc set_case_sensitive*(combo: PCombo, val: gboolean){.cdecl, - dynlib: lib, importc: "gtk_combo_set_case_sensitive".} -proc set_item_string*(combo: PCombo, item: PItem, item_value: cstring){. - cdecl, dynlib: lib, importc: "gtk_combo_set_item_string".} -proc set_popdown_strings*(combo: PCombo, strings: PGList){.cdecl, - dynlib: lib, importc: "gtk_combo_set_popdown_strings".} -proc disable_activate*(combo: PCombo){.cdecl, dynlib: lib, - importc: "gtk_combo_disable_activate".} -const - bm_TGtkCTree_line_style* = 0x0003'i16 - bp_TGtkCTree_line_style* = 0'i16 - bm_TGtkCTree_expander_style* = 0x000C'i16 - bp_TGtkCTree_expander_style* = 2'i16 - bm_TGtkCTree_show_stub* = 0x0010'i16 - bp_TGtkCTree_show_stub* = 4'i16 - bm_TGtkCTreeRow_is_leaf* = 0x0001'i16 - bp_TGtkCTreeRow_is_leaf* = 0'i16 - bm_TGtkCTreeRow_expanded* = 0x0002'i16 - bp_TGtkCTreeRow_expanded* = 1'i16 - -proc TYPE_CTREE*(): GType -proc CTREE*(obj: pointer): PCTree -proc CTREE_CLASS*(klass: pointer): PCTreeClass -proc IS_CTREE*(obj: pointer): bool -proc IS_CTREE_CLASS*(klass: pointer): bool -proc CTREE_GET_CLASS*(obj: pointer): PCTreeClass -proc CTREE_ROW*(node: TAddress): PCTreeRow -proc CTREE_NODE*(node: TAddress): PCTreeNode -proc CTREE_NODE_NEXT*(nnode: TAddress): PCTreeNode -proc CTREE_NODE_PREV*(pnode: TAddress): PCTreeNode -proc CTREE_FUNC*(fun: TAddress): TCTreeFunc -proc TYPE_CTREE_NODE*(): GType -proc line_style*(a: PCTree): guint -proc set_line_style*(a: PCTree, `line_style`: guint) -proc expander_style*(a: PCTree): guint -proc set_expander_style*(a: PCTree, `expander_style`: guint) -proc show_stub*(a: PCTree): guint -proc set_show_stub*(a: PCTree, `show_stub`: guint) -proc is_leaf*(a: PCTreeRow): guint -proc set_is_leaf*(a: PCTreeRow, `is_leaf`: guint) -proc expanded*(a: PCTreeRow): guint -proc set_expanded*(a: PCTreeRow, `expanded`: guint) -proc ctree_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_ctree_get_type".} -proc ctree_new*(columns: gint, tree_column: gint): PCTree{.cdecl, dynlib: lib, - importc: "gtk_ctree_new".} -proc insert_node*(ctree: PCTree, parent: PCTreeNode, sibling: PCTreeNode, - text: openarray[cstring], spacing: guint8, - pixmap_closed: gdk2.PPixmap, mask_closed: gdk2.PBitmap, - pixmap_opened: gdk2.PPixmap, mask_opened: gdk2.PBitmap, - is_leaf: gboolean, expanded: gboolean): PCTreeNode{. - cdecl, dynlib: lib, importc: "gtk_ctree_insert_node".} -proc remove_node*(ctree: PCTree, node: PCTreeNode){.cdecl, dynlib: lib, - importc: "gtk_ctree_remove_node".} -proc insert_gnode*(ctree: PCTree, parent: PCTreeNode, sibling: PCTreeNode, - gnode: PGNode, fun: TCTreeGNodeFunc, data: gpointer): PCTreeNode{. - cdecl, dynlib: lib, importc: "gtk_ctree_insert_gnode".} -proc export_to_gnode*(ctree: PCTree, parent: PGNode, sibling: PGNode, - node: PCTreeNode, fun: TCTreeGNodeFunc, - data: gpointer): PGNode{.cdecl, dynlib: lib, - importc: "gtk_ctree_export_to_gnode".} -proc post_recursive*(ctree: PCTree, node: PCTreeNode, fun: TCTreeFunc, - data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_ctree_post_recursive".} -proc post_recursive_to_depth*(ctree: PCTree, node: PCTreeNode, - depth: gint, fun: TCTreeFunc, - data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_ctree_post_recursive_to_depth".} -proc pre_recursive*(ctree: PCTree, node: PCTreeNode, fun: TCTreeFunc, - data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_ctree_pre_recursive".} -proc pre_recursive_to_depth*(ctree: PCTree, node: PCTreeNode, - depth: gint, fun: TCTreeFunc, - data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_ctree_pre_recursive_to_depth".} -proc is_viewable*(ctree: PCTree, node: PCTreeNode): gboolean{.cdecl, - dynlib: lib, importc: "gtk_ctree_is_viewable".} -proc last*(ctree: PCTree, node: PCTreeNode): PCTreeNode{.cdecl, - dynlib: lib, importc: "gtk_ctree_last".} -proc find_node_ptr*(ctree: PCTree, ctree_row: PCTreeRow): PCTreeNode{. - cdecl, dynlib: lib, importc: "gtk_ctree_find_node_ptr".} -proc node_nth*(ctree: PCTree, row: guint): PCTreeNode{.cdecl, dynlib: lib, - importc: "gtk_ctree_node_nth".} -proc find*(ctree: PCTree, node: PCTreeNode, child: PCTreeNode): gboolean{. - cdecl, dynlib: lib, importc: "gtk_ctree_find".} -proc is_ancestor*(ctree: PCTree, node: PCTreeNode, child: PCTreeNode): gboolean{. - cdecl, dynlib: lib, importc: "gtk_ctree_is_ancestor".} -proc find_by_row_data*(ctree: PCTree, node: PCTreeNode, data: gpointer): PCTreeNode{. - cdecl, dynlib: lib, importc: "gtk_ctree_find_by_row_data".} -proc find_all_by_row_data*(ctree: PCTree, node: PCTreeNode, - data: gpointer): PGList{.cdecl, dynlib: lib, - importc: "gtk_ctree_find_all_by_row_data".} -proc find_by_row_data_custom*(ctree: PCTree, node: PCTreeNode, - data: gpointer, fun: TGCompareFunc): PCTreeNode{. - cdecl, dynlib: lib, importc: "gtk_ctree_find_by_row_data_custom".} -proc find_all_by_row_data_custom*(ctree: PCTree, node: PCTreeNode, - data: gpointer, fun: TGCompareFunc): PGList{. - cdecl, dynlib: lib, importc: "gtk_ctree_find_all_by_row_data_custom".} -proc is_hot_spot*(ctree: PCTree, x: gint, y: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_ctree_is_hot_spot".} -proc move*(ctree: PCTree, node: PCTreeNode, new_parent: PCTreeNode, - new_sibling: PCTreeNode){.cdecl, dynlib: lib, - importc: "gtk_ctree_move".} -proc expand*(ctree: PCTree, node: PCTreeNode){.cdecl, dynlib: lib, - importc: "gtk_ctree_expand".} -proc expand_recursive*(ctree: PCTree, node: PCTreeNode){.cdecl, - dynlib: lib, importc: "gtk_ctree_expand_recursive".} -proc expand_to_depth*(ctree: PCTree, node: PCTreeNode, depth: gint){. - cdecl, dynlib: lib, importc: "gtk_ctree_expand_to_depth".} -proc collapse*(ctree: PCTree, node: PCTreeNode){.cdecl, dynlib: lib, - importc: "gtk_ctree_collapse".} -proc collapse_recursive*(ctree: PCTree, node: PCTreeNode){.cdecl, - dynlib: lib, importc: "gtk_ctree_collapse_recursive".} -proc collapse_to_depth*(ctree: PCTree, node: PCTreeNode, depth: gint){. - cdecl, dynlib: lib, importc: "gtk_ctree_collapse_to_depth".} -proc toggle_expansion*(ctree: PCTree, node: PCTreeNode){.cdecl, - dynlib: lib, importc: "gtk_ctree_toggle_expansion".} -proc toggle_expansion_recursive*(ctree: PCTree, node: PCTreeNode){.cdecl, - dynlib: lib, importc: "gtk_ctree_toggle_expansion_recursive".} -proc select*(ctree: PCTree, node: PCTreeNode){.cdecl, dynlib: lib, - importc: "gtk_ctree_select".} -proc select_recursive*(ctree: PCTree, node: PCTreeNode){.cdecl, - dynlib: lib, importc: "gtk_ctree_select_recursive".} -proc unselect*(ctree: PCTree, node: PCTreeNode){.cdecl, dynlib: lib, - importc: "gtk_ctree_unselect".} -proc unselect_recursive*(ctree: PCTree, node: PCTreeNode){.cdecl, - dynlib: lib, importc: "gtk_ctree_unselect_recursive".} -proc real_select_recursive*(ctree: PCTree, node: PCTreeNode, state: gint){. - cdecl, dynlib: lib, importc: "gtk_ctree_real_select_recursive".} -proc node_set_text*(ctree: PCTree, node: PCTreeNode, column: gint, - text: cstring){.cdecl, dynlib: lib, - importc: "gtk_ctree_node_set_text".} -proc node_set_pixmap*(ctree: PCTree, node: PCTreeNode, column: gint, - pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){.cdecl, - dynlib: lib, importc: "gtk_ctree_node_set_pixmap".} -proc node_set_pixtext*(ctree: PCTree, node: PCTreeNode, column: gint, - text: cstring, spacing: guint8, pixmap: gdk2.PPixmap, - mask: gdk2.PBitmap){.cdecl, dynlib: lib, - importc: "gtk_ctree_node_set_pixtext".} -proc set_node_info*(ctree: PCTree, node: PCTreeNode, text: cstring, - spacing: guint8, pixmap_closed: gdk2.PPixmap, - mask_closed: gdk2.PBitmap, pixmap_opened: gdk2.PPixmap, - mask_opened: gdk2.PBitmap, is_leaf: gboolean, - expanded: gboolean){.cdecl, dynlib: lib, - importc: "gtk_ctree_set_node_info".} -proc node_set_shift*(ctree: PCTree, node: PCTreeNode, column: gint, - vertical: gint, horizontal: gint){.cdecl, - dynlib: lib, importc: "gtk_ctree_node_set_shift".} -proc node_set_selectable*(ctree: PCTree, node: PCTreeNode, - selectable: gboolean){.cdecl, dynlib: lib, - importc: "gtk_ctree_node_set_selectable".} -proc node_get_selectable*(ctree: PCTree, node: PCTreeNode): gboolean{. - cdecl, dynlib: lib, importc: "gtk_ctree_node_get_selectable".} -proc node_get_cell_type*(ctree: PCTree, node: PCTreeNode, column: gint): TCellType{. - cdecl, dynlib: lib, importc: "gtk_ctree_node_get_cell_type".} -proc node_get_text*(ctree: PCTree, node: PCTreeNode, column: gint, - text: PPgchar): gboolean{.cdecl, dynlib: lib, - importc: "gtk_ctree_node_get_text".} -proc node_set_row_style*(ctree: PCTree, node: PCTreeNode, style: PStyle){. - cdecl, dynlib: lib, importc: "gtk_ctree_node_set_row_style".} -proc node_get_row_style*(ctree: PCTree, node: PCTreeNode): PStyle{.cdecl, - dynlib: lib, importc: "gtk_ctree_node_get_row_style".} -proc node_set_cell_style*(ctree: PCTree, node: PCTreeNode, column: gint, - style: PStyle){.cdecl, dynlib: lib, - importc: "gtk_ctree_node_set_cell_style".} -proc node_get_cell_style*(ctree: PCTree, node: PCTreeNode, column: gint): PStyle{. - cdecl, dynlib: lib, importc: "gtk_ctree_node_get_cell_style".} -proc node_set_foreground*(ctree: PCTree, node: PCTreeNode, - color: gdk2.PColor){.cdecl, dynlib: lib, - importc: "gtk_ctree_node_set_foreground".} -proc node_set_background*(ctree: PCTree, node: PCTreeNode, - color: gdk2.PColor){.cdecl, dynlib: lib, - importc: "gtk_ctree_node_set_background".} -proc node_set_row_data*(ctree: PCTree, node: PCTreeNode, data: gpointer){. - cdecl, dynlib: lib, importc: "gtk_ctree_node_set_row_data".} -proc node_set_row_data_full*(ctree: PCTree, node: PCTreeNode, - data: gpointer, destroy: TDestroyNotify){. - cdecl, dynlib: lib, importc: "gtk_ctree_node_set_row_data_full".} -proc node_get_row_data*(ctree: PCTree, node: PCTreeNode): gpointer{. - cdecl, dynlib: lib, importc: "gtk_ctree_node_get_row_data".} -proc node_moveto*(ctree: PCTree, node: PCTreeNode, column: gint, - row_align: gfloat, col_align: gfloat){.cdecl, - dynlib: lib, importc: "gtk_ctree_node_moveto".} -proc node_is_visible*(ctree: PCTree, node: PCTreeNode): TVisibility{. - cdecl, dynlib: lib, importc: "gtk_ctree_node_is_visible".} -proc set_indent*(ctree: PCTree, indent: gint){.cdecl, dynlib: lib, - importc: "gtk_ctree_set_indent".} -proc set_spacing*(ctree: PCTree, spacing: gint){.cdecl, dynlib: lib, - importc: "gtk_ctree_set_spacing".} -proc set_show_stub*(ctree: PCTree, show_stub: gboolean){.cdecl, - dynlib: lib, importc: "gtk_ctree_set_show_stub".} -proc set_line_style*(ctree: PCTree, line_style: TCTreeLineStyle){.cdecl, - dynlib: lib, importc: "gtk_ctree_set_line_style".} -proc set_expander_style*(ctree: PCTree, - expander_style: TCTreeExpanderStyle){.cdecl, - dynlib: lib, importc: "gtk_ctree_set_expander_style".} -proc set_drag_compare_func*(ctree: PCTree, cmp_func: TCTreeCompareDragFunc){. - cdecl, dynlib: lib, importc: "gtk_ctree_set_drag_compare_func".} -proc sort_node*(ctree: PCTree, node: PCTreeNode){.cdecl, dynlib: lib, - importc: "gtk_ctree_sort_node".} -proc sort_recursive*(ctree: PCTree, node: PCTreeNode){.cdecl, - dynlib: lib, importc: "gtk_ctree_sort_recursive".} -proc ctree_set_reorderable*(t: pointer, r: bool) -proc ctree_node_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_ctree_node_get_type".} -proc TYPE_DRAWING_AREA*(): GType -proc DRAWING_AREA*(obj: pointer): PDrawingArea -proc DRAWING_AREA_CLASS*(klass: pointer): PDrawingAreaClass -proc IS_DRAWING_AREA*(obj: pointer): bool -proc IS_DRAWING_AREA_CLASS*(klass: pointer): bool -proc DRAWING_AREA_GET_CLASS*(obj: pointer): PDrawingAreaClass -proc drawing_area_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_drawing_area_get_type".} -proc drawing_area_new*(): PDrawingArea{.cdecl, dynlib: lib, - importc: "gtk_drawing_area_new".} -proc TYPE_CURVE*(): GType -proc CURVE*(obj: pointer): PCurve -proc CURVE_CLASS*(klass: pointer): PCurveClass -proc IS_CURVE*(obj: pointer): bool -proc IS_CURVE_CLASS*(klass: pointer): bool -proc CURVE_GET_CLASS*(obj: pointer): PCurveClass -proc curve_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_curve_get_type".} -proc curve_new*(): PCurve{.cdecl, dynlib: lib, importc: "gtk_curve_new".} -proc reset*(curve: PCurve){.cdecl, dynlib: lib, importc: "gtk_curve_reset".} -proc set_gamma*(curve: PCurve, gamma: gfloat){.cdecl, dynlib: lib, - importc: "gtk_curve_set_gamma".} -proc set_range*(curve: PCurve, min_x: gfloat, max_x: gfloat, - min_y: gfloat, max_y: gfloat){.cdecl, dynlib: lib, - importc: "gtk_curve_set_range".} -proc set_curve_type*(curve: PCurve, thetype: TCurveType){.cdecl, - dynlib: lib, importc: "gtk_curve_set_curve_type".} -const - DEST_DEFAULT_MOTION* = 1 shl 0 - DEST_DEFAULT_HIGHLIGHT* = 1 shl 1 - DEST_DEFAULT_DROP* = 1 shl 2 - DEST_DEFAULT_ALL* = 0x00000007 - TARGET_SAME_APP* = 1 shl 0 - TARGET_SAME_WIDGET* = 1 shl 1 - -proc drag_get_data*(widget: PWidget, context: gdk2.PDragContext, target: gdk2.TAtom, - time: guint32){.cdecl, dynlib: lib, - importc: "gtk_drag_get_data".} -proc drag_finish*(context: gdk2.PDragContext, success: gboolean, del: gboolean, - time: guint32){.cdecl, dynlib: lib, importc: "gtk_drag_finish".} -proc drag_get_source_widget*(context: gdk2.PDragContext): PWidget{.cdecl, - dynlib: lib, importc: "gtk_drag_get_source_widget".} -proc drag_highlight*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_drag_highlight".} -proc drag_unhighlight*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_drag_unhighlight".} -proc drag_dest_set*(widget: PWidget, flags: TDestDefaults, - targets: PTargetEntry, n_targets: gint, - actions: gdk2.TDragAction){.cdecl, dynlib: lib, - importc: "gtk_drag_dest_set".} -proc drag_dest_set_proxy*(widget: PWidget, proxy_window: gdk2.PWindow, - protocol: gdk2.TDragProtocol, use_coordinates: gboolean){. - cdecl, dynlib: lib, importc: "gtk_drag_dest_set_proxy".} -proc drag_dest_unset*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_drag_dest_unset".} -proc drag_dest_find_target*(widget: PWidget, context: gdk2.PDragContext, - target_list: PTargetList): gdk2.TAtom{.cdecl, - dynlib: lib, importc: "gtk_drag_dest_find_target".} -proc drag_dest_get_target_list*(widget: PWidget): PTargetList{.cdecl, - dynlib: lib, importc: "gtk_drag_dest_get_target_list".} -proc drag_dest_set_target_list*(widget: PWidget, target_list: PTargetList){. - cdecl, dynlib: lib, importc: "gtk_drag_dest_set_target_list".} -proc drag_source_set*(widget: PWidget, start_button_mask: gdk2.TModifierType, - targets: PTargetEntry, n_targets: gint, - actions: gdk2.TDragAction){.cdecl, dynlib: lib, - importc: "gtk_drag_source_set".} -proc drag_source_unset*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_drag_source_unset".} -proc drag_source_set_icon*(widget: PWidget, colormap: gdk2.PColormap, - pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){.cdecl, - dynlib: lib, importc: "gtk_drag_source_set_icon".} -proc drag_source_set_icon_pixbuf*(widget: PWidget, pixbuf: gdk2pixbuf.PPixbuf){.cdecl, - dynlib: lib, importc: "gtk_drag_source_set_icon_pixbuf".} -proc drag_source_set_icon_stock*(widget: PWidget, stock_id: cstring){.cdecl, - dynlib: lib, importc: "gtk_drag_source_set_icon_stock".} -proc drag_begin*(widget: PWidget, targets: PTargetList, actions: gdk2.TDragAction, - button: gint, event: gdk2.PEvent): gdk2.PDragContext{.cdecl, - dynlib: lib, importc: "gtk_drag_begin".} -proc drag_set_icon_widget*(context: gdk2.PDragContext, widget: PWidget, - hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, - importc: "gtk_drag_set_icon_widget".} -proc drag_set_icon_pixmap*(context: gdk2.PDragContext, colormap: gdk2.PColormap, - pixmap: gdk2.PPixmap, mask: gdk2.PBitmap, hot_x: gint, - hot_y: gint){.cdecl, dynlib: lib, - importc: "gtk_drag_set_icon_pixmap".} -proc drag_set_icon_pixbuf*(context: gdk2.PDragContext, pixbuf: gdk2pixbuf.PPixbuf, - hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, - importc: "gtk_drag_set_icon_pixbuf".} -proc drag_set_icon_stock*(context: gdk2.PDragContext, stock_id: cstring, - hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, - importc: "gtk_drag_set_icon_stock".} -proc drag_set_icon_default*(context: gdk2.PDragContext){.cdecl, dynlib: lib, - importc: "gtk_drag_set_icon_default".} -proc drag_check_threshold*(widget: PWidget, start_x: gint, start_y: gint, - current_x: gint, current_y: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_drag_check_threshold".} -proc drag_source_handle_event*(widget: PWidget, event: gdk2.PEvent){.cdecl, - dynlib: lib, importc: "_gtk_drag_source_handle_event".} -proc drag_dest_handle_event*(toplevel: PWidget, event: gdk2.PEvent){.cdecl, - dynlib: lib, importc: "_gtk_drag_dest_handle_event".} -proc TYPE_EDITABLE*(): GType -proc EDITABLE*(obj: pointer): PEditable -proc EDITABLE_CLASS*(vtable: pointer): PEditableClass -proc IS_EDITABLE*(obj: pointer): bool -proc IS_EDITABLE_CLASS*(vtable: pointer): bool -proc EDITABLE_GET_CLASS*(inst: pointer): PEditableClass -proc editable_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_editable_get_type".} -proc select_region*(editable: PEditable, start: gint, theEnd: gint){. - cdecl, dynlib: lib, importc: "gtk_editable_select_region".} -proc get_selection_bounds*(editable: PEditable, start: Pgint, - theEnd: Pgint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_editable_get_selection_bounds".} -proc insert_text*(editable: PEditable, new_text: cstring, - new_text_length: gint, position: Pgint){.cdecl, - dynlib: lib, importc: "gtk_editable_insert_text".} -proc delete_text*(editable: PEditable, start_pos: gint, end_pos: gint){. - cdecl, dynlib: lib, importc: "gtk_editable_delete_text".} -proc get_chars*(editable: PEditable, start_pos: gint, end_pos: gint): cstring{. - cdecl, dynlib: lib, importc: "gtk_editable_get_chars".} -proc cut_clipboard*(editable: PEditable){.cdecl, dynlib: lib, - importc: "gtk_editable_cut_clipboard".} -proc copy_clipboard*(editable: PEditable){.cdecl, dynlib: lib, - importc: "gtk_editable_copy_clipboard".} -proc paste_clipboard*(editable: PEditable){.cdecl, dynlib: lib, - importc: "gtk_editable_paste_clipboard".} -proc delete_selection*(editable: PEditable){.cdecl, dynlib: lib, - importc: "gtk_editable_delete_selection".} -proc set_position*(editable: PEditable, position: gint){.cdecl, - dynlib: lib, importc: "gtk_editable_set_position".} -proc get_position*(editable: PEditable): gint{.cdecl, dynlib: lib, - importc: "gtk_editable_get_position".} -proc set_editable*(editable: PEditable, is_editable: gboolean){.cdecl, - dynlib: lib, importc: "gtk_editable_set_editable".} -proc get_editable*(editable: PEditable): gboolean{.cdecl, dynlib: lib, - importc: "gtk_editable_get_editable".} -proc TYPE_IM_CONTEXT*(): GType -proc IM_CONTEXT*(obj: pointer): PIMContext -proc IM_CONTEXT_CLASS*(klass: pointer): PIMContextClass -proc IS_IM_CONTEXT*(obj: pointer): bool -proc IS_IM_CONTEXT_CLASS*(klass: pointer): bool -proc IM_CONTEXT_GET_CLASS*(obj: pointer): PIMContextClass -proc im_context_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_im_context_get_type".} -proc set_client_window*(context: PIMContext, window: gdk2.PWindow){. - cdecl, dynlib: lib, importc: "gtk_im_context_set_client_window".} -proc filter_keypress*(context: PIMContext, event: gdk2.PEventKey): gboolean{. - cdecl, dynlib: lib, importc: "gtk_im_context_filter_keypress".} -proc focus_in*(context: PIMContext){.cdecl, dynlib: lib, - importc: "gtk_im_context_focus_in".} -proc focus_out*(context: PIMContext){.cdecl, dynlib: lib, - importc: "gtk_im_context_focus_out".} -proc reset*(context: PIMContext){.cdecl, dynlib: lib, - importc: "gtk_im_context_reset".} -proc set_cursor_location*(context: PIMContext, area: gdk2.PRectangle){. - cdecl, dynlib: lib, importc: "gtk_im_context_set_cursor_location".} -proc set_use_preedit*(context: PIMContext, use_preedit: gboolean){. - cdecl, dynlib: lib, importc: "gtk_im_context_set_use_preedit".} -proc set_surrounding*(context: PIMContext, text: cstring, len: gint, - cursor_index: gint){.cdecl, dynlib: lib, - importc: "gtk_im_context_set_surrounding".} -proc get_surrounding*(context: PIMContext, text: PPgchar, - cursor_index: Pgint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_im_context_get_surrounding".} -proc delete_surrounding*(context: PIMContext, offset: gint, - n_chars: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_im_context_delete_surrounding".} -const - bm_TGtkMenuShell_active* = 0x0001'i16 - bp_TGtkMenuShell_active* = 0'i16 - bm_TGtkMenuShell_have_grab* = 0x0002'i16 - bp_TGtkMenuShell_have_grab* = 1'i16 - bm_TGtkMenuShell_have_xgrab* = 0x0004'i16 - bp_TGtkMenuShell_have_xgrab* = 2'i16 - bm_TGtkMenuShell_ignore_leave* = 0x0008'i16 - bp_TGtkMenuShell_ignore_leave* = 3'i16 - bm_TGtkMenuShell_menu_flag* = 0x0010'i16 - bp_TGtkMenuShell_menu_flag* = 4'i16 - bm_TGtkMenuShell_ignore_enter* = 0x0020'i16 - bp_TGtkMenuShell_ignore_enter* = 5'i16 - bm_TGtkMenuShellClass_submenu_placement* = 0x0001'i16 - bp_TGtkMenuShellClass_submenu_placement* = 0'i16 - -proc TYPE_MENU_SHELL*(): GType -proc MENU_SHELL*(obj: pointer): PMenuShell -proc MENU_SHELL_CLASS*(klass: pointer): PMenuShellClass -proc IS_MENU_SHELL*(obj: pointer): bool -proc IS_MENU_SHELL_CLASS*(klass: pointer): bool -proc MENU_SHELL_GET_CLASS*(obj: pointer): PMenuShellClass -proc active*(a: PMenuShell): guint -proc set_active*(a: PMenuShell, `active`: guint) -proc have_grab*(a: PMenuShell): guint -proc set_have_grab*(a: PMenuShell, `have_grab`: guint) -proc have_xgrab*(a: PMenuShell): guint -proc set_have_xgrab*(a: PMenuShell, `have_xgrab`: guint) -proc ignore_leave*(a: PMenuShell): guint -proc set_ignore_leave*(a: PMenuShell, `ignore_leave`: guint) -proc menu_flag*(a: PMenuShell): guint -proc set_menu_flag*(a: PMenuShell, `menu_flag`: guint) -proc ignore_enter*(a: PMenuShell): guint -proc set_ignore_enter*(a: PMenuShell, `ignore_enter`: guint) -proc submenu_placement*(a: PMenuShellClass): guint -proc set_submenu_placement*(a: PMenuShellClass, `submenu_placement`: guint) -proc menu_shell_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_menu_shell_get_type".} -proc append*(menu_shell: PMenuShell, child: PWidget){.cdecl, - dynlib: lib, importc: "gtk_menu_shell_append".} -proc prepend*(menu_shell: PMenuShell, child: PWidget){.cdecl, - dynlib: lib, importc: "gtk_menu_shell_prepend".} -proc insert*(menu_shell: PMenuShell, child: PWidget, position: gint){. - cdecl, dynlib: lib, importc: "gtk_menu_shell_insert".} -proc deactivate*(menu_shell: PMenuShell){.cdecl, dynlib: lib, - importc: "gtk_menu_shell_deactivate".} -proc select_item*(menu_shell: PMenuShell, menu_item: PWidget){.cdecl, - dynlib: lib, importc: "gtk_menu_shell_select_item".} -proc deselect*(menu_shell: PMenuShell){.cdecl, dynlib: lib, - importc: "gtk_menu_shell_deselect".} -proc activate_item*(menu_shell: PMenuShell, menu_item: PWidget, - force_deactivate: gboolean){.cdecl, dynlib: lib, - importc: "gtk_menu_shell_activate_item".} -proc select_first*(menu_shell: PMenuShell){.cdecl, dynlib: lib, - importc: "_gtk_menu_shell_select_first".} -proc activate*(menu_shell: PMenuShell){.cdecl, dynlib: lib, - importc: "_gtk_menu_shell_activate".} -const - bm_TGtkMenu_needs_destruction_ref_count* = 0x0001'i16 - bp_TGtkMenu_needs_destruction_ref_count* = 0'i16 - bm_TGtkMenu_torn_off* = 0x0002'i16 - bp_TGtkMenu_torn_off* = 1'i16 - bm_TGtkMenu_tearoff_active* = 0x0004'i16 - bp_TGtkMenu_tearoff_active* = 2'i16 - bm_TGtkMenu_scroll_fast* = 0x0008'i16 - bp_TGtkMenu_scroll_fast* = 3'i16 - bm_TGtkMenu_upper_arrow_visible* = 0x0010'i16 - bp_TGtkMenu_upper_arrow_visible* = 4'i16 - bm_TGtkMenu_lower_arrow_visible* = 0x0020'i16 - bp_TGtkMenu_lower_arrow_visible* = 5'i16 - bm_TGtkMenu_upper_arrow_prelight* = 0x0040'i16 - bp_TGtkMenu_upper_arrow_prelight* = 6'i16 - bm_TGtkMenu_lower_arrow_prelight* = 0x0080'i16 - bp_TGtkMenu_lower_arrow_prelight* = 7'i16 - -proc TYPE_MENU*(): GType -proc MENU*(obj: pointer): PMenu -proc MENU_CLASS*(klass: pointer): PMenuClass -proc IS_MENU*(obj: pointer): bool -proc IS_MENU_CLASS*(klass: pointer): bool -proc MENU_GET_CLASS*(obj: pointer): PMenuClass -proc needs_destruction_ref_count*(a: PMenu): guint -proc set_needs_destruction_ref_count*(a: PMenu, - `needs_destruction_ref_count`: guint) -proc torn_off*(a: PMenu): guint -proc set_torn_off*(a: PMenu, `torn_off`: guint) -proc tearoff_active*(a: PMenu): guint -proc set_tearoff_active*(a: PMenu, `tearoff_active`: guint) -proc scroll_fast*(a: PMenu): guint -proc set_scroll_fast*(a: PMenu, `scroll_fast`: guint) -proc upper_arrow_visible*(a: PMenu): guint -proc set_upper_arrow_visible*(a: PMenu, `upper_arrow_visible`: guint) -proc lower_arrow_visible*(a: PMenu): guint -proc set_lower_arrow_visible*(a: PMenu, `lower_arrow_visible`: guint) -proc upper_arrow_prelight*(a: PMenu): guint -proc set_upper_arrow_prelight*(a: PMenu, `upper_arrow_prelight`: guint) -proc lower_arrow_prelight*(a: PMenu): guint -proc set_lower_arrow_prelight*(a: PMenu, `lower_arrow_prelight`: guint) -proc menu_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_menu_get_type".} -proc menu_new*(): PMenu{.cdecl, dynlib: lib, importc: "gtk_menu_new".} -proc popup*(menu: PMenu, parent_menu_shell: PWidget, - parent_menu_item: PWidget, fun: TMenuPositionFunc, - data: gpointer, button: guint, activate_time: guint32){.cdecl, - dynlib: lib, importc: "gtk_menu_popup".} -proc reposition*(menu: PMenu){.cdecl, dynlib: lib, - importc: "gtk_menu_reposition".} -proc popdown*(menu: PMenu){.cdecl, dynlib: lib, importc: "gtk_menu_popdown".} -proc get_active*(menu: PMenu): PWidget{.cdecl, dynlib: lib, - importc: "gtk_menu_get_active".} -proc set_active*(menu: PMenu, index: guint){.cdecl, dynlib: lib, - importc: "gtk_menu_set_active".} -proc set_accel_group*(menu: PMenu, accel_group: PAccelGroup){.cdecl, - dynlib: lib, importc: "gtk_menu_set_accel_group".} -proc get_accel_group*(menu: PMenu): PAccelGroup{.cdecl, dynlib: lib, - importc: "gtk_menu_get_accel_group".} -proc set_accel_path*(menu: PMenu, accel_path: cstring){.cdecl, dynlib: lib, - importc: "gtk_menu_set_accel_path".} -proc attach_to_widget*(menu: PMenu, attach_widget: PWidget, - detacher: TMenuDetachFunc){.cdecl, dynlib: lib, - importc: "gtk_menu_attach_to_widget".} -proc detach*(menu: PMenu){.cdecl, dynlib: lib, importc: "gtk_menu_detach".} -proc get_attach_widget*(menu: PMenu): PWidget{.cdecl, dynlib: lib, - importc: "gtk_menu_get_attach_widget".} -proc set_tearoff_state*(menu: PMenu, torn_off: gboolean){.cdecl, - dynlib: lib, importc: "gtk_menu_set_tearoff_state".} -proc get_tearoff_state*(menu: PMenu): gboolean{.cdecl, dynlib: lib, - importc: "gtk_menu_get_tearoff_state".} -proc set_title*(menu: PMenu, title: cstring){.cdecl, dynlib: lib, - importc: "gtk_menu_set_title".} -proc get_title*(menu: PMenu): cstring{.cdecl, dynlib: lib, - importc: "gtk_menu_get_title".} -proc reorder_child*(menu: PMenu, child: PWidget, position: gint){.cdecl, - dynlib: lib, importc: "gtk_menu_reorder_child".} -proc set_screen*(menu: PMenu, screen: gdk2.PScreen){.cdecl, dynlib: lib, - importc: "gtk_menu_set_screen".} -const - bm_TGtkEntry_editable* = 0x0001'i16 - bp_TGtkEntry_editable* = 0'i16 - bm_TGtkEntry_visible* = 0x0002'i16 - bp_TGtkEntry_visible* = 1'i16 - bm_TGtkEntry_overwrite_mode* = 0x0004'i16 - bp_TGtkEntry_overwrite_mode* = 2'i16 - bm_TGtkEntry_in_drag* = 0x0008'i16 - bp_TGtkEntry_in_drag* = 3'i16 - bm_TGtkEntry_cache_includes_preedit* = 0x0001'i16 - bp_TGtkEntry_cache_includes_preedit* = 0'i16 - bm_TGtkEntry_need_im_reset* = 0x0002'i16 - bp_TGtkEntry_need_im_reset* = 1'i16 - bm_TGtkEntry_has_frame* = 0x0004'i16 - bp_TGtkEntry_has_frame* = 2'i16 - bm_TGtkEntry_activates_default* = 0x0008'i16 - bp_TGtkEntry_activates_default* = 3'i16 - bm_TGtkEntry_cursor_visible* = 0x0010'i16 - bp_TGtkEntry_cursor_visible* = 4'i16 - bm_TGtkEntry_in_click* = 0x0020'i16 - bp_TGtkEntry_in_click* = 5'i16 - bm_TGtkEntry_is_cell_renderer* = 0x0040'i16 - bp_TGtkEntry_is_cell_renderer* = 6'i16 - bm_TGtkEntry_editing_canceled* = 0x0080'i16 - bp_TGtkEntry_editing_canceled* = 7'i16 - bm_TGtkEntry_mouse_cursor_obscured* = 0x0100'i16 - bp_TGtkEntry_mouse_cursor_obscured* = 8'i16 - -proc TYPE_ENTRY*(): GType -proc ENTRY*(obj: pointer): PEntry -proc ENTRY_CLASS*(klass: pointer): PEntryClass -proc IS_ENTRY*(obj: pointer): bool -proc IS_ENTRY_CLASS*(klass: pointer): bool -proc ENTRY_GET_CLASS*(obj: pointer): PEntryClass -proc editable*(a: PEntry): guint -proc set_editable*(a: PEntry, `editable`: guint) -proc visible*(a: PEntry): guint -proc set_visible*(a: PEntry, `visible`: guint) -proc overwrite_mode*(a: PEntry): guint -proc set_overwrite_mode*(a: PEntry, `overwrite_mode`: guint) -proc in_drag*(a: PEntry): guint -proc set_in_drag*(a: PEntry, `in_drag`: guint) -proc cache_includes_preedit*(a: PEntry): guint -proc set_cache_includes_preedit*(a: PEntry, `cache_includes_preedit`: guint) -proc need_im_reset*(a: PEntry): guint -proc set_need_im_reset*(a: PEntry, `need_im_reset`: guint) -proc has_frame*(a: PEntry): guint -proc set_has_frame*(a: PEntry, `has_frame`: guint) -proc activates_default*(a: PEntry): guint -proc set_activates_default*(a: PEntry, `activates_default`: guint) -proc cursor_visible*(a: PEntry): guint -proc set_cursor_visible*(a: PEntry, `cursor_visible`: guint) -proc in_click*(a: PEntry): guint -proc set_in_click*(a: PEntry, `in_click`: guint) -proc is_cell_renderer*(a: PEntry): guint -proc set_is_cell_renderer*(a: PEntry, `is_cell_renderer`: guint) -proc editing_canceled*(a: PEntry): guint -proc set_editing_canceled*(a: PEntry, `editing_canceled`: guint) -proc mouse_cursor_obscured*(a: PEntry): guint -proc set_mouse_cursor_obscured*(a: PEntry, `mouse_cursor_obscured`: guint) -proc entry_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_entry_get_type".} -proc entry_new*(): PEntry{.cdecl, dynlib: lib, importc: "gtk_entry_new".} -proc set_visibility*(entry: PEntry, visible: gboolean){.cdecl, - dynlib: lib, importc: "gtk_entry_set_visibility".} -proc get_visibility*(entry: PEntry): gboolean{.cdecl, dynlib: lib, - importc: "gtk_entry_get_visibility".} -proc set_invisible_char*(entry: PEntry, ch: gunichar){.cdecl, dynlib: lib, - importc: "gtk_entry_set_invisible_char".} -proc get_invisible_char*(entry: PEntry): gunichar{.cdecl, dynlib: lib, - importc: "gtk_entry_get_invisible_char".} -proc set_has_frame*(entry: PEntry, setting: gboolean){.cdecl, dynlib: lib, - importc: "gtk_entry_set_has_frame".} -proc get_has_frame*(entry: PEntry): gboolean{.cdecl, dynlib: lib, - importc: "gtk_entry_get_has_frame".} -proc set_max_length*(entry: PEntry, max: gint){.cdecl, dynlib: lib, - importc: "gtk_entry_set_max_length".} -proc get_max_length*(entry: PEntry): gint{.cdecl, dynlib: lib, - importc: "gtk_entry_get_max_length".} -proc set_activates_default*(entry: PEntry, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_entry_set_activates_default".} -proc get_activates_default*(entry: PEntry): gboolean{.cdecl, dynlib: lib, - importc: "gtk_entry_get_activates_default".} -proc set_width_chars*(entry: PEntry, n_chars: gint){.cdecl, dynlib: lib, - importc: "gtk_entry_set_width_chars".} -proc get_width_chars*(entry: PEntry): gint{.cdecl, dynlib: lib, - importc: "gtk_entry_get_width_chars".} -proc set_text*(entry: PEntry, text: cstring){.cdecl, dynlib: lib, - importc: "gtk_entry_set_text".} -proc get_text*(entry: PEntry): cstring{.cdecl, dynlib: lib, - importc: "gtk_entry_get_text".} -proc get_layout*(entry: PEntry): pango.PLayout{.cdecl, dynlib: lib, - importc: "gtk_entry_get_layout".} -proc get_layout_offsets*(entry: PEntry, x: Pgint, y: Pgint){.cdecl, - dynlib: lib, importc: "gtk_entry_get_layout_offsets".} -const - ANCHOR_CENTER* = 0 - ANCHOR_NORTH* = 1 - ANCHOR_NORTH_WEST* = 2 - ANCHOR_NORTH_EAST* = 3 - ANCHOR_SOUTH* = 4 - ANCHOR_SOUTH_WEST* = 5 - ANCHOR_SOUTH_EAST* = 6 - ANCHOR_WEST* = 7 - ANCHOR_EAST* = 8 - ANCHOR_N* = ANCHOR_NORTH - ANCHOR_NW* = ANCHOR_NORTH_WEST - ANCHOR_NE* = ANCHOR_NORTH_EAST - ANCHOR_S* = ANCHOR_SOUTH - ANCHOR_SW* = ANCHOR_SOUTH_WEST - ANCHOR_SE* = ANCHOR_SOUTH_EAST - ANCHOR_W* = ANCHOR_WEST - ANCHOR_E* = ANCHOR_EAST - ARROW_UP* = 0 - ARROW_DOWN* = 1 - ARROW_LEFT* = 2 - ARROW_RIGHT* = 3 - constEXPAND* = 1 shl 0 - constSHRINK* = 1 shl 1 - constFILL* = 1 shl 2 - BUTTONBOX_DEFAULT_STYLE* = 0 - BUTTONBOX_SPREAD* = 1 - BUTTONBOX_EDGE* = 2 - BUTTONBOX_START* = 3 - BUTTONBOX_END* = 4 - CURVE_TYPE_LINEAR* = 0 - CURVE_TYPE_SPLINE* = 1 - CURVE_TYPE_FREE* = 2 - DELETE_CHARS* = 0 - DELETE_WORD_ENDS* = 1 - DELETE_WORDS* = 2 - DELETE_DISPLAY_LINES* = 3 - DELETE_DISPLAY_LINE_ENDS* = 4 - DELETE_PARAGRAPH_ENDS* = 5 - DELETE_PARAGRAPHS* = 6 - DELETE_WHITESPACE* = 7 - DIR_TAB_FORWARD* = 0 - DIR_TAB_BACKWARD* = 1 - DIR_UP* = 2 - DIR_DOWN* = 3 - DIR_LEFT* = 4 - DIR_RIGHT* = 5 - EXPANDER_COLLAPSED* = 0 - EXPANDER_SEMI_COLLAPSED* = 1 - EXPANDER_SEMI_EXPANDED* = 2 - EXPANDER_EXPANDED* = 3 - ICON_SIZE_INVALID* = 0 - ICON_SIZE_MENU* = 1 - ICON_SIZE_SMALL_TOOLBAR* = 2 - ICON_SIZE_LARGE_TOOLBAR* = 3 - ICON_SIZE_BUTTON* = 4 - ICON_SIZE_DND* = 5 - ICON_SIZE_DIALOG* = 6 - TEXT_DIR_NONE* = 0 - TEXT_DIR_LTR* = 1 - TEXT_DIR_RTL* = 2 - JUSTIFY_LEFT* = 0 - JUSTIFY_RIGHT* = 1 - JUSTIFY_CENTER* = 2 - JUSTIFY_FILL* = 3 - MENU_DIR_PARENT* = 0 - MENU_DIR_CHILD* = 1 - MENU_DIR_NEXT* = 2 - MENU_DIR_PREV* = 3 - PIXELS* = 0 - INCHES* = 1 - CENTIMETERS* = 2 - MOVEMENT_LOGICAL_POSITIONS* = 0 - MOVEMENT_VISUAL_POSITIONS* = 1 - MOVEMENT_WORDS* = 2 - MOVEMENT_DISPLAY_LINES* = 3 - MOVEMENT_DISPLAY_LINE_ENDS* = 4 - MOVEMENT_PARAGRAPHS* = 5 - MOVEMENT_PARAGRAPH_ENDS* = 6 - MOVEMENT_PAGES* = 7 - MOVEMENT_BUFFER_ENDS* = 8 - ORIENTATION_HORIZONTAL* = 0 - ORIENTATION_VERTICAL* = 1 - CORNER_TOP_LEFT* = 0 - CORNER_BOTTOM_LEFT* = 1 - CORNER_TOP_RIGHT* = 2 - CORNER_BOTTOM_RIGHT* = 3 - constPACK_START* = 0 - constPACK_END* = 1 - PATH_PRIO_LOWEST* = 0 - PATH_PRIO_GTK* = 4 - PATH_PRIO_APPLICATION* = 8 - PATH_PRIO_THEME* = 10 - PATH_PRIO_RC* = 12 - PATH_PRIO_HIGHEST* = 15 - PATH_WIDGET* = 0 - PATH_WIDGET_CLASS* = 1 - PATH_CLASS* = 2 - POLICY_ALWAYS* = 0 - POLICY_AUTOMATIC* = 1 - POLICY_NEVER* = 2 - POS_LEFT* = 0 - POS_RIGHT* = 1 - POS_TOP* = 2 - POS_BOTTOM* = 3 - PREVIEW_COLOR* = 0 - PREVIEW_GRAYSCALE* = 1 - RELIEF_NORMAL* = 0 - RELIEF_HALF* = 1 - RELIEF_NONE* = 2 - RESIZE_PARENT* = 0 - RESIZE_QUEUE* = 1 - RESIZE_IMMEDIATE* = 2 - SCROLL_NONE* = 0 - SCROLL_JUMP* = 1 - SCROLL_STEP_BACKWARD* = 2 - SCROLL_STEP_FORWARD* = 3 - SCROLL_PAGE_BACKWARD* = 4 - SCROLL_PAGE_FORWARD* = 5 - SCROLL_STEP_UP* = 6 - SCROLL_STEP_DOWN* = 7 - SCROLL_PAGE_UP* = 8 - SCROLL_PAGE_DOWN* = 9 - SCROLL_STEP_LEFT* = 10 - SCROLL_STEP_RIGHT* = 11 - SCROLL_PAGE_LEFT* = 12 - SCROLL_PAGE_RIGHT* = 13 - SCROLL_START* = 14 - SCROLL_END* = 15 - SELECTION_NONE* = 0 - SELECTION_SINGLE* = 1 - SELECTION_BROWSE* = 2 - SELECTION_MULTIPLE* = 3 - SELECTION_EXTENDED* = SELECTION_MULTIPLE - SHADOW_NONE* = 0 - SHADOW_IN* = 1 - SHADOW_OUT* = 2 - SHADOW_ETCHED_IN* = 3 - SHADOW_ETCHED_OUT* = 4 - STATE_NORMAL* = 0 - STATE_ACTIVE* = 1 - STATE_PRELIGHT* = 2 - STATE_SELECTED* = 3 - STATE_INSENSITIVE* = 4 - DIRECTION_LEFT* = 0 - DIRECTION_RIGHT* = 1 - TOP_BOTTOM* = 0 - LEFT_RIGHT* = 1 - TOOLBAR_ICONS* = 0 - TOOLBAR_TEXT* = 1 - TOOLBAR_BOTH* = 2 - TOOLBAR_BOTH_HORIZ* = 3 - UPDATE_CONTINUOUS* = 0 - UPDATE_DISCONTINUOUS* = 1 - UPDATE_DELAYED* = 2 - VISIBILITY_NONE* = 0 - VISIBILITY_PARTIAL* = 1 - VISIBILITY_FULL* = 2 - WIN_POS_NONE* = 0 - WIN_POS_CENTER* = 1 - WIN_POS_MOUSE* = 2 - WIN_POS_CENTER_ALWAYS* = 3 - WIN_POS_CENTER_ON_PARENT* = 4 - WINDOW_TOPLEVEL* = 0 - WINDOW_POPUP* = 1 - WRAP_NONE* = 0 - WRAP_CHAR* = 1 - WRAP_WORD* = 2 - SORT_ASCENDING* = 0 - SORT_DESCENDING* = 1 - -proc TYPE_EVENT_BOX*(): GType -proc EVENT_BOX*(obj: pointer): PEventBox -proc EVENT_BOX_CLASS*(klass: pointer): PEventBoxClass -proc IS_EVENT_BOX*(obj: pointer): bool -proc IS_EVENT_BOX_CLASS*(klass: pointer): bool -proc EVENT_BOX_GET_CLASS*(obj: pointer): PEventBoxClass -proc event_box_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_event_box_get_type".} -proc event_box_new*(): PEventBox{.cdecl, dynlib: lib, - 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: lib, importc: "fnmatch".} -proc TYPE_FILE_SELECTION*(): GType -proc FILE_SELECTION*(obj: pointer): PFileSelection -proc FILE_SELECTION_CLASS*(klass: pointer): PFileSelectionClass -proc IS_FILE_SELECTION*(obj: pointer): bool -proc IS_FILE_SELECTION_CLASS*(klass: pointer): bool -proc FILE_SELECTION_GET_CLASS*(obj: pointer): PFileSelectionClass -proc file_selection_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_file_selection_get_type".} -proc file_selection_new*(title: cstring): PFileSelection{.cdecl, dynlib: lib, - importc: "gtk_file_selection_new".} -proc set_filename*(filesel: PFileSelection, filename: cstring){. - cdecl, dynlib: lib, importc: "gtk_file_selection_set_filename".} -proc get_filename*(filesel: PFileSelection): cstring{.cdecl, - dynlib: lib, importc: "gtk_file_selection_get_filename".} -proc complete*(filesel: PFileSelection, pattern: cstring){.cdecl, - dynlib: lib, importc: "gtk_file_selection_complete".} -proc show_fileop_buttons*(filesel: PFileSelection){.cdecl, - dynlib: lib, importc: "gtk_file_selection_show_fileop_buttons".} -proc hide_fileop_buttons*(filesel: PFileSelection){.cdecl, - dynlib: lib, importc: "gtk_file_selection_hide_fileop_buttons".} -proc get_selections*(filesel: PFileSelection): PPgchar{.cdecl, - dynlib: lib, importc: "gtk_file_selection_get_selections".} -proc set_select_multiple*(filesel: PFileSelection, - select_multiple: gboolean){.cdecl, dynlib: lib, importc: "gtk_file_selection_set_select_multiple".} -proc get_select_multiple*(filesel: PFileSelection): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_selection_get_select_multiple".} -proc TYPE_FIXED*(): GType -proc FIXED*(obj: pointer): PFixed -proc FIXED_CLASS*(klass: pointer): PFixedClass -proc IS_FIXED*(obj: pointer): bool -proc IS_FIXED_CLASS*(klass: pointer): bool -proc FIXED_GET_CLASS*(obj: pointer): PFixedClass -proc fixed_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_fixed_get_type".} -proc fixed_new*(): PFixed{.cdecl, dynlib: lib, importc: "gtk_fixed_new".} -proc put*(fixed: PFixed, widget: PWidget, x: gint, y: gint){.cdecl, - dynlib: lib, importc: "gtk_fixed_put".} -proc move*(fixed: PFixed, widget: PWidget, x: gint, y: gint){.cdecl, - dynlib: lib, importc: "gtk_fixed_move".} -proc set_has_window*(fixed: PFixed, has_window: gboolean){.cdecl, - dynlib: lib, importc: "gtk_fixed_set_has_window".} -proc get_has_window*(fixed: PFixed): gboolean{.cdecl, dynlib: lib, - importc: "gtk_fixed_get_has_window".} -proc TYPE_FONT_SELECTION*(): GType -proc FONT_SELECTION*(obj: pointer): PFontSelection -proc FONT_SELECTION_CLASS*(klass: pointer): PFontSelectionClass -proc IS_FONT_SELECTION*(obj: pointer): bool -proc IS_FONT_SELECTION_CLASS*(klass: pointer): bool -proc FONT_SELECTION_GET_CLASS*(obj: pointer): PFontSelectionClass -proc TYPE_FONT_SELECTION_DIALOG*(): GType -proc FONT_SELECTION_DIALOG*(obj: pointer): PFontSelectionDialog -proc FONT_SELECTION_DIALOG_CLASS*(klass: pointer): PFontSelectionDialogClass -proc IS_FONT_SELECTION_DIALOG*(obj: pointer): bool -proc IS_FONT_SELECTION_DIALOG_CLASS*(klass: pointer): bool -proc FONT_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PFontSelectionDialogClass -proc font_selection_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_font_selection_get_type".} -proc font_selection_new*(): PFontSelection{.cdecl, dynlib: lib, - importc: "gtk_font_selection_new".} -proc get_font_name*(fontsel: PFontSelection): cstring{.cdecl, - dynlib: lib, importc: "gtk_font_selection_get_font_name".} -proc set_font_name*(fontsel: PFontSelection, fontname: cstring): gboolean{. - cdecl, dynlib: lib, importc: "gtk_font_selection_set_font_name".} -proc get_preview_text*(fontsel: PFontSelection): cstring{.cdecl, - dynlib: lib, importc: "gtk_font_selection_get_preview_text".} -proc set_preview_text*(fontsel: PFontSelection, text: cstring){. - cdecl, dynlib: lib, importc: "gtk_font_selection_set_preview_text".} -proc font_selection_dialog_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_font_selection_dialog_get_type".} -proc font_selection_dialog_new*(title: cstring): PFontSelectionDialog{.cdecl, - dynlib: lib, importc: "gtk_font_selection_dialog_new".} -proc dialog_get_font_name*(fsd: PFontSelectionDialog): cstring{. - cdecl, dynlib: lib, importc: "gtk_font_selection_dialog_get_font_name".} -proc dialog_set_font_name*(fsd: PFontSelectionDialog, - fontname: cstring): gboolean{.cdecl, dynlib: lib, importc: "gtk_font_selection_dialog_set_font_name".} -proc dialog_get_preview_text*(fsd: PFontSelectionDialog): cstring{. - cdecl, dynlib: lib, importc: "gtk_font_selection_dialog_get_preview_text".} -proc dialog_set_preview_text*(fsd: PFontSelectionDialog, - text: cstring){.cdecl, dynlib: lib, - importc: "gtk_font_selection_dialog_set_preview_text".} -proc TYPE_GAMMA_CURVE*(): GType -proc GAMMA_CURVE*(obj: pointer): PGammaCurve -proc GAMMA_CURVE_CLASS*(klass: pointer): PGammaCurveClass -proc IS_GAMMA_CURVE*(obj: pointer): bool -proc IS_GAMMA_CURVE_CLASS*(klass: pointer): bool -proc GAMMA_CURVE_GET_CLASS*(obj: pointer): PGammaCurveClass -proc gamma_curve_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_gamma_curve_get_type".} -proc gamma_curve_new*(): PGammaCurve{.cdecl, dynlib: lib, - importc: "gtk_gamma_curve_new".} -proc gc_get*(depth: gint, colormap: gdk2.PColormap, values: gdk2.PGCValues, - values_mask: gdk2.TGCValuesMask): gdk2.PGC{.cdecl, dynlib: lib, - importc: "gtk_gc_get".} -proc gc_release*(gc: gdk2.PGC){.cdecl, dynlib: lib, importc: "gtk_gc_release".} -const - bm_TGtkHandleBox_handle_position* = 0x0003'i16 - bp_TGtkHandleBox_handle_position* = 0'i16 - bm_TGtkHandleBox_float_window_mapped* = 0x0004'i16 - bp_TGtkHandleBox_float_window_mapped* = 2'i16 - bm_TGtkHandleBox_child_detached* = 0x0008'i16 - bp_TGtkHandleBox_child_detached* = 3'i16 - bm_TGtkHandleBox_in_drag* = 0x0010'i16 - bp_TGtkHandleBox_in_drag* = 4'i16 - bm_TGtkHandleBox_shrink_on_detach* = 0x0020'i16 - bp_TGtkHandleBox_shrink_on_detach* = 5'i16 - bm_TGtkHandleBox_snap_edge* = 0x01C0'i16 - bp_TGtkHandleBox_snap_edge* = 6'i16 - -proc TYPE_HANDLE_BOX*(): GType -proc HANDLE_BOX*(obj: pointer): PHandleBox -proc HANDLE_BOX_CLASS*(klass: pointer): PHandleBoxClass -proc IS_HANDLE_BOX*(obj: pointer): bool -proc IS_HANDLE_BOX_CLASS*(klass: pointer): bool -proc HANDLE_BOX_GET_CLASS*(obj: pointer): PHandleBoxClass -proc handle_position*(a: PHandleBox): guint -proc set_handle_position*(a: PHandleBox, `handle_position`: guint) -proc float_window_mapped*(a: PHandleBox): guint -proc set_float_window_mapped*(a: PHandleBox, `float_window_mapped`: guint) -proc child_detached*(a: PHandleBox): guint -proc set_child_detached*(a: PHandleBox, `child_detached`: guint) -proc in_drag*(a: PHandleBox): guint -proc set_in_drag*(a: PHandleBox, `in_drag`: guint) -proc shrink_on_detach*(a: PHandleBox): guint -proc set_shrink_on_detach*(a: PHandleBox, `shrink_on_detach`: guint) -proc snap_edge*(a: PHandleBox): gint -proc set_snap_edge*(a: PHandleBox, `snap_edge`: gint) -proc handle_box_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_handle_box_get_type".} -proc handle_box_new*(): PHandleBox{.cdecl, dynlib: lib, - importc: "gtk_handle_box_new".} -proc set_shadow_type*(handle_box: PHandleBox, thetype: TShadowType){. - cdecl, dynlib: lib, importc: "gtk_handle_box_set_shadow_type".} -proc get_shadow_type*(handle_box: PHandleBox): TShadowType{.cdecl, - dynlib: lib, importc: "gtk_handle_box_get_shadow_type".} -proc set_handle_position*(handle_box: PHandleBox, - position: TPositionType){.cdecl, - dynlib: lib, importc: "gtk_handle_box_set_handle_position".} -proc get_handle_position*(handle_box: PHandleBox): TPositionType{. - cdecl, dynlib: lib, importc: "gtk_handle_box_get_handle_position".} -proc set_snap_edge*(handle_box: PHandleBox, edge: TPositionType){. - cdecl, dynlib: lib, importc: "gtk_handle_box_set_snap_edge".} -proc get_snap_edge*(handle_box: PHandleBox): TPositionType{.cdecl, - dynlib: lib, importc: "gtk_handle_box_get_snap_edge".} -const - bm_TGtkPaned_position_set* = 0x0001'i16 - bp_TGtkPaned_position_set* = 0'i16 - bm_TGtkPaned_in_drag* = 0x0002'i16 - bp_TGtkPaned_in_drag* = 1'i16 - bm_TGtkPaned_child1_shrink* = 0x0004'i16 - bp_TGtkPaned_child1_shrink* = 2'i16 - bm_TGtkPaned_child1_resize* = 0x0008'i16 - bp_TGtkPaned_child1_resize* = 3'i16 - bm_TGtkPaned_child2_shrink* = 0x0010'i16 - bp_TGtkPaned_child2_shrink* = 4'i16 - bm_TGtkPaned_child2_resize* = 0x0020'i16 - bp_TGtkPaned_child2_resize* = 5'i16 - bm_TGtkPaned_orientation* = 0x0040'i16 - bp_TGtkPaned_orientation* = 6'i16 - bm_TGtkPaned_in_recursion* = 0x0080'i16 - bp_TGtkPaned_in_recursion* = 7'i16 - bm_TGtkPaned_handle_prelit* = 0x0100'i16 - bp_TGtkPaned_handle_prelit* = 8'i16 - -proc TYPE_PANED*(): GType -proc PANED*(obj: pointer): PPaned -proc PANED_CLASS*(klass: pointer): PPanedClass -proc IS_PANED*(obj: pointer): bool -proc IS_PANED_CLASS*(klass: pointer): bool -proc PANED_GET_CLASS*(obj: pointer): PPanedClass -proc position_set*(a: PPaned): guint -proc set_position_set*(a: PPaned, `position_set`: guint) -proc in_drag*(a: PPaned): guint -proc set_in_drag*(a: PPaned, `in_drag`: guint) -proc child1_shrink*(a: PPaned): guint -proc set_child1_shrink*(a: PPaned, `child1_shrink`: guint) -proc child1_resize*(a: PPaned): guint -proc set_child1_resize*(a: PPaned, `child1_resize`: guint) -proc child2_shrink*(a: PPaned): guint -proc set_child2_shrink*(a: PPaned, `child2_shrink`: guint) -proc child2_resize*(a: PPaned): guint -proc set_child2_resize*(a: PPaned, `child2_resize`: guint) -proc orientation*(a: PPaned): guint -proc set_orientation*(a: PPaned, `orientation`: guint) -proc in_recursion*(a: PPaned): guint -proc set_in_recursion*(a: PPaned, `in_recursion`: guint) -proc handle_prelit*(a: PPaned): guint -proc set_handle_prelit*(a: PPaned, `handle_prelit`: guint) -proc paned_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_paned_get_type".} -proc add1*(paned: PPaned, child: PWidget){.cdecl, dynlib: lib, - importc: "gtk_paned_add1".} -proc add2*(paned: PPaned, child: PWidget){.cdecl, dynlib: lib, - importc: "gtk_paned_add2".} -proc pack1*(paned: PPaned, child: PWidget, resize: gboolean, - shrink: gboolean){.cdecl, dynlib: lib, - importc: "gtk_paned_pack1".} -proc pack2*(paned: PPaned, child: PWidget, resize: gboolean, - shrink: gboolean){.cdecl, dynlib: lib, - importc: "gtk_paned_pack2".} -proc get_position*(paned: PPaned): gint{.cdecl, dynlib: lib, - importc: "gtk_paned_get_position".} -proc set_position*(paned: PPaned, position: gint){.cdecl, dynlib: lib, - importc: "gtk_paned_set_position".} -proc compute_position*(paned: PPaned, allocation: gint, child1_req: gint, - child2_req: gint){.cdecl, dynlib: lib, - importc: "gtk_paned_compute_position".} -proc TYPE_HBUTTON_BOX*(): GType -proc HBUTTON_BOX*(obj: pointer): PHButtonBox -proc HBUTTON_BOX_CLASS*(klass: pointer): PHButtonBoxClass -proc IS_HBUTTON_BOX*(obj: pointer): bool -proc IS_HBUTTON_BOX_CLASS*(klass: pointer): bool -proc HBUTTON_BOX_GET_CLASS*(obj: pointer): PHButtonBoxClass -proc hbutton_box_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_hbutton_box_get_type".} -proc hbutton_box_new*(): PHButtonBox{.cdecl, dynlib: lib, - importc: "gtk_hbutton_box_new".} -proc TYPE_HPANED*(): GType -proc HPANED*(obj: pointer): PHPaned -proc HPANED_CLASS*(klass: pointer): PHPanedClass -proc IS_HPANED*(obj: pointer): bool -proc IS_HPANED_CLASS*(klass: pointer): bool -proc HPANED_GET_CLASS*(obj: pointer): PHPanedClass -proc hpaned_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_hpaned_get_type".} -proc hpaned_new*(): PHPaned{.cdecl, dynlib: lib, importc: "gtk_hpaned_new".} -proc TYPE_RULER*(): GType -proc RULER*(obj: pointer): PRuler -proc RULER_CLASS*(klass: pointer): PRulerClass -proc IS_RULER*(obj: pointer): bool -proc IS_RULER_CLASS*(klass: pointer): bool -proc RULER_GET_CLASS*(obj: pointer): PRulerClass -proc ruler_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_ruler_get_type".} -proc set_metric*(ruler: PRuler, metric: TMetricType){.cdecl, dynlib: lib, - importc: "gtk_ruler_set_metric".} -proc set_range*(ruler: PRuler, lower: gdouble, upper: gdouble, - position: gdouble, max_size: gdouble){.cdecl, dynlib: lib, - importc: "gtk_ruler_set_range".} -proc draw_ticks*(ruler: PRuler){.cdecl, dynlib: lib, - importc: "gtk_ruler_draw_ticks".} -proc draw_pos*(ruler: PRuler){.cdecl, dynlib: lib, - importc: "gtk_ruler_draw_pos".} -proc get_metric*(ruler: PRuler): TMetricType{.cdecl, dynlib: lib, - importc: "gtk_ruler_get_metric".} -proc get_range*(ruler: PRuler, lower: Pgdouble, upper: Pgdouble, - position: Pgdouble, max_size: Pgdouble){.cdecl, - dynlib: lib, importc: "gtk_ruler_get_range".} -proc TYPE_HRULER*(): GType -proc HRULER*(obj: pointer): PHRuler -proc HRULER_CLASS*(klass: pointer): PHRulerClass -proc IS_HRULER*(obj: pointer): bool -proc IS_HRULER_CLASS*(klass: pointer): bool -proc HRULER_GET_CLASS*(obj: pointer): PHRulerClass -proc hruler_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_hruler_get_type".} -proc hruler_new*(): PHRuler{.cdecl, dynlib: lib, importc: "gtk_hruler_new".} -proc TYPE_SETTINGS*(): GType -proc SETTINGS*(obj: pointer): PSettings -proc SETTINGS_CLASS*(klass: pointer): PSettingsClass -proc IS_SETTINGS*(obj: pointer): bool -proc IS_SETTINGS_CLASS*(klass: pointer): bool -proc SETTINGS_GET_CLASS*(obj: pointer): PSettingsClass -proc settings_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_settings_get_type".} -proc settings_get_for_screen*(screen: gdk2.PScreen): PSettings{.cdecl, - dynlib: lib, importc: "gtk_settings_get_for_screen".} -proc settings_install_property*(pspec: PGParamSpec){.cdecl, dynlib: lib, - importc: "gtk_settings_install_property".} -proc settings_install_property_parser*(pspec: PGParamSpec, - parser: TRcPropertyParser){.cdecl, - dynlib: lib, importc: "gtk_settings_install_property_parser".} -proc rc_property_parse_color*(pspec: PGParamSpec, gstring: PGString, - property_value: PGValue): gboolean{.cdecl, - dynlib: lib, importc: "gtk_rc_property_parse_color".} -proc rc_property_parse_enum*(pspec: PGParamSpec, gstring: PGString, - property_value: PGValue): gboolean{.cdecl, - dynlib: lib, importc: "gtk_rc_property_parse_enum".} -proc rc_property_parse_flags*(pspec: PGParamSpec, gstring: PGString, - property_value: PGValue): gboolean{.cdecl, - dynlib: lib, importc: "gtk_rc_property_parse_flags".} -proc rc_property_parse_requisition*(pspec: PGParamSpec, gstring: PGString, - property_value: PGValue): gboolean{.cdecl, - dynlib: lib, importc: "gtk_rc_property_parse_requisition".} -proc rc_property_parse_border*(pspec: PGParamSpec, gstring: PGString, - property_value: PGValue): gboolean{.cdecl, - dynlib: lib, importc: "gtk_rc_property_parse_border".} -proc set_property_value*(settings: PSettings, name: cstring, - svalue: PSettingsValue){.cdecl, dynlib: lib, - importc: "gtk_settings_set_property_value".} -proc set_string_property*(settings: PSettings, name: cstring, - v_string: cstring, origin: cstring){.cdecl, - dynlib: lib, importc: "gtk_settings_set_string_property".} -proc set_long_property*(settings: PSettings, name: cstring, - v_long: glong, origin: cstring){.cdecl, - dynlib: lib, importc: "gtk_settings_set_long_property".} -proc set_double_property*(settings: PSettings, name: cstring, - v_double: gdouble, origin: cstring){.cdecl, - dynlib: lib, importc: "gtk_settings_set_double_property".} -proc settings_handle_event*(event: gdk2.PEventSetting){.cdecl, dynlib: lib, - importc: "_gtk_settings_handle_event".} -proc rc_property_parser_from_type*(thetype: GType): TRcPropertyParser{.cdecl, - dynlib: lib, importc: "_gtk_rc_property_parser_from_type".} -proc settings_parse_convert*(parser: TRcPropertyParser, src_value: PGValue, - pspec: PGParamSpec, dest_value: PGValue): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_settings_parse_convert".} -const - RC_FG* = 1 shl 0 - RC_BG* = 1 shl 1 - RC_TEXT* = 1 shl 2 - RC_BASE* = 1 shl 3 - bm_TGtkRcStyle_engine_specified* = 0x0001'i16 - bp_TGtkRcStyle_engine_specified* = 0'i16 - -proc TYPE_RC_STYLE*(): GType -proc RC_STYLE_get*(anObject: pointer): PRcStyle -proc RC_STYLE_CLASS*(klass: pointer): PRcStyleClass -proc IS_RC_STYLE*(anObject: pointer): bool -proc IS_RC_STYLE_CLASS*(klass: pointer): bool -proc RC_STYLE_GET_CLASS*(obj: pointer): PRcStyleClass -proc engine_specified*(a: PRcStyle): guint -proc set_engine_specified*(a: PRcStyle, `engine_specified`: guint) -proc rc_init*(){.cdecl, dynlib: lib, importc: "_gtk_rc_init".} -proc rc_add_default_file*(filename: cstring){.cdecl, dynlib: lib, - importc: "gtk_rc_add_default_file".} -proc rc_set_default_files*(filenames: PPgchar){.cdecl, dynlib: lib, - importc: "gtk_rc_set_default_files".} -proc rc_get_default_files*(): PPgchar{.cdecl, dynlib: lib, - importc: "gtk_rc_get_default_files".} -proc rc_get_style*(widget: PWidget): PStyle{.cdecl, dynlib: lib, - importc: "gtk_rc_get_style".} -proc rc_get_style_by_paths*(settings: PSettings, widget_path: cstring, - class_path: cstring, thetype: GType): PStyle{.cdecl, - dynlib: lib, importc: "gtk_rc_get_style_by_paths".} -proc rc_reparse_all_for_settings*(settings: PSettings, force_load: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gtk_rc_reparse_all_for_settings".} -proc rc_find_pixmap_in_path*(settings: PSettings, scanner: PGScanner, - pixmap_file: cstring): cstring{.cdecl, dynlib: lib, - importc: "gtk_rc_find_pixmap_in_path".} -proc rc_parse*(filename: cstring){.cdecl, dynlib: lib, importc: "gtk_rc_parse".} -proc rc_parse_string*(rc_string: cstring){.cdecl, dynlib: lib, - importc: "gtk_rc_parse_string".} -proc rc_reparse_all*(): gboolean{.cdecl, dynlib: lib, - importc: "gtk_rc_reparse_all".} -proc rc_style_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_rc_style_get_type".} -proc rc_style_new*(): PRcStyle{.cdecl, dynlib: lib, importc: "gtk_rc_style_new".} -proc copy*(orig: PRcStyle): PRcStyle{.cdecl, dynlib: lib, - importc: "gtk_rc_style_copy".} -proc reference*(rc_style: PRcStyle){.cdecl, dynlib: lib, - importc: "gtk_rc_style_ref".} -proc unref*(rc_style: PRcStyle){.cdecl, dynlib: lib, - importc: "gtk_rc_style_unref".} -proc rc_find_module_in_path*(module_file: cstring): cstring{.cdecl, dynlib: lib, - importc: "gtk_rc_find_module_in_path".} -proc rc_get_theme_dir*(): cstring{.cdecl, dynlib: lib, - importc: "gtk_rc_get_theme_dir".} -proc rc_get_module_dir*(): cstring{.cdecl, dynlib: lib, - importc: "gtk_rc_get_module_dir".} -proc rc_get_im_module_path*(): cstring{.cdecl, dynlib: lib, - importc: "gtk_rc_get_im_module_path".} -proc rc_get_im_module_file*(): cstring{.cdecl, dynlib: lib, - importc: "gtk_rc_get_im_module_file".} -proc rc_scanner_new*(): PGScanner{.cdecl, dynlib: lib, - importc: "gtk_rc_scanner_new".} -proc rc_parse_color*(scanner: PGScanner, color: gdk2.PColor): guint{.cdecl, - dynlib: lib, importc: "gtk_rc_parse_color".} -proc rc_parse_state*(scanner: PGScanner, state: PStateType): guint{.cdecl, - dynlib: lib, importc: "gtk_rc_parse_state".} -proc rc_parse_priority*(scanner: PGScanner, priority: PPathPriorityType): guint{. - cdecl, dynlib: lib, importc: "gtk_rc_parse_priority".} -proc lookup_rc_property*(rc_style: PRcStyle, type_name: TGQuark, - property_name: TGQuark): PRcProperty{.cdecl, - dynlib: lib, importc: "_gtk_rc_style_lookup_rc_property".} -proc rc_context_get_default_font_name*(settings: PSettings): cstring{.cdecl, - dynlib: lib, importc: "_gtk_rc_context_get_default_font_name".} -proc TYPE_STYLE*(): GType -proc STYLE*(anObject: pointer): PStyle -proc STYLE_CLASS*(klass: pointer): PStyleClass -proc IS_STYLE*(anObject: pointer): bool -proc IS_STYLE_CLASS*(klass: pointer): bool -proc STYLE_GET_CLASS*(obj: pointer): PStyleClass -proc TYPE_BORDER*(): GType -proc STYLE_ATTACHED*(style: pointer): bool -proc style_get_type*(): GType{.cdecl, dynlib: lib, importc: "gtk_style_get_type".} -proc style_new*(): PStyle{.cdecl, dynlib: lib, importc: "gtk_style_new".} -proc copy*(style: PStyle): PStyle{.cdecl, dynlib: lib, - importc: "gtk_style_copy".} -proc attach*(style: PStyle, window: gdk2.PWindow): PStyle{.cdecl, - dynlib: lib, importc: "gtk_style_attach".} -proc detach*(style: PStyle){.cdecl, dynlib: lib, - importc: "gtk_style_detach".} -proc set_background*(style: PStyle, window: gdk2.PWindow, - state_type: TStateType){.cdecl, dynlib: lib, - importc: "gtk_style_set_background".} -proc apply_default_background*(style: PStyle, window: gdk2.PWindow, - set_bg: gboolean, state_type: TStateType, - area: gdk2.PRectangle, x: gint, y: gint, - width: gint, height: gint){.cdecl, - dynlib: lib, importc: "gtk_style_apply_default_background".} -proc lookup_icon_set*(style: PStyle, stock_id: cstring): PIconSet{.cdecl, - dynlib: lib, importc: "gtk_style_lookup_icon_set".} -proc render_icon*(style: PStyle, source: PIconSource, - direction: TTextDirection, state: TStateType, - size: TIconSize, widget: PWidget, detail: cstring): gdk2pixbuf.PPixbuf{. - cdecl, dynlib: lib, importc: "gtk_style_render_icon".} -proc paint_hline*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x1: gint, x2: gint, y: gint){.cdecl, dynlib: lib, - importc: "gtk_paint_hline".} -proc paint_vline*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - y1: gint, y2: gint, x: gint){.cdecl, dynlib: lib, - importc: "gtk_paint_vline".} -proc paint_shadow*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint){.cdecl, dynlib: lib, - importc: "gtk_paint_shadow".} -proc paint_polygon*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, points: gdk2.PPoint, - npoints: gint, fill: gboolean){.cdecl, dynlib: lib, - importc: "gtk_paint_polygon".} -proc paint_arrow*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, arrow_type: TArrowType, - fill: gboolean, x: gint, y: gint, width: gint, height: gint){. - cdecl, dynlib: lib, importc: "gtk_paint_arrow".} -proc paint_diamond*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint){.cdecl, dynlib: lib, - importc: "gtk_paint_diamond".} -proc paint_box*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, widget: PWidget, - detail: cstring, x: gint, y: gint, width: gint, height: gint){. - cdecl, dynlib: lib, importc: "gtk_paint_box".} -proc paint_flat_box*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint){.cdecl, dynlib: lib, - importc: "gtk_paint_flat_box".} -proc paint_check*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint){.cdecl, dynlib: lib, - importc: "gtk_paint_check".} -proc paint_option*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint){.cdecl, dynlib: lib, - importc: "gtk_paint_option".} -proc paint_tab*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, widget: PWidget, - detail: cstring, x: gint, y: gint, width: gint, height: gint){. - cdecl, dynlib: lib, importc: "gtk_paint_tab".} -proc paint_shadow_gap*(style: PStyle, window: gdk2.PWindow, - state_type: TStateType, shadow_type: TShadowType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint, - gap_side: TPositionType, gap_x: gint, gap_width: gint){. - cdecl, dynlib: lib, importc: "gtk_paint_shadow_gap".} -proc paint_box_gap*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint, gap_side: TPositionType, - gap_x: gint, gap_width: gint){.cdecl, dynlib: lib, - importc: "gtk_paint_box_gap".} -proc paint_extension*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint, gap_side: TPositionType){. - cdecl, dynlib: lib, importc: "gtk_paint_extension".} -proc paint_focus*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, width: gint, height: gint){.cdecl, - dynlib: lib, importc: "gtk_paint_focus".} -proc paint_slider*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint, orientation: TOrientation){.cdecl, - dynlib: lib, importc: "gtk_paint_slider".} -proc paint_handle*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - shadow_type: TShadowType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, x: gint, y: gint, - width: gint, height: gint, orientation: TOrientation){.cdecl, - dynlib: lib, importc: "gtk_paint_handle".} -proc paint_expander*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - area: gdk2.PRectangle, widget: PWidget, detail: cstring, - x: gint, y: gint, expander_style: TExpanderStyle){.cdecl, - dynlib: lib, importc: "gtk_paint_expander".} -proc paint_layout*(style: PStyle, window: gdk2.PWindow, state_type: TStateType, - use_text: gboolean, area: gdk2.PRectangle, widget: PWidget, - detail: cstring, x: gint, y: gint, layout: pango.PLayout){. - cdecl, dynlib: lib, importc: "gtk_paint_layout".} -proc paint_resize_grip*(style: PStyle, window: gdk2.PWindow, - state_type: TStateType, area: gdk2.PRectangle, - widget: PWidget, detail: cstring, edge: gdk2.TWindowEdge, - x: gint, y: gint, width: gint, height: gint){.cdecl, - dynlib: lib, importc: "gtk_paint_resize_grip".} -proc border_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_border_get_type".} -proc copy*(border: PBorder): PBorder{.cdecl, dynlib: lib, - importc: "gtk_border_copy".} -proc free*(border: PBorder){.cdecl, dynlib: lib, - importc: "gtk_border_free".} -proc peek_property_value*(style: PStyle, widget_type: GType, - pspec: PGParamSpec, parser: TRcPropertyParser): PGValue{. - cdecl, dynlib: lib, importc: "_gtk_style_peek_property_value".} -proc get_insertion_cursor_gc*(widget: PWidget, is_primary: gboolean): gdk2.PGC{. - cdecl, dynlib: lib, importc: "_gtk_get_insertion_cursor_gc".} -proc draw_insertion_cursor*(widget: PWidget, drawable: gdk2.PDrawable, gc: gdk2.PGC, - location: gdk2.PRectangle, direction: TTextDirection, - draw_arrow: gboolean){.cdecl, dynlib: lib, - importc: "_gtk_draw_insertion_cursor".} -const - bm_TGtkRange_inverted* = 0x0001'i16 - bp_TGtkRange_inverted* = 0'i16 - bm_TGtkRange_flippable* = 0x0002'i16 - bp_TGtkRange_flippable* = 1'i16 - bm_TGtkRange_has_stepper_a* = 0x0004'i16 - bp_TGtkRange_has_stepper_a* = 2'i16 - bm_TGtkRange_has_stepper_b* = 0x0008'i16 - bp_TGtkRange_has_stepper_b* = 3'i16 - bm_TGtkRange_has_stepper_c* = 0x0010'i16 - bp_TGtkRange_has_stepper_c* = 4'i16 - bm_TGtkRange_has_stepper_d* = 0x0020'i16 - bp_TGtkRange_has_stepper_d* = 5'i16 - bm_TGtkRange_need_recalc* = 0x0040'i16 - bp_TGtkRange_need_recalc* = 6'i16 - bm_TGtkRange_slider_size_fixed* = 0x0080'i16 - bp_TGtkRange_slider_size_fixed* = 7'i16 - bm_TGtkRange_trough_click_forward* = 0x0001'i16 - bp_TGtkRange_trough_click_forward* = 0'i16 - bm_TGtkRange_update_pending* = 0x0002'i16 - bp_TGtkRange_update_pending* = 1'i16 - -proc TYPE_RANGE*(): GType -proc RANGE*(obj: pointer): PRange -proc RANGE_CLASS*(klass: pointer): PRangeClass -proc IS_RANGE*(obj: pointer): bool -proc IS_RANGE_CLASS*(klass: pointer): bool -proc RANGE_GET_CLASS*(obj: pointer): PRangeClass -proc inverted*(a: PRange): guint -proc set_inverted*(a: PRange, `inverted`: guint) -proc flippable*(a: PRange): guint -proc set_flippable*(a: PRange, `flippable`: guint) -proc has_stepper_a*(a: PRange): guint -proc set_has_stepper_a*(a: PRange, `has_stepper_a`: guint) -proc has_stepper_b*(a: PRange): guint -proc set_has_stepper_b*(a: PRange, `has_stepper_b`: guint) -proc has_stepper_c*(a: PRange): guint -proc set_has_stepper_c*(a: PRange, `has_stepper_c`: guint) -proc has_stepper_d*(a: PRange): guint -proc set_has_stepper_d*(a: PRange, `has_stepper_d`: guint) -proc need_recalc*(a: PRange): guint -proc set_need_recalc*(a: PRange, `need_recalc`: guint) -proc slider_size_fixed*(a: PRange): guint -proc set_slider_size_fixed*(a: PRange, `slider_size_fixed`: guint) -proc trough_click_forward*(a: PRange): guint -proc set_trough_click_forward*(a: PRange, `trough_click_forward`: guint) -proc update_pending*(a: PRange): guint -proc set_update_pending*(a: PRange, `update_pending`: guint) -proc range_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_range_get_type".} -proc set_update_policy*(range: PRange, policy: TUpdateType){.cdecl, - dynlib: lib, importc: "gtk_range_set_update_policy".} -proc get_update_policy*(range: PRange): TUpdateType{.cdecl, dynlib: lib, - importc: "gtk_range_get_update_policy".} -proc set_adjustment*(range: PRange, adjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_range_set_adjustment".} -proc get_adjustment*(range: PRange): PAdjustment{.cdecl, dynlib: lib, - importc: "gtk_range_get_adjustment".} -proc set_inverted*(range: PRange, setting: gboolean){.cdecl, dynlib: lib, - importc: "gtk_range_set_inverted".} -proc get_inverted*(range: PRange): gboolean{.cdecl, dynlib: lib, - importc: "gtk_range_get_inverted".} -proc set_increments*(range: PRange, step: gdouble, page: gdouble){.cdecl, - dynlib: lib, importc: "gtk_range_set_increments".} -proc set_range*(range: PRange, min: gdouble, max: gdouble){.cdecl, - dynlib: lib, importc: "gtk_range_set_range".} -proc set_value*(range: PRange, value: gdouble){.cdecl, dynlib: lib, - importc: "gtk_range_set_value".} -proc get_value*(range: PRange): gdouble{.cdecl, dynlib: lib, - importc: "gtk_range_get_value".} -const - bm_TGtkScale_draw_value* = 0x0001'i16 - bp_TGtkScale_draw_value* = 0'i16 - bm_TGtkScale_value_pos* = 0x0006'i16 - bp_TGtkScale_value_pos* = 1'i16 - -proc TYPE_SCALE*(): GType -proc SCALE*(obj: pointer): PScale -proc SCALE_CLASS*(klass: pointer): PScaleClass -proc IS_SCALE*(obj: pointer): bool -proc IS_SCALE_CLASS*(klass: pointer): bool -proc SCALE_GET_CLASS*(obj: pointer): PScaleClass -proc draw_value*(a: PScale): guint -proc set_draw_value*(a: PScale, `draw_value`: guint) -proc value_pos*(a: PScale): guint -proc set_value_pos*(a: PScale, `value_pos`: guint) -proc scale_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_scale_get_type".} -proc set_digits*(scale: PScale, digits: gint){.cdecl, dynlib: lib, - importc: "gtk_scale_set_digits".} -proc get_digits*(scale: PScale): gint{.cdecl, dynlib: lib, - importc: "gtk_scale_get_digits".} -proc set_draw_value*(scale: PScale, draw_value: gboolean){.cdecl, - dynlib: lib, importc: "gtk_scale_set_draw_value".} -proc get_draw_value*(scale: PScale): gboolean{.cdecl, dynlib: lib, - importc: "gtk_scale_get_draw_value".} -proc set_value_pos*(scale: PScale, pos: TPositionType){.cdecl, - dynlib: lib, importc: "gtk_scale_set_value_pos".} -proc get_value_pos*(scale: PScale): TPositionType{.cdecl, dynlib: lib, - importc: "gtk_scale_get_value_pos".} -proc get_value_size*(scale: PScale, width: Pgint, height: Pgint){.cdecl, - dynlib: lib, importc: "_gtk_scale_get_value_size".} -proc format_value*(scale: PScale, value: gdouble): cstring{.cdecl, - dynlib: lib, importc: "_gtk_scale_format_value".} -proc TYPE_HSCALE*(): GType -proc HSCALE*(obj: pointer): PHScale -proc HSCALE_CLASS*(klass: pointer): PHScaleClass -proc IS_HSCALE*(obj: pointer): bool -proc IS_HSCALE_CLASS*(klass: pointer): bool -proc HSCALE_GET_CLASS*(obj: pointer): PHScaleClass -proc hscale_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_hscale_get_type".} -proc hscale_new*(adjustment: PAdjustment): PHScale{.cdecl, dynlib: lib, - importc: "gtk_hscale_new".} -proc hscale_new*(min: gdouble, max: gdouble, step: gdouble): PHScale{. - cdecl, dynlib: lib, importc: "gtk_hscale_new_with_range".} -proc TYPE_SCROLLBAR*(): GType -proc SCROLLBAR*(obj: pointer): PScrollbar -proc SCROLLBAR_CLASS*(klass: pointer): PScrollbarClass -proc IS_SCROLLBAR*(obj: pointer): bool -proc IS_SCROLLBAR_CLASS*(klass: pointer): bool -proc SCROLLBAR_GET_CLASS*(obj: pointer): PScrollbarClass -proc scrollbar_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_scrollbar_get_type".} -proc TYPE_HSCROLLBAR*(): GType -proc HSCROLLBAR*(obj: pointer): PHScrollbar -proc HSCROLLBAR_CLASS*(klass: pointer): PHScrollbarClass -proc IS_HSCROLLBAR*(obj: pointer): bool -proc IS_HSCROLLBAR_CLASS*(klass: pointer): bool -proc HSCROLLBAR_GET_CLASS*(obj: pointer): PHScrollbarClass -proc hscrollbar_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_hscrollbar_get_type".} -proc hscrollbar_new*(adjustment: PAdjustment): PHScrollbar{.cdecl, dynlib: lib, - importc: "gtk_hscrollbar_new".} -proc TYPE_SEPARATOR*(): GType -proc SEPARATOR*(obj: pointer): PSeparator -proc SEPARATOR_CLASS*(klass: pointer): PSeparatorClass -proc IS_SEPARATOR*(obj: pointer): bool -proc IS_SEPARATOR_CLASS*(klass: pointer): bool -proc SEPARATOR_GET_CLASS*(obj: pointer): PSeparatorClass -proc separator_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_separator_get_type".} -proc TYPE_HSEPARATOR*(): GType -proc HSEPARATOR*(obj: pointer): PHSeparator -proc HSEPARATOR_CLASS*(klass: pointer): PHSeparatorClass -proc IS_HSEPARATOR*(obj: pointer): bool -proc IS_HSEPARATOR_CLASS*(klass: pointer): bool -proc HSEPARATOR_GET_CLASS*(obj: pointer): PHSeparatorClass -proc hseparator_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_hseparator_get_type".} -proc hseparator_new*(): PHSeparator{.cdecl, dynlib: lib, - importc: "gtk_hseparator_new".} -proc TYPE_ICON_FACTORY*(): GType -proc ICON_FACTORY*(anObject: pointer): PIconFactory -proc ICON_FACTORY_CLASS*(klass: pointer): PIconFactoryClass -proc IS_ICON_FACTORY*(anObject: pointer): bool -proc IS_ICON_FACTORY_CLASS*(klass: pointer): bool -proc ICON_FACTORY_GET_CLASS*(obj: pointer): PIconFactoryClass -proc TYPE_ICON_SET*(): GType -proc TYPE_ICON_SOURCE*(): GType -proc icon_factory_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_icon_factory_get_type".} -proc icon_factory_new*(): PIconFactory{.cdecl, dynlib: lib, - importc: "gtk_icon_factory_new".} -proc add*(factory: PIconFactory, stock_id: cstring, - icon_set: PIconSet){.cdecl, dynlib: lib, - importc: "gtk_icon_factory_add".} -proc lookup*(factory: PIconFactory, stock_id: cstring): PIconSet{. - cdecl, dynlib: lib, importc: "gtk_icon_factory_lookup".} -proc add_default*(factory: PIconFactory){.cdecl, dynlib: lib, - importc: "gtk_icon_factory_add_default".} -proc remove_default*(factory: PIconFactory){.cdecl, dynlib: lib, - importc: "gtk_icon_factory_remove_default".} -proc icon_factory_lookup_default*(stock_id: cstring): PIconSet{.cdecl, - dynlib: lib, importc: "gtk_icon_factory_lookup_default".} -proc icon_size_lookup*(size: TIconSize, width: Pgint, height: Pgint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_icon_size_lookup".} -proc icon_size_register*(name: cstring, width: gint, height: gint): TIconSize{. - cdecl, dynlib: lib, importc: "gtk_icon_size_register".} -proc icon_size_register_alias*(alias: cstring, target: TIconSize){.cdecl, - dynlib: lib, importc: "gtk_icon_size_register_alias".} -proc icon_size_from_name*(name: cstring): TIconSize{.cdecl, dynlib: lib, - importc: "gtk_icon_size_from_name".} -proc icon_size_get_name*(size: TIconSize): cstring{.cdecl, dynlib: lib, - importc: "gtk_icon_size_get_name".} -proc icon_set_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_icon_set_get_type".} -proc icon_set_new*(): PIconSet{.cdecl, dynlib: lib, importc: "gtk_icon_set_new".} -proc icon_set_new_from_pixbuf*(pixbuf: gdk2pixbuf.PPixbuf): PIconSet{.cdecl, - dynlib: lib, importc: "gtk_icon_set_new_from_pixbuf".} -proc reference*(icon_set: PIconSet): PIconSet{.cdecl, dynlib: lib, - importc: "gtk_icon_set_ref".} -proc unref*(icon_set: PIconSet){.cdecl, dynlib: lib, - importc: "gtk_icon_set_unref".} -proc copy*(icon_set: PIconSet): PIconSet{.cdecl, dynlib: lib, - importc: "gtk_icon_set_copy".} -proc render_icon*(icon_set: PIconSet, style: PStyle, - direction: TTextDirection, state: TStateType, - size: TIconSize, widget: PWidget, detail: cstring): gdk2pixbuf.PPixbuf{. - cdecl, dynlib: lib, importc: "gtk_icon_set_render_icon".} -proc add_source*(icon_set: PIconSet, source: PIconSource){.cdecl, - dynlib: lib, importc: "gtk_icon_set_add_source".} -proc get_sizes*(icon_set: PIconSet, sizes: PPGtkIconSize, - n_sizes: pgint){.cdecl, dynlib: lib, - importc: "gtk_icon_set_get_sizes".} -proc icon_source_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_icon_source_get_type".} -proc icon_source_new*(): PIconSource{.cdecl, dynlib: lib, - importc: "gtk_icon_source_new".} -proc copy*(source: PIconSource): PIconSource{.cdecl, dynlib: lib, - importc: "gtk_icon_source_copy".} -proc free*(source: PIconSource){.cdecl, dynlib: lib, - importc: "gtk_icon_source_free".} -proc set_filename*(source: PIconSource, filename: cstring){.cdecl, - dynlib: lib, importc: "gtk_icon_source_set_filename".} -proc set_pixbuf*(source: PIconSource, pixbuf: gdk2pixbuf.PPixbuf){.cdecl, - dynlib: lib, importc: "gtk_icon_source_set_pixbuf".} -proc get_filename*(source: PIconSource): cstring{.cdecl, - dynlib: lib, importc: "gtk_icon_source_get_filename".} -proc get_pixbuf*(source: PIconSource): gdk2pixbuf.PPixbuf{.cdecl, - dynlib: lib, importc: "gtk_icon_source_get_pixbuf".} -proc set_direction_wildcarded*(source: PIconSource, - setting: gboolean){.cdecl, dynlib: lib, - importc: "gtk_icon_source_set_direction_wildcarded".} -proc set_state_wildcarded*(source: PIconSource, setting: gboolean){. - cdecl, dynlib: lib, importc: "gtk_icon_source_set_state_wildcarded".} -proc set_size_wildcarded*(source: PIconSource, setting: gboolean){. - cdecl, dynlib: lib, importc: "gtk_icon_source_set_size_wildcarded".} -proc get_size_wildcarded*(source: PIconSource): gboolean{.cdecl, - dynlib: lib, importc: "gtk_icon_source_get_size_wildcarded".} -proc get_state_wildcarded*(source: PIconSource): gboolean{.cdecl, - dynlib: lib, importc: "gtk_icon_source_get_state_wildcarded".} -proc get_direction_wildcarded*(source: PIconSource): gboolean{. - cdecl, dynlib: lib, importc: "gtk_icon_source_get_direction_wildcarded".} -proc set_direction*(source: PIconSource, direction: TTextDirection){. - cdecl, dynlib: lib, importc: "gtk_icon_source_set_direction".} -proc set_state*(source: PIconSource, state: TStateType){.cdecl, - dynlib: lib, importc: "gtk_icon_source_set_state".} -proc set_size*(source: PIconSource, size: TIconSize){.cdecl, - dynlib: lib, importc: "gtk_icon_source_set_size".} -proc get_direction*(source: PIconSource): TTextDirection{.cdecl, - dynlib: lib, importc: "gtk_icon_source_get_direction".} -proc get_state*(source: PIconSource): TStateType{.cdecl, - dynlib: lib, importc: "gtk_icon_source_get_state".} -proc get_size*(source: PIconSource): TIconSize{.cdecl, dynlib: lib, - importc: "gtk_icon_source_get_size".} -proc icon_set_invalidate_caches*(){.cdecl, dynlib: lib, - importc: "_gtk_icon_set_invalidate_caches".} -proc icon_factory_list_ids*(): PGSList{.cdecl, dynlib: lib, - importc: "_gtk_icon_factory_list_ids".} -proc TYPE_IMAGE*(): GType -proc IMAGE*(obj: pointer): PImage -proc IMAGE_CLASS*(klass: pointer): PImageClass -proc IS_IMAGE*(obj: pointer): bool -proc IS_IMAGE_CLASS*(klass: pointer): bool -proc IMAGE_GET_CLASS*(obj: pointer): PImageClass -proc image_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_image_get_type".} -proc image_new*(): PImage{.cdecl, dynlib: lib, importc: "gtk_image_new".} -proc image_new_from_pixmap*(pixmap: gdk2.PPixmap, mask: gdk2.PBitmap): PImage{. - cdecl, dynlib: lib, importc: "gtk_image_new_from_pixmap".} -proc image_new_from_image*(image: gdk2.PImage, mask: gdk2.PBitmap): PImage{.cdecl, - dynlib: lib, importc: "gtk_image_new_from_image".} -proc image_new_from_file*(filename: cstring): PImage{.cdecl, dynlib: lib, - importc: "gtk_image_new_from_file".} -proc image_new_from_pixbuf*(pixbuf: gdk2pixbuf.PPixbuf): PImage{.cdecl, dynlib: lib, - importc: "gtk_image_new_from_pixbuf".} -proc image_new_from_stock*(stock_id: cstring, size: TIconSize): PImage{.cdecl, - dynlib: lib, importc: "gtk_image_new_from_stock".} -proc image_new_from_icon_set*(icon_set: PIconSet, size: TIconSize): PImage{. - cdecl, dynlib: lib, importc: "gtk_image_new_from_icon_set".} -proc image_new_from_animation*(animation: gdk2pixbuf.PPixbufAnimation): PImage{.cdecl, - dynlib: lib, importc: "gtk_image_new_from_animation".} -proc set_from_pixmap*(image: PImage, pixmap: gdk2.PPixmap, mask: gdk2.PBitmap){. - cdecl, dynlib: lib, importc: "gtk_image_set_from_pixmap".} -proc set_from_image*(image: PImage, gdk_image: gdk2.PImage, mask: gdk2.PBitmap){. - cdecl, dynlib: lib, importc: "gtk_image_set_from_image".} -proc set_from_file*(image: PImage, filename: cstring){.cdecl, dynlib: lib, - importc: "gtk_image_set_from_file".} -proc set_from_pixbuf*(image: PImage, pixbuf: gdk2pixbuf.PPixbuf){.cdecl, - dynlib: lib, importc: "gtk_image_set_from_pixbuf".} -proc set_from_stock*(image: PImage, stock_id: cstring, size: TIconSize){. - cdecl, dynlib: lib, importc: "gtk_image_set_from_stock".} -proc set_from_icon_set*(image: PImage, icon_set: PIconSet, size: TIconSize){. - cdecl, dynlib: lib, importc: "gtk_image_set_from_icon_set".} -proc set_from_animation*(image: PImage, animation: gdk2pixbuf.PPixbufAnimation){. - cdecl, dynlib: lib, importc: "gtk_image_set_from_animation".} -proc get_storage_type*(image: PImage): TImageType{.cdecl, dynlib: lib, - importc: "gtk_image_get_storage_type".} -proc get_pixbuf*(image: PImage): gdk2pixbuf.PPixbuf{.cdecl, dynlib: lib, - importc: "gtk_image_get_pixbuf".} -proc get_stock*(image: PImage, stock_id: PPgchar, size: PIconSize){.cdecl, - dynlib: lib, importc: "gtk_image_get_stock".} -proc get_animation*(image: PImage): gdk2pixbuf.PPixbufAnimation{.cdecl, - dynlib: lib, importc: "gtk_image_get_animation".} -proc TYPE_IMAGE_MENU_ITEM*(): GType -proc IMAGE_MENU_ITEM*(obj: pointer): PImageMenuItem -proc IMAGE_MENU_ITEM_CLASS*(klass: pointer): PImageMenuItemClass -proc IS_IMAGE_MENU_ITEM*(obj: pointer): bool -proc IS_IMAGE_MENU_ITEM_CLASS*(klass: pointer): bool -proc IMAGE_MENU_ITEM_GET_CLASS*(obj: pointer): PImageMenuItemClass -proc image_menu_item_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_image_menu_item_get_type".} -proc image_menu_item_new*(): PImageMenuItem{.cdecl, dynlib: lib, - importc: "gtk_image_menu_item_new".} -proc image_menu_item_new*(`label`: cstring): PImageMenuItem{.cdecl, - dynlib: lib, importc: "gtk_image_menu_item_new_with_label".} -proc image_menu_item_new_with_mnemonic*(`label`: cstring): PImageMenuItem{. - cdecl, dynlib: lib, importc: "gtk_image_menu_item_new_with_mnemonic".} -proc image_menu_item_new_from_stock*(stock_id: cstring, accel_group: PAccelGroup): PImageMenuItem{. - cdecl, dynlib: lib, importc: "gtk_image_menu_item_new_from_stock".} -proc item_set_image*(image_menu_item: PImageMenuItem, image: PWidget){. - cdecl, dynlib: lib, importc: "gtk_image_menu_item_set_image".} -proc item_get_image*(image_menu_item: PImageMenuItem): PWidget{. - cdecl, dynlib: lib, importc: "gtk_image_menu_item_get_image".} -const - bm_TGtkIMContextSimple_in_hex_sequence* = 0x0001'i16 - bp_TGtkIMContextSimple_in_hex_sequence* = 0'i16 - -proc TYPE_IM_CONTEXT_SIMPLE*(): GType -proc IM_CONTEXT_SIMPLE*(obj: pointer): PIMContextSimple -proc IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): PIMContextSimpleClass -proc IS_IM_CONTEXT_SIMPLE*(obj: pointer): bool -proc IS_IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): bool -proc IM_CONTEXT_SIMPLE_GET_CLASS*(obj: pointer): PIMContextSimpleClass -proc in_hex_sequence*(a: PIMContextSimple): guint -proc set_in_hex_sequence*(a: PIMContextSimple, `in_hex_sequence`: guint) -proc im_context_simple_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_im_context_simple_get_type".} -proc im_context_simple_new*(): PIMContext{.cdecl, dynlib: lib, - importc: "gtk_im_context_simple_new".} -proc simple_add_table*(context_simple: PIMContextSimple, - data: Pguint16, max_seq_len: gint, - n_seqs: gint){.cdecl, dynlib: lib, - importc: "gtk_im_context_simple_add_table".} -proc TYPE_IM_MULTICONTEXT*(): GType -proc IM_MULTICONTEXT*(obj: pointer): PIMMulticontext -proc IM_MULTICONTEXT_CLASS*(klass: pointer): PIMMulticontextClass -proc IS_IM_MULTICONTEXT*(obj: pointer): bool -proc IS_IM_MULTICONTEXT_CLASS*(klass: pointer): bool -proc IM_MULTICONTEXT_GET_CLASS*(obj: pointer): PIMMulticontextClass -proc im_multicontext_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_im_multicontext_get_type".} -proc im_multicontext_new*(): PIMContext{.cdecl, dynlib: lib, - importc: "gtk_im_multicontext_new".} -proc append_menuitems*(context: PIMMulticontext, - menushell: PMenuShell){.cdecl, - dynlib: lib, importc: "gtk_im_multicontext_append_menuitems".} -proc TYPE_INPUT_DIALOG*(): GType -proc INPUT_DIALOG*(obj: pointer): PInputDialog -proc INPUT_DIALOG_CLASS*(klass: pointer): PInputDialogClass -proc IS_INPUT_DIALOG*(obj: pointer): bool -proc IS_INPUT_DIALOG_CLASS*(klass: pointer): bool -proc INPUT_DIALOG_GET_CLASS*(obj: pointer): PInputDialogClass -proc input_dialog_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_input_dialog_get_type".} -proc input_dialog_new*(): PInputDialog{.cdecl, dynlib: lib, - importc: "gtk_input_dialog_new".} -proc TYPE_INVISIBLE*(): GType -proc INVISIBLE*(obj: pointer): PInvisible -proc INVISIBLE_CLASS*(klass: pointer): PInvisibleClass -proc IS_INVISIBLE*(obj: pointer): bool -proc IS_INVISIBLE_CLASS*(klass: pointer): bool -proc INVISIBLE_GET_CLASS*(obj: pointer): PInvisibleClass -proc invisible_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_invisible_get_type".} -proc invisible_new*(): PInvisible{.cdecl, dynlib: lib, - importc: "gtk_invisible_new".} -proc invisible_new_for_screen*(screen: gdk2.PScreen): PInvisible{.cdecl, - dynlib: lib, importc: "gtk_invisible_new_for_screen".} -proc set_screen*(invisible: PInvisible, screen: gdk2.PScreen){.cdecl, - dynlib: lib, importc: "gtk_invisible_set_screen".} -proc get_screen*(invisible: PInvisible): gdk2.PScreen{.cdecl, - dynlib: lib, importc: "gtk_invisible_get_screen".} -proc TYPE_ITEM_FACTORY*(): GType -proc ITEM_FACTORY*(anObject: pointer): PItemFactory -proc ITEM_FACTORY_CLASS*(klass: pointer): PItemFactoryClass -proc IS_ITEM_FACTORY*(anObject: pointer): bool -proc IS_ITEM_FACTORY_CLASS*(klass: pointer): bool -proc ITEM_FACTORY_GET_CLASS*(obj: pointer): PItemFactoryClass -proc item_factory_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_item_factory_get_type".} -proc item_factory_new*(container_type: TType, path: cstring, - accel_group: PAccelGroup): PItemFactory{.cdecl, - dynlib: lib, importc: "gtk_item_factory_new".} -proc construct*(ifactory: PItemFactory, container_type: TType, - path: cstring, accel_group: PAccelGroup){.cdecl, - dynlib: lib, importc: "gtk_item_factory_construct".} -proc item_factory_add_foreign*(accel_widget: PWidget, full_path: cstring, - accel_group: PAccelGroup, keyval: guint, - modifiers: gdk2.TModifierType){.cdecl, dynlib: lib, - importc: "gtk_item_factory_add_foreign".} -proc item_factory_from_widget*(widget: PWidget): PItemFactory{.cdecl, - dynlib: lib, importc: "gtk_item_factory_from_widget".} -proc item_factory_path_from_widget*(widget: PWidget): cstring{.cdecl, - dynlib: lib, importc: "gtk_item_factory_path_from_widget".} -proc get_item*(ifactory: PItemFactory, path: cstring): PWidget{. - cdecl, dynlib: lib, importc: "gtk_item_factory_get_item".} -proc get_widget*(ifactory: PItemFactory, path: cstring): PWidget{. - cdecl, dynlib: lib, importc: "gtk_item_factory_get_widget".} -proc get_widget_by_action*(ifactory: PItemFactory, action: guint): PWidget{. - cdecl, dynlib: lib, importc: "gtk_item_factory_get_widget_by_action".} -proc get_item_by_action*(ifactory: PItemFactory, action: guint): PWidget{. - cdecl, dynlib: lib, importc: "gtk_item_factory_get_item_by_action".} -proc create_item*(ifactory: PItemFactory, entry: PItemFactoryEntry, - callback_data: gpointer, callback_type: guint){. - cdecl, dynlib: lib, importc: "gtk_item_factory_create_item".} -proc create_items*(ifactory: PItemFactory, n_entries: guint, - entries: PItemFactoryEntry, - callback_data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_item_factory_create_items".} -proc delete_item*(ifactory: PItemFactory, path: cstring){.cdecl, - dynlib: lib, importc: "gtk_item_factory_delete_item".} -proc delete_entry*(ifactory: PItemFactory, entry: PItemFactoryEntry){. - cdecl, dynlib: lib, importc: "gtk_item_factory_delete_entry".} -proc delete_entries*(ifactory: PItemFactory, n_entries: guint, - entries: PItemFactoryEntry){.cdecl, - dynlib: lib, importc: "gtk_item_factory_delete_entries".} -proc popup*(ifactory: PItemFactory, x: guint, y: guint, - mouse_button: guint, time: guint32){.cdecl, - dynlib: lib, importc: "gtk_item_factory_popup".} -proc popup*(ifactory: PItemFactory, popup_data: gpointer, - destroy: TDestroyNotify, x: guint, y: guint, - mouse_button: guint, time: guint32){.cdecl, - dynlib: lib, importc: "gtk_item_factory_popup_with_data".} -proc popup_data*(ifactory: PItemFactory): gpointer{.cdecl, - dynlib: lib, importc: "gtk_item_factory_popup_data".} -proc item_factory_popup_data_from_widget*(widget: PWidget): gpointer{.cdecl, - dynlib: lib, importc: "gtk_item_factory_popup_data_from_widget".} -proc set_translate_func*(ifactory: PItemFactory, - fun: TTranslateFunc, data: gpointer, - notify: TDestroyNotify){.cdecl, - dynlib: lib, importc: "gtk_item_factory_set_translate_func".} -proc TYPE_LAYOUT*(): GType -proc LAYOUT*(obj: pointer): PLayout -proc LAYOUT_CLASS*(klass: pointer): PLayoutClass -proc IS_LAYOUT*(obj: pointer): bool -proc IS_LAYOUT_CLASS*(klass: pointer): bool -proc LAYOUT_GET_CLASS*(obj: pointer): PLayoutClass -proc layout_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_layout_get_type".} -proc layout_new*(hadjustment: PAdjustment, vadjustment: PAdjustment): PLayout{. - cdecl, dynlib: lib, importc: "gtk_layout_new".} -proc put*(layout: PLayout, child_widget: PWidget, x: gint, y: gint){. - cdecl, dynlib: lib, importc: "gtk_layout_put".} -proc move*(layout: PLayout, child_widget: PWidget, x: gint, y: gint){. - cdecl, dynlib: lib, importc: "gtk_layout_move".} -proc set_size*(layout: PLayout, width: guint, height: guint){.cdecl, - dynlib: lib, importc: "gtk_layout_set_size".} -proc get_size*(layout: PLayout, width: Pguint, height: Pguint){.cdecl, - dynlib: lib, importc: "gtk_layout_get_size".} -proc get_hadjustment*(layout: PLayout): PAdjustment{.cdecl, dynlib: lib, - importc: "gtk_layout_get_hadjustment".} -proc get_vadjustment*(layout: PLayout): PAdjustment{.cdecl, dynlib: lib, - importc: "gtk_layout_get_vadjustment".} -proc set_hadjustment*(layout: PLayout, adjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_layout_set_hadjustment".} -proc set_vadjustment*(layout: PLayout, adjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_layout_set_vadjustment".} -const - bm_TGtkList_selection_mode* = 0x0003'i16 - bp_TGtkList_selection_mode* = 0'i16 - bm_TGtkList_drag_selection* = 0x0004'i16 - bp_TGtkList_drag_selection* = 2'i16 - bm_TGtkList_add_mode* = 0x0008'i16 - bp_TGtkList_add_mode* = 3'i16 - -proc TYPE_LIST*(): GType -proc LIST*(obj: pointer): PList -proc LIST_CLASS*(klass: pointer): PListClass -proc IS_LIST*(obj: pointer): bool -proc IS_LIST_CLASS*(klass: pointer): bool -proc LIST_GET_CLASS*(obj: pointer): PListClass -proc selection_mode*(a: PList): guint -proc set_selection_mode*(a: PList, `selection_mode`: guint) -proc drag_selection*(a: PList): guint -proc set_drag_selection*(a: PList, `drag_selection`: guint) -proc add_mode*(a: PList): guint -proc set_add_mode*(a: PList, `add_mode`: guint) -proc list_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_list_get_type".} -proc list_new*(): PList{.cdecl, dynlib: lib, importc: "gtk_list_new".} -proc insert_items*(list: PList, items: PGList, position: gint){.cdecl, - dynlib: lib, importc: "gtk_list_insert_items".} -proc append_items*(list: PList, items: PGList){.cdecl, dynlib: lib, - importc: "gtk_list_append_items".} -proc prepend_items*(list: PList, items: PGList){.cdecl, dynlib: lib, - importc: "gtk_list_prepend_items".} -proc remove_items*(list: PList, items: PGList){.cdecl, dynlib: lib, - importc: "gtk_list_remove_items".} -proc remove_items_no_unref*(list: PList, items: PGList){.cdecl, - dynlib: lib, importc: "gtk_list_remove_items_no_unref".} -proc clear_items*(list: PList, start: gint, theEnd: gint){.cdecl, - dynlib: lib, importc: "gtk_list_clear_items".} -proc select_item*(list: PList, item: gint){.cdecl, dynlib: lib, - importc: "gtk_list_select_item".} -proc unselect_item*(list: PList, item: gint){.cdecl, dynlib: lib, - importc: "gtk_list_unselect_item".} -proc select_child*(list: PList, child: PWidget){.cdecl, dynlib: lib, - importc: "gtk_list_select_child".} -proc unselect_child*(list: PList, child: PWidget){.cdecl, dynlib: lib, - importc: "gtk_list_unselect_child".} -proc child_position*(list: PList, child: PWidget): gint{.cdecl, - dynlib: lib, importc: "gtk_list_child_position".} -proc set_selection_mode*(list: PList, mode: TSelectionMode){.cdecl, - dynlib: lib, importc: "gtk_list_set_selection_mode".} -proc extend_selection*(list: PList, scroll_type: TScrollType, - position: gfloat, auto_start_selection: gboolean){. - cdecl, dynlib: lib, importc: "gtk_list_extend_selection".} -proc start_selection*(list: PList){.cdecl, dynlib: lib, - importc: "gtk_list_start_selection".} -proc end_selection*(list: PList){.cdecl, dynlib: lib, - importc: "gtk_list_end_selection".} -proc select_all*(list: PList){.cdecl, dynlib: lib, - importc: "gtk_list_select_all".} -proc unselect_all*(list: PList){.cdecl, dynlib: lib, - importc: "gtk_list_unselect_all".} -proc scroll_horizontal*(list: PList, scroll_type: TScrollType, - position: gfloat){.cdecl, dynlib: lib, - importc: "gtk_list_scroll_horizontal".} -proc scroll_vertical*(list: PList, scroll_type: TScrollType, - position: gfloat){.cdecl, dynlib: lib, - importc: "gtk_list_scroll_vertical".} -proc toggle_add_mode*(list: PList){.cdecl, dynlib: lib, - importc: "gtk_list_toggle_add_mode".} -proc toggle_focus_row*(list: PList){.cdecl, dynlib: lib, - importc: "gtk_list_toggle_focus_row".} -proc toggle_row*(list: PList, item: PWidget){.cdecl, dynlib: lib, - importc: "gtk_list_toggle_row".} -proc undo_selection*(list: PList){.cdecl, dynlib: lib, - importc: "gtk_list_undo_selection".} -proc end_drag_selection*(list: PList){.cdecl, dynlib: lib, - importc: "gtk_list_end_drag_selection".} -const - TREE_MODEL_ITERS_PERSIST* = 1 shl 0 - TREE_MODEL_LIST_ONLY* = 1 shl 1 - -proc TYPE_TREE_MODEL*(): GType -proc TREE_MODEL*(obj: pointer): PTreeModel -proc IS_TREE_MODEL*(obj: pointer): bool -proc TREE_MODEL_GET_IFACE*(obj: pointer): PTreeModelIface -proc TYPE_TREE_ITER*(): GType -proc TYPE_TREE_PATH*(): GType -proc tree_path_new*(): PTreePath{.cdecl, dynlib: lib, - importc: "gtk_tree_path_new".} -proc tree_path_new_from_string*(path: cstring): PTreePath{.cdecl, dynlib: lib, - importc: "gtk_tree_path_new_from_string".} -proc to_string*(path: PTreePath): cstring{.cdecl, dynlib: lib, - importc: "gtk_tree_path_to_string".} -proc tree_path_new_root*(): PTreePath -proc tree_path_new_first*(): PTreePath{.cdecl, dynlib: lib, - importc: "gtk_tree_path_new_first".} -proc append_index*(path: PTreePath, index: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_path_append_index".} -proc prepend_index*(path: PTreePath, index: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_path_prepend_index".} -proc get_depth*(path: PTreePath): gint{.cdecl, dynlib: lib, - importc: "gtk_tree_path_get_depth".} -proc get_indices*(path: PTreePath): Pgint{.cdecl, dynlib: lib, - importc: "gtk_tree_path_get_indices".} -proc free*(path: PTreePath){.cdecl, dynlib: lib, - importc: "gtk_tree_path_free".} -proc copy*(path: PTreePath): PTreePath{.cdecl, dynlib: lib, - importc: "gtk_tree_path_copy".} -proc tree_path_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_tree_path_get_type".} -proc compare*(a: PTreePath, b: PTreePath): gint{.cdecl, dynlib: lib, - importc: "gtk_tree_path_compare".} -proc next*(path: PTreePath){.cdecl, dynlib: lib, - importc: "gtk_tree_path_next".} -proc prev*(path: PTreePath): gboolean{.cdecl, dynlib: lib, - importc: "gtk_tree_path_prev".} -proc up*(path: PTreePath): gboolean{.cdecl, dynlib: lib, - importc: "gtk_tree_path_up".} -proc down*(path: PTreePath){.cdecl, dynlib: lib, - importc: "gtk_tree_path_down".} -proc is_ancestor*(path: PTreePath, descendant: PTreePath): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_path_is_ancestor".} -proc is_descendant*(path: PTreePath, ancestor: PTreePath): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_path_is_descendant".} -proc row_reference_new*(model: PTreeModel, path: PTreePath): PTreeRowReference{. - cdecl, dynlib: lib, importc: "gtk_tree_row_reference_new".} -proc tree_row_reference_new_proxy*(proxy: PGObject, model: PTreeModel, - path: PTreePath): PTreeRowReference{.cdecl, - dynlib: lib, importc: "gtk_tree_row_reference_new_proxy".} -proc reference_get_path*(reference: PTreeRowReference): PTreePath{. - cdecl, dynlib: lib, importc: "gtk_tree_row_reference_get_path".} -proc reference_valid*(reference: PTreeRowReference): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_row_reference_valid".} -proc reference_free*(reference: PTreeRowReference){.cdecl, dynlib: lib, - importc: "gtk_tree_row_reference_free".} -proc tree_row_reference_inserted*(proxy: PGObject, path: PTreePath){.cdecl, - dynlib: lib, importc: "gtk_tree_row_reference_inserted".} -proc tree_row_reference_deleted*(proxy: PGObject, path: PTreePath){.cdecl, - dynlib: lib, importc: "gtk_tree_row_reference_deleted".} -proc tree_row_reference_reordered*(proxy: PGObject, path: PTreePath, - iter: PTreeIter, new_order: Pgint){.cdecl, - dynlib: lib, importc: "gtk_tree_row_reference_reordered".} -proc copy*(iter: PTreeIter): PTreeIter{.cdecl, dynlib: lib, - importc: "gtk_tree_iter_copy".} -proc free*(iter: PTreeIter){.cdecl, dynlib: lib, - importc: "gtk_tree_iter_free".} -proc tree_iter_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_tree_iter_get_type".} -proc tree_model_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tree_model_get_type".} -proc get_flags*(tree_model: PTreeModel): TTreeModelFlags{.cdecl, - dynlib: lib, importc: "gtk_tree_model_get_flags".} -proc get_n_columns*(tree_model: PTreeModel): gint{.cdecl, - dynlib: lib, importc: "gtk_tree_model_get_n_columns".} -proc get_column_type*(tree_model: PTreeModel, index: gint): GType{. - cdecl, dynlib: lib, importc: "gtk_tree_model_get_column_type".} -proc get_iter*(tree_model: PTreeModel, iter: PTreeIter, - path: PTreePath): gboolean{.cdecl, dynlib: lib, - importc: "gtk_tree_model_get_iter".} -proc get_iter_from_string*(tree_model: PTreeModel, iter: PTreeIter, - path_string: cstring): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_model_get_iter_from_string".} -proc get_iter_root*(tree_model: PTreeModel, iter: PTreeIter): gboolean -proc get_iter_first*(tree_model: PTreeModel, iter: PTreeIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_model_get_iter_first".} -proc get_path*(tree_model: PTreeModel, iter: PTreeIter): PTreePath{. - cdecl, dynlib: lib, importc: "gtk_tree_model_get_path".} -proc get_value*(tree_model: PTreeModel, iter: PTreeIter, - column: gint, value: PGValue){.cdecl, dynlib: lib, - importc: "gtk_tree_model_get_value".} -proc iter_next*(tree_model: PTreeModel, iter: PTreeIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_model_iter_next".} -proc iter_children*(tree_model: PTreeModel, iter: PTreeIter, - parent: PTreeIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_tree_model_iter_children".} -proc iter_has_child*(tree_model: PTreeModel, iter: PTreeIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_model_iter_has_child".} -proc iter_n_children*(tree_model: PTreeModel, iter: PTreeIter): gint{. - cdecl, dynlib: lib, importc: "gtk_tree_model_iter_n_children".} -proc iter_nth_child*(tree_model: PTreeModel, iter: PTreeIter, - parent: PTreeIter, n: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_model_iter_nth_child".} -proc iter_parent*(tree_model: PTreeModel, iter: PTreeIter, - child: PTreeIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_tree_model_iter_parent".} -proc get_string_from_iter*(tree_model: PTreeModel, iter: PTreeIter): - cstring{.cdecl, dynlib: lib, - importc: "gtk_tree_model_get_string_from_iter".} -proc ref_node*(tree_model: PTreeModel, iter: PTreeIter){.cdecl, - dynlib: lib, importc: "gtk_tree_model_ref_node".} -proc unref_node*(tree_model: PTreeModel, iter: PTreeIter){.cdecl, - dynlib: lib, importc: "gtk_tree_model_unref_node".} -proc foreach*(model: PTreeModel, fun: TTreeModelForeachFunc, - user_data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_tree_model_foreach".} -proc row_changed*(tree_model: PTreeModel, path: PTreePath, - iter: PTreeIter){.cdecl, dynlib: lib, - importc: "gtk_tree_model_row_changed".} -proc row_inserted*(tree_model: PTreeModel, path: PTreePath, - iter: PTreeIter){.cdecl, dynlib: lib, - importc: "gtk_tree_model_row_inserted".} -proc row_has_child_toggled*(tree_model: PTreeModel, path: PTreePath, - iter: PTreeIter){.cdecl, dynlib: lib, - importc: "gtk_tree_model_row_has_child_toggled".} -proc row_deleted*(tree_model: PTreeModel, path: PTreePath){.cdecl, - dynlib: lib, importc: "gtk_tree_model_row_deleted".} -proc rows_reordered*(tree_model: PTreeModel, path: PTreePath, - iter: PTreeIter, new_order: Pgint){.cdecl, - dynlib: lib, importc: "gtk_tree_model_rows_reordered".} -const - TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID* = - (1) - -proc TYPE_TREE_SORTABLE*(): GType -proc TREE_SORTABLE*(obj: pointer): PTreeSortable -proc TREE_SORTABLE_CLASS*(obj: pointer): PTreeSortableIface -proc IS_TREE_SORTABLE*(obj: pointer): bool -proc TREE_SORTABLE_GET_IFACE*(obj: pointer): PTreeSortableIface -proc tree_sortable_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_tree_sortable_get_type".} -proc sort_column_changed*(sortable: PTreeSortable){.cdecl, - dynlib: lib, importc: "gtk_tree_sortable_sort_column_changed".} -proc get_sort_column_id*(sortable: PTreeSortable, - sort_column_id: Pgint, order: PSortType): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_sortable_get_sort_column_id".} -proc set_sort_column_id*(sortable: PTreeSortable, - sort_column_id: gint, order: TSortType){. - cdecl, dynlib: lib, importc: "gtk_tree_sortable_set_sort_column_id".} -proc set_sort_func*(sortable: PTreeSortable, sort_column_id: gint, - sort_func: TTreeIterCompareFunc, - user_data: gpointer, destroy: TDestroyNotify){. - cdecl, dynlib: lib, importc: "gtk_tree_sortable_set_sort_func".} -proc set_default_sort_func*(sortable: PTreeSortable, - sort_func: TTreeIterCompareFunc, user_data: gpointer, - destroy: TDestroyNotify){.cdecl, dynlib: lib, importc: "gtk_tree_sortable_set_default_sort_func".} -proc has_default_sort_func*(sortable: PTreeSortable): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_sortable_has_default_sort_func".} -proc TYPE_TREE_MODEL_SORT*(): GType -proc TREE_MODEL_SORT*(obj: pointer): PTreeModelSort -proc TREE_MODEL_SORT_CLASS*(klass: pointer): PTreeModelSortClass -proc IS_TREE_MODEL_SORT*(obj: pointer): bool -proc IS_TREE_MODEL_SORT_CLASS*(klass: pointer): bool -proc TREE_MODEL_SORT_GET_CLASS*(obj: pointer): PTreeModelSortClass -proc tree_model_sort_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_tree_model_sort_get_type".} -proc sort_new*(child_model: PTreeModel): PTreeModel{. - cdecl, dynlib: lib, importc: "gtk_tree_model_sort_new_with_model".} -proc sort_get_model*(tree_model: PTreeModelSort): PTreeModel{.cdecl, - dynlib: lib, importc: "gtk_tree_model_sort_get_model".} -proc tree_model_sort_convert_child_path_to_path*( - tree_model_sort: PTreeModelSort, child_path: PTreePath): PTreePath{.cdecl, - dynlib: lib, importc: "gtk_tree_model_sort_convert_child_path_to_path".} -proc tree_model_sort_convert_child_iter_to_iter*( - tree_model_sort: PTreeModelSort, sort_iter: PTreeIter, child_iter: PTreeIter){. - cdecl, dynlib: lib, - importc: "gtk_tree_model_sort_convert_child_iter_to_iter".} -proc tree_model_sort_convert_path_to_child_path*( - tree_model_sort: PTreeModelSort, sorted_path: PTreePath): PTreePath{.cdecl, - dynlib: lib, importc: "gtk_tree_model_sort_convert_path_to_child_path".} -proc tree_model_sort_convert_iter_to_child_iter*( - tree_model_sort: PTreeModelSort, child_iter: PTreeIter, - sorted_iter: PTreeIter){.cdecl, dynlib: lib, importc: "gtk_tree_model_sort_convert_iter_to_child_iter".} -proc sort_reset_default_sort_func*(tree_model_sort: PTreeModelSort){. - cdecl, dynlib: lib, importc: "gtk_tree_model_sort_reset_default_sort_func".} -proc sort_clear_cache*(tree_model_sort: PTreeModelSort){.cdecl, - dynlib: lib, importc: "gtk_tree_model_sort_clear_cache".} -const - bm_TGtkListStore_columns_dirty* = 0x0001'i16 - bp_TGtkListStore_columns_dirty* = 0'i16 - -proc TYPE_LIST_STORE*(): GType -proc LIST_STORE*(obj: pointer): PListStore -proc LIST_STORE_CLASS*(klass: pointer): PListStoreClass -proc IS_LIST_STORE*(obj: pointer): bool -proc IS_LIST_STORE_CLASS*(klass: pointer): bool -proc LIST_STORE_GET_CLASS*(obj: pointer): PListStoreClass -proc columns_dirty*(a: PListStore): guint -proc set_columns_dirty*(a: PListStore, `columns_dirty`: guint) -proc list_store_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_list_store_get_type".} -proc list_store_newv*(n_columns: gint, types: PGType): PListStore{.cdecl, - dynlib: lib, importc: "gtk_list_store_newv".} -proc set_column_types*(list_store: PListStore, n_columns: gint, - types: PGType){.cdecl, dynlib: lib, - importc: "gtk_list_store_set_column_types".} -proc set_value*(list_store: PListStore, iter: PTreeIter, - column: gint, value: PGValue){.cdecl, dynlib: lib, - importc: "gtk_list_store_set_value".} -proc remove*(list_store: PListStore, iter: PTreeIter){.cdecl, - dynlib: lib, importc: "gtk_list_store_remove".} -proc insert*(list_store: PListStore, iter: PTreeIter, position: gint){. - cdecl, dynlib: lib, importc: "gtk_list_store_insert".} -proc insert_before*(list_store: PListStore, iter: PTreeIter, - sibling: PTreeIter){.cdecl, dynlib: lib, - importc: "gtk_list_store_insert_before".} -proc insert_after*(list_store: PListStore, iter: PTreeIter, - sibling: PTreeIter){.cdecl, dynlib: lib, - importc: "gtk_list_store_insert_after".} -proc prepend*(list_store: PListStore, iter: PTreeIter){.cdecl, - dynlib: lib, importc: "gtk_list_store_prepend".} -proc append*(list_store: PListStore, iter: PTreeIter){.cdecl, - dynlib: lib, importc: "gtk_list_store_append".} -proc clear*(list_store: PListStore){.cdecl, dynlib: lib, - importc: "gtk_list_store_clear".} -when false: - const - PRIORITY_RESIZE* = G_PRIORITY_HIGH_IDLE + 10 -proc check_version*(required_major: guint, required_minor: guint, - required_micro: guint): cstring{.cdecl, dynlib: lib, - importc: "gtk_check_version".} -proc disable_setlocale*(){.cdecl, dynlib: lib, importc: "gtk_disable_setlocale".} -proc set_locale*(): cstring{.cdecl, dynlib: lib, importc: "gtk_set_locale".} -proc get_default_language*(): pango.PLanguage{.cdecl, dynlib: lib, - importc: "gtk_get_default_language".} -proc events_pending*(): gint{.cdecl, dynlib: lib, importc: "gtk_events_pending".} -proc main_do_event*(event: gdk2.PEvent){.cdecl, dynlib: lib, - importc: "gtk_main_do_event".} -proc main*(){.cdecl, dynlib: lib, importc: "gtk_main".} -proc init*(argc, argv: pointer){.cdecl, dynlib: lib, importc: "gtk_init".} -proc main_level*(): guint{.cdecl, dynlib: lib, importc: "gtk_main_level".} -proc main_quit*(){.cdecl, dynlib: lib, importc: "gtk_main_quit".} -proc main_iteration*(): gboolean{.cdecl, dynlib: lib, - importc: "gtk_main_iteration".} -proc main_iteration_do*(blocking: gboolean): gboolean{.cdecl, dynlib: lib, - importc: "gtk_main_iteration_do".} -proc gtkTrue*(): gboolean{.cdecl, dynlib: lib, importc: "gtk_true".} -proc gtkFalse*(): gboolean{.cdecl, dynlib: lib, importc: "gtk_false".} -proc grab_add*(widget: PWidget){.cdecl, dynlib: lib, importc: "gtk_grab_add".} -proc grab_get_current*(): PWidget{.cdecl, dynlib: lib, - importc: "gtk_grab_get_current".} -proc grab_remove*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_grab_remove".} -proc init_add*(`function`: TFunction, data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_init_add".} -proc quit_add_destroy*(main_level: guint, anObject: PObject){.cdecl, - dynlib: lib, importc: "gtk_quit_add_destroy".} -proc quit_add*(main_level: guint, `function`: TFunction, data: gpointer): guint{. - cdecl, dynlib: lib, importc: "gtk_quit_add".} -proc quit_add_full*(main_level: guint, `function`: TFunction, - marshal: TCallbackMarshal, data: gpointer, - destroy: TDestroyNotify): guint{.cdecl, dynlib: lib, - importc: "gtk_quit_add_full".} -proc quit_remove*(quit_handler_id: guint){.cdecl, dynlib: lib, - importc: "gtk_quit_remove".} -proc quit_remove_by_data*(data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_quit_remove_by_data".} -proc timeout_add*(interval: guint32, `function`: TFunction, data: gpointer): guint{. - cdecl, dynlib: lib, importc: "gtk_timeout_add".} -proc timeout_add_full*(interval: guint32, `function`: TFunction, - marshal: TCallbackMarshal, data: gpointer, - destroy: TDestroyNotify): guint{.cdecl, dynlib: lib, - importc: "gtk_timeout_add_full".} -proc timeout_remove*(timeout_handler_id: guint){.cdecl, dynlib: lib, - importc: "gtk_timeout_remove".} -proc idle_add*(`function`: TFunction, data: gpointer): guint{.cdecl, - dynlib: lib, importc: "gtk_idle_add".} -proc idle_add_priority*(priority: gint, `function`: TFunction, data: gpointer): guint{. - cdecl, dynlib: lib, importc: "gtk_idle_add_priority".} -proc idle_add_full*(priority: gint, `function`: TFunction, - marshal: TCallbackMarshal, data: gpointer, - destroy: TDestroyNotify): guint{.cdecl, dynlib: lib, - importc: "gtk_idle_add_full".} -proc idle_remove*(idle_handler_id: guint){.cdecl, dynlib: lib, - importc: "gtk_idle_remove".} -proc idle_remove_by_data*(data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_idle_remove_by_data".} -proc input_add_full*(source: gint, condition: gdk2.TInputCondition, - `function`: gdk2.TInputFunction, marshal: TCallbackMarshal, - data: gpointer, destroy: TDestroyNotify): guint{.cdecl, - dynlib: lib, importc: "gtk_input_add_full".} -proc input_remove*(input_handler_id: guint){.cdecl, dynlib: lib, - importc: "gtk_input_remove".} -proc key_snooper_install*(snooper: TKeySnoopFunc, func_data: gpointer): guint{. - cdecl, dynlib: lib, importc: "gtk_key_snooper_install".} -proc key_snooper_remove*(snooper_handler_id: guint){.cdecl, dynlib: lib, - importc: "gtk_key_snooper_remove".} -proc get_current_event*(): gdk2.PEvent{.cdecl, dynlib: lib, - importc: "gtk_get_current_event".} -proc get_current_event_time*(): guint32{.cdecl, dynlib: lib, - importc: "gtk_get_current_event_time".} -proc get_current_event_state*(state: gdk2.PModifierType): gboolean{.cdecl, - dynlib: lib, importc: "gtk_get_current_event_state".} -proc get_event_widget*(event: gdk2.PEvent): PWidget{.cdecl, dynlib: lib, - importc: "gtk_get_event_widget".} -proc propagate_event*(widget: PWidget, event: gdk2.PEvent){.cdecl, dynlib: lib, - importc: "gtk_propagate_event".} -proc boolean_handled_accumulator*(ihint: PGSignalInvocationHint, - return_accu: PGValue, handler_return: PGValue, - dummy: gpointer): gboolean{.cdecl, - dynlib: lib, importc: "_gtk_boolean_handled_accumulator".} -proc find_module*(name: cstring, thetype: cstring): cstring{.cdecl, dynlib: lib, - importc: "_gtk_find_module".} -proc get_module_path*(thetype: cstring): PPgchar{.cdecl, dynlib: lib, - importc: "_gtk_get_module_path".} -proc TYPE_MENU_BAR*(): GType -proc MENU_BAR*(obj: pointer): PMenuBar -proc MENU_BAR_CLASS*(klass: pointer): PMenuBarClass -proc IS_MENU_BAR*(obj: pointer): bool -proc IS_MENU_BAR_CLASS*(klass: pointer): bool -proc MENU_BAR_GET_CLASS*(obj: pointer): PMenuBarClass -proc menu_bar_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_menu_bar_get_type".} -proc menu_bar_new*(): PMenuBar{.cdecl, dynlib: lib, importc: "gtk_menu_bar_new".} -proc cycle_focus*(menubar: PMenuBar, dir: TDirectionType){.cdecl, - dynlib: lib, importc: "_gtk_menu_bar_cycle_focus".} -proc TYPE_MESSAGE_DIALOG*(): GType -proc MESSAGE_DIALOG*(obj: pointer): PMessageDialog -proc MESSAGE_DIALOG_CLASS*(klass: pointer): PMessageDialogClass -proc IS_MESSAGE_DIALOG*(obj: pointer): bool -proc IS_MESSAGE_DIALOG_CLASS*(klass: pointer): bool -proc MESSAGE_DIALOG_GET_CLASS*(obj: pointer): PMessageDialogClass -proc message_dialog_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_message_dialog_get_type".} -const - bm_TGtkNotebook_show_tabs* = 0x0001'i16 - bp_TGtkNotebook_show_tabs* = 0'i16 - bm_TGtkNotebook_homogeneous* = 0x0002'i16 - bp_TGtkNotebook_homogeneous* = 1'i16 - bm_TGtkNotebook_show_border* = 0x0004'i16 - bp_TGtkNotebook_show_border* = 2'i16 - bm_TGtkNotebook_tab_pos* = 0x0018'i16 - bp_TGtkNotebook_tab_pos* = 3'i16 - bm_TGtkNotebook_scrollable* = 0x0020'i16 - bp_TGtkNotebook_scrollable* = 5'i16 - bm_TGtkNotebook_in_child* = 0x00C0'i16 - bp_TGtkNotebook_in_child* = 6'i16 - bm_TGtkNotebook_click_child* = 0x0300'i16 - bp_TGtkNotebook_click_child* = 8'i16 - bm_TGtkNotebook_button* = 0x0C00'i16 - bp_TGtkNotebook_button* = 10'i16 - bm_TGtkNotebook_need_timer* = 0x1000'i16 - bp_TGtkNotebook_need_timer* = 12'i16 - bm_TGtkNotebook_child_has_focus* = 0x2000'i16 - bp_TGtkNotebook_child_has_focus* = 13'i16 - bm_TGtkNotebook_have_visible_child* = 0x4000'i16 - bp_TGtkNotebook_have_visible_child* = 14'i16 - bm_TGtkNotebook_focus_out* = 0x8000'i16 - bp_TGtkNotebook_focus_out* = 15'i16 - -proc TYPE_NOTEBOOK*(): GType -proc NOTEBOOK*(obj: pointer): PNotebook -proc NOTEBOOK_CLASS*(klass: pointer): PNotebookClass -proc IS_NOTEBOOK*(obj: pointer): bool -proc IS_NOTEBOOK_CLASS*(klass: pointer): bool -proc NOTEBOOK_GET_CLASS*(obj: pointer): PNotebookClass -proc show_tabs*(a: PNotebook): guint -proc set_show_tabs*(a: PNotebook, `show_tabs`: guint) -proc homogeneous*(a: PNotebook): guint -proc set_homogeneous*(a: PNotebook, `homogeneous`: guint) -proc show_border*(a: PNotebook): guint -proc set_show_border*(a: PNotebook, `show_border`: guint) -proc tab_pos*(a: PNotebook): guint -proc scrollable*(a: PNotebook): guint -proc set_scrollable*(a: PNotebook, `scrollable`: guint) -proc in_child*(a: PNotebook): guint -proc set_in_child*(a: PNotebook, `in_child`: guint) -proc click_child*(a: PNotebook): guint -proc set_click_child*(a: PNotebook, `click_child`: guint) -proc button*(a: PNotebook): guint -proc set_button*(a: PNotebook, `button`: guint) -proc need_timer*(a: PNotebook): guint -proc set_need_timer*(a: PNotebook, `need_timer`: guint) -proc child_has_focus*(a: PNotebook): guint -proc set_child_has_focus*(a: PNotebook, `child_has_focus`: guint) -proc have_visible_child*(a: PNotebook): guint -proc set_have_visible_child*(a: PNotebook, `have_visible_child`: guint) -proc focus_out*(a: PNotebook): guint -proc set_focus_out*(a: PNotebook, `focus_out`: guint) -proc notebook_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_notebook_get_type".} -proc notebook_new*(): PNotebook{.cdecl, dynlib: lib, importc: "gtk_notebook_new".} -proc append_page*(notebook: PNotebook, child: PWidget, - tab_label: PWidget): gint{.cdecl, dynlib: lib, - importc: "gtk_notebook_append_page".} -proc append_page_menu*(notebook: PNotebook, child: PWidget, - tab_label: PWidget, menu_label: PWidget): gint{. - cdecl, dynlib: lib, importc: "gtk_notebook_append_page_menu".} -proc prepend_page*(notebook: PNotebook, child: PWidget, - tab_label: PWidget): gint{.cdecl, dynlib: lib, - importc: "gtk_notebook_prepend_page".} -proc prepend_page_menu*(notebook: PNotebook, child: PWidget, - tab_label: PWidget, menu_label: PWidget): gint{. - cdecl, dynlib: lib, importc: "gtk_notebook_prepend_page_menu".} -proc insert_page*(notebook: PNotebook, child: PWidget, - tab_label: PWidget, position: gint): gint{.cdecl, - dynlib: lib, importc: "gtk_notebook_insert_page".} -proc insert_page_menu*(notebook: PNotebook, child: PWidget, - tab_label: PWidget, menu_label: PWidget, - position: gint): gint{.cdecl, dynlib: lib, - importc: "gtk_notebook_insert_page_menu".} -proc remove_page*(notebook: PNotebook, page_num: gint){.cdecl, - dynlib: lib, importc: "gtk_notebook_remove_page".} -proc get_current_page*(notebook: PNotebook): gint{.cdecl, dynlib: lib, - importc: "gtk_notebook_get_current_page".} -proc get_n_pages*(notebook: PNotebook): gint{.cdecl, dynlib: lib, - importc: "gtk_notebook_get_n_pages".} -proc get_nth_page*(notebook: PNotebook, page_num: gint): PWidget{. - cdecl, dynlib: lib, importc: "gtk_notebook_get_nth_page".} -proc page_num*(notebook: PNotebook, child: PWidget): gint{.cdecl, - dynlib: lib, importc: "gtk_notebook_page_num".} -proc set_current_page*(notebook: PNotebook, page_num: gint){.cdecl, - dynlib: lib, importc: "gtk_notebook_set_current_page".} -proc next_page*(notebook: PNotebook){.cdecl, dynlib: lib, - importc: "gtk_notebook_next_page".} -proc prev_page*(notebook: PNotebook){.cdecl, dynlib: lib, - importc: "gtk_notebook_prev_page".} -proc set_show_border*(notebook: PNotebook, show_border: gboolean){. - cdecl, dynlib: lib, importc: "gtk_notebook_set_show_border".} -proc get_show_border*(notebook: PNotebook): gboolean{.cdecl, - dynlib: lib, importc: "gtk_notebook_get_show_border".} -proc set_show_tabs*(notebook: PNotebook, show_tabs: gboolean){.cdecl, - dynlib: lib, importc: "gtk_notebook_set_show_tabs".} -proc get_show_tabs*(notebook: PNotebook): gboolean{.cdecl, dynlib: lib, - importc: "gtk_notebook_get_show_tabs".} -#proc set_tab_pos*(notebook: PNotebook, pos: TPositionType){.cdecl, -# dynlib: lib, importc: "gtk_notebook_set_tab_pos".} -proc get_tab_pos*(notebook: PNotebook): TPositionType{.cdecl, - dynlib: lib, importc: "gtk_notebook_get_tab_pos".} -proc set_scrollable*(notebook: PNotebook, scrollable: gboolean){.cdecl, - dynlib: lib, importc: "gtk_notebook_set_scrollable".} -proc get_scrollable*(notebook: PNotebook): gboolean{.cdecl, - dynlib: lib, importc: "gtk_notebook_get_scrollable".} -proc set_tab_reorderable*(notebook: PNotebook, child: PWidget, b: bool){.cdecl, - dynlib: lib, importc: "gtk_notebook_set_tab_reorderable".} -proc get_tab_reorderable*(notebook: PNotebook, child: PWidget): bool {.cdecl, - dynlib: lib, importc: "gtk_notebook_get_tab_reorderable".} -proc popup_enable*(notebook: PNotebook){.cdecl, dynlib: lib, - importc: "gtk_notebook_popup_enable".} -proc popup_disable*(notebook: PNotebook){.cdecl, dynlib: lib, - importc: "gtk_notebook_popup_disable".} -proc get_tab_label*(notebook: PNotebook, child: PWidget): PWidget{. - cdecl, dynlib: lib, importc: "gtk_notebook_get_tab_label".} -proc set_tab_label*(notebook: PNotebook, child: PWidget, - tab_label: PWidget){.cdecl, dynlib: lib, - importc: "gtk_notebook_set_tab_label".} -proc set_tab_label_text*(notebook: PNotebook, child: PWidget, - tab_text: cstring){.cdecl, dynlib: lib, - importc: "gtk_notebook_set_tab_label_text".} -proc get_tab_label_text*(notebook: PNotebook, child: PWidget): cstring{. - cdecl, dynlib: lib, importc: "gtk_notebook_get_tab_label_text".} -proc get_menu_label*(notebook: PNotebook, child: PWidget): PWidget{. - cdecl, dynlib: lib, importc: "gtk_notebook_get_menu_label".} -proc set_menu_label*(notebook: PNotebook, child: PWidget, - menu_label: PWidget){.cdecl, dynlib: lib, - importc: "gtk_notebook_set_menu_label".} -proc set_menu_label_text*(notebook: PNotebook, child: PWidget, - menu_text: cstring){.cdecl, dynlib: lib, - importc: "gtk_notebook_set_menu_label_text".} -proc get_menu_label_text*(notebook: PNotebook, child: PWidget): cstring{. - cdecl, dynlib: lib, importc: "gtk_notebook_get_menu_label_text".} -proc query_tab_label_packing*(notebook: PNotebook, child: PWidget, - expand: Pgboolean, fill: Pgboolean, - pack_type: PPackType){.cdecl, - dynlib: lib, importc: "gtk_notebook_query_tab_label_packing".} -proc set_tab_label_packing*(notebook: PNotebook, child: PWidget, - expand: gboolean, fill: gboolean, - pack_type: TPackType){.cdecl, dynlib: lib, - importc: "gtk_notebook_set_tab_label_packing".} -proc reorder_child*(notebook: PNotebook, child: PWidget, position: gint){. - cdecl, dynlib: lib, importc: "gtk_notebook_reorder_child".} -const - bm_TGtkOldEditable_has_selection* = 0x0001'i16 - bp_TGtkOldEditable_has_selection* = 0'i16 - bm_TGtkOldEditable_editable* = 0x0002'i16 - bp_TGtkOldEditable_editable* = 1'i16 - bm_TGtkOldEditable_visible* = 0x0004'i16 - bp_TGtkOldEditable_visible* = 2'i16 - -proc TYPE_OLD_EDITABLE*(): GType -proc OLD_EDITABLE*(obj: pointer): POldEditable -proc OLD_EDITABLE_CLASS*(klass: pointer): POldEditableClass -proc IS_OLD_EDITABLE*(obj: pointer): bool -proc IS_OLD_EDITABLE_CLASS*(klass: pointer): bool -proc OLD_EDITABLE_GET_CLASS*(obj: pointer): POldEditableClass -proc has_selection*(a: POldEditable): guint -proc set_has_selection*(a: POldEditable, `has_selection`: guint) -proc editable*(a: POldEditable): guint -proc set_editable*(a: POldEditable, `editable`: guint) -proc visible*(a: POldEditable): guint -proc set_visible*(a: POldEditable, `visible`: guint) -proc old_editable_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_old_editable_get_type".} -proc claim_selection*(old_editable: POldEditable, claim: gboolean, - time: guint32){.cdecl, dynlib: lib, - importc: "gtk_old_editable_claim_selection".} -proc changed*(old_editable: POldEditable){.cdecl, dynlib: lib, - importc: "gtk_old_editable_changed".} -proc TYPE_OPTION_MENU*(): GType -proc OPTION_MENU*(obj: pointer): POptionMenu -proc OPTION_MENU_CLASS*(klass: pointer): POptionMenuClass -proc IS_OPTION_MENU*(obj: pointer): bool -proc IS_OPTION_MENU_CLASS*(klass: pointer): bool -proc OPTION_MENU_GET_CLASS*(obj: pointer): POptionMenuClass -proc option_menu_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_option_menu_get_type".} -proc option_menu_new*(): POptionMenu{.cdecl, dynlib: lib, - importc: "gtk_option_menu_new".} -proc get_menu*(option_menu: POptionMenu): PWidget{.cdecl, - dynlib: lib, importc: "gtk_option_menu_get_menu".} -proc set_menu*(option_menu: POptionMenu, menu: PWidget){.cdecl, - dynlib: lib, importc: "gtk_option_menu_set_menu".} -proc remove_menu*(option_menu: POptionMenu){.cdecl, dynlib: lib, - importc: "gtk_option_menu_remove_menu".} -proc get_history*(option_menu: POptionMenu): gint{.cdecl, - dynlib: lib, importc: "gtk_option_menu_get_history".} -proc set_history*(option_menu: POptionMenu, index: guint){.cdecl, - dynlib: lib, importc: "gtk_option_menu_set_history".} -const - bm_TGtkPixmap_build_insensitive* = 0x0001'i16 - bp_TGtkPixmap_build_insensitive* = 0'i16 - -proc TYPE_PIXMAP*(): GType -proc PIXMAP*(obj: pointer): PPixmap -proc PIXMAP_CLASS*(klass: pointer): PPixmapClass -proc IS_PIXMAP*(obj: pointer): bool -proc IS_PIXMAP_CLASS*(klass: pointer): bool -proc PIXMAP_GET_CLASS*(obj: pointer): PPixmapClass -proc build_insensitive*(a: PPixmap): guint -proc set_build_insensitive*(a: PPixmap, `build_insensitive`: guint) -proc pixmap_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_pixmap_get_type".} -proc pixmap_new*(pixmap: gdk2.PPixmap, mask: gdk2.PBitmap): PPixmap{.cdecl, - dynlib: lib, importc: "gtk_pixmap_new".} -proc set*(pixmap: PPixmap, val: gdk2.PPixmap, mask: gdk2.PBitmap){.cdecl, - dynlib: lib, importc: "gtk_pixmap_set".} -proc get*(pixmap: PPixmap, val: var gdk2.PPixmap, mask: var gdk2.PBitmap){. - cdecl, dynlib: lib, importc: "gtk_pixmap_get".} -proc set_build_insensitive*(pixmap: PPixmap, build: gboolean){.cdecl, - dynlib: lib, importc: "gtk_pixmap_set_build_insensitive".} -const - bm_TGtkPlug_same_app* = 0x0001'i16 - bp_TGtkPlug_same_app* = 0'i16 - -proc TYPE_PLUG*(): GType -proc PLUG*(obj: pointer): PPlug -proc PLUG_CLASS*(klass: pointer): PPlugClass -proc IS_PLUG*(obj: pointer): bool -proc IS_PLUG_CLASS*(klass: pointer): bool -proc PLUG_GET_CLASS*(obj: pointer): PPlugClass -proc same_app*(a: PPlug): guint -proc set_same_app*(a: PPlug, `same_app`: guint) -proc plug_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_plug_get_type".} -proc construct_for_display*(plug: PPlug, display: gdk2.PDisplay, - socket_id: gdk2.TNativeWindow){.cdecl, - dynlib: lib, importc: "gtk_plug_construct_for_display".} -proc plug_new_for_display*(display: gdk2.PDisplay, socket_id: gdk2.TNativeWindow): PPlug{. - cdecl, dynlib: lib, importc: "gtk_plug_new_for_display".} -proc get_id*(plug: PPlug): gdk2.TNativeWindow{.cdecl, dynlib: lib, - importc: "gtk_plug_get_id".} -proc add_to_socket*(plug: PPlug, socket: PSocket){.cdecl, dynlib: lib, - importc: "_gtk_plug_add_to_socket".} -proc remove_from_socket*(plug: PPlug, socket: PSocket){.cdecl, dynlib: lib, - importc: "_gtk_plug_remove_from_socket".} -const - bm_TGtkPreview_type* = 0x0001'i16 - bp_TGtkPreview_type* = 0'i16 - bm_TGtkPreview_expand* = 0x0002'i16 - bp_TGtkPreview_expand* = 1'i16 - -proc TYPE_PREVIEW*(): GType -proc PREVIEW*(obj: pointer): PPreview -proc PREVIEW_CLASS*(klass: pointer): PPreviewClass -proc IS_PREVIEW*(obj: pointer): bool -proc IS_PREVIEW_CLASS*(klass: pointer): bool -proc PREVIEW_GET_CLASS*(obj: pointer): PPreviewClass -proc get_type*(a: PPreview): guint -proc set_type*(a: PPreview, `type`: guint) -proc get_expand*(a: PPreview): guint -proc set_expand*(a: PPreview, `expand`: guint) -proc preview_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_preview_get_type".} -proc preview_uninit*(){.cdecl, dynlib: lib, importc: "gtk_preview_uninit".} -proc preview_new*(thetype: TPreviewClass): PPreview{.cdecl, dynlib: lib, - importc: "gtk_preview_new".} -proc size*(preview: PPreview, width: gint, height: gint){.cdecl, - dynlib: lib, importc: "gtk_preview_size".} -proc put*(preview: PPreview, window: gdk2.PWindow, gc: gdk2.PGC, srcx: gint, - srcy: gint, destx: gint, desty: gint, width: gint, - height: gint){.cdecl, dynlib: lib, importc: "gtk_preview_put".} -proc draw_row*(preview: PPreview, data: Pguchar, x: gint, y: gint, - w: gint){.cdecl, dynlib: lib, - importc: "gtk_preview_draw_row".} -proc set_expand*(preview: PPreview, expand: gboolean){.cdecl, - dynlib: lib, importc: "gtk_preview_set_expand".} -proc preview_set_gamma*(gamma: float64){.cdecl, dynlib: lib, - importc: "gtk_preview_set_gamma".} -proc preview_set_color_cube*(nred_shades: guint, ngreen_shades: guint, - nblue_shades: guint, ngray_shades: guint){.cdecl, - dynlib: lib, importc: "gtk_preview_set_color_cube".} -proc preview_set_install_cmap*(install_cmap: gint){.cdecl, dynlib: lib, - importc: "gtk_preview_set_install_cmap".} -proc preview_set_reserved*(nreserved: gint){.cdecl, dynlib: lib, - importc: "gtk_preview_set_reserved".} -proc set_dither*(preview: PPreview, dither: gdk2.TRgbDither){.cdecl, - dynlib: lib, importc: "gtk_preview_set_dither".} -proc preview_get_info*(): PPreviewInfo{.cdecl, dynlib: lib, - importc: "gtk_preview_get_info".} -proc preview_reset*(){.cdecl, dynlib: lib, importc: "gtk_preview_reset".} -const - bm_TGtkProgress_show_text* = 0x0001'i16 - bp_TGtkProgress_show_text* = 0'i16 - bm_TGtkProgress_activity_mode* = 0x0002'i16 - bp_TGtkProgress_activity_mode* = 1'i16 - bm_TGtkProgress_use_text_format* = 0x0004'i16 - bp_TGtkProgress_use_text_format* = 2'i16 - -proc show_text*(a: PProgress): guint -proc set_show_text*(a: PProgress, `show_text`: guint) -proc activity_mode*(a: PProgress): guint -proc set_activity_mode*(a: PProgress, `activity_mode`: guint) -proc use_text_format*(a: PProgress): guint -proc set_use_text_format*(a: PProgress, `use_text_format`: guint) -const - bm_TGtkProgressBar_activity_dir* = 0x0001'i16 - bp_TGtkProgressBar_activity_dir* = 0'i16 - -proc TYPE_PROGRESS_BAR*(): GType -proc PROGRESS_BAR*(obj: pointer): PProgressBar -proc PROGRESS_BAR_CLASS*(klass: pointer): PProgressBarClass -proc IS_PROGRESS_BAR*(obj: pointer): bool -proc IS_PROGRESS_BAR_CLASS*(klass: pointer): bool -proc PROGRESS_BAR_GET_CLASS*(obj: pointer): PProgressBarClass -proc activity_dir*(a: PProgressBar): guint -proc set_activity_dir*(a: PProgressBar, `activity_dir`: guint) -proc progress_bar_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_progress_bar_get_type".} -proc progress_bar_new*(): PProgressBar{.cdecl, dynlib: lib, - importc: "gtk_progress_bar_new".} -proc pulse*(pbar: PProgressBar){.cdecl, dynlib: lib, - importc: "gtk_progress_bar_pulse".} -proc set_text*(pbar: PProgressBar, text: cstring){.cdecl, - dynlib: lib, importc: "gtk_progress_bar_set_text".} -proc set_fraction*(pbar: PProgressBar, fraction: gdouble){.cdecl, - dynlib: lib, importc: "gtk_progress_bar_set_fraction".} -proc set_pulse_step*(pbar: PProgressBar, fraction: gdouble){.cdecl, - dynlib: lib, importc: "gtk_progress_bar_set_pulse_step".} -proc set_orientation*(pbar: PProgressBar, - orientation: TProgressBarOrientation){.cdecl, - dynlib: lib, importc: "gtk_progress_bar_set_orientation".} -proc get_text*(pbar: PProgressBar): cstring{.cdecl, dynlib: lib, - importc: "gtk_progress_bar_get_text".} -proc get_fraction*(pbar: PProgressBar): gdouble{.cdecl, - dynlib: lib, importc: "gtk_progress_bar_get_fraction".} -proc get_pulse_step*(pbar: PProgressBar): gdouble{.cdecl, - dynlib: lib, importc: "gtk_progress_bar_get_pulse_step".} -proc get_orientation*(pbar: PProgressBar): TProgressBarOrientation{. - cdecl, dynlib: lib, importc: "gtk_progress_bar_get_orientation".} -proc TYPE_RADIO_BUTTON*(): GType -proc RADIO_BUTTON*(obj: pointer): PRadioButton -proc RADIO_BUTTON_CLASS*(klass: pointer): PRadioButtonClass -proc IS_RADIO_BUTTON*(obj: pointer): bool -proc IS_RADIO_BUTTON_CLASS*(klass: pointer): bool -proc RADIO_BUTTON_GET_CLASS*(obj: pointer): PRadioButtonClass -proc radio_button_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_radio_button_get_type".} -proc radio_button_new*(group: PGSList): PRadioButton{.cdecl, dynlib: lib, - importc: "gtk_radio_button_new".} -proc new_from_widget*(group: PRadioButton): PRadioButton{.cdecl, - dynlib: lib, importc: "gtk_radio_button_new_from_widget".} -proc radio_button_new*(group: PGSList, `label`: cstring): PRadioButton{. - cdecl, dynlib: lib, importc: "gtk_radio_button_new_with_label".} -proc radio_button_new_with_label_from_widget*(group: PRadioButton, - `label`: cstring): PRadioButton{.cdecl, dynlib: lib, importc: "gtk_radio_button_new_with_label_from_widget".} -proc radio_button_new_with_mnemonic*(group: PGSList, `label`: cstring): PRadioButton{. - cdecl, dynlib: lib, importc: "gtk_radio_button_new_with_mnemonic".} -proc radio_button_new_with_mnemonic_from_widget*(group: PRadioButton, - `label`: cstring): PRadioButton{.cdecl, dynlib: lib, importc: "gtk_radio_button_new_with_mnemonic_from_widget".} -proc get_group*(radio_button: PRadioButton): PGSList{.cdecl, - dynlib: lib, importc: "gtk_radio_button_get_group".} -proc set_group*(radio_button: PRadioButton, group: PGSList){.cdecl, - dynlib: lib, importc: "gtk_radio_button_set_group".} -proc TYPE_RADIO_MENU_ITEM*(): GType -proc RADIO_MENU_ITEM*(obj: pointer): PRadioMenuItem -proc RADIO_MENU_ITEM_CLASS*(klass: pointer): PRadioMenuItemClass -proc IS_RADIO_MENU_ITEM*(obj: pointer): bool -proc IS_RADIO_MENU_ITEM_CLASS*(klass: pointer): bool -proc RADIO_MENU_ITEM_GET_CLASS*(obj: pointer): PRadioMenuItemClass -proc radio_menu_item_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_radio_menu_item_get_type".} -proc radio_menu_item_new*(group: PGSList): PRadioMenuItem{.cdecl, dynlib: lib, - importc: "gtk_radio_menu_item_new".} -proc radio_menu_item_new*(group: PGSList, `label`: cstring): PRadioMenuItem{. - cdecl, dynlib: lib, importc: "gtk_radio_menu_item_new_with_label".} -proc radio_menu_item_new_with_mnemonic*(group: PGSList, `label`: cstring): PRadioMenuItem{. - cdecl, dynlib: lib, importc: "gtk_radio_menu_item_new_with_mnemonic".} -proc item_get_group*(radio_menu_item: PRadioMenuItem): PGSList{. - cdecl, dynlib: lib, importc: "gtk_radio_menu_item_get_group".} -proc item_set_group*(radio_menu_item: PRadioMenuItem, group: PGSList){. - cdecl, dynlib: lib, importc: "gtk_radio_menu_item_set_group".} -const - bm_TGtkScrolledWindow_hscrollbar_policy* = 0x0003'i16 - bp_TGtkScrolledWindow_hscrollbar_policy* = 0'i16 - bm_TGtkScrolledWindow_vscrollbar_policy* = 0x000C'i16 - bp_TGtkScrolledWindow_vscrollbar_policy* = 2'i16 - bm_TGtkScrolledWindow_hscrollbar_visible* = 0x0010'i16 - bp_TGtkScrolledWindow_hscrollbar_visible* = 4'i16 - bm_TGtkScrolledWindow_vscrollbar_visible* = 0x0020'i16 - bp_TGtkScrolledWindow_vscrollbar_visible* = 5'i16 - bm_TGtkScrolledWindow_window_placement* = 0x00C0'i16 - bp_TGtkScrolledWindow_window_placement* = 6'i16 - bm_TGtkScrolledWindow_focus_out* = 0x0100'i16 - bp_TGtkScrolledWindow_focus_out* = 8'i16 - -proc TYPE_SCROLLED_WINDOW*(): GType -proc SCROLLED_WINDOW*(obj: pointer): PScrolledWindow -proc SCROLLED_WINDOW_CLASS*(klass: pointer): PScrolledWindowClass -proc IS_SCROLLED_WINDOW*(obj: pointer): bool -proc IS_SCROLLED_WINDOW_CLASS*(klass: pointer): bool -proc SCROLLED_WINDOW_GET_CLASS*(obj: pointer): PScrolledWindowClass -proc hscrollbar_policy*(a: PScrolledWindow): guint -proc set_hscrollbar_policy*(a: PScrolledWindow, `hscrollbar_policy`: guint) -proc vscrollbar_policy*(a: PScrolledWindow): guint -proc set_vscrollbar_policy*(a: PScrolledWindow, `vscrollbar_policy`: guint) -proc hscrollbar_visible*(a: PScrolledWindow): guint -proc set_hscrollbar_visible*(a: PScrolledWindow, `hscrollbar_visible`: guint) -proc vscrollbar_visible*(a: PScrolledWindow): guint -proc set_vscrollbar_visible*(a: PScrolledWindow, `vscrollbar_visible`: guint) -proc window_placement*(a: PScrolledWindow): guint -proc set_window_placement*(a: PScrolledWindow, `window_placement`: guint) -proc focus_out*(a: PScrolledWindow): guint -proc set_focus_out*(a: PScrolledWindow, `focus_out`: guint) -proc scrolled_window_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_scrolled_window_get_type".} -proc scrolled_window_new*(hadjustment: PAdjustment, vadjustment: PAdjustment): PScrolledWindow{. - cdecl, dynlib: lib, importc: "gtk_scrolled_window_new".} -proc set_hadjustment*(scrolled_window: PScrolledWindow, - hadjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_scrolled_window_set_hadjustment".} -proc set_vadjustment*(scrolled_window: PScrolledWindow, - hadjustment: PAdjustment){.cdecl, - dynlib: lib, importc: "gtk_scrolled_window_set_vadjustment".} -proc get_hadjustment*(scrolled_window: PScrolledWindow): PAdjustment{. - cdecl, dynlib: lib, importc: "gtk_scrolled_window_get_hadjustment".} -proc get_vadjustment*(scrolled_window: PScrolledWindow): PAdjustment{. - cdecl, dynlib: lib, importc: "gtk_scrolled_window_get_vadjustment".} -proc set_policy*(scrolled_window: PScrolledWindow, - hscrollbar_policy: TPolicyType, - vscrollbar_policy: TPolicyType){.cdecl, - dynlib: lib, importc: "gtk_scrolled_window_set_policy".} -proc get_policy*(scrolled_window: PScrolledWindow, - hscrollbar_policy: PPolicyType, - vscrollbar_policy: PPolicyType){.cdecl, - dynlib: lib, importc: "gtk_scrolled_window_get_policy".} -proc set_placement*(scrolled_window: PScrolledWindow, - window_placement: TCornerType){.cdecl, - dynlib: lib, importc: "gtk_scrolled_window_set_placement".} -proc get_placement*(scrolled_window: PScrolledWindow): TCornerType{. - cdecl, dynlib: lib, importc: "gtk_scrolled_window_get_placement".} -proc set_shadow_type*(scrolled_window: PScrolledWindow, - thetype: TShadowType){.cdecl, dynlib: lib, - importc: "gtk_scrolled_window_set_shadow_type".} -proc get_shadow_type*(scrolled_window: PScrolledWindow): TShadowType{. - cdecl, dynlib: lib, importc: "gtk_scrolled_window_get_shadow_type".} -proc add_with_viewport*(scrolled_window: PScrolledWindow, - child: PWidget){.cdecl, dynlib: lib, - importc: "gtk_scrolled_window_add_with_viewport".} -proc TYPE_SELECTION_DATA*(): GType -proc list_new*(targets: PTargetEntry, ntargets: guint): PTargetList{. - cdecl, dynlib: lib, importc: "gtk_target_list_new".} -proc reference*(list: PTargetList){.cdecl, dynlib: lib, - importc: "gtk_target_list_ref".} -proc unref*(list: PTargetList){.cdecl, dynlib: lib, - importc: "gtk_target_list_unref".} -proc add*(list: PTargetList, target: gdk2.TAtom, flags: guint, - info: guint){.cdecl, dynlib: lib, - importc: "gtk_target_list_add".} -proc add_table*(list: PTargetList, targets: PTargetEntry, - ntargets: guint){.cdecl, dynlib: lib, - importc: "gtk_target_list_add_table".} -proc remove*(list: PTargetList, target: gdk2.TAtom){.cdecl, - dynlib: lib, importc: "gtk_target_list_remove".} -proc find*(list: PTargetList, target: gdk2.TAtom, info: Pguint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_target_list_find".} -proc selection_owner_set*(widget: PWidget, selection: gdk2.TAtom, time: guint32): gboolean{. - cdecl, dynlib: lib, importc: "gtk_selection_owner_set".} -proc selection_owner_set_for_display*(display: gdk2.PDisplay, widget: PWidget, - selection: gdk2.TAtom, time: guint32): gboolean{. - cdecl, dynlib: lib, importc: "gtk_selection_owner_set_for_display".} -proc selection_add_target*(widget: PWidget, selection: gdk2.TAtom, - target: gdk2.TAtom, info: guint){.cdecl, dynlib: lib, - importc: "gtk_selection_add_target".} -proc selection_add_targets*(widget: PWidget, selection: gdk2.TAtom, - targets: PTargetEntry, ntargets: guint){.cdecl, - dynlib: lib, importc: "gtk_selection_add_targets".} -proc selection_clear_targets*(widget: PWidget, selection: gdk2.TAtom){.cdecl, - dynlib: lib, importc: "gtk_selection_clear_targets".} -proc selection_convert*(widget: PWidget, selection: gdk2.TAtom, target: gdk2.TAtom, - time: guint32): gboolean{.cdecl, dynlib: lib, - importc: "gtk_selection_convert".} -proc set*(selection_data: PSelectionData, thetype: gdk2.TAtom, - format: gint, data: Pguchar, length: gint){.cdecl, - dynlib: lib, importc: "gtk_selection_data_set".} -proc set_text*(selection_data: PSelectionData, str: cstring, - len: gint): gboolean{.cdecl, dynlib: lib, - importc: "gtk_selection_data_set_text".} -proc get_text*(selection_data: PSelectionData): Pguchar{.cdecl, - dynlib: lib, importc: "gtk_selection_data_get_text".} -proc targets_include_text*(selection_data: PSelectionData): gboolean{. - cdecl, dynlib: lib, importc: "gtk_selection_data_targets_include_text".} -proc selection_remove_all*(widget: PWidget){.cdecl, dynlib: lib, - importc: "gtk_selection_remove_all".} -proc selection_clear*(widget: PWidget, event: gdk2.PEventSelection): gboolean{. - cdecl, dynlib: lib, importc: "gtk_selection_clear".} -proc selection_request*(widget: PWidget, event: gdk2.PEventSelection): gboolean{. - cdecl, dynlib: lib, importc: "gtk_selection_request".} -proc selection_incr_event*(window: gdk2.PWindow, event: gdk2.PEventProperty): gboolean{. - cdecl, dynlib: lib, importc: "gtk_selection_incr_event".} -proc selection_notify*(widget: PWidget, event: gdk2.PEventSelection): gboolean{. - cdecl, dynlib: lib, importc: "gtk_selection_notify".} -proc selection_property_notify*(widget: PWidget, event: gdk2.PEventProperty): gboolean{. - cdecl, dynlib: lib, importc: "gtk_selection_property_notify".} -proc selection_data_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_selection_data_get_type".} -proc copy*(data: PSelectionData): PSelectionData{.cdecl, - dynlib: lib, importc: "gtk_selection_data_copy".} -proc free*(data: PSelectionData){.cdecl, dynlib: lib, - importc: "gtk_selection_data_free".} -proc TYPE_SEPARATOR_MENU_ITEM*(): GType -proc SEPARATOR_MENU_ITEM*(obj: pointer): PSeparatorMenuItem -proc SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): PSeparatorMenuItemClass -proc IS_SEPARATOR_MENU_ITEM*(obj: pointer): bool -proc IS_SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): bool -proc SEPARATOR_MENU_ITEM_GET_CLASS*(obj: pointer): PSeparatorMenuItemClass -proc separator_menu_item_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_separator_menu_item_get_type".} -proc separator_menu_item_new*(): PSeparatorMenuItem{.cdecl, dynlib: lib, - importc: "gtk_separator_menu_item_new".} -const - bm_TGtkSizeGroup_have_width* = 0x0001'i16 - bp_TGtkSizeGroup_have_width* = 0'i16 - bm_TGtkSizeGroup_have_height* = 0x0002'i16 - bp_TGtkSizeGroup_have_height* = 1'i16 - -proc TYPE_SIZE_GROUP*(): GType -proc SIZE_GROUP*(obj: pointer): PSizeGroup -proc SIZE_GROUP_CLASS*(klass: pointer): PSizeGroupClass -proc IS_SIZE_GROUP*(obj: pointer): bool -proc IS_SIZE_GROUP_CLASS*(klass: pointer): bool -proc SIZE_GROUP_GET_CLASS*(obj: pointer): PSizeGroupClass -proc have_width*(a: PSizeGroup): guint -proc set_have_width*(a: PSizeGroup, `have_width`: guint) -proc have_height*(a: PSizeGroup): guint -proc set_have_height*(a: PSizeGroup, `have_height`: guint) -proc size_group_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_size_group_get_type".} -proc size_group_new*(mode: TSizeGroupMode): PSizeGroup{.cdecl, dynlib: lib, - importc: "gtk_size_group_new".} -proc set_mode*(size_group: PSizeGroup, mode: TSizeGroupMode){.cdecl, - dynlib: lib, importc: "gtk_size_group_set_mode".} -proc get_mode*(size_group: PSizeGroup): TSizeGroupMode{.cdecl, - dynlib: lib, importc: "gtk_size_group_get_mode".} -proc add_widget*(size_group: PSizeGroup, widget: PWidget){.cdecl, - dynlib: lib, importc: "gtk_size_group_add_widget".} -proc remove_widget*(size_group: PSizeGroup, widget: PWidget){.cdecl, - dynlib: lib, importc: "gtk_size_group_remove_widget".} -proc size_group_get_child_requisition*(widget: PWidget, - requisition: PRequisition){.cdecl, - dynlib: lib, importc: "_gtk_size_group_get_child_requisition".} -proc size_group_compute_requisition*(widget: PWidget, requisition: PRequisition){. - cdecl, dynlib: lib, importc: "_gtk_size_group_compute_requisition".} -proc size_group_queue_resize*(widget: PWidget){.cdecl, dynlib: lib, - importc: "_gtk_size_group_queue_resize".} -const - bm_TGtkSocket_same_app* = 0x0001'i16 - bp_TGtkSocket_same_app* = 0'i16 - bm_TGtkSocket_focus_in* = 0x0002'i16 - bp_TGtkSocket_focus_in* = 1'i16 - bm_TGtkSocket_have_size* = 0x0004'i16 - bp_TGtkSocket_have_size* = 2'i16 - bm_TGtkSocket_need_map* = 0x0008'i16 - bp_TGtkSocket_need_map* = 3'i16 - bm_TGtkSocket_is_mapped* = 0x0010'i16 - bp_TGtkSocket_is_mapped* = 4'i16 - -proc TYPE_SOCKET*(): GType -proc SOCKET*(obj: pointer): PSocket -proc SOCKET_CLASS*(klass: pointer): PSocketClass -proc IS_SOCKET*(obj: pointer): bool -proc IS_SOCKET_CLASS*(klass: pointer): bool -proc SOCKET_GET_CLASS*(obj: pointer): PSocketClass -proc same_app*(a: PSocket): guint -proc set_same_app*(a: PSocket, `same_app`: guint) -proc focus_in*(a: PSocket): guint -proc set_focus_in*(a: PSocket, `focus_in`: guint) -proc have_size*(a: PSocket): guint -proc set_have_size*(a: PSocket, `have_size`: guint) -proc need_map*(a: PSocket): guint -proc set_need_map*(a: PSocket, `need_map`: guint) -proc is_mapped*(a: PSocket): guint -proc set_is_mapped*(a: PSocket, `is_mapped`: guint) -proc socket_new*(): PSocket{.cdecl, dynlib: lib, importc: "gtk_socket_new".} -proc socket_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_socket_get_type".} -proc add_id*(socket: PSocket, window_id: gdk2.TNativeWindow){.cdecl, - dynlib: lib, importc: "gtk_socket_add_id".} -proc get_id*(socket: PSocket): gdk2.TNativeWindow{.cdecl, dynlib: lib, - importc: "gtk_socket_get_id".} -const - INPUT_ERROR* = - (1) - bm_TGtkSpinButton_in_child* = 0x00000003'i32 - bp_TGtkSpinButton_in_child* = 0'i32 - bm_TGtkSpinButton_click_child* = 0x0000000C'i32 - bp_TGtkSpinButton_click_child* = 2'i32 - bm_TGtkSpinButton_button* = 0x00000030'i32 - bp_TGtkSpinButton_button* = 4'i32 - bm_TGtkSpinButton_need_timer* = 0x00000040'i32 - bp_TGtkSpinButton_need_timer* = 6'i32 - bm_TGtkSpinButton_timer_calls* = 0x00000380'i32 - bp_TGtkSpinButton_timer_calls* = 7'i32 - bm_TGtkSpinButton_digits* = 0x000FFC00'i32 - bp_TGtkSpinButton_digits* = 10'i32 - bm_TGtkSpinButton_numeric* = 0x00100000'i32 - bp_TGtkSpinButton_numeric* = 20'i32 - bm_TGtkSpinButton_wrap* = 0x00200000'i32 - bp_TGtkSpinButton_wrap* = 21'i32 - bm_TGtkSpinButton_snap_to_ticks* = 0x00400000'i32 - bp_TGtkSpinButton_snap_to_ticks* = 22'i32 - -proc TYPE_SPIN_BUTTON*(): GType -proc SPIN_BUTTON*(obj: pointer): PSpinButton -proc SPIN_BUTTON_CLASS*(klass: pointer): PSpinButtonClass -proc IS_SPIN_BUTTON*(obj: pointer): bool -proc IS_SPIN_BUTTON_CLASS*(klass: pointer): bool -proc SPIN_BUTTON_GET_CLASS*(obj: pointer): PSpinButtonClass -proc in_child*(a: PSpinButton): guint -proc set_in_child*(a: PSpinButton, `in_child`: guint) -proc click_child*(a: PSpinButton): guint -proc set_click_child*(a: PSpinButton, `click_child`: guint) -proc button*(a: PSpinButton): guint -proc set_button*(a: PSpinButton, `button`: guint) -proc need_timer*(a: PSpinButton): guint -proc set_need_timer*(a: PSpinButton, `need_timer`: guint) -proc timer_calls*(a: PSpinButton): guint -proc set_timer_calls*(a: PSpinButton, `timer_calls`: guint) -proc digits*(a: PSpinButton): guint -proc set_digits*(a: PSpinButton, `digits`: guint) -proc numeric*(a: PSpinButton): guint -proc set_numeric*(a: PSpinButton, `numeric`: guint) -proc wrap*(a: PSpinButton): guint -proc set_wrap*(a: PSpinButton, `wrap`: guint) -proc snap_to_ticks*(a: PSpinButton): guint -proc set_snap_to_ticks*(a: PSpinButton, `snap_to_ticks`: guint) -proc spin_button_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_spin_button_get_type".} -proc configure*(spin_button: PSpinButton, adjustment: PAdjustment, - climb_rate: gdouble, digits: guint){.cdecl, - dynlib: lib, importc: "gtk_spin_button_configure".} -proc spin_button_new*(adjustment: PAdjustment, climb_rate: gdouble, - digits: guint): PSpinButton{.cdecl, dynlib: lib, - importc: "gtk_spin_button_new".} -proc spin_button_new*(min: gdouble, max: gdouble, step: gdouble): PSpinButton{. - cdecl, dynlib: lib, importc: "gtk_spin_button_new_with_range".} -proc set_adjustment*(spin_button: PSpinButton, - adjustment: PAdjustment){.cdecl, dynlib: lib, - importc: "gtk_spin_button_set_adjustment".} -proc get_adjustment*(spin_button: PSpinButton): PAdjustment{.cdecl, - dynlib: lib, importc: "gtk_spin_button_get_adjustment".} -proc set_digits*(spin_button: PSpinButton, digits: guint){.cdecl, - dynlib: lib, importc: "gtk_spin_button_set_digits".} -proc get_digits*(spin_button: PSpinButton): guint{.cdecl, - dynlib: lib, importc: "gtk_spin_button_get_digits".} -proc set_increments*(spin_button: PSpinButton, step: gdouble, - page: gdouble){.cdecl, dynlib: lib, - importc: "gtk_spin_button_set_increments".} -proc get_increments*(spin_button: PSpinButton, step: Pgdouble, - page: Pgdouble){.cdecl, dynlib: lib, - importc: "gtk_spin_button_get_increments".} -proc set_range*(spin_button: PSpinButton, min: gdouble, max: gdouble){. - cdecl, dynlib: lib, importc: "gtk_spin_button_set_range".} -proc get_range*(spin_button: PSpinButton, min: Pgdouble, - max: Pgdouble){.cdecl, dynlib: lib, - importc: "gtk_spin_button_get_range".} -proc get_value*(spin_button: PSpinButton): gdouble{.cdecl, - dynlib: lib, importc: "gtk_spin_button_get_value".} -proc get_value_as_int*(spin_button: PSpinButton): gint{.cdecl, - dynlib: lib, importc: "gtk_spin_button_get_value_as_int".} -proc set_value*(spin_button: PSpinButton, value: gdouble){.cdecl, - dynlib: lib, importc: "gtk_spin_button_set_value".} -proc set_update_policy*(spin_button: PSpinButton, - policy: TSpinButtonUpdatePolicy){.cdecl, - dynlib: lib, importc: "gtk_spin_button_set_update_policy".} -proc get_update_policy*(spin_button: PSpinButton): TSpinButtonUpdatePolicy{. - cdecl, dynlib: lib, importc: "gtk_spin_button_get_update_policy".} -proc set_numeric*(spin_button: PSpinButton, numeric: gboolean){. - cdecl, dynlib: lib, importc: "gtk_spin_button_set_numeric".} -proc get_numeric*(spin_button: PSpinButton): gboolean{.cdecl, - dynlib: lib, importc: "gtk_spin_button_get_numeric".} -proc spin*(spin_button: PSpinButton, direction: TSpinType, - increment: gdouble){.cdecl, dynlib: lib, - importc: "gtk_spin_button_spin".} -proc set_wrap*(spin_button: PSpinButton, wrap: gboolean){.cdecl, - dynlib: lib, importc: "gtk_spin_button_set_wrap".} -proc get_wrap*(spin_button: PSpinButton): gboolean{.cdecl, - dynlib: lib, importc: "gtk_spin_button_get_wrap".} -proc set_snap_to_ticks*(spin_button: PSpinButton, - snap_to_ticks: gboolean){.cdecl, - dynlib: lib, importc: "gtk_spin_button_set_snap_to_ticks".} -proc get_snap_to_ticks*(spin_button: PSpinButton): gboolean{.cdecl, - dynlib: lib, importc: "gtk_spin_button_get_snap_to_ticks".} -proc update*(spin_button: PSpinButton){.cdecl, dynlib: lib, - importc: "gtk_spin_button_update".} -const - STOCK_DIALOG_INFO* = "gtk-dialog-info" - STOCK_DIALOG_WARNING* = "gtk-dialog-warning" - STOCK_DIALOG_ERROR* = "gtk-dialog-error" - STOCK_DIALOG_QUESTION* = "gtk-dialog-question" - STOCK_DND* = "gtk-dnd" - STOCK_DND_MULTIPLE* = "gtk-dnd-multiple" - STOCK_ABOUT* = "gtk-about" - STOCK_ADD_name* = "gtk-add" - STOCK_APPLY* = "gtk-apply" - STOCK_BOLD* = "gtk-bold" - STOCK_CANCEL* = "gtk-cancel" - STOCK_CDROM* = "gtk-cdrom" - STOCK_CLEAR* = "gtk-clear" - STOCK_CLOSE* = "gtk-close" - STOCK_COLOR_PICKER* = "gtk-color-picker" - STOCK_CONVERT* = "gtk-convert" - STOCK_CONNECT* = "gtk-connect" - STOCK_COPY* = "gtk-copy" - STOCK_CUT* = "gtk-cut" - STOCK_DELETE* = "gtk-delete" - STOCK_EDIT* = "gtk-edit" - STOCK_EXECUTE* = "gtk-execute" - STOCK_FIND* = "gtk-find" - STOCK_FIND_AND_REPLACE* = "gtk-find-and-replace" - STOCK_FLOPPY* = "gtk-floppy" - STOCK_GOTO_BOTTOM* = "gtk-goto-bottom" - STOCK_GOTO_FIRST* = "gtk-goto-first" - STOCK_GOTO_LAST* = "gtk-goto-last" - STOCK_GOTO_TOP* = "gtk-goto-top" - STOCK_GO_BACK* = "gtk-go-back" - STOCK_GO_DOWN* = "gtk-go-down" - STOCK_GO_FORWARD* = "gtk-go-forward" - STOCK_GO_UP* = "gtk-go-up" - STOCK_HELP* = "gtk-help" - STOCK_HOME* = "gtk-home" - STOCK_INDEX* = "gtk-index" - STOCK_ITALIC* = "gtk-italic" - STOCK_JUMP_TO* = "gtk-jump-to" - STOCK_JUSTIFY_CENTER* = "gtk-justify-center" - STOCK_JUSTIFY_FILL* = "gtk-justify-fill" - STOCK_JUSTIFY_LEFT* = "gtk-justify-left" - STOCK_JUSTIFY_RIGHT* = "gtk-justify-right" - STOCK_MEDIA_FORWARD* = "gtk-media-forward" - STOCK_MEDIA_NEXT* = "gtk-media-next" - STOCK_MEDIA_PAUSE* = "gtk-media-pause" - STOCK_MEDIA_PLAY* = "gtk-media-play" - STOCK_MEDIA_PREVIOUS* = "gtk-media-previous" - STOCK_MEDIA_RECORD* = "gtk-media-record" - STOCK_MEDIA_REWIND* = "gtk-media-rewind" - STOCK_MEDIA_STOP* = "gtk-media-stop" - STOCK_MISSING_IMAGE* = "gtk-missing-image" - STOCK_NEW* = "gtk-new" - STOCK_NO* = "gtk-no" - STOCK_OK* = "gtk-ok" - STOCK_OPEN* = "gtk-open" - STOCK_PASTE* = "gtk-paste" - STOCK_PREFERENCES* = "gtk-preferences" - STOCK_PRINT* = "gtk-print" - STOCK_PRINT_PREVIEW* = "gtk-print-preview" - STOCK_PROPERTIES* = "gtk-properties" - STOCK_QUIT* = "gtk-quit" - STOCK_REDO* = "gtk-redo" - STOCK_REFRESH* = "gtk-refresh" - STOCK_REMOVE* = "gtk-remove" - STOCK_REVERT_TO_SAVED* = "gtk-revert-to-saved" - STOCK_SAVE* = "gtk-save" - STOCK_SAVE_AS* = "gtk-save-as" - STOCK_SELECT_COLOR* = "gtk-select-color" - STOCK_SELECT_FONT* = "gtk-select-font" - STOCK_SORT_ASCENDING* = "gtk-sort-ascending" - STOCK_SORT_DESCENDING* = "gtk-sort-descending" - STOCK_SPELL_CHECK* = "gtk-spell-check" - STOCK_STOP* = "gtk-stop" - STOCK_STRIKETHROUGH* = "gtk-strikethrough" - STOCK_UNDELETE* = "gtk-undelete" - STOCK_UNDERLINE* = "gtk-underline" - STOCK_UNDO* = "gtk-undo" - STOCK_YES* = "gtk-yes" - STOCK_ZOOM_100* = "gtk-zoom-100" - STOCK_ZOOM_FIT* = "gtk-zoom-fit" - STOCK_ZOOM_IN* = "gtk-zoom-in" - STOCK_ZOOM_OUT* = "gtk-zoom-out" - -proc add*(items: PStockItem, n_items: guint){.cdecl, dynlib: lib, - importc: "gtk_stock_add".} -proc add_static*(items: PStockItem, n_items: guint){.cdecl, dynlib: lib, - importc: "gtk_stock_add_static".} -proc stock_lookup*(stock_id: cstring, item: PStockItem): gboolean{.cdecl, - dynlib: lib, importc: "gtk_stock_lookup".} -proc stock_list_ids*(): PGSList{.cdecl, dynlib: lib, - importc: "gtk_stock_list_ids".} -proc copy*(item: PStockItem): PStockItem{.cdecl, dynlib: lib, - importc: "gtk_stock_item_copy".} -proc free*(item: PStockItem){.cdecl, dynlib: lib, - importc: "gtk_stock_item_free".} -proc TYPE_STATUSBAR*(): GType -proc STATUSBAR*(obj: pointer): PStatusbar -proc STATUSBAR_CLASS*(klass: pointer): PStatusbarClass -proc IS_STATUSBAR*(obj: pointer): bool -proc IS_STATUSBAR_CLASS*(klass: pointer): bool -proc STATUSBAR_GET_CLASS*(obj: pointer): PStatusbarClass -const - bm_TGtkStatusbar_has_resize_grip* = 0x0001'i16 - bp_TGtkStatusbar_has_resize_grip* = 0'i16 - -proc has_resize_grip*(a: PStatusbar): guint -proc set_has_resize_grip*(a: PStatusbar, `has_resize_grip`: guint) -proc statusbar_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_statusbar_get_type".} -proc statusbar_new*(): PStatusbar{.cdecl, dynlib: lib, - importc: "gtk_statusbar_new".} -proc get_context_id*(statusbar: PStatusbar, - context_description: cstring): guint{.cdecl, - dynlib: lib, importc: "gtk_statusbar_get_context_id".} -proc push*(statusbar: PStatusbar, context_id: guint, text: cstring): guint{. - cdecl, dynlib: lib, importc: "gtk_statusbar_push".} -proc pop*(statusbar: PStatusbar, context_id: guint){.cdecl, - dynlib: lib, importc: "gtk_statusbar_pop".} -proc remove*(statusbar: PStatusbar, context_id: guint, - message_id: guint){.cdecl, dynlib: lib, - importc: "gtk_statusbar_remove".} -proc set_has_resize_grip*(statusbar: PStatusbar, setting: gboolean){. - cdecl, dynlib: lib, importc: "gtk_statusbar_set_has_resize_grip".} -proc get_has_resize_grip*(statusbar: PStatusbar): gboolean{.cdecl, - dynlib: lib, importc: "gtk_statusbar_get_has_resize_grip".} -const - bm_TGtkTable_homogeneous* = 0x0001'i16 - bp_TGtkTable_homogeneous* = 0'i16 - bm_TGtkTableChild_xexpand* = 0x0001'i16 - bp_TGtkTableChild_xexpand* = 0'i16 - bm_TGtkTableChild_yexpand* = 0x0002'i16 - bp_TGtkTableChild_yexpand* = 1'i16 - bm_TGtkTableChild_xshrink* = 0x0004'i16 - bp_TGtkTableChild_xshrink* = 2'i16 - bm_TGtkTableChild_yshrink* = 0x0008'i16 - bp_TGtkTableChild_yshrink* = 3'i16 - bm_TGtkTableChild_xfill* = 0x0010'i16 - bp_TGtkTableChild_xfill* = 4'i16 - bm_TGtkTableChild_yfill* = 0x0020'i16 - bp_TGtkTableChild_yfill* = 5'i16 - bm_TGtkTableRowCol_need_expand* = 0x0001'i16 - bp_TGtkTableRowCol_need_expand* = 0'i16 - bm_TGtkTableRowCol_need_shrink* = 0x0002'i16 - bp_TGtkTableRowCol_need_shrink* = 1'i16 - bm_TGtkTableRowCol_expand* = 0x0004'i16 - bp_TGtkTableRowCol_expand* = 2'i16 - bm_TGtkTableRowCol_shrink* = 0x0008'i16 - bp_TGtkTableRowCol_shrink* = 3'i16 - bm_TGtkTableRowCol_empty* = 0x0010'i16 - bp_TGtkTableRowCol_empty* = 4'i16 - -proc TYPE_TABLE*(): GType -proc TABLE*(obj: pointer): PTable -proc TABLE_CLASS*(klass: pointer): PTableClass -proc IS_TABLE*(obj: pointer): bool -proc IS_TABLE_CLASS*(klass: pointer): bool -proc TABLE_GET_CLASS*(obj: pointer): PTableClass -proc homogeneous*(a: PTable): guint -proc set_homogeneous*(a: PTable, `homogeneous`: guint) -proc xexpand*(a: PTableChild): guint -proc set_xexpand*(a: PTableChild, `xexpand`: guint) -proc yexpand*(a: PTableChild): guint -proc set_yexpand*(a: PTableChild, `yexpand`: guint) -proc xshrink*(a: PTableChild): guint -proc set_xshrink*(a: PTableChild, `xshrink`: guint) -proc yshrink*(a: PTableChild): guint -proc set_yshrink*(a: PTableChild, `yshrink`: guint) -proc xfill*(a: PTableChild): guint -proc set_xfill*(a: PTableChild, `xfill`: guint) -proc yfill*(a: PTableChild): guint -proc set_yfill*(a: PTableChild, `yfill`: guint) -proc need_expand*(a: PTableRowCol): guint -proc set_need_expand*(a: PTableRowCol, `need_expand`: guint) -proc need_shrink*(a: PTableRowCol): guint -proc set_need_shrink*(a: PTableRowCol, `need_shrink`: guint) -proc expand*(a: PTableRowCol): guint -proc set_expand*(a: PTableRowCol, `expand`: guint) -proc shrink*(a: PTableRowCol): guint -proc set_shrink*(a: PTableRowCol, `shrink`: guint) -proc empty*(a: PTableRowCol): guint -proc set_empty*(a: PTableRowCol, `empty`: guint) -proc table_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_table_get_type".} -proc table_new*(rows: guint, columns: guint, homogeneous: gboolean): PTable{. - cdecl, dynlib: lib, importc: "gtk_table_new".} -proc resize*(table: PTable, rows: guint, columns: guint){.cdecl, - dynlib: lib, importc: "gtk_table_resize".} -proc attach*(table: PTable, child: PWidget, left_attach: guint, - right_attach: guint, top_attach: guint, bottom_attach: guint, - xoptions: TAttachOptions, yoptions: TAttachOptions, - xpadding: guint, ypadding: guint){.cdecl, dynlib: lib, - importc: "gtk_table_attach".} -proc attach_defaults*(table: PTable, widget: PWidget, left_attach: guint, - right_attach: guint, top_attach: guint, - bottom_attach: guint){.cdecl, dynlib: lib, - importc: "gtk_table_attach_defaults".} -proc set_row_spacing*(table: PTable, row: guint, spacing: guint){.cdecl, - dynlib: lib, importc: "gtk_table_set_row_spacing".} -proc get_row_spacing*(table: PTable, row: guint): guint{.cdecl, - dynlib: lib, importc: "gtk_table_get_row_spacing".} -proc set_col_spacing*(table: PTable, column: guint, spacing: guint){. - cdecl, dynlib: lib, importc: "gtk_table_set_col_spacing".} -proc get_col_spacing*(table: PTable, column: guint): guint{.cdecl, - dynlib: lib, importc: "gtk_table_get_col_spacing".} -proc set_row_spacings*(table: PTable, spacing: guint){.cdecl, dynlib: lib, - importc: "gtk_table_set_row_spacings".} -proc get_default_row_spacing*(table: PTable): guint{.cdecl, dynlib: lib, - importc: "gtk_table_get_default_row_spacing".} -proc set_col_spacings*(table: PTable, spacing: guint){.cdecl, dynlib: lib, - importc: "gtk_table_set_col_spacings".} -proc get_default_col_spacing*(table: PTable): guint{.cdecl, dynlib: lib, - importc: "gtk_table_get_default_col_spacing".} -proc set_homogeneous*(table: PTable, homogeneous: gboolean){.cdecl, - dynlib: lib, importc: "gtk_table_set_homogeneous".} -proc get_homogeneous*(table: PTable): gboolean{.cdecl, dynlib: lib, - importc: "gtk_table_get_homogeneous".} -const - bm_TGtkTearoffMenuItem_torn_off* = 0x0001'i16 - bp_TGtkTearoffMenuItem_torn_off* = 0'i16 - -proc TYPE_TEAROFF_MENU_ITEM*(): GType -proc TEAROFF_MENU_ITEM*(obj: pointer): PTearoffMenuItem -proc TEAROFF_MENU_ITEM_CLASS*(klass: pointer): PTearoffMenuItemClass -proc IS_TEAROFF_MENU_ITEM*(obj: pointer): bool -proc IS_TEAROFF_MENU_ITEM_CLASS*(klass: pointer): bool -proc TEAROFF_MENU_ITEM_GET_CLASS*(obj: pointer): PTearoffMenuItemClass -proc torn_off*(a: PTearoffMenuItem): guint -proc set_torn_off*(a: PTearoffMenuItem, `torn_off`: guint) -proc tearoff_menu_item_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tearoff_menu_item_get_type".} -proc tearoff_menu_item_new*(): PTearoffMenuItem{.cdecl, dynlib: lib, - importc: "gtk_tearoff_menu_item_new".} -const - bm_TGtkText_line_wrap* = 0x0001'i16 - bp_TGtkText_line_wrap* = 0'i16 - bm_TGtkText_word_wrap* = 0x0002'i16 - bp_TGtkText_word_wrap* = 1'i16 - bm_TGtkText_use_wchar* = 0x0004'i16 - bp_TGtkText_use_wchar* = 2'i16 - -proc TYPE_TEXT*(): GType -proc TEXT*(obj: pointer): PText -proc TEXT_CLASS*(klass: pointer): PTextClass -proc IS_TEXT*(obj: pointer): bool -proc IS_TEXT_CLASS*(klass: pointer): bool -proc TEXT_GET_CLASS*(obj: pointer): PTextClass -proc line_wrap*(a: PText): guint -proc set_line_wrap*(a: PText, `line_wrap`: guint) -proc word_wrap*(a: PText): guint -proc set_word_wrap*(a: PText, `word_wrap`: guint) -proc use_wchar*(a: PText): gboolean -proc set_use_wchar*(a: PText, `use_wchar`: gboolean) -proc text_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_text_get_type".} -proc text_new*(hadj: PAdjustment, vadj: PAdjustment): PText{.cdecl, dynlib: lib, - importc: "gtk_text_new".} -proc set_editable*(text: PText, editable: gboolean){.cdecl, dynlib: lib, - importc: "gtk_text_set_editable".} -proc set_word_wrap*(text: PText, word_wrap: gboolean){.cdecl, dynlib: lib, - importc: "gtk_text_set_word_wrap".} -proc set_line_wrap*(text: PText, line_wrap: gboolean){.cdecl, dynlib: lib, - importc: "gtk_text_set_line_wrap".} -proc set_adjustments*(text: PText, hadj: PAdjustment, vadj: PAdjustment){. - cdecl, dynlib: lib, importc: "gtk_text_set_adjustments".} -proc set_point*(text: PText, index: guint){.cdecl, dynlib: lib, - importc: "gtk_text_set_point".} -proc get_point*(text: PText): guint{.cdecl, dynlib: lib, - importc: "gtk_text_get_point".} -proc get_length*(text: PText): guint{.cdecl, dynlib: lib, - importc: "gtk_text_get_length".} -proc freeze*(text: PText){.cdecl, dynlib: lib, importc: "gtk_text_freeze".} -proc thaw*(text: PText){.cdecl, dynlib: lib, importc: "gtk_text_thaw".} -proc insert*(text: PText, font: gdk2.PFont, fore: gdk2.PColor, back: gdk2.PColor, - chars: cstring, length: gint){.cdecl, dynlib: lib, - importc: "gtk_text_insert".} -proc backward_delete*(text: PText, nchars: guint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_backward_delete".} -proc forward_delete*(text: PText, nchars: guint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_forward_delete".} -proc INDEX_WCHAR*(t: PText, index: guint): guint32 -proc INDEX_UCHAR*(t: PText, index: guint): GUChar -const - TEXT_SEARCH_VISIBLE_ONLY* = 0 - TEXT_SEARCH_TEXT_ONLY* = 1 - -proc TYPE_TEXT_ITER*(): GType -proc get_buffer*(iter: PTextIter): PTextBuffer{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_buffer".} -proc copy*(iter: PTextIter): PTextIter{.cdecl, dynlib: lib, - importc: "gtk_text_iter_copy".} -proc free*(iter: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_iter_free".} -proc text_iter_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_type".} -proc get_offset*(iter: PTextIter): gint{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_offset".} -proc get_line*(iter: PTextIter): gint{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_line".} -proc get_line_offset*(iter: PTextIter): gint{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_line_offset".} -proc get_line_index*(iter: PTextIter): gint{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_line_index".} -proc get_visible_line_offset*(iter: PTextIter): gint{.cdecl, - dynlib: lib, importc: "gtk_text_iter_get_visible_line_offset".} -proc get_visible_line_index*(iter: PTextIter): gint{.cdecl, - dynlib: lib, importc: "gtk_text_iter_get_visible_line_index".} -proc get_char*(iter: PTextIter): gunichar{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_char".} -proc get_slice*(start: PTextIter, theEnd: PTextIter): cstring{.cdecl, - dynlib: lib, importc: "gtk_text_iter_get_slice".} -proc get_text*(start: PTextIter, theEnd: PTextIter): cstring{.cdecl, - dynlib: lib, importc: "gtk_text_iter_get_text".} -proc get_visible_slice*(start: PTextIter, theEnd: PTextIter): cstring{. - cdecl, dynlib: lib, importc: "gtk_text_iter_get_visible_slice".} -proc get_visible_text*(start: PTextIter, theEnd: PTextIter): cstring{. - cdecl, dynlib: lib, importc: "gtk_text_iter_get_visible_text".} -proc get_pixbuf*(iter: PTextIter): gdk2pixbuf.PPixbuf{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_pixbuf".} -proc get_marks*(iter: PTextIter): PGSList{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_marks".} -proc get_child_anchor*(iter: PTextIter): PTextChildAnchor{.cdecl, - dynlib: lib, importc: "gtk_text_iter_get_child_anchor".} -proc get_toggled_tags*(iter: PTextIter, toggled_on: gboolean): PGSList{. - cdecl, dynlib: lib, importc: "gtk_text_iter_get_toggled_tags".} -proc begins_tag*(iter: PTextIter, tag: PTextTag): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_begins_tag".} -proc ends_tag*(iter: PTextIter, tag: PTextTag): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_ends_tag".} -proc toggles_tag*(iter: PTextIter, tag: PTextTag): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_toggles_tag".} -proc has_tag*(iter: PTextIter, tag: PTextTag): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_has_tag".} -proc get_tags*(iter: PTextIter): PGSList{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_tags".} -proc editable*(iter: PTextIter, default_setting: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_editable".} -proc can_insert*(iter: PTextIter, default_editability: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_can_insert".} -proc starts_word*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_starts_word".} -proc ends_word*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_ends_word".} -proc inside_word*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_inside_word".} -proc starts_sentence*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_starts_sentence".} -proc ends_sentence*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_ends_sentence".} -proc inside_sentence*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_inside_sentence".} -proc starts_line*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_starts_line".} -proc ends_line*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_ends_line".} -proc is_cursor_position*(iter: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_is_cursor_position".} -proc get_chars_in_line*(iter: PTextIter): gint{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_chars_in_line".} -proc get_bytes_in_line*(iter: PTextIter): gint{.cdecl, dynlib: lib, - importc: "gtk_text_iter_get_bytes_in_line".} -proc get_attributes*(iter: PTextIter, values: PTextAttributes): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_get_attributes".} -proc get_language*(iter: PTextIter): pango.PLanguage{.cdecl, - dynlib: lib, importc: "gtk_text_iter_get_language".} -proc is_end*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_is_end".} -proc is_start*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_is_start".} -proc forward_char*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_forward_char".} -proc backward_char*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_backward_char".} -proc forward_chars*(iter: PTextIter, count: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_forward_chars".} -proc backward_chars*(iter: PTextIter, count: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_backward_chars".} -proc forward_line*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_forward_line".} -proc backward_line*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_backward_line".} -proc forward_lines*(iter: PTextIter, count: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_forward_lines".} -proc backward_lines*(iter: PTextIter, count: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_backward_lines".} -proc forward_word_end*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_iter_forward_word_end".} -proc backward_word_start*(iter: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_backward_word_start".} -proc forward_word_ends*(iter: PTextIter, count: gint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_forward_word_ends".} -proc backward_word_starts*(iter: PTextIter, count: gint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_backward_word_starts".} -proc forward_sentence_end*(iter: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_forward_sentence_end".} -proc backward_sentence_start*(iter: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_backward_sentence_start".} -proc forward_sentence_ends*(iter: PTextIter, count: gint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_forward_sentence_ends".} -proc backward_sentence_starts*(iter: PTextIter, count: gint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_backward_sentence_starts".} -proc forward_cursor_position*(iter: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_forward_cursor_position".} -proc backward_cursor_position*(iter: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_backward_cursor_position".} -proc forward_cursor_positions*(iter: PTextIter, count: gint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_forward_cursor_positions".} -proc backward_cursor_positions*(iter: PTextIter, count: gint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_backward_cursor_positions".} -proc set_offset*(iter: PTextIter, char_offset: gint){.cdecl, - dynlib: lib, importc: "gtk_text_iter_set_offset".} -proc set_line*(iter: PTextIter, line_number: gint){.cdecl, - dynlib: lib, importc: "gtk_text_iter_set_line".} -proc set_line_offset*(iter: PTextIter, char_on_line: gint){.cdecl, - dynlib: lib, importc: "gtk_text_iter_set_line_offset".} -proc set_line_index*(iter: PTextIter, byte_on_line: gint){.cdecl, - dynlib: lib, importc: "gtk_text_iter_set_line_index".} -proc forward_to_end*(iter: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_iter_forward_to_end".} -proc forward_to_line_end*(iter: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_forward_to_line_end".} -proc set_visible_line_offset*(iter: PTextIter, char_on_line: gint){. - cdecl, dynlib: lib, importc: "gtk_text_iter_set_visible_line_offset".} -proc set_visible_line_index*(iter: PTextIter, byte_on_line: gint){. - cdecl, dynlib: lib, importc: "gtk_text_iter_set_visible_line_index".} -proc forward_to_tag_toggle*(iter: PTextIter, tag: PTextTag): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_forward_to_tag_toggle".} -proc backward_to_tag_toggle*(iter: PTextIter, tag: PTextTag): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_backward_to_tag_toggle".} -proc forward_find_char*(iter: PTextIter, pred: TTextCharPredicate, - user_data: gpointer, limit: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_forward_find_char".} -proc backward_find_char*(iter: PTextIter, pred: TTextCharPredicate, - user_data: gpointer, limit: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_backward_find_char".} -proc forward_search*(iter: PTextIter, str: cstring, - flags: TTextSearchFlags, match_start: PTextIter, - match_end: PTextIter, limit: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_forward_search".} -proc backward_search*(iter: PTextIter, str: cstring, - flags: TTextSearchFlags, match_start: PTextIter, - match_end: PTextIter, limit: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_backward_search".} -proc equal*(lhs: PTextIter, rhs: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_iter_equal".} -proc compare*(lhs: PTextIter, rhs: PTextIter): gint{.cdecl, - dynlib: lib, importc: "gtk_text_iter_compare".} -proc in_range*(iter: PTextIter, start: PTextIter, theEnd: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_iter_in_range".} -proc order*(first: PTextIter, second: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_iter_order".} -proc TYPE_TEXT_TAG*(): GType -proc TEXT_TAG*(obj: pointer): PTextTag -proc TEXT_TAG_CLASS*(klass: pointer): PTextTagClass -proc IS_TEXT_TAG*(obj: pointer): bool -proc IS_TEXT_TAG_CLASS*(klass: pointer): bool -proc TEXT_TAG_GET_CLASS*(obj: pointer): PTextTagClass -proc TYPE_TEXT_ATTRIBUTES*(): GType -proc text_tag_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_text_tag_get_type".} -proc text_tag_new*(name: cstring): PTextTag{.cdecl, dynlib: lib, - importc: "gtk_text_tag_new".} -proc get_priority*(tag: PTextTag): gint{.cdecl, dynlib: lib, - importc: "gtk_text_tag_get_priority".} -proc set_priority*(tag: PTextTag, priority: gint){.cdecl, dynlib: lib, - importc: "gtk_text_tag_set_priority".} -proc event*(tag: PTextTag, event_object: PGObject, event: gdk2.PEvent, - iter: PTextIter): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_tag_event".} -proc text_attributes_new*(): PTextAttributes{.cdecl, dynlib: lib, - importc: "gtk_text_attributes_new".} -proc copy*(src: PTextAttributes): PTextAttributes{.cdecl, - dynlib: lib, importc: "gtk_text_attributes_copy".} -proc copy_values*(src: PTextAttributes, dest: PTextAttributes){. - cdecl, dynlib: lib, importc: "gtk_text_attributes_copy_values".} -proc unref*(values: PTextAttributes){.cdecl, dynlib: lib, - importc: "gtk_text_attributes_unref".} -proc reference*(values: PTextAttributes){.cdecl, dynlib: lib, - importc: "gtk_text_attributes_ref".} -proc text_attributes_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_text_attributes_get_type".} -const - bm_TGtkTextTag_bg_color_set* = 0x00000001'i32 - bp_TGtkTextTag_bg_color_set* = 0'i32 - bm_TGtkTextTag_bg_stipple_set* = 0x00000002'i32 - bp_TGtkTextTag_bg_stipple_set* = 1'i32 - bm_TGtkTextTag_fg_color_set* = 0x00000004'i32 - bp_TGtkTextTag_fg_color_set* = 2'i32 - bm_TGtkTextTag_scale_set* = 0x00000008'i32 - bp_TGtkTextTag_scale_set* = 3'i32 - bm_TGtkTextTag_fg_stipple_set* = 0x00000010'i32 - bp_TGtkTextTag_fg_stipple_set* = 4'i32 - bm_TGtkTextTag_justification_set* = 0x00000020'i32 - bp_TGtkTextTag_justification_set* = 5'i32 - bm_TGtkTextTag_left_margin_set* = 0x00000040'i32 - bp_TGtkTextTag_left_margin_set* = 6'i32 - bm_TGtkTextTag_indent_set* = 0x00000080'i32 - bp_TGtkTextTag_indent_set* = 7'i32 - bm_TGtkTextTag_rise_set* = 0x00000100'i32 - bp_TGtkTextTag_rise_set* = 8'i32 - bm_TGtkTextTag_strikethrough_set* = 0x00000200'i32 - bp_TGtkTextTag_strikethrough_set* = 9'i32 - bm_TGtkTextTag_right_margin_set* = 0x00000400'i32 - bp_TGtkTextTag_right_margin_set* = 10'i32 - bm_TGtkTextTag_pixels_above_lines_set* = 0x00000800'i32 - bp_TGtkTextTag_pixels_above_lines_set* = 11'i32 - bm_TGtkTextTag_pixels_below_lines_set* = 0x00001000'i32 - bp_TGtkTextTag_pixels_below_lines_set* = 12'i32 - bm_TGtkTextTag_pixels_inside_wrap_set* = 0x00002000'i32 - bp_TGtkTextTag_pixels_inside_wrap_set* = 13'i32 - bm_TGtkTextTag_tabs_set* = 0x00004000'i32 - bp_TGtkTextTag_tabs_set* = 14'i32 - bm_TGtkTextTag_underline_set* = 0x00008000'i32 - bp_TGtkTextTag_underline_set* = 15'i32 - bm_TGtkTextTag_wrap_mode_set* = 0x00010000'i32 - bp_TGtkTextTag_wrap_mode_set* = 16'i32 - bm_TGtkTextTag_bg_full_height_set* = 0x00020000'i32 - bp_TGtkTextTag_bg_full_height_set* = 17'i32 - bm_TGtkTextTag_invisible_set* = 0x00040000'i32 - bp_TGtkTextTag_invisible_set* = 18'i32 - bm_TGtkTextTag_editable_set* = 0x00080000'i32 - bp_TGtkTextTag_editable_set* = 19'i32 - bm_TGtkTextTag_language_set* = 0x00100000'i32 - bp_TGtkTextTag_language_set* = 20'i32 - bm_TGtkTextTag_pad1* = 0x00200000'i32 - bp_TGtkTextTag_pad1* = 21'i32 - bm_TGtkTextTag_pad2* = 0x00400000'i32 - bp_TGtkTextTag_pad2* = 22'i32 - bm_TGtkTextTag_pad3* = 0x00800000'i32 - bp_TGtkTextTag_pad3* = 23'i32 - -proc bg_color_set*(a: PTextTag): guint -proc set_bg_color_set*(a: PTextTag, `bg_color_set`: guint) -proc bg_stipple_set*(a: PTextTag): guint -proc set_bg_stipple_set*(a: PTextTag, `bg_stipple_set`: guint) -proc fg_color_set*(a: PTextTag): guint -proc set_fg_color_set*(a: PTextTag, `fg_color_set`: guint) -proc scale_set*(a: PTextTag): guint -proc set_scale_set*(a: PTextTag, `scale_set`: guint) -proc fg_stipple_set*(a: PTextTag): guint -proc set_fg_stipple_set*(a: PTextTag, `fg_stipple_set`: guint) -proc justification_set*(a: PTextTag): guint -proc set_justification_set*(a: PTextTag, `justification_set`: guint) -proc left_margin_set*(a: PTextTag): guint -proc set_left_margin_set*(a: PTextTag, `left_margin_set`: guint) -proc indent_set*(a: PTextTag): guint -proc set_indent_set*(a: PTextTag, `indent_set`: guint) -proc rise_set*(a: PTextTag): guint -proc set_rise_set*(a: PTextTag, `rise_set`: guint) -proc strikethrough_set*(a: PTextTag): guint -proc set_strikethrough_set*(a: PTextTag, `strikethrough_set`: guint) -proc right_margin_set*(a: PTextTag): guint -proc set_right_margin_set*(a: PTextTag, `right_margin_set`: guint) -proc pixels_above_lines_set*(a: PTextTag): guint -proc set_pixels_above_lines_set*(a: PTextTag, - `pixels_above_lines_set`: guint) -proc pixels_below_lines_set*(a: PTextTag): guint -proc set_pixels_below_lines_set*(a: PTextTag, - `pixels_below_lines_set`: guint) -proc pixels_inside_wrap_set*(a: PTextTag): guint -proc set_pixels_inside_wrap_set*(a: PTextTag, - `pixels_inside_wrap_set`: guint) -proc tabs_set*(a: PTextTag): guint -proc set_tabs_set*(a: PTextTag, `tabs_set`: guint) -proc underline_set*(a: PTextTag): guint -proc set_underline_set*(a: PTextTag, `underline_set`: guint) -proc wrap_mode_set*(a: PTextTag): guint -proc set_wrap_mode_set*(a: PTextTag, `wrap_mode_set`: guint) -proc bg_full_height_set*(a: PTextTag): guint -proc set_bg_full_height_set*(a: PTextTag, `bg_full_height_set`: guint) -proc invisible_set*(a: PTextTag): guint -proc set_invisible_set*(a: PTextTag, `invisible_set`: guint) -proc editable_set*(a: PTextTag): guint -proc set_editable_set*(a: PTextTag, `editable_set`: guint) -proc language_set*(a: PTextTag): guint -proc set_language_set*(a: PTextTag, `language_set`: guint) -proc pad1*(a: PTextTag): guint -proc set_pad1*(a: PTextTag, `pad1`: guint) -proc pad2*(a: PTextTag): guint -proc set_pad2*(a: PTextTag, `pad2`: guint) -proc pad3*(a: PTextTag): guint -proc set_pad3*(a: PTextTag, `pad3`: guint) -const - bm_TGtkTextAppearance_underline* = 0x000F'i16 - bp_TGtkTextAppearance_underline* = 0'i16 - bm_TGtkTextAppearance_strikethrough* = 0x0010'i16 - bp_TGtkTextAppearance_strikethrough* = 4'i16 - bm_TGtkTextAppearance_draw_bg* = 0x0020'i16 - bp_TGtkTextAppearance_draw_bg* = 5'i16 - bm_TGtkTextAppearance_inside_selection* = 0x0040'i16 - bp_TGtkTextAppearance_inside_selection* = 6'i16 - bm_TGtkTextAppearance_is_text* = 0x0080'i16 - bp_TGtkTextAppearance_is_text* = 7'i16 - bm_TGtkTextAppearance_pad1* = 0x0100'i16 - bp_TGtkTextAppearance_pad1* = 8'i16 - bm_TGtkTextAppearance_pad2* = 0x0200'i16 - bp_TGtkTextAppearance_pad2* = 9'i16 - bm_TGtkTextAppearance_pad3* = 0x0400'i16 - bp_TGtkTextAppearance_pad3* = 10'i16 - bm_TGtkTextAppearance_pad4* = 0x0800'i16 - bp_TGtkTextAppearance_pad4* = 11'i16 - -proc underline*(a: PTextAppearance): guint -proc set_underline*(a: PTextAppearance, `underline`: guint) -proc strikethrough*(a: PTextAppearance): guint -proc set_strikethrough*(a: PTextAppearance, `strikethrough`: guint) -proc draw_bg*(a: PTextAppearance): guint -proc set_draw_bg*(a: PTextAppearance, `draw_bg`: guint) -proc inside_selection*(a: PTextAppearance): guint -proc set_inside_selection*(a: PTextAppearance, `inside_selection`: guint) -proc is_text*(a: PTextAppearance): guint -proc set_is_text*(a: PTextAppearance, `is_text`: guint) -proc pad1*(a: PTextAppearance): guint -proc set_pad1*(a: PTextAppearance, `pad1`: guint) -proc pad2*(a: PTextAppearance): guint -proc set_pad2*(a: PTextAppearance, `pad2`: guint) -proc pad3*(a: PTextAppearance): guint -proc set_pad3*(a: PTextAppearance, `pad3`: guint) -proc pad4*(a: PTextAppearance): guint -proc set_pad4*(a: PTextAppearance, `pad4`: guint) -const - bm_TGtkTextAttributes_invisible* = 0x0001'i16 - bp_TGtkTextAttributes_invisible* = 0'i16 - bm_TGtkTextAttributes_bg_full_height* = 0x0002'i16 - bp_TGtkTextAttributes_bg_full_height* = 1'i16 - bm_TGtkTextAttributes_editable* = 0x0004'i16 - bp_TGtkTextAttributes_editable* = 2'i16 - bm_TGtkTextAttributes_realized* = 0x0008'i16 - bp_TGtkTextAttributes_realized* = 3'i16 - bm_TGtkTextAttributes_pad1* = 0x0010'i16 - bp_TGtkTextAttributes_pad1* = 4'i16 - bm_TGtkTextAttributes_pad2* = 0x0020'i16 - bp_TGtkTextAttributes_pad2* = 5'i16 - bm_TGtkTextAttributes_pad3* = 0x0040'i16 - bp_TGtkTextAttributes_pad3* = 6'i16 - bm_TGtkTextAttributes_pad4* = 0x0080'i16 - bp_TGtkTextAttributes_pad4* = 7'i16 - -proc invisible*(a: PTextAttributes): guint -proc set_invisible*(a: PTextAttributes, `invisible`: guint) -proc bg_full_height*(a: PTextAttributes): guint -proc set_bg_full_height*(a: PTextAttributes, `bg_full_height`: guint) -proc editable*(a: PTextAttributes): guint -proc set_editable*(a: PTextAttributes, `editable`: guint) -proc realized*(a: PTextAttributes): guint -proc set_realized*(a: PTextAttributes, `realized`: guint) -proc pad1*(a: PTextAttributes): guint -proc set_pad1*(a: PTextAttributes, `pad1`: guint) -proc pad2*(a: PTextAttributes): guint -proc set_pad2*(a: PTextAttributes, `pad2`: guint) -proc pad3*(a: PTextAttributes): guint -proc set_pad3*(a: PTextAttributes, `pad3`: guint) -proc pad4*(a: PTextAttributes): guint -proc set_pad4*(a: PTextAttributes, `pad4`: guint) -proc TYPE_TEXT_TAG_TABLE*(): GType -proc TEXT_TAG_TABLE*(obj: pointer): PTextTagTable -proc TEXT_TAG_TABLE_CLASS*(klass: pointer): PTextTagTableClass -proc IS_TEXT_TAG_TABLE*(obj: pointer): bool -proc IS_TEXT_TAG_TABLE_CLASS*(klass: pointer): bool -proc TEXT_TAG_TABLE_GET_CLASS*(obj: pointer): PTextTagTableClass -proc text_tag_table_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_text_tag_table_get_type".} -proc text_tag_table_new*(): PTextTagTable{.cdecl, dynlib: lib, - importc: "gtk_text_tag_table_new".} -proc table_add*(table: PTextTagTable, tag: PTextTag){.cdecl, - dynlib: lib, importc: "gtk_text_tag_table_add".} -proc table_remove*(table: PTextTagTable, tag: PTextTag){.cdecl, - dynlib: lib, importc: "gtk_text_tag_table_remove".} -proc table_lookup*(table: PTextTagTable, name: cstring): PTextTag{. - cdecl, dynlib: lib, importc: "gtk_text_tag_table_lookup".} -proc table_foreach*(table: PTextTagTable, fun: TTextTagTableForeach, - data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_text_tag_table_foreach".} -proc table_get_size*(table: PTextTagTable): gint{.cdecl, dynlib: lib, - importc: "gtk_text_tag_table_get_size".} -proc table_add_buffer*(table: PTextTagTable, buffer: gpointer){.cdecl, - dynlib: lib, importc: "_gtk_text_tag_table_add_buffer".} -proc table_remove_buffer*(table: PTextTagTable, buffer: gpointer){. - cdecl, dynlib: lib, importc: "_gtk_text_tag_table_remove_buffer".} -proc TYPE_TEXT_MARK*(): GType -proc TEXT_MARK*(anObject: pointer): PTextMark -proc TEXT_MARK_CLASS*(klass: pointer): PTextMarkClass -proc IS_TEXT_MARK*(anObject: pointer): bool -proc IS_TEXT_MARK_CLASS*(klass: pointer): bool -proc TEXT_MARK_GET_CLASS*(obj: pointer): PTextMarkClass -proc text_mark_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_text_mark_get_type".} -proc set_visible*(mark: PTextMark, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_text_mark_set_visible".} -proc get_visible*(mark: PTextMark): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_mark_get_visible".} -proc get_name*(mark: PTextMark): cstring{.cdecl, dynlib: lib, - importc: "gtk_text_mark_get_name".} -proc get_deleted*(mark: PTextMark): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_mark_get_deleted".} -proc get_buffer*(mark: PTextMark): PTextBuffer{.cdecl, dynlib: lib, - importc: "gtk_text_mark_get_buffer".} -proc get_left_gravity*(mark: PTextMark): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_mark_get_left_gravity".} -const - bm_TGtkTextMarkBody_visible* = 0x0001'i16 - bp_TGtkTextMarkBody_visible* = 0'i16 - bm_TGtkTextMarkBody_not_deleteable* = 0x0002'i16 - bp_TGtkTextMarkBody_not_deleteable* = 1'i16 - -proc visible*(a: PTextMarkBody): guint -proc set_visible*(a: PTextMarkBody, `visible`: guint) -proc not_deleteable*(a: PTextMarkBody): guint -proc set_not_deleteable*(a: PTextMarkBody, `not_deleteable`: guint) -proc mark_segment_new*(tree: PTextBTree, left_gravity: gboolean, name: cstring): PTextLineSegment{. - cdecl, dynlib: lib, importc: "_gtk_mark_segment_new".} -proc TYPE_TEXT_CHILD_ANCHOR*(): GType -proc TEXT_CHILD_ANCHOR*(anObject: pointer): PTextChildAnchor -proc TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): PTextChildAnchorClass -proc IS_TEXT_CHILD_ANCHOR*(anObject: pointer): bool -proc IS_TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): bool -proc TEXT_CHILD_ANCHOR_GET_CLASS*(obj: pointer): PTextChildAnchorClass -proc text_child_anchor_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_text_child_anchor_get_type".} -proc text_child_anchor_new*(): PTextChildAnchor{.cdecl, dynlib: lib, - importc: "gtk_text_child_anchor_new".} -proc anchor_get_widgets*(anchor: PTextChildAnchor): PGList{.cdecl, - dynlib: lib, importc: "gtk_text_child_anchor_get_widgets".} -proc anchor_get_deleted*(anchor: PTextChildAnchor): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_child_anchor_get_deleted".} -proc pixbuf_segment_new*(pixbuf: gdk2pixbuf.PPixbuf): PTextLineSegment{.cdecl, - dynlib: lib, importc: "_gtk_pixbuf_segment_new".} -proc widget_segment_new*(anchor: PTextChildAnchor): PTextLineSegment{.cdecl, - dynlib: lib, importc: "_gtk_widget_segment_new".} -proc widget_segment_add*(widget_segment: PTextLineSegment, child: PWidget){. - cdecl, dynlib: lib, importc: "_gtk_widget_segment_add".} -proc widget_segment_remove*(widget_segment: PTextLineSegment, child: PWidget){. - cdecl, dynlib: lib, importc: "_gtk_widget_segment_remove".} -proc widget_segment_ref*(widget_segment: PTextLineSegment){.cdecl, dynlib: lib, - importc: "_gtk_widget_segment_ref".} -proc widget_segment_unref*(widget_segment: PTextLineSegment){.cdecl, - dynlib: lib, importc: "_gtk_widget_segment_unref".} -proc anchored_child_get_layout*(child: PWidget): PTextLayout{.cdecl, - dynlib: lib, importc: "_gtk_anchored_child_get_layout".} -proc line_segment_split*(iter: PTextIter): PTextLineSegment{.cdecl, - dynlib: lib, importc: "gtk_text_line_segment_split".} -proc char_segment_new*(text: cstring, len: guint): PTextLineSegment{.cdecl, - dynlib: lib, importc: "_gtk_char_segment_new".} -proc char_segment_new_from_two_strings*(text1: cstring, len1: guint, - text2: cstring, len2: guint): PTextLineSegment{. - cdecl, dynlib: lib, importc: "_gtk_char_segment_new_from_two_strings".} -proc toggle_segment_new*(info: PTextTagInfo, StateOn: gboolean): PTextLineSegment{. - cdecl, dynlib: lib, importc: "_gtk_toggle_segment_new".} -proc btree_new*(table: PTextTagTable, buffer: PTextBuffer): PTextBTree{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_new".} -proc reference*(tree: PTextBTree){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_ref".} -proc unref*(tree: PTextBTree){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_unref".} -proc get_buffer*(tree: PTextBTree): PTextBuffer{.cdecl, dynlib: lib, - importc: "_gtk_text_btree_get_buffer".} -proc get_chars_changed_stamp*(tree: PTextBTree): guint{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_chars_changed_stamp".} -proc get_segments_changed_stamp*(tree: PTextBTree): guint{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_segments_changed_stamp".} -proc segments_changed*(tree: PTextBTree){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_segments_changed".} -proc is_end*(tree: PTextBTree, line: PTextLine, - seg: PTextLineSegment, byte_index: int32, - char_offset: int32): gboolean{.cdecl, dynlib: lib, - importc: "_gtk_text_btree_is_end".} -proc btree_delete*(start: PTextIter, theEnd: PTextIter){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_delete".} -proc btree_insert*(iter: PTextIter, text: cstring, len: gint){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_insert".} -proc btree_insert_pixbuf*(iter: PTextIter, pixbuf: gdk2pixbuf.PPixbuf){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_insert_pixbuf".} -proc btree_insert_child_anchor*(iter: PTextIter, anchor: PTextChildAnchor){. - cdecl, dynlib: lib, importc: "_gtk_text_btree_insert_child_anchor".} -proc btree_unregister_child_anchor*(anchor: PTextChildAnchor){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_unregister_child_anchor".} -proc find_line_by_y*(tree: PTextBTree, view_id: gpointer, - ypixel: gint, line_top_y: Pgint): PTextLine{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_find_line_by_y".} -proc find_line_top*(tree: PTextBTree, line: PTextLine, - view_id: gpointer): gint{.cdecl, dynlib: lib, - importc: "_gtk_text_btree_find_line_top".} -proc add_view*(tree: PTextBTree, layout: PTextLayout){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_add_view".} -proc remove_view*(tree: PTextBTree, view_id: gpointer){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_remove_view".} -proc invalidate_region*(tree: PTextBTree, start: PTextIter, - theEnd: PTextIter){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_invalidate_region".} -proc get_view_size*(tree: PTextBTree, view_id: gpointer, - width: Pgint, height: Pgint){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_get_view_size".} -proc is_valid*(tree: PTextBTree, view_id: gpointer): gboolean{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_is_valid".} -proc validate*(tree: PTextBTree, view_id: gpointer, max_pixels: gint, - y: Pgint, old_height: Pgint, new_height: Pgint): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_validate".} -proc validate_line*(tree: PTextBTree, line: PTextLine, - view_id: gpointer){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_validate_line".} -proc btree_tag*(start: PTextIter, theEnd: PTextIter, tag: PTextTag, - apply: gboolean){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_tag".} -proc get_line*(tree: PTextBTree, line_number: gint, - real_line_number: Pgint): PTextLine{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_line".} -proc get_line_no_last*(tree: PTextBTree, line_number: gint, - real_line_number: Pgint): PTextLine{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_line_no_last".} -proc get_end_iter_line*(tree: PTextBTree): PTextLine{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_end_iter_line".} -proc get_line_at_char*(tree: PTextBTree, char_index: gint, - line_start_index: Pgint, - real_char_index: Pgint): PTextLine{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_line_at_char".} -proc btree_get_tags*(iter: PTextIter, num_tags: Pgint): PPGtkTextTag{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_get_tags".} -proc btree_get_text*(start: PTextIter, theEnd: PTextIter, - include_hidden: gboolean, include_nonchars: gboolean): cstring{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_get_text".} -proc line_count*(tree: PTextBTree): gint{.cdecl, dynlib: lib, - importc: "_gtk_text_btree_line_count".} -proc char_count*(tree: PTextBTree): gint{.cdecl, dynlib: lib, - importc: "_gtk_text_btree_char_count".} -proc btree_char_is_invisible*(iter: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_char_is_invisible".} -proc get_iter_at_char*(tree: PTextBTree, iter: PTextIter, - char_index: gint){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_get_iter_at_char".} -proc get_iter_at_line_char*(tree: PTextBTree, iter: PTextIter, - line_number: gint, char_index: gint){. - cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_line_char".} -proc get_iter_at_line_byte*(tree: PTextBTree, iter: PTextIter, - line_number: gint, byte_index: gint){. - cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_line_byte".} -proc get_iter_from_string*(tree: PTextBTree, iter: PTextIter, - `string`: cstring): gboolean{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_iter_from_string".} -proc get_iter_at_mark_name*(tree: PTextBTree, iter: PTextIter, - mark_name: cstring): gboolean{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_iter_at_mark_name".} -proc get_iter_at_mark*(tree: PTextBTree, iter: PTextIter, - mark: PTextMark){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_get_iter_at_mark".} -proc get_end_iter*(tree: PTextBTree, iter: PTextIter){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_end_iter".} -proc get_iter_at_line*(tree: PTextBTree, iter: PTextIter, - line: PTextLine, byte_offset: gint){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_iter_at_line".} -proc get_iter_at_first_toggle*(tree: PTextBTree, iter: PTextIter, - tag: PTextTag): gboolean{.cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_first_toggle".} -proc get_iter_at_last_toggle*(tree: PTextBTree, iter: PTextIter, - tag: PTextTag): gboolean{.cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_last_toggle".} -proc get_iter_at_child_anchor*(tree: PTextBTree, iter: PTextIter, - anchor: PTextChildAnchor){.cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_child_anchor".} -proc set_mark*(tree: PTextBTree, existing_mark: PTextMark, - name: cstring, left_gravity: gboolean, - index: PTextIter, should_exist: gboolean): PTextMark{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_set_mark".} -proc remove_mark_by_name*(tree: PTextBTree, name: cstring){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_remove_mark_by_name".} -proc remove_mark*(tree: PTextBTree, segment: PTextMark){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_remove_mark".} -proc get_selection_bounds*(tree: PTextBTree, start: PTextIter, - theEnd: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "_gtk_text_btree_get_selection_bounds".} -proc place_cursor*(tree: PTextBTree, `where`: PTextIter){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_place_cursor".} -proc mark_is_insert*(tree: PTextBTree, segment: PTextMark): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_mark_is_insert".} -proc mark_is_selection_bound*(tree: PTextBTree, segment: PTextMark): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_mark_is_selection_bound".} -proc get_mark_by_name*(tree: PTextBTree, name: cstring): PTextMark{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_get_mark_by_name".} -proc first_could_contain_tag*(tree: PTextBTree, tag: PTextTag): PTextLine{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_first_could_contain_tag".} -proc last_could_contain_tag*(tree: PTextBTree, tag: PTextTag): PTextLine{. - cdecl, dynlib: lib, importc: "_gtk_text_btree_last_could_contain_tag".} -const - bm_TGtkTextLineData_width* = 0x00FFFFFF'i32 - bp_TGtkTextLineData_width* = 0'i32 - bm_TGtkTextLineData_valid* = 0xFF000000'i32 - bp_TGtkTextLineData_valid* = 24'i32 - -proc width*(a: PTextLineData): gint -proc set_width*(a: PTextLineData, NewWidth: gint) -proc valid*(a: PTextLineData): gint -proc set_valid*(a: PTextLineData, `valid`: gint) -proc get_number*(line: PTextLine): gint{.cdecl, dynlib: lib, - importc: "_gtk_text_line_get_number".} -proc char_has_tag*(line: PTextLine, tree: PTextBTree, - char_in_line: gint, tag: PTextTag): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_text_line_char_has_tag".} -proc byte_has_tag*(line: PTextLine, tree: PTextBTree, - byte_in_line: gint, tag: PTextTag): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_text_line_byte_has_tag".} -proc is_last*(line: PTextLine, tree: PTextBTree): gboolean{.cdecl, - dynlib: lib, importc: "_gtk_text_line_is_last".} -proc contains_end_iter*(line: PTextLine, tree: PTextBTree): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_text_line_contains_end_iter".} -proc next*(line: PTextLine): PTextLine{.cdecl, dynlib: lib, - importc: "_gtk_text_line_next".} -proc next_excluding_last*(line: PTextLine): PTextLine{.cdecl, - dynlib: lib, importc: "_gtk_text_line_next_excluding_last".} -proc previous*(line: PTextLine): PTextLine{.cdecl, dynlib: lib, - importc: "_gtk_text_line_previous".} -proc add_data*(line: PTextLine, data: PTextLineData){.cdecl, - dynlib: lib, importc: "_gtk_text_line_add_data".} -proc remove_data*(line: PTextLine, view_id: gpointer): gpointer{. - cdecl, dynlib: lib, importc: "_gtk_text_line_remove_data".} -proc get_data*(line: PTextLine, view_id: gpointer): gpointer{.cdecl, - dynlib: lib, importc: "_gtk_text_line_get_data".} -proc invalidate_wrap*(line: PTextLine, ld: PTextLineData){.cdecl, - dynlib: lib, importc: "_gtk_text_line_invalidate_wrap".} -proc char_count*(line: PTextLine): gint{.cdecl, dynlib: lib, - importc: "_gtk_text_line_char_count".} -proc byte_count*(line: PTextLine): gint{.cdecl, dynlib: lib, - importc: "_gtk_text_line_byte_count".} -proc char_index*(line: PTextLine): gint{.cdecl, dynlib: lib, - importc: "_gtk_text_line_char_index".} -proc byte_to_segment*(line: PTextLine, byte_offset: gint, - seg_offset: Pgint): PTextLineSegment{.cdecl, - dynlib: lib, importc: "_gtk_text_line_byte_to_segment".} -proc char_to_segment*(line: PTextLine, char_offset: gint, - seg_offset: Pgint): PTextLineSegment{.cdecl, - dynlib: lib, importc: "_gtk_text_line_char_to_segment".} -proc byte_to_char_offsets*(line: PTextLine, byte_offset: gint, - line_char_offset: Pgint, - seg_char_offset: Pgint){.cdecl, - dynlib: lib, importc: "_gtk_text_line_byte_to_char_offsets".} -proc char_to_byte_offsets*(line: PTextLine, char_offset: gint, - line_byte_offset: Pgint, - seg_byte_offset: Pgint){.cdecl, - dynlib: lib, importc: "_gtk_text_line_char_to_byte_offsets".} -proc byte_to_any_segment*(line: PTextLine, byte_offset: gint, - seg_offset: Pgint): PTextLineSegment{.cdecl, - dynlib: lib, importc: "_gtk_text_line_byte_to_any_segment".} -proc char_to_any_segment*(line: PTextLine, char_offset: gint, - seg_offset: Pgint): PTextLineSegment{.cdecl, - dynlib: lib, importc: "_gtk_text_line_char_to_any_segment".} -proc byte_to_char*(line: PTextLine, byte_offset: gint): gint{.cdecl, - dynlib: lib, importc: "_gtk_text_line_byte_to_char".} -proc char_to_byte*(line: PTextLine, char_offset: gint): gint{.cdecl, - dynlib: lib, importc: "_gtk_text_line_char_to_byte".} -proc next_could_contain_tag*(line: PTextLine, tree: PTextBTree, - tag: PTextTag): PTextLine{.cdecl, - dynlib: lib, importc: "_gtk_text_line_next_could_contain_tag".} -proc previous_could_contain_tag*(line: PTextLine, tree: PTextBTree, - tag: PTextTag): PTextLine{.cdecl, dynlib: lib, importc: "_gtk_text_line_previous_could_contain_tag".} -proc line_data_new*(layout: PTextLayout, line: PTextLine): PTextLineData{. - cdecl, dynlib: lib, importc: "_gtk_text_line_data_new".} -proc check*(tree: PTextBTree){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_check".} -proc spew*(tree: PTextBTree){.cdecl, dynlib: lib, - importc: "_gtk_text_btree_spew".} -proc toggle_segment_check_func*(segPtr: PTextLineSegment, line: PTextLine){. - cdecl, dynlib: lib, importc: "_gtk_toggle_segment_check_func".} -proc change_node_toggle_count*(node: PTextBTreeNode, info: PTextTagInfo, - delta: gint){.cdecl, dynlib: lib, - importc: "_gtk_change_node_toggle_count".} -proc release_mark_segment*(tree: PTextBTree, - segment: PTextLineSegment){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_release_mark_segment".} -proc notify_will_remove_tag*(tree: PTextBTree, tag: PTextTag){.cdecl, - dynlib: lib, importc: "_gtk_text_btree_notify_will_remove_tag".} -const - bm_TGtkTextBuffer_modified* = 0x0001'i16 - bp_TGtkTextBuffer_modified* = 0'i16 - -proc TYPE_TEXT_BUFFER*(): GType -proc TEXT_BUFFER*(obj: pointer): PTextBuffer -proc TEXT_BUFFER_CLASS*(klass: pointer): PTextBufferClass -proc IS_TEXT_BUFFER*(obj: pointer): bool -proc IS_TEXT_BUFFER_CLASS*(klass: pointer): bool -proc TEXT_BUFFER_GET_CLASS*(obj: pointer): PTextBufferClass -proc modified*(a: PTextBuffer): guint -proc set_modified*(a: PTextBuffer, `modified`: guint) -proc text_buffer_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_type".} -proc text_buffer_new*(table: PTextTagTable): PTextBuffer{.cdecl, dynlib: lib, - importc: "gtk_text_buffer_new".} -proc get_line_count*(buffer: PTextBuffer): gint{.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_line_count".} -proc get_char_count*(buffer: PTextBuffer): gint{.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_char_count".} -proc get_tag_table*(buffer: PTextBuffer): PTextTagTable{.cdecl, - dynlib: lib, importc: "gtk_text_buffer_get_tag_table".} -proc set_text*(buffer: PTextBuffer, text: cstring, len: gint){. - cdecl, dynlib: lib, importc: "gtk_text_buffer_set_text".} -proc insert*(buffer: PTextBuffer, iter: PTextIter, text: cstring, - len: gint){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_insert".} -proc insert_at_cursor*(buffer: PTextBuffer, text: cstring, len: gint){. - cdecl, dynlib: lib, importc: "gtk_text_buffer_insert_at_cursor".} -proc insert_interactive*(buffer: PTextBuffer, iter: PTextIter, - text: cstring, len: gint, - default_editable: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_buffer_insert_interactive".} -proc insert_interactive_at_cursor*(buffer: PTextBuffer, - text: cstring, len: gint, default_editable: gboolean): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_buffer_insert_interactive_at_cursor".} -proc insert_range*(buffer: PTextBuffer, iter: PTextIter, - start: PTextIter, theEnd: PTextIter){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_insert_range".} -proc insert_range_interactive*(buffer: PTextBuffer, iter: PTextIter, - start: PTextIter, theEnd: PTextIter, default_editable: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_buffer_insert_range_interactive".} -proc delete*(buffer: PTextBuffer, start: PTextIter, - theEnd: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_delete".} -proc delete_interactive*(buffer: PTextBuffer, start_iter: PTextIter, - end_iter: PTextIter, - default_editable: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_buffer_delete_interactive".} -proc get_text*(buffer: PTextBuffer, start: PTextIter, - theEnd: PTextIter, include_hidden_chars: gboolean): cstring{. - cdecl, dynlib: lib, importc: "gtk_text_buffer_get_text".} -proc get_slice*(buffer: PTextBuffer, start: PTextIter, - theEnd: PTextIter, include_hidden_chars: gboolean): cstring{. - cdecl, dynlib: lib, importc: "gtk_text_buffer_get_slice".} -proc insert_pixbuf*(buffer: PTextBuffer, iter: PTextIter, - pixbuf: gdk2pixbuf.PPixbuf){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_insert_pixbuf".} -proc insert_child_anchor*(buffer: PTextBuffer, iter: PTextIter, - anchor: PTextChildAnchor){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_insert_child_anchor".} -proc create_child_anchor*(buffer: PTextBuffer, iter: PTextIter): PTextChildAnchor{. - cdecl, dynlib: lib, importc: "gtk_text_buffer_create_child_anchor".} -proc create_mark*(buffer: PTextBuffer, mark_name: cstring, - `where`: PTextIter, left_gravity: gboolean): PTextMark{. - cdecl, dynlib: lib, importc: "gtk_text_buffer_create_mark".} -proc move_mark*(buffer: PTextBuffer, mark: PTextMark, - `where`: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_move_mark".} -proc delete_mark*(buffer: PTextBuffer, mark: PTextMark){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_delete_mark".} -proc get_mark*(buffer: PTextBuffer, name: cstring): PTextMark{. - cdecl, dynlib: lib, importc: "gtk_text_buffer_get_mark".} -proc move_mark_by_name*(buffer: PTextBuffer, name: cstring, - `where`: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_move_mark_by_name".} -proc delete_mark_by_name*(buffer: PTextBuffer, name: cstring){. - cdecl, dynlib: lib, importc: "gtk_text_buffer_delete_mark_by_name".} -proc get_insert*(buffer: PTextBuffer): PTextMark{.cdecl, - dynlib: lib, importc: "gtk_text_buffer_get_insert".} -proc get_selection_bound*(buffer: PTextBuffer): PTextMark{.cdecl, - dynlib: lib, importc: "gtk_text_buffer_get_selection_bound".} -proc place_cursor*(buffer: PTextBuffer, `where`: PTextIter){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_place_cursor".} -proc apply_tag*(buffer: PTextBuffer, tag: PTextTag, - start: PTextIter, theEnd: PTextIter){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_apply_tag".} -proc remove_tag*(buffer: PTextBuffer, tag: PTextTag, - start: PTextIter, theEnd: PTextIter){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_remove_tag".} -proc apply_tag_by_name*(buffer: PTextBuffer, name: cstring, - start: PTextIter, theEnd: PTextIter){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_apply_tag_by_name".} -proc remove_tag_by_name*(buffer: PTextBuffer, name: cstring, - start: PTextIter, theEnd: PTextIter){. - cdecl, dynlib: lib, importc: "gtk_text_buffer_remove_tag_by_name".} -proc remove_all_tags*(buffer: PTextBuffer, start: PTextIter, - theEnd: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_remove_all_tags".} -proc get_iter_at_line_offset*(buffer: PTextBuffer, iter: PTextIter, - line_number: gint, char_offset: gint){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_iter_at_line_offset".} -proc get_iter_at_line_index*(buffer: PTextBuffer, iter: PTextIter, - line_number: gint, byte_index: gint){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_iter_at_line_index".} -proc get_iter_at_offset*(buffer: PTextBuffer, iter: PTextIter, - char_offset: gint){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_iter_at_offset".} -proc get_iter_at_line*(buffer: PTextBuffer, iter: PTextIter, - line_number: gint){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_iter_at_line".} -proc get_start_iter*(buffer: PTextBuffer, iter: PTextIter){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_get_start_iter".} -proc get_end_iter*(buffer: PTextBuffer, iter: PTextIter){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_get_end_iter".} -proc get_bounds*(buffer: PTextBuffer, start: PTextIter, - theEnd: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_bounds".} -proc get_iter_at_mark*(buffer: PTextBuffer, iter: PTextIter, - mark: PTextMark){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_get_iter_at_mark".} -proc get_iter_at_child_anchor*(buffer: PTextBuffer, iter: PTextIter, - anchor: PTextChildAnchor){.cdecl, dynlib: lib, importc: "gtk_text_buffer_get_iter_at_child_anchor".} -proc get_modified*(buffer: PTextBuffer): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_buffer_get_modified".} -proc set_modified*(buffer: PTextBuffer, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_set_modified".} -proc add_selection_clipboard*(buffer: PTextBuffer, - clipboard: PClipboard){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_add_selection_clipboard".} -proc remove_selection_clipboard*(buffer: PTextBuffer, - clipboard: PClipboard){.cdecl, dynlib: lib, importc: "gtk_text_buffer_remove_selection_clipboard".} -proc cut_clipboard*(buffer: PTextBuffer, clipboard: PClipboard, - default_editable: gboolean){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_cut_clipboard".} -proc copy_clipboard*(buffer: PTextBuffer, clipboard: PClipboard){. - cdecl, dynlib: lib, importc: "gtk_text_buffer_copy_clipboard".} -proc paste_clipboard*(buffer: PTextBuffer, clipboard: PClipboard, - override_location: PTextIter, - default_editable: gboolean){.cdecl, - dynlib: lib, importc: "gtk_text_buffer_paste_clipboard".} -proc get_selection_bounds*(buffer: PTextBuffer, start: PTextIter, - theEnd: PTextIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_buffer_get_selection_bounds".} -proc delete_selection*(buffer: PTextBuffer, interactive: gboolean, - default_editable: gboolean): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_buffer_delete_selection".} -proc begin_user_action*(buffer: PTextBuffer){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_begin_user_action".} -proc end_user_action*(buffer: PTextBuffer){.cdecl, dynlib: lib, - importc: "gtk_text_buffer_end_user_action".} -proc spew*(buffer: PTextBuffer){.cdecl, dynlib: lib, - importc: "_gtk_text_buffer_spew".} -proc get_btree*(buffer: PTextBuffer): PTextBTree{.cdecl, - dynlib: lib, importc: "_gtk_text_buffer_get_btree".} -proc get_line_log_attrs*(buffer: PTextBuffer, - anywhere_in_line: PTextIter, - char_len: Pgint): pango.PLogAttr{.cdecl, - dynlib: lib, importc: "_gtk_text_buffer_get_line_log_attrs".} -proc notify_will_remove_tag*(buffer: PTextBuffer, tag: PTextTag){. - cdecl, dynlib: lib, importc: "_gtk_text_buffer_notify_will_remove_tag".} -proc get_has_selection*(buffer: PTextBuffer): bool {.cdecl, - dynlib: lib, importc: "gtk_text_buffer_get_has_selection".} -proc select_range*(buffer: PTextBuffer, ins, - bound: PTextIter) {.cdecl, dynlib: lib, importc: "gtk_text_buffer_select_range".} -proc backspace*(buffer: PTextBuffer, iter: PTextIter, - interactive, defaultEditable: bool): bool {.cdecl, - dynlib: lib, importc: "gtk_text_buffer_backspace".} - -proc TYPE_TEXT_LAYOUT*(): GType -proc TEXT_LAYOUT*(obj: pointer): PTextLayout -proc TEXT_LAYOUT_CLASS*(klass: pointer): PTextLayoutClass -proc IS_TEXT_LAYOUT*(obj: pointer): bool -proc IS_TEXT_LAYOUT_CLASS*(klass: pointer): bool -proc TEXT_LAYOUT_GET_CLASS*(obj: pointer): PTextLayoutClass -const - bm_TGtkTextLayout_cursor_visible* = 0x0001'i16 - bp_TGtkTextLayout_cursor_visible* = 0'i16 - bm_TGtkTextLayout_cursor_direction* = 0x0006'i16 - bp_TGtkTextLayout_cursor_direction* = 1'i16 - -proc cursor_visible*(a: PTextLayout): guint -proc set_cursor_visible*(a: PTextLayout, `cursor_visible`: guint) -proc cursor_direction*(a: PTextLayout): gint -proc set_cursor_direction*(a: PTextLayout, `cursor_direction`: gint) -const - bm_TGtkTextCursorDisplay_is_strong* = 0x0001'i16 - bp_TGtkTextCursorDisplay_is_strong* = 0'i16 - bm_TGtkTextCursorDisplay_is_weak* = 0x0002'i16 - bp_TGtkTextCursorDisplay_is_weak* = 1'i16 - -proc is_strong*(a: PTextCursorDisplay): guint -proc set_is_strong*(a: PTextCursorDisplay, `is_strong`: guint) -proc is_weak*(a: PTextCursorDisplay): guint -proc set_is_weak*(a: PTextCursorDisplay, `is_weak`: guint) -proc text_layout_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_text_layout_get_type".} -proc text_layout_new*(): PTextLayout{.cdecl, dynlib: lib, - importc: "gtk_text_layout_new".} -proc set_buffer*(layout: PTextLayout, buffer: PTextBuffer){.cdecl, - dynlib: lib, importc: "gtk_text_layout_set_buffer".} -proc get_buffer*(layout: PTextLayout): PTextBuffer{.cdecl, - dynlib: lib, importc: "gtk_text_layout_get_buffer".} -proc set_default_style*(layout: PTextLayout, values: PTextAttributes){. - cdecl, dynlib: lib, importc: "gtk_text_layout_set_default_style".} -proc set_contexts*(layout: PTextLayout, ltr_context: pango.PContext, - rtl_context: pango.PContext){.cdecl, dynlib: lib, - importc: "gtk_text_layout_set_contexts".} -proc set_cursor_direction*(layout: PTextLayout, - direction: TTextDirection){.cdecl, - dynlib: lib, importc: "gtk_text_layout_set_cursor_direction".} -proc default_style_changed*(layout: PTextLayout){.cdecl, - dynlib: lib, importc: "gtk_text_layout_default_style_changed".} -proc set_screen_width*(layout: PTextLayout, width: gint){.cdecl, - dynlib: lib, importc: "gtk_text_layout_set_screen_width".} -proc set_preedit_string*(layout: PTextLayout, - preedit_string: cstring, - preedit_attrs: pango.PAttrList, - cursor_pos: gint){.cdecl, dynlib: lib, - importc: "gtk_text_layout_set_preedit_string".} -proc set_cursor_visible*(layout: PTextLayout, - cursor_visible: gboolean){.cdecl, - dynlib: lib, importc: "gtk_text_layout_set_cursor_visible".} -proc get_cursor_visible*(layout: PTextLayout): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_layout_get_cursor_visible".} -proc get_size*(layout: PTextLayout, width: Pgint, height: Pgint){. - cdecl, dynlib: lib, importc: "gtk_text_layout_get_size".} -proc get_lines*(layout: PTextLayout, top_y: gint, bottom_y: gint, - first_line_y: Pgint): PGSList{.cdecl, dynlib: lib, - importc: "gtk_text_layout_get_lines".} -proc wrap_loop_start*(layout: PTextLayout){.cdecl, dynlib: lib, - importc: "gtk_text_layout_wrap_loop_start".} -proc wrap_loop_end*(layout: PTextLayout){.cdecl, dynlib: lib, - importc: "gtk_text_layout_wrap_loop_end".} -proc get_line_display*(layout: PTextLayout, line: PTextLine, - size_only: gboolean): PTextLineDisplay{. - cdecl, dynlib: lib, importc: "gtk_text_layout_get_line_display".} -proc free_line_display*(layout: PTextLayout, - display: PTextLineDisplay){.cdecl, - dynlib: lib, importc: "gtk_text_layout_free_line_display".} -proc get_line_at_y*(layout: PTextLayout, target_iter: PTextIter, - y: gint, line_top: Pgint){.cdecl, dynlib: lib, - importc: "gtk_text_layout_get_line_at_y".} -proc get_iter_at_pixel*(layout: PTextLayout, iter: PTextIter, - x: gint, y: gint){.cdecl, dynlib: lib, - importc: "gtk_text_layout_get_iter_at_pixel".} -proc invalidate*(layout: PTextLayout, start: PTextIter, - theEnd: PTextIter){.cdecl, dynlib: lib, - importc: "gtk_text_layout_invalidate".} -proc free_line_data*(layout: PTextLayout, line: PTextLine, - line_data: PTextLineData){.cdecl, dynlib: lib, - importc: "gtk_text_layout_free_line_data".} -proc is_valid*(layout: PTextLayout): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_layout_is_valid".} -proc validate_yrange*(layout: PTextLayout, anchor_line: PTextIter, - y0: gint, y1: gint){.cdecl, dynlib: lib, - importc: "gtk_text_layout_validate_yrange".} -proc validate*(layout: PTextLayout, max_pixels: gint){.cdecl, - dynlib: lib, importc: "gtk_text_layout_validate".} -proc wrap*(layout: PTextLayout, line: PTextLine, - line_data: PTextLineData): PTextLineData{.cdecl, - dynlib: lib, importc: "gtk_text_layout_wrap".} -proc changed*(layout: PTextLayout, y: gint, old_height: gint, - new_height: gint){.cdecl, dynlib: lib, - importc: "gtk_text_layout_changed".} -proc get_iter_location*(layout: PTextLayout, iter: PTextIter, - rect: gdk2.PRectangle){.cdecl, dynlib: lib, - importc: "gtk_text_layout_get_iter_location".} -proc get_line_yrange*(layout: PTextLayout, iter: PTextIter, - y: Pgint, height: Pgint){.cdecl, dynlib: lib, - importc: "gtk_text_layout_get_line_yrange".} -proc get_line_xrange*(layout: PTextLayout, iter: PTextIter, - x: Pgint, width: Pgint){.cdecl, dynlib: lib, - importc: "_gtk_text_layout_get_line_xrange".} -proc get_cursor_locations*(layout: PTextLayout, iter: PTextIter, - strong_pos: gdk2.PRectangle, - weak_pos: gdk2.PRectangle){.cdecl, - dynlib: lib, importc: "gtk_text_layout_get_cursor_locations".} -proc clamp_iter_to_vrange*(layout: PTextLayout, iter: PTextIter, - top: gint, bottom: gint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_layout_clamp_iter_to_vrange".} -proc move_iter_to_line_end*(layout: PTextLayout, iter: PTextIter, - direction: gint): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_layout_move_iter_to_line_end".} -proc move_iter_to_previous_line*(layout: PTextLayout, - iter: PTextIter): gboolean{.cdecl, dynlib: lib, importc: "gtk_text_layout_move_iter_to_previous_line".} -proc move_iter_to_next_line*(layout: PTextLayout, iter: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_layout_move_iter_to_next_line".} -proc move_iter_to_x*(layout: PTextLayout, iter: PTextIter, x: gint){. - cdecl, dynlib: lib, importc: "gtk_text_layout_move_iter_to_x".} -proc move_iter_visually*(layout: PTextLayout, iter: PTextIter, - count: gint): gboolean{.cdecl, dynlib: lib, - importc: "gtk_text_layout_move_iter_visually".} -proc iter_starts_line*(layout: PTextLayout, iter: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_layout_iter_starts_line".} -proc get_iter_at_line*(layout: PTextLayout, iter: PTextIter, - line: PTextLine, byte_offset: gint){.cdecl, - dynlib: lib, importc: "gtk_text_layout_get_iter_at_line".} -proc anchor_register_child*(anchor: PTextChildAnchor, child: PWidget, - layout: PTextLayout){.cdecl, dynlib: lib, - importc: "gtk_text_child_anchor_register_child".} -proc anchor_unregister_child*(anchor: PTextChildAnchor, - child: PWidget){.cdecl, dynlib: lib, - importc: "gtk_text_child_anchor_unregister_child".} -proc anchor_queue_resize*(anchor: PTextChildAnchor, - layout: PTextLayout){.cdecl, dynlib: lib, - importc: "gtk_text_child_anchor_queue_resize".} -proc text_anchored_child_set_layout*(child: PWidget, layout: PTextLayout){. - cdecl, dynlib: lib, importc: "gtk_text_anchored_child_set_layout".} -proc spew*(layout: PTextLayout){.cdecl, dynlib: lib, - importc: "gtk_text_layout_spew".} -const # GTK_TEXT_VIEW_PRIORITY_VALIDATE* = GDK_PRIORITY_REDRAW + 5 - bm_TGtkTextView_editable* = 0x0001'i16 - bp_TGtkTextView_editable* = 0'i16 - bm_TGtkTextView_overwrite_mode* = 0x0002'i16 - bp_TGtkTextView_overwrite_mode* = 1'i16 - bm_TGtkTextView_cursor_visible* = 0x0004'i16 - bp_TGtkTextView_cursor_visible* = 2'i16 - bm_TGtkTextView_need_im_reset* = 0x0008'i16 - bp_TGtkTextView_need_im_reset* = 3'i16 - bm_TGtkTextView_just_selected_element* = 0x0010'i16 - bp_TGtkTextView_just_selected_element* = 4'i16 - bm_TGtkTextView_disable_scroll_on_focus* = 0x0020'i16 - bp_TGtkTextView_disable_scroll_on_focus* = 5'i16 - bm_TGtkTextView_onscreen_validated* = 0x0040'i16 - bp_TGtkTextView_onscreen_validated* = 6'i16 - bm_TGtkTextView_mouse_cursor_obscured* = 0x0080'i16 - bp_TGtkTextView_mouse_cursor_obscured* = 7'i16 - -proc TYPE_TEXT_VIEW*(): GType -proc TEXT_VIEW*(obj: pointer): PTextView -proc TEXT_VIEW_CLASS*(klass: pointer): PTextViewClass -proc IS_TEXT_VIEW*(obj: pointer): bool -proc IS_TEXT_VIEW_CLASS*(klass: pointer): bool -proc TEXT_VIEW_GET_CLASS*(obj: pointer): PTextViewClass -proc editable*(a: PTextView): guint -proc set_editable*(a: PTextView, `editable`: guint) -proc overwrite_mode*(a: PTextView): guint -proc set_overwrite_mode*(a: PTextView, `overwrite_mode`: guint) -proc cursor_visible*(a: PTextView): guint -proc set_cursor_visible*(a: PTextView, `cursor_visible`: guint) -proc need_im_reset*(a: PTextView): guint -proc set_need_im_reset*(a: PTextView, `need_im_reset`: guint) -proc just_selected_element*(a: PTextView): guint -proc set_just_selected_element*(a: PTextView, `just_selected_element`: guint) -proc disable_scroll_on_focus*(a: PTextView): guint -proc set_disable_scroll_on_focus*(a: PTextView, - `disable_scroll_on_focus`: guint) -proc onscreen_validated*(a: PTextView): guint -proc set_onscreen_validated*(a: PTextView, `onscreen_validated`: guint) -proc mouse_cursor_obscured*(a: PTextView): guint -proc set_mouse_cursor_obscured*(a: PTextView, `mouse_cursor_obscured`: guint) -proc text_view_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_text_view_get_type".} -proc text_view_new*(): PTextView{.cdecl, dynlib: lib, - importc: "gtk_text_view_new".} -proc text_view_new*(buffer: PTextBuffer): PTextView{.cdecl, - dynlib: lib, importc: "gtk_text_view_new_with_buffer".} -proc set_buffer*(text_view: PTextView, buffer: PTextBuffer){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_buffer".} -proc get_buffer*(text_view: PTextView): PTextBuffer{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_buffer".} -proc scroll_to_iter*(text_view: PTextView, iter: PTextIter, - within_margin: gdouble, use_align: gboolean, - xalign: gdouble, yalign: gdouble): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_view_scroll_to_iter".} -proc scroll_to_mark*(text_view: PTextView, mark: PTextMark, - within_margin: gdouble, use_align: gboolean, - xalign: gdouble, yalign: gdouble){.cdecl, - dynlib: lib, importc: "gtk_text_view_scroll_to_mark".} -proc scroll_mark_onscreen*(text_view: PTextView, mark: PTextMark){. - cdecl, dynlib: lib, importc: "gtk_text_view_scroll_mark_onscreen".} -proc move_mark_onscreen*(text_view: PTextView, mark: PTextMark): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_view_move_mark_onscreen".} -proc place_cursor_onscreen*(text_view: PTextView): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_view_place_cursor_onscreen".} -proc get_visible_rect*(text_view: PTextView, - visible_rect: gdk2.PRectangle){.cdecl, - dynlib: lib, importc: "gtk_text_view_get_visible_rect".} -proc set_cursor_visible*(text_view: PTextView, setting: gboolean){. - cdecl, dynlib: lib, importc: "gtk_text_view_set_cursor_visible".} -proc get_cursor_visible*(text_view: PTextView): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_cursor_visible".} -proc get_iter_location*(text_view: PTextView, iter: PTextIter, - location: gdk2.PRectangle){.cdecl, dynlib: lib, - importc: "gtk_text_view_get_iter_location".} -proc get_iter_at_location*(text_view: PTextView, iter: PTextIter, - x: gint, y: gint){.cdecl, dynlib: lib, - importc: "gtk_text_view_get_iter_at_location".} -proc get_line_yrange*(text_view: PTextView, iter: PTextIter, y: Pgint, - height: Pgint){.cdecl, dynlib: lib, - importc: "gtk_text_view_get_line_yrange".} -proc get_line_at_y*(text_view: PTextView, target_iter: PTextIter, - y: gint, line_top: Pgint){.cdecl, dynlib: lib, - importc: "gtk_text_view_get_line_at_y".} -proc buffer_to_window_coords*(text_view: PTextView, - win: TTextWindowType, buffer_x: gint, - buffer_y: gint, window_x: Pgint, - window_y: Pgint){.cdecl, dynlib: lib, - importc: "gtk_text_view_buffer_to_window_coords".} -proc window_to_buffer_coords*(text_view: PTextView, - win: TTextWindowType, window_x: gint, - window_y: gint, buffer_x: Pgint, - buffer_y: Pgint){.cdecl, dynlib: lib, - importc: "gtk_text_view_window_to_buffer_coords".} -proc get_window*(text_view: PTextView, win: TTextWindowType): gdk2.PWindow{. - cdecl, dynlib: lib, importc: "gtk_text_view_get_window".} -proc get_window_type*(text_view: PTextView, window: gdk2.PWindow): TTextWindowType{. - cdecl, dynlib: lib, importc: "gtk_text_view_get_window_type".} -proc set_border_window_size*(text_view: PTextView, - thetype: TTextWindowType, size: gint){. - cdecl, dynlib: lib, importc: "gtk_text_view_set_border_window_size".} -proc get_border_window_size*(text_view: PTextView, - thetype: TTextWindowType): gint{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_border_window_size".} -proc forward_display_line*(text_view: PTextView, iter: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_view_forward_display_line".} -proc backward_display_line*(text_view: PTextView, iter: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_view_backward_display_line".} -proc forward_display_line_end*(text_view: PTextView, iter: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_view_forward_display_line_end".} -proc backward_display_line_start*(text_view: PTextView, - iter: PTextIter): gboolean{.cdecl, dynlib: lib, importc: "gtk_text_view_backward_display_line_start".} -proc starts_display_line*(text_view: PTextView, iter: PTextIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_view_starts_display_line".} -proc move_visually*(text_view: PTextView, iter: PTextIter, count: gint): gboolean{. - cdecl, dynlib: lib, importc: "gtk_text_view_move_visually".} -proc add_child_at_anchor*(text_view: PTextView, child: PWidget, - anchor: PTextChildAnchor){.cdecl, - dynlib: lib, importc: "gtk_text_view_add_child_at_anchor".} -proc add_child_in_window*(text_view: PTextView, child: PWidget, - which_window: TTextWindowType, xpos: gint, - ypos: gint){.cdecl, dynlib: lib, - importc: "gtk_text_view_add_child_in_window".} -proc move_child*(text_view: PTextView, child: PWidget, xpos: gint, - ypos: gint){.cdecl, dynlib: lib, - importc: "gtk_text_view_move_child".} -proc set_wrap_mode*(text_view: PTextView, wrap_mode: TWrapMode){. - cdecl, dynlib: lib, importc: "gtk_text_view_set_wrap_mode".} -proc get_wrap_mode*(text_view: PTextView): TWrapMode{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_wrap_mode".} -proc set_editable*(text_view: PTextView, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_editable".} -proc get_editable*(text_view: PTextView): gboolean{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_editable".} -proc set_pixels_above_lines*(text_view: PTextView, - pixels_above_lines: gint){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_pixels_above_lines".} -proc get_pixels_above_lines*(text_view: PTextView): gint{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_pixels_above_lines".} -proc set_pixels_below_lines*(text_view: PTextView, - pixels_below_lines: gint){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_pixels_below_lines".} -proc get_pixels_below_lines*(text_view: PTextView): gint{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_pixels_below_lines".} -proc set_pixels_inside_wrap*(text_view: PTextView, - pixels_inside_wrap: gint){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_pixels_inside_wrap".} -proc get_pixels_inside_wrap*(text_view: PTextView): gint{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_pixels_inside_wrap".} -proc set_justification*(text_view: PTextView, - justification: TJustification){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_justification".} -proc get_justification*(text_view: PTextView): TJustification{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_justification".} -proc set_left_margin*(text_view: PTextView, left_margin: gint){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_left_margin".} -proc get_left_margin*(text_view: PTextView): gint{.cdecl, dynlib: lib, - importc: "gtk_text_view_get_left_margin".} -proc set_right_margin*(text_view: PTextView, right_margin: gint){. - cdecl, dynlib: lib, importc: "gtk_text_view_set_right_margin".} -proc get_right_margin*(text_view: PTextView): gint{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_right_margin".} -proc set_indent*(text_view: PTextView, indent: gint){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_indent".} -proc get_indent*(text_view: PTextView): gint{.cdecl, dynlib: lib, - importc: "gtk_text_view_get_indent".} -proc set_tabs*(text_view: PTextView, tabs: pango.PTabArray){.cdecl, - dynlib: lib, importc: "gtk_text_view_set_tabs".} -proc get_tabs*(text_view: PTextView): pango.PTabArray{.cdecl, - dynlib: lib, importc: "gtk_text_view_get_tabs".} -proc get_default_attributes*(text_view: PTextView): PTextAttributes{. - cdecl, dynlib: lib, importc: "gtk_text_view_get_default_attributes".} -const - bm_TGtkTipsQuery_emit_always* = 0x0001'i16 - bp_TGtkTipsQuery_emit_always* = 0'i16 - bm_TGtkTipsQuery_in_query* = 0x0002'i16 - bp_TGtkTipsQuery_in_query* = 1'i16 - -proc TYPE_TIPS_QUERY*(): GType -proc TIPS_QUERY*(obj: pointer): PTipsQuery -proc TIPS_QUERY_CLASS*(klass: pointer): PTipsQueryClass -proc IS_TIPS_QUERY*(obj: pointer): bool -proc IS_TIPS_QUERY_CLASS*(klass: pointer): bool -proc TIPS_QUERY_GET_CLASS*(obj: pointer): PTipsQueryClass -proc emit_always*(a: PTipsQuery): guint -proc set_emit_always*(a: PTipsQuery, `emit_always`: guint) -proc in_query*(a: PTipsQuery): guint -proc set_in_query*(a: PTipsQuery, `in_query`: guint) -proc tips_query_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tips_query_get_type".} -proc tips_query_new*(): PTipsQuery{.cdecl, dynlib: lib, - importc: "gtk_tips_query_new".} -proc start_query*(tips_query: PTipsQuery){.cdecl, dynlib: lib, - importc: "gtk_tips_query_start_query".} -proc stop_query*(tips_query: PTipsQuery){.cdecl, dynlib: lib, - importc: "gtk_tips_query_stop_query".} -proc set_caller*(tips_query: PTipsQuery, caller: PWidget){.cdecl, - dynlib: lib, importc: "gtk_tips_query_set_caller".} -proc set_labels*(tips_query: PTipsQuery, label_inactive: cstring, - label_no_tip: cstring){.cdecl, dynlib: lib, - importc: "gtk_tips_query_set_labels".} -const - bm_TGtkTooltips_delay* = 0x3FFFFFFF'i32 - bp_TGtkTooltips_delay* = 0'i32 - bm_TGtkTooltips_enabled* = 0x40000000'i32 - bp_TGtkTooltips_enabled* = 30'i32 - bm_TGtkTooltips_have_grab* = 0x80000000'i32 - bp_TGtkTooltips_have_grab* = 31'i32 - bm_TGtkTooltips_use_sticky_delay* = 0x00000001'i32 - bp_TGtkTooltips_use_sticky_delay* = 0'i32 - -proc TYPE_TOOLTIPS*(): GType -proc TOOLTIPS*(obj: pointer): PTooltips -proc TOOLTIPS_CLASS*(klass: pointer): PTooltipsClass -proc IS_TOOLTIPS*(obj: pointer): bool -proc IS_TOOLTIPS_CLASS*(klass: pointer): bool -proc TOOLTIPS_GET_CLASS*(obj: pointer): PTooltipsClass -proc delay*(a: PTooltips): guint -proc set_delay*(a: PTooltips, `delay`: guint) -proc enabled*(a: PTooltips): guint -proc set_enabled*(a: PTooltips, `enabled`: guint) -proc have_grab*(a: PTooltips): guint -proc set_have_grab*(a: PTooltips, `have_grab`: guint) -proc use_sticky_delay*(a: PTooltips): guint -proc set_use_sticky_delay*(a: PTooltips, `use_sticky_delay`: guint) -proc tooltips_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tooltips_get_type".} -proc tooltips_new*(): PTooltips{.cdecl, dynlib: lib, importc: "gtk_tooltips_new".} -proc enable*(tooltips: PTooltips){.cdecl, dynlib: lib, - importc: "gtk_tooltips_enable".} -proc disable*(tooltips: PTooltips){.cdecl, dynlib: lib, - importc: "gtk_tooltips_disable".} -proc set_tip*(tooltips: PTooltips, widget: PWidget, tip_text: cstring, - tip_private: cstring){.cdecl, dynlib: lib, - importc: "gtk_tooltips_set_tip".} -proc tooltips_data_get*(widget: PWidget): PTooltipsData{.cdecl, dynlib: lib, - importc: "gtk_tooltips_data_get".} -proc force_window*(tooltips: PTooltips){.cdecl, dynlib: lib, - importc: "gtk_tooltips_force_window".} -proc tooltips_toggle_keyboard_mode*(widget: PWidget){.cdecl, dynlib: lib, - importc: "_gtk_tooltips_toggle_keyboard_mode".} -const - bm_TGtkToolbar_style_set* = 0x0001'i16 - bp_TGtkToolbar_style_set* = 0'i16 - bm_TGtkToolbar_icon_size_set* = 0x0002'i16 - bp_TGtkToolbar_icon_size_set* = 1'i16 - -proc TYPE_TOOLBAR*(): GType -proc TOOLBAR*(obj: pointer): PToolbar -proc TOOLBAR_CLASS*(klass: pointer): PToolbarClass -proc IS_TOOLBAR*(obj: pointer): bool -proc IS_TOOLBAR_CLASS*(klass: pointer): bool -proc TOOLBAR_GET_CLASS*(obj: pointer): PToolbarClass -proc style_set*(a: PToolbar): guint -proc set_style_set*(a: PToolbar, `style_set`: guint) -proc icon_size_set*(a: PToolbar): guint -proc set_icon_size_set*(a: PToolbar, `icon_size_set`: guint) -proc toolbar_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_toolbar_get_type".} -proc toolbar_new*(): PToolbar{.cdecl, dynlib: lib, importc: "gtk_toolbar_new".} -proc append_item*(toolbar: PToolbar, text: cstring, - tooltip_text: cstring, tooltip_private_text: cstring, - icon: PWidget, callback: TSignalFunc, - user_data: gpointer): PWidget{.cdecl, dynlib: lib, - importc: "gtk_toolbar_append_item".} -proc prepend_item*(toolbar: PToolbar, text: cstring, - tooltip_text: cstring, tooltip_private_text: cstring, - icon: PWidget, callback: TSignalFunc, - user_data: gpointer): PWidget{.cdecl, dynlib: lib, - importc: "gtk_toolbar_prepend_item".} -proc insert_item*(toolbar: PToolbar, text: cstring, - tooltip_text: cstring, tooltip_private_text: cstring, - icon: PWidget, callback: TSignalFunc, - user_data: gpointer, position: gint): PWidget{.cdecl, - dynlib: lib, importc: "gtk_toolbar_insert_item".} -proc insert_stock*(toolbar: PToolbar, stock_id: cstring, - tooltip_text: cstring, tooltip_private_text: cstring, - callback: TSignalFunc, user_data: gpointer, - position: gint): PWidget{.cdecl, dynlib: lib, - importc: "gtk_toolbar_insert_stock".} -proc append_space*(toolbar: PToolbar){.cdecl, dynlib: lib, - importc: "gtk_toolbar_append_space".} -proc prepend_space*(toolbar: PToolbar){.cdecl, dynlib: lib, - importc: "gtk_toolbar_prepend_space".} -proc insert_space*(toolbar: PToolbar, position: gint){.cdecl, - dynlib: lib, importc: "gtk_toolbar_insert_space".} -proc remove_space*(toolbar: PToolbar, position: gint){.cdecl, - dynlib: lib, importc: "gtk_toolbar_remove_space".} -proc append_element*(toolbar: PToolbar, thetype: TToolbarChildType, - widget: PWidget, text: cstring, - tooltip_text: cstring, - tooltip_private_text: cstring, icon: PWidget, - callback: TSignalFunc, user_data: gpointer): PWidget{. - cdecl, dynlib: lib, importc: "gtk_toolbar_append_element".} -proc prepend_element*(toolbar: PToolbar, thetype: TToolbarChildType, - widget: PWidget, text: cstring, - tooltip_text: cstring, - tooltip_private_text: cstring, icon: PWidget, - callback: TSignalFunc, user_data: gpointer): PWidget{. - cdecl, dynlib: lib, importc: "gtk_toolbar_prepend_element".} -proc insert_element*(toolbar: PToolbar, thetype: TToolbarChildType, - widget: PWidget, text: cstring, - tooltip_text: cstring, - tooltip_private_text: cstring, icon: PWidget, - callback: TSignalFunc, user_data: gpointer, - position: gint): PWidget{.cdecl, dynlib: lib, - importc: "gtk_toolbar_insert_element".} -proc append_widget*(toolbar: PToolbar, widget: PWidget, - tooltip_text: cstring, tooltip_private_text: cstring){. - cdecl, dynlib: lib, importc: "gtk_toolbar_append_widget".} -proc prepend_widget*(toolbar: PToolbar, widget: PWidget, - tooltip_text: cstring, - tooltip_private_text: cstring){.cdecl, dynlib: lib, - importc: "gtk_toolbar_prepend_widget".} -proc insert_widget*(toolbar: PToolbar, widget: PWidget, - tooltip_text: cstring, - tooltip_private_text: cstring, position: gint){. - cdecl, dynlib: lib, importc: "gtk_toolbar_insert_widget".} -proc set_orientation*(toolbar: PToolbar, orientation: TOrientation){. - cdecl, dynlib: lib, importc: "gtk_toolbar_set_orientation".} -proc set_style*(toolbar: PToolbar, style: TToolbarStyle){.cdecl, - dynlib: lib, importc: "gtk_toolbar_set_style".} -proc set_icon_size*(toolbar: PToolbar, icon_size: TIconSize){.cdecl, - dynlib: lib, importc: "gtk_toolbar_set_icon_size".} -proc set_tooltips*(toolbar: PToolbar, enable: gboolean){.cdecl, - dynlib: lib, importc: "gtk_toolbar_set_tooltips".} -proc unset_style*(toolbar: PToolbar){.cdecl, dynlib: lib, - importc: "gtk_toolbar_unset_style".} -proc unset_icon_size*(toolbar: PToolbar){.cdecl, dynlib: lib, - importc: "gtk_toolbar_unset_icon_size".} -proc get_orientation*(toolbar: PToolbar): TOrientation{.cdecl, - dynlib: lib, importc: "gtk_toolbar_get_orientation".} -proc get_style*(toolbar: PToolbar): TToolbarStyle{.cdecl, dynlib: lib, - importc: "gtk_toolbar_get_style".} -proc get_icon_size*(toolbar: PToolbar): TIconSize{.cdecl, dynlib: lib, - importc: "gtk_toolbar_get_icon_size".} -proc get_tooltips*(toolbar: PToolbar): gboolean{.cdecl, dynlib: lib, - importc: "gtk_toolbar_get_tooltips".} -const - bm_TGtkTree_selection_mode* = 0x0003'i16 - bp_TGtkTree_selection_mode* = 0'i16 - bm_TGtkTree_view_mode* = 0x0004'i16 - bp_TGtkTree_view_mode* = 2'i16 - bm_TGtkTree_view_line* = 0x0008'i16 - bp_TGtkTree_view_line* = 3'i16 - -proc TYPE_TREE*(): GType -proc TREE*(obj: pointer): PTree -proc TREE_CLASS*(klass: pointer): PTreeClass -proc IS_TREE*(obj: pointer): bool -proc IS_TREE_CLASS*(klass: pointer): bool -proc TREE_GET_CLASS*(obj: pointer): PTreeClass -proc IS_ROOT_TREE*(obj: pointer): bool -proc TREE_ROOT_TREE*(obj: pointer): PTree -proc TREE_SELECTION_OLD*(obj: pointer): PGList -proc selection_mode*(a: PTree): guint -proc set_selection_mode*(a: PTree, `selection_mode`: guint) -proc view_mode*(a: PTree): guint -proc set_view_mode*(a: PTree, `view_mode`: guint) -proc view_line*(a: PTree): guint -proc set_view_line*(a: PTree, `view_line`: guint) -proc tree_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_tree_get_type".} -proc tree_new*(): PTree{.cdecl, dynlib: lib, importc: "gtk_tree_new".} -proc append*(tree: PTree, tree_item: PWidget){.cdecl, dynlib: lib, - importc: "gtk_tree_append".} -proc prepend*(tree: PTree, tree_item: PWidget){.cdecl, dynlib: lib, - importc: "gtk_tree_prepend".} -proc insert*(tree: PTree, tree_item: PWidget, position: gint){.cdecl, - dynlib: lib, importc: "gtk_tree_insert".} -proc remove_items*(tree: PTree, items: PGList){.cdecl, dynlib: lib, - importc: "gtk_tree_remove_items".} -proc clear_items*(tree: PTree, start: gint, theEnd: gint){.cdecl, - dynlib: lib, importc: "gtk_tree_clear_items".} -proc select_item*(tree: PTree, item: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_select_item".} -proc unselect_item*(tree: PTree, item: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_unselect_item".} -proc select_child*(tree: PTree, tree_item: PWidget){.cdecl, dynlib: lib, - importc: "gtk_tree_select_child".} -proc unselect_child*(tree: PTree, tree_item: PWidget){.cdecl, dynlib: lib, - importc: "gtk_tree_unselect_child".} -proc child_position*(tree: PTree, child: PWidget): gint{.cdecl, - dynlib: lib, importc: "gtk_tree_child_position".} -proc set_selection_mode*(tree: PTree, mode: TSelectionMode){.cdecl, - dynlib: lib, importc: "gtk_tree_set_selection_mode".} -proc set_view_mode*(tree: PTree, mode: TTreeViewMode){.cdecl, dynlib: lib, - importc: "gtk_tree_set_view_mode".} -proc set_view_lines*(tree: PTree, flag: gboolean){.cdecl, dynlib: lib, - importc: "gtk_tree_set_view_lines".} -proc remove_item*(tree: PTree, child: PWidget){.cdecl, dynlib: lib, - importc: "gtk_tree_remove_item".} -proc TYPE_TREE_DRAG_SOURCE*(): GType -proc TREE_DRAG_SOURCE*(obj: pointer): PTreeDragSource -proc IS_TREE_DRAG_SOURCE*(obj: pointer): bool -proc TREE_DRAG_SOURCE_GET_IFACE*(obj: pointer): PTreeDragSourceIface -proc tree_drag_source_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_tree_drag_source_get_type".} -proc source_row_draggable*(drag_source: PTreeDragSource, - path: PTreePath): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_drag_source_row_draggable".} -proc source_drag_data_delete*(drag_source: PTreeDragSource, - path: PTreePath): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_drag_source_drag_data_delete".} -proc source_drag_data_get*(drag_source: PTreeDragSource, - path: PTreePath, - selection_data: PSelectionData): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_drag_source_drag_data_get".} -proc TYPE_TREE_DRAG_DEST*(): GType -proc TREE_DRAG_DEST*(obj: pointer): PTreeDragDest -proc IS_TREE_DRAG_DEST*(obj: pointer): bool -proc TREE_DRAG_DEST_GET_IFACE*(obj: pointer): PTreeDragDestIface -proc tree_drag_dest_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_tree_drag_dest_get_type".} -proc dest_drag_data_received*(drag_dest: PTreeDragDest, - dest: PTreePath, - selection_data: PSelectionData): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_drag_dest_drag_data_received".} -proc dest_row_drop_possible*(drag_dest: PTreeDragDest, - dest_path: PTreePath, - selection_data: PSelectionData): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_drag_dest_row_drop_possible".} -proc tree_set_row_drag_data*(selection_data: PSelectionData, - tree_model: PTreeModel, path: PTreePath): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_set_row_drag_data".} -const - bm_TGtkTreeItem_expanded* = 0x0001'i16 - bp_TGtkTreeItem_expanded* = 0'i16 - -proc TYPE_TREE_ITEM*(): GType -proc TREE_ITEM*(obj: pointer): PTreeItem -proc TREE_ITEM_CLASS*(klass: pointer): PTreeItemClass -proc IS_TREE_ITEM*(obj: pointer): bool -proc IS_TREE_ITEM_CLASS*(klass: pointer): bool -proc TREE_ITEM_GET_CLASS*(obj: pointer): PTreeItemClass -proc TREE_ITEM_SUBTREE*(obj: pointer): PWidget -proc expanded*(a: PTreeItem): guint -proc set_expanded*(a: PTreeItem, `expanded`: guint) -proc tree_item_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tree_item_get_type".} -proc tree_item_new*(): PTreeItem{.cdecl, dynlib: lib, - importc: "gtk_tree_item_new".} -proc tree_item_new*(`label`: cstring): PTreeItem{.cdecl, dynlib: lib, - importc: "gtk_tree_item_new_with_label".} -proc set_subtree*(tree_item: PTreeItem, subtree: PWidget){.cdecl, - dynlib: lib, importc: "gtk_tree_item_set_subtree".} -proc remove_subtree*(tree_item: PTreeItem){.cdecl, dynlib: lib, - importc: "gtk_tree_item_remove_subtree".} -proc select*(tree_item: PTreeItem){.cdecl, dynlib: lib, - importc: "gtk_tree_item_select".} -proc deselect*(tree_item: PTreeItem){.cdecl, dynlib: lib, - importc: "gtk_tree_item_deselect".} -proc expand*(tree_item: PTreeItem){.cdecl, dynlib: lib, - importc: "gtk_tree_item_expand".} -proc collapse*(tree_item: PTreeItem){.cdecl, dynlib: lib, - importc: "gtk_tree_item_collapse".} -proc TYPE_TREE_SELECTION*(): GType -proc TREE_SELECTION*(obj: pointer): PTreeSelection -proc TREE_SELECTION_CLASS*(klass: pointer): PTreeSelectionClass -proc IS_TREE_SELECTION*(obj: pointer): bool -proc IS_TREE_SELECTION_CLASS*(klass: pointer): bool -proc TREE_SELECTION_GET_CLASS*(obj: pointer): PTreeSelectionClass -proc tree_selection_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tree_selection_get_type".} -proc set_mode*(selection: PTreeSelection, thetype: TSelectionMode){. - cdecl, dynlib: lib, importc: "gtk_tree_selection_set_mode".} -proc get_mode*(selection: PTreeSelection): TSelectionMode{.cdecl, - dynlib: lib, importc: "gtk_tree_selection_get_mode".} -proc set_select_function*(selection: PTreeSelection, - fun: TTreeSelectionFunc, data: gpointer, destroy: TDestroyNotify){.cdecl, - dynlib: lib, importc: "gtk_tree_selection_set_select_function".} -proc get_user_data*(selection: PTreeSelection): gpointer{.cdecl, - dynlib: lib, importc: "gtk_tree_selection_get_user_data".} -proc get_tree_view*(selection: PTreeSelection): PTreeView{.cdecl, - dynlib: lib, importc: "gtk_tree_selection_get_tree_view".} -proc get_selected*(selection: PTreeSelection, - model: PPGtkTreeModel, iter: PTreeIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_selection_get_selected".} -proc get_selected_rows*(selection: PTreeSelection, - model: PPGtkTreeModel): PGList{.cdecl, - dynlib: lib, importc: "gtk_tree_selection_get_selected_rows".} -proc selected_foreach*(selection: PTreeSelection, - fun: TTreeSelectionForeachFunc, - data: gpointer){.cdecl, dynlib: lib, - importc: "gtk_tree_selection_selected_foreach".} -proc select_path*(selection: PTreeSelection, path: PTreePath){. - cdecl, dynlib: lib, importc: "gtk_tree_selection_select_path".} -proc unselect_path*(selection: PTreeSelection, path: PTreePath){. - cdecl, dynlib: lib, importc: "gtk_tree_selection_unselect_path".} -proc select_iter*(selection: PTreeSelection, iter: PTreeIter){. - cdecl, dynlib: lib, importc: "gtk_tree_selection_select_iter".} -proc unselect_iter*(selection: PTreeSelection, iter: PTreeIter){. - cdecl, dynlib: lib, importc: "gtk_tree_selection_unselect_iter".} -proc path_is_selected*(selection: PTreeSelection, path: PTreePath): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_selection_path_is_selected".} -proc iter_is_selected*(selection: PTreeSelection, iter: PTreeIter): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_selection_iter_is_selected".} -proc select_all*(selection: PTreeSelection){.cdecl, dynlib: lib, - importc: "gtk_tree_selection_select_all".} -proc unselect_all*(selection: PTreeSelection){.cdecl, - dynlib: lib, importc: "gtk_tree_selection_unselect_all".} -proc select_range*(selection: PTreeSelection, - start_path: PTreePath, end_path: PTreePath){. - cdecl, dynlib: lib, importc: "gtk_tree_selection_select_range".} -const - bm_TGtkTreeStore_columns_dirty* = 0x0001'i16 - bp_TGtkTreeStore_columns_dirty* = 0'i16 - -proc TYPE_TREE_STORE*(): GType -proc TREE_STORE*(obj: pointer): PTreeStore -proc TREE_STORE_CLASS*(klass: pointer): PTreeStoreClass -proc IS_TREE_STORE*(obj: pointer): bool -proc IS_TREE_STORE_CLASS*(klass: pointer): bool -proc TREE_STORE_GET_CLASS*(obj: pointer): PTreeStoreClass -proc columns_dirty*(a: PTreeStore): guint -proc set_columns_dirty*(a: PTreeStore, `columns_dirty`: guint) -proc tree_store_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tree_store_get_type".} -proc tree_store_newv*(n_columns: gint, types: PGType): PTreeStore{.cdecl, - dynlib: lib, importc: "gtk_tree_store_newv".} -proc set_column_types*(tree_store: PTreeStore, n_columns: gint, - types: PGType){.cdecl, dynlib: lib, - importc: "gtk_tree_store_set_column_types".} -proc set_value*(tree_store: PTreeStore, iter: PTreeIter, - column: gint, value: PGValue){.cdecl, dynlib: lib, - importc: "gtk_tree_store_set_value".} -proc remove*(tree_store: PTreeStore, iter: PTreeIter){.cdecl, - dynlib: lib, importc: "gtk_tree_store_remove".} -proc insert*(tree_store: PTreeStore, iter: PTreeIter, - parent: PTreeIter, position: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_store_insert".} -proc insert_before*(tree_store: PTreeStore, iter: PTreeIter, - parent: PTreeIter, sibling: PTreeIter){.cdecl, - dynlib: lib, importc: "gtk_tree_store_insert_before".} -proc insert_after*(tree_store: PTreeStore, iter: PTreeIter, - parent: PTreeIter, sibling: PTreeIter){.cdecl, - dynlib: lib, importc: "gtk_tree_store_insert_after".} -proc prepend*(tree_store: PTreeStore, iter: PTreeIter, - parent: PTreeIter){.cdecl, dynlib: lib, - importc: "gtk_tree_store_prepend".} -proc append*(tree_store: PTreeStore, iter: PTreeIter, - parent: PTreeIter){.cdecl, dynlib: lib, - importc: "gtk_tree_store_append".} -proc is_ancestor*(tree_store: PTreeStore, iter: PTreeIter, - descendant: PTreeIter): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_store_is_ancestor".} -proc iter_depth*(tree_store: PTreeStore, iter: PTreeIter): gint{. - cdecl, dynlib: lib, importc: "gtk_tree_store_iter_depth".} -proc clear*(tree_store: PTreeStore){.cdecl, dynlib: lib, - importc: "gtk_tree_store_clear".} -const - bm_TGtkTreeViewColumn_visible* = 0x0001'i16 - bp_TGtkTreeViewColumn_visible* = 0'i16 - bm_TGtkTreeViewColumn_resizable* = 0x0002'i16 - bp_TGtkTreeViewColumn_resizable* = 1'i16 - bm_TGtkTreeViewColumn_clickable* = 0x0004'i16 - bp_TGtkTreeViewColumn_clickable* = 2'i16 - bm_TGtkTreeViewColumn_dirty* = 0x0008'i16 - bp_TGtkTreeViewColumn_dirty* = 3'i16 - bm_TGtkTreeViewColumn_show_sort_indicator* = 0x0010'i16 - bp_TGtkTreeViewColumn_show_sort_indicator* = 4'i16 - bm_TGtkTreeViewColumn_maybe_reordered* = 0x0020'i16 - bp_TGtkTreeViewColumn_maybe_reordered* = 5'i16 - bm_TGtkTreeViewColumn_reorderable* = 0x0040'i16 - bp_TGtkTreeViewColumn_reorderable* = 6'i16 - bm_TGtkTreeViewColumn_use_resized_width* = 0x0080'i16 - bp_TGtkTreeViewColumn_use_resized_width* = 7'i16 - -proc TYPE_TREE_VIEW_COLUMN*(): GType -proc TREE_VIEW_COLUMN*(obj: pointer): PTreeViewColumn -proc TREE_VIEW_COLUMN_CLASS*(klass: pointer): PTreeViewColumnClass -proc IS_TREE_VIEW_COLUMN*(obj: pointer): bool -proc IS_TREE_VIEW_COLUMN_CLASS*(klass: pointer): bool -proc TREE_VIEW_COLUMN_GET_CLASS*(obj: pointer): PTreeViewColumnClass -proc visible*(a: PTreeViewColumn): guint -proc set_visible*(a: PTreeViewColumn, `visible`: guint) -proc resizable*(a: PTreeViewColumn): guint -proc set_resizable*(a: PTreeViewColumn, `resizable`: guint) -proc clickable*(a: PTreeViewColumn): guint -proc set_clickable*(a: PTreeViewColumn, `clickable`: guint) -proc dirty*(a: PTreeViewColumn): guint -proc set_dirty*(a: PTreeViewColumn, `dirty`: guint) -proc show_sort_indicator*(a: PTreeViewColumn): guint -proc set_show_sort_indicator*(a: PTreeViewColumn, - `show_sort_indicator`: guint) -proc maybe_reordered*(a: PTreeViewColumn): guint -proc set_maybe_reordered*(a: PTreeViewColumn, `maybe_reordered`: guint) -proc reorderable*(a: PTreeViewColumn): guint -proc set_reorderable*(a: PTreeViewColumn, `reorderable`: guint) -proc use_resized_width*(a: PTreeViewColumn): guint -proc set_use_resized_width*(a: PTreeViewColumn, `use_resized_width`: guint) -proc tree_view_column_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_get_type".} -proc tree_view_column_new*(): PTreeViewColumn{.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_new".} -proc column_pack_start*(tree_column: PTreeViewColumn, - cell: PCellRenderer, expand: gboolean){.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_pack_start".} -proc column_pack_end*(tree_column: PTreeViewColumn, - cell: PCellRenderer, expand: gboolean){.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_pack_end".} -proc column_clear*(tree_column: PTreeViewColumn){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_clear".} -proc column_get_cell_renderers*(tree_column: PTreeViewColumn): PGList{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_cell_renderers".} -proc column_add_attribute*(tree_column: PTreeViewColumn, - cell_renderer: PCellRenderer, - attribute: cstring, column: gint){.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_add_attribute".} -proc column_set_cell_data_func*(tree_column: PTreeViewColumn, - cell_renderer: PCellRenderer, fun: TTreeCellDataFunc, func_data: gpointer, - destroy: TDestroyNotify){.cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_cell_data_func".} -proc column_clear_attributes*(tree_column: PTreeViewColumn, - cell_renderer: PCellRenderer){.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_clear_attributes".} -proc column_set_spacing*(tree_column: PTreeViewColumn, spacing: gint){. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_spacing".} -proc column_get_spacing*(tree_column: PTreeViewColumn): gint{.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_get_spacing".} -proc column_set_visible*(tree_column: PTreeViewColumn, - visible: gboolean){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_visible".} -proc column_get_visible*(tree_column: PTreeViewColumn): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_visible".} -proc column_set_resizable*(tree_column: PTreeViewColumn, - resizable: gboolean){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_resizable".} -proc column_get_resizable*(tree_column: PTreeViewColumn): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_resizable".} -proc column_set_sizing*(tree_column: PTreeViewColumn, - thetype: TTreeViewColumnSizing){.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_set_sizing".} -proc column_get_sizing*(tree_column: PTreeViewColumn): TTreeViewColumnSizing{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_sizing".} -proc column_get_width*(tree_column: PTreeViewColumn): gint{.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_get_width".} -proc column_get_fixed_width*(tree_column: PTreeViewColumn): gint{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_fixed_width".} -proc column_set_fixed_width*(tree_column: PTreeViewColumn, - fixed_width: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_fixed_width".} -proc column_set_min_width*(tree_column: PTreeViewColumn, - min_width: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_min_width".} -proc column_get_min_width*(tree_column: PTreeViewColumn): gint{.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_get_min_width".} -proc column_set_max_width*(tree_column: PTreeViewColumn, - max_width: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_max_width".} -proc column_get_max_width*(tree_column: PTreeViewColumn): gint{.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_get_max_width".} -proc column_clicked*(tree_column: PTreeViewColumn){.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_clicked".} -proc column_set_title*(tree_column: PTreeViewColumn, title: cstring){. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_title".} -proc column_get_title*(tree_column: PTreeViewColumn): cstring{.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_get_title".} -proc column_set_clickable*(tree_column: PTreeViewColumn, - clickable: gboolean){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_clickable".} -proc column_get_clickable*(tree_column: PTreeViewColumn): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_clickable".} -proc column_set_widget*(tree_column: PTreeViewColumn, widget: PWidget){. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_widget".} -proc column_get_widget*(tree_column: PTreeViewColumn): PWidget{.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_get_widget".} -proc column_set_alignment*(tree_column: PTreeViewColumn, - xalign: gfloat){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_alignment".} -proc column_get_alignment*(tree_column: PTreeViewColumn): gfloat{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_alignment".} -proc column_set_reorderable*(tree_column: PTreeViewColumn, - reorderable: gboolean){.cdecl, - dynlib: lib, importc: "gtk_tree_view_column_set_reorderable".} -proc column_get_reorderable*(tree_column: PTreeViewColumn): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_reorderable".} -proc column_set_sort_column_id*(tree_column: PTreeViewColumn, - sort_column_id: gint){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_sort_column_id".} -proc column_get_sort_column_id*(tree_column: PTreeViewColumn): gint{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_sort_column_id".} -proc column_set_sort_indicator*(tree_column: PTreeViewColumn, - setting: gboolean){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_sort_indicator".} -proc column_get_sort_indicator*(tree_column: PTreeViewColumn): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_sort_indicator".} -proc column_set_sort_order*(tree_column: PTreeViewColumn, - order: TSortType){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_set_sort_order".} -proc column_get_sort_order*(tree_column: PTreeViewColumn): TSortType{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_sort_order".} -proc column_cell_set_cell_data*(tree_column: PTreeViewColumn, - tree_model: PTreeModel, iter: PTreeIter, is_expander: gboolean, - is_expanded: gboolean){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_cell_set_cell_data".} -proc column_cell_get_size*(tree_column: PTreeViewColumn, - cell_area: gdk2.PRectangle, x_offset: Pgint, - y_offset: Pgint, width: Pgint, - height: Pgint){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_cell_get_size".} -proc column_cell_is_visible*(tree_column: PTreeViewColumn): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_cell_is_visible".} -proc column_focus_cell*(tree_column: PTreeViewColumn, - cell: PCellRenderer){.cdecl, dynlib: lib, - importc: "gtk_tree_view_column_focus_cell".} -proc column_set_expand*(tree_column: PTreeViewColumn, Expand: gboolean){. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_expand".} -proc column_get_expand*(tree_column: PTreeViewColumn): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_expand".} -const - RBNODE_BLACK* = 1 shl 0 - RBNODE_RED* = 1 shl 1 - RBNODE_IS_PARENT* = 1 shl 2 - RBNODE_IS_SELECTED* = 1 shl 3 - RBNODE_IS_PRELIT* = 1 shl 4 - RBNODE_IS_SEMI_COLLAPSED* = 1 shl 5 - RBNODE_IS_SEMI_EXPANDED* = 1 shl 6 - RBNODE_INVALID* = 1 shl 7 - RBNODE_COLUMN_INVALID* = 1 shl 8 - RBNODE_DESCENDANTS_INVALID* = 1 shl 9 - RBNODE_NON_COLORS* = RBNODE_IS_PARENT or RBNODE_IS_SELECTED or - RBNODE_IS_PRELIT or RBNODE_IS_SEMI_COLLAPSED or RBNODE_IS_SEMI_EXPANDED or - RBNODE_INVALID or RBNODE_COLUMN_INVALID or RBNODE_DESCENDANTS_INVALID - -const - bm_TGtkRBNode_flags* = 0x3FFF'i16 - bp_TGtkRBNode_flags* = 0'i16 - bm_TGtkRBNode_parity* = 0x4000'i16 - bp_TGtkRBNode_parity* = 14'i16 - -proc flags*(a: PRBNode): guint -proc set_flags*(a: PRBNode, `flags`: guint) -proc parity*(a: PRBNode): guint -proc set_parity*(a: PRBNode, `parity`: guint) -proc GET_COLOR*(node: PRBNode): guint -proc SET_COLOR*(node: PRBNode, color: guint) -proc GET_HEIGHT*(node: PRBNode): gint -proc SET_FLAG*(node: PRBNode, flag: guint16) -proc UNSET_FLAG*(node: PRBNode, flag: guint16) -proc FLAG_SET*(node: PRBNode, flag: guint): bool -proc rbtree_push_allocator*(allocator: PGAllocator){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_push_allocator".} -proc rbtree_pop_allocator*(){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_pop_allocator".} -proc rbtree_new*(): PRBTree{.cdecl, dynlib: lib, importc: "_gtk_rbtree_new".} -proc free*(tree: PRBTree){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_free".} -proc remove*(tree: PRBTree){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_remove".} -proc destroy*(tree: PRBTree){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_destroy".} -proc insert_before*(tree: PRBTree, node: PRBNode, height: gint, - valid: gboolean): PRBNode{.cdecl, dynlib: lib, - importc: "_gtk_rbtree_insert_before".} -proc insert_after*(tree: PRBTree, node: PRBNode, height: gint, - valid: gboolean): PRBNode{.cdecl, dynlib: lib, - importc: "_gtk_rbtree_insert_after".} -proc remove_node*(tree: PRBTree, node: PRBNode){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_remove_node".} -proc reorder*(tree: PRBTree, new_order: Pgint, length: gint){.cdecl, - dynlib: lib, importc: "_gtk_rbtree_reorder".} -proc find_count*(tree: PRBTree, count: gint): PRBNode{.cdecl, - dynlib: lib, importc: "_gtk_rbtree_find_count".} -proc node_set_height*(tree: PRBTree, node: PRBNode, height: gint){. - cdecl, dynlib: lib, importc: "_gtk_rbtree_node_set_height".} -proc node_mark_invalid*(tree: PRBTree, node: PRBNode){.cdecl, - dynlib: lib, importc: "_gtk_rbtree_node_mark_invalid".} -proc node_mark_valid*(tree: PRBTree, node: PRBNode){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_node_mark_valid".} -proc column_invalid*(tree: PRBTree){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_column_invalid".} -proc mark_invalid*(tree: PRBTree){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_mark_invalid".} -proc set_fixed_height*(tree: PRBTree, height: gint){.cdecl, dynlib: lib, - importc: "_gtk_rbtree_set_fixed_height".} -proc node_find_offset*(tree: PRBTree, node: PRBNode): gint{.cdecl, - dynlib: lib, importc: "_gtk_rbtree_node_find_offset".} -proc node_find_parity*(tree: PRBTree, node: PRBNode): gint{.cdecl, - dynlib: lib, importc: "_gtk_rbtree_node_find_parity".} -proc traverse*(tree: PRBTree, node: PRBNode, order: TGTraverseType, - fun: TRBTreeTraverseFunc, data: gpointer){.cdecl, - dynlib: lib, importc: "_gtk_rbtree_traverse".} -proc next*(tree: PRBTree, node: PRBNode): PRBNode{.cdecl, dynlib: lib, - importc: "_gtk_rbtree_next".} -proc prev*(tree: PRBTree, node: PRBNode): PRBNode{.cdecl, dynlib: lib, - importc: "_gtk_rbtree_prev".} -proc get_depth*(tree: PRBTree): gint{.cdecl, dynlib: lib, - importc: "_gtk_rbtree_get_depth".} -const - TREE_VIEW_DRAG_WIDTH* = 6 - TREE_VIEW_IS_LIST* = 1 shl 0 - TREE_VIEW_SHOW_EXPANDERS* = 1 shl 1 - TREE_VIEW_IN_COLUMN_RESIZE* = 1 shl 2 - TREE_VIEW_ARROW_PRELIT* = 1 shl 3 - TREE_VIEW_HEADERS_VISIBLE* = 1 shl 4 - TREE_VIEW_DRAW_KEYFOCUS* = 1 shl 5 - TREE_VIEW_MODEL_SETUP* = 1 shl 6 - 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 SET_FLAG*(tree_view: PTreeView, flag: guint) -proc UNSET_FLAG*(tree_view: PTreeView, flag: guint) -proc FLAG_SET*(tree_view: PTreeView, flag: guint): bool -proc HEADER_HEIGHT*(tree_view: PTreeView): int32 -proc COLUMN_REQUESTED_WIDTH*(column: PTreeViewColumn): int32 -proc DRAW_EXPANDERS*(tree_view: PTreeView): bool -proc COLUMN_DRAG_DEAD_MULTIPLIER*(tree_view: PTreeView): int32 -const - bm_TGtkTreeViewPrivate_scroll_to_use_align* = 0x0001'i16 - bp_TGtkTreeViewPrivate_scroll_to_use_align* = 0'i16 - bm_TGtkTreeViewPrivate_fixed_height_check* = 0x0002'i16 - bp_TGtkTreeViewPrivate_fixed_height_check* = 1'i16 - bm_TGtkTreeViewPrivate_reorderable* = 0x0004'i16 - bp_TGtkTreeViewPrivate_reorderable* = 2'i16 - bm_TGtkTreeViewPrivate_header_has_focus* = 0x0008'i16 - bp_TGtkTreeViewPrivate_header_has_focus* = 3'i16 - bm_TGtkTreeViewPrivate_drag_column_window_state* = 0x0070'i16 - bp_TGtkTreeViewPrivate_drag_column_window_state* = 4'i16 - bm_TGtkTreeViewPrivate_has_rules* = 0x0080'i16 - bp_TGtkTreeViewPrivate_has_rules* = 7'i16 - bm_TGtkTreeViewPrivate_mark_rows_col_dirty* = 0x0100'i16 - bp_TGtkTreeViewPrivate_mark_rows_col_dirty* = 8'i16 - bm_TGtkTreeViewPrivate_enable_search* = 0x0200'i16 - bp_TGtkTreeViewPrivate_enable_search* = 9'i16 - bm_TGtkTreeViewPrivate_disable_popdown* = 0x0400'i16 - bp_TGtkTreeViewPrivate_disable_popdown* = 10'i16 - -proc scroll_to_use_align*(a: PTreeViewPrivate): guint -proc set_scroll_to_use_align*(a: PTreeViewPrivate, - `scroll_to_use_align`: guint) -proc fixed_height_check*(a: PTreeViewPrivate): guint -proc set_fixed_height_check*(a: PTreeViewPrivate, - `fixed_height_check`: guint) -proc reorderable*(a: PTreeViewPrivate): guint -proc set_reorderable*(a: PTreeViewPrivate, `reorderable`: guint) -proc header_has_focus*(a: PTreeViewPrivate): guint -proc set_header_has_focus*(a: PTreeViewPrivate, `header_has_focus`: guint) -proc drag_column_window_state*(a: PTreeViewPrivate): guint -proc set_drag_column_window_state*(a: PTreeViewPrivate, - `drag_column_window_state`: guint) -proc has_rules*(a: PTreeViewPrivate): guint -proc set_has_rules*(a: PTreeViewPrivate, `has_rules`: guint) -proc mark_rows_col_dirty*(a: PTreeViewPrivate): guint -proc set_mark_rows_col_dirty*(a: PTreeViewPrivate, - `mark_rows_col_dirty`: guint) -proc enable_search*(a: PTreeViewPrivate): guint -proc set_enable_search*(a: PTreeViewPrivate, `enable_search`: guint) -proc disable_popdown*(a: PTreeViewPrivate): guint -proc set_disable_popdown*(a: PTreeViewPrivate, `disable_popdown`: guint) -proc internal_select_node*(selection: PTreeSelection, - node: PRBNode, tree: PRBTree, path: PTreePath, state: gdk2.TModifierType, - override_browse_mode: gboolean){.cdecl, dynlib: lib, importc: "_gtk_tree_selection_internal_select_node".} -proc find_node*(tree_view: PTreeView, path: PTreePath, - tree: var PRBTree, node: var PRBNode): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_tree_view_find_node".} -proc find_path*(tree_view: PTreeView, tree: PRBTree, node: PRBNode): PTreePath{. - cdecl, dynlib: lib, importc: "_gtk_tree_view_find_path".} -proc child_move_resize*(tree_view: PTreeView, widget: PWidget, - x: gint, y: gint, width: gint, height: gint){. - cdecl, dynlib: lib, importc: "_gtk_tree_view_child_move_resize".} -proc queue_draw_node*(tree_view: PTreeView, tree: PRBTree, - node: PRBNode, clip_rect: gdk2.PRectangle){. - cdecl, dynlib: lib, importc: "_gtk_tree_view_queue_draw_node".} -proc column_realize_button*(column: PTreeViewColumn){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_column_realize_button".} -proc column_unrealize_button*(column: PTreeViewColumn){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_column_unrealize_button".} -proc column_set_tree_view*(column: PTreeViewColumn, - tree_view: PTreeView){.cdecl, dynlib: lib, - importc: "_gtk_tree_view_column_set_tree_view".} -proc column_unset_tree_view*(column: PTreeViewColumn){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_column_unset_tree_view".} -proc column_set_width*(column: PTreeViewColumn, width: gint){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_column_set_width".} -proc column_start_drag*(tree_view: PTreeView, column: PTreeViewColumn){. - cdecl, dynlib: lib, importc: "_gtk_tree_view_column_start_drag".} -proc column_start_editing*(tree_column: PTreeViewColumn, - editable_widget: PCellEditable){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_column_start_editing".} -proc column_stop_editing*(tree_column: PTreeViewColumn){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_column_stop_editing".} -proc install_mark_rows_col_dirty*(tree_view: PTreeView){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_install_mark_rows_col_dirty".} -proc DOgtk_tree_view_column_autosize*(tree_view: PTreeView, - column: PTreeViewColumn){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_column_autosize".} -proc column_has_editable_cell*(column: PTreeViewColumn): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_tree_view_column_has_editable_cell".} -proc column_get_edited_cell*(column: PTreeViewColumn): PCellRenderer{. - cdecl, dynlib: lib, importc: "_gtk_tree_view_column_get_edited_cell".} -proc column_count_special_cells*(column: PTreeViewColumn): gint{. - cdecl, dynlib: lib, importc: "_gtk_tree_view_column_count_special_cells".} -proc column_get_cell_at_pos*(column: PTreeViewColumn, x: gint): PCellRenderer{. - cdecl, dynlib: lib, importc: "_gtk_tree_view_column_get_cell_at_pos".} -proc tree_selection_new*(): PTreeSelection{.cdecl, dynlib: lib, - importc: "_gtk_tree_selection_new".} -proc selection_new*(tree_view: PTreeView): PTreeSelection{. - cdecl, dynlib: lib, importc: "_gtk_tree_selection_new_with_tree_view".} -proc set_tree_view*(selection: PTreeSelection, - tree_view: PTreeView){.cdecl, dynlib: lib, - importc: "_gtk_tree_selection_set_tree_view".} -proc column_cell_render*(tree_column: PTreeViewColumn, - window: gdk2.PWindow, - background_area: gdk2.PRectangle, - cell_area: gdk2.PRectangle, - expose_area: gdk2.PRectangle, flags: guint){. - cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_render".} -proc column_cell_focus*(tree_column: PTreeViewColumn, direction: gint, - left: gboolean, right: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_focus".} -proc column_cell_draw_focus*(tree_column: PTreeViewColumn, - window: gdk2.PWindow, - background_area: gdk2.PRectangle, - cell_area: gdk2.PRectangle, - expose_area: gdk2.PRectangle, flags: guint){. - cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_draw_focus".} -proc column_cell_set_dirty*(tree_column: PTreeViewColumn, - install_handler: gboolean){.cdecl, - dynlib: lib, importc: "_gtk_tree_view_column_cell_set_dirty".} -proc column_get_neighbor_sizes*(column: PTreeViewColumn, - cell: PCellRenderer, left: Pgint, right: Pgint){.cdecl, dynlib: lib, - importc: "_gtk_tree_view_column_get_neighbor_sizes".} -proc TYPE_TREE_VIEW*(): GType -proc TREE_VIEW*(obj: pointer): PTreeView -proc TREE_VIEW_CLASS*(klass: pointer): PTreeViewClass -proc IS_TREE_VIEW*(obj: pointer): bool -proc IS_TREE_VIEW_CLASS*(klass: pointer): bool -proc TREE_VIEW_GET_CLASS*(obj: pointer): PTreeViewClass -proc tree_view_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_tree_view_get_type".} -proc tree_view_new*(): PTreeView{.cdecl, dynlib: lib, - importc: "gtk_tree_view_new".} -proc tree_view_new*(model: PTreeModel): PTreeView{.cdecl, - dynlib: lib, importc: "gtk_tree_view_new_with_model".} -proc get_model*(tree_view: PTreeView): PTreeModel{.cdecl, dynlib: lib, - importc: "gtk_tree_view_get_model".} -proc set_model*(tree_view: PTreeView, model: PTreeModel){.cdecl, - dynlib: lib, importc: "gtk_tree_view_set_model".} -proc get_selection*(tree_view: PTreeView): PTreeSelection{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_selection".} -proc get_hadjustment*(tree_view: PTreeView): PAdjustment{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_hadjustment".} -proc set_hadjustment*(tree_view: PTreeView, adjustment: PAdjustment){. - cdecl, dynlib: lib, importc: "gtk_tree_view_set_hadjustment".} -proc get_vadjustment*(tree_view: PTreeView): PAdjustment{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_vadjustment".} -proc set_vadjustment*(tree_view: PTreeView, adjustment: PAdjustment){. - cdecl, dynlib: lib, importc: "gtk_tree_view_set_vadjustment".} -proc get_headers_visible*(tree_view: PTreeView): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_headers_visible".} -proc set_headers_visible*(tree_view: PTreeView, - headers_visible: gboolean){.cdecl, - dynlib: lib, importc: "gtk_tree_view_set_headers_visible".} -proc columns_autosize*(tree_view: PTreeView){.cdecl, dynlib: lib, - importc: "gtk_tree_view_columns_autosize".} -proc set_headers_clickable*(tree_view: PTreeView, setting: gboolean){. - cdecl, dynlib: lib, importc: "gtk_tree_view_set_headers_clickable".} -proc set_rules_hint*(tree_view: PTreeView, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_tree_view_set_rules_hint".} -proc get_rules_hint*(tree_view: PTreeView): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_rules_hint".} -proc append_column*(tree_view: PTreeView, column: PTreeViewColumn): gint{. - cdecl, dynlib: lib, importc: "gtk_tree_view_append_column".} -proc remove_column*(tree_view: PTreeView, column: PTreeViewColumn): gint{. - cdecl, dynlib: lib, importc: "gtk_tree_view_remove_column".} -proc insert_column*(tree_view: PTreeView, column: PTreeViewColumn, - position: gint): gint{.cdecl, dynlib: lib, - importc: "gtk_tree_view_insert_column".} -proc insert_column_with_data_func*(tree_view: PTreeView, - position: gint, title: cstring, cell: PCellRenderer, - fun: TTreeCellDataFunc, data: gpointer, dnotify: TGDestroyNotify): gint{. - cdecl, dynlib: lib, importc: "gtk_tree_view_insert_column_with_data_func".} -proc get_column*(tree_view: PTreeView, n: gint): PTreeViewColumn{. - cdecl, dynlib: lib, importc: "gtk_tree_view_get_column".} -proc get_columns*(tree_view: PTreeView): PGList{.cdecl, dynlib: lib, - importc: "gtk_tree_view_get_columns".} -proc move_column_after*(tree_view: PTreeView, column: PTreeViewColumn, - base_column: PTreeViewColumn){.cdecl, - dynlib: lib, importc: "gtk_tree_view_move_column_after".} -proc set_expander_column*(tree_view: PTreeView, - column: PTreeViewColumn){.cdecl, - dynlib: lib, importc: "gtk_tree_view_set_expander_column".} -proc get_expander_column*(tree_view: PTreeView): PTreeViewColumn{. - cdecl, dynlib: lib, importc: "gtk_tree_view_get_expander_column".} -proc set_column_drag_function*(tree_view: PTreeView, - fun: TTreeViewColumnDropFunc, user_data: gpointer, destroy: TDestroyNotify){. - cdecl, dynlib: lib, importc: "gtk_tree_view_set_column_drag_function".} -proc scroll_to_point*(tree_view: PTreeView, tree_x: gint, tree_y: gint){. - cdecl, dynlib: lib, importc: "gtk_tree_view_scroll_to_point".} -proc scroll_to_cell*(tree_view: PTreeView, path: PTreePath, - column: PTreeViewColumn, use_align: gboolean, - row_align: gfloat, col_align: gfloat){.cdecl, - dynlib: lib, importc: "gtk_tree_view_scroll_to_cell".} -proc row_activated*(tree_view: PTreeView, path: PTreePath, - column: PTreeViewColumn){.cdecl, dynlib: lib, - importc: "gtk_tree_view_row_activated".} -proc expand_all*(tree_view: PTreeView){.cdecl, dynlib: lib, - importc: "gtk_tree_view_expand_all".} -proc collapse_all*(tree_view: PTreeView){.cdecl, dynlib: lib, - importc: "gtk_tree_view_collapse_all".} -proc expand_row*(tree_view: PTreeView, path: PTreePath, - open_all: gboolean): gboolean{.cdecl, dynlib: lib, - importc: "gtk_tree_view_expand_row".} -proc collapse_row*(tree_view: PTreeView, path: PTreePath): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_collapse_row".} -proc map_expanded_rows*(tree_view: PTreeView, - fun: TTreeViewMappingFunc, data: gpointer){. - cdecl, dynlib: lib, importc: "gtk_tree_view_map_expanded_rows".} -proc row_expanded*(tree_view: PTreeView, path: PTreePath): gboolean{. - cdecl, dynlib: lib, importc: "gtk_tree_view_row_expanded".} -proc set_reorderable*(tree_view: PTreeView, reorderable: gboolean){. - cdecl, dynlib: lib, importc: "gtk_tree_view_set_reorderable".} -proc get_reorderable*(tree_view: PTreeView): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_reorderable".} -proc set_cursor*(tree_view: PTreeView, path: PTreePath, - focus_column: PTreeViewColumn, - start_editing: gboolean){.cdecl, dynlib: lib, - importc: "gtk_tree_view_set_cursor".} -proc set_cursor_on_cell*(tree_view: PTreeView, path: PTreePath, - focus_column: PTreeViewColumn, - focus_cell: PCellRenderer, - start_editing: gboolean){.cdecl, dynlib: lib, - importc: "gtk_tree_view_set_cursor_on_cell".} -proc get_bin_window*(tree_view: PTreeView): gdk2.PWindow{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_bin_window".} -proc get_cell_area*(tree_view: PTreeView, path: PTreePath, - column: PTreeViewColumn, rect: gdk2.PRectangle){. - cdecl, dynlib: lib, importc: "gtk_tree_view_get_cell_area".} -proc get_background_area*(tree_view: PTreeView, path: PTreePath, - column: PTreeViewColumn, rect: gdk2.PRectangle){. - cdecl, dynlib: lib, importc: "gtk_tree_view_get_background_area".} -proc get_visible_rect*(tree_view: PTreeView, - visible_rect: gdk2.PRectangle){.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_visible_rect".} -proc widget_to_tree_coords*(tree_view: PTreeView, wx: gint, wy: gint, - tx: Pgint, ty: Pgint){.cdecl, dynlib: lib, - importc: "gtk_tree_view_widget_to_tree_coords".} -proc tree_to_widget_coords*(tree_view: PTreeView, tx: gint, ty: gint, - wx: Pgint, wy: Pgint){.cdecl, dynlib: lib, - importc: "gtk_tree_view_tree_to_widget_coords".} -proc enable_model_drag_source*(tree_view: PTreeView, - start_button_mask: gdk2.TModifierType, targets: PTargetEntry, n_targets: gint, - actions: gdk2.TDragAction){.cdecl, dynlib: lib, - importc: "gtk_tree_view_enable_model_drag_source".} -proc enable_model_drag_dest*(tree_view: PTreeView, - targets: PTargetEntry, n_targets: gint, - actions: gdk2.TDragAction){.cdecl, - dynlib: lib, importc: "gtk_tree_view_enable_model_drag_dest".} -proc unset_rows_drag_source*(tree_view: PTreeView){.cdecl, - dynlib: lib, importc: "gtk_tree_view_unset_rows_drag_source".} -proc unset_rows_drag_dest*(tree_view: PTreeView){.cdecl, dynlib: lib, - importc: "gtk_tree_view_unset_rows_drag_dest".} -proc set_drag_dest_row*(tree_view: PTreeView, path: PTreePath, - pos: TTreeViewDropPosition){.cdecl, - dynlib: lib, importc: "gtk_tree_view_set_drag_dest_row".} -proc create_row_drag_icon*(tree_view: PTreeView, path: PTreePath): gdk2.PPixmap{. - cdecl, dynlib: lib, importc: "gtk_tree_view_create_row_drag_icon".} -proc set_enable_search*(tree_view: PTreeView, enable_search: gboolean){. - cdecl, dynlib: lib, importc: "gtk_tree_view_set_enable_search".} -proc get_enable_search*(tree_view: PTreeView): gboolean{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_enable_search".} -proc get_search_column*(tree_view: PTreeView): gint{.cdecl, - dynlib: lib, importc: "gtk_tree_view_get_search_column".} -proc set_search_column*(tree_view: PTreeView, column: gint){.cdecl, - dynlib: lib, importc: "gtk_tree_view_set_search_column".} -proc get_search_equal_func*(tree_view: PTreeView): TTreeViewSearchEqualFunc{. - cdecl, dynlib: lib, importc: "gtk_tree_view_get_search_equal_func".} -proc set_search_equal_func*(tree_view: PTreeView, search_equal_func: TTreeViewSearchEqualFunc, - search_user_data: gpointer, - search_destroy: TDestroyNotify){.cdecl, - dynlib: lib, importc: "gtk_tree_view_set_search_equal_func".} -proc set_destroy_count_func*(tree_view: PTreeView, - fun: TTreeDestroyCountFunc, - data: gpointer, destroy: TDestroyNotify){. - cdecl, dynlib: lib, importc: "gtk_tree_view_set_destroy_count_func".} -proc TYPE_VBUTTON_BOX*(): GType -proc VBUTTON_BOX*(obj: pointer): PVButtonBox -proc VBUTTON_BOX_CLASS*(klass: pointer): PVButtonBoxClass -proc IS_VBUTTON_BOX*(obj: pointer): bool -proc IS_VBUTTON_BOX_CLASS*(klass: pointer): bool -proc VBUTTON_BOX_GET_CLASS*(obj: pointer): PVButtonBoxClass -proc vbutton_box_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_vbutton_box_get_type".} -proc vbutton_box_new*(): PVButtonBox{.cdecl, dynlib: lib, - importc: "gtk_vbutton_box_new".} -proc TYPE_VIEWPORT*(): GType -proc VIEWPORT*(obj: pointer): PViewport -proc VIEWPORT_CLASS*(klass: pointer): PViewportClass -proc IS_VIEWPORT*(obj: pointer): bool -proc IS_VIEWPORT_CLASS*(klass: pointer): bool -proc VIEWPORT_GET_CLASS*(obj: pointer): PViewportClass -proc viewport_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_viewport_get_type".} -proc viewport_new*(hadjustment: PAdjustment, vadjustment: PAdjustment): PViewport{. - cdecl, dynlib: lib, importc: "gtk_viewport_new".} -proc get_hadjustment*(viewport: PViewport): PAdjustment{.cdecl, - dynlib: lib, importc: "gtk_viewport_get_hadjustment".} -proc get_vadjustment*(viewport: PViewport): PAdjustment{.cdecl, - dynlib: lib, importc: "gtk_viewport_get_vadjustment".} -proc set_hadjustment*(viewport: PViewport, adjustment: PAdjustment){. - cdecl, dynlib: lib, importc: "gtk_viewport_set_hadjustment".} -proc set_vadjustment*(viewport: PViewport, adjustment: PAdjustment){. - cdecl, dynlib: lib, importc: "gtk_viewport_set_vadjustment".} -proc set_shadow_type*(viewport: PViewport, thetype: TShadowType){. - cdecl, dynlib: lib, importc: "gtk_viewport_set_shadow_type".} -proc get_shadow_type*(viewport: PViewport): TShadowType{.cdecl, - dynlib: lib, importc: "gtk_viewport_get_shadow_type".} -proc TYPE_VPANED*(): GType -proc VPANED*(obj: pointer): PVPaned -proc VPANED_CLASS*(klass: pointer): PVPanedClass -proc IS_VPANED*(obj: pointer): bool -proc IS_VPANED_CLASS*(klass: pointer): bool -proc VPANED_GET_CLASS*(obj: pointer): PVPanedClass -proc vpaned_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_vpaned_get_type".} -proc vpaned_new*(): PVPaned{.cdecl, dynlib: lib, importc: "gtk_vpaned_new".} -proc TYPE_VRULER*(): GType -proc VRULER*(obj: pointer): PVRuler -proc VRULER_CLASS*(klass: pointer): PVRulerClass -proc IS_VRULER*(obj: pointer): bool -proc IS_VRULER_CLASS*(klass: pointer): bool -proc VRULER_GET_CLASS*(obj: pointer): PVRulerClass -proc vruler_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_vruler_get_type".} -proc vruler_new*(): PVRuler{.cdecl, dynlib: lib, importc: "gtk_vruler_new".} -proc TYPE_VSCALE*(): GType -proc VSCALE*(obj: pointer): PVScale -proc VSCALE_CLASS*(klass: pointer): PVScaleClass -proc IS_VSCALE*(obj: pointer): bool -proc IS_VSCALE_CLASS*(klass: pointer): bool -proc VSCALE_GET_CLASS*(obj: pointer): PVScaleClass -proc vscale_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_vscale_get_type".} -proc vscale_new*(adjustment: PAdjustment): PVScale{.cdecl, dynlib: lib, - importc: "gtk_vscale_new".} -proc vscale_new*(min: gdouble, max: gdouble, step: gdouble): PVScale{. - cdecl, dynlib: lib, importc: "gtk_vscale_new_with_range".} -proc TYPE_VSCROLLBAR*(): GType -proc VSCROLLBAR*(obj: pointer): PVScrollbar -proc VSCROLLBAR_CLASS*(klass: pointer): PVScrollbarClass -proc IS_VSCROLLBAR*(obj: pointer): bool -proc IS_VSCROLLBAR_CLASS*(klass: pointer): bool -proc VSCROLLBAR_GET_CLASS*(obj: pointer): PVScrollbarClass -proc vscrollbar_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_vscrollbar_get_type".} -proc vscrollbar_new*(adjustment: PAdjustment): PVScrollbar{.cdecl, dynlib: lib, - importc: "gtk_vscrollbar_new".} -proc TYPE_VSEPARATOR*(): GType -proc VSEPARATOR*(obj: pointer): PVSeparator -proc VSEPARATOR_CLASS*(klass: pointer): PVSeparatorClass -proc IS_VSEPARATOR*(obj: pointer): bool -proc IS_VSEPARATOR_CLASS*(klass: pointer): bool -proc VSEPARATOR_GET_CLASS*(obj: pointer): PVSeparatorClass -proc vseparator_get_type*(): TType{.cdecl, dynlib: lib, - importc: "gtk_vseparator_get_type".} -proc vseparator_new*(): PVSeparator{.cdecl, dynlib: lib, - importc: "gtk_vseparator_new".} -proc TYPE_OBJECT*(): GType = - result = gtk2.object_get_type() - -proc CHECK_CAST*(instance: Pointer, g_type: GType): PGTypeInstance = - result = G_TYPE_CHECK_INSTANCE_CAST(instance, g_type) - -proc CHECK_CLASS_CAST*(g_class: pointer, g_type: GType): Pointer = - result = G_TYPE_CHECK_CLASS_CAST(g_class, g_type) - -proc CHECK_GET_CLASS*(instance: Pointer, g_type: GType): PGTypeClass = - result = G_TYPE_INSTANCE_GET_CLASS(instance, g_type) - -proc CHECK_TYPE*(instance: Pointer, g_type: GType): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type) - -proc CHECK_CLASS_TYPE*(g_class: pointer, g_type: GType): bool = - result = G_TYPE_CHECK_CLASS_TYPE(g_class, g_type) - -proc `OBJECT`*(anObject: pointer): PObject = - result = cast[PObject](CHECK_CAST(anObject, gtk2.TYPE_OBJECT())) - -proc OBJECT_CLASS*(klass: pointer): PObjectClass = - result = cast[PObjectClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_OBJECT())) - -proc IS_OBJECT*(anObject: pointer): bool = - result = CHECK_TYPE(anObject, gtk2.TYPE_OBJECT()) - -proc IS_OBJECT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_OBJECT()) - -proc OBJECT_GET_CLASS*(anObject: pointer): PObjectClass = - result = cast[PObjectClass](CHECK_GET_CLASS(anObject, gtk2.TYPE_OBJECT())) - -proc OBJECT_TYPE*(anObject: pointer): GType = - result = G_TYPE_FROM_INSTANCE(anObject) - -proc OBJECT_TYPE_NAME*(anObject: pointer): cstring = - result = g_type_name(OBJECT_TYPE(anObject)) - -proc OBJECT_FLAGS*(obj: pointer): guint32 = - result = (gtk2.`OBJECT`(obj)).flags - -proc OBJECT_FLOATING*(obj: pointer): gboolean = - result = ((OBJECT_FLAGS(obj)) and cint(FLOATING)) != 0'i32 - -proc OBJECT_SET_FLAGS*(obj: pointer, flag: guint32) = - gtk2.`OBJECT`(obj).flags = gtk2.`OBJECT`(obj).flags or flag - -proc OBJECT_UNSET_FLAGS*(obj: pointer, flag: guint32) = - gtk2.`OBJECT`(obj).flags = gtk2.`OBJECT`(obj).flags and not (flag) - -proc object_data_try_key*(`string`: cstring): TGQuark = - result = g_quark_try_string(`string`) - -proc object_data_force_id*(`string`: cstring): TGQuark = - result = g_quark_from_string(`string`) - -proc CLASS_NAME*(`class`: pointer): cstring = - result = g_type_name(G_TYPE_FROM_CLASS(`class`)) - -proc CLASS_TYPE*(`class`: pointer): GType = - result = G_TYPE_FROM_CLASS(`class`) - -proc TYPE_IS_OBJECT*(thetype: GType): gboolean = - result = g_type_is_a(thetype, gtk2.TYPE_OBJECT()) - -proc TYPE_IDENTIFIER*(): GType = - result = identifier_get_type() - -proc SIGNAL_FUNC*(f: pointer): TSignalFunc = - result = cast[TSignalFunc](f) - -proc type_name*(thetype: GType): cstring = - result = g_type_name(thetype) - -proc type_from_name*(name: cstring): GType = - result = g_type_from_name(name) - -proc type_parent*(thetype: GType): GType = - result = g_type_parent(thetype) - -proc type_is_a*(thetype, is_a_type: GType): gboolean = - result = g_type_is_a(thetype, is_a_type) - -proc FUNDAMENTAL_TYPE*(thetype: GType): GType = - result = G_TYPE_FUNDAMENTAL(thetype) - -proc VALUE_CHAR*(a: TArg): gchar = - var a = a - Result = cast[ptr gchar](addr(a.d))[] - -proc VALUE_UCHAR*(a: TArg): guchar = - var a = a - Result = cast[ptr guchar](addr(a.d))[] - -proc VALUE_BOOL*(a: TArg): gboolean = - var a = a - Result = cast[ptr gboolean](addr(a.d))[] - -proc VALUE_INT*(a: TArg): gint = - var a = a - Result = cast[ptr gint](addr(a.d))[] - -proc VALUE_UINT*(a: TArg): guint = - var a = a - Result = cast[ptr guint](addr(a.d))[] - -proc VALUE_LONG*(a: TArg): glong = - var a = a - Result = cast[ptr glong](addr(a.d))[] - -proc VALUE_ULONG*(a: TArg): gulong = - var a = a - Result = cast[ptr gulong](addr(a.d))[] - -proc VALUE_FLOAT*(a: TArg): gfloat = - var a = a - Result = cast[ptr gfloat](addr(a.d))[] - -proc VALUE_DOUBLE*(a: TArg): gdouble = - var a = a - Result = cast[ptr gdouble](addr(a.d))[] - -proc VALUE_STRING*(a: TArg): cstring = - var a = a - Result = cast[ptr cstring](addr(a.d))[] - -proc VALUE_ENUM*(a: TArg): gint = - var a = a - Result = cast[ptr gint](addr(a.d))[] - -proc VALUE_FLAGS*(a: TArg): guint = - var a = a - Result = cast[ptr guint](addr(a.d))[] - -proc VALUE_BOXED*(a: TArg): gpointer = - var a = a - Result = cast[ptr gpointer](addr(a.d))[] - -proc VALUE_OBJECT*(a: TArg): PObject = - var a = a - Result = cast[ptr PObject](addr(a.d))[] - -proc VALUE_POINTER*(a: TArg): GPointer = - var a = a - Result = cast[ptr gpointer](addr(a.d))[] - -proc VALUE_SIGNAL*(a: TArg): TArgSignalData = - var a = a - Result = cast[ptr TArgSignalData](addr(a.d))[] - -proc RETLOC_CHAR*(a: TArg): cstring = - var a = a - Result = cast[ptr cstring](addr(a.d))[] - -proc RETLOC_UCHAR*(a: TArg): Pguchar = - var a = a - Result = cast[ptr pguchar](addr(a.d))[] - -proc RETLOC_BOOL*(a: TArg): Pgboolean = - var a = a - Result = cast[ptr pgboolean](addr(a.d))[] - -proc RETLOC_INT*(a: TArg): Pgint = - var a = a - Result = cast[ptr pgint](addr(a.d))[] - -proc RETLOC_UINT*(a: TArg): Pguint = - var a = a - Result = cast[ptr pguint](addr(a.d))[] - -proc RETLOC_LONG*(a: TArg): Pglong = - var a = a - Result = cast[ptr pglong](addr(a.d))[] - -proc RETLOC_ULONG*(a: TArg): Pgulong = - var a = a - Result = cast[ptr pgulong](addr(a.d))[] - -proc RETLOC_FLOAT*(a: TArg): Pgfloat = - var a = a - Result = cast[ptr pgfloat](addr(a.d))[] - -proc RETLOC_DOUBLE*(a: TArg): Pgdouble = - var a = a - Result = cast[ptr pgdouble](addr(a.d))[] - -proc RETLOC_STRING*(a: TArg): Ppgchar = - var a = a - Result = cast[ptr Ppgchar](addr(a.d))[] - -proc RETLOC_ENUM*(a: TArg): Pgint = - var a = a - Result = cast[ptr Pgint](addr(a.d))[] - -proc RETLOC_FLAGS*(a: TArg): Pguint = - var a = a - Result = cast[ptr pguint](addr(a.d))[] - -proc RETLOC_BOXED*(a: TArg): Pgpointer = - var a = a - Result = cast[ptr pgpointer](addr(a.d))[] - -proc RETLOC_OBJECT*(a: TArg): PPGtkObject = - var a = a - Result = cast[ptr ppgtkobject](addr(a.d))[] - -proc RETLOC_POINTER*(a: TArg): Pgpointer = - var a = a - Result = cast[ptr pgpointer](addr(a.d))[] - -proc TYPE_WIDGET*(): GType = - result = widget_get_type() - -proc WIDGET*(widget: pointer): PWidget = - result = cast[PWidget](CHECK_CAST(widget, TYPE_WIDGET())) - -proc WIDGET_CLASS*(klass: pointer): PWidgetClass = - result = cast[PWidgetClass](CHECK_CLASS_CAST(klass, TYPE_WIDGET())) - -proc IS_WIDGET*(widget: pointer): bool = - result = CHECK_TYPE(widget, TYPE_WIDGET()) - -proc IS_WIDGET_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_WIDGET()) - -proc WIDGET_GET_CLASS*(obj: pointer): PWidgetClass = - result = cast[PWidgetClass](CHECK_GET_CLASS(obj, TYPE_WIDGET())) - -proc WIDGET_TYPE*(wid: pointer): GType = - result = OBJECT_TYPE(wid) - -proc WIDGET_STATE*(wid: pointer): int32 = - result = (WIDGET(wid)).state - -proc WIDGET_SAVED_STATE*(wid: pointer): int32 = - result = (WIDGET(wid)).saved_state - -proc WIDGET_FLAGS*(wid: pointer): guint32 = - result = OBJECT_FLAGS(wid) - -proc WIDGET_TOPLEVEL*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(TOPLEVEL)) != 0'i32 - -proc WIDGET_NO_WINDOW*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(NO_WINDOW)) != 0'i32 - -proc WIDGET_REALIZED*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(constREALIZED)) != 0'i32 - -proc WIDGET_MAPPED*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(MAPPED)) != 0'i32 - -proc WIDGET_VISIBLE*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(constVISIBLE)) != 0'i32 - -proc WIDGET_DRAWABLE*(wid: pointer): gboolean = - result = (WIDGET_VISIBLE(wid)) and (WIDGET_MAPPED(wid)) - -proc WIDGET_SENSITIVE*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(SENSITIVE)) != 0'i32 - -proc WIDGET_PARENT_SENSITIVE*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(PARENT_SENSITIVE)) != 0'i32 - -proc WIDGET_IS_SENSITIVE*(wid: pointer): gboolean = - result = (WIDGET_SENSITIVE(wid)) and (WIDGET_PARENT_SENSITIVE(wid)) - -proc WIDGET_CAN_FOCUS*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(CAN_FOCUS)) != 0'i32 - -proc WIDGET_HAS_FOCUS*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(constHAS_FOCUS)) != 0'i32 - -proc WIDGET_CAN_DEFAULT*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(CAN_DEFAULT)) != 0'i32 - -proc WIDGET_HAS_DEFAULT*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(HAS_DEFAULT)) != 0'i32 - -proc WIDGET_HAS_GRAB*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(HAS_GRAB)) != 0'i32 - -proc WIDGET_RC_STYLE*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(RC_STYLE)) != 0'i32 - -proc WIDGET_COMPOSITE_CHILD*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(COMPOSITE_CHILD)) != 0'i32 - -proc WIDGET_APP_PAINTABLE*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(APP_PAINTABLE)) != 0'i32 - -proc WIDGET_RECEIVES_DEFAULT*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(RECEIVES_DEFAULT)) != 0'i32 - -proc WIDGET_DOUBLE_BUFFERED*(wid: pointer): gboolean = - result = ((WIDGET_FLAGS(wid)) and cint(DOUBLE_BUFFERED)) != 0'i32 - -proc TYPE_REQUISITION*(): GType = - result = requisition_get_type() - -proc x_set*(a: PWidgetAuxInfo): guint = - result = (a.flag0 and bm_TGtkWidgetAuxInfo_x_set) shr - bp_TGtkWidgetAuxInfo_x_set - -proc set_x_set*(a: PWidgetAuxInfo, `x_set`: guint) = - a.flag0 = a.flag0 or - (int16(`x_set` shl bp_TGtkWidgetAuxInfo_x_set) and - bm_TGtkWidgetAuxInfo_x_set) - -proc y_set*(a: PWidgetAuxInfo): guint = - result = (a.flag0 and bm_TGtkWidgetAuxInfo_y_set) shr - bp_TGtkWidgetAuxInfo_y_set - -proc set_y_set*(a: PWidgetAuxInfo, `y_set`: guint) = - a.flag0 = a.flag0 or - (int16(`y_set` shl bp_TGtkWidgetAuxInfo_y_set) and - bm_TGtkWidgetAuxInfo_y_set) - -proc widget_set_visual*(widget, visual: pointer) = - if (Widget != nil) and (visual != nil): nil - -proc widget_push_visual*(visual: pointer) = - if (visual != nil): nil - -proc widget_pop_visual*() = - nil - -proc widget_set_default_visual*(visual: pointer) = - if (visual != nil): nil - -proc widget_set_rc_style*(widget: pointer) = - set_style(cast[PWidget](widget), nil) - -proc widget_restore_default_style*(widget: pointer) = - set_style(cast[PWidget](widget), nil) - -proc SET_FLAGS*(wid: PWidget, flags: TWidgetFlags): TWidgetFlags = - cast[pObject](wid).flags = cast[pObject](wid).flags or (flags) - result = cast[pObject](wid).flags - -proc UNSET_FLAGS*(wid: PWidget, flags: TWidgetFlags): TWidgetFlags = - cast[pObject](wid).flags = cast[pObject](wid).flags and (not (flags)) - result = cast[pObject](wid).flags - -proc TYPE_MISC*(): GType = - result = misc_get_type() - -proc MISC*(obj: pointer): PMisc = - result = cast[PMisc](CHECK_CAST(obj, TYPE_MISC())) - -proc MISC_CLASS*(klass: pointer): PMiscClass = - result = cast[PMiscClass](CHECK_CLASS_CAST(klass, TYPE_MISC())) - -proc IS_MISC*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_MISC()) - -proc IS_MISC_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_MISC()) - -proc MISC_GET_CLASS*(obj: pointer): PMiscClass = - result = cast[PMiscClass](CHECK_GET_CLASS(obj, TYPE_MISC())) - -proc TYPE_ACCEL_GROUP*(): GType = - result = accel_group_get_type() - -proc ACCEL_GROUP*(anObject: pointer): PAccelGroup = - result = cast[PAccelGroup](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_ACCEL_GROUP())) - -proc ACCEL_GROUP_CLASS*(klass: pointer): PAccelGroupClass = - result = cast[PAccelGroupClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_ACCEL_GROUP())) - -proc IS_ACCEL_GROUP*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_ACCEL_GROUP()) - -proc IS_ACCEL_GROUP_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_ACCEL_GROUP()) - -proc ACCEL_GROUP_GET_CLASS*(obj: pointer): PAccelGroupClass = - result = cast[PAccelGroupClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_ACCEL_GROUP())) - -proc accel_flags*(a: PAccelKey): guint = - result = (a.flag0 and bm_TGtkAccelKey_accel_flags) shr - bp_TGtkAccelKey_accel_flags - -proc set_accel_flags*(a: PAccelKey, `accel_flags`: guint) = - a.flag0 = a.flag0 or - (int16(`accel_flags` shl bp_TGtkAccelKey_accel_flags) and - bm_TGtkAccelKey_accel_flags) - -proc reference*(AccelGroup: PAccelGroup) = - discard g_object_ref(AccelGroup) - -proc unref*(AccelGroup: PAccelGroup) = - g_object_unref(AccelGroup) - -proc TYPE_CONTAINER*(): GType = - result = container_get_type() - -proc CONTAINER*(obj: pointer): PContainer = - result = cast[PContainer](CHECK_CAST(obj, TYPE_CONTAINER())) - -proc CONTAINER_CLASS*(klass: pointer): PContainerClass = - result = cast[PContainerClass](CHECK_CLASS_CAST(klass, TYPE_CONTAINER())) - -proc IS_CONTAINER*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CONTAINER()) - -proc IS_CONTAINER_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CONTAINER()) - -proc CONTAINER_GET_CLASS*(obj: pointer): PContainerClass = - result = cast[PContainerClass](CHECK_GET_CLASS(obj, TYPE_CONTAINER())) - -proc IS_RESIZE_CONTAINER*(widget: pointer): bool = - result = (IS_CONTAINER(widget)) and - ((resize_mode(cast[PContainer](widget))) != cint(RESIZE_PARENT)) - -proc border_width*(a: PContainer): guint = - result = (a.Container_flag0 and bm_TGtkContainer_border_width) shr - bp_TGtkContainer_border_width - -proc need_resize*(a: PContainer): guint = - result = (a.Container_flag0 and bm_TGtkContainer_need_resize) shr - bp_TGtkContainer_need_resize - -proc set_need_resize*(a: PContainer, `need_resize`: guint) = - a.Container_flag0 = a.Container_flag0 or - ((`need_resize` shl bp_TGtkContainer_need_resize) and - bm_TGtkContainer_need_resize) - -proc resize_mode*(a: PContainer): guint = - result = (a.Container_flag0 and bm_TGtkContainer_resize_mode) shr - bp_TGtkContainer_resize_mode - -proc set_resize_mode*(a: PContainer, `resize_mode`: guint) = - a.Containerflag0 = a.Containerflag0 or - ((`resize_mode` shl bp_TGtkContainer_resize_mode) and - bm_TGtkContainer_resize_mode) - -proc reallocate_redraws*(a: PContainer): guint = - result = (a.Containerflag0 and bm_TGtkContainer_reallocate_redraws) shr - bp_TGtkContainer_reallocate_redraws - -proc set_reallocate_redraws*(a: PContainer, `reallocate_redraws`: guint) = - a.Containerflag0 = a.Containerflag0 or - ((`reallocate_redraws` shl bp_TGtkContainer_reallocate_redraws) and - bm_TGtkContainer_reallocate_redraws) - -proc has_focus_chain*(a: PContainer): guint = - result = (a.Containerflag0 and bm_TGtkContainer_has_focus_chain) shr - bp_TGtkContainer_has_focus_chain - -proc set_has_focus_chain*(a: PContainer, `has_focus_chain`: guint) = - a.Containerflag0 = a.Containerflag0 or - ((`has_focus_chain` shl bp_TGtkContainer_has_focus_chain) and - bm_TGtkContainer_has_focus_chain) - -proc CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID*(anObject: pointer, - property_id: guint, pspec: pointer) = - write(stdout, "WARNING: invalid child property id\x0A") - -proc TYPE_BIN*(): GType = - result = bin_get_type() - -proc BIN*(obj: pointer): PBin = - result = cast[PBin](CHECK_CAST(obj, TYPE_BIN())) - -proc BIN_CLASS*(klass: pointer): PBinClass = - result = cast[PBinClass](CHECK_CLASS_CAST(klass, TYPE_BIN())) - -proc IS_BIN*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_BIN()) - -proc IS_BIN_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_BIN()) - -proc BIN_GET_CLASS*(obj: pointer): PBinClass = - result = cast[PBinClass](CHECK_GET_CLASS(obj, TYPE_BIN())) - -proc TYPE_WINDOW*(): GType = - result = window_get_type() - -proc WINDOW*(obj: pointer): PWindow = - result = cast[PWindow](CHECK_CAST(obj, gtk2.TYPE_WINDOW())) - -proc WINDOW_CLASS*(klass: pointer): PWindowClass = - result = cast[PWindowClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_WINDOW())) - -proc IS_WINDOW*(obj: pointer): bool = - result = CHECK_TYPE(obj, gtk2.TYPE_WINDOW()) - -proc IS_WINDOW_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_WINDOW()) - -proc WINDOW_GET_CLASS*(obj: pointer): PWindowClass = - result = cast[PWindowClass](CHECK_GET_CLASS(obj, gtk2.TYPE_WINDOW())) - -proc allow_shrink*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_allow_shrink) shr - bp_TGtkWindow_allow_shrink - -proc set_allow_shrink*(a: gtk2.PWindow, `allow_shrink`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`allow_shrink` shl bp_TGtkWindow_allow_shrink) and - bm_TGtkWindow_allow_shrink) - -proc allow_grow*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_allow_grow) shr - bp_TGtkWindow_allow_grow - -proc set_allow_grow*(a: gtk2.PWindow, `allow_grow`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`allow_grow` shl bp_TGtkWindow_allow_grow) and - bm_TGtkWindow_allow_grow) - -proc configure_notify_received*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_configure_notify_received) shr - bp_TGtkWindow_configure_notify_received - -proc set_configure_notify_received*(a: gtk2.PWindow, - `configure_notify_received`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`configure_notify_received` shl - bp_TGtkWindow_configure_notify_received) and - bm_TGtkWindow_configure_notify_received) - -proc need_default_position*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_need_default_position) shr - bp_TGtkWindow_need_default_position - -proc set_need_default_position*(a: gtk2.PWindow, `need_default_position`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`need_default_position` shl bp_TGtkWindow_need_default_position) and - bm_TGtkWindow_need_default_position) - -proc need_default_size*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_need_default_size) shr - bp_TGtkWindow_need_default_size - -proc set_need_default_size*(a: gtk2.PWindow, `need_default_size`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`need_default_size` shl bp_TGtkWindow_need_default_size) and - bm_TGtkWindow_need_default_size) - -proc position*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_position) shr - bp_TGtkWindow_position - -proc get_type*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_type) shr bp_TGtkWindow_type - -proc set_type*(a: gtk2.PWindow, `type`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`type` shl bp_TGtkWindow_type) and bm_TGtkWindow_type) - -proc has_user_ref_count*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_has_user_ref_count) shr - bp_TGtkWindow_has_user_ref_count - -proc set_has_user_ref_count*(a: gtk2.PWindow, `has_user_ref_count`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`has_user_ref_count` shl bp_TGtkWindow_has_user_ref_count) and - bm_TGtkWindow_has_user_ref_count) - -proc has_focus*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_has_focus) shr - bp_TGtkWindow_has_focus - -proc set_has_focus*(a: gtk2.PWindow, `has_focus`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`has_focus` shl bp_TGtkWindow_has_focus) and bm_TGtkWindow_has_focus) - -proc modal*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_modal) shr bp_TGtkWindow_modal - -proc set_modal*(a: gtk2.PWindow, `modal`: guint) = - a.Window_flag0 = a.Window_flag0 or - ((`modal` shl bp_TGtkWindow_modal) and bm_TGtkWindow_modal) - -proc destroy_with_parent*(a: gtk2.PWindow): guint = - result = (a.Window_flag0 and bm_TGtkWindow_destroy_with_parent) shr - bp_TGtkWindow_destroy_with_parent - -proc set_destroy_with_parent*(a: gtk2.PWindow, `destroy_with_parent`: guint) = - a.Windowflag0 = a.Windowflag0 or - ((`destroy_with_parent` shl bp_TGtkWindow_destroy_with_parent) and - bm_TGtkWindow_destroy_with_parent) - -proc has_frame*(a: gtk2.PWindow): guint = - result = (a.Windowflag0 and bm_TGtkWindow_has_frame) shr - bp_TGtkWindow_has_frame - -proc set_has_frame*(a: gtk2.PWindow, `has_frame`: guint) = - a.Windowflag0 = a.Windowflag0 or - ((`has_frame` shl bp_TGtkWindow_has_frame) and bm_TGtkWindow_has_frame) - -proc iconify_initially*(a: gtk2.PWindow): guint = - result = (a.Windowflag0 and bm_TGtkWindow_iconify_initially) shr - bp_TGtkWindow_iconify_initially - -proc set_iconify_initially*(a: gtk2.PWindow, `iconify_initially`: guint) = - a.Windowflag0 = a.Windowflag0 or - ((`iconify_initially` shl bp_TGtkWindow_iconify_initially) and - bm_TGtkWindow_iconify_initially) - -proc stick_initially*(a: gtk2.PWindow): guint = - result = (a.Windowflag0 and bm_TGtkWindow_stick_initially) shr - bp_TGtkWindow_stick_initially - -proc set_stick_initially*(a: gtk2.PWindow, `stick_initially`: guint) = - a.Windowflag0 = a.Windowflag0 or - ((`stick_initially` shl bp_TGtkWindow_stick_initially) and - bm_TGtkWindow_stick_initially) - -proc maximize_initially*(a: gtk2.PWindow): guint = - result = (a.Windowflag0 and bm_TGtkWindow_maximize_initially) shr - bp_TGtkWindow_maximize_initially - -proc set_maximize_initially*(a: gtk2.PWindow, `maximize_initially`: guint) = - a.Windowflag0 = a.Windowflag0 or - ((`maximize_initially` shl bp_TGtkWindow_maximize_initially) and - bm_TGtkWindow_maximize_initially) - -proc decorated*(a: gtk2.PWindow): guint = - result = (a.Windowflag0 and bm_TGtkWindow_decorated) shr - bp_TGtkWindow_decorated - -proc set_decorated*(a: gtk2.PWindow, `decorated`: guint) = - a.Windowflag0 = a.Windowflag0 or - ((`decorated` shl bp_TGtkWindow_decorated) and bm_TGtkWindow_decorated) - -proc type_hint*(a: gtk2.PWindow): guint = - result = (a.Windowflag0 and bm_TGtkWindow_type_hint) shr - bp_TGtkWindow_type_hint - -proc set_type_hint*(a: gtk2.PWindow, `type_hint`: guint) = - a.Windowflag0 = a.Windowflag0 or - ((`type_hint` shl bp_TGtkWindow_type_hint) and bm_TGtkWindow_type_hint) - -proc gravity*(a: gtk2.PWindow): guint = - result = (a.Windowflag0 and bm_TGtkWindow_gravity) shr - bp_TGtkWindow_gravity - -proc set_gravity*(a: gtk2.PWindow, `gravity`: guint) = - a.Windowflag0 = a.Windowflag0 or - ((`gravity` shl bp_TGtkWindow_gravity) and bm_TGtkWindow_gravity) - -proc TYPE_WINDOW_GROUP*(): GType = - result = window_group_get_type() - -proc WINDOW_GROUP*(anObject: pointer): PWindowGroup = - result = cast[PWindowGroup](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_WINDOW_GROUP())) - -proc WINDOW_GROUP_CLASS*(klass: pointer): PWindowGroupClass = - result = cast[PWindowGroupClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_WINDOW_GROUP())) - -proc IS_WINDOW_GROUP*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_WINDOW_GROUP()) - -proc IS_WINDOW_GROUP_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_WINDOW_GROUP()) - -proc WINDOW_GROUP_GET_CLASS*(obj: pointer): PWindowGroupClass = - result = cast[PWindowGroupClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_WINDOW_GROUP())) - -proc TYPE_LABEL*(): GType = - result = label_get_type() - -proc LABEL*(obj: pointer): PLabel = - result = cast[PLabel](CHECK_CAST(obj, TYPE_LABEL())) - -proc LABEL_CLASS*(klass: pointer): PLabelClass = - result = cast[PLabelClass](CHECK_CLASS_CAST(klass, TYPE_LABEL())) - -proc IS_LABEL*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_LABEL()) - -proc IS_LABEL_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_LABEL()) - -proc LABEL_GET_CLASS*(obj: pointer): PLabelClass = - result = cast[PLabelClass](CHECK_GET_CLASS(obj, TYPE_LABEL())) - -proc jtype*(a: PLabel): guint = - result = (a.Labelflag0 and bm_TGtkLabel_jtype) shr bp_TGtkLabel_jtype - -proc set_jtype*(a: PLabel, `jtype`: guint) = - a.Labelflag0 = a.Labelflag0 or - (int16(`jtype` shl bp_TGtkLabel_jtype) and bm_TGtkLabel_jtype) - -proc wrap*(a: PLabel): guint = - result = (a.Labelflag0 and bm_TGtkLabel_wrap) shr bp_TGtkLabel_wrap - -proc set_wrap*(a: PLabel, `wrap`: guint) = - a.Labelflag0 = a.Labelflag0 or - (int16(`wrap` shl bp_TGtkLabel_wrap) and bm_TGtkLabel_wrap) - -proc use_underline*(a: PLabel): guint = - result = (a.Labelflag0 and bm_TGtkLabel_use_underline) shr - bp_TGtkLabel_use_underline - -proc set_use_underline*(a: PLabel, `use_underline`: guint) = - a.Labelflag0 = a.Labelflag0 or - (int16(`use_underline` shl bp_TGtkLabel_use_underline) and - bm_TGtkLabel_use_underline) - -proc use_markup*(a: PLabel): guint = - result = (a.Labelflag0 and bm_TGtkLabel_use_markup) shr - bp_TGtkLabel_use_markup - -proc set_use_markup*(a: PLabel, `use_markup`: guint) = - a.Labelflag0 = a.Labelflag0 or - (int16(`use_markup` shl bp_TGtkLabel_use_markup) and - bm_TGtkLabel_use_markup) - -proc TYPE_ACCEL_LABEL*(): GType = - result = accel_label_get_type() - -proc ACCEL_LABEL*(obj: pointer): PAccelLabel = - result = cast[PAccelLabel](CHECK_CAST(obj, TYPE_ACCEL_LABEL())) - -proc ACCEL_LABEL_CLASS*(klass: pointer): PAccelLabelClass = - result = cast[PAccelLabelClass](CHECK_CLASS_CAST(klass, TYPE_ACCEL_LABEL())) - -proc IS_ACCEL_LABEL*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_ACCEL_LABEL()) - -proc IS_ACCEL_LABEL_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ACCEL_LABEL()) - -proc ACCEL_LABEL_GET_CLASS*(obj: pointer): PAccelLabelClass = - result = cast[PAccelLabelClass](CHECK_GET_CLASS(obj, TYPE_ACCEL_LABEL())) - -proc latin1_to_char*(a: PAccelLabelClass): guint = - result = (a.AccelLabelClassflag0 and bm_TGtkAccelLabelClass_latin1_to_char) shr - bp_TGtkAccelLabelClass_latin1_to_char - -proc set_latin1_to_char*(a: PAccelLabelClass, `latin1_to_char`: guint) = - a.AccelLabelClassflag0 = a.AccelLabelClassflag0 or - (int16(`latin1_to_char` shl bp_TGtkAccelLabelClass_latin1_to_char) and - bm_TGtkAccelLabelClass_latin1_to_char) - -proc accelerator_width*(accel_label: PAccelLabel): guint = - result = get_accel_width(accel_label) - -proc TYPE_ACCESSIBLE*(): GType = - result = accessible_get_type() - -proc ACCESSIBLE*(obj: pointer): PAccessible = - result = cast[PAccessible](CHECK_CAST(obj, TYPE_ACCESSIBLE())) - -proc ACCESSIBLE_CLASS*(klass: pointer): PAccessibleClass = - result = cast[PAccessibleClass](CHECK_CLASS_CAST(klass, TYPE_ACCESSIBLE())) - -proc IS_ACCESSIBLE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_ACCESSIBLE()) - -proc IS_ACCESSIBLE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ACCESSIBLE()) - -proc ACCESSIBLE_GET_CLASS*(obj: pointer): PAccessibleClass = - result = cast[PAccessibleClass](CHECK_GET_CLASS(obj, TYPE_ACCESSIBLE())) - -proc TYPE_ADJUSTMENT*(): GType = - result = adjustment_get_type() - -proc ADJUSTMENT*(obj: pointer): PAdjustment = - result = cast[PAdjustment](CHECK_CAST(obj, TYPE_ADJUSTMENT())) - -proc ADJUSTMENT_CLASS*(klass: pointer): PAdjustmentClass = - result = cast[PAdjustmentClass](CHECK_CLASS_CAST(klass, TYPE_ADJUSTMENT())) - -proc IS_ADJUSTMENT*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_ADJUSTMENT()) - -proc IS_ADJUSTMENT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ADJUSTMENT()) - -proc ADJUSTMENT_GET_CLASS*(obj: pointer): PAdjustmentClass = - result = cast[PAdjustmentClass](CHECK_GET_CLASS(obj, TYPE_ADJUSTMENT())) - -proc TYPE_ALIGNMENT*(): GType = - result = alignment_get_type() - -proc ALIGNMENT*(obj: pointer): PAlignment = - result = cast[PAlignment](CHECK_CAST(obj, TYPE_ALIGNMENT())) - -proc ALIGNMENT_CLASS*(klass: pointer): PAlignmentClass = - result = cast[PAlignmentClass](CHECK_CLASS_CAST(klass, TYPE_ALIGNMENT())) - -proc IS_ALIGNMENT*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_ALIGNMENT()) - -proc IS_ALIGNMENT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ALIGNMENT()) - -proc ALIGNMENT_GET_CLASS*(obj: pointer): PAlignmentClass = - result = cast[PAlignmentClass](CHECK_GET_CLASS(obj, TYPE_ALIGNMENT())) - -proc TYPE_FRAME*(): GType = - result = frame_get_type() - -proc FRAME*(obj: pointer): PFrame = - result = cast[PFrame](CHECK_CAST(obj, TYPE_FRAME())) - -proc FRAME_CLASS*(klass: pointer): PFrameClass = - result = cast[PFrameClass](CHECK_CLASS_CAST(klass, TYPE_FRAME())) - -proc IS_FRAME*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_FRAME()) - -proc IS_FRAME_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_FRAME()) - -proc FRAME_GET_CLASS*(obj: pointer): PFrameClass = - result = cast[PFrameClass](CHECK_GET_CLASS(obj, TYPE_FRAME())) - -proc TYPE_ASPECT_FRAME*(): GType = - result = aspect_frame_get_type() - -proc ASPECT_FRAME*(obj: pointer): PAspectFrame = - result = cast[PAspectFrame](CHECK_CAST(obj, TYPE_ASPECT_FRAME())) - -proc ASPECT_FRAME_CLASS*(klass: pointer): PAspectFrameClass = - result = cast[PAspectFrameClass](CHECK_CLASS_CAST(klass, TYPE_ASPECT_FRAME())) - -proc IS_ASPECT_FRAME*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_ASPECT_FRAME()) - -proc IS_ASPECT_FRAME_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ASPECT_FRAME()) - -proc ASPECT_FRAME_GET_CLASS*(obj: pointer): PAspectFrameClass = - result = cast[PAspectFrameClass](CHECK_GET_CLASS(obj, TYPE_ASPECT_FRAME())) - -proc TYPE_ARROW*(): GType = - result = arrow_get_type() - -proc ARROW*(obj: pointer): PArrow = - result = cast[PArrow](CHECK_CAST(obj, TYPE_ARROW())) - -proc ARROW_CLASS*(klass: pointer): PArrowClass = - result = cast[PArrowClass](CHECK_CLASS_CAST(klass, TYPE_ARROW())) - -proc IS_ARROW*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_ARROW()) - -proc IS_ARROW_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ARROW()) - -proc ARROW_GET_CLASS*(obj: pointer): PArrowClass = - result = cast[PArrowClass](CHECK_GET_CLASS(obj, TYPE_ARROW())) - -proc parsed*(a: PBindingSet): guint = - result = (a.flag0 and bm_TGtkBindingSet_parsed) shr - bp_TGtkBindingSet_parsed - -proc set_parsed*(a: PBindingSet, `parsed`: guint) = - a.flag0 = a.flag0 or - (int16(`parsed` shl bp_TGtkBindingSet_parsed) and - bm_TGtkBindingSet_parsed) - -proc destroyed*(a: PBindingEntry): guint = - result = (a.flag0 and bm_TGtkBindingEntry_destroyed) shr - bp_TGtkBindingEntry_destroyed - -proc set_destroyed*(a: PBindingEntry, `destroyed`: guint) = - a.flag0 = a.flag0 or - (int16(`destroyed` shl bp_TGtkBindingEntry_destroyed) and - bm_TGtkBindingEntry_destroyed) - -proc in_emission*(a: PBindingEntry): guint = - result = (a.flag0 and bm_TGtkBindingEntry_in_emission) shr - bp_TGtkBindingEntry_in_emission - -proc set_in_emission*(a: PBindingEntry, `in_emission`: guint) = - a.flag0 = a.flag0 or - (int16(`in_emission` shl bp_TGtkBindingEntry_in_emission) and - bm_TGtkBindingEntry_in_emission) - -proc entry_add*(binding_set: PBindingSet, keyval: guint, - modifiers: gdk2.TModifierType) = - entry_clear(binding_set, keyval, modifiers) - -proc TYPE_BOX*(): GType = - result = box_get_type() - -proc BOX*(obj: pointer): PBox = - result = cast[PBox](CHECK_CAST(obj, TYPE_BOX())) - -proc BOX_CLASS*(klass: pointer): PBoxClass = - result = cast[PBoxClass](CHECK_CLASS_CAST(klass, TYPE_BOX())) - -proc IS_BOX*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_BOX()) - -proc IS_BOX_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_BOX()) - -proc BOX_GET_CLASS*(obj: pointer): PBoxClass = - result = cast[PBoxClass](CHECK_GET_CLASS(obj, TYPE_BOX())) - -proc homogeneous*(a: PBox): guint = - result = (a.Boxflag0 and bm_TGtkBox_homogeneous) shr bp_TGtkBox_homogeneous - -proc set_homogeneous*(a: PBox, `homogeneous`: guint) = - a.Boxflag0 = a.Boxflag0 or - (int16(`homogeneous` shl bp_TGtkBox_homogeneous) and - bm_TGtkBox_homogeneous) - -proc expand*(a: PBoxChild): guint = - result = (a.flag0 and bm_TGtkBoxChild_expand) shr bp_TGtkBoxChild_expand - -proc set_expand*(a: PBoxChild, `expand`: guint) = - a.flag0 = a.flag0 or - (int16(`expand` shl bp_TGtkBoxChild_expand) and bm_TGtkBoxChild_expand) - -proc fill*(a: PBoxChild): guint = - result = (a.flag0 and bm_TGtkBoxChild_fill) shr bp_TGtkBoxChild_fill - -proc set_fill*(a: PBoxChild, `fill`: guint) = - a.flag0 = a.flag0 or - (int16(`fill` shl bp_TGtkBoxChild_fill) and bm_TGtkBoxChild_fill) - -proc pack*(a: PBoxChild): guint = - result = (a.flag0 and bm_TGtkBoxChild_pack) shr bp_TGtkBoxChild_pack - -proc set_pack*(a: PBoxChild, `pack`: guint) = - a.flag0 = a.flag0 or - (int16(`pack` shl bp_TGtkBoxChild_pack) and bm_TGtkBoxChild_pack) - -proc is_secondary*(a: PBoxChild): guint = - result = (a.flag0 and bm_TGtkBoxChild_is_secondary) shr - bp_TGtkBoxChild_is_secondary - -proc set_is_secondary*(a: PBoxChild, `is_secondary`: guint) = - a.flag0 = a.flag0 or - (int16(`is_secondary` shl bp_TGtkBoxChild_is_secondary) and - bm_TGtkBoxChild_is_secondary) - -proc TYPE_BUTTON_BOX*(): GType = - result = button_box_get_type() - -proc BUTTON_BOX*(obj: pointer): PButtonBox = - result = cast[PButtonBox](CHECK_CAST(obj, TYPE_BUTTON_BOX())) - -proc BUTTON_BOX_CLASS*(klass: pointer): PButtonBoxClass = - result = cast[PButtonBoxClass](CHECK_CLASS_CAST(klass, TYPE_BUTTON_BOX())) - -proc IS_BUTTON_BOX*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_BUTTON_BOX()) - -proc IS_BUTTON_BOX_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_BUTTON_BOX()) - -proc BUTTON_BOX_GET_CLASS*(obj: pointer): PButtonBoxClass = - result = cast[PButtonBoxClass](CHECK_GET_CLASS(obj, TYPE_BUTTON_BOX())) - -proc button_box_set_spacing*(b: pointer, s: gint) = - set_spacing(BOX(b), s) - -proc button_box_get_spacing*(b: pointer): gint = - result = get_spacing(BOX(b)) - -proc TYPE_BUTTON*(): GType = - result = button_get_type() - -proc BUTTON*(obj: pointer): PButton = - result = cast[PButton](CHECK_CAST(obj, TYPE_BUTTON())) - -proc BUTTON_CLASS*(klass: pointer): PButtonClass = - result = cast[PButtonClass](CHECK_CLASS_CAST(klass, TYPE_BUTTON())) - -proc IS_BUTTON*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_BUTTON()) - -proc IS_BUTTON_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_BUTTON()) - -proc BUTTON_GET_CLASS*(obj: pointer): PButtonClass = - result = cast[PButtonClass](CHECK_GET_CLASS(obj, TYPE_BUTTON())) - -proc constructed*(a: PButton): guint = - result = (a.Buttonflag0 and bm_TGtkButton_constructed) shr - bp_TGtkButton_constructed - -proc set_constructed*(a: PButton, `constructed`: guint) = - a.Buttonflag0 = a.Buttonflag0 or - (int16(`constructed` shl bp_TGtkButton_constructed) and - bm_TGtkButton_constructed) - -proc in_button*(a: PButton): guint = - result = (a.Buttonflag0 and bm_TGtkButton_in_button) shr - bp_TGtkButton_in_button - -proc set_in_button*(a: PButton, `in_button`: guint) = - a.Buttonflag0 = a.Buttonflag0 or - (int16(`in_button` shl bp_TGtkButton_in_button) and - bm_TGtkButton_in_button) - -proc button_down*(a: PButton): guint = - result = (a.Buttonflag0 and bm_TGtkButton_button_down) shr - bp_TGtkButton_button_down - -proc set_button_down*(a: PButton, `button_down`: guint) = - a.Buttonflag0 = a.Buttonflag0 or - (int16(`button_down` shl bp_TGtkButton_button_down) and - bm_TGtkButton_button_down) - -proc relief*(a: PButton): guint = - result = (a.Buttonflag0 and bm_TGtkButton_relief) shr bp_TGtkButton_relief - -proc use_underline*(a: PButton): guint = - result = (a.Buttonflag0 and bm_TGtkButton_use_underline) shr - bp_TGtkButton_use_underline - -proc set_use_underline*(a: PButton, `use_underline`: guint) = - a.Buttonflag0 = a.Buttonflag0 or - (int16(`use_underline` shl bp_TGtkButton_use_underline) and - bm_TGtkButton_use_underline) - -proc use_stock*(a: PButton): guint = - result = (a.Buttonflag0 and bm_TGtkButton_use_stock) shr - bp_TGtkButton_use_stock - -proc set_use_stock*(a: PButton, `use_stock`: guint) = - a.Buttonflag0 = a.Buttonflag0 or - (int16(`use_stock` shl bp_TGtkButton_use_stock) and - bm_TGtkButton_use_stock) - -proc depressed*(a: PButton): guint = - result = (a.Buttonflag0 and bm_TGtkButton_depressed) shr - bp_TGtkButton_depressed - -proc set_depressed*(a: PButton, `depressed`: guint) = - a.Buttonflag0 = a.Buttonflag0 or - (int16(`depressed` shl bp_TGtkButton_depressed) and - bm_TGtkButton_depressed) - -proc depress_on_activate*(a: PButton): guint = - result = (a.Buttonflag0 and bm_TGtkButton_depress_on_activate) shr - bp_TGtkButton_depress_on_activate - -proc set_depress_on_activate*(a: PButton, `depress_on_activate`: guint) = - a.Buttonflag0 = a.Buttonflag0 or - (int16(`depress_on_activate` shl bp_TGtkButton_depress_on_activate) and - bm_TGtkButton_depress_on_activate) - -proc TYPE_CALENDAR*(): GType = - result = calendar_get_type() - -proc CALENDAR*(obj: pointer): PCalendar = - result = cast[PCalendar](CHECK_CAST(obj, TYPE_CALENDAR())) - -proc CALENDAR_CLASS*(klass: pointer): PCalendarClass = - result = cast[PCalendarClass](CHECK_CLASS_CAST(klass, TYPE_CALENDAR())) - -proc IS_CALENDAR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CALENDAR()) - -proc IS_CALENDAR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CALENDAR()) - -proc CALENDAR_GET_CLASS*(obj: pointer): PCalendarClass = - result = cast[PCalendarClass](CHECK_GET_CLASS(obj, TYPE_CALENDAR())) - -proc TYPE_CELL_EDITABLE*(): GType = - result = cell_editable_get_type() - -proc CELL_EDITABLE*(obj: pointer): PCellEditable = - result = cast[PCellEditable](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_CELL_EDITABLE())) - -proc CELL_EDITABLE_CLASS*(obj: pointer): PCellEditableIface = - result = cast[PCellEditableIface](G_TYPE_CHECK_CLASS_CAST(obj, - TYPE_CELL_EDITABLE())) - -proc IS_CELL_EDITABLE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_CELL_EDITABLE()) - -proc CELL_EDITABLE_GET_IFACE*(obj: pointer): PCellEditableIface = - result = cast[PCellEditableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_CELL_EDITABLE())) - -proc TYPE_CELL_RENDERER*(): GType = - result = cell_renderer_get_type() - -proc CELL_RENDERER*(obj: pointer): PCellRenderer = - result = cast[PCellRenderer](CHECK_CAST(obj, TYPE_CELL_RENDERER())) - -proc CELL_RENDERER_CLASS*(klass: pointer): PCellRendererClass = - result = cast[PCellRendererClass](CHECK_CLASS_CAST(klass, TYPE_CELL_RENDERER())) - -proc IS_CELL_RENDERER*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CELL_RENDERER()) - -proc IS_CELL_RENDERER_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CELL_RENDERER()) - -proc CELL_RENDERER_GET_CLASS*(obj: pointer): PCellRendererClass = - result = cast[PCellRendererClass](CHECK_GET_CLASS(obj, TYPE_CELL_RENDERER())) - -proc mode*(a: PCellRenderer): guint = - result = (a.CellRendererflag0 and bm_TGtkCellRenderer_mode) shr - bp_TGtkCellRenderer_mode - -proc set_mode*(a: PCellRenderer, `mode`: guint) = - a.CellRendererflag0 = a.CellRendererflag0 or - (int16(`mode` shl bp_TGtkCellRenderer_mode) and - bm_TGtkCellRenderer_mode) - -proc visible*(a: PCellRenderer): guint = - result = (a.CellRendererflag0 and bm_TGtkCellRenderer_visible) shr - bp_TGtkCellRenderer_visible - -proc set_visible*(a: PCellRenderer, `visible`: guint) = - a.CellRendererflag0 = a.CellRendererflag0 or - (int16(`visible` shl bp_TGtkCellRenderer_visible) and - bm_TGtkCellRenderer_visible) - -proc is_expander*(a: PCellRenderer): guint = - result = (a.CellRendererflag0 and bm_TGtkCellRenderer_is_expander) shr - bp_TGtkCellRenderer_is_expander - -proc set_is_expander*(a: PCellRenderer, `is_expander`: guint) = - a.CellRendererflag0 = a.CellRendererflag0 or - (int16(`is_expander` shl bp_TGtkCellRenderer_is_expander) and - bm_TGtkCellRenderer_is_expander) - -proc is_expanded*(a: PCellRenderer): guint = - result = (a.CellRendererflag0 and bm_TGtkCellRenderer_is_expanded) shr - bp_TGtkCellRenderer_is_expanded - -proc set_is_expanded*(a: PCellRenderer, `is_expanded`: guint) = - a.CellRendererflag0 = a.CellRendererflag0 or - (int16(`is_expanded` shl bp_TGtkCellRenderer_is_expanded) and - bm_TGtkCellRenderer_is_expanded) - -proc cell_background_set*(a: PCellRenderer): guint = - result = (a.CellRendererflag0 and bm_TGtkCellRenderer_cell_background_set) shr - bp_TGtkCellRenderer_cell_background_set - -proc set_cell_background_set*(a: PCellRenderer, `cell_background_set`: guint) = - a.CellRendererflag0 = a.CellRendererflag0 or - (int16(`cell_background_set` shl - bp_TGtkCellRenderer_cell_background_set) and - bm_TGtkCellRenderer_cell_background_set) - -proc TYPE_CELL_RENDERER_TEXT*(): GType = - result = cell_renderer_text_get_type() - -proc CELL_RENDERER_TEXT*(obj: pointer): PCellRendererText = - result = cast[PCellRendererText](CHECK_CAST(obj, TYPE_CELL_RENDERER_TEXT())) - -proc CELL_RENDERER_TEXT_CLASS*(klass: pointer): PCellRendererTextClass = - result = cast[PCellRendererTextClass](CHECK_CLASS_CAST(klass, - TYPE_CELL_RENDERER_TEXT())) - -proc IS_CELL_RENDERER_TEXT*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CELL_RENDERER_TEXT()) - -proc IS_CELL_RENDERER_TEXT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CELL_RENDERER_TEXT()) - -proc CELL_RENDERER_TEXT_GET_CLASS*(obj: pointer): PCellRendererTextClass = - result = cast[PCellRendererTextClass](CHECK_GET_CLASS(obj, - TYPE_CELL_RENDERER_TEXT())) - -proc strikethrough*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_strikethrough) shr - bp_TGtkCellRendererText_strikethrough - -proc set_strikethrough*(a: PCellRendererText, `strikethrough`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`strikethrough` shl bp_TGtkCellRendererText_strikethrough) and - bm_TGtkCellRendererText_strikethrough) - -proc editable*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_editable) shr - bp_TGtkCellRendererText_editable - -proc set_editable*(a: PCellRendererText, `editable`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`editable` shl bp_TGtkCellRendererText_editable) and - bm_TGtkCellRendererText_editable) - -proc scale_set*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_scale_set) shr - bp_TGtkCellRendererText_scale_set - -proc set_scale_set*(a: PCellRendererText, `scale_set`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`scale_set` shl bp_TGtkCellRendererText_scale_set) and - bm_TGtkCellRendererText_scale_set) - -proc foreground_set*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and - bm_TGtkCellRendererText_foreground_set) shr - bp_TGtkCellRendererText_foreground_set - -proc set_foreground_set*(a: PCellRendererText, `foreground_set`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`foreground_set` shl bp_TGtkCellRendererText_foreground_set) and - bm_TGtkCellRendererText_foreground_set) - -proc background_set*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and - bm_TGtkCellRendererText_background_set) shr - bp_TGtkCellRendererText_background_set - -proc set_background_set*(a: PCellRendererText, `background_set`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`background_set` shl bp_TGtkCellRendererText_background_set) and - bm_TGtkCellRendererText_background_set) - -proc underline_set*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_underline_set) shr - bp_TGtkCellRendererText_underline_set - -proc set_underline_set*(a: PCellRendererText, `underline_set`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`underline_set` shl bp_TGtkCellRendererText_underline_set) and - bm_TGtkCellRendererText_underline_set) - -proc rise_set*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_rise_set) shr - bp_TGtkCellRendererText_rise_set - -proc set_rise_set*(a: PCellRendererText, `rise_set`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`rise_set` shl bp_TGtkCellRendererText_rise_set) and - bm_TGtkCellRendererText_rise_set) - -proc strikethrough_set*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and - bm_TGtkCellRendererText_strikethrough_set) shr - bp_TGtkCellRendererText_strikethrough_set - -proc set_strikethrough_set*(a: PCellRendererText, `strikethrough_set`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`strikethrough_set` shl - bp_TGtkCellRendererText_strikethrough_set) and - bm_TGtkCellRendererText_strikethrough_set) - -proc editable_set*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_editable_set) shr - bp_TGtkCellRendererText_editable_set - -proc set_editable_set*(a: PCellRendererText, `editable_set`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`editable_set` shl bp_TGtkCellRendererText_editable_set) and - bm_TGtkCellRendererText_editable_set) - -proc calc_fixed_height*(a: PCellRendererText): guint = - result = (a.CellRendererTextflag0 and - bm_TGtkCellRendererText_calc_fixed_height) shr - bp_TGtkCellRendererText_calc_fixed_height - -proc set_calc_fixed_height*(a: PCellRendererText, `calc_fixed_height`: guint) = - a.CellRendererTextflag0 = a.CellRendererTextflag0 or - (int16(`calc_fixed_height` shl - bp_TGtkCellRendererText_calc_fixed_height) and - bm_TGtkCellRendererText_calc_fixed_height) - -proc TYPE_CELL_RENDERER_TOGGLE*(): GType = - result = cell_renderer_toggle_get_type() - -proc CELL_RENDERER_TOGGLE*(obj: pointer): PCellRendererToggle = - result = cast[PCellRendererToggle](CHECK_CAST(obj, TYPE_CELL_RENDERER_TOGGLE())) - -proc CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): PCellRendererToggleClass = - result = cast[PCellRendererToggleClass](CHECK_CLASS_CAST(klass, - TYPE_CELL_RENDERER_TOGGLE())) - -proc IS_CELL_RENDERER_TOGGLE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CELL_RENDERER_TOGGLE()) - -proc IS_CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CELL_RENDERER_TOGGLE()) - -proc CELL_RENDERER_TOGGLE_GET_CLASS*(obj: pointer): PCellRendererToggleClass = - result = cast[PCellRendererToggleClass](CHECK_GET_CLASS(obj, - TYPE_CELL_RENDERER_TOGGLE())) - -proc active*(a: PCellRendererToggle): guint = - result = (a.CellRendererToggleflag0 and bm_TGtkCellRendererToggle_active) shr - bp_TGtkCellRendererToggle_active - -proc set_active*(a: PCellRendererToggle, `active`: guint) = - a.CellRendererToggleflag0 = a.CellRendererToggleflag0 or - (int16(`active` shl bp_TGtkCellRendererToggle_active) and - bm_TGtkCellRendererToggle_active) - -proc activatable*(a: PCellRendererToggle): guint = - result = (a.CellRendererToggleflag0 and - bm_TGtkCellRendererToggle_activatable) shr - bp_TGtkCellRendererToggle_activatable - -proc set_activatable*(a: PCellRendererToggle, `activatable`: guint) = - a.CellRendererToggleflag0 = a.CellRendererToggleflag0 or - (int16(`activatable` shl bp_TGtkCellRendererToggle_activatable) and - bm_TGtkCellRendererToggle_activatable) - -proc radio*(a: PCellRendererToggle): guint = - result = (a.CellRendererToggleflag0 and bm_TGtkCellRendererToggle_radio) shr - bp_TGtkCellRendererToggle_radio - -proc set_radio*(a: PCellRendererToggle, `radio`: guint) = - a.CellRendererToggleflag0 = a.CellRendererToggleflag0 or - (int16(`radio` shl bp_TGtkCellRendererToggle_radio) and - bm_TGtkCellRendererToggle_radio) - -proc TYPE_CELL_RENDERER_PIXBUF*(): GType = - result = cell_renderer_pixbuf_get_type() - -proc CELL_RENDERER_PIXBUF*(obj: pointer): PCellRendererPixbuf = - result = cast[PCellRendererPixbuf](CHECK_CAST(obj, TYPE_CELL_RENDERER_PIXBUF())) - -proc CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): PCellRendererPixbufClass = - result = cast[PCellRendererPixbufClass](CHECK_CLASS_CAST(klass, - TYPE_CELL_RENDERER_PIXBUF())) - -proc IS_CELL_RENDERER_PIXBUF*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CELL_RENDERER_PIXBUF()) - -proc IS_CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CELL_RENDERER_PIXBUF()) - -proc CELL_RENDERER_PIXBUF_GET_CLASS*(obj: pointer): PCellRendererPixbufClass = - result = cast[PCellRendererPixbufClass](CHECK_GET_CLASS(obj, - TYPE_CELL_RENDERER_PIXBUF())) - -proc TYPE_ITEM*(): GType = - result = item_get_type() - -proc ITEM*(obj: pointer): PItem = - result = cast[PItem](CHECK_CAST(obj, TYPE_ITEM())) - -proc ITEM_CLASS*(klass: pointer): PItemClass = - result = cast[PItemClass](CHECK_CLASS_CAST(klass, TYPE_ITEM())) - -proc IS_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_ITEM()) - -proc IS_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ITEM()) - -proc ITEM_GET_CLASS*(obj: pointer): PItemClass = - result = cast[PItemClass](CHECK_GET_CLASS(obj, TYPE_ITEM())) - -proc TYPE_MENU_ITEM*(): GType = - result = menu_item_get_type() - -proc MENU_ITEM*(obj: pointer): PMenuItem = - result = cast[PMenuItem](CHECK_CAST(obj, TYPE_MENU_ITEM())) - -proc MENU_ITEM_CLASS*(klass: pointer): PMenuItemClass = - result = cast[PMenuItemClass](CHECK_CLASS_CAST(klass, TYPE_MENU_ITEM())) - -proc IS_MENU_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_MENU_ITEM()) - -proc IS_MENU_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_MENU_ITEM()) - -proc MENU_ITEM_GET_CLASS*(obj: pointer): PMenuItemClass = - result = cast[PMenuItemClass](CHECK_GET_CLASS(obj, TYPE_MENU_ITEM())) - -proc show_submenu_indicator*(a: PMenuItem): guint = - result = (a.MenuItemflag0 and bm_TGtkMenuItem_show_submenu_indicator) shr - bp_TGtkMenuItem_show_submenu_indicator - -proc set_show_submenu_indicator*(a: PMenuItem, - `show_submenu_indicator`: guint) = - a.MenuItemflag0 = a.MenuItemflag0 or - (int16(`show_submenu_indicator` shl - bp_TGtkMenuItem_show_submenu_indicator) and - bm_TGtkMenuItem_show_submenu_indicator) - -proc submenu_placement*(a: PMenuItem): guint = - result = (a.MenuItemflag0 and bm_TGtkMenuItem_submenu_placement) shr - bp_TGtkMenuItem_submenu_placement - -proc set_submenu_placement*(a: PMenuItem, `submenu_placement`: guint) = - a.MenuItemflag0 = a.MenuItemflag0 or - (int16(`submenu_placement` shl bp_TGtkMenuItem_submenu_placement) and - bm_TGtkMenuItem_submenu_placement) - -proc submenu_direction*(a: PMenuItem): guint = - result = (a.MenuItemflag0 and bm_TGtkMenuItem_submenu_direction) shr - bp_TGtkMenuItem_submenu_direction - -proc set_submenu_direction*(a: PMenuItem, `submenu_direction`: guint) = - a.MenuItemflag0 = a.MenuItemflag0 or - (int16(`submenu_direction` shl bp_TGtkMenuItem_submenu_direction) and - bm_TGtkMenuItem_submenu_direction) - -proc right_justify*(a: PMenuItem): guint = - result = (a.MenuItemflag0 and bm_TGtkMenuItem_right_justify) shr - bp_TGtkMenuItem_right_justify - -proc set_right_justify*(a: PMenuItem, `right_justify`: guint) = - a.MenuItemflag0 = a.MenuItemflag0 or - (int16(`right_justify` shl bp_TGtkMenuItem_right_justify) and - bm_TGtkMenuItem_right_justify) - -proc timer_from_keypress*(a: PMenuItem): guint = - result = (a.MenuItemflag0 and bm_TGtkMenuItem_timer_from_keypress) shr - bp_TGtkMenuItem_timer_from_keypress - -proc set_timer_from_keypress*(a: PMenuItem, `timer_from_keypress`: guint) = - a.MenuItemflag0 = a.MenuItemflag0 or - (int16(`timer_from_keypress` shl bp_TGtkMenuItem_timer_from_keypress) and - bm_TGtkMenuItem_timer_from_keypress) - -proc hide_on_activate*(a: PMenuItemClass): guint = - result = (a.MenuItemClassflag0 and bm_TGtkMenuItemClass_hide_on_activate) shr - bp_TGtkMenuItemClass_hide_on_activate - -proc set_hide_on_activate*(a: PMenuItemClass, `hide_on_activate`: guint) = - a.MenuItemClassflag0 = a.MenuItemClassflag0 or - (int16(`hide_on_activate` shl bp_TGtkMenuItemClass_hide_on_activate) and - bm_TGtkMenuItemClass_hide_on_activate) - -proc right_justify*(menu_item: PMenuItem) = - set_right_justified(menu_item, system.true) - -proc TYPE_TOGGLE_BUTTON*(): GType = - result = toggle_button_get_type() - -proc TOGGLE_BUTTON*(obj: pointer): PToggleButton = - result = cast[PToggleButton](CHECK_CAST(obj, TYPE_TOGGLE_BUTTON())) - -proc TOGGLE_BUTTON_CLASS*(klass: pointer): PToggleButtonClass = - result = cast[PToggleButtonClass](CHECK_CLASS_CAST(klass, TYPE_TOGGLE_BUTTON())) - -proc IS_TOGGLE_BUTTON*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TOGGLE_BUTTON()) - -proc IS_TOGGLE_BUTTON_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TOGGLE_BUTTON()) - -proc TOGGLE_BUTTON_GET_CLASS*(obj: pointer): PToggleButtonClass = - result = cast[PToggleButtonClass](CHECK_GET_CLASS(obj, TYPE_TOGGLE_BUTTON())) - -proc active*(a: PToggleButton): guint = - result = (a.ToggleButtonflag0 and bm_TGtkToggleButton_active) shr - bp_TGtkToggleButton_active - -proc set_active*(a: PToggleButton, `active`: guint) = - a.ToggleButtonflag0 = a.ToggleButtonflag0 or - (int16(`active` shl bp_TGtkToggleButton_active) and - bm_TGtkToggleButton_active) - -proc draw_indicator*(a: PToggleButton): guint = - result = (a.ToggleButtonflag0 and bm_TGtkToggleButton_draw_indicator) shr - bp_TGtkToggleButton_draw_indicator - -proc set_draw_indicator*(a: PToggleButton, `draw_indicator`: guint) = - a.ToggleButtonflag0 = a.ToggleButtonflag0 or - (int16(`draw_indicator` shl bp_TGtkToggleButton_draw_indicator) and - bm_TGtkToggleButton_draw_indicator) - -proc inconsistent*(a: PToggleButton): guint = - result = (a.ToggleButtonflag0 and bm_TGtkToggleButton_inconsistent) shr - bp_TGtkToggleButton_inconsistent - -proc set_inconsistent*(a: PToggleButton, `inconsistent`: guint) = - a.ToggleButtonflag0 = a.ToggleButtonflag0 or - (int16(`inconsistent` shl bp_TGtkToggleButton_inconsistent) and - bm_TGtkToggleButton_inconsistent) - -proc TYPE_CHECK_BUTTON*(): GType = - result = check_button_get_type() - -proc CHECK_BUTTON*(obj: pointer): PCheckButton = - result = cast[PCheckButton](CHECK_CAST(obj, TYPE_CHECK_BUTTON())) - -proc CHECK_BUTTON_CLASS*(klass: pointer): PCheckButtonClass = - result = cast[PCheckButtonClass](CHECK_CLASS_CAST(klass, TYPE_CHECK_BUTTON())) - -proc IS_CHECK_BUTTON*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CHECK_BUTTON()) - -proc IS_CHECK_BUTTON_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CHECK_BUTTON()) - -proc CHECK_BUTTON_GET_CLASS*(obj: pointer): PCheckButtonClass = - result = cast[PCheckButtonClass](CHECK_GET_CLASS(obj, TYPE_CHECK_BUTTON())) - -proc TYPE_CHECK_MENU_ITEM*(): GType = - result = check_menu_item_get_type() - -proc CHECK_MENU_ITEM*(obj: pointer): PCheckMenuItem = - result = cast[PCheckMenuItem](CHECK_CAST(obj, TYPE_CHECK_MENU_ITEM())) - -proc CHECK_MENU_ITEM_CLASS*(klass: pointer): PCheckMenuItemClass = - result = cast[PCheckMenuItemClass](CHECK_CLASS_CAST(klass, - TYPE_CHECK_MENU_ITEM())) - -proc IS_CHECK_MENU_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CHECK_MENU_ITEM()) - -proc IS_CHECK_MENU_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CHECK_MENU_ITEM()) - -proc CHECK_MENU_ITEM_GET_CLASS*(obj: pointer): PCheckMenuItemClass = - result = cast[PCheckMenuItemClass](CHECK_GET_CLASS(obj, TYPE_CHECK_MENU_ITEM())) - -proc active*(a: PCheckMenuItem): guint = - result = (a.CheckMenuItemflag0 and bm_TGtkCheckMenuItem_active) shr - bp_TGtkCheckMenuItem_active - -proc set_active*(a: PCheckMenuItem, `active`: guint) = - a.CheckMenuItemflag0 = a.CheckMenuItemflag0 or - (int16(`active` shl bp_TGtkCheckMenuItem_active) and - bm_TGtkCheckMenuItem_active) - -proc always_show_toggle*(a: PCheckMenuItem): guint = - result = (a.CheckMenuItemflag0 and bm_TGtkCheckMenuItem_always_show_toggle) shr - bp_TGtkCheckMenuItem_always_show_toggle - -proc set_always_show_toggle*(a: PCheckMenuItem, `always_show_toggle`: guint) = - a.CheckMenuItemflag0 = a.CheckMenuItemflag0 or - (int16(`always_show_toggle` shl bp_TGtkCheckMenuItem_always_show_toggle) and - bm_TGtkCheckMenuItem_always_show_toggle) - -proc inconsistent*(a: PCheckMenuItem): guint = - result = (a.CheckMenuItemflag0 and bm_TGtkCheckMenuItem_inconsistent) shr - bp_TGtkCheckMenuItem_inconsistent - -proc set_inconsistent*(a: PCheckMenuItem, `inconsistent`: guint) = - a.CheckMenuItemflag0 = a.CheckMenuItemflag0 or - (int16(`inconsistent` shl bp_TGtkCheckMenuItem_inconsistent) and - bm_TGtkCheckMenuItem_inconsistent) - -proc TYPE_CLIST*(): GType = - result = clist_get_type() - -proc CLIST*(obj: pointer): PCList = - result = cast[PCList](CHECK_CAST(obj, TYPE_CLIST())) - -proc CLIST_CLASS*(klass: pointer): PCListClass = - result = cast[PCListClass](CHECK_CLASS_CAST(klass, TYPE_CLIST())) - -proc IS_CLIST*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CLIST()) - -proc IS_CLIST_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CLIST()) - -proc CLIST_GET_CLASS*(obj: pointer): PCListClass = - result = cast[PCListClass](CHECK_GET_CLASS(obj, TYPE_CLIST())) - -proc CLIST_FLAGS*(clist: pointer): guint16 = - result = toU16(CLIST(clist).flags) - -proc SET_FLAG*(clist: PCList, flag: guint16) = - clist.flags = CLIST(clist).flags or (flag) - -proc UNSET_FLAG*(clist: PCList, flag: guint16) = - clist.flags = CLIST(clist).flags and not (flag) - -proc CLIST_IN_DRAG_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_IN_DRAG)) != 0'i32 - -proc CLIST_ROW_HEIGHT_SET_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_ROW_HEIGHT_SET)) != 0'i32 - -proc CLIST_SHOW_TITLES_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_SHOW_TITLES)) != 0'i32 - -proc CLIST_ADD_MODE_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_ADD_MODE)) != 0'i32 - -proc CLIST_AUTO_SORT_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_AUTO_SORT)) != 0'i32 - -proc CLIST_AUTO_RESIZE_BLOCKED_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_AUTO_RESIZE_BLOCKED)) != 0'i32 - -proc CLIST_REORDERABLE_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_REORDERABLE)) != 0'i32 - -proc CLIST_USE_DRAG_ICONS_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_USE_DRAG_ICONS)) != 0'i32 - -proc CLIST_DRAW_DRAG_LINE_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_DRAW_DRAG_LINE)) != 0'i32 - -proc CLIST_DRAW_DRAG_RECT_get*(clist: pointer): bool = - result = ((CLIST_FLAGS(clist)) and cint(CLIST_DRAW_DRAG_RECT)) != 0'i32 - -proc CLIST_ROW_get*(glist: PGList): PCListRow = - result = cast[PCListRow](glist.data) - -when false: - proc CELL_TEXT_get*(cell: pointer): PCellText = - result = cast[PCellText](addr((cell))) - - proc CELL_PIXMAP_get*(cell: pointer): PCellPixmap = - result = cast[PCellPixmap](addr((cell))) - - proc CELL_PIXTEXT_get*(cell: pointer): PCellPixText = - result = cast[PCellPixText](addr((cell))) - - proc CELL_WIDGET_get*(cell: pointer): PCellWidget = - result = cast[PCellWidget](addr((cell))) - -proc visible*(a: PCListColumn): guint = - result = (a.flag0 and bm_TGtkCListColumn_visible) shr - bp_TGtkCListColumn_visible - -proc set_visible*(a: PCListColumn, `visible`: guint) = - a.flag0 = a.flag0 or - (int16(`visible` shl bp_TGtkCListColumn_visible) and - bm_TGtkCListColumn_visible) - -proc width_set*(a: PCListColumn): guint = - result = (a.flag0 and bm_TGtkCListColumn_width_set) shr - bp_TGtkCListColumn_width_set - -proc set_width_set*(a: PCListColumn, `width_set`: guint) = - a.flag0 = a.flag0 or - (int16(`width_set` shl bp_TGtkCListColumn_width_set) and - bm_TGtkCListColumn_width_set) - -proc resizeable*(a: PCListColumn): guint = - result = (a.flag0 and bm_TGtkCListColumn_resizeable) shr - bp_TGtkCListColumn_resizeable - -proc set_resizeable*(a: PCListColumn, `resizeable`: guint) = - a.flag0 = a.flag0 or - (int16(`resizeable` shl bp_TGtkCListColumn_resizeable) and - bm_TGtkCListColumn_resizeable) - -proc auto_resize*(a: PCListColumn): guint = - result = (a.flag0 and bm_TGtkCListColumn_auto_resize) shr - bp_TGtkCListColumn_auto_resize - -proc set_auto_resize*(a: PCListColumn, `auto_resize`: guint) = - a.flag0 = a.flag0 or - (int16(`auto_resize` shl bp_TGtkCListColumn_auto_resize) and - bm_TGtkCListColumn_auto_resize) - -proc button_passive*(a: PCListColumn): guint = - result = (a.flag0 and bm_TGtkCListColumn_button_passive) shr - bp_TGtkCListColumn_button_passive - -proc set_button_passive*(a: PCListColumn, `button_passive`: guint) = - a.flag0 = a.flag0 or - (int16(`button_passive` shl bp_TGtkCListColumn_button_passive) and - bm_TGtkCListColumn_button_passive) - -proc fg_set*(a: PCListRow): guint = - result = (a.flag0 and bm_TGtkCListRow_fg_set) shr bp_TGtkCListRow_fg_set - -proc set_fg_set*(a: PCListRow, `fg_set`: guint) = - a.flag0 = a.flag0 or - (int16(`fg_set` shl bp_TGtkCListRow_fg_set) and bm_TGtkCListRow_fg_set) - -proc bg_set*(a: PCListRow): guint = - result = (a.flag0 and bm_TGtkCListRow_bg_set) shr bp_TGtkCListRow_bg_set - -proc set_bg_set*(a: PCListRow, `bg_set`: guint) = - a.flag0 = a.flag0 or - (int16(`bg_set` shl bp_TGtkCListRow_bg_set) and bm_TGtkCListRow_bg_set) - -proc selectable*(a: PCListRow): guint = - result = (a.flag0 and bm_TGtkCListRow_selectable) shr - bp_TGtkCListRow_selectable - -proc set_selectable*(a: PCListRow, `selectable`: guint) = - a.flag0 = a.flag0 or - (int16(`selectable` shl bp_TGtkCListRow_selectable) and - bm_TGtkCListRow_selectable) - -proc TYPE_DIALOG*(): GType = - result = dialog_get_type() - -proc DIALOG*(obj: pointer): PDialog = - result = cast[PDialog](CHECK_CAST(obj, TYPE_DIALOG())) - -proc DIALOG_CLASS*(klass: pointer): PDialogClass = - result = cast[PDialogClass](CHECK_CLASS_CAST(klass, TYPE_DIALOG())) - -proc IS_DIALOG*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_DIALOG()) - -proc IS_DIALOG_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_DIALOG()) - -proc DIALOG_GET_CLASS*(obj: pointer): PDialogClass = - result = cast[PDialogClass](CHECK_GET_CLASS(obj, TYPE_DIALOG())) - -proc TYPE_VBOX*(): GType = - result = vbox_get_type() - -proc VBOX*(obj: pointer): PVBox = - result = cast[PVBox](CHECK_CAST(obj, TYPE_VBOX())) - -proc VBOX_CLASS*(klass: pointer): PVBoxClass = - result = cast[PVBoxClass](CHECK_CLASS_CAST(klass, TYPE_VBOX())) - -proc IS_VBOX*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_VBOX()) - -proc IS_VBOX_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_VBOX()) - -proc VBOX_GET_CLASS*(obj: pointer): PVBoxClass = - result = cast[PVBoxClass](CHECK_GET_CLASS(obj, TYPE_VBOX())) - -proc TYPE_COLOR_SELECTION*(): GType = - result = color_selection_get_type() - -proc COLOR_SELECTION*(obj: pointer): PColorSelection = - result = cast[PColorSelection](CHECK_CAST(obj, TYPE_COLOR_SELECTION())) - -proc COLOR_SELECTION_CLASS*(klass: pointer): PColorSelectionClass = - result = cast[PColorSelectionClass](CHECK_CLASS_CAST(klass, - TYPE_COLOR_SELECTION())) - -proc IS_COLOR_SELECTION*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_COLOR_SELECTION()) - -proc IS_COLOR_SELECTION_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_COLOR_SELECTION()) - -proc COLOR_SELECTION_GET_CLASS*(obj: pointer): PColorSelectionClass = - result = cast[PColorSelectionClass](CHECK_GET_CLASS(obj, - TYPE_COLOR_SELECTION())) - -proc TYPE_COLOR_SELECTION_DIALOG*(): GType = - result = color_selection_dialog_get_type() - -proc COLOR_SELECTION_DIALOG*(obj: pointer): PColorSelectionDialog = - result = cast[PColorSelectionDialog](CHECK_CAST(obj, - TYPE_COLOR_SELECTION_DIALOG())) - -proc COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): PColorSelectionDialogClass = - result = cast[PColorSelectionDialogClass](CHECK_CLASS_CAST(klass, - TYPE_COLOR_SELECTION_DIALOG())) - -proc IS_COLOR_SELECTION_DIALOG*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_COLOR_SELECTION_DIALOG()) - -proc IS_COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_COLOR_SELECTION_DIALOG()) - -proc COLOR_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PColorSelectionDialogClass = - result = cast[PColorSelectionDialogClass](CHECK_GET_CLASS(obj, - TYPE_COLOR_SELECTION_DIALOG())) - -proc TYPE_HBOX*(): GType = - result = hbox_get_type() - -proc HBOX*(obj: pointer): PHBox = - result = cast[PHBox](CHECK_CAST(obj, TYPE_HBOX())) - -proc HBOX_CLASS*(klass: pointer): PHBoxClass = - result = cast[PHBoxClass](CHECK_CLASS_CAST(klass, TYPE_HBOX())) - -proc IS_HBOX*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_HBOX()) - -proc IS_HBOX_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_HBOX()) - -proc HBOX_GET_CLASS*(obj: pointer): PHBoxClass = - result = cast[PHBoxClass](CHECK_GET_CLASS(obj, TYPE_HBOX())) - -proc TYPE_COMBO*(): GType = - result = combo_get_type() - -proc COMBO*(obj: pointer): PCombo = - result = cast[PCombo](CHECK_CAST(obj, TYPE_COMBO())) - -proc COMBO_CLASS*(klass: pointer): PComboClass = - result = cast[PComboClass](CHECK_CLASS_CAST(klass, TYPE_COMBO())) - -proc IS_COMBO*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_COMBO()) - -proc IS_COMBO_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_COMBO()) - -proc COMBO_GET_CLASS*(obj: pointer): PComboClass = - result = cast[PComboClass](CHECK_GET_CLASS(obj, TYPE_COMBO())) - -proc value_in_list*(a: PCombo): guint = - result = (a.Comboflag0 and bm_TGtkCombo_value_in_list) shr - bp_TGtkCombo_value_in_list - -proc set_value_in_list*(a: PCombo, `value_in_list`: guint) = - a.Comboflag0 = a.Comboflag0 or - (int16(`value_in_list` shl bp_TGtkCombo_value_in_list) and - bm_TGtkCombo_value_in_list) - -proc ok_if_empty*(a: PCombo): guint = - result = (a.Comboflag0 and bm_TGtkCombo_ok_if_empty) shr - bp_TGtkCombo_ok_if_empty - -proc set_ok_if_empty*(a: PCombo, `ok_if_empty`: guint) = - a.Comboflag0 = a.Comboflag0 or - (int16(`ok_if_empty` shl bp_TGtkCombo_ok_if_empty) and - bm_TGtkCombo_ok_if_empty) - -proc case_sensitive*(a: PCombo): guint = - result = (a.Comboflag0 and bm_TGtkCombo_case_sensitive) shr - bp_TGtkCombo_case_sensitive - -proc set_case_sensitive*(a: PCombo, `case_sensitive`: guint) = - a.Comboflag0 = a.Comboflag0 or - (int16(`case_sensitive` shl bp_TGtkCombo_case_sensitive) and - bm_TGtkCombo_case_sensitive) - -proc use_arrows*(a: PCombo): guint = - result = (a.Comboflag0 and bm_TGtkCombo_use_arrows) shr - bp_TGtkCombo_use_arrows - -proc set_use_arrows*(a: PCombo, `use_arrows`: guint) = - a.Comboflag0 = a.Comboflag0 or - (int16(`use_arrows` shl bp_TGtkCombo_use_arrows) and - bm_TGtkCombo_use_arrows) - -proc use_arrows_always*(a: PCombo): guint = - result = (a.Comboflag0 and bm_TGtkCombo_use_arrows_always) shr - bp_TGtkCombo_use_arrows_always - -proc set_use_arrows_always*(a: PCombo, `use_arrows_always`: guint) = - a.Comboflag0 = a.Comboflag0 or - (int16(`use_arrows_always` shl bp_TGtkCombo_use_arrows_always) and - bm_TGtkCombo_use_arrows_always) - -proc TYPE_CTREE*(): GType = - result = ctree_get_type() - -proc CTREE*(obj: pointer): PCTree = - result = cast[PCTree](CHECK_CAST(obj, TYPE_CTREE())) - -proc CTREE_CLASS*(klass: pointer): PCTreeClass = - result = cast[PCTreeClass](CHECK_CLASS_CAST(klass, TYPE_CTREE())) - -proc IS_CTREE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CTREE()) - -proc IS_CTREE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CTREE()) - -proc CTREE_GET_CLASS*(obj: pointer): PCTreeClass = - result = cast[PCTreeClass](CHECK_GET_CLASS(obj, TYPE_CTREE())) - -proc CTREE_ROW*(node: TAddress): PCTreeRow = - result = cast[PCTreeRow]((cast[PGList](node)).data) - -proc CTREE_NODE*(node: TAddress): PCTreeNode = - result = cast[PCTreeNode](node) - -proc CTREE_NODE_NEXT*(nnode: TAddress): PCTreeNode = - result = cast[PCTreeNode]((cast[PGList](nnode)).next) - -proc CTREE_NODE_PREV*(pnode: TAddress): PCTreeNode = - result = cast[PCTreeNode]((cast[PGList](pnode)).prev) - -proc CTREE_FUNC*(fun: TAddress): TCTreeFunc = - result = cast[TCTreeFunc](fun) - -proc TYPE_CTREE_NODE*(): GType = - result = ctree_node_get_type() - -proc line_style*(a: PCTree): guint = - result = (a.CTreeflag0 and bm_TGtkCTree_line_style) shr - bp_TGtkCTree_line_style - -proc set_line_style*(a: PCTree, `line_style`: guint) = - a.CTreeflag0 = a.CTreeflag0 or - (int16(`line_style` shl bp_TGtkCTree_line_style) and - bm_TGtkCTree_line_style) - -proc expander_style*(a: PCTree): guint = - result = (a.CTreeflag0 and bm_TGtkCTree_expander_style) shr - bp_TGtkCTree_expander_style - -proc set_expander_style*(a: PCTree, `expander_style`: guint) = - a.CTreeflag0 = a.CTreeflag0 or - (int16(`expander_style` shl bp_TGtkCTree_expander_style) and - bm_TGtkCTree_expander_style) - -proc show_stub*(a: PCTree): guint = - result = (a.CTreeflag0 and bm_TGtkCTree_show_stub) shr - bp_TGtkCTree_show_stub - -proc set_show_stub*(a: PCTree, `show_stub`: guint) = - a.CTreeflag0 = a.CTreeflag0 or - (int16(`show_stub` shl bp_TGtkCTree_show_stub) and - bm_TGtkCTree_show_stub) - -proc is_leaf*(a: PCTreeRow): guint = - result = (a.CTreeRow_flag0 and bm_TGtkCTreeRow_is_leaf) shr - bp_TGtkCTreeRow_is_leaf - -proc set_is_leaf*(a: PCTreeRow, `is_leaf`: guint) = - a.CTreeRow_flag0 = a.CTreeRow_flag0 or - (int16(`is_leaf` shl bp_TGtkCTreeRow_is_leaf) and - bm_TGtkCTreeRow_is_leaf) - -proc expanded*(a: PCTreeRow): guint = - result = (a.CTreeRow_flag0 and bm_TGtkCTreeRow_expanded) shr - bp_TGtkCTreeRow_expanded - -proc set_expanded*(a: PCTreeRow, `expanded`: guint) = - a.CTreeRow_flag0 = a.CTreeRowflag0 or - (int16(`expanded` shl bp_TGtkCTreeRow_expanded) and - bm_TGtkCTreeRow_expanded) - -proc ctree_set_reorderable*(t: pointer, r: bool) = - set_reorderable(cast[PCList](t), r) - -proc TYPE_DRAWING_AREA*(): GType = - result = drawing_area_get_type() - -proc DRAWING_AREA*(obj: pointer): PDrawingArea = - result = cast[PDrawingArea](CHECK_CAST(obj, TYPE_DRAWING_AREA())) - -proc DRAWING_AREA_CLASS*(klass: pointer): PDrawingAreaClass = - result = cast[PDrawingAreaClass](CHECK_CLASS_CAST(klass, TYPE_DRAWING_AREA())) - -proc IS_DRAWING_AREA*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_DRAWING_AREA()) - -proc IS_DRAWING_AREA_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_DRAWING_AREA()) - -proc DRAWING_AREA_GET_CLASS*(obj: pointer): PDrawingAreaClass = - result = cast[PDrawingAreaClass](CHECK_GET_CLASS(obj, TYPE_DRAWING_AREA())) - -proc TYPE_CURVE*(): GType = - result = curve_get_type() - -proc CURVE*(obj: pointer): PCurve = - result = cast[PCurve](CHECK_CAST(obj, TYPE_CURVE())) - -proc CURVE_CLASS*(klass: pointer): PCurveClass = - result = cast[PCurveClass](CHECK_CLASS_CAST(klass, TYPE_CURVE())) - -proc IS_CURVE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_CURVE()) - -proc IS_CURVE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_CURVE()) - -proc CURVE_GET_CLASS*(obj: pointer): PCurveClass = - result = cast[PCurveClass](CHECK_GET_CLASS(obj, TYPE_CURVE())) - -proc TYPE_EDITABLE*(): GType = - result = editable_get_type() - -proc EDITABLE*(obj: pointer): PEditable = - result = cast[PEditable](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_EDITABLE())) - -proc EDITABLE_CLASS*(vtable: pointer): PEditableClass = - result = cast[PEditableClass](G_TYPE_CHECK_CLASS_CAST(vtable, TYPE_EDITABLE())) - -proc IS_EDITABLE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_EDITABLE()) - -proc IS_EDITABLE_CLASS*(vtable: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(vtable, TYPE_EDITABLE()) - -proc EDITABLE_GET_CLASS*(inst: pointer): PEditableClass = - result = cast[PEditableClass](G_TYPE_INSTANCE_GET_INTERFACE(inst, - TYPE_EDITABLE())) - -proc TYPE_IM_CONTEXT*(): GType = - result = im_context_get_type() - -proc IM_CONTEXT*(obj: pointer): PIMContext = - result = cast[PIMContext](CHECK_CAST(obj, TYPE_IM_CONTEXT())) - -proc IM_CONTEXT_CLASS*(klass: pointer): PIMContextClass = - result = cast[PIMContextClass](CHECK_CLASS_CAST(klass, TYPE_IM_CONTEXT())) - -proc IS_IM_CONTEXT*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_IM_CONTEXT()) - -proc IS_IM_CONTEXT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_IM_CONTEXT()) - -proc IM_CONTEXT_GET_CLASS*(obj: pointer): PIMContextClass = - result = cast[PIMContextClass](CHECK_GET_CLASS(obj, TYPE_IM_CONTEXT())) - -proc TYPE_MENU_SHELL*(): GType = - result = menu_shell_get_type() - -proc MENU_SHELL*(obj: pointer): PMenuShell = - result = cast[PMenuShell](CHECK_CAST(obj, TYPE_MENU_SHELL())) - -proc MENU_SHELL_CLASS*(klass: pointer): PMenuShellClass = - result = cast[PMenuShellClass](CHECK_CLASS_CAST(klass, TYPE_MENU_SHELL())) - -proc IS_MENU_SHELL*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_MENU_SHELL()) - -proc IS_MENU_SHELL_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_MENU_SHELL()) - -proc MENU_SHELL_GET_CLASS*(obj: pointer): PMenuShellClass = - result = cast[PMenuShellClass](CHECK_GET_CLASS(obj, TYPE_MENU_SHELL())) - -proc active*(a: PMenuShell): guint = - result = (a.MenuShellflag0 and bm_TGtkMenuShell_active) shr - bp_TGtkMenuShell_active - -proc set_active*(a: PMenuShell, `active`: guint) = - a.MenuShellflag0 = a.MenuShellflag0 or - (int16(`active` shl bp_TGtkMenuShell_active) and - bm_TGtkMenuShell_active) - -proc have_grab*(a: PMenuShell): guint = - result = (a.MenuShellflag0 and bm_TGtkMenuShell_have_grab) shr - bp_TGtkMenuShell_have_grab - -proc set_have_grab*(a: PMenuShell, `have_grab`: guint) = - a.MenuShellflag0 = a.MenuShellflag0 or - (int16(`have_grab` shl bp_TGtkMenuShell_have_grab) and - bm_TGtkMenuShell_have_grab) - -proc have_xgrab*(a: PMenuShell): guint = - result = (a.MenuShellflag0 and bm_TGtkMenuShell_have_xgrab) shr - bp_TGtkMenuShell_have_xgrab - -proc set_have_xgrab*(a: PMenuShell, `have_xgrab`: guint) = - a.MenuShellflag0 = a.MenuShellflag0 or - (int16(`have_xgrab` shl bp_TGtkMenuShell_have_xgrab) and - bm_TGtkMenuShell_have_xgrab) - -proc ignore_leave*(a: PMenuShell): guint = - result = (a.MenuShellflag0 and bm_TGtkMenuShell_ignore_leave) shr - bp_TGtkMenuShell_ignore_leave - -proc set_ignore_leave*(a: PMenuShell, `ignore_leave`: guint) = - a.MenuShellflag0 = a.MenuShellflag0 or - (int16(`ignore_leave` shl bp_TGtkMenuShell_ignore_leave) and - bm_TGtkMenuShell_ignore_leave) - -proc menu_flag*(a: PMenuShell): guint = - result = (a.MenuShellflag0 and bm_TGtkMenuShell_menu_flag) shr - bp_TGtkMenuShell_menu_flag - -proc set_menu_flag*(a: PMenuShell, `menu_flag`: guint) = - a.MenuShellflag0 = a.MenuShellflag0 or - (int16(`menu_flag` shl bp_TGtkMenuShell_menu_flag) and - bm_TGtkMenuShell_menu_flag) - -proc ignore_enter*(a: PMenuShell): guint = - result = (a.MenuShellflag0 and bm_TGtkMenuShell_ignore_enter) shr - bp_TGtkMenuShell_ignore_enter - -proc set_ignore_enter*(a: PMenuShell, `ignore_enter`: guint) = - a.MenuShellflag0 = a.MenuShellflag0 or - (int16(`ignore_enter` shl bp_TGtkMenuShell_ignore_enter) and - bm_TGtkMenuShell_ignore_enter) - -proc submenu_placement*(a: PMenuShellClass): guint = - result = (a.MenuShellClassflag0 and bm_TGtkMenuShellClass_submenu_placement) shr - bp_TGtkMenuShellClass_submenu_placement - -proc set_submenu_placement*(a: PMenuShellClass, `submenu_placement`: guint) = - a.MenuShellClassflag0 = a.MenuShellClassflag0 or - (int16(`submenu_placement` shl bp_TGtkMenuShellClass_submenu_placement) and - bm_TGtkMenuShellClass_submenu_placement) - -proc TYPE_MENU*(): GType = - result = menu_get_type() - -proc MENU*(obj: pointer): PMenu = - result = cast[PMenu](CHECK_CAST(obj, TYPE_MENU())) - -proc MENU_CLASS*(klass: pointer): PMenuClass = - result = cast[PMenuClass](CHECK_CLASS_CAST(klass, TYPE_MENU())) - -proc IS_MENU*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_MENU()) - -proc IS_MENU_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_MENU()) - -proc MENU_GET_CLASS*(obj: pointer): PMenuClass = - result = cast[PMenuClass](CHECK_GET_CLASS(obj, TYPE_MENU())) - -proc needs_destruction_ref_count*(a: PMenu): guint = - result = (a.Menuflag0 and bm_TGtkMenu_needs_destruction_ref_count) shr - bp_TGtkMenu_needs_destruction_ref_count - -proc set_needs_destruction_ref_count*(a: PMenu, - `needs_destruction_ref_count`: guint) = - a.Menuflag0 = a.Menuflag0 or - (int16(`needs_destruction_ref_count` shl - bp_TGtkMenu_needs_destruction_ref_count) and - bm_TGtkMenu_needs_destruction_ref_count) - -proc torn_off*(a: PMenu): guint = - result = (a.Menuflag0 and bm_TGtkMenu_torn_off) shr bp_TGtkMenu_torn_off - -proc set_torn_off*(a: PMenu, `torn_off`: guint) = - a.Menuflag0 = a.Menuflag0 or - (int16(`torn_off` shl bp_TGtkMenu_torn_off) and bm_TGtkMenu_torn_off) - -proc tearoff_active*(a: PMenu): guint = - result = (a.Menuflag0 and bm_TGtkMenu_tearoff_active) shr - bp_TGtkMenu_tearoff_active - -proc set_tearoff_active*(a: PMenu, `tearoff_active`: guint) = - a.Menuflag0 = a.Menuflag0 or - (int16(`tearoff_active` shl bp_TGtkMenu_tearoff_active) and - bm_TGtkMenu_tearoff_active) - -proc scroll_fast*(a: PMenu): guint = - result = (a.Menuflag0 and bm_TGtkMenu_scroll_fast) shr - bp_TGtkMenu_scroll_fast - -proc set_scroll_fast*(a: PMenu, `scroll_fast`: guint) = - a.Menuflag0 = a.Menuflag0 or - (int16(`scroll_fast` shl bp_TGtkMenu_scroll_fast) and - bm_TGtkMenu_scroll_fast) - -proc upper_arrow_visible*(a: PMenu): guint = - result = (a.Menuflag0 and bm_TGtkMenu_upper_arrow_visible) shr - bp_TGtkMenu_upper_arrow_visible - -proc set_upper_arrow_visible*(a: PMenu, `upper_arrow_visible`: guint) = - a.Menuflag0 = a.Menuflag0 or - (int16(`upper_arrow_visible` shl bp_TGtkMenu_upper_arrow_visible) and - bm_TGtkMenu_upper_arrow_visible) - -proc lower_arrow_visible*(a: PMenu): guint = - result = (a.Menuflag0 and bm_TGtkMenu_lower_arrow_visible) shr - bp_TGtkMenu_lower_arrow_visible - -proc set_lower_arrow_visible*(a: PMenu, `lower_arrow_visible`: guint) = - a.Menuflag0 = a.Menuflag0 or - (int16(`lower_arrow_visible` shl bp_TGtkMenu_lower_arrow_visible) and - bm_TGtkMenu_lower_arrow_visible) - -proc upper_arrow_prelight*(a: PMenu): guint = - result = (a.Menuflag0 and bm_TGtkMenu_upper_arrow_prelight) shr - bp_TGtkMenu_upper_arrow_prelight - -proc set_upper_arrow_prelight*(a: PMenu, `upper_arrow_prelight`: guint) = - a.Menuflag0 = a.Menuflag0 or - (int16(`upper_arrow_prelight` shl bp_TGtkMenu_upper_arrow_prelight) and - bm_TGtkMenu_upper_arrow_prelight) - -proc lower_arrow_prelight*(a: PMenu): guint = - result = (a.Menuflag0 and bm_TGtkMenu_lower_arrow_prelight) shr - bp_TGtkMenu_lower_arrow_prelight - -proc set_lower_arrow_prelight*(a: PMenu, `lower_arrow_prelight`: guint) = - a.Menuflag0 = a.Menuflag0 or - (int16(`lower_arrow_prelight` shl bp_TGtkMenu_lower_arrow_prelight) and - bm_TGtkMenu_lower_arrow_prelight) - -proc menu_append*(menu, child: PWidget) = - append(cast[PMenuShell](menu), child) - -proc menu_prepend*(menu, child: PWidget) = - prepend(cast[PMenuShell](menu), child) - -proc menu_insert*(menu, child: PWidget, pos: gint) = - insert(cast[PMenuShell](menu), child, pos) - -proc TYPE_ENTRY*(): GType = - result = entry_get_type() - -proc ENTRY*(obj: pointer): PEntry = - result = cast[PEntry](CHECK_CAST(obj, TYPE_ENTRY())) - -proc ENTRY_CLASS*(klass: pointer): PEntryClass = - result = cast[PEntryClass](CHECK_CLASS_CAST(klass, TYPE_ENTRY())) - -proc IS_ENTRY*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_ENTRY()) - -proc IS_ENTRY_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ENTRY()) - -proc ENTRY_GET_CLASS*(obj: pointer): PEntryClass = - result = cast[PEntryClass](CHECK_GET_CLASS(obj, TYPE_ENTRY())) - -proc editable*(a: PEntry): guint = - result = (a.Entryflag0 and bm_TGtkEntry_editable) shr bp_TGtkEntry_editable - -proc set_editable*(a: PEntry, `editable`: guint) = - a.Entryflag0 = a.Entryflag0 or - (int16(`editable` shl bp_TGtkEntry_editable) and bm_TGtkEntry_editable) - -proc visible*(a: PEntry): guint = - result = (a.Entryflag0 and bm_TGtkEntry_visible) shr bp_TGtkEntry_visible - -proc set_visible*(a: PEntry, `visible`: guint) = - a.Entryflag0 = a.Entryflag0 or - (int16(`visible` shl bp_TGtkEntry_visible) and bm_TGtkEntry_visible) - -proc overwrite_mode*(a: PEntry): guint = - result = (a.Entryflag0 and bm_TGtkEntry_overwrite_mode) shr - bp_TGtkEntry_overwrite_mode - -proc set_overwrite_mode*(a: PEntry, `overwrite_mode`: guint) = - a.Entryflag0 = a.Entryflag0 or - (int16(`overwrite_mode` shl bp_TGtkEntry_overwrite_mode) and - bm_TGtkEntry_overwrite_mode) - -proc in_drag*(a: PEntry): guint = - result = (a.Entryflag0 and bm_TGtkEntry_in_drag) shr bp_TGtkEntry_in_drag - -proc set_in_drag*(a: PEntry, `in_drag`: guint) = - a.Entryflag0 = a.Entryflag0 or - (int16(`in_drag` shl bp_TGtkEntry_in_drag) and bm_TGtkEntry_in_drag) - -proc cache_includes_preedit*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_cache_includes_preedit) shr - bp_TGtkEntry_cache_includes_preedit - -proc set_cache_includes_preedit*(a: PEntry, `cache_includes_preedit`: guint) = - a.flag1 = a.flag1 or - (int16(`cache_includes_preedit` shl bp_TGtkEntry_cache_includes_preedit) and - bm_TGtkEntry_cache_includes_preedit) - -proc need_im_reset*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_need_im_reset) shr - bp_TGtkEntry_need_im_reset - -proc set_need_im_reset*(a: PEntry, `need_im_reset`: guint) = - a.flag1 = a.flag1 or - (int16(`need_im_reset` shl bp_TGtkEntry_need_im_reset) and - bm_TGtkEntry_need_im_reset) - -proc has_frame*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_has_frame) shr bp_TGtkEntry_has_frame - -proc set_has_frame*(a: PEntry, `has_frame`: guint) = - a.flag1 = a.flag1 or - (int16(`has_frame` shl bp_TGtkEntry_has_frame) and - bm_TGtkEntry_has_frame) - -proc activates_default*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_activates_default) shr - bp_TGtkEntry_activates_default - -proc set_activates_default*(a: PEntry, `activates_default`: guint) = - a.flag1 = a.flag1 or - (int16(`activates_default` shl bp_TGtkEntry_activates_default) and - bm_TGtkEntry_activates_default) - -proc cursor_visible*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_cursor_visible) shr - bp_TGtkEntry_cursor_visible - -proc set_cursor_visible*(a: PEntry, `cursor_visible`: guint) = - a.flag1 = a.flag1 or - (int16(`cursor_visible` shl bp_TGtkEntry_cursor_visible) and - bm_TGtkEntry_cursor_visible) - -proc in_click*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_in_click) shr bp_TGtkEntry_in_click - -proc set_in_click*(a: PEntry, `in_click`: guint) = - a.flag1 = a.flag1 or - (int16(`in_click` shl bp_TGtkEntry_in_click) and bm_TGtkEntry_in_click) - -proc is_cell_renderer*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_is_cell_renderer) shr - bp_TGtkEntry_is_cell_renderer - -proc set_is_cell_renderer*(a: PEntry, `is_cell_renderer`: guint) = - a.flag1 = a.flag1 or - (int16(`is_cell_renderer` shl bp_TGtkEntry_is_cell_renderer) and - bm_TGtkEntry_is_cell_renderer) - -proc editing_canceled*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_editing_canceled) shr - bp_TGtkEntry_editing_canceled - -proc set_editing_canceled*(a: PEntry, `editing_canceled`: guint) = - a.flag1 = a.flag1 or - (int16(`editing_canceled` shl bp_TGtkEntry_editing_canceled) and - bm_TGtkEntry_editing_canceled) - -proc mouse_cursor_obscured*(a: PEntry): guint = - result = (a.flag1 and bm_TGtkEntry_mouse_cursor_obscured) shr - bp_TGtkEntry_mouse_cursor_obscured - -proc set_mouse_cursor_obscured*(a: PEntry, `mouse_cursor_obscured`: guint) = - a.flag1 = a.flag1 or - (int16(`mouse_cursor_obscured` shl bp_TGtkEntry_mouse_cursor_obscured) and - bm_TGtkEntry_mouse_cursor_obscured) - -proc TYPE_EVENT_BOX*(): GType = - result = event_box_get_type() - -proc EVENT_BOX*(obj: pointer): PEventBox = - result = cast[PEventBox](CHECK_CAST(obj, TYPE_EVENT_BOX())) - -proc EVENT_BOX_CLASS*(klass: pointer): PEventBoxClass = - result = cast[PEventBoxClass](CHECK_CLASS_CAST(klass, TYPE_EVENT_BOX())) - -proc IS_EVENT_BOX*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_EVENT_BOX()) - -proc IS_EVENT_BOX_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_EVENT_BOX()) - -proc EVENT_BOX_GET_CLASS*(obj: pointer): PEventBoxClass = - result = cast[PEventBoxClass](CHECK_GET_CLASS(obj, TYPE_EVENT_BOX())) - -proc TYPE_FILE_SELECTION*(): GType = - result = file_selection_get_type() - -proc FILE_SELECTION*(obj: pointer): PFileSelection = - result = cast[PFileSelection](CHECK_CAST(obj, TYPE_FILE_SELECTION())) - -proc FILE_SELECTION_CLASS*(klass: pointer): PFileSelectionClass = - result = cast[PFileSelectionClass](CHECK_CLASS_CAST(klass, - TYPE_FILE_SELECTION())) - -proc IS_FILE_SELECTION*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_FILE_SELECTION()) - -proc IS_FILE_SELECTION_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_FILE_SELECTION()) - -proc FILE_SELECTION_GET_CLASS*(obj: pointer): PFileSelectionClass = - result = cast[PFileSelectionClass](CHECK_GET_CLASS(obj, TYPE_FILE_SELECTION())) - -proc TYPE_FIXED*(): GType = - result = fixed_get_type() - -proc FIXED*(obj: pointer): PFixed = - result = cast[PFixed](CHECK_CAST(obj, TYPE_FIXED())) - -proc FIXED_CLASS*(klass: pointer): PFixedClass = - result = cast[PFixedClass](CHECK_CLASS_CAST(klass, TYPE_FIXED())) - -proc IS_FIXED*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_FIXED()) - -proc IS_FIXED_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_FIXED()) - -proc FIXED_GET_CLASS*(obj: pointer): PFixedClass = - result = cast[PFixedClass](CHECK_GET_CLASS(obj, TYPE_FIXED())) - -proc TYPE_FONT_SELECTION*(): GType = - result = font_selection_get_type() - -proc FONT_SELECTION*(obj: pointer): PFontSelection = - result = cast[PFontSelection](CHECK_CAST(obj, TYPE_FONT_SELECTION())) - -proc FONT_SELECTION_CLASS*(klass: pointer): PFontSelectionClass = - result = cast[PFontSelectionClass](CHECK_CLASS_CAST(klass, - TYPE_FONT_SELECTION())) - -proc IS_FONT_SELECTION*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_FONT_SELECTION()) - -proc IS_FONT_SELECTION_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_FONT_SELECTION()) - -proc FONT_SELECTION_GET_CLASS*(obj: pointer): PFontSelectionClass = - result = cast[PFontSelectionClass](CHECK_GET_CLASS(obj, TYPE_FONT_SELECTION())) - -proc TYPE_FONT_SELECTION_DIALOG*(): GType = - result = font_selection_dialog_get_type() - -proc FONT_SELECTION_DIALOG*(obj: pointer): PFontSelectionDialog = - result = cast[PFontSelectionDialog](CHECK_CAST(obj, - TYPE_FONT_SELECTION_DIALOG())) - -proc FONT_SELECTION_DIALOG_CLASS*(klass: pointer): PFontSelectionDialogClass = - result = cast[PFontSelectionDialogClass](CHECK_CLASS_CAST(klass, - TYPE_FONT_SELECTION_DIALOG())) - -proc IS_FONT_SELECTION_DIALOG*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_FONT_SELECTION_DIALOG()) - -proc IS_FONT_SELECTION_DIALOG_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_FONT_SELECTION_DIALOG()) - -proc FONT_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PFontSelectionDialogClass = - result = cast[PFontSelectionDialogClass](CHECK_GET_CLASS(obj, - TYPE_FONT_SELECTION_DIALOG())) - -proc TYPE_GAMMA_CURVE*(): GType = - result = gamma_curve_get_type() - -proc GAMMA_CURVE*(obj: pointer): PGammaCurve = - result = cast[PGammaCurve](CHECK_CAST(obj, TYPE_GAMMA_CURVE())) - -proc GAMMA_CURVE_CLASS*(klass: pointer): PGammaCurveClass = - result = cast[PGammaCurveClass](CHECK_CLASS_CAST(klass, TYPE_GAMMA_CURVE())) - -proc IS_GAMMA_CURVE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_GAMMA_CURVE()) - -proc IS_GAMMA_CURVE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_GAMMA_CURVE()) - -proc GAMMA_CURVE_GET_CLASS*(obj: pointer): PGammaCurveClass = - result = cast[PGammaCurveClass](CHECK_GET_CLASS(obj, TYPE_GAMMA_CURVE())) - -proc TYPE_HANDLE_BOX*(): GType = - result = handle_box_get_type() - -proc HANDLE_BOX*(obj: pointer): PHandleBox = - result = cast[PHandleBox](CHECK_CAST(obj, TYPE_HANDLE_BOX())) - -proc HANDLE_BOX_CLASS*(klass: pointer): PHandleBoxClass = - result = cast[PHandleBoxClass](CHECK_CLASS_CAST(klass, TYPE_HANDLE_BOX())) - -proc IS_HANDLE_BOX*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_HANDLE_BOX()) - -proc IS_HANDLE_BOX_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_HANDLE_BOX()) - -proc HANDLE_BOX_GET_CLASS*(obj: pointer): PHandleBoxClass = - result = cast[PHandleBoxClass](CHECK_GET_CLASS(obj, TYPE_HANDLE_BOX())) - -proc handle_position*(a: PHandleBox): guint = - result = (a.HandleBoxflag0 and bm_TGtkHandleBox_handle_position) shr - bp_TGtkHandleBox_handle_position - -proc set_handle_position*(a: PHandleBox, `handle_position`: guint) = - a.HandleBoxflag0 = a.HandleBoxflag0 or - (int16(`handle_position` shl bp_TGtkHandleBox_handle_position) and - bm_TGtkHandleBox_handle_position) - -proc float_window_mapped*(a: PHandleBox): guint = - result = (a.HandleBoxflag0 and bm_TGtkHandleBox_float_window_mapped) shr - bp_TGtkHandleBox_float_window_mapped - -proc set_float_window_mapped*(a: PHandleBox, `float_window_mapped`: guint) = - a.HandleBoxflag0 = a.HandleBoxflag0 or - (int16(`float_window_mapped` shl bp_TGtkHandleBox_float_window_mapped) and - bm_TGtkHandleBox_float_window_mapped) - -proc child_detached*(a: PHandleBox): guint = - result = (a.HandleBoxflag0 and bm_TGtkHandleBox_child_detached) shr - bp_TGtkHandleBox_child_detached - -proc set_child_detached*(a: PHandleBox, `child_detached`: guint) = - a.HandleBoxflag0 = a.HandleBoxflag0 or - (int16(`child_detached` shl bp_TGtkHandleBox_child_detached) and - bm_TGtkHandleBox_child_detached) - -proc in_drag*(a: PHandleBox): guint = - result = (a.HandleBoxflag0 and bm_TGtkHandleBox_in_drag) shr - bp_TGtkHandleBox_in_drag - -proc set_in_drag*(a: PHandleBox, `in_drag`: guint) = - a.HandleBoxflag0 = a.HandleBoxflag0 or - (int16(`in_drag` shl bp_TGtkHandleBox_in_drag) and - bm_TGtkHandleBox_in_drag) - -proc shrink_on_detach*(a: PHandleBox): guint = - result = (a.HandleBoxflag0 and bm_TGtkHandleBox_shrink_on_detach) shr - bp_TGtkHandleBox_shrink_on_detach - -proc set_shrink_on_detach*(a: PHandleBox, `shrink_on_detach`: guint) = - a.HandleBoxflag0 = a.HandleBoxflag0 or - (int16(`shrink_on_detach` shl bp_TGtkHandleBox_shrink_on_detach) and - bm_TGtkHandleBox_shrink_on_detach) - -proc snap_edge*(a: PHandleBox): gint = - result = (a.HandleBoxflag0 and bm_TGtkHandleBox_snap_edge) shr - bp_TGtkHandleBox_snap_edge - -proc set_snap_edge*(a: PHandleBox, `snap_edge`: gint) = - a.HandleBoxflag0 = a.HandleBoxflag0 or - (int16(`snap_edge` shl bp_TGtkHandleBox_snap_edge) and - bm_TGtkHandleBox_snap_edge) - -proc TYPE_PANED*(): GType = - result = paned_get_type() - -proc PANED*(obj: pointer): PPaned = - result = cast[PPaned](CHECK_CAST(obj, TYPE_PANED())) - -proc PANED_CLASS*(klass: pointer): PPanedClass = - result = cast[PPanedClass](CHECK_CLASS_CAST(klass, TYPE_PANED())) - -proc IS_PANED*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_PANED()) - -proc IS_PANED_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_PANED()) - -proc PANED_GET_CLASS*(obj: pointer): PPanedClass = - result = cast[PPanedClass](CHECK_GET_CLASS(obj, TYPE_PANED())) - -proc position_set*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_position_set) shr - bp_TGtkPaned_position_set - -proc set_position_set*(a: PPaned, `position_set`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`position_set` shl bp_TGtkPaned_position_set) and - bm_TGtkPaned_position_set) - -proc in_drag*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_in_drag) shr bp_TGtkPaned_in_drag - -proc set_in_drag*(a: PPaned, `in_drag`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`in_drag` shl bp_TGtkPaned_in_drag) and bm_TGtkPaned_in_drag) - -proc child1_shrink*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_child1_shrink) shr - bp_TGtkPaned_child1_shrink - -proc set_child1_shrink*(a: PPaned, `child1_shrink`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`child1_shrink` shl bp_TGtkPaned_child1_shrink) and - bm_TGtkPaned_child1_shrink) - -proc child1_resize*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_child1_resize) shr - bp_TGtkPaned_child1_resize - -proc set_child1_resize*(a: PPaned, `child1_resize`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`child1_resize` shl bp_TGtkPaned_child1_resize) and - bm_TGtkPaned_child1_resize) - -proc child2_shrink*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_child2_shrink) shr - bp_TGtkPaned_child2_shrink - -proc set_child2_shrink*(a: PPaned, `child2_shrink`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`child2_shrink` shl bp_TGtkPaned_child2_shrink) and - bm_TGtkPaned_child2_shrink) - -proc child2_resize*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_child2_resize) shr - bp_TGtkPaned_child2_resize - -proc set_child2_resize*(a: PPaned, `child2_resize`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`child2_resize` shl bp_TGtkPaned_child2_resize) and - bm_TGtkPaned_child2_resize) - -proc orientation*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_orientation) shr - bp_TGtkPaned_orientation - -proc set_orientation*(a: PPaned, `orientation`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`orientation` shl bp_TGtkPaned_orientation) and - bm_TGtkPaned_orientation) - -proc in_recursion*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_in_recursion) shr - bp_TGtkPaned_in_recursion - -proc set_in_recursion*(a: PPaned, `in_recursion`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`in_recursion` shl bp_TGtkPaned_in_recursion) and - bm_TGtkPaned_in_recursion) - -proc handle_prelit*(a: PPaned): guint = - result = (a.Panedflag0 and bm_TGtkPaned_handle_prelit) shr - bp_TGtkPaned_handle_prelit - -proc set_handle_prelit*(a: PPaned, `handle_prelit`: guint) = - a.Panedflag0 = a.Panedflag0 or - (int16(`handle_prelit` shl bp_TGtkPaned_handle_prelit) and - bm_TGtkPaned_handle_prelit) - -proc paned_gutter_size*(p: pointer, s: gint) = - if (p != nil) and (s != 0'i32): nil - -proc paned_set_gutter_size*(p: pointer, s: gint) = - if (p != nil) and (s != 0'i32): nil - -proc TYPE_HBUTTON_BOX*(): GType = - result = hbutton_box_get_type() - -proc HBUTTON_BOX*(obj: pointer): PHButtonBox = - result = cast[PHButtonBox](CHECK_CAST(obj, TYPE_HBUTTON_BOX())) - -proc HBUTTON_BOX_CLASS*(klass: pointer): PHButtonBoxClass = - result = cast[PHButtonBoxClass](CHECK_CLASS_CAST(klass, TYPE_HBUTTON_BOX())) - -proc IS_HBUTTON_BOX*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_HBUTTON_BOX()) - -proc IS_HBUTTON_BOX_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_HBUTTON_BOX()) - -proc HBUTTON_BOX_GET_CLASS*(obj: pointer): PHButtonBoxClass = - result = cast[PHButtonBoxClass](CHECK_GET_CLASS(obj, TYPE_HBUTTON_BOX())) - -proc TYPE_HPANED*(): GType = - result = hpaned_get_type() - -proc HPANED*(obj: pointer): PHPaned = - result = cast[PHPaned](CHECK_CAST(obj, TYPE_HPANED())) - -proc HPANED_CLASS*(klass: pointer): PHPanedClass = - result = cast[PHPanedClass](CHECK_CLASS_CAST(klass, TYPE_HPANED())) - -proc IS_HPANED*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_HPANED()) - -proc IS_HPANED_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_HPANED()) - -proc HPANED_GET_CLASS*(obj: pointer): PHPanedClass = - result = cast[PHPanedClass](CHECK_GET_CLASS(obj, TYPE_HPANED())) - -proc TYPE_RULER*(): GType = - result = ruler_get_type() - -proc RULER*(obj: pointer): PRuler = - result = cast[PRuler](CHECK_CAST(obj, TYPE_RULER())) - -proc RULER_CLASS*(klass: pointer): PRulerClass = - result = cast[PRulerClass](CHECK_CLASS_CAST(klass, TYPE_RULER())) - -proc IS_RULER*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_RULER()) - -proc IS_RULER_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_RULER()) - -proc RULER_GET_CLASS*(obj: pointer): PRulerClass = - result = cast[PRulerClass](CHECK_GET_CLASS(obj, TYPE_RULER())) - -proc TYPE_HRULER*(): GType = - result = hruler_get_type() - -proc HRULER*(obj: pointer): PHRuler = - result = cast[PHRuler](CHECK_CAST(obj, TYPE_HRULER())) - -proc HRULER_CLASS*(klass: pointer): PHRulerClass = - result = cast[PHRulerClass](CHECK_CLASS_CAST(klass, TYPE_HRULER())) - -proc IS_HRULER*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_HRULER()) - -proc IS_HRULER_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_HRULER()) - -proc HRULER_GET_CLASS*(obj: pointer): PHRulerClass = - result = cast[PHRulerClass](CHECK_GET_CLASS(obj, TYPE_HRULER())) - -proc TYPE_SETTINGS*(): GType = - result = settings_get_type() - -proc SETTINGS*(obj: pointer): PSettings = - result = cast[PSettings](CHECK_CAST(obj, TYPE_SETTINGS())) - -proc SETTINGS_CLASS*(klass: pointer): PSettingsClass = - result = cast[PSettingsClass](CHECK_CLASS_CAST(klass, TYPE_SETTINGS())) - -proc IS_SETTINGS*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SETTINGS()) - -proc IS_SETTINGS_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SETTINGS()) - -proc SETTINGS_GET_CLASS*(obj: pointer): PSettingsClass = - result = cast[PSettingsClass](CHECK_GET_CLASS(obj, TYPE_SETTINGS())) - -proc TYPE_RC_STYLE*(): GType = - result = rc_style_get_type() - -proc RC_STYLE_get*(anObject: pointer): PRcStyle = - result = cast[PRcStyle](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_RC_STYLE())) - -proc RC_STYLE_CLASS*(klass: pointer): PRcStyleClass = - result = cast[PRcStyleClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_RC_STYLE())) - -proc IS_RC_STYLE*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_RC_STYLE()) - -proc IS_RC_STYLE_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_RC_STYLE()) - -proc RC_STYLE_GET_CLASS*(obj: pointer): PRcStyleClass = - result = cast[PRcStyleClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_RC_STYLE())) - -proc engine_specified*(a: PRcStyle): guint = - result = (a.RcStyleflag0 and bm_TGtkRcStyle_engine_specified) shr - bp_TGtkRcStyle_engine_specified - -proc set_engine_specified*(a: PRcStyle, `engine_specified`: guint) = - a.RcStyleflag0 = a.RcStyleflag0 or - (int16(`engine_specified` shl bp_TGtkRcStyle_engine_specified) and - bm_TGtkRcStyle_engine_specified) - -proc TYPE_STYLE*(): GType = - result = style_get_type() - -proc STYLE*(anObject: pointer): PStyle = - result = cast[PStyle](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_STYLE())) - -proc STYLE_CLASS*(klass: pointer): PStyleClass = - result = cast[PStyleClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_STYLE())) - -proc IS_STYLE*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_STYLE()) - -proc IS_STYLE_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_STYLE()) - -proc STYLE_GET_CLASS*(obj: pointer): PStyleClass = - result = cast[PStyleClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_STYLE())) - -proc TYPE_BORDER*(): GType = - result = border_get_type() - -proc STYLE_ATTACHED*(style: pointer): bool = - result = ((STYLE(style)).attach_count) > 0'i32 - -proc apply_default_pixmap*(style: PStyle, window: gdk2.PWindow, - state_type: TStateType, area: gdk2.PRectangle, - x: gint, y: gint, width: gint, height: gint) = - apply_default_background(style, window, true, state_type, area, x, y, - width, height) - -proc TYPE_RANGE*(): GType = - result = range_get_type() - -proc RANGE*(obj: pointer): PRange = - result = cast[PRange](CHECK_CAST(obj, TYPE_RANGE())) - -proc RANGE_CLASS*(klass: pointer): PRangeClass = - result = cast[PRangeClass](CHECK_CLASS_CAST(klass, TYPE_RANGE())) - -proc IS_RANGE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_RANGE()) - -proc IS_RANGE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_RANGE()) - -proc RANGE_GET_CLASS*(obj: pointer): PRangeClass = - result = cast[PRangeClass](CHECK_GET_CLASS(obj, TYPE_RANGE())) - -proc inverted*(a: PRange): guint = - result = (a.Rangeflag0 and bm_TGtkRange_inverted) shr bp_TGtkRange_inverted - -proc set_inverted*(a: PRange, `inverted`: guint) = - a.Rangeflag0 = a.Rangeflag0 or - (int16(`inverted` shl bp_TGtkRange_inverted) and bm_TGtkRange_inverted) - -proc flippable*(a: PRange): guint = - result = (a.Rangeflag0 and bm_TGtkRange_flippable) shr - bp_TGtkRange_flippable - -proc set_flippable*(a: PRange, `flippable`: guint) = - a.Rangeflag0 = a.Rangeflag0 or - (int16(`flippable` shl bp_TGtkRange_flippable) and - bm_TGtkRange_flippable) - -proc has_stepper_a*(a: PRange): guint = - result = (a.Rangeflag0 and bm_TGtkRange_has_stepper_a) shr - bp_TGtkRange_has_stepper_a - -proc set_has_stepper_a*(a: PRange, `has_stepper_a`: guint) = - a.Rangeflag0 = a.Rangeflag0 or - (int16(`has_stepper_a` shl bp_TGtkRange_has_stepper_a) and - bm_TGtkRange_has_stepper_a) - -proc has_stepper_b*(a: PRange): guint = - result = (a.Rangeflag0 and bm_TGtkRange_has_stepper_b) shr - bp_TGtkRange_has_stepper_b - -proc set_has_stepper_b*(a: PRange, `has_stepper_b`: guint) = - a.Rangeflag0 = a.Rangeflag0 or - (int16(`has_stepper_b` shl bp_TGtkRange_has_stepper_b) and - bm_TGtkRange_has_stepper_b) - -proc has_stepper_c*(a: PRange): guint = - result = (a.Rangeflag0 and bm_TGtkRange_has_stepper_c) shr - bp_TGtkRange_has_stepper_c - -proc set_has_stepper_c*(a: PRange, `has_stepper_c`: guint) = - a.Rangeflag0 = a.Rangeflag0 or - (int16(`has_stepper_c` shl bp_TGtkRange_has_stepper_c) and - bm_TGtkRange_has_stepper_c) - -proc has_stepper_d*(a: PRange): guint = - result = (a.Rangeflag0 and bm_TGtkRange_has_stepper_d) shr - bp_TGtkRange_has_stepper_d - -proc set_has_stepper_d*(a: PRange, `has_stepper_d`: guint) = - a.Rangeflag0 = a.Rangeflag0 or - (int16(`has_stepper_d` shl bp_TGtkRange_has_stepper_d) and - bm_TGtkRange_has_stepper_d) - -proc need_recalc*(a: PRange): guint = - result = (a.Rangeflag0 and bm_TGtkRange_need_recalc) shr - bp_TGtkRange_need_recalc - -proc set_need_recalc*(a: PRange, `need_recalc`: guint) = - a.Rangeflag0 = a.Rangeflag0 or - (int16(`need_recalc` shl bp_TGtkRange_need_recalc) and - bm_TGtkRange_need_recalc) - -proc slider_size_fixed*(a: PRange): guint = - result = (a.Rangeflag0 and bm_TGtkRange_slider_size_fixed) shr - bp_TGtkRange_slider_size_fixed - -proc set_slider_size_fixed*(a: PRange, `slider_size_fixed`: guint) = - a.Rangeflag0 = a.Rangeflag0 or - (int16(`slider_size_fixed` shl bp_TGtkRange_slider_size_fixed) and - bm_TGtkRange_slider_size_fixed) - -proc trough_click_forward*(a: PRange): guint = - result = (a.flag1 and bm_TGtkRange_trough_click_forward) shr - bp_TGtkRange_trough_click_forward - -proc set_trough_click_forward*(a: PRange, `trough_click_forward`: guint) = - a.flag1 = a.flag1 or - (int16(`trough_click_forward` shl bp_TGtkRange_trough_click_forward) and - bm_TGtkRange_trough_click_forward) - -proc update_pending*(a: PRange): guint = - result = (a.flag1 and bm_TGtkRange_update_pending) shr - bp_TGtkRange_update_pending - -proc set_update_pending*(a: PRange, `update_pending`: guint) = - a.flag1 = a.flag1 or - (int16(`update_pending` shl bp_TGtkRange_update_pending) and - bm_TGtkRange_update_pending) - -proc TYPE_SCALE*(): GType = - result = scale_get_type() - -proc SCALE*(obj: pointer): PScale = - result = cast[PScale](CHECK_CAST(obj, TYPE_SCALE())) - -proc SCALE_CLASS*(klass: pointer): PScaleClass = - result = cast[PScaleClass](CHECK_CLASS_CAST(klass, TYPE_SCALE())) - -proc IS_SCALE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SCALE()) - -proc IS_SCALE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SCALE()) - -proc SCALE_GET_CLASS*(obj: pointer): PScaleClass = - result = cast[PScaleClass](CHECK_GET_CLASS(obj, TYPE_SCALE())) - -proc draw_value*(a: PScale): guint = - result = (a.Scaleflag0 and bm_TGtkScale_draw_value) shr - bp_TGtkScale_draw_value - -proc set_draw_value*(a: PScale, `draw_value`: guint) = - a.Scaleflag0 = a.Scaleflag0 or - (int16(`draw_value` shl bp_TGtkScale_draw_value) and - bm_TGtkScale_draw_value) - -proc value_pos*(a: PScale): guint = - result = (a.Scaleflag0 and bm_TGtkScale_value_pos) shr - bp_TGtkScale_value_pos - -proc set_value_pos*(a: PScale, `value_pos`: guint) = - a.Scaleflag0 = a.Scaleflag0 or - (int16(`value_pos` shl bp_TGtkScale_value_pos) and - bm_TGtkScale_value_pos) - -proc TYPE_HSCALE*(): GType = - result = hscale_get_type() - -proc HSCALE*(obj: pointer): PHScale = - result = cast[PHScale](CHECK_CAST(obj, TYPE_HSCALE())) - -proc HSCALE_CLASS*(klass: pointer): PHScaleClass = - result = cast[PHScaleClass](CHECK_CLASS_CAST(klass, TYPE_HSCALE())) - -proc IS_HSCALE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_HSCALE()) - -proc IS_HSCALE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_HSCALE()) - -proc HSCALE_GET_CLASS*(obj: pointer): PHScaleClass = - result = cast[PHScaleClass](CHECK_GET_CLASS(obj, TYPE_HSCALE())) - -proc TYPE_SCROLLBAR*(): GType = - result = scrollbar_get_type() - -proc SCROLLBAR*(obj: pointer): PScrollbar = - result = cast[PScrollbar](CHECK_CAST(obj, TYPE_SCROLLBAR())) - -proc SCROLLBAR_CLASS*(klass: pointer): PScrollbarClass = - result = cast[PScrollbarClass](CHECK_CLASS_CAST(klass, TYPE_SCROLLBAR())) - -proc IS_SCROLLBAR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SCROLLBAR()) - -proc IS_SCROLLBAR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SCROLLBAR()) - -proc SCROLLBAR_GET_CLASS*(obj: pointer): PScrollbarClass = - result = cast[PScrollbarClass](CHECK_GET_CLASS(obj, TYPE_SCROLLBAR())) - -proc TYPE_HSCROLLBAR*(): GType = - result = hscrollbar_get_type() - -proc HSCROLLBAR*(obj: pointer): PHScrollbar = - result = cast[PHScrollbar](CHECK_CAST(obj, TYPE_HSCROLLBAR())) - -proc HSCROLLBAR_CLASS*(klass: pointer): PHScrollbarClass = - result = cast[PHScrollbarClass](CHECK_CLASS_CAST(klass, TYPE_HSCROLLBAR())) - -proc IS_HSCROLLBAR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_HSCROLLBAR()) - -proc IS_HSCROLLBAR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_HSCROLLBAR()) - -proc HSCROLLBAR_GET_CLASS*(obj: pointer): PHScrollbarClass = - result = cast[PHScrollbarClass](CHECK_GET_CLASS(obj, TYPE_HSCROLLBAR())) - -proc TYPE_SEPARATOR*(): GType = - result = separator_get_type() - -proc SEPARATOR*(obj: pointer): PSeparator = - result = cast[PSeparator](CHECK_CAST(obj, TYPE_SEPARATOR())) - -proc SEPARATOR_CLASS*(klass: pointer): PSeparatorClass = - result = cast[PSeparatorClass](CHECK_CLASS_CAST(klass, TYPE_SEPARATOR())) - -proc IS_SEPARATOR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SEPARATOR()) - -proc IS_SEPARATOR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SEPARATOR()) - -proc SEPARATOR_GET_CLASS*(obj: pointer): PSeparatorClass = - result = cast[PSeparatorClass](CHECK_GET_CLASS(obj, TYPE_SEPARATOR())) - -proc TYPE_HSEPARATOR*(): GType = - result = hseparator_get_type() - -proc HSEPARATOR*(obj: pointer): PHSeparator = - result = cast[PHSeparator](CHECK_CAST(obj, TYPE_HSEPARATOR())) - -proc HSEPARATOR_CLASS*(klass: pointer): PHSeparatorClass = - result = cast[PHSeparatorClass](CHECK_CLASS_CAST(klass, TYPE_HSEPARATOR())) - -proc IS_HSEPARATOR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_HSEPARATOR()) - -proc IS_HSEPARATOR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_HSEPARATOR()) - -proc HSEPARATOR_GET_CLASS*(obj: pointer): PHSeparatorClass = - result = cast[PHSeparatorClass](CHECK_GET_CLASS(obj, TYPE_HSEPARATOR())) - -proc TYPE_ICON_FACTORY*(): GType = - result = icon_factory_get_type() - -proc ICON_FACTORY*(anObject: pointer): PIconFactory = - result = cast[PIconFactory](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_ICON_FACTORY())) - -proc ICON_FACTORY_CLASS*(klass: pointer): PIconFactoryClass = - result = cast[PIconFactoryClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_ICON_FACTORY())) - -proc IS_ICON_FACTORY*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_ICON_FACTORY()) - -proc IS_ICON_FACTORY_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_ICON_FACTORY()) - -proc ICON_FACTORY_GET_CLASS*(obj: pointer): PIconFactoryClass = - result = cast[PIconFactoryClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_ICON_FACTORY())) - -proc TYPE_ICON_SET*(): GType = - result = icon_set_get_type() - -proc TYPE_ICON_SOURCE*(): GType = - result = icon_source_get_type() - -proc TYPE_IMAGE*(): GType = - result = gtk2.image_get_type() - -proc IMAGE*(obj: pointer): PImage = - result = cast[PImage](CHECK_CAST(obj, gtk2.TYPE_IMAGE())) - -proc IMAGE_CLASS*(klass: pointer): PImageClass = - result = cast[PImageClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_IMAGE())) - -proc IS_IMAGE*(obj: pointer): bool = - result = CHECK_TYPE(obj, gtk2.TYPE_IMAGE()) - -proc IS_IMAGE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_IMAGE()) - -proc IMAGE_GET_CLASS*(obj: pointer): PImageClass = - result = cast[PImageClass](CHECK_GET_CLASS(obj, gtk2.TYPE_IMAGE())) - -proc TYPE_IMAGE_MENU_ITEM*(): GType = - result = image_menu_item_get_type() - -proc IMAGE_MENU_ITEM*(obj: pointer): PImageMenuItem = - result = cast[PImageMenuItem](CHECK_CAST(obj, TYPE_IMAGE_MENU_ITEM())) - -proc IMAGE_MENU_ITEM_CLASS*(klass: pointer): PImageMenuItemClass = - result = cast[PImageMenuItemClass](CHECK_CLASS_CAST(klass, - TYPE_IMAGE_MENU_ITEM())) - -proc IS_IMAGE_MENU_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_IMAGE_MENU_ITEM()) - -proc IS_IMAGE_MENU_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_IMAGE_MENU_ITEM()) - -proc IMAGE_MENU_ITEM_GET_CLASS*(obj: pointer): PImageMenuItemClass = - result = cast[PImageMenuItemClass](CHECK_GET_CLASS(obj, TYPE_IMAGE_MENU_ITEM())) - -proc TYPE_IM_CONTEXT_SIMPLE*(): GType = - result = im_context_simple_get_type() - -proc IM_CONTEXT_SIMPLE*(obj: pointer): PIMContextSimple = - result = cast[PIMContextSimple](CHECK_CAST(obj, TYPE_IM_CONTEXT_SIMPLE())) - -proc IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): PIMContextSimpleClass = - result = cast[PIMContextSimpleClass](CHECK_CLASS_CAST(klass, - TYPE_IM_CONTEXT_SIMPLE())) - -proc IS_IM_CONTEXT_SIMPLE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_IM_CONTEXT_SIMPLE()) - -proc IS_IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_IM_CONTEXT_SIMPLE()) - -proc IM_CONTEXT_SIMPLE_GET_CLASS*(obj: pointer): PIMContextSimpleClass = - result = cast[PIMContextSimpleClass](CHECK_GET_CLASS(obj, - TYPE_IM_CONTEXT_SIMPLE())) - -proc in_hex_sequence*(a: PIMContextSimple): guint = - result = (a.IMContextSimpleflag0 and bm_TGtkIMContextSimple_in_hex_sequence) shr - bp_TGtkIMContextSimple_in_hex_sequence - -proc set_in_hex_sequence*(a: PIMContextSimple, `in_hex_sequence`: guint) = - a.IMContextSimpleflag0 = a.IMContextSimpleflag0 or - (int16(`in_hex_sequence` shl bp_TGtkIMContextSimple_in_hex_sequence) and - bm_TGtkIMContextSimple_in_hex_sequence) - -proc TYPE_IM_MULTICONTEXT*(): GType = - result = im_multicontext_get_type() - -proc IM_MULTICONTEXT*(obj: pointer): PIMMulticontext = - result = cast[PIMMulticontext](CHECK_CAST(obj, TYPE_IM_MULTICONTEXT())) - -proc IM_MULTICONTEXT_CLASS*(klass: pointer): PIMMulticontextClass = - result = cast[PIMMulticontextClass](CHECK_CLASS_CAST(klass, - TYPE_IM_MULTICONTEXT())) - -proc IS_IM_MULTICONTEXT*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_IM_MULTICONTEXT()) - -proc IS_IM_MULTICONTEXT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_IM_MULTICONTEXT()) - -proc IM_MULTICONTEXT_GET_CLASS*(obj: pointer): PIMMulticontextClass = - result = cast[PIMMulticontextClass](CHECK_GET_CLASS(obj, - TYPE_IM_MULTICONTEXT())) - -proc TYPE_INPUT_DIALOG*(): GType = - result = input_dialog_get_type() - -proc INPUT_DIALOG*(obj: pointer): PInputDialog = - result = cast[PInputDialog](CHECK_CAST(obj, TYPE_INPUT_DIALOG())) - -proc INPUT_DIALOG_CLASS*(klass: pointer): PInputDialogClass = - result = cast[PInputDialogClass](CHECK_CLASS_CAST(klass, TYPE_INPUT_DIALOG())) - -proc IS_INPUT_DIALOG*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_INPUT_DIALOG()) - -proc IS_INPUT_DIALOG_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_INPUT_DIALOG()) - -proc INPUT_DIALOG_GET_CLASS*(obj: pointer): PInputDialogClass = - result = cast[PInputDialogClass](CHECK_GET_CLASS(obj, TYPE_INPUT_DIALOG())) - -proc TYPE_INVISIBLE*(): GType = - result = invisible_get_type() - -proc INVISIBLE*(obj: pointer): PInvisible = - result = cast[PInvisible](CHECK_CAST(obj, TYPE_INVISIBLE())) - -proc INVISIBLE_CLASS*(klass: pointer): PInvisibleClass = - result = cast[PInvisibleClass](CHECK_CLASS_CAST(klass, TYPE_INVISIBLE())) - -proc IS_INVISIBLE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_INVISIBLE()) - -proc IS_INVISIBLE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_INVISIBLE()) - -proc INVISIBLE_GET_CLASS*(obj: pointer): PInvisibleClass = - result = cast[PInvisibleClass](CHECK_GET_CLASS(obj, TYPE_INVISIBLE())) - -proc TYPE_ITEM_FACTORY*(): GType = - result = item_factory_get_type() - -proc ITEM_FACTORY*(anObject: pointer): PItemFactory = - result = cast[PItemFactory](CHECK_CAST(anObject, TYPE_ITEM_FACTORY())) - -proc ITEM_FACTORY_CLASS*(klass: pointer): PItemFactoryClass = - result = cast[PItemFactoryClass](CHECK_CLASS_CAST(klass, TYPE_ITEM_FACTORY())) - -proc IS_ITEM_FACTORY*(anObject: pointer): bool = - result = CHECK_TYPE(anObject, TYPE_ITEM_FACTORY()) - -proc IS_ITEM_FACTORY_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_ITEM_FACTORY()) - -proc ITEM_FACTORY_GET_CLASS*(obj: pointer): PItemFactoryClass = - result = cast[PItemFactoryClass](CHECK_GET_CLASS(obj, TYPE_ITEM_FACTORY())) - -proc TYPE_LAYOUT*(): GType = - result = gtk2.layout_get_type() - -proc LAYOUT*(obj: pointer): PLayout = - result = cast[PLayout](CHECK_CAST(obj, gtk2.TYPE_LAYOUT())) - -proc LAYOUT_CLASS*(klass: pointer): PLayoutClass = - result = cast[PLayoutClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_LAYOUT())) - -proc IS_LAYOUT*(obj: pointer): bool = - result = CHECK_TYPE(obj, gtk2.TYPE_LAYOUT()) - -proc IS_LAYOUT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_LAYOUT()) - -proc LAYOUT_GET_CLASS*(obj: pointer): PLayoutClass = - result = cast[PLayoutClass](CHECK_GET_CLASS(obj, gtk2.TYPE_LAYOUT())) - -proc TYPE_LIST*(): GType = - result = list_get_type() - -proc LIST*(obj: pointer): PList = - result = cast[PList](CHECK_CAST(obj, TYPE_LIST())) - -proc LIST_CLASS*(klass: pointer): PListClass = - result = cast[PListClass](CHECK_CLASS_CAST(klass, TYPE_LIST())) - -proc IS_LIST*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_LIST()) - -proc IS_LIST_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_LIST()) - -proc LIST_GET_CLASS*(obj: pointer): PListClass = - result = cast[PListClass](CHECK_GET_CLASS(obj, TYPE_LIST())) - -proc selection_mode*(a: PList): guint = - result = (a.Listflag0 and bm_TGtkList_selection_mode) shr - bp_TGtkList_selection_mode - -proc set_selection_mode*(a: PList, `selection_mode`: guint) = - a.Listflag0 = a.Listflag0 or - (int16(`selection_mode` shl bp_TGtkList_selection_mode) and - bm_TGtkList_selection_mode) - -proc drag_selection*(a: PList): guint = - result = (a.Listflag0 and bm_TGtkList_drag_selection) shr - bp_TGtkList_drag_selection - -proc set_drag_selection*(a: PList, `drag_selection`: guint) = - a.Listflag0 = a.Listflag0 or - (int16(`drag_selection` shl bp_TGtkList_drag_selection) and - bm_TGtkList_drag_selection) - -proc add_mode*(a: PList): guint = - result = (a.Listflag0 and bm_TGtkList_add_mode) shr bp_TGtkList_add_mode - -proc set_add_mode*(a: PList, `add_mode`: guint) = - a.Listflag0 = a.Listflag0 or - (int16(`add_mode` shl bp_TGtkList_add_mode) and bm_TGtkList_add_mode) - -proc list_item_get_type(): GType{.importc: "gtk_list_item_get_type", cdecl, - dynlib: lib.} -proc TYPE_LIST_ITEM*(): GType = - result = list_item_get_type() - -type - TListItem = object of TItem - TListItemClass = object of TItemClass - PListItem = ptr TListItem - PListItemClass = ptr TListItemClass - -proc LIST_ITEM*(obj: pointer): PListItem = - result = cast[PListItem](CHECK_CAST(obj, TYPE_LIST_ITEM())) - -proc LIST_ITEM_CLASS*(klass: pointer): PListItemClass = - result = cast[PListItemClass](CHECK_CLASS_CAST(klass, TYPE_LIST_ITEM())) - -proc IS_LIST_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_LIST_ITEM()) - -proc IS_LIST_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_LIST_ITEM()) - -proc LIST_ITEM_GET_CLASS*(obj: pointer): PListItemClass = - #proc gtk_tree_model_get_type(): GType {.importc, cdecl, dynlib: gtklib.} - result = cast[PListItemClass](CHECK_GET_CLASS(obj, TYPE_LIST_ITEM())) - -proc TYPE_TREE_MODEL*(): GType = - result = tree_model_get_type() - -proc TREE_MODEL*(obj: pointer): PTreeModel = - result = cast[PTreeModel](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TREE_MODEL())) - -proc IS_TREE_MODEL*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TREE_MODEL()) - -proc TREE_MODEL_GET_IFACE*(obj: pointer): PTreeModelIface = - result = cast[PTreeModelIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_TREE_MODEL())) - -proc TYPE_TREE_ITER*(): GType = - result = tree_iter_get_type() - -proc TYPE_TREE_PATH*(): GType = - result = tree_path_get_type() - -proc tree_path_new_root*(): PTreePath = - result = tree_path_new_first() - -proc get_iter_root*(tree_model: PTreeModel, iter: PTreeIter): gboolean = - result = get_iter_first(tree_model, iter) - -proc TYPE_TREE_SORTABLE*(): GType = - result = tree_sortable_get_type() - -proc TREE_SORTABLE*(obj: pointer): PTreeSortable = - result = cast[PTreeSortable](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_TREE_SORTABLE())) - -proc TREE_SORTABLE_CLASS*(obj: pointer): PTreeSortableIface = - result = cast[PTreeSortableIface](G_TYPE_CHECK_CLASS_CAST(obj, - TYPE_TREE_SORTABLE())) - -proc IS_TREE_SORTABLE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TREE_SORTABLE()) - -proc TREE_SORTABLE_GET_IFACE*(obj: pointer): PTreeSortableIface = - result = cast[PTreeSortableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_TREE_SORTABLE())) - -proc TYPE_TREE_MODEL_SORT*(): GType = - result = tree_model_sort_get_type() - -proc TREE_MODEL_SORT*(obj: pointer): PTreeModelSort = - result = cast[PTreeModelSort](CHECK_CAST(obj, TYPE_TREE_MODEL_SORT())) - -proc TREE_MODEL_SORT_CLASS*(klass: pointer): PTreeModelSortClass = - result = cast[PTreeModelSortClass](CHECK_CLASS_CAST(klass, - TYPE_TREE_MODEL_SORT())) - -proc IS_TREE_MODEL_SORT*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TREE_MODEL_SORT()) - -proc IS_TREE_MODEL_SORT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TREE_MODEL_SORT()) - -proc TREE_MODEL_SORT_GET_CLASS*(obj: pointer): PTreeModelSortClass = - result = cast[PTreeModelSortClass](CHECK_GET_CLASS(obj, TYPE_TREE_MODEL_SORT())) - -proc TYPE_LIST_STORE*(): GType = - result = list_store_get_type() - -proc LIST_STORE*(obj: pointer): PListStore = - result = cast[PListStore](CHECK_CAST(obj, TYPE_LIST_STORE())) - -proc LIST_STORE_CLASS*(klass: pointer): PListStoreClass = - result = cast[PListStoreClass](CHECK_CLASS_CAST(klass, TYPE_LIST_STORE())) - -proc IS_LIST_STORE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_LIST_STORE()) - -proc IS_LIST_STORE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_LIST_STORE()) - -proc LIST_STORE_GET_CLASS*(obj: pointer): PListStoreClass = - result = cast[PListStoreClass](CHECK_GET_CLASS(obj, TYPE_LIST_STORE())) - -proc columns_dirty*(a: PListStore): guint = - result = (a.ListStoreflag0 and bm_TGtkListStore_columns_dirty) shr - bp_TGtkListStore_columns_dirty - -proc set_columns_dirty*(a: PListStore, `columns_dirty`: guint) = - a.ListStoreflag0 = a.ListStoreflag0 or - (int16(`columns_dirty` shl bp_TGtkListStore_columns_dirty) and - bm_TGtkListStore_columns_dirty) - -proc TYPE_MENU_BAR*(): GType = - result = menu_bar_get_type() - -proc MENU_BAR*(obj: pointer): PMenuBar = - result = cast[PMenuBar](CHECK_CAST(obj, TYPE_MENU_BAR())) - -proc MENU_BAR_CLASS*(klass: pointer): PMenuBarClass = - result = cast[PMenuBarClass](CHECK_CLASS_CAST(klass, TYPE_MENU_BAR())) - -proc IS_MENU_BAR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_MENU_BAR()) - -proc IS_MENU_BAR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_MENU_BAR()) - -proc MENU_BAR_GET_CLASS*(obj: pointer): PMenuBarClass = - result = cast[PMenuBarClass](CHECK_GET_CLASS(obj, TYPE_MENU_BAR())) - -proc menu_bar_append*(menu, child: PWidget) = - append(cast[PMenuShell](menu), child) - -proc menu_bar_prepend*(menu, child: PWidget) = - prepend(cast[PMenuShell](menu), child) - -proc menu_bar_insert*(menu, child: PWidget, pos: gint) = - insert(cast[PMenuShell](menu), child, pos) - -proc TYPE_MESSAGE_DIALOG*(): GType = - result = message_dialog_get_type() - -proc MESSAGE_DIALOG*(obj: pointer): PMessageDialog = - result = cast[PMessageDialog](CHECK_CAST(obj, TYPE_MESSAGE_DIALOG())) - -proc MESSAGE_DIALOG_CLASS*(klass: pointer): PMessageDialogClass = - result = cast[PMessageDialogClass](CHECK_CLASS_CAST(klass, - TYPE_MESSAGE_DIALOG())) - -proc IS_MESSAGE_DIALOG*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_MESSAGE_DIALOG()) - -proc IS_MESSAGE_DIALOG_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_MESSAGE_DIALOG()) - -proc MESSAGE_DIALOG_GET_CLASS*(obj: pointer): PMessageDialogClass = - result = cast[PMessageDialogClass](CHECK_GET_CLASS(obj, TYPE_MESSAGE_DIALOG())) - -proc TYPE_NOTEBOOK*(): GType = - result = notebook_get_type() - -proc NOTEBOOK*(obj: pointer): PNotebook = - result = cast[PNotebook](CHECK_CAST(obj, TYPE_NOTEBOOK())) - -proc NOTEBOOK_CLASS*(klass: pointer): PNotebookClass = - result = cast[PNotebookClass](CHECK_CLASS_CAST(klass, TYPE_NOTEBOOK())) - -proc IS_NOTEBOOK*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_NOTEBOOK()) - -proc IS_NOTEBOOK_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_NOTEBOOK()) - -proc NOTEBOOK_GET_CLASS*(obj: pointer): PNotebookClass = - result = cast[PNotebookClass](CHECK_GET_CLASS(obj, TYPE_NOTEBOOK())) - -proc show_tabs*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_show_tabs) shr - bp_TGtkNotebook_show_tabs - -proc set_show_tabs*(a: PNotebook, `show_tabs`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`show_tabs` shl bp_TGtkNotebook_show_tabs) and - bm_TGtkNotebook_show_tabs) - -proc homogeneous*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_homogeneous) shr - bp_TGtkNotebook_homogeneous - -proc set_homogeneous*(a: PNotebook, `homogeneous`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`homogeneous` shl bp_TGtkNotebook_homogeneous) and - bm_TGtkNotebook_homogeneous) - -proc show_border*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_show_border) shr - bp_TGtkNotebook_show_border - -proc set_show_border*(a: PNotebook, `show_border`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`show_border` shl bp_TGtkNotebook_show_border) and - bm_TGtkNotebook_show_border) - -proc tab_pos*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_tab_pos) shr - bp_TGtkNotebook_tab_pos - -proc set_tab_pos*(a: PNotebook, `tab_pos`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`tab_pos` shl bp_TGtkNotebook_tab_pos) and - bm_TGtkNotebook_tab_pos) - -proc scrollable*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_scrollable) shr - bp_TGtkNotebook_scrollable - -proc set_scrollable*(a: PNotebook, `scrollable`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`scrollable` shl bp_TGtkNotebook_scrollable) and - bm_TGtkNotebook_scrollable) - -proc in_child*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_in_child) shr - bp_TGtkNotebook_in_child - -proc set_in_child*(a: PNotebook, `in_child`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`in_child` shl bp_TGtkNotebook_in_child) and - bm_TGtkNotebook_in_child) - -proc click_child*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_click_child) shr - bp_TGtkNotebook_click_child - -proc set_click_child*(a: PNotebook, `click_child`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`click_child` shl bp_TGtkNotebook_click_child) and - bm_TGtkNotebook_click_child) - -proc button*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_button) shr - bp_TGtkNotebook_button - -proc set_button*(a: PNotebook, `button`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`button` shl bp_TGtkNotebook_button) and bm_TGtkNotebook_button) - -proc need_timer*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_need_timer) shr - bp_TGtkNotebook_need_timer - -proc set_need_timer*(a: PNotebook, `need_timer`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`need_timer` shl bp_TGtkNotebook_need_timer) and - bm_TGtkNotebook_need_timer) - -proc child_has_focus*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_child_has_focus) shr - bp_TGtkNotebook_child_has_focus - -proc set_child_has_focus*(a: PNotebook, `child_has_focus`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`child_has_focus` shl bp_TGtkNotebook_child_has_focus) and - bm_TGtkNotebook_child_has_focus) - -proc have_visible_child*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_have_visible_child) shr - bp_TGtkNotebook_have_visible_child - -proc set_have_visible_child*(a: PNotebook, `have_visible_child`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`have_visible_child` shl bp_TGtkNotebook_have_visible_child) and - bm_TGtkNotebook_have_visible_child) - -proc focus_out*(a: PNotebook): guint = - result = (a.Notebookflag0 and bm_TGtkNotebook_focus_out) shr - bp_TGtkNotebook_focus_out - -proc set_focus_out*(a: PNotebook, `focus_out`: guint) = - a.Notebookflag0 = a.Notebookflag0 or - (int16(`focus_out` shl bp_TGtkNotebook_focus_out) and - bm_TGtkNotebook_focus_out) - -proc TYPE_OLD_EDITABLE*(): GType = - result = old_editable_get_type() - -proc OLD_EDITABLE*(obj: pointer): POldEditable = - result = cast[POldEditable](CHECK_CAST(obj, TYPE_OLD_EDITABLE())) - -proc OLD_EDITABLE_CLASS*(klass: pointer): POldEditableClass = - result = cast[POldEditableClass](CHECK_CLASS_CAST(klass, TYPE_OLD_EDITABLE())) - -proc IS_OLD_EDITABLE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_OLD_EDITABLE()) - -proc IS_OLD_EDITABLE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_OLD_EDITABLE()) - -proc OLD_EDITABLE_GET_CLASS*(obj: pointer): POldEditableClass = - result = cast[POldEditableClass](CHECK_GET_CLASS(obj, TYPE_OLD_EDITABLE())) - -proc has_selection*(a: POldEditable): guint = - result = (a.OldEditableflag0 and bm_TGtkOldEditable_has_selection) shr - bp_TGtkOldEditable_has_selection - -proc set_has_selection*(a: POldEditable, `has_selection`: guint) = - a.OldEditableflag0 = a.OldEditableflag0 or - (int16(`has_selection` shl bp_TGtkOldEditable_has_selection) and - bm_TGtkOldEditable_has_selection) - -proc editable*(a: POldEditable): guint = - result = (a.OldEditableflag0 and bm_TGtkOldEditable_editable) shr - bp_TGtkOldEditable_editable - -proc set_editable*(a: POldEditable, `editable`: guint) = - a.OldEditableflag0 = a.OldEditableflag0 or - (int16(`editable` shl bp_TGtkOldEditable_editable) and - bm_TGtkOldEditable_editable) - -proc visible*(a: POldEditable): guint = - result = (a.OldEditableflag0 and bm_TGtkOldEditable_visible) shr - bp_TGtkOldEditable_visible - -proc set_visible*(a: POldEditable, `visible`: guint) = - a.OldEditableflag0 = a.OldEditableflag0 or - (int16(`visible` shl bp_TGtkOldEditable_visible) and - bm_TGtkOldEditable_visible) - -proc TYPE_OPTION_MENU*(): GType = - result = option_menu_get_type() - -proc OPTION_MENU*(obj: pointer): POptionMenu = - result = cast[POptionMenu](CHECK_CAST(obj, TYPE_OPTION_MENU())) - -proc OPTION_MENU_CLASS*(klass: pointer): POptionMenuClass = - result = cast[POptionMenuClass](CHECK_CLASS_CAST(klass, TYPE_OPTION_MENU())) - -proc IS_OPTION_MENU*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_OPTION_MENU()) - -proc IS_OPTION_MENU_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_OPTION_MENU()) - -proc OPTION_MENU_GET_CLASS*(obj: pointer): POptionMenuClass = - result = cast[POptionMenuClass](CHECK_GET_CLASS(obj, TYPE_OPTION_MENU())) - -proc TYPE_PIXMAP*(): GType = - result = gtk2.pixmap_get_type() - -proc PIXMAP*(obj: pointer): PPixmap = - result = cast[PPixmap](CHECK_CAST(obj, gtk2.TYPE_PIXMAP())) - -proc PIXMAP_CLASS*(klass: pointer): PPixmapClass = - result = cast[PPixmapClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_PIXMAP())) - -proc IS_PIXMAP*(obj: pointer): bool = - result = CHECK_TYPE(obj, gtk2.TYPE_PIXMAP()) - -proc IS_PIXMAP_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_PIXMAP()) - -proc PIXMAP_GET_CLASS*(obj: pointer): PPixmapClass = - result = cast[PPixmapClass](CHECK_GET_CLASS(obj, gtk2.TYPE_PIXMAP())) - -proc build_insensitive*(a: PPixmap): guint = - result = (a.Pixmapflag0 and bm_TGtkPixmap_build_insensitive) shr - bp_TGtkPixmap_build_insensitive - -proc set_build_insensitive*(a: PPixmap, `build_insensitive`: guint) = - a.Pixmapflag0 = a.Pixmapflag0 or - (int16(`build_insensitive` shl bp_TGtkPixmap_build_insensitive) and - bm_TGtkPixmap_build_insensitive) - -proc TYPE_PLUG*(): GType = - result = plug_get_type() - -proc PLUG*(obj: pointer): PPlug = - result = cast[PPlug](CHECK_CAST(obj, TYPE_PLUG())) - -proc PLUG_CLASS*(klass: pointer): PPlugClass = - result = cast[PPlugClass](CHECK_CLASS_CAST(klass, TYPE_PLUG())) - -proc IS_PLUG*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_PLUG()) - -proc IS_PLUG_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_PLUG()) - -proc PLUG_GET_CLASS*(obj: pointer): PPlugClass = - result = cast[PPlugClass](CHECK_GET_CLASS(obj, TYPE_PLUG())) - -proc same_app*(a: PPlug): guint = - result = (a.Plugflag0 and bm_TGtkPlug_same_app) shr bp_TGtkPlug_same_app - -proc set_same_app*(a: PPlug, `same_app`: guint) = - a.Plugflag0 = a.Plugflag0 or - (int16(`same_app` shl bp_TGtkPlug_same_app) and bm_TGtkPlug_same_app) - -proc TYPE_PREVIEW*(): GType = - result = preview_get_type() - -proc PREVIEW*(obj: pointer): PPreview = - result = cast[PPreview](CHECK_CAST(obj, TYPE_PREVIEW())) - -proc PREVIEW_CLASS*(klass: pointer): PPreviewClass = - result = cast[PPreviewClass](CHECK_CLASS_CAST(klass, TYPE_PREVIEW())) - -proc IS_PREVIEW*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_PREVIEW()) - -proc IS_PREVIEW_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_PREVIEW()) - -proc PREVIEW_GET_CLASS*(obj: pointer): PPreviewClass = - result = cast[PPreviewClass](CHECK_GET_CLASS(obj, TYPE_PREVIEW())) - -proc get_type*(a: PPreview): guint = - result = (a.Previewflag0 and bm_TGtkPreview_type) shr bp_TGtkPreview_type - -proc set_type*(a: PPreview, `type`: guint) = - a.Previewflag0 = a.Previewflag0 or - (int16(`type` shl bp_TGtkPreview_type) and bm_TGtkPreview_type) - -proc get_expand*(a: PPreview): guint = - result = (a.Previewflag0 and bm_TGtkPreview_expand) shr - bp_TGtkPreview_expand - -proc set_expand*(a: PPreview, `expand`: guint) = - a.Previewflag0 = a.Previewflag0 or - (int16(`expand` shl bp_TGtkPreview_expand) and bm_TGtkPreview_expand) - -proc progress_get_type(): GType{.importc: "gtk_progress_get_type", cdecl, - dynlib: lib.} -proc TYPE_PROGRESS*(): GType = - result = progress_get_type() - -proc PROGRESS*(obj: pointer): PProgress = - result = cast[PProgress](CHECK_CAST(obj, TYPE_PROGRESS())) - -proc PROGRESS_CLASS*(klass: pointer): PProgressClass = - result = cast[PProgressClass](CHECK_CLASS_CAST(klass, TYPE_PROGRESS())) - -proc IS_PROGRESS*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_PROGRESS()) - -proc IS_PROGRESS_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_PROGRESS()) - -proc PROGRESS_GET_CLASS*(obj: pointer): PProgressClass = - result = cast[PProgressClass](CHECK_GET_CLASS(obj, TYPE_PROGRESS())) - -proc show_text*(a: PProgress): guint = - result = (a.Progressflag0 and bm_TGtkProgress_show_text) shr - bp_TGtkProgress_show_text - -proc set_show_text*(a: PProgress, `show_text`: guint) = - a.Progressflag0 = a.Progressflag0 or - (int16(`show_text` shl bp_TGtkProgress_show_text) and - bm_TGtkProgress_show_text) - -proc activity_mode*(a: PProgress): guint = - result = (a.Progressflag0 and bm_TGtkProgress_activity_mode) shr - bp_TGtkProgress_activity_mode - -proc set_activity_mode*(a: PProgress, `activity_mode`: guint) = - a.Progressflag0 = a.Progressflag0 or - (int16(`activity_mode` shl bp_TGtkProgress_activity_mode) and - bm_TGtkProgress_activity_mode) - -proc use_text_format*(a: PProgress): guint = - result = (a.Progressflag0 and bm_TGtkProgress_use_text_format) shr - bp_TGtkProgress_use_text_format - -proc set_use_text_format*(a: PProgress, `use_text_format`: guint) = - a.Progressflag0 = a.Progressflag0 or - (int16(`use_text_format` shl bp_TGtkProgress_use_text_format) and - bm_TGtkProgress_use_text_format) - -proc TYPE_PROGRESS_BAR*(): GType = - result = progress_bar_get_type() - -proc PROGRESS_BAR*(obj: pointer): PProgressBar = - result = cast[PProgressBar](CHECK_CAST(obj, TYPE_PROGRESS_BAR())) - -proc PROGRESS_BAR_CLASS*(klass: pointer): PProgressBarClass = - result = cast[PProgressBarClass](CHECK_CLASS_CAST(klass, TYPE_PROGRESS_BAR())) - -proc IS_PROGRESS_BAR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_PROGRESS_BAR()) - -proc IS_PROGRESS_BAR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_PROGRESS_BAR()) - -proc PROGRESS_BAR_GET_CLASS*(obj: pointer): PProgressBarClass = - result = cast[PProgressBarClass](CHECK_GET_CLASS(obj, TYPE_PROGRESS_BAR())) - -proc activity_dir*(a: PProgressBar): guint = - result = (a.ProgressBarflag0 and bm_TGtkProgressBar_activity_dir) shr - bp_TGtkProgressBar_activity_dir - -proc set_activity_dir*(a: PProgressBar, `activity_dir`: guint) = - a.ProgressBarflag0 = a.ProgressBarflag0 or - (int16(`activity_dir` shl bp_TGtkProgressBar_activity_dir) and - bm_TGtkProgressBar_activity_dir) - -proc TYPE_RADIO_BUTTON*(): GType = - result = radio_button_get_type() - -proc RADIO_BUTTON*(obj: pointer): PRadioButton = - result = cast[PRadioButton](CHECK_CAST(obj, TYPE_RADIO_BUTTON())) - -proc RADIO_BUTTON_CLASS*(klass: pointer): PRadioButtonClass = - result = cast[PRadioButtonClass](CHECK_CLASS_CAST(klass, TYPE_RADIO_BUTTON())) - -proc IS_RADIO_BUTTON*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_RADIO_BUTTON()) - -proc IS_RADIO_BUTTON_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_RADIO_BUTTON()) - -proc RADIO_BUTTON_GET_CLASS*(obj: pointer): PRadioButtonClass = - result = cast[PRadioButtonClass](CHECK_GET_CLASS(obj, TYPE_RADIO_BUTTON())) - -proc TYPE_RADIO_MENU_ITEM*(): GType = - result = radio_menu_item_get_type() - -proc RADIO_MENU_ITEM*(obj: pointer): PRadioMenuItem = - result = cast[PRadioMenuItem](CHECK_CAST(obj, TYPE_RADIO_MENU_ITEM())) - -proc RADIO_MENU_ITEM_CLASS*(klass: pointer): PRadioMenuItemClass = - result = cast[PRadioMenuItemClass](CHECK_CLASS_CAST(klass, - TYPE_RADIO_MENU_ITEM())) - -proc IS_RADIO_MENU_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_RADIO_MENU_ITEM()) - -proc IS_RADIO_MENU_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_RADIO_MENU_ITEM()) - -proc RADIO_MENU_ITEM_GET_CLASS*(obj: pointer): PRadioMenuItemClass = - result = cast[PRadioMenuItemClass](CHECK_GET_CLASS(obj, TYPE_RADIO_MENU_ITEM())) - -proc TYPE_SCROLLED_WINDOW*(): GType = - result = scrolled_window_get_type() - -proc SCROLLED_WINDOW*(obj: pointer): PScrolledWindow = - result = cast[PScrolledWindow](CHECK_CAST(obj, TYPE_SCROLLED_WINDOW())) - -proc SCROLLED_WINDOW_CLASS*(klass: pointer): PScrolledWindowClass = - result = cast[PScrolledWindowClass](CHECK_CLASS_CAST(klass, - TYPE_SCROLLED_WINDOW())) - -proc IS_SCROLLED_WINDOW*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SCROLLED_WINDOW()) - -proc IS_SCROLLED_WINDOW_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SCROLLED_WINDOW()) - -proc SCROLLED_WINDOW_GET_CLASS*(obj: pointer): PScrolledWindowClass = - result = cast[PScrolledWindowClass](CHECK_GET_CLASS(obj, - TYPE_SCROLLED_WINDOW())) - -proc hscrollbar_policy*(a: PScrolledWindow): guint = - result = (a.ScrolledWindowflag0 and bm_TGtkScrolledWindow_hscrollbar_policy) shr - bp_TGtkScrolledWindow_hscrollbar_policy - -proc set_hscrollbar_policy*(a: PScrolledWindow, `hscrollbar_policy`: guint) = - a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or - (int16(`hscrollbar_policy` shl bp_TGtkScrolledWindow_hscrollbar_policy) and - bm_TGtkScrolledWindow_hscrollbar_policy) - -proc vscrollbar_policy*(a: PScrolledWindow): guint = - result = (a.ScrolledWindowflag0 and bm_TGtkScrolledWindow_vscrollbar_policy) shr - bp_TGtkScrolledWindow_vscrollbar_policy - -proc set_vscrollbar_policy*(a: PScrolledWindow, `vscrollbar_policy`: guint) = - a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or - (int16(`vscrollbar_policy` shl bp_TGtkScrolledWindow_vscrollbar_policy) and - bm_TGtkScrolledWindow_vscrollbar_policy) - -proc hscrollbar_visible*(a: PScrolledWindow): guint = - result = (a.ScrolledWindowflag0 and - bm_TGtkScrolledWindow_hscrollbar_visible) shr - bp_TGtkScrolledWindow_hscrollbar_visible - -proc set_hscrollbar_visible*(a: PScrolledWindow, `hscrollbar_visible`: guint) = - a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or - (int16(`hscrollbar_visible` shl - bp_TGtkScrolledWindow_hscrollbar_visible) and - bm_TGtkScrolledWindow_hscrollbar_visible) - -proc vscrollbar_visible*(a: PScrolledWindow): guint = - result = (a.ScrolledWindowflag0 and - bm_TGtkScrolledWindow_vscrollbar_visible) shr - bp_TGtkScrolledWindow_vscrollbar_visible - -proc set_vscrollbar_visible*(a: PScrolledWindow, `vscrollbar_visible`: guint) = - a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or - int16((`vscrollbar_visible` shl - bp_TGtkScrolledWindow_vscrollbar_visible) and - bm_TGtkScrolledWindow_vscrollbar_visible) - -proc window_placement*(a: PScrolledWindow): guint = - result = (a.ScrolledWindowflag0 and bm_TGtkScrolledWindow_window_placement) shr - bp_TGtkScrolledWindow_window_placement - -proc set_window_placement*(a: PScrolledWindow, `window_placement`: guint) = - a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or - (int16(`window_placement` shl bp_TGtkScrolledWindow_window_placement) and - bm_TGtkScrolledWindow_window_placement) - -proc focus_out*(a: PScrolledWindow): guint = - result = (a.ScrolledWindowflag0 and bm_TGtkScrolledWindow_focus_out) shr - bp_TGtkScrolledWindow_focus_out - -proc set_focus_out*(a: PScrolledWindow, `focus_out`: guint) = - a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or - (int16(`focus_out` shl bp_TGtkScrolledWindow_focus_out) and - bm_TGtkScrolledWindow_focus_out) - -proc TYPE_SELECTION_DATA*(): GType = - result = selection_data_get_type() - -proc TYPE_SEPARATOR_MENU_ITEM*(): GType = - result = separator_menu_item_get_type() - -proc SEPARATOR_MENU_ITEM*(obj: pointer): PSeparatorMenuItem = - result = cast[PSeparatorMenuItem](CHECK_CAST(obj, TYPE_SEPARATOR_MENU_ITEM())) - -proc SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): PSeparatorMenuItemClass = - result = cast[PSeparatorMenuItemClass](CHECK_CLASS_CAST(klass, - TYPE_SEPARATOR_MENU_ITEM())) - -proc IS_SEPARATOR_MENU_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SEPARATOR_MENU_ITEM()) - -proc IS_SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SEPARATOR_MENU_ITEM()) - -proc SEPARATOR_MENU_ITEM_GET_CLASS*(obj: pointer): PSeparatorMenuItemClass = - result = cast[PSeparatorMenuItemClass](CHECK_GET_CLASS(obj, - TYPE_SEPARATOR_MENU_ITEM())) - -proc signal_lookup*(name: cstring, object_type: GType): guint = - result = g_signal_lookup(name, object_type) - -proc signal_name*(signal_id: guint): cstring = - result = g_signal_name(signal_id) - -proc signal_emit_stop*(instance: gpointer, signal_id: guint, detail: TGQuark) = - if detail != 0'i32: g_signal_stop_emission(instance, signal_id, 0) - -proc signal_connect_full*(anObject: PObject, name: cstring, fun: TSignalFunc, - unknown1: pointer, func_data: gpointer, - unknown2: pointer, unknown3, unknown4: int): gulong{. - importc: "gtk_signal_connect_full", cdecl, dynlib: lib.} -proc signal_compat_matched*(anObject: PObject, fun: TSignalFunc, - data: gpointer, m: TGSignalMatchType, u: int){. - importc: "gtk_signal_compat_matched", cdecl, dynlib: lib.} -proc signal_connect*(anObject: PObject, name: cstring, fun: TSignalFunc, - func_data: gpointer): gulong = - result = signal_connect_full(anObject, name, fun, nil, func_data, nil, 0, 0) - -proc signal_connect_after*(anObject: PObject, name: cstring, fun: TSignalFunc, - func_data: gpointer): gulong = - result = signal_connect_full(anObject, name, fun, nil, func_data, nil, 0, 1) - -proc signal_connect_object*(anObject: PObject, name: cstring, - fun: TSignalFunc, slot_object: gpointer): gulong = - result = signal_connect_full(anObject, name, fun, nil, slot_object, nil, 1, - 0) - -proc signal_connect_object_after*(anObject: PObject, name: cstring, - fun: TSignalFunc, slot_object: gpointer): gulong = - result = signal_connect_full(anObject, name, fun, nil, slot_object, nil, 1, - 1) - -proc signal_disconnect*(anObject: gpointer, handler_id: gulong) = - g_signal_handler_disconnect(anObject, handler_id) - -proc signal_handler_block*(anObject: gpointer, handler_id: gulong) = - g_signal_handler_block(anObject, handler_id) - -proc signal_handler_unblock*(anObject: gpointer, handler_id: gulong) = - g_signal_handler_unblock(anObject, handler_id) - -proc signal_disconnect_by_data*(anObject: PObject, data: gpointer) = - signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 0) - -proc signal_disconnect_by_func*(anObject: PObject, fun: TSignalFunc, - data: gpointer) = - signal_compat_matched(anObject, fun, data, cast[TGSignalMatchType](G_SIGNAL_MATCH_FUNC or - G_SIGNAL_MATCH_DATA), 0) - -proc signal_handler_block_by_func*(anObject: PObject, fun: TSignalFunc, - data: gpointer) = - signal_compat_matched(anObject, fun, data, TGSignalMatchType( - G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0) - -proc signal_handler_block_by_data*(anObject: PObject, data: gpointer) = - signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 1) - -proc signal_handler_unblock_by_func*(anObject: PObject, fun: TSignalFunc, - data: gpointer) = - signal_compat_matched(anObject, fun, data, cast[TGSignalMatchType](G_SIGNAL_MATCH_FUNC or - G_SIGNAL_MATCH_DATA), 0) - -proc signal_handler_unblock_by_data*(anObject: PObject, data: gpointer) = - signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 2) - -proc signal_handler_pending*(anObject: PObject, signal_id: guint, - may_be_blocked: gboolean): gboolean = - Result = g_signal_has_handler_pending(anObject, signal_id, 0, may_be_blocked) - -proc signal_handler_pending_by_func*(anObject: PObject, signal_id: guint, - may_be_blocked: gboolean, - fun: TSignalFunc, - 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[TGSignalMatchType](G_SIGNAL_MATCH_UNBLOCKED) - Result = g_signal_handler_find(anObject, t, signal_id, 0, nil, fun, data) != - 0 - -proc TYPE_SIZE_GROUP*(): GType = - result = size_group_get_type() - -proc SIZE_GROUP*(obj: pointer): PSizeGroup = - result = cast[PSizeGroup](CHECK_CAST(obj, TYPE_SIZE_GROUP())) - -proc SIZE_GROUP_CLASS*(klass: pointer): PSizeGroupClass = - result = cast[PSizeGroupClass](CHECK_CLASS_CAST(klass, TYPE_SIZE_GROUP())) - -proc IS_SIZE_GROUP*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SIZE_GROUP()) - -proc IS_SIZE_GROUP_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SIZE_GROUP()) - -proc SIZE_GROUP_GET_CLASS*(obj: pointer): PSizeGroupClass = - result = cast[PSizeGroupClass](CHECK_GET_CLASS(obj, TYPE_SIZE_GROUP())) - -proc have_width*(a: PSizeGroup): guint = - result = (a.SizeGroupflag0 and bm_TGtkSizeGroup_have_width) shr - bp_TGtkSizeGroup_have_width - -proc set_have_width*(a: PSizeGroup, `have_width`: guint) = - a.SizeGroupflag0 = a.SizeGroupflag0 or - (int16(`have_width` shl bp_TGtkSizeGroup_have_width) and - bm_TGtkSizeGroup_have_width) - -proc have_height*(a: PSizeGroup): guint = - result = (a.SizeGroupflag0 and bm_TGtkSizeGroup_have_height) shr - bp_TGtkSizeGroup_have_height - -proc set_have_height*(a: PSizeGroup, `have_height`: guint) = - a.SizeGroupflag0 = a.SizeGroupflag0 or - (int16(`have_height` shl bp_TGtkSizeGroup_have_height) and - bm_TGtkSizeGroup_have_height) - -proc TYPE_SOCKET*(): GType = - result = socket_get_type() - -proc SOCKET*(obj: pointer): PSocket = - result = cast[PSocket](CHECK_CAST(obj, TYPE_SOCKET())) - -proc SOCKET_CLASS*(klass: pointer): PSocketClass = - result = cast[PSocketClass](CHECK_CLASS_CAST(klass, TYPE_SOCKET())) - -proc IS_SOCKET*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SOCKET()) - -proc IS_SOCKET_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SOCKET()) - -proc SOCKET_GET_CLASS*(obj: pointer): PSocketClass = - result = cast[PSocketClass](CHECK_GET_CLASS(obj, TYPE_SOCKET())) - -proc same_app*(a: PSocket): guint = - result = (a.Socketflag0 and bm_TGtkSocket_same_app) shr - bp_TGtkSocket_same_app - -proc set_same_app*(a: PSocket, `same_app`: guint) = - a.Socketflag0 = a.Socketflag0 or - (int16(`same_app` shl bp_TGtkSocket_same_app) and - bm_TGtkSocket_same_app) - -proc focus_in*(a: PSocket): guint = - result = (a.Socketflag0 and bm_TGtkSocket_focus_in) shr - bp_TGtkSocket_focus_in - -proc set_focus_in*(a: PSocket, `focus_in`: guint) = - a.Socketflag0 = a.Socketflag0 or - (int16(`focus_in` shl bp_TGtkSocket_focus_in) and - bm_TGtkSocket_focus_in) - -proc have_size*(a: PSocket): guint = - result = (a.Socketflag0 and bm_TGtkSocket_have_size) shr - bp_TGtkSocket_have_size - -proc set_have_size*(a: PSocket, `have_size`: guint) = - a.Socketflag0 = a.Socketflag0 or - (int16(`have_size` shl bp_TGtkSocket_have_size) and - bm_TGtkSocket_have_size) - -proc need_map*(a: PSocket): guint = - result = (a.Socketflag0 and bm_TGtkSocket_need_map) shr - bp_TGtkSocket_need_map - -proc set_need_map*(a: PSocket, `need_map`: guint) = - a.Socketflag0 = a.Socketflag0 or - (int16(`need_map` shl bp_TGtkSocket_need_map) and - bm_TGtkSocket_need_map) - -proc is_mapped*(a: PSocket): guint = - result = (a.Socketflag0 and bm_TGtkSocket_is_mapped) shr - bp_TGtkSocket_is_mapped - -proc set_is_mapped*(a: PSocket, `is_mapped`: guint) = - a.Socketflag0 = a.Socketflag0 or - (int16(`is_mapped` shl bp_TGtkSocket_is_mapped) and - bm_TGtkSocket_is_mapped) - -proc TYPE_SPIN_BUTTON*(): GType = - result = spin_button_get_type() - -proc SPIN_BUTTON*(obj: pointer): PSpinButton = - result = cast[PSpinButton](CHECK_CAST(obj, TYPE_SPIN_BUTTON())) - -proc SPIN_BUTTON_CLASS*(klass: pointer): PSpinButtonClass = - result = cast[PSpinButtonClass](CHECK_CLASS_CAST(klass, TYPE_SPIN_BUTTON())) - -proc IS_SPIN_BUTTON*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_SPIN_BUTTON()) - -proc IS_SPIN_BUTTON_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_SPIN_BUTTON()) - -proc SPIN_BUTTON_GET_CLASS*(obj: pointer): PSpinButtonClass = - result = cast[PSpinButtonClass](CHECK_GET_CLASS(obj, TYPE_SPIN_BUTTON())) - -proc in_child*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_in_child) shr - bp_TGtkSpinButton_in_child - -proc set_in_child*(a: PSpinButton, `in_child`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`in_child` shl bp_TGtkSpinButton_in_child) and - bm_TGtkSpinButton_in_child) - -proc click_child*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_click_child) shr - bp_TGtkSpinButton_click_child - -proc set_click_child*(a: PSpinButton, `click_child`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`click_child` shl bp_TGtkSpinButton_click_child) and - bm_TGtkSpinButton_click_child) - -proc button*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_button) shr - bp_TGtkSpinButton_button - -proc set_button*(a: PSpinButton, `button`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`button` shl bp_TGtkSpinButton_button) and bm_TGtkSpinButton_button) - -proc need_timer*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_need_timer) shr - bp_TGtkSpinButton_need_timer - -proc set_need_timer*(a: PSpinButton, `need_timer`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`need_timer` shl bp_TGtkSpinButton_need_timer) and - bm_TGtkSpinButton_need_timer) - -proc timer_calls*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_timer_calls) shr - bp_TGtkSpinButton_timer_calls - -proc set_timer_calls*(a: PSpinButton, `timer_calls`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`timer_calls` shl bp_TGtkSpinButton_timer_calls) and - bm_TGtkSpinButton_timer_calls) - -proc digits*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_digits) shr - bp_TGtkSpinButton_digits - -proc set_digits*(a: PSpinButton, `digits`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`digits` shl bp_TGtkSpinButton_digits) and bm_TGtkSpinButton_digits) - -proc numeric*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_numeric) shr - bp_TGtkSpinButton_numeric - -proc set_numeric*(a: PSpinButton, `numeric`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`numeric` shl bp_TGtkSpinButton_numeric) and - bm_TGtkSpinButton_numeric) - -proc wrap*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_wrap) shr - bp_TGtkSpinButton_wrap - -proc set_wrap*(a: PSpinButton, `wrap`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`wrap` shl bp_TGtkSpinButton_wrap) and bm_TGtkSpinButton_wrap) - -proc snap_to_ticks*(a: PSpinButton): guint = - result = (a.SpinButtonflag0 and bm_TGtkSpinButton_snap_to_ticks) shr - bp_TGtkSpinButton_snap_to_ticks - -proc set_snap_to_ticks*(a: PSpinButton, `snap_to_ticks`: guint) = - a.SpinButtonflag0 = a.SpinButtonflag0 or - ((`snap_to_ticks` shl bp_TGtkSpinButton_snap_to_ticks) and - bm_TGtkSpinButton_snap_to_ticks) - -proc TYPE_STATUSBAR*(): GType = - result = statusbar_get_type() - -proc STATUSBAR*(obj: pointer): PStatusbar = - result = cast[PStatusbar](CHECK_CAST(obj, TYPE_STATUSBAR())) - -proc STATUSBAR_CLASS*(klass: pointer): PStatusbarClass = - result = cast[PStatusbarClass](CHECK_CLASS_CAST(klass, TYPE_STATUSBAR())) - -proc IS_STATUSBAR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_STATUSBAR()) - -proc IS_STATUSBAR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_STATUSBAR()) - -proc STATUSBAR_GET_CLASS*(obj: pointer): PStatusbarClass = - result = cast[PStatusbarClass](CHECK_GET_CLASS(obj, TYPE_STATUSBAR())) - -proc has_resize_grip*(a: PStatusbar): guint = - result = (a.Statusbarflag0 and bm_TGtkStatusbar_has_resize_grip) shr - bp_TGtkStatusbar_has_resize_grip - -proc set_has_resize_grip*(a: PStatusbar, `has_resize_grip`: guint) = - a.Statusbarflag0 = a.Statusbarflag0 or - (int16(`has_resize_grip` shl bp_TGtkStatusbar_has_resize_grip) and - bm_TGtkStatusbar_has_resize_grip) - -proc TYPE_TABLE*(): GType = - result = gtk2.table_get_type() - -proc TABLE*(obj: pointer): PTable = - result = cast[PTable](CHECK_CAST(obj, gtk2.TYPE_TABLE())) - -proc TABLE_CLASS*(klass: pointer): PTableClass = - result = cast[PTableClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_TABLE())) - -proc IS_TABLE*(obj: pointer): bool = - result = CHECK_TYPE(obj, gtk2.TYPE_TABLE()) - -proc IS_TABLE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_TABLE()) - -proc TABLE_GET_CLASS*(obj: pointer): PTableClass = - result = cast[PTableClass](CHECK_GET_CLASS(obj, gtk2.TYPE_TABLE())) - -proc homogeneous*(a: PTable): guint = - result = (a.Tableflag0 and bm_TGtkTable_homogeneous) shr - bp_TGtkTable_homogeneous - -proc set_homogeneous*(a: PTable, `homogeneous`: guint) = - a.Tableflag0 = a.Tableflag0 or - (int16(`homogeneous` shl bp_TGtkTable_homogeneous) and - bm_TGtkTable_homogeneous) - -proc xexpand*(a: PTableChild): guint = - result = (a.TableChildflag0 and bm_TGtkTableChild_xexpand) shr - bp_TGtkTableChild_xexpand - -proc set_xexpand*(a: PTableChild, `xexpand`: guint) = - a.TableChildflag0 = a.TableChildflag0 or - (int16(`xexpand` shl bp_TGtkTableChild_xexpand) and - bm_TGtkTableChild_xexpand) - -proc yexpand*(a: PTableChild): guint = - result = (a.TableChildflag0 and bm_TGtkTableChild_yexpand) shr - bp_TGtkTableChild_yexpand - -proc set_yexpand*(a: PTableChild, `yexpand`: guint) = - a.TableChildflag0 = a.TableChildflag0 or - (int16(`yexpand` shl bp_TGtkTableChild_yexpand) and - bm_TGtkTableChild_yexpand) - -proc xshrink*(a: PTableChild): guint = - result = (a.TableChildflag0 and bm_TGtkTableChild_xshrink) shr - bp_TGtkTableChild_xshrink - -proc set_xshrink*(a: PTableChild, `xshrink`: guint) = - a.TableChildflag0 = a.TableChildflag0 or - (int16(`xshrink` shl bp_TGtkTableChild_xshrink) and - bm_TGtkTableChild_xshrink) - -proc yshrink*(a: PTableChild): guint = - result = (a.TableChildflag0 and bm_TGtkTableChild_yshrink) shr - bp_TGtkTableChild_yshrink - -proc set_yshrink*(a: PTableChild, `yshrink`: guint) = - a.TableChildflag0 = a.TableChildflag0 or - (int16(`yshrink` shl bp_TGtkTableChild_yshrink) and - bm_TGtkTableChild_yshrink) - -proc xfill*(a: PTableChild): guint = - result = (a.TableChildflag0 and bm_TGtkTableChild_xfill) shr - bp_TGtkTableChild_xfill - -proc set_xfill*(a: PTableChild, `xfill`: guint) = - a.TableChildflag0 = a.TableChildflag0 or - (int16(`xfill` shl bp_TGtkTableChild_xfill) and bm_TGtkTableChild_xfill) - -proc yfill*(a: PTableChild): guint = - result = (a.TableChildflag0 and bm_TGtkTableChild_yfill) shr - bp_TGtkTableChild_yfill - -proc set_yfill*(a: PTableChild, `yfill`: guint) = - a.TableChildflag0 = a.TableChildflag0 or - (int16(`yfill` shl bp_TGtkTableChild_yfill) and bm_TGtkTableChild_yfill) - -proc need_expand*(a: PTableRowCol): guint = - result = (a.flag0 and bm_TGtkTableRowCol_need_expand) shr - bp_TGtkTableRowCol_need_expand - -proc set_need_expand*(a: PTableRowCol, `need_expand`: guint) = - a.flag0 = a.flag0 or - (int16(`need_expand` shl bp_TGtkTableRowCol_need_expand) and - bm_TGtkTableRowCol_need_expand) - -proc need_shrink*(a: PTableRowCol): guint = - result = (a.flag0 and bm_TGtkTableRowCol_need_shrink) shr - bp_TGtkTableRowCol_need_shrink - -proc set_need_shrink*(a: PTableRowCol, `need_shrink`: guint) = - a.flag0 = a.flag0 or - (int16(`need_shrink` shl bp_TGtkTableRowCol_need_shrink) and - bm_TGtkTableRowCol_need_shrink) - -proc expand*(a: PTableRowCol): guint = - result = (a.flag0 and bm_TGtkTableRowCol_expand) shr - bp_TGtkTableRowCol_expand - -proc set_expand*(a: PTableRowCol, `expand`: guint) = - a.flag0 = a.flag0 or - (int16(`expand` shl bp_TGtkTableRowCol_expand) and - bm_TGtkTableRowCol_expand) - -proc shrink*(a: PTableRowCol): guint = - result = (a.flag0 and bm_TGtkTableRowCol_shrink) shr - bp_TGtkTableRowCol_shrink - -proc set_shrink*(a: PTableRowCol, `shrink`: guint) = - a.flag0 = a.flag0 or - (int16(`shrink` shl bp_TGtkTableRowCol_shrink) and - bm_TGtkTableRowCol_shrink) - -proc empty*(a: PTableRowCol): guint = - result = (a.flag0 and bm_TGtkTableRowCol_empty) shr - bp_TGtkTableRowCol_empty - -proc set_empty*(a: PTableRowCol, `empty`: guint) = - a.flag0 = a.flag0 or - (int16(`empty` shl bp_TGtkTableRowCol_empty) and - bm_TGtkTableRowCol_empty) - -proc TYPE_TEAROFF_MENU_ITEM*(): GType = - result = tearoff_menu_item_get_type() - -proc TEAROFF_MENU_ITEM*(obj: pointer): PTearoffMenuItem = - result = cast[PTearoffMenuItem](CHECK_CAST(obj, TYPE_TEAROFF_MENU_ITEM())) - -proc TEAROFF_MENU_ITEM_CLASS*(klass: pointer): PTearoffMenuItemClass = - result = cast[PTearoffMenuItemClass](CHECK_CLASS_CAST(klass, - TYPE_TEAROFF_MENU_ITEM())) - -proc IS_TEAROFF_MENU_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TEAROFF_MENU_ITEM()) - -proc IS_TEAROFF_MENU_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TEAROFF_MENU_ITEM()) - -proc TEAROFF_MENU_ITEM_GET_CLASS*(obj: pointer): PTearoffMenuItemClass = - result = cast[PTearoffMenuItemClass](CHECK_GET_CLASS(obj, - TYPE_TEAROFF_MENU_ITEM())) - -proc torn_off*(a: PTearoffMenuItem): guint = - result = (a.TearoffMenuItemflag0 and bm_TGtkTearoffMenuItem_torn_off) shr - bp_TGtkTearoffMenuItem_torn_off - -proc set_torn_off*(a: PTearoffMenuItem, `torn_off`: guint) = - a.TearoffMenuItemflag0 = a.TearoffMenuItemflag0 or - (int16(`torn_off` shl bp_TGtkTearoffMenuItem_torn_off) and - bm_TGtkTearoffMenuItem_torn_off) - -proc TYPE_TEXT*(): GType = - result = gtk2.text_get_type() - -proc TEXT*(obj: pointer): PText = - result = cast[PText](CHECK_CAST(obj, gtk2.TYPE_TEXT())) - -proc TEXT_CLASS*(klass: pointer): PTextClass = - result = cast[PTextClass](CHECK_CLASS_CAST(klass, gtk2.TYPE_TEXT())) - -proc IS_TEXT*(obj: pointer): bool = - result = CHECK_TYPE(obj, gtk2.TYPE_TEXT()) - -proc IS_TEXT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, gtk2.TYPE_TEXT()) - -proc TEXT_GET_CLASS*(obj: pointer): PTextClass = - result = cast[PTextClass](CHECK_GET_CLASS(obj, gtk2.TYPE_TEXT())) - -proc line_wrap*(a: PText): guint = - result = (a.Textflag0 and bm_TGtkText_line_wrap) shr bp_TGtkText_line_wrap - -proc set_line_wrap*(a: PText, `line_wrap`: guint) = - a.Textflag0 = a.Textflag0 or - (int16(`line_wrap` shl bp_TGtkText_line_wrap) and bm_TGtkText_line_wrap) - -proc word_wrap*(a: PText): guint = - result = (a.Textflag0 and bm_TGtkText_word_wrap) shr bp_TGtkText_word_wrap - -proc set_word_wrap*(a: PText, `word_wrap`: guint) = - a.Textflag0 = a.Textflag0 or - (int16(`word_wrap` shl bp_TGtkText_word_wrap) and bm_TGtkText_word_wrap) - -proc use_wchar*(a: PText): gboolean = - result = ((a.Textflag0 and bm_TGtkText_use_wchar) shr bp_TGtkText_use_wchar) > - 0'i16 - -proc set_use_wchar*(a: PText, `use_wchar`: gboolean) = - if `use_wchar`: - a.Textflag0 = a.Textflag0 or bm_TGtkText_use_wchar - else: - a.Textflag0 = a.Textflag0 and not bm_TGtkText_use_wchar - -proc INDEX_WCHAR*(t: PText, index: guint): guint32 = - nil - -proc INDEX_UCHAR*(t: PText, index: guint): GUChar = - nil - -proc TYPE_TEXT_ITER*(): GType = - result = text_iter_get_type() - -proc TYPE_TEXT_TAG*(): GType = - result = text_tag_get_type() - -proc TEXT_TAG*(obj: pointer): PTextTag = - result = cast[PTextTag](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TEXT_TAG())) - -proc TEXT_TAG_CLASS*(klass: pointer): PTextTagClass = - result = cast[PTextTagClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_TEXT_TAG())) - -proc IS_TEXT_TAG*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT_TAG()) - -proc IS_TEXT_TAG_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_TAG()) - -proc TEXT_TAG_GET_CLASS*(obj: pointer): PTextTagClass = - result = cast[PTextTagClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_TEXT_TAG())) - -proc TYPE_TEXT_ATTRIBUTES*(): GType = - result = text_attributes_get_type() - -proc bg_color_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_bg_color_set) shr - bp_TGtkTextTag_bg_color_set - -proc set_bg_color_set*(a: PTextTag, `bg_color_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`bg_color_set` shl bp_TGtkTextTag_bg_color_set) and - bm_TGtkTextTag_bg_color_set) - -proc bg_stipple_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_bg_stipple_set) shr - bp_TGtkTextTag_bg_stipple_set - -proc set_bg_stipple_set*(a: PTextTag, `bg_stipple_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`bg_stipple_set` shl bp_TGtkTextTag_bg_stipple_set) and - bm_TGtkTextTag_bg_stipple_set) - -proc fg_color_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_fg_color_set) shr - bp_TGtkTextTag_fg_color_set - -proc set_fg_color_set*(a: PTextTag, `fg_color_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`fg_color_set` shl bp_TGtkTextTag_fg_color_set) and - bm_TGtkTextTag_fg_color_set) - -proc scale_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_scale_set) shr - bp_TGtkTextTag_scale_set - -proc set_scale_set*(a: PTextTag, `scale_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`scale_set` shl bp_TGtkTextTag_scale_set) and - bm_TGtkTextTag_scale_set) - -proc fg_stipple_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_fg_stipple_set) shr - bp_TGtkTextTag_fg_stipple_set - -proc set_fg_stipple_set*(a: PTextTag, `fg_stipple_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`fg_stipple_set` shl bp_TGtkTextTag_fg_stipple_set) and - bm_TGtkTextTag_fg_stipple_set) - -proc justification_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_justification_set) shr - bp_TGtkTextTag_justification_set - -proc set_justification_set*(a: PTextTag, `justification_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`justification_set` shl bp_TGtkTextTag_justification_set) and - bm_TGtkTextTag_justification_set) - -proc left_margin_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_left_margin_set) shr - bp_TGtkTextTag_left_margin_set - -proc set_left_margin_set*(a: PTextTag, `left_margin_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`left_margin_set` shl bp_TGtkTextTag_left_margin_set) and - bm_TGtkTextTag_left_margin_set) - -proc indent_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_indent_set) shr - bp_TGtkTextTag_indent_set - -proc set_indent_set*(a: PTextTag, `indent_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`indent_set` shl bp_TGtkTextTag_indent_set) and - bm_TGtkTextTag_indent_set) - -proc rise_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_rise_set) shr - bp_TGtkTextTag_rise_set - -proc set_rise_set*(a: PTextTag, `rise_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`rise_set` shl bp_TGtkTextTag_rise_set) and bm_TGtkTextTag_rise_set) - -proc strikethrough_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_strikethrough_set) shr - bp_TGtkTextTag_strikethrough_set - -proc set_strikethrough_set*(a: PTextTag, `strikethrough_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`strikethrough_set` shl bp_TGtkTextTag_strikethrough_set) and - bm_TGtkTextTag_strikethrough_set) - -proc right_margin_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_right_margin_set) shr - bp_TGtkTextTag_right_margin_set - -proc set_right_margin_set*(a: PTextTag, `right_margin_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`right_margin_set` shl bp_TGtkTextTag_right_margin_set) and - bm_TGtkTextTag_right_margin_set) - -proc pixels_above_lines_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_pixels_above_lines_set) shr - bp_TGtkTextTag_pixels_above_lines_set - -proc set_pixels_above_lines_set*(a: PTextTag, - `pixels_above_lines_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 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: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_pixels_below_lines_set) shr - bp_TGtkTextTag_pixels_below_lines_set - -proc set_pixels_below_lines_set*(a: PTextTag, - `pixels_below_lines_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 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: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_pixels_inside_wrap_set) shr - bp_TGtkTextTag_pixels_inside_wrap_set - -proc set_pixels_inside_wrap_set*(a: PTextTag, - `pixels_inside_wrap_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`pixels_inside_wrap_set` shl bp_TGtkTextTag_pixels_inside_wrap_set) and - bm_TGtkTextTag_pixels_inside_wrap_set) - -proc tabs_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_tabs_set) shr - bp_TGtkTextTag_tabs_set - -proc set_tabs_set*(a: PTextTag, `tabs_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`tabs_set` shl bp_TGtkTextTag_tabs_set) and bm_TGtkTextTag_tabs_set) - -proc underline_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_underline_set) shr - bp_TGtkTextTag_underline_set - -proc set_underline_set*(a: PTextTag, `underline_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`underline_set` shl bp_TGtkTextTag_underline_set) and - bm_TGtkTextTag_underline_set) - -proc wrap_mode_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_wrap_mode_set) shr - bp_TGtkTextTag_wrap_mode_set - -proc set_wrap_mode_set*(a: PTextTag, `wrap_mode_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`wrap_mode_set` shl bp_TGtkTextTag_wrap_mode_set) and - bm_TGtkTextTag_wrap_mode_set) - -proc bg_full_height_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_bg_full_height_set) shr - bp_TGtkTextTag_bg_full_height_set - -proc set_bg_full_height_set*(a: PTextTag, `bg_full_height_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`bg_full_height_set` shl bp_TGtkTextTag_bg_full_height_set) and - bm_TGtkTextTag_bg_full_height_set) - -proc invisible_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_invisible_set) shr - bp_TGtkTextTag_invisible_set - -proc set_invisible_set*(a: PTextTag, `invisible_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`invisible_set` shl bp_TGtkTextTag_invisible_set) and - bm_TGtkTextTag_invisible_set) - -proc editable_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_editable_set) shr - bp_TGtkTextTag_editable_set - -proc set_editable_set*(a: PTextTag, `editable_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`editable_set` shl bp_TGtkTextTag_editable_set) and - bm_TGtkTextTag_editable_set) - -proc language_set*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_language_set) shr - bp_TGtkTextTag_language_set - -proc set_language_set*(a: PTextTag, `language_set`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`language_set` shl bp_TGtkTextTag_language_set) and - bm_TGtkTextTag_language_set) - -proc pad1*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_pad1) shr bp_TGtkTextTag_pad1 - -proc set_pad1*(a: PTextTag, `pad1`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`pad1` shl bp_TGtkTextTag_pad1) and bm_TGtkTextTag_pad1) - -proc pad2*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_pad2) shr bp_TGtkTextTag_pad2 - -proc set_pad2*(a: PTextTag, `pad2`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`pad2` shl bp_TGtkTextTag_pad2) and bm_TGtkTextTag_pad2) - -proc pad3*(a: PTextTag): guint = - result = (a.TextTagflag0 and bm_TGtkTextTag_pad3) shr bp_TGtkTextTag_pad3 - -proc set_pad3*(a: PTextTag, `pad3`: guint) = - a.TextTagflag0 = a.TextTagflag0 or - ((`pad3` shl bp_TGtkTextTag_pad3) and bm_TGtkTextTag_pad3) - -proc underline*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_underline) shr - bp_TGtkTextAppearance_underline - -proc set_underline*(a: PTextAppearance, `underline`: guint) = - a.flag0 = a.flag0 or - (int16(`underline` shl bp_TGtkTextAppearance_underline) and - bm_TGtkTextAppearance_underline) - -proc strikethrough*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_strikethrough) shr - bp_TGtkTextAppearance_strikethrough - -proc set_strikethrough*(a: PTextAppearance, `strikethrough`: guint) = - a.flag0 = a.flag0 or - (int16(`strikethrough` shl bp_TGtkTextAppearance_strikethrough) and - bm_TGtkTextAppearance_strikethrough) - -proc draw_bg*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_draw_bg) shr - bp_TGtkTextAppearance_draw_bg - -proc set_draw_bg*(a: PTextAppearance, `draw_bg`: guint) = - a.flag0 = a.flag0 or - (int16(`draw_bg` shl bp_TGtkTextAppearance_draw_bg) and - bm_TGtkTextAppearance_draw_bg) - -proc inside_selection*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_inside_selection) shr - bp_TGtkTextAppearance_inside_selection - -proc set_inside_selection*(a: PTextAppearance, `inside_selection`: guint) = - a.flag0 = a.flag0 or - (int16(`inside_selection` shl bp_TGtkTextAppearance_inside_selection) and - bm_TGtkTextAppearance_inside_selection) - -proc is_text*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_is_text) shr - bp_TGtkTextAppearance_is_text - -proc set_is_text*(a: PTextAppearance, `is_text`: guint) = - a.flag0 = a.flag0 or - (int16(`is_text` shl bp_TGtkTextAppearance_is_text) and - bm_TGtkTextAppearance_is_text) - -proc pad1*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_pad1) shr - bp_TGtkTextAppearance_pad1 - -proc set_pad1*(a: PTextAppearance, `pad1`: guint) = - a.flag0 = a.flag0 or - (int16(`pad1` shl bp_TGtkTextAppearance_pad1) and - bm_TGtkTextAppearance_pad1) - -proc pad2*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_pad2) shr - bp_TGtkTextAppearance_pad2 - -proc set_pad2*(a: PTextAppearance, `pad2`: guint) = - a.flag0 = a.flag0 or - (int16(`pad2` shl bp_TGtkTextAppearance_pad2) and - bm_TGtkTextAppearance_pad2) - -proc pad3*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_pad3) shr - bp_TGtkTextAppearance_pad3 - -proc set_pad3*(a: PTextAppearance, `pad3`: guint) = - a.flag0 = a.flag0 or - (int16(`pad3` shl bp_TGtkTextAppearance_pad3) and - bm_TGtkTextAppearance_pad3) - -proc pad4*(a: PTextAppearance): guint = - result = (a.flag0 and bm_TGtkTextAppearance_pad4) shr - bp_TGtkTextAppearance_pad4 - -proc set_pad4*(a: PTextAppearance, `pad4`: guint) = - a.flag0 = a.flag0 or - (int16(`pad4` shl bp_TGtkTextAppearance_pad4) and - bm_TGtkTextAppearance_pad4) - -proc invisible*(a: PTextAttributes): guint = - result = (a.flag0 and bm_TGtkTextAttributes_invisible) shr - bp_TGtkTextAttributes_invisible - -proc set_invisible*(a: PTextAttributes, `invisible`: guint) = - a.flag0 = a.flag0 or - (int16(`invisible` shl bp_TGtkTextAttributes_invisible) and - bm_TGtkTextAttributes_invisible) - -proc bg_full_height*(a: PTextAttributes): guint = - result = (a.flag0 and bm_TGtkTextAttributes_bg_full_height) shr - bp_TGtkTextAttributes_bg_full_height - -proc set_bg_full_height*(a: PTextAttributes, `bg_full_height`: guint) = - a.flag0 = a.flag0 or - (int16(`bg_full_height` shl bp_TGtkTextAttributes_bg_full_height) and - bm_TGtkTextAttributes_bg_full_height) - -proc editable*(a: PTextAttributes): guint = - result = (a.flag0 and bm_TGtkTextAttributes_editable) shr - bp_TGtkTextAttributes_editable - -proc set_editable*(a: PTextAttributes, `editable`: guint) = - a.flag0 = a.flag0 or - (int16(`editable` shl bp_TGtkTextAttributes_editable) and - bm_TGtkTextAttributes_editable) - -proc realized*(a: PTextAttributes): guint = - result = (a.flag0 and bm_TGtkTextAttributes_realized) shr - bp_TGtkTextAttributes_realized - -proc set_realized*(a: PTextAttributes, `realized`: guint) = - a.flag0 = a.flag0 or - (int16(`realized` shl bp_TGtkTextAttributes_realized) and - bm_TGtkTextAttributes_realized) - -proc pad1*(a: PTextAttributes): guint = - result = (a.flag0 and bm_TGtkTextAttributes_pad1) shr - bp_TGtkTextAttributes_pad1 - -proc set_pad1*(a: PTextAttributes, `pad1`: guint) = - a.flag0 = a.flag0 or - (int16(`pad1` shl bp_TGtkTextAttributes_pad1) and - bm_TGtkTextAttributes_pad1) - -proc pad2*(a: PTextAttributes): guint = - result = (a.flag0 and bm_TGtkTextAttributes_pad2) shr - bp_TGtkTextAttributes_pad2 - -proc set_pad2*(a: PTextAttributes, `pad2`: guint) = - a.flag0 = a.flag0 or - (int16(`pad2` shl bp_TGtkTextAttributes_pad2) and - bm_TGtkTextAttributes_pad2) - -proc pad3*(a: PTextAttributes): guint = - result = (a.flag0 and bm_TGtkTextAttributes_pad3) shr - bp_TGtkTextAttributes_pad3 - -proc set_pad3*(a: PTextAttributes, `pad3`: guint) = - a.flag0 = a.flag0 or - (int16(`pad3` shl bp_TGtkTextAttributes_pad3) and - bm_TGtkTextAttributes_pad3) - -proc pad4*(a: PTextAttributes): guint = - result = (a.flag0 and bm_TGtkTextAttributes_pad4) shr - bp_TGtkTextAttributes_pad4 - -proc set_pad4*(a: PTextAttributes, `pad4`: guint) = - a.flag0 = a.flag0 or - (int16(`pad4` shl bp_TGtkTextAttributes_pad4) and - bm_TGtkTextAttributes_pad4) - -proc TYPE_TEXT_TAG_TABLE*(): GType = - result = text_tag_table_get_type() - -proc TEXT_TAG_TABLE*(obj: pointer): PTextTagTable = - result = cast[PTextTagTable](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_TEXT_TAG_TABLE())) - -proc TEXT_TAG_TABLE_CLASS*(klass: pointer): PTextTagTableClass = - result = cast[PTextTagTableClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_TEXT_TAG_TABLE())) - -proc IS_TEXT_TAG_TABLE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT_TAG_TABLE()) - -proc IS_TEXT_TAG_TABLE_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_TAG_TABLE()) - -proc TEXT_TAG_TABLE_GET_CLASS*(obj: pointer): PTextTagTableClass = - result = cast[PTextTagTableClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_TEXT_TAG_TABLE())) - -proc TYPE_TEXT_MARK*(): GType = - result = text_mark_get_type() - -proc TEXT_MARK*(anObject: pointer): PTextMark = - result = cast[PTextMark](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_TEXT_MARK())) - -proc TEXT_MARK_CLASS*(klass: pointer): PTextMarkClass = - result = cast[PTextMarkClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_TEXT_MARK())) - -proc IS_TEXT_MARK*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_TEXT_MARK()) - -proc IS_TEXT_MARK_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_MARK()) - -proc TEXT_MARK_GET_CLASS*(obj: pointer): PTextMarkClass = - result = cast[PTextMarkClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_TEXT_MARK())) - -proc visible*(a: PTextMarkBody): guint = - result = (a.flag0 and bm_TGtkTextMarkBody_visible) shr - bp_TGtkTextMarkBody_visible - -proc set_visible*(a: PTextMarkBody, `visible`: guint) = - a.flag0 = a.flag0 or - (int16(`visible` shl bp_TGtkTextMarkBody_visible) and - bm_TGtkTextMarkBody_visible) - -proc not_deleteable*(a: PTextMarkBody): guint = - result = (a.flag0 and bm_TGtkTextMarkBody_not_deleteable) shr - bp_TGtkTextMarkBody_not_deleteable - -proc set_not_deleteable*(a: PTextMarkBody, `not_deleteable`: guint) = - a.flag0 = a.flag0 or - (int16(`not_deleteable` shl bp_TGtkTextMarkBody_not_deleteable) and - bm_TGtkTextMarkBody_not_deleteable) - -proc TYPE_TEXT_CHILD_ANCHOR*(): GType = - result = text_child_anchor_get_type() - -proc TEXT_CHILD_ANCHOR*(anObject: pointer): PTextChildAnchor = - result = cast[PTextChildAnchor](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_TEXT_CHILD_ANCHOR())) - -proc TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): PTextChildAnchorClass = - result = cast[PTextChildAnchorClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_TEXT_CHILD_ANCHOR())) - -proc IS_TEXT_CHILD_ANCHOR*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_TEXT_CHILD_ANCHOR()) - -proc IS_TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_CHILD_ANCHOR()) - -proc TEXT_CHILD_ANCHOR_GET_CLASS*(obj: pointer): PTextChildAnchorClass = - result = cast[PTextChildAnchorClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_TEXT_CHILD_ANCHOR())) - -proc width*(a: PTextLineData): gint = - result = a.flag0 and bm_TGtkTextLineData_width - -proc set_width*(a: PTextLineData, NewWidth: gint) = - a.flag0 = (bm_TGtkTextLineData_width and NewWidth) or a.flag0 - -proc valid*(a: PTextLineData): gint = - result = (a.flag0 and bm_TGtkTextLineData_valid) shr - bp_TGtkTextLineData_valid - -proc set_valid*(a: PTextLineData, `valid`: gint) = - a.flag0 = a.flag0 or - ((`valid` shl bp_TGtkTextLineData_valid) and bm_TGtkTextLineData_valid) - -proc TYPE_TEXT_BUFFER*(): GType = - result = text_buffer_get_type() - -proc TEXT_BUFFER*(obj: pointer): PTextBuffer = - result = cast[PTextBuffer](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TEXT_BUFFER())) - -proc TEXT_BUFFER_CLASS*(klass: pointer): PTextBufferClass = - result = cast[PTextBufferClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_TEXT_BUFFER())) - -proc IS_TEXT_BUFFER*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT_BUFFER()) - -proc IS_TEXT_BUFFER_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_BUFFER()) - -proc TEXT_BUFFER_GET_CLASS*(obj: pointer): PTextBufferClass = - result = cast[PTextBufferClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_TEXT_BUFFER())) - -proc modified*(a: PTextBuffer): guint = - result = (a.TextBufferflag0 and bm_TGtkTextBuffer_modified) shr - bp_TGtkTextBuffer_modified - -proc set_modified*(a: PTextBuffer, `modified`: guint) = - a.TextBufferflag0 = a.TextBufferflag0 or - (int16(`modified` shl bp_TGtkTextBuffer_modified) and - bm_TGtkTextBuffer_modified) - -proc TYPE_TEXT_LAYOUT*(): GType = - result = text_layout_get_type() - -proc TEXT_LAYOUT*(obj: pointer): PTextLayout = - result = cast[PTextLayout](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TEXT_LAYOUT())) - -proc TEXT_LAYOUT_CLASS*(klass: pointer): PTextLayoutClass = - result = cast[PTextLayoutClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_TEXT_LAYOUT())) - -proc IS_TEXT_LAYOUT*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT_LAYOUT()) - -proc IS_TEXT_LAYOUT_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_LAYOUT()) - -proc TEXT_LAYOUT_GET_CLASS*(obj: pointer): PTextLayoutClass = - result = cast[PTextLayoutClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_TEXT_LAYOUT())) - -proc cursor_visible*(a: PTextLayout): guint = - result = (a.TextLayoutflag0 and bm_TGtkTextLayout_cursor_visible) shr - bp_TGtkTextLayout_cursor_visible - -proc set_cursor_visible*(a: PTextLayout, `cursor_visible`: guint) = - a.TextLayoutflag0 = a.TextLayoutflag0 or - (int16(`cursor_visible` shl bp_TGtkTextLayout_cursor_visible) and - bm_TGtkTextLayout_cursor_visible) - -proc cursor_direction*(a: PTextLayout): gint = - result = (a.TextLayoutflag0 and bm_TGtkTextLayout_cursor_direction) shr - bp_TGtkTextLayout_cursor_direction - -proc set_cursor_direction*(a: PTextLayout, `cursor_direction`: gint) = - a.TextLayoutflag0 = a.TextLayoutflag0 or - (int16(`cursor_direction` shl bp_TGtkTextLayout_cursor_direction) and - bm_TGtkTextLayout_cursor_direction) - -proc is_strong*(a: PTextCursorDisplay): guint = - result = (a.flag0 and bm_TGtkTextCursorDisplay_is_strong) shr - bp_TGtkTextCursorDisplay_is_strong - -proc set_is_strong*(a: PTextCursorDisplay, `is_strong`: guint) = - a.flag0 = a.flag0 or - (int16(`is_strong` shl bp_TGtkTextCursorDisplay_is_strong) and - bm_TGtkTextCursorDisplay_is_strong) - -proc is_weak*(a: PTextCursorDisplay): guint = - result = (a.flag0 and bm_TGtkTextCursorDisplay_is_weak) shr - bp_TGtkTextCursorDisplay_is_weak - -proc set_is_weak*(a: PTextCursorDisplay, `is_weak`: guint) = - a.flag0 = a.flag0 or - (int16(`is_weak` shl bp_TGtkTextCursorDisplay_is_weak) and - bm_TGtkTextCursorDisplay_is_weak) - -proc TYPE_TEXT_VIEW*(): GType = - result = text_view_get_type() - -proc TEXT_VIEW*(obj: pointer): PTextView = - result = cast[PTextView](CHECK_CAST(obj, TYPE_TEXT_VIEW())) - -proc TEXT_VIEW_CLASS*(klass: pointer): PTextViewClass = - result = cast[PTextViewClass](CHECK_CLASS_CAST(klass, TYPE_TEXT_VIEW())) - -proc IS_TEXT_VIEW*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TEXT_VIEW()) - -proc IS_TEXT_VIEW_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TEXT_VIEW()) - -proc TEXT_VIEW_GET_CLASS*(obj: pointer): PTextViewClass = - result = cast[PTextViewClass](CHECK_GET_CLASS(obj, TYPE_TEXT_VIEW())) - -proc editable*(a: PTextView): guint = - result = (a.TextViewflag0 and bm_TGtkTextView_editable) shr - bp_TGtkTextView_editable - -proc set_editable*(a: PTextView, `editable`: guint) = - a.TextViewflag0 = a.TextViewflag0 or - (int16(`editable` shl bp_TGtkTextView_editable) and - bm_TGtkTextView_editable) - -proc overwrite_mode*(a: PTextView): guint = - result = (a.TextViewflag0 and bm_TGtkTextView_overwrite_mode) shr - bp_TGtkTextView_overwrite_mode - -proc set_overwrite_mode*(a: PTextView, `overwrite_mode`: guint) = - a.TextViewflag0 = a.TextViewflag0 or - (int16(`overwrite_mode` shl bp_TGtkTextView_overwrite_mode) and - bm_TGtkTextView_overwrite_mode) - -proc cursor_visible*(a: PTextView): guint = - result = (a.TextViewflag0 and bm_TGtkTextView_cursor_visible) shr - bp_TGtkTextView_cursor_visible - -proc set_cursor_visible*(a: PTextView, `cursor_visible`: guint) = - a.TextViewflag0 = a.TextViewflag0 or - (int16(`cursor_visible` shl bp_TGtkTextView_cursor_visible) and - bm_TGtkTextView_cursor_visible) - -proc need_im_reset*(a: PTextView): guint = - result = (a.TextViewflag0 and bm_TGtkTextView_need_im_reset) shr - bp_TGtkTextView_need_im_reset - -proc set_need_im_reset*(a: PTextView, `need_im_reset`: guint) = - a.TextViewflag0 = a.TextViewflag0 or - (int16(`need_im_reset` shl bp_TGtkTextView_need_im_reset) and - bm_TGtkTextView_need_im_reset) - -proc just_selected_element*(a: PTextView): guint = - result = (a.TextViewflag0 and bm_TGtkTextView_just_selected_element) shr - bp_TGtkTextView_just_selected_element - -proc set_just_selected_element*(a: PTextView, `just_selected_element`: guint) = - a.TextViewflag0 = a.TextViewflag0 or - (int16(`just_selected_element` shl - bp_TGtkTextView_just_selected_element) and - bm_TGtkTextView_just_selected_element) - -proc disable_scroll_on_focus*(a: PTextView): guint = - result = (a.TextViewflag0 and bm_TGtkTextView_disable_scroll_on_focus) shr - bp_TGtkTextView_disable_scroll_on_focus - -proc set_disable_scroll_on_focus*(a: PTextView, - `disable_scroll_on_focus`: guint) = - a.TextViewflag0 = a.TextViewflag0 or - (int16(`disable_scroll_on_focus` shl - bp_TGtkTextView_disable_scroll_on_focus) and - bm_TGtkTextView_disable_scroll_on_focus) - -proc onscreen_validated*(a: PTextView): guint = - result = (a.TextViewflag0 and bm_TGtkTextView_onscreen_validated) shr - bp_TGtkTextView_onscreen_validated - -proc set_onscreen_validated*(a: PTextView, `onscreen_validated`: guint) = - a.TextViewflag0 = a.TextViewflag0 or - (int16(`onscreen_validated` shl bp_TGtkTextView_onscreen_validated) and - bm_TGtkTextView_onscreen_validated) - -proc mouse_cursor_obscured*(a: PTextView): guint = - result = (a.TextViewflag0 and bm_TGtkTextView_mouse_cursor_obscured) shr - bp_TGtkTextView_mouse_cursor_obscured - -proc set_mouse_cursor_obscured*(a: PTextView, `mouse_cursor_obscured`: guint) = - a.TextViewflag0 = a.TextViewflag0 or - (int16(`mouse_cursor_obscured` shl - bp_TGtkTextView_mouse_cursor_obscured) and - bm_TGtkTextView_mouse_cursor_obscured) - -proc TYPE_TIPS_QUERY*(): GType = - result = tips_query_get_type() - -proc TIPS_QUERY*(obj: pointer): PTipsQuery = - result = cast[PTipsQuery](CHECK_CAST(obj, TYPE_TIPS_QUERY())) - -proc TIPS_QUERY_CLASS*(klass: pointer): PTipsQueryClass = - result = cast[PTipsQueryClass](CHECK_CLASS_CAST(klass, TYPE_TIPS_QUERY())) - -proc IS_TIPS_QUERY*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TIPS_QUERY()) - -proc IS_TIPS_QUERY_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TIPS_QUERY()) - -proc TIPS_QUERY_GET_CLASS*(obj: pointer): PTipsQueryClass = - result = cast[PTipsQueryClass](CHECK_GET_CLASS(obj, TYPE_TIPS_QUERY())) - -proc emit_always*(a: PTipsQuery): guint = - result = (a.TipsQueryflag0 and bm_TGtkTipsQuery_emit_always) shr - bp_TGtkTipsQuery_emit_always - -proc set_emit_always*(a: PTipsQuery, `emit_always`: guint) = - a.TipsQueryflag0 = a.TipsQueryflag0 or - (int16(`emit_always` shl bp_TGtkTipsQuery_emit_always) and - bm_TGtkTipsQuery_emit_always) - -proc in_query*(a: PTipsQuery): guint = - result = (a.TipsQueryflag0 and bm_TGtkTipsQuery_in_query) shr - bp_TGtkTipsQuery_in_query - -proc set_in_query*(a: PTipsQuery, `in_query`: guint) = - a.TipsQueryflag0 = a.TipsQueryflag0 or - (int16(`in_query` shl bp_TGtkTipsQuery_in_query) and - bm_TGtkTipsQuery_in_query) - -proc TYPE_TOOLTIPS*(): GType = - result = tooltips_get_type() - -proc TOOLTIPS*(obj: pointer): PTooltips = - result = cast[PTooltips](CHECK_CAST(obj, TYPE_TOOLTIPS())) - -proc TOOLTIPS_CLASS*(klass: pointer): PTooltipsClass = - result = cast[PTooltipsClass](CHECK_CLASS_CAST(klass, TYPE_TOOLTIPS())) - -proc IS_TOOLTIPS*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TOOLTIPS()) - -proc IS_TOOLTIPS_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TOOLTIPS()) - -proc TOOLTIPS_GET_CLASS*(obj: pointer): PTooltipsClass = - result = cast[PTooltipsClass](CHECK_GET_CLASS(obj, TYPE_TOOLTIPS())) - -proc delay*(a: PTooltips): guint = - result = (a.Tooltipsflag0 and bm_TGtkTooltips_delay) shr - bp_TGtkTooltips_delay - -proc set_delay*(a: PTooltips, `delay`: guint) = - a.Tooltipsflag0 = a.Tooltipsflag0 or - ((`delay` shl bp_TGtkTooltips_delay) and bm_TGtkTooltips_delay) - -proc enabled*(a: PTooltips): guint = - result = (a.Tooltipsflag0 and bm_TGtkTooltips_enabled) shr - bp_TGtkTooltips_enabled - -proc set_enabled*(a: PTooltips, `enabled`: guint) = - a.Tooltipsflag0 = a.Tooltipsflag0 or - ((`enabled` shl bp_TGtkTooltips_enabled) and bm_TGtkTooltips_enabled) - -proc have_grab*(a: PTooltips): guint = - result = (a.Tooltipsflag0 and bm_TGtkTooltips_have_grab) shr - bp_TGtkTooltips_have_grab - -proc set_have_grab*(a: PTooltips, `have_grab`: guint) = - a.Tooltipsflag0 = a.Tooltipsflag0 or - ((`have_grab` shl bp_TGtkTooltips_have_grab) and - bm_TGtkTooltips_have_grab) - -proc use_sticky_delay*(a: PTooltips): guint = - result = (a.Tooltipsflag0 and bm_TGtkTooltips_use_sticky_delay) shr - bp_TGtkTooltips_use_sticky_delay - -proc set_use_sticky_delay*(a: PTooltips, `use_sticky_delay`: guint) = - a.Tooltipsflag0 = a.Tooltipsflag0 or - ((`use_sticky_delay` shl bp_TGtkTooltips_use_sticky_delay) and - bm_TGtkTooltips_use_sticky_delay) - -proc TYPE_TOOLBAR*(): GType = - result = toolbar_get_type() - -proc TOOLBAR*(obj: pointer): PToolbar = - result = cast[PToolbar](CHECK_CAST(obj, TYPE_TOOLBAR())) - -proc TOOLBAR_CLASS*(klass: pointer): PToolbarClass = - result = cast[PToolbarClass](CHECK_CLASS_CAST(klass, TYPE_TOOLBAR())) - -proc IS_TOOLBAR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TOOLBAR()) - -proc IS_TOOLBAR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TOOLBAR()) - -proc TOOLBAR_GET_CLASS*(obj: pointer): PToolbarClass = - result = cast[PToolbarClass](CHECK_GET_CLASS(obj, TYPE_TOOLBAR())) - -proc style_set*(a: PToolbar): guint = - result = (a.Toolbarflag0 and bm_TGtkToolbar_style_set) shr - bp_TGtkToolbar_style_set - -proc set_style_set*(a: PToolbar, `style_set`: guint) = - a.Toolbarflag0 = a.Toolbarflag0 or - (int16(`style_set` shl bp_TGtkToolbar_style_set) and - bm_TGtkToolbar_style_set) - -proc icon_size_set*(a: PToolbar): guint = - result = (a.Toolbarflag0 and bm_TGtkToolbar_icon_size_set) shr - bp_TGtkToolbar_icon_size_set - -proc set_icon_size_set*(a: PToolbar, `icon_size_set`: guint) = - a.Toolbarflag0 = a.Toolbarflag0 or - (int16(`icon_size_set` shl bp_TGtkToolbar_icon_size_set) and - bm_TGtkToolbar_icon_size_set) - -proc TYPE_TREE*(): GType = - result = tree_get_type() - -proc TREE*(obj: pointer): PTree = - result = cast[PTree](CHECK_CAST(obj, TYPE_TREE())) - -proc TREE_CLASS*(klass: pointer): PTreeClass = - result = cast[PTreeClass](CHECK_CLASS_CAST(klass, TYPE_TREE())) - -proc IS_TREE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TREE()) - -proc IS_TREE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TREE()) - -proc TREE_GET_CLASS*(obj: pointer): PTreeClass = - result = cast[PTreeClass](CHECK_GET_CLASS(obj, TYPE_TREE())) - -proc IS_ROOT_TREE*(obj: pointer): bool = - result = (cast[PObject]((TREE(obj)).root_tree)) == (cast[PObject](obj)) - -proc TREE_ROOT_TREE*(obj: pointer): PTree = - result = TREE(obj).root_tree - -proc TREE_SELECTION_OLD*(obj: pointer): PGList = - result = (TREE_ROOT_TREE(obj)).selection - -proc selection_mode*(a: PTree): guint = - result = (a.Treeflag0 and bm_TGtkTree_selection_mode) shr - bp_TGtkTree_selection_mode - -proc set_selection_mode*(a: PTree, `selection_mode`: guint) = - a.Treeflag0 = a.Treeflag0 or - (int16(`selection_mode` shl bp_TGtkTree_selection_mode) and - bm_TGtkTree_selection_mode) - -proc view_mode*(a: PTree): guint = - result = (a.Treeflag0 and bm_TGtkTree_view_mode) shr bp_TGtkTree_view_mode - -proc set_view_mode*(a: PTree, `view_mode`: guint) = - a.Treeflag0 = a.Treeflag0 or - (int16(`view_mode` shl bp_TGtkTree_view_mode) and bm_TGtkTree_view_mode) - -proc view_line*(a: PTree): guint = - result = (a.Treeflag0 and bm_TGtkTree_view_line) shr bp_TGtkTree_view_line - -proc set_view_line*(a: PTree, `view_line`: guint) = - a.Treeflag0 = a.Treeflag0 or - (int16(`view_line` shl bp_TGtkTree_view_line) and bm_TGtkTree_view_line) - -proc TYPE_TREE_DRAG_SOURCE*(): GType = - result = tree_drag_source_get_type() - -proc TREE_DRAG_SOURCE*(obj: pointer): PTreeDragSource = - result = cast[PTreeDragSource](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_TREE_DRAG_SOURCE())) - -proc IS_TREE_DRAG_SOURCE*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TREE_DRAG_SOURCE()) - -proc TREE_DRAG_SOURCE_GET_IFACE*(obj: pointer): PTreeDragSourceIface = - result = cast[PTreeDragSourceIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_TREE_DRAG_SOURCE())) - -proc TYPE_TREE_DRAG_DEST*(): GType = - result = tree_drag_dest_get_type() - -proc TREE_DRAG_DEST*(obj: pointer): PTreeDragDest = - result = cast[PTreeDragDest](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_TREE_DRAG_DEST())) - -proc IS_TREE_DRAG_DEST*(obj: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TREE_DRAG_DEST()) - -proc TREE_DRAG_DEST_GET_IFACE*(obj: pointer): PTreeDragDestIface = - result = cast[PTreeDragDestIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, - TYPE_TREE_DRAG_DEST())) - -proc TYPE_TREE_ITEM*(): GType = - result = tree_item_get_type() - -proc TREE_ITEM*(obj: pointer): PTreeItem = - result = cast[PTreeItem](CHECK_CAST(obj, TYPE_TREE_ITEM())) - -proc TREE_ITEM_CLASS*(klass: pointer): PTreeItemClass = - result = cast[PTreeItemClass](CHECK_CLASS_CAST(klass, TYPE_TREE_ITEM())) - -proc IS_TREE_ITEM*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TREE_ITEM()) - -proc IS_TREE_ITEM_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TREE_ITEM()) - -proc TREE_ITEM_GET_CLASS*(obj: pointer): PTreeItemClass = - result = cast[PTreeItemClass](CHECK_GET_CLASS(obj, TYPE_TREE_ITEM())) - -proc TREE_ITEM_SUBTREE*(obj: pointer): PWidget = - result = (TREE_ITEM(obj)).subtree - -proc expanded*(a: PTreeItem): guint = - result = (a.TreeItemflag0 and bm_TGtkTreeItem_expanded) shr - bp_TGtkTreeItem_expanded - -proc set_expanded*(a: PTreeItem, `expanded`: guint) = - a.TreeItemflag0 = a.TreeItemflag0 or - (int16(`expanded` shl bp_TGtkTreeItem_expanded) and - bm_TGtkTreeItem_expanded) - -proc TYPE_TREE_SELECTION*(): GType = - result = tree_selection_get_type() - -proc TREE_SELECTION*(obj: pointer): PTreeSelection = - result = cast[PTreeSelection](CHECK_CAST(obj, TYPE_TREE_SELECTION())) - -proc TREE_SELECTION_CLASS*(klass: pointer): PTreeSelectionClass = - result = cast[PTreeSelectionClass](CHECK_CLASS_CAST(klass, - TYPE_TREE_SELECTION())) - -proc IS_TREE_SELECTION*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TREE_SELECTION()) - -proc IS_TREE_SELECTION_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TREE_SELECTION()) - -proc TREE_SELECTION_GET_CLASS*(obj: pointer): PTreeSelectionClass = - result = cast[PTreeSelectionClass](CHECK_GET_CLASS(obj, TYPE_TREE_SELECTION())) - -proc TYPE_TREE_STORE*(): GType = - result = tree_store_get_type() - -proc TREE_STORE*(obj: pointer): PTreeStore = - result = cast[PTreeStore](CHECK_CAST(obj, TYPE_TREE_STORE())) - -proc TREE_STORE_CLASS*(klass: pointer): PTreeStoreClass = - result = cast[PTreeStoreClass](CHECK_CLASS_CAST(klass, TYPE_TREE_STORE())) - -proc IS_TREE_STORE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TREE_STORE()) - -proc IS_TREE_STORE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TREE_STORE()) - -proc TREE_STORE_GET_CLASS*(obj: pointer): PTreeStoreClass = - result = cast[PTreeStoreClass](CHECK_GET_CLASS(obj, TYPE_TREE_STORE())) - -proc columns_dirty*(a: PTreeStore): guint = - result = (a.TreeStoreflag0 and bm_TGtkTreeStore_columns_dirty) shr - bp_TGtkTreeStore_columns_dirty - -proc set_columns_dirty*(a: PTreeStore, `columns_dirty`: guint) = - a.TreeStoreflag0 = a.TreeStoreflag0 or - (int16(`columns_dirty` shl bp_TGtkTreeStore_columns_dirty) and - bm_TGtkTreeStore_columns_dirty) - -proc TYPE_TREE_VIEW_COLUMN*(): GType = - result = tree_view_column_get_type() - -proc TREE_VIEW_COLUMN*(obj: pointer): PTreeViewColumn = - result = cast[PTreeViewColumn](CHECK_CAST(obj, TYPE_TREE_VIEW_COLUMN())) - -proc TREE_VIEW_COLUMN_CLASS*(klass: pointer): PTreeViewColumnClass = - result = cast[PTreeViewColumnClass](CHECK_CLASS_CAST(klass, - TYPE_TREE_VIEW_COLUMN())) - -proc IS_TREE_VIEW_COLUMN*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TREE_VIEW_COLUMN()) - -proc IS_TREE_VIEW_COLUMN_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TREE_VIEW_COLUMN()) - -proc TREE_VIEW_COLUMN_GET_CLASS*(obj: pointer): PTreeViewColumnClass = - result = cast[PTreeViewColumnClass](CHECK_GET_CLASS(obj, - TYPE_TREE_VIEW_COLUMN())) - -proc visible*(a: PTreeViewColumn): guint = - result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_visible) shr - bp_TGtkTreeViewColumn_visible - -proc set_visible*(a: PTreeViewColumn, `visible`: guint) = - a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or - (int16(`visible` shl bp_TGtkTreeViewColumn_visible) and - bm_TGtkTreeViewColumn_visible) - -proc resizable*(a: PTreeViewColumn): guint = - result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_resizable) shr - bp_TGtkTreeViewColumn_resizable - -proc set_resizable*(a: PTreeViewColumn, `resizable`: guint) = - a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or - (int16(`resizable` shl bp_TGtkTreeViewColumn_resizable) and - bm_TGtkTreeViewColumn_resizable) - -proc clickable*(a: PTreeViewColumn): guint = - result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_clickable) shr - bp_TGtkTreeViewColumn_clickable - -proc set_clickable*(a: PTreeViewColumn, `clickable`: guint) = - a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or - (int16(`clickable` shl bp_TGtkTreeViewColumn_clickable) and - bm_TGtkTreeViewColumn_clickable) - -proc dirty*(a: PTreeViewColumn): guint = - result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_dirty) shr - bp_TGtkTreeViewColumn_dirty - -proc set_dirty*(a: PTreeViewColumn, `dirty`: guint) = - a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or - (int16(`dirty` shl bp_TGtkTreeViewColumn_dirty) and - bm_TGtkTreeViewColumn_dirty) - -proc show_sort_indicator*(a: PTreeViewColumn): guint = - result = (a.TreeViewColumnflag0 and - bm_TGtkTreeViewColumn_show_sort_indicator) shr - bp_TGtkTreeViewColumn_show_sort_indicator - -proc set_show_sort_indicator*(a: PTreeViewColumn, - `show_sort_indicator`: guint) = - a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or - (int16(`show_sort_indicator` shl - bp_TGtkTreeViewColumn_show_sort_indicator) and - bm_TGtkTreeViewColumn_show_sort_indicator) - -proc maybe_reordered*(a: PTreeViewColumn): guint = - result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_maybe_reordered) shr - bp_TGtkTreeViewColumn_maybe_reordered - -proc set_maybe_reordered*(a: PTreeViewColumn, `maybe_reordered`: guint) = - a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or - (int16(`maybe_reordered` shl bp_TGtkTreeViewColumn_maybe_reordered) and - bm_TGtkTreeViewColumn_maybe_reordered) - -proc reorderable*(a: PTreeViewColumn): guint = - result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_reorderable) shr - bp_TGtkTreeViewColumn_reorderable - -proc set_reorderable*(a: PTreeViewColumn, `reorderable`: guint) = - a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or - (int16(`reorderable` shl bp_TGtkTreeViewColumn_reorderable) and - bm_TGtkTreeViewColumn_reorderable) - -proc use_resized_width*(a: PTreeViewColumn): guint = - result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_use_resized_width) shr - bp_TGtkTreeViewColumn_use_resized_width - -proc set_use_resized_width*(a: PTreeViewColumn, `use_resized_width`: guint) = - a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or - (int16(`use_resized_width` shl bp_TGtkTreeViewColumn_use_resized_width) and - bm_TGtkTreeViewColumn_use_resized_width) - -proc flags*(a: PRBNode): guint = - result = (a.flag0 and bm_TGtkRBNode_flags) shr bp_TGtkRBNode_flags - -proc set_flags*(a: PRBNode, `flags`: guint) = - a.flag0 = a.flag0 or - (int16(`flags` shl bp_TGtkRBNode_flags) and bm_TGtkRBNode_flags) - -proc parity*(a: PRBNode): guint = - result = (a.flag0 and bm_TGtkRBNode_parity) shr bp_TGtkRBNode_parity - -proc set_parity*(a: PRBNode, `parity`: guint) = - a.flag0 = a.flag0 or - (int16(`parity` shl bp_TGtkRBNode_parity) and bm_TGtkRBNode_parity) - -proc GET_COLOR*(node: PRBNode): guint = - if node == nil: - Result = RBNODE_BLACK - elif (int(flags(node)) and RBNODE_RED) == RBNODE_RED: - Result = RBNODE_RED - else: - Result = RBNODE_BLACK - -proc SET_COLOR*(node: PRBNode, color: guint) = - if node == nil: - return - if ((flags(node) and (color)) != color): - set_flags(node, flags(node) xor cint(RBNODE_RED or RBNODE_BLACK)) - -proc GET_HEIGHT*(node: PRBNode): gint = - var if_local1: gint - if node.children != nil: - if_local1 = node.children.root.offset - else: - if_local1 = 0 - result = node.offset - - ((node.left.offset) + node.right.offset + if_local1) - -proc FLAG_SET*(node: PRBNode, flag: guint): bool = - result = (node != nil) and ((flags(node) and (flag)) == flag) - -proc SET_FLAG*(node: PRBNode, flag: guint16) = - set_flags(node, (flag) or flags(node)) - -proc UNSET_FLAG*(node: PRBNode, flag: guint16) = - set_flags(node, (not (flag)) and flags(node)) - -proc FLAG_SET*(tree_view: PTreeView, flag: guint): bool = - result = ((tree_view.priv.flags) and (flag)) == flag - -proc HEADER_HEIGHT*(tree_view: PTreeView): int32 = - var if_local1: int32 - if FLAG_SET(tree_view, TREE_VIEW_HEADERS_VISIBLE): - if_local1 = tree_view.priv.header_height - else: - if_local1 = 0 - result = if_local1 - -proc COLUMN_REQUESTED_WIDTH*(column: PTreeViewColumn): int32 = - var MinWidth, MaxWidth: int - if column.min_width != - 1'i32: - MinWidth = column.min_width - else: - MinWidth = column.requested_width - if column.max_width != - 1'i32: - MaxWidth = column.max_width - else: - MaxWidth = column.requested_width - result = CLAMP(column.requested_width, MinWidth, MaxWidth).int32 - -proc DRAW_EXPANDERS*(tree_view: PTreeView): bool = - result = (not (FLAG_SET(tree_view, TREE_VIEW_IS_LIST))) and - (FLAG_SET(tree_view, TREE_VIEW_SHOW_EXPANDERS)) - -proc COLUMN_DRAG_DEAD_MULTIPLIER*(tree_view: PTreeView): int32 = - result = 10'i32 * (HEADER_HEIGHT(tree_view)) - -proc scroll_to_use_align*(a: PTreeViewPrivate): 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: PTreeViewPrivate, - `scroll_to_use_align`: guint) = - a.flag0 = a.flag0 or - (int16(`scroll_to_use_align` shl - bp_TGtkTreeViewPrivate_scroll_to_use_align) and - bm_TGtkTreeViewPrivate_scroll_to_use_align) - -proc fixed_height_check*(a: PTreeViewPrivate): guint = - result = (a.flag0 and bm_TGtkTreeViewPrivate_fixed_height_check) shr - bp_TGtkTreeViewPrivate_fixed_height_check - -proc set_fixed_height_check*(a: PTreeViewPrivate, - `fixed_height_check`: guint) = - a.flag0 = a.flag0 or - (int16(`fixed_height_check` shl - bp_TGtkTreeViewPrivate_fixed_height_check) and - bm_TGtkTreeViewPrivate_fixed_height_check) - -proc reorderable*(a: PTreeViewPrivate): guint = - result = (a.flag0 and bm_TGtkTreeViewPrivate_reorderable) shr - bp_TGtkTreeViewPrivate_reorderable - -proc set_reorderable*(a: PTreeViewPrivate, `reorderable`: guint) = - a.flag0 = a.flag0 or - (int16(`reorderable` shl bp_TGtkTreeViewPrivate_reorderable) and - bm_TGtkTreeViewPrivate_reorderable) - -proc header_has_focus*(a: PTreeViewPrivate): guint = - result = (a.flag0 and bm_TGtkTreeViewPrivate_header_has_focus) shr - bp_TGtkTreeViewPrivate_header_has_focus - -proc set_header_has_focus*(a: PTreeViewPrivate, `header_has_focus`: guint) = - a.flag0 = a.flag0 or - (int16(`header_has_focus` shl bp_TGtkTreeViewPrivate_header_has_focus) and - bm_TGtkTreeViewPrivate_header_has_focus) - -proc drag_column_window_state*(a: PTreeViewPrivate): 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: PTreeViewPrivate, - `drag_column_window_state`: guint) = - a.flag0 = a.flag0 or - (int16(`drag_column_window_state` shl - bp_TGtkTreeViewPrivate_drag_column_window_state) and - bm_TGtkTreeViewPrivate_drag_column_window_state) - -proc has_rules*(a: PTreeViewPrivate): guint = - result = (a.flag0 and bm_TGtkTreeViewPrivate_has_rules) shr - bp_TGtkTreeViewPrivate_has_rules - -proc set_has_rules*(a: PTreeViewPrivate, `has_rules`: guint) = - a.flag0 = a.flag0 or - (int16(`has_rules` shl bp_TGtkTreeViewPrivate_has_rules) and - bm_TGtkTreeViewPrivate_has_rules) - -proc mark_rows_col_dirty*(a: PTreeViewPrivate): 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: PTreeViewPrivate, - `mark_rows_col_dirty`: guint) = - a.flag0 = a.flag0 or - (int16(`mark_rows_col_dirty` shl - bp_TGtkTreeViewPrivate_mark_rows_col_dirty) and - bm_TGtkTreeViewPrivate_mark_rows_col_dirty) - -proc enable_search*(a: PTreeViewPrivate): guint = - result = (a.flag0 and bm_TGtkTreeViewPrivate_enable_search) shr - bp_TGtkTreeViewPrivate_enable_search - -proc set_enable_search*(a: PTreeViewPrivate, `enable_search`: guint) = - a.flag0 = a.flag0 or - (int16(`enable_search` shl bp_TGtkTreeViewPrivate_enable_search) and - bm_TGtkTreeViewPrivate_enable_search) - -proc disable_popdown*(a: PTreeViewPrivate): guint = - result = (a.flag0 and bm_TGtkTreeViewPrivate_disable_popdown) shr - bp_TGtkTreeViewPrivate_disable_popdown - -proc set_disable_popdown*(a: PTreeViewPrivate, `disable_popdown`: guint) = - a.flag0 = a.flag0 or - (int16(`disable_popdown` shl bp_TGtkTreeViewPrivate_disable_popdown) and - bm_TGtkTreeViewPrivate_disable_popdown) - -proc SET_FLAG*(tree_view: PTreeView, flag: guint) = - tree_view.priv.flags = tree_view.priv.flags or (flag) - -proc UNSET_FLAG*(tree_view: PTreeView, flag: guint) = - tree_view.priv.flags = tree_view.priv.flags and not (flag) - -proc TYPE_TREE_VIEW*(): GType = - result = tree_view_get_type() - -proc TREE_VIEW*(obj: pointer): PTreeView = - result = cast[PTreeView](CHECK_CAST(obj, TYPE_TREE_VIEW())) - -proc TREE_VIEW_CLASS*(klass: pointer): PTreeViewClass = - result = cast[PTreeViewClass](CHECK_CLASS_CAST(klass, TYPE_TREE_VIEW())) - -proc IS_TREE_VIEW*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_TREE_VIEW()) - -proc IS_TREE_VIEW_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_TREE_VIEW()) - -proc TREE_VIEW_GET_CLASS*(obj: pointer): PTreeViewClass = - result = cast[PTreeViewClass](CHECK_GET_CLASS(obj, TYPE_TREE_VIEW())) - -proc TYPE_VBUTTON_BOX*(): GType = - result = vbutton_box_get_type() - -proc VBUTTON_BOX*(obj: pointer): PVButtonBox = - result = cast[PVButtonBox](CHECK_CAST(obj, TYPE_VBUTTON_BOX())) - -proc VBUTTON_BOX_CLASS*(klass: pointer): PVButtonBoxClass = - result = cast[PVButtonBoxClass](CHECK_CLASS_CAST(klass, TYPE_VBUTTON_BOX())) - -proc IS_VBUTTON_BOX*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_VBUTTON_BOX()) - -proc IS_VBUTTON_BOX_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_VBUTTON_BOX()) - -proc VBUTTON_BOX_GET_CLASS*(obj: pointer): PVButtonBoxClass = - result = cast[PVButtonBoxClass](CHECK_GET_CLASS(obj, TYPE_VBUTTON_BOX())) - -proc TYPE_VIEWPORT*(): GType = - result = viewport_get_type() - -proc VIEWPORT*(obj: pointer): PViewport = - result = cast[PViewport](CHECK_CAST(obj, TYPE_VIEWPORT())) - -proc VIEWPORT_CLASS*(klass: pointer): PViewportClass = - result = cast[PViewportClass](CHECK_CLASS_CAST(klass, TYPE_VIEWPORT())) - -proc IS_VIEWPORT*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_VIEWPORT()) - -proc IS_VIEWPORT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_VIEWPORT()) - -proc VIEWPORT_GET_CLASS*(obj: pointer): PViewportClass = - result = cast[PViewportClass](CHECK_GET_CLASS(obj, TYPE_VIEWPORT())) - -proc TYPE_VPANED*(): GType = - result = vpaned_get_type() - -proc VPANED*(obj: pointer): PVPaned = - result = cast[PVPaned](CHECK_CAST(obj, TYPE_VPANED())) - -proc VPANED_CLASS*(klass: pointer): PVPanedClass = - result = cast[PVPanedClass](CHECK_CLASS_CAST(klass, TYPE_VPANED())) - -proc IS_VPANED*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_VPANED()) - -proc IS_VPANED_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_VPANED()) - -proc VPANED_GET_CLASS*(obj: pointer): PVPanedClass = - result = cast[PVPanedClass](CHECK_GET_CLASS(obj, TYPE_VPANED())) - -proc TYPE_VRULER*(): GType = - result = vruler_get_type() - -proc VRULER*(obj: pointer): PVRuler = - result = cast[PVRuler](CHECK_CAST(obj, TYPE_VRULER())) - -proc VRULER_CLASS*(klass: pointer): PVRulerClass = - result = cast[PVRulerClass](CHECK_CLASS_CAST(klass, TYPE_VRULER())) - -proc IS_VRULER*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_VRULER()) - -proc IS_VRULER_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_VRULER()) - -proc VRULER_GET_CLASS*(obj: pointer): PVRulerClass = - result = cast[PVRulerClass](CHECK_GET_CLASS(obj, TYPE_VRULER())) - -proc TYPE_VSCALE*(): GType = - result = vscale_get_type() - -proc VSCALE*(obj: pointer): PVScale = - result = cast[PVScale](CHECK_CAST(obj, TYPE_VSCALE())) - -proc VSCALE_CLASS*(klass: pointer): PVScaleClass = - result = cast[PVScaleClass](CHECK_CLASS_CAST(klass, TYPE_VSCALE())) - -proc IS_VSCALE*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_VSCALE()) - -proc IS_VSCALE_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_VSCALE()) - -proc VSCALE_GET_CLASS*(obj: pointer): PVScaleClass = - result = cast[PVScaleClass](CHECK_GET_CLASS(obj, TYPE_VSCALE())) - -proc TYPE_VSCROLLBAR*(): GType = - result = vscrollbar_get_type() - -proc VSCROLLBAR*(obj: pointer): PVScrollbar = - result = cast[PVScrollbar](CHECK_CAST(obj, TYPE_VSCROLLBAR())) - -proc VSCROLLBAR_CLASS*(klass: pointer): PVScrollbarClass = - result = cast[PVScrollbarClass](CHECK_CLASS_CAST(klass, TYPE_VSCROLLBAR())) - -proc IS_VSCROLLBAR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_VSCROLLBAR()) - -proc IS_VSCROLLBAR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_VSCROLLBAR()) - -proc VSCROLLBAR_GET_CLASS*(obj: pointer): PVScrollbarClass = - result = cast[PVScrollbarClass](CHECK_GET_CLASS(obj, TYPE_VSCROLLBAR())) - -proc TYPE_VSEPARATOR*(): GType = - result = vseparator_get_type() - -proc VSEPARATOR*(obj: pointer): PVSeparator = - result = cast[PVSeparator](CHECK_CAST(obj, TYPE_VSEPARATOR())) - -proc VSEPARATOR_CLASS*(klass: pointer): PVSeparatorClass = - result = cast[PVSeparatorClass](CHECK_CLASS_CAST(klass, TYPE_VSEPARATOR())) - -proc IS_VSEPARATOR*(obj: pointer): bool = - result = CHECK_TYPE(obj, TYPE_VSEPARATOR()) - -proc IS_VSEPARATOR_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, TYPE_VSEPARATOR()) - -proc VSEPARATOR_GET_CLASS*(obj: pointer): PVSeparatorClass = - # these were missing: - result = cast[PVSeparatorClass](CHECK_GET_CLASS(obj, TYPE_VSEPARATOR())) - -type - Tcelllayout {.pure, final.} = object - - PCellLayout* = tcelllayout - PPGtkCellLayout* = ptr PCellLayout - PSignalRunType* = ptr TSignalRunType - TSignalRunType* = int32 - PFileChooserAction* = ptr TFileChooserAction - TFileChooserAction* = enum - FILE_CHOOSER_ACTION_OPEN, FILE_CHOOSER_ACTION_SAVE, - FILE_CHOOSER_ACTION_SELECT_FOLDER, FILE_CHOOSER_ACTION_CREATE_FOLDER - PFileChooserError* = ptr TFileChooserError - TFileChooserError* = enum - FILE_CHOOSER_ERROR_NONEXISTENT, FILE_CHOOSER_ERROR_BAD_FILENAME - - TFileChooser = object of TDialog - PFileChooser* = ptr TFileChooser - PPFileChooser* = ptr PFileChooser - - -const - ARG_READWRITE* = ARG_READABLE or ARG_WRITABLE - -proc entry_add_signal*(binding_set: PBindingSet, keyval: guint, - modifiers: gdk2.TModifierType, - signal_name: cstring, n_args: guint){.varargs, - importc: "gtk_binding_entry_add_signal", cdecl, dynlib: lib.} -proc clist_new_with_titles*(columns: gint): PCList{.varargs, cdecl, - importc: "gtk_clist_new_with_titles", dynlib: lib.} -proc prepend*(clist: PCList): gint{.importc: "gtk_clist_prepend", varargs, - cdecl, dynlib: lib.} -proc append*(clist: PCList): gint{.importc: "gtk_clist_append", varargs, - cdecl, dynlib: lib.} -proc insert*(clist: PCList, row: gint): gint{.varargs, cdecl, - importc: "gtk_clist_insert", dynlib: lib.} -proc set_attributes*(cell_layout: PCellLayout, cell: PCellRenderer){. - cdecl, varargs, importc: "gtk_cell_layout_set_attributes", dynlib: lib, - importc: "gtk_cell_layout_set_attributes".} -proc add_with_properties*(container: PContainer, widget: PWidget, - first_prop_name: cstring){.varargs, - importc: "gtk_container_add_with_properties", cdecl, dynlib: lib.} -proc child_set*(container: PContainer, child: PWidget, - first_prop_name: cstring){.varargs, cdecl, - importc: "gtk_container_child_set", dynlib: lib.} -proc child_get*(container: PContainer, child: PWidget, - first_prop_name: cstring){.varargs, cdecl, - importc: "gtk_container_child_get", dynlib: lib.} -proc child_set_valist*(container: PContainer, child: PWidget, - first_property_name: cstring){.varargs, - importc: "gtk_container_child_set_valist", cdecl, dynlib: lib.} -proc child_get_valist*(container: PContainer, child: PWidget, - first_property_name: cstring){.varargs, - importc: "gtk_container_child_get_valist", cdecl, dynlib: lib.} -proc ctree_new_with_titles*(columns: gint, tree_column: gint): PCTree{. - importc: "gtk_ctree_new_with_titles", varargs, cdecl, dynlib: lib.} -proc get_vector*(curve: PCurve, veclen: int32){.varargs, cdecl, - importc: "gtk_curve_get_vector", dynlib: lib.} -proc set_vector*(curve: PCurve, veclen: int32){.varargs, cdecl, - importc: "gtk_curve_set_vector", dynlib: lib.} -proc add_buttons*(dialog: PDialog, first_button_text: cstring){.varargs, - cdecl, importc: "gtk_dialog_add_buttons", dynlib: lib.} -proc dialog_new_with_buttons*(title: cstring, parent: PWindow, - flags: TDialogFlags, first_button_text: cstring): PDialog{. - varargs, cdecl, importc: "gtk_dialog_new_with_buttons", dynlib: lib.} -proc list_store_new*(n_columns: gint): PListStore{.varargs, cdecl, - importc: "gtk_list_store_new", dynlib: lib.} -proc set*(list_store: PListStore, iter: PTreeIter){.varargs, cdecl, - importc: "gtk_list_store_set", dynlib: lib.} -proc set_valist*(list_store: PListStore, iter: PTreeIter){.varargs, - cdecl, importc: "gtk_list_store_set_valist", dynlib: lib.} -proc message_dialog_new*(parent: PWindow, flags: TDialogFlags, - thetype: TMessageType, buttons: TButtonsType, - message_format: cstring): PMessageDialog{.varargs, - cdecl, importc: "gtk_message_dialog_new", dynlib: lib.} -proc set_markup*(msgDialog: PMessageDialog, str: cstring) {.cdecl, - importc: "gtk_message_dialog_set_markup", dynlib: lib.} - -proc signal_new*(name: cstring, signal_flags: TSignalRunType, - object_type: TType, function_offset: guint, - marshaller: TSignalMarshaller, return_val: TType, n_args: guint): guint{. - varargs, importc: "gtk_signal_new", cdecl, dynlib: lib.} -proc signal_emit*(anObject: PObject, signal_id: guint){.varargs, cdecl, - importc: "gtk_signal_emit", dynlib: lib.} -proc signal_emit_by_name*(anObject: PObject, name: cstring){.varargs, cdecl, - importc: "gtk_signal_emit_by_name", dynlib: lib.} -proc insert_with_tags*(buffer: PTextBuffer, iter: PTextIter, - text: cstring, length: gint, - first_tag: PTextTag){.varargs, - importc: "gtk_text_buffer_insert_with_tags", cdecl, dynlib: lib.} -proc insert_with_tags_by_name*(buffer: PTextBuffer, iter: PTextIter, - text: cstring, length: gint, first_tag_name: cstring){.varargs, - importc: "gtk_text_buffer_insert_with_tags_by_name", cdecl, dynlib: lib.} -proc create_tag*(buffer: PTextBuffer, tag_name: cstring, - first_property_name: cstring): PTextTag{.varargs, - importc: "gtk_text_buffer_create_tag", cdecl, dynlib: lib.} -proc get*(tree_model: PTreeModel, iter: PTreeIter){.varargs, - importc: "gtk_tree_model_get", cdecl, dynlib: lib.} -proc get_valist*(tree_model: PTreeModel, iter: PTreeIter){.varargs, - importc: "gtk_tree_model_get_valist", cdecl, dynlib: lib.} -proc tree_store_new*(n_columns: gint): PTreeStore{.varargs, cdecl, - importc: "gtk_tree_store_new", dynlib: lib.} -proc set*(tree_store: PTreeStore, iter: PTreeIter){.varargs, cdecl, - importc: "gtk_tree_store_set", dynlib: lib.} -proc set_valist*(tree_store: PTreeStore, iter: PTreeIter){.varargs, - cdecl, importc: "gtk_tree_store_set_valist", dynlib: lib.} -proc iter_is_valid*(tree_store: PTreeStore, iter: PTreeIter): gboolean{. - cdecl, importc: "gtk_tree_store_iter_is_valid", dynlib: lib.} -proc reorder*(tree_store: PTreeStore, parent: PTreeIter, - new_order: pgint){.cdecl, - importc: "gtk_tree_store_reorder", dynlib: lib.} -proc swap*(tree_store: PTreeStore, a: PTreeIter, b: PTreeIter){. - cdecl, importc: "gtk_tree_store_swap", dynlib: lib.} -proc move_before*(tree_store: PTreeStore, iter: PTreeIter, - position: PTreeIter){.cdecl, - importc: "gtk_tree_store_move_before", dynlib: lib.} -proc move_after*(tree_store: PTreeStore, iter: PTreeIter, - position: PTreeIter){.cdecl, - importc: "gtk_tree_store_move_after", dynlib: lib.} -proc insert_column_with_attributes*(tree_view: PTreeView, - position: gint, title: cstring, cell: PCellRenderer): gint{.varargs, - importc: "gtk_tree_view_insert_column_with_attributes", cdecl, dynlib: lib.} -proc tree_view_column_new_with_attributes*(title: cstring, cell: PCellRenderer): PTreeViewColumn{. - importc: "gtk_tree_view_column_new_with_attributes", varargs, cdecl, - dynlib: lib.} -proc column_set_attributes*(tree_column: PTreeViewColumn, - cell_renderer: PCellRenderer){. - importc: "gtk_tree_view_column_set_attributes", varargs, cdecl, dynlib: lib.} -proc widget_new*(thetype: TType, first_property_name: cstring): PWidget{. - importc: "gtk_widget_new", varargs, cdecl, dynlib: lib.} -proc set*(widget: PWidget, first_property_name: cstring){.varargs, - importc: "gtk_widget_set", cdecl, dynlib: lib.} -proc queue_clear*(widget: PWidget){.importc: "gtk_widget_queue_clear", - cdecl, dynlib: lib.} -proc queue_clear_area*(widget: PWidget, x: gint, y: gint, width: gint, - height: gint){.cdecl, - importc: "gtk_widget_queue_clear_area", dynlib: lib.} -proc draw*(widget: PWidget, area: gdk2.PRectangle){.cdecl, - importc: "gtk_widget_draw", dynlib: lib.} -proc style_get_valist*(widget: PWidget, first_property_name: cstring){. - varargs, cdecl, importc: "gtk_widget_style_get_valist", dynlib: lib.} -proc style_get*(widget: PWidget, first_property_name: cstring){.varargs, - cdecl, importc: "gtk_widget_style_get", dynlib: lib.} -proc file_chooser_dialog_new*(title: cstring, parent: PWindow, - action: TFileChooserAction, - first_button_text: cstring): PFileChooser{.cdecl, - varargs, dynlib: lib, importc: "gtk_file_chooser_dialog_new".} - -proc file_chooser_dialog_new_with_backend*(title: cstring, parent: PWindow, - action: TFileChooserAction, backend: cstring, first_button_text: cstring): PFileChooser{. - varargs, cdecl, dynlib: lib, - importc: "gtk_file_chooser_dialog_new_with_backend".} -proc reference*(anObject: PObject): PObject{.cdecl, importc: "gtk_object_ref", - dynlib: lib.} -proc unref*(anObject: PObject){.cdecl, importc: "gtk_object_unref", - dynlib: lib.} -proc weakref*(anObject: PObject, notify: TDestroyNotify, data: gpointer){. - cdecl, importc: "gtk_object_weakref", dynlib: lib.} -proc weakunref*(anObject: PObject, notify: TDestroyNotify, data: gpointer){. - cdecl, importc: "gtk_object_weakunref", dynlib: lib.} -proc set_data*(anObject: PObject, key: cstring, data: gpointer){.cdecl, - importc: "gtk_object_set_data", dynlib: lib.} -proc set_data_full*(anObject: PObject, key: cstring, data: gpointer, - destroy: TDestroyNotify){. - importc: "gtk_object_set_data_full", cdecl, dynlib: lib.} -proc remove_data*(anObject: PObject, key: cstring){.cdecl, - importc: "gtk_object_remove_data", dynlib: lib.} -proc get_data*(anObject: PObject, key: cstring): gpointer{.cdecl, - importc: "gtk_object_get_data", dynlib: lib.} -proc remove_no_notify*(anObject: PObject, key: cstring){.cdecl, - importc: "gtk_object_remove_no_notify", dynlib: lib.} -proc set_user_data*(anObject: PObject, data: gpointer){.cdecl, - importc: "gtk_object_set_user_data", dynlib: lib.} -proc get_user_data*(anObject: PObject): gpointer{.cdecl, - importc: "gtk_object_get_user_data", dynlib: lib.} -proc set_data_by_id*(anObject: PObject, data_id: TGQuark, data: gpointer){. - cdecl, importc: "gtk_object_set_data_by_id", dynlib: lib.} -proc set_data_by_id_full*(anObject: PObject, data_id: TGQuark, - data: gpointer, destroy: TDestroyNotify){. - cdecl, importc: "gtk_object_set_data_by_id_full", dynlib: lib.} -proc get_data_by_id*(anObject: PObject, data_id: TGQuark): gpointer{. - cdecl, importc: "gtk_object_get_data_by_id", dynlib: lib.} -proc remove_data_by_id*(anObject: PObject, data_id: TGQuark){.cdecl, - importc: "gtk_object_remove_data_by_id", dynlib: lib.} -proc remove_no_notify_by_id*(anObject: PObject, key_id: TGQuark){.cdecl, - importc: "gtk_object_remove_no_notify_by_id", dynlib: lib.} -proc object_data_try_key*(str: cstring): TGQuark{.cdecl, - importc: "gtk_object_data_try_key", dynlib: lib.} -proc object_data_force_id*(str: cstring): TGQuark{.cdecl, - importc: "gtk_object_data_force_id", dynlib: lib.} -proc get*(anObject: PObject, first_property_name: cstring){.cdecl, - importc: "gtk_object_get", varargs, dynlib: lib.} -proc set*(anObject: PObject, first_property_name: cstring){.cdecl, - importc: "gtk_object_set", varargs, dynlib: lib.} -proc object_add_arg_type*(arg_name: cstring, arg_type: TType, arg_flags: guint, - arg_id: guint){.cdecl, - importc: "gtk_object_add_arg_type", dynlib: lib.} - -type - TFileFilter {.pure, final.} = object - PFileFilter* = ptr TFileFilter - PPGtkFileFilter* = ptr PFileFilter - PFileFilterFlags* = ptr TFileFilterFlags - TFileFilterFlags* = enum - FILE_FILTER_FILENAME = 1 shl 0, FILE_FILTER_URI = 1 shl 1, - FILE_FILTER_DISPLAY_NAME = 1 shl 2, FILE_FILTER_MIME_TYPE = 1 shl 3 - PFileFilterInfo* = ptr TFileFilterInfo - TFileFilterInfo*{.final, pure.} = object - contains*: TFileFilterFlags - filename*: cstring - uri*: cstring - display_name*: cstring - mime_type*: cstring - - TFileFilterFunc* = proc (filter_info: PFileFilterInfo, data: gpointer): gboolean{. - cdecl.} - -proc TYPE_FILE_FILTER*(): GType -proc FILE_FILTER*(obj: pointer): PFileFilter -proc IS_FILE_FILTER*(obj: pointer): gboolean -proc file_filter_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_file_filter_get_type".} -proc file_filter_new*(): PFileFilter{.cdecl, dynlib: lib, - importc: "gtk_file_filter_new".} -proc set_name*(filter: PFileFilter, name: cstring){.cdecl, - dynlib: lib, importc: "gtk_file_filter_set_name".} -proc get_name*(filter: PFileFilter): cstring{.cdecl, dynlib: lib, - importc: "gtk_file_filter_get_name".} -proc add_mime_type*(filter: PFileFilter, mime_type: cstring){.cdecl, - dynlib: lib, importc: "gtk_file_filter_add_mime_type".} -proc add_pattern*(filter: PFileFilter, pattern: cstring){.cdecl, - dynlib: lib, importc: "gtk_file_filter_add_pattern".} -proc add_custom*(filter: PFileFilter, needed: TFileFilterFlags, - func: TFileFilterFunc, data: gpointer, - notify: TGDestroyNotify){.cdecl, dynlib: lib, - importc: "gtk_file_filter_add_custom".} -proc get_needed*(filter: PFileFilter): TFileFilterFlags{.cdecl, - dynlib: lib, importc: "gtk_file_filter_get_needed".} -proc filter*(filter: PFileFilter, filter_info: PFileFilterInfo): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_filter_filter".} -proc TYPE_FILE_FILTER(): GType = - result = file_filter_get_type() - -proc FILE_FILTER(obj: pointer): PFileFilter = - result = cast[PFileFilter](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_FILE_FILTER())) - -proc IS_FILE_FILTER(obj: pointer): gboolean = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_FILE_FILTER()) - -proc file_chooser_get_type*(): GType{.cdecl, dynlib: lib, - importc: "gtk_file_chooser_get_type".} -proc file_chooser_error_quark*(): TGQuark{.cdecl, dynlib: lib, - importc: "gtk_file_chooser_error_quark".} -proc TYPE_FILE_CHOOSER*(): GType = - result = file_chooser_get_type() - -proc FILE_CHOOSER*(obj: pointer): PFileChooser = - result = cast[PFileChooser](G_TYPE_CHECK_INSTANCE_CAST(obj, - TYPE_FILE_CHOOSER())) - -proc IS_FILE_CHOOSER*(obj: pointer): gboolean = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_FILE_CHOOSER()) - -proc set_action*(chooser: PFileChooser, action: TFileChooserAction){. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_action".} -proc get_action*(chooser: PFileChooser): TFileChooserAction{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_action".} -proc set_local_only*(chooser: PFileChooser, local_only: gboolean){. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_local_only".} -proc get_local_only*(chooser: PFileChooser): gboolean{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_local_only".} -proc set_select_multiple*(chooser: PFileChooser, - select_multiple: gboolean){.cdecl, - dynlib: lib, importc: "gtk_file_chooser_set_select_multiple".} -proc get_select_multiple*(chooser: PFileChooser): gboolean{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_select_multiple".} -proc set_current_name*(chooser: PFileChooser, name: cstring){. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_current_name".} -proc get_filename*(chooser: PFileChooser): cstring{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_filename".} -proc set_filename*(chooser: PFileChooser, filename: cstring): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_filename".} -proc select_filename*(chooser: PFileChooser, filename: cstring): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_select_filename".} -proc unselect_filename*(chooser: PFileChooser, filename: cstring){. - cdecl, dynlib: lib, importc: "gtk_file_chooser_unselect_filename".} -proc select_all*(chooser: PFileChooser){.cdecl, dynlib: lib, - importc: "gtk_file_chooser_select_all".} -proc unselect_all*(chooser: PFileChooser){.cdecl, dynlib: lib, - importc: "gtk_file_chooser_unselect_all".} -proc get_filenames*(chooser: PFileChooser): PGSList{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_filenames".} -proc set_current_folder*(chooser: PFileChooser, filename: cstring): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_current_folder".} -proc get_current_folder*(chooser: PFileChooser): cstring{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_current_folder".} -proc get_uri*(chooser: PFileChooser): cstring{.cdecl, dynlib: lib, - importc: "gtk_file_chooser_get_uri".} -proc set_uri*(chooser: PFileChooser, uri: cstring): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_uri".} -proc select_uri*(chooser: PFileChooser, uri: cstring): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_select_uri".} -proc unselect_uri*(chooser: PFileChooser, uri: cstring){.cdecl, - dynlib: lib, importc: "gtk_file_chooser_unselect_uri".} -proc get_uris*(chooser: PFileChooser): PGSList{.cdecl, dynlib: lib, - importc: "gtk_file_chooser_get_uris".} -proc set_current_folder_uri*(chooser: PFileChooser, uri: cstring): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_current_folder_uri".} -proc get_current_folder_uri*(chooser: PFileChooser): cstring{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_get_current_folder_uri".} -proc set_preview_widget*(chooser: PFileChooser, - preview_widget: PWidget){.cdecl, - dynlib: lib, importc: "gtk_file_chooser_set_preview_widget".} -proc get_preview_widget*(chooser: PFileChooser): PWidget{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_preview_widget".} -proc set_preview_widget_active*(chooser: PFileChooser, - active: gboolean){.cdecl, dynlib: lib, - importc: "gtk_file_chooser_set_preview_widget_active".} -proc get_preview_widget_active*(chooser: PFileChooser): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_get_preview_widget_active".} -proc set_use_preview_label*(chooser: PFileChooser, - use_label: gboolean){.cdecl, dynlib: lib, - importc: "gtk_file_chooser_set_use_preview_label".} -proc get_use_preview_label*(chooser: PFileChooser): gboolean{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_get_use_preview_label".} -proc get_preview_filename*(chooser: PFileChooser): cstring{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_preview_filename".} -proc get_preview_uri*(chooser: PFileChooser): cstring{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_preview_uri".} -proc set_extra_widget*(chooser: PFileChooser, extra_widget: PWidget){. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_extra_widget".} -proc get_extra_widget*(chooser: PFileChooser): PWidget{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_extra_widget".} -proc add_filter*(chooser: PFileChooser, filter: PFileFilter){. - cdecl, dynlib: lib, importc: "gtk_file_chooser_add_filter".} -proc remove_filter*(chooser: PFileChooser, filter: PFileFilter){. - cdecl, dynlib: lib, importc: "gtk_file_chooser_remove_filter".} -proc list_filters*(chooser: PFileChooser): PGSList{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_list_filters".} -proc set_filter*(chooser: PFileChooser, filter: PFileFilter){. - cdecl, dynlib: lib, importc: "gtk_file_chooser_set_filter".} -proc get_filter*(chooser: PFileChooser): PFileFilter{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_get_filter".} -proc add_shortcut_folder*(chooser: PFileChooser, folder: cstring, - error: pointer): gboolean{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_add_shortcut_folder".} -proc remove_shortcut_folder*(chooser: PFileChooser, - folder: cstring, error: pointer): gboolean{.cdecl, dynlib: lib, - importc: "gtk_file_chooser_remove_shortcut_folder".} -proc list_shortcut_folders*(chooser: PFileChooser): PGSList{.cdecl, - dynlib: lib, importc: "gtk_file_chooser_list_shortcut_folders".} -proc add_shortcut_folder_uri*(chooser: PFileChooser, uri: cstring, - error: pointer): gboolean{.cdecl, dynlib: lib, importc: "gtk_file_chooser_add_shortcut_folder_uri".} -proc remove_shortcut_folder_uri*(chooser: PFileChooser, - uri: cstring, error: pointer): gboolean{.cdecl, dynlib: lib, - importc: "gtk_file_chooser_remove_shortcut_folder_uri".} -proc list_shortcut_folder_uris*(chooser: PFileChooser): PGSList{. - cdecl, dynlib: lib, importc: "gtk_file_chooser_list_shortcut_folder_uris".} -proc set_do_overwrite_confirmation*(chooser: PFileChooser, - do_overwrite_confirmation: gboolean){.cdecl, dynlib: lib, - importc: "gtk_file_chooser_set_do_overwrite_confirmation".} - -proc get_realized*(w: PWidget): gboolean {.cdecl, dynlib: lib, - importc: "gtk_widget_get_realized".} - -proc set_skip_taskbar_hint*(window: PWindow, setting: gboolean){.cdecl, - dynlib: lib, importc: "gtk_window_set_skip_taskbar_hint".} - -type - TTooltip* {.pure, final.} = object - PTooltip* = ptr TTooltip - -proc set_tooltip_text*(w: PWidget, t: cstring){.cdecl, - dynlib: lib, importc: "gtk_widget_set_tooltip_text".} - -proc get_tooltip_text*(w: PWidget): cstring{.cdecl, - dynlib: lib, importc: "gtk_widget_get_tooltip_text".} - -proc set_tooltip_markup*(w: PWidget, m: cstring) {.cdecl, dynlib: lib, - importc: "gtk_widget_set_tooltip_markup".} - -proc get_tooltip_markup*(w: PWidget): cstring {.cdecl, dynlib: lib, - importc: "gtk_widget_get_tooltip_markup".} - -proc set_tooltip_column*(w: PTreeview, column: gint){.cdecl, - dynlib: lib, importc: "gtk_tree_view_set_tooltip_column".} - -proc trigger_tooltip_query*(widg: PWidget){.cdecl, dynlib: lib, - importc: "gtk_widget_trigger_tooltip_query".} - -proc trigger_tooltip_query*(widg: PTooltip){.cdecl, dynlib: lib, - importc: "gtk_tooltip_trigger_tooltip_query".} - -proc set_has_tooltip*(widget: PWidget, b: gboolean){.cdecl, dynlib: lib, - importc: "gtk_widget_set_has_tooltip".} - -proc get_has_tooltip*(widget: PWidget): gboolean{.cdecl, dynlib: lib, - importc: "gtk_widget_get_has_tooltip".} - -proc set_markup*(tp: PTooltip, mk: cstring){.cdecl, dynlib: lib, - importc: "gtk_tooltip_set_markup".} - -proc set_visible_window*(evBox: PEventBox, v: gboolean){.cdecl, dynlib: lib, - importc: "gtk_event_box_set_visible_window".} - -proc get_vadjustment*(scrolled_window: PTextView): PAdjustment{. - cdecl, dynlib: lib, importc: "gtk_text_view_get_vadjustment".} - -type - TInfoBar* = object of THBox - PInfoBar* = ptr TInfoBar - -proc info_bar_new*(): PInfoBar{.cdecl, dynlib: lib, importc: "gtk_info_bar_new".} -proc info_bar_new_with_buttons*(first_button_text: cstring): PInfoBar {.cdecl, dynlib:lib, - varargs, importc: "gtk_info_bar_new_with_buttons".} -proc add_action_widget*(infobar: PInfoBar, child: PWidget, respID: gint) {. - cdecl, dynlib: lib, importc: "gtk_info_bar_add_action_widget".} -proc add_button*(infobar: PInfoBar, btnText: cstring, respID: gint): PWidget{. - cdecl, dynlib: lib, importc: "gtk_info_bar_add_button".} -proc set_response_sensitive*(infobar: PInfoBar, respID: gint, setting: gboolean){. - cdecl, dynlib: lib, importc: "gtk_info_bar_set_response_sensitive".} -proc set_default_response*(infobar: PInfoBar, respID: gint){.cdecl, - dynlib: lib, importc: "gtk_info_bar_set_default_response".} -proc response*(infobar: PInfoBar, respID: gint){.cdecl, dynlib: lib, - importc: "gtk_info_bar_response".} -proc set_message_type*(infobar: PInfoBar, messageType: TMessageType){.cdecl, - dynlib: lib, importc: "gtk_info_bar_set_message_type".} -proc get_message_type*(infobar: PInfoBar): TMessageType{.cdecl, dynlib: lib, - importc: "gtk_info_bar_get_message_type".} -proc get_action_area*(infobar: PInfoBar): PWidget{.cdecl, dynlib: lib, - importc: "gtk_info_bar_get_action_area".} -proc get_content_area*(infobar: PInfoBar): PContainer{.cdecl, dynlib: lib, - importc: "gtk_info_bar_get_content_area".} - -type - TComboBox* = object of TWidget - PComboBox* = ptr TComboBox - -proc comboBoxNew*(): PComboBox{.cdecl, importc: "gtk_combo_box_new", dynlib: lib.} -proc comboBox_new_with_entry*(): PComboBox{.cdecl, - importc: "gtk_combo_box_new_with_entry", - dynlib: lib.} -proc comboBox_new_with_model*(model: PTreeModel): PComboBox{.cdecl, - importc: "gtk_combo_box_new_with_model", dynlib: lib.} -proc comboBox_new_with_model_and_entry*(model: PTreeModel): PComboBox{.cdecl, - importc: "gtk_combo_box_new_with_model_and_entry", dynlib: lib.} - -proc get_wrap_width*(combo_box: PComboBox): gint{.cdecl, - importc: "gtk_combo_box_get_wrap_width", dynlib: lib.} -proc set_wrap_width*(combo_box: PComboBox; width: gint){.cdecl, - importc: "gtk_combo_box_set_wrap_width", dynlib: lib.} -proc get_row_span_column*(combo_box: PComboBox): gint{.cdecl, - importc: "gtk_combo_box_get_row_span_column", dynlib: lib.} -proc set_row_span_column*(combo_box: PComboBox; row_span: gint){.cdecl, - importc: "gtk_combo_box_set_row_span_column", dynlib: lib.} -proc get_column_span_column*(combo_box: PComboBox): gint{.cdecl, - importc: "gtk_combo_box_get_column_span_column", dynlib: lib.} -proc set_column_span_column*(combo_box: PComboBox; column_span: gint){. - cdecl, importc: "gtk_combo_box_set_column_span_column", dynlib: lib.} -proc get_add_tearoffs*(combo_box: PComboBox): gboolean{.cdecl, - importc: "gtk_combo_box_get_add_tearoffs", dynlib: lib.} -proc set_add_tearoffs*(combo_box: PComboBox; add_tearoffs: gboolean){. - cdecl, importc: "gtk_combo_box_set_add_tearoffs", dynlib: lib.} -proc get_title*(combo_box: PComboBox): ptr gchar{.cdecl, - importc: "gtk_combo_box_get_title", dynlib: lib.} -proc set_title*(combo_box: PComboBox; title: ptr gchar){.cdecl, - importc: "gtk_combo_box_set_title", dynlib: lib.} -proc get_focus_on_click*(combo: PComboBox): gboolean{.cdecl, - importc: "gtk_combo_box_get_focus_on_click", dynlib: lib.} -proc set_focus_on_click*(combo: PComboBox; focus_on_click: gboolean){. - cdecl, importc: "gtk_combo_box_set_focus_on_click", dynlib: lib.} - -proc get_active*(combo_box: PComboBox): gint{.cdecl, - importc: "gtk_combo_box_get_active", dynlib: lib.} -proc set_active*(combo_box: PComboBox; index: gint){.cdecl, - importc: "gtk_combo_box_set_active", dynlib: lib.} -proc get_active_iter*(combo_box: PComboBox; iter: PTreeIter): gboolean{. - cdecl, importc: "gtk_combo_box_get_active_iter", dynlib: lib.} -proc set_active_iter*(combo_box: PComboBox; iter: PTreeIter){.cdecl, - importc: "gtk_combo_box_set_active_iter", dynlib: lib.} - -proc set_model*(combo_box: PComboBox; model: PTreeModel){.cdecl, - importc: "gtk_combo_box_set_model", dynlib: lib.} -proc get_model*(combo_box: PComboBox): PTreeModel{.cdecl, - importc: "gtk_combo_box_get_model", dynlib: lib.} -discard """proc get_row_separator_func*(combo_box: PComboBox): GtkTreeViewRowSeparatorFunc{. - cdecl, importc: "gtk_combo_box_get_row_separator_func", dynlib: lib.} -proc set_row_separator_func*(combo_box: PComboBox; - func: GtkTreeViewRowSeparatorFunc; data: gpointer; - destroy: GDestroyNotify){.cdecl, - importc: "gtk_combo_box_set_row_separator_func", dynlib: lib.}""" -discard """proc set_button_sensitivity*(combo_box: PComboBox; - sensitivity: GtkSensitivityType){.cdecl, - importc: "gtk_combo_box_set_button_sensitivity", dynlib: lib.} -proc get_button_sensitivity*(combo_box: PComboBox): GtkSensitivityType{. - cdecl, importc: "gtk_combo_box_get_button_sensitivity", dynlib: lib.}""" -proc get_has_entry*(combo_box: PComboBox): gboolean{.cdecl, - importc: "gtk_combo_box_get_has_entry", dynlib: lib.} -proc set_entry_text_column*(combo_box: PComboBox; text_column: gint){. - cdecl, importc: "gtk_combo_box_set_entry_text_column", dynlib: lib.} -proc get_entry_text_column*(combo_box: PComboBox): gint{.cdecl, - importc: "gtk_combo_box_get_entry_text_column", dynlib: lib.} - -proc popup*(combo_box: PComboBox){.cdecl, importc: "gtk_combo_box_popup", - dynlib: lib.} -proc popdown*(combo_box: PComboBox){.cdecl, - importc: "gtk_combo_box_popdown", dynlib: lib.} -discard """proc get_popup_accessible*(combo_box: PComboBox): ptr AtkObject{.cdecl, - importc: "gtk_combo_box_get_popup_accessible", dynlib: lib.}""" - -type - TComboBoxText* = object of TComboBox - PComboBoxText* = ptr TComboBoxText - -proc combo_box_text_new*(): PComboBoxText{.cdecl, importc: "gtk_combo_box_text_new", - dynlib: lib.} -proc combo_box_text_new_with_entry*(): PComboBoxText{.cdecl, - importc: "gtk_combo_box_text_new_with_entry", dynlib: lib.} -proc append_text*(combo_box: PComboBoxText; text: cstring){.cdecl, - importc: "gtk_combo_box_text_append_text", dynlib: lib.} -proc insert_text*(combo_box: PComboBoxText; position: gint; - text: cstring){.cdecl, - importc: "gtk_combo_box_text_insert_text", dynlib: lib.} -proc prepend_text*(combo_box: PComboBoxText; text: cstring){.cdecl, - importc: "gtk_combo_box_text_prepend_text", dynlib: lib.} -proc remove*(combo_box: PComboBoxText; position: gint){.cdecl, - importc: "gtk_combo_box_text_remove", dynlib: lib.} -proc get_active_text*(combo_box: PComboBoxText): cstring{.cdecl, - importc: "gtk_combo_box_text_get_active_text", dynlib: lib.} -proc is_active*(win: PWindow): gboolean{.cdecl, - importc: "gtk_window_is_active", dynlib: lib.} -proc has_toplevel_focus*(win: PWindow): gboolean{.cdecl, - importc: "gtk_window_has_toplevel_focus", dynlib: lib.} - -proc nimrod_init*() = - var - cmdLine{.importc: "cmdLine".}: array[0..255, cstring] - cmdCount{.importc: "cmdCount".}: cint - init(addr(cmdLine), addr(cmdCount)) diff --git a/lib/wrappers/gtk/gtkglext.nim b/lib/wrappers/gtk/gtkglext.nim deleted file mode 100644 index b3f5647bde..0000000000 --- a/lib/wrappers/gtk/gtkglext.nim +++ /dev/null @@ -1,53 +0,0 @@ -{.deadCodeElim: on.} -import - Glib2, Gdk2, gtk2, GdkGLExt - -when defined(windows): - const - GLExtLib* = "libgtkglext-win32-1.0-0.dll" -elif defined(macosx): - const - GLExtLib* = "libgtkglext-x11-1.0.dylib" -else: - const - GLExtLib* = "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 gl_parse_args*(argc: ptr int32, argv: PPPChar): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gtk_gl_parse_args".} -proc gl_init_check*(argc: ptr int32, argv: PPPChar): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gtk_gl_init_check".} -proc gl_init*(argc: ptr int32, argv: PPPChar){.cdecl, dynlib: GLExtLib, - importc: "gtk_gl_init".} -proc set_gl_capability*(widget: PWidget, glconfig: PGLConfig, - share_list: PGLContext, direct: gboolean, - render_type: int): gboolean{.cdecl, - dynlib: GLExtLib, importc: "gtk_widget_set_gl_capability".} -proc is_gl_capable*(widget: PWidget): gboolean{.cdecl, dynlib: GLExtLib, - importc: "gtk_widget_is_gl_capable".} -proc get_gl_config*(widget: PWidget): PGLConfig{.cdecl, - dynlib: GLExtLib, importc: "gtk_widget_get_gl_config".} -proc create_gl_context*(widget: PWidget, share_list: PGLContext, - direct: gboolean, render_type: int): PGLContext{. - cdecl, dynlib: GLExtLib, importc: "gtk_widget_create_gl_context".} -proc get_gl_context*(widget: PWidget): PGLContext{.cdecl, - dynlib: GLExtLib, importc: "gtk_widget_get_gl_context".} -proc get_gl_window*(widget: PWidget): PGLWindow{.cdecl, - dynlib: GLExtLib, importc: "gtk_widget_get_gl_window".} - -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 get_gl_drawable*(widget: PWidget): PGLDrawable = - result = GL_DRAWABLE(get_gl_window(widget)) diff --git a/lib/wrappers/gtk/gtkhtml.nim b/lib/wrappers/gtk/gtkhtml.nim deleted file mode 100644 index 92496c03bb..0000000000 --- a/lib/wrappers/gtk/gtkhtml.nim +++ /dev/null @@ -1,523 +0,0 @@ -{.deadCodeElim: on.} -import - gtk2, glib2, atk, pango, gdk2pixbuf, gdk2 - -when defined(windows): - const - htmllib = "libgtkhtml-win32-2.0-0.dll" -elif defined(macosx): - const - htmllib = "libgtkhtml-2.dylib" -else: - const - htmllib = "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 - PDomString* = cstring - TDomBoolean* = gboolean - TDomException* = gushort - TDomTimeStamp* = guint64 - PDomNode* = ptr TDomNode - TDomNode* = object of TGObject - xmlnode*: pointer - style*: pointer - - PDomException* = ptr TDomException - - 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*{.final, pure.} = object - parent*: PDomNode - iterators*: PGSList - - PDomDocumentClass* = ptr TDomDocumentClass - TDomDocumentClass*{.final, pure.} = object - 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*: pointer - res*: int32 - chars*: array[0..9, char] - blocking*: gboolean - blocking_node*: PDomNode - - PHtmlParserClass* = ptr THtmlParserClass - THtmlParserClass* = object of gtk2.TObjectClass - 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: cstring, - 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: cstring, len: gint, - user_data: gpointer){.cdecl.} - PHtmlContext* = ptr THtmlContext - THtmlContext* = object of TGObject - documents*: PGSList - standard_font*: PHtmlFontSpecification - fixed_font*: PHtmlFontSpecification - debug_painting*: gboolean - - PHtmlFontSpecification* = ptr THtmlFontSpecification - THtmlFontSpecification {.final, pure.} = object - - PHtmlContextClass* = ptr THtmlContextClass - THtmlContextClass* = 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: cstring, - stream: PHtmlStream){.cdecl.} - link_clicked*: proc (document: PHtmlDocument, url: cstring){.cdecl.} - set_base*: proc (document: PHtmlDocument, url: cstring){.cdecl.} - title_changed*: proc (document: PHtmlDocument, new_title: cstring){.cdecl.} - submit*: proc (document: PHtmlDocument, `method`: cstring, url: cstring, - encoding: cstring){.cdecl.} - - PHtmlView* = ptr THtmlView - THtmlView* = object of gtk2.TLayout - 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*: cstring - magnification*: gdouble - magnification_modified*: gboolean - on_url*: gboolean - - PHtmlViewClass* = ptr THtmlViewClass - THtmlViewClass* = object of gtk2.TLayoutClass - move_cursor*: proc (html_view: PHtmlView, step: TMovementStep, count: gint, - extend_selection: gboolean){.cdecl.} - on_url*: proc (html_view: PHtmlView, url: cstring) - activate*: proc (html_view: PHtmlView) - move_focus_out*: proc (html_view: PHtmlView, direction: TDirectionType) - - PDomNodeList* = ptr TDomNodeList - TDomNodeList {.pure, final.} = object - - PDomNamedNodeMap* = ptr TDomNamedNodeMap - TDomNamedNodeMap {.pure, final.} = object - - PDomDocumentType* = ptr TDomDocumentType - TDomDocumentType {.pure, final.} = object - - PDomElement* = ptr TDomElement - TDomElement = object of TDomNode - - PDomText* = ptr TDomText - TDomText = object of TDomNode - - PDomComment* = ptr TDomComment - TDomComment = object of TDomNode - - THtmlBox {.pure, final.} = object - PHtmlBox* = ptr THtmlBox - - -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: htmllib, - importc: "dom_node_get_type".} -proc dom_Node_mkref*(node: pointer): PDomNode{.cdecl, dynlib: htmllib, - importc: "dom_Node_mkref".} -proc get_childNodes*(node: PDomNode): PDomNodeList{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_childNodes".} -proc removeChild*(node: PDomNode, oldChild: PDomNode, - exc: PDomException): PDomNode{.cdecl, - dynlib: htmllib, importc: "dom_Node_removeChild".} -proc get_nodeValue*(node: PDomNode, exc: PDomException): PDomString{. - cdecl, dynlib: htmllib, importc: "dom_Node__get_nodeValue".} -proc get_firstChild*(node: PDomNode): PDomNode{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_firstChild".} -proc get_nodeName*(node: PDomNode): PDomString{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_nodeName".} -proc get_attributes*(node: PDomNode): PDomNamedNodeMap{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_attributes".} -proc get_doctype*(doc: PDomDocument): PDomDocumentType{.cdecl, - dynlib: htmllib, importc: "dom_Document__get_doctype".} -proc hasChildNodes*(node: PDomNode): bool{.cdecl, - dynlib: htmllib, importc: "dom_Node_hasChildNodes".} -proc get_parentNode*(node: PDomNode): PDomNode{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_parentNode".} -proc get_nextSibling*(node: PDomNode): PDomNode{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_nextSibling".} -proc get_nodeType*(node: PDomNode): gushort{.cdecl, dynlib: htmllib, - importc: "dom_Node__get_nodeType".} - -proc cloneNode*(node: PDomNode, deep: bool): PDomNode{.cdecl, - dynlib: htmllib, importc: "dom_Node_cloneNode".} -proc appendChild*(node: PDomNode, newChild: PDomNode, - exc: PDomException): PDomNode{.cdecl, - dynlib: htmllib, importc: "dom_Node_appendChild".} -proc get_localName*(node: PDomNode): PDomString{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_localName".} -proc get_namespaceURI*(node: PDomNode): PDomString{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_namespaceURI".} -proc get_previousSibling*(node: PDomNode): PDomNode{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_previousSibling".} -proc get_lastChild*(node: PDomNode): PDomNode{.cdecl, dynlib: htmllib, - importc: "dom_Node__get_lastChild".} -proc set_nodeValue*(node: PDomNode, value: PDomString, - exc: PDomException){.cdecl, dynlib: htmllib, - importc: "dom_Node__set_nodeValue".} -proc get_ownerDocument*(node: PDomNode): PDomDocument{.cdecl, - dynlib: htmllib, importc: "dom_Node__get_ownerDocument".} -proc hasAttributes*(node: PDomNode): gboolean{.cdecl, dynlib: htmllib, - 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 get_documentElement*(doc: PDomDocument): PDomElement -proc createElement*(doc: PDomDocument, tagName: PDomString): PDomElement -proc createTextNode*(doc: PDomDocument, data: PDomString): PDomText -proc createComment*(doc: PDomDocument, data: PDomString): PDomComment -proc importNode*(doc: PDomDocument, importedNode: PDomNode, - deep: bool, 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: htmllib, importc: "html_focus_iterator_next_element".} -proc html_focus_iterator_prev_element*(document: PDomDocument, - element: PDomElement): PDomElement{. - cdecl, dynlib: htmllib, 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 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: htmllib, - importc: "html_stream_get_type".} -proc html_stream_new*(write_func: THtmlStreamWriteFunc, - close_func: THtmlStreamCloseFunc, user_data: gpointer): PHtmlStream{. - cdecl, dynlib: htmllib, importc: "html_stream_new".} -proc write*(stream: PHtmlStream, buffer: cstring, size: guint){. - cdecl, dynlib: htmllib, importc: "html_stream_write".} -proc close*(stream: PHtmlStream){.cdecl, dynlib: htmllib, - importc: "html_stream_close".} -proc destroy*(stream: PHtmlStream){.cdecl, dynlib: htmllib, - importc: "html_stream_destroy".} -proc get_written*(stream: PHtmlStream): gint{.cdecl, - dynlib: htmllib, importc: "html_stream_get_written".} -proc cancel*(stream: PHtmlStream){.cdecl, dynlib: htmllib, - importc: "html_stream_cancel".} -proc set_cancel_func*(stream: PHtmlStream, - abort_func: THtmlStreamCancelFunc, - cancel_data: gpointer){.cdecl, - dynlib: htmllib, importc: "html_stream_set_cancel_func".} -proc get_mime_type*(stream: PHtmlStream): cstring{.cdecl, - dynlib: htmllib, importc: "html_stream_get_mime_type".} -proc set_mime_type*(stream: PHtmlStream, mime_type: cstring){.cdecl, - dynlib: htmllib, importc: "html_stream_set_mime_type".} -proc html_stream_buffer_new*(close_func: THtmlStreamBufferCloseFunc, - user_data: gpointer): PHtmlStream{.cdecl, - dynlib: htmllib, importc: "html_stream_buffer_new".} -proc event_mouse_move*(view: PHtmlView, event: Gdk2.PEventMotion){.cdecl, - dynlib: htmllib, importc: "html_event_mouse_move".} -proc event_button_press*(view: PHtmlView, button: Gdk2.PEventButton){.cdecl, - dynlib: htmllib, importc: "html_event_button_press".} -proc event_button_release*(view: PHtmlView, event: Gdk2.PEventButton){.cdecl, - dynlib: htmllib, importc: "html_event_button_release".} -proc event_activate*(view: PHtmlView){.cdecl, dynlib: htmllib, - importc: "html_event_activate".} -proc event_key_press*(view: PHtmlView, event: Gdk2.PEventKey): gboolean{. - cdecl, dynlib: htmllib, importc: "html_event_key_press".} -proc event_find_root_box*(self: PHtmlBox, x: gint, y: gint): PHtmlBox{. - cdecl, dynlib: htmllib, importc: "html_event_find_root_box".} -proc selection_start*(view: PHtmlView, event: Gdk2.PEventButton){.cdecl, - dynlib: htmllib, importc: "html_selection_start".} -proc selection_end*(view: PHtmlView, event: Gdk2.PEventButton){.cdecl, - dynlib: htmllib, importc: "html_selection_end".} -proc selection_update*(view: PHtmlView, event: Gdk2.PEventMotion){.cdecl, - dynlib: htmllib, importc: "html_selection_update".} -proc selection_clear*(view: PHtmlView){.cdecl, dynlib: htmllib, - importc: "html_selection_clear".} -proc selection_set*(view: PHtmlView, start: PDomNode, offset: int32, - len: int32){.cdecl, dynlib: htmllib, - importc: "html_selection_set".} -proc HTML_CONTEXT_TYPE*(): GType -proc HTML_CONTEXT*(obj: pointer): PHtmlContext -proc HTML_CONTEXT_CLASS*(klass: pointer): PHtmlContextClass -proc HTML_IS_CONTEXT*(obj: pointer): bool -proc HTML_IS_CONTEXT_CLASS*(klass: pointer): bool -proc html_context_get_type*(): GType -proc html_context_get*(): PHtmlContext -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: htmllib, - importc: "html_document_get_type".} -proc html_document_new*(): PHtmlDocument{.cdecl, dynlib: htmllib, - importc: "html_document_new".} -proc open_stream*(document: PHtmlDocument, mime_type: cstring): gboolean{. - cdecl, dynlib: htmllib, importc: "html_document_open_stream".} -proc write_stream*(document: PHtmlDocument, buffer: cstring, - len: gint){.cdecl, dynlib: htmllib, - importc: "html_document_write_stream".} -proc close_stream*(document: PHtmlDocument){.cdecl, - dynlib: htmllib, importc: "html_document_close_stream".} -proc clear*(document: PHtmlDocument){.cdecl, dynlib: htmllib, - 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: htmllib, - importc: "html_view_get_type".} -proc html_view_new*(): PWidget{.cdecl, dynlib: htmllib, importc: "html_view_new".} -proc set_document*(view: PHtmlView, document: PHtmlDocument){.cdecl, - dynlib: htmllib, importc: "html_view_set_document".} -proc jump_to_anchor*(view: PHtmlView, anchor: cstring){.cdecl, - dynlib: htmllib, importc: "html_view_jump_to_anchor".} -proc get_magnification*(view: PHtmlView): gdouble{.cdecl, - dynlib: htmllib, importc: "html_view_get_magnification".} -proc set_magnification*(view: PHtmlView, magnification: gdouble){. - cdecl, dynlib: htmllib, importc: "html_view_set_magnification".} -proc zoom_in*(view: PHtmlView){.cdecl, dynlib: htmllib, - importc: "html_view_zoom_in".} -proc zoom_out*(view: PHtmlView){.cdecl, dynlib: htmllib, - importc: "html_view_zoom_out".} -proc zoom_reset*(view: PHtmlView){.cdecl, dynlib: htmllib, - 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()) - -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 = CHECK_CAST(obj, HTML_PARSER_TYPE(), THtmlParser) - -proc HTML_PARSER_CLASS*(klass: pointer): PHtmlParserClass = - result = CHECK_CLASS_CAST(klass, HTML_PARSER_TYPE(), THtmlParserClass) - -proc HTML_IS_PARSER*(obj: pointer): bool = - result = 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 HTML_CONTEXT_TYPE*(): GType = - result = html_context_get_type() - -proc HTML_CONTEXT*(obj: pointer): PHtmlContext = - result = CHECK_CAST(obj, HTML_CONTEXT_TYPE(), THtmlContext) - -proc HTML_CONTEXT_CLASS*(klass: pointer): PHtmlContextClass = - result = CHECK_CLASS_CAST(klass, HTML_CONTEXT_TYPE(), THtmlContextClass) - -proc HTML_IS_CONTEXT*(obj: pointer): bool = - result = CHECK_TYPE(obj, HTML_CONTEXT_TYPE()) - -proc HTML_IS_CONTEXT_CLASS*(klass: pointer): bool = - result = CHECK_CLASS_TYPE(klass, HTML_CONTEXT_TYPE()) - -proc HTML_TYPE_DOCUMENT*(): GType = - result = html_document_get_type() - -proc HTML_DOCUMENT*(obj: pointer): PHtmlDocument = - result = PHtmlDocument(CHECK_CAST(obj, HTML_TYPE_DOCUMENT())) - -proc HTML_DOCUMENT_CLASS*(klass: pointer): PHtmlDocumentClass = - result = CHECK_CLASS_CAST(klass, HTML_TYPE_DOCUMENT()) - -proc HTML_IS_DOCUMENT*(obj: pointer): bool = - result = CHECK_TYPE(obj, HTML_TYPE_DOCUMENT()) - -proc HTML_TYPE_VIEW*(): GType = - result = html_view_get_type() - -proc HTML_VIEW*(obj: pointer): PHtmlView = - result = PHtmlView(CHECK_CAST(obj, HTML_TYPE_VIEW())) - -proc HTML_VIEW_CLASS*(klass: pointer): PHtmlViewClass = - result = PHtmlViewClass(CHECK_CLASS_CAST(klass, HTML_TYPE_VIEW())) - -proc HTML_IS_VIEW*(obj: pointer): bool = - result = CHECK_TYPE(obj, HTML_TYPE_VIEW()) diff --git a/lib/wrappers/gtk/libglade2.nim b/lib/wrappers/gtk/libglade2.nim deleted file mode 100644 index 6dda3364ec..0000000000 --- a/lib/wrappers/gtk/libglade2.nim +++ /dev/null @@ -1,111 +0,0 @@ -{.deadCodeElim: on.} -import - glib2, gtk2 - -when defined(win32): - const - LibGladeLib = "libglade-2.0-0.dll" -elif defined(macosx): - const - LibGladeLib = "libglade-2.0.dylib" -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 init*(){.cdecl, dynlib: LibGladeLib, importc: "glade_init".} -proc require*(TheLibrary: cstring){.cdecl, dynlib: LibGladeLib, - importc: "glade_require".} -proc provide*(TheLibrary: cstring){.cdecl, dynlib: LibGladeLib, - importc: "glade_provide".} -type - PXMLPrivate* = pointer - PXML* = ptr TXML - TXML* = object of TGObject - filename*: cstring - priv*: PXMLPrivate - - PXMLClass* = ptr TXMLClass - TXMLClass* = object of TGObjectClass - TXMLConnectFunc* = proc (handler_name: cstring, anObject: PGObject, - signal_name: cstring, signal_data: cstring, - connect_object: PGObject, after: gboolean, - user_data: gpointer){.cdecl.} - -proc TYPE_XML*(): GType -proc XML*(obj: pointer): PXML -proc XML_CLASS*(klass: pointer): PXMLClass -proc IS_XML*(obj: pointer): gboolean -proc IS_XML_CLASS*(klass: pointer): gboolean -proc XML_GET_CLASS*(obj: pointer): PXMLClass -proc xml_get_type*(): GType{.cdecl, dynlib: LibGladeLib, - importc: "glade_xml_get_type".} -proc xml_new*(fname: cstring, root: cstring, domain: cstring): PXML{.cdecl, - dynlib: LibGladeLib, importc: "glade_xml_new".} -proc xml_new_from_buffer*(buffer: cstring, size: int32, root: cstring, - domain: cstring): PXML{.cdecl, dynlib: LibGladeLib, - importc: "glade_xml_new_from_buffer".} -proc construct*(self: PXML, fname: cstring, root: cstring, domain: cstring): gboolean{. - cdecl, dynlib: LibGladeLib, importc: "glade_xml_construct".} -proc signal_connect*(self: PXML, handlername: cstring, func: TGCallback){. - cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect".} -proc signal_connect_data*(self: PXML, handlername: cstring, - func: TGCallback, user_data: gpointer){.cdecl, - dynlib: LibGladeLib, importc: "glade_xml_signal_connect_data".} -proc signal_autoconnect*(self: PXML){.cdecl, dynlib: LibGladeLib, - importc: "glade_xml_signal_autoconnect".} -proc signal_connect_full*(self: PXML, handler_name: cstring, - func: TXMLConnectFunc, user_data: gpointer){. - cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect_full".} -proc signal_autoconnect_full*(self: PXML, func: TXMLConnectFunc, - user_data: gpointer){.cdecl, - dynlib: LibGladeLib, importc: "glade_xml_signal_autoconnect_full".} -proc get_widget*(self: PXML, name: cstring): gtk2.PWidget{.cdecl, - dynlib: LibGladeLib, importc: "glade_xml_get_widget".} -proc get_widget_prefix*(self: PXML, name: cstring): PGList{.cdecl, - dynlib: LibGladeLib, importc: "glade_xml_get_widget_prefix".} -proc relative_file*(self: PXML, filename: cstring): cstring{.cdecl, - dynlib: LibGladeLib, importc: "glade_xml_relative_file".} -proc get_widget_name*(widget: gtk2.PWidget): cstring{.cdecl, dynlib: LibGladeLib, - importc: "glade_get_widget_name".} -proc get_widget_tree*(widget: gtk2.PWidget): PXML{.cdecl, dynlib: LibGladeLib, - importc: "glade_get_widget_tree".} -type - PXMLCustomWidgetHandler* = ptr TXMLCustomWidgetHandler - TXMLCustomWidgetHandler* = gtk2.TWidget - -proc set_custom_handler*(handler: TXMLCustomWidgetHandler, user_data: gpointer){. - cdecl, dynlib: LibGladeLib, importc: "glade_set_custom_handler".} -proc gnome_init*() = - init() - -proc bonobo_init*() = - init() - -proc xml_new_from_memory*(buffer: cstring, size: int32, root: cstring, - domain: cstring): PXML = - result = xml_new_from_buffer(buffer, size, root, domain) - -proc TYPE_XML*(): GType = - result = xml_get_type() - -proc XML*(obj: pointer): PXML = - result = cast[PXML](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_XML())) - -proc XML_CLASS*(klass: pointer): PXMLClass = - result = cast[PXMLClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_XML())) - -proc IS_XML*(obj: pointer): gboolean = - result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_XML()) - -proc IS_XML_CLASS*(klass: pointer): gboolean = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_XML()) - -proc XML_GET_CLASS*(obj: pointer): PXMLClass = - result = cast[PXMLClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_XML())) diff --git a/lib/wrappers/gtk/pango.nim b/lib/wrappers/gtk/pango.nim deleted file mode 100644 index 5d9fcd96f9..0000000000 --- a/lib/wrappers/gtk/pango.nim +++ /dev/null @@ -1,1160 +0,0 @@ -{.deadCodeElim: on.} -import - glib2 - -when defined(win32): - const - lib* = "libpango-1.0-0.dll" -elif defined(macosx): - const - lib* = "libpango-1.0.dylib" -else: - const - lib* = "libpango-1.0.so.0" -type - TFont* {.pure, final.} = object - PFont* = ptr TFont - TFontFamily* {.pure, final.} = object - PFontFamily* = ptr TFontFamily - TFontSet* {.pure, final.} = object - PFontset* = ptr TFontset - TFontMetrics* {.pure, final.} = object - PFontMetrics* = ptr TFontMetrics - TFontFace* {.pure, final.} = object - PFontFace* = ptr TFontFace - TFontMap* {.pure, final.} = object - PFontMap* = ptr TFontMap - TFontsetClass {.pure, final.} = object - PFontsetClass* = ptr TFontSetClass - TFontFamilyClass* {.pure, final.} = object - PFontFamilyClass* = ptr TFontFamilyClass - TFontFaceClass* {.pure, final.} = object - PFontFaceClass* = ptr TFontFaceClass - TFontClass* {.pure, final.} = object - PFontClass* = ptr TFontClass - TFontMapClass* {.pure, final.} = object - PFontMapClass* = ptr TFontMapClass - PFontDescription* = ptr TFontDescription - TFontDescription* {.pure, final.} = object - PAttrList* = ptr TAttrList - TAttrList* {.pure, final.} = object - PAttrIterator* = ptr TAttrIterator - TAttrIterator* {.pure, final.} = object - PLayout* = ptr TLayout - TLayout* {.pure, final.} = object - PLayoutClass* = ptr TLayoutClass - TLayoutClass* {.pure, final.} = object - PLayoutIter* = ptr TLayoutIter - TLayoutIter* {.pure, final.} = object - PContext* = ptr TContext - TContext* {.pure, final.} = object - PContextClass* = ptr TContextClass - TContextClass* {.pure, final.} = object - PFontsetSimple* = ptr TFontsetSimple - TFontsetSimple* {.pure, final.} = object - PTabArray* = ptr TTabArray - TTabArray* {.pure, final.} = object - PGlyphString* = ptr TGlyphString - PAnalysis* = ptr TAnalysis - PItem* = ptr TItem - PLanguage* = ptr TLanguage - TLanguage* {.pure, final.} = object - PGlyph* = ptr TGlyph - TGlyph* = guint32 - PRectangle* = ptr TRectangle - TRectangle*{.final, pure.} = object - x*: int32 - y*: int32 - width*: int32 - height*: int32 - - PDirection* = ptr TDirection - TDirection* = enum - DIRECTION_LTR, DIRECTION_RTL, DIRECTION_TTB_LTR, DIRECTION_TTB_RTL - PColor* = ptr TColor - TColor*{.final, pure.} = object - red*: guint16 - green*: guint16 - blue*: guint16 - - PAttrType* = ptr TAttrType - TAttrType* = int32 - PUnderline* = ptr TUnderline - TUnderline* = int32 - PAttribute* = ptr TAttribute - PAttrClass* = ptr TAttrClass - TAttribute*{.final, pure.} = object - klass*: PAttrClass - start_index*: int - end_index*: int - - TAttrClass*{.final, pure.} = object - `type`*: TAttrType - copy*: proc (attr: PAttribute): PAttribute{.cdecl.} - destroy*: proc (attr: PAttribute){.cdecl.} - equal*: proc (attr1: PAttribute, attr2: PAttribute): gboolean{.cdecl.} - - PAttrString* = ptr TAttrString - TAttrString*{.final, pure.} = object - attr*: TAttribute - value*: cstring - - PAttrLanguage* = ptr TAttrLanguage - TAttrLanguage*{.final, pure.} = object - attr*: TAttribute - value*: PLanguage - - PAttrInt* = ptr TAttrInt - TAttrInt*{.final, pure.} = object - attr*: TAttribute - value*: int32 - - PAttrFloat* = ptr TAttrFloat - TAttrFloat*{.final, pure.} = object - attr*: TAttribute - value*: gdouble - - PAttrColor* = ptr TAttrColor - TAttrColor*{.final, pure.} = object - attr*: TAttribute - color*: TColor - - PAttrShape* = ptr TAttrShape - TAttrShape*{.final, pure.} = object - attr*: TAttribute - ink_rect*: TRectangle - logical_rect*: TRectangle - - PAttrFontDesc* = ptr TAttrFontDesc - TAttrFontDesc*{.final, pure.} = object - attr*: TAttribute - desc*: PFontDescription - - PLogAttr* = ptr TLogAttr - TLogAttr*{.final, pure.} = object - flag0*: guint16 - - PCoverageLevel* = ptr TCoverageLevel - TCoverageLevel* = enum - COVERAGE_NONE, COVERAGE_FALLBACK, COVERAGE_APPROXIMATE, COVERAGE_EXACT - PBlockInfo* = ptr TBlockInfo - TBlockInfo*{.final, pure.} = object - data*: Pguchar - level*: TCoverageLevel - - PCoverage* = ptr TCoverage - TCoverage*{.final, pure.} = object - ref_count*: int - n_blocks*: int32 - data_size*: int32 - blocks*: PBlockInfo - - PEngineRange* = ptr TEngineRange - TEngineRange*{.final, pure.} = object - start*: int32 - theEnd*: int32 - langs*: cstring - - PEngineInfo* = ptr TEngineInfo - TEngineInfo*{.final, pure.} = object - id*: cstring - engine_type*: cstring - render_type*: cstring - ranges*: PEngineRange - n_ranges*: gint - - PEngine* = ptr TEngine - TEngine*{.final, pure.} = object - id*: cstring - `type`*: cstring - length*: gint - - TEngineLangScriptBreak* = proc (text: cstring, len: int32, - analysis: PAnalysis, attrs: PLogAttr, - attrs_len: int32){.cdecl.} - PEngineLang* = ptr TEngineLang - TEngineLang*{.final, pure.} = object - engine*: TEngine - script_break*: TEngineLangScriptBreak - - TEngineShapeScript* = proc (font: PFont, text: cstring, length: int32, - analysis: PAnalysis, glyphs: PGlyphString){.cdecl.} - TEngineShapeGetCoverage* = proc (font: PFont, language: PLanguage): PCoverage{. - cdecl.} - PEngineShape* = ptr TEngineShape - TEngineShape*{.final, pure.} = object - engine*: TEngine - script_shape*: TEngineShapeScript - get_coverage*: TEngineShapeGetCoverage - - PStyle* = ptr TStyle - TStyle* = gint - PVariant* = ptr TVariant - TVariant* = gint - PWeight* = ptr TWeight - TWeight* = gint - PStretch* = ptr TStretch - TStretch* = gint - PFontMask* = ptr TFontMask - TFontMask* = int32 - PGlyphUnit* = ptr TGlyphUnit - TGlyphUnit* = gint32 - PGlyphGeometry* = ptr TGlyphGeometry - TGlyphGeometry*{.final, pure.} = object - width*: TGlyphUnit - x_offset*: TGlyphUnit - y_offset*: TGlyphUnit - - PGlyphVisAttr* = ptr TGlyphVisAttr - TGlyphVisAttr*{.final, pure.} = object - flag0*: int16 - - PGlyphInfo* = ptr TGlyphInfo - TGlyphInfo*{.final, pure.} = object - glyph*: TGlyph - geometry*: TGlyphGeometry - attr*: TGlyphVisAttr - - TGlyphString*{.final, pure.} = object - num_glyphs*: gint - glyphs*: PGlyphInfo - log_clusters*: Pgint - space*: gint - - TAnalysis*{.final, pure.} = object - shape_engine*: PEngineShape - lang_engine*: PEngineLang - font*: PFont - level*: guint8 - language*: PLanguage - extra_attrs*: PGSList - - TItem*{.final, pure.} = object - offset*: gint - length*: gint - num_chars*: gint - analysis*: TAnalysis - - PAlignment* = ptr TAlignment - TAlignment* = enum - ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT - PWrapMode* = ptr TWrapMode - TWrapMode* = enum - WRAP_WORD, WRAP_CHAR - PLayoutLine* = ptr TLayoutLine - TLayoutLine*{.final, pure.} = object - layout*: PLayout - start_index*: gint - length*: gint - runs*: PGSList - - PLayoutRun* = ptr TLayoutRun - TLayoutRun*{.final, pure.} = object - item*: PItem - glyphs*: PGlyphString - - PTabAlign* = ptr TTabAlign - TTabAlign* = enum - TAB_LEFT - -const - SCALE* = 1024 - -proc PIXELS*(d: int): int -proc ASCENT*(rect: TRectangle): int32 -proc DESCENT*(rect: TRectangle): int32 -proc LBEARING*(rect: TRectangle): int32 -proc RBEARING*(rect: TRectangle): int32 -proc TYPE_LANGUAGE*(): GType -proc language_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_language_get_type".} -proc language_from_string*(language: cstring): PLanguage{.cdecl, dynlib: lib, - importc: "pango_language_from_string".} -proc to_string*(language: PLanguage): cstring -proc matches*(language: PLanguage, range_list: cstring): gboolean{. - cdecl, dynlib: lib, importc: "pango_language_matches".} -const - ATTR_INVALID* = 0 - ATTR_LANGUAGE* = 1 - ATTR_FAMILY* = 2 - ATTR_STYLE* = 3 - ATTR_WEIGHT* = 4 - ATTR_VARIANT* = 5 - ATTR_STRETCH* = 6 - ATTR_SIZE* = 7 - ATTR_FONT_DESC* = 8 - ATTR_FOREGROUND* = 9 - ATTR_BACKGROUND* = 10 - ATTR_UNDERLINE* = 11 - ATTR_STRIKETHROUGH* = 12 - ATTR_RISE* = 13 - ATTR_SHAPE* = 14 - ATTR_SCALE* = 15 - UNDERLINE_NONE* = 0 - UNDERLINE_SINGLE* = 1 - UNDERLINE_DOUBLE* = 2 - UNDERLINE_LOW* = 3 - -proc TYPE_COLOR*(): GType -proc color_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_color_get_type".} -proc copy*(src: PColor): PColor{.cdecl, dynlib: lib, - importc: "pango_color_copy".} -proc free*(color: PColor){.cdecl, dynlib: lib, importc: "pango_color_free".} -proc parse*(color: PColor, spec: cstring): gboolean{.cdecl, dynlib: lib, - importc: "pango_color_parse".} -proc TYPE_ATTR_LIST*(): GType -proc attr_type_register*(name: cstring): TAttrType{.cdecl, dynlib: lib, - importc: "pango_attr_type_register".} -proc copy*(attr: PAttribute): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attribute_copy".} -proc destroy*(attr: PAttribute){.cdecl, dynlib: lib, - importc: "pango_attribute_destroy".} -proc equal*(attr1: PAttribute, attr2: PAttribute): gboolean{.cdecl, - dynlib: lib, importc: "pango_attribute_equal".} -proc attr_language_new*(language: PLanguage): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_language_new".} -proc attr_family_new*(family: cstring): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_family_new".} -proc attr_foreground_new*(red: guint16, green: guint16, blue: guint16): PAttribute{. - cdecl, dynlib: lib, importc: "pango_attr_foreground_new".} -proc attr_background_new*(red: guint16, green: guint16, blue: guint16): PAttribute{. - cdecl, dynlib: lib, importc: "pango_attr_background_new".} -proc attr_size_new*(size: int32): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_size_new".} -proc attr_style_new*(style: TStyle): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_style_new".} -proc attr_weight_new*(weight: TWeight): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_weight_new".} -proc attr_variant_new*(variant: TVariant): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_variant_new".} -proc attr_stretch_new*(stretch: TStretch): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_stretch_new".} -proc attr_font_desc_new*(desc: PFontDescription): PAttribute{.cdecl, - dynlib: lib, importc: "pango_attr_font_desc_new".} -proc attr_underline_new*(underline: TUnderline): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_underline_new".} -proc attr_strikethrough_new*(strikethrough: gboolean): PAttribute{.cdecl, - dynlib: lib, importc: "pango_attr_strikethrough_new".} -proc attr_rise_new*(rise: int32): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_rise_new".} -proc attr_shape_new*(ink_rect: PRectangle, logical_rect: PRectangle): PAttribute{. - cdecl, dynlib: lib, importc: "pango_attr_shape_new".} -proc attr_scale_new*(scale_factor: gdouble): PAttribute{.cdecl, dynlib: lib, - importc: "pango_attr_scale_new".} -proc attr_list_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_attr_list_get_type".} -proc attr_list_new*(): PAttrList{.cdecl, dynlib: lib, - importc: "pango_attr_list_new".} -proc reference*(list: PAttrList){.cdecl, dynlib: lib, - importc: "pango_attr_list_ref".} -proc unref*(list: PAttrList){.cdecl, dynlib: lib, - importc: "pango_attr_list_unref".} -proc copy*(list: PAttrList): PAttrList{.cdecl, dynlib: lib, - importc: "pango_attr_list_copy".} -proc insert*(list: PAttrList, attr: PAttribute){.cdecl, dynlib: lib, - importc: "pango_attr_list_insert".} -proc insert_before*(list: PAttrList, attr: PAttribute){.cdecl, - dynlib: lib, importc: "pango_attr_list_insert_before".} -proc change*(list: PAttrList, attr: PAttribute){.cdecl, dynlib: lib, - importc: "pango_attr_list_change".} -proc splice*(list: PAttrList, other: PAttrList, pos: gint, len: gint){. - cdecl, dynlib: lib, importc: "pango_attr_list_splice".} -proc get_iterator*(list: PAttrList): PAttrIterator{.cdecl, - dynlib: lib, importc: "pango_attr_list_get_iterator".} -proc attr_iterator_range*(`iterator`: PAttrIterator, start: Pgint, theEnd: Pgint){. - cdecl, dynlib: lib, importc: "pango_attr_iterator_range".} -proc attr_iterator_next*(`iterator`: PAttrIterator): gboolean{.cdecl, - dynlib: lib, importc: "pango_attr_iterator_next".} -proc attr_iterator_copy*(`iterator`: PAttrIterator): PAttrIterator{.cdecl, - dynlib: lib, importc: "pango_attr_iterator_copy".} -proc attr_iterator_destroy*(`iterator`: PAttrIterator){.cdecl, dynlib: lib, - importc: "pango_attr_iterator_destroy".} -proc attr_iterator_get*(`iterator`: PAttrIterator, `type`: TAttrType): PAttribute{. - cdecl, dynlib: lib, importc: "pango_attr_iterator_get".} -proc attr_iterator_get_font*(`iterator`: PAttrIterator, desc: PFontDescription, - language: var PLanguage, extra_attrs: PPGSList){. - cdecl, dynlib: lib, importc: "pango_attr_iterator_get_font".} -proc parse_markup*(markup_text: cstring, length: int32, accel_marker: gunichar, - attr_list: var PAttrList, text: PPchar, - accel_char: Pgunichar, error: pointer): gboolean{.cdecl, - dynlib: lib, importc: "pango_parse_markup".} -const - bm_TPangoLogAttr_is_line_break* = 0x0001'i16 - bp_TPangoLogAttr_is_line_break* = 0'i16 - bm_TPangoLogAttr_is_mandatory_break* = 0x0002'i16 - bp_TPangoLogAttr_is_mandatory_break* = 1'i16 - bm_TPangoLogAttr_is_char_break* = 0x0004'i16 - bp_TPangoLogAttr_is_char_break* = 2'i16 - bm_TPangoLogAttr_is_white* = 0x0008'i16 - bp_TPangoLogAttr_is_white* = 3'i16 - bm_TPangoLogAttr_is_cursor_position* = 0x0010'i16 - bp_TPangoLogAttr_is_cursor_position* = 4'i16 - bm_TPangoLogAttr_is_word_start* = 0x0020'i16 - bp_TPangoLogAttr_is_word_start* = 5'i16 - bm_TPangoLogAttr_is_word_end* = 0x0040'i16 - bp_TPangoLogAttr_is_word_end* = 6'i16 - bm_TPangoLogAttr_is_sentence_boundary* = 0x0080'i16 - bp_TPangoLogAttr_is_sentence_boundary* = 7'i16 - bm_TPangoLogAttr_is_sentence_start* = 0x0100'i16 - bp_TPangoLogAttr_is_sentence_start* = 8'i16 - bm_TPangoLogAttr_is_sentence_end* = 0x0200'i16 - bp_TPangoLogAttr_is_sentence_end* = 9'i16 - -proc is_line_break*(a: PLogAttr): guint -proc set_is_line_break*(a: PLogAttr, `is_line_break`: guint) -proc is_mandatory_break*(a: PLogAttr): guint -proc set_is_mandatory_break*(a: PLogAttr, `is_mandatory_break`: guint) -proc is_char_break*(a: PLogAttr): guint -proc set_is_char_break*(a: PLogAttr, `is_char_break`: guint) -proc is_white*(a: PLogAttr): guint -proc set_is_white*(a: PLogAttr, `is_white`: guint) -proc is_cursor_position*(a: PLogAttr): guint -proc set_is_cursor_position*(a: PLogAttr, `is_cursor_position`: guint) -proc is_word_start*(a: PLogAttr): guint -proc set_is_word_start*(a: PLogAttr, `is_word_start`: guint) -proc is_word_end*(a: PLogAttr): guint -proc set_is_word_end*(a: PLogAttr, `is_word_end`: guint) -proc is_sentence_boundary*(a: PLogAttr): guint -proc set_is_sentence_boundary*(a: PLogAttr, `is_sentence_boundary`: guint) -proc is_sentence_start*(a: PLogAttr): guint -proc set_is_sentence_start*(a: PLogAttr, `is_sentence_start`: guint) -proc is_sentence_end*(a: PLogAttr): guint -proc set_is_sentence_end*(a: PLogAttr, `is_sentence_end`: guint) -proc `break`*(text: cstring, length: int32, analysis: PAnalysis, attrs: PLogAttr, - attrs_len: int32){.cdecl, dynlib: lib, importc: "pango_break".} -proc find_paragraph_boundary*(text: cstring, length: gint, - paragraph_delimiter_index: Pgint, - next_paragraph_start: Pgint){.cdecl, dynlib: lib, - importc: "pango_find_paragraph_boundary".} -proc get_log_attrs*(text: cstring, length: int32, level: int32, - language: PLanguage, log_attrs: PLogAttr, attrs_len: int32){. - cdecl, dynlib: lib, importc: "pango_get_log_attrs".} -proc TYPE_CONTEXT*(): GType -proc CONTEXT*(anObject: pointer): PContext -proc CONTEXT_CLASS*(klass: pointer): PContextClass -proc IS_CONTEXT*(anObject: pointer): bool -proc IS_CONTEXT_CLASS*(klass: pointer): bool -proc GET_CLASS*(obj: PContext): PContextClass -proc context_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_context_get_type".} -proc list_families*(context: PContext, - families: openarray[ptr PFontFamily]){.cdecl, - dynlib: lib, importc: "pango_context_list_families".} -proc load_font*(context: PContext, desc: PFontDescription): PFont{. - cdecl, dynlib: lib, importc: "pango_context_load_font".} -proc load_fontset*(context: PContext, desc: PFontDescription, - language: PLanguage): PFontset{.cdecl, dynlib: lib, - importc: "pango_context_load_fontset".} -proc get_metrics*(context: PContext, desc: PFontDescription, - language: PLanguage): PFontMetrics{.cdecl, - dynlib: lib, importc: "pango_context_get_metrics".} -proc set_font_description*(context: PContext, desc: PFontDescription){. - cdecl, dynlib: lib, importc: "pango_context_set_font_description".} -proc get_font_description*(context: PContext): PFontDescription{.cdecl, - dynlib: lib, importc: "pango_context_get_font_description".} -proc get_language*(context: PContext): PLanguage{.cdecl, dynlib: lib, - importc: "pango_context_get_language".} -proc set_language*(context: PContext, language: PLanguage){.cdecl, - dynlib: lib, importc: "pango_context_set_language".} -proc set_base_dir*(context: PContext, direction: TDirection){.cdecl, - dynlib: lib, importc: "pango_context_set_base_dir".} -proc get_base_dir*(context: PContext): TDirection{.cdecl, dynlib: lib, - importc: "pango_context_get_base_dir".} -proc itemize*(context: PContext, text: cstring, start_index: int32, - length: int32, attrs: PAttrList, cached_iter: PAttrIterator): PGList{. - cdecl, dynlib: lib, importc: "pango_itemize".} -proc coverage_new*(): PCoverage{.cdecl, dynlib: lib, - importc: "pango_coverage_new".} -proc reference*(coverage: PCoverage): PCoverage{.cdecl, dynlib: lib, - importc: "pango_coverage_ref".} -proc unref*(coverage: PCoverage){.cdecl, dynlib: lib, - importc: "pango_coverage_unref".} -proc copy*(coverage: PCoverage): PCoverage{.cdecl, dynlib: lib, - importc: "pango_coverage_copy".} -proc get*(coverage: PCoverage, index: int32): TCoverageLevel{.cdecl, - dynlib: lib, importc: "pango_coverage_get".} -proc set*(coverage: PCoverage, index: int32, level: TCoverageLevel){. - cdecl, dynlib: lib, importc: "pango_coverage_set".} -proc max*(coverage: PCoverage, other: PCoverage){.cdecl, dynlib: lib, - importc: "pango_coverage_max".} -proc to_bytes*(coverage: PCoverage, bytes: PPguchar, n_bytes: var int32){. - cdecl, dynlib: lib, importc: "pango_coverage_to_bytes".} -proc coverage_from_bytes*(bytes: Pguchar, n_bytes: int32): PCoverage{.cdecl, - dynlib: lib, importc: "pango_coverage_from_bytes".} -proc TYPE_FONTSET*(): GType -proc FONTSET*(anObject: pointer): PFontset -proc IS_FONTSET*(anObject: pointer): bool -proc fontset_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_fontset_get_type".} -proc get_font*(fontset: PFontset, wc: guint): PFont{.cdecl, dynlib: lib, - importc: "pango_fontset_get_font".} -proc get_metrics*(fontset: PFontset): PFontMetrics{.cdecl, dynlib: lib, - importc: "pango_fontset_get_metrics".} -const - STYLE_NORMAL* = 0 - STYLE_OBLIQUE* = 1 - STYLE_ITALIC* = 2 - VARIANT_NORMAL* = 0 - VARIANT_SMALL_CAPS* = 1 - WEIGHT_ULTRALIGHT* = 200 - WEIGHT_LIGHT* = 300 - WEIGHT_NORMAL* = 400 - WEIGHT_BOLD* = 700 - WEIGHT_ULTRABOLD* = 800 - WEIGHT_HEAVY* = 900 - STRETCH_ULTRA_CONDENSED* = 0 - STRETCH_EXTRA_CONDENSED* = 1 - STRETCH_CONDENSED* = 2 - STRETCH_SEMI_CONDENSED* = 3 - STRETCH_NORMAL* = 4 - STRETCH_SEMI_EXPANDED* = 5 - STRETCH_EXPANDED* = 6 - STRETCH_EXTRA_EXPANDED* = 7 - STRETCH_ULTRA_EXPANDED* = 8 - FONT_MASK_FAMILY* = 1 shl 0 - FONT_MASK_STYLE* = 1 shl 1 - FONT_MASK_VARIANT* = 1 shl 2 - FONT_MASK_WEIGHT* = 1 shl 3 - FONT_MASK_STRETCH* = 1 shl 4 - FONT_MASK_SIZE* = 1 shl 5 - SCALE_XX_SMALL* = 0.578704 - SCALE_X_SMALL* = 0.644444 - SCALE_SMALL* = 0.833333 - SCALE_MEDIUM* = 1.00000 - SCALE_LARGE* = 1.20000 - SCALE_X_LARGE* = 1.44000 - SCALE_XX_LARGE* = 1.72800 - -proc TYPE_FONT_DESCRIPTION*(): GType -proc font_description_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_font_description_get_type".} -proc font_description_new*(): PFontDescription{.cdecl, dynlib: lib, - importc: "pango_font_description_new".} -proc copy*(desc: PFontDescription): PFontDescription{.cdecl, - dynlib: lib, importc: "pango_font_description_copy".} -proc copy_static*(desc: PFontDescription): PFontDescription{. - cdecl, dynlib: lib, importc: "pango_font_description_copy_static".} -proc hash*(desc: PFontDescription): guint{.cdecl, dynlib: lib, - importc: "pango_font_description_hash".} -proc equal*(desc1: PFontDescription, desc2: PFontDescription): gboolean{. - cdecl, dynlib: lib, importc: "pango_font_description_equal".} -proc free*(desc: PFontDescription){.cdecl, dynlib: lib, - importc: "pango_font_description_free".} -proc font_descriptions_free*(descs: var PFontDescription, n_descs: int32){. - cdecl, dynlib: lib, importc: "pango_font_descriptions_free".} -proc set_family*(desc: PFontDescription, family: cstring){. - cdecl, dynlib: lib, importc: "pango_font_description_set_family".} -proc set_family_static*(desc: PFontDescription, family: cstring){. - cdecl, dynlib: lib, importc: "pango_font_description_set_family_static".} -proc get_family*(desc: PFontDescription): cstring{.cdecl, - dynlib: lib, importc: "pango_font_description_get_family".} -proc set_style*(desc: PFontDescription, style: TStyle){.cdecl, - dynlib: lib, importc: "pango_font_description_set_style".} -proc get_style*(desc: PFontDescription): TStyle{.cdecl, - dynlib: lib, importc: "pango_font_description_get_style".} -proc set_variant*(desc: PFontDescription, variant: TVariant){. - cdecl, dynlib: lib, importc: "pango_font_description_set_variant".} -proc get_variant*(desc: PFontDescription): TVariant{.cdecl, - dynlib: lib, importc: "pango_font_description_get_variant".} -proc set_weight*(desc: PFontDescription, weight: TWeight){. - cdecl, dynlib: lib, importc: "pango_font_description_set_weight".} -proc get_weight*(desc: PFontDescription): TWeight{.cdecl, - dynlib: lib, importc: "pango_font_description_get_weight".} -proc set_stretch*(desc: PFontDescription, stretch: TStretch){. - cdecl, dynlib: lib, importc: "pango_font_description_set_stretch".} -proc get_stretch*(desc: PFontDescription): TStretch{.cdecl, - dynlib: lib, importc: "pango_font_description_get_stretch".} -proc set_size*(desc: PFontDescription, size: gint){.cdecl, - dynlib: lib, importc: "pango_font_description_set_size".} -proc get_size*(desc: PFontDescription): gint{.cdecl, - dynlib: lib, importc: "pango_font_description_get_size".} -proc set_absolute_size*(desc: PFontDescription, size: float64){. - cdecl, dynlib: lib, importc: "pango_font_description_set_absolute_size".} -proc get_size_is_absolute*(desc: PFontDescription, - size: float64): gboolean{.cdecl, dynlib: lib, importc: "pango_font_description_get_size_is_absolute".} -proc get_set_fields*(desc: PFontDescription): TFontMask{.cdecl, - dynlib: lib, importc: "pango_font_description_get_set_fields".} -proc unset_fields*(desc: PFontDescription, to_unset: TFontMask){. - cdecl, dynlib: lib, importc: "pango_font_description_unset_fields".} -proc merge*(desc: PFontDescription, - desc_to_merge: PFontDescription, - replace_existing: gboolean){.cdecl, dynlib: lib, - importc: "pango_font_description_merge".} -proc merge_static*(desc: PFontDescription, - desc_to_merge: PFontDescription, - replace_existing: gboolean){.cdecl, - dynlib: lib, importc: "pango_font_description_merge_static".} -proc better_match*(desc: PFontDescription, - old_match: PFontDescription, - new_match: PFontDescription): gboolean{. - cdecl, dynlib: lib, importc: "pango_font_description_better_match".} -proc font_description_from_string*(str: cstring): PFontDescription{.cdecl, - dynlib: lib, importc: "pango_font_description_from_string".} -proc to_string*(desc: PFontDescription): cstring{.cdecl, - dynlib: lib, importc: "pango_font_description_to_string".} -proc to_filename*(desc: PFontDescription): cstring{.cdecl, - dynlib: lib, importc: "pango_font_description_to_filename".} -proc TYPE_FONT_METRICS*(): GType -proc font_metrics_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_font_metrics_get_type".} -proc reference*(metrics: PFontMetrics): PFontMetrics{.cdecl, dynlib: lib, - importc: "pango_font_metrics_ref".} -proc unref*(metrics: PFontMetrics){.cdecl, dynlib: lib, - importc: "pango_font_metrics_unref".} -proc get_ascent*(metrics: PFontMetrics): int32{.cdecl, dynlib: lib, - importc: "pango_font_metrics_get_ascent".} -proc get_descent*(metrics: PFontMetrics): int32{.cdecl, - dynlib: lib, importc: "pango_font_metrics_get_descent".} -proc get_approximate_char_width*(metrics: PFontMetrics): int32{. - cdecl, dynlib: lib, importc: "pango_font_metrics_get_approximate_char_width".} -proc get_approximate_digit_width*(metrics: PFontMetrics): int32{. - cdecl, dynlib: lib, - importc: "pango_font_metrics_get_approximate_digit_width".} -proc TYPE_FONT_FAMILY*(): GType -proc FONT_FAMILY*(anObject: Pointer): PFontFamily -proc IS_FONT_FAMILY*(anObject: Pointer): bool -proc font_family_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_font_family_get_type".} -proc list_faces*(family: PFontFamily, - faces: var openarray[ptr PFontFace]){.cdecl, - dynlib: lib, importc: "pango_font_family_list_faces".} -proc get_name*(family: PFontFamily): cstring{.cdecl, dynlib: lib, - importc: "pango_font_family_get_name".} -proc TYPE_FONT_FACE*(): GType -proc FONT_FACE*(anObject: pointer): PFontFace -proc IS_FONT_FACE*(anObject: pointer): bool -proc font_face_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_font_face_get_type".} -proc describe*(face: PFontFace): PFontDescription{.cdecl, dynlib: lib, - importc: "pango_font_face_describe".} -proc get_face_name*(face: PFontFace): cstring{.cdecl, dynlib: lib, - importc: "pango_font_face_get_face_name".} -proc TYPE_FONT*(): GType -proc FONT*(anObject: pointer): PFont -proc IS_FONT*(anObject: pointer): bool -proc font_get_type*(): GType{.cdecl, dynlib: lib, importc: "pango_font_get_type".} -proc describe*(font: PFont): PFontDescription{.cdecl, dynlib: lib, - importc: "pango_font_describe".} -proc get_coverage*(font: PFont, language: PLanguage): PCoverage{.cdecl, - dynlib: lib, importc: "pango_font_get_coverage".} -proc find_shaper*(font: PFont, language: PLanguage, ch: guint32): PEngineShape{. - cdecl, dynlib: lib, importc: "pango_font_find_shaper".} -proc get_metrics*(font: PFont, language: PLanguage): PFontMetrics{.cdecl, - dynlib: lib, importc: "pango_font_get_metrics".} -proc get_glyph_extents*(font: PFont, glyph: TGlyph, ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, dynlib: lib, - importc: "pango_font_get_glyph_extents".} -proc TYPE_FONT_MAP*(): GType -proc FONT_MAP*(anObject: pointer): PFontMap -proc IS_FONT_MAP*(anObject: pointer): bool -proc font_map_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_font_map_get_type".} -proc load_font*(fontmap: PFontMap, context: PContext, - desc: PFontDescription): PFont{.cdecl, dynlib: lib, - importc: "pango_font_map_load_font".} -proc load_fontset*(fontmap: PFontMap, context: PContext, - desc: PFontDescription, language: PLanguage): PFontset{. - cdecl, dynlib: lib, importc: "pango_font_map_load_fontset".} -proc list_families*(fontmap: PFontMap, - families: var openarray[ptr PFontFamily]){.cdecl, - dynlib: lib, importc: "pango_font_map_list_families".} -const - bm_TPangoGlyphVisAttr_is_cluster_start* = 0x0001'i16 - bp_TPangoGlyphVisAttr_is_cluster_start* = 0'i16 - -proc is_cluster_start*(a: PGlyphVisAttr): guint -proc set_is_cluster_start*(a: PGlyphVisAttr, `is_cluster_start`: guint) -proc TYPE_GLYPH_STRING*(): GType -proc glyph_string_new*(): PGlyphString{.cdecl, dynlib: lib, - importc: "pango_glyph_string_new".} -proc glyph_string_set_size*(`string`: PGlyphString, new_len: gint){.cdecl, - dynlib: lib, importc: "pango_glyph_string_set_size".} -proc glyph_string_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_glyph_string_get_type".} -proc glyph_string_copy*(`string`: PGlyphString): PGlyphString{.cdecl, - dynlib: lib, importc: "pango_glyph_string_copy".} -proc glyph_string_free*(`string`: PGlyphString){.cdecl, dynlib: lib, - importc: "pango_glyph_string_free".} -proc extents*(glyphs: PGlyphString, font: PFont, - ink_rect: PRectangle, logical_rect: PRectangle){. - cdecl, dynlib: lib, importc: "pango_glyph_string_extents".} -proc extents_range*(glyphs: PGlyphString, start: int32, - theEnd: int32, font: PFont, - ink_rect: PRectangle, logical_rect: PRectangle){. - cdecl, dynlib: lib, importc: "pango_glyph_string_extents_range".} -proc get_logical_widths*(glyphs: PGlyphString, text: cstring, - length: int32, embedding_level: int32, - logical_widths: var int32){.cdecl, - dynlib: lib, importc: "pango_glyph_string_get_logical_widths".} -proc index_to_x*(glyphs: PGlyphString, text: cstring, - length: int32, analysis: PAnalysis, index: int32, - trailing: gboolean, x_pos: var int32){.cdecl, - dynlib: lib, importc: "pango_glyph_string_index_to_x".} -proc x_to_index*(glyphs: PGlyphString, text: cstring, - length: int32, analysis: PAnalysis, x_pos: int32, - index, trailing: var int32){.cdecl, dynlib: lib, - importc: "pango_glyph_string_x_to_index".} -proc shape*(text: cstring, length: gint, analysis: PAnalysis, - glyphs: PGlyphString){.cdecl, dynlib: lib, importc: "pango_shape".} -proc reorder_items*(logical_items: PGList): PGList{.cdecl, dynlib: lib, - importc: "pango_reorder_items".} -proc item_new*(): PItem{.cdecl, dynlib: lib, importc: "pango_item_new".} -proc copy*(item: PItem): PItem{.cdecl, dynlib: lib, - importc: "pango_item_copy".} -proc free*(item: PItem){.cdecl, dynlib: lib, importc: "pango_item_free".} -proc split*(orig: PItem, split_index: int32, split_offset: int32): PItem{. - cdecl, dynlib: lib, importc: "pango_item_split".} -proc TYPE_LAYOUT*(): GType -proc LAYOUT*(anObject: pointer): PLayout -proc LAYOUT_CLASS*(klass: pointer): PLayoutClass -proc IS_LAYOUT*(anObject: pointer): bool -proc IS_LAYOUT_CLASS*(klass: pointer): bool -proc GET_CLASS*(obj: PLayout): PLayoutClass -proc layout_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_layout_get_type".} -proc layout_new*(context: PContext): PLayout{.cdecl, dynlib: lib, - importc: "pango_layout_new".} -proc copy*(src: PLayout): PLayout{.cdecl, dynlib: lib, - importc: "pango_layout_copy".} -proc get_context*(layout: PLayout): PContext{.cdecl, dynlib: lib, - importc: "pango_layout_get_context".} -proc set_attributes*(layout: PLayout, attrs: PAttrList){.cdecl, - dynlib: lib, importc: "pango_layout_set_attributes".} -proc get_attributes*(layout: PLayout): PAttrList{.cdecl, dynlib: lib, - importc: "pango_layout_get_attributes".} -proc set_text*(layout: PLayout, text: cstring, length: int32){.cdecl, - dynlib: lib, importc: "pango_layout_set_text".} -proc get_text*(layout: PLayout): cstring{.cdecl, dynlib: lib, - importc: "pango_layout_get_text".} -proc set_markup*(layout: PLayout, markup: cstring, length: int32){.cdecl, - dynlib: lib, importc: "pango_layout_set_markup".} -proc set_markup*(layout: PLayout, markup: cstring, - length: int32, accel_marker: gunichar, - accel_char: Pgunichar){.cdecl, dynlib: lib, - importc: "pango_layout_set_markup_with_accel".} -proc set_font_description*(layout: PLayout, desc: PFontDescription){. - cdecl, dynlib: lib, importc: "pango_layout_set_font_description".} -proc set_width*(layout: PLayout, width: int32){.cdecl, dynlib: lib, - importc: "pango_layout_set_width".} -proc get_width*(layout: PLayout): int32{.cdecl, dynlib: lib, - importc: "pango_layout_get_width".} -proc set_wrap*(layout: PLayout, wrap: TWrapMode){.cdecl, dynlib: lib, - importc: "pango_layout_set_wrap".} -proc get_wrap*(layout: PLayout): TWrapMode{.cdecl, dynlib: lib, - importc: "pango_layout_get_wrap".} -proc set_indent*(layout: PLayout, indent: int32){.cdecl, dynlib: lib, - importc: "pango_layout_set_indent".} -proc get_indent*(layout: PLayout): int32{.cdecl, dynlib: lib, - importc: "pango_layout_get_indent".} -proc set_spacing*(layout: PLayout, spacing: int32){.cdecl, dynlib: lib, - importc: "pango_layout_set_spacing".} -proc get_spacing*(layout: PLayout): int32{.cdecl, dynlib: lib, - importc: "pango_layout_get_spacing".} -proc set_justify*(layout: PLayout, justify: gboolean){.cdecl, - dynlib: lib, importc: "pango_layout_set_justify".} -proc get_justify*(layout: PLayout): gboolean{.cdecl, dynlib: lib, - importc: "pango_layout_get_justify".} -proc set_alignment*(layout: PLayout, alignment: TAlignment){.cdecl, - dynlib: lib, importc: "pango_layout_set_alignment".} -proc get_alignment*(layout: PLayout): TAlignment{.cdecl, dynlib: lib, - importc: "pango_layout_get_alignment".} -proc set_tabs*(layout: PLayout, tabs: PTabArray){.cdecl, dynlib: lib, - importc: "pango_layout_set_tabs".} -proc get_tabs*(layout: PLayout): PTabArray{.cdecl, dynlib: lib, - importc: "pango_layout_get_tabs".} -proc set_single_paragraph_mode*(layout: PLayout, setting: gboolean){. - cdecl, dynlib: lib, importc: "pango_layout_set_single_paragraph_mode".} -proc get_single_paragraph_mode*(layout: PLayout): gboolean{.cdecl, - dynlib: lib, importc: "pango_layout_get_single_paragraph_mode".} -proc context_changed*(layout: PLayout){.cdecl, dynlib: lib, - importc: "pango_layout_context_changed".} -proc get_log_attrs*(layout: PLayout, attrs: var PLogAttr, n_attrs: Pgint){. - cdecl, dynlib: lib, importc: "pango_layout_get_log_attrs".} -proc index_to_pos*(layout: PLayout, index: int32, pos: PRectangle){. - cdecl, dynlib: lib, importc: "pango_layout_index_to_pos".} -proc get_cursor_pos*(layout: PLayout, index: int32, - strong_pos: PRectangle, weak_pos: PRectangle){. - cdecl, dynlib: lib, importc: "pango_layout_get_cursor_pos".} -proc move_cursor_visually*(layout: PLayout, strong: gboolean, - old_index: int32, old_trailing: int32, - direction: int32, - new_index, new_trailing: var int32){.cdecl, - dynlib: lib, importc: "pango_layout_move_cursor_visually".} -proc xy_to_index*(layout: PLayout, x: int32, y: int32, - index, trailing: var int32): gboolean{.cdecl, - dynlib: lib, importc: "pango_layout_xy_to_index".} -proc get_extents*(layout: PLayout, ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, dynlib: lib, - importc: "pango_layout_get_extents".} -proc get_pixel_extents*(layout: PLayout, ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, dynlib: lib, - importc: "pango_layout_get_pixel_extents".} -proc get_size*(layout: PLayout, width: var int32, height: var int32){. - cdecl, dynlib: lib, importc: "pango_layout_get_size".} -proc get_pixel_size*(layout: PLayout, width: var int32, height: var int32){. - cdecl, dynlib: lib, importc: "pango_layout_get_pixel_size".} -proc get_line_count*(layout: PLayout): int32{.cdecl, dynlib: lib, - importc: "pango_layout_get_line_count".} -proc get_line*(layout: PLayout, line: int32): PLayoutLine{.cdecl, - dynlib: lib, importc: "pango_layout_get_line".} -proc get_lines*(layout: PLayout): PGSList{.cdecl, dynlib: lib, - importc: "pango_layout_get_lines".} -proc reference*(line: PLayoutLine){.cdecl, dynlib: lib, - importc: "pango_layout_line_ref".} -proc unref*(line: PLayoutLine){.cdecl, dynlib: lib, - importc: "pango_layout_line_unref".} -proc x_to_index*(line: PLayoutLine, x_pos: int32, index: var int32, - trailing: var int32): gboolean{.cdecl, dynlib: lib, - importc: "pango_layout_line_x_to_index".} -proc index_to_x*(line: PLayoutLine, index: int32, - trailing: gboolean, x_pos: var int32){.cdecl, - dynlib: lib, importc: "pango_layout_line_index_to_x".} -proc get_extents*(line: PLayoutLine, ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, dynlib: lib, - importc: "pango_layout_line_get_extents".} -proc get_pixel_extents*(layout_line: PLayoutLine, - ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, - dynlib: lib, importc: "pango_layout_line_get_pixel_extents".} -proc get_iter*(layout: PLayout): PLayoutIter{.cdecl, dynlib: lib, - importc: "pango_layout_get_iter".} -proc free*(iter: PLayoutIter){.cdecl, dynlib: lib, - importc: "pango_layout_iter_free".} -proc get_index*(iter: PLayoutIter): int32{.cdecl, dynlib: lib, - importc: "pango_layout_iter_get_index".} -proc get_run*(iter: PLayoutIter): PLayoutRun{.cdecl, dynlib: lib, - importc: "pango_layout_iter_get_run".} -proc get_line*(iter: PLayoutIter): PLayoutLine{.cdecl, dynlib: lib, - importc: "pango_layout_iter_get_line".} -proc at_last_line*(iter: PLayoutIter): gboolean{.cdecl, dynlib: lib, - importc: "pango_layout_iter_at_last_line".} -proc next_char*(iter: PLayoutIter): gboolean{.cdecl, dynlib: lib, - importc: "pango_layout_iter_next_char".} -proc next_cluster*(iter: PLayoutIter): gboolean{.cdecl, dynlib: lib, - importc: "pango_layout_iter_next_cluster".} -proc next_run*(iter: PLayoutIter): gboolean{.cdecl, dynlib: lib, - importc: "pango_layout_iter_next_run".} -proc next_line*(iter: PLayoutIter): gboolean{.cdecl, dynlib: lib, - importc: "pango_layout_iter_next_line".} -proc get_char_extents*(iter: PLayoutIter, logical_rect: PRectangle){. - cdecl, dynlib: lib, importc: "pango_layout_iter_get_char_extents".} -proc get_cluster_extents*(iter: PLayoutIter, ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, - dynlib: lib, importc: "pango_layout_iter_get_cluster_extents".} -proc get_run_extents*(iter: PLayoutIter, ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, dynlib: lib, - importc: "pango_layout_iter_get_run_extents".} -proc get_line_extents*(iter: PLayoutIter, ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, - dynlib: lib, importc: "pango_layout_iter_get_line_extents".} -proc get_line_yrange*(iter: PLayoutIter, y0: var int32, - y1: var int32){.cdecl, dynlib: lib, - importc: "pango_layout_iter_get_line_yrange".} -proc get_layout_extents*(iter: PLayoutIter, ink_rect: PRectangle, - logical_rect: PRectangle){.cdecl, - dynlib: lib, importc: "pango_layout_iter_get_layout_extents".} -proc get_baseline*(iter: PLayoutIter): int32{.cdecl, dynlib: lib, - importc: "pango_layout_iter_get_baseline".} -proc TYPE_TAB_ARRAY*(): GType -proc tab_array_new*(initial_size: gint, positions_in_pixels: gboolean): PTabArray{. - cdecl, dynlib: lib, importc: "pango_tab_array_new".} -proc tab_array_get_type*(): GType{.cdecl, dynlib: lib, - importc: "pango_tab_array_get_type".} -proc copy*(src: PTabArray): PTabArray{.cdecl, dynlib: lib, - importc: "pango_tab_array_copy".} -proc free*(tab_array: PTabArray){.cdecl, dynlib: lib, - importc: "pango_tab_array_free".} -proc get_size*(tab_array: PTabArray): gint{.cdecl, dynlib: lib, - importc: "pango_tab_array_get_size".} -proc resize*(tab_array: PTabArray, new_size: gint){.cdecl, - dynlib: lib, importc: "pango_tab_array_resize".} -proc set_tab*(tab_array: PTabArray, tab_index: gint, - alignment: TTabAlign, location: gint){.cdecl, - dynlib: lib, importc: "pango_tab_array_set_tab".} -proc get_tab*(tab_array: PTabArray, tab_index: gint, - alignment: PTabAlign, location: Pgint){.cdecl, - dynlib: lib, importc: "pango_tab_array_get_tab".} -proc get_positions_in_pixels*(tab_array: PTabArray): gboolean{.cdecl, - dynlib: lib, importc: "pango_tab_array_get_positions_in_pixels".} -proc ASCENT*(rect: TRectangle): int32 = - result = -rect.y - -proc DESCENT*(rect: TRectangle): int32 = - result = (rect.y) + (rect.height) - -proc LBEARING*(rect: TRectangle): int32 = - result = rect.x - -proc RBEARING*(rect: TRectangle): int32 = - result = (rect.x) + (rect.width) - -proc TYPE_LANGUAGE*(): GType = - result = language_get_type() - -proc to_string*(language: PLanguage): cstring = - result = cast[cstring](language) - -proc PIXELS*(d: int): int = - if d >= 0: - result = (d + (SCALE div 2)) div SCALE - else: - result = (d - (SCALE div 2)) div SCALE - -proc TYPE_COLOR*(): GType = - result = color_get_type() - -proc TYPE_ATTR_LIST*(): GType = - result = attr_list_get_type() - -proc is_line_break*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_line_break) shr - bp_TPangoLogAttr_is_line_break - -proc set_is_line_break*(a: PLogAttr, `is_line_break`: guint) = - a.flag0 = a.flag0 or - (int16(`is_line_break` shl bp_TPangoLogAttr_is_line_break) and - bm_TPangoLogAttr_is_line_break) - -proc is_mandatory_break*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_mandatory_break) shr - bp_TPangoLogAttr_is_mandatory_break - -proc set_is_mandatory_break*(a: PLogAttr, `is_mandatory_break`: guint) = - a.flag0 = a.flag0 or - (int16(`is_mandatory_break` shl bp_TPangoLogAttr_is_mandatory_break) and - bm_TPangoLogAttr_is_mandatory_break) - -proc is_char_break*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_char_break) shr - bp_TPangoLogAttr_is_char_break - -proc set_is_char_break*(a: PLogAttr, `is_char_break`: guint) = - a.flag0 = a.flag0 or - (int16(`is_char_break` shl bp_TPangoLogAttr_is_char_break) and - bm_TPangoLogAttr_is_char_break) - -proc is_white*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_white) shr - bp_TPangoLogAttr_is_white - -proc set_is_white*(a: PLogAttr, `is_white`: guint) = - a.flag0 = a.flag0 or - (int16(`is_white` shl bp_TPangoLogAttr_is_white) and - bm_TPangoLogAttr_is_white) - -proc is_cursor_position*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_cursor_position) shr - bp_TPangoLogAttr_is_cursor_position - -proc set_is_cursor_position*(a: PLogAttr, `is_cursor_position`: guint) = - a.flag0 = a.flag0 or - (int16(`is_cursor_position` shl bp_TPangoLogAttr_is_cursor_position) and - bm_TPangoLogAttr_is_cursor_position) - -proc is_word_start*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_word_start) shr - bp_TPangoLogAttr_is_word_start - -proc set_is_word_start*(a: PLogAttr, `is_word_start`: guint) = - a.flag0 = a.flag0 or - (int16(`is_word_start` shl bp_TPangoLogAttr_is_word_start) and - bm_TPangoLogAttr_is_word_start) - -proc is_word_end*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_word_end) shr - bp_TPangoLogAttr_is_word_end - -proc set_is_word_end*(a: PLogAttr, `is_word_end`: guint) = - a.flag0 = a.flag0 or - (int16(`is_word_end` shl bp_TPangoLogAttr_is_word_end) and - bm_TPangoLogAttr_is_word_end) - -proc is_sentence_boundary*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_sentence_boundary) shr - bp_TPangoLogAttr_is_sentence_boundary - -proc set_is_sentence_boundary*(a: PLogAttr, `is_sentence_boundary`: guint) = - a.flag0 = a.flag0 or - (int16(`is_sentence_boundary` shl bp_TPangoLogAttr_is_sentence_boundary) and - bm_TPangoLogAttr_is_sentence_boundary) - -proc is_sentence_start*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_sentence_start) shr - bp_TPangoLogAttr_is_sentence_start - -proc set_is_sentence_start*(a: PLogAttr, `is_sentence_start`: guint) = - a.flag0 = a.flag0 or - (int16(`is_sentence_start` shl bp_TPangoLogAttr_is_sentence_start) and - bm_TPangoLogAttr_is_sentence_start) - -proc is_sentence_end*(a: PLogAttr): guint = - result = (a.flag0 and bm_TPangoLogAttr_is_sentence_end) shr - bp_TPangoLogAttr_is_sentence_end - -proc set_is_sentence_end*(a: PLogAttr, `is_sentence_end`: guint) = - a.flag0 = a.flag0 or - (int16(`is_sentence_end` shl bp_TPangoLogAttr_is_sentence_end) and - bm_TPangoLogAttr_is_sentence_end) - -proc TYPE_CONTEXT*(): GType = - result = context_get_type() - -proc CONTEXT*(anObject: pointer): PContext = - result = cast[PContext](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_CONTEXT())) - -proc CONTEXT_CLASS*(klass: pointer): PContextClass = - result = cast[PContextClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_CONTEXT())) - -proc IS_CONTEXT*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_CONTEXT()) - -proc IS_CONTEXT_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_CONTEXT()) - -proc GET_CLASS*(obj: PContext): PContextClass = - result = cast[PContextClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_CONTEXT())) - -proc TYPE_FONTSET*(): GType = - result = fontset_get_type() - -proc FONTSET*(anObject: pointer): PFontset = - result = cast[PFontset](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_FONTSET())) - -proc IS_FONTSET*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_FONTSET()) - -proc FONTSET_CLASS*(klass: pointer): PFontsetClass = - result = cast[PFontsetClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_FONTSET())) - -proc IS_FONTSET_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_FONTSET()) - -proc GET_CLASS*(obj: PFontset): PFontsetClass = - result = cast[PFontsetClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_FONTSET())) - -proc fontset_simple_get_type(): GType{.importc: "pango_fontset_simple_get_type", - cdecl, dynlib: lib.} -proc TYPE_FONTSET_SIMPLE*(): GType = - result = fontset_simple_get_type() - -proc FONTSET_SIMPLE*(anObject: pointer): PFontsetSimple = - result = cast[PFontsetSimple](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_FONTSET_SIMPLE())) - -proc IS_FONTSET_SIMPLE*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_FONTSET_SIMPLE()) - -proc TYPE_FONT_DESCRIPTION*(): GType = - result = font_description_get_type() - -proc TYPE_FONT_METRICS*(): GType = - result = font_metrics_get_type() - -proc TYPE_FONT_FAMILY*(): GType = - result = font_family_get_type() - -proc FONT_FAMILY*(anObject: pointer): PFontFamily = - result = cast[PFontFamily](G_TYPE_CHECK_INSTANCE_CAST(anObject, - TYPE_FONT_FAMILY())) - -proc IS_FONT_FAMILY*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_FONT_FAMILY()) - -proc FONT_FAMILY_CLASS*(klass: Pointer): PFontFamilyClass = - result = cast[PFontFamilyClass](G_TYPE_CHECK_CLASS_CAST(klass, - TYPE_FONT_FAMILY())) - -proc IS_FONT_FAMILY_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_FONT_FAMILY()) - -proc GET_CLASS*(obj: PFontFamily): PFontFamilyClass = - result = cast[PFontFamilyClass](G_TYPE_INSTANCE_GET_CLASS(obj, - TYPE_FONT_FAMILY())) - -proc TYPE_FONT_FACE*(): GType = - result = font_face_get_type() - -proc FONT_FACE*(anObject: Pointer): PFontFace = - result = cast[PFontFace](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_FONT_FACE())) - -proc IS_FONT_FACE*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_FONT_FACE()) - -proc FONT_FACE_CLASS*(klass: Pointer): PFontFaceClass = - result = cast[PFontFaceClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_FONT_FACE())) - -proc IS_FONT_FACE_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_FONT_FACE()) - -proc FONT_FACE_GET_CLASS*(obj: Pointer): PFontFaceClass = - result = cast[PFontFaceClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_FONT_FACE())) - -proc TYPE_FONT*(): GType = - result = font_get_type() - -proc FONT*(anObject: Pointer): PFont = - result = cast[PFont](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_FONT())) - -proc IS_FONT*(anObject: Pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_FONT()) - -proc FONT_CLASS*(klass: Pointer): PFontClass = - result = cast[PFontClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_FONT())) - -proc IS_FONT_CLASS*(klass: Pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_FONT()) - -proc GET_CLASS*(obj: PFont): PFontClass = - result = cast[PFontClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_FONT())) - -proc TYPE_FONT_MAP*(): GType = - result = font_map_get_type() - -proc FONT_MAP*(anObject: pointer): PFontmap = - result = cast[PFontmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_FONT_MAP())) - -proc IS_FONT_MAP*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_FONT_MAP()) - -proc FONT_MAP_CLASS*(klass: pointer): PFontMapClass = - result = cast[PFontMapClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_FONT_MAP())) - -proc IS_FONT_MAP_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_FONT_MAP()) - -proc GET_CLASS*(obj: PFontMap): PFontMapClass = - result = cast[PFontMapClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_FONT_MAP())) - -proc is_cluster_start*(a: PGlyphVisAttr): guint = - result = (a.flag0 and bm_TPangoGlyphVisAttr_is_cluster_start) shr - bp_TPangoGlyphVisAttr_is_cluster_start - -proc set_is_cluster_start*(a: PGlyphVisAttr, `is_cluster_start`: guint) = - a.flag0 = a.flag0 or - (int16(`is_cluster_start` shl bp_TPangoGlyphVisAttr_is_cluster_start) and - bm_TPangoGlyphVisAttr_is_cluster_start) - -proc TYPE_GLYPH_STRING*(): GType = - result = glyph_string_get_type() - -proc TYPE_LAYOUT*(): GType = - result = layout_get_type() - -proc LAYOUT*(anObject: pointer): PLayout = - result = cast[PLayout](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_LAYOUT())) - -proc LAYOUT_CLASS*(klass: pointer): PLayoutClass = - result = cast[PLayoutClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_LAYOUT())) - -proc IS_LAYOUT*(anObject: pointer): bool = - result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_LAYOUT()) - -proc IS_LAYOUT_CLASS*(klass: pointer): bool = - result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_LAYOUT()) - -proc GET_CLASS*(obj: PLayout): PLayoutClass = - result = cast[PLayoutClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_LAYOUT())) - -proc TYPE_TAB_ARRAY*(): GType = - result = tab_array_get_type() diff --git a/lib/wrappers/gtk/pangoutils.nim b/lib/wrappers/gtk/pangoutils.nim deleted file mode 100644 index 240273b11b..0000000000 --- a/lib/wrappers/gtk/pangoutils.nim +++ /dev/null @@ -1,42 +0,0 @@ -{.deadCodeElim: on.} -import - glib2, pango - -proc split_file_list*(str: cstring): PPchar{.cdecl, dynlib: lib, - importc: "pango_split_file_list".} -proc trim_string*(str: cstring): cstring{.cdecl, dynlib: lib, - importc: "pango_trim_string".} -proc read_line*(stream: TFile, str: PGString): gint{.cdecl, dynlib: lib, - importc: "pango_read_line".} -proc skip_space*(pos: PPchar): gboolean{.cdecl, dynlib: lib, - importc: "pango_skip_space".} -proc scan_word*(pos: PPchar, OutStr: PGString): gboolean{.cdecl, dynlib: lib, - importc: "pango_scan_word".} -proc scan_string*(pos: PPchar, OutStr: PGString): gboolean{.cdecl, dynlib: lib, - importc: "pango_scan_string".} -proc scan_int*(pos: PPchar, OutInt: ptr int32): gboolean{.cdecl, dynlib: lib, - importc: "pango_scan_int".} -proc config_key_get*(key: cstring): cstring{.cdecl, dynlib: lib, - importc: "pango_config_key_get".} -proc lookup_aliases*(fontname: cstring, families: PPPchar, n_families: ptr int32){. - cdecl, dynlib: lib, importc: "pango_lookup_aliases".} -proc parse_style*(str: cstring, style: PStyle, warn: gboolean): gboolean{.cdecl, - dynlib: lib, importc: "pango_parse_style".} -proc parse_variant*(str: cstring, variant: PVariant, warn: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "pango_parse_variant".} -proc parse_weight*(str: cstring, weight: PWeight, warn: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "pango_parse_weight".} -proc parse_stretch*(str: cstring, stretch: PStretch, warn: gboolean): gboolean{. - cdecl, dynlib: lib, importc: "pango_parse_stretch".} -proc get_sysconf_subdirectory*(): cstring{.cdecl, dynlib: lib, - importc: "pango_get_sysconf_subdirectory".} -proc get_lib_subdirectory*(): cstring{.cdecl, dynlib: lib, - importc: "pango_get_lib_subdirectory".} -proc log2vis_get_embedding_levels*(str: Pgunichar, len: int32, - pbase_dir: PDirection, - embedding_level_list: Pguint8): gboolean{. - cdecl, dynlib: lib, importc: "pango_log2vis_get_embedding_levels".} -proc get_mirror_char*(ch: gunichar, mirrored_ch: Pgunichar): gboolean{.cdecl, - dynlib: lib, importc: "pango_get_mirror_char".} -proc get_sample_string*(language: PLanguage): cstring{.cdecl, - dynlib: lib, importc: "pango_language_get_sample_string".} From 0b4805f3668d5babebf0532305b7caf58ca4817e Mon Sep 17 00:00:00 2001 From: fowlmouth Date: Sun, 1 Dec 2013 21:17:50 -0600 Subject: [PATCH 055/326] Removed opengl --- lib/wrappers/opengl/gl.nim | 1536 ----- lib/wrappers/opengl/glext.nim | 4673 --------------- lib/wrappers/opengl/glu.nim | 335 -- lib/wrappers/opengl/glut.nim | 438 -- lib/wrappers/opengl/glx.nim | 153 - lib/wrappers/opengl/opengl.nim | 9708 -------------------------------- lib/wrappers/opengl/wingl.nim | 368 -- 7 files changed, 17211 deletions(-) delete mode 100644 lib/wrappers/opengl/gl.nim delete mode 100644 lib/wrappers/opengl/glext.nim delete mode 100644 lib/wrappers/opengl/glu.nim delete mode 100644 lib/wrappers/opengl/glut.nim delete mode 100644 lib/wrappers/opengl/glx.nim delete mode 100644 lib/wrappers/opengl/opengl.nim delete mode 100644 lib/wrappers/opengl/wingl.nim diff --git a/lib/wrappers/opengl/gl.nim b/lib/wrappers/opengl/gl.nim deleted file mode 100644 index 9387b5bc9e..0000000000 --- a/lib/wrappers/opengl/gl.nim +++ /dev/null @@ -1,1536 +0,0 @@ -# -# -# Adaption of the delphi3d.net OpenGL units to FreePascal -# Sebastian Guenther (sg@freepascal.org) in 2002 -# These units are free to use -# -#****************************************************************************** -# Converted to Delphi by Tom Nuydens (tom@delphi3d.net) -# For the latest updates, visit Delphi3D: http://www.delphi3d.net -#****************************************************************************** - -when defined(windows): - {.push, callconv: stdcall.} -else: - {.push, callconv: cdecl.} -when defined(windows): - const - dllname* = "opengl32.dll" -elif defined(macosx): - const - dllname* = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib" -else: - const - dllname* = "libGL.so.1" -type - PGLenum* = ptr TGLenum - PGLboolean* = ptr TGLboolean - PGLbitfield* = ptr TGLbitfield - TGLbyte* = int8 - PGLbyte* = ptr TGlbyte - PGLshort* = ptr TGLshort - PGLint* = ptr TGLint - PGLsizei* = ptr TGLsizei - PGLubyte* = ptr TGLubyte - PGLushort* = ptr TGLushort - PGLuint* = ptr TGLuint - PGLfloat* = ptr TGLfloat - PGLclampf* = ptr TGLclampf - PGLdouble* = ptr TGLdouble - PGLclampd* = ptr TGLclampd - PGLvoid* = Pointer - PPGLvoid* = ptr PGLvoid - TGLenum* = cint - TGLboolean* = bool - TGLbitfield* = cint - TGLshort* = int16 - TGLint* = cint - TGLsizei* = int - TGLubyte* = int8 - TGLushort* = int16 - TGLuint* = cint - TGLfloat* = float32 - TGLclampf* = float32 - TGLdouble* = float - TGLclampd* = float - -const # Version - GL_VERSION_1_1* = 1 # AccumOp - constGL_ACCUM* = 0x00000100 - GL_LOAD* = 0x00000101 - GL_RETURN* = 0x00000102 - GL_MULT* = 0x00000103 - GL_ADD* = 0x00000104 # AlphaFunction - GL_NEVER* = 0x00000200 - GL_LESS* = 0x00000201 - GL_EQUAL* = 0x00000202 - GL_LEQUAL* = 0x00000203 - GL_GREATER* = 0x00000204 - GL_NOTEQUAL* = 0x00000205 - GL_GEQUAL* = 0x00000206 - GL_ALWAYS* = 0x00000207 # AttribMask - GL_CURRENT_BIT* = 0x00000001 - GL_POINT_BIT* = 0x00000002 - GL_LINE_BIT* = 0x00000004 - GL_POLYGON_BIT* = 0x00000008 - GL_POLYGON_STIPPLE_BIT* = 0x00000010 - GL_PIXEL_MODE_BIT* = 0x00000020 - GL_LIGHTING_BIT* = 0x00000040 - GL_FOG_BIT* = 0x00000080 - GL_DEPTH_BUFFER_BIT* = 0x00000100 - GL_ACCUM_BUFFER_BIT* = 0x00000200 - GL_STENCIL_BUFFER_BIT* = 0x00000400 - GL_VIEWPORT_BIT* = 0x00000800 - GL_TRANSFORM_BIT* = 0x00001000 - GL_ENABLE_BIT* = 0x00002000 - GL_COLOR_BUFFER_BIT* = 0x00004000 - GL_HINT_BIT* = 0x00008000 - GL_EVAL_BIT* = 0x00010000 - GL_LIST_BIT* = 0x00020000 - GL_TEXTURE_BIT* = 0x00040000 - GL_SCISSOR_BIT* = 0x00080000 - GL_ALL_ATTRIB_BITS* = 0x000FFFFF # BeginMode - GL_POINTS* = 0x00000000 - GL_LINES* = 0x00000001 - GL_LINE_LOOP* = 0x00000002 - GL_LINE_STRIP* = 0x00000003 - GL_TRIANGLES* = 0x00000004 - GL_TRIANGLE_STRIP* = 0x00000005 - GL_TRIANGLE_FAN* = 0x00000006 - GL_QUADS* = 0x00000007 - GL_QUAD_STRIP* = 0x00000008 - GL_POLYGON* = 0x00000009 # BlendingFactorDest - GL_ZERO* = 0 - GL_ONE* = 1 - GL_SRC_COLOR* = 0x00000300 - GL_ONE_MINUS_SRC_COLOR* = 0x00000301 - GL_SRC_ALPHA* = 0x00000302 - GL_ONE_MINUS_SRC_ALPHA* = 0x00000303 - GL_DST_ALPHA* = 0x00000304 - GL_ONE_MINUS_DST_ALPHA* = 0x00000305 # BlendingFactorSrc - # GL_ZERO - # GL_ONE - GL_DST_COLOR* = 0x00000306 - GL_ONE_MINUS_DST_COLOR* = 0x00000307 - GL_SRC_ALPHA_SATURATE* = 0x00000308 # GL_SRC_ALPHA - # GL_ONE_MINUS_SRC_ALPHA - # GL_DST_ALPHA - # GL_ONE_MINUS_DST_ALPHA - # Boolean - GL_TRUE* = 1 - GL_FALSE* = 0 # ClearBufferMask - # GL_COLOR_BUFFER_BIT - # GL_ACCUM_BUFFER_BIT - # GL_STENCIL_BUFFER_BIT - # GL_DEPTH_BUFFER_BIT - # ClientArrayType - # GL_VERTEX_ARRAY - # GL_NORMAL_ARRAY - # GL_COLOR_ARRAY - # GL_INDEX_ARRAY - # GL_TEXTURE_COORD_ARRAY - # GL_EDGE_FLAG_ARRAY - # ClipPlaneName - GL_CLIP_PLANE0* = 0x00003000 - GL_CLIP_PLANE1* = 0x00003001 - GL_CLIP_PLANE2* = 0x00003002 - GL_CLIP_PLANE3* = 0x00003003 - GL_CLIP_PLANE4* = 0x00003004 - GL_CLIP_PLANE5* = 0x00003005 # ColorMaterialFace - # GL_FRONT - # GL_BACK - # GL_FRONT_AND_BACK - # ColorMaterialParameter - # GL_AMBIENT - # GL_DIFFUSE - # GL_SPECULAR - # GL_EMISSION - # GL_AMBIENT_AND_DIFFUSE - # ColorPointerType - # GL_BYTE - # GL_UNSIGNED_BYTE - # GL_SHORT - # GL_UNSIGNED_SHORT - # GL_INT - # GL_UNSIGNED_INT - # GL_FLOAT - # GL_DOUBLE - # CullFaceMode - # GL_FRONT - # GL_BACK - # GL_FRONT_AND_BACK - # DataType - GL_BYTE* = 0x00001400 - GL_UNSIGNED_BYTE* = 0x00001401 - GL_SHORT* = 0x00001402 - GL_UNSIGNED_SHORT* = 0x00001403 - GL_INT* = 0x00001404 - GL_UNSIGNED_INT* = 0x00001405 - GL_FLOAT* = 0x00001406 - GL_2_BYTES* = 0x00001407 - GL_3_BYTES* = 0x00001408 - GL_4_BYTES* = 0x00001409 - GL_DOUBLE* = 0x0000140A # DepthFunction - # GL_NEVER - # GL_LESS - # GL_EQUAL - # GL_LEQUAL - # GL_GREATER - # GL_NOTEQUAL - # GL_GEQUAL - # GL_ALWAYS - # DrawBufferMode - GL_NONE* = 0 - GL_FRONT_LEFT* = 0x00000400 - GL_FRONT_RIGHT* = 0x00000401 - GL_BACK_LEFT* = 0x00000402 - GL_BACK_RIGHT* = 0x00000403 - GL_FRONT* = 0x00000404 - GL_BACK* = 0x00000405 - GL_LEFT* = 0x00000406 - GL_RIGHT* = 0x00000407 - GL_FRONT_AND_BACK* = 0x00000408 - GL_AUX0* = 0x00000409 - GL_AUX1* = 0x0000040A - GL_AUX2* = 0x0000040B - GL_AUX3* = 0x0000040C # Enable - # GL_FOG - # GL_LIGHTING - # GL_TEXTURE_1D - # GL_TEXTURE_2D - # GL_LINE_STIPPLE - # GL_POLYGON_STIPPLE - # GL_CULL_FACE - # GL_ALPHA_TEST - # GL_BLEND - # GL_INDEX_LOGIC_OP - # GL_COLOR_LOGIC_OP - # GL_DITHER - # GL_STENCIL_TEST - # GL_DEPTH_TEST - # GL_CLIP_PLANE0 - # GL_CLIP_PLANE1 - # GL_CLIP_PLANE2 - # GL_CLIP_PLANE3 - # GL_CLIP_PLANE4 - # GL_CLIP_PLANE5 - # GL_LIGHT0 - # GL_LIGHT1 - # GL_LIGHT2 - # GL_LIGHT3 - # GL_LIGHT4 - # GL_LIGHT5 - # GL_LIGHT6 - # GL_LIGHT7 - # GL_TEXTURE_GEN_S - # GL_TEXTURE_GEN_T - # GL_TEXTURE_GEN_R - # GL_TEXTURE_GEN_Q - # GL_MAP1_VERTEX_3 - # GL_MAP1_VERTEX_4 - # GL_MAP1_COLOR_4 - # GL_MAP1_INDEX - # GL_MAP1_NORMAL - # GL_MAP1_TEXTURE_COORD_1 - # GL_MAP1_TEXTURE_COORD_2 - # GL_MAP1_TEXTURE_COORD_3 - # GL_MAP1_TEXTURE_COORD_4 - # GL_MAP2_VERTEX_3 - # GL_MAP2_VERTEX_4 - # GL_MAP2_COLOR_4 - # GL_MAP2_INDEX - # GL_MAP2_NORMAL - # GL_MAP2_TEXTURE_COORD_1 - # GL_MAP2_TEXTURE_COORD_2 - # GL_MAP2_TEXTURE_COORD_3 - # GL_MAP2_TEXTURE_COORD_4 - # GL_POINT_SMOOTH - # GL_LINE_SMOOTH - # GL_POLYGON_SMOOTH - # GL_SCISSOR_TEST - # GL_COLOR_MATERIAL - # GL_NORMALIZE - # GL_AUTO_NORMAL - # GL_VERTEX_ARRAY - # GL_NORMAL_ARRAY - # GL_COLOR_ARRAY - # GL_INDEX_ARRAY - # GL_TEXTURE_COORD_ARRAY - # GL_EDGE_FLAG_ARRAY - # GL_POLYGON_OFFSET_POINT - # GL_POLYGON_OFFSET_LINE - # GL_POLYGON_OFFSET_FILL - # ErrorCode - GL_NO_ERROR* = 0 - GL_INVALID_ENUM* = 0x00000500 - GL_INVALID_VALUE* = 0x00000501 - GL_INVALID_OPERATION* = 0x00000502 - GL_STACK_OVERFLOW* = 0x00000503 - GL_STACK_UNDERFLOW* = 0x00000504 - GL_OUT_OF_MEMORY* = 0x00000505 # FeedBackMode - GL_2D* = 0x00000600 - GL_3D* = 0x00000601 - GL_3D_COLOR* = 0x00000602 - GL_3D_COLOR_TEXTURE* = 0x00000603 - GL_4D_COLOR_TEXTURE* = 0x00000604 # FeedBackToken - GL_PASS_THROUGH_TOKEN* = 0x00000700 - GL_POINT_TOKEN* = 0x00000701 - GL_LINE_TOKEN* = 0x00000702 - GL_POLYGON_TOKEN* = 0x00000703 - GL_BITMAP_TOKEN* = 0x00000704 - GL_DRAW_PIXEL_TOKEN* = 0x00000705 - GL_COPY_PIXEL_TOKEN* = 0x00000706 - GL_LINE_RESET_TOKEN* = 0x00000707 # FogMode - # GL_LINEAR - GL_EXP* = 0x00000800 - GL_EXP2* = 0x00000801 # FogParameter - # GL_FOG_COLOR - # GL_FOG_DENSITY - # GL_FOG_END - # GL_FOG_INDEX - # GL_FOG_MODE - # GL_FOG_START - # FrontFaceDirection - GL_CW* = 0x00000900 - GL_CCW* = 0x00000901 # GetMapTarget - GL_COEFF* = 0x00000A00 - GL_ORDER* = 0x00000A01 - GL_DOMAIN* = 0x00000A02 # GetPixelMap - # GL_PIXEL_MAP_I_TO_I - # GL_PIXEL_MAP_S_TO_S - # GL_PIXEL_MAP_I_TO_R - # GL_PIXEL_MAP_I_TO_G - # GL_PIXEL_MAP_I_TO_B - # GL_PIXEL_MAP_I_TO_A - # GL_PIXEL_MAP_R_TO_R - # GL_PIXEL_MAP_G_TO_G - # GL_PIXEL_MAP_B_TO_B - # GL_PIXEL_MAP_A_TO_A - # GetPointerTarget - # GL_VERTEX_ARRAY_POINTER - # GL_NORMAL_ARRAY_POINTER - # GL_COLOR_ARRAY_POINTER - # GL_INDEX_ARRAY_POINTER - # GL_TEXTURE_COORD_ARRAY_POINTER - # GL_EDGE_FLAG_ARRAY_POINTER - # GetTarget - GL_CURRENT_COLOR* = 0x00000B00 - GL_CURRENT_INDEX* = 0x00000B01 - GL_CURRENT_NORMAL* = 0x00000B02 - GL_CURRENT_TEXTURE_COORDS* = 0x00000B03 - GL_CURRENT_RASTER_COLOR* = 0x00000B04 - GL_CURRENT_RASTER_INDEX* = 0x00000B05 - GL_CURRENT_RASTER_TEXTURE_COORDS* = 0x00000B06 - GL_CURRENT_RASTER_POSITION* = 0x00000B07 - GL_CURRENT_RASTER_POSITION_VALID* = 0x00000B08 - GL_CURRENT_RASTER_DISTANCE* = 0x00000B09 - GL_POINT_SMOOTH* = 0x00000B10 - constGL_POINT_SIZE* = 0x00000B11 - GL_POINT_SIZE_RANGE* = 0x00000B12 - GL_POINT_SIZE_GRANULARITY* = 0x00000B13 - GL_LINE_SMOOTH* = 0x00000B20 - constGL_LINE_WIDTH* = 0x00000B21 - GL_LINE_WIDTH_RANGE* = 0x00000B22 - GL_LINE_WIDTH_GRANULARITY* = 0x00000B23 - constGL_LINE_STIPPLE* = 0x00000B24 - GL_LINE_STIPPLE_PATTERN* = 0x00000B25 - GL_LINE_STIPPLE_REPEAT* = 0x00000B26 - GL_LIST_MODE* = 0x00000B30 - GL_MAX_LIST_NESTING* = 0x00000B31 - constGL_LIST_BASE* = 0x00000B32 - GL_LIST_INDEX* = 0x00000B33 - constGL_POLYGON_MODE* = 0x00000B40 - GL_POLYGON_SMOOTH* = 0x00000B41 - constGL_POLYGON_STIPPLE* = 0x00000B42 - constGL_EDGE_FLAG* = 0x00000B43 - constGL_CULL_FACE* = 0x00000B44 - GL_CULL_FACE_MODE* = 0x00000B45 - constGL_FRONT_FACE* = 0x00000B46 - GL_LIGHTING* = 0x00000B50 - GL_LIGHT_MODEL_LOCAL_VIEWER* = 0x00000B51 - GL_LIGHT_MODEL_TWO_SIDE* = 0x00000B52 - GL_LIGHT_MODEL_AMBIENT* = 0x00000B53 - constGL_SHADE_MODEL* = 0x00000B54 - GL_COLOR_MATERIAL_FACE* = 0x00000B55 - GL_COLOR_MATERIAL_PARAMETER* = 0x00000B56 - constGL_COLOR_MATERIAL* = 0x00000B57 - GL_FOG* = 0x00000B60 - GL_FOG_INDEX* = 0x00000B61 - GL_FOG_DENSITY* = 0x00000B62 - GL_FOG_START* = 0x00000B63 - GL_FOG_END* = 0x00000B64 - GL_FOG_MODE* = 0x00000B65 - GL_FOG_COLOR* = 0x00000B66 - constGL_DEPTH_RANGE* = 0x00000B70 - GL_DEPTH_TEST* = 0x00000B71 - GL_DEPTH_WRITEMASK* = 0x00000B72 - GL_DEPTH_CLEAR_VALUE* = 0x00000B73 - constGL_DEPTH_FUNC* = 0x00000B74 - GL_ACCUM_CLEAR_VALUE* = 0x00000B80 - GL_STENCIL_TEST* = 0x00000B90 - GL_STENCIL_CLEAR_VALUE* = 0x00000B91 - constGL_STENCIL_FUNC* = 0x00000B92 - GL_STENCIL_VALUE_MASK* = 0x00000B93 - GL_STENCIL_FAIL* = 0x00000B94 - GL_STENCIL_PASS_DEPTH_FAIL* = 0x00000B95 - GL_STENCIL_PASS_DEPTH_PASS* = 0x00000B96 - GL_STENCIL_REF* = 0x00000B97 - GL_STENCIL_WRITEMASK* = 0x00000B98 - constGL_MATRIX_MODE* = 0x00000BA0 - GL_NORMALIZE* = 0x00000BA1 - constGL_VIEWPORT* = 0x00000BA2 - GL_MODELVIEW_STACK_DEPTH* = 0x00000BA3 - GL_PROJECTION_STACK_DEPTH* = 0x00000BA4 - GL_TEXTURE_STACK_DEPTH* = 0x00000BA5 - GL_MODELVIEW_MATRIX* = 0x00000BA6 - GL_PROJECTION_MATRIX* = 0x00000BA7 - GL_TEXTURE_MATRIX* = 0x00000BA8 - GL_ATTRIB_STACK_DEPTH* = 0x00000BB0 - GL_CLIENT_ATTRIB_STACK_DEPTH* = 0x00000BB1 - GL_ALPHA_TEST* = 0x00000BC0 - GL_ALPHA_TEST_FUNC* = 0x00000BC1 - GL_ALPHA_TEST_REF* = 0x00000BC2 - GL_DITHER* = 0x00000BD0 - GL_BLEND_DST* = 0x00000BE0 - GL_BLEND_SRC* = 0x00000BE1 - GL_BLEND* = 0x00000BE2 - GL_LOGIC_OP_MODE* = 0x00000BF0 - GL_INDEX_LOGIC_OP* = 0x00000BF1 - GL_COLOR_LOGIC_OP* = 0x00000BF2 - GL_AUX_BUFFERS* = 0x00000C00 - constGL_DRAW_BUFFER* = 0x00000C01 - constGL_READ_BUFFER* = 0x00000C02 - GL_SCISSOR_BOX* = 0x00000C10 - GL_SCISSOR_TEST* = 0x00000C11 - GL_INDEX_CLEAR_VALUE* = 0x00000C20 - GL_INDEX_WRITEMASK* = 0x00000C21 - GL_COLOR_CLEAR_VALUE* = 0x00000C22 - GL_COLOR_WRITEMASK* = 0x00000C23 - GL_INDEX_MODE* = 0x00000C30 - GL_RGBA_MODE* = 0x00000C31 - GL_DOUBLEBUFFER* = 0x00000C32 - GL_STEREO* = 0x00000C33 - constGL_RENDER_MODE* = 0x00000C40 - GL_PERSPECTIVE_CORRECTION_HINT* = 0x00000C50 - GL_POINT_SMOOTH_HINT* = 0x00000C51 - GL_LINE_SMOOTH_HINT* = 0x00000C52 - GL_POLYGON_SMOOTH_HINT* = 0x00000C53 - GL_FOG_HINT* = 0x00000C54 - GL_TEXTURE_GEN_S* = 0x00000C60 - GL_TEXTURE_GEN_T* = 0x00000C61 - GL_TEXTURE_GEN_R* = 0x00000C62 - GL_TEXTURE_GEN_Q* = 0x00000C63 - GL_PIXEL_MAP_I_TO_I* = 0x00000C70 - GL_PIXEL_MAP_S_TO_S* = 0x00000C71 - GL_PIXEL_MAP_I_TO_R* = 0x00000C72 - GL_PIXEL_MAP_I_TO_G* = 0x00000C73 - GL_PIXEL_MAP_I_TO_B* = 0x00000C74 - GL_PIXEL_MAP_I_TO_A* = 0x00000C75 - GL_PIXEL_MAP_R_TO_R* = 0x00000C76 - GL_PIXEL_MAP_G_TO_G* = 0x00000C77 - GL_PIXEL_MAP_B_TO_B* = 0x00000C78 - GL_PIXEL_MAP_A_TO_A* = 0x00000C79 - GL_PIXEL_MAP_I_TO_I_SIZE* = 0x00000CB0 - GL_PIXEL_MAP_S_TO_S_SIZE* = 0x00000CB1 - GL_PIXEL_MAP_I_TO_R_SIZE* = 0x00000CB2 - GL_PIXEL_MAP_I_TO_G_SIZE* = 0x00000CB3 - GL_PIXEL_MAP_I_TO_B_SIZE* = 0x00000CB4 - GL_PIXEL_MAP_I_TO_A_SIZE* = 0x00000CB5 - GL_PIXEL_MAP_R_TO_R_SIZE* = 0x00000CB6 - GL_PIXEL_MAP_G_TO_G_SIZE* = 0x00000CB7 - GL_PIXEL_MAP_B_TO_B_SIZE* = 0x00000CB8 - GL_PIXEL_MAP_A_TO_A_SIZE* = 0x00000CB9 - GL_UNPACK_SWAP_BYTES* = 0x00000CF0 - GL_UNPACK_LSB_FIRST* = 0x00000CF1 - GL_UNPACK_ROW_LENGTH* = 0x00000CF2 - GL_UNPACK_SKIP_ROWS* = 0x00000CF3 - GL_UNPACK_SKIP_PIXELS* = 0x00000CF4 - GL_UNPACK_ALIGNMENT* = 0x00000CF5 - GL_PACK_SWAP_BYTES* = 0x00000D00 - GL_PACK_LSB_FIRST* = 0x00000D01 - GL_PACK_ROW_LENGTH* = 0x00000D02 - GL_PACK_SKIP_ROWS* = 0x00000D03 - GL_PACK_SKIP_PIXELS* = 0x00000D04 - GL_PACK_ALIGNMENT* = 0x00000D05 - GL_MAP_COLOR* = 0x00000D10 - GL_MAP_STENCIL* = 0x00000D11 - GL_INDEX_SHIFT* = 0x00000D12 - GL_INDEX_OFFSET* = 0x00000D13 - GL_RED_SCALE* = 0x00000D14 - GL_RED_BIAS* = 0x00000D15 - GL_ZOOM_X* = 0x00000D16 - GL_ZOOM_Y* = 0x00000D17 - GL_GREEN_SCALE* = 0x00000D18 - GL_GREEN_BIAS* = 0x00000D19 - GL_BLUE_SCALE* = 0x00000D1A - GL_BLUE_BIAS* = 0x00000D1B - GL_ALPHA_SCALE* = 0x00000D1C - GL_ALPHA_BIAS* = 0x00000D1D - GL_DEPTH_SCALE* = 0x00000D1E - GL_DEPTH_BIAS* = 0x00000D1F - GL_MAX_EVAL_ORDER* = 0x00000D30 - GL_MAX_LIGHTS* = 0x00000D31 - GL_MAX_CLIP_PLANES* = 0x00000D32 - GL_MAX_TEXTURE_SIZE* = 0x00000D33 - GL_MAX_PIXEL_MAP_TABLE* = 0x00000D34 - GL_MAX_ATTRIB_STACK_DEPTH* = 0x00000D35 - GL_MAX_MODELVIEW_STACK_DEPTH* = 0x00000D36 - GL_MAX_NAME_STACK_DEPTH* = 0x00000D37 - GL_MAX_PROJECTION_STACK_DEPTH* = 0x00000D38 - GL_MAX_TEXTURE_STACK_DEPTH* = 0x00000D39 - GL_MAX_VIEWPORT_DIMS* = 0x00000D3A - GL_MAX_CLIENT_ATTRIB_STACK_DEPTH* = 0x00000D3B - GL_SUBPIXEL_BITS* = 0x00000D50 - GL_INDEX_BITS* = 0x00000D51 - GL_RED_BITS* = 0x00000D52 - GL_GREEN_BITS* = 0x00000D53 - GL_BLUE_BITS* = 0x00000D54 - GL_ALPHA_BITS* = 0x00000D55 - GL_DEPTH_BITS* = 0x00000D56 - GL_STENCIL_BITS* = 0x00000D57 - GL_ACCUM_RED_BITS* = 0x00000D58 - GL_ACCUM_GREEN_BITS* = 0x00000D59 - GL_ACCUM_BLUE_BITS* = 0x00000D5A - GL_ACCUM_ALPHA_BITS* = 0x00000D5B - GL_NAME_STACK_DEPTH* = 0x00000D70 - GL_AUTO_NORMAL* = 0x00000D80 - GL_MAP1_COLOR_4* = 0x00000D90 - GL_MAP1_INDEX* = 0x00000D91 - GL_MAP1_NORMAL* = 0x00000D92 - GL_MAP1_TEXTURE_COORD_1* = 0x00000D93 - GL_MAP1_TEXTURE_COORD_2* = 0x00000D94 - GL_MAP1_TEXTURE_COORD_3* = 0x00000D95 - GL_MAP1_TEXTURE_COORD_4* = 0x00000D96 - GL_MAP1_VERTEX_3* = 0x00000D97 - GL_MAP1_VERTEX_4* = 0x00000D98 - GL_MAP2_COLOR_4* = 0x00000DB0 - GL_MAP2_INDEX* = 0x00000DB1 - GL_MAP2_NORMAL* = 0x00000DB2 - GL_MAP2_TEXTURE_COORD_1* = 0x00000DB3 - GL_MAP2_TEXTURE_COORD_2* = 0x00000DB4 - GL_MAP2_TEXTURE_COORD_3* = 0x00000DB5 - GL_MAP2_TEXTURE_COORD_4* = 0x00000DB6 - GL_MAP2_VERTEX_3* = 0x00000DB7 - GL_MAP2_VERTEX_4* = 0x00000DB8 - GL_MAP1_GRID_DOMAIN* = 0x00000DD0 - GL_MAP1_GRID_SEGMENTS* = 0x00000DD1 - GL_MAP2_GRID_DOMAIN* = 0x00000DD2 - GL_MAP2_GRID_SEGMENTS* = 0x00000DD3 - GL_TEXTURE_1D* = 0x00000DE0 - GL_TEXTURE_2D* = 0x00000DE1 - GL_FEEDBACK_BUFFER_POINTER* = 0x00000DF0 - GL_FEEDBACK_BUFFER_SIZE* = 0x00000DF1 - GL_FEEDBACK_BUFFER_TYPE* = 0x00000DF2 - GL_SELECTION_BUFFER_POINTER* = 0x00000DF3 - GL_SELECTION_BUFFER_SIZE* = 0x00000DF4 # GL_TEXTURE_BINDING_1D - # GL_TEXTURE_BINDING_2D - # GL_VERTEX_ARRAY - # GL_NORMAL_ARRAY - # GL_COLOR_ARRAY - # GL_INDEX_ARRAY - # GL_TEXTURE_COORD_ARRAY - # GL_EDGE_FLAG_ARRAY - # GL_VERTEX_ARRAY_SIZE - # GL_VERTEX_ARRAY_TYPE - # GL_VERTEX_ARRAY_STRIDE - # GL_NORMAL_ARRAY_TYPE - # GL_NORMAL_ARRAY_STRIDE - # GL_COLOR_ARRAY_SIZE - # GL_COLOR_ARRAY_TYPE - # GL_COLOR_ARRAY_STRIDE - # GL_INDEX_ARRAY_TYPE - # GL_INDEX_ARRAY_STRIDE - # GL_TEXTURE_COORD_ARRAY_SIZE - # GL_TEXTURE_COORD_ARRAY_TYPE - # GL_TEXTURE_COORD_ARRAY_STRIDE - # GL_EDGE_FLAG_ARRAY_STRIDE - # GL_POLYGON_OFFSET_FACTOR - # GL_POLYGON_OFFSET_UNITS - # GetTextureParameter - # GL_TEXTURE_MAG_FILTER - # GL_TEXTURE_MIN_FILTER - # GL_TEXTURE_WRAP_S - # GL_TEXTURE_WRAP_T - GL_TEXTURE_WIDTH* = 0x00001000 - GL_TEXTURE_HEIGHT* = 0x00001001 - GL_TEXTURE_INTERNAL_FORMAT* = 0x00001003 - GL_TEXTURE_BORDER_COLOR* = 0x00001004 - GL_TEXTURE_BORDER* = 0x00001005 # GL_TEXTURE_RED_SIZE - # GL_TEXTURE_GREEN_SIZE - # GL_TEXTURE_BLUE_SIZE - # GL_TEXTURE_ALPHA_SIZE - # GL_TEXTURE_LUMINANCE_SIZE - # GL_TEXTURE_INTENSITY_SIZE - # GL_TEXTURE_PRIORITY - # GL_TEXTURE_RESIDENT - # HintMode - GL_DONT_CARE* = 0x00001100 - GL_FASTEST* = 0x00001101 - GL_NICEST* = 0x00001102 # HintTarget - # GL_PERSPECTIVE_CORRECTION_HINT - # GL_POINT_SMOOTH_HINT - # GL_LINE_SMOOTH_HINT - # GL_POLYGON_SMOOTH_HINT - # GL_FOG_HINT - # IndexPointerType - # GL_SHORT - # GL_INT - # GL_FLOAT - # GL_DOUBLE - # LightModelParameter - # GL_LIGHT_MODEL_AMBIENT - # GL_LIGHT_MODEL_LOCAL_VIEWER - # GL_LIGHT_MODEL_TWO_SIDE - # LightName - GL_LIGHT0* = 0x00004000 - GL_LIGHT1* = 0x00004001 - GL_LIGHT2* = 0x00004002 - GL_LIGHT3* = 0x00004003 - GL_LIGHT4* = 0x00004004 - GL_LIGHT5* = 0x00004005 - GL_LIGHT6* = 0x00004006 - GL_LIGHT7* = 0x00004007 # LightParameter - GL_AMBIENT* = 0x00001200 - GL_DIFFUSE* = 0x00001201 - GL_SPECULAR* = 0x00001202 - GL_POSITION* = 0x00001203 - GL_SPOT_DIRECTION* = 0x00001204 - GL_SPOT_EXPONENT* = 0x00001205 - GL_SPOT_CUTOFF* = 0x00001206 - GL_CONSTANT_ATTENUATION* = 0x00001207 - GL_LINEAR_ATTENUATION* = 0x00001208 - GL_QUADRATIC_ATTENUATION* = 0x00001209 # InterleavedArrays - # GL_V2F - # GL_V3F - # GL_C4UB_V2F - # GL_C4UB_V3F - # GL_C3F_V3F - # GL_N3F_V3F - # GL_C4F_N3F_V3F - # GL_T2F_V3F - # GL_T4F_V4F - # GL_T2F_C4UB_V3F - # GL_T2F_C3F_V3F - # GL_T2F_N3F_V3F - # GL_T2F_C4F_N3F_V3F - # GL_T4F_C4F_N3F_V4F - # ListMode - GL_COMPILE* = 0x00001300 - GL_COMPILE_AND_EXECUTE* = 0x00001301 # ListNameType - # GL_BYTE - # GL_UNSIGNED_BYTE - # GL_SHORT - # GL_UNSIGNED_SHORT - # GL_INT - # GL_UNSIGNED_INT - # GL_FLOAT - # GL_2_BYTES - # GL_3_BYTES - # GL_4_BYTES - # LogicOp - constGL_CLEAR* = 0x00001500 - GL_AND* = 0x00001501 - GL_AND_REVERSE* = 0x00001502 - GL_COPY* = 0x00001503 - GL_AND_INVERTED* = 0x00001504 - GL_NOOP* = 0x00001505 - GL_XOR* = 0x00001506 - GL_OR* = 0x00001507 - GL_NOR* = 0x00001508 - GL_EQUIV* = 0x00001509 - GL_INVERT* = 0x0000150A - GL_OR_REVERSE* = 0x0000150B - GL_COPY_INVERTED* = 0x0000150C - GL_OR_INVERTED* = 0x0000150D - GL_NAND* = 0x0000150E - GL_SET* = 0x0000150F # MapTarget - # GL_MAP1_COLOR_4 - # GL_MAP1_INDEX - # GL_MAP1_NORMAL - # GL_MAP1_TEXTURE_COORD_1 - # GL_MAP1_TEXTURE_COORD_2 - # GL_MAP1_TEXTURE_COORD_3 - # GL_MAP1_TEXTURE_COORD_4 - # GL_MAP1_VERTEX_3 - # GL_MAP1_VERTEX_4 - # GL_MAP2_COLOR_4 - # GL_MAP2_INDEX - # GL_MAP2_NORMAL - # GL_MAP2_TEXTURE_COORD_1 - # GL_MAP2_TEXTURE_COORD_2 - # GL_MAP2_TEXTURE_COORD_3 - # GL_MAP2_TEXTURE_COORD_4 - # GL_MAP2_VERTEX_3 - # GL_MAP2_VERTEX_4 - # MaterialFace - # GL_FRONT - # GL_BACK - # GL_FRONT_AND_BACK - # MaterialParameter - GL_EMISSION* = 0x00001600 - GL_SHININESS* = 0x00001601 - GL_AMBIENT_AND_DIFFUSE* = 0x00001602 - GL_COLOR_INDEXES* = 0x00001603 # GL_AMBIENT - # GL_DIFFUSE - # GL_SPECULAR - # MatrixMode - GL_MODELVIEW* = 0x00001700 - GL_PROJECTION* = 0x00001701 - GL_TEXTURE* = 0x00001702 # MeshMode1 - # GL_POINT - # GL_LINE - # MeshMode2 - # GL_POINT - # GL_LINE - # GL_FILL - # NormalPointerType - # GL_BYTE - # GL_SHORT - # GL_INT - # GL_FLOAT - # GL_DOUBLE - # PixelCopyType - GL_COLOR* = 0x00001800 - GL_DEPTH* = 0x00001801 - GL_STENCIL* = 0x00001802 # PixelFormat - GL_COLOR_INDEX* = 0x00001900 - GL_STENCIL_INDEX* = 0x00001901 - GL_DEPTH_COMPONENT* = 0x00001902 - GL_RED* = 0x00001903 - GL_GREEN* = 0x00001904 - GL_BLUE* = 0x00001905 - GL_ALPHA* = 0x00001906 - GL_RGB* = 0x00001907 - GL_RGBA* = 0x00001908 - GL_LUMINANCE* = 0x00001909 - GL_LUMINANCE_ALPHA* = 0x0000190A # PixelMap - # GL_PIXEL_MAP_I_TO_I - # GL_PIXEL_MAP_S_TO_S - # GL_PIXEL_MAP_I_TO_R - # GL_PIXEL_MAP_I_TO_G - # GL_PIXEL_MAP_I_TO_B - # GL_PIXEL_MAP_I_TO_A - # GL_PIXEL_MAP_R_TO_R - # GL_PIXEL_MAP_G_TO_G - # GL_PIXEL_MAP_B_TO_B - # GL_PIXEL_MAP_A_TO_A - # PixelStore - # GL_UNPACK_SWAP_BYTES - # GL_UNPACK_LSB_FIRST - # GL_UNPACK_ROW_LENGTH - # GL_UNPACK_SKIP_ROWS - # GL_UNPACK_SKIP_PIXELS - # GL_UNPACK_ALIGNMENT - # GL_PACK_SWAP_BYTES - # GL_PACK_LSB_FIRST - # GL_PACK_ROW_LENGTH - # GL_PACK_SKIP_ROWS - # GL_PACK_SKIP_PIXELS - # GL_PACK_ALIGNMENT - # PixelTransfer - # GL_MAP_COLOR - # GL_MAP_STENCIL - # GL_INDEX_SHIFT - # GL_INDEX_OFFSET - # GL_RED_SCALE - # GL_RED_BIAS - # GL_GREEN_SCALE - # GL_GREEN_BIAS - # GL_BLUE_SCALE - # GL_BLUE_BIAS - # GL_ALPHA_SCALE - # GL_ALPHA_BIAS - # GL_DEPTH_SCALE - # GL_DEPTH_BIAS - # PixelType - constGL_BITMAP* = 0x00001A00 - GL_POINT* = 0x00001B00 - GL_LINE* = 0x00001B01 - GL_FILL* = 0x00001B02 # ReadBufferMode - # GL_FRONT_LEFT - # GL_FRONT_RIGHT - # GL_BACK_LEFT - # GL_BACK_RIGHT - # GL_FRONT - # GL_BACK - # GL_LEFT - # GL_RIGHT - # GL_AUX0 - # GL_AUX1 - # GL_AUX2 - # GL_AUX3 - # RenderingMode - GL_RENDER* = 0x00001C00 - GL_FEEDBACK* = 0x00001C01 - GL_SELECT* = 0x00001C02 # ShadingModel - GL_FLAT* = 0x00001D00 - GL_SMOOTH* = 0x00001D01 # StencilFunction - # GL_NEVER - # GL_LESS - # GL_EQUAL - # GL_LEQUAL - # GL_GREATER - # GL_NOTEQUAL - # GL_GEQUAL - # GL_ALWAYS - # StencilOp - # GL_ZERO - GL_KEEP* = 0x00001E00 - GL_REPLACE* = 0x00001E01 - GL_INCR* = 0x00001E02 - GL_DECR* = 0x00001E03 # GL_INVERT - # StringName - GL_VENDOR* = 0x00001F00 - GL_RENDERER* = 0x00001F01 - GL_VERSION* = 0x00001F02 - GL_EXTENSIONS* = 0x00001F03 # TextureCoordName - GL_S* = 0x00002000 - GL_T* = 0x00002001 - GL_R* = 0x00002002 - GL_Q* = 0x00002003 # TexCoordPointerType - # GL_SHORT - # GL_INT - # GL_FLOAT - # GL_DOUBLE - # TextureEnvMode - GL_MODULATE* = 0x00002100 - GL_DECAL* = 0x00002101 # GL_BLEND - # GL_REPLACE - # TextureEnvParameter - GL_TEXTURE_ENV_MODE* = 0x00002200 - GL_TEXTURE_ENV_COLOR* = 0x00002201 # TextureEnvTarget - GL_TEXTURE_ENV* = 0x00002300 # TextureGenMode - GL_EYE_LINEAR* = 0x00002400 - GL_OBJECT_LINEAR* = 0x00002401 - GL_SPHERE_MAP* = 0x00002402 # TextureGenParameter - GL_TEXTURE_GEN_MODE* = 0x00002500 - GL_OBJECT_PLANE* = 0x00002501 - GL_EYE_PLANE* = 0x00002502 # TextureMagFilter - GL_NEAREST* = 0x00002600 - GL_LINEAR* = 0x00002601 # TextureMinFilter - # GL_NEAREST - # GL_LINEAR - GL_NEAREST_MIPMAP_NEAREST* = 0x00002700 - GL_LINEAR_MIPMAP_NEAREST* = 0x00002701 - GL_NEAREST_MIPMAP_LINEAR* = 0x00002702 - GL_LINEAR_MIPMAP_LINEAR* = 0x00002703 # TextureParameterName - GL_TEXTURE_MAG_FILTER* = 0x00002800 - GL_TEXTURE_MIN_FILTER* = 0x00002801 - GL_TEXTURE_WRAP_S* = 0x00002802 - GL_TEXTURE_WRAP_T* = 0x00002803 # GL_TEXTURE_BORDER_COLOR - # GL_TEXTURE_PRIORITY - # TextureTarget - # GL_TEXTURE_1D - # GL_TEXTURE_2D - # GL_PROXY_TEXTURE_1D - # GL_PROXY_TEXTURE_2D - # TextureWrapMode - GL_CLAMP* = 0x00002900 - GL_REPEAT* = 0x00002901 # VertexPointerType - # GL_SHORT - # GL_INT - # GL_FLOAT - # GL_DOUBLE - # ClientAttribMask - GL_CLIENT_PIXEL_STORE_BIT* = 0x00000001 - GL_CLIENT_VERTEX_ARRAY_BIT* = 0x00000002 - GL_CLIENT_ALL_ATTRIB_BITS* = 0xFFFFFFFF # polygon_offset - GL_POLYGON_OFFSET_FACTOR* = 0x00008038 - GL_POLYGON_OFFSET_UNITS* = 0x00002A00 - GL_POLYGON_OFFSET_POINT* = 0x00002A01 - GL_POLYGON_OFFSET_LINE* = 0x00002A02 - GL_POLYGON_OFFSET_FILL* = 0x00008037 # texture - GL_ALPHA4* = 0x0000803B - GL_ALPHA8* = 0x0000803C - GL_ALPHA12* = 0x0000803D - GL_ALPHA16* = 0x0000803E - GL_LUMINANCE4* = 0x0000803F - GL_LUMINANCE8* = 0x00008040 - GL_LUMINANCE12* = 0x00008041 - GL_LUMINANCE16* = 0x00008042 - GL_LUMINANCE4_ALPHA4* = 0x00008043 - GL_LUMINANCE6_ALPHA2* = 0x00008044 - GL_LUMINANCE8_ALPHA8* = 0x00008045 - GL_LUMINANCE12_ALPHA4* = 0x00008046 - GL_LUMINANCE12_ALPHA12* = 0x00008047 - GL_LUMINANCE16_ALPHA16* = 0x00008048 - GL_INTENSITY* = 0x00008049 - GL_INTENSITY4* = 0x0000804A - GL_INTENSITY8* = 0x0000804B - GL_INTENSITY12* = 0x0000804C - GL_INTENSITY16* = 0x0000804D - GL_R3_G3_B2* = 0x00002A10 - GL_RGB4* = 0x0000804F - GL_RGB5* = 0x00008050 - GL_RGB8* = 0x00008051 - GL_RGB10* = 0x00008052 - GL_RGB12* = 0x00008053 - GL_RGB16* = 0x00008054 - GL_RGBA2* = 0x00008055 - GL_RGBA4* = 0x00008056 - GL_RGB5_A1* = 0x00008057 - GL_RGBA8* = 0x00008058 - GL_RGB10_A2* = 0x00008059 - GL_RGBA12* = 0x0000805A - GL_RGBA16* = 0x0000805B - GL_TEXTURE_RED_SIZE* = 0x0000805C - GL_TEXTURE_GREEN_SIZE* = 0x0000805D - GL_TEXTURE_BLUE_SIZE* = 0x0000805E - GL_TEXTURE_ALPHA_SIZE* = 0x0000805F - GL_TEXTURE_LUMINANCE_SIZE* = 0x00008060 - GL_TEXTURE_INTENSITY_SIZE* = 0x00008061 - GL_PROXY_TEXTURE_1D* = 0x00008063 - GL_PROXY_TEXTURE_2D* = 0x00008064 # texture_object - GL_TEXTURE_PRIORITY* = 0x00008066 - GL_TEXTURE_RESIDENT* = 0x00008067 - GL_TEXTURE_BINDING_1D* = 0x00008068 - GL_TEXTURE_BINDING_2D* = 0x00008069 # vertex_array - GL_VERTEX_ARRAY* = 0x00008074 - GL_NORMAL_ARRAY* = 0x00008075 - GL_COLOR_ARRAY* = 0x00008076 - GL_INDEX_ARRAY* = 0x00008077 - GL_TEXTURE_COORD_ARRAY* = 0x00008078 - GL_EDGE_FLAG_ARRAY* = 0x00008079 - GL_VERTEX_ARRAY_SIZE* = 0x0000807A - GL_VERTEX_ARRAY_TYPE* = 0x0000807B - GL_VERTEX_ARRAY_STRIDE* = 0x0000807C - GL_NORMAL_ARRAY_TYPE* = 0x0000807E - GL_NORMAL_ARRAY_STRIDE* = 0x0000807F - GL_COLOR_ARRAY_SIZE* = 0x00008081 - GL_COLOR_ARRAY_TYPE* = 0x00008082 - GL_COLOR_ARRAY_STRIDE* = 0x00008083 - GL_INDEX_ARRAY_TYPE* = 0x00008085 - GL_INDEX_ARRAY_STRIDE* = 0x00008086 - GL_TEXTURE_COORD_ARRAY_SIZE* = 0x00008088 - GL_TEXTURE_COORD_ARRAY_TYPE* = 0x00008089 - GL_TEXTURE_COORD_ARRAY_STRIDE* = 0x0000808A - GL_EDGE_FLAG_ARRAY_STRIDE* = 0x0000808C - GL_VERTEX_ARRAY_POINTER* = 0x0000808E - GL_NORMAL_ARRAY_POINTER* = 0x0000808F - GL_COLOR_ARRAY_POINTER* = 0x00008090 - GL_INDEX_ARRAY_POINTER* = 0x00008091 - GL_TEXTURE_COORD_ARRAY_POINTER* = 0x00008092 - GL_EDGE_FLAG_ARRAY_POINTER* = 0x00008093 - GL_V2F* = 0x00002A20 - GL_V3F* = 0x00002A21 - GL_C4UB_V2F* = 0x00002A22 - GL_C4UB_V3F* = 0x00002A23 - GL_C3F_V3F* = 0x00002A24 - GL_N3F_V3F* = 0x00002A25 - GL_C4F_N3F_V3F* = 0x00002A26 - GL_T2F_V3F* = 0x00002A27 - GL_T4F_V4F* = 0x00002A28 - GL_T2F_C4UB_V3F* = 0x00002A29 - GL_T2F_C3F_V3F* = 0x00002A2A - GL_T2F_N3F_V3F* = 0x00002A2B - GL_T2F_C4F_N3F_V3F* = 0x00002A2C - GL_T4F_C4F_N3F_V4F* = 0x00002A2D # Extensions - GL_EXT_vertex_array* = 1 - GL_WIN_swap_hint* = 1 - GL_EXT_bgra* = 1 - GL_EXT_paletted_texture* = 1 # EXT_vertex_array - GL_VERTEX_ARRAY_EXT* = 0x00008074 - GL_NORMAL_ARRAY_EXT* = 0x00008075 - GL_COLOR_ARRAY_EXT* = 0x00008076 - GL_INDEX_ARRAY_EXT* = 0x00008077 - GL_TEXTURE_COORD_ARRAY_EXT* = 0x00008078 - GL_EDGE_FLAG_ARRAY_EXT* = 0x00008079 - GL_VERTEX_ARRAY_SIZE_EXT* = 0x0000807A - GL_VERTEX_ARRAY_TYPE_EXT* = 0x0000807B - GL_VERTEX_ARRAY_STRIDE_EXT* = 0x0000807C - GL_VERTEX_ARRAY_COUNT_EXT* = 0x0000807D - GL_NORMAL_ARRAY_TYPE_EXT* = 0x0000807E - GL_NORMAL_ARRAY_STRIDE_EXT* = 0x0000807F - GL_NORMAL_ARRAY_COUNT_EXT* = 0x00008080 - GL_COLOR_ARRAY_SIZE_EXT* = 0x00008081 - GL_COLOR_ARRAY_TYPE_EXT* = 0x00008082 - GL_COLOR_ARRAY_STRIDE_EXT* = 0x00008083 - GL_COLOR_ARRAY_COUNT_EXT* = 0x00008084 - GL_INDEX_ARRAY_TYPE_EXT* = 0x00008085 - GL_INDEX_ARRAY_STRIDE_EXT* = 0x00008086 - GL_INDEX_ARRAY_COUNT_EXT* = 0x00008087 - GL_TEXTURE_COORD_ARRAY_SIZE_EXT* = 0x00008088 - GL_TEXTURE_COORD_ARRAY_TYPE_EXT* = 0x00008089 - GL_TEXTURE_COORD_ARRAY_STRIDE_EXT* = 0x0000808A - GL_TEXTURE_COORD_ARRAY_COUNT_EXT* = 0x0000808B - GL_EDGE_FLAG_ARRAY_STRIDE_EXT* = 0x0000808C - GL_EDGE_FLAG_ARRAY_COUNT_EXT* = 0x0000808D - GL_VERTEX_ARRAY_POINTER_EXT* = 0x0000808E - GL_NORMAL_ARRAY_POINTER_EXT* = 0x0000808F - GL_COLOR_ARRAY_POINTER_EXT* = 0x00008090 - GL_INDEX_ARRAY_POINTER_EXT* = 0x00008091 - GL_TEXTURE_COORD_ARRAY_POINTER_EXT* = 0x00008092 - GL_EDGE_FLAG_ARRAY_POINTER_EXT* = 0x00008093 - GL_DOUBLE_EXT* = GL_DOUBLE # EXT_bgra - GL_BGR_EXT* = 0x000080E0 - GL_BGRA_EXT* = 0x000080E1 # EXT_paletted_texture - # These must match the GL_COLOR_TABLE_*_SGI enumerants - GL_COLOR_TABLE_FORMAT_EXT* = 0x000080D8 - GL_COLOR_TABLE_WIDTH_EXT* = 0x000080D9 - GL_COLOR_TABLE_RED_SIZE_EXT* = 0x000080DA - GL_COLOR_TABLE_GREEN_SIZE_EXT* = 0x000080DB - GL_COLOR_TABLE_BLUE_SIZE_EXT* = 0x000080DC - GL_COLOR_TABLE_ALPHA_SIZE_EXT* = 0x000080DD - GL_COLOR_TABLE_LUMINANCE_SIZE_EXT* = 0x000080DE - GL_COLOR_TABLE_INTENSITY_SIZE_EXT* = 0x000080DF - GL_COLOR_INDEX1_EXT* = 0x000080E2 - GL_COLOR_INDEX2_EXT* = 0x000080E3 - GL_COLOR_INDEX4_EXT* = 0x000080E4 - GL_COLOR_INDEX8_EXT* = 0x000080E5 - GL_COLOR_INDEX12_EXT* = 0x000080E6 - GL_COLOR_INDEX16_EXT* = 0x000080E7 # For compatibility with OpenGL v1.0 - constGL_LOGIC_OP* = GL_INDEX_LOGIC_OP - GL_TEXTURE_COMPONENTS* = GL_TEXTURE_INTERNAL_FORMAT - -proc glAccum*(op: TGLenum, value: TGLfloat){.dynlib: dllname, importc: "glAccum".} -proc glAlphaFunc*(func: TGLenum, theref: TGLclampf){.dynlib: dllname, - importc: "glAlphaFunc".} -proc glAreTexturesResident*(n: TGLsizei, textures: PGLuint, - residences: PGLboolean): TGLboolean{. - dynlib: dllname, importc: "glAreTexturesResident".} -proc glArrayElement*(i: TGLint){.dynlib: dllname, importc: "glArrayElement".} -proc glBegin*(mode: TGLenum){.dynlib: dllname, importc: "glBegin".} -proc glBindTexture*(target: TGLenum, texture: TGLuint){.dynlib: dllname, - importc: "glBindTexture".} -proc glBitmap*(width, height: TGLsizei, xorig, yorig: TGLfloat, - xmove, ymove: TGLfloat, bitmap: PGLubyte){.dynlib: dllname, - importc: "glBitmap".} -proc glBlendFunc*(sfactor, dfactor: TGLenum){.dynlib: dllname, - importc: "glBlendFunc".} -proc glCallList*(list: TGLuint){.dynlib: dllname, importc: "glCallList".} -proc glCallLists*(n: TGLsizei, atype: TGLenum, lists: Pointer){.dynlib: dllname, - importc: "glCallLists".} -proc glClear*(mask: TGLbitfield){.dynlib: dllname, importc: "glClear".} -proc glClearAccum*(red, green, blue, alpha: TGLfloat){.dynlib: dllname, - importc: "glClearAccum".} -proc glClearColor*(red, green, blue, alpha: TGLclampf){.dynlib: dllname, - importc: "glClearColor".} -proc glClearDepth*(depth: TGLclampd){.dynlib: dllname, importc: "glClearDepth".} -proc glClearIndex*(c: TGLfloat){.dynlib: dllname, importc: "glClearIndex".} -proc glClearStencil*(s: TGLint){.dynlib: dllname, importc: "glClearStencil".} -proc glClipPlane*(plane: TGLenum, equation: PGLdouble){.dynlib: dllname, - importc: "glClipPlane".} -proc glColor3b*(red, green, blue: TGlbyte){.dynlib: dllname, - importc: "glColor3b".} -proc glColor3bv*(v: PGLbyte){.dynlib: dllname, importc: "glColor3bv".} -proc glColor3d*(red, green, blue: TGLdouble){.dynlib: dllname, - importc: "glColor3d".} -proc glColor3dv*(v: PGLdouble){.dynlib: dllname, importc: "glColor3dv".} -proc glColor3f*(red, green, blue: TGLfloat){.dynlib: dllname, - importc: "glColor3f".} -proc glColor3fv*(v: PGLfloat){.dynlib: dllname, importc: "glColor3fv".} -proc glColor3i*(red, green, blue: TGLint){.dynlib: dllname, importc: "glColor3i".} -proc glColor3iv*(v: PGLint){.dynlib: dllname, importc: "glColor3iv".} -proc glColor3s*(red, green, blue: TGLshort){.dynlib: dllname, - importc: "glColor3s".} -proc glColor3sv*(v: PGLshort){.dynlib: dllname, importc: "glColor3sv".} -proc glColor3ub*(red, green, blue: TGLubyte){.dynlib: dllname, - importc: "glColor3ub".} -proc glColor3ubv*(v: PGLubyte){.dynlib: dllname, importc: "glColor3ubv".} -proc glColor3ui*(red, green, blue: TGLuint){.dynlib: dllname, - importc: "glColor3ui".} -proc glColor3uiv*(v: PGLuint){.dynlib: dllname, importc: "glColor3uiv".} -proc glColor3us*(red, green, blue: TGLushort){.dynlib: dllname, - importc: "glColor3us".} -proc glColor3usv*(v: PGLushort){.dynlib: dllname, importc: "glColor3usv".} -proc glColor4b*(red, green, blue, alpha: TGlbyte){.dynlib: dllname, - importc: "glColor4b".} -proc glColor4bv*(v: PGLbyte){.dynlib: dllname, importc: "glColor4bv".} -proc glColor4d*(red, green, blue, alpha: TGLdouble){.dynlib: dllname, - importc: "glColor4d".} -proc glColor4dv*(v: PGLdouble){.dynlib: dllname, importc: "glColor4dv".} -proc glColor4f*(red, green, blue, alpha: TGLfloat){.dynlib: dllname, - importc: "glColor4f".} -proc glColor4fv*(v: PGLfloat){.dynlib: dllname, importc: "glColor4fv".} -proc glColor4i*(red, green, blue, alpha: TGLint){.dynlib: dllname, - importc: "glColor4i".} -proc glColor4iv*(v: PGLint){.dynlib: dllname, importc: "glColor4iv".} -proc glColor4s*(red, green, blue, alpha: TGLshort){.dynlib: dllname, - importc: "glColor4s".} -proc glColor4sv*(v: PGLshort){.dynlib: dllname, importc: "glColor4sv".} -proc glColor4ub*(red, green, blue, alpha: TGLubyte){.dynlib: dllname, - importc: "glColor4ub".} -proc glColor4ubv*(v: PGLubyte){.dynlib: dllname, importc: "glColor4ubv".} -proc glColor4ui*(red, green, blue, alpha: TGLuint){.dynlib: dllname, - importc: "glColor4ui".} -proc glColor4uiv*(v: PGLuint){.dynlib: dllname, importc: "glColor4uiv".} -proc glColor4us*(red, green, blue, alpha: TGLushort){.dynlib: dllname, - importc: "glColor4us".} -proc glColor4usv*(v: PGLushort){.dynlib: dllname, importc: "glColor4usv".} -proc glColorMask*(red, green, blue, alpha: TGLboolean){.dynlib: dllname, - importc: "glColorMask".} -proc glColorMaterial*(face, mode: TGLenum){.dynlib: dllname, - importc: "glColorMaterial".} -proc glColorPointer*(size: TGLint, atype: TGLenum, stride: TGLsizei, - pointer: Pointer){.dynlib: dllname, - importc: "glColorPointer".} -proc glCopyPixels*(x, y: TGLint, width, height: TGLsizei, atype: TGLenum){. - dynlib: dllname, importc: "glCopyPixels".} -proc glCopyTexImage1D*(target: TGLenum, level: TGLint, internalFormat: TGLenum, - x, y: TGLint, width: TGLsizei, border: TGLint){. - dynlib: dllname, importc: "glCopyTexImage1D".} -proc glCopyTexImage2D*(target: TGLenum, level: TGLint, internalFormat: TGLenum, - x, y: TGLint, width, height: TGLsizei, border: TGLint){. - dynlib: dllname, importc: "glCopyTexImage2D".} -proc glCopyTexSubImage1D*(target: TGLenum, level, xoffset, x, y: TGLint, - width: TGLsizei){.dynlib: dllname, - importc: "glCopyTexSubImage1D".} -proc glCopyTexSubImage2D*(target: TGLenum, - level, xoffset, yoffset, x, y: TGLint, - width, height: TGLsizei){.dynlib: dllname, - importc: "glCopyTexSubImage2D".} -proc glCullFace*(mode: TGLenum){.dynlib: dllname, importc: "glCullFace".} -proc glDeleteLists*(list: TGLuint, range: TGLsizei){.dynlib: dllname, - importc: "glDeleteLists".} -proc glDeleteTextures*(n: TGLsizei, textures: PGLuint){.dynlib: dllname, - importc: "glDeleteTextures".} -proc glDepthFunc*(func: TGLenum){.dynlib: dllname, importc: "glDepthFunc".} -proc glDepthMask*(flag: TGLboolean){.dynlib: dllname, importc: "glDepthMask".} -proc glDepthRange*(zNear, zFar: TGLclampd){.dynlib: dllname, - importc: "glDepthRange".} -proc glDisable*(cap: TGLenum){.dynlib: dllname, importc: "glDisable".} -proc glDisableClientState*(aarray: TGLenum){.dynlib: dllname, - importc: "glDisableClientState".} -proc glDrawArrays*(mode: TGLenum, first: TGLint, count: TGLsizei){. - dynlib: dllname, importc: "glDrawArrays".} -proc glDrawBuffer*(mode: TGLenum){.dynlib: dllname, importc: "glDrawBuffer".} -proc glDrawElements*(mode: TGLenum, count: TGLsizei, atype: TGLenum, - indices: Pointer){.dynlib: dllname, - importc: "glDrawElements".} -proc glDrawPixels*(width, height: TGLsizei, format, atype: TGLenum, - pixels: Pointer){.dynlib: dllname, importc: "glDrawPixels".} -proc glEdgeFlag*(flag: TGLboolean){.dynlib: dllname, importc: "glEdgeFlag".} -proc glEdgeFlagPointer*(stride: TGLsizei, pointer: Pointer){.dynlib: dllname, - importc: "glEdgeFlagPointer".} -proc glEdgeFlagv*(flag: PGLboolean){.dynlib: dllname, importc: "glEdgeFlagv".} -proc glEnable*(cap: TGLenum){.dynlib: dllname, importc: "glEnable".} -proc glEnableClientState*(aarray: TGLenum){.dynlib: dllname, - importc: "glEnableClientState".} -proc glEnd*(){.dynlib: dllname, importc: "glEnd".} -proc glEndList*(){.dynlib: dllname, importc: "glEndList".} -proc glEvalCoord1d*(u: TGLdouble){.dynlib: dllname, importc: "glEvalCoord1d".} -proc glEvalCoord1dv*(u: PGLdouble){.dynlib: dllname, importc: "glEvalCoord1dv".} -proc glEvalCoord1f*(u: TGLfloat){.dynlib: dllname, importc: "glEvalCoord1f".} -proc glEvalCoord1fv*(u: PGLfloat){.dynlib: dllname, importc: "glEvalCoord1fv".} -proc glEvalCoord2d*(u, v: TGLdouble){.dynlib: dllname, importc: "glEvalCoord2d".} -proc glEvalCoord2dv*(u: PGLdouble){.dynlib: dllname, importc: "glEvalCoord2dv".} -proc glEvalCoord2f*(u, v: TGLfloat){.dynlib: dllname, importc: "glEvalCoord2f".} -proc glEvalCoord2fv*(u: PGLfloat){.dynlib: dllname, importc: "glEvalCoord2fv".} -proc glEvalMesh1*(mode: TGLenum, i1, i2: TGLint){.dynlib: dllname, - importc: "glEvalMesh1".} -proc glEvalMesh2*(mode: TGLenum, i1, i2, j1, j2: TGLint){.dynlib: dllname, - importc: "glEvalMesh2".} -proc glEvalPoint1*(i: TGLint){.dynlib: dllname, importc: "glEvalPoint1".} -proc glEvalPoint2*(i, j: TGLint){.dynlib: dllname, importc: "glEvalPoint2".} -proc glFeedbackBuffer*(size: TGLsizei, atype: TGLenum, buffer: PGLfloat){. - dynlib: dllname, importc: "glFeedbackBuffer".} -proc glFinish*(){.dynlib: dllname, importc: "glFinish".} -proc glFlush*(){.dynlib: dllname, importc: "glFlush".} -proc glFogf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glFogf".} -proc glFogfv*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glFogfv".} -proc glFogi*(pname: TGLenum, param: TGLint){.dynlib: dllname, importc: "glFogi".} -proc glFogiv*(pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glFogiv".} -proc glFrontFace*(mode: TGLenum){.dynlib: dllname, importc: "glFrontFace".} -proc glFrustum*(left, right, bottom, top, zNear, zFar: TGLdouble){. - dynlib: dllname, importc: "glFrustum".} -proc glGenLists*(range: TGLsizei): TGLuint{.dynlib: dllname, - importc: "glGenLists".} -proc glGenTextures*(n: TGLsizei, textures: PGLuint){.dynlib: dllname, - importc: "glGenTextures".} -proc glGetBooleanv*(pname: TGLenum, params: PGLboolean){.dynlib: dllname, - importc: "glGetBooleanv".} -proc glGetClipPlane*(plane: TGLenum, equation: PGLdouble){.dynlib: dllname, - importc: "glGetClipPlane".} -proc glGetDoublev*(pname: TGLenum, params: PGLdouble){.dynlib: dllname, - importc: "glGetDoublev".} -proc glGetError*(): TGLenum{.dynlib: dllname, importc: "glGetError".} -proc glGetFloatv*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glGetFloatv".} -proc glGetIntegerv*(pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glGetIntegerv".} -proc glGetLightfv*(light, pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glGetLightfv".} -proc glGetLightiv*(light, pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glGetLightiv".} -proc glGetMapdv*(target, query: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glGetMapdv".} -proc glGetMapfv*(target, query: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glGetMapfv".} -proc glGetMapiv*(target, query: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glGetMapiv".} -proc glGetMaterialfv*(face, pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glGetMaterialfv".} -proc glGetMaterialiv*(face, pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glGetMaterialiv".} -proc glGetPixelMapfv*(map: TGLenum, values: PGLfloat){.dynlib: dllname, - importc: "glGetPixelMapfv".} -proc glGetPixelMapuiv*(map: TGLenum, values: PGLuint){.dynlib: dllname, - importc: "glGetPixelMapuiv".} -proc glGetPixelMapusv*(map: TGLenum, values: PGLushort){.dynlib: dllname, - importc: "glGetPixelMapusv".} -proc glGetPointerv*(pname: TGLenum, params: Pointer){.dynlib: dllname, - importc: "glGetPointerv".} -proc glGetPolygonStipple*(mask: PGLubyte){.dynlib: dllname, - importc: "glGetPolygonStipple".} -proc glGetString*(name: TGLenum): cstring{.dynlib: dllname, - importc: "glGetString".} -proc glGetTexEnvfv*(target, pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glGetTexEnvfv".} -proc glGetTexEnviv*(target, pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glGetTexEnviv".} -proc glGetTexGendv*(coord, pname: TGLenum, params: PGLdouble){.dynlib: dllname, - importc: "glGetTexGendv".} -proc glGetTexGenfv*(coord, pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glGetTexGenfv".} -proc glGetTexGeniv*(coord, pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glGetTexGeniv".} -proc glGetTexImage*(target: TGLenum, level: TGLint, format: TGLenum, - atype: TGLenum, pixels: Pointer){.dynlib: dllname, - importc: "glGetTexImage".} -proc glGetTexLevelParameterfv*(target: TGLenum, level: TGLint, pname: TGLenum, - params: Pointer){.dynlib: dllname, - importc: "glGetTexLevelParameterfv".} -proc glGetTexLevelParameteriv*(target: TGLenum, level: TGLint, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetTexLevelParameteriv".} -proc glGetTexParameterfv*(target, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetTexParameterfv".} -proc glGetTexParameteriv*(target, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetTexParameteriv".} -proc glHint*(target, mode: TGLenum){.dynlib: dllname, importc: "glHint".} -proc glIndexMask*(mask: TGLuint){.dynlib: dllname, importc: "glIndexMask".} -proc glIndexPointer*(atype: TGLenum, stride: TGLsizei, pointer: Pointer){. - dynlib: dllname, importc: "glIndexPointer".} -proc glIndexd*(c: TGLdouble){.dynlib: dllname, importc: "glIndexd".} -proc glIndexdv*(c: PGLdouble){.dynlib: dllname, importc: "glIndexdv".} -proc glIndexf*(c: TGLfloat){.dynlib: dllname, importc: "glIndexf".} -proc glIndexfv*(c: PGLfloat){.dynlib: dllname, importc: "glIndexfv".} -proc glIndexi*(c: TGLint){.dynlib: dllname, importc: "glIndexi".} -proc glIndexiv*(c: PGLint){.dynlib: dllname, importc: "glIndexiv".} -proc glIndexs*(c: TGLshort){.dynlib: dllname, importc: "glIndexs".} -proc glIndexsv*(c: PGLshort){.dynlib: dllname, importc: "glIndexsv".} -proc glIndexub*(c: TGLubyte){.dynlib: dllname, importc: "glIndexub".} -proc glIndexubv*(c: PGLubyte){.dynlib: dllname, importc: "glIndexubv".} -proc glInitNames*(){.dynlib: dllname, importc: "glInitNames".} -proc glInterleavedArrays*(format: TGLenum, stride: TGLsizei, pointer: Pointer){. - dynlib: dllname, importc: "glInterleavedArrays".} -proc glIsEnabled*(cap: TGLenum): TGLboolean{.dynlib: dllname, - importc: "glIsEnabled".} -proc glIsList*(list: TGLuint): TGLboolean{.dynlib: dllname, importc: "glIsList".} -proc glIsTexture*(texture: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsTexture".} -proc glLightModelf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glLightModelf".} -proc glLightModelfv*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glLightModelfv".} -proc glLightModeli*(pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glLightModeli".} -proc glLightModeliv*(pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glLightModeliv".} -proc glLightf*(light, pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glLightf".} -proc glLightfv*(light, pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glLightfv".} -proc glLighti*(light, pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glLighti".} -proc glLightiv*(light, pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glLightiv".} -proc glLineStipple*(factor: TGLint, pattern: TGLushort){.dynlib: dllname, - importc: "glLineStipple".} -proc glLineWidth*(width: TGLfloat){.dynlib: dllname, importc: "glLineWidth".} -proc glListBase*(base: TGLuint){.dynlib: dllname, importc: "glListBase".} -proc glLoadIdentity*(){.dynlib: dllname, importc: "glLoadIdentity".} -proc glLoadMatrixd*(m: PGLdouble){.dynlib: dllname, importc: "glLoadMatrixd".} -proc glLoadMatrixf*(m: PGLfloat){.dynlib: dllname, importc: "glLoadMatrixf".} -proc glLoadName*(name: TGLuint){.dynlib: dllname, importc: "glLoadName".} -proc glLogicOp*(opcode: TGLenum){.dynlib: dllname, importc: "glLogicOp".} -proc glMap1d*(target: TGLenum, u1, u2: TGLdouble, stride, order: TGLint, - points: PGLdouble){.dynlib: dllname, importc: "glMap1d".} -proc glMap1f*(target: TGLenum, u1, u2: TGLfloat, stride, order: TGLint, - points: PGLfloat){.dynlib: dllname, importc: "glMap1f".} -proc glMap2d*(target: TGLenum, u1, u2: TGLdouble, ustride, uorder: TGLint, - v1, v2: TGLdouble, vstride, vorder: TGLint, points: PGLdouble){. - dynlib: dllname, importc: "glMap2d".} -proc glMap2f*(target: TGLenum, u1, u2: TGLfloat, ustride, uorder: TGLint, - v1, v2: TGLfloat, vstride, vorder: TGLint, points: PGLfloat){. - dynlib: dllname, importc: "glMap2f".} -proc glMapGrid1d*(un: TGLint, u1, u2: TGLdouble){.dynlib: dllname, - importc: "glMapGrid1d".} -proc glMapGrid1f*(un: TGLint, u1, u2: TGLfloat){.dynlib: dllname, - importc: "glMapGrid1f".} -proc glMapGrid2d*(un: TGLint, u1, u2: TGLdouble, vn: TGLint, v1, v2: TGLdouble){. - dynlib: dllname, importc: "glMapGrid2d".} -proc glMapGrid2f*(un: TGLint, u1, u2: TGLfloat, vn: TGLint, v1, v2: TGLfloat){. - dynlib: dllname, importc: "glMapGrid2f".} -proc glMaterialf*(face, pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glMaterialf".} -proc glMaterialfv*(face, pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glMaterialfv".} -proc glMateriali*(face, pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glMateriali".} -proc glMaterialiv*(face, pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glMaterialiv".} -proc glMatrixMode*(mode: TGLenum){.dynlib: dllname, importc: "glMatrixMode".} -proc glMultMatrixd*(m: PGLdouble){.dynlib: dllname, importc: "glMultMatrixd".} -proc glMultMatrixf*(m: PGLfloat){.dynlib: dllname, importc: "glMultMatrixf".} -proc glNewList*(list: TGLuint, mode: TGLenum){.dynlib: dllname, - importc: "glNewList".} -proc glNormal3b*(nx, ny, nz: TGlbyte){.dynlib: dllname, importc: "glNormal3b".} -proc glNormal3bv*(v: PGLbyte){.dynlib: dllname, importc: "glNormal3bv".} -proc glNormal3d*(nx, ny, nz: TGLdouble){.dynlib: dllname, importc: "glNormal3d".} -proc glNormal3dv*(v: PGLdouble){.dynlib: dllname, importc: "glNormal3dv".} -proc glNormal3f*(nx, ny, nz: TGLfloat){.dynlib: dllname, importc: "glNormal3f".} -proc glNormal3fv*(v: PGLfloat){.dynlib: dllname, importc: "glNormal3fv".} -proc glNormal3i*(nx, ny, nz: TGLint){.dynlib: dllname, importc: "glNormal3i".} -proc glNormal3iv*(v: PGLint){.dynlib: dllname, importc: "glNormal3iv".} -proc glNormal3s*(nx, ny, nz: TGLshort){.dynlib: dllname, importc: "glNormal3s".} -proc glNormal3sv*(v: PGLshort){.dynlib: dllname, importc: "glNormal3sv".} -proc glNormalPointer*(atype: TGLenum, stride: TGLsizei, pointer: Pointer){. - dynlib: dllname, importc: "glNormalPointer".} -proc glOrtho*(left, right, bottom, top, zNear, zFar: TGLdouble){. - dynlib: dllname, importc: "glOrtho".} -proc glPassThrough*(token: TGLfloat){.dynlib: dllname, importc: "glPassThrough".} -proc glPixelMapfv*(map: TGLenum, mapsize: TGLsizei, values: PGLfloat){. - dynlib: dllname, importc: "glPixelMapfv".} -proc glPixelMapuiv*(map: TGLenum, mapsize: TGLsizei, values: PGLuint){. - dynlib: dllname, importc: "glPixelMapuiv".} -proc glPixelMapusv*(map: TGLenum, mapsize: TGLsizei, values: PGLushort){. - dynlib: dllname, importc: "glPixelMapusv".} -proc glPixelStoref*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glPixelStoref".} -proc glPixelStorei*(pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glPixelStorei".} -proc glPixelTransferf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glPixelTransferf".} -proc glPixelTransferi*(pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glPixelTransferi".} -proc glPixelZoom*(xfactor, yfactor: TGLfloat){.dynlib: dllname, - importc: "glPixelZoom".} -proc glPointSize*(size: TGLfloat){.dynlib: dllname, importc: "glPointSize".} -proc glPolygonMode*(face, mode: TGLenum){.dynlib: dllname, - importc: "glPolygonMode".} -proc glPolygonOffset*(factor, units: TGLfloat){.dynlib: dllname, - importc: "glPolygonOffset".} -proc glPolygonStipple*(mask: PGLubyte){.dynlib: dllname, - importc: "glPolygonStipple".} -proc glPopAttrib*(){.dynlib: dllname, importc: "glPopAttrib".} -proc glPopClientAttrib*(){.dynlib: dllname, importc: "glPopClientAttrib".} -proc glPopMatrix*(){.dynlib: dllname, importc: "glPopMatrix".} -proc glPopName*(){.dynlib: dllname, importc: "glPopName".} -proc glPrioritizeTextures*(n: TGLsizei, textures: PGLuint, priorities: PGLclampf){. - dynlib: dllname, importc: "glPrioritizeTextures".} -proc glPushAttrib*(mask: TGLbitfield){.dynlib: dllname, importc: "glPushAttrib".} -proc glPushClientAttrib*(mask: TGLbitfield){.dynlib: dllname, - importc: "glPushClientAttrib".} -proc glPushMatrix*(){.dynlib: dllname, importc: "glPushMatrix".} -proc glPushName*(name: TGLuint){.dynlib: dllname, importc: "glPushName".} -proc glRasterPos2d*(x, y: TGLdouble){.dynlib: dllname, importc: "glRasterPos2d".} -proc glRasterPos2dv*(v: PGLdouble){.dynlib: dllname, importc: "glRasterPos2dv".} -proc glRasterPos2f*(x, y: TGLfloat){.dynlib: dllname, importc: "glRasterPos2f".} -proc glRasterPos2fv*(v: PGLfloat){.dynlib: dllname, importc: "glRasterPos2fv".} -proc glRasterPos2i*(x, y: TGLint){.dynlib: dllname, importc: "glRasterPos2i".} -proc glRasterPos2iv*(v: PGLint){.dynlib: dllname, importc: "glRasterPos2iv".} -proc glRasterPos2s*(x, y: TGLshort){.dynlib: dllname, importc: "glRasterPos2s".} -proc glRasterPos2sv*(v: PGLshort){.dynlib: dllname, importc: "glRasterPos2sv".} -proc glRasterPos3d*(x, y, z: TGLdouble){.dynlib: dllname, - importc: "glRasterPos3d".} -proc glRasterPos3dv*(v: PGLdouble){.dynlib: dllname, importc: "glRasterPos3dv".} -proc glRasterPos3f*(x, y, z: TGLfloat){.dynlib: dllname, - importc: "glRasterPos3f".} -proc glRasterPos3fv*(v: PGLfloat){.dynlib: dllname, importc: "glRasterPos3fv".} -proc glRasterPos3i*(x, y, z: TGLint){.dynlib: dllname, importc: "glRasterPos3i".} -proc glRasterPos3iv*(v: PGLint){.dynlib: dllname, importc: "glRasterPos3iv".} -proc glRasterPos3s*(x, y, z: TGLshort){.dynlib: dllname, - importc: "glRasterPos3s".} -proc glRasterPos3sv*(v: PGLshort){.dynlib: dllname, importc: "glRasterPos3sv".} -proc glRasterPos4d*(x, y, z, w: TGLdouble){.dynlib: dllname, - importc: "glRasterPos4d".} -proc glRasterPos4dv*(v: PGLdouble){.dynlib: dllname, importc: "glRasterPos4dv".} -proc glRasterPos4f*(x, y, z, w: TGLfloat){.dynlib: dllname, - importc: "glRasterPos4f".} -proc glRasterPos4fv*(v: PGLfloat){.dynlib: dllname, importc: "glRasterPos4fv".} -proc glRasterPos4i*(x, y, z, w: TGLint){.dynlib: dllname, - importc: "glRasterPos4i".} -proc glRasterPos4iv*(v: PGLint){.dynlib: dllname, importc: "glRasterPos4iv".} -proc glRasterPos4s*(x, y, z, w: TGLshort){.dynlib: dllname, - importc: "glRasterPos4s".} -proc glRasterPos4sv*(v: PGLshort){.dynlib: dllname, importc: "glRasterPos4sv".} -proc glReadBuffer*(mode: TGLenum){.dynlib: dllname, importc: "glReadBuffer".} -proc glReadPixels*(x, y: TGLint, width, height: TGLsizei, - format, atype: TGLenum, pixels: Pointer){.dynlib: dllname, - importc: "glReadPixels".} -proc glRectd*(x1, y1, x2, y2: TGLdouble){.dynlib: dllname, importc: "glRectd".} -proc glRectdv*(v1: PGLdouble, v2: PGLdouble){.dynlib: dllname, - importc: "glRectdv".} -proc glRectf*(x1, y1, x2, y2: TGLfloat){.dynlib: dllname, importc: "glRectf".} -proc glRectfv*(v1: PGLfloat, v2: PGLfloat){.dynlib: dllname, importc: "glRectfv".} -proc glRecti*(x1, y1, x2, y2: TGLint){.dynlib: dllname, importc: "glRecti".} -proc glRectiv*(v1: PGLint, v2: PGLint){.dynlib: dllname, importc: "glRectiv".} -proc glRects*(x1, y1, x2, y2: TGLshort){.dynlib: dllname, importc: "glRects".} -proc glRectsv*(v1: PGLshort, v2: PGLshort){.dynlib: dllname, importc: "glRectsv".} -proc glRenderMode*(mode: TGLint): TGLint{.dynlib: dllname, - importc: "glRenderMode".} -proc glRotated*(angle, x, y, z: TGLdouble){.dynlib: dllname, - importc: "glRotated".} -proc glRotatef*(angle, x, y, z: TGLfloat){.dynlib: dllname, importc: "glRotatef".} -proc glScaled*(x, y, z: TGLdouble){.dynlib: dllname, importc: "glScaled".} -proc glScalef*(x, y, z: TGLfloat){.dynlib: dllname, importc: "glScalef".} -proc glScissor*(x, y: TGLint, width, height: TGLsizei){.dynlib: dllname, - importc: "glScissor".} -proc glSelectBuffer*(size: TGLsizei, buffer: PGLuint){.dynlib: dllname, - importc: "glSelectBuffer".} -proc glShadeModel*(mode: TGLenum){.dynlib: dllname, importc: "glShadeModel".} -proc glStencilFunc*(func: TGLenum, theref: TGLint, mask: TGLuint){. - dynlib: dllname, importc: "glStencilFunc".} -proc glStencilMask*(mask: TGLuint){.dynlib: dllname, importc: "glStencilMask".} -proc glStencilOp*(fail, zfail, zpass: TGLenum){.dynlib: dllname, - importc: "glStencilOp".} -proc glTexCoord1d*(s: TGLdouble){.dynlib: dllname, importc: "glTexCoord1d".} -proc glTexCoord1dv*(v: PGLdouble){.dynlib: dllname, importc: "glTexCoord1dv".} -proc glTexCoord1f*(s: TGLfloat){.dynlib: dllname, importc: "glTexCoord1f".} -proc glTexCoord1fv*(v: PGLfloat){.dynlib: dllname, importc: "glTexCoord1fv".} -proc glTexCoord1i*(s: TGLint){.dynlib: dllname, importc: "glTexCoord1i".} -proc glTexCoord1iv*(v: PGLint){.dynlib: dllname, importc: "glTexCoord1iv".} -proc glTexCoord1s*(s: TGLshort){.dynlib: dllname, importc: "glTexCoord1s".} -proc glTexCoord1sv*(v: PGLshort){.dynlib: dllname, importc: "glTexCoord1sv".} -proc glTexCoord2d*(s, t: TGLdouble){.dynlib: dllname, importc: "glTexCoord2d".} -proc glTexCoord2dv*(v: PGLdouble){.dynlib: dllname, importc: "glTexCoord2dv".} -proc glTexCoord2f*(s, t: TGLfloat){.dynlib: dllname, importc: "glTexCoord2f".} -proc glTexCoord2fv*(v: PGLfloat){.dynlib: dllname, importc: "glTexCoord2fv".} -proc glTexCoord2i*(s, t: TGLint){.dynlib: dllname, importc: "glTexCoord2i".} -proc glTexCoord2iv*(v: PGLint){.dynlib: dllname, importc: "glTexCoord2iv".} -proc glTexCoord2s*(s, t: TGLshort){.dynlib: dllname, importc: "glTexCoord2s".} -proc glTexCoord2sv*(v: PGLshort){.dynlib: dllname, importc: "glTexCoord2sv".} -proc glTexCoord3d*(s, t, r: TGLdouble){.dynlib: dllname, importc: "glTexCoord3d".} -proc glTexCoord3dv*(v: PGLdouble){.dynlib: dllname, importc: "glTexCoord3dv".} -proc glTexCoord3f*(s, t, r: TGLfloat){.dynlib: dllname, importc: "glTexCoord3f".} -proc glTexCoord3fv*(v: PGLfloat){.dynlib: dllname, importc: "glTexCoord3fv".} -proc glTexCoord3i*(s, t, r: TGLint){.dynlib: dllname, importc: "glTexCoord3i".} -proc glTexCoord3iv*(v: PGLint){.dynlib: dllname, importc: "glTexCoord3iv".} -proc glTexCoord3s*(s, t, r: TGLshort){.dynlib: dllname, importc: "glTexCoord3s".} -proc glTexCoord3sv*(v: PGLshort){.dynlib: dllname, importc: "glTexCoord3sv".} -proc glTexCoord4d*(s, t, r, q: TGLdouble){.dynlib: dllname, - importc: "glTexCoord4d".} -proc glTexCoord4dv*(v: PGLdouble){.dynlib: dllname, importc: "glTexCoord4dv".} -proc glTexCoord4f*(s, t, r, q: TGLfloat){.dynlib: dllname, - importc: "glTexCoord4f".} -proc glTexCoord4fv*(v: PGLfloat){.dynlib: dllname, importc: "glTexCoord4fv".} -proc glTexCoord4i*(s, t, r, q: TGLint){.dynlib: dllname, importc: "glTexCoord4i".} -proc glTexCoord4iv*(v: PGLint){.dynlib: dllname, importc: "glTexCoord4iv".} -proc glTexCoord4s*(s, t, r, q: TGLshort){.dynlib: dllname, - importc: "glTexCoord4s".} -proc glTexCoord4sv*(v: PGLshort){.dynlib: dllname, importc: "glTexCoord4sv".} -proc glTexCoordPointer*(size: TGLint, atype: TGLenum, stride: TGLsizei, - pointer: Pointer){.dynlib: dllname, - importc: "glTexCoordPointer".} -proc glTexEnvf*(target: TGLenum, pname: TGLenum, param: TGLfloat){. - dynlib: dllname, importc: "glTexEnvf".} -proc glTexEnvfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glTexEnvfv".} -proc glTexEnvi*(target: TGLenum, pname: TGLenum, param: TGLint){. - dynlib: dllname, importc: "glTexEnvi".} -proc glTexEnviv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glTexEnviv".} -proc glTexGend*(coord: TGLenum, pname: TGLenum, param: TGLdouble){. - dynlib: dllname, importc: "glTexGend".} -proc glTexGendv*(coord: TGLenum, pname: TGLenum, params: PGLdouble){. - dynlib: dllname, importc: "glTexGendv".} -proc glTexGenf*(coord: TGLenum, pname: TGLenum, param: TGLfloat){. - dynlib: dllname, importc: "glTexGenf".} -proc glTexGenfv*(coord: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glTexGenfv".} -proc glTexGeni*(coord: TGLenum, pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glTexGeni".} -proc glTexGeniv*(coord: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glTexGeniv".} -proc glTexImage1D*(target: TGLenum, level, internalformat: TGLint, - width: TGLsizei, border: TGLint, format, atype: TGLenum, - pixels: Pointer){.dynlib: dllname, importc: "glTexImage1D".} -proc glTexImage2D*(target: TGLenum, level, internalformat: TGLint, - width, height: TGLsizei, border: TGLint, - format, atype: TGLenum, pixels: Pointer){.dynlib: dllname, - importc: "glTexImage2D".} -proc glTexParameterf*(target: TGLenum, pname: TGLenum, param: TGLfloat){. - dynlib: dllname, importc: "glTexParameterf".} -proc glTexParameterfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glTexParameterfv".} -proc glTexParameteri*(target: TGLenum, pname: TGLenum, param: TGLint){. - dynlib: dllname, importc: "glTexParameteri".} -proc glTexParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glTexParameteriv".} -proc glTexSubImage1D*(target: TGLenum, level, xoffset: TGLint, width: TGLsizei, - format, atype: TGLenum, pixels: Pointer){.dynlib: dllname, - importc: "glTexSubImage1D".} -proc glTexSubImage2D*(target: TGLenum, level, xoffset, yoffset: TGLint, - width, height: TGLsizei, format, atype: TGLenum, - pixels: Pointer){.dynlib: dllname, - importc: "glTexSubImage2D".} -proc glTranslated*(x, y, z: TGLdouble){.dynlib: dllname, importc: "glTranslated".} -proc glTranslatef*(x, y, z: TGLfloat){.dynlib: dllname, importc: "glTranslatef".} -proc glVertex2d*(x, y: TGLdouble){.dynlib: dllname, importc: "glVertex2d".} -proc glVertex2dv*(v: PGLdouble){.dynlib: dllname, importc: "glVertex2dv".} -proc glVertex2f*(x, y: TGLfloat){.dynlib: dllname, importc: "glVertex2f".} -proc glVertex2fv*(v: PGLfloat){.dynlib: dllname, importc: "glVertex2fv".} -proc glVertex2i*(x, y: TGLint){.dynlib: dllname, importc: "glVertex2i".} -proc glVertex2iv*(v: PGLint){.dynlib: dllname, importc: "glVertex2iv".} -proc glVertex2s*(x, y: TGLshort){.dynlib: dllname, importc: "glVertex2s".} -proc glVertex2sv*(v: PGLshort){.dynlib: dllname, importc: "glVertex2sv".} -proc glVertex3d*(x, y, z: TGLdouble){.dynlib: dllname, importc: "glVertex3d".} -proc glVertex3dv*(v: PGLdouble){.dynlib: dllname, importc: "glVertex3dv".} -proc glVertex3f*(x, y, z: TGLfloat){.dynlib: dllname, importc: "glVertex3f".} -proc glVertex3fv*(v: PGLfloat){.dynlib: dllname, importc: "glVertex3fv".} -proc glVertex3i*(x, y, z: TGLint){.dynlib: dllname, importc: "glVertex3i".} -proc glVertex3iv*(v: PGLint){.dynlib: dllname, importc: "glVertex3iv".} -proc glVertex3s*(x, y, z: TGLshort){.dynlib: dllname, importc: "glVertex3s".} -proc glVertex3sv*(v: PGLshort){.dynlib: dllname, importc: "glVertex3sv".} -proc glVertex4d*(x, y, z, w: TGLdouble){.dynlib: dllname, importc: "glVertex4d".} -proc glVertex4dv*(v: PGLdouble){.dynlib: dllname, importc: "glVertex4dv".} -proc glVertex4f*(x, y, z, w: TGLfloat){.dynlib: dllname, importc: "glVertex4f".} -proc glVertex4fv*(v: PGLfloat){.dynlib: dllname, importc: "glVertex4fv".} -proc glVertex4i*(x, y, z, w: TGLint){.dynlib: dllname, importc: "glVertex4i".} -proc glVertex4iv*(v: PGLint){.dynlib: dllname, importc: "glVertex4iv".} -proc glVertex4s*(x, y, z, w: TGLshort){.dynlib: dllname, importc: "glVertex4s".} -proc glVertex4sv*(v: PGLshort){.dynlib: dllname, importc: "glVertex4sv".} -proc glVertexPointer*(size: TGLint, atype: TGLenum, stride: TGLsizei, - pointer: Pointer){.dynlib: dllname, - importc: "glVertexPointer".} -proc glViewport*(x, y: TGLint, width, height: TGLsizei){.dynlib: dllname, - importc: "glViewport".} -type - PFN_GLARRAY_ELEMENT_EXTPROC* = proc (i: TGLint) - PFN_GLDRAW_ARRAYS_EXTPROC* = proc (mode: TGLenum, first: TGLint, - count: TGLsizei) - PFN_GLVERTEX_POINTER_EXTPROC* = proc (size: TGLint, atype: TGLenum, - stride, count: TGLsizei, - pointer: Pointer) - PFN_GLNORMAL_POINTER_EXTPROC* = proc (atype: TGLenum, stride, count: TGLsizei, - pointer: Pointer) - PFN_GLCOLOR_POINTER_EXTPROC* = proc (size: TGLint, atype: TGLenum, - stride, count: TGLsizei, pointer: Pointer) - PFN_GLINDEX_POINTER_EXTPROC* = proc (atype: TGLenum, stride, count: TGLsizei, - pointer: Pointer) - PFN_GLTEXCOORD_POINTER_EXTPROC* = proc (size: TGLint, atype: TGLenum, - stride, count: TGLsizei, pointer: Pointer) - PFN_GLEDGEFLAG_POINTER_EXTPROC* = proc (stride, count: TGLsizei, - pointer: PGLboolean) - PFN_GLGET_POINTER_VEXT_PROC* = proc (pname: TGLenum, params: Pointer) - PFN_GLARRAY_ELEMENT_ARRAY_EXTPROC* = proc (mode: TGLenum, count: TGLsizei, - pi: Pointer) # WIN_swap_hint - PFN_GLADDSWAPHINT_RECT_WINPROC* = proc (x, y: TGLint, width, height: TGLsizei) - PFN_GLCOLOR_TABLE_EXTPROC* = proc (target, internalFormat: TGLenum, - width: TGLsizei, format, atype: TGLenum, - data: Pointer) - PFN_GLCOLOR_SUBTABLE_EXTPROC* = proc (target: TGLenum, start, count: TGLsizei, - format, atype: TGLenum, data: Pointer) - PFN_GLGETCOLOR_TABLE_EXTPROC* = proc (target, format, atype: TGLenum, - data: Pointer) - PFN_GLGETCOLOR_TABLE_PARAMETER_IVEXTPROC* = proc (target, pname: TGLenum, - params: PGLint) - PFN_GLGETCOLOR_TABLE_PARAMETER_FVEXTPROC* = proc (target, pname: TGLenum, - params: PGLfloat) - -{.pop.} -# implementation diff --git a/lib/wrappers/opengl/glext.nim b/lib/wrappers/opengl/glext.nim deleted file mode 100644 index 32871df0e4..0000000000 --- a/lib/wrappers/opengl/glext.nim +++ /dev/null @@ -1,4673 +0,0 @@ -# -# -# Adaption of the delphi3d.net OpenGL units to FreePascal -# Sebastian Guenther (sg@freepascal.org) in 2002 -# These units are free to use -# -# - -#************************************************* -# * OpenGL extension loading library * -# * Generated by MetaGLext, written by Tom Nuydens * -# * (tom@delphi3d.net -- http://www.delphi3d.net * -# ************************************************* -#*** Generated on 10/11/2002 - -when defined(windows): - {.push, callconv: stdcall.} -else: - {.push, callconv: cdecl.} -import - gl - -type - GLcharARB* = Char - TGLcharARB* = GLcharARB - PGLcharARB* = ptr GLcharARB - GLhandleARB* = int - TGLhandleARB* = GLhandleARB - PGLhandleARB* = ptr GLhandleARB - GLintptr* = int - TGLintptr* = GLintptr - PGLintptr* = ptr GLintptr - GLsizeiptr* = int - TGLsizeiptr* = GLsizeiptr - PGLsizeiptr* = ptr GLsizeiptr - GLchar* = Char - TGLchar* = GLchar - PGLchar* = cstring #***** GL_version_1_2 *****// - -const - GL_UNSIGNED_BYTE_3_3_2* = 0x00008032 - GL_UNSIGNED_SHORT_4_4_4_4* = 0x00008033 - GL_UNSIGNED_SHORT_5_5_5_1* = 0x00008034 - GL_UNSIGNED_INT_8_8_8_8* = 0x00008035 - GL_UNSIGNED_INT_10_10_10_2* = 0x00008036 - GL_RESCALE_NORMAL* = 0x0000803A - GL_UNSIGNED_BYTE_2_3_3_REV* = 0x00008362 - GL_UNSIGNED_SHORT_5_6_5* = 0x00008363 - GL_UNSIGNED_SHORT_5_6_5_REV* = 0x00008364 - GL_UNSIGNED_SHORT_4_4_4_4_REV* = 0x00008365 - GL_UNSIGNED_SHORT_1_5_5_5_REV* = 0x00008366 - GL_UNSIGNED_INT_8_8_8_8_REV* = 0x00008367 - GL_UNSIGNED_INT_2_10_10_10_REV* = 0x00008368 - GL_BGR* = 0x000080E0 - GL_BGRA* = 0x000080E1 - GL_MAX_ELEMENTS_VERTICES* = 0x000080E8 - GL_MAX_ELEMENTS_INDICES* = 0x000080E9 - GL_CLAMP_TO_EDGE* = 0x0000812F - GL_TEXTURE_MIN_LOD* = 0x0000813A - GL_TEXTURE_MAX_LOD* = 0x0000813B - GL_TEXTURE_BASE_LEVEL* = 0x0000813C - GL_TEXTURE_MAX_LEVEL* = 0x0000813D - GL_LIGHT_MODEL_COLOR_CONTROL* = 0x000081F8 - GL_SINGLE_COLOR* = 0x000081F9 - GL_SEPARATE_SPECULAR_COLOR* = 0x000081FA - GL_SMOOTH_POINT_SIZE_RANGE* = 0x00000B12 - GL_SMOOTH_POINT_SIZE_GRANULARITY* = 0x00000B13 - GL_SMOOTH_LINE_WIDTH_RANGE* = 0x00000B22 - GL_SMOOTH_LINE_WIDTH_GRANULARITY* = 0x00000B23 - GL_ALIASED_POINT_SIZE_RANGE* = 0x0000846D - GL_ALIASED_LINE_WIDTH_RANGE* = 0x0000846E - GL_PACK_SKIP_IMAGES* = 0x0000806B - GL_PACK_IMAGE_HEIGHT* = 0x0000806C - GL_UNPACK_SKIP_IMAGES* = 0x0000806D - GL_UNPACK_IMAGE_HEIGHT* = 0x0000806E - GL_TEXTURE_3D* = 0x0000806F - GL_PROXY_TEXTURE_3D* = 0x00008070 - GL_TEXTURE_DEPTH* = 0x00008071 - GL_TEXTURE_WRAP_R* = 0x00008072 - GL_MAX_3D_TEXTURE_SIZE* = 0x00008073 - -proc glBlendColor*(red: TGLclampf, green: TGLclampf, blue: TGLclampf, - alpha: TGLclampf){.dynlib: dllname, importc: "glBlendColor".} -proc glBlendEquation*(mode: TGLenum){.dynlib: dllname, - importc: "glBlendEquation".} -proc glDrawRangeElements*(mode: TGLenum, start: TGLuint, theend: TGLuint, - count: TGLsizei, thetype: TGLenum, indices: PGLvoid){. - dynlib: dllname, importc: "glDrawRangeElements".} -proc glColorTable*(target: TGLenum, internalformat: TGLenum, width: TGLsizei, - format: TGLenum, thetype: TGLenum, table: PGLvoid){. - dynlib: dllname, importc: "glColorTable".} -proc glColorTableParameterfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glColorTableParameterfv".} -proc glColorTableParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glColorTableParameteriv".} -proc glCopyColorTable*(target: TGLenum, internalformat: TGLenum, x: TGLint, - y: TGLint, width: TGLsizei){.dynlib: dllname, - importc: "glCopyColorTable".} -proc glGetColorTable*(target: TGLenum, format: TGLenum, thetype: TGLenum, - table: PGLvoid){.dynlib: dllname, - importc: "glGetColorTable".} -proc glGetColorTableParameterfv*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetColorTableParameterfv".} -proc glGetColorTableParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetColorTableParameteriv".} -proc glColorSubTable*(target: TGLenum, start: TGLsizei, count: TGLsizei, - format: TGLenum, thetype: TGLenum, data: PGLvoid){. - dynlib: dllname, importc: "glColorSubTable".} -proc glCopyColorSubTable*(target: TGLenum, start: TGLsizei, x: TGLint, - y: TGLint, width: TGLsizei){.dynlib: dllname, - importc: "glCopyColorSubTable".} -proc glConvolutionFilter1D*(target: TGLenum, internalformat: TGLenum, - width: TGLsizei, format: TGLenum, thetype: TGLenum, - image: PGLvoid){.dynlib: dllname, - importc: "glConvolutionFilter1D".} -proc glConvolutionFilter2D*(target: TGLenum, internalformat: TGLenum, - width: TGLsizei, height: TGLsizei, format: TGLenum, - thetype: TGLenum, image: PGLvoid){.dynlib: dllname, - importc: "glConvolutionFilter2D".} -proc glConvolutionParameterf*(target: TGLenum, pname: TGLenum, params: TGLfloat){. - dynlib: dllname, importc: "glConvolutionParameterf".} -proc glConvolutionParameterfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glConvolutionParameterfv".} -proc glConvolutionParameteri*(target: TGLenum, pname: TGLenum, params: TGLint){. - dynlib: dllname, importc: "glConvolutionParameteri".} -proc glConvolutionParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glConvolutionParameteriv".} -proc glCopyConvolutionFilter1D*(target: TGLenum, internalformat: TGLenum, - x: TGLint, y: TGLint, width: TGLsizei){. - dynlib: dllname, importc: "glCopyConvolutionFilter1D".} -proc glCopyConvolutionFilter2D*(target: TGLenum, internalformat: TGLenum, - x: TGLint, y: TGLint, width: TGLsizei, - height: TGLsizei){.dynlib: dllname, - importc: "glCopyConvolutionFilter2D".} -proc glGetConvolutionFilter*(target: TGLenum, format: TGLenum, thetype: TGLenum, - image: PGLvoid){.dynlib: dllname, - importc: "glGetConvolutionFilter".} -proc glGetConvolutionParameterfv*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetConvolutionParameterfv".} -proc glGetConvolutionParameteriv*(target: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetConvolutionParameteriv".} -proc glGetSeparableFilter*(target: TGLenum, format: TGLenum, thetype: TGLenum, - row: PGLvoid, column: PGLvoid, span: PGLvoid){. - dynlib: dllname, importc: "glGetSeparableFilter".} -proc glSeparableFilter2D*(target: TGLenum, internalformat: TGLenum, - width: TGLsizei, height: TGLsizei, format: TGLenum, - thetype: TGLenum, row: PGLvoid, column: PGLvoid){. - dynlib: dllname, importc: "glSeparableFilter2D".} -proc glGetHistogram*(target: TGLenum, reset: TGLboolean, format: TGLenum, - thetype: TGLenum, values: PGLvoid){.dynlib: dllname, - importc: "glGetHistogram".} -proc glGetHistogramParameterfv*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetHistogramParameterfv".} -proc glGetHistogramParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetHistogramParameteriv".} -proc glGetMinmax*(target: TGLenum, reset: TGLboolean, format: TGLenum, - thetype: TGLenum, values: PGLvoid){.dynlib: dllname, - importc: "glGetMinmax".} -proc glGetMinmaxParameterfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetMinmaxParameterfv".} -proc glGetMinmaxParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetMinmaxParameteriv".} -proc glHistogram*(target: TGLenum, width: TGLsizei, internalformat: TGLenum, - sink: TGLboolean){.dynlib: dllname, importc: "glHistogram".} -proc glMinmax*(target: TGLenum, internalformat: TGLenum, sink: TGLboolean){. - dynlib: dllname, importc: "glMinmax".} -proc glResetHistogram*(target: TGLenum){.dynlib: dllname, - importc: "glResetHistogram".} -proc glResetMinmax*(target: TGLenum){.dynlib: dllname, importc: "glResetMinmax".} -proc glTexImage3D*(target: TGLenum, level: TGLint, internalformat: TGLint, - width: TGLsizei, height: TGLsizei, depth: TGLsizei, - border: TGLint, format: TGLenum, thetype: TGLenum, - pixels: PGLvoid){.dynlib: dllname, importc: "glTexImage3D".} -proc glTexSubImage3D*(target: TGLenum, level: TGLint, xoffset: TGLint, - yoffset: TGLint, zoffset: TGLint, width: TGLsizei, - height: TGLsizei, depth: TGLsizei, format: TGLenum, - thetype: TGLenum, pixels: PGLvoid){.dynlib: dllname, - importc: "glTexSubImage3D".} -proc glCopyTexSubImage3D*(target: TGLenum, level: TGLint, xoffset: TGLint, - yoffset: TGLint, zoffset: TGLint, x: TGLint, - y: TGLint, width: TGLsizei, height: TGLsizei){. - dynlib: dllname, importc: "glCopyTexSubImage3D".} -proc glActiveTextureARB*(texture: TGLenum){.dynlib: dllname, - importc: "glActiveTextureARB".} -proc glClientActiveTextureARB*(texture: TGLenum){.dynlib: dllname, - importc: "glClientActiveTextureARB".} -proc glMultiTexCoord1dARB*(target: TGLenum, s: TGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord1dARB".} -proc glMultiTexCoord1dvARB*(target: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord1dvARB".} -proc glMultiTexCoord1fARB*(target: TGLenum, s: TGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord1fARB".} -proc glMultiTexCoord1fvARB*(target: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord1fvARB".} -proc glMultiTexCoord1iARB*(target: TGLenum, s: TGLint){.dynlib: dllname, - importc: "glMultiTexCoord1iARB".} -proc glMultiTexCoord1ivARB*(target: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glMultiTexCoord1ivARB".} -proc glMultiTexCoord1sARB*(target: TGLenum, s: TGLshort){.dynlib: dllname, - importc: "glMultiTexCoord1sARB".} -proc glMultiTexCoord1svARB*(target: TGLenum, v: PGLshort){.dynlib: dllname, - importc: "glMultiTexCoord1svARB".} -proc glMultiTexCoord2dARB*(target: TGLenum, s: TGLdouble, t: TGLdouble){. - dynlib: dllname, importc: "glMultiTexCoord2dARB".} -proc glMultiTexCoord2dvARB*(target: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord2dvARB".} -proc glMultiTexCoord2fARB*(target: TGLenum, s: TGLfloat, t: TGLfloat){. - dynlib: dllname, importc: "glMultiTexCoord2fARB".} -proc glMultiTexCoord2fvARB*(target: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord2fvARB".} -proc glMultiTexCoord2iARB*(target: TGLenum, s: TGLint, t: TGLint){. - dynlib: dllname, importc: "glMultiTexCoord2iARB".} -proc glMultiTexCoord2ivARB*(target: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glMultiTexCoord2ivARB".} -proc glMultiTexCoord2sARB*(target: TGLenum, s: TGLshort, t: TGLshort){. - dynlib: dllname, importc: "glMultiTexCoord2sARB".} -proc glMultiTexCoord2svARB*(target: TGLenum, v: PGLshort){.dynlib: dllname, - importc: "glMultiTexCoord2svARB".} -proc glMultiTexCoord3dARB*(target: TGLenum, s: TGLdouble, t: TGLdouble, - r: TGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord3dARB".} -proc glMultiTexCoord3dvARB*(target: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord3dvARB".} -proc glMultiTexCoord3fARB*(target: TGLenum, s: TGLfloat, t: TGLfloat, - r: TGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord3fARB".} -proc glMultiTexCoord3fvARB*(target: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord3fvARB".} -proc glMultiTexCoord3iARB*(target: TGLenum, s: TGLint, t: TGLint, r: TGLint){. - dynlib: dllname, importc: "glMultiTexCoord3iARB".} -proc glMultiTexCoord3ivARB*(target: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glMultiTexCoord3ivARB".} -proc glMultiTexCoord3sARB*(target: TGLenum, s: TGLshort, t: TGLshort, - r: TGLshort){.dynlib: dllname, - importc: "glMultiTexCoord3sARB".} -proc glMultiTexCoord3svARB*(target: TGLenum, v: PGLshort){.dynlib: dllname, - importc: "glMultiTexCoord3svARB".} -proc glMultiTexCoord4dARB*(target: TGLenum, s: TGLdouble, t: TGLdouble, - r: TGLdouble, q: TGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord4dARB".} -proc glMultiTexCoord4dvARB*(target: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord4dvARB".} -proc glMultiTexCoord4fARB*(target: TGLenum, s: TGLfloat, t: TGLfloat, - r: TGLfloat, q: TGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord4fARB".} -proc glMultiTexCoord4fvARB*(target: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord4fvARB".} -proc glMultiTexCoord4iARB*(target: TGLenum, s: TGLint, t: TGLint, r: TGLint, - q: TGLint){.dynlib: dllname, - importc: "glMultiTexCoord4iARB".} -proc glMultiTexCoord4ivARB*(target: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glMultiTexCoord4ivARB".} -proc glMultiTexCoord4sARB*(target: TGLenum, s: TGLshort, t: TGLshort, - r: TGLshort, q: TGLshort){.dynlib: dllname, - importc: "glMultiTexCoord4sARB".} -proc glMultiTexCoord4svARB*(target: TGLenum, v: PGLshort){.dynlib: dllname, - importc: "glMultiTexCoord4svARB".} -proc glSampleCoverageARB*(value: TGLclampf, invert: TGLboolean){. - dynlib: dllname, importc: "glSampleCoverageARB".} - #***** GL_ARB_texture_env_add *****// -proc glWeightbvARB*(size: TGLint, weights: PGLbyte){.dynlib: dllname, - importc: "glWeightbvARB".} -proc glWeightsvARB*(size: TGLint, weights: PGLshort){.dynlib: dllname, - importc: "glWeightsvARB".} -proc glWeightivARB*(size: TGLint, weights: PGLint){.dynlib: dllname, - importc: "glWeightivARB".} -proc glWeightfvARB*(size: TGLint, weights: PGLfloat){.dynlib: dllname, - importc: "glWeightfvARB".} -proc glWeightdvARB*(size: TGLint, weights: PGLdouble){.dynlib: dllname, - importc: "glWeightdvARB".} -proc glWeightvARB*(size: TGLint, weights: PGLdouble){.dynlib: dllname, - importc: "glWeightvARB".} -proc glWeightubvARB*(size: TGLint, weights: PGLubyte){.dynlib: dllname, - importc: "glWeightubvARB".} -proc glWeightusvARB*(size: TGLint, weights: PGLushort){.dynlib: dllname, - importc: "glWeightusvARB".} -proc glWeightuivARB*(size: TGLint, weights: PGLuint){.dynlib: dllname, - importc: "glWeightuivARB".} -proc glWeightPointerARB*(size: TGLint, thetype: TGLenum, stride: TGLsizei, - pointer: PGLvoid){.dynlib: dllname, - importc: "glWeightPointerARB".} -proc glVertexBlendARB*(count: TGLint){.dynlib: dllname, - importc: "glVertexBlendARB".} -proc glVertexAttrib1sARB*(index: TGLuint, x: TGLshort){.dynlib: dllname, - importc: "glVertexAttrib1sARB".} -proc glVertexAttrib1fARB*(index: TGLuint, x: TGLfloat){.dynlib: dllname, - importc: "glVertexAttrib1fARB".} -proc glVertexAttrib1dARB*(index: TGLuint, x: TGLdouble){.dynlib: dllname, - importc: "glVertexAttrib1dARB".} -proc glVertexAttrib2sARB*(index: TGLuint, x: TGLshort, y: TGLshort){. - dynlib: dllname, importc: "glVertexAttrib2sARB".} -proc glVertexAttrib2fARB*(index: TGLuint, x: TGLfloat, y: TGLfloat){. - dynlib: dllname, importc: "glVertexAttrib2fARB".} -proc glVertexAttrib2dARB*(index: TGLuint, x: TGLdouble, y: TGLdouble){. - dynlib: dllname, importc: "glVertexAttrib2dARB".} -proc glVertexAttrib3sARB*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort){. - dynlib: dllname, importc: "glVertexAttrib3sARB".} -proc glVertexAttrib3fARB*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glVertexAttrib3fARB".} -proc glVertexAttrib3dARB*(index: TGLuint, x: TGLdouble, y: TGLdouble, - z: TGLdouble){.dynlib: dllname, - importc: "glVertexAttrib3dARB".} -proc glVertexAttrib4sARB*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort, - w: TGLshort){.dynlib: dllname, - importc: "glVertexAttrib4sARB".} -proc glVertexAttrib4fARB*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat, - w: TGLfloat){.dynlib: dllname, - importc: "glVertexAttrib4fARB".} -proc glVertexAttrib4dARB*(index: TGLuint, x: TGLdouble, y: TGLdouble, - z: TGLdouble, w: TGLdouble){.dynlib: dllname, - importc: "glVertexAttrib4dARB".} -proc glVertexAttrib4NubARB*(index: TGLuint, x: TGLubyte, y: TGLubyte, - z: TGLubyte, w: TGLubyte){.dynlib: dllname, - importc: "glVertexAttrib4NubARB".} -proc glVertexAttrib1svARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib1svARB".} -proc glVertexAttrib1fvARB*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib1fvARB".} -proc glVertexAttrib1dvARB*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib1dvARB".} -proc glVertexAttrib2svARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib2svARB".} -proc glVertexAttrib2fvARB*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib2fvARB".} -proc glVertexAttrib2dvARB*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib2dvARB".} -proc glVertexAttrib3svARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib3svARB".} -proc glVertexAttrib3fvARB*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib3fvARB".} -proc glVertexAttrib3dvARB*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib3dvARB".} -proc glVertexAttrib4bvARB*(index: TGLuint, v: PGLbyte){.dynlib: dllname, - importc: "glVertexAttrib4bvARB".} -proc glVertexAttrib4svARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib4svARB".} -proc glVertexAttrib4ivARB*(index: TGLuint, v: PGLint){.dynlib: dllname, - importc: "glVertexAttrib4ivARB".} -proc glVertexAttrib4ubvARB*(index: TGLuint, v: PGLubyte){.dynlib: dllname, - importc: "glVertexAttrib4ubvARB".} -proc glVertexAttrib4usvARB*(index: TGLuint, v: PGLushort){.dynlib: dllname, - importc: "glVertexAttrib4usvARB".} -proc glVertexAttrib4uivARB*(index: TGLuint, v: PGLuint){.dynlib: dllname, - importc: "glVertexAttrib4uivARB".} -proc glVertexAttrib4fvARB*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib4fvARB".} -proc glVertexAttrib4dvARB*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib4dvARB".} -proc glVertexAttrib4NbvARB*(index: TGLuint, v: PGLbyte){.dynlib: dllname, - importc: "glVertexAttrib4NbvARB".} -proc glVertexAttrib4NsvARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib4NsvARB".} -proc glVertexAttrib4NivARB*(index: TGLuint, v: PGLint){.dynlib: dllname, - importc: "glVertexAttrib4NivARB".} -proc glVertexAttrib4NubvARB*(index: TGLuint, v: PGLubyte){.dynlib: dllname, - importc: "glVertexAttrib4NubvARB".} -proc glVertexAttrib4NusvARB*(index: TGLuint, v: PGLushort){.dynlib: dllname, - importc: "glVertexAttrib4NusvARB".} -proc glVertexAttrib4NuivARB*(index: TGLuint, v: PGLuint){.dynlib: dllname, - importc: "glVertexAttrib4NuivARB".} -proc glVertexAttribPointerARB*(index: TGLuint, size: TGLint, thetype: TGLenum, - normalized: TGLboolean, stride: TGLsizei, - pointer: PGLvoid){.dynlib: dllname, - importc: "glVertexAttribPointerARB".} -proc glEnableVertexAttribArrayARB*(index: TGLuint){.dynlib: dllname, - importc: "glEnableVertexAttribArrayARB".} -proc glDisableVertexAttribArrayARB*(index: TGLuint){.dynlib: dllname, - importc: "glDisableVertexAttribArrayARB".} -proc glProgramStringARB*(target: TGLenum, format: TGLenum, length: TGLsizei, - str: PGLvoid){.dynlib: dllname, - importc: "glProgramStringARB".} -proc glBindProgramARB*(target: TGLenum, theProgram: TGLuint){.dynlib: dllname, - importc: "glBindProgramARB".} -proc glDeleteProgramsARB*(n: TGLsizei, programs: PGLuint){.dynlib: dllname, - importc: "glDeleteProgramsARB".} -proc glGenProgramsARB*(n: TGLsizei, programs: PGLuint){.dynlib: dllname, - importc: "glGenProgramsARB".} -proc glProgramEnvParameter4dARB*(target: TGLenum, index: TGLuint, x: TGLdouble, - y: TGLdouble, z: TGLdouble, w: TGLdouble){. - dynlib: dllname, importc: "glProgramEnvParameter4dARB".} -proc glProgramEnvParameter4dvARB*(target: TGLenum, index: TGLuint, - params: PGLdouble){.dynlib: dllname, - importc: "glProgramEnvParameter4dvARB".} -proc glProgramEnvParameter4fARB*(target: TGLenum, index: TGLuint, x: TGLfloat, - y: TGLfloat, z: TGLfloat, w: TGLfloat){. - dynlib: dllname, importc: "glProgramEnvParameter4fARB".} -proc glProgramEnvParameter4fvARB*(target: TGLenum, index: TGLuint, - params: PGLfloat){.dynlib: dllname, - importc: "glProgramEnvParameter4fvARB".} -proc glProgramLocalParameter4dARB*(target: TGLenum, index: TGLuint, - x: TGLdouble, y: TGLdouble, z: TGLdouble, - w: TGLdouble){.dynlib: dllname, - importc: "glProgramLocalParameter4dARB".} -proc glProgramLocalParameter4dvARB*(target: TGLenum, index: TGLuint, - params: PGLdouble){.dynlib: dllname, - importc: "glProgramLocalParameter4dvARB".} -proc glProgramLocalParameter4fARB*(target: TGLenum, index: TGLuint, x: TGLfloat, - y: TGLfloat, z: TGLfloat, w: TGLfloat){. - dynlib: dllname, importc: "glProgramLocalParameter4fARB".} -proc glProgramLocalParameter4fvARB*(target: TGLenum, index: TGLuint, - params: PGLfloat){.dynlib: dllname, - importc: "glProgramLocalParameter4fvARB".} -proc glGetProgramEnvParameterdvARB*(target: TGLenum, index: TGLuint, - params: PGLdouble){.dynlib: dllname, - importc: "glGetProgramEnvParameterdvARB".} -proc glGetProgramEnvParameterfvARB*(target: TGLenum, index: TGLuint, - params: PGLfloat){.dynlib: dllname, - importc: "glGetProgramEnvParameterfvARB".} -proc glGetProgramLocalParameterdvARB*(target: TGLenum, index: TGLuint, - params: PGLdouble){.dynlib: dllname, - importc: "glGetProgramLocalParameterdvARB".} -proc glGetProgramLocalParameterfvARB*(target: TGLenum, index: TGLuint, - params: PGLfloat){.dynlib: dllname, - importc: "glGetProgramLocalParameterfvARB".} -proc glGetProgramivARB*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetProgramivARB".} -proc glGetProgramStringARB*(target: TGLenum, pname: TGLenum, str: PGLvoid){. - dynlib: dllname, importc: "glGetProgramStringARB".} -proc glGetVertexAttribdvARB*(index: TGLuint, pname: TGLenum, params: PGLdouble){. - dynlib: dllname, importc: "glGetVertexAttribdvARB".} -proc glGetVertexAttribfvARB*(index: TGLuint, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetVertexAttribfvARB".} -proc glGetVertexAttribivARB*(index: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetVertexAttribivARB".} -proc glGetVertexAttribPointervARB*(index: TGLuint, pname: TGLenum, - pointer: PGLvoid){.dynlib: dllname, - importc: "glGetVertexAttribPointervARB".} -proc glIsProgramARB*(theProgram: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsProgramARB".} - #***** GL_ARB_window_pos *****// -proc glWindowPos2dARB*(x: TGLdouble, y: TGLdouble){.dynlib: dllname, - importc: "glWindowPos2dARB".} -proc glWindowPos2fARB*(x: TGLfloat, y: TGLfloat){.dynlib: dllname, - importc: "glWindowPos2fARB".} -proc glWindowPos2iARB*(x: TGLint, y: TGLint){.dynlib: dllname, - importc: "glWindowPos2iARB".} -proc glWindowPos2sARB*(x: TGLshort, y: TGLshort){.dynlib: dllname, - importc: "glWindowPos2sARB".} -proc glWindowPos2dvARB*(p: PGLdouble){.dynlib: dllname, - importc: "glWindowPos2dvARB".} -proc glWindowPos2fvARB*(p: PGLfloat){.dynlib: dllname, - importc: "glWindowPos2fvARB".} -proc glWindowPos2ivARB*(p: PGLint){.dynlib: dllname, - importc: "glWindowPos2ivARB".} -proc glWindowPos2svARB*(p: PGLshort){.dynlib: dllname, - importc: "glWindowPos2svARB".} -proc glWindowPos3dARB*(x: TGLdouble, y: TGLdouble, z: TGLdouble){. - dynlib: dllname, importc: "glWindowPos3dARB".} -proc glWindowPos3fARB*(x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, - importc: "glWindowPos3fARB".} -proc glWindowPos3iARB*(x: TGLint, y: TGLint, z: TGLint){.dynlib: dllname, - importc: "glWindowPos3iARB".} -proc glWindowPos3sARB*(x: TGLshort, y: TGLshort, z: TGLshort){.dynlib: dllname, - importc: "glWindowPos3sARB".} -proc glWindowPos3dvARB*(p: PGLdouble){.dynlib: dllname, - importc: "glWindowPos3dvARB".} -proc glWindowPos3fvARB*(p: PGLfloat){.dynlib: dllname, - importc: "glWindowPos3fvARB".} -proc glWindowPos3ivARB*(p: PGLint){.dynlib: dllname, - importc: "glWindowPos3ivARB".} -proc glWindowPos3svARB*(p: PGLshort){.dynlib: dllname, - importc: "glWindowPos3svARB".} -proc glBlendEquationSeparate*(modeRGB: TGLenum, modeAlpha: TGLenum){. - dynlib: dllname, importc: "glBlendEquationSeparate".} -proc glDrawBuffers*(n: TGLsizei, bufs: PGLenum){.dynlib: dllname, - importc: "glDrawBuffers".} -proc glStencilOpSeparate*(face: TGLenum, sfail: TGLenum, dpfail: TGLenum, - dppass: TGLenum){.dynlib: dllname, - importc: "glStencilOpSeparate".} -proc glStencilFuncSeparate*(frontfunc: TGLenum, backfunc: TGLenum, - theRef: TGLint, mask: TGLuint){.dynlib: dllname, - importc: "glStencilFuncSeparate".} -proc glStencilMaskSeparate*(face: TGLenum, mask: TGLuint){.dynlib: dllname, - importc: "glStencilMaskSeparate".} -proc glAttachShader*(theProgram: TGLuint, shader: TGLuint){.dynlib: dllname, - importc: "glAttachShader".} -proc glBindAttribLocation*(theProgram: TGLuint, index: TGLuint, name: PGLchar){. - dynlib: dllname, importc: "glBindAttribLocation".} -proc glCompileShader*(shader: TGLuint){.dynlib: dllname, - importc: "glCompileShader".} -proc glCreateProgram*(): TGLuint{.dynlib: dllname, importc: "glCreateProgram".} -proc glCreateShader*(thetype: TGLenum): TGLuint{.dynlib: dllname, - importc: "glCreateShader".} -proc glDeleteProgram*(theProgram: TGLuint){.dynlib: dllname, - importc: "glDeleteProgram".} -proc glDeleteShader*(shader: TGLuint){.dynlib: dllname, - importc: "glDeleteShader".} -proc glDetachShader*(theProgram: TGLuint, shader: TGLuint){.dynlib: dllname, - importc: "glDetachShader".} -proc glDisableVertexAttribArray*(index: TGLuint){.dynlib: dllname, - importc: "glDisableVertexAttribArray".} -proc glEnableVertexAttribArray*(index: TGLuint){.dynlib: dllname, - importc: "glEnableVertexAttribArray".} -proc glGetActiveAttrib*(theProgram: TGLuint, index: TGLuint, bufSize: TGLsizei, - len: PGLsizei, size: PGLint, thetype: PGLenum, - name: PGLchar){.dynlib: dllname, - importc: "glGetActiveAttrib".} -proc glGetActiveUniform*(theProgram: TGLuint, index: TGLuint, bufSize: TGLsizei, - len: PGLsizei, size: PGLint, thetype: PGLenum, - name: PGLchar){.dynlib: dllname, - importc: "glGetActiveUniform".} -proc glGetAttachedShaders*(theProgram: TGLuint, maxCount: TGLsizei, - count: PGLsizei, obj: PGLuint){.dynlib: dllname, - importc: "glGetAttachedShaders".} -proc glGetAttribLocation*(theProgram: TGLuint, name: PGLchar): TGLint{. - dynlib: dllname, importc: "glGetAttribLocation".} -proc glGetProgramiv*(theProgram: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetProgramiv".} -proc glGetProgramInfoLog*(theProgram: TGLuint, bufSize: TGLsizei, len: PGLsizei, - infoLog: PGLchar){.dynlib: dllname, - importc: "glGetProgramInfoLog".} -proc glGetShaderiv*(shader: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetShaderiv".} -proc glGetShaderInfoLog*(shader: TGLuint, bufSize: TGLsizei, len: PGLsizei, - infoLog: PGLchar){.dynlib: dllname, - importc: "glGetShaderInfoLog".} -proc glGetShaderSource*(shader: TGLuint, bufSize: TGLsizei, len: PGLsizei, - source: PGLchar){.dynlib: dllname, - importc: "glGetShaderSource".} -proc glGetUniformLocation*(theProgram: TGLuint, name: PGLchar): TGLint{. - dynlib: dllname, importc: "glGetUniformLocation".} -proc glGetUniformfv*(theProgram: TGLuint, location: TGLint, params: PGLfloat){. - dynlib: dllname, importc: "glGetUniformfv".} -proc glGetUniformiv*(theProgram: TGLuint, location: TGLint, params: PGLint){. - dynlib: dllname, importc: "glGetUniformiv".} -proc glGetVertexAttribdv*(index: TGLuint, pname: TGLenum, params: PGLdouble){. - dynlib: dllname, importc: "glGetVertexAttribdv".} -proc glGetVertexAttribfv*(index: TGLuint, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetVertexAttribfv".} -proc glGetVertexAttribiv*(index: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetVertexAttribiv".} -proc glGetVertexAttribPointerv*(index: TGLuint, pname: TGLenum, pointer: PGLvoid){. - dynlib: dllname, importc: "glGetVertexAttribPointerv".} -proc glIsProgram*(theProgram: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsProgram".} -proc glIsShader*(shader: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsShader".} -proc glLinkProgram*(theProgram: TGLuint){.dynlib: dllname, - importc: "glLinkProgram".} -proc glShaderSource*(shader: TGLuint, count: TGLsizei, str: PGLchar, len: PGLint){. - dynlib: dllname, importc: "glShaderSource".} -proc glUseProgram*(theProgram: TGLuint){.dynlib: dllname, - importc: "glUseProgram".} -proc glUniform1f*(location: TGLint, v0: TGLfloat){.dynlib: dllname, - importc: "glUniform1f".} -proc glUniform2f*(location: TGLint, v0: TGLfloat, v1: TGLfloat){. - dynlib: dllname, importc: "glUniform2f".} -proc glUniform3f*(location: TGLint, v0: TGLfloat, v1: TGLfloat, v2: TGLfloat){. - dynlib: dllname, importc: "glUniform3f".} -proc glUniform4f*(location: TGLint, v0: TGLfloat, v1: TGLfloat, v2: TGLfloat, - v3: TGLfloat){.dynlib: dllname, importc: "glUniform4f".} -proc glUniform1i*(location: TGLint, v0: TGLint){.dynlib: dllname, - importc: "glUniform1i".} -proc glUniform2i*(location: TGLint, v0: TGLint, v1: TGLint){.dynlib: dllname, - importc: "glUniform2i".} -proc glUniform3i*(location: TGLint, v0: TGLint, v1: TGLint, v2: TGLint){. - dynlib: dllname, importc: "glUniform3i".} -proc glUniform4i*(location: TGLint, v0: TGLint, v1: TGLint, v2: TGLint, - v3: TGLint){.dynlib: dllname, importc: "glUniform4i".} -proc glUniform1fv*(location: TGLint, count: TGLsizei, value: PGLfloat){. - dynlib: dllname, importc: "glUniform1fv".} -proc glUniform2fv*(location: TGLint, count: TGLsizei, value: PGLfloat){. - dynlib: dllname, importc: "glUniform2fv".} -proc glUniform3fv*(location: TGLint, count: TGLsizei, value: PGLfloat){. - dynlib: dllname, importc: "glUniform3fv".} -proc glUniform4fv*(location: TGLint, count: TGLsizei, value: PGLfloat){. - dynlib: dllname, importc: "glUniform4fv".} -proc glUniform1iv*(location: TGLint, count: TGLsizei, value: PGLint){. - dynlib: dllname, importc: "glUniform1iv".} -proc glUniform2iv*(location: TGLint, count: TGLsizei, value: PGLint){. - dynlib: dllname, importc: "glUniform2iv".} -proc glUniform3iv*(location: TGLint, count: TGLsizei, value: PGLint){. - dynlib: dllname, importc: "glUniform3iv".} -proc glUniform4iv*(location: TGLint, count: TGLsizei, value: PGLint){. - dynlib: dllname, importc: "glUniform4iv".} -proc glUniformMatrix2fv*(location: TGLint, count: TGLsizei, - transpose: TGLboolean, value: PGLfloat){. - dynlib: dllname, importc: "glUniformMatrix2fv".} -proc glUniformMatrix3fv*(location: TGLint, count: TGLsizei, - transpose: TGLboolean, value: PGLfloat){. - dynlib: dllname, importc: "glUniformMatrix3fv".} -proc glUniformMatrix4fv*(location: TGLint, count: TGLsizei, - transpose: TGLboolean, value: PGLfloat){. - dynlib: dllname, importc: "glUniformMatrix4fv".} -proc glValidateProgram*(theProgram: TGLuint){.dynlib: dllname, - importc: "glValidateProgram".} -proc glVertexAttrib1d*(index: TGLuint, x: TGLdouble){.dynlib: dllname, - importc: "glVertexAttrib1d".} -proc glVertexAttrib1dv*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib1dv".} -proc glVertexAttrib1f*(index: TGLuint, x: TGLfloat){.dynlib: dllname, - importc: "glVertexAttrib1f".} -proc glVertexAttrib1fv*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib1fv".} -proc glVertexAttrib1s*(index: TGLuint, x: TGLshort){.dynlib: dllname, - importc: "glVertexAttrib1s".} -proc glVertexAttrib1sv*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib1sv".} -proc glVertexAttrib2d*(index: TGLuint, x: TGLdouble, y: TGLdouble){. - dynlib: dllname, importc: "glVertexAttrib2d".} -proc glVertexAttrib2dv*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib2dv".} -proc glVertexAttrib2f*(index: TGLuint, x: TGLfloat, y: TGLfloat){. - dynlib: dllname, importc: "glVertexAttrib2f".} -proc glVertexAttrib2fv*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib2fv".} -proc glVertexAttrib2s*(index: TGLuint, x: TGLshort, y: TGLshort){. - dynlib: dllname, importc: "glVertexAttrib2s".} -proc glVertexAttrib2sv*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib2sv".} -proc glVertexAttrib3d*(index: TGLuint, x: TGLdouble, y: TGLdouble, z: TGLdouble){. - dynlib: dllname, importc: "glVertexAttrib3d".} -proc glVertexAttrib3dv*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib3dv".} -proc glVertexAttrib3f*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glVertexAttrib3f".} -proc glVertexAttrib3fv*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib3fv".} -proc glVertexAttrib3s*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort){. - dynlib: dllname, importc: "glVertexAttrib3s".} -proc glVertexAttrib3sv*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib3sv".} -proc glVertexAttrib4Nbv*(index: TGLuint, v: PGLbyte){.dynlib: dllname, - importc: "glVertexAttrib4Nbv".} -proc glVertexAttrib4Niv*(index: TGLuint, v: PGLint){.dynlib: dllname, - importc: "glVertexAttrib4Niv".} -proc glVertexAttrib4Nsv*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib4Nsv".} -proc glVertexAttrib4Nub*(index: TGLuint, x: TGLubyte, y: TGLubyte, z: TGLubyte, - w: TGLubyte){.dynlib: dllname, - importc: "glVertexAttrib4Nub".} -proc glVertexAttrib4Nubv*(index: TGLuint, v: PGLubyte){.dynlib: dllname, - importc: "glVertexAttrib4Nubv".} -proc glVertexAttrib4Nuiv*(index: TGLuint, v: PGLuint){.dynlib: dllname, - importc: "glVertexAttrib4Nuiv".} -proc glVertexAttrib4Nusv*(index: TGLuint, v: PGLushort){.dynlib: dllname, - importc: "glVertexAttrib4Nusv".} -proc glVertexAttrib4bv*(index: TGLuint, v: PGLbyte){.dynlib: dllname, - importc: "glVertexAttrib4bv".} -proc glVertexAttrib4d*(index: TGLuint, x: TGLdouble, y: TGLdouble, z: TGLdouble, - w: TGLdouble){.dynlib: dllname, - importc: "glVertexAttrib4d".} -proc glVertexAttrib4dv*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib4dv".} -proc glVertexAttrib4f*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat, - w: TGLfloat){.dynlib: dllname, - importc: "glVertexAttrib4f".} -proc glVertexAttrib4fv*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib4fv".} -proc glVertexAttrib4iv*(index: TGLuint, v: PGLint){.dynlib: dllname, - importc: "glVertexAttrib4iv".} -proc glVertexAttrib4s*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort, - w: TGLshort){.dynlib: dllname, - importc: "glVertexAttrib4s".} -proc glVertexAttrib4sv*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib4sv".} -proc glVertexAttrib4ubv*(index: TGLuint, v: PGLubyte){.dynlib: dllname, - importc: "glVertexAttrib4ubv".} -proc glVertexAttrib4uiv*(index: TGLuint, v: PGLuint){.dynlib: dllname, - importc: "glVertexAttrib4uiv".} -proc glVertexAttrib4usv*(index: TGLuint, v: PGLushort){.dynlib: dllname, - importc: "glVertexAttrib4usv".} -proc glVertexAttribPointer*(index: TGLuint, size: TGLint, thetype: TGLenum, - normalized: TGLboolean, stride: TGLsizei, - pointer: PGLvoid){.dynlib: dllname, - importc: "glVertexAttribPointer".} -const - GL_CONSTANT_COLOR* = 0x00008001 - GL_ONE_MINUS_CONSTANT_COLOR* = 0x00008002 - GL_CONSTANT_ALPHA* = 0x00008003 - GL_ONE_MINUS_CONSTANT_ALPHA* = 0x00008004 - constGL_BLEND_COLOR* = 0x00008005 - GL_FUNC_ADD* = 0x00008006 - GL_MIN* = 0x00008007 - GL_MAX* = 0x00008008 - constGL_BLEND_EQUATION* = 0x00008009 - GL_FUNC_SUBTRACT* = 0x0000800A - GL_FUNC_REVERSE_SUBTRACT* = 0x0000800B - GL_CONVOLUTION_1D* = 0x00008010 - GL_CONVOLUTION_2D* = 0x00008011 - GL_SEPARABLE_2D* = 0x00008012 - GL_CONVOLUTION_BORDER_MODE* = 0x00008013 - GL_CONVOLUTION_FILTER_SCALE* = 0x00008014 - GL_CONVOLUTION_FILTER_BIAS* = 0x00008015 - GL_REDUCE* = 0x00008016 - GL_CONVOLUTION_FORMAT* = 0x00008017 - GL_CONVOLUTION_WIDTH* = 0x00008018 - GL_CONVOLUTION_HEIGHT* = 0x00008019 - GL_MAX_CONVOLUTION_WIDTH* = 0x0000801A - GL_MAX_CONVOLUTION_HEIGHT* = 0x0000801B - GL_POST_CONVOLUTION_RED_SCALE* = 0x0000801C - GL_POST_CONVOLUTION_GREEN_SCALE* = 0x0000801D - GL_POST_CONVOLUTION_BLUE_SCALE* = 0x0000801E - GL_POST_CONVOLUTION_ALPHA_SCALE* = 0x0000801F - GL_POST_CONVOLUTION_RED_BIAS* = 0x00008020 - GL_POST_CONVOLUTION_GREEN_BIAS* = 0x00008021 - GL_POST_CONVOLUTION_BLUE_BIAS* = 0x00008022 - GL_POST_CONVOLUTION_ALPHA_BIAS* = 0x00008023 - constGL_HISTOGRAM* = 0x00008024 - GL_PROXY_HISTOGRAM* = 0x00008025 - GL_HISTOGRAM_WIDTH* = 0x00008026 - GL_HISTOGRAM_FORMAT* = 0x00008027 - GL_HISTOGRAM_RED_SIZE* = 0x00008028 - GL_HISTOGRAM_GREEN_SIZE* = 0x00008029 - GL_HISTOGRAM_BLUE_SIZE* = 0x0000802A - GL_HISTOGRAM_ALPHA_SIZE* = 0x0000802B - GL_HISTOGRAM_LUMINANCE_SIZE* = 0x0000802C - GL_HISTOGRAM_SINK* = 0x0000802D - constGL_MINMAX* = 0x0000802E - GL_MINMAX_FORMAT* = 0x0000802F - GL_MINMAX_SINK* = 0x00008030 - GL_TABLE_TOO_LARGE* = 0x00008031 - GL_COLOR_MATRIX* = 0x000080B1 - GL_COLOR_MATRIX_STACK_DEPTH* = 0x000080B2 - GL_MAX_COLOR_MATRIX_STACK_DEPTH* = 0x000080B3 - GL_POST_COLOR_MATRIX_RED_SCALE* = 0x000080B4 - GL_POST_COLOR_MATRIX_GREEN_SCALE* = 0x000080B5 - GL_POST_COLOR_MATRIX_BLUE_SCALE* = 0x000080B6 - GL_POST_COLOR_MATRIX_ALPHA_SCALE* = 0x000080B7 - GL_POST_COLOR_MATRIX_RED_BIAS* = 0x000080B8 - GL_POST_COLOR_MATRIX_GREEN_BIAS* = 0x000080B9 - GL_POST_COLOR_MATRIX_BLUE_BIAS* = 0x000080BA - GL_POST_COLOR_MATIX_ALPHA_BIAS* = 0x000080BB - constGL_COLOR_TABLE* = 0x000080D0 - GL_POST_CONVOLUTION_COLOR_TABLE* = 0x000080D1 - GL_POST_COLOR_MATRIX_COLOR_TABLE* = 0x000080D2 - GL_PROXY_COLOR_TABLE* = 0x000080D3 - GL_PROXY_POST_CONVOLUTION_COLOR_TABLE* = 0x000080D4 - GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE* = 0x000080D5 - GL_COLOR_TABLE_SCALE* = 0x000080D6 - GL_COLOR_TABLE_BIAS* = 0x000080D7 - GL_COLOR_TABLE_FORMAT* = 0x000080D8 - GL_COLOR_TABLE_WIDTH* = 0x000080D9 - GL_COLOR_TABLE_RED_SIZE* = 0x000080DA - GL_COLOR_TABLE_GREEN_SIZE* = 0x000080DB - GL_COLOR_TABLE_BLUE_SIZE* = 0x000080DC - GL_COLOR_TABLE_ALPHA_SIZE* = 0x000080DD - GL_COLOR_TABLE_LUMINANCE_SIZE* = 0x000080DE - GL_COLOR_TABLE_INTENSITY_SIZE* = 0x000080DF - GL_IGNORE_BORDER* = 0x00008150 - GL_CONSTANT_BORDER* = 0x00008151 - GL_WRAP_BORDER* = 0x00008152 - GL_REPLICATE_BORDER* = 0x00008153 - GL_CONVOLUTION_BORDER_COLOR* = 0x00008154 - -proc glActiveTexture*(texture: TGLenum){.dynlib: dllname, - importc: "glActiveTexture".} -proc glClientActiveTexture*(texture: TGLenum){.dynlib: dllname, - importc: "glClientActiveTexture".} -proc glMultiTexCoord1d*(target: TGLenum, s: TGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord1d".} -proc glMultiTexCoord1dv*(target: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord1dv".} -proc glMultiTexCoord1f*(target: TGLenum, s: TGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord1f".} -proc glMultiTexCoord1fv*(target: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord1fv".} -proc glMultiTexCoord1i*(target: TGLenum, s: TGLint){.dynlib: dllname, - importc: "glMultiTexCoord1i".} -proc glMultiTexCoord1iv*(target: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glMultiTexCoord1iv".} -proc glMultiTexCoord1s*(target: TGLenum, s: TGLshort){.dynlib: dllname, - importc: "glMultiTexCoord1s".} -proc glMultiTexCoord1sv*(target: TGLenum, v: PGLshort){.dynlib: dllname, - importc: "glMultiTexCoord1sv".} -proc glMultiTexCoord2d*(target: TGLenum, s: TGLdouble, t: TGLdouble){. - dynlib: dllname, importc: "glMultiTexCoord2d".} -proc glMultiTexCoord2dv*(target: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord2dv".} -proc glMultiTexCoord2f*(target: TGLenum, s: TGLfloat, t: TGLfloat){. - dynlib: dllname, importc: "glMultiTexCoord2f".} -proc glMultiTexCoord2fv*(target: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord2fv".} -proc glMultiTexCoord2i*(target: TGLenum, s: TGLint, t: TGLint){.dynlib: dllname, - importc: "glMultiTexCoord2i".} -proc glMultiTexCoord2iv*(target: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glMultiTexCoord2iv".} -proc glMultiTexCoord2s*(target: TGLenum, s: TGLshort, t: TGLshort){. - dynlib: dllname, importc: "glMultiTexCoord2s".} -proc glMultiTexCoord2sv*(target: TGLenum, v: PGLshort){.dynlib: dllname, - importc: "glMultiTexCoord2sv".} -proc glMultiTexCoord3d*(target: TGLenum, s: TGLdouble, t: TGLdouble, - r: TGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord3d".} -proc glMultiTexCoord3dv*(target: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord3dv".} -proc glMultiTexCoord3f*(target: TGLenum, s: TGLfloat, t: TGLfloat, r: TGLfloat){. - dynlib: dllname, importc: "glMultiTexCoord3f".} -proc glMultiTexCoord3fv*(target: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord3fv".} -proc glMultiTexCoord3i*(target: TGLenum, s: TGLint, t: TGLint, r: TGLint){. - dynlib: dllname, importc: "glMultiTexCoord3i".} -proc glMultiTexCoord3iv*(target: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glMultiTexCoord3iv".} -proc glMultiTexCoord3s*(target: TGLenum, s: TGLshort, t: TGLshort, r: TGLshort){. - dynlib: dllname, importc: "glMultiTexCoord3s".} -proc glMultiTexCoord3sv*(target: TGLenum, v: PGLshort){.dynlib: dllname, - importc: "glMultiTexCoord3sv".} -proc glMultiTexCoord4d*(target: TGLenum, s: TGLdouble, t: TGLdouble, - r: TGLdouble, q: TGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord4d".} -proc glMultiTexCoord4dv*(target: TGLenum, v: PGLdouble){.dynlib: dllname, - importc: "glMultiTexCoord4dv".} -proc glMultiTexCoord4f*(target: TGLenum, s: TGLfloat, t: TGLfloat, r: TGLfloat, - q: TGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord4f".} -proc glMultiTexCoord4fv*(target: TGLenum, v: PGLfloat){.dynlib: dllname, - importc: "glMultiTexCoord4fv".} -proc glMultiTexCoord4i*(target: TGLenum, s: TGLint, t: TGLint, r: TGLint, - q: TGLint){.dynlib: dllname, - importc: "glMultiTexCoord4i".} -proc glMultiTexCoord4iv*(target: TGLenum, v: PGLint){.dynlib: dllname, - importc: "glMultiTexCoord4iv".} -proc glMultiTexCoord4s*(target: TGLenum, s: TGLshort, t: TGLshort, r: TGLshort, - q: TGLshort){.dynlib: dllname, - importc: "glMultiTexCoord4s".} -proc glMultiTexCoord4sv*(target: TGLenum, v: PGLshort){.dynlib: dllname, - importc: "glMultiTexCoord4sv".} -proc glLoadTransposeMatrixf*(m: PGLfloat){.dynlib: dllname, - importc: "glLoadTransposeMatrixf".} -proc glLoadTransposeMatrixd*(m: PGLdouble){.dynlib: dllname, - importc: "glLoadTransposeMatrixd".} -proc glMultTransposeMatrixf*(m: PGLfloat){.dynlib: dllname, - importc: "glMultTransposeMatrixf".} -proc glMultTransposeMatrixd*(m: PGLdouble){.dynlib: dllname, - importc: "glMultTransposeMatrixd".} -proc glSampleCoverage*(value: TGLclampf, invert: TGLboolean){.dynlib: dllname, - importc: "glSampleCoverage".} -proc glCompressedTexImage3D*(target: TGLenum, level: TGLint, - internalformat: TGLenum, width: TGLsizei, - height: TGLsizei, depth: TGLsizei, border: TGLint, - imageSize: TGLsizei, data: PGLvoid){. - dynlib: dllname, importc: "glCompressedTexImage3D".} -proc glCompressedTexImage2D*(target: TGLenum, level: TGLint, - internalformat: TGLenum, width: TGLsizei, - height: TGLsizei, border: TGLint, - imageSize: TGLsizei, data: PGLvoid){. - dynlib: dllname, importc: "glCompressedTexImage2D".} -proc glCompressedTexImage1D*(target: TGLenum, level: TGLint, - internalformat: TGLenum, width: TGLsizei, - border: TGLint, imageSize: TGLsizei, data: PGLvoid){. - dynlib: dllname, importc: "glCompressedTexImage1D".} -proc glCompressedTexSubImage3D*(target: TGLenum, level: TGLint, xoffset: TGLint, - yoffset: TGLint, zoffset: TGLint, - width: TGLsizei, height: TGLsizei, - depth: TGLsizei, format: TGLenum, - imageSize: TGLsizei, data: PGLvoid){. - dynlib: dllname, importc: "glCompressedTexSubImage3D".} -proc glCompressedTexSubImage2D*(target: TGLenum, level: TGLint, xoffset: TGLint, - yoffset: TGLint, width: TGLsizei, - height: TGLsizei, format: TGLenum, - imageSize: TGLsizei, data: PGLvoid){. - dynlib: dllname, importc: "glCompressedTexSubImage2D".} -proc glCompressedTexSubImage1D*(target: TGLenum, level: TGLint, xoffset: TGLint, - width: TGLsizei, format: TGLenum, - imageSize: TGLsizei, data: PGLvoid){. - dynlib: dllname, importc: "glCompressedTexSubImage1D".} -proc glGetCompressedTexImage*(target: TGLenum, level: TGLint, img: PGLvoid){. - dynlib: dllname, importc: "glGetCompressedTexImage".} - #***** GL_version_1_3 *****// -const - GL_TEXTURE0* = 0x000084C0 - GL_TEXTURE1* = 0x000084C1 - GL_TEXTURE2* = 0x000084C2 - GL_TEXTURE3* = 0x000084C3 - GL_TEXTURE4* = 0x000084C4 - GL_TEXTURE5* = 0x000084C5 - GL_TEXTURE6* = 0x000084C6 - GL_TEXTURE7* = 0x000084C7 - GL_TEXTURE8* = 0x000084C8 - GL_TEXTURE9* = 0x000084C9 - GL_TEXTURE10* = 0x000084CA - GL_TEXTURE11* = 0x000084CB - GL_TEXTURE12* = 0x000084CC - GL_TEXTURE13* = 0x000084CD - GL_TEXTURE14* = 0x000084CE - GL_TEXTURE15* = 0x000084CF - GL_TEXTURE16* = 0x000084D0 - GL_TEXTURE17* = 0x000084D1 - GL_TEXTURE18* = 0x000084D2 - GL_TEXTURE19* = 0x000084D3 - GL_TEXTURE20* = 0x000084D4 - GL_TEXTURE21* = 0x000084D5 - GL_TEXTURE22* = 0x000084D6 - GL_TEXTURE23* = 0x000084D7 - GL_TEXTURE24* = 0x000084D8 - GL_TEXTURE25* = 0x000084D9 - GL_TEXTURE26* = 0x000084DA - GL_TEXTURE27* = 0x000084DB - GL_TEXTURE28* = 0x000084DC - GL_TEXTURE29* = 0x000084DD - GL_TEXTURE30* = 0x000084DE - GL_TEXTURE31* = 0x000084DF - constGL_ACTIVE_TEXTURE* = 0x000084E0 - constGL_CLIENT_ACTIVE_TEXTURE* = 0x000084E1 - GL_MAX_TEXTURE_UNITS* = 0x000084E2 - GL_TRANSPOSE_MODELVIEW_MATRIX* = 0x000084E3 - GL_TRANSPOSE_PROJECTION_MATRIX* = 0x000084E4 - GL_TRANSPOSE_TEXTURE_MATRIX* = 0x000084E5 - GL_TRANSPOSE_COLOR_MATRIX* = 0x000084E6 - GL_MULTISAMPLE* = 0x0000809D - GL_SAMPLE_ALPHA_TO_COVERAGE* = 0x0000809E - GL_SAMPLE_ALPHA_TO_ONE* = 0x0000809F - constGL_SAMPLE_COVERAGE* = 0x000080A0 - GL_SAMPLE_BUFFERS* = 0x000080A8 - GL_SAMPLES* = 0x000080A9 - GL_SAMPLE_COVERAGE_VALUE* = 0x000080AA - GL_SAMPLE_COVERAGE_INVERT* = 0x000080AB - GL_MULTISAMPLE_BIT* = 0x20000000 - GL_NORMAL_MAP* = 0x00008511 - GL_REFLECTION_MAP* = 0x00008512 - GL_TEXTURE_CUBE_MAP* = 0x00008513 - GL_TEXTURE_BINDING_CUBE_MAP* = 0x00008514 - GL_TEXTURE_CUBE_MAP_POSITIVE_X* = 0x00008515 - GL_TEXTURE_CUBE_MAP_NEGATIVE_X* = 0x00008516 - GL_TEXTURE_CUBE_MAP_POSITIVE_Y* = 0x00008517 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y* = 0x00008518 - GL_TEXTURE_CUBE_MAP_POSITIVE_Z* = 0x00008519 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z* = 0x0000851A - GL_PROXY_TEXTURE_CUBE_MAP* = 0x0000851B - GL_MAX_CUBE_MAP_TEXTURE_SIZE* = 0x0000851C - GL_COMPRESSED_ALPHA* = 0x000084E9 - GL_COMPRESSED_LUMINANCE* = 0x000084EA - GL_COMPRESSED_LUMINANCE_ALPHA* = 0x000084EB - GL_COMPRESSED_INTENSITY* = 0x000084EC - GL_COMPRESSED_RGB* = 0x000084ED - GL_COMPRESSED_RGBA* = 0x000084EE - GL_TEXTURE_COMPRESSION_HINT* = 0x000084EF - GL_TEXTURE_COMPRESSED_IMAGE_SIZE* = 0x000086A0 - GL_TEXTURE_COMPRESSED* = 0x000086A1 - GL_NUM_COMPRESSED_TEXTURE_FORMATS* = 0x000086A2 - GL_COMPRESSED_TEXTURE_FORMATS* = 0x000086A3 - GL_CLAMP_TO_BORDER* = 0x0000812D - GL_CLAMP_TO_BORDER_SGIS* = 0x0000812D - GL_COMBINE* = 0x00008570 - GL_COMBINE_RGB* = 0x00008571 - GL_COMBINE_ALPHA* = 0x00008572 - GL_SOURCE0_RGB* = 0x00008580 - GL_SOURCE1_RGB* = 0x00008581 - GL_SOURCE2_RGB* = 0x00008582 - GL_SOURCE0_ALPHA* = 0x00008588 - GL_SOURCE1_ALPHA* = 0x00008589 - GL_SOURCE2_ALPHA* = 0x0000858A - GL_OPERAND0_RGB* = 0x00008590 - GL_OPERAND1_RGB* = 0x00008591 - GL_OPERAND2_RGB* = 0x00008592 - GL_OPERAND0_ALPHA* = 0x00008598 - GL_OPERAND1_ALPHA* = 0x00008599 - GL_OPERAND2_ALPHA* = 0x0000859A - GL_RGB_SCALE* = 0x00008573 - GL_ADD_SIGNED* = 0x00008574 - GL_INTERPOLATE* = 0x00008575 - GL_SUBTRACT* = 0x000084E7 - GL_CONSTANT* = 0x00008576 - GL_PRIMARY_COLOR* = 0x00008577 - GL_PREVIOUS* = 0x00008578 - GL_DOT3_RGB* = 0x000086AE - GL_DOT3_RGBA* = 0x000086AF - -const - GL_TEXTURE0_ARB* = 0x000084C0 - GL_TEXTURE1_ARB* = 0x000084C1 - GL_TEXTURE2_ARB* = 0x000084C2 - GL_TEXTURE3_ARB* = 0x000084C3 - GL_TEXTURE4_ARB* = 0x000084C4 - GL_TEXTURE5_ARB* = 0x000084C5 - GL_TEXTURE6_ARB* = 0x000084C6 - GL_TEXTURE7_ARB* = 0x000084C7 - GL_TEXTURE8_ARB* = 0x000084C8 - GL_TEXTURE9_ARB* = 0x000084C9 - GL_TEXTURE10_ARB* = 0x000084CA - GL_TEXTURE11_ARB* = 0x000084CB - GL_TEXTURE12_ARB* = 0x000084CC - GL_TEXTURE13_ARB* = 0x000084CD - GL_TEXTURE14_ARB* = 0x000084CE - GL_TEXTURE15_ARB* = 0x000084CF - GL_TEXTURE16_ARB* = 0x000084D0 - GL_TEXTURE17_ARB* = 0x000084D1 - GL_TEXTURE18_ARB* = 0x000084D2 - GL_TEXTURE19_ARB* = 0x000084D3 - GL_TEXTURE20_ARB* = 0x000084D4 - GL_TEXTURE21_ARB* = 0x000084D5 - GL_TEXTURE22_ARB* = 0x000084D6 - GL_TEXTURE23_ARB* = 0x000084D7 - GL_TEXTURE24_ARB* = 0x000084D8 - GL_TEXTURE25_ARB* = 0x000084D9 - GL_TEXTURE26_ARB* = 0x000084DA - GL_TEXTURE27_ARB* = 0x000084DB - GL_TEXTURE28_ARB* = 0x000084DC - GL_TEXTURE29_ARB* = 0x000084DD - GL_TEXTURE30_ARB* = 0x000084DE - GL_TEXTURE31_ARB* = 0x000084DF - constGL_ACTIVE_TEXTURE_ARB* = 0x000084E0 - constGL_CLIENT_ACTIVE_TEXTURE_ARB* = 0x000084E1 - GL_MAX_TEXTURE_UNITS_ARB* = 0x000084E2 - #***** GL_ARB_transpose_matrix *****// - -const - GL_TRANSPOSE_MODELVIEW_MATRIX_ARB* = 0x000084E3 - GL_TRANSPOSE_PROJECTION_MATRIX_ARB* = 0x000084E4 - GL_TRANSPOSE_TEXTURE_MATRIX_ARB* = 0x000084E5 - GL_TRANSPOSE_COLOR_MATRIX_ARB* = 0x000084E6 - -proc glLoadTransposeMatrixfARB*(m: PGLfloat){.dynlib: dllname, - importc: "glLoadTransposeMatrixfARB".} -proc glLoadTransposeMatrixdARB*(m: PGLdouble){.dynlib: dllname, - importc: "glLoadTransposeMatrixdARB".} -proc glMultTransposeMatrixfARB*(m: PGLfloat){.dynlib: dllname, - importc: "glMultTransposeMatrixfARB".} -proc glMultTransposeMatrixdARB*(m: PGLdouble){.dynlib: dllname, - importc: "glMultTransposeMatrixdARB".} -const - WGL_SAMPLE_BUFFERS_ARB* = 0x00002041 - WGL_SAMPLES_ARB* = 0x00002042 - GL_MULTISAMPLE_ARB* = 0x0000809D - GL_SAMPLE_ALPHA_TO_COVERAGE_ARB* = 0x0000809E - GL_SAMPLE_ALPHA_TO_ONE_ARB* = 0x0000809F - constGL_SAMPLE_COVERAGE_ARB* = 0x000080A0 - GL_MULTISAMPLE_BIT_ARB* = 0x20000000 - GL_SAMPLE_BUFFERS_ARB* = 0x000080A8 - GL_SAMPLES_ARB* = 0x000080A9 - GL_SAMPLE_COVERAGE_VALUE_ARB* = 0x000080AA - GL_SAMPLE_COVERAGE_INVERT_ARB* = 0x000080AB - -const - GL_NORMAL_MAP_ARB* = 0x00008511 - GL_REFLECTION_MAP_ARB* = 0x00008512 - GL_TEXTURE_CUBE_MAP_ARB* = 0x00008513 - GL_TEXTURE_BINDING_CUBE_MAP_ARB* = 0x00008514 - GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB* = 0x00008515 - GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB* = 0x00008516 - GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB* = 0x00008517 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB* = 0x00008518 - GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB* = 0x00008519 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB* = 0x0000851A - GL_PROXY_TEXTURE_CUBE_MAP_ARB* = 0x0000851B - GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB* = 0x0000851C - -const - GL_DEPTH_COMPONENT16_ARB* = 0x000081A5 - GL_DEPTH_COMPONENT24_ARB* = 0x000081A6 - GL_DEPTH_COMPONENT32_ARB* = 0x000081A7 - GL_TEXTURE_DEPTH_SIZE_ARB* = 0x0000884A - GL_DEPTH_TEXTURE_MODE_ARB* = 0x0000884B - #***** GL_ARB_point_parameters *****// - -const - GL_POINT_SIZE_MIN_ARB* = 0x00008126 - GL_POINT_SIZE_MAX_ARB* = 0x00008127 - GL_POINT_FADE_THRESHOLD_SIZE_ARB* = 0x00008128 - GL_POINT_DISTANCE_ATTENUATION_ARB* = 0x00008129 - -proc glPointParameterfARB*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glPointParameterfARB".} -proc glPointParameterfvARB*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glPointParameterfvARB".} -const - GL_TEXTURE_COMPARE_MODE_ARB* = 0x0000884C - GL_TEXTURE_COMPARE_FUNC_ARB* = 0x0000884D - GL_COMPARE_R_TO_TEXTURE_ARB* = 0x0000884E - -const - GL_TEXTURE_COMPARE_FAIL_VALUE_ARB* = 0x000080BF - GL_CLAMP_TO_BORDER_ARB* = 0x0000812D - -const - GL_COMPRESSED_ALPHA_ARB* = 0x000084E9 - GL_COMPRESSED_LUMINANCE_ARB* = 0x000084EA - GL_COMPRESSED_LUMINANCE_ALPHA_ARB* = 0x000084EB - GL_COMPRESSED_INTENSITY_ARB* = 0x000084EC - GL_COMPRESSED_RGB_ARB* = 0x000084ED - GL_COMPRESSED_RGBA_ARB* = 0x000084EE - GL_TEXTURE_COMPRESSION_HINT_ARB* = 0x000084EF - GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB* = 0x000086A0 - GL_TEXTURE_COMPRESSED_ARB* = 0x000086A1 - GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB* = 0x000086A2 - GL_COMPRESSED_TEXTURE_FORMATS_ARB* = 0x000086A3 - -proc glCompressedTexImage3DARB*(target: TGLenum, level: TGLint, - internalformat: TGLenum, width: TGLsizei, - height: TGLsizei, depth: TGLsizei, - border: TGLint, imageSize: TGLsizei, - data: PGLvoid){.dynlib: dllname, - importc: "glCompressedTexImage3DARB".} -proc glCompressedTexImage2DARB*(target: TGLenum, level: TGLint, - internalformat: TGLenum, width: TGLsizei, - height: TGLsizei, border: TGLint, - imageSize: TGLsizei, data: PGLvoid){. - dynlib: dllname, importc: "glCompressedTexImage2DARB".} -proc glCompressedTexImage1DARB*(target: TGLenum, level: TGLint, - internalformat: TGLenum, width: TGLsizei, - border: TGLint, imageSize: TGLsizei, - data: PGLvoid){.dynlib: dllname, - importc: "glCompressedTexImage1DARB".} -proc glCompressedTexSubImage3DARB*(target: TGLenum, level: TGLint, - xoffset: TGLint, yoffset: TGLint, - zoffset: TGLint, width: TGLsizei, - height: TGLsizei, depth: TGLsizei, - format: TGLenum, imageSize: TGLsizei, - data: PGLvoid){.dynlib: dllname, - importc: "glCompressedTexSubImage3DARB".} -proc glCompressedTexSubImage2DARB*(target: TGLenum, level: TGLint, - xoffset: TGLint, yoffset: TGLint, - width: TGLsizei, height: TGLsizei, - format: TGLenum, imageSize: TGLsizei, - data: PGLvoid){.dynlib: dllname, - importc: "glCompressedTexSubImage2DARB".} -proc glCompressedTexSubImage1DARB*(target: TGLenum, level: TGLint, - xoffset: TGLint, width: TGLsizei, - format: TGLenum, imageSize: TGLsizei, - data: PGLvoid){.dynlib: dllname, - importc: "glCompressedTexSubImage1DARB".} -proc glGetCompressedTexImageARB*(target: TGLenum, lod: TGLint, img: PGLvoid){. - dynlib: dllname, importc: "glGetCompressedTexImageARB".} - #***** GL_ARB_texture_env_combine *****// -const - GL_COMBINE_ARB* = 0x00008570 - GL_COMBINE_RGB_ARB* = 0x00008571 - GL_COMBINE_ALPHA_ARB* = 0x00008572 - GL_SOURCE0_RGB_ARB* = 0x00008580 - GL_SOURCE1_RGB_ARB* = 0x00008581 - GL_SOURCE2_RGB_ARB* = 0x00008582 - GL_SOURCE0_ALPHA_ARB* = 0x00008588 - GL_SOURCE1_ALPHA_ARB* = 0x00008589 - GL_SOURCE2_ALPHA_ARB* = 0x0000858A - GL_OPERAND0_RGB_ARB* = 0x00008590 - GL_OPERAND1_RGB_ARB* = 0x00008591 - GL_OPERAND2_RGB_ARB* = 0x00008592 - GL_OPERAND0_ALPHA_ARB* = 0x00008598 - GL_OPERAND1_ALPHA_ARB* = 0x00008599 - GL_OPERAND2_ALPHA_ARB* = 0x0000859A - GL_RGB_SCALE_ARB* = 0x00008573 - GL_ADD_SIGNED_ARB* = 0x00008574 - GL_INTERPOLATE_ARB* = 0x00008575 - GL_SUBTRACT_ARB* = 0x000084E7 - GL_CONSTANT_ARB* = 0x00008576 - GL_PRIMARY_COLOR_ARB* = 0x00008577 - GL_PREVIOUS_ARB* = 0x00008578 - #***** GL_ARB_texture_env_crossbar *****// - #***** GL_ARB_texture_env_dot3 *****// - -const - GL_DOT3_RGB_ARB* = 0x000086AE - GL_DOT3_RGBA_ARB* = 0x000086AF - #***** GL_ARB_texture_mirrored_repeat *****// - -const - GL_MIRRORED_REPEAT_ARB* = 0x00008370 - #***** GL_ARB_vertex_blend *****// - -const - GL_MAX_VERTEX_UNITS_ARB* = 0x000086A4 - GL_ACTIVE_VERTEX_UNITS_ARB* = 0x000086A5 - GL_WEIGHT_SUM_UNITY_ARB* = 0x000086A6 - constGL_VERTEX_BLEND_ARB* = 0x000086A7 - GL_MODELVIEW0_ARB* = 0x00001700 - GL_MODELVIEW1_ARB* = 0x0000850A - GL_MODELVIEW2_ARB* = 0x00008722 - GL_MODELVIEW3_ARB* = 0x00008723 - GL_MODELVIEW4_ARB* = 0x00008724 - GL_MODELVIEW5_ARB* = 0x00008725 - GL_MODELVIEW6_ARB* = 0x00008726 - GL_MODELVIEW7_ARB* = 0x00008727 - GL_MODELVIEW8_ARB* = 0x00008728 - GL_MODELVIEW9_ARB* = 0x00008729 - GL_MODELVIEW10_ARB* = 0x0000872A - GL_MODELVIEW11_ARB* = 0x0000872B - GL_MODELVIEW12_ARB* = 0x0000872C - GL_MODELVIEW13_ARB* = 0x0000872D - GL_MODELVIEW14_ARB* = 0x0000872E - GL_MODELVIEW15_ARB* = 0x0000872F - GL_MODELVIEW16_ARB* = 0x00008730 - GL_MODELVIEW17_ARB* = 0x00008731 - GL_MODELVIEW18_ARB* = 0x00008732 - GL_MODELVIEW19_ARB* = 0x00008733 - GL_MODELVIEW20_ARB* = 0x00008734 - GL_MODELVIEW21_ARB* = 0x00008735 - GL_MODELVIEW22_ARB* = 0x00008736 - GL_MODELVIEW23_ARB* = 0x00008737 - GL_MODELVIEW24_ARB* = 0x00008738 - GL_MODELVIEW25_ARB* = 0x00008739 - GL_MODELVIEW26_ARB* = 0x0000873A - GL_MODELVIEW27_ARB* = 0x0000873B - GL_MODELVIEW28_ARB* = 0x0000873C - GL_MODELVIEW29_ARB* = 0x0000873D - GL_MODELVIEW30_ARB* = 0x0000873E - GL_MODELVIEW31_ARB* = 0x0000873F - GL_CURRENT_WEIGHT_ARB* = 0x000086A8 - GL_WEIGHT_ARRAY_TYPE_ARB* = 0x000086A9 - GL_WEIGHT_ARRAY_STRIDE_ARB* = 0x000086AA - GL_WEIGHT_ARRAY_SIZE_ARB* = 0x000086AB - GL_WEIGHT_ARRAY_POINTER_ARB* = 0x000086AC - GL_WEIGHT_ARRAY_ARB* = 0x000086AD - -const - GL_VERTEX_PROGRAM_ARB* = 0x00008620 - GL_VERTEX_PROGRAM_POINT_SIZE_ARB* = 0x00008642 - GL_VERTEX_PROGRAM_TWO_SIDE_ARB* = 0x00008643 - GL_COLOR_SUM_ARB* = 0x00008458 - GL_PROGRAM_FORMAT_ASCII_ARB* = 0x00008875 - GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB* = 0x00008622 - GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB* = 0x00008623 - GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB* = 0x00008624 - GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB* = 0x00008625 - GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB* = 0x0000886A - GL_CURRENT_VERTEX_ATTRIB_ARB* = 0x00008626 - GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB* = 0x00008645 - GL_PROGRAM_LENGTH_ARB* = 0x00008627 - GL_PROGRAM_FORMAT_ARB* = 0x00008876 - GL_PROGRAM_BINDING_ARB* = 0x00008677 - GL_PROGRAM_INSTRUCTIONS_ARB* = 0x000088A0 - GL_MAX_PROGRAM_INSTRUCTIONS_ARB* = 0x000088A1 - GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB* = 0x000088A2 - GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB* = 0x000088A3 - GL_PROGRAM_TEMPORARIES_ARB* = 0x000088A4 - GL_MAX_PROGRAM_TEMPORARIES_ARB* = 0x000088A5 - GL_PROGRAM_NATIVE_TEMPORARIES_ARB* = 0x000088A6 - GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB* = 0x000088A7 - GL_PROGRAM_PARAMETERS_ARB* = 0x000088A8 - GL_MAX_PROGRAM_PARAMETERS_ARB* = 0x000088A9 - GL_PROGRAM_NATIVE_PARAMETERS_ARB* = 0x000088AA - GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB* = 0x000088AB - GL_PROGRAM_ATTRIBS_ARB* = 0x000088AC - GL_MAX_PROGRAM_ATTRIBS_ARB* = 0x000088AD - GL_PROGRAM_NATIVE_ATTRIBS_ARB* = 0x000088AE - GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB* = 0x000088AF - GL_PROGRAM_ADDRESS_REGISTERS_ARB* = 0x000088B0 - GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB* = 0x000088B1 - GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB* = 0x000088B2 - GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB* = 0x000088B3 - GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB* = 0x000088B4 - GL_MAX_PROGRAM_ENV_PARAMETERS_ARB* = 0x000088B5 - GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB* = 0x000088B6 - constGL_PROGRAM_STRING_ARB* = 0x00008628 - GL_PROGRAM_ERROR_POSITION_ARB* = 0x0000864B - GL_CURRENT_MATRIX_ARB* = 0x00008641 - GL_TRANSPOSE_CURRENT_MATRIX_ARB* = 0x000088B7 - GL_CURRENT_MATRIX_STACK_DEPTH_ARB* = 0x00008640 - GL_MAX_VERTEX_ATTRIBS_ARB* = 0x00008869 - GL_MAX_PROGRAM_MATRICES_ARB* = 0x0000862F - GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB* = 0x0000862E - GL_PROGRAM_ERROR_STRING_ARB* = 0x00008874 - GL_MATRIX0_ARB* = 0x000088C0 - GL_MATRIX1_ARB* = 0x000088C1 - GL_MATRIX2_ARB* = 0x000088C2 - GL_MATRIX3_ARB* = 0x000088C3 - GL_MATRIX4_ARB* = 0x000088C4 - GL_MATRIX5_ARB* = 0x000088C5 - GL_MATRIX6_ARB* = 0x000088C6 - GL_MATRIX7_ARB* = 0x000088C7 - GL_MATRIX8_ARB* = 0x000088C8 - GL_MATRIX9_ARB* = 0x000088C9 - GL_MATRIX10_ARB* = 0x000088CA - GL_MATRIX11_ARB* = 0x000088CB - GL_MATRIX12_ARB* = 0x000088CC - GL_MATRIX13_ARB* = 0x000088CD - GL_MATRIX14_ARB* = 0x000088CE - GL_MATRIX15_ARB* = 0x000088CF - GL_MATRIX16_ARB* = 0x000088D0 - GL_MATRIX17_ARB* = 0x000088D1 - GL_MATRIX18_ARB* = 0x000088D2 - GL_MATRIX19_ARB* = 0x000088D3 - GL_MATRIX20_ARB* = 0x000088D4 - GL_MATRIX21_ARB* = 0x000088D5 - GL_MATRIX22_ARB* = 0x000088D6 - GL_MATRIX23_ARB* = 0x000088D7 - GL_MATRIX24_ARB* = 0x000088D8 - GL_MATRIX25_ARB* = 0x000088D9 - GL_MATRIX26_ARB* = 0x000088DA - GL_MATRIX27_ARB* = 0x000088DB - GL_MATRIX28_ARB* = 0x000088DC - GL_MATRIX29_ARB* = 0x000088DD - GL_MATRIX30_ARB* = 0x000088DE - GL_MATRIX31_ARB* = 0x000088DF - -const - GL_422_EXT* = 0x000080CC - GL_422_REV_EXT* = 0x000080CD - GL_422_AVERAGE_EXT* = 0x000080CE - GL_422_REV_AVERAGE_EXT* = 0x000080CF - #***** GL_EXT_abgr *****// - -const - GL_ABGR_EXT* = 0x00008000 - #***** GL_EXT_bgra *****// - -const - GL_BGR_EXT* = 0x000080E0 - GL_BGRA_EXT* = 0x000080E1 - #***** GL_EXT_blend_color *****// - -const - GL_CONSTANT_COLOR_EXT* = 0x00008001 - GL_ONE_MINUS_CONSTANT_COLOR_EXT* = 0x00008002 - GL_CONSTANT_ALPHA_EXT* = 0x00008003 - GL_ONE_MINUS_CONSTANT_ALPHA_EXT* = 0x00008004 - constGL_BLEND_COLOR_EXT* = 0x00008005 - -proc glBlendColorEXT*(red: TGLclampf, green: TGLclampf, blue: TGLclampf, - alpha: TGLclampf){.dynlib: dllname, - importc: "glBlendColorEXT".} - #***** GL_EXT_blend_func_separate *****// -const - GL_BLEND_DST_RGB_EXT* = 0x000080C8 - GL_BLEND_SRC_RGB_EXT* = 0x000080C9 - GL_BLEND_DST_ALPHA_EXT* = 0x000080CA - GL_BLEND_SRC_ALPHA_EXT* = 0x000080CB - -proc glBlendFuncSeparateEXT*(sfactorRGB: TGLenum, dfactorRGB: TGLenum, - sfactorAlpha: TGLenum, dfactorAlpha: TGLenum){. - dynlib: dllname, importc: "glBlendFuncSeparateEXT".} - #***** GL_EXT_blend_logic_op *****// - #***** GL_EXT_blend_minmax *****// -const - GL_FUNC_ADD_EXT* = 0x00008006 - GL_MIN_EXT* = 0x00008007 - GL_MAX_EXT* = 0x00008008 - constGL_BLEND_EQUATION_EXT* = 0x00008009 - -proc glBlendEquationEXT*(mode: TGLenum){.dynlib: dllname, - importc: "glBlendEquationEXT".} - #***** GL_EXT_blend_subtract *****// -const - GL_FUNC_SUBTRACT_EXT* = 0x0000800A - GL_FUNC_REVERSE_SUBTRACT_EXT* = 0x0000800B - #***** GL_EXT_clip_volume_hint *****// - -const - GL_CLIP_VOLUME_CLIPPING_HINT_EXT* = 0x000080F0 - #***** GL_EXT_color_subtable *****// - -proc glColorSubTableEXT*(target: TGLenum, start: TGLsizei, count: TGLsizei, - format: TGLenum, thetype: TGLenum, data: PGLvoid){. - dynlib: dllname, importc: "glColorSubTableEXT".} -proc glCopyColorSubTableEXT*(target: TGLenum, start: TGLsizei, x: TGLint, - y: TGLint, width: TGLsizei){.dynlib: dllname, - importc: "glCopyColorSubTableEXT".} - #***** GL_EXT_compiled_vertex_array *****// -const - GL_ARRAY_ELEMENT_LOCK_FIRST_EXT* = 0x000081A8 - GL_ARRAY_ELEMENT_LOCK_COUNT_EXT* = 0x000081A9 - -proc glLockArraysEXT*(first: TGLint, count: TGLsizei){.dynlib: dllname, - importc: "glLockArraysEXT".} -proc glUnlockArraysEXT*(){.dynlib: dllname, importc: "glUnlockArraysEXT".} - #***** GL_EXT_convolution *****// -const - GL_CONVOLUTION_1D_EXT* = 0x00008010 - GL_CONVOLUTION_2D_EXT* = 0x00008011 - GL_SEPARABLE_2D_EXT* = 0x00008012 - GL_CONVOLUTION_BORDER_MODE_EXT* = 0x00008013 - GL_CONVOLUTION_FILTER_SCALE_EXT* = 0x00008014 - GL_CONVOLUTION_FILTER_BIAS_EXT* = 0x00008015 - GL_REDUCE_EXT* = 0x00008016 - GL_CONVOLUTION_FORMAT_EXT* = 0x00008017 - GL_CONVOLUTION_WIDTH_EXT* = 0x00008018 - GL_CONVOLUTION_HEIGHT_EXT* = 0x00008019 - GL_MAX_CONVOLUTION_WIDTH_EXT* = 0x0000801A - GL_MAX_CONVOLUTION_HEIGHT_EXT* = 0x0000801B - GL_POST_CONVOLUTION_RED_SCALE_EXT* = 0x0000801C - GL_POST_CONVOLUTION_GREEN_SCALE_EXT* = 0x0000801D - GL_POST_CONVOLUTION_BLUE_SCALE_EXT* = 0x0000801E - GL_POST_CONVOLUTION_ALPHA_SCALE_EXT* = 0x0000801F - GL_POST_CONVOLUTION_RED_BIAS_EXT* = 0x00008020 - GL_POST_CONVOLUTION_GREEN_BIAS_EXT* = 0x00008021 - GL_POST_CONVOLUTION_BLUE_BIAS_EXT* = 0x00008022 - GL_POST_CONVOLUTION_ALPHA_BIAS_EXT* = 0x00008023 - -proc glConvolutionFilter1DEXT*(target: TGLenum, internalformat: TGLenum, - width: TGLsizei, format: TGLenum, - thetype: TGLenum, image: PGLvoid){. - dynlib: dllname, importc: "glConvolutionFilter1DEXT".} -proc glConvolutionFilter2DEXT*(target: TGLenum, internalformat: TGLenum, - width: TGLsizei, height: TGLsizei, - format: TGLenum, thetype: TGLenum, image: PGLvoid){. - dynlib: dllname, importc: "glConvolutionFilter2DEXT".} -proc glCopyConvolutionFilter1DEXT*(target: TGLenum, internalformat: TGLenum, - x: TGLint, y: TGLint, width: TGLsizei){. - dynlib: dllname, importc: "glCopyConvolutionFilter1DEXT".} -proc glCopyConvolutionFilter2DEXT*(target: TGLenum, internalformat: TGLenum, - x: TGLint, y: TGLint, width: TGLsizei, - height: TGLsizei){.dynlib: dllname, - importc: "glCopyConvolutionFilter2DEXT".} -proc glGetConvolutionFilterEXT*(target: TGLenum, format: TGLenum, - thetype: TGLenum, image: PGLvoid){. - dynlib: dllname, importc: "glGetConvolutionFilterEXT".} -proc glSeparableFilter2DEXT*(target: TGLenum, internalformat: TGLenum, - width: TGLsizei, height: TGLsizei, format: TGLenum, - thetype: TGLenum, row: PGLvoid, column: PGLvoid){. - dynlib: dllname, importc: "glSeparableFilter2DEXT".} -proc glGetSeparableFilterEXT*(target: TGLenum, format: TGLenum, - thetype: TGLenum, row: PGLvoid, column: PGLvoid, - span: PGLvoid){.dynlib: dllname, - importc: "glGetSeparableFilterEXT".} -proc glConvolutionParameteriEXT*(target: TGLenum, pname: TGLenum, param: TGLint){. - dynlib: dllname, importc: "glConvolutionParameteriEXT".} -proc glConvolutionParameterivEXT*(target: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glConvolutionParameterivEXT".} -proc glConvolutionParameterfEXT*(target: TGLenum, pname: TGLenum, - param: TGLfloat){.dynlib: dllname, - importc: "glConvolutionParameterfEXT".} -proc glConvolutionParameterfvEXT*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glConvolutionParameterfvEXT".} -proc glGetConvolutionParameterivEXT*(target: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetConvolutionParameterivEXT".} -proc glGetConvolutionParameterfvEXT*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetConvolutionParameterfvEXT".} - #***** GL_EXT_fog_coord *****// -const - GL_FOG_COORDINATE_SOURCE_EXT* = 0x00008450 - GL_FOG_COORDINATE_EXT* = 0x00008451 - GL_FRAGMENT_DEPTH_EXT* = 0x00008452 - GL_CURRENT_FOG_COORDINATE_EXT* = 0x00008453 - GL_FOG_COORDINATE_ARRAY_TYPE_EXT* = 0x00008454 - GL_FOG_COORDINATE_ARRAY_STRIDE_EXT* = 0x00008455 - GL_FOG_COORDINATE_ARRAY_POINTER_EXT* = 0x00008456 - GL_FOG_COORDINATE_ARRAY_EXT* = 0x00008457 - -proc glFogCoordfEXfloat*(coord: TGLfloat){.dynlib: dllname, - importc: "glFogCoordfEXfloat".} -proc glFogCoorddEXdouble*(coord: TGLdouble){.dynlib: dllname, - importc: "glFogCoorddEXdouble".} -proc glFogCoordfvEXfloat*(coord: TGLfloat){.dynlib: dllname, - importc: "glFogCoordfvEXfloat".} -proc glFogCoorddvEXdouble*(coord: TGLdouble){.dynlib: dllname, - importc: "glFogCoorddvEXdouble".} -proc glFogCoordPointerEXT*(thetype: TGLenum, stride: TGLsizei, pointer: PGLvoid){. - dynlib: dllname, importc: "glFogCoordPointerEXT".} - #***** GL_EXT_histogram *****// -const - constGL_HISTOGRAM_EXT* = 0x00008024 - GL_PROXY_HISTOGRAM_EXT* = 0x00008025 - GL_HISTOGRAM_WIDTH_EXT* = 0x00008026 - GL_HISTOGRAM_FORMAT_EXT* = 0x00008027 - GL_HISTOGRAM_RED_SIZE_EXT* = 0x00008028 - GL_HISTOGRAM_GREEN_SIZE_EXT* = 0x00008029 - GL_HISTOGRAM_BLUE_SIZE_EXT* = 0x0000802A - GL_HISTOGRAM_ALPHA_SIZE_EXT* = 0x0000802B - GL_HISTOGRAM_LUMINANCE_SIZE_EXT* = 0x0000802C - GL_HISTOGRAM_SINK_EXT* = 0x0000802D - constGL_MINMAX_EXT* = 0x0000802E - GL_MINMAX_FORMAT_EXT* = 0x0000802F - GL_MINMAX_SINK_EXT* = 0x00008030 - -proc glHistogramEXT*(target: TGLenum, width: TGLsizei, internalformat: TGLenum, - sink: TGLboolean){.dynlib: dllname, - importc: "glHistogramEXT".} -proc glResetHistogramEXT*(target: TGLenum){.dynlib: dllname, - importc: "glResetHistogramEXT".} -proc glGetHistogramEXT*(target: TGLenum, reset: TGLboolean, format: TGLenum, - thetype: TGLenum, values: PGLvoid){.dynlib: dllname, - importc: "glGetHistogramEXT".} -proc glGetHistogramParameterivEXT*(target: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetHistogramParameterivEXT".} -proc glGetHistogramParameterfvEXT*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetHistogramParameterfvEXT".} -proc glMinmaxEXT*(target: TGLenum, internalformat: TGLenum, sink: TGLboolean){. - dynlib: dllname, importc: "glMinmaxEXT".} -proc glResetMinmaxEXT*(target: TGLenum){.dynlib: dllname, - importc: "glResetMinmaxEXT".} -proc glGetMinmaxEXT*(target: TGLenum, reset: TGLboolean, format: TGLenum, - thetype: TGLenum, values: PGLvoid){.dynlib: dllname, - importc: "glGetMinmaxEXT".} -proc glGetMinmaxParameterivEXT*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetMinmaxParameterivEXT".} -proc glGetMinmaxParameterfvEXT*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetMinmaxParameterfvEXT".} - #***** GL_EXT_multi_draw_arrays *****// -proc glMultiDrawArraysEXT*(mode: TGLenum, first: PGLint, count: PGLsizei, - primcount: TGLsizei){.dynlib: dllname, - importc: "glMultiDrawArraysEXT".} -proc glMultiDrawElementsEXT*(mode: TGLenum, count: PGLsizei, thetype: TGLenum, - indices: PGLvoid, primcount: TGLsizei){. - dynlib: dllname, importc: "glMultiDrawElementsEXT".} - #***** GL_EXT_packed_pixels *****// -const - GL_UNSIGNED_BYTE_3_3_2_EXT* = 0x00008032 - GL_UNSIGNED_SHORT_4_4_4_4_EXT* = 0x00008033 - GL_UNSIGNED_SHORT_5_5_5_1_EXT* = 0x00008034 - GL_UNSIGNED_INT_8_8_8_8_EXT* = 0x00008035 - GL_UNSIGNED_INT_10_10_10_2_EXT* = 0x00008036 - #***** GL_EXT_paletted_texture *****// - -const - GL_COLOR_INDEX1_EXT* = 0x000080E2 - GL_COLOR_INDEX2_EXT* = 0x000080E3 - GL_COLOR_INDEX4_EXT* = 0x000080E4 - GL_COLOR_INDEX8_EXT* = 0x000080E5 - GL_COLOR_INDEX12_EXT* = 0x000080E6 - GL_COLOR_INDEX16_EXT* = 0x000080E7 - GL_COLOR_TABLE_FORMAT_EXT* = 0x000080D8 - GL_COLOR_TABLE_WIDTH_EXT* = 0x000080D9 - GL_COLOR_TABLE_RED_SIZE_EXT* = 0x000080DA - GL_COLOR_TABLE_GREEN_SIZE_EXT* = 0x000080DB - GL_COLOR_TABLE_BLUE_SIZE_EXT* = 0x000080DC - GL_COLOR_TABLE_ALPHA_SIZE_EXT* = 0x000080DD - GL_COLOR_TABLE_LUMINANCE_SIZE_EXT* = 0x000080DE - GL_COLOR_TABLE_INTENSITY_SIZE_EXT* = 0x000080DF - GL_TEXTURE_INDEX_SIZE_EXT* = 0x000080ED - GL_TEXTURE_1D* = 0x00000DE0 - GL_TEXTURE_2D* = 0x00000DE1 - GL_TEXTURE_3D_EXT* = 0x0000806F # GL_TEXTURE_CUBE_MAP_ARB { already defined } - GL_PROXY_TEXTURE_1D* = 0x00008063 - GL_PROXY_TEXTURE_2D* = 0x00008064 - GL_PROXY_TEXTURE_3D_EXT* = 0x00008070 # GL_PROXY_TEXTURE_CUBE_MAP_ARB { already defined } - # GL_TEXTURE_1D { already defined } - # GL_TEXTURE_2D { already defined } - # GL_TEXTURE_3D_EXT { already defined } - # GL_TEXTURE_CUBE_MAP_ARB { already defined } - -proc glColorTableEXT*(target: TGLenum, internalFormat: TGLenum, width: TGLsizei, - format: TGLenum, thetype: TGLenum, data: PGLvoid){. - dynlib: dllname, importc: "glColorTableEXT".} - # glColorSubTableEXT { already defined } -proc glGetColorTableEXT*(target: TGLenum, format: TGLenum, thetype: TGLenum, - data: PGLvoid){.dynlib: dllname, - importc: "glGetColorTableEXT".} -proc glGetColorTableParameterivEXT*(target: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetColorTableParameterivEXT".} -proc glGetColorTableParameterfvEXT*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetColorTableParameterfvEXT".} - #***** GL_EXT_point_parameters *****// -const - GL_POINT_SIZE_MIN_EXT* = 0x00008126 - GL_POINT_SIZE_MAX_EXT* = 0x00008127 - GL_POINT_FADE_THRESHOLD_SIZE_EXT* = 0x00008128 - GL_DISTANCE_ATTENUATION_EXT* = 0x00008129 - -proc glPointParameterfEXT*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glPointParameterfEXT".} -proc glPointParameterfvEXT*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glPointParameterfvEXT".} - #***** GL_EXT_polygon_offset *****// -const - constGL_POLYGON_OFFSET_EXT* = 0x00008037 - GL_POLYGON_OFFSET_FACTOR_EXT* = 0x00008038 - GL_POLYGON_OFFSET_BIAS_EXT* = 0x00008039 - -proc glPolygonOffsetEXT*(factor: TGLfloat, bias: TGLfloat){.dynlib: dllname, - importc: "glPolygonOffsetEXT".} - #***** GL_EXT_secondary_color *****// -const - GL_COLOR_SUM_EXT* = 0x00008458 - GL_CURRENT_SECONDARY_COLOR_EXT* = 0x00008459 - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT* = 0x0000845A - GL_SECONDARY_COLOR_ARRAY_TYPE_EXT* = 0x0000845B - GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT* = 0x0000845C - GL_SECONDARY_COLOR_ARRAY_POINTER_EXT* = 0x0000845D - GL_SECONDARY_COLOR_ARRAY_EXT* = 0x0000845E - -proc glSecondaryColor3bEXT*(components: TGLbyte){.dynlib: dllname, - importc: "glSecondaryColor3bEXT".} -proc glSecondaryColor3sEXT*(components: TGLshort){.dynlib: dllname, - importc: "glSecondaryColor3sEXT".} -proc glSecondaryColor3iEXT*(components: TGLint){.dynlib: dllname, - importc: "glSecondaryColor3iEXT".} -proc glSecondaryColor3fEXT*(components: TGLfloat){.dynlib: dllname, - importc: "glSecondaryColor3fEXT".} -proc glSecondaryColor3dEXT*(components: TGLdouble){.dynlib: dllname, - importc: "glSecondaryColor3dEXT".} -proc glSecondaryColor3ubEXT*(components: TGLubyte){.dynlib: dllname, - importc: "glSecondaryColor3ubEXT".} -proc glSecondaryColor3usEXT*(components: TGLushort){.dynlib: dllname, - importc: "glSecondaryColor3usEXT".} -proc glSecondaryColor3uiEXT*(components: TGLuint){.dynlib: dllname, - importc: "glSecondaryColor3uiEXT".} -proc glSecondaryColor3bvEXT*(components: TGLbyte){.dynlib: dllname, - importc: "glSecondaryColor3bvEXT".} -proc glSecondaryColor3svEXT*(components: TGLshort){.dynlib: dllname, - importc: "glSecondaryColor3svEXT".} -proc glSecondaryColor3ivEXT*(components: TGLint){.dynlib: dllname, - importc: "glSecondaryColor3ivEXT".} -proc glSecondaryColor3fvEXT*(components: TGLfloat){.dynlib: dllname, - importc: "glSecondaryColor3fvEXT".} -proc glSecondaryColor3dvEXT*(components: TGLdouble){.dynlib: dllname, - importc: "glSecondaryColor3dvEXT".} -proc glSecondaryColor3ubvEXT*(components: TGLubyte){.dynlib: dllname, - importc: "glSecondaryColor3ubvEXT".} -proc glSecondaryColor3usvEXT*(components: TGLushort){.dynlib: dllname, - importc: "glSecondaryColor3usvEXT".} -proc glSecondaryColor3uivEXT*(components: TGLuint){.dynlib: dllname, - importc: "glSecondaryColor3uivEXT".} -proc glSecondaryColorPointerEXT*(size: TGLint, thetype: TGLenum, - stride: TGLsizei, pointer: PGLvoid){. - dynlib: dllname, importc: "glSecondaryColorPointerEXT".} - #***** GL_EXT_separate_specular_color *****// -const - GL_LIGHT_MODEL_COLOR_CONTROL_EXT* = 0x000081F8 - GL_SINGLE_COLOR_EXT* = 0x000081F9 - GL_SEPARATE_SPECULAR_COLOR_EXT* = 0x000081FA - #***** GL_EXT_shadow_funcs *****// - #***** GL_EXT_shared_texture_palette *****// - -const - GL_SHARED_TEXTURE_PALETTE_EXT* = 0x000081FB - #***** GL_EXT_stencil_two_side *****// - -const - GL_STENCIL_TEST_TWO_SIDE_EXT* = 0x00008910 - constGL_ACTIVE_STENCIL_FACE_EXT* = 0x00008911 - -proc glActiveStencilFaceEXT*(face: TGLenum){.dynlib: dllname, - importc: "glActiveStencilFaceEXT".} - #***** GL_EXT_stencil_wrap *****// -const - GL_INCR_WRAP_EXT* = 0x00008507 - GL_DECR_WRAP_EXT* = 0x00008508 - #***** GL_EXT_subtexture *****// - -proc glTexSubImage1DEXT*(target: TGLenum, level: TGLint, xoffset: TGLint, - width: TGLsizei, format: TGLenum, thetype: TGLenum, - pixels: PGLvoid){.dynlib: dllname, - importc: "glTexSubImage1DEXT".} -proc glTexSubImage2DEXT*(target: TGLenum, level: TGLint, xoffset: TGLint, - yoffset: TGLint, width: TGLsizei, height: TGLsizei, - format: TGLenum, thetype: TGLenum, pixels: PGLvoid){. - dynlib: dllname, importc: "glTexSubImage2DEXT".} -proc glTexSubImage3DEXT*(target: TGLenum, level: TGLint, xoffset: TGLint, - yoffset: TGLint, zoffset: TGLint, width: TGLsizei, - height: TGLsizei, depth: TGLsizei, format: TGLenum, - thetype: TGLenum, pixels: PGLvoid){.dynlib: dllname, - importc: "glTexSubImage3DEXT".} - #***** GL_EXT_texture3D *****// -const - GL_PACK_SKIP_IMAGES_EXT* = 0x0000806B - GL_PACK_IMAGE_HEIGHT_EXT* = 0x0000806C - GL_UNPACK_SKIP_IMAGES_EXT* = 0x0000806D - GL_UNPACK_IMAGE_HEIGHT_EXT* = 0x0000806E # GL_TEXTURE_3D_EXT { already defined } - # GL_PROXY_TEXTURE_3D_EXT { already defined } - GL_TEXTURE_DEPTH_EXT* = 0x00008071 - GL_TEXTURE_WRAP_R_EXT* = 0x00008072 - GL_MAX_3D_TEXTURE_SIZE_EXT* = 0x00008073 - -proc glTexImage3DEXT*(target: TGLenum, level: TGLint, internalformat: TGLenum, - width: TGLsizei, height: TGLsizei, depth: TGLsizei, - border: TGLint, format: TGLenum, thetype: TGLenum, - pixels: PGLvoid){.dynlib: dllname, - importc: "glTexImage3DEXT".} - #***** GL_EXT_texture_compression_s3tc *****// -const - GL_COMPRESSED_RGB_S3TC_DXT1_EXT* = 0x000083F0 - GL_COMPRESSED_RGBA_S3TC_DXT1_EXT* = 0x000083F1 - GL_COMPRESSED_RGBA_S3TC_DXT3_EXT* = 0x000083F2 - GL_COMPRESSED_RGBA_S3TC_DXT5_EXT* = 0x000083F3 - #***** GL_EXT_texture_env_add *****// - #***** GL_EXT_texture_env_combine *****// - -const - GL_COMBINE_EXT* = 0x00008570 - GL_COMBINE_RGB_EXT* = 0x00008571 - GL_COMBINE_ALPHA_EXT* = 0x00008572 - GL_SOURCE0_RGB_EXT* = 0x00008580 - GL_SOURCE1_RGB_EXT* = 0x00008581 - GL_SOURCE2_RGB_EXT* = 0x00008582 - GL_SOURCE0_ALPHA_EXT* = 0x00008588 - GL_SOURCE1_ALPHA_EXT* = 0x00008589 - GL_SOURCE2_ALPHA_EXT* = 0x0000858A - GL_OPERAND0_RGB_EXT* = 0x00008590 - GL_OPERAND1_RGB_EXT* = 0x00008591 - GL_OPERAND2_RGB_EXT* = 0x00008592 - GL_OPERAND0_ALPHA_EXT* = 0x00008598 - GL_OPERAND1_ALPHA_EXT* = 0x00008599 - GL_OPERAND2_ALPHA_EXT* = 0x0000859A - GL_RGB_SCALE_EXT* = 0x00008573 - GL_ADD_SIGNED_EXT* = 0x00008574 - GL_INTERPOLATE_EXT* = 0x00008575 - GL_CONSTANT_EXT* = 0x00008576 - GL_PRIMARY_COLOR_EXT* = 0x00008577 - GL_PREVIOUS_EXT* = 0x00008578 - #***** GL_EXT_texture_env_dot3 *****// - -const - GL_DOT3_RGB_EXT* = 0x00008740 - GL_DOT3_RGBA_EXT* = 0x00008741 - #***** GL_EXT_texture_filter_anisotropic *****// - -const - GL_TEXTURE_MAX_ANISOTROPY_EXT* = 0x000084FE - GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT* = 0x000084FF - #***** GL_EXT_texture_lod_bias *****// - -const - GL_TEXTURE_FILTER_CONTROL_EXT* = 0x00008500 - GL_TEXTURE_LOD_BIAS_EXT* = 0x00008501 - GL_MAX_TEXTURE_LOD_BIAS_EXT* = 0x000084FD - #***** GL_EXT_texture_object *****// - -const - GL_TEXTURE_PRIORITY_EXT* = 0x00008066 - GL_TEXTURE_RESIDENT_EXT* = 0x00008067 - GL_TEXTURE_1D_BINDING_EXT* = 0x00008068 - GL_TEXTURE_2D_BINDING_EXT* = 0x00008069 - GL_TEXTURE_3D_BINDING_EXT* = 0x0000806A - -proc glGenTexturesEXT*(n: TGLsizei, textures: PGLuint){.dynlib: dllname, - importc: "glGenTexturesEXT".} -proc glDeleteTexturesEXT*(n: TGLsizei, textures: PGLuint){.dynlib: dllname, - importc: "glDeleteTexturesEXT".} -proc glBindTextureEXT*(target: TGLenum, texture: TGLuint){.dynlib: dllname, - importc: "glBindTextureEXT".} -proc glPrioritizeTexturesEXT*(n: TGLsizei, textures: PGLuint, - priorities: PGLclampf){.dynlib: dllname, - importc: "glPrioritizeTexturesEXT".} -proc glAreTexturesResidentEXT*(n: TGLsizei, textures: PGLuint, - residences: PGLboolean): TGLboolean{. - dynlib: dllname, importc: "glAreTexturesResidentEXT".} -proc glIsTextureEXT*(texture: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsTextureEXT".} - #***** GL_EXT_vertex_array *****// -const - GL_VERTEX_ARRAY_EXT* = 0x00008074 - GL_NORMAL_ARRAY_EXT* = 0x00008075 - GL_COLOR_ARRAY_EXT* = 0x00008076 - GL_INDEX_ARRAY_EXT* = 0x00008077 - GL_TEXTURE_COORD_ARRAY_EXT* = 0x00008078 - GL_EDGE_FLAG_ARRAY_EXT* = 0x00008079 - GL_DOUBLE_EXT* = 0x0000140A - GL_VERTEX_ARRAY_SIZE_EXT* = 0x0000807A - GL_VERTEX_ARRAY_TYPE_EXT* = 0x0000807B - GL_VERTEX_ARRAY_STRIDE_EXT* = 0x0000807C - GL_VERTEX_ARRAY_COUNT_EXT* = 0x0000807D - GL_NORMAL_ARRAY_TYPE_EXT* = 0x0000807E - GL_NORMAL_ARRAY_STRIDE_EXT* = 0x0000807F - GL_NORMAL_ARRAY_COUNT_EXT* = 0x00008080 - GL_COLOR_ARRAY_SIZE_EXT* = 0x00008081 - GL_COLOR_ARRAY_TYPE_EXT* = 0x00008082 - GL_COLOR_ARRAY_STRIDE_EXT* = 0x00008083 - GL_COLOR_ARRAY_COUNT_EXT* = 0x00008084 - GL_INDEX_ARRAY_TYPE_EXT* = 0x00008085 - GL_INDEX_ARRAY_STRIDE_EXT* = 0x00008086 - GL_INDEX_ARRAY_COUNT_EXT* = 0x00008087 - GL_TEXTURE_COORD_ARRAY_SIZE_EXT* = 0x00008088 - GL_TEXTURE_COORD_ARRAY_TYPE_EXT* = 0x00008089 - GL_TEXTURE_COORD_ARRAY_STRIDE_EXT* = 0x0000808A - GL_TEXTURE_COORD_ARRAY_COUNT_EXT* = 0x0000808B - GL_EDGE_FLAG_ARRAY_STRIDE_EXT* = 0x0000808C - GL_EDGE_FLAG_ARRAY_COUNT_EXT* = 0x0000808D - GL_VERTEX_ARRAY_POINTER_EXT* = 0x0000808E - GL_NORMAL_ARRAY_POINTER_EXT* = 0x0000808F - GL_COLOR_ARRAY_POINTER_EXT* = 0x00008090 - GL_INDEX_ARRAY_POINTER_EXT* = 0x00008091 - GL_TEXTURE_COORD_ARRAY_POINTER_EXT* = 0x00008092 - GL_EDGE_FLAG_ARRAY_POINTER_EXT* = 0x00008093 - -proc glArrayElementEXT*(i: TGLint){.dynlib: dllname, - importc: "glArrayElementEXT".} -proc glDrawArraysEXT*(mode: TGLenum, first: TGLint, count: TGLsizei){. - dynlib: dllname, importc: "glDrawArraysEXT".} -proc glVertexPointerEXT*(size: TGLint, thetype: TGLenum, stride: TGLsizei, - count: TGLsizei, pointer: PGLvoid){.dynlib: dllname, - importc: "glVertexPointerEXT".} -proc glNormalPointerEXT*(thetype: TGLenum, stride: TGLsizei, count: TGLsizei, - pointer: PGLvoid){.dynlib: dllname, - importc: "glNormalPointerEXT".} -proc glColorPointerEXT*(size: TGLint, thetype: TGLenum, stride: TGLsizei, - count: TGLsizei, pointer: PGLvoid){.dynlib: dllname, - importc: "glColorPointerEXT".} -proc glIndexPointerEXT*(thetype: TGLenum, stride: TGLsizei, count: TGLsizei, - pointer: PGLvoid){.dynlib: dllname, - importc: "glIndexPointerEXT".} -proc glTexCoordPointerEXT*(size: TGLint, thetype: TGLenum, stride: TGLsizei, - count: TGLsizei, pointer: PGLvoid){.dynlib: dllname, - importc: "glTexCoordPointerEXT".} -proc glEdgeFlagPointerEXT*(stride: TGLsizei, count: TGLsizei, - pointer: PGLboolean){.dynlib: dllname, - importc: "glEdgeFlagPointerEXT".} -proc glGetPointervEXT*(pname: TGLenum, params: PGLvoid){.dynlib: dllname, - importc: "glGetPointervEXT".} - #***** GL_EXT_vertex_shader *****// -const - GL_VERTEX_SHADER_EXT* = 0x00008780 - GL_VARIANT_VALUE_EXT* = 0x000087E4 - GL_VARIANT_DATATYPE_EXT* = 0x000087E5 - GL_VARIANT_ARRAY_STRIDE_EXT* = 0x000087E6 - GL_VARIANT_ARRAY_TYPE_EXT* = 0x000087E7 - GL_VARIANT_ARRAY_EXT* = 0x000087E8 - GL_VARIANT_ARRAY_POINTER_EXT* = 0x000087E9 - GL_INVARIANT_VALUE_EXT* = 0x000087EA - GL_INVARIANT_DATATYPE_EXT* = 0x000087EB - GL_LOCAL_CONSTANT_VALUE_EXT* = 0x000087EC - GL_LOCAL_CONSTANT_DATATYPE_EXT* = 0x000087ED - GL_OP_INDEX_EXT* = 0x00008782 - GL_OP_NEGATE_EXT* = 0x00008783 - GL_OP_DOT3_EXT* = 0x00008784 - GL_OP_DOT4_EXT* = 0x00008785 - GL_OP_MUL_EXT* = 0x00008786 - GL_OP_ADD_EXT* = 0x00008787 - GL_OP_MADD_EXT* = 0x00008788 - GL_OP_FRAC_EXT* = 0x00008789 - GL_OP_MAX_EXT* = 0x0000878A - GL_OP_MIN_EXT* = 0x0000878B - GL_OP_SET_GE_EXT* = 0x0000878C - GL_OP_SET_LT_EXT* = 0x0000878D - GL_OP_CLAMP_EXT* = 0x0000878E - GL_OP_FLOOR_EXT* = 0x0000878F - GL_OP_ROUND_EXT* = 0x00008790 - GL_OP_EXP_BASE_2_EXT* = 0x00008791 - GL_OP_LOG_BASE_2_EXT* = 0x00008792 - GL_OP_POWER_EXT* = 0x00008793 - GL_OP_RECIP_EXT* = 0x00008794 - GL_OP_RECIP_SQRT_EXT* = 0x00008795 - GL_OP_SUB_EXT* = 0x00008796 - GL_OP_CROSS_PRODUCT_EXT* = 0x00008797 - GL_OP_MULTIPLY_MATRIX_EXT* = 0x00008798 - GL_OP_MOV_EXT* = 0x00008799 - GL_OUTPUT_VERTEX_EXT* = 0x0000879A - GL_OUTPUT_COLOR0_EXT* = 0x0000879B - GL_OUTPUT_COLOR1_EXT* = 0x0000879C - GL_OUTPUT_TEXTURE_COORD0_EXT* = 0x0000879D - GL_OUTPUT_TEXTURE_COORD1_EXT* = 0x0000879E - GL_OUTPUT_TEXTURE_COORD2_EXT* = 0x0000879F - GL_OUTPUT_TEXTURE_COORD3_EXT* = 0x000087A0 - GL_OUTPUT_TEXTURE_COORD4_EXT* = 0x000087A1 - GL_OUTPUT_TEXTURE_COORD5_EXT* = 0x000087A2 - GL_OUTPUT_TEXTURE_COORD6_EXT* = 0x000087A3 - GL_OUTPUT_TEXTURE_COORD7_EXT* = 0x000087A4 - GL_OUTPUT_TEXTURE_COORD8_EXT* = 0x000087A5 - GL_OUTPUT_TEXTURE_COORD9_EXT* = 0x000087A6 - GL_OUTPUT_TEXTURE_COORD10_EXT* = 0x000087A7 - GL_OUTPUT_TEXTURE_COORD11_EXT* = 0x000087A8 - GL_OUTPUT_TEXTURE_COORD12_EXT* = 0x000087A9 - GL_OUTPUT_TEXTURE_COORD13_EXT* = 0x000087AA - GL_OUTPUT_TEXTURE_COORD14_EXT* = 0x000087AB - GL_OUTPUT_TEXTURE_COORD15_EXT* = 0x000087AC - GL_OUTPUT_TEXTURE_COORD16_EXT* = 0x000087AD - GL_OUTPUT_TEXTURE_COORD17_EXT* = 0x000087AE - GL_OUTPUT_TEXTURE_COORD18_EXT* = 0x000087AF - GL_OUTPUT_TEXTURE_COORD19_EXT* = 0x000087B0 - GL_OUTPUT_TEXTURE_COORD20_EXT* = 0x000087B1 - GL_OUTPUT_TEXTURE_COORD21_EXT* = 0x000087B2 - GL_OUTPUT_TEXTURE_COORD22_EXT* = 0x000087B3 - GL_OUTPUT_TEXTURE_COORD23_EXT* = 0x000087B4 - GL_OUTPUT_TEXTURE_COORD24_EXT* = 0x000087B5 - GL_OUTPUT_TEXTURE_COORD25_EXT* = 0x000087B6 - GL_OUTPUT_TEXTURE_COORD26_EXT* = 0x000087B7 - GL_OUTPUT_TEXTURE_COORD27_EXT* = 0x000087B8 - GL_OUTPUT_TEXTURE_COORD28_EXT* = 0x000087B9 - GL_OUTPUT_TEXTURE_COORD29_EXT* = 0x000087BA - GL_OUTPUT_TEXTURE_COORD30_EXT* = 0x000087BB - GL_OUTPUT_TEXTURE_COORD31_EXT* = 0x000087BC - GL_OUTPUT_FOG_EXT* = 0x000087BD - GL_SCALAR_EXT* = 0x000087BE - GL_VECTOR_EXT* = 0x000087BF - GL_MATRIX_EXT* = 0x000087C0 - GL_VARIANT_EXT* = 0x000087C1 - GL_INVARIANT_EXT* = 0x000087C2 - GL_LOCAL_CONSTANT_EXT* = 0x000087C3 - GL_LOCAL_EXT* = 0x000087C4 - GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087C5 - GL_MAX_VERTEX_SHADER_VARIANTS_EXT* = 0x000087C6 - GL_MAX_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087C7 - GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087C8 - GL_MAX_VERTEX_SHADER_LOCALS_EXT* = 0x000087C9 - GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087CA - GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT* = 0x000087CB - GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087CC - GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087CD - GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT* = 0x000087CE - GL_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087CF - GL_VERTEX_SHADER_VARIANTS_EXT* = 0x000087D0 - GL_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087D1 - GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087D2 - GL_VERTEX_SHADER_LOCALS_EXT* = 0x000087D3 - GL_VERTEX_SHADER_BINDING_EXT* = 0x00008781 - GL_VERTEX_SHADER_OPTIMIZED_EXT* = 0x000087D4 - GL_X_EXT* = 0x000087D5 - GL_Y_EXT* = 0x000087D6 - GL_Z_EXT* = 0x000087D7 - GL_W_EXT* = 0x000087D8 - GL_NEGATIVE_X_EXT* = 0x000087D9 - GL_NEGATIVE_Y_EXT* = 0x000087DA - GL_NEGATIVE_Z_EXT* = 0x000087DB - GL_NEGATIVE_W_EXT* = 0x000087DC - GL_ZERO_EXT* = 0x000087DD - GL_ONE_EXT* = 0x000087DE - GL_NEGATIVE_ONE_EXT* = 0x000087DF - GL_NORMALIZED_RANGE_EXT* = 0x000087E0 - GL_FULL_RANGE_EXT* = 0x000087E1 - GL_CURRENT_VERTEX_EXT* = 0x000087E2 - GL_MVP_MATRIX_EXT* = 0x000087E3 - -proc glBeginVertexShaderEXT*(){.dynlib: dllname, - importc: "glBeginVertexShaderEXT".} -proc glEndVertexShaderEXT*(){.dynlib: dllname, importc: "glEndVertexShaderEXT".} -proc glBindVertexShaderEXT*(id: TGLuint){.dynlib: dllname, - importc: "glBindVertexShaderEXT".} -proc glGenVertexShadersEXT*(range: TGLuint): TGLuint{.dynlib: dllname, - importc: "glGenVertexShadersEXT".} -proc glDeleteVertexShaderEXT*(id: TGLuint){.dynlib: dllname, - importc: "glDeleteVertexShaderEXT".} -proc glShaderOp1EXT*(op: TGLenum, res: TGLuint, arg1: TGLuint){.dynlib: dllname, - importc: "glShaderOp1EXT".} -proc glShaderOp2EXT*(op: TGLenum, res: TGLuint, arg1: TGLuint, arg2: TGLuint){. - dynlib: dllname, importc: "glShaderOp2EXT".} -proc glShaderOp3EXT*(op: TGLenum, res: TGLuint, arg1: TGLuint, arg2: TGLuint, - arg3: TGLuint){.dynlib: dllname, importc: "glShaderOp3EXT".} -proc glSwizzleEXT*(res: TGLuint, theIn: TGLuint, outX: TGLenum, outY: TGLenum, - outZ: TGLenum, outW: TGLenum){.dynlib: dllname, - importc: "glSwizzleEXT".} -proc glWriteMaskEXT*(res: TGLuint, theIn: TGLuint, outX: TGLenum, outY: TGLenum, - outZ: TGLenum, outW: TGLenum){.dynlib: dllname, - importc: "glWriteMaskEXT".} -proc glInsertComponentEXT*(res: TGLuint, src: TGLuint, num: TGLuint){. - dynlib: dllname, importc: "glInsertComponentEXT".} -proc glExtractComponentEXT*(res: TGLuint, src: TGLuint, num: TGLuint){. - dynlib: dllname, importc: "glExtractComponentEXT".} -proc glGenSymbolsEXT*(datatype: TGLenum, storagetype: TGLenum, range: TGLenum, - components: TGLuint): TGLuint{.dynlib: dllname, - importc: "glGenSymbolsEXT".} -proc glSetInvariantEXT*(id: TGLuint, thetype: TGLenum, address: PGLvoid){. - dynlib: dllname, importc: "glSetInvariantEXT".} -proc glSetLocalConstantEXT*(id: TGLuint, thetype: TGLenum, address: PGLvoid){. - dynlib: dllname, importc: "glSetLocalConstantEXT".} -proc glVariantbvEXT*(id: TGLuint, address: PGLbyte){.dynlib: dllname, - importc: "glVariantbvEXT".} -proc glVariantsvEXT*(id: TGLuint, address: PGLshort){.dynlib: dllname, - importc: "glVariantsvEXT".} -proc glVariantivEXT*(id: TGLuint, address: PGLint){.dynlib: dllname, - importc: "glVariantivEXT".} -proc glVariantfvEXT*(id: TGLuint, address: PGLfloat){.dynlib: dllname, - importc: "glVariantfvEXT".} -proc glVariantdvEXT*(id: TGLuint, address: PGLdouble){.dynlib: dllname, - importc: "glVariantdvEXT".} -proc glVariantubvEXT*(id: TGLuint, address: PGLubyte){.dynlib: dllname, - importc: "glVariantubvEXT".} -proc glVariantusvEXT*(id: TGLuint, address: PGLushort){.dynlib: dllname, - importc: "glVariantusvEXT".} -proc glVariantuivEXT*(id: TGLuint, address: PGLuint){.dynlib: dllname, - importc: "glVariantuivEXT".} -proc glVariantPointerEXT*(id: TGLuint, thetype: TGLenum, stride: TGLuint, - address: PGLvoid){.dynlib: dllname, - importc: "glVariantPointerEXT".} -proc glEnableVariantClientStateEXT*(id: TGLuint){.dynlib: dllname, - importc: "glEnableVariantClientStateEXT".} -proc glDisableVariantClientStateEXT*(id: TGLuint){.dynlib: dllname, - importc: "glDisableVariantClientStateEXT".} -proc glBindLightParameterEXT*(light: TGLenum, value: TGLenum): TGLuint{. - dynlib: dllname, importc: "glBindLightParameterEXT".} -proc glBindMaterialParameterEXT*(face: TGLenum, value: TGLenum): TGLuint{. - dynlib: dllname, importc: "glBindMaterialParameterEXT".} -proc glBindTexGenParameterEXT*(theunit: TGLenum, coord: TGLenum, value: TGLenum): TGLuint{. - dynlib: dllname, importc: "glBindTexGenParameterEXT".} -proc glBindTextureUnitParameterEXT*(theunit: TGLenum, value: TGLenum): TGLuint{. - dynlib: dllname, importc: "glBindTextureUnitParameterEXT".} -proc glBindParameterEXT*(value: TGLenum): TGLuint{.dynlib: dllname, - importc: "glBindParameterEXT".} -proc glIsVariantEnabledEXT*(id: TGLuint, cap: TGLenum): TGLboolean{. - dynlib: dllname, importc: "glIsVariantEnabledEXT".} -proc glGetVariantBooleanvEXT*(id: TGLuint, value: TGLenum, data: PGLboolean){. - dynlib: dllname, importc: "glGetVariantBooleanvEXT".} -proc glGetVariantIntegervEXT*(id: TGLuint, value: TGLenum, data: PGLint){. - dynlib: dllname, importc: "glGetVariantIntegervEXT".} -proc glGetVariantFloatvEXT*(id: TGLuint, value: TGLenum, data: PGLfloat){. - dynlib: dllname, importc: "glGetVariantFloatvEXT".} -proc glGetVariantPointervEXT*(id: TGLuint, value: TGLenum, data: PGLvoid){. - dynlib: dllname, importc: "glGetVariantPointervEXT".} -proc glGetInvariantBooleanvEXT*(id: TGLuint, value: TGLenum, data: PGLboolean){. - dynlib: dllname, importc: "glGetInvariantBooleanvEXT".} -proc glGetInvariantIntegervEXT*(id: TGLuint, value: TGLenum, data: PGLint){. - dynlib: dllname, importc: "glGetInvariantIntegervEXT".} -proc glGetInvariantFloatvEXT*(id: TGLuint, value: TGLenum, data: PGLfloat){. - dynlib: dllname, importc: "glGetInvariantFloatvEXT".} -proc glGetLocalConstantBooleanvEXT*(id: TGLuint, value: TGLenum, - data: PGLboolean){.dynlib: dllname, - importc: "glGetLocalConstantBooleanvEXT".} -proc glGetLocalConstantIntegervEXT*(id: TGLuint, value: TGLenum, data: PGLint){. - dynlib: dllname, importc: "glGetLocalConstantIntegervEXT".} -proc glGetLocalConstantFloatvEXT*(id: TGLuint, value: TGLenum, data: PGLfloat){. - dynlib: dllname, importc: "glGetLocalConstantFloatvEXT".} - #***** GL_EXT_vertex_weighting *****// -const - GL_VERTEX_WEIGHTING_EXT* = 0x00008509 - GL_MODELVIEW0_EXT* = 0x00001700 - GL_MODELVIEW1_EXT* = 0x0000850A - GL_MODELVIEW0_MATRIX_EXT* = 0x00000BA6 - GL_MODELVIEW1_MATRIX_EXT* = 0x00008506 - GL_CURRENT_VERTEX_WEIGHT_EXT* = 0x0000850B - GL_VERTEX_WEIGHT_ARRAY_EXT* = 0x0000850C - GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT* = 0x0000850D - GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT* = 0x0000850E - GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT* = 0x0000850F - GL_MODELVIEW0_STACK_DEPTH_EXT* = 0x00000BA3 - GL_MODELVIEW1_STACK_DEPTH_EXT* = 0x00008502 - GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT* = 0x00008510 - -proc glVertexWeightfEXT*(weight: TGLfloat){.dynlib: dllname, - importc: "glVertexWeightfEXT".} -proc glVertexWeightfvEXT*(weight: PGLfloat){.dynlib: dllname, - importc: "glVertexWeightfvEXT".} -proc glVertexWeightPointerEXT*(size: TGLint, thetype: TGLenum, stride: TGLsizei, - pointer: PGLvoid){.dynlib: dllname, - importc: "glVertexWeightPointerEXT".} - #***** GL_HP_occlusion_test *****// -const - GL_OCCLUSION_TEST_HP* = 0x00008165 - GL_OCCLUSION_TEST_RESULT_HP* = 0x00008166 - #***** GL_NV_blend_square *****// - #***** GL_NV_copy_depth_to_color *****// - -const - GL_DEPTH_STENCIL_TO_RGBA_NV* = 0x0000886E - GL_DEPTH_STENCIL_TO_BGRA_NV* = 0x0000886F - #***** GL_NV_depth_clamp *****// - -const - GL_DEPTH_CLAMP_NV* = 0x0000864F - #***** GL_NV_evaluators *****// - -const - GL_EVAL_2D_NV* = 0x000086C0 - GL_EVAL_TRIANGULAR_2D_NV* = 0x000086C1 - GL_MAP_TESSELLATION_NV* = 0x000086C2 - GL_MAP_ATTRIB_U_ORDER_NV* = 0x000086C3 - GL_MAP_ATTRIB_V_ORDER_NV* = 0x000086C4 - GL_EVAL_FRACTIONAL_TESSELLATION_NV* = 0x000086C5 - GL_EVAL_VERTEX_ATTRIB0_NV* = 0x000086C6 - GL_EVAL_VERTEX_ATTRIB1_NV* = 0x000086C7 - GL_EVAL_VERTEX_ATTRIB2_NV* = 0x000086C8 - GL_EVAL_VERTEX_ATTRIB3_NV* = 0x000086C9 - GL_EVAL_VERTEX_ATTRIB4_NV* = 0x000086CA - GL_EVAL_VERTEX_ATTRIB5_NV* = 0x000086CB - GL_EVAL_VERTEX_ATTRIB6_NV* = 0x000086CC - GL_EVAL_VERTEX_ATTRIB7_NV* = 0x000086CD - GL_EVAL_VERTEX_ATTRIB8_NV* = 0x000086CE - GL_EVAL_VERTEX_ATTRIB9_NV* = 0x000086CF - GL_EVAL_VERTEX_ATTRIB10_NV* = 0x000086D0 - GL_EVAL_VERTEX_ATTRIB11_NV* = 0x000086D1 - GL_EVAL_VERTEX_ATTRIB12_NV* = 0x000086D2 - GL_EVAL_VERTEX_ATTRIB13_NV* = 0x000086D3 - GL_EVAL_VERTEX_ATTRIB14_NV* = 0x000086D4 - GL_EVAL_VERTEX_ATTRIB15_NV* = 0x000086D5 - GL_MAX_MAP_TESSELLATION_NV* = 0x000086D6 - GL_MAX_RATIONAL_EVAL_ORDER_NV* = 0x000086D7 - -proc glMapControlPointsNV*(target: TGLenum, index: TGLuint, thetype: TGLenum, - ustride: TGLsizei, vstride: TGLsizei, uorder: TGLint, - vorder: TGLint, thepacked: TGLboolean, - points: PGLvoid){.dynlib: dllname, - importc: "glMapControlPointsNV".} -proc glMapParameterivNV*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glMapParameterivNV".} -proc glMapParameterfvNV*(target: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glMapParameterfvNV".} -proc glGetMapControlPointsNV*(target: TGLenum, index: TGLuint, thetype: TGLenum, - ustride: TGLsizei, vstride: TGLsizei, - thepacked: TGLboolean, points: PGLvoid){. - dynlib: dllname, importc: "glGetMapControlPointsNV".} -proc glGetMapParameterivNV*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetMapParameterivNV".} -proc glGetMapParameterfvNV*(target: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetMapParameterfvNV".} -proc glGetMapAttribParameterivNV*(target: TGLenum, index: TGLuint, - pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetMapAttribParameterivNV".} -proc glGetMapAttribParameterfvNV*(target: TGLenum, index: TGLuint, - pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetMapAttribParameterfvNV".} -proc glEvalMapsNV*(target: TGLenum, mode: TGLenum){.dynlib: dllname, - importc: "glEvalMapsNV".} - #***** GL_NV_fence *****// -const - GL_ALL_COMPLETED_NV* = 0x000084F2 - GL_FENCE_STATUS_NV* = 0x000084F3 - GL_FENCE_CONDITION_NV* = 0x000084F4 - -proc glGenFencesNV*(n: TGLsizei, fences: PGLuint){.dynlib: dllname, - importc: "glGenFencesNV".} -proc glDeleteFencesNV*(n: TGLsizei, fences: PGLuint){.dynlib: dllname, - importc: "glDeleteFencesNV".} -proc glSetFenceNV*(fence: TGLuint, condition: TGLenum){.dynlib: dllname, - importc: "glSetFenceNV".} -proc glTestFenceNV*(fence: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glTestFenceNV".} -proc glFinishFenceNV*(fence: TGLuint){.dynlib: dllname, - importc: "glFinishFenceNV".} -proc glIsFenceNV*(fence: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsFenceNV".} -proc glGetFenceivNV*(fence: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetFenceivNV".} - #***** GL_NV_fog_distance *****// -const - GL_FOG_DISTANCE_MODE_NV* = 0x0000855A - GL_EYE_RADIAL_NV* = 0x0000855B - GL_EYE_PLANE_ABSOLUTE_NV* = 0x0000855C - #***** GL_NV_light_max_exponent *****// - -const - GL_MAX_SHININESS_NV* = 0x00008504 - GL_MAX_SPOT_EXPONENT_NV* = 0x00008505 - #***** GL_NV_multisample_filter_hint *****// - -const - GL_MULTISAMPLE_FILTER_HINT_NV* = 0x00008534 - #***** GL_NV_occlusion_query *****// - # GL_OCCLUSION_TEST_HP { already defined } - # GL_OCCLUSION_TEST_RESULT_HP { already defined } - -const - GL_PIXEL_COUNTER_BITS_NV* = 0x00008864 - GL_CURRENT_OCCLUSION_QUERY_ID_NV* = 0x00008865 - GL_PIXEL_COUNT_NV* = 0x00008866 - GL_PIXEL_COUNT_AVAILABLE_NV* = 0x00008867 - -proc glGenOcclusionQueriesNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glGenOcclusionQueriesNV".} -proc glDeleteOcclusionQueriesNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glDeleteOcclusionQueriesNV".} -proc glIsOcclusionQueryNV*(id: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsOcclusionQueryNV".} -proc glBeginOcclusionQueryNV*(id: TGLuint){.dynlib: dllname, - importc: "glBeginOcclusionQueryNV".} -proc glEndOcclusionQueryNV*(){.dynlib: dllname, importc: "glEndOcclusionQueryNV".} -proc glGetOcclusionQueryivNV*(id: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetOcclusionQueryivNV".} -proc glGetOcclusionQueryuivNV*(id: TGLuint, pname: TGLenum, params: PGLuint){. - dynlib: dllname, importc: "glGetOcclusionQueryuivNV".} - #***** GL_NV_packed_depth_stencil *****// -const - GL_DEPTH_STENCIL_NV* = 0x000084F9 - GL_UNSIGNED_INT_24_8_NV* = 0x000084FA - #***** GL_NV_point_sprite *****// - -const - GL_POINT_SPRITE_NV* = 0x00008861 - GL_COORD_REPLACE_NV* = 0x00008862 - GL_POINT_SPRITE_R_MODE_NV* = 0x00008863 - -proc glPointParameteriNV*(pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glPointParameteriNV".} -proc glPointParameterivNV*(pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glPointParameterivNV".} - #***** GL_NV_register_combiners *****// -const - GL_REGISTER_COMBINERS_NV* = 0x00008522 - GL_COMBINER0_NV* = 0x00008550 - GL_COMBINER1_NV* = 0x00008551 - GL_COMBINER2_NV* = 0x00008552 - GL_COMBINER3_NV* = 0x00008553 - GL_COMBINER4_NV* = 0x00008554 - GL_COMBINER5_NV* = 0x00008555 - GL_COMBINER6_NV* = 0x00008556 - GL_COMBINER7_NV* = 0x00008557 - GL_VARIABLE_A_NV* = 0x00008523 - GL_VARIABLE_B_NV* = 0x00008524 - GL_VARIABLE_C_NV* = 0x00008525 - GL_VARIABLE_D_NV* = 0x00008526 - GL_VARIABLE_E_NV* = 0x00008527 - GL_VARIABLE_F_NV* = 0x00008528 - GL_VARIABLE_G_NV* = 0x00008529 - GL_CONSTANT_COLOR0_NV* = 0x0000852A - GL_CONSTANT_COLOR1_NV* = 0x0000852B - GL_PRIMARY_COLOR_NV* = 0x0000852C - GL_SECONDARY_COLOR_NV* = 0x0000852D - GL_SPARE0_NV* = 0x0000852E - GL_SPARE1_NV* = 0x0000852F - GL_UNSIGNED_IDENTITY_NV* = 0x00008536 - GL_UNSIGNED_INVERT_NV* = 0x00008537 - GL_EXPAND_NORMAL_NV* = 0x00008538 - GL_EXPAND_NEGATE_NV* = 0x00008539 - GL_HALF_BIAS_NORMAL_NV* = 0x0000853A - GL_HALF_BIAS_NEGATE_NV* = 0x0000853B - GL_SIGNED_IDENTITY_NV* = 0x0000853C - GL_SIGNED_NEGATE_NV* = 0x0000853D - GL_E_TIMES_F_NV* = 0x00008531 - GL_SPARE0_PLUS_SECONDARY_COLOR_NV* = 0x00008532 - GL_SCALE_BY_TWO_NV* = 0x0000853E - GL_SCALE_BY_FOUR_NV* = 0x0000853F - GL_SCALE_BY_ONE_HALF_NV* = 0x00008540 - GL_BIAS_BY_NEGATIVE_ONE_HALF_NV* = 0x00008541 - GL_DISCARD_NV* = 0x00008530 - constGL_COMBINER_INPUT_NV* = 0x00008542 - GL_COMBINER_MAPPING_NV* = 0x00008543 - GL_COMBINER_COMPONENT_USAGE_NV* = 0x00008544 - GL_COMBINER_AB_DOT_PRODUCT_NV* = 0x00008545 - GL_COMBINER_CD_DOT_PRODUCT_NV* = 0x00008546 - GL_COMBINER_MUX_SUM_NV* = 0x00008547 - GL_COMBINER_SCALE_NV* = 0x00008548 - GL_COMBINER_BIAS_NV* = 0x00008549 - GL_COMBINER_AB_OUTPUT_NV* = 0x0000854A - GL_COMBINER_CD_OUTPUT_NV* = 0x0000854B - GL_COMBINER_SUM_OUTPUT_NV* = 0x0000854C - GL_NUM_GENERAL_COMBINERS_NV* = 0x0000854E - GL_COLOR_SUM_CLAMP_NV* = 0x0000854F - GL_MAX_GENERAL_COMBINERS_NV* = 0x0000854D - -proc glCombinerParameterfvNV*(pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glCombinerParameterfvNV".} -proc glCombinerParameterivNV*(pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glCombinerParameterivNV".} -proc glCombinerParameterfNV*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glCombinerParameterfNV".} -proc glCombinerParameteriNV*(pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glCombinerParameteriNV".} -proc glCombinerInputNV*(stage: TGLenum, portion: TGLenum, variable: TGLenum, - input: TGLenum, mapping: TGLenum, - componentUsage: TGLenum){.dynlib: dllname, - importc: "glCombinerInputNV".} -proc glCombinerOutputNV*(stage: TGLenum, portion: TGLenum, abOutput: TGLenum, - cdOutput: TGLenum, sumOutput: TGLenum, scale: TGLenum, - bias: TGLenum, abDotProduct: TGLboolean, - cdDotProduct: TGLboolean, muxSum: TGLboolean){. - dynlib: dllname, importc: "glCombinerOutputNV".} -proc glFinalCombinerInputNV*(variable: TGLenum, input: TGLenum, - mapping: TGLenum, componentUsage: TGLenum){. - dynlib: dllname, importc: "glFinalCombinerInputNV".} -proc glGetCombinerInputParameterfvNV*(stage: TGLenum, portion: TGLenum, - variable: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetCombinerInputParameterfvNV".} -proc glGetCombinerInputParameterivNV*(stage: TGLenum, portion: TGLenum, - variable: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetCombinerInputParameterivNV".} -proc glGetCombinerOutputParameterfvNV*(stage: TGLenum, portion: TGLenum, - pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetCombinerOutputParameterfvNV".} -proc glGetCombinerOutputParameterivNV*(stage: TGLenum, portion: TGLenum, - pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetCombinerOutputParameterivNV".} -proc glGetFinalCombinerInputParameterfvNV*(variable: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetFinalCombinerInputParameterfvNV".} -proc glGetFinalCombinerInputParameterivNV*(variable: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetFinalCombinerInputParameterivNV".} - #***** GL_NV_register_combiners2 *****// -const - GL_PER_STAGE_CONSTANTS_NV* = 0x00008535 - -proc glCombinerStageParameterfvNV*(stage: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glCombinerStageParameterfvNV".} -proc glGetCombinerStageParameterfvNV*(stage: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetCombinerStageParameterfvNV".} - #***** GL_NV_texgen_emboss *****// -const - GL_EMBOSS_MAP_NV* = 0x0000855F - GL_EMBOSS_LIGHT_NV* = 0x0000855D - GL_EMBOSS_CONSTANT_NV* = 0x0000855E - #***** GL_NV_texgen_reflection *****// - -const - GL_NORMAL_MAP_NV* = 0x00008511 - GL_REFLECTION_MAP_NV* = 0x00008512 - #***** GL_NV_texture_compression_vtc *****// - # GL_COMPRESSED_RGB_S3TC_DXT1_EXT { already defined } - # GL_COMPRESSED_RGBA_S3TC_DXT1_EXT { already defined } - # GL_COMPRESSED_RGBA_S3TC_DXT3_EXT { already defined } - # GL_COMPRESSED_RGBA_S3TC_DXT5_EXT { already defined } - #***** GL_NV_texture_env_combine4 *****// - -const - GL_COMBINE4_NV* = 0x00008503 - GL_SOURCE3_RGB_NV* = 0x00008583 - GL_SOURCE3_ALPHA_NV* = 0x0000858B - GL_OPERAND3_RGB_NV* = 0x00008593 - GL_OPERAND3_ALPHA_NV* = 0x0000859B - #***** GL_NV_texture_rectangle *****// - -const - GL_TEXTURE_RECTANGLE_NV* = 0x000084F5 - GL_TEXTURE_BINDING_RECTANGLE_NV* = 0x000084F6 - GL_PROXY_TEXTURE_RECTANGLE_NV* = 0x000084F7 - GL_MAX_RECTANGLE_TEXTURE_SIZE_NV* = 0x000084F8 - #***** GL_NV_texture_shader *****// - -const - GL_TEXTURE_SHADER_NV* = 0x000086DE - GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV* = 0x000086D9 - GL_SHADER_OPERATION_NV* = 0x000086DF - GL_CULL_MODES_NV* = 0x000086E0 - GL_OFFSET_TEXTURE_MATRIX_NV* = 0x000086E1 - GL_OFFSET_TEXTURE_SCALE_NV* = 0x000086E2 - GL_OFFSET_TEXTURE_BIAS_NV* = 0x000086E3 - GL_PREVIOUS_TEXTURE_INPUT_NV* = 0x000086E4 - GL_CONST_EYE_NV* = 0x000086E5 - GL_SHADER_CONSISTENT_NV* = 0x000086DD - GL_PASS_THROUGH_NV* = 0x000086E6 - GL_CULL_FRAGMENT_NV* = 0x000086E7 - GL_OFFSET_TEXTURE_2D_NV* = 0x000086E8 - GL_OFFSET_TEXTURE_RECTANGLE_NV* = 0x0000864C - GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV* = 0x0000864D - GL_DEPENDENT_AR_TEXTURE_2D_NV* = 0x000086E9 - GL_DEPENDENT_GB_TEXTURE_2D_NV* = 0x000086EA - GL_DOT_PRODUCT_NV* = 0x000086EC - GL_DOT_PRODUCT_DEPTH_REPLACE_NV* = 0x000086ED - GL_DOT_PRODUCT_TEXTURE_2D_NV* = 0x000086EE - GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV* = 0x0000864E - GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV* = 0x000086F0 - GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV* = 0x000086F1 - GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV* = 0x000086F2 - GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV* = 0x000086F3 - GL_HILO_NV* = 0x000086F4 - GL_DSDT_NV* = 0x000086F5 - GL_DSDT_MAG_NV* = 0x000086F6 - GL_DSDT_MAG_VIB_NV* = 0x000086F7 - GL_UNSIGNED_INT_S8_S8_8_8_NV* = 0x000086DA - GL_UNSIGNED_INT_8_8_S8_S8_REV_NV* = 0x000086DB - GL_SIGNED_RGBA_NV* = 0x000086FB - GL_SIGNED_RGBA8_NV* = 0x000086FC - GL_SIGNED_RGB_NV* = 0x000086FE - GL_SIGNED_RGB8_NV* = 0x000086FF - GL_SIGNED_LUMINANCE_NV* = 0x00008701 - GL_SIGNED_LUMINANCE8_NV* = 0x00008702 - GL_SIGNED_LUMINANCE_ALPHA_NV* = 0x00008703 - GL_SIGNED_LUMINANCE8_ALPHA8_NV* = 0x00008704 - GL_SIGNED_ALPHA_NV* = 0x00008705 - GL_SIGNED_ALPHA8_NV* = 0x00008706 - GL_SIGNED_INTENSITY_NV* = 0x00008707 - GL_SIGNED_INTENSITY8_NV* = 0x00008708 - GL_SIGNED_RGB_UNSIGNED_ALPHA_NV* = 0x0000870C - GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV* = 0x0000870D - GL_HILO16_NV* = 0x000086F8 - GL_SIGNED_HILO_NV* = 0x000086F9 - GL_SIGNED_HILO16_NV* = 0x000086FA - GL_DSDT8_NV* = 0x00008709 - GL_DSDT8_MAG8_NV* = 0x0000870A - GL_DSDT_MAG_INTENSITY_NV* = 0x000086DC - GL_DSDT8_MAG8_INTENSITY8_NV* = 0x0000870B - GL_HI_SCALE_NV* = 0x0000870E - GL_LO_SCALE_NV* = 0x0000870F - GL_DS_SCALE_NV* = 0x00008710 - GL_DT_SCALE_NV* = 0x00008711 - GL_MAGNITUDE_SCALE_NV* = 0x00008712 - GL_VIBRANCE_SCALE_NV* = 0x00008713 - GL_HI_BIAS_NV* = 0x00008714 - GL_LO_BIAS_NV* = 0x00008715 - GL_DS_BIAS_NV* = 0x00008716 - GL_DT_BIAS_NV* = 0x00008717 - GL_MAGNITUDE_BIAS_NV* = 0x00008718 - GL_VIBRANCE_BIAS_NV* = 0x00008719 - GL_TEXTURE_BORDER_VALUES_NV* = 0x0000871A - GL_TEXTURE_HI_SIZE_NV* = 0x0000871B - GL_TEXTURE_LO_SIZE_NV* = 0x0000871C - GL_TEXTURE_DS_SIZE_NV* = 0x0000871D - GL_TEXTURE_DT_SIZE_NV* = 0x0000871E - GL_TEXTURE_MAG_SIZE_NV* = 0x0000871F - #***** GL_NV_texture_shader2 *****// - -const - GL_DOT_PRODUCT_TEXTURE_3D_NV* = 0x000086EF # GL_HILO_NV { already defined } - # GL_DSDT_NV { already defined } - # GL_DSDT_MAG_NV { already defined } - # GL_DSDT_MAG_VIB_NV { already defined } - # GL_UNSIGNED_INT_S8_S8_8_8_NV { already defined } - # GL_UNSIGNED_INT_8_8_S8_S8_REV_NV { already defined } - # GL_SIGNED_RGBA_NV { already defined } - # GL_SIGNED_RGBA8_NV { already defined } - # GL_SIGNED_RGB_NV { already defined } - # GL_SIGNED_RGB8_NV { already defined } - # GL_SIGNED_LUMINANCE_NV { already defined } - # GL_SIGNED_LUMINANCE8_NV { already defined } - # GL_SIGNED_LUMINANCE_ALPHA_NV { already defined } - # GL_SIGNED_LUMINANCE8_ALPHA8_NV { already defined } - # GL_SIGNED_ALPHA_NV { already defined } - # GL_SIGNED_ALPHA8_NV { already defined } - # GL_SIGNED_INTENSITY_NV { already defined } - # GL_SIGNED_INTENSITY8_NV { already defined } - # GL_SIGNED_RGB_UNSIGNED_ALPHA_NV { already defined } - # GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV { already defined } - # GL_HILO16_NV { already defined } - # GL_SIGNED_HILO_NV { already defined } - # GL_SIGNED_HILO16_NV { already defined } - # GL_DSDT8_NV { already defined } - # GL_DSDT8_MAG8_NV { already defined } - # GL_DSDT_MAG_INTENSITY_NV { already defined } - # GL_DSDT8_MAG8_INTENSITY8_NV { already defined } - #***** GL_NV_texture_shader3 *****// - -const - GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV* = 0x00008850 - GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV* = 0x00008851 - GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV* = 0x00008852 - GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV* = 0x00008853 - GL_OFFSET_HILO_TEXTURE_2D_NV* = 0x00008854 - GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV* = 0x00008855 - GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV* = 0x00008856 - GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV* = 0x00008857 - GL_DEPENDENT_HILO_TEXTURE_2D_NV* = 0x00008858 - GL_DEPENDENT_RGB_TEXTURE_3D_NV* = 0x00008859 - GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV* = 0x0000885A - GL_DOT_PRODUCT_PASS_THROUGH_NV* = 0x0000885B - GL_DOT_PRODUCT_TEXTURE_1D_NV* = 0x0000885C - GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV* = 0x0000885D - GL_HILO8_NV* = 0x0000885E - GL_SIGNED_HILO8_NV* = 0x0000885F - GL_FORCE_BLUE_TO_ONE_NV* = 0x00008860 - #***** GL_NV_vertex_array_range *****// - -const - constGL_VERTEX_ARRAY_RANGE_NV* = 0x0000851D - GL_VERTEX_ARRAY_RANGE_LENGTH_NV* = 0x0000851E - GL_VERTEX_ARRAY_RANGE_VALID_NV* = 0x0000851F - GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV* = 0x00008520 - GL_VERTEX_ARRAY_RANGE_POINTER_NV* = 0x00008521 - -proc glVertexArrayRangeNV*(len: TGLsizei, pointer: PGLvoid){.dynlib: dllname, - importc: "glVertexArrayRangeNV".} -proc glFlushVertexArrayRangeNV*(){.dynlib: dllname, - importc: "glFlushVertexArrayRangeNV".} - #***** GL_NV_vertex_array_range2 *****// -const - GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV* = 0x00008533 - #***** GL_NV_vertex_program *****// - -const - GL_VERTEX_PROGRAM_NV* = 0x00008620 - GL_VERTEX_PROGRAM_POINT_SIZE_NV* = 0x00008642 - GL_VERTEX_PROGRAM_TWO_SIDE_NV* = 0x00008643 - GL_VERTEX_STATE_PROGRAM_NV* = 0x00008621 - GL_ATTRIB_ARRAY_SIZE_NV* = 0x00008623 - GL_ATTRIB_ARRAY_STRIDE_NV* = 0x00008624 - GL_ATTRIB_ARRAY_TYPE_NV* = 0x00008625 - GL_CURRENT_ATTRIB_NV* = 0x00008626 - GL_PROGRAM_PARAMETER_NV* = 0x00008644 - GL_ATTRIB_ARRAY_POINTER_NV* = 0x00008645 - GL_PROGRAM_TARGET_NV* = 0x00008646 - GL_PROGRAM_LENGTH_NV* = 0x00008627 - GL_PROGRAM_RESIDENT_NV* = 0x00008647 - GL_PROGRAM_STRING_NV* = 0x00008628 - constGL_TRACK_MATRIX_NV* = 0x00008648 - GL_TRACK_MATRIX_TRANSFORM_NV* = 0x00008649 - GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV* = 0x0000862E - GL_MAX_TRACK_MATRICES_NV* = 0x0000862F - GL_CURRENT_MATRIX_STACK_DEPTH_NV* = 0x00008640 - GL_CURRENT_MATRIX_NV* = 0x00008641 - GL_VERTEX_PROGRAM_BINDING_NV* = 0x0000864A - GL_PROGRAM_ERROR_POSITION_NV* = 0x0000864B - GL_MODELVIEW_PROJECTION_NV* = 0x00008629 - GL_MATRIX0_NV* = 0x00008630 - GL_MATRIX1_NV* = 0x00008631 - GL_MATRIX2_NV* = 0x00008632 - GL_MATRIX3_NV* = 0x00008633 - GL_MATRIX4_NV* = 0x00008634 - GL_MATRIX5_NV* = 0x00008635 - GL_MATRIX6_NV* = 0x00008636 - GL_MATRIX7_NV* = 0x00008637 - GL_IDENTITY_NV* = 0x0000862A - GL_INVERSE_NV* = 0x0000862B - GL_TRANSPOSE_NV* = 0x0000862C - GL_INVERSE_TRANSPOSE_NV* = 0x0000862D - GL_VERTEX_ATTRIB_ARRAY0_NV* = 0x00008650 - GL_VERTEX_ATTRIB_ARRAY1_NV* = 0x00008651 - GL_VERTEX_ATTRIB_ARRAY2_NV* = 0x00008652 - GL_VERTEX_ATTRIB_ARRAY3_NV* = 0x00008653 - GL_VERTEX_ATTRIB_ARRAY4_NV* = 0x00008654 - GL_VERTEX_ATTRIB_ARRAY5_NV* = 0x00008655 - GL_VERTEX_ATTRIB_ARRAY6_NV* = 0x00008656 - GL_VERTEX_ATTRIB_ARRAY7_NV* = 0x00008657 - GL_VERTEX_ATTRIB_ARRAY8_NV* = 0x00008658 - GL_VERTEX_ATTRIB_ARRAY9_NV* = 0x00008659 - GL_VERTEX_ATTRIB_ARRAY10_NV* = 0x0000865A - GL_VERTEX_ATTRIB_ARRAY11_NV* = 0x0000865B - GL_VERTEX_ATTRIB_ARRAY12_NV* = 0x0000865C - GL_VERTEX_ATTRIB_ARRAY13_NV* = 0x0000865D - GL_VERTEX_ATTRIB_ARRAY14_NV* = 0x0000865E - GL_VERTEX_ATTRIB_ARRAY15_NV* = 0x0000865F - GL_MAP1_VERTEX_ATTRIB0_4_NV* = 0x00008660 - GL_MAP1_VERTEX_ATTRIB1_4_NV* = 0x00008661 - GL_MAP1_VERTEX_ATTRIB2_4_NV* = 0x00008662 - GL_MAP1_VERTEX_ATTRIB3_4_NV* = 0x00008663 - GL_MAP1_VERTEX_ATTRIB4_4_NV* = 0x00008664 - GL_MAP1_VERTEX_ATTRIB5_4_NV* = 0x00008665 - GL_MAP1_VERTEX_ATTRIB6_4_NV* = 0x00008666 - GL_MAP1_VERTEX_ATTRIB7_4_NV* = 0x00008667 - GL_MAP1_VERTEX_ATTRIB8_4_NV* = 0x00008668 - GL_MAP1_VERTEX_ATTRIB9_4_NV* = 0x00008669 - GL_MAP1_VERTEX_ATTRIB10_4_NV* = 0x0000866A - GL_MAP1_VERTEX_ATTRIB11_4_NV* = 0x0000866B - GL_MAP1_VERTEX_ATTRIB12_4_NV* = 0x0000866C - GL_MAP1_VERTEX_ATTRIB13_4_NV* = 0x0000866D - GL_MAP1_VERTEX_ATTRIB14_4_NV* = 0x0000866E - GL_MAP1_VERTEX_ATTRIB15_4_NV* = 0x0000866F - GL_MAP2_VERTEX_ATTRIB0_4_NV* = 0x00008670 - GL_MAP2_VERTEX_ATTRIB1_4_NV* = 0x00008671 - GL_MAP2_VERTEX_ATTRIB2_4_NV* = 0x00008672 - GL_MAP2_VERTEX_ATTRIB3_4_NV* = 0x00008673 - GL_MAP2_VERTEX_ATTRIB4_4_NV* = 0x00008674 - GL_MAP2_VERTEX_ATTRIB5_4_NV* = 0x00008675 - GL_MAP2_VERTEX_ATTRIB6_4_NV* = 0x00008676 - GL_MAP2_VERTEX_ATTRIB7_4_NV* = 0x00008677 - GL_MAP2_VERTEX_ATTRIB8_4_NV* = 0x00008678 - GL_MAP2_VERTEX_ATTRIB9_4_NV* = 0x00008679 - GL_MAP2_VERTEX_ATTRIB10_4_NV* = 0x0000867A - GL_MAP2_VERTEX_ATTRIB11_4_NV* = 0x0000867B - GL_MAP2_VERTEX_ATTRIB12_4_NV* = 0x0000867C - GL_MAP2_VERTEX_ATTRIB13_4_NV* = 0x0000867D - GL_MAP2_VERTEX_ATTRIB14_4_NV* = 0x0000867E - GL_MAP2_VERTEX_ATTRIB15_4_NV* = 0x0000867F - -proc glBindProgramNV*(target: TGLenum, id: TGLuint){.dynlib: dllname, - importc: "glBindProgramNV".} -proc glDeleteProgramsNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glDeleteProgramsNV".} -proc glExecuteProgramNV*(target: TGLenum, id: TGLuint, params: PGLfloat){. - dynlib: dllname, importc: "glExecuteProgramNV".} -proc glGenProgramsNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glGenProgramsNV".} -proc glAreProgramsResidentNV*(n: TGLsizei, ids: PGLuint, residences: PGLboolean): TGLboolean{. - dynlib: dllname, importc: "glAreProgramsResidentNV".} -proc glRequestResidentProgramsNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glRequestResidentProgramsNV".} -proc glGetProgramParameterfvNV*(target: TGLenum, index: TGLuint, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetProgramParameterfvNV".} -proc glGetProgramParameterdvNV*(target: TGLenum, index: TGLuint, pname: TGLenum, - params: PGLdouble){.dynlib: dllname, - importc: "glGetProgramParameterdvNV".} -proc glGetProgramivNV*(id: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetProgramivNV".} -proc glGetProgramStringNV*(id: TGLuint, pname: TGLenum, theProgram: PGLubyte){. - dynlib: dllname, importc: "glGetProgramStringNV".} -proc glGetTrackMatrixivNV*(target: TGLenum, address: TGLuint, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetTrackMatrixivNV".} -proc glGetVertexAttribdvNV*(index: TGLuint, pname: TGLenum, params: PGLdouble){. - dynlib: dllname, importc: "glGetVertexAttribdvNV".} -proc glGetVertexAttribfvNV*(index: TGLuint, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetVertexAttribfvNV".} -proc glGetVertexAttribivNV*(index: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetVertexAttribivNV".} -proc glGetVertexAttribPointervNV*(index: TGLuint, pname: TGLenum, - pointer: PGLvoid){.dynlib: dllname, - importc: "glGetVertexAttribPointervNV".} -proc glIsProgramNV*(id: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsProgramNV".} -proc glLoadProgramNV*(target: TGLenum, id: TGLuint, length: TGLsizei, - theProgram: PGLubyte){.dynlib: dllname, - importc: "glLoadProgramNV".} -proc glProgramParameter4fNV*(target: TGLenum, index: TGLuint, x: TGLfloat, - y: TGLfloat, z: TGLfloat, w: TGLfloat){. - dynlib: dllname, importc: "glProgramParameter4fNV".} -proc glProgramParameter4fvNV*(target: TGLenum, index: TGLuint, params: PGLfloat){. - dynlib: dllname, importc: "glProgramParameter4fvNV".} -proc glProgramParameters4dvNV*(target: TGLenum, index: TGLuint, num: TGLuint, - params: PGLdouble){.dynlib: dllname, - importc: "glProgramParameters4dvNV".} -proc glProgramParameters4fvNV*(target: TGLenum, index: TGLuint, num: TGLuint, - params: PGLfloat){.dynlib: dllname, - importc: "glProgramParameters4fvNV".} -proc glTrackMatrixNV*(target: TGLenum, address: TGLuint, matrix: TGLenum, - transform: TGLenum){.dynlib: dllname, - importc: "glTrackMatrixNV".} -proc glVertexAttribPointerNV*(index: TGLuint, size: TGLint, thetype: TGLenum, - stride: TGLsizei, pointer: PGLvoid){. - dynlib: dllname, importc: "glVertexAttribPointerNV".} -proc glVertexAttrib1sNV*(index: TGLuint, x: TGLshort){.dynlib: dllname, - importc: "glVertexAttrib1sNV".} -proc glVertexAttrib1fNV*(index: TGLuint, x: TGLfloat){.dynlib: dllname, - importc: "glVertexAttrib1fNV".} -proc glVertexAttrib1dNV*(index: TGLuint, x: TGLdouble){.dynlib: dllname, - importc: "glVertexAttrib1dNV".} -proc glVertexAttrib2sNV*(index: TGLuint, x: TGLshort, y: TGLshort){. - dynlib: dllname, importc: "glVertexAttrib2sNV".} -proc glVertexAttrib2fNV*(index: TGLuint, x: TGLfloat, y: TGLfloat){. - dynlib: dllname, importc: "glVertexAttrib2fNV".} -proc glVertexAttrib2dNV*(index: TGLuint, x: TGLdouble, y: TGLdouble){. - dynlib: dllname, importc: "glVertexAttrib2dNV".} -proc glVertexAttrib3sNV*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort){. - dynlib: dllname, importc: "glVertexAttrib3sNV".} -proc glVertexAttrib3fNV*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glVertexAttrib3fNV".} -proc glVertexAttrib3dNV*(index: TGLuint, x: TGLdouble, y: TGLdouble, - z: TGLdouble){.dynlib: dllname, - importc: "glVertexAttrib3dNV".} -proc glVertexAttrib4sNV*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort, - w: TGLshort){.dynlib: dllname, - importc: "glVertexAttrib4sNV".} -proc glVertexAttrib4fNV*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat, - w: TGLfloat){.dynlib: dllname, - importc: "glVertexAttrib4fNV".} -proc glVertexAttrib4dNV*(index: TGLuint, x: TGLdouble, y: TGLdouble, - z: TGLdouble, w: TGLdouble){.dynlib: dllname, - importc: "glVertexAttrib4dNV".} -proc glVertexAttrib4ubNV*(index: TGLuint, x: TGLubyte, y: TGLubyte, z: TGLubyte, - w: TGLubyte){.dynlib: dllname, - importc: "glVertexAttrib4ubNV".} -proc glVertexAttrib1svNV*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib1svNV".} -proc glVertexAttrib1fvNV*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib1fvNV".} -proc glVertexAttrib1dvNV*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib1dvNV".} -proc glVertexAttrib2svNV*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib2svNV".} -proc glVertexAttrib2fvNV*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib2fvNV".} -proc glVertexAttrib2dvNV*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib2dvNV".} -proc glVertexAttrib3svNV*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib3svNV".} -proc glVertexAttrib3fvNV*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib3fvNV".} -proc glVertexAttrib3dvNV*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib3dvNV".} -proc glVertexAttrib4svNV*(index: TGLuint, v: PGLshort){.dynlib: dllname, - importc: "glVertexAttrib4svNV".} -proc glVertexAttrib4fvNV*(index: TGLuint, v: PGLfloat){.dynlib: dllname, - importc: "glVertexAttrib4fvNV".} -proc glVertexAttrib4dvNV*(index: TGLuint, v: PGLdouble){.dynlib: dllname, - importc: "glVertexAttrib4dvNV".} -proc glVertexAttrib4ubvNV*(index: TGLuint, v: PGLubyte){.dynlib: dllname, - importc: "glVertexAttrib4ubvNV".} -proc glVertexAttribs1svNV*(index: TGLuint, n: TGLsizei, v: PGLshort){. - dynlib: dllname, importc: "glVertexAttribs1svNV".} -proc glVertexAttribs1fvNV*(index: TGLuint, n: TGLsizei, v: PGLfloat){. - dynlib: dllname, importc: "glVertexAttribs1fvNV".} -proc glVertexAttribs1dvNV*(index: TGLuint, n: TGLsizei, v: PGLdouble){. - dynlib: dllname, importc: "glVertexAttribs1dvNV".} -proc glVertexAttribs2svNV*(index: TGLuint, n: TGLsizei, v: PGLshort){. - dynlib: dllname, importc: "glVertexAttribs2svNV".} -proc glVertexAttribs2fvNV*(index: TGLuint, n: TGLsizei, v: PGLfloat){. - dynlib: dllname, importc: "glVertexAttribs2fvNV".} -proc glVertexAttribs2dvNV*(index: TGLuint, n: TGLsizei, v: PGLdouble){. - dynlib: dllname, importc: "glVertexAttribs2dvNV".} -proc glVertexAttribs3svNV*(index: TGLuint, n: TGLsizei, v: PGLshort){. - dynlib: dllname, importc: "glVertexAttribs3svNV".} -proc glVertexAttribs3fvNV*(index: TGLuint, n: TGLsizei, v: PGLfloat){. - dynlib: dllname, importc: "glVertexAttribs3fvNV".} -proc glVertexAttribs3dvNV*(index: TGLuint, n: TGLsizei, v: PGLdouble){. - dynlib: dllname, importc: "glVertexAttribs3dvNV".} -proc glVertexAttribs4svNV*(index: TGLuint, n: TGLsizei, v: PGLshort){. - dynlib: dllname, importc: "glVertexAttribs4svNV".} -proc glVertexAttribs4fvNV*(index: TGLuint, n: TGLsizei, v: PGLfloat){. - dynlib: dllname, importc: "glVertexAttribs4fvNV".} -proc glVertexAttribs4dvNV*(index: TGLuint, n: TGLsizei, v: PGLdouble){. - dynlib: dllname, importc: "glVertexAttribs4dvNV".} -proc glVertexAttribs4ubvNV*(index: TGLuint, n: TGLsizei, v: PGLubyte){. - dynlib: dllname, importc: "glVertexAttribs4ubvNV".} - #***** GL_NV_vertex_program1_1 *****// - #***** GL_ATI_element_array *****// -const - GL_ELEMENT_ARRAY_ATI* = 0x00008768 - GL_ELEMENT_ARRAY_TYPE_ATI* = 0x00008769 - GL_ELEMENT_ARRAY_POINTER_ATI* = 0x0000876A - -proc glElementPointerATI*(thetype: TGLenum, pointer: PGLvoid){.dynlib: dllname, - importc: "glElementPointerATI".} -proc glDrawElementArrayATI*(mode: TGLenum, count: TGLsizei){.dynlib: dllname, - importc: "glDrawElementArrayATI".} -proc glDrawRangeElementArrayATI*(mode: TGLenum, start: TGLuint, theend: TGLuint, - count: TGLsizei){.dynlib: dllname, - importc: "glDrawRangeElementArrayATI".} - #***** GL_ATI_envmap_bumpmap *****// -const - GL_BUMP_ROT_MATRIX_ATI* = 0x00008775 - GL_BUMP_ROT_MATRIX_SIZE_ATI* = 0x00008776 - GL_BUMP_NUM_TEX_UNITS_ATI* = 0x00008777 - GL_BUMP_TEX_UNITS_ATI* = 0x00008778 - GL_DUDV_ATI* = 0x00008779 - GL_DU8DV8_ATI* = 0x0000877A - GL_BUMP_ENVMAP_ATI* = 0x0000877B - GL_BUMP_TARGET_ATI* = 0x0000877C - -proc glTexBumpParameterivATI*(pname: TGLenum, param: PGLint){.dynlib: dllname, - importc: "glTexBumpParameterivATI".} -proc glTexBumpParameterfvATI*(pname: TGLenum, param: PGLfloat){.dynlib: dllname, - importc: "glTexBumpParameterfvATI".} -proc glGetTexBumpParameterivATI*(pname: TGLenum, param: PGLint){. - dynlib: dllname, importc: "glGetTexBumpParameterivATI".} -proc glGetTexBumpParameterfvATI*(pname: TGLenum, param: PGLfloat){. - dynlib: dllname, importc: "glGetTexBumpParameterfvATI".} - #***** GL_ATI_fragment_shader *****// -const - GL_FRAGMENT_SHADER_ATI* = 0x00008920 - GL_REG_0_ATI* = 0x00008921 - GL_REG_1_ATI* = 0x00008922 - GL_REG_2_ATI* = 0x00008923 - GL_REG_3_ATI* = 0x00008924 - GL_REG_4_ATI* = 0x00008925 - GL_REG_5_ATI* = 0x00008926 - GL_CON_0_ATI* = 0x00008941 - GL_CON_1_ATI* = 0x00008942 - GL_CON_2_ATI* = 0x00008943 - GL_CON_3_ATI* = 0x00008944 - GL_CON_4_ATI* = 0x00008945 - GL_CON_5_ATI* = 0x00008946 - GL_CON_6_ATI* = 0x00008947 - GL_CON_7_ATI* = 0x00008948 - GL_MOV_ATI* = 0x00008961 - GL_ADD_ATI* = 0x00008963 - GL_MUL_ATI* = 0x00008964 - GL_SUB_ATI* = 0x00008965 - GL_DOT3_ATI* = 0x00008966 - GL_DOT4_ATI* = 0x00008967 - GL_MAD_ATI* = 0x00008968 - GL_LERP_ATI* = 0x00008969 - GL_CND_ATI* = 0x0000896A - GL_CND0_ATI* = 0x0000896B - GL_DOT2_ADD_ATI* = 0x0000896C - GL_SECONDARY_INTERPOLATOR_ATI* = 0x0000896D - GL_SWIZZLE_STR_ATI* = 0x00008976 - GL_SWIZZLE_STQ_ATI* = 0x00008977 - GL_SWIZZLE_STR_DR_ATI* = 0x00008978 - GL_SWIZZLE_STQ_DQ_ATI* = 0x00008979 - GL_RED_BIT_ATI* = 0x00000001 - GL_GREEN_BIT_ATI* = 0x00000002 - GL_BLUE_BIT_ATI* = 0x00000004 - GL_2X_BIT_ATI* = 0x00000001 - GL_4X_BIT_ATI* = 0x00000002 - GL_8X_BIT_ATI* = 0x00000004 - GL_HALF_BIT_ATI* = 0x00000008 - GL_QUARTER_BIT_ATI* = 0x00000010 - GL_EIGHTH_BIT_ATI* = 0x00000020 - GL_SATURATE_BIT_ATI* = 0x00000040 # GL_2X_BIT_ATI { already defined } - GL_COMP_BIT_ATI* = 0x00000002 - GL_NEGATE_BIT_ATI* = 0x00000004 - GL_BIAS_BIT_ATI* = 0x00000008 - -proc glGenFragmentShadersATI*(range: TGLuint): TGLuint{.dynlib: dllname, - importc: "glGenFragmentShadersATI".} -proc glBindFragmentShaderATI*(id: TGLuint){.dynlib: dllname, - importc: "glBindFragmentShaderATI".} -proc glDeleteFragmentShaderATI*(id: TGLuint){.dynlib: dllname, - importc: "glDeleteFragmentShaderATI".} -proc glBeginFragmentShaderATI*(){.dynlib: dllname, - importc: "glBeginFragmentShaderATI".} -proc glEndFragmentShaderATI*(){.dynlib: dllname, - importc: "glEndFragmentShaderATI".} -proc glPassTexCoordATI*(dst: TGLuint, coord: TGLuint, swizzle: TGLenum){. - dynlib: dllname, importc: "glPassTexCoordATI".} -proc glSampleMapATI*(dst: TGLuint, interp: TGLuint, swizzle: TGLenum){. - dynlib: dllname, importc: "glSampleMapATI".} -proc glColorFragmentOp1ATI*(op: TGLenum, dst: TGLuint, dstMask: TGLuint, - dstMod: TGLuint, arg1: TGLuint, arg1Rep: TGLuint, - arg1Mod: TGLuint){.dynlib: dllname, - importc: "glColorFragmentOp1ATI".} -proc glColorFragmentOp2ATI*(op: TGLenum, dst: TGLuint, dstMask: TGLuint, - dstMod: TGLuint, arg1: TGLuint, arg1Rep: TGLuint, - arg1Mod: TGLuint, arg2: TGLuint, arg2Rep: TGLuint, - arg2Mod: TGLuint){.dynlib: dllname, - importc: "glColorFragmentOp2ATI".} -proc glColorFragmentOp3ATI*(op: TGLenum, dst: TGLuint, dstMask: TGLuint, - dstMod: TGLuint, arg1: TGLuint, arg1Rep: TGLuint, - arg1Mod: TGLuint, arg2: TGLuint, arg2Rep: TGLuint, - arg2Mod: TGLuint, arg3: TGLuint, arg3Rep: TGLuint, - arg3Mod: TGLuint){.dynlib: dllname, - importc: "glColorFragmentOp3ATI".} -proc glAlphaFragmentOp1ATI*(op: TGLenum, dst: TGLuint, dstMod: TGLuint, - arg1: TGLuint, arg1Rep: TGLuint, arg1Mod: TGLuint){. - dynlib: dllname, importc: "glAlphaFragmentOp1ATI".} -proc glAlphaFragmentOp2ATI*(op: TGLenum, dst: TGLuint, dstMod: TGLuint, - arg1: TGLuint, arg1Rep: TGLuint, arg1Mod: TGLuint, - arg2: TGLuint, arg2Rep: TGLuint, arg2Mod: TGLuint){. - dynlib: dllname, importc: "glAlphaFragmentOp2ATI".} -proc glAlphaFragmentOp3ATI*(op: TGLenum, dst: TGLuint, dstMod: TGLuint, - arg1: TGLuint, arg1Rep: TGLuint, arg1Mod: TGLuint, - arg2: TGLuint, arg2Rep: TGLuint, arg2Mod: TGLuint, - arg3: TGLuint, arg3Rep: TGLuint, arg3Mod: TGLuint){. - dynlib: dllname, importc: "glAlphaFragmentOp3ATI".} -proc glSetFragmentShaderConstantATI*(dst: TGLuint, value: PGLfloat){. - dynlib: dllname, importc: "glSetFragmentShaderConstantATI".} - #***** GL_ATI_pn_triangles *****// -const - GL_PN_TRIANGLES_ATI* = 0x000087F0 - GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI* = 0x000087F1 - GL_PN_TRIANGLES_POINT_MODE_ATI* = 0x000087F2 - GL_PN_TRIANGLES_NORMAL_MODE_ATI* = 0x000087F3 - GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI* = 0x000087F4 - GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI* = 0x000087F5 - GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI* = 0x000087F6 - GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI* = 0x000087F7 - GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI* = 0x000087F8 - -proc glPNTrianglesiATI*(pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glPNTrianglesiATI".} -proc glPNTrianglesfATI*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glPNTrianglesfATI".} - #***** GL_ATI_texture_mirror_once *****// -const - GL_MIRROR_CLAMP_ATI* = 0x00008742 - GL_MIRROR_CLAMP_TO_EDGE_ATI* = 0x00008743 - #***** GL_ATI_vertex_array_object *****// - -const - GL_STATIC_ATI* = 0x00008760 - GL_DYNAMIC_ATI* = 0x00008761 - GL_PRESERVE_ATI* = 0x00008762 - GL_DISCARD_ATI* = 0x00008763 - GL_OBJECT_BUFFER_SIZE_ATI* = 0x00008764 - GL_OBJECT_BUFFER_USAGE_ATI* = 0x00008765 - GL_ARRAY_OBJECT_BUFFER_ATI* = 0x00008766 - GL_ARRAY_OBJECT_OFFSET_ATI* = 0x00008767 - -proc glNewObjectBufferATI*(size: TGLsizei, pointer: PGLvoid, usage: TGLenum): TGLuint{. - dynlib: dllname, importc: "glNewObjectBufferATI".} -proc glIsObjectBufferATI*(buffer: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsObjectBufferATI".} -proc glUpdateObjectBufferATI*(buffer: TGLuint, offset: TGLuint, size: TGLsizei, - pointer: PGLvoid, preserve: TGLenum){. - dynlib: dllname, importc: "glUpdateObjectBufferATI".} -proc glGetObjectBufferfvATI*(buffer: TGLuint, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetObjectBufferfvATI".} -proc glGetObjectBufferivATI*(buffer: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetObjectBufferivATI".} -proc glDeleteObjectBufferATI*(buffer: TGLuint){.dynlib: dllname, - importc: "glDeleteObjectBufferATI".} -proc glArrayObjectATI*(thearray: TGLenum, size: TGLint, thetype: TGLenum, - stride: TGLsizei, buffer: TGLuint, offset: TGLuint){. - dynlib: dllname, importc: "glArrayObjectATI".} -proc glGetArrayObjectfvATI*(thearray: TGLenum, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetArrayObjectfvATI".} -proc glGetArrayObjectivATI*(thearray: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetArrayObjectivATI".} -proc glVariantArrayObjectATI*(id: TGLuint, thetype: TGLenum, stride: TGLsizei, - buffer: TGLuint, offset: TGLuint){. - dynlib: dllname, importc: "glVariantArrayObjectATI".} -proc glGetVariantArrayObjectfvATI*(id: TGLuint, pname: TGLenum, params: PGLfloat){. - dynlib: dllname, importc: "glGetVariantArrayObjectfvATI".} -proc glGetVariantArrayObjectivATI*(id: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetVariantArrayObjectivATI".} - #***** GL_ATI_vertex_streams *****// -const - GL_MAX_VERTEX_STREAMS_ATI* = 0x0000876B - GL_VERTEX_STREAM0_ATI* = 0x0000876C - GL_VERTEX_STREAM1_ATI* = 0x0000876D - GL_VERTEX_STREAM2_ATI* = 0x0000876E - GL_VERTEX_STREAM3_ATI* = 0x0000876F - GL_VERTEX_STREAM4_ATI* = 0x00008770 - GL_VERTEX_STREAM5_ATI* = 0x00008771 - GL_VERTEX_STREAM6_ATI* = 0x00008772 - GL_VERTEX_STREAM7_ATI* = 0x00008773 - GL_VERTEX_SOURCE_ATI* = 0x00008774 - -proc glVertexStream1s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glVertexStream1s".} -proc glVertexStream1i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glVertexStream1i".} -proc glVertexStream1f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glVertexStream1f".} -proc glVertexStream1d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glVertexStream1d".} -proc glVertexStream1sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glVertexStream1sv".} -proc glVertexStream1iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glVertexStream1iv".} -proc glVertexStream1fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glVertexStream1fv".} -proc glVertexStream1dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glVertexStream1dv".} -proc glVertexStream2s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glVertexStream2s".} -proc glVertexStream2i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glVertexStream2i".} -proc glVertexStream2f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glVertexStream2f".} -proc glVertexStream2d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glVertexStream2d".} -proc glVertexStream2sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glVertexStream2sv".} -proc glVertexStream2iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glVertexStream2iv".} -proc glVertexStream2fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glVertexStream2fv".} -proc glVertexStream2dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glVertexStream2dv".} -proc glVertexStream3s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glVertexStream3s".} -proc glVertexStream3i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glVertexStream3i".} -proc glVertexStream3f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glVertexStream3f".} -proc glVertexStream3d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glVertexStream3d".} -proc glVertexStream3sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glVertexStream3sv".} -proc glVertexStream3iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glVertexStream3iv".} -proc glVertexStream3fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glVertexStream3fv".} -proc glVertexStream3dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glVertexStream3dv".} -proc glVertexStream4s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glVertexStream4s".} -proc glVertexStream4i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glVertexStream4i".} -proc glVertexStream4f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glVertexStream4f".} -proc glVertexStream4d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glVertexStream4d".} -proc glVertexStream4sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glVertexStream4sv".} -proc glVertexStream4iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glVertexStream4iv".} -proc glVertexStream4fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glVertexStream4fv".} -proc glVertexStream4dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glVertexStream4dv".} -proc glNormalStream3b*(stream: TGLenum, coords: TGLByte){.dynlib: dllname, - importc: "glNormalStream3b".} -proc glNormalStream3s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glNormalStream3s".} -proc glNormalStream3i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glNormalStream3i".} -proc glNormalStream3f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glNormalStream3f".} -proc glNormalStream3d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glNormalStream3d".} -proc glNormalStream3bv*(stream: TGLenum, coords: TGLByte){.dynlib: dllname, - importc: "glNormalStream3bv".} -proc glNormalStream3sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, - importc: "glNormalStream3sv".} -proc glNormalStream3iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, - importc: "glNormalStream3iv".} -proc glNormalStream3fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, - importc: "glNormalStream3fv".} -proc glNormalStream3dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, - importc: "glNormalStream3dv".} -proc glClientActiveVertexStream*(stream: TGLenum){.dynlib: dllname, - importc: "glClientActiveVertexStream".} -proc glVertexBlendEnvi*(pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glVertexBlendEnvi".} -proc glVertexBlendEnvf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glVertexBlendEnvf".} - #***** GL_3DFX_texture_compression_FXT1 *****// -const - GL_COMPRESSED_RGB_FXT1_3DFX* = 0x000086B0 - GL_COMPRESSED_RGBA_FXT1_3DFX* = 0x000086B1 - #***** GL_IBM_cull_vertex *****// - -const - GL_CULL_VERTEX_IBM* = 0x0001928A - #***** GL_IBM_multimode_draw_arrays *****// - -proc glMultiModeDrawArraysIBM*(mode: PGLenum, first: PGLint, count: PGLsizei, - primcount: TGLsizei, modestride: TGLint){. - dynlib: dllname, importc: "glMultiModeDrawArraysIBM".} -proc glMultiModeDrawElementsIBM*(mode: PGLenum, count: PGLsizei, - thetype: TGLenum, indices: PGLvoid, - primcount: TGLsizei, modestride: TGLint){. - dynlib: dllname, importc: "glMultiModeDrawElementsIBM".} - #***** GL_IBM_raster_pos_clip *****// -const - GL_RASTER_POSITION_UNCLIPPED_IBM* = 0x00019262 - #***** GL_IBM_texture_mirrored_repeat *****// - -const - GL_MIRRORED_REPEAT_IBM* = 0x00008370 - #***** GL_IBM_vertex_array_lists *****// - -const - GL_VERTEX_ARRAY_LIST_IBM* = 0x0001929E - GL_NORMAL_ARRAY_LIST_IBM* = 0x0001929F - GL_COLOR_ARRAY_LIST_IBM* = 0x000192A0 - GL_INDEX_ARRAY_LIST_IBM* = 0x000192A1 - GL_TEXTURE_COORD_ARRAY_LIST_IBM* = 0x000192A2 - GL_EDGE_FLAG_ARRAY_LIST_IBM* = 0x000192A3 - GL_FOG_COORDINATE_ARRAY_LIST_IBM* = 0x000192A4 - GL_SECONDARY_COLOR_ARRAY_LIST_IBM* = 0x000192A5 - GL_VERTEX_ARRAY_LIST_STRIDE_IBM* = 0x000192A8 - GL_NORMAL_ARRAY_LIST_STRIDE_IBM* = 0x000192A9 - GL_COLOR_ARRAY_LIST_STRIDE_IBM* = 0x000192AA - GL_INDEX_ARRAY_LIST_STRIDE_IBM* = 0x000192AB - GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM* = 0x000192AC - GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM* = 0x000192AD - GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM* = 0x000192AE - GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM* = 0x000192AF - -proc glColorPointerListIBM*(size: TGLint, thetype: TGLenum, stride: TGLint, - pointer: PGLvoid, ptrstride: TGLint){. - dynlib: dllname, importc: "glColorPointerListIBM".} -proc glSecondaryColorPointerListIBM*(size: TGLint, thetype: TGLenum, - stride: TGLint, pointer: PGLvoid, - ptrstride: TGLint){.dynlib: dllname, - importc: "glSecondaryColorPointerListIBM".} -proc glEdgeFlagPointerListIBM*(stride: TGLint, pointer: PGLboolean, - ptrstride: TGLint){.dynlib: dllname, - importc: "glEdgeFlagPointerListIBM".} -proc glFogCoordPointerListIBM*(thetype: TGLenum, stride: TGLint, - pointer: PGLvoid, ptrstride: TGLint){. - dynlib: dllname, importc: "glFogCoordPointerListIBM".} -proc glNormalPointerListIBM*(thetype: TGLenum, stride: TGLint, pointer: PGLvoid, - ptrstride: TGLint){.dynlib: dllname, - importc: "glNormalPointerListIBM".} -proc glTexCoordPointerListIBM*(size: TGLint, thetype: TGLenum, stride: TGLint, - pointer: PGLvoid, ptrstride: TGLint){. - dynlib: dllname, importc: "glTexCoordPointerListIBM".} -proc glVertexPointerListIBM*(size: TGLint, thetype: TGLenum, stride: TGLint, - pointer: PGLvoid, ptrstride: TGLint){. - dynlib: dllname, importc: "glVertexPointerListIBM".} - #***** GL_MESA_resize_buffers *****// -proc glResizeBuffersMESA*(){.dynlib: dllname, importc: "glResizeBuffersMESA".} - #***** GL_MESA_window_pos *****// -proc glWindowPos2dMESA*(x: TGLdouble, y: TGLdouble){.dynlib: dllname, - importc: "glWindowPos2dMESA".} -proc glWindowPos2fMESA*(x: TGLfloat, y: TGLfloat){.dynlib: dllname, - importc: "glWindowPos2fMESA".} -proc glWindowPos2iMESA*(x: TGLint, y: TGLint){.dynlib: dllname, - importc: "glWindowPos2iMESA".} -proc glWindowPos2sMESA*(x: TGLshort, y: TGLshort){.dynlib: dllname, - importc: "glWindowPos2sMESA".} -proc glWindowPos2ivMESA*(p: PGLint){.dynlib: dllname, - importc: "glWindowPos2ivMESA".} -proc glWindowPos2svMESA*(p: PGLshort){.dynlib: dllname, - importc: "glWindowPos2svMESA".} -proc glWindowPos2fvMESA*(p: PGLfloat){.dynlib: dllname, - importc: "glWindowPos2fvMESA".} -proc glWindowPos2dvMESA*(p: PGLdouble){.dynlib: dllname, - importc: "glWindowPos2dvMESA".} -proc glWindowPos3iMESA*(x: TGLint, y: TGLint, z: TGLint){.dynlib: dllname, - importc: "glWindowPos3iMESA".} -proc glWindowPos3sMESA*(x: TGLshort, y: TGLshort, z: TGLshort){.dynlib: dllname, - importc: "glWindowPos3sMESA".} -proc glWindowPos3fMESA*(x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, - importc: "glWindowPos3fMESA".} -proc glWindowPos3dMESA*(x: TGLdouble, y: TGLdouble, z: TGLdouble){. - dynlib: dllname, importc: "glWindowPos3dMESA".} -proc glWindowPos3ivMESA*(p: PGLint){.dynlib: dllname, - importc: "glWindowPos3ivMESA".} -proc glWindowPos3svMESA*(p: PGLshort){.dynlib: dllname, - importc: "glWindowPos3svMESA".} -proc glWindowPos3fvMESA*(p: PGLfloat){.dynlib: dllname, - importc: "glWindowPos3fvMESA".} -proc glWindowPos3dvMESA*(p: PGLdouble){.dynlib: dllname, - importc: "glWindowPos3dvMESA".} -proc glWindowPos4iMESA*(x: TGLint, y: TGLint, z: TGLint, w: TGLint){. - dynlib: dllname, importc: "glWindowPos4iMESA".} -proc glWindowPos4sMESA*(x: TGLshort, y: TGLshort, z: TGLshort, w: TGLshort){. - dynlib: dllname, importc: "glWindowPos4sMESA".} -proc glWindowPos4fMESA*(x: TGLfloat, y: TGLfloat, z: TGLfloat, w: TGLfloat){. - dynlib: dllname, importc: "glWindowPos4fMESA".} -proc glWindowPos4dMESA*(x: TGLdouble, y: TGLdouble, z: TGLdouble, w: TGLdouble){. - dynlib: dllname, importc: "glWindowPos4dMESA".} -proc glWindowPos4ivMESA*(p: PGLint){.dynlib: dllname, - importc: "glWindowPos4ivMESA".} -proc glWindowPos4svMESA*(p: PGLshort){.dynlib: dllname, - importc: "glWindowPos4svMESA".} -proc glWindowPos4fvMESA*(p: PGLfloat){.dynlib: dllname, - importc: "glWindowPos4fvMESA".} -proc glWindowPos4dvMESA*(p: PGLdouble){.dynlib: dllname, - importc: "glWindowPos4dvMESA".} - #***** GL_OML_interlace *****// -const - GL_INTERLACE_OML* = 0x00008980 - GL_INTERLACE_READ_OML* = 0x00008981 - #***** GL_OML_resample *****// - -const - GL_PACK_RESAMPLE_OML* = 0x00008984 - GL_UNPACK_RESAMPLE_OML* = 0x00008985 - GL_RESAMPLE_REPLICATE_OML* = 0x00008986 - GL_RESAMPLE_ZERO_FILL_OML* = 0x00008987 - GL_RESAMPLE_AVERAGE_OML* = 0x00008988 - GL_RESAMPLE_DECIMATE_OML* = 0x00008989 # GL_RESAMPLE_AVERAGE_OML { already defined } - #***** GL_OML_subsample *****// - -const - GL_FORMAT_SUBSAMPLE_24_24_OML* = 0x00008982 - GL_FORMAT_SUBSAMPLE_244_244_OML* = 0x00008983 - #***** GL_SGIS_generate_mipmap *****// - -const - GL_GENERATE_MIPMAP_SGIS* = 0x00008191 - GL_GENERATE_MIPMAP_HINT_SGIS* = 0x00008192 - #***** GL_SGIS_multisample *****// - -const - GLX_SAMPLE_BUFFERS_SGIS* = 0x000186A0 - GLX_SAMPLES_SGIS* = 0x000186A1 - GL_MULTISAMPLE_SGIS* = 0x0000809D - GL_SAMPLE_ALPHA_TO_MASK_SGIS* = 0x0000809E - GL_SAMPLE_ALPHA_TO_ONE_SGIS* = 0x0000809F - constGL_SAMPLE_MASK_SGIS* = 0x000080A0 - GL_MULTISAMPLE_BIT_EXT* = 0x20000000 - GL_1PASS_SGIS* = 0x000080A1 - GL_2PASS_0_SGIS* = 0x000080A2 - GL_2PASS_1_SGIS* = 0x000080A3 - GL_4PASS_0_SGIS* = 0x000080A4 - GL_4PASS_1_SGIS* = 0x000080A5 - GL_4PASS_2_SGIS* = 0x000080A6 - GL_4PASS_3_SGIS* = 0x000080A7 - GL_SAMPLE_BUFFERS_SGIS* = 0x000080A8 - GL_SAMPLES_SGIS* = 0x000080A9 - GL_SAMPLE_MASK_VALUE_SGIS* = 0x000080AA - GL_SAMPLE_MASK_INVERT_SGIS* = 0x000080AB - constGL_SAMPLE_PATTERN_SGIS* = 0x000080AC - -proc glSampleMaskSGIS*(value: TGLclampf, invert: TGLboolean){.dynlib: dllname, - importc: "glSampleMaskSGIS".} -proc glSamplePatternSGIS*(pattern: TGLenum){.dynlib: dllname, - importc: "glSamplePatternSGIS".} - #***** GL_SGIS_pixel_texture *****// -const - GL_PIXEL_TEXTURE_SGIS* = 0x00008353 - GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS* = 0x00008354 - GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS* = 0x00008355 - GL_PIXEL_GROUP_COLOR_SGIS* = 0x00008356 - -proc glPixelTexGenParameteriSGIS*(pname: TGLenum, param: TGLint){. - dynlib: dllname, importc: "glPixelTexGenParameteriSGIS".} -proc glPixelTexGenParameterfSGIS*(pname: TGLenum, param: TGLfloat){. - dynlib: dllname, importc: "glPixelTexGenParameterfSGIS".} -proc glGetPixelTexGenParameterivSGIS*(pname: TGLenum, params: TGLint){. - dynlib: dllname, importc: "glGetPixelTexGenParameterivSGIS".} -proc glGetPixelTexGenParameterfvSGIS*(pname: TGLenum, params: TGLfloat){. - dynlib: dllname, importc: "glGetPixelTexGenParameterfvSGIS".} - #***** GL_SGIS_texture_border_clamp *****// - # GL_CLAMP_TO_BORDER_SGIS { already defined } - #***** GL_SGIS_texture_color_mask *****// -const - GL_TEXTURE_COLOR_WRITEMASK_SGIS* = 0x000081EF - -proc glTextureColorMaskSGIS*(r: TGLboolean, g: TGLboolean, b: TGLboolean, - a: TGLboolean){.dynlib: dllname, - importc: "glTextureColorMaskSGIS".} - #***** GL_SGIS_texture_edge_clamp *****// -const - GL_CLAMP_TO_EDGE_SGIS* = 0x0000812F - #***** GL_SGIS_texture_lod *****// - -const - GL_TEXTURE_MIN_LOD_SGIS* = 0x0000813A - GL_TEXTURE_MAX_LOD_SGIS* = 0x0000813B - GL_TEXTURE_BASE_LEVEL_SGIS* = 0x0000813C - GL_TEXTURE_MAX_LEVEL_SGIS* = 0x0000813D - #***** GL_SGIS_depth_texture *****// - -const - GL_DEPTH_COMPONENT16_SGIX* = 0x000081A5 - GL_DEPTH_COMPONENT24_SGIX* = 0x000081A6 - GL_DEPTH_COMPONENT32_SGIX* = 0x000081A7 - #***** GL_SGIX_fog_offset *****// - -const - GL_FOG_OFFSET_SGIX* = 0x00008198 - GL_FOG_OFFSET_VALUE_SGIX* = 0x00008199 - #***** GL_SGIX_interlace *****// - -const - GL_INTERLACE_SGIX* = 0x00008094 - #***** GL_SGIX_shadow_ambient *****// - -const - GL_SHADOW_AMBIENT_SGIX* = 0x000080BF - #***** GL_SGI_color_matrix *****// - -const - GL_COLOR_MATRIX_SGI* = 0x000080B1 - GL_COLOR_MATRIX_STACK_DEPTH_SGI* = 0x000080B2 - GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI* = 0x000080B3 - GL_POST_COLOR_MATRIX_RED_SCALE_SGI* = 0x000080B4 - GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI* = 0x000080B5 - GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI* = 0x000080B6 - GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI* = 0x000080B7 - GL_POST_COLOR_MATRIX_RED_BIAS_SGI* = 0x000080B8 - GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI* = 0x000080B9 - GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI* = 0x000080BA - GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI* = 0x000080BB - #***** GL_SGI_color_table *****// - -const - constGL_COLOR_TABLE_SGI* = 0x000080D0 - GL_POST_CONVOLUTION_COLOR_TABLE_SGI* = 0x000080D1 - GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI* = 0x000080D2 - GL_PROXY_COLOR_TABLE_SGI* = 0x000080D3 - GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI* = 0x000080D4 - GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI* = 0x000080D5 - GL_COLOR_TABLE_SCALE_SGI* = 0x000080D6 - GL_COLOR_TABLE_BIAS_SGI* = 0x000080D7 - GL_COLOR_TABLE_FORMAT_SGI* = 0x000080D8 - GL_COLOR_TABLE_WIDTH_SGI* = 0x000080D9 - GL_COLOR_TABLE_RED_SIZE_SGI* = 0x000080DA - GL_COLOR_TABLE_GREEN_SIZE_SGI* = 0x000080DB - GL_COLOR_TABLE_BLUE_SIZE_SGI* = 0x000080DC - GL_COLOR_TABLE_ALPHA_SIZE_SGI* = 0x000080DD - GL_COLOR_TABLE_LUMINANCE_SIZE_SGI* = 0x000080DE - GL_COLOR_TABLE_INTENSITY_SIZE_SGI* = 0x000080DF - -proc glColorTableSGI*(target: TGLenum, internalformat: TGLenum, width: TGLsizei, - format: TGLenum, thetype: TGLenum, table: PGLvoid){. - dynlib: dllname, importc: "glColorTableSGI".} -proc glCopyColorTableSGI*(target: TGLenum, internalformat: TGLenum, x: TGLint, - y: TGLint, width: TGLsizei){.dynlib: dllname, - importc: "glCopyColorTableSGI".} -proc glColorTableParameterivSGI*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glColorTableParameterivSGI".} -proc glColorTableParameterfvSGI*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glColorTableParameterfvSGI".} -proc glGetColorTableSGI*(target: TGLenum, format: TGLenum, thetype: TGLenum, - table: PGLvoid){.dynlib: dllname, - importc: "glGetColorTableSGI".} -proc glGetColorTableParameterivSGI*(target: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetColorTableParameterivSGI".} -proc glGetColorTableParameterfvSGI*(target: TGLenum, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetColorTableParameterfvSGI".} - #***** GL_SGI_texture_color_table *****// -const - GL_TEXTURE_COLOR_TABLE_SGI* = 0x000080BC - GL_PROXY_TEXTURE_COLOR_TABLE_SGI* = 0x000080BD - #***** GL_SUN_vertex *****// - -proc glColor4ubVertex2fSUN*(r: TGLubyte, g: TGLubyte, b: TGLubyte, a: TGLubyte, - x: TGLfloat, y: TGLfloat){.dynlib: dllname, - importc: "glColor4ubVertex2fSUN".} -proc glColor4ubVertex2fvSUN*(c: PGLubyte, v: PGLfloat){.dynlib: dllname, - importc: "glColor4ubVertex2fvSUN".} -proc glColor4ubVertex3fSUN*(r: TGLubyte, g: TGLubyte, b: TGLubyte, a: TGLubyte, - x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glColor4ubVertex3fSUN".} -proc glColor4ubVertex3fvSUN*(c: PGLubyte, v: PGLfloat){.dynlib: dllname, - importc: "glColor4ubVertex3fvSUN".} -proc glColor3fVertex3fSUN*(r: TGLfloat, g: TGLfloat, b: TGLfloat, x: TGLfloat, - y: TGLfloat, z: TGLfloat){.dynlib: dllname, - importc: "glColor3fVertex3fSUN".} -proc glColor3fVertex3fvSUN*(c: PGLfloat, v: PGLfloat){.dynlib: dllname, - importc: "glColor3fVertex3fvSUN".} -proc glNormal3fVertex3fSUN*(nx: TGLfloat, ny: TGLfloat, nz: TGLfloat, - x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glNormal3fVertex3fSUN".} -proc glNormal3fVertex3fvSUN*(n: PGLfloat, v: PGLfloat){.dynlib: dllname, - importc: "glNormal3fVertex3fvSUN".} -proc glColor4fNormal3fVertex3fSUN*(r: TGLfloat, g: TGLfloat, b: TGLfloat, - a: TGLfloat, nx: TGLfloat, ny: TGLfloat, - nz: TGLfloat, x: TGLfloat, y: TGLfloat, - z: TGLfloat){.dynlib: dllname, - importc: "glColor4fNormal3fVertex3fSUN".} -proc glColor4fNormal3fVertex3fvSUN*(c: PGLfloat, n: PGLfloat, v: PGLfloat){. - dynlib: dllname, importc: "glColor4fNormal3fVertex3fvSUN".} -proc glTexCoord2fVertex3fSUN*(s: TGLfloat, t: TGLfloat, x: TGLfloat, - y: TGLfloat, z: TGLfloat){.dynlib: dllname, - importc: "glTexCoord2fVertex3fSUN".} -proc glTexCoord2fVertex3fvSUN*(tc: PGLfloat, v: PGLfloat){.dynlib: dllname, - importc: "glTexCoord2fVertex3fvSUN".} -proc glTexCoord4fVertex4fSUN*(s: TGLfloat, t: TGLfloat, p: TGLfloat, - q: TGLfloat, x: TGLfloat, y: TGLfloat, - z: TGLfloat, w: TGLfloat){.dynlib: dllname, - importc: "glTexCoord4fVertex4fSUN".} -proc glTexCoord4fVertex4fvSUN*(tc: PGLfloat, v: PGLfloat){.dynlib: dllname, - importc: "glTexCoord4fVertex4fvSUN".} -proc glTexCoord2fColor4ubVertex3fSUN*(s: TGLfloat, t: TGLfloat, r: TGLubyte, - g: TGLubyte, b: TGLubyte, a: TGLubyte, - x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glTexCoord2fColor4ubVertex3fSUN".} -proc glTexCoord2fColor4ubVertex3fvSUN*(tc: PGLfloat, c: PGLubyte, v: PGLfloat){. - dynlib: dllname, importc: "glTexCoord2fColor4ubVertex3fvSUN".} -proc glTexCoord2fColor3fVertex3fSUN*(s: TGLfloat, t: TGLfloat, r: TGLfloat, - g: TGLfloat, b: TGLfloat, x: TGLfloat, - y: TGLfloat, z: TGLfloat){.dynlib: dllname, - importc: "glTexCoord2fColor3fVertex3fSUN".} -proc glTexCoord2fColor3fVertex3fvSUN*(tc: PGLfloat, c: PGLfloat, v: PGLfloat){. - dynlib: dllname, importc: "glTexCoord2fColor3fVertex3fvSUN".} -proc glTexCoord2fNormal3fVertex3fSUN*(s: TGLfloat, t: TGLfloat, nx: TGLfloat, - ny: TGLfloat, nz: TGLfloat, x: TGLfloat, - y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glTexCoord2fNormal3fVertex3fSUN".} -proc glTexCoord2fNormal3fVertex3fvSUN*(tc: PGLfloat, n: PGLfloat, v: PGLfloat){. - dynlib: dllname, importc: "glTexCoord2fNormal3fVertex3fvSUN".} -proc glTexCoord2fColor4fNormal3fVertex3fSUN*(s: TGLfloat, t: TGLfloat, - r: TGLfloat, g: TGLfloat, b: TGLfloat, a: TGLfloat, nx: TGLfloat, - ny: TGLfloat, nz: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glTexCoord2fColor4fNormal3fVertex3fSUN".} -proc glTexCoord2fColor4fNormal3fVertex3fvSUN*(tc: PGLfloat, c: PGLfloat, - n: PGLfloat, v: PGLfloat){.dynlib: dllname, importc: "glTexCoord2fColor4fNormal3fVertex3fvSUN".} -proc glTexCoord4fColor4fNormal3fVertex4fSUN*(s: TGLfloat, t: TGLfloat, - p: TGLfloat, q: TGLfloat, r: TGLfloat, g: TGLfloat, b: TGLfloat, - a: TGLfloat, nx: TGLfloat, ny: TGLfloat, nz: TGLfloat, x: TGLfloat, - y: TGLfloat, z: TGLfloat, w: TGLfloat){.dynlib: dllname, - importc: "glTexCoord4fColor4fNormal3fVertex4fSUN".} -proc glTexCoord4fColor4fNormal3fVertex4fvSUN*(tc: PGLfloat, c: PGLfloat, - n: PGLfloat, v: PGLfloat){.dynlib: dllname, importc: "glTexCoord4fColor4fNormal3fVertex4fvSUN".} -proc glReplacementCodeuiVertex3fSUN*(rc: TGLuint, x: TGLfloat, y: TGLfloat, - z: TGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiVertex3fSUN".} -proc glReplacementCodeuiVertex3fvSUN*(rc: PGLuint, v: PGLfloat){. - dynlib: dllname, importc: "glReplacementCodeuiVertex3fvSUN".} -proc glReplacementCodeuiColor4ubVertex3fSUN*(rc: TGLuint, r: TGLubyte, - g: TGLubyte, b: TGLubyte, a: TGLubyte, x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glReplacementCodeuiColor4ubVertex3fSUN".} -proc glReplacementCodeuiColor4ubVertex3fvSUN*(rc: PGLuint, c: PGLubyte, - v: PGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiColor4ubVertex3fvSUN".} -proc glReplacementCodeuiColor3fVertex3fSUN*(rc: TGLuint, r: TGLfloat, - g: TGLfloat, b: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glReplacementCodeuiColor3fVertex3fSUN".} -proc glReplacementCodeuiColor3fVertex3fvSUN*(rc: PGLuint, c: PGLfloat, - v: PGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiColor3fVertex3fvSUN".} -proc glReplacementCodeuiNormal3fVertex3fSUN*(rc: TGLuint, nx: TGLfloat, - ny: TGLfloat, nz: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){. - dynlib: dllname, importc: "glReplacementCodeuiNormal3fVertex3fSUN".} -proc glReplacementCodeuiNormal3fVertex3fvSUN*(rc: PGLuint, n: PGLfloat, - v: PGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiNormal3fVertex3fvSUN".} -proc glReplacementCodeuiColor4fNormal3fVertex3fSUN*(rc: TGLuint, r: TGLfloat, - g: TGLfloat, b: TGLfloat, a: TGLfloat, nx: TGLfloat, ny: TGLfloat, - nz: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiColor4fNormal3fVertex3fSUN".} -proc glReplacementCodeuiColor4fNormal3fVertex3fvSUN*(rc: PGLuint, c: PGLfloat, - n: PGLfloat, v: PGLfloat){.dynlib: dllname, importc: "glReplacementCodeuiColor4fNormal3fVertex3fvSUN".} -proc glReplacementCodeuiTexCoord2fVertex3fSUN*(rc: TGLuint, s: TGLfloat, - t: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiTexCoord2fVertex3fSUN".} -proc glReplacementCodeuiTexCoord2fVertex3fvSUN*(rc: PGLuint, tc: PGLfloat, - v: PGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiTexCoord2fVertex3fvSUN".} -proc glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN*(rc: TGLuint, s: TGLfloat, - t: TGLfloat, nx: TGLfloat, ny: TGLfloat, nz: TGLfloat, x: TGLfloat, - y: TGLfloat, z: TGLfloat){.dynlib: dllname, importc: "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN".} -proc glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN*(rc: PGLuint, - tc: PGLfloat, n: PGLfloat, v: PGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN".} -proc glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN*(rc: TGLuint, - s: TGLfloat, t: TGLfloat, r: TGLfloat, g: TGLfloat, b: TGLfloat, - a: TGLfloat, nx: TGLfloat, ny: TGLfloat, nz: TGLfloat, x: TGLfloat, - y: TGLfloat, z: TGLfloat){.dynlib: dllname, importc: "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN".} -proc glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN*(rc: PGLuint, - tc: PGLfloat, c: PGLfloat, n: PGLfloat, v: PGLfloat){.dynlib: dllname, - importc: "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN".} - #***** GL_ARB_fragment_program *****// -const - GL_FRAGMENT_PROGRAM_ARB* = 0x00008804 # GL_PROGRAM_FORMAT_ASCII_ARB { already defined } - # GL_PROGRAM_LENGTH_ARB { already defined } - # GL_PROGRAM_FORMAT_ARB { already defined } - # GL_PROGRAM_BINDING_ARB { already defined } - # GL_PROGRAM_INSTRUCTIONS_ARB { already defined } - # GL_MAX_PROGRAM_INSTRUCTIONS_ARB { already defined } - # GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB { already defined } - # GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB { already defined } - # GL_PROGRAM_TEMPORARIES_ARB { already defined } - # GL_MAX_PROGRAM_TEMPORARIES_ARB { already defined } - # GL_PROGRAM_NATIVE_TEMPORARIES_ARB { already defined } - # GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB { already defined } - # GL_PROGRAM_PARAMETERS_ARB { already defined } - # GL_MAX_PROGRAM_PARAMETERS_ARB { already defined } - # GL_PROGRAM_NATIVE_PARAMETERS_ARB { already defined } - # GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB { already defined } - # GL_PROGRAM_ATTRIBS_ARB { already defined } - # GL_MAX_PROGRAM_ATTRIBS_ARB { already defined } - # GL_PROGRAM_NATIVE_ATTRIBS_ARB { already defined } - # GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB { already defined } - # GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB { already defined } - # GL_MAX_PROGRAM_ENV_PARAMETERS_ARB { already defined } - # GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB { already defined } - GL_PROGRAM_ALU_INSTRUCTIONS_ARB* = 0x00008805 - GL_PROGRAM_TEX_INSTRUCTIONS_ARB* = 0x00008806 - GL_PROGRAM_TEX_INDIRECTIONS_ARB* = 0x00008807 - GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB* = 0x00008808 - GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB* = 0x00008809 - GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB* = 0x0000880A - GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB* = 0x0000880B - GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB* = 0x0000880C - GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB* = 0x0000880D - GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB* = 0x0000880E - GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB* = 0x0000880F - GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB* = 0x00008810 # GL_PROGRAM_STRING_ARB { already defined } - # - # - # GL_PROGRAM_ERROR_POSITION_ARB { already defined } - # GL_CURRENT_MATRIX_ARB { already defined } - # - # - # GL_TRANSPOSE_CURRENT_MATRIX_ARB { already defined } - # - # - # GL_CURRENT_MATRIX_STACK_DEPTH_ARB { already defined } - # - # - # GL_MAX_PROGRAM_MATRICES_ARB { already defined } - # - # - # GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB { already defined } - GL_MAX_TEXTURE_COORDS_ARB* = 0x00008871 - GL_MAX_TEXTURE_IMAGE_UNITS_ARB* = 0x00008872 # GL_PROGRAM_ERROR_STRING_ARB { already defined } - # GL_MATRIX0_ARB { already defined } - # GL_MATRIX1_ARB { already defined } - # GL_MATRIX2_ARB { already defined } - # GL_MATRIX3_ARB { already defined } - # GL_MATRIX4_ARB { already defined } - # GL_MATRIX5_ARB { already defined } - # GL_MATRIX6_ARB { already defined } - # GL_MATRIX7_ARB { already defined } - # GL_MATRIX8_ARB { already defined } - # GL_MATRIX9_ARB { already defined } - # GL_MATRIX10_ARB { already defined } - # GL_MATRIX11_ARB { already defined } - # GL_MATRIX12_ARB { already defined } - # GL_MATRIX13_ARB { already defined } - # GL_MATRIX14_ARB { already defined } - # GL_MATRIX15_ARB { already defined } - # GL_MATRIX16_ARB { already defined } - # GL_MATRIX17_ARB { already defined } - # GL_MATRIX18_ARB { already defined } - # GL_MATRIX19_ARB { already defined } - # GL_MATRIX20_ARB { already defined } - # GL_MATRIX21_ARB { already defined } - # GL_MATRIX22_ARB { already defined } - # GL_MATRIX23_ARB { already defined } - # GL_MATRIX24_ARB { already defined } - # GL_MATRIX25_ARB { already defined } - # GL_MATRIX26_ARB { already defined } - # GL_MATRIX27_ARB { already defined } - # GL_MATRIX28_ARB { already defined } - # GL_MATRIX29_ARB { already defined } - # GL_MATRIX30_ARB { already defined } - # GL_MATRIX31_ARB { already defined } - # glProgramStringARB { already defined } - # glBindProgramARB { already defined } - # glDeleteProgramsARB { already defined } - # glGenProgramsARB { already defined } - # glProgramEnvParameter4dARB { already defined } - # glProgramEnvParameter4dvARB { already defined } - # glProgramEnvParameter4fARB { already defined } - # glProgramEnvParameter4fvARB { already defined } - # glProgramLocalParameter4dARB { already defined } - # glProgramLocalParameter4dvARB { already defined } - # glProgramLocalParameter4fARB { already defined } - # glProgramLocalParameter4fvARB { already defined } - # glGetProgramEnvParameterdvARB { already defined } - # glGetProgramEnvParameterfvARB { already defined } - # glGetProgramLocalParameterdvARB { already defined } - # glGetProgramLocalParameterfvARB { already defined } - # glGetProgramivARB { already defined } - # glGetProgramStringARB { already defined } - # glIsProgramARB { already defined } - #***** GL_ATI_text_fragment_shader ***** - -const - GL_TEXT_FRAGMENT_SHADER_ATI* = 0x00008200 #***** GL_ARB_vertex_buffer_object ***** - -const - GL_BUFFER_SIZE_ARB* = 0x00008764 - GL_BUFFER_USAGE_ARB* = 0x00008765 - GL_ARRAY_BUFFER_ARB* = 0x00008892 - GL_ELEMENT_ARRAY_BUFFER_ARB* = 0x00008893 - GL_ARRAY_BUFFER_BINDING_ARB* = 0x00008894 - GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB* = 0x00008895 - GL_VERTEX_ARRAY_BUFFER_BINDING_ARB* = 0x00008896 - GL_NORMAL_ARRAY_BUFFER_BINDING_ARB* = 0x00008897 - GL_COLOR_ARRAY_BUFFER_BINDING_ARB* = 0x00008898 - GL_INDEX_ARRAY_BUFFER_BINDING_ARB* = 0x00008899 - GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB* = 0x0000889A - GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB* = 0x0000889B - GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB* = 0x0000889C - GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB* = 0x0000889D - GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB* = 0x0000889E - GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB* = 0x0000889F - GL_READ_ONLY_ARB* = 0x000088B8 - GL_WRITE_ONLY_ARB* = 0x000088B9 - GL_READ_WRITE_ARB* = 0x000088BA - GL_BUFFER_ACCESS_ARB* = 0x000088BB - GL_BUFFER_MAPPED_ARB* = 0x000088BC - GL_BUFFER_MAP_POINTER_ARB* = 0x000088BD - GL_STREAM_DRAW_ARB* = 0x000088E0 - GL_STREAM_READ_ARB* = 0x000088E1 - GL_STREAM_COPY_ARB* = 0x000088E2 - GL_STATIC_DRAW_ARB* = 0x000088E4 - GL_STATIC_READ_ARB* = 0x000088E5 - GL_STATIC_COPY_ARB* = 0x000088E6 - GL_DYNAMIC_DRAW_ARB* = 0x000088E8 - GL_DYNAMIC_READ_ARB* = 0x000088E9 - GL_DYNAMIC_COPY_ARB* = 0x000088EA - -proc glBindBufferARB*(target: TGLenum, buffer: TGLuint){.dynlib: dllname, - importc: "glBindBufferARB".} -proc glDeleteBuffersARB*(n: TGLsizei, buffers: PGLuint){.dynlib: dllname, - importc: "glDeleteBuffersARB".} -proc glGenBuffersARB*(n: TGLsizei, buffers: PGLuint){.dynlib: dllname, - importc: "glGenBuffersARB".} -proc glIsBufferARB*(buffer: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsBufferARB".} -proc glBufferDataARB*(target: TGLenum, size: TGLsizei, data: PGLvoid, - usage: TGLenum){.dynlib: dllname, - importc: "glBufferDataARB".} -proc glBufferSubDataARB*(target: TGLenum, offset: TGLint, size: TGLsizei, - data: PGLvoid){.dynlib: dllname, - importc: "glBufferSubDataARB".} -proc glGetBufferSubDataARB*(target: TGLenum, offset: TGLint, size: TGLsizei, - data: PGLvoid){.dynlib: dllname, - importc: "glGetBufferSubDataARB".} -proc glMapBufferARB*(target: TGLenum, access: TGLenum): PGLvoid{. - dynlib: dllname, importc: "glMapBufferARB".} -proc glUnmapBufferARB*(target: TGLenum): TGLboolean{.dynlib: dllname, - importc: "glUnmapBufferARB".} -proc glGetBufferParameterivARB*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetBufferParameterivARB".} -proc glGetBufferPointervARB*(target: TGLenum, pname: TGLenum, params: PPGLvoid){. - dynlib: dllname, importc: "glGetBufferPointervARB".} - #***** GL_APPLE_client_storage *****// -const - GL_UNPACK_CLIENT_STORAGE_APPLE* = 0x000085B2 - #***** GL_APPLE_element_array *****// - -const - GL_ELEMENT_ARRAY_APPLE* = 0x00008768 - GL_ELEMENT_ARRAY_TYPE_APPLE* = 0x00008769 - GL_ELEMENT_ARRAY_POINTER_APPLE* = 0x0000876A - -proc glElementPointerAPPLE*(thetype: TGLenum, pointer: PGLvoid){. - dynlib: dllname, importc: "glElementPointerAPPLE".} -proc glDrawElementArrayAPPLE*(mode: TGLenum, first: TGLint, count: TGLsizei){. - dynlib: dllname, importc: "glDrawElementArrayAPPLE".} -proc glDrawRangeElementArrayAPPLE*(mode: TGLenum, start: TGLuint, - theend: TGLuint, first: TGLint, - count: TGLsizei){.dynlib: dllname, - importc: "glDrawRangeElementArrayAPPLE".} -proc glMultiDrawElementArrayAPPLE*(mode: TGLenum, first: PGLint, - count: PGLsizei, primcount: TGLsizei){. - dynlib: dllname, importc: "glMultiDrawElementArrayAPPLE".} -proc glMultiDrawRangeElementArrayAPPLE*(mode: TGLenum, start: TGLuint, - theend: TGLuint, first: PGLint, - count: PGLsizei, primcount: TGLsizei){. - dynlib: dllname, importc: "glMultiDrawRangeElementArrayAPPLE".} - #***** GL_APPLE_fence *****// -const - GL_DRAW_PIXELS_APPLE* = 0x00008A0A - GL_FENCE_APPLE* = 0x00008A0B - -proc glGenFencesAPPLE*(n: TGLsizei, fences: PGLuint){.dynlib: dllname, - importc: "glGenFencesAPPLE".} -proc glDeleteFencesAPPLE*(n: TGLsizei, fences: PGLuint){.dynlib: dllname, - importc: "glDeleteFencesAPPLE".} -proc glSetFenceAPPLE*(fence: TGLuint){.dynlib: dllname, - importc: "glSetFenceAPPLE".} -proc glIsFenceAPPLE*(fence: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsFenceAPPLE".} -proc glTestFenceAPPLE*(fence: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glTestFenceAPPLE".} -proc glFinishFenceAPPLE*(fence: TGLuint){.dynlib: dllname, - importc: "glFinishFenceAPPLE".} -proc glTestObjectAPPLE*(theobject: TGLenum, name: TGLuint): TGLboolean{. - dynlib: dllname, importc: "glTestObjectAPPLE".} -proc glFinishObjectAPPLE*(theobject: TGLenum, name: TGLint){.dynlib: dllname, - importc: "glFinishObjectAPPLE".} - #***** GL_APPLE_vertex_array_object *****// -const - GL_VERTEX_ARRAY_BINDING_APPLE* = 0x000085B5 - -proc glBindVertexArrayAPPLE*(thearray: TGLuint){.dynlib: dllname, - importc: "glBindVertexArrayAPPLE".} -proc glDeleteVertexArraysAPPLE*(n: TGLsizei, arrays: PGLuint){.dynlib: dllname, - importc: "glDeleteVertexArraysAPPLE".} -proc glGenVertexArraysAPPLE*(n: TGLsizei, arrays: PGLuint){.dynlib: dllname, - importc: "glGenVertexArraysAPPLE".} -proc glIsVertexArrayAPPLE*(thearray: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsVertexArrayAPPLE".} - #***** GL_APPLE_vertex_array_range *****// -const - constGL_VERTEX_ARRAY_RANGE_APPLE* = 0x0000851D - GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE* = 0x0000851E - GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE* = 0x00008520 - GL_VERTEX_ARRAY_RANGE_POINTER_APPLE* = 0x00008521 - GL_VERTEX_ARRAY_STORAGE_HINT_APPLE* = 0x0000851F - GL_STORAGE_CACHED_APPLE* = 0x000085BE - GL_STORAGE_SHARED_APPLE* = 0x000085BF - -proc glVertexArrayRangeAPPLE*(len: TGLsizei, pointer: PGLvoid){.dynlib: dllname, - importc: "glVertexArrayRangeAPPLE".} -proc glFlushVertexArrayRangeAPPLE*(len: TGLsizei, pointer: PGLvoid){. - dynlib: dllname, importc: "glFlushVertexArrayRangeAPPLE".} -proc glVertexArrayParameteriAPPLE*(pname: TGLenum, param: TGLint){. - dynlib: dllname, importc: "glVertexArrayParameteriAPPLE".} - #***** GL_ARB_matrix_palette *****// -const - GL_MATRIX_PALETTE_ARB* = 0x00008840 - GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB* = 0x00008841 - GL_MAX_PALETTE_MATRICES_ARB* = 0x00008842 - constGL_CURRENT_PALETTE_MATRIX_ARB* = 0x00008843 - GL_MATRIX_INDEX_ARRAY_ARB* = 0x00008844 - GL_CURRENT_MATRIX_INDEX_ARB* = 0x00008845 - GL_MATRIX_INDEX_ARRAY_SIZE_ARB* = 0x00008846 - GL_MATRIX_INDEX_ARRAY_TYPE_ARB* = 0x00008847 - GL_MATRIX_INDEX_ARRAY_STRIDE_ARB* = 0x00008848 - GL_MATRIX_INDEX_ARRAY_POINTER_ARB* = 0x00008849 - -proc glCurrentPaletteMatrixARB*(index: TGLint){.dynlib: dllname, - importc: "glCurrentPaletteMatrixARB".} -proc glMatrixIndexubvARB*(size: TGLint, indices: PGLubyte){.dynlib: dllname, - importc: "glMatrixIndexubvARB".} -proc glMatrixIndexusvARB*(size: TGLint, indices: PGLushort){.dynlib: dllname, - importc: "glMatrixIndexusvARB".} -proc glMatrixIndexuivARB*(size: TGLint, indices: PGLuint){.dynlib: dllname, - importc: "glMatrixIndexuivARB".} -proc glMatrixIndexPointerARB*(size: TGLint, thetype: TGLenum, stride: TGLsizei, - pointer: PGLvoid){.dynlib: dllname, - importc: "glMatrixIndexPointerARB".} - #***** GL_NV_element_array *****// -const - GL_ELEMENT_ARRAY_TYPE_NV* = 0x00008769 - GL_ELEMENT_ARRAY_POINTER_NV* = 0x0000876A - -proc glElementPointerNV*(thetype: TGLenum, pointer: PGLvoid){.dynlib: dllname, - importc: "glElementPointerNV".} -proc glDrawElementArrayNV*(mode: TGLenum, first: TGLint, count: TGLsizei){. - dynlib: dllname, importc: "glDrawElementArrayNV".} -proc glDrawRangeElementArrayNV*(mode: TGLenum, start: TGLuint, theend: TGLuint, - first: TGLint, count: TGLsizei){. - dynlib: dllname, importc: "glDrawRangeElementArrayNV".} -proc glMultiDrawElementArrayNV*(mode: TGLenum, first: PGLint, count: PGLsizei, - primcount: TGLsizei){.dynlib: dllname, - importc: "glMultiDrawElementArrayNV".} -proc glMultiDrawRangeElementArrayNV*(mode: TGLenum, start: TGLuint, - theend: TGLuint, first: PGLint, - count: PGLsizei, primcount: TGLsizei){. - dynlib: dllname, importc: "glMultiDrawRangeElementArrayNV".} - #***** GL_NV_float_buffer *****// -const - GL_FLOAT_R_NV* = 0x00008880 - GL_FLOAT_RG_NV* = 0x00008881 - GL_FLOAT_RGB_NV* = 0x00008882 - GL_FLOAT_RGBA_NV* = 0x00008883 - GL_FLOAT_R16_NV* = 0x00008884 - GL_FLOAT_R32_NV* = 0x00008885 - GL_FLOAT_RG16_NV* = 0x00008886 - GL_FLOAT_RG32_NV* = 0x00008887 - GL_FLOAT_RGB16_NV* = 0x00008888 - GL_FLOAT_RGB32_NV* = 0x00008889 - GL_FLOAT_RGBA16_NV* = 0x0000888A - GL_FLOAT_RGBA32_NV* = 0x0000888B - GL_TEXTURE_FLOAT_COMPONENTS_NV* = 0x0000888C - GL_FLOAT_CLEAR_COLOR_VALUE_NV* = 0x0000888D - GL_FLOAT_RGBA_MODE_NV* = 0x0000888E - #***** GL_NV_fragment_program *****// - -const - GL_FRAGMENT_PROGRAM_NV* = 0x00008870 - GL_MAX_TEXTURE_COORDS_NV* = 0x00008871 - GL_MAX_TEXTURE_IMAGE_UNITS_NV* = 0x00008872 - GL_FRAGMENT_PROGRAM_BINDING_NV* = 0x00008873 - GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV* = 0x00008868 - GL_PROGRAM_ERROR_STRING_NV* = 0x00008874 - -proc glProgramNamedParameter4fNV*(id: TGLuint, length: TGLsizei, name: PGLubyte, - x: TGLfloat, y: TGLfloat, z: TGLfloat, - w: TGLfloat){.dynlib: dllname, - importc: "glProgramNamedParameter4fNV".} -proc glProgramNamedParameter4dNV*(id: TGLuint, length: TGLsizei, name: PGLubyte, - x: TGLdouble, y: TGLdouble, z: TGLdouble, - w: TGLdouble){.dynlib: dllname, - importc: "glProgramNamedParameter4dNV".} -proc glGetProgramNamedParameterfvNV*(id: TGLuint, length: TGLsizei, - name: PGLubyte, params: PGLfloat){. - dynlib: dllname, importc: "glGetProgramNamedParameterfvNV".} -proc glGetProgramNamedParameterdvNV*(id: TGLuint, length: TGLsizei, - name: PGLubyte, params: PGLdouble){. - dynlib: dllname, importc: "glGetProgramNamedParameterdvNV".} - # glProgramLocalParameter4dARB { already defined } - # glProgramLocalParameter4dvARB { already defined } - # glProgramLocalParameter4fARB { already defined } - # glProgramLocalParameter4fvARB { already defined } - # glGetProgramLocalParameterdvARB { already defined } - # glGetProgramLocalParameterfvARB { already defined } - #***** GL_NV_primitive_restart *****// -const - constGL_PRIMITIVE_RESTART_NV* = 0x00008558 - constGL_PRIMITIVE_RESTART_INDEX_NV* = 0x00008559 - -proc glPrimitiveRestartNV*(){.dynlib: dllname, importc: "glPrimitiveRestartNV".} -proc glPrimitiveRestartIndexNV*(index: TGLuint){.dynlib: dllname, - importc: "glPrimitiveRestartIndexNV".} - #***** GL_NV_vertex_program2 *****// - #***** GL_NV_pixel_data_range *****// -const - GL_WRITE_PIXEL_DATA_RANGE_NV* = 0x00008878 - GL_READ_PIXEL_DATA_RANGE_NV* = 0x00008879 - GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV* = 0x0000887A - GL_READ_PIXEL_DATA_RANGE_LENGTH_NV* = 0x0000887B - GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV* = 0x0000887C - GL_READ_PIXEL_DATA_RANGE_POINTER_NV* = 0x0000887D - -proc glPixelDataRangeNV*(target: TGLenum, len: TGLsizei, pointer: PGLvoid){. - dynlib: dllname, importc: "glPixelDataRangeNV".} -proc glFlushPixelDataRangeNV*(target: TGLenum){.dynlib: dllname, - importc: "glFlushPixelDataRangeNV".} - # wglAllocateMemoryNV { already defined } - # wglFreeMemoryNV { already defined } - #***** GL_EXT_texture_rectangle *****// -const - GL_TEXTURE_RECTANGLE_EXT* = 0x000084F5 - GL_TEXTURE_BINDING_RECTANGLE_EXT* = 0x000084F6 - GL_PROXY_TEXTURE_RECTANGLE_EXT* = 0x000084F7 - GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT* = 0x000084F8 - #***** GL_S3_s3tc *****// - -const - GL_RGB_S3TC* = 0x000083A0 - GL_RGB4_S3TC* = 0x000083A1 - GL_RGBA_S3TC* = 0x000083A2 - GL_RGBA4_S3TC* = 0x000083A3 - #***** GL_ATI_draw_buffers *****// - -const - GL_MAX_DRAW_BUFFERS_ATI* = 0x00008824 - GL_DRAW_BUFFER0_ATI* = 0x00008825 - GL_DRAW_BUFFER1_ATI* = 0x00008826 - GL_DRAW_BUFFER2_ATI* = 0x00008827 - GL_DRAW_BUFFER3_ATI* = 0x00008828 - GL_DRAW_BUFFER4_ATI* = 0x00008829 - GL_DRAW_BUFFER5_ATI* = 0x0000882A - GL_DRAW_BUFFER6_ATI* = 0x0000882B - GL_DRAW_BUFFER7_ATI* = 0x0000882C - GL_DRAW_BUFFER8_ATI* = 0x0000882D - GL_DRAW_BUFFER9_ATI* = 0x0000882E - GL_DRAW_BUFFER10_ATI* = 0x0000882F - GL_DRAW_BUFFER11_ATI* = 0x00008830 - GL_DRAW_BUFFER12_ATI* = 0x00008831 - GL_DRAW_BUFFER13_ATI* = 0x00008832 - GL_DRAW_BUFFER14_ATI* = 0x00008833 - GL_DRAW_BUFFER15_ATI* = 0x00008834 - -proc glDrawBuffersATI*(n: TGLsizei, bufs: PGLenum){.dynlib: dllname, - importc: "glDrawBuffersATI".} - #***** GL_ATI_texture_env_combine3 *****// -const - GL_MODULATE_ADD_ATI* = 0x00008744 - GL_MODULATE_SIGNED_ADD_ATI* = 0x00008745 - GL_MODULATE_SUBTRACT_ATI* = 0x00008746 - #***** GL_ATI_texture_float *****// - -const - GL_RGBA_FLOAT32_ATI* = 0x00008814 - GL_RGB_FLOAT32_ATI* = 0x00008815 - GL_ALPHA_FLOAT32_ATI* = 0x00008816 - GL_INTENSITY_FLOAT32_ATI* = 0x00008817 - GL_LUMINANCE_FLOAT32_ATI* = 0x00008818 - GL_LUMINANCE_ALPHA_FLOAT32_ATI* = 0x00008819 - GL_RGBA_FLOAT16_ATI* = 0x0000881A - GL_RGB_FLOAT16_ATI* = 0x0000881B - GL_ALPHA_FLOAT16_ATI* = 0x0000881C - GL_INTENSITY_FLOAT16_ATI* = 0x0000881D - GL_LUMINANCE_FLOAT16_ATI* = 0x0000881E - GL_LUMINANCE_ALPHA_FLOAT16_ATI* = 0x0000881F - #***** GL_NV_texture_expand_normal *****// - -const - GL_TEXTURE_UNSIGNED_REMAP_MODE_NV* = 0x0000888F - #***** GL_NV_half_float *****// - -const - GL_HALF_FLOAT_NV* = 0x0000140B - -proc glVertex2hNV*(x: TGLushort, y: TGLushort){.dynlib: dllname, - importc: "glVertex2hNV".} -proc glVertex2hvNV*(v: PGLushort){.dynlib: dllname, importc: "glVertex2hvNV".} -proc glVertex3hNV*(x: TGLushort, y: TGLushort, z: TGLushort){.dynlib: dllname, - importc: "glVertex3hNV".} -proc glVertex3hvNV*(v: PGLushort){.dynlib: dllname, importc: "glVertex3hvNV".} -proc glVertex4hNV*(x: TGLushort, y: TGLushort, z: TGLushort, w: TGLushort){. - dynlib: dllname, importc: "glVertex4hNV".} -proc glVertex4hvNV*(v: PGLushort){.dynlib: dllname, importc: "glVertex4hvNV".} -proc glNormal3hNV*(nx: TGLushort, ny: TGLushort, nz: TGLushort){. - dynlib: dllname, importc: "glNormal3hNV".} -proc glNormal3hvNV*(v: PGLushort){.dynlib: dllname, importc: "glNormal3hvNV".} -proc glColor3hNV*(red: TGLushort, green: TGLushort, blue: TGLushort){. - dynlib: dllname, importc: "glColor3hNV".} -proc glColor3hvNV*(v: PGLushort){.dynlib: dllname, importc: "glColor3hvNV".} -proc glColor4hNV*(red: TGLushort, green: TGLushort, blue: TGLushort, - alpha: TGLushort){.dynlib: dllname, importc: "glColor4hNV".} -proc glColor4hvNV*(v: PGLushort){.dynlib: dllname, importc: "glColor4hvNV".} -proc glTexCoord1hNV*(s: TGLushort){.dynlib: dllname, importc: "glTexCoord1hNV".} -proc glTexCoord1hvNV*(v: PGLushort){.dynlib: dllname, importc: "glTexCoord1hvNV".} -proc glTexCoord2hNV*(s: TGLushort, t: TGLushort){.dynlib: dllname, - importc: "glTexCoord2hNV".} -proc glTexCoord2hvNV*(v: PGLushort){.dynlib: dllname, importc: "glTexCoord2hvNV".} -proc glTexCoord3hNV*(s: TGLushort, t: TGLushort, r: TGLushort){.dynlib: dllname, - importc: "glTexCoord3hNV".} -proc glTexCoord3hvNV*(v: PGLushort){.dynlib: dllname, importc: "glTexCoord3hvNV".} -proc glTexCoord4hNV*(s: TGLushort, t: TGLushort, r: TGLushort, q: TGLushort){. - dynlib: dllname, importc: "glTexCoord4hNV".} -proc glTexCoord4hvNV*(v: PGLushort){.dynlib: dllname, importc: "glTexCoord4hvNV".} -proc glMultiTexCoord1hNV*(target: TGLenum, s: TGLushort){.dynlib: dllname, - importc: "glMultiTexCoord1hNV".} -proc glMultiTexCoord1hvNV*(target: TGLenum, v: PGLushort){.dynlib: dllname, - importc: "glMultiTexCoord1hvNV".} -proc glMultiTexCoord2hNV*(target: TGLenum, s: TGLushort, t: TGLushort){. - dynlib: dllname, importc: "glMultiTexCoord2hNV".} -proc glMultiTexCoord2hvNV*(target: TGLenum, v: PGLushort){.dynlib: dllname, - importc: "glMultiTexCoord2hvNV".} -proc glMultiTexCoord3hNV*(target: TGLenum, s: TGLushort, t: TGLushort, - r: TGLushort){.dynlib: dllname, - importc: "glMultiTexCoord3hNV".} -proc glMultiTexCoord3hvNV*(target: TGLenum, v: PGLushort){.dynlib: dllname, - importc: "glMultiTexCoord3hvNV".} -proc glMultiTexCoord4hNV*(target: TGLenum, s: TGLushort, t: TGLushort, - r: TGLushort, q: TGLushort){.dynlib: dllname, - importc: "glMultiTexCoord4hNV".} -proc glMultiTexCoord4hvNV*(target: TGLenum, v: PGLushort){.dynlib: dllname, - importc: "glMultiTexCoord4hvNV".} -proc glFogCoordhNV*(fog: TGLushort){.dynlib: dllname, importc: "glFogCoordhNV".} -proc glFogCoordhvNV*(fog: PGLushort){.dynlib: dllname, importc: "glFogCoordhvNV".} -proc glSecondaryColor3hNV*(red: TGLushort, green: TGLushort, blue: TGLushort){. - dynlib: dllname, importc: "glSecondaryColor3hNV".} -proc glSecondaryColor3hvNV*(v: PGLushort){.dynlib: dllname, - importc: "glSecondaryColor3hvNV".} -proc glVertexWeighthNV*(weight: TGLushort){.dynlib: dllname, - importc: "glVertexWeighthNV".} -proc glVertexWeighthvNV*(weight: PGLushort){.dynlib: dllname, - importc: "glVertexWeighthvNV".} -proc glVertexAttrib1hNV*(index: TGLuint, x: TGLushort){.dynlib: dllname, - importc: "glVertexAttrib1hNV".} -proc glVertexAttrib1hvNV*(index: TGLuint, v: PGLushort){.dynlib: dllname, - importc: "glVertexAttrib1hvNV".} -proc glVertexAttrib2hNV*(index: TGLuint, x: TGLushort, y: TGLushort){. - dynlib: dllname, importc: "glVertexAttrib2hNV".} -proc glVertexAttrib2hvNV*(index: TGLuint, v: PGLushort){.dynlib: dllname, - importc: "glVertexAttrib2hvNV".} -proc glVertexAttrib3hNV*(index: TGLuint, x: TGLushort, y: TGLushort, - z: TGLushort){.dynlib: dllname, - importc: "glVertexAttrib3hNV".} -proc glVertexAttrib3hvNV*(index: TGLuint, v: PGLushort){.dynlib: dllname, - importc: "glVertexAttrib3hvNV".} -proc glVertexAttrib4hNV*(index: TGLuint, x: TGLushort, y: TGLushort, - z: TGLushort, w: TGLushort){.dynlib: dllname, - importc: "glVertexAttrib4hNV".} -proc glVertexAttrib4hvNV*(index: TGLuint, v: PGLushort){.dynlib: dllname, - importc: "glVertexAttrib4hvNV".} -proc glVertexAttribs1hvNV*(index: TGLuint, n: TGLsizei, v: PGLushort){. - dynlib: dllname, importc: "glVertexAttribs1hvNV".} -proc glVertexAttribs2hvNV*(index: TGLuint, n: TGLsizei, v: PGLushort){. - dynlib: dllname, importc: "glVertexAttribs2hvNV".} -proc glVertexAttribs3hvNV*(index: TGLuint, n: TGLsizei, v: PGLushort){. - dynlib: dllname, importc: "glVertexAttribs3hvNV".} -proc glVertexAttribs4hvNV*(index: TGLuint, n: TGLsizei, v: PGLushort){. - dynlib: dllname, importc: "glVertexAttribs4hvNV".} - #***** GL_ATI_map_object_buffer *****// -proc glMapObjectBufferATI*(buffer: TGLuint): PGLvoid{.dynlib: dllname, - importc: "glMapObjectBufferATI".} -proc glUnmapObjectBufferATI*(buffer: TGLuint){.dynlib: dllname, - importc: "glUnmapObjectBufferATI".} - #***** GL_ATI_separate_stencil *****// -const - GL_KEEP* = 0x00001E00 - GL_ZERO* = 0x00000000 - GL_REPLACE* = 0x00001E01 - GL_INCR* = 0x00001E02 - GL_DECR* = 0x00001E03 - GL_INVERT* = 0x0000150A - GL_NEVER* = 0x00000200 - GL_LESS* = 0x00000201 - GL_LEQUAL* = 0x00000203 - GL_GREATER* = 0x00000204 - GL_GEQUAL* = 0x00000206 - GL_EQUAL* = 0x00000202 - GL_NOTEQUAL* = 0x00000205 - GL_ALWAYS* = 0x00000207 - GL_FRONT* = 0x00000404 - GL_BACK* = 0x00000405 - GL_FRONT_AND_BACK* = 0x00000408 - GL_STENCIL_BACK_FUNC_ATI* = 0x00008800 - GL_STENCIL_BACK_FAIL_ATI* = 0x00008801 - GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI* = 0x00008802 - GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI* = 0x00008803 - -proc glStencilOpSeparateATI*(face: TGLenum, sfail: TGLenum, dpfail: TGLenum, - dppass: TGLenum){.dynlib: dllname, - importc: "glStencilOpSeparateATI".} -proc glStencilFuncSeparateATI*(frontfunc: TGLenum, backfunc: TGLenum, - theRef: TGLint, mask: TGLuint){.dynlib: dllname, - importc: "glStencilFuncSeparateATI".} - #***** GL_ATI_vertex_attrib_array_object *****// -proc glVertexAttribArrayObjectATI*(index: TGLuint, size: TGLint, - thetype: TGLenum, normalized: TGLboolean, - stride: TGLsizei, buffer: TGLuint, - offset: TGLuint){.dynlib: dllname, - importc: "glVertexAttribArrayObjectATI".} -proc glGetVertexAttribArrayObjectfvATI*(index: TGLuint, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetVertexAttribArrayObjectfvATI".} -proc glGetVertexAttribArrayObjectivATI*(index: TGLuint, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetVertexAttribArrayObjectivATI".} - #***** GL_ARB_occlusion_query *****// -const - GL_SAMPLES_PASSED_ARB* = 0x00008914 - GL_QUERY_COUNTER_BITS_ARB* = 0x00008864 - GL_CURRENT_QUERY_ARB* = 0x00008865 - GL_QUERY_RESULT_ARB* = 0x00008866 - GL_QUERY_RESULT_AVAILABLE_ARB* = 0x00008867 - -proc glGenQueriesARB*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glGenQueriesARB".} -proc glDeleteQueriesARB*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glDeleteQueriesARB".} -proc glIsQueryARB*(id: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsQueryARB".} -proc glBeginQueryARB*(target: TGLenum, id: TGLuint){.dynlib: dllname, - importc: "glBeginQueryARB".} -proc glEndQueryARB*(target: TGLenum){.dynlib: dllname, importc: "glEndQueryARB".} -proc glGetQueryivARB*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetQueryivARB".} -proc glGetQueryObjectivARB*(id: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetQueryObjectivARB".} -proc glGetQueryObjectuivARB*(id: TGLuint, pname: TGLenum, params: PGLuint){. - dynlib: dllname, importc: "glGetQueryObjectuivARB".} - #***** GL_ARB_shader_objects *****// -const - GL_PROGRAM_OBJECT_ARB* = 0x00008B40 - GL_OBJECT_TYPE_ARB* = 0x00008B4E - GL_OBJECT_SUBTYPE_ARB* = 0x00008B4F - GL_OBJECT_DELETE_STATUS_ARB* = 0x00008B80 - GL_OBJECT_COMPILE_STATUS_ARB* = 0x00008B81 - GL_OBJECT_LINK_STATUS_ARB* = 0x00008B82 - GL_OBJECT_VALIDATE_STATUS_ARB* = 0x00008B83 - GL_OBJECT_INFO_LOG_LENGTH_ARB* = 0x00008B84 - GL_OBJECT_ATTACHED_OBJECTS_ARB* = 0x00008B85 - GL_OBJECT_ACTIVE_UNIFORMS_ARB* = 0x00008B86 - GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB* = 0x00008B87 - GL_OBJECT_SHADER_SOURCE_LENGTH_ARB* = 0x00008B88 - GL_SHADER_OBJECT_ARB* = 0x00008B48 - GL_FLOAT* = 0x00001406 - GL_FLOAT_VEC2_ARB* = 0x00008B50 - GL_FLOAT_VEC3_ARB* = 0x00008B51 - GL_FLOAT_VEC4_ARB* = 0x00008B52 - GL_INT* = 0x00001404 - GL_INT_VEC2_ARB* = 0x00008B53 - GL_INT_VEC3_ARB* = 0x00008B54 - GL_INT_VEC4_ARB* = 0x00008B55 - GL_BOOL_ARB* = 0x00008B56 - GL_BOOL_VEC2_ARB* = 0x00008B57 - GL_BOOL_VEC3_ARB* = 0x00008B58 - GL_BOOL_VEC4_ARB* = 0x00008B59 - GL_FLOAT_MAT2_ARB* = 0x00008B5A - GL_FLOAT_MAT3_ARB* = 0x00008B5B - GL_FLOAT_MAT4_ARB* = 0x00008B5C - -proc glDeleteObjectARB*(obj: GLhandleARB){.dynlib: dllname, - importc: "glDeleteObjectARB".} -proc glGetHandleARB*(pname: TGLenum): GLhandleARB{.dynlib: dllname, - importc: "glGetHandleARB".} -proc glDetachObjectARB*(containerObj: GLhandleARB, attachedObj: GLhandleARB){. - dynlib: dllname, importc: "glDetachObjectARB".} -proc glCreateShaderObjectARB*(shaderType: TGLenum): GLhandleARB{. - dynlib: dllname, importc: "glCreateShaderObjectARB".} -proc glShaderSourceARB*(shaderObj: GLhandleARB, count: TGLsizei, str: PGLvoid, - len: PGLint){.dynlib: dllname, - importc: "glShaderSourceARB".} -proc glCompileShaderARB*(shaderObj: GLhandleARB){.dynlib: dllname, - importc: "glCompileShaderARB".} -proc glCreateProgramObjectARB*(): GLhandleARB{.dynlib: dllname, - importc: "glCreateProgramObjectARB".} -proc glAttachObjectARB*(containerObj: GLhandleARB, obj: GLhandleARB){. - dynlib: dllname, importc: "glAttachObjectARB".} -proc glLinkProgramARB*(programObj: GLhandleARB){.dynlib: dllname, - importc: "glLinkProgramARB".} -proc glUseProgramObjectARB*(programObj: GLhandleARB){.dynlib: dllname, - importc: "glUseProgramObjectARB".} -proc glValidateProgramARB*(programObj: GLhandleARB){.dynlib: dllname, - importc: "glValidateProgramARB".} -proc glUniform1fARB*(location: TGLint, v0: TGLfloat){.dynlib: dllname, - importc: "glUniform1fARB".} -proc glUniform2fARB*(location: TGLint, v0: TGLfloat, v1: TGLfloat){. - dynlib: dllname, importc: "glUniform2fARB".} -proc glUniform3fARB*(location: TGLint, v0: TGLfloat, v1: TGLfloat, v2: TGLfloat){. - dynlib: dllname, importc: "glUniform3fARB".} -proc glUniform4fARB*(location: TGLint, v0: TGLfloat, v1: TGLfloat, v2: TGLfloat, - v3: TGLfloat){.dynlib: dllname, importc: "glUniform4fARB".} -proc glUniform1iARB*(location: TGLint, v0: TGLint){.dynlib: dllname, - importc: "glUniform1iARB".} -proc glUniform2iARB*(location: TGLint, v0: TGLint, v1: TGLint){.dynlib: dllname, - importc: "glUniform2iARB".} -proc glUniform3iARB*(location: TGLint, v0: TGLint, v1: TGLint, v2: TGLint){. - dynlib: dllname, importc: "glUniform3iARB".} -proc glUniform4iARB*(location: TGLint, v0: TGLint, v1: TGLint, v2: TGLint, - v3: TGLint){.dynlib: dllname, importc: "glUniform4iARB".} -proc glUniform1fvARB*(location: TGLint, count: TGLsizei, value: PGLfloat){. - dynlib: dllname, importc: "glUniform1fvARB".} -proc glUniform2fvARB*(location: TGLint, count: TGLsizei, value: PGLfloat){. - dynlib: dllname, importc: "glUniform2fvARB".} -proc glUniform3fvARB*(location: TGLint, count: TGLsizei, value: PGLfloat){. - dynlib: dllname, importc: "glUniform3fvARB".} -proc glUniform4fvARB*(location: TGLint, count: TGLsizei, value: PGLfloat){. - dynlib: dllname, importc: "glUniform4fvARB".} -proc glUniform1ivARB*(location: TGLint, count: TGLsizei, value: PGLint){. - dynlib: dllname, importc: "glUniform1ivARB".} -proc glUniform2ivARB*(location: TGLint, count: TGLsizei, value: PGLint){. - dynlib: dllname, importc: "glUniform2ivARB".} -proc glUniform3ivARB*(location: TGLint, count: TGLsizei, value: PGLint){. - dynlib: dllname, importc: "glUniform3ivARB".} -proc glUniform4ivARB*(location: TGLint, count: TGLsizei, value: PGLint){. - dynlib: dllname, importc: "glUniform4ivARB".} -proc glUniformMatrix2fvARB*(location: TGLint, count: TGLsizei, - transpose: TGLboolean, value: PGLfloat){. - dynlib: dllname, importc: "glUniformMatrix2fvARB".} -proc glUniformMatrix3fvARB*(location: TGLint, count: TGLsizei, - transpose: TGLboolean, value: PGLfloat){. - dynlib: dllname, importc: "glUniformMatrix3fvARB".} -proc glUniformMatrix4fvARB*(location: TGLint, count: TGLsizei, - transpose: TGLboolean, value: PGLfloat){. - dynlib: dllname, importc: "glUniformMatrix4fvARB".} -proc glGetObjectParameterfvARB*(obj: GLhandleARB, pname: TGLenum, - params: PGLfloat){.dynlib: dllname, - importc: "glGetObjectParameterfvARB".} -proc glGetObjectParameterivARB*(obj: GLhandleARB, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetObjectParameterivARB".} -proc glGetInfoLogARB*(obj: GLhandleARB, maxLength: TGLsizei, len: PGLsizei, - infoLog: PGLcharARB){.dynlib: dllname, - importc: "glGetInfoLogARB".} -proc glGetAttachedObjectsARB*(containerObj: GLhandleARB, maxCount: TGLsizei, - count: PGLsizei, obj: PGLhandleARB){. - dynlib: dllname, importc: "glGetAttachedObjectsARB".} -proc glGetUniformLocationARB*(programObj: GLhandleARB, name: PGLcharARB): TGLint{. - dynlib: dllname, importc: "glGetUniformLocationARB".} -proc glGetActiveUniformARB*(programObj: GLhandleARB, index: TGLuint, - maxLength: TGLsizei, len: PGLsizei, size: PGLint, - thetype: PGLenum, name: PGLcharARB){. - dynlib: dllname, importc: "glGetActiveUniformARB".} -proc glGetUniformfvARB*(programObj: GLhandleARB, location: TGLint, - params: PGLfloat){.dynlib: dllname, - importc: "glGetUniformfvARB".} -proc glGetUniformivARB*(programObj: GLhandleARB, location: TGLint, - params: PGLint){.dynlib: dllname, - importc: "glGetUniformivARB".} -proc glGetShaderSourceARB*(obj: GLhandleARB, maxLength: TGLsizei, len: PGLsizei, - source: PGLcharARB){.dynlib: dllname, - importc: "glGetShaderSourceARB".} -const - GL_VERTEX_SHADER_ARB* = 0x00008B31 - GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB* = 0x00008B4A - GL_MAX_VARYING_FLOATS_ARB* = 0x00008B4B # GL_MAX_VERTEX_ATTRIBS_ARB { already defined } - # GL_MAX_TEXTURE_IMAGE_UNITS_ARB { already defined } - GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB* = 0x00008B4C - GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB* = 0x00008B4D # - # - # GL_MAX_TEXTURE_COORDS_ARB { already defined } - # - # - # GL_VERTEX_PROGRAM_POINT_SIZE_ARB { already defined } - # - # - # GL_VERTEX_PROGRAM_TWO_SIDE_ARB { already defined } - # GL_OBJECT_TYPE_ARB { already defined } - # GL_OBJECT_SUBTYPE_ARB { already defined } - GL_OBJECT_ACTIVE_ATTRIBUTES_ARB* = 0x00008B89 - GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB* = 0x00008B8A # GL_SHADER_OBJECT_ARB { already defined } - # - # - # GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB { already defined } - # - # - # GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB { already defined } - # - # - # GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB { already defined } - # - # - # GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB { already defined } - # - # - # GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB { already defined } - # - # - # GL_CURRENT_VERTEX_ATTRIB_ARB { already defined } - # - # - # GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB { already defined } - # GL_FLOAT { already defined } - # GL_FLOAT_VEC2_ARB { already defined } - # GL_FLOAT_VEC3_ARB { already defined } - # GL_FLOAT_VEC4_ARB { already defined } - # GL_FLOAT_MAT2_ARB { already defined } - # GL_FLOAT_MAT3_ARB { already defined } - # GL_FLOAT_MAT4_ARB { already defined } - # glVertexAttrib1fARB { already defined } - # glVertexAttrib1sARB { already defined } - # glVertexAttrib1dARB { already defined } - # glVertexAttrib2fARB { already defined } - # glVertexAttrib2sARB { already defined } - # glVertexAttrib2dARB { already defined } - # glVertexAttrib3fARB { already defined } - # glVertexAttrib3sARB { already defined } - # glVertexAttrib3dARB { already defined } - # glVertexAttrib4fARB { already defined } - # glVertexAttrib4sARB { already defined } - # glVertexAttrib4dARB { already defined } - # glVertexAttrib4NubARB { already defined } - # glVertexAttrib1fvARB { already defined } - # glVertexAttrib1svARB { already defined } - # glVertexAttrib1dvARB { already defined } - # glVertexAttrib2fvARB { already defined } - # glVertexAttrib2svARB { already defined } - # glVertexAttrib2dvARB { already defined } - # glVertexAttrib3fvARB { already defined } - # glVertexAttrib3svARB { already defined } - # glVertexAttrib3dvARB { already defined } - # glVertexAttrib4fvARB { already defined } - # glVertexAttrib4svARB { already defined } - # glVertexAttrib4dvARB { already defined } - # glVertexAttrib4ivARB { already defined } - # glVertexAttrib4bvARB { already defined } - # glVertexAttrib4ubvARB { already defined } - # glVertexAttrib4usvARB { already defined } - # glVertexAttrib4uivARB { already defined } - # glVertexAttrib4NbvARB { already defined } - # glVertexAttrib4NsvARB { already defined } - # glVertexAttrib4NivARB { already defined } - # glVertexAttrib4NubvARB { already defined } - # glVertexAttrib4NusvARB { already defined } - # glVertexAttrib4NuivARB { already defined } - # - # - # glVertexAttribPointerARB { already defined } - # - # - # glEnableVertexAttribArrayARB { already defined } - # - # - # glDisableVertexAttribArrayARB { already defined } - -proc glBindAttribLocationARB*(programObj: GLhandleARB, index: TGLuint, - name: PGLcharARB){.dynlib: dllname, - importc: "glBindAttribLocationARB".} -proc glGetActiveAttribARB*(programObj: GLhandleARB, index: TGLuint, - maxLength: TGLsizei, len: PGLsizei, size: PGLint, - thetype: PGLenum, name: PGLcharARB){.dynlib: dllname, - importc: "glGetActiveAttribARB".} -proc glGetAttribLocationARB*(programObj: GLhandleARB, name: PGLcharARB): TGLint{. - dynlib: dllname, importc: "glGetAttribLocationARB".} - # glGetVertexAttribdvARB { already defined } - # glGetVertexAttribfvARB { already defined } - # glGetVertexAttribivARB { already defined } - # glGetVertexAttribPointervARB { already defined } - #***** GL_ARB_fragment_shader *****// -const - GL_FRAGMENT_SHADER_ARB* = 0x00008B30 - GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB* = 0x00008B49 # GL_MAX_TEXTURE_COORDS_ARB { already defined } - # - # - # GL_MAX_TEXTURE_IMAGE_UNITS_ARB { already defined } - # GL_OBJECT_TYPE_ARB { already defined } - # GL_OBJECT_SUBTYPE_ARB { already defined } - # GL_SHADER_OBJECT_ARB { already defined } - #***** GL_ARB_shading_language_100 *****// - #***** GL_ARB_texture_non_power_of_two *****// - #***** GL_ARB_point_sprite *****// - -const - GL_POINT_SPRITE_ARB* = 0x00008861 - GL_COORD_REPLACE_ARB* = 0x00008862 - #***** GL_EXT_depth_bounds_test *****// - -const - constGL_DEPTH_BOUNDS_TEST_EXT* = 0x00008890 - constGL_DEPTH_BOUNDS_EXT* = 0x00008891 - -proc glDepthBoundsEXT*(zmin: TGLclampd, zmax: TGLclampd){.dynlib: dllname, - importc: "glDepthBoundsEXT".} - #***** GL_EXT_texture_mirror_clamp *****// -const - GL_MIRROR_CLAMP_EXT* = 0x00008742 - GL_MIRROR_CLAMP_TO_EDGE_EXT* = 0x00008743 - GL_MIRROR_CLAMP_TO_BORDER_EXT* = 0x00008912 - #***** GL_EXT_blend_equation_separate *****// - -const - GL_BLEND_EQUATION_RGB_EXT* = 0x00008009 - GL_BLEND_EQUATION_ALPHA_EXT* = 0x0000883D - -proc glBlendEquationSeparateEXT*(modeRGB: TGLenum, modeAlpha: TGLenum){. - dynlib: dllname, importc: "glBlendEquationSeparateEXT".} - #***** GL_MESA_pack_invert *****// -const - GL_PACK_INVERT_MESA* = 0x00008758 - #***** GL_MESA_ycbcr_texture *****// - -const - GL_YCBCR_MESA* = 0x00008757 - GL_UNSIGNED_SHORT_8_8_MESA* = 0x000085BA - GL_UNSIGNED_SHORT_8_8_REV_MESA* = 0x000085BB - #***** GL_ARB_fragment_program_shadow *****// - #***** GL_NV_fragment_program_option *****// - #***** GL_EXT_pixel_buffer_object *****// - -const - GL_PIXEL_PACK_BUFFER_EXT* = 0x000088EB - GL_PIXEL_UNPACK_BUFFER_EXT* = 0x000088EC - GL_PIXEL_PACK_BUFFER_BINDING_EXT* = 0x000088ED - GL_PIXEL_UNPACK_BUFFER_BINDING_EXT* = 0x000088EF - #***** GL_NV_fragment_program2 *****// - -const - GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV* = 0x000088F4 - GL_MAX_PROGRAM_CALL_DEPTH_NV* = 0x000088F5 - GL_MAX_PROGRAM_IF_DEPTH_NV* = 0x000088F6 - GL_MAX_PROGRAM_LOOP_DEPTH_NV* = 0x000088F7 - GL_MAX_PROGRAM_LOOP_COUNT_NV* = 0x000088F8 - #***** GL_NV_vertex_program2_option *****// - # GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV { already defined } - # GL_MAX_PROGRAM_CALL_DEPTH_NV { already defined } - #***** GL_NV_vertex_program3 *****// - # GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB { already defined } - #***** GL_ARB_draw_buffers *****// - -const - GL_MAX_DRAW_BUFFERS_ARB* = 0x00008824 - GL_DRAW_BUFFER0_ARB* = 0x00008825 - GL_DRAW_BUFFER1_ARB* = 0x00008826 - GL_DRAW_BUFFER2_ARB* = 0x00008827 - GL_DRAW_BUFFER3_ARB* = 0x00008828 - GL_DRAW_BUFFER4_ARB* = 0x00008829 - GL_DRAW_BUFFER5_ARB* = 0x0000882A - GL_DRAW_BUFFER6_ARB* = 0x0000882B - GL_DRAW_BUFFER7_ARB* = 0x0000882C - GL_DRAW_BUFFER8_ARB* = 0x0000882D - GL_DRAW_BUFFER9_ARB* = 0x0000882E - GL_DRAW_BUFFER10_ARB* = 0x0000882F - GL_DRAW_BUFFER11_ARB* = 0x00008830 - GL_DRAW_BUFFER12_ARB* = 0x00008831 - GL_DRAW_BUFFER13_ARB* = 0x00008832 - GL_DRAW_BUFFER14_ARB* = 0x00008833 - GL_DRAW_BUFFER15_ARB* = 0x00008834 - -proc glDrawBuffersARB*(n: TGLsizei, bufs: PGLenum){.dynlib: dllname, - importc: "glDrawBuffersARB".} - #***** GL_ARB_texture_rectangle *****// -const - GL_TEXTURE_RECTANGLE_ARB* = 0x000084F5 - GL_TEXTURE_BINDING_RECTANGLE_ARB* = 0x000084F6 - GL_PROXY_TEXTURE_RECTANGLE_ARB* = 0x000084F7 - GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB* = 0x000084F8 - #***** GL_ARB_color_buffer_float *****// - -const - GL_RGBA_FLOAT_MODE_ARB* = 0x00008820 - GL_CLAMP_VERTEX_COLOR_ARB* = 0x0000891A - GL_CLAMP_FRAGMENT_COLOR_ARB* = 0x0000891B - GL_CLAMP_READ_COLOR_ARB* = 0x0000891C - GL_FIXED_ONLY_ARB* = 0x0000891D - WGL_TYPE_RGBA_FLOAT_ARB* = 0x000021A0 - -proc glClampColorARB*(target: TGLenum, clamp: TGLenum){.dynlib: dllname, - importc: "glClampColorARB".} - #***** GL_ARB_half_float_pixel *****// -const - GL_HALF_FLOAT_ARB* = 0x0000140B - #***** GL_ARB_texture_float *****// - -const - GL_TEXTURE_RED_TYPE_ARB* = 0x00008C10 - GL_TEXTURE_GREEN_TYPE_ARB* = 0x00008C11 - GL_TEXTURE_BLUE_TYPE_ARB* = 0x00008C12 - GL_TEXTURE_ALPHA_TYPE_ARB* = 0x00008C13 - GL_TEXTURE_LUMINANCE_TYPE_ARB* = 0x00008C14 - GL_TEXTURE_INTENSITY_TYPE_ARB* = 0x00008C15 - GL_TEXTURE_DEPTH_TYPE_ARB* = 0x00008C16 - GL_UNSIGNED_NORMALIZED_ARB* = 0x00008C17 - GL_RGBA32F_ARB* = 0x00008814 - GL_RGB32F_ARB* = 0x00008815 - GL_ALPHA32F_ARB* = 0x00008816 - GL_INTENSITY32F_ARB* = 0x00008817 - GL_LUMINANCE32F_ARB* = 0x00008818 - GL_LUMINANCE_ALPHA32F_ARB* = 0x00008819 - GL_RGBA16F_ARB* = 0x0000881A - GL_RGB16F_ARB* = 0x0000881B - GL_ALPHA16F_ARB* = 0x0000881C - GL_INTENSITY16F_ARB* = 0x0000881D - GL_LUMINANCE16F_ARB* = 0x0000881E - GL_LUMINANCE_ALPHA16F_ARB* = 0x0000881F - #***** GL_EXT_texture_compression_dxt1 *****// - # GL_COMPRESSED_RGB_S3TC_DXT1_EXT { already defined } - # GL_COMPRESSED_RGBA_S3TC_DXT1_EXT { already defined } - #***** GL_ARB_pixel_buffer_object *****// - -const - GL_PIXEL_PACK_BUFFER_ARB* = 0x000088EB - GL_PIXEL_UNPACK_BUFFER_ARB* = 0x000088EC - GL_PIXEL_PACK_BUFFER_BINDING_ARB* = 0x000088ED - GL_PIXEL_UNPACK_BUFFER_BINDING_ARB* = 0x000088EF - #***** GL_EXT_framebuffer_object *****// - -const - GL_FRAMEBUFFER_EXT* = 0x00008D40 - GL_RENDERBUFFER_EXT* = 0x00008D41 - GL_STENCIL_INDEX_EXT* = 0x00008D45 - GL_STENCIL_INDEX1_EXT* = 0x00008D46 - GL_STENCIL_INDEX4_EXT* = 0x00008D47 - GL_STENCIL_INDEX8_EXT* = 0x00008D48 - GL_STENCIL_INDEX16_EXT* = 0x00008D49 - GL_RENDERBUFFER_WIDTH_EXT* = 0x00008D42 - GL_RENDERBUFFER_HEIGHT_EXT* = 0x00008D43 - GL_RENDERBUFFER_INTERNAL_FORMAT_EXT* = 0x00008D44 - GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT* = 0x00008CD0 - GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT* = 0x00008CD1 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT* = 0x00008CD2 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT* = 0x00008CD3 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT* = 0x00008CD4 - GL_COLOR_ATTACHMENT0_EXT* = 0x00008CE0 - GL_COLOR_ATTACHMENT1_EXT* = 0x00008CE1 - GL_COLOR_ATTACHMENT2_EXT* = 0x00008CE2 - GL_COLOR_ATTACHMENT3_EXT* = 0x00008CE3 - GL_COLOR_ATTACHMENT4_EXT* = 0x00008CE4 - GL_COLOR_ATTACHMENT5_EXT* = 0x00008CE5 - GL_COLOR_ATTACHMENT6_EXT* = 0x00008CE6 - GL_COLOR_ATTACHMENT7_EXT* = 0x00008CE7 - GL_COLOR_ATTACHMENT8_EXT* = 0x00008CE8 - GL_COLOR_ATTACHMENT9_EXT* = 0x00008CE9 - GL_COLOR_ATTACHMENT10_EXT* = 0x00008CEA - GL_COLOR_ATTACHMENT11_EXT* = 0x00008CEB - GL_COLOR_ATTACHMENT12_EXT* = 0x00008CEC - GL_COLOR_ATTACHMENT13_EXT* = 0x00008CED - GL_COLOR_ATTACHMENT14_EXT* = 0x00008CEE - GL_COLOR_ATTACHMENT15_EXT* = 0x00008CEF - GL_DEPTH_ATTACHMENT_EXT* = 0x00008D00 - GL_STENCIL_ATTACHMENT_EXT* = 0x00008D20 - GL_FRAMEBUFFER_COMPLETE_EXT* = 0x00008CD5 - GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT* = 0x00008CD6 - GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT* = 0x00008CD7 - GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT* = 0x00008CD8 - GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT* = 0x00008CD9 - GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT* = 0x00008CDA - GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT* = 0x00008CDB - GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT* = 0x00008CDC - GL_FRAMEBUFFER_UNSUPPORTED_EXT* = 0x00008CDD - GL_FRAMEBUFFER_STATUS_ERROR_EXT* = 0x00008CDE - GL_FRAMEBUFFER_BINDING_EXT* = 0x00008CA6 - GL_RENDERBUFFER_BINDING_EXT* = 0x00008CA7 - GL_MAX_COLOR_ATTACHMENTS_EXT* = 0x00008CDF - GL_MAX_RENDERBUFFER_SIZE_EXT* = 0x000084E8 - GL_INVALID_FRAMEBUFFER_OPERATION_EXT* = 0x00000506 - -proc glIsRenderbufferEXT*(renderbuffer: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsRenderbufferEXT".} -proc glBindRenderbufferEXT*(target: TGLenum, renderbuffer: TGLuint){. - dynlib: dllname, importc: "glBindRenderbufferEXT".} -proc glDeleteRenderbuffersEXT*(n: TGLsizei, renderbuffers: PGLuint){. - dynlib: dllname, importc: "glDeleteRenderbuffersEXT".} -proc glGenRenderbuffersEXT*(n: TGLsizei, renderbuffers: PGLuint){. - dynlib: dllname, importc: "glGenRenderbuffersEXT".} -proc glRenderbufferStorageEXT*(target: TGLenum, internalformat: TGLenum, - width: TGLsizei, height: TGLsizei){. - dynlib: dllname, importc: "glRenderbufferStorageEXT".} -proc glGetRenderbufferParameterivEXT*(target: TGLenum, pname: TGLenum, - params: PGLint){.dynlib: dllname, - importc: "glGetRenderbufferParameterivEXT".} -proc glIsFramebufferEXT*(framebuffer: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsFramebufferEXT".} -proc glBindFramebufferEXT*(target: TGLenum, framebuffer: TGLuint){. - dynlib: dllname, importc: "glBindFramebufferEXT".} -proc glDeleteFramebuffersEXT*(n: TGLsizei, framebuffers: PGLuint){. - dynlib: dllname, importc: "glDeleteFramebuffersEXT".} -proc glGenFramebuffersEXT*(n: TGLsizei, framebuffers: PGLuint){.dynlib: dllname, - importc: "glGenFramebuffersEXT".} -proc glCheckFramebufferStatusEXT*(target: TGLenum): TGLenum{.dynlib: dllname, - importc: "glCheckFramebufferStatusEXT".} -proc glFramebufferTexture1DEXT*(target: TGLenum, attachment: TGLenum, - textarget: TGLenum, texture: TGLuint, - level: TGLint){.dynlib: dllname, - importc: "glFramebufferTexture1DEXT".} -proc glFramebufferTexture2DEXT*(target: TGLenum, attachment: TGLenum, - textarget: TGLenum, texture: TGLuint, - level: TGLint){.dynlib: dllname, - importc: "glFramebufferTexture2DEXT".} -proc glFramebufferTexture3DEXT*(target: TGLenum, attachment: TGLenum, - textarget: TGLenum, texture: TGLuint, - level: TGLint, zoffset: TGLint){. - dynlib: dllname, importc: "glFramebufferTexture3DEXT".} -proc glFramebufferRenderbufferEXT*(target: TGLenum, attachment: TGLenum, - renderbuffertarget: TGLenum, - renderbuffer: TGLuint){.dynlib: dllname, - importc: "glFramebufferRenderbufferEXT".} -proc glGetFramebufferAttachmentParameterivEXT*(target: TGLenum, - attachment: TGLenum, pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glGetFramebufferAttachmentParameterivEXT".} -proc glGenerateMipmapEXT*(target: TGLenum){.dynlib: dllname, - importc: "glGenerateMipmapEXT".} - #***** GL_version_1_4 *****// -const - GL_BLEND_DST_RGB* = 0x000080C8 - GL_BLEND_SRC_RGB* = 0x000080C9 - GL_BLEND_DST_ALPHA* = 0x000080CA - GL_BLEND_SRC_ALPHA* = 0x000080CB - GL_POINT_SIZE_MIN* = 0x00008126 - GL_POINT_SIZE_MAX* = 0x00008127 - GL_POINT_FADE_THRESHOLD_SIZE* = 0x00008128 - GL_POINT_DISTANCE_ATTENUATION* = 0x00008129 - GL_GENERATE_MIPMAP* = 0x00008191 - GL_GENERATE_MIPMAP_HINT* = 0x00008192 - GL_DEPTH_COMPONENT16* = 0x000081A5 - GL_DEPTH_COMPONENT24* = 0x000081A6 - GL_DEPTH_COMPONENT32* = 0x000081A7 - GL_MIRRORED_REPEAT* = 0x00008370 - GL_FOG_COORDINATE_SOURCE* = 0x00008450 - GL_FOG_COORDINATE* = 0x00008451 - GL_FRAGMENT_DEPTH* = 0x00008452 - GL_CURRENT_FOG_COORDINATE* = 0x00008453 - GL_FOG_COORDINATE_ARRAY_TYPE* = 0x00008454 - GL_FOG_COORDINATE_ARRAY_STRIDE* = 0x00008455 - GL_FOG_COORDINATE_ARRAY_POINTER* = 0x00008456 - GL_FOG_COORDINATE_ARRAY* = 0x00008457 - GL_COLOR_SUM* = 0x00008458 - GL_CURRENT_SECONDARY_COLOR* = 0x00008459 - GL_SECONDARY_COLOR_ARRAY_SIZE* = 0x0000845A - GL_SECONDARY_COLOR_ARRAY_TYPE* = 0x0000845B - GL_SECONDARY_COLOR_ARRAY_STRIDE* = 0x0000845C - GL_SECONDARY_COLOR_ARRAY_POINTER* = 0x0000845D - GL_SECONDARY_COLOR_ARRAY* = 0x0000845E - GL_MAX_TEXTURE_LOD_BIAS* = 0x000084FD - GL_TEXTURE_FILTER_CONTROL* = 0x00008500 - GL_TEXTURE_LOD_BIAS* = 0x00008501 - GL_INCR_WRAP* = 0x00008507 - GL_DECR_WRAP* = 0x00008508 - GL_TEXTURE_DEPTH_SIZE* = 0x0000884A - GL_DEPTH_TEXTURE_MODE* = 0x0000884B - GL_TEXTURE_COMPARE_MODE* = 0x0000884C - GL_TEXTURE_COMPARE_FUNC* = 0x0000884D - GL_COMPARE_R_TO_TEXTURE* = 0x0000884E - -proc glBlendFuncSeparate*(sfactorRGB: TGLenum, dfactorRGB: TGLenum, - sfactorAlpha: TGLenum, dfactorAlpha: TGLenum){. - dynlib: dllname, importc: "glBlendFuncSeparate".} -proc glFogCoordf*(coord: TGLfloat){.dynlib: dllname, importc: "glFogCoordf".} -proc glFogCoordfv*(coord: PGLfloat){.dynlib: dllname, importc: "glFogCoordfv".} -proc glFogCoordd*(coord: TGLdouble){.dynlib: dllname, importc: "glFogCoordd".} -proc glFogCoorddv*(coord: PGLdouble){.dynlib: dllname, importc: "glFogCoorddv".} -proc glFogCoordPointer*(thetype: TGLenum, stride: TGLsizei, pointer: PGLvoid){. - dynlib: dllname, importc: "glFogCoordPointer".} -proc glMultiDrawArrays*(mode: TGLenum, first: PGLint, count: PGLsizei, - primcount: TGLsizei){.dynlib: dllname, - importc: "glMultiDrawArrays".} -proc glMultiDrawElements*(mode: TGLenum, count: PGLsizei, thetype: TGLenum, - indices: PGLvoid, primcount: TGLsizei){. - dynlib: dllname, importc: "glMultiDrawElements".} -proc glPointParameterf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, - importc: "glPointParameterf".} -proc glPointParameterfv*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, - importc: "glPointParameterfv".} -proc glPointParameteri*(pname: TGLenum, param: TGLint){.dynlib: dllname, - importc: "glPointParameteri".} -proc glPointParameteriv*(pname: TGLenum, params: PGLint){.dynlib: dllname, - importc: "glPointParameteriv".} -proc glSecondaryColor3b*(red: TGLByte, green: TGLByte, blue: TGLByte){. - dynlib: dllname, importc: "glSecondaryColor3b".} -proc glSecondaryColor3bv*(v: PGLbyte){.dynlib: dllname, - importc: "glSecondaryColor3bv".} -proc glSecondaryColor3d*(red: TGLdouble, green: TGLdouble, blue: TGLdouble){. - dynlib: dllname, importc: "glSecondaryColor3d".} -proc glSecondaryColor3dv*(v: PGLdouble){.dynlib: dllname, - importc: "glSecondaryColor3dv".} -proc glSecondaryColor3f*(red: TGLfloat, green: TGLfloat, blue: TGLfloat){. - dynlib: dllname, importc: "glSecondaryColor3f".} -proc glSecondaryColor3fv*(v: PGLfloat){.dynlib: dllname, - importc: "glSecondaryColor3fv".} -proc glSecondaryColor3i*(red: TGLint, green: TGLint, blue: TGLint){. - dynlib: dllname, importc: "glSecondaryColor3i".} -proc glSecondaryColor3iv*(v: PGLint){.dynlib: dllname, - importc: "glSecondaryColor3iv".} -proc glSecondaryColor3s*(red: TGLshort, green: TGLshort, blue: TGLshort){. - dynlib: dllname, importc: "glSecondaryColor3s".} -proc glSecondaryColor3sv*(v: PGLshort){.dynlib: dllname, - importc: "glSecondaryColor3sv".} -proc glSecondaryColor3ub*(red: TGLubyte, green: TGLubyte, blue: TGLubyte){. - dynlib: dllname, importc: "glSecondaryColor3ub".} -proc glSecondaryColor3ubv*(v: PGLubyte){.dynlib: dllname, - importc: "glSecondaryColor3ubv".} -proc glSecondaryColor3ui*(red: TGLuint, green: TGLuint, blue: TGLuint){. - dynlib: dllname, importc: "glSecondaryColor3ui".} -proc glSecondaryColor3uiv*(v: PGLuint){.dynlib: dllname, - importc: "glSecondaryColor3uiv".} -proc glSecondaryColor3us*(red: TGLushort, green: TGLushort, blue: TGLushort){. - dynlib: dllname, importc: "glSecondaryColor3us".} -proc glSecondaryColor3usv*(v: PGLushort){.dynlib: dllname, - importc: "glSecondaryColor3usv".} -proc glSecondaryColorPointer*(size: TGLint, thetype: TGLenum, stride: TGLsizei, - pointer: PGLvoid){.dynlib: dllname, - importc: "glSecondaryColorPointer".} -proc glWindowPos2d*(x: TGLdouble, y: TGLdouble){.dynlib: dllname, - importc: "glWindowPos2d".} -proc glWindowPos2dv*(v: PGLdouble){.dynlib: dllname, importc: "glWindowPos2dv".} -proc glWindowPos2f*(x: TGLfloat, y: TGLfloat){.dynlib: dllname, - importc: "glWindowPos2f".} -proc glWindowPos2fv*(v: PGLfloat){.dynlib: dllname, importc: "glWindowPos2fv".} -proc glWindowPos2i*(x: TGLint, y: TGLint){.dynlib: dllname, - importc: "glWindowPos2i".} -proc glWindowPos2iv*(v: PGLint){.dynlib: dllname, importc: "glWindowPos2iv".} -proc glWindowPos2s*(x: TGLshort, y: TGLshort){.dynlib: dllname, - importc: "glWindowPos2s".} -proc glWindowPos2sv*(v: PGLshort){.dynlib: dllname, importc: "glWindowPos2sv".} -proc glWindowPos3d*(x: TGLdouble, y: TGLdouble, z: TGLdouble){.dynlib: dllname, - importc: "glWindowPos3d".} -proc glWindowPos3dv*(v: PGLdouble){.dynlib: dllname, importc: "glWindowPos3dv".} -proc glWindowPos3f*(x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, - importc: "glWindowPos3f".} -proc glWindowPos3fv*(v: PGLfloat){.dynlib: dllname, importc: "glWindowPos3fv".} -proc glWindowPos3i*(x: TGLint, y: TGLint, z: TGLint){.dynlib: dllname, - importc: "glWindowPos3i".} -proc glWindowPos3iv*(v: PGLint){.dynlib: dllname, importc: "glWindowPos3iv".} -proc glWindowPos3s*(x: TGLshort, y: TGLshort, z: TGLshort){.dynlib: dllname, - importc: "glWindowPos3s".} -proc glWindowPos3sv*(v: PGLshort){.dynlib: dllname, importc: "glWindowPos3sv".} - #***** GL_version_1_5 *****// -const - GL_BUFFER_SIZE* = 0x00008764 - GL_BUFFER_USAGE* = 0x00008765 - GL_QUERY_COUNTER_BITS* = 0x00008864 - GL_CURRENT_QUERY* = 0x00008865 - GL_QUERY_RESULT* = 0x00008866 - GL_QUERY_RESULT_AVAILABLE* = 0x00008867 - GL_ARRAY_BUFFER* = 0x00008892 - GL_ELEMENT_ARRAY_BUFFER* = 0x00008893 - GL_ARRAY_BUFFER_BINDING* = 0x00008894 - GL_ELEMENT_ARRAY_BUFFER_BINDING* = 0x00008895 - GL_VERTEX_ARRAY_BUFFER_BINDING* = 0x00008896 - GL_NORMAL_ARRAY_BUFFER_BINDING* = 0x00008897 - GL_COLOR_ARRAY_BUFFER_BINDING* = 0x00008898 - GL_INDEX_ARRAY_BUFFER_BINDING* = 0x00008899 - GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING* = 0x0000889A - GL_EDGE_FLAG_ARRAY_BUFFER_BINDING* = 0x0000889B - GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING* = 0x0000889C - GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING* = 0x0000889D - GL_WEIGHT_ARRAY_BUFFER_BINDING* = 0x0000889E - GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING* = 0x0000889F - GL_READ_ONLY* = 0x000088B8 - GL_WRITE_ONLY* = 0x000088B9 - GL_READ_WRITE* = 0x000088BA - GL_BUFFER_ACCESS* = 0x000088BB - GL_BUFFER_MAPPED* = 0x000088BC - GL_BUFFER_MAP_POINTER* = 0x000088BD - GL_STREAM_DRAW* = 0x000088E0 - GL_STREAM_READ* = 0x000088E1 - GL_STREAM_COPY* = 0x000088E2 - GL_STATIC_DRAW* = 0x000088E4 - GL_STATIC_READ* = 0x000088E5 - GL_STATIC_COPY* = 0x000088E6 - GL_DYNAMIC_DRAW* = 0x000088E8 - GL_DYNAMIC_READ* = 0x000088E9 - GL_DYNAMIC_COPY* = 0x000088EA - GL_SAMPLES_PASSED* = 0x00008914 - GL_FOG_COORD_SRC* = 0x00008450 - GL_FOG_COORD* = 0x00008451 - GL_CURRENT_FOG_COORD* = 0x00008453 - GL_FOG_COORD_ARRAY_TYPE* = 0x00008454 - GL_FOG_COORD_ARRAY_STRIDE* = 0x00008455 - GL_FOG_COORD_ARRAY_POINTER* = 0x00008456 - GL_FOG_COORD_ARRAY* = 0x00008457 - GL_FOG_COORD_ARRAY_BUFFER_BINDING* = 0x0000889D - GL_SRC0_RGB* = 0x00008580 - GL_SRC1_RGB* = 0x00008581 - GL_SRC2_RGB* = 0x00008582 - GL_SRC0_ALPHA* = 0x00008588 - GL_SRC1_ALPHA* = 0x00008589 - GL_SRC2_ALPHA* = 0x0000858A - -proc glGenQueries*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glGenQueries".} -proc glDeleteQueries*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, - importc: "glDeleteQueries".} -proc glIsQuery*(id: TGLuint): TGLboolean{.dynlib: dllname, importc: "glIsQuery".} -proc glBeginQuery*(target: TGLenum, id: TGLuint){.dynlib: dllname, - importc: "glBeginQuery".} -proc glEndQuery*(target: TGLenum){.dynlib: dllname, importc: "glEndQuery".} -proc glGetQueryiv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetQueryiv".} -proc glGetQueryObjectiv*(id: TGLuint, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetQueryObjectiv".} -proc glGetQueryObjectuiv*(id: TGLuint, pname: TGLenum, params: PGLuint){. - dynlib: dllname, importc: "glGetQueryObjectuiv".} -proc glBindBuffer*(target: TGLenum, buffer: TGLuint){.dynlib: dllname, - importc: "glBindBuffer".} -proc glDeleteBuffers*(n: TGLsizei, buffers: PGLuint){.dynlib: dllname, - importc: "glDeleteBuffers".} -proc glGenBuffers*(n: TGLsizei, buffers: PGLuint){.dynlib: dllname, - importc: "glGenBuffers".} -proc glIsBuffer*(buffer: TGLuint): TGLboolean{.dynlib: dllname, - importc: "glIsBuffer".} -proc glBufferData*(target: TGLenum, size: GLsizeiptr, data: PGLvoid, - usage: TGLenum){.dynlib: dllname, importc: "glBufferData".} -proc glBufferSubData*(target: TGLenum, offset: GLintptr, size: GLsizeiptr, - data: PGLvoid){.dynlib: dllname, - importc: "glBufferSubData".} -proc glGetBufferSubData*(target: TGLenum, offset: GLintptr, size: GLsizeiptr, - data: PGLvoid){.dynlib: dllname, - importc: "glGetBufferSubData".} -proc glMapBuffer*(target: TGLenum, access: TGLenum): PGLvoid{.dynlib: dllname, - importc: "glMapBuffer".} -proc glUnmapBuffer*(target: TGLenum): TGLboolean{.dynlib: dllname, - importc: "glUnmapBuffer".} -proc glGetBufferParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. - dynlib: dllname, importc: "glGetBufferParameteriv".} -proc glGetBufferPointerv*(target: TGLenum, pname: TGLenum, params: PGLvoid){. - dynlib: dllname, importc: "glGetBufferPointerv".} - #***** GL_version_2_0 *****// -const - GL_BLEND_EQUATION_RGB* = 0x00008009 - GL_VERTEX_ATTRIB_ARRAY_ENABLED* = 0x00008622 - GL_VERTEX_ATTRIB_ARRAY_SIZE* = 0x00008623 - GL_VERTEX_ATTRIB_ARRAY_STRIDE* = 0x00008624 - GL_VERTEX_ATTRIB_ARRAY_TYPE* = 0x00008625 - GL_CURRENT_VERTEX_ATTRIB* = 0x00008626 - GL_VERTEX_PROGRAM_POINT_SIZE* = 0x00008642 - GL_VERTEX_PROGRAM_TWO_SIDE* = 0x00008643 - GL_VERTEX_ATTRIB_ARRAY_POINTER* = 0x00008645 - GL_STENCIL_BACK_FUNC* = 0x00008800 - GL_STENCIL_BACK_FAIL* = 0x00008801 - GL_STENCIL_BACK_PASS_DEPTH_FAIL* = 0x00008802 - GL_STENCIL_BACK_PASS_DEPTH_PASS* = 0x00008803 - GL_MAX_DRAW_BUFFERS* = 0x00008824 - GL_DRAW_BUFFER0* = 0x00008825 - GL_DRAW_BUFFER1* = 0x00008826 - GL_DRAW_BUFFER2* = 0x00008827 - GL_DRAW_BUFFER3* = 0x00008828 - GL_DRAW_BUFFER4* = 0x00008829 - GL_DRAW_BUFFER5* = 0x0000882A - GL_DRAW_BUFFER6* = 0x0000882B - GL_DRAW_BUFFER7* = 0x0000882C - GL_DRAW_BUFFER8* = 0x0000882D - GL_DRAW_BUFFER9* = 0x0000882E - GL_DRAW_BUFFER10* = 0x0000882F - GL_DRAW_BUFFER11* = 0x00008830 - GL_DRAW_BUFFER12* = 0x00008831 - GL_DRAW_BUFFER13* = 0x00008832 - GL_DRAW_BUFFER14* = 0x00008833 - GL_DRAW_BUFFER15* = 0x00008834 - GL_BLEND_EQUATION_ALPHA* = 0x0000883D - GL_POINT_SPRITE* = 0x00008861 - GL_COORD_REPLACE* = 0x00008862 - GL_MAX_VERTEX_ATTRIBS* = 0x00008869 - GL_VERTEX_ATTRIB_ARRAY_NORMALIZED* = 0x0000886A - GL_MAX_TEXTURE_COORDS* = 0x00008871 - GL_MAX_TEXTURE_IMAGE_UNITS* = 0x00008872 - GL_FRAGMENT_SHADER* = 0x00008B30 - GL_VERTEX_SHADER* = 0x00008B31 - GL_MAX_FRAGMENT_UNIFORM_COMPONENTS* = 0x00008B49 - GL_MAX_VERTEX_UNIFORM_COMPONENTS* = 0x00008B4A - GL_MAX_VARYING_FLOATS* = 0x00008B4B - GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS* = 0x00008B4C - GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS* = 0x00008B4D - GL_SHADER_TYPE* = 0x00008B4F - GL_FLOAT_VEC2* = 0x00008B50 - GL_FLOAT_VEC3* = 0x00008B51 - GL_FLOAT_VEC4* = 0x00008B52 - GL_INT_VEC2* = 0x00008B53 - GL_INT_VEC3* = 0x00008B54 - GL_INT_VEC4* = 0x00008B55 - GL_BOOL* = 0x00008B56 - GL_BOOL_VEC2* = 0x00008B57 - GL_BOOL_VEC3* = 0x00008B58 - GL_BOOL_VEC4* = 0x00008B59 - GL_FLOAT_MAT2* = 0x00008B5A - GL_FLOAT_MAT3* = 0x00008B5B - GL_FLOAT_MAT4* = 0x00008B5C - GL_SAMPLER_1D* = 0x00008B5D - GL_SAMPLER_2D* = 0x00008B5E - GL_SAMPLER_3D* = 0x00008B5F - GL_SAMPLER_CUBE* = 0x00008B60 - GL_SAMPLER_1D_SHADOW* = 0x00008B61 - GL_SAMPLER_2D_SHADOW* = 0x00008B62 - GL_DELETE_STATUS* = 0x00008B80 - GL_COMPILE_STATUS* = 0x00008B81 - GL_LINK_STATUS* = 0x00008B82 - GL_VALIDATE_STATUS* = 0x00008B83 - GL_INFO_LOG_LENGTH* = 0x00008B84 - GL_ATTACHED_SHADERS* = 0x00008B85 - GL_ACTIVE_UNIFORMS* = 0x00008B86 - GL_ACTIVE_UNIFORM_MAX_LENGTH* = 0x00008B87 - GL_SHADER_SOURCE_LENGTH* = 0x00008B88 - GL_ACTIVE_ATTRIBUTES* = 0x00008B89 - GL_ACTIVE_ATTRIBUTE_MAX_LENGTH* = 0x00008B8A - GL_FRAGMENT_SHADER_DERIVATIVE_HINT* = 0x00008B8B - GL_SHADING_LANGUAGE_VERSION* = 0x00008B8C - GL_CURRENT_PROGRAM* = 0x00008B8D - GL_POINT_SPRITE_COORD_ORIGIN* = 0x00008CA0 - GL_LOWER_LEFT* = 0x00008CA1 - GL_UPPER_LEFT* = 0x00008CA2 - GL_STENCIL_BACK_REF* = 0x00008CA3 - GL_STENCIL_BACK_VALUE_MASK* = 0x00008CA4 - GL_STENCIL_BACK_WRITEMASK* = 0x00008CA5 - -{.pop.} \ No newline at end of file diff --git a/lib/wrappers/opengl/glu.nim b/lib/wrappers/opengl/glu.nim deleted file mode 100644 index e00120d83b..0000000000 --- a/lib/wrappers/opengl/glu.nim +++ /dev/null @@ -1,335 +0,0 @@ -# -# -# Adaption of the delphi3d.net OpenGL units to FreePascal -# Sebastian Guenther (sg@freepascal.org) in 2002 -# These units are free to use -#****************************************************************************** -# Converted to Delphi by Tom Nuydens (tom@delphi3d.net) -# For the latest updates, visit Delphi3D: http://www.delphi3d.net -#****************************************************************************** - -import - GL - -when defined(windows): - {.push, callconv: stdcall.} -else: - {.push, callconv: cdecl.} - -when defined(windows): - const - dllname = "glu32.dll" -elif defined(macosx): - const - dllname = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib" -else: - const - dllname = "libGLU.so.1" -type - TViewPortArray* = array[0..3, TGLint] - T16dArray* = array[0..15, TGLdouble] - TCallBack* = proc () - T3dArray* = array[0..2, TGLdouble] - T4pArray* = array[0..3, Pointer] - T4fArray* = array[0..3, TGLfloat] - PPointer* = ptr Pointer - -type - GLUnurbs*{.final.} = object - PGLUnurbs* = ptr GLUnurbs - GLUquadric*{.final.} = object - PGLUquadric* = ptr GLUquadric - GLUtesselator*{.final.} = object - PGLUtesselator* = ptr GLUtesselator # backwards compatibility: - GLUnurbsObj* = GLUnurbs - PGLUnurbsObj* = PGLUnurbs - GLUquadricObj* = GLUquadric - PGLUquadricObj* = PGLUquadric - GLUtesselatorObj* = GLUtesselator - PGLUtesselatorObj* = PGLUtesselator - GLUtriangulatorObj* = GLUtesselator - PGLUtriangulatorObj* = PGLUtesselator - TGLUnurbs* = GLUnurbs - TGLUquadric* = GLUquadric - TGLUtesselator* = GLUtesselator - TGLUnurbsObj* = GLUnurbsObj - TGLUquadricObj* = GLUquadricObj - TGLUtesselatorObj* = GLUtesselatorObj - TGLUtriangulatorObj* = GLUtriangulatorObj - -proc gluErrorString*(errCode: TGLenum): cstring{.dynlib: dllname, - importc: "gluErrorString".} -proc gluErrorUnicodeStringEXT*(errCode: TGLenum): ptr int16{.dynlib: dllname, - importc: "gluErrorUnicodeStringEXT".} -proc gluGetString*(name: TGLenum): cstring{.dynlib: dllname, - importc: "gluGetString".} -proc gluOrtho2D*(left, right, bottom, top: TGLdouble){.dynlib: dllname, - importc: "gluOrtho2D".} -proc gluPerspective*(fovy, aspect, zNear, zFar: TGLdouble){.dynlib: dllname, - importc: "gluPerspective".} -proc gluPickMatrix*(x, y, width, height: TGLdouble, viewport: var TViewPortArray){. - dynlib: dllname, importc: "gluPickMatrix".} -proc gluLookAt*(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: TGLdouble){. - dynlib: dllname, importc: "gluLookAt".} -proc gluProject*(objx, objy, objz: TGLdouble, - modelMatrix, projMatrix: var T16dArray, - viewport: var TViewPortArray, winx, winy, winz: PGLdouble): int{. - dynlib: dllname, importc: "gluProject".} -proc gluUnProject*(winx, winy, winz: TGLdouble, - modelMatrix, projMatrix: var T16dArray, - viewport: var TViewPortArray, objx, objy, objz: PGLdouble): int{. - dynlib: dllname, importc: "gluUnProject".} -proc gluScaleImage*(format: TGLenum, widthin, heightin: TGLint, typein: TGLenum, - datain: Pointer, widthout, heightout: TGLint, - typeout: TGLenum, dataout: Pointer): int{.dynlib: dllname, - importc: "gluScaleImage".} -proc gluBuild1DMipmaps*(target: TGLenum, components, width: TGLint, - format, atype: TGLenum, data: Pointer): int{. - dynlib: dllname, importc: "gluBuild1DMipmaps".} -proc gluBuild2DMipmaps*(target: TGLenum, components, width, height: TGLint, - format, atype: TGLenum, data: Pointer): int{. - dynlib: dllname, importc: "gluBuild2DMipmaps".} -proc gluNewQuadric*(): PGLUquadric{.dynlib: dllname, importc: "gluNewQuadric".} -proc gluDeleteQuadric*(state: PGLUquadric){.dynlib: dllname, - importc: "gluDeleteQuadric".} -proc gluQuadricNormals*(quadObject: PGLUquadric, normals: TGLenum){. - dynlib: dllname, importc: "gluQuadricNormals".} -proc gluQuadricTexture*(quadObject: PGLUquadric, textureCoords: TGLboolean){. - dynlib: dllname, importc: "gluQuadricTexture".} -proc gluQuadricOrientation*(quadObject: PGLUquadric, orientation: TGLenum){. - dynlib: dllname, importc: "gluQuadricOrientation".} -proc gluQuadricDrawStyle*(quadObject: PGLUquadric, drawStyle: TGLenum){. - dynlib: dllname, importc: "gluQuadricDrawStyle".} -proc gluCylinder*(qobj: PGLUquadric, baseRadius, topRadius, height: TGLdouble, - slices, stacks: TGLint){.dynlib: dllname, - importc: "gluCylinder".} -proc gluDisk*(qobj: PGLUquadric, innerRadius, outerRadius: TGLdouble, - slices, loops: TGLint){.dynlib: dllname, importc: "gluDisk".} -proc gluPartialDisk*(qobj: PGLUquadric, innerRadius, outerRadius: TGLdouble, - slices, loops: TGLint, startAngle, sweepAngle: TGLdouble){. - dynlib: dllname, importc: "gluPartialDisk".} -proc gluSphere*(qobj: PGLuquadric, radius: TGLdouble, slices, stacks: TGLint){. - dynlib: dllname, importc: "gluSphere".} -proc gluQuadricCallback*(qobj: PGLUquadric, which: TGLenum, fn: TCallBack){. - dynlib: dllname, importc: "gluQuadricCallback".} -proc gluNewTess*(): PGLUtesselator{.dynlib: dllname, importc: "gluNewTess".} -proc gluDeleteTess*(tess: PGLUtesselator){.dynlib: dllname, - importc: "gluDeleteTess".} -proc gluTessBeginPolygon*(tess: PGLUtesselator, polygon_data: Pointer){. - dynlib: dllname, importc: "gluTessBeginPolygon".} -proc gluTessBeginContour*(tess: PGLUtesselator){.dynlib: dllname, - importc: "gluTessBeginContour".} -proc gluTessVertex*(tess: PGLUtesselator, coords: var T3dArray, data: Pointer){. - dynlib: dllname, importc: "gluTessVertex".} -proc gluTessEndContour*(tess: PGLUtesselator){.dynlib: dllname, - importc: "gluTessEndContour".} -proc gluTessEndPolygon*(tess: PGLUtesselator){.dynlib: dllname, - importc: "gluTessEndPolygon".} -proc gluTessProperty*(tess: PGLUtesselator, which: TGLenum, value: TGLdouble){. - dynlib: dllname, importc: "gluTessProperty".} -proc gluTessNormal*(tess: PGLUtesselator, x, y, z: TGLdouble){.dynlib: dllname, - importc: "gluTessNormal".} -proc gluTessCallback*(tess: PGLUtesselator, which: TGLenum, fn: TCallBack){. - dynlib: dllname, importc: "gluTessCallback".} -proc gluGetTessProperty*(tess: PGLUtesselator, which: TGLenum, value: PGLdouble){. - dynlib: dllname, importc: "gluGetTessProperty".} -proc gluNewNurbsRenderer*(): PGLUnurbs{.dynlib: dllname, - importc: "gluNewNurbsRenderer".} -proc gluDeleteNurbsRenderer*(nobj: PGLUnurbs){.dynlib: dllname, - importc: "gluDeleteNurbsRenderer".} -proc gluBeginSurface*(nobj: PGLUnurbs){.dynlib: dllname, - importc: "gluBeginSurface".} -proc gluBeginCurve*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluBeginCurve".} -proc gluEndCurve*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluEndCurve".} -proc gluEndSurface*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluEndSurface".} -proc gluBeginTrim*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluBeginTrim".} -proc gluEndTrim*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluEndTrim".} -proc gluPwlCurve*(nobj: PGLUnurbs, count: TGLint, aarray: PGLfloat, - stride: TGLint, atype: TGLenum){.dynlib: dllname, - importc: "gluPwlCurve".} -proc gluNurbsCurve*(nobj: PGLUnurbs, nknots: TGLint, knot: PGLfloat, - stride: TGLint, ctlarray: PGLfloat, order: TGLint, - atype: TGLenum){.dynlib: dllname, importc: "gluNurbsCurve".} -proc gluNurbsSurface*(nobj: PGLUnurbs, sknot_count: TGLint, sknot: PGLfloat, - tknot_count: TGLint, tknot: PGLfloat, - s_stride, t_stride: TGLint, ctlarray: PGLfloat, - sorder, torder: TGLint, atype: TGLenum){.dynlib: dllname, - importc: "gluNurbsSurface".} -proc gluLoadSamplingMatrices*(nobj: PGLUnurbs, - modelMatrix, projMatrix: var T16dArray, - viewport: var TViewPortArray){.dynlib: dllname, - importc: "gluLoadSamplingMatrices".} -proc gluNurbsProperty*(nobj: PGLUnurbs, aproperty: TGLenum, value: TGLfloat){. - dynlib: dllname, importc: "gluNurbsProperty".} -proc gluGetNurbsProperty*(nobj: PGLUnurbs, aproperty: TGLenum, value: PGLfloat){. - dynlib: dllname, importc: "gluGetNurbsProperty".} -proc gluNurbsCallback*(nobj: PGLUnurbs, which: TGLenum, fn: TCallBack){. - dynlib: dllname, importc: "gluNurbsCallback".} - #*** Callback function prototypes *** -type # gluQuadricCallback - GLUquadricErrorProc* = proc (p: TGLenum) # gluTessCallback - GLUtessBeginProc* = proc (p: TGLenum) - GLUtessEdgeFlagProc* = proc (p: TGLboolean) - GLUtessVertexProc* = proc (p: Pointer) - GLUtessEndProc* = proc () - GLUtessErrorProc* = proc (p: TGLenum) - GLUtessCombineProc* = proc (p1: var T3dArray, p2: T4pArray, p3: T4fArray, - p4: PPointer) - GLUtessBeginDataProc* = proc (p1: TGLenum, p2: Pointer) - GLUtessEdgeFlagDataProc* = proc (p1: TGLboolean, p2: Pointer) - GLUtessVertexDataProc* = proc (p1, p2: Pointer) - GLUtessEndDataProc* = proc (p: Pointer) - GLUtessErrorDataProc* = proc (p1: TGLenum, p2: Pointer) - GLUtessCombineDataProc* = proc (p1: var T3dArray, p2: var T4pArray, - p3: var T4fArray, p4: PPointer, p5: Pointer) # - # - # gluNurbsCallback - GLUnurbsErrorProc* = proc (p: TGLenum) #*** Generic constants ****/ - -const # Version - GLU_VERSION_1_1* = 1 - GLU_VERSION_1_2* = 1 # Errors: (return value 0 = no error) - GLU_INVALID_ENUM* = 100900 - GLU_INVALID_VALUE* = 100901 - GLU_OUT_OF_MEMORY* = 100902 - GLU_INCOMPATIBLE_GL_VERSION* = 100903 # StringName - GLU_VERSION* = 100800 - GLU_EXTENSIONS* = 100801 # Boolean - GLU_TRUE* = GL_TRUE - GLU_FALSE* = GL_FALSE #*** Quadric constants ****/ - # QuadricNormal - GLU_SMOOTH* = 100000 - GLU_FLAT* = 100001 - GLU_NONE* = 100002 # QuadricDrawStyle - GLU_POINT* = 100010 - GLU_LINE* = 100011 - GLU_FILL* = 100012 - GLU_SILHOUETTE* = 100013 # QuadricOrientation - GLU_OUTSIDE* = 100020 - GLU_INSIDE* = 100021 # Callback types: - # GLU_ERROR = 100103; - #*** Tesselation constants ****/ - GLU_TESS_MAX_COORD* = 1.00000e+150 # TessProperty - GLU_TESS_WINDING_RULE* = 100140 - GLU_TESS_BOUNDARY_ONLY* = 100141 - GLU_TESS_TOLERANCE* = 100142 # TessWinding - GLU_TESS_WINDING_ODD* = 100130 - GLU_TESS_WINDING_NONZERO* = 100131 - GLU_TESS_WINDING_POSITIVE* = 100132 - GLU_TESS_WINDING_NEGATIVE* = 100133 - GLU_TESS_WINDING_ABS_GEQ_TWO* = 100134 # TessCallback - GLU_TESS_BEGIN* = 100100 # void (CALLBACK*)(TGLenum type) - constGLU_TESS_VERTEX* = 100101 # void (CALLBACK*)(void *data) - GLU_TESS_END* = 100102 # void (CALLBACK*)(void) - GLU_TESS_ERROR* = 100103 # void (CALLBACK*)(TGLenum errno) - GLU_TESS_EDGE_FLAG* = 100104 # void (CALLBACK*)(TGLboolean boundaryEdge) - GLU_TESS_COMBINE* = 100105 # void (CALLBACK*)(TGLdouble coords[3], - # void *data[4], - # TGLfloat weight[4], - # void **dataOut) - GLU_TESS_BEGIN_DATA* = 100106 # void (CALLBACK*)(TGLenum type, - # void *polygon_data) - GLU_TESS_VERTEX_DATA* = 100107 # void (CALLBACK*)(void *data, - # void *polygon_data) - GLU_TESS_END_DATA* = 100108 # void (CALLBACK*)(void *polygon_data) - GLU_TESS_ERROR_DATA* = 100109 # void (CALLBACK*)(TGLenum errno, - # void *polygon_data) - GLU_TESS_EDGE_FLAG_DATA* = 100110 # void (CALLBACK*)(TGLboolean boundaryEdge, - # void *polygon_data) - GLU_TESS_COMBINE_DATA* = 100111 # void (CALLBACK*)(TGLdouble coords[3], - # void *data[4], - # TGLfloat weight[4], - # void **dataOut, - # void *polygon_data) - # TessError - GLU_TESS_ERROR1* = 100151 - GLU_TESS_ERROR2* = 100152 - GLU_TESS_ERROR3* = 100153 - GLU_TESS_ERROR4* = 100154 - GLU_TESS_ERROR5* = 100155 - GLU_TESS_ERROR6* = 100156 - GLU_TESS_ERROR7* = 100157 - GLU_TESS_ERROR8* = 100158 - GLU_TESS_MISSING_BEGIN_POLYGON* = GLU_TESS_ERROR1 - GLU_TESS_MISSING_BEGIN_CONTOUR* = GLU_TESS_ERROR2 - GLU_TESS_MISSING_END_POLYGON* = GLU_TESS_ERROR3 - GLU_TESS_MISSING_END_CONTOUR* = GLU_TESS_ERROR4 - GLU_TESS_COORD_TOO_LARGE* = GLU_TESS_ERROR5 - GLU_TESS_NEED_COMBINE_CALLBACK* = GLU_TESS_ERROR6 #*** NURBS constants ****/ - # NurbsProperty - GLU_AUTO_LOAD_MATRIX* = 100200 - GLU_CULLING* = 100201 - GLU_SAMPLING_TOLERANCE* = 100203 - GLU_DISPLAY_MODE* = 100204 - GLU_PARAMETRIC_TOLERANCE* = 100202 - GLU_SAMPLING_METHOD* = 100205 - GLU_U_STEP* = 100206 - GLU_V_STEP* = 100207 # NurbsSampling - GLU_PATH_LENGTH* = 100215 - GLU_PARAMETRIC_ERROR* = 100216 - GLU_DOMAIN_DISTANCE* = 100217 # NurbsTrim - GLU_MAP1_TRIM_2* = 100210 - GLU_MAP1_TRIM_3* = 100211 # NurbsDisplay - # GLU_FILL = 100012; - GLU_OUTLINE_POLYGON* = 100240 - GLU_OUTLINE_PATCH* = 100241 # NurbsCallback - # GLU_ERROR = 100103; - # NurbsErrors - GLU_NURBS_ERROR1* = 100251 - GLU_NURBS_ERROR2* = 100252 - GLU_NURBS_ERROR3* = 100253 - GLU_NURBS_ERROR4* = 100254 - GLU_NURBS_ERROR5* = 100255 - GLU_NURBS_ERROR6* = 100256 - GLU_NURBS_ERROR7* = 100257 - GLU_NURBS_ERROR8* = 100258 - GLU_NURBS_ERROR9* = 100259 - GLU_NURBS_ERROR10* = 100260 - GLU_NURBS_ERROR11* = 100261 - GLU_NURBS_ERROR12* = 100262 - GLU_NURBS_ERROR13* = 100263 - GLU_NURBS_ERROR14* = 100264 - GLU_NURBS_ERROR15* = 100265 - GLU_NURBS_ERROR16* = 100266 - GLU_NURBS_ERROR17* = 100267 - GLU_NURBS_ERROR18* = 100268 - GLU_NURBS_ERROR19* = 100269 - GLU_NURBS_ERROR20* = 100270 - GLU_NURBS_ERROR21* = 100271 - GLU_NURBS_ERROR22* = 100272 - GLU_NURBS_ERROR23* = 100273 - GLU_NURBS_ERROR24* = 100274 - GLU_NURBS_ERROR25* = 100275 - GLU_NURBS_ERROR26* = 100276 - GLU_NURBS_ERROR27* = 100277 - GLU_NURBS_ERROR28* = 100278 - GLU_NURBS_ERROR29* = 100279 - GLU_NURBS_ERROR30* = 100280 - GLU_NURBS_ERROR31* = 100281 - GLU_NURBS_ERROR32* = 100282 - GLU_NURBS_ERROR33* = 100283 - GLU_NURBS_ERROR34* = 100284 - GLU_NURBS_ERROR35* = 100285 - GLU_NURBS_ERROR36* = 100286 - GLU_NURBS_ERROR37* = 100287 #*** Backwards compatibility for old tesselator ****/ - -proc gluBeginPolygon*(tess: PGLUtesselator){.dynlib: dllname, - importc: "gluBeginPolygon".} -proc gluNextContour*(tess: PGLUtesselator, atype: TGLenum){.dynlib: dllname, - importc: "gluNextContour".} -proc gluEndPolygon*(tess: PGLUtesselator){.dynlib: dllname, - importc: "gluEndPolygon".} -const # Contours types -- obsolete! - GLU_CW* = 100120 - GLU_CCW* = 100121 - GLU_INTERIOR* = 100122 - GLU_EXTERIOR* = 100123 - GLU_UNKNOWN* = 100124 # Names without "TESS_" prefix - GLU_BEGIN* = GLU_TESS_BEGIN - GLU_VERTEX* = constGLU_TESS_VERTEX - GLU_END* = GLU_TESS_END - GLU_ERROR* = GLU_TESS_ERROR - GLU_EDGE_FLAG* = GLU_TESS_EDGE_FLAG - -{.pop.} -# implementation diff --git a/lib/wrappers/opengl/glut.nim b/lib/wrappers/opengl/glut.nim deleted file mode 100644 index ff157c3273..0000000000 --- a/lib/wrappers/opengl/glut.nim +++ /dev/null @@ -1,438 +0,0 @@ -# -# -# Adaption of the delphi3d.net OpenGL units to FreePascal -# Sebastian Guenther (sg@freepascal.org) in 2002 -# These units are free to use -# - -# Copyright (c) Mark J. Kilgard, 1994, 1995, 1996. -# This program is freely distributable without licensing fees and is -# provided without guarantee or warrantee expressed or implied. This -# program is -not- in the public domain. -#****************************************************************************** -# Converted to Delphi by Tom Nuydens (tom@delphi3d.net) -# Contributions by Igor Karpov (glygrik@hotbox.ru) -# For the latest updates, visit Delphi3D: http://www.delphi3d.net -#****************************************************************************** - -import - GL - -when defined(windows): - const - dllname = "glut32.dll" -elif defined(macosx): - const - dllname = "/System/Library/Frameworks/GLUT.framework/GLUT" -else: - const - dllname = "libglut.so.3" -type - TGlutVoidCallback* = proc (){.cdecl.} - TGlut1IntCallback* = proc (value: cint){.cdecl.} - TGlut2IntCallback* = proc (v1, v2: cint){.cdecl.} - TGlut3IntCallback* = proc (v1, v2, v3: cint){.cdecl.} - TGlut4IntCallback* = proc (v1, v2, v3, v4: cint){.cdecl.} - TGlut1Char2IntCallback* = proc (c: int8, v1, v2: cint){.cdecl.} - TGlut1UInt3IntCallback* = proc (u, v1, v2, v3: cint){.cdecl.} - -const - GLUT_API_VERSION* = 3 - GLUT_XLIB_IMPLEMENTATION* = 12 # Display mode bit masks. - GLUT_RGB* = 0 - GLUT_RGBA* = GLUT_RGB - GLUT_INDEX* = 1 - GLUT_SINGLE* = 0 - GLUT_DOUBLE* = 2 - GLUT_ACCUM* = 4 - GLUT_ALPHA* = 8 - GLUT_DEPTH* = 16 - GLUT_STENCIL* = 32 - GLUT_MULTISAMPLE* = 128 - GLUT_STEREO* = 256 - GLUT_LUMINANCE* = 512 # Mouse buttons. - GLUT_LEFT_BUTTON* = 0 - GLUT_MIDDLE_BUTTON* = 1 - GLUT_RIGHT_BUTTON* = 2 # Mouse button state. - GLUT_DOWN* = 0 - GLUT_UP* = 1 # function keys - GLUT_KEY_F1* = 1 - GLUT_KEY_F2* = 2 - GLUT_KEY_F3* = 3 - GLUT_KEY_F4* = 4 - GLUT_KEY_F5* = 5 - GLUT_KEY_F6* = 6 - GLUT_KEY_F7* = 7 - GLUT_KEY_F8* = 8 - GLUT_KEY_F9* = 9 - GLUT_KEY_F10* = 10 - GLUT_KEY_F11* = 11 - GLUT_KEY_F12* = 12 # directional keys - GLUT_KEY_LEFT* = 100 - GLUT_KEY_UP* = 101 - GLUT_KEY_RIGHT* = 102 - GLUT_KEY_DOWN* = 103 - GLUT_KEY_PAGE_UP* = 104 - GLUT_KEY_PAGE_DOWN* = 105 - GLUT_KEY_HOME* = 106 - GLUT_KEY_END* = 107 - GLUT_KEY_INSERT* = 108 # Entry/exit state. - GLUT_LEFT* = 0 - GLUT_ENTERED* = 1 # Menu usage state. - GLUT_MENU_NOT_IN_USE* = 0 - GLUT_MENU_IN_USE* = 1 # Visibility state. - GLUT_NOT_VISIBLE* = 0 - GLUT_VISIBLE* = 1 # Window status state. - GLUT_HIDDEN* = 0 - GLUT_FULLY_RETAINED* = 1 - GLUT_PARTIALLY_RETAINED* = 2 - GLUT_FULLY_COVERED* = 3 # Color index component selection values. - GLUT_RED* = 0 - GLUT_GREEN* = 1 - GLUT_BLUE* = 2 # Layers for use. - GLUT_NORMAL* = 0 - GLUT_OVERLAY* = 1 - -when defined(Windows): - const # Stroke font constants (use these in GLUT program). - GLUT_STROKE_ROMAN* = cast[Pointer](0) - GLUT_STROKE_MONO_ROMAN* = cast[Pointer](1) # Bitmap font constants (use these in GLUT program). - GLUT_BITMAP_9_BY_15* = cast[Pointer](2) - GLUT_BITMAP_8_BY_13* = cast[Pointer](3) - GLUT_BITMAP_TIMES_ROMAN_10* = cast[Pointer](4) - GLUT_BITMAP_TIMES_ROMAN_24* = cast[Pointer](5) - GLUT_BITMAP_HELVETICA_10* = cast[Pointer](6) - GLUT_BITMAP_HELVETICA_12* = cast[Pointer](7) - GLUT_BITMAP_HELVETICA_18* = cast[Pointer](8) -else: - var # Stroke font constants (use these in GLUT program). - GLUT_STROKE_ROMAN*: Pointer - GLUT_STROKE_MONO_ROMAN*: Pointer # Bitmap font constants (use these in GLUT program). - GLUT_BITMAP_9_BY_15*: Pointer - GLUT_BITMAP_8_BY_13*: Pointer - GLUT_BITMAP_TIMES_ROMAN_10*: Pointer - GLUT_BITMAP_TIMES_ROMAN_24*: Pointer - GLUT_BITMAP_HELVETICA_10*: Pointer - GLUT_BITMAP_HELVETICA_12*: Pointer - GLUT_BITMAP_HELVETICA_18*: Pointer -const # glutGet parameters. - GLUT_WINDOW_X* = 100 - GLUT_WINDOW_Y* = 101 - GLUT_WINDOW_WIDTH* = 102 - GLUT_WINDOW_HEIGHT* = 103 - GLUT_WINDOW_BUFFER_SIZE* = 104 - GLUT_WINDOW_STENCIL_SIZE* = 105 - GLUT_WINDOW_DEPTH_SIZE* = 106 - GLUT_WINDOW_RED_SIZE* = 107 - GLUT_WINDOW_GREEN_SIZE* = 108 - GLUT_WINDOW_BLUE_SIZE* = 109 - GLUT_WINDOW_ALPHA_SIZE* = 110 - GLUT_WINDOW_ACCUM_RED_SIZE* = 111 - GLUT_WINDOW_ACCUM_GREEN_SIZE* = 112 - GLUT_WINDOW_ACCUM_BLUE_SIZE* = 113 - GLUT_WINDOW_ACCUM_ALPHA_SIZE* = 114 - GLUT_WINDOW_DOUBLEBUFFER* = 115 - GLUT_WINDOW_RGBA* = 116 - GLUT_WINDOW_PARENT* = 117 - GLUT_WINDOW_NUM_CHILDREN* = 118 - GLUT_WINDOW_COLORMAP_SIZE* = 119 - GLUT_WINDOW_NUM_SAMPLES* = 120 - GLUT_WINDOW_STEREO* = 121 - GLUT_WINDOW_CURSOR* = 122 - GLUT_SCREEN_WIDTH* = 200 - GLUT_SCREEN_HEIGHT* = 201 - GLUT_SCREEN_WIDTH_MM* = 202 - GLUT_SCREEN_HEIGHT_MM* = 203 - GLUT_MENU_NUM_ITEMS* = 300 - GLUT_DISPLAY_MODE_POSSIBLE* = 400 - GLUT_INIT_WINDOW_X* = 500 - GLUT_INIT_WINDOW_Y* = 501 - GLUT_INIT_WINDOW_WIDTH* = 502 - GLUT_INIT_WINDOW_HEIGHT* = 503 - constGLUT_INIT_DISPLAY_MODE* = 504 - GLUT_ELAPSED_TIME* = 700 - GLUT_WINDOW_FORMAT_ID* = 123 # glutDeviceGet parameters. - GLUT_HAS_KEYBOARD* = 600 - GLUT_HAS_MOUSE* = 601 - GLUT_HAS_SPACEBALL* = 602 - GLUT_HAS_DIAL_AND_BUTTON_BOX* = 603 - GLUT_HAS_TABLET* = 604 - GLUT_NUM_MOUSE_BUTTONS* = 605 - GLUT_NUM_SPACEBALL_BUTTONS* = 606 - GLUT_NUM_BUTTON_BOX_BUTTONS* = 607 - GLUT_NUM_DIALS* = 608 - GLUT_NUM_TABLET_BUTTONS* = 609 - GLUT_DEVICE_IGNORE_KEY_REPEAT* = 610 - GLUT_DEVICE_KEY_REPEAT* = 611 - GLUT_HAS_JOYSTICK* = 612 - GLUT_OWNS_JOYSTICK* = 613 - GLUT_JOYSTICK_BUTTONS* = 614 - GLUT_JOYSTICK_AXES* = 615 - GLUT_JOYSTICK_POLL_RATE* = 616 # glutLayerGet parameters. - GLUT_OVERLAY_POSSIBLE* = 800 - GLUT_LAYER_IN_USE* = 801 - GLUT_HAS_OVERLAY* = 802 - GLUT_TRANSPARENT_INDEX* = 803 - GLUT_NORMAL_DAMAGED* = 804 - GLUT_OVERLAY_DAMAGED* = 805 # glutVideoResizeGet parameters. - GLUT_VIDEO_RESIZE_POSSIBLE* = 900 - GLUT_VIDEO_RESIZE_IN_USE* = 901 - GLUT_VIDEO_RESIZE_X_DELTA* = 902 - GLUT_VIDEO_RESIZE_Y_DELTA* = 903 - GLUT_VIDEO_RESIZE_WIDTH_DELTA* = 904 - GLUT_VIDEO_RESIZE_HEIGHT_DELTA* = 905 - GLUT_VIDEO_RESIZE_X* = 906 - GLUT_VIDEO_RESIZE_Y* = 907 - GLUT_VIDEO_RESIZE_WIDTH* = 908 - GLUT_VIDEO_RESIZE_HEIGHT* = 909 # glutGetModifiers return mask. - GLUT_ACTIVE_SHIFT* = 1 - GLUT_ACTIVE_CTRL* = 2 - GLUT_ACTIVE_ALT* = 4 # glutSetCursor parameters. - # Basic arrows. - GLUT_CURSOR_RIGHT_ARROW* = 0 - GLUT_CURSOR_LEFT_ARROW* = 1 # Symbolic cursor shapes. - GLUT_CURSOR_INFO* = 2 - GLUT_CURSOR_DESTROY* = 3 - GLUT_CURSOR_HELP* = 4 - GLUT_CURSOR_CYCLE* = 5 - GLUT_CURSOR_SPRAY* = 6 - GLUT_CURSOR_WAIT* = 7 - GLUT_CURSOR_TEXT* = 8 - GLUT_CURSOR_CROSSHAIR* = 9 # Directional cursors. - GLUT_CURSOR_UP_DOWN* = 10 - GLUT_CURSOR_LEFT_RIGHT* = 11 # Sizing cursors. - GLUT_CURSOR_TOP_SIDE* = 12 - GLUT_CURSOR_BOTTOM_SIDE* = 13 - GLUT_CURSOR_LEFT_SIDE* = 14 - GLUT_CURSOR_RIGHT_SIDE* = 15 - GLUT_CURSOR_TOP_LEFT_CORNER* = 16 - GLUT_CURSOR_TOP_RIGHT_CORNER* = 17 - GLUT_CURSOR_BOTTOM_RIGHT_CORNER* = 18 - GLUT_CURSOR_BOTTOM_LEFT_CORNER* = 19 # Inherit from parent window. - GLUT_CURSOR_INHERIT* = 100 # Blank cursor. - GLUT_CURSOR_NONE* = 101 # Fullscreen crosshair (if available). - GLUT_CURSOR_FULL_CROSSHAIR* = 102 # GLUT device control sub-API. - # glutSetKeyRepeat modes. - GLUT_KEY_REPEAT_OFF* = 0 - GLUT_KEY_REPEAT_ON* = 1 - GLUT_KEY_REPEAT_DEFAULT* = 2 # Joystick button masks. - GLUT_JOYSTICK_BUTTON_A* = 1 - GLUT_JOYSTICK_BUTTON_B* = 2 - GLUT_JOYSTICK_BUTTON_C* = 4 - GLUT_JOYSTICK_BUTTON_D* = 8 # GLUT game mode sub-API. - # glutGameModeGet. - GLUT_GAME_MODE_ACTIVE* = 0 - GLUT_GAME_MODE_POSSIBLE* = 1 - GLUT_GAME_MODE_WIDTH* = 2 - GLUT_GAME_MODE_HEIGHT* = 3 - GLUT_GAME_MODE_PIXEL_DEPTH* = 4 - GLUT_GAME_MODE_REFRESH_RATE* = 5 - GLUT_GAME_MODE_DISPLAY_CHANGED* = 6 # GLUT initialization sub-API. - -proc glutInit*(argcp: ptr cint, argv: pointer){.dynlib: dllname, - importc: "glutInit".} - -proc glutInit*() = - ## version that passes `argc` and `argc` implicitely. - var - cmdLine {.importc: "cmdLine".}: array[0..255, cstring] - cmdCount {.importc: "cmdCount".}: cint - glutInit(addr(cmdCount), addr(cmdLine)) - -proc glutInitDisplayMode*(mode: int16){.dynlib: dllname, - importc: "glutInitDisplayMode".} -proc glutInitDisplayString*(str: cstring){.dynlib: dllname, - importc: "glutInitDisplayString".} -proc glutInitWindowPosition*(x, y: int){.dynlib: dllname, - importc: "glutInitWindowPosition".} -proc glutInitWindowSize*(width, height: int){.dynlib: dllname, - importc: "glutInitWindowSize".} -proc glutMainLoop*(){.dynlib: dllname, importc: "glutMainLoop".} - # GLUT window sub-API. -proc glutCreateWindow*(title: cstring): int{.dynlib: dllname, - importc: "glutCreateWindow".} -proc glutCreateSubWindow*(win, x, y, width, height: int): int{.dynlib: dllname, - importc: "glutCreateSubWindow".} -proc glutDestroyWindow*(win: int){.dynlib: dllname, importc: "glutDestroyWindow".} -proc glutPostRedisplay*(){.dynlib: dllname, importc: "glutPostRedisplay".} -proc glutPostWindowRedisplay*(win: int){.dynlib: dllname, - importc: "glutPostWindowRedisplay".} -proc glutSwapBuffers*(){.dynlib: dllname, importc: "glutSwapBuffers".} -proc glutGetWindow*(): int{.dynlib: dllname, importc: "glutGetWindow".} -proc glutSetWindow*(win: int){.dynlib: dllname, importc: "glutSetWindow".} -proc glutSetWindowTitle*(title: cstring){.dynlib: dllname, - importc: "glutSetWindowTitle".} -proc glutSetIconTitle*(title: cstring){.dynlib: dllname, - importc: "glutSetIconTitle".} -proc glutPositionWindow*(x, y: int){.dynlib: dllname, - importc: "glutPositionWindow".} -proc glutReshapeWindow*(width, height: int){.dynlib: dllname, - importc: "glutReshapeWindow".} -proc glutPopWindow*(){.dynlib: dllname, importc: "glutPopWindow".} -proc glutPushWindow*(){.dynlib: dllname, importc: "glutPushWindow".} -proc glutIconifyWindow*(){.dynlib: dllname, importc: "glutIconifyWindow".} -proc glutShowWindow*(){.dynlib: dllname, importc: "glutShowWindow".} -proc glutHideWindow*(){.dynlib: dllname, importc: "glutHideWindow".} -proc glutFullScreen*(){.dynlib: dllname, importc: "glutFullScreen".} -proc glutSetCursor*(cursor: int){.dynlib: dllname, importc: "glutSetCursor".} -proc glutWarpPointer*(x, y: int){.dynlib: dllname, importc: "glutWarpPointer".} - # GLUT overlay sub-API. -proc glutEstablishOverlay*(){.dynlib: dllname, importc: "glutEstablishOverlay".} -proc glutRemoveOverlay*(){.dynlib: dllname, importc: "glutRemoveOverlay".} -proc glutUseLayer*(layer: TGLenum){.dynlib: dllname, importc: "glutUseLayer".} -proc glutPostOverlayRedisplay*(){.dynlib: dllname, - importc: "glutPostOverlayRedisplay".} -proc glutPostWindowOverlayRedisplay*(win: int){.dynlib: dllname, - importc: "glutPostWindowOverlayRedisplay".} -proc glutShowOverlay*(){.dynlib: dllname, importc: "glutShowOverlay".} -proc glutHideOverlay*(){.dynlib: dllname, importc: "glutHideOverlay".} - # GLUT menu sub-API. -proc glutCreateMenu*(callback: TGlut1IntCallback): int{.dynlib: dllname, - importc: "glutCreateMenu".} -proc glutDestroyMenu*(menu: int){.dynlib: dllname, importc: "glutDestroyMenu".} -proc glutGetMenu*(): int{.dynlib: dllname, importc: "glutGetMenu".} -proc glutSetMenu*(menu: int){.dynlib: dllname, importc: "glutSetMenu".} -proc glutAddMenuEntry*(caption: cstring, value: int){.dynlib: dllname, - importc: "glutAddMenuEntry".} -proc glutAddSubMenu*(caption: cstring, submenu: int){.dynlib: dllname, - importc: "glutAddSubMenu".} -proc glutChangeToMenuEntry*(item: int, caption: cstring, value: int){. - dynlib: dllname, importc: "glutChangeToMenuEntry".} -proc glutChangeToSubMenu*(item: int, caption: cstring, submenu: int){. - dynlib: dllname, importc: "glutChangeToSubMenu".} -proc glutRemoveMenuItem*(item: int){.dynlib: dllname, - importc: "glutRemoveMenuItem".} -proc glutAttachMenu*(button: int){.dynlib: dllname, importc: "glutAttachMenu".} -proc glutDetachMenu*(button: int){.dynlib: dllname, importc: "glutDetachMenu".} - # GLUT window callback sub-API. -proc glutDisplayFunc*(f: TGlutVoidCallback){.dynlib: dllname, - importc: "glutDisplayFunc".} -proc glutReshapeFunc*(f: TGlut2IntCallback){.dynlib: dllname, - importc: "glutReshapeFunc".} -proc glutKeyboardFunc*(f: TGlut1Char2IntCallback){.dynlib: dllname, - importc: "glutKeyboardFunc".} -proc glutMouseFunc*(f: TGlut4IntCallback){.dynlib: dllname, - importc: "glutMouseFunc".} -proc glutMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname, - importc: "glutMotionFunc".} -proc glutPassiveMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname, - importc: "glutPassiveMotionFunc".} -proc glutEntryFunc*(f: TGlut1IntCallback){.dynlib: dllname, - importc: "glutEntryFunc".} -proc glutVisibilityFunc*(f: TGlut1IntCallback){.dynlib: dllname, - importc: "glutVisibilityFunc".} -proc glutIdleFunc*(f: TGlutVoidCallback){.dynlib: dllname, - importc: "glutIdleFunc".} -proc glutTimerFunc*(millis: int16, f: TGlut1IntCallback, value: int){. - dynlib: dllname, importc: "glutTimerFunc".} -proc glutMenuStateFunc*(f: TGlut1IntCallback){.dynlib: dllname, - importc: "glutMenuStateFunc".} -proc glutSpecialFunc*(f: TGlut3IntCallback){.dynlib: dllname, - importc: "glutSpecialFunc".} -proc glutSpaceballMotionFunc*(f: TGlut3IntCallback){.dynlib: dllname, - importc: "glutSpaceballMotionFunc".} -proc glutSpaceballRotateFunc*(f: TGlut3IntCallback){.dynlib: dllname, - importc: "glutSpaceballRotateFunc".} -proc glutSpaceballButtonFunc*(f: TGlut2IntCallback){.dynlib: dllname, - importc: "glutSpaceballButtonFunc".} -proc glutButtonBoxFunc*(f: TGlut2IntCallback){.dynlib: dllname, - importc: "glutButtonBoxFunc".} -proc glutDialsFunc*(f: TGlut2IntCallback){.dynlib: dllname, - importc: "glutDialsFunc".} -proc glutTabletMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname, - importc: "glutTabletMotionFunc".} -proc glutTabletButtonFunc*(f: TGlut4IntCallback){.dynlib: dllname, - importc: "glutTabletButtonFunc".} -proc glutMenuStatusFunc*(f: TGlut3IntCallback){.dynlib: dllname, - importc: "glutMenuStatusFunc".} -proc glutOverlayDisplayFunc*(f: TGlutVoidCallback){.dynlib: dllname, - importc: "glutOverlayDisplayFunc".} -proc glutWindowStatusFunc*(f: TGlut1IntCallback){.dynlib: dllname, - importc: "glutWindowStatusFunc".} -proc glutKeyboardUpFunc*(f: TGlut1Char2IntCallback){.dynlib: dllname, - importc: "glutKeyboardUpFunc".} -proc glutSpecialUpFunc*(f: TGlut3IntCallback){.dynlib: dllname, - importc: "glutSpecialUpFunc".} -proc glutJoystickFunc*(f: TGlut1UInt3IntCallback, pollInterval: int){. - dynlib: dllname, importc: "glutJoystickFunc".} - # GLUT color index sub-API. -proc glutSetColor*(cell: int, red, green, blue: TGLfloat){.dynlib: dllname, - importc: "glutSetColor".} -proc glutGetColor*(ndx, component: int): TGLfloat{.dynlib: dllname, - importc: "glutGetColor".} -proc glutCopyColormap*(win: int){.dynlib: dllname, importc: "glutCopyColormap".} - # GLUT state retrieval sub-API. -proc glutGet*(t: TGLenum): int{.dynlib: dllname, importc: "glutGet".} -proc glutDeviceGet*(t: TGLenum): int{.dynlib: dllname, importc: "glutDeviceGet".} - # GLUT extension support sub-API -proc glutExtensionSupported*(name: cstring): int{.dynlib: dllname, - importc: "glutExtensionSupported".} -proc glutGetModifiers*(): int{.dynlib: dllname, importc: "glutGetModifiers".} -proc glutLayerGet*(t: TGLenum): int{.dynlib: dllname, importc: "glutLayerGet".} - # GLUT font sub-API -proc glutBitmapCharacter*(font: pointer, character: int){.dynlib: dllname, - importc: "glutBitmapCharacter".} -proc glutBitmapWidth*(font: pointer, character: int): int{.dynlib: dllname, - importc: "glutBitmapWidth".} -proc glutStrokeCharacter*(font: pointer, character: int){.dynlib: dllname, - importc: "glutStrokeCharacter".} -proc glutStrokeWidth*(font: pointer, character: int): int{.dynlib: dllname, - importc: "glutStrokeWidth".} -proc glutBitmapLength*(font: pointer, str: cstring): int{.dynlib: dllname, - importc: "glutBitmapLength".} -proc glutStrokeLength*(font: pointer, str: cstring): int{.dynlib: dllname, - importc: "glutStrokeLength".} - # GLUT pre-built models sub-API -proc glutWireSphere*(radius: TGLdouble, slices, stacks: TGLint){. - dynlib: dllname, importc: "glutWireSphere".} -proc glutSolidSphere*(radius: TGLdouble, slices, stacks: TGLint){. - dynlib: dllname, importc: "glutSolidSphere".} -proc glutWireCone*(base, height: TGLdouble, slices, stacks: TGLint){. - dynlib: dllname, importc: "glutWireCone".} -proc glutSolidCone*(base, height: TGLdouble, slices, stacks: TGLint){. - dynlib: dllname, importc: "glutSolidCone".} -proc glutWireCube*(size: TGLdouble){.dynlib: dllname, importc: "glutWireCube".} -proc glutSolidCube*(size: TGLdouble){.dynlib: dllname, importc: "glutSolidCube".} -proc glutWireTorus*(innerRadius, outerRadius: TGLdouble, sides, rings: TGLint){. - dynlib: dllname, importc: "glutWireTorus".} -proc glutSolidTorus*(innerRadius, outerRadius: TGLdouble, sides, rings: TGLint){. - dynlib: dllname, importc: "glutSolidTorus".} -proc glutWireDodecahedron*(){.dynlib: dllname, importc: "glutWireDodecahedron".} -proc glutSolidDodecahedron*(){.dynlib: dllname, importc: "glutSolidDodecahedron".} -proc glutWireTeapot*(size: TGLdouble){.dynlib: dllname, - importc: "glutWireTeapot".} -proc glutSolidTeapot*(size: TGLdouble){.dynlib: dllname, - importc: "glutSolidTeapot".} -proc glutWireOctahedron*(){.dynlib: dllname, importc: "glutWireOctahedron".} -proc glutSolidOctahedron*(){.dynlib: dllname, importc: "glutSolidOctahedron".} -proc glutWireTetrahedron*(){.dynlib: dllname, importc: "glutWireTetrahedron".} -proc glutSolidTetrahedron*(){.dynlib: dllname, importc: "glutSolidTetrahedron".} -proc glutWireIcosahedron*(){.dynlib: dllname, importc: "glutWireIcosahedron".} -proc glutSolidIcosahedron*(){.dynlib: dllname, importc: "glutSolidIcosahedron".} - # GLUT video resize sub-API. -proc glutVideoResizeGet*(param: TGLenum): int{.dynlib: dllname, - importc: "glutVideoResizeGet".} -proc glutSetupVideoResizing*(){.dynlib: dllname, - importc: "glutSetupVideoResizing".} -proc glutStopVideoResizing*(){.dynlib: dllname, importc: "glutStopVideoResizing".} -proc glutVideoResize*(x, y, width, height: int){.dynlib: dllname, - importc: "glutVideoResize".} -proc glutVideoPan*(x, y, width, height: int){.dynlib: dllname, - importc: "glutVideoPan".} - # GLUT debugging sub-API. -proc glutReportErrors*(){.dynlib: dllname, importc: "glutReportErrors".} - # GLUT device control sub-API. -proc glutIgnoreKeyRepeat*(ignore: int){.dynlib: dllname, - importc: "glutIgnoreKeyRepeat".} -proc glutSetKeyRepeat*(repeatMode: int){.dynlib: dllname, - importc: "glutSetKeyRepeat".} -proc glutForceJoystickFunc*(){.dynlib: dllname, importc: "glutForceJoystickFunc".} - # GLUT game mode sub-API. - #example glutGameModeString('1280x1024:32@75'); -proc glutGameModeString*(AString: cstring){.dynlib: dllname, - importc: "glutGameModeString".} -proc glutEnterGameMode*(): int{.dynlib: dllname, importc: "glutEnterGameMode".} -proc glutLeaveGameMode*(){.dynlib: dllname, importc: "glutLeaveGameMode".} -proc glutGameModeGet*(mode: TGLenum): int{.dynlib: dllname, - importc: "glutGameModeGet".} -# implementation diff --git a/lib/wrappers/opengl/glx.nim b/lib/wrappers/opengl/glx.nim deleted file mode 100644 index ae5ca75b51..0000000000 --- a/lib/wrappers/opengl/glx.nim +++ /dev/null @@ -1,153 +0,0 @@ -# -# -# Translation of the Mesa GLX headers for FreePascal -# Copyright (C) 1999 Sebastian Guenther -# -# -# Mesa 3-D graphics library -# Version: 3.0 -# Copyright (C) 1995-1998 Brian Paul -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -import - X, XLib, XUtil, gl - -when defined(windows): - const - dllname = "GL.dll" -elif defined(macosx): - const - dllname = "/usr/X11R6/lib/libGL.dylib" -else: - const - dllname = "libGL.so" -const - GLX_USE_GL* = 1'i32 - GLX_BUFFER_SIZE* = 2'i32 - GLX_LEVEL* = 3'i32 - GLX_RGBA* = 4'i32 - GLX_DOUBLEBUFFER* = 5'i32 - GLX_STEREO* = 6'i32 - GLX_AUX_BUFFERS* = 7'i32 - GLX_RED_SIZE* = 8'i32 - GLX_GREEN_SIZE* = 9'i32 - GLX_BLUE_SIZE* = 10'i32 - GLX_ALPHA_SIZE* = 11'i32 - GLX_DEPTH_SIZE* = 12'i32 - GLX_STENCIL_SIZE* = 13'i32 - GLX_ACCUM_RED_SIZE* = 14'i32 - GLX_ACCUM_GREEN_SIZE* = 15'i32 - GLX_ACCUM_BLUE_SIZE* = 16'i32 - GLX_ACCUM_ALPHA_SIZE* = 17'i32 # GLX_EXT_visual_info extension - GLX_X_VISUAL_TYPE_EXT* = 0x00000022 - GLX_TRANSPARENT_TYPE_EXT* = 0x00000023 - GLX_TRANSPARENT_INDEX_VALUE_EXT* = 0x00000024 - GLX_TRANSPARENT_RED_VALUE_EXT* = 0x00000025 - GLX_TRANSPARENT_GREEN_VALUE_EXT* = 0x00000026 - GLX_TRANSPARENT_BLUE_VALUE_EXT* = 0x00000027 - GLX_TRANSPARENT_ALPHA_VALUE_EXT* = 0x00000028 # Error codes returned by glXGetConfig: - GLX_BAD_SCREEN* = 1 - GLX_BAD_ATTRIBUTE* = 2 - GLX_NO_EXTENSION* = 3 - GLX_BAD_VISUAL* = 4 - GLX_BAD_CONTEXT* = 5 - GLX_BAD_VALUE* = 6 - GLX_BAD_ENUM* = 7 # GLX 1.1 and later: - GLX_VENDOR* = 1 - GLX_VERSION* = 2 - GLX_EXTENSIONS* = 3 # GLX_visual_info extension - GLX_TRUE_COLOR_EXT* = 0x00008002 - GLX_DIRECT_COLOR_EXT* = 0x00008003 - GLX_PSEUDO_COLOR_EXT* = 0x00008004 - GLX_STATIC_COLOR_EXT* = 0x00008005 - GLX_GRAY_SCALE_EXT* = 0x00008006 - GLX_STATIC_GRAY_EXT* = 0x00008007 - GLX_NONE_EXT* = 0x00008000 - GLX_TRANSPARENT_RGB_EXT* = 0x00008008 - GLX_TRANSPARENT_INDEX_EXT* = 0x00008009 - -type # From XLib: - XPixmap* = TXID - XFont* = TXID - XColormap* = TXID - GLXContext* = Pointer - GLXPixmap* = TXID - GLXDrawable* = TXID - GLXContextID* = TXID - TXPixmap* = XPixmap - TXFont* = XFont - TXColormap* = XColormap - TGLXContext* = GLXContext - TGLXPixmap* = GLXPixmap - TGLXDrawable* = GLXDrawable - TGLXContextID* = GLXContextID - -proc glXChooseVisual*(dpy: PDisplay, screen: int, attribList: ptr int32): PXVisualInfo{. - cdecl, dynlib: dllname, importc: "glXChooseVisual".} -proc glXCreateContext*(dpy: PDisplay, vis: PXVisualInfo, shareList: GLXContext, - direct: bool): GLXContext{.cdecl, dynlib: dllname, - importc: "glXCreateContext".} -proc glXDestroyContext*(dpy: PDisplay, ctx: GLXContext){.cdecl, dynlib: dllname, - importc: "glXDestroyContext".} -proc glXMakeCurrent*(dpy: PDisplay, drawable: GLXDrawable, ctx: GLXContext): bool{. - cdecl, dynlib: dllname, importc: "glXMakeCurrent".} -proc glXCopyContext*(dpy: PDisplay, src, dst: GLXContext, mask: int32){.cdecl, - dynlib: dllname, importc: "glXCopyContext".} -proc glXSwapBuffers*(dpy: PDisplay, drawable: GLXDrawable){.cdecl, - dynlib: dllname, importc: "glXSwapBuffers".} -proc glXCreateGLXPixmap*(dpy: PDisplay, visual: PXVisualInfo, pixmap: XPixmap): GLXPixmap{. - cdecl, dynlib: dllname, importc: "glXCreateGLXPixmap".} -proc glXDestroyGLXPixmap*(dpy: PDisplay, pixmap: GLXPixmap){.cdecl, - dynlib: dllname, importc: "glXDestroyGLXPixmap".} -proc glXQueryExtension*(dpy: PDisplay, errorb, event: var int): bool{.cdecl, - dynlib: dllname, importc: "glXQueryExtension".} -proc glXQueryVersion*(dpy: PDisplay, maj, min: var int): bool{.cdecl, - dynlib: dllname, importc: "glXQueryVersion".} -proc glXIsDirect*(dpy: PDisplay, ctx: GLXContext): bool{.cdecl, dynlib: dllname, - importc: "glXIsDirect".} -proc glXGetConfig*(dpy: PDisplay, visual: PXVisualInfo, attrib: int, - value: var int): int{.cdecl, dynlib: dllname, - importc: "glXGetConfig".} -proc glXGetCurrentContext*(): GLXContext{.cdecl, dynlib: dllname, - importc: "glXGetCurrentContext".} -proc glXGetCurrentDrawable*(): GLXDrawable{.cdecl, dynlib: dllname, - importc: "glXGetCurrentDrawable".} -proc glXWaitGL*(){.cdecl, dynlib: dllname, importc: "glXWaitGL".} -proc glXWaitX*(){.cdecl, dynlib: dllname, importc: "glXWaitX".} -proc glXUseXFont*(font: XFont, first, count, list: int){.cdecl, dynlib: dllname, - importc: "glXUseXFont".} - # GLX 1.1 and later -proc glXQueryExtensionsString*(dpy: PDisplay, screen: int): cstring{.cdecl, - dynlib: dllname, importc: "glXQueryExtensionsString".} -proc glXQueryServerString*(dpy: PDisplay, screen, name: int): cstring{.cdecl, - dynlib: dllname, importc: "glXQueryServerString".} -proc glXGetClientString*(dpy: PDisplay, name: int): cstring{.cdecl, - dynlib: dllname, importc: "glXGetClientString".} - # Mesa GLX Extensions -proc glXCreateGLXPixmapMESA*(dpy: PDisplay, visual: PXVisualInfo, - pixmap: XPixmap, cmap: XColormap): GLXPixmap{. - cdecl, dynlib: dllname, importc: "glXCreateGLXPixmapMESA".} -proc glXReleaseBufferMESA*(dpy: PDisplay, d: GLXDrawable): bool{.cdecl, - dynlib: dllname, importc: "glXReleaseBufferMESA".} -proc glXCopySubBufferMESA*(dpy: PDisplay, drawbale: GLXDrawable, - x, y, width, height: int){.cdecl, dynlib: dllname, - importc: "glXCopySubBufferMESA".} -proc glXGetVideoSyncSGI*(counter: var int32): int{.cdecl, dynlib: dllname, - importc: "glXGetVideoSyncSGI".} -proc glXWaitVideoSyncSGI*(divisor, remainder: int, count: var int32): int{. - cdecl, dynlib: dllname, importc: "glXWaitVideoSyncSGI".} -# implementation diff --git a/lib/wrappers/opengl/opengl.nim b/lib/wrappers/opengl/opengl.nim deleted file mode 100644 index 6549cc6f90..0000000000 --- a/lib/wrappers/opengl/opengl.nim +++ /dev/null @@ -1,9708 +0,0 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2012 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -## This module is a wrapper around `opengl`:idx:. If you define the symbol -## ``useGlew`` this wrapper does not use Nimrod's ``dynlib`` mechanism, -## but `glew`:idx: instead. However, this shouldn't be necessary anymore; even -## extension loading for the different operating systems is handled here. -## -## You need to call ``loadExtensions`` after a rendering context has been -## created to load any extension proc that your code uses. - -when defined(linux): - import X, XLib, XUtil -elif defined(windows): - import winlean, os - -when defined(windows): - const - ogldll* = "OpenGL32.dll" - gludll* = "GLU32.dll" -elif defined(macosx): - const - ogldll* = "libGL.dylib" - gludll* = "libGLU.dylib" -else: - const - ogldll* = "libGL.so.1" - gludll* = "libGLU.so.1" - -when defined(useGlew): - {.pragma: ogl, header: "".} - {.pragma: oglx, header: "".} - {.pragma: wgl, header: "".} - {.pragma: glu, dynlib: gludll.} -else: - # quite complex ... thanks to extension support for various platforms: - import dynlib - - let oglHandle = LoadLib(ogldll) - if isNil(oglHandle): quit("could not load: " & ogldll) - - when defined(windows): - var wglGetProcAddress = cast[proc (s: cstring): pointer {.stdcall.}]( - symAddr(oglHandle, "wglGetProcAddress")) - elif defined(linux): - var glXGetProcAddress = cast[proc (s: cstring): pointer {.cdecl.}]( - symAddr(oglHandle, "glXGetProcAddress")) - var glXGetProcAddressARB = cast[proc (s: cstring): pointer {.cdecl.}]( - symAddr(oglHandle, "glXGetProcAddressARB")) - - proc glGetProc(h: TLibHandle; procName: cstring): pointer = - when defined(windows): - result = symAddr(h, procname) - if result != nil: return - if not isNil(wglGetProcAddress): result = wglGetProcAddress(ProcName) - elif defined(linux): - if not isNil(glXGetProcAddress): result = glXGetProcAddress(ProcName) - if result != nil: return - if not isNil(glXGetProcAddressARB): - result = glXGetProcAddressARB(ProcName) - if result != nil: return - result = symAddr(h, procname) - else: - result = symAddr(h, procName) - if result == nil: raiseInvalidLibrary(procName) - - var gluHandle: TLibHandle - - proc gluGetProc(procname: cstring): pointer = - if gluHandle == nil: - gluHandle = LoadLib(gludll) - if gluHandle == nil: quit("could not load: " & gludll) - result = glGetProc(gluHandle, procname) - - # undocumented 'dynlib' feature: the string literal is replaced by - # the imported proc name: - {.pragma: ogl, dynlib: glGetProc(oglHandle, "0").} - {.pragma: oglx, dynlib: glGetProc(oglHandle, "0").} - {.pragma: wgl, dynlib: glGetProc(oglHandle, "0").} - {.pragma: glu, dynlib: gluGetProc("").} - - proc nimLoadProcs0() {.importc.} - - template loadExtensions*() = - ## call this after your rendering context has been setup if you use - ## extensions. - bind nimLoadProcs0 - nimLoadProcs0() - -#============================================================================== -# -# OpenGL 4.2 - Headertranslation -# Version 4.2a -# Date : 26.11.2011 -# -# Works with : -# - Delphi 3 and up -# - FreePascal (1.9.3 and up) -# -#============================================================================== -# -# Containts the translations of glext.h, gl_1_1.h, glu.h and weglext.h. -# It also contains some helperfunctions that were inspired by those -# found in Mike Lischke's OpenGL12.pas. -# -# Copyright (C) DGL-OpenGL2-Portteam -# All Rights Reserved -# -# Obtained through: -# Delphi OpenGL Community(DGL) - www.delphigl.com -# -# Converted and maintained by DGL's GL2.0-Team : -# - Sascha Willems - http://www.saschawillems.de -# - Steffen Xonna (Lossy eX) - http://www.dev-center.de -# Additional input : -# - Andrey Gruzdev (Mac OS X patch for XE2 / FPC) -# - Lars Middendorf -# - Martin Waldegger (Mars) -# - Benjamin Rosseaux (BeRo) - http://www.0ok.de -# Additional thanks: -# sigsegv (libdl.so) -# -# -#============================================================================== -# You may retrieve the latest version of this file at the Delphi OpenGL -# Community home page, located at http://www.delphigl.com/ -# -# The contents of this file are used with permission, subject to -# the Mozilla Public License Version 1.1 (the "License"); you may -# not use this file except in compliance with the License. You may -# obtain a copy of the License at -# http://www.mozilla.org/MPL/MPL-1.1.html -# -# Software distributed under the License is distributed on an -# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -#============================================================================== -# History : -# Version 1.0 Initial Release -# Version 1.1 Added PPointer in Tpyessection for compatiblity with Delphi -# versions lower than 7 (SW) -# Added a function named RaiseLastOSError including a comment -# on how to make it run under Delphi versions lower than 7 (SW) -# Added some data types according to the GL-Syntax (SW) -# Version 1.2 Fixed some problems with getting the addresses of some -# Extensions (e.g. glTexImage3D) where the EXT/ARB did work -# but not the core-functions (SW) -# Version 1.3 A second call to ReadimplementationProperties won't -# revert to the default libs anymore (MW) -# Libraries now will be released if necessary (MW) -# Version 1.3a Small fixes for glSlang-functions (SW) -# Version 1.3b Fixed a small bug with GL_ARB_shader_objects, that lead -# lead to that extension not loaded correctly (SW) -# Version 1.3c more GL 1.5 compliance by FOG_COORD_xx and -# ARB less VBO and occlusion query routines (MW) -# Version 1.3d Fixed linebreaks (should now be corrected under D5) (SW) -# Version 1.4 Changed header to correspond to the OpenGL-Shading -# Language specification 1.10 : -# - Added new GL_SAMPLER*-Constants -# - Added Constant GL_SHADING_LANGUAGE_VERSION_ARB -# - Added Constant GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB -# - Added Constant GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB (SW) -# Version 1.4a Fixed a missing stdcall for glBindAttribLocationARB (SW) -# Version 1.4b Fixed declaration for glUniform*(f/i)vARB (added count) (MW) -# glCompileShaderARB changed from function to procedure (MW) -# Version 1.5 Added support for FreePascal (BR) -# Added type TGLVectorf3/TGLVector3f (SW) -# Version 1.6 Added Extension GL_EXT_framebuffer_object (SX) -# Version 1.7 Added Extension GL_ARB_fragment_program_shadow (SX) -# Added Extension GL_ARB_draw_buffers (SX) -# Added Extension GL_ARB_texture_rectangle (SX) -# Added Extension GL_ARB_color_buffer_float (SX) -# Added Extension GL_ARB_half_float_pixel (SX) -# Added Extension GL_ARB_texture_float (SX) -# Added Extension GL_ARB_pixel_buffer_object (SX) -# Added Extension GL_EXT_depth_bounds_test (SX) -# Added Extension GL_EXT_texture_mirror_clamp (SX) -# Added Extension GL_EXT_blend_equation_separate (SX) -# Added Extension GL_EXT_pixel_buffer_object (SX) -# Added Extension GL_EXT_texture_compression_dxt1 (SX) -# Added Extension GL_NV_fragment_program_option (SX) -# Added Extension GL_NV_fragment_program2 (SX) -# Added Extension GL_NV_vertex_program2_option (SX) -# Added Extension GL_NV_vertex_program3 (SX) -# Version 1.8 Added explicit delegate type definitions (LM) -# Added .Net 1.1 Support (LM) -# Added .Net overloaded functions (LM) -# Added delayed extension loading and stubs (LM) -# Added automatic InitOpenGL call in CreateRenderingContext(LM) -# Added extra Read* function (LM) -# Version 2.0 fixed some Problem with version string and damn drivers. -# String 1.15 identified as OpenGL 1.5 not as OpenGL 1.1 (SX) -# Removed unexisting extension GL_ARB_texture_mirror_repeat(SX) -# Added Extension WGL_ARB_pixel_format_float (SX) -# Added Extension GL_EXT_stencil_clear_tag (SX) -# Added Extension GL_EXT_texture_rectangle (SX) -# Added Extension GL_EXT_texture_edge_clamp (SX) -# Some 1.5 Core Consts added (now completed) (SX) -# gluProject need pointer for not .net (SX) -# gluUnProject need pointer for not .net (SX) -# wglUseFontOutlines* need pointer for not .net (SX) -# wglSwapMultipleBuffers need pointer for not .net (SX) -# Bug with wglGetExtensionsStringEXT removed -# different type for .net (SX) -# Added OpenGL 2.0 Core (SX) -# Version 2.0.1 fixed some problems with glGetActiveAttrib in 2.0 Core (SX) -# fixes some problems with gluProject (SX) -# fixes some problems with gluUnProject (SX) -# fixes some problems with gluTessVertex (SX) -# fixes some problems with gluLoadSamplingMatrices (SX) -# Version 2.1 Removed .NET Support (SX) -# Better support for Linux (SX) -# Better Codeformation (SX) -# Added some more Vector/Matrix types (SX) -# Added OpenGL 2.1 Core (SX) -# Added Extension GL_EXT_packed_depth_stencil (SX) -# Added Extension GL_EXT_texture_sRGB (SX) -# Added Extension GL_EXT_framebuffer_blit (SX) -# Added Extension GL_EXT_framebuffer_multisample (SX) -# Added Extension GL_EXT_timer_query (SX) -# Added Extension GL_EXT_gpu_program_parameters (SX) -# Added Extension GL_EXT_bindable_uniform (SX) -# Added Extension GL_EXT_draw_buffers2 (SX) -# Added Extension GL_EXT_draw_instanced (SX) -# Added Extension GL_EXT_framebuffer_sRGB (SX) -# Added Extension GL_EXT_geometry_shader4 (SX) -# Added Extension GL_EXT_gpu_shader4 (SX) -# Added Extension GL_EXT_packed_float (SX) -# Added Extension GL_EXT_texture_array (SX) -# Added Extension GL_EXT_texture_buffer_object (SX) -# Added Extension GL_EXT_texture_compression_latc (SX) -# Added Extension GL_EXT_texture_compression_rgtc (SX) -# Added Extension GL_EXT_texture_integer (SX) -# Added Extension GL_EXT_texture_shared_exponent (SX) -# Added Extension GL_NV_depth_buffer_float (SX) -# Added Extension GL_NV_fragment_program4 (SX) -# Added Extension GL_NV_framebuffer_multisample_coverage (SX) -# Added Extension GL_NV_geometry_program4 (SX) -# Added Extension GL_NV_gpu_program4 (SX) -# Added Extension GL_NV_parameter_buffer_object (SX) -# Added Extension GL_NV_transform_feedback (SX) -# Added Extension GL_NV_vertex_program4 (SX) -# Version 3.0 fixed some const of GL_EXT_texture_shared_exponent (SX) -# possible better support for mac (SX) -# Added OpenGL 3.0 Core (SX) -# Added Extension GL_ARB_depth_buffer_float (SX) -# Added Extension GL_ARB_draw_instanced (SX) -# Added Extension GL_ARB_framebuffer_object (SX) -# Added Extension GL_ARB_framebuffer_sRGB (SX) -# Added Extension GL_ARB_geometry_shader4 (SX) -# Added Extension GL_ARB_half_float_vertex (SX) -# Added Extension GL_ARB_instanced_arrays (SX) -# Added Extension GL_ARB_map_buffer_range (SX) -# Added Extension GL_ARB_texture_buffer_object (SX) -# Added Extension GL_ARB_texture_compression_rgtc (SX) -# Added Extension GL_ARB_texture_rg (SX) -# Added Extension GL_ARB_vertex_array_object (SX) -# Added Extension GL_NV_conditional_render (SX) -# Added Extension GL_NV_present_video (SX) -# Added Extension GL_EXT_transform_feedback (SX) -# Added Extension GL_EXT_direct_state_access (SX) -# Added Extension GL_EXT_vertex_array_bgra (SX) -# Added Extension GL_EXT_texture_swizzle (SX) -# Added Extension GL_NV_explicit_multisample (SX) -# Added Extension GL_NV_transform_feedback2 (SX) -# Added Extension WGL_ARB_create_context (SX) -# Added Extension WGL_NV_present_video (SX) -# Added Extension WGL_NV_video_out (SX) -# Added Extension WGL_NV_swap_group (SX) -# Added Extension WGL_NV_gpu_affinity (SX) -# Added define DGL_TINY_HEADER to suppress automatic -# function loading (SX) -# glProcedure renamed to dglGetProcAddress and now it's -# visible from outside the unit to custom load functions (SX) -# dglCheckExtension added to check if an extension exists (SX) -# Read_GL_ARB_buffer_object renamed to -# Read_GL_ARB_vertex_buffer_object (SX) -# Version 3.0.1 fixed an problem with fpc (SX) -# Version 3.0.2 fixed an problem with WGL_ARB_create_context (SX) -# Version 3.2 Functions from GL_VERSION_3_0 where updated (SX) -# Functions from GL_ARB_map_buffer_range where updated (SX) -# Functions from GL_NV_present_video where added (SX) -# Added consts of GL_ARB_instanced_arrays (SX) -# Defines to identify Delphi was changed (prevent for -# feature maintenance) (SX) -# Added Extension GL_ATI_meminfo (SX) -# Added Extension GL_AMD_performance_monitor (SX) -# Added Extension GL_AMD_texture_texture4 (SX) -# Added Extension GL_AMD_vertex_shader_tesselator (SX) -# Added Extension GL_EXT_provoking_vertex (SX) -# Added Extension WGL_AMD_gpu_association (SX) -# Added OpenGL 3.1 Core (SX) -# All deprecated stuff can be disabled if you undef the -# define DGL_DEPRECATED (SX) -# Added Extension GL_ARB_uniform_buffer_object (SX) -# Added Extension GL_ARB_compatibility (SX) -# Added Extension GL_ARB_copy_buffer (SX) -# Added Extension GL_ARB_shader_texture_lod (SX) -# Remove function from GL_NV_present_video (SX) -# Added Extension WGL_3DL_stereo_control (SX) -# Added Extension GL_EXT_texture_snorm (SX) -# Added Extension GL_AMD_draw_buffers_blend (SX) -# Added Extension GL_APPLE_texture_range (SX) -# Added Extension GL_APPLE_float_pixels (SX) -# Added Extension GL_APPLE_vertex_program_evaluators (SX) -# Added Extension GL_APPLE_aux_depth_stencil (SX) -# Added Extension GL_APPLE_object_purgeable (SX) -# Added Extension GL_APPLE_row_bytes (SX) -# Added OpenGL 3.2 Core (SX) -# Added Extension GL_ARB_depth_clamp (SX) -# Added Extension GL_ARB_draw_elements_base_vertex (SX) -# Added Extension GL_ARB_fragment_coord_conventions (SX) -# Added Extension GL_ARB_provoking_vertex (SX) -# Added Extension GL_ARB_seamless_cube_map (SX) -# Added Extension GL_ARB_sync (SX) -# Added Extension GL_ARB_texture_multisample (SX) -# Added Extension GL_ARB_vertex_array_bgra (SX) -# Added Extension GL_ARB_draw_buffers_blend (SX) -# Added Extension GL_ARB_sample_shading (SX) -# Added Extension GL_ARB_texture_cube_map_array (SX) -# Added Extension GL_ARB_texture_gather (SX) -# Added Extension GL_ARB_texture_query_lod (SX) -# Added Extension WGL_ARB_create_context_profile (SX) -# Added GLX Core up to Version 1.4 (SX) -# Added Extension GLX_ARB_multisample (SX) -# Added Extension GLX_ARB_fbconfig_float (SX) -# Added Extension GLX_ARB_get_proc_address (SX) -# Added Extension GLX_ARB_create_context (SX) -# Added Extension GLX_ARB_create_context_profile (SX) -# Added Extension GLX_EXT_visual_info (SX) -# Added Extension GLX_EXT_visual_rating (SX) -# Added Extension GLX_EXT_import_context (SX) -# Added Extension GLX_EXT_fbconfig_packed_float (SX) -# Added Extension GLX_EXT_framebuffer_sRGB (SX) -# Added Extension GLX_EXT_texture_from_pixmap (SX) -# Version 3.2.1 Fixed some problems with Delphi < 6 (SX) -# Version 3.2.2 Added Extension GL_APPLE_rgb_422 (SX) -# Added Extension GL_EXT_separate_shader_objects (SX) -# Added Extension GL_NV_video_capture (SX) -# Added Extension GL_NV_copy_image (SX) -# Added Extension GL_NV_parameter_buffer_object2 (SX) -# Added Extension GL_NV_shader_buffer_load (SX) -# Added Extension GL_NV_vertex_buffer_unified_memory (SX) -# Added Extension GL_NV_texture_barrier (SX) -# Variable GL_EXT_texture_snorm will be filled (SX) -# Variable GL_APPLE_row_bytes will be filled (SX) -# Added Extension WGL_NV_video_capture (SX) -# Added Extension WGL_NV_copy_image (SX) -# WGL_NV_video_out now named WGL_NV_video_output (SX) -# Added Extension GLX_EXT_swap_control (SX) -# Version 3.2.3 Fixed an Problem with glGetAttribLocation (SX) -# Added const GL_UNIFORM_BUFFER_EXT (SX) -# Functions of GL_NV_texture_barrier now will be loaded (SX) -# Version 4.0 Changes on Extension GL_ARB_texture_gather (SX) -# Changes on Extension GL_NV_shader_buffer_load (SX) -# Added OpenGL 3.3 Core (SX) -# Added OpenGL 4.0 Core (SX) -# Added Extension GL_AMD_shader_stencil_export (SX) -# Added Extension GL_AMD_seamless_cubemap_per_texture (SX) -# Added Extension GL_ARB_shading_language_include (SX) -# Added Extension GL_ARB_texture_compression_bptc (SX) -# Added Extension GL_ARB_blend_func_extended (SX) -# Added Extension GL_ARB_explicit_attrib_location (SX) -# Added Extension GL_ARB_occlusion_query2 (SX) -# Added Extension GL_ARB_sampler_objects (SX) -# Added Extension GL_ARB_shader_bit_encoding (SX) -# Added Extension GL_ARB_texture_rgb10_a2ui (SX) -# Added Extension GL_ARB_texture_swizzle (SX) -# Added Extension GL_ARB_timer_query (SX) -# Added Extension GL_ARB_vertextyp_2_10_10_10_rev (SX) -# Added Extension GL_ARB_draw_indirect (SX) -# Added Extension GL_ARB_gpu_shader5 (SX) -# Added Extension GL_ARB_gpu_shader_fp64 (SX) -# Added Extension GL_ARB_shader_subroutine (SX) -# Added Extension GL_ARB_tessellation_shader (SX) -# Added Extension GL_ARB_texture_buffer_object_rgb32 (SX) -# Added Extension GL_ARB_transform_feedback2 (SX) -# Added Extension GL_ARB_transform_feedback3 (SX) -# Version 4.1 Possible fix some strange linux behavior (SX) -# All function uses GL instead of TGL types (SX) -# GL_AMD_vertex_shader_tesselator will be read now (SX) -# GL_AMD_draw_buffers_blend will be read now (SX) -# Changes on glStencilFuncSeparate (GL_2_0) (SX) -# Changes on GL_VERSION_3_2 (SX) -# Changes on GL_VERSION_3_3 (SX) -# Changes on GL_VERSION_4_0 (SX) -# Changes on GL_ARB_sample_shading (SX) -# Changes on GL_ARB_texture_cube_map_array (SX) -# Changes on GL_ARB_gpu_shader5 (SX) -# Changes on GL_ARB_transform_feedback3 (SX) -# Changes on GL_ARB_sampler_objects (SX) -# Changes on GL_ARB_gpu_shader_fp64 (SX) -# Changes on GL_APPLE_element_array (SX) -# Changes on GL_APPLE_vertex_array_range (SX) -# Changes on GL_NV_transform_feedback (SX) -# Changes on GL_NV_vertex_buffer_unified_memory (SX) -# Changes on GL_EXT_multi_draw_arrays (SX) -# Changes on GL_EXT_direct_state_access (SX) -# Changes on GL_AMD_performance_monitor (SX) -# Changes on GL_AMD_seamless_cubemap_per_texture (SX) -# Changes on GL_EXT_geometry_shader4 (SX) -# Added OpenGL 4.1 Core (SX) -# Added Extension GL_ARB_ES2_compatibility (SX) -# Added Extension GL_ARB_get_program_binary (SX) -# Added Extension GL_ARB_separate_shader_objects (SX) -# Added Extension GL_ARB_shader_precision (SX) -# Added Extension GL_ARB_vertex_attrib_64bit (SX) -# Added Extension GL_ARB_viewport_array (SX) -# Added Extension GL_ARB_cl_event (SX) -# Added Extension GL_ARB_debug_output (SX) -# Added Extension GL_ARB_robustness (SX) -# Added Extension GL_ARB_shader_stencil_export (SX) -# Added Extension GL_AMD_conservative_depth (SX) -# Added Extension GL_EXT_shader_image_load_store (SX) -# Added Extension GL_EXT_vertex_attrib_64bit (SX) -# Added Extension GL_NV_gpu_program5 (SX) -# Added Extension GL_NV_gpu_shader5 (SX) -# Added Extension GL_NV_shader_buffer_store (SX) -# Added Extension GL_NV_tessellation_program5 (SX) -# Added Extension GL_NV_vertex_attrib_integer_64bit (SX) -# Added Extension GL_NV_multisample_coverage (SX) -# Added Extension GL_AMD_name_gen_delete (SX) -# Added Extension GL_AMD_debug_output (SX) -# Added Extension GL_NV_vdpau_interop (SX) -# Added Extension GL_AMD_transform_feedback3_lines_triangles (SX) -# Added Extension GL_AMD_depth_clamp_separate (SX) -# Added Extension GL_EXT_texture_sRGB_decode (SX) -# Added Extension WGL_ARB_framebuffer_sRGB (SX) -# Added Extension WGL_ARB_create_context_robustness (SX) -# Added Extension WGL_EXT_create_context_es2_profile (SX) -# Added Extension WGL_NV_multisample_coverage (SX) -# Added Extension GLX_ARB_vertex_buffer_object (SX) -# Added Extension GLX_ARB_framebuffer_sRGB (SX) -# Added Extension GLX_ARB_create_context_robustness (SX) -# Added Extension GLX_EXT_create_context_es2_profile (SX) -# Version 4.1a Fix for dglGetProcAddress with FPC and linux (def param) (SW) -# Version 4.2 Added OpenGL 4.2 Core (SW) -# Added Extension GL_ARB_base_instance (SW) -# Added Extension GL_ARB_shading_language_420pack (SW) -# Added Extension GL_ARB_transform_feedback_instanced (SW) -# Added Extension GL_ARB_compressed_texture_pixel_storage (SW) -# Added Extension GL_ARB_conservative_depth (SW) -# Added Extension GL_ARB_internalformat_query (SW) -# Added Extension GL_ARB_map_buffer_alignment (SW) -# Added Extension GL_ARB_shader_atomic_counters (SW) -# Added Extension GL_ARB_shader_image_load_store (SW) -# Added Extension GL_ARB_shading_language_packing (SW) -# Added Extension GL_ARB_texture_storage (SW) -# Added Extension WGL_NV_DX_interop (SW) -# Added Define for WGL_EXT_create_context_es2_profile (SW) -# Version 4.2a Added Mac OS X patch by Andrey Gruzdev (SW) -#============================================================================== -# Header based on glext.h rev 72 (2011/08/08) -# Header based on wglext.h rev 23 (2011/04/13) -# Header based on glxext.h rev 32 (2010/08/06) (only Core/ARB/EXT) -# -# This is an important notice for maintaining. Dont remove it. And make sure -# to keep it up to date -#============================================================================== - -{.deadCodeElim: on.} - -type - PPointer* = ptr Pointer - GLenum* = uint32 - GLboolean* = bool - GLbitfield* = uint32 - GLbyte* = int8 - GLshort* = int16 - GLint* = int32 - GLsizei* = int32 - GLubyte* = uint8 - GLushort* = uint16 - GLuint* = uint32 - GLfloat* = float32 - GLclampf* = float32 - GLdouble* = float64 - GLclampd* = float64 - GLvoid* = Pointer - GLint64* = Int64 - GLuint64* = uint64 - TGLenum* = GLenum - TGLboolean* = GLboolean - TGLbitfield* = GLbitfield - TGLbyte* = GLbyte - TGLshort* = GLshort - TGLint* = GLint - TGLsizei* = GLsizei - TGLubyte* = GLubyte - TGLushort* = GLushort - TGLuint* = GLuint - TGLfloat* = GLfloat - TGLclampf* = GLclampf - TGLdouble* = GLdouble - TGLclampd* = GLclampd - TGLvoid* = GLvoid - TGLint64* = GLint64 - TGLuint64* = GLuint64 - PGLboolean* = ptr GLboolean - PGLbyte* = ptr GLbyte - PGLshort* = ptr GLshort - PGLint* = ptr GLint - PGLsizei* = ptr GLsizei - PGLubyte* = ptr GLubyte - PGLushort* = ptr GLushort - PGLuint* = ptr GLuint - PGLclampf* = ptr GLclampf - PGLfloat* = ptr GLfloat - PGLdouble* = ptr GLdouble - PGLclampd* = ptr GLclampd - PGLenum* = ptr GLenum - PGLvoid* = Pointer - PPGLvoid* = ptr PGLvoid - PGLint64* = ptr GLint64 - PGLuint64* = ptr GLuint64 # GL_NV_half_float - GLhalfNV* = int16 - TGLhalfNV* = GLhalfNV - PGLhalfNV* = ptr GLhalfNV # GL_ARB_shader_objects - PGLHandleARB* = ptr GLHandleARB - GLHandleARB* = int - GLcharARB* = Char - PGLcharARB* = cstring - PPGLcharARB* = ptr PGLcharARB # GL_VERSION_1_5 - GLintptr* = GLint - GLsizeiptr* = GLsizei # GL_ARB_vertex_buffer_object - GLintptrARB* = GLint - GLsizeiptrARB* = GLsizei # GL_VERSION_2_0 - GLHandle* = int - PGLchar* = cstring - PPGLchar* = ptr PGLChar # GL_EXT_timer_query - GLint64EXT* = Int64 - TGLint64EXT* = GLint64EXT - PGLint64EXT* = ptr GLint64EXT - GLuint64EXT* = GLuint64 - TGLuint64EXT* = GLuint64EXT - PGLuint64EXT* = ptr GLuint64EXT # WGL_ARB_pbuffer - - GLsync* = Pointer # GL_ARB_cl_event - # These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event - Tcl_context*{.final.} = object - Tcl_event*{.final.} = object - p_cl_context* = ptr Tcl_context - p_cl_event* = ptr Tcl_event # GL_ARB_debug_output - TglDebugProcARB* = proc (source: GLenum, typ: GLenum, id: GLuint, - severity: GLenum, len: GLsizei, message: PGLchar, - userParam: PGLvoid){.stdcall.} # GL_AMD_debug_output - TglDebugProcAMD* = proc (id: GLuint, category: GLenum, severity: GLenum, - len: GLsizei, message: PGLchar, userParam: PGLvoid){. - stdcall.} # GL_NV_vdpau_interop - GLvdpauSurfaceNV* = GLintptr - PGLvdpauSurfaceNV* = ptr GLvdpauSurfaceNV # GLX - -when defined(windows): - type - HPBUFFERARB* = THandle # WGL_EXT_pbuffer - HPBUFFEREXT* = THandle # WGL_NV_present_video - PHVIDEOOUTPUTDEVICENV* = ptr HVIDEOOUTPUTDEVICENV - HVIDEOOUTPUTDEVICENV* = THandle # WGL_NV_video_output - PHPVIDEODEV* = ptr HPVIDEODEV - HPVIDEODEV* = THandle # WGL_NV_gpu_affinity - PHPGPUNV* = ptr HPGPUNV - PHGPUNV* = ptr HGPUNV # WGL_NV_video_capture - HVIDEOINPUTDEVICENV* = THandle - PHVIDEOINPUTDEVICENV* = ptr HVIDEOINPUTDEVICENV - HPGPUNV* = THandle - HGPUNV* = THandle # GL_ARB_sync - -when defined(LINUX): - type - GLXContext* = Pointer - GLXContextID* = TXID - GLXDrawable* = TXID - GLXFBConfig* = Pointer - GLXPbuffer* = TXID - GLXPixmap* = TXID - GLXWindow* = TXID - Window* = TXID - Colormap* = TXID - Pixmap* = TXID - Font* = TXID -type # Datatypes corresponding to GL's types TGL(name)(type)(count) - TGLVectorub2* = array[0..1, GLubyte] - TGLVectori2* = array[0..1, GLint] - TGLVectorf2* = array[0..1, GLfloat] - TGLVectord2* = array[0..1, GLdouble] - TGLVectorp2* = array[0..1, Pointer] - TGLVectorb3* = array[0..2, GLbyte] - TGLVectorub3* = array[0..2, GLubyte] - TGLVectori3* = array[0..2, GLint] - TGLVectorui3* = array[0..2, GLuint] - TGLVectorf3* = array[0..2, GLfloat] - TGLVectord3* = array[0..2, GLdouble] - TGLVectorp3* = array[0..2, Pointer] - TGLVectors3* = array[0..2, GLshort] - TGLVectorus3* = array[0..2, GLushort] - TGLVectorb4* = array[0..3, GLbyte] - TGLVectorub4* = array[0..3, GLubyte] - TGLVectori4* = array[0..3, GLint] - TGLVectorui4* = array[0..3, GLuint] - TGLVectorf4* = array[0..3, GLfloat] - TGLVectord4* = array[0..3, GLdouble] - TGLVectorp4* = array[0..3, Pointer] - TGLVectors4* = array[0..3, GLshort] - TGLVectorus4* = array[0..3, GLshort] - TGLArrayf4* = TGLVectorf4 - TGLArrayf3* = TGLVectorf3 - TGLArrayd3* = TGLVectord3 - TGLArrayi4* = TGLVectori4 - TGLArrayp4* = TGLVectorp4 - TGlMatrixub3* = array[0..2, array[0..2, GLubyte]] - TGlMatrixi3* = array[0..2, array[0..2, GLint]] - TGLMatrixf3* = array[0..2, array[0..2, GLfloat]] - TGLMatrixd3* = array[0..2, array[0..2, GLdouble]] - TGlMatrixub4* = array[0..3, array[0..3, GLubyte]] - TGlMatrixi4* = array[0..3, array[0..3, GLint]] - TGLMatrixf4* = array[0..3, array[0..3, GLfloat]] - TGLMatrixd4* = array[0..3, array[0..3, GLdouble]] - TGLVector3f* = TGLVectorf3 # Datatypes corresponding to OpenGL12.pas for easy porting - TVector3d* = TGLVectord3 - TVector4i* = TGLVectori4 - TVector4f* = TGLVectorf4 - TVector4p* = TGLVectorp4 - TMatrix4f* = TGLMatrixf4 - TMatrix4d* = TGLMatrixd4 - PGLMatrixd4* = ptr TGLMatrixd4 - PVector4i* = ptr TVector4i - TRect*{.final.} = object - Left*, Top*, Right*, Bottom*: int32 - - PGPU_DEVICE* = ptr GPU_DEVICE - GPU_DEVICE*{.final.} = object - cb*: int32 - DeviceName*: array[0..31, Char] - DeviceString*: array[0..127, Char] - Flags*: int32 - rcVirtualScreen*: TRect - - -when defined(windows): - type - PWGLSwap* = ptr TWGLSwap - TWGLSWAP*{.final.} = object - hdc*: HDC - uiFlags*: int32 - -type - TGLUNurbs*{.final.} = object - TGLUQuadric*{.final.} = object - TGLUTesselator*{.final.} = object - PGLUNurbs* = ptr TGLUNurbs - PGLUQuadric* = ptr TGLUQuadric - PGLUTesselator* = ptr TGLUTesselator # backwards compatibility - TGLUNurbsObj* = TGLUNurbs - TGLUQuadricObj* = TGLUQuadric - TGLUTesselatorObj* = TGLUTesselator - TGLUTriangulatorObj* = TGLUTesselator - PGLUNurbsObj* = PGLUNurbs - PGLUQuadricObj* = PGLUQuadric - PGLUTesselatorObj* = PGLUTesselator - PGLUTriangulatorObj* = PGLUTesselator # GLUQuadricCallback - - TGLUQuadricErrorProc* = proc(errorCode: GLenum){.stdcall.} - TGLUTessBeginProc* = proc(AType: GLenum){.stdcall.} - TGLUTessEdgeFlagProc* = proc(Flag: GLboolean){.stdcall.} - TGLUTessVertexProc* = proc(VertexData: Pointer){.stdcall.} - TGLUTessEndProc* = proc(){.stdcall.} - TGLUTessErrorProc* = proc(ErrNo: GLenum){.stdcall.} - TGLUTessCombineProc* = proc(Coords: TGLArrayd3, VertexData: TGLArrayp4, - Weight: TGLArrayf4, OutData: PPointer){.stdcall.} - TGLUTessBeginDataProc* = proc(AType: GLenum, UserData: Pointer){.stdcall.} - TGLUTessEdgeFlagDataProc* = proc(Flag: GLboolean, UserData: Pointer){.stdcall.} - TGLUTessVertexDataProc* = proc(VertexData: Pointer, UserData: Pointer){.stdcall.} - TGLUTessEndDataProc* = proc(UserData: Pointer){.stdcall.} - TGLUTessErrorDataProc* = proc(ErrNo: GLenum, UserData: Pointer){.stdcall.} - TGLUTessCombineDataProc* = proc(Coords: TGLArrayd3, VertexData: TGLArrayp4, - Weight: TGLArrayf4, OutData: PPointer, - UserData: Pointer){.stdcall.} - # GLUNurbsCallback - TGLUNurbsErrorProc* = proc(ErrorCode: GLEnum){.stdcall.} - -const # GL_VERSION_1_1 - # AttribMask - GL_DEPTH_BUFFER_BIT* = 0x00000100 - GL_STENCIL_BUFFER_BIT* = 0x00000400 - GL_COLOR_BUFFER_BIT* = 0x00004000 # Boolean - GL_TRUE* = 1 - GL_FALSE* = 0 # BeginMode - GL_POINTS* = 0x00000000 - GL_LINES* = 0x00000001 - GL_LINE_LOOP* = 0x00000002 - GL_LINE_STRIP* = 0x00000003 - GL_TRIANGLES* = 0x00000004 - GL_TRIANGLE_STRIP* = 0x00000005 - GL_TRIANGLE_FAN* = 0x00000006 # AlphaFunction - GL_NEVER* = 0x00000200 - GL_LESS* = 0x00000201 - GL_EQUAL* = 0x00000202 - GL_LEQUAL* = 0x00000203 - GL_GREATER* = 0x00000204 - GL_NOTEQUAL* = 0x00000205 - GL_GEQUAL* = 0x00000206 - GL_ALWAYS* = 0x00000207 # BlendingFactorDest - GL_ZERO* = 0 - GL_ONE* = 1 - GL_SRC_COLOR* = 0x00000300 - GL_ONE_MINUS_SRC_COLOR* = 0x00000301 - GL_SRC_ALPHA* = 0x00000302 - GL_ONE_MINUS_SRC_ALPHA* = 0x00000303 - GL_DST_ALPHA* = 0x00000304 - GL_ONE_MINUS_DST_ALPHA* = 0x00000305 # BlendingFactorSrc - GL_DST_COLOR* = 0x00000306 - GL_ONE_MINUS_DST_COLOR* = 0x00000307 - GL_SRC_ALPHA_SATURATE* = 0x00000308 # DrawBufferMode - GL_NONE* = 0 - GL_FRONT_LEFT* = 0x00000400 - GL_FRONT_RIGHT* = 0x00000401 - GL_BACK_LEFT* = 0x00000402 - GL_BACK_RIGHT* = 0x00000403 - GL_FRONT* = 0x00000404 - GL_BACK* = 0x00000405 - GL_LEFT* = 0x00000406 - GL_RIGHT* = 0x00000407 - GL_FRONT_AND_BACK* = 0x00000408 # ErrorCode - GL_NO_ERROR* = 0 - GL_INVALID_ENUM* = 0x00000500 - GL_INVALID_VALUE* = 0x00000501 - GL_INVALID_OPERATION* = 0x00000502 - GL_OUT_OF_MEMORY* = 0x00000505 # FrontFaceDirection - GL_CW* = 0x00000900 - GL_CCW* = 0x00000901 # GetPName - cGL_POINT_SIZE* = 0x00000B11 - GL_POINT_SIZE_RANGE* = 0x00000B12 - GL_POINT_SIZE_GRANULARITY* = 0x00000B13 - GL_LINE_SMOOTH* = 0x00000B20 - cGL_LINE_WIDTH* = 0x00000B21 - GL_LINE_WIDTH_RANGE* = 0x00000B22 - GL_LINE_WIDTH_GRANULARITY* = 0x00000B23 - GL_POLYGON_SMOOTH* = 0x00000B41 - cGL_CULL_FACE* = 0x00000B44 - GL_CULL_FACE_MODE* = 0x00000B45 - cGL_FRONT_FACE* = 0x00000B46 - cGL_DEPTH_RANGE* = 0x00000B70 - GL_DEPTH_TEST* = 0x00000B71 - GL_DEPTH_WRITEMASK* = 0x00000B72 - GL_DEPTH_CLEAR_VALUE* = 0x00000B73 - cGL_DEPTH_FUNC* = 0x00000B74 - GL_STENCIL_TEST* = 0x00000B90 - GL_STENCIL_CLEAR_VALUE* = 0x00000B91 - cGL_STENCIL_FUNC* = 0x00000B92 - GL_STENCIL_VALUE_MASK* = 0x00000B93 - GL_STENCIL_FAIL* = 0x00000B94 - GL_STENCIL_PASS_DEPTH_FAIL* = 0x00000B95 - GL_STENCIL_PASS_DEPTH_PASS* = 0x00000B96 - GL_STENCIL_REF* = 0x00000B97 - GL_STENCIL_WRITEMASK* = 0x00000B98 - cGL_VIEWPORT* = 0x00000BA2 - GL_DITHER* = 0x00000BD0 - GL_BLEND_DST* = 0x00000BE0 - GL_BLEND_SRC* = 0x00000BE1 - GL_BLEND* = 0x00000BE2 - GL_LOGIC_OP_MODE* = 0x00000BF0 - GL_COLOR_LOGIC_OP* = 0x00000BF2 - cGL_DRAW_BUFFER* = 0x00000C01 - cGL_READ_BUFFER* = 0x00000C02 - GL_SCISSOR_BOX* = 0x00000C10 - GL_SCISSOR_TEST* = 0x00000C11 - GL_COLOR_CLEAR_VALUE* = 0x00000C22 - GL_COLOR_WRITEMASK* = 0x00000C23 - GL_DOUBLEBUFFER* = 0x00000C32 - GL_STEREO* = 0x00000C33 - GL_LINE_SMOOTH_HINT* = 0x00000C52 - GL_POLYGON_SMOOTH_HINT* = 0x00000C53 - GL_UNPACK_SWAP_BYTES* = 0x00000CF0 - GL_UNPACK_LSB_FIRST* = 0x00000CF1 - GL_UNPACK_ROW_LENGTH* = 0x00000CF2 - GL_UNPACK_SKIP_ROWS* = 0x00000CF3 - GL_UNPACK_SKIP_PIXELS* = 0x00000CF4 - GL_UNPACK_ALIGNMENT* = 0x00000CF5 - GL_PACK_SWAP_BYTES* = 0x00000D00 - GL_PACK_LSB_FIRST* = 0x00000D01 - GL_PACK_ROW_LENGTH* = 0x00000D02 - GL_PACK_SKIP_ROWS* = 0x00000D03 - GL_PACK_SKIP_PIXELS* = 0x00000D04 - GL_PACK_ALIGNMENT* = 0x00000D05 - GL_MAX_TEXTURE_SIZE* = 0x00000D33 - GL_MAX_VIEWPORT_DIMS* = 0x00000D3A - GL_SUBPIXEL_BITS* = 0x00000D50 - GL_TEXTURE_1D* = 0x00000DE0 - GL_TEXTURE_2D* = 0x00000DE1 - GL_POLYGON_OFFSET_UNITS* = 0x00002A00 - GL_POLYGON_OFFSET_POINT* = 0x00002A01 - GL_POLYGON_OFFSET_LINE* = 0x00002A02 - GL_POLYGON_OFFSET_FILL* = 0x00008037 - GL_POLYGON_OFFSET_FACTOR* = 0x00008038 - GL_TEXTURE_BINDING_1D* = 0x00008068 - GL_TEXTURE_BINDING_2D* = 0x00008069 # GetTextureParameter - GL_TEXTURE_WIDTH* = 0x00001000 - GL_TEXTURE_HEIGHT* = 0x00001001 - GL_TEXTURE_INTERNAL_FORMAT* = 0x00001003 - GL_TEXTURE_BORDER_COLOR* = 0x00001004 - GL_TEXTURE_BORDER* = 0x00001005 - GL_TEXTURE_RED_SIZE* = 0x0000805C - GL_TEXTURE_GREEN_SIZE* = 0x0000805D - GL_TEXTURE_BLUE_SIZE* = 0x0000805E - GL_TEXTURE_ALPHA_SIZE* = 0x0000805F # HintMode - GL_DONT_CARE* = 0x00001100 - GL_FASTEST* = 0x00001101 - GL_NICEST* = 0x00001102 # DataType - cGL_BYTE* = 0x00001400 - cGL_UNSIGNED_BYTE* = 0x00001401 - cGL_SHORT* = 0x00001402 - cGL_UNSIGNED_SHORT* = 0x00001403 - cGL_INT* = 0x00001404 - cGL_UNSIGNED_INT* = 0x00001405 - cGL_FLOAT* = 0x00001406 - cGL_DOUBLE* = 0x0000140A # LogicOp - cGL_CLEAR* = 0x00001500 - GL_AND* = 0x00001501 - GL_AND_REVERSE* = 0x00001502 - GL_COPY* = 0x00001503 - GL_AND_INVERTED* = 0x00001504 - GL_NOOP* = 0x00001505 - GL_XOR* = 0x00001506 - GL_OR* = 0x00001507 - GL_NOR* = 0x00001508 - GL_EQUIV* = 0x00001509 - GL_INVERT* = 0x0000150A - GL_OR_REVERSE* = 0x0000150B - GL_COPY_INVERTED* = 0x0000150C - GL_OR_INVERTED* = 0x0000150D - GL_NAND* = 0x0000150E - GL_SET* = 0x0000150F # MatrixMode (for gl3.h, FBO attachment type) - GL_TEXTURE* = 0x00001702 # PixelCopyType - GL_COLOR* = 0x00001800 - GL_DEPTH* = 0x00001801 - GL_STENCIL* = 0x00001802 # PixelFormat - GL_STENCIL_INDEX* = 0x00001901 - GL_DEPTH_COMPONENT* = 0x00001902 - GL_RED* = 0x00001903 - GL_GREEN* = 0x00001904 - GL_BLUE* = 0x00001905 - GL_ALPHA* = 0x00001906 - GL_RGB* = 0x00001907 - GL_RGBA* = 0x00001908 # PolygonMode - GL_POINT* = 0x00001B00 - GL_LINE* = 0x00001B01 - GL_FILL* = 0x00001B02 # StencilOp - GL_KEEP* = 0x00001E00 - GL_REPLACE* = 0x00001E01 - GL_INCR* = 0x00001E02 - GL_DECR* = 0x00001E03 # StringName - GL_VENDOR* = 0x00001F00 - GL_RENDERER* = 0x00001F01 - GL_VERSION* = 0x00001F02 - GL_EXTENSIONS* = 0x00001F03 # TextureMagFilter - GL_NEAREST* = 0x00002600 - GL_LINEAR* = 0x00002601 # TextureMinFilter - GL_NEAREST_MIPMAP_NEAREST* = 0x00002700 - GL_LINEAR_MIPMAP_NEAREST* = 0x00002701 - GL_NEAREST_MIPMAP_LINEAR* = 0x00002702 - GL_LINEAR_MIPMAP_LINEAR* = 0x00002703 # TextureParameterName - GL_TEXTURE_MAG_FILTER* = 0x00002800 - GL_TEXTURE_MIN_FILTER* = 0x00002801 - GL_TEXTURE_WRAP_S* = 0x00002802 - GL_TEXTURE_WRAP_T* = 0x00002803 # TextureTarget - GL_PROXY_TEXTURE_1D* = 0x00008063 - GL_PROXY_TEXTURE_2D* = 0x00008064 # TextureWrapMode - GL_REPEAT* = 0x00002901 # PixelInternalFormat - GL_R3_G3_B2* = 0x00002A10 - GL_RGB4* = 0x0000804F - GL_RGB5* = 0x00008050 - GL_RGB8* = 0x00008051 - GL_RGB10* = 0x00008052 - GL_RGB12* = 0x00008053 - GL_RGB16* = 0x00008054 - GL_RGBA2* = 0x00008055 - GL_RGBA4* = 0x00008056 - GL_RGB5_A1* = 0x00008057 - GL_RGBA8* = 0x00008058 - GL_RGB10_A2* = 0x00008059 - GL_RGBA12* = 0x0000805A - GL_RGBA16* = 0x0000805B - cGL_ACCUM* = 0x00000100 - GL_LOAD* = 0x00000101 - GL_RETURN* = 0x00000102 - GL_MULT* = 0x00000103 - GL_ADD* = 0x00000104 - GL_CURRENT_BIT* = 0x00000001 - GL_POINT_BIT* = 0x00000002 - GL_LINE_BIT* = 0x00000004 - GL_POLYGON_BIT* = 0x00000008 - GL_POLYGON_STIPPLE_BIT* = 0x00000010 - GL_PIXEL_MODE_BIT* = 0x00000020 - GL_LIGHTING_BIT* = 0x00000040 - GL_FOG_BIT* = 0x00000080 - GL_ACCUM_BUFFER_BIT* = 0x00000200 - GL_VIEWPORT_BIT* = 0x00000800 - GL_TRANSFORM_BIT* = 0x00001000 - GL_ENABLE_BIT* = 0x00002000 - GL_HINT_BIT* = 0x00008000 - GL_EVAL_BIT* = 0x00010000 - GL_LIST_BIT* = 0x00020000 - GL_TEXTURE_BIT* = 0x00040000 - GL_SCISSOR_BIT* = 0x00080000 - GL_ALL_ATTRIB_BITS* = 0x000FFFFF - GL_QUADS* = 0x00000007 - GL_QUAD_STRIP* = 0x00000008 - GL_POLYGON* = 0x00000009 - GL_CLIP_PLANE0* = 0x00003000 - GL_CLIP_PLANE1* = 0x00003001 - GL_CLIP_PLANE2* = 0x00003002 - GL_CLIP_PLANE3* = 0x00003003 - GL_CLIP_PLANE4* = 0x00003004 - GL_CLIP_PLANE5* = 0x00003005 - GL_2_BYTES* = 0x00001407 - GL_3_BYTES* = 0x00001408 - GL_4_BYTES* = 0x00001409 - GL_AUX0* = 0x00000409 - GL_AUX1* = 0x0000040A - GL_AUX2* = 0x0000040B - GL_AUX3* = 0x0000040C - GL_STACK_OVERFLOW* = 0x00000503 - GL_STACK_UNDERFLOW* = 0x00000504 - GL_2D* = 0x00000600 - GL_3D* = 0x00000601 - GL_3D_COLOR* = 0x00000602 - GL_3D_COLOR_TEXTURE* = 0x00000603 - GL_4D_COLOR_TEXTURE* = 0x00000604 - GL_PASS_THROUGH_TOKEN* = 0x00000700 - GL_POINT_TOKEN* = 0x00000701 - GL_LINE_TOKEN* = 0x00000702 - GL_POLYGON_TOKEN* = 0x00000703 - GL_BITMAP_TOKEN* = 0x00000704 - GL_DRAW_PIXEL_TOKEN* = 0x00000705 - GL_COPY_PIXEL_TOKEN* = 0x00000706 - GL_LINE_RESET_TOKEN* = 0x00000707 - GL_EXP* = 0x00000800 - GL_EXP2* = 0x00000801 - GL_COEFF* = 0x00000A00 - GL_ORDER* = 0x00000A01 - GL_DOMAIN* = 0x00000A02 - GL_CURRENT_COLOR* = 0x00000B00 - GL_CURRENT_INDEX* = 0x00000B01 - GL_CURRENT_NORMAL* = 0x00000B02 - GL_CURRENT_TEXTURE_COORDS* = 0x00000B03 - GL_CURRENT_RASTER_COLOR* = 0x00000B04 - GL_CURRENT_RASTER_INDEX* = 0x00000B05 - GL_CURRENT_RASTER_TEXTURE_COORDS* = 0x00000B06 - GL_CURRENT_RASTER_POSITION* = 0x00000B07 - GL_CURRENT_RASTER_POSITION_VALID* = 0x00000B08 - GL_CURRENT_RASTER_DISTANCE* = 0x00000B09 - GL_POINT_SMOOTH* = 0x00000B10 - cGL_LINE_STIPPLE* = 0x00000B24 - GL_LINE_STIPPLE_PATTERN* = 0x00000B25 - GL_LINE_STIPPLE_REPEAT* = 0x00000B26 - GL_LIST_MODE* = 0x00000B30 - GL_MAX_LIST_NESTING* = 0x00000B31 - cGL_LIST_BASE* = 0x00000B32 - GL_LIST_INDEX* = 0x00000B33 - cGL_POLYGON_MODE* = 0x00000B40 - cGL_POLYGON_STIPPLE* = 0x00000B42 - cGL_EDGE_FLAG* = 0x00000B43 - GL_LIGHTING* = 0x00000B50 - GL_LIGHT_MODEL_LOCAL_VIEWER* = 0x00000B51 - GL_LIGHT_MODEL_TWO_SIDE* = 0x00000B52 - GL_LIGHT_MODEL_AMBIENT* = 0x00000B53 - cGL_SHADE_MODEL* = 0x00000B54 - GL_COLOR_MATERIAL_FACE* = 0x00000B55 - GL_COLOR_MATERIAL_PARAMETER* = 0x00000B56 - cGL_COLOR_MATERIAL* = 0x00000B57 - GL_FOG* = 0x00000B60 - GL_FOG_INDEX* = 0x00000B61 - GL_FOG_DENSITY* = 0x00000B62 - GL_FOG_START* = 0x00000B63 - GL_FOG_END* = 0x00000B64 - GL_FOG_MODE* = 0x00000B65 - GL_FOG_COLOR* = 0x00000B66 - GL_ACCUM_CLEAR_VALUE* = 0x00000B80 - cGL_MATRIX_MODE* = 0x00000BA0 - GL_NORMALIZE* = 0x00000BA1 - GL_MODELVIEW_STACK_DEPTH* = 0x00000BA3 - GL_PROJECTION_STACK_DEPTH* = 0x00000BA4 - GL_TEXTURE_STACK_DEPTH* = 0x00000BA5 - GL_MODELVIEW_MATRIX* = 0x00000BA6 - GL_PROJECTION_MATRIX* = 0x00000BA7 - GL_TEXTURE_MATRIX* = 0x00000BA8 - GL_ATTRIB_STACK_DEPTH* = 0x00000BB0 - GL_CLIENT_ATTRIB_STACK_DEPTH* = 0x00000BB1 - GL_ALPHA_TEST* = 0x00000BC0 - GL_ALPHA_TEST_FUNC* = 0x00000BC1 - GL_ALPHA_TEST_REF* = 0x00000BC2 - GL_INDEX_LOGIC_OP* = 0x00000BF1 - GL_AUX_BUFFERS* = 0x00000C00 - GL_INDEX_CLEAR_VALUE* = 0x00000C20 - GL_INDEX_WRITEMASK* = 0x00000C21 - GL_INDEX_MODE* = 0x00000C30 - GL_RGBA_MODE* = 0x00000C31 - cGL_RENDER_MODE* = 0x00000C40 - GL_PERSPECTIVE_CORRECTION_HINT* = 0x00000C50 - GL_POINT_SMOOTH_HINT* = 0x00000C51 - GL_FOG_HINT* = 0x00000C54 - GL_TEXTURE_GEN_S* = 0x00000C60 - GL_TEXTURE_GEN_T* = 0x00000C61 - GL_TEXTURE_GEN_R* = 0x00000C62 - GL_TEXTURE_GEN_Q* = 0x00000C63 - GL_PIXEL_MAP_I_TO_I* = 0x00000C70 - GL_PIXEL_MAP_S_TO_S* = 0x00000C71 - GL_PIXEL_MAP_I_TO_R* = 0x00000C72 - GL_PIXEL_MAP_I_TO_G* = 0x00000C73 - GL_PIXEL_MAP_I_TO_B* = 0x00000C74 - GL_PIXEL_MAP_I_TO_A* = 0x00000C75 - GL_PIXEL_MAP_R_TO_R* = 0x00000C76 - GL_PIXEL_MAP_G_TO_G* = 0x00000C77 - GL_PIXEL_MAP_B_TO_B* = 0x00000C78 - GL_PIXEL_MAP_A_TO_A* = 0x00000C79 - GL_PIXEL_MAP_I_TO_I_SIZE* = 0x00000CB0 - GL_PIXEL_MAP_S_TO_S_SIZE* = 0x00000CB1 - GL_PIXEL_MAP_I_TO_R_SIZE* = 0x00000CB2 - GL_PIXEL_MAP_I_TO_G_SIZE* = 0x00000CB3 - GL_PIXEL_MAP_I_TO_B_SIZE* = 0x00000CB4 - GL_PIXEL_MAP_I_TO_A_SIZE* = 0x00000CB5 - GL_PIXEL_MAP_R_TO_R_SIZE* = 0x00000CB6 - GL_PIXEL_MAP_G_TO_G_SIZE* = 0x00000CB7 - GL_PIXEL_MAP_B_TO_B_SIZE* = 0x00000CB8 - GL_PIXEL_MAP_A_TO_A_SIZE* = 0x00000CB9 - GL_MAP_COLOR* = 0x00000D10 - GL_MAP_STENCIL* = 0x00000D11 - GL_INDEX_SHIFT* = 0x00000D12 - GL_INDEX_OFFSET* = 0x00000D13 - GL_RED_SCALE* = 0x00000D14 - GL_RED_BIAS* = 0x00000D15 - GL_ZOOM_X* = 0x00000D16 - GL_ZOOM_Y* = 0x00000D17 - GL_GREEN_SCALE* = 0x00000D18 - GL_GREEN_BIAS* = 0x00000D19 - GL_BLUE_SCALE* = 0x00000D1A - GL_BLUE_BIAS* = 0x00000D1B - GL_ALPHA_SCALE* = 0x00000D1C - GL_ALPHA_BIAS* = 0x00000D1D - GL_DEPTH_SCALE* = 0x00000D1E - GL_DEPTH_BIAS* = 0x00000D1F - GL_MAX_EVAL_ORDER* = 0x00000D30 - GL_MAX_LIGHTS* = 0x00000D31 - GL_MAX_CLIP_PLANES* = 0x00000D32 - GL_MAX_PIXEL_MAP_TABLE* = 0x00000D34 - GL_MAX_ATTRIB_STACK_DEPTH* = 0x00000D35 - GL_MAX_MODELVIEW_STACK_DEPTH* = 0x00000D36 - GL_MAX_NAME_STACK_DEPTH* = 0x00000D37 - GL_MAX_PROJECTION_STACK_DEPTH* = 0x00000D38 - GL_MAX_TEXTURE_STACK_DEPTH* = 0x00000D39 - GL_MAX_CLIENT_ATTRIB_STACK_DEPTH* = 0x00000D3B - GL_INDEX_BITS* = 0x00000D51 - GL_RED_BITS* = 0x00000D52 - GL_GREEN_BITS* = 0x00000D53 - GL_BLUE_BITS* = 0x00000D54 - GL_ALPHA_BITS* = 0x00000D55 - GL_DEPTH_BITS* = 0x00000D56 - GL_STENCIL_BITS* = 0x00000D57 - GL_ACCUM_RED_BITS* = 0x00000D58 - GL_ACCUM_GREEN_BITS* = 0x00000D59 - GL_ACCUM_BLUE_BITS* = 0x00000D5A - GL_ACCUM_ALPHA_BITS* = 0x00000D5B - GL_NAME_STACK_DEPTH* = 0x00000D70 - GL_AUTO_NORMAL* = 0x00000D80 - GL_MAP1_COLOR_4* = 0x00000D90 - GL_MAP1_INDEX* = 0x00000D91 - GL_MAP1_NORMAL* = 0x00000D92 - GL_MAP1_TEXTURE_COORD_1* = 0x00000D93 - GL_MAP1_TEXTURE_COORD_2* = 0x00000D94 - GL_MAP1_TEXTURE_COORD_3* = 0x00000D95 - GL_MAP1_TEXTURE_COORD_4* = 0x00000D96 - GL_MAP1_VERTEX_3* = 0x00000D97 - GL_MAP1_VERTEX_4* = 0x00000D98 - GL_MAP2_COLOR_4* = 0x00000DB0 - GL_MAP2_INDEX* = 0x00000DB1 - GL_MAP2_NORMAL* = 0x00000DB2 - GL_MAP2_TEXTURE_COORD_1* = 0x00000DB3 - GL_MAP2_TEXTURE_COORD_2* = 0x00000DB4 - GL_MAP2_TEXTURE_COORD_3* = 0x00000DB5 - GL_MAP2_TEXTURE_COORD_4* = 0x00000DB6 - GL_MAP2_VERTEX_3* = 0x00000DB7 - GL_MAP2_VERTEX_4* = 0x00000DB8 - GL_MAP1_GRID_DOMAIN* = 0x00000DD0 - GL_MAP1_GRID_SEGMENTS* = 0x00000DD1 - GL_MAP2_GRID_DOMAIN* = 0x00000DD2 - GL_MAP2_GRID_SEGMENTS* = 0x00000DD3 - GL_FEEDBACK_BUFFER_POINTER* = 0x00000DF0 - GL_FEEDBACK_BUFFER_SIZE* = 0x00000DF1 - GL_FEEDBACK_BUFFERtyp* = 0x00000DF2 - GL_SELECTION_BUFFER_POINTER* = 0x00000DF3 - GL_SELECTION_BUFFER_SIZE* = 0x00000DF4 - GL_LIGHT0* = 0x00004000 - GL_LIGHT1* = 0x00004001 - GL_LIGHT2* = 0x00004002 - GL_LIGHT3* = 0x00004003 - GL_LIGHT4* = 0x00004004 - GL_LIGHT5* = 0x00004005 - GL_LIGHT6* = 0x00004006 - GL_LIGHT7* = 0x00004007 - GL_AMBIENT* = 0x00001200 - GL_DIFFUSE* = 0x00001201 - GL_SPECULAR* = 0x00001202 - GL_POSITION* = 0x00001203 - GL_SPOT_DIRECTION* = 0x00001204 - GL_SPOT_EXPONENT* = 0x00001205 - GL_SPOT_CUTOFF* = 0x00001206 - GL_CONSTANT_ATTENUATION* = 0x00001207 - GL_LINEAR_ATTENUATION* = 0x00001208 - GL_QUADRATIC_ATTENUATION* = 0x00001209 - GL_COMPILE* = 0x00001300 - GL_COMPILE_AND_EXECUTE* = 0x00001301 - GL_EMISSION* = 0x00001600 - GL_SHININESS* = 0x00001601 - GL_AMBIENT_AND_DIFFUSE* = 0x00001602 - GL_COLOR_INDEXES* = 0x00001603 - GL_MODELVIEW* = 0x00001700 - GL_PROJECTION* = 0x00001701 - GL_COLOR_INDEX* = 0x00001900 - GL_LUMINANCE* = 0x00001909 - GL_LUMINANCE_ALPHA* = 0x0000190A - cGL_BITMAP* = 0x00001A00 - GL_RENDER* = 0x00001C00 - GL_FEEDBACK* = 0x00001C01 - GL_SELECT* = 0x00001C02 - GL_FLAT* = 0x00001D00 - GL_SMOOTH* = 0x00001D01 - GL_S* = 0x00002000 - GL_T* = 0x00002001 - GL_R* = 0x00002002 - GL_Q* = 0x00002003 - GL_MODULATE* = 0x00002100 - GL_DECAL* = 0x00002101 - GL_TEXTURE_ENV_MODE* = 0x00002200 - GL_TEXTURE_ENV_COLOR* = 0x00002201 - GL_TEXTURE_ENV* = 0x00002300 - GL_EYE_LINEAR* = 0x00002400 - GL_OBJECT_LINEAR* = 0x00002401 - GL_SPHERE_MAP* = 0x00002402 - GL_TEXTURE_GEN_MODE* = 0x00002500 - GL_OBJECT_PLANE* = 0x00002501 - GL_EYE_PLANE* = 0x00002502 - GL_CLAMP* = 0x00002900 - GL_CLIENT_PIXEL_STORE_BIT* = 0x00000001 - GL_CLIENT_VERTEX_ARRAY_BIT* = 0x00000002 - GL_CLIENT_ALL_ATTRIB_BITS* = 0xFFFFFFFF - GL_ALPHA4* = 0x0000803B - GL_ALPHA8* = 0x0000803C - GL_ALPHA12* = 0x0000803D - GL_ALPHA16* = 0x0000803E - GL_LUMINANCE4* = 0x0000803F - GL_LUMINANCE8* = 0x00008040 - GL_LUMINANCE12* = 0x00008041 - GL_LUMINANCE16* = 0x00008042 - GL_LUMINANCE4_ALPHA4* = 0x00008043 - GL_LUMINANCE6_ALPHA2* = 0x00008044 - GL_LUMINANCE8_ALPHA8* = 0x00008045 - GL_LUMINANCE12_ALPHA4* = 0x00008046 - GL_LUMINANCE12_ALPHA12* = 0x00008047 - GL_LUMINANCE16_ALPHA16* = 0x00008048 - GL_INTENSITY* = 0x00008049 - GL_INTENSITY4* = 0x0000804A - GL_INTENSITY8* = 0x0000804B - GL_INTENSITY12* = 0x0000804C - GL_INTENSITY16* = 0x0000804D - GL_TEXTURE_LUMINANCE_SIZE* = 0x00008060 - GL_TEXTURE_INTENSITY_SIZE* = 0x00008061 - GL_TEXTURE_PRIORITY* = 0x00008066 - GL_TEXTURE_RESIDENT* = 0x00008067 - GL_VERTEX_ARRAY* = 0x00008074 - GL_NORMAL_ARRAY* = 0x00008075 - GL_COLOR_ARRAY* = 0x00008076 - GL_INDEX_ARRAY* = 0x00008077 - GL_TEXTURE_COORD_ARRAY* = 0x00008078 - GL_EDGE_FLAG_ARRAY* = 0x00008079 - GL_VERTEX_ARRAY_SIZE* = 0x0000807A - GL_VERTEX_ARRAYtyp* = 0x0000807B - GL_VERTEX_ARRAY_STRIDE* = 0x0000807C - GL_NORMAL_ARRAYtyp* = 0x0000807E - GL_NORMAL_ARRAY_STRIDE* = 0x0000807F - GL_COLOR_ARRAY_SIZE* = 0x00008081 - GL_COLOR_ARRAYtyp* = 0x00008082 - GL_COLOR_ARRAY_STRIDE* = 0x00008083 - GL_INDEX_ARRAYtyp* = 0x00008085 - GL_INDEX_ARRAY_STRIDE* = 0x00008086 - GL_TEXTURE_COORD_ARRAY_SIZE* = 0x00008088 - GL_TEXTURE_COORD_ARRAYtyp* = 0x00008089 - GL_TEXTURE_COORD_ARRAY_STRIDE* = 0x0000808A - GL_EDGE_FLAG_ARRAY_STRIDE* = 0x0000808C - GL_VERTEX_ARRAY_POINTER* = 0x0000808E - GL_NORMAL_ARRAY_POINTER* = 0x0000808F - GL_COLOR_ARRAY_POINTER* = 0x00008090 - GL_INDEX_ARRAY_POINTER* = 0x00008091 - GL_TEXTURE_COORD_ARRAY_POINTER* = 0x00008092 - GL_EDGE_FLAG_ARRAY_POINTER* = 0x00008093 - GL_V2F* = 0x00002A20 - GL_V3F* = 0x00002A21 - GL_C4UB_V2F* = 0x00002A22 - GL_C4UB_V3F* = 0x00002A23 - GL_C3F_V3F* = 0x00002A24 - GL_N3F_V3F* = 0x00002A25 - GL_C4F_N3F_V3F* = 0x00002A26 - GL_T2F_V3F* = 0x00002A27 - GL_T4F_V4F* = 0x00002A28 - GL_T2F_C4UB_V3F* = 0x00002A29 - GL_T2F_C3F_V3F* = 0x00002A2A - GL_T2F_N3F_V3F* = 0x00002A2B - GL_T2F_C4F_N3F_V3F* = 0x00002A2C - GL_T4F_C4F_N3F_V4F* = 0x00002A2D - GL_COLOR_TABLE_FORMAT_EXT* = 0x000080D8 - GL_COLOR_TABLE_WIDTH_EXT* = 0x000080D9 - GL_COLOR_TABLE_RED_SIZE_EXT* = 0x000080DA - GL_COLOR_TABLE_GREEN_SIZE_EXT* = 0x000080DB - GL_COLOR_TABLE_BLUE_SIZE_EXT* = 0x000080DC - GL_COLOR_TABLE_ALPHA_SIZE_EXT* = 0x000080DD - GL_COLOR_TABLE_LUMINANCE_SIZE_EXT* = 0x000080DE - GL_COLOR_TABLE_INTENSITY_SIZE_EXT* = 0x000080DF - cGL_LOGIC_OP* = GL_INDEX_LOGIC_OP - GL_TEXTURE_COMPONENTS* = GL_TEXTURE_INTERNAL_FORMAT # GL_VERSION_1_2 - GL_UNSIGNED_BYTE_3_3_2* = 0x00008032 - GL_UNSIGNED_SHORT_4_4_4_4* = 0x00008033 - GL_UNSIGNED_SHORT_5_5_5_1* = 0x00008034 - GL_UNSIGNED_INT_8_8_8_8* = 0x00008035 - GL_UNSIGNED_INT_10_10_10_2* = 0x00008036 - GL_TEXTURE_BINDING_3D* = 0x0000806A - GL_PACK_SKIP_IMAGES* = 0x0000806B - GL_PACK_IMAGE_HEIGHT* = 0x0000806C - GL_UNPACK_SKIP_IMAGES* = 0x0000806D - GL_UNPACK_IMAGE_HEIGHT* = 0x0000806E - GL_TEXTURE_3D* = 0x0000806F - GL_PROXY_TEXTURE_3D* = 0x00008070 - GL_TEXTURE_DEPTH* = 0x00008071 - GL_TEXTURE_WRAP_R* = 0x00008072 - GL_MAX_3D_TEXTURE_SIZE* = 0x00008073 - GL_UNSIGNED_BYTE_2_3_3_REV* = 0x00008362 - GL_UNSIGNED_SHORT_5_6_5* = 0x00008363 - GL_UNSIGNED_SHORT_5_6_5_REV* = 0x00008364 - GL_UNSIGNED_SHORT_4_4_4_4_REV* = 0x00008365 - GL_UNSIGNED_SHORT_1_5_5_5_REV* = 0x00008366 - GL_UNSIGNED_INT_8_8_8_8_REV* = 0x00008367 - GL_UNSIGNED_INT_2_10_10_10_REV* = 0x00008368 - GL_BGR* = 0x000080E0 - GL_BGRA* = 0x000080E1 - GL_MAX_ELEMENTS_VERTICES* = 0x000080E8 - GL_MAX_ELEMENTS_INDICES* = 0x000080E9 - GL_CLAMP_TO_EDGE* = 0x0000812F - GL_TEXTURE_MIN_LOD* = 0x0000813A - GL_TEXTURE_MAX_LOD* = 0x0000813B - GL_TEXTURE_BASE_LEVEL* = 0x0000813C - GL_TEXTURE_MAX_LEVEL* = 0x0000813D - GL_SMOOTH_POINT_SIZE_RANGE* = 0x00000B12 - GL_SMOOTH_POINT_SIZE_GRANULARITY* = 0x00000B13 - GL_SMOOTH_LINE_WIDTH_RANGE* = 0x00000B22 - GL_SMOOTH_LINE_WIDTH_GRANULARITY* = 0x00000B23 - GL_ALIASED_LINE_WIDTH_RANGE* = 0x0000846E - GL_RESCALE_NORMAL* = 0x0000803A - GL_LIGHT_MODEL_COLOR_CONTROL* = 0x000081F8 - GL_SINGLE_COLOR* = 0x000081F9 - GL_SEPARATE_SPECULAR_COLOR* = 0x000081FA - GL_ALIASED_POINT_SIZE_RANGE* = 0x0000846D # GL_VERSION_1_3 - GL_TEXTURE0* = 0x000084C0 - GL_TEXTURE1* = 0x000084C1 - GL_TEXTURE2* = 0x000084C2 - GL_TEXTURE3* = 0x000084C3 - GL_TEXTURE4* = 0x000084C4 - GL_TEXTURE5* = 0x000084C5 - GL_TEXTURE6* = 0x000084C6 - GL_TEXTURE7* = 0x000084C7 - GL_TEXTURE8* = 0x000084C8 - GL_TEXTURE9* = 0x000084C9 - GL_TEXTURE10* = 0x000084CA - GL_TEXTURE11* = 0x000084CB - GL_TEXTURE12* = 0x000084CC - GL_TEXTURE13* = 0x000084CD - GL_TEXTURE14* = 0x000084CE - GL_TEXTURE15* = 0x000084CF - GL_TEXTURE16* = 0x000084D0 - GL_TEXTURE17* = 0x000084D1 - GL_TEXTURE18* = 0x000084D2 - GL_TEXTURE19* = 0x000084D3 - GL_TEXTURE20* = 0x000084D4 - GL_TEXTURE21* = 0x000084D5 - GL_TEXTURE22* = 0x000084D6 - GL_TEXTURE23* = 0x000084D7 - GL_TEXTURE24* = 0x000084D8 - GL_TEXTURE25* = 0x000084D9 - GL_TEXTURE26* = 0x000084DA - GL_TEXTURE27* = 0x000084DB - GL_TEXTURE28* = 0x000084DC - GL_TEXTURE29* = 0x000084DD - GL_TEXTURE30* = 0x000084DE - GL_TEXTURE31* = 0x000084DF - cGL_ACTIVE_TEXTURE* = 0x000084E0 - GL_MULTISAMPLE* = 0x0000809D - GL_SAMPLE_ALPHA_TO_COVERAGE* = 0x0000809E - GL_SAMPLE_ALPHA_TO_ONE* = 0x0000809F - cGL_SAMPLE_COVERAGE* = 0x000080A0 - GL_SAMPLE_BUFFERS* = 0x000080A8 - GL_SAMPLES* = 0x000080A9 - GL_SAMPLE_COVERAGE_VALUE* = 0x000080AA - GL_SAMPLE_COVERAGE_INVERT* = 0x000080AB - GL_TEXTURE_CUBE_MAP* = 0x00008513 - GL_TEXTURE_BINDING_CUBE_MAP* = 0x00008514 - GL_TEXTURE_CUBE_MAP_POSITIVE_X* = 0x00008515 - GL_TEXTURE_CUBE_MAP_NEGATIVE_X* = 0x00008516 - GL_TEXTURE_CUBE_MAP_POSITIVE_Y* = 0x00008517 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y* = 0x00008518 - GL_TEXTURE_CUBE_MAP_POSITIVE_Z* = 0x00008519 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z* = 0x0000851A - GL_PROXY_TEXTURE_CUBE_MAP* = 0x0000851B - GL_MAX_CUBE_MAP_TEXTURE_SIZE* = 0x0000851C - GL_COMPRESSED_RGB* = 0x000084ED - GL_COMPRESSED_RGBA* = 0x000084EE - GL_TEXTURE_COMPRESSION_HINT* = 0x000084EF - GL_TEXTURE_COMPRESSED_IMAGE_SIZE* = 0x000086A0 - GL_TEXTURE_COMPRESSED* = 0x000086A1 - GL_NUM_COMPRESSED_TEXTURE_FORMATS* = 0x000086A2 - GL_COMPRESSED_TEXTURE_FORMATS* = 0x000086A3 - GL_CLAMP_TO_BORDER* = 0x0000812D - cGL_CLIENT_ACTIVE_TEXTURE* = 0x000084E1 - GL_MAX_TEXTURE_UNITS* = 0x000084E2 - GL_TRANSPOSE_MODELVIEW_MATRIX* = 0x000084E3 - GL_TRANSPOSE_PROJECTION_MATRIX* = 0x000084E4 - GL_TRANSPOSE_TEXTURE_MATRIX* = 0x000084E5 - GL_TRANSPOSE_COLOR_MATRIX* = 0x000084E6 - GL_MULTISAMPLE_BIT* = 0x20000000 - GL_NORMAL_MAP* = 0x00008511 - GL_REFLECTION_MAP* = 0x00008512 - GL_COMPRESSED_ALPHA* = 0x000084E9 - GL_COMPRESSED_LUMINANCE* = 0x000084EA - GL_COMPRESSED_LUMINANCE_ALPHA* = 0x000084EB - GL_COMPRESSED_INTENSITY* = 0x000084EC - GL_COMBINE* = 0x00008570 - GL_COMBINE_RGB* = 0x00008571 - GL_COMBINE_ALPHA* = 0x00008572 - GL_SOURCE0_RGB* = 0x00008580 - GL_SOURCE1_RGB* = 0x00008581 - GL_SOURCE2_RGB* = 0x00008582 - GL_SOURCE0_ALPHA* = 0x00008588 - GL_SOURCE1_ALPHA* = 0x00008589 - GL_SOURCE2_ALPHA* = 0x0000858A - GL_OPERAND0_RGB* = 0x00008590 - GL_OPERAND1_RGB* = 0x00008591 - GL_OPERAND2_RGB* = 0x00008592 - GL_OPERAND0_ALPHA* = 0x00008598 - GL_OPERAND1_ALPHA* = 0x00008599 - GL_OPERAND2_ALPHA* = 0x0000859A - GL_RGB_SCALE* = 0x00008573 - GL_ADD_SIGNED* = 0x00008574 - GL_INTERPOLATE* = 0x00008575 - GL_SUBTRACT* = 0x000084E7 - GL_CONSTANT* = 0x00008576 - GL_PRIMARY_COLOR* = 0x00008577 - GL_PREVIOUS* = 0x00008578 - GL_DOT3_RGB* = 0x000086AE - GL_DOT3_RGBA* = 0x000086AF # GL_VERSION_1_4 - GL_BLEND_DST_RGB* = 0x000080C8 - GL_BLEND_SRC_RGB* = 0x000080C9 - GL_BLEND_DST_ALPHA* = 0x000080CA - GL_BLEND_SRC_ALPHA* = 0x000080CB - GL_POINT_FADE_THRESHOLD_SIZE* = 0x00008128 - GL_DEPTH_COMPONENT16* = 0x000081A5 - GL_DEPTH_COMPONENT24* = 0x000081A6 - GL_DEPTH_COMPONENT32* = 0x000081A7 - GL_MIRRORED_REPEAT* = 0x00008370 - GL_MAX_TEXTURE_LOD_BIAS* = 0x000084FD - GL_TEXTURE_LOD_BIAS* = 0x00008501 - GL_INCR_WRAP* = 0x00008507 - GL_DECR_WRAP* = 0x00008508 - GL_TEXTURE_DEPTH_SIZE* = 0x0000884A - GL_TEXTURE_COMPARE_MODE* = 0x0000884C - GL_TEXTURE_COMPARE_FUNC* = 0x0000884D - GL_POINT_SIZE_MIN* = 0x00008126 - GL_POINT_SIZE_MAX* = 0x00008127 - GL_POINT_DISTANCE_ATTENUATION* = 0x00008129 - cGL_GENERATE_MIPMAP* = 0x00008191 - GL_GENERATE_MIPMAP_HINT* = 0x00008192 - GL_FOG_COORDINATE_SOURCE* = 0x00008450 - GL_FOG_COORDINATE* = 0x00008451 - GL_FRAGMENT_DEPTH* = 0x00008452 - GL_CURRENT_FOG_COORDINATE* = 0x00008453 - GL_FOG_COORDINATE_ARRAYtyp* = 0x00008454 - GL_FOG_COORDINATE_ARRAY_STRIDE* = 0x00008455 - GL_FOG_COORDINATE_ARRAY_POINTER* = 0x00008456 - GL_FOG_COORDINATE_ARRAY* = 0x00008457 - GL_COLOR_SUM* = 0x00008458 - GL_CURRENT_SECONDARY_COLOR* = 0x00008459 - GL_SECONDARY_COLOR_ARRAY_SIZE* = 0x0000845A - GL_SECONDARY_COLOR_ARRAYtyp* = 0x0000845B - GL_SECONDARY_COLOR_ARRAY_STRIDE* = 0x0000845C - GL_SECONDARY_COLOR_ARRAY_POINTER* = 0x0000845D - GL_SECONDARY_COLOR_ARRAY* = 0x0000845E - GL_TEXTURE_FILTER_CONTROL* = 0x00008500 - GL_DEPTH_TEXTURE_MODE* = 0x0000884B - GL_COMPARE_R_TO_TEXTURE* = 0x0000884E # GL_VERSION_1_5 - GL_BUFFER_SIZE* = 0x00008764 - GL_BUFFER_USAGE* = 0x00008765 - GL_QUERY_COUNTER_BITS* = 0x00008864 - GL_CURRENT_QUERY* = 0x00008865 - GL_QUERY_RESULT* = 0x00008866 - GL_QUERY_RESULT_AVAILABLE* = 0x00008867 - GL_ARRAY_BUFFER* = 0x00008892 - GL_ELEMENT_ARRAY_BUFFER* = 0x00008893 - GL_ARRAY_BUFFER_BINDING* = 0x00008894 - GL_ELEMENT_ARRAY_BUFFER_BINDING* = 0x00008895 - GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING* = 0x0000889F - GL_READ_ONLY* = 0x000088B8 - GL_WRITE_ONLY* = 0x000088B9 - GL_READ_WRITE* = 0x000088BA - GL_BUFFER_ACCESS* = 0x000088BB - GL_BUFFER_MAPPED* = 0x000088BC - GL_BUFFER_MAP_POINTER* = 0x000088BD - GL_STREAM_DRAW* = 0x000088E0 - GL_STREAM_READ* = 0x000088E1 - GL_STREAM_COPY* = 0x000088E2 - GL_STATIC_DRAW* = 0x000088E4 - GL_STATIC_READ* = 0x000088E5 - GL_STATIC_COPY* = 0x000088E6 - GL_DYNAMIC_DRAW* = 0x000088E8 - GL_DYNAMIC_READ* = 0x000088E9 - GL_DYNAMIC_COPY* = 0x000088EA - GL_SAMPLES_PASSED* = 0x00008914 - GL_VERTEX_ARRAY_BUFFER_BINDING* = 0x00008896 - GL_NORMAL_ARRAY_BUFFER_BINDING* = 0x00008897 - GL_COLOR_ARRAY_BUFFER_BINDING* = 0x00008898 - GL_INDEX_ARRAY_BUFFER_BINDING* = 0x00008899 - GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING* = 0x0000889A - GL_EDGE_FLAG_ARRAY_BUFFER_BINDING* = 0x0000889B - GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING* = 0x0000889C - GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING* = 0x0000889D - GL_WEIGHT_ARRAY_BUFFER_BINDING* = 0x0000889E - GL_FOG_COORD_SRC* = 0x00008450 - GL_FOG_COORD* = 0x00008451 - GL_CURRENT_FOG_COORD* = 0x00008453 - GL_FOG_COORD_ARRAYtyp* = 0x00008454 - GL_FOG_COORD_ARRAY_STRIDE* = 0x00008455 - GL_FOG_COORD_ARRAY_POINTER* = 0x00008456 - GL_FOG_COORD_ARRAY* = 0x00008457 - GL_FOG_COORD_ARRAY_BUFFER_BINDING* = 0x0000889D - GL_SRC0_RGB* = 0x00008580 - GL_SRC1_RGB* = 0x00008581 - GL_SRC2_RGB* = 0x00008582 - GL_SRC0_ALPHA* = 0x00008588 - GL_SRC1_ALPHA* = 0x00008589 - GL_SRC2_ALPHA* = 0x0000858A # GL_VERSION_2_0 - GL_BLEND_EQUATION_RGB* = 0x00008009 - GL_VERTEX_ATTRIB_ARRAY_ENABLED* = 0x00008622 - GL_VERTEX_ATTRIB_ARRAY_SIZE* = 0x00008623 - GL_VERTEX_ATTRIB_ARRAY_STRIDE* = 0x00008624 - GL_VERTEX_ATTRIB_ARRAYtyp* = 0x00008625 - GL_CURRENT_VERTEX_ATTRIB* = 0x00008626 - GL_VERTEX_PROGRAM_POINT_SIZE* = 0x00008642 - GL_VERTEX_ATTRIB_ARRAY_POINTER* = 0x00008645 - GL_STENCIL_BACK_FUNC* = 0x00008800 - GL_STENCIL_BACK_FAIL* = 0x00008801 - GL_STENCIL_BACK_PASS_DEPTH_FAIL* = 0x00008802 - GL_STENCIL_BACK_PASS_DEPTH_PASS* = 0x00008803 - GL_MAX_DRAW_BUFFERS* = 0x00008824 - GL_DRAW_BUFFER0* = 0x00008825 - GL_DRAW_BUFFER1* = 0x00008826 - GL_DRAW_BUFFER2* = 0x00008827 - GL_DRAW_BUFFER3* = 0x00008828 - GL_DRAW_BUFFER4* = 0x00008829 - GL_DRAW_BUFFER5* = 0x0000882A - GL_DRAW_BUFFER6* = 0x0000882B - GL_DRAW_BUFFER7* = 0x0000882C - GL_DRAW_BUFFER8* = 0x0000882D - GL_DRAW_BUFFER9* = 0x0000882E - GL_DRAW_BUFFER10* = 0x0000882F - GL_DRAW_BUFFER11* = 0x00008830 - GL_DRAW_BUFFER12* = 0x00008831 - GL_DRAW_BUFFER13* = 0x00008832 - GL_DRAW_BUFFER14* = 0x00008833 - GL_DRAW_BUFFER15* = 0x00008834 - GL_BLEND_EQUATION_ALPHA* = 0x0000883D - GL_MAX_VERTEX_ATTRIBS* = 0x00008869 - GL_VERTEX_ATTRIB_ARRAY_NORMALIZED* = 0x0000886A - GL_MAX_TEXTURE_IMAGE_UNITS* = 0x00008872 - GL_FRAGMENT_SHADER* = 0x00008B30 - GL_VERTEX_SHADER* = 0x00008B31 - GL_MAX_FRAGMENT_UNIFORM_COMPONENTS* = 0x00008B49 - GL_MAX_VERTEX_UNIFORM_COMPONENTS* = 0x00008B4A - GL_MAX_VARYING_FLOATS* = 0x00008B4B - GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS* = 0x00008B4C - GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS* = 0x00008B4D - GL_SHADERtyp* = 0x00008B4F - GL_FLOAT_VEC2* = 0x00008B50 - GL_FLOAT_VEC3* = 0x00008B51 - GL_FLOAT_VEC4* = 0x00008B52 - GL_INT_VEC2* = 0x00008B53 - GL_INT_VEC3* = 0x00008B54 - GL_INT_VEC4* = 0x00008B55 - GL_BOOL* = 0x00008B56 - GL_BOOL_VEC2* = 0x00008B57 - GL_BOOL_VEC3* = 0x00008B58 - GL_BOOL_VEC4* = 0x00008B59 - GL_FLOAT_MAT2* = 0x00008B5A - GL_FLOAT_MAT3* = 0x00008B5B - GL_FLOAT_MAT4* = 0x00008B5C - GL_SAMPLER_1D* = 0x00008B5D - GL_SAMPLER_2D* = 0x00008B5E - GL_SAMPLER_3D* = 0x00008B5F - GL_SAMPLER_CUBE* = 0x00008B60 - GL_SAMPLER_1D_SHADOW* = 0x00008B61 - GL_SAMPLER_2D_SHADOW* = 0x00008B62 - GL_DELETE_STATUS* = 0x00008B80 - GL_COMPILE_STATUS* = 0x00008B81 - GL_LINK_STATUS* = 0x00008B82 - GL_VALIDATE_STATUS* = 0x00008B83 - GL_INFO_LOG_LENGTH* = 0x00008B84 - GL_ATTACHED_SHADERS* = 0x00008B85 - GL_ACTIVE_UNIFORMS* = 0x00008B86 - GL_ACTIVE_UNIFORM_MAX_LENGTH* = 0x00008B87 - GL_SHADER_SOURCE_LENGTH* = 0x00008B88 - GL_ACTIVE_ATTRIBUTES* = 0x00008B89 - GL_ACTIVE_ATTRIBUTE_MAX_LENGTH* = 0x00008B8A - GL_FRAGMENT_SHADER_DERIVATIVE_HINT* = 0x00008B8B - GL_SHADING_LANGUAGE_VERSION* = 0x00008B8C - GL_CURRENT_PROGRAM* = 0x00008B8D - GL_POINT_SPRITE_COORD_ORIGIN* = 0x00008CA0 - GL_LOWER_LEFT* = 0x00008CA1 - GL_UPPER_LEFT* = 0x00008CA2 - GL_STENCIL_BACK_REF* = 0x00008CA3 - GL_STENCIL_BACK_VALUE_MASK* = 0x00008CA4 - GL_STENCIL_BACK_WRITEMASK* = 0x00008CA5 - GL_VERTEX_PROGRAM_TWO_SIDE* = 0x00008643 - GL_POINT_SPRITE* = 0x00008861 - GL_COORD_REPLACE* = 0x00008862 - GL_MAX_TEXTURE_COORDS* = 0x00008871 # GL_VERSION_2_1 - GL_PIXEL_PACK_BUFFER* = 0x000088EB - GL_PIXEL_UNPACK_BUFFER* = 0x000088EC - GL_PIXEL_PACK_BUFFER_BINDING* = 0x000088ED - GL_PIXEL_UNPACK_BUFFER_BINDING* = 0x000088EF - GL_FLOAT_MAT2x3* = 0x00008B65 - GL_FLOAT_MAT2x4* = 0x00008B66 - GL_FLOAT_MAT3x2* = 0x00008B67 - GL_FLOAT_MAT3x4* = 0x00008B68 - GL_FLOAT_MAT4x2* = 0x00008B69 - GL_FLOAT_MAT4x3* = 0x00008B6A - GL_SRGB* = 0x00008C40 - GL_SRGB8* = 0x00008C41 - GL_SRGB_ALPHA* = 0x00008C42 - GL_SRGB8_ALPHA8* = 0x00008C43 - GL_COMPRESSED_SRGB* = 0x00008C48 - GL_COMPRESSED_SRGB_ALPHA* = 0x00008C49 - GL_CURRENT_RASTER_SECONDARY_COLOR* = 0x0000845F - GL_SLUMINANCE_ALPHA* = 0x00008C44 - GL_SLUMINANCE8_ALPHA8* = 0x00008C45 - GL_SLUMINANCE* = 0x00008C46 - GL_SLUMINANCE8* = 0x00008C47 - GL_COMPRESSED_SLUMINANCE* = 0x00008C4A - GL_COMPRESSED_SLUMINANCE_ALPHA* = 0x00008C4B # GL_VERSION_3_0 - GL_COMPARE_REF_TO_TEXTURE* = 0x0000884E - GL_CLIP_DISTANCE0* = 0x00003000 - GL_CLIP_DISTANCE1* = 0x00003001 - GL_CLIP_DISTANCE2* = 0x00003002 - GL_CLIP_DISTANCE3* = 0x00003003 - GL_CLIP_DISTANCE4* = 0x00003004 - GL_CLIP_DISTANCE5* = 0x00003005 - GL_CLIP_DISTANCE6* = 0x00003006 - GL_CLIP_DISTANCE7* = 0x00003007 - GL_MAX_CLIP_DISTANCES* = 0x00000D32 - GL_MAJOR_VERSION* = 0x0000821B - GL_MINOR_VERSION* = 0x0000821C - GL_NUM_EXTENSIONS* = 0x0000821D - GL_CONTEXT_FLAGS* = 0x0000821E - GL_DEPTH_BUFFER* = 0x00008223 - GL_STENCIL_BUFFER* = 0x00008224 - GL_COMPRESSED_RED* = 0x00008225 - GL_COMPRESSED_RG* = 0x00008226 - GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT* = 0x00000001 - GL_RGBA32F* = 0x00008814 - GL_RGB32F* = 0x00008815 - GL_RGBA16F* = 0x0000881A - GL_RGB16F* = 0x0000881B - GL_VERTEX_ATTRIB_ARRAY_INTEGER* = 0x000088FD - GL_MAX_ARRAY_TEXTURE_LAYERS* = 0x000088FF - GL_MIN_PROGRAM_TEXEL_OFFSET* = 0x00008904 - GL_MAX_PROGRAM_TEXEL_OFFSET* = 0x00008905 - GL_CLAMP_READ_COLOR* = 0x0000891C - GL_FIXED_ONLY* = 0x0000891D - GL_MAX_VARYING_COMPONENTS* = 0x00008B4B - GL_TEXTURE_1D_ARRAY* = 0x00008C18 - GL_PROXY_TEXTURE_1D_ARRAY* = 0x00008C19 - GL_TEXTURE_2D_ARRAY* = 0x00008C1A - GL_PROXY_TEXTURE_2D_ARRAY* = 0x00008C1B - GL_TEXTURE_BINDING_1D_ARRAY* = 0x00008C1C - GL_TEXTURE_BINDING_2D_ARRAY* = 0x00008C1D - GL_R11F_G11F_B10F* = 0x00008C3A - GL_UNSIGNED_INT_10F_11F_11F_REV* = 0x00008C3B - GL_RGB9_E5* = 0x00008C3D - GL_UNSIGNED_INT_5_9_9_9_REV* = 0x00008C3E - GL_TEXTURE_SHARED_SIZE* = 0x00008C3F - GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH* = 0x00008C76 - GL_TRANSFORM_FEEDBACK_BUFFER_MODE* = 0x00008C7F - GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS* = 0x00008C80 - cGL_TRANSFORM_FEEDBACK_VARYINGS* = 0x00008C83 - GL_TRANSFORM_FEEDBACK_BUFFER_START* = 0x00008C84 - GL_TRANSFORM_FEEDBACK_BUFFER_SIZE* = 0x00008C85 - GL_PRIMITIVES_GENERATED* = 0x00008C87 - GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN* = 0x00008C88 - GL_RASTERIZER_DISCARD* = 0x00008C89 - GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS* = 0x00008C8A - GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS* = 0x00008C8B - GL_INTERLEAVED_ATTRIBS* = 0x00008C8C - GL_SEPARATE_ATTRIBS* = 0x00008C8D - GL_TRANSFORM_FEEDBACK_BUFFER* = 0x00008C8E - GL_TRANSFORM_FEEDBACK_BUFFER_BINDING* = 0x00008C8F - GL_RGBA32UI* = 0x00008D70 - GL_RGB32UI* = 0x00008D71 - GL_RGBA16UI* = 0x00008D76 - GL_RGB16UI* = 0x00008D77 - GL_RGBA8UI* = 0x00008D7C - GL_RGB8UI* = 0x00008D7D - GL_RGBA32I* = 0x00008D82 - GL_RGB32I* = 0x00008D83 - GL_RGBA16I* = 0x00008D88 - GL_RGB16I* = 0x00008D89 - GL_RGBA8I* = 0x00008D8E - GL_RGB8I* = 0x00008D8F - GL_RED_INTEGER* = 0x00008D94 - GL_GREEN_INTEGER* = 0x00008D95 - GL_BLUE_INTEGER* = 0x00008D96 - GL_RGB_INTEGER* = 0x00008D98 - GL_RGBA_INTEGER* = 0x00008D99 - GL_BGR_INTEGER* = 0x00008D9A - GL_BGRA_INTEGER* = 0x00008D9B - GL_SAMPLER_1D_ARRAY* = 0x00008DC0 - GL_SAMPLER_2D_ARRAY* = 0x00008DC1 - GL_SAMPLER_1D_ARRAY_SHADOW* = 0x00008DC3 - GL_SAMPLER_2D_ARRAY_SHADOW* = 0x00008DC4 - GL_SAMPLER_CUBE_SHADOW* = 0x00008DC5 - GL_UNSIGNED_INT_VEC2* = 0x00008DC6 - GL_UNSIGNED_INT_VEC3* = 0x00008DC7 - GL_UNSIGNED_INT_VEC4* = 0x00008DC8 - GL_INT_SAMPLER_1D* = 0x00008DC9 - GL_INT_SAMPLER_2D* = 0x00008DCA - GL_INT_SAMPLER_3D* = 0x00008DCB - GL_INT_SAMPLER_CUBE* = 0x00008DCC - GL_INT_SAMPLER_1D_ARRAY* = 0x00008DCE - GL_INT_SAMPLER_2D_ARRAY* = 0x00008DCF - GL_UNSIGNED_INT_SAMPLER_1D* = 0x00008DD1 - GL_UNSIGNED_INT_SAMPLER_2D* = 0x00008DD2 - GL_UNSIGNED_INT_SAMPLER_3D* = 0x00008DD3 - GL_UNSIGNED_INT_SAMPLER_CUBE* = 0x00008DD4 - GL_UNSIGNED_INT_SAMPLER_1D_ARRAY* = 0x00008DD6 - GL_UNSIGNED_INT_SAMPLER_2D_ARRAY* = 0x00008DD7 - GL_QUERY_WAIT* = 0x00008E13 - GL_QUERY_NO_WAIT* = 0x00008E14 - GL_QUERY_BY_REGION_WAIT* = 0x00008E15 - GL_QUERY_BY_REGION_NO_WAIT* = 0x00008E16 - GL_BUFFER_ACCESS_FLAGS* = 0x0000911F - GL_BUFFER_MAP_LENGTH* = 0x00009120 - GL_BUFFER_MAP_OFFSET* = 0x00009121 - GL_CLAMP_VERTEX_COLOR* = 0x0000891A - GL_CLAMP_FRAGMENT_COLOR* = 0x0000891B - GL_ALPHA_INTEGER* = 0x00008D97 # GL_VERSION_3_1 - GL_SAMPLER_2D_RECT* = 0x00008B63 - GL_SAMPLER_2D_RECT_SHADOW* = 0x00008B64 - GL_SAMPLER_BUFFER* = 0x00008DC2 - GL_INT_SAMPLER_2D_RECT* = 0x00008DCD - GL_INT_SAMPLER_BUFFER* = 0x00008DD0 - GL_UNSIGNED_INT_SAMPLER_2D_RECT* = 0x00008DD5 - GL_UNSIGNED_INT_SAMPLER_BUFFER* = 0x00008DD8 - GL_TEXTURE_BUFFER* = 0x00008C2A - GL_MAX_TEXTURE_BUFFER_SIZE* = 0x00008C2B - GL_TEXTURE_BINDING_BUFFER* = 0x00008C2C - GL_TEXTURE_BUFFER_DATA_STORE_BINDING* = 0x00008C2D - GL_TEXTURE_BUFFER_FORMAT* = 0x00008C2E - GL_TEXTURE_RECTANGLE* = 0x000084F5 - GL_TEXTURE_BINDING_RECTANGLE* = 0x000084F6 - GL_PROXY_TEXTURE_RECTANGLE* = 0x000084F7 - GL_MAX_RECTANGLE_TEXTURE_SIZE* = 0x000084F8 - GL_RED_SNORM* = 0x00008F90 - GL_RG_SNORM* = 0x00008F91 - GL_RGB_SNORM* = 0x00008F92 - GL_RGBA_SNORM* = 0x00008F93 - GL_R8_SNORM* = 0x00008F94 - GL_RG8_SNORM* = 0x00008F95 - GL_RGB8_SNORM* = 0x00008F96 - GL_RGBA8_SNORM* = 0x00008F97 - GL_R16_SNORM* = 0x00008F98 - GL_RG16_SNORM* = 0x00008F99 - GL_RGB16_SNORM* = 0x00008F9A - GL_RGBA16_SNORM* = 0x00008F9B - GL_SIGNED_NORMALIZED* = 0x00008F9C - GL_PRIMITIVE_RESTART* = 0x00008F9D - cGL_PRIMITIVE_RESTART_INDEX* = 0x00008F9E - GL_CONTEXT_CORE_PROFILE_BIT* = 0x00000001 - GL_CONTEXT_COMPATIBILITY_PROFILE_BIT* = 0x00000002 - GL_LINES_ADJACENCY* = 0x0000000A - GL_LINE_STRIP_ADJACENCY* = 0x0000000B - GL_TRIANGLES_ADJACENCY* = 0x0000000C - GL_TRIANGLE_STRIP_ADJACENCY* = 0x0000000D - GL_PROGRAM_POINT_SIZE* = 0x00008642 - GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS* = 0x00008C29 - GL_FRAMEBUFFER_ATTACHMENT_LAYERED* = 0x00008DA7 - GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS* = 0x00008DA8 - GL_GEOMETRY_SHADER* = 0x00008DD9 - GL_GEOMETRY_VERTICES_OUT* = 0x00008916 - GL_GEOMETRY_INPUTtyp* = 0x00008917 - GL_GEOMETRY_OUTPUTtyp* = 0x00008918 - GL_MAX_GEOMETRY_UNIFORM_COMPONENTS* = 0x00008DDF - GL_MAX_GEOMETRY_OUTPUT_VERTICES* = 0x00008DE0 - GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS* = 0x00008DE1 - GL_MAX_VERTEX_OUTPUT_COMPONENTS* = 0x00009122 - GL_MAX_GEOMETRY_INPUT_COMPONENTS* = 0x00009123 - GL_MAX_GEOMETRY_OUTPUT_COMPONENTS* = 0x00009124 - GL_MAX_FRAGMENT_INPUT_COMPONENTS* = 0x00009125 - GL_CONTEXT_PROFILE_MASK* = 0x00009126 # GL_VERSION_3_3 - GL_VERTEX_ATTRIB_ARRAY_DIVISOR* = 0x000088FE # GL_VERSION_4_0 - GL_SAMPLE_SHADING* = 0x00008C36 - GL_MIN_SAMPLE_SHADING_VALUE* = 0x00008C37 - GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET* = 0x00008E5E - GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET* = 0x00008E5F - GL_TEXTURE_CUBE_MAP_ARRAY* = 0x00009009 - GL_TEXTURE_BINDING_CUBE_MAP_ARRAY* = 0x0000900A - GL_PROXY_TEXTURE_CUBE_MAP_ARRAY* = 0x0000900B - GL_SAMPLER_CUBE_MAP_ARRAY* = 0x0000900C - GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW* = 0x0000900D - GL_INT_SAMPLER_CUBE_MAP_ARRAY* = 0x0000900E - GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY* = 0x0000900F # GL_3DFX_multisample - GL_MULTISAMPLE_3DFX* = 0x000086B2 - GL_SAMPLE_BUFFERS_3DFX* = 0x000086B3 - GL_SAMPLES_3DFX* = 0x000086B4 - GL_MULTISAMPLE_BIT_3DFX* = 0x20000000 # GL_3DFX_texture_compression_FXT1 - GL_COMPRESSED_RGB_FXT1_3DFX* = 0x000086B0 - GL_COMPRESSED_RGBA_FXT1_3DFX* = 0x000086B1 # GL_APPLE_client_storage - GL_UNPACK_CLIENT_STORAGE_APPLE* = 0x000085B2 # GL_APPLE_element_array - GL_ELEMENT_ARRAY_APPLE* = 0x00008A0C - GL_ELEMENT_ARRAYtyp_APPLE* = 0x00008A0D - GL_ELEMENT_ARRAY_POINTER_APPLE* = 0x00008A0E # GL_APPLE_fence - GL_DRAW_PIXELS_APPLE* = 0x00008A0A - GL_FENCE_APPLE* = 0x00008A0B # GL_APPLE_specular_vector - GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE* = 0x000085B0 # GL_APPLE_transform_hint - GL_TRANSFORM_HINT_APPLE* = 0x000085B1 # GL_APPLE_vertex_array_object - GL_VERTEX_ARRAY_BINDING_APPLE* = 0x000085B5 # GL_APPLE_vertex_array_range - cGL_VERTEX_ARRAY_RANGE_APPLE* = 0x0000851D - GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE* = 0x0000851E - GL_VERTEX_ARRAY_STORAGE_HINT_APPLE* = 0x0000851F - GL_VERTEX_ARRAY_RANGE_POINTER_APPLE* = 0x00008521 - GL_STORAGE_CLIENT_APPLE* = 0x000085B4 - GL_STORAGE_CACHED_APPLE* = 0x000085BE - GL_STORAGE_SHARED_APPLE* = 0x000085BF # GL_APPLE_ycbcr_422 - GL_YCBCR_422_APPLE* = 0x000085B9 - GL_UNSIGNED_SHORT_8_8_APPLE* = 0x000085BA - GL_UNSIGNED_SHORT_8_8_REV_APPLE* = 0x000085BB # GL_APPLE_texture_range - GL_TEXTURE_RANGE_LENGTH_APPLE* = 0x000085B7 - GL_TEXTURE_RANGE_POINTER_APPLE* = 0x000085B8 - GL_TEXTURE_STORAGE_HINT_APPLE* = 0x000085BC - GL_STORAGE_PRIVATE_APPLE* = 0x000085BD # reuse GL_STORAGE_CACHED_APPLE - # reuse GL_STORAGE_SHARED_APPLE - # GL_APPLE_float_pixels - GL_HALF_APPLE* = 0x0000140B - GL_RGBA_FLOAT32_APPLE* = 0x00008814 - GL_RGB_FLOAT32_APPLE* = 0x00008815 - GL_ALPHA_FLOAT32_APPLE* = 0x00008816 - GL_INTENSITY_FLOAT32_APPLE* = 0x00008817 - GL_LUMINANCE_FLOAT32_APPLE* = 0x00008818 - GL_LUMINANCE_ALPHA_FLOAT32_APPLE* = 0x00008819 - GL_RGBA_FLOAT16_APPLE* = 0x0000881A - GL_RGB_FLOAT16_APPLE* = 0x0000881B - GL_ALPHA_FLOAT16_APPLE* = 0x0000881C - GL_INTENSITY_FLOAT16_APPLE* = 0x0000881D - GL_LUMINANCE_FLOAT16_APPLE* = 0x0000881E - GL_LUMINANCE_ALPHA_FLOAT16_APPLE* = 0x0000881F - GL_COLOR_FLOAT_APPLE* = 0x00008A0F # GL_APPLE_vertex_program_evaluators - GL_VERTEX_ATTRIB_MAP1_APPLE* = 0x00008A00 - GL_VERTEX_ATTRIB_MAP2_APPLE* = 0x00008A01 - GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE* = 0x00008A02 - GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE* = 0x00008A03 - GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE* = 0x00008A04 - GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE* = 0x00008A05 - GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE* = 0x00008A06 - GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE* = 0x00008A07 - GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE* = 0x00008A08 - GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE* = 0x00008A09 # GL_APPLE_aux_depth_stencil - GL_AUX_DEPTH_STENCIL_APPLE* = 0x00008A14 # GL_APPLE_object_purgeable - GL_BUFFER_OBJECT_APPLE* = 0x000085B3 - GL_RELEASED_APPLE* = 0x00008A19 - GL_VOLATILE_APPLE* = 0x00008A1A - GL_RETAINED_APPLE* = 0x00008A1B - GL_UNDEFINED_APPLE* = 0x00008A1C - GL_PURGEABLE_APPLE* = 0x00008A1D # GL_APPLE_row_bytes - GL_PACK_ROW_BYTES_APPLE* = 0x00008A15 - GL_UNPACK_ROW_BYTES_APPLE* = 0x00008A16 # GL_APPLE_rgb_422 - # reuse GL_UNSIGNED_SHORT_8_8_APPLE - # reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE - # GL_ARB_depth_texture - GL_DEPTH_COMPONENT16_ARB* = 0x000081A5 - GL_DEPTH_COMPONENT24_ARB* = 0x000081A6 - GL_DEPTH_COMPONENT32_ARB* = 0x000081A7 - GL_TEXTURE_DEPTH_SIZE_ARB* = 0x0000884A - GL_DEPTH_TEXTURE_MODE_ARB* = 0x0000884B # GL_ARB_fragment_program - GL_FRAGMENT_PROGRAM_ARB* = 0x00008804 - GL_PROGRAM_ALU_INSTRUCTIONS_ARB* = 0x00008805 - GL_PROGRAM_TEX_INSTRUCTIONS_ARB* = 0x00008806 - GL_PROGRAM_TEX_INDIRECTIONS_ARB* = 0x00008807 - GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB* = 0x00008808 - GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB* = 0x00008809 - GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB* = 0x0000880A - GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB* = 0x0000880B - GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB* = 0x0000880C - GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB* = 0x0000880D - GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB* = 0x0000880E - GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB* = 0x0000880F - GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB* = 0x00008810 - GL_MAX_TEXTURE_COORDS_ARB* = 0x00008871 - GL_MAX_TEXTURE_IMAGE_UNITS_ARB* = 0x00008872 # GL_ARB_imaging - GL_CONSTANT_COLOR_ARB* = 0x00008001 - GL_ONE_MINUS_CONSTANT_COLOR* = 0x00008002 - GL_CONSTANT_ALPHA* = 0x00008003 - GL_ONE_MINUS_CONSTANT_ALPHA* = 0x00008004 - cGL_BLEND_COLOR* = 0x00008005 - GL_FUNC_ADD* = 0x00008006 - GL_MIN* = 0x00008007 - GL_MAX* = 0x00008008 - cGL_BLEND_EQUATION* = 0x00008009 - GL_FUNC_SUBTRACT* = 0x0000800A - GL_FUNC_REVERSE_SUBTRACT* = 0x0000800B - GL_CONVOLUTION_1D* = 0x00008010 - GL_CONVOLUTION_2D* = 0x00008011 - GL_SEPARABLE_2D* = 0x00008012 - GL_CONVOLUTION_BORDER_MODE* = 0x00008013 - GL_CONVOLUTION_FILTER_SCALE* = 0x00008014 - GL_CONVOLUTION_FILTER_BIAS* = 0x00008015 - GL_REDUCE* = 0x00008016 - GL_CONVOLUTION_FORMAT* = 0x00008017 - GL_CONVOLUTION_WIDTH* = 0x00008018 - GL_CONVOLUTION_HEIGHT* = 0x00008019 - GL_MAX_CONVOLUTION_WIDTH* = 0x0000801A - GL_MAX_CONVOLUTION_HEIGHT* = 0x0000801B - GL_POST_CONVOLUTION_RED_SCALE* = 0x0000801C - GL_POST_CONVOLUTION_GREEN_SCALE* = 0x0000801D - GL_POST_CONVOLUTION_BLUE_SCALE* = 0x0000801E - GL_POST_CONVOLUTION_ALPHA_SCALE* = 0x0000801F - GL_POST_CONVOLUTION_RED_BIAS* = 0x00008020 - GL_POST_CONVOLUTION_GREEN_BIAS* = 0x00008021 - GL_POST_CONVOLUTION_BLUE_BIAS* = 0x00008022 - GL_POST_CONVOLUTION_ALPHA_BIAS* = 0x00008023 - cGL_HISTOGRAM* = 0x00008024 - GL_PROXY_HISTOGRAM* = 0x00008025 - GL_HISTOGRAM_WIDTH* = 0x00008026 - GL_HISTOGRAM_FORMAT* = 0x00008027 - GL_HISTOGRAM_RED_SIZE* = 0x00008028 - GL_HISTOGRAM_GREEN_SIZE* = 0x00008029 - GL_HISTOGRAM_BLUE_SIZE* = 0x0000802A - GL_HISTOGRAM_ALPHA_SIZE* = 0x0000802B - GL_HISTOGRAM_LUMINANCE_SIZE* = 0x0000802C - GL_HISTOGRAM_SINK* = 0x0000802D - cGL_MINMAX* = 0x0000802E - GL_MINMAX_FORMAT* = 0x0000802F - GL_MINMAX_SINK* = 0x00008030 - GL_TABLE_TOO_LARGE* = 0x00008031 - GL_COLOR_MATRIX* = 0x000080B1 - GL_COLOR_MATRIX_STACK_DEPTH* = 0x000080B2 - GL_MAX_COLOR_MATRIX_STACK_DEPTH* = 0x000080B3 - GL_POST_COLOR_MATRIX_RED_SCALE* = 0x000080B4 - GL_POST_COLOR_MATRIX_GREEN_SCALE* = 0x000080B5 - GL_POST_COLOR_MATRIX_BLUE_SCALE* = 0x000080B6 - GL_POST_COLOR_MATRIX_ALPHA_SCALE* = 0x000080B7 - GL_POST_COLOR_MATRIX_RED_BIAS* = 0x000080B8 - GL_POST_COLOR_MATRIX_GREEN_BIAS* = 0x000080B9 - GL_POST_COLOR_MATRIX_BLUE_BIAS* = 0x000080BA - GL_POST_COLOR_MATRIX_ALPHA_BIAS* = 0x000080BB - cGL_COLOR_TABLE* = 0x000080D0 - GL_POST_CONVOLUTION_COLOR_TABLE* = 0x000080D1 - GL_POST_COLOR_MATRIX_COLOR_TABLE* = 0x000080D2 - GL_PROXY_COLOR_TABLE* = 0x000080D3 - GL_PROXY_POST_CONVOLUTION_COLOR_TABLE* = 0x000080D4 - GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE* = 0x000080D5 - GL_COLOR_TABLE_SCALE* = 0x000080D6 - GL_COLOR_TABLE_BIAS* = 0x000080D7 - GL_COLOR_TABLE_FORMAT* = 0x000080D8 - GL_COLOR_TABLE_WIDTH* = 0x000080D9 - GL_COLOR_TABLE_RED_SIZE* = 0x000080DA - GL_COLOR_TABLE_GREEN_SIZE* = 0x000080DB - GL_COLOR_TABLE_BLUE_SIZE* = 0x000080DC - GL_COLOR_TABLE_ALPHA_SIZE* = 0x000080DD - GL_COLOR_TABLE_LUMINANCE_SIZE* = 0x000080DE - GL_COLOR_TABLE_INTENSITY_SIZE* = 0x000080DF - GL_CONSTANT_BORDER* = 0x00008151 - GL_REPLICATE_BORDER* = 0x00008153 - GL_CONVOLUTION_BORDER_COLOR* = 0x00008154 # GL_ARB_matrix_palette - GL_MATRIX_PALETTE_ARB* = 0x00008840 - GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB* = 0x00008841 - GL_MAX_PALETTE_MATRICES_ARB* = 0x00008842 - cGL_CURRENT_PALETTE_MATRIX_ARB* = 0x00008843 - GL_MATRIX_INDEX_ARRAY_ARB* = 0x00008844 - GL_CURRENT_MATRIX_INDEX_ARB* = 0x00008845 - GL_MATRIX_INDEX_ARRAY_SIZE_ARB* = 0x00008846 - GL_MATRIX_INDEX_ARRAYtyp_ARB* = 0x00008847 - GL_MATRIX_INDEX_ARRAY_STRIDE_ARB* = 0x00008848 - GL_MATRIX_INDEX_ARRAY_POINTER_ARB* = 0x00008849 # GL_ARB_multisample - GL_MULTISAMPLE_ARB* = 0x0000809D - GL_SAMPLE_ALPHA_TO_COVERAGE_ARB* = 0x0000809E - GL_SAMPLE_ALPHA_TO_ONE_ARB* = 0x0000809F - cGL_SAMPLE_COVERAGE_ARB* = 0x000080A0 - GL_SAMPLE_BUFFERS_ARB* = 0x000080A8 - GL_SAMPLES_ARB* = 0x000080A9 - GL_SAMPLE_COVERAGE_VALUE_ARB* = 0x000080AA - GL_SAMPLE_COVERAGE_INVERT_ARB* = 0x000080AB - GL_MULTISAMPLE_BIT_ARB* = 0x20000000 # GL_ARB_multitexture - GL_TEXTURE0_ARB* = 0x000084C0 - GL_TEXTURE1_ARB* = 0x000084C1 - GL_TEXTURE2_ARB* = 0x000084C2 - GL_TEXTURE3_ARB* = 0x000084C3 - GL_TEXTURE4_ARB* = 0x000084C4 - GL_TEXTURE5_ARB* = 0x000084C5 - GL_TEXTURE6_ARB* = 0x000084C6 - GL_TEXTURE7_ARB* = 0x000084C7 - GL_TEXTURE8_ARB* = 0x000084C8 - GL_TEXTURE9_ARB* = 0x000084C9 - GL_TEXTURE10_ARB* = 0x000084CA - GL_TEXTURE11_ARB* = 0x000084CB - GL_TEXTURE12_ARB* = 0x000084CC - GL_TEXTURE13_ARB* = 0x000084CD - GL_TEXTURE14_ARB* = 0x000084CE - GL_TEXTURE15_ARB* = 0x000084CF - GL_TEXTURE16_ARB* = 0x000084D0 - GL_TEXTURE17_ARB* = 0x000084D1 - GL_TEXTURE18_ARB* = 0x000084D2 - GL_TEXTURE19_ARB* = 0x000084D3 - GL_TEXTURE20_ARB* = 0x000084D4 - GL_TEXTURE21_ARB* = 0x000084D5 - GL_TEXTURE22_ARB* = 0x000084D6 - GL_TEXTURE23_ARB* = 0x000084D7 - GL_TEXTURE24_ARB* = 0x000084D8 - GL_TEXTURE25_ARB* = 0x000084D9 - GL_TEXTURE26_ARB* = 0x000084DA - GL_TEXTURE27_ARB* = 0x000084DB - GL_TEXTURE28_ARB* = 0x000084DC - GL_TEXTURE29_ARB* = 0x000084DD - GL_TEXTURE30_ARB* = 0x000084DE - GL_TEXTURE31_ARB* = 0x000084DF - cGL_ACTIVE_TEXTURE_ARB* = 0x000084E0 - cGL_CLIENT_ACTIVE_TEXTURE_ARB* = 0x000084E1 - GL_MAX_TEXTURE_UNITS_ARB* = 0x000084E2 # GL_ARB_point_parameters - GL_POINT_SIZE_MIN_ARB* = 0x00008126 - GL_POINT_SIZE_MAX_ARB* = 0x00008127 - GL_POINT_FADE_THRESHOLD_SIZE_ARB* = 0x00008128 - GL_POINT_DISTANCE_ATTENUATION_ARB* = 0x00008129 # GL_ARB_shadow - GL_TEXTURE_COMPARE_MODE_ARB* = 0x0000884C - GL_TEXTURE_COMPARE_FUNC_ARB* = 0x0000884D - GL_COMPARE_R_TO_TEXTURE_ARB* = 0x0000884E # GL_ARB_shadow_ambient - GL_TEXTURE_COMPARE_FAIL_VALUE_ARB* = 0x000080BF # GL_ARB_texture_border_clamp - GL_CLAMP_TO_BORDER_ARB* = 0x0000812D # GL_ARB_texture_compression - GL_COMPRESSED_ALPHA_ARB* = 0x000084E9 - GL_COMPRESSED_LUMINANCE_ARB* = 0x000084EA - GL_COMPRESSED_LUMINANCE_ALPHA_ARB* = 0x000084EB - GL_COMPRESSED_INTENSITY_ARB* = 0x000084EC - GL_COMPRESSED_RGB_ARB* = 0x000084ED - GL_COMPRESSED_RGBA_ARB* = 0x000084EE - GL_TEXTURE_COMPRESSION_HINT_ARB* = 0x000084EF - GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB* = 0x000086A0 - GL_TEXTURE_COMPRESSED_ARB* = 0x000086A1 - GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB* = 0x000086A2 - GL_COMPRESSED_TEXTURE_FORMATS_ARB* = 0x000086A3 # GL_ARB_texture_cube_map - GL_NORMAL_MAP_ARB* = 0x00008511 - GL_REFLECTION_MAP_ARB* = 0x00008512 - GL_TEXTURE_CUBE_MAP_ARB* = 0x00008513 - GL_TEXTURE_BINDING_CUBE_MAP_ARB* = 0x00008514 - GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB* = 0x00008515 - GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB* = 0x00008516 - GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB* = 0x00008517 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB* = 0x00008518 - GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB* = 0x00008519 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB* = 0x0000851A - GL_PROXY_TEXTURE_CUBE_MAP_ARB* = 0x0000851B - GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB* = 0x0000851C # GL_ARB_texture_env_combine - GL_COMBINE_ARB* = 0x00008570 - GL_COMBINE_RGB_ARB* = 0x00008571 - GL_COMBINE_ALPHA_ARB* = 0x00008572 - GL_SOURCE0_RGB_ARB* = 0x00008580 - GL_SOURCE1_RGB_ARB* = 0x00008581 - GL_SOURCE2_RGB_ARB* = 0x00008582 - GL_SOURCE0_ALPHA_ARB* = 0x00008588 - GL_SOURCE1_ALPHA_ARB* = 0x00008589 - GL_SOURCE2_ALPHA_ARB* = 0x0000858A - GL_OPERAND0_RGB_ARB* = 0x00008590 - GL_OPERAND1_RGB_ARB* = 0x00008591 - GL_OPERAND2_RGB_ARB* = 0x00008592 - GL_OPERAND0_ALPHA_ARB* = 0x00008598 - GL_OPERAND1_ALPHA_ARB* = 0x00008599 - GL_OPERAND2_ALPHA_ARB* = 0x0000859A - GL_RGB_SCALE_ARB* = 0x00008573 - GL_ADD_SIGNED_ARB* = 0x00008574 - GL_INTERPOLATE_ARB* = 0x00008575 - GL_SUBTRACT_ARB* = 0x000084E7 - GL_CONSTANT_ARB* = 0x00008576 - GL_PRIMARY_COLOR_ARB* = 0x00008577 - GL_PREVIOUS_ARB* = 0x00008578 # GL_ARB_texture_env_dot3 - GL_DOT3_RGB_ARB* = 0x000086AE - GL_DOT3_RGBA_ARB* = 0x000086AF # GL_ARB_texture_mirrored_repeat - GL_MIRRORED_REPEAT_ARB* = 0x00008370 # GL_ARB_transpose_matrix - GL_TRANSPOSE_MODELVIEW_MATRIX_ARB* = 0x000084E3 - GL_TRANSPOSE_PROJECTION_MATRIX_ARB* = 0x000084E4 - GL_TRANSPOSE_TEXTURE_MATRIX_ARB* = 0x000084E5 - GL_TRANSPOSE_COLOR_MATRIX_ARB* = 0x000084E6 # GL_ARB_vertex_blend - GL_MAX_VERTEX_UNITS_ARB* = 0x000086A4 - GL_ACTIVE_VERTEX_UNITS_ARB* = 0x000086A5 - GL_WEIGHT_SUM_UNITY_ARB* = 0x000086A6 - cGL_VERTEX_BLEND_ARB* = 0x000086A7 - GL_CURRENT_WEIGHT_ARB* = 0x000086A8 - GL_WEIGHT_ARRAYtyp_ARB* = 0x000086A9 - GL_WEIGHT_ARRAY_STRIDE_ARB* = 0x000086AA - GL_WEIGHT_ARRAY_SIZE_ARB* = 0x000086AB - GL_WEIGHT_ARRAY_POINTER_ARB* = 0x000086AC - GL_WEIGHT_ARRAY_ARB* = 0x000086AD - GL_MODELVIEW0_ARB* = 0x00001700 - GL_MODELVIEW1_ARB* = 0x0000850A - GL_MODELVIEW2_ARB* = 0x00008722 - GL_MODELVIEW3_ARB* = 0x00008723 - GL_MODELVIEW4_ARB* = 0x00008724 - GL_MODELVIEW5_ARB* = 0x00008725 - GL_MODELVIEW6_ARB* = 0x00008726 - GL_MODELVIEW7_ARB* = 0x00008727 - GL_MODELVIEW8_ARB* = 0x00008728 - GL_MODELVIEW9_ARB* = 0x00008729 - GL_MODELVIEW10_ARB* = 0x0000872A - GL_MODELVIEW11_ARB* = 0x0000872B - GL_MODELVIEW12_ARB* = 0x0000872C - GL_MODELVIEW13_ARB* = 0x0000872D - GL_MODELVIEW14_ARB* = 0x0000872E - GL_MODELVIEW15_ARB* = 0x0000872F - GL_MODELVIEW16_ARB* = 0x00008730 - GL_MODELVIEW17_ARB* = 0x00008731 - GL_MODELVIEW18_ARB* = 0x00008732 - GL_MODELVIEW19_ARB* = 0x00008733 - GL_MODELVIEW20_ARB* = 0x00008734 - GL_MODELVIEW21_ARB* = 0x00008735 - GL_MODELVIEW22_ARB* = 0x00008736 - GL_MODELVIEW23_ARB* = 0x00008737 - GL_MODELVIEW24_ARB* = 0x00008738 - GL_MODELVIEW25_ARB* = 0x00008739 - GL_MODELVIEW26_ARB* = 0x0000873A - GL_MODELVIEW27_ARB* = 0x0000873B - GL_MODELVIEW28_ARB* = 0x0000873C - GL_MODELVIEW29_ARB* = 0x0000873D - GL_MODELVIEW30_ARB* = 0x0000873E - GL_MODELVIEW31_ARB* = 0x0000873F # GL_ARB_vertex_buffer_object - GL_BUFFER_SIZE_ARB* = 0x00008764 - GL_BUFFER_USAGE_ARB* = 0x00008765 - GL_ARRAY_BUFFER_ARB* = 0x00008892 - GL_ELEMENT_ARRAY_BUFFER_ARB* = 0x00008893 - GL_ARRAY_BUFFER_BINDING_ARB* = 0x00008894 - GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB* = 0x00008895 - GL_VERTEX_ARRAY_BUFFER_BINDING_ARB* = 0x00008896 - GL_NORMAL_ARRAY_BUFFER_BINDING_ARB* = 0x00008897 - GL_COLOR_ARRAY_BUFFER_BINDING_ARB* = 0x00008898 - GL_INDEX_ARRAY_BUFFER_BINDING_ARB* = 0x00008899 - GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB* = 0x0000889A - GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB* = 0x0000889B - GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB* = 0x0000889C - GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB* = 0x0000889D - GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB* = 0x0000889E - GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB* = 0x0000889F - GL_READ_ONLY_ARB* = 0x000088B8 - GL_WRITE_ONLY_ARB* = 0x000088B9 - GL_READ_WRITE_ARB* = 0x000088BA - GL_BUFFER_ACCESS_ARB* = 0x000088BB - GL_BUFFER_MAPPED_ARB* = 0x000088BC - GL_BUFFER_MAP_POINTER_ARB* = 0x000088BD - GL_STREAM_DRAW_ARB* = 0x000088E0 - GL_STREAM_READ_ARB* = 0x000088E1 - GL_STREAM_COPY_ARB* = 0x000088E2 - GL_STATIC_DRAW_ARB* = 0x000088E4 - GL_STATIC_READ_ARB* = 0x000088E5 - GL_STATIC_COPY_ARB* = 0x000088E6 - GL_DYNAMIC_DRAW_ARB* = 0x000088E8 - GL_DYNAMIC_READ_ARB* = 0x000088E9 - GL_DYNAMIC_COPY_ARB* = 0x000088EA # GL_ARB_vertex_program - GL_COLOR_SUM_ARB* = 0x00008458 - GL_VERTEX_PROGRAM_ARB* = 0x00008620 - GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB* = 0x00008622 - GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB* = 0x00008623 - GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB* = 0x00008624 - GL_VERTEX_ATTRIB_ARRAYtyp_ARB* = 0x00008625 - GL_CURRENT_VERTEX_ATTRIB_ARB* = 0x00008626 - GL_PROGRAM_LENGTH_ARB* = 0x00008627 - cGL_PROGRAM_STRING_ARB* = 0x00008628 - GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB* = 0x0000862E - GL_MAX_PROGRAM_MATRICES_ARB* = 0x0000862F - GL_CURRENT_MATRIX_STACK_DEPTH_ARB* = 0x00008640 - GL_CURRENT_MATRIX_ARB* = 0x00008641 - GL_VERTEX_PROGRAM_POINT_SIZE_ARB* = 0x00008642 - GL_VERTEX_PROGRAM_TWO_SIDE_ARB* = 0x00008643 - GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB* = 0x00008645 - GL_PROGRAM_ERROR_POSITION_ARB* = 0x0000864B - GL_PROGRAM_BINDING_ARB* = 0x00008677 - GL_MAX_VERTEX_ATTRIBS_ARB* = 0x00008869 - GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB* = 0x0000886A - GL_PROGRAM_ERROR_STRING_ARB* = 0x00008874 - GL_PROGRAM_FORMAT_ASCII_ARB* = 0x00008875 - GL_PROGRAM_FORMAT_ARB* = 0x00008876 - GL_PROGRAM_INSTRUCTIONS_ARB* = 0x000088A0 - GL_MAX_PROGRAM_INSTRUCTIONS_ARB* = 0x000088A1 - GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB* = 0x000088A2 - GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB* = 0x000088A3 - GL_PROGRAM_TEMPORARIES_ARB* = 0x000088A4 - GL_MAX_PROGRAM_TEMPORARIES_ARB* = 0x000088A5 - GL_PROGRAM_NATIVE_TEMPORARIES_ARB* = 0x000088A6 - GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB* = 0x000088A7 - GL_PROGRAM_PARAMETERS_ARB* = 0x000088A8 - GL_MAX_PROGRAM_PARAMETERS_ARB* = 0x000088A9 - GL_PROGRAM_NATIVE_PARAMETERS_ARB* = 0x000088AA - GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB* = 0x000088AB - GL_PROGRAM_ATTRIBS_ARB* = 0x000088AC - GL_MAX_PROGRAM_ATTRIBS_ARB* = 0x000088AD - GL_PROGRAM_NATIVE_ATTRIBS_ARB* = 0x000088AE - GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB* = 0x000088AF - GL_PROGRAM_ADDRESS_REGISTERS_ARB* = 0x000088B0 - GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB* = 0x000088B1 - GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB* = 0x000088B2 - GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB* = 0x000088B3 - GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB* = 0x000088B4 - GL_MAX_PROGRAM_ENV_PARAMETERS_ARB* = 0x000088B5 - GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB* = 0x000088B6 - GL_TRANSPOSE_CURRENT_MATRIX_ARB* = 0x000088B7 - GL_MATRIX0_ARB* = 0x000088C0 - GL_MATRIX1_ARB* = 0x000088C1 - GL_MATRIX2_ARB* = 0x000088C2 - GL_MATRIX3_ARB* = 0x000088C3 - GL_MATRIX4_ARB* = 0x000088C4 - GL_MATRIX5_ARB* = 0x000088C5 - GL_MATRIX6_ARB* = 0x000088C6 - GL_MATRIX7_ARB* = 0x000088C7 - GL_MATRIX8_ARB* = 0x000088C8 - GL_MATRIX9_ARB* = 0x000088C9 - GL_MATRIX10_ARB* = 0x000088CA - GL_MATRIX11_ARB* = 0x000088CB - GL_MATRIX12_ARB* = 0x000088CC - GL_MATRIX13_ARB* = 0x000088CD - GL_MATRIX14_ARB* = 0x000088CE - GL_MATRIX15_ARB* = 0x000088CF - GL_MATRIX16_ARB* = 0x000088D0 - GL_MATRIX17_ARB* = 0x000088D1 - GL_MATRIX18_ARB* = 0x000088D2 - GL_MATRIX19_ARB* = 0x000088D3 - GL_MATRIX20_ARB* = 0x000088D4 - GL_MATRIX21_ARB* = 0x000088D5 - GL_MATRIX22_ARB* = 0x000088D6 - GL_MATRIX23_ARB* = 0x000088D7 - GL_MATRIX24_ARB* = 0x000088D8 - GL_MATRIX25_ARB* = 0x000088D9 - GL_MATRIX26_ARB* = 0x000088DA - GL_MATRIX27_ARB* = 0x000088DB - GL_MATRIX28_ARB* = 0x000088DC - GL_MATRIX29_ARB* = 0x000088DD - GL_MATRIX30_ARB* = 0x000088DE - GL_MATRIX31_ARB* = 0x000088DF # GL_ARB_draw_buffers - GL_MAX_DRAW_BUFFERS_ARB* = 0x00008824 - GL_DRAW_BUFFER0_ARB* = 0x00008825 - GL_DRAW_BUFFER1_ARB* = 0x00008826 - GL_DRAW_BUFFER2_ARB* = 0x00008827 - GL_DRAW_BUFFER3_ARB* = 0x00008828 - GL_DRAW_BUFFER4_ARB* = 0x00008829 - GL_DRAW_BUFFER5_ARB* = 0x0000882A - GL_DRAW_BUFFER6_ARB* = 0x0000882B - GL_DRAW_BUFFER7_ARB* = 0x0000882C - GL_DRAW_BUFFER8_ARB* = 0x0000882D - GL_DRAW_BUFFER9_ARB* = 0x0000882E - GL_DRAW_BUFFER10_ARB* = 0x0000882F - GL_DRAW_BUFFER11_ARB* = 0x00008830 - GL_DRAW_BUFFER12_ARB* = 0x00008831 - GL_DRAW_BUFFER13_ARB* = 0x00008832 - GL_DRAW_BUFFER14_ARB* = 0x00008833 - GL_DRAW_BUFFER15_ARB* = 0x00008834 # GL_ARB_texture_rectangle - GL_TEXTURE_RECTANGLE_ARB* = 0x000084F5 - GL_TEXTURE_BINDING_RECTANGLE_ARB* = 0x000084F6 - GL_PROXY_TEXTURE_RECTANGLE_ARB* = 0x000084F7 - GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB* = 0x000084F8 # GL_ARB_color_buffer_float - GL_RGBA_FLOAT_MODE_ARB* = 0x00008820 - GL_CLAMP_VERTEX_COLOR_ARB* = 0x0000891A - GL_CLAMP_FRAGMENT_COLOR_ARB* = 0x0000891B - GL_CLAMP_READ_COLOR_ARB* = 0x0000891C - GL_FIXED_ONLY_ARB* = 0x0000891D - WGLtyp_RGBA_FLOAT_ARB* = 0x000021A0 - GLX_RGBA_FLOATtyp* = 0x000020B9 - GLX_RGBA_FLOAT_BIT* = 0x00000004 # GL_ARB_half_float_pixel - GL_HALF_FLOAT_ARB* = 0x0000140B # GL_ARB_texture_float - GL_TEXTURE_REDtyp_ARB* = 0x00008C10 - GL_TEXTURE_GREENtyp_ARB* = 0x00008C11 - GL_TEXTURE_BLUEtyp_ARB* = 0x00008C12 - GL_TEXTURE_ALPHAtyp_ARB* = 0x00008C13 - GL_TEXTURE_LUMINANCEtyp_ARB* = 0x00008C14 - GL_TEXTURE_INTENSITYtyp_ARB* = 0x00008C15 - GL_TEXTURE_DEPTHtyp_ARB* = 0x00008C16 - GL_UNSIGNED_NORMALIZED_ARB* = 0x00008C17 - GL_RGBA32F_ARB* = 0x00008814 - GL_RGB32F_ARB* = 0x00008815 - GL_ALPHA32F_ARB* = 0x00008816 - GL_INTENSITY32F_ARB* = 0x00008817 - GL_LUMINANCE32F_ARB* = 0x00008818 - GL_LUMINANCE_ALPHA32F_ARB* = 0x00008819 - GL_RGBA16F_ARB* = 0x0000881A - GL_RGB16F_ARB* = 0x0000881B - GL_ALPHA16F_ARB* = 0x0000881C - GL_INTENSITY16F_ARB* = 0x0000881D - GL_LUMINANCE16F_ARB* = 0x0000881E - GL_LUMINANCE_ALPHA16F_ARB* = 0x0000881F # GL_ARB_pixel_buffer_object - GL_PIXEL_PACK_BUFFER_ARB* = 0x000088EB - GL_PIXEL_UNPACK_BUFFER_ARB* = 0x000088EC - GL_PIXEL_PACK_BUFFER_BINDING_ARB* = 0x000088ED - GL_PIXEL_UNPACK_BUFFER_BINDING_ARB* = 0x000088EF # GL_ARB_depth_buffer_float - GL_DEPTH_COMPONENT32F* = 0x00008CAC - GL_DEPTH32F_STENCIL8* = 0x00008CAD - GL_FLOAT_32_UNSIGNED_INT_24_8_REV* = 0x00008DAD # GL_ARB_framebuffer_object - GL_INVALID_FRAMEBUFFER_OPERATION* = 0x00000506 - GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING* = 0x00008210 - GL_FRAMEBUFFER_ATTACHMENT_COMPONENTtyp* = 0x00008211 - GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE* = 0x00008212 - GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE* = 0x00008213 - GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE* = 0x00008214 - GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE* = 0x00008215 - GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE* = 0x00008216 - GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE* = 0x00008217 - GL_FRAMEBUFFER_DEFAULT* = 0x00008218 - GL_FRAMEBUFFER_UNDEFINED* = 0x00008219 - GL_DEPTH_STENCIL_ATTACHMENT* = 0x0000821A - GL_MAX_RENDERBUFFER_SIZE* = 0x000084E8 - GL_DEPTH_STENCIL* = 0x000084F9 - GL_UNSIGNED_INT_24_8* = 0x000084FA - GL_DEPTH24_STENCIL8* = 0x000088F0 - GL_TEXTURE_STENCIL_SIZE* = 0x000088F1 - GL_TEXTURE_REDtyp* = 0x00008C10 - GL_TEXTURE_GREENtyp* = 0x00008C11 - GL_TEXTURE_BLUEtyp* = 0x00008C12 - GL_TEXTURE_ALPHAtyp* = 0x00008C13 - GL_TEXTURE_DEPTHtyp* = 0x00008C16 - GL_UNSIGNED_NORMALIZED* = 0x00008C17 - GL_FRAMEBUFFER_BINDING* = 0x00008CA6 - GL_DRAW_FRAMEBUFFER_BINDING* = GL_FRAMEBUFFER_BINDING - GL_RENDERBUFFER_BINDING* = 0x00008CA7 - GL_READ_FRAMEBUFFER* = 0x00008CA8 - GL_DRAW_FRAMEBUFFER* = 0x00008CA9 - GL_READ_FRAMEBUFFER_BINDING* = 0x00008CAA - GL_RENDERBUFFER_SAMPLES* = 0x00008CAB - GL_FRAMEBUFFER_ATTACHMENT_OBJECTtyp* = 0x00008CD0 - GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME* = 0x00008CD1 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL* = 0x00008CD2 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE* = 0x00008CD3 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER* = 0x00008CD4 - GL_FRAMEBUFFER_COMPLETE* = 0x00008CD5 - GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT* = 0x00008CD6 - GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT* = 0x00008CD7 - GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER* = 0x00008CDB - GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER* = 0x00008CDC - GL_FRAMEBUFFER_UNSUPPORTED* = 0x00008CDD - GL_MAX_COLOR_ATTACHMENTS* = 0x00008CDF - GL_COLOR_ATTACHMENT0* = 0x00008CE0 - GL_COLOR_ATTACHMENT1* = 0x00008CE1 - GL_COLOR_ATTACHMENT2* = 0x00008CE2 - GL_COLOR_ATTACHMENT3* = 0x00008CE3 - GL_COLOR_ATTACHMENT4* = 0x00008CE4 - GL_COLOR_ATTACHMENT5* = 0x00008CE5 - GL_COLOR_ATTACHMENT6* = 0x00008CE6 - GL_COLOR_ATTACHMENT7* = 0x00008CE7 - GL_COLOR_ATTACHMENT8* = 0x00008CE8 - GL_COLOR_ATTACHMENT9* = 0x00008CE9 - GL_COLOR_ATTACHMENT10* = 0x00008CEA - GL_COLOR_ATTACHMENT11* = 0x00008CEB - GL_COLOR_ATTACHMENT12* = 0x00008CEC - GL_COLOR_ATTACHMENT13* = 0x00008CED - GL_COLOR_ATTACHMENT14* = 0x00008CEE - GL_COLOR_ATTACHMENT15* = 0x00008CEF - GL_DEPTH_ATTACHMENT* = 0x00008D00 - GL_STENCIL_ATTACHMENT* = 0x00008D20 - GL_FRAMEBUFFER* = 0x00008D40 - GL_RENDERBUFFER* = 0x00008D41 - GL_RENDERBUFFER_WIDTH* = 0x00008D42 - GL_RENDERBUFFER_HEIGHT* = 0x00008D43 - GL_RENDERBUFFER_INTERNAL_FORMAT* = 0x00008D44 - GL_STENCIL_INDEX1* = 0x00008D46 - GL_STENCIL_INDEX4* = 0x00008D47 - GL_STENCIL_INDEX8* = 0x00008D48 - GL_STENCIL_INDEX16* = 0x00008D49 - GL_RENDERBUFFER_RED_SIZE* = 0x00008D50 - GL_RENDERBUFFER_GREEN_SIZE* = 0x00008D51 - GL_RENDERBUFFER_BLUE_SIZE* = 0x00008D52 - GL_RENDERBUFFER_ALPHA_SIZE* = 0x00008D53 - GL_RENDERBUFFER_DEPTH_SIZE* = 0x00008D54 - GL_RENDERBUFFER_STENCIL_SIZE* = 0x00008D55 - GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE* = 0x00008D56 - GL_MAX_SAMPLES* = 0x00008D57 - GL_INDEX* = 0x00008222 - GL_TEXTURE_LUMINANCEtyp* = 0x00008C14 - GL_TEXTURE_INTENSITYtyp* = 0x00008C15 # GL_ARB_framebuffer_sRGB - GL_FRAMEBUFFER_SRGB* = 0x00008DB9 # GL_ARB_geometry_shader4 - GL_LINES_ADJACENCY_ARB* = 0x0000000A - GL_LINE_STRIP_ADJACENCY_ARB* = 0x0000000B - GL_TRIANGLES_ADJACENCY_ARB* = 0x0000000C - GL_TRIANGLE_STRIP_ADJACENCY_ARB* = 0x0000000D - GL_PROGRAM_POINT_SIZE_ARB* = 0x00008642 - GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB* = 0x00008C29 - GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB* = 0x00008DA7 - GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB* = 0x00008DA8 - GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB* = 0x00008DA9 - GL_GEOMETRY_SHADER_ARB* = 0x00008DD9 - GL_GEOMETRY_VERTICES_OUT_ARB* = 0x00008DDA - GL_GEOMETRY_INPUTtyp_ARB* = 0x00008DDB - GL_GEOMETRY_OUTPUTtyp_ARB* = 0x00008DDC - GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB* = 0x00008DDD - GL_MAX_VERTEX_VARYING_COMPONENTS_ARB* = 0x00008DDE - GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB* = 0x00008DDF - GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB* = 0x00008DE0 - GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB* = 0x00008DE1 # reuse - # GL_MAX_VARYING_COMPONENTS - # reuse - # GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER - # - # GL_ARB_half_float_vertex - GL_HALF_FLOAT* = 0x0000140B # GL_ARB_instanced_arrays - GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB* = 0x000088FE # GL_ARB_map_buffer_range - GL_MAP_READ_BIT* = 0x00000001 - GL_MAP_WRITE_BIT* = 0x00000002 - GL_MAP_INVALIDATE_RANGE_BIT* = 0x00000004 - GL_MAP_INVALIDATE_BUFFER_BIT* = 0x00000008 - GL_MAP_FLUSH_EXPLICIT_BIT* = 0x00000010 - GL_MAP_UNSYNCHRONIZED_BIT* = 0x00000020 # GL_ARB_texture_buffer_object - GL_TEXTURE_BUFFER_ARB* = 0x00008C2A - GL_MAX_TEXTURE_BUFFER_SIZE_ARB* = 0x00008C2B - GL_TEXTURE_BINDING_BUFFER_ARB* = 0x00008C2C - GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB* = 0x00008C2D - GL_TEXTURE_BUFFER_FORMAT_ARB* = 0x00008C2E # GL_ARB_texture_compression_rgtc - GL_COMPRESSED_RED_RGTC1* = 0x00008DBB - GL_COMPRESSED_SIGNED_RED_RGTC1* = 0x00008DBC - GL_COMPRESSED_RG_RGTC2* = 0x00008DBD - GL_COMPRESSED_SIGNED_RG_RGTC2* = 0x00008DBE # GL_ARB_texture_rg - GL_RG* = 0x00008227 - GL_RG_INTEGER* = 0x00008228 - GL_R8* = 0x00008229 - GL_R16* = 0x0000822A - GL_RG8* = 0x0000822B - GL_RG16* = 0x0000822C - GL_R16F* = 0x0000822D - GL_R32F* = 0x0000822E - GL_RG16F* = 0x0000822F - GL_RG32F* = 0x00008230 - GL_R8I* = 0x00008231 - GL_R8UI* = 0x00008232 - GL_R16I* = 0x00008233 - GL_R16UI* = 0x00008234 - GL_R32I* = 0x00008235 - GL_R32UI* = 0x00008236 - GL_RG8I* = 0x00008237 - GL_RG8UI* = 0x00008238 - GL_RG16I* = 0x00008239 - GL_RG16UI* = 0x0000823A - GL_RG32I* = 0x0000823B - GL_RG32UI* = 0x0000823C # GL_ARB_vertex_array_object - GL_VERTEX_ARRAY_BINDING* = 0x000085B5 # GL_ARB_uniform_buffer_object - GL_UNIFORM_BUFFER* = 0x00008A11 - GL_UNIFORM_BUFFER_BINDING* = 0x00008A28 - GL_UNIFORM_BUFFER_START* = 0x00008A29 - GL_UNIFORM_BUFFER_SIZE* = 0x00008A2A - GL_MAX_VERTEX_UNIFORM_BLOCKS* = 0x00008A2B - GL_MAX_GEOMETRY_UNIFORM_BLOCKS* = 0x00008A2C - GL_MAX_FRAGMENT_UNIFORM_BLOCKS* = 0x00008A2D - GL_MAX_COMBINED_UNIFORM_BLOCKS* = 0x00008A2E - GL_MAX_UNIFORM_BUFFER_BINDINGS* = 0x00008A2F - GL_MAX_UNIFORM_BLOCK_SIZE* = 0x00008A30 - GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS* = 0x00008A31 - GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS* = 0x00008A32 - GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS* = 0x00008A33 - GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT* = 0x00008A34 - GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH* = 0x00008A35 - GL_ACTIVE_UNIFORM_BLOCKS* = 0x00008A36 - GL_UNIFORMtyp* = 0x00008A37 - GL_UNIFORM_SIZE* = 0x00008A38 - GL_UNIFORM_NAME_LENGTH* = 0x00008A39 - GL_UNIFORM_BLOCK_INDEX* = 0x00008A3A - GL_UNIFORM_OFFSET* = 0x00008A3B - GL_UNIFORM_ARRAY_STRIDE* = 0x00008A3C - GL_UNIFORM_MATRIX_STRIDE* = 0x00008A3D - GL_UNIFORM_IS_ROW_MAJOR* = 0x00008A3E - cGL_UNIFORM_BLOCK_BINDING* = 0x00008A3F - GL_UNIFORM_BLOCK_DATA_SIZE* = 0x00008A40 - GL_UNIFORM_BLOCK_NAME_LENGTH* = 0x00008A41 - GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS* = 0x00008A42 - GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES* = 0x00008A43 - GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER* = 0x00008A44 - GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER* = 0x00008A45 - GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER* = 0x00008A46 - GL_INVALID_INDEX* = 0xFFFFFFFF # GL_ARB_compatibility - # ARB_compatibility just defines tokens from core 3.0 - # GL_ARB_copy_buffer - GL_COPY_READ_BUFFER* = 0x00008F36 - GL_COPY_WRITE_BUFFER* = 0x00008F37 # GL_ARB_depth_clamp - GL_DEPTH_CLAMP* = 0x0000864F # GL_ARB_provoking_vertex - GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION* = 0x00008E4C - GL_FIRST_VERTEX_CONVENTION* = 0x00008E4D - GL_LAST_VERTEX_CONVENTION* = 0x00008E4E - cGL_PROVOKING_VERTEX* = 0x00008E4F # GL_ARB_seamless_cube_map - GL_TEXTURE_CUBE_MAP_SEAMLESS* = 0x0000884F # GL_ARB_sync - GL_MAX_SERVER_WAIT_TIMEOUT* = 0x00009111 - GL_OBJECTtyp* = 0x00009112 - GL_SYNC_CONDITION* = 0x00009113 - GL_SYNC_STATUS* = 0x00009114 - GL_SYNC_FLAGS* = 0x00009115 - GL_SYNC_FENCE* = 0x00009116 - GL_SYNC_GPU_COMMANDS_COMPLETE* = 0x00009117 - GL_UNSIGNALED* = 0x00009118 - GL_SIGNALED* = 0x00009119 - GL_ALREADY_SIGNALED* = 0x0000911A - GL_TIMEOUT_EXPIRED* = 0x0000911B - GL_CONDITION_SATISFIED* = 0x0000911C - GL_WAIT_FAILED* = 0x0000911D - GL_SYNC_FLUSH_COMMANDS_BIT* = 0x00000001 - GL_TIMEOUT_IGNORED* = int64(- 1) # GL_ARB_texture_multisample - GL_SAMPLE_POSITION* = 0x00008E50 - GL_SAMPLE_MASK* = 0x00008E51 - GL_SAMPLE_MASK_VALUE* = 0x00008E52 - GL_MAX_SAMPLE_MASK_WORDS* = 0x00008E59 - GL_TEXTURE_2D_MULTISAMPLE* = 0x00009100 - GL_PROXY_TEXTURE_2D_MULTISAMPLE* = 0x00009101 - GL_TEXTURE_2D_MULTISAMPLE_ARRAY* = 0x00009102 - GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY* = 0x00009103 - GL_TEXTURE_BINDING_2D_MULTISAMPLE* = 0x00009104 - GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY* = 0x00009105 - GL_TEXTURE_SAMPLES* = 0x00009106 - GL_TEXTURE_FIXED_SAMPLE_LOCATIONS* = 0x00009107 - GL_SAMPLER_2D_MULTISAMPLE* = 0x00009108 - GL_INT_SAMPLER_2D_MULTISAMPLE* = 0x00009109 - GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE* = 0x0000910A - GL_SAMPLER_2D_MULTISAMPLE_ARRAY* = 0x0000910B - GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY* = 0x0000910C - GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY* = 0x0000910D - GL_MAX_COLOR_TEXTURE_SAMPLES* = 0x0000910E - GL_MAX_DEPTH_TEXTURE_SAMPLES* = 0x0000910F - GL_MAX_INTEGER_SAMPLES* = 0x00009110 # GL_ARB_vertex_array_bgra - # reuse GL_BGRA - # GL_ARB_sample_shading - GL_SAMPLE_SHADING_ARB* = 0x00008C36 - GL_MIN_SAMPLE_SHADING_VALUE_ARB* = 0x00008C37 # GL_ARB_texture_cube_map_array - GL_TEXTURE_CUBE_MAP_ARRAY_ARB* = 0x00009009 - GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB* = 0x0000900A - GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB* = 0x0000900B - GL_SAMPLER_CUBE_MAP_ARRAY_ARB* = 0x0000900C - GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB* = 0x0000900D - GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB* = 0x0000900E - GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB* = 0x0000900F # GL_ARB_texture_gather - GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB* = 0x00008E5E - GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB* = 0x00008E5F # - # GL_ARB_shading_language_include - GL_SHADER_INCLUDE_ARB* = 0x00008DAE - GL_NAMED_STRING_LENGTH_ARB* = 0x00008DE9 - GL_NAMED_STRINGtyp_ARB* = 0x00008DEA # GL_ARB_texture_compression_bptc - GL_COMPRESSED_RGBA_BPTC_UNORM_ARB* = 0x00008E8C - GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB* = 0x00008E8D - GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB* = 0x00008E8E - GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB* = 0x00008E8F # - # GL_ARB_blend_func_extended - GL_SRC1_COLOR* = 0x000088F9 # reuse GL_SRC1_ALPHA - GL_ONE_MINUS_SRC1_COLOR* = 0x000088FA - GL_ONE_MINUS_SRC1_ALPHA* = 0x000088FB - GL_MAX_DUAL_SOURCE_DRAW_BUFFERS* = 0x000088FC # GL_ARB_occlusion_query2 - GL_ANY_SAMPLES_PASSED* = 0x00008C2F # GL_ARB_sampler_objects - GL_SAMPLER_BINDING* = 0x00008919 # GL_ARB_texture_rgb10_a2ui - GL_RGB10_A2UI* = 0x0000906F # GL_ARB_texture_swizzle - GL_TEXTURE_SWIZZLE_R* = 0x00008E42 - GL_TEXTURE_SWIZZLE_G* = 0x00008E43 - GL_TEXTURE_SWIZZLE_B* = 0x00008E44 - GL_TEXTURE_SWIZZLE_A* = 0x00008E45 - GL_TEXTURE_SWIZZLE_RGBA* = 0x00008E46 # GL_ARB_timer_query - GL_TIME_ELAPSED* = 0x000088BF - GL_TIMESTAMP* = 0x00008E28 # GL_ARB_vertextyp_2_10_10_10_rev - # reuse GL_UNSIGNED_INT_2_10_10_10_REV - GL_INT_2_10_10_10_REV* = 0x00008D9F # GL_ARB_draw_indirect - GL_DRAW_INDIRECT_BUFFER* = 0x00008F3F - GL_DRAW_INDIRECT_BUFFER_BINDING* = 0x00008F43 # GL_ARB_gpu_shader5 - GL_GEOMETRY_SHADER_INVOCATIONS* = 0x0000887F - GL_MAX_GEOMETRY_SHADER_INVOCATIONS* = 0x00008E5A - GL_MIN_FRAGMENT_INTERPOLATION_OFFSET* = 0x00008E5B - GL_MAX_FRAGMENT_INTERPOLATION_OFFSET* = 0x00008E5C - GL_FRAGMENT_INTERPOLATION_OFFSET_BITS* = 0x00008E5D # reuse GL_MAX_VERTEX_STREAMS - # GL_ARB_gpu_shader_fp64 - # reuse GL_DOUBLE - GL_DOUBLE_VEC2* = 0x00008FFC - GL_DOUBLE_VEC3* = 0x00008FFD - GL_DOUBLE_VEC4* = 0x00008FFE - GL_DOUBLE_MAT2* = 0x00008F46 - GL_DOUBLE_MAT3* = 0x00008F47 - GL_DOUBLE_MAT4* = 0x00008F48 - GL_DOUBLE_MAT2x3* = 0x00008F49 - GL_DOUBLE_MAT2x4* = 0x00008F4A - GL_DOUBLE_MAT3x2* = 0x00008F4B - GL_DOUBLE_MAT3x4* = 0x00008F4C - GL_DOUBLE_MAT4x2* = 0x00008F4D - GL_DOUBLE_MAT4x3* = 0x00008F4E # GL_ARB_shader_subroutine - GL_ACTIVE_SUBROUTINES* = 0x00008DE5 - GL_ACTIVE_SUBROUTINE_UNIFORMS* = 0x00008DE6 - GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS* = 0x00008E47 - GL_ACTIVE_SUBROUTINE_MAX_LENGTH* = 0x00008E48 - GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH* = 0x00008E49 - GL_MAX_SUBROUTINES* = 0x00008DE7 - GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS* = 0x00008DE8 - GL_NUM_COMPATIBLE_SUBROUTINES* = 0x00008E4A - GL_COMPATIBLE_SUBROUTINES* = 0x00008E4B # GL_ARB_tessellation_shader - GL_PATCHES* = 0x0000000E - GL_PATCH_VERTICES* = 0x00008E72 - GL_PATCH_DEFAULT_INNER_LEVEL* = 0x00008E73 - GL_PATCH_DEFAULT_OUTER_LEVEL* = 0x00008E74 - GL_TESS_CONTROL_OUTPUT_VERTICES* = 0x00008E75 - GL_TESS_GEN_MODE* = 0x00008E76 - GL_TESS_GEN_SPACING* = 0x00008E77 - GL_TESS_GEN_VERTEX_ORDER* = 0x00008E78 - GL_TESS_GEN_POINT_MODE* = 0x00008E79 - GL_ISOLINES* = 0x00008E7A # reuse GL_EQUAL - GL_FRACTIONAL_ODD* = 0x00008E7B - GL_FRACTIONAL_EVEN* = 0x00008E7C - GL_MAX_PATCH_VERTICES* = 0x00008E7D - GL_MAX_TESS_GEN_LEVEL* = 0x00008E7E - GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS* = 0x00008E7F - GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS* = 0x00008E80 - GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS* = 0x00008E81 - GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS* = 0x00008E82 - GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS* = 0x00008E83 - GL_MAX_TESS_PATCH_COMPONENTS* = 0x00008E84 - GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS* = 0x00008E85 - GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS* = 0x00008E86 - GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS* = 0x00008E89 - GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS* = 0x00008E8A - GL_MAX_TESS_CONTROL_INPUT_COMPONENTS* = 0x0000886C - GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS* = 0x0000886D - GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS* = 0x00008E1E - GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS* = 0x00008E1F - GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER* = 0x000084F0 - GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER* = 0x000084F1 - GL_TESS_EVALUATION_SHADER* = 0x00008E87 - GL_TESS_CONTROL_SHADER* = 0x00008E88 # GL_ARB_texture_buffer_object_rgb32 - # GL_ARB_transform_feedback2 - GL_TRANSFORM_FEEDBACK* = 0x00008E22 - GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED* = 0x00008E23 - GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE* = 0x00008E24 - GL_TRANSFORM_FEEDBACK_BINDING* = 0x00008E25 # GL_ARB_transform_feedback3 - GL_MAX_TRANSFORM_FEEDBACK_BUFFERS* = 0x00008E70 - GL_MAX_VERTEX_STREAMS* = 0x00008E71 # GL_ARB_ES2_compatibility - GL_FIXED* = 0x0000140C - GL_IMPLEMENTATION_COLOR_READtyp* = 0x00008B9A - GL_IMPLEMENTATION_COLOR_READ_FORMAT* = 0x00008B9B - GL_LOW_FLOAT* = 0x00008DF0 - GL_MEDIUM_FLOAT* = 0x00008DF1 - GL_HIGH_FLOAT* = 0x00008DF2 - GL_LOW_INT* = 0x00008DF3 - GL_MEDIUM_INT* = 0x00008DF4 - GL_HIGH_INT* = 0x00008DF5 - GL_SHADER_COMPILER* = 0x00008DFA - GL_NUM_SHADER_BINARY_FORMATS* = 0x00008DF9 - GL_MAX_VERTEX_UNIFORM_VECTORS* = 0x00008DFB - GL_MAX_VARYING_VECTORS* = 0x00008DFC - GL_MAX_FRAGMENT_UNIFORM_VECTORS* = 0x00008DFD # GL_ARB_get_program_binary - GL_PROGRAM_BINARY_RETRIEVABLE_HINT* = 0x00008257 - GL_PROGRAM_BINARY_LENGTH* = 0x00008741 - GL_NUM_PROGRAM_BINARY_FORMATS* = 0x000087FE - GL_PROGRAM_BINARY_FORMATS* = 0x000087FF # GL_ARB_separate_shader_objects - GL_VERTEX_SHADER_BIT* = 0x00000001 - GL_FRAGMENT_SHADER_BIT* = 0x00000002 - GL_GEOMETRY_SHADER_BIT* = 0x00000004 - GL_TESS_CONTROL_SHADER_BIT* = 0x00000008 - GL_TESS_EVALUATION_SHADER_BIT* = 0x00000010 - GL_ALL_SHADER_BITS* = 0xFFFFFFFF - GL_PROGRAM_SEPARABLE* = 0x00008258 - GL_ACTIVE_PROGRAM* = 0x00008259 - GL_PROGRAM_PIPELINE_BINDING* = 0x0000825A # GL_ARB_vertex_attrib_64bit - GL_MAX_VIEWPORTS* = 0x0000825B - GL_VIEWPORT_SUBPIXEL_BITS* = 0x0000825C - GL_VIEWPORT_BOUNDS_RANGE* = 0x0000825D - GL_LAYER_PROVOKING_VERTEX* = 0x0000825E - GL_VIEWPORT_INDEX_PROVOKING_VERTEX* = 0x0000825F - GL_UNDEFINED_VERTEX* = 0x00008260 # GL_ARB_cl_event - GL_SYNC_CL_EVENT_ARB* = 0x00008240 - GL_SYNC_CL_EVENT_COMPLETE_ARB* = 0x00008241 # GL_ARB_debug_output - GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB* = 0x00008242 - GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB* = 0x00008243 - GL_DEBUG_CALLBACK_FUNCTION_ARB* = 0x00008244 - GL_DEBUG_CALLBACK_USER_PARAM_ARB* = 0x00008245 - GL_DEBUG_SOURCE_API_ARB* = 0x00008246 - GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB* = 0x00008247 - GL_DEBUG_SOURCE_SHADER_COMPILER_ARB* = 0x00008248 - GL_DEBUG_SOURCE_THIRD_PARTY_ARB* = 0x00008249 - GL_DEBUG_SOURCE_APPLICATION_ARB* = 0x0000824A - GL_DEBUG_SOURCE_OTHER_ARB* = 0x0000824B - GL_DEBUGtyp_ERROR_ARB* = 0x0000824C - GL_DEBUGtyp_DEPRECATED_BEHAVIOR_ARB* = 0x0000824D - GL_DEBUGtyp_UNDEFINED_BEHAVIOR_ARB* = 0x0000824E - GL_DEBUGtyp_PORTABILITY_ARB* = 0x0000824F - GL_DEBUGtyp_PERFORMANCE_ARB* = 0x00008250 - GL_DEBUGtyp_OTHER_ARB* = 0x00008251 - GL_MAX_DEBUG_MESSAGE_LENGTH_ARB* = 0x00009143 - GL_MAX_DEBUG_LOGGED_MESSAGES_ARB* = 0x00009144 - GL_DEBUG_LOGGED_MESSAGES_ARB* = 0x00009145 - GL_DEBUG_SEVERITY_HIGH_ARB* = 0x00009146 - GL_DEBUG_SEVERITY_MEDIUM_ARB* = 0x00009147 - GL_DEBUG_SEVERITY_LOW_ARB* = 0x00009148 # GL_ARB_robustness - # reuse GL_NO_ERROR - GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB* = 0x00000004 - GL_LOSE_CONTEXT_ON_RESET_ARB* = 0x00008252 - GL_GUILTY_CONTEXT_RESET_ARB* = 0x00008253 - GL_INNOCENT_CONTEXT_RESET_ARB* = 0x00008254 - GL_UNKNOWN_CONTEXT_RESET_ARB* = 0x00008255 - GL_RESET_NOTIFICATION_STRATEGY_ARB* = 0x00008256 - GL_NO_RESET_NOTIFICATION_ARB* = 0x00008261 # - # GL_ARB_compressed_texture_pixel_storage - GL_UNPACK_COMPRESSED_BLOCK_WIDTH* = 0x00009127 - GL_UNPACK_COMPRESSED_BLOCK_HEIGHT* = 0x00009128 - GL_UNPACK_COMPRESSED_BLOCK_DEPTH* = 0x00009129 - GL_UNPACK_COMPRESSED_BLOCK_SIZE* = 0x0000912A - GL_PACK_COMPRESSED_BLOCK_WIDTH* = 0x0000912B - GL_PACK_COMPRESSED_BLOCK_HEIGHT* = 0x0000912C - GL_PACK_COMPRESSED_BLOCK_DEPTH* = 0x0000912D - GL_PACK_COMPRESSED_BLOCK_SIZE* = 0x0000912E # GL_ARB_internalformat_query - GL_NUM_SAMPLE_COUNTS* = 0x00009380 # GL_ARB_map_buffer_alignment - GL_MIN_MAP_BUFFER_ALIGNMENT* = 0x000090BC # GL_ARB_shader_atomic_counters - GL_ATOMIC_COUNTER_BUFFER* = 0x000092C0 - GL_ATOMIC_COUNTER_BUFFER_BINDING* = 0x000092C1 - GL_ATOMIC_COUNTER_BUFFER_START* = 0x000092C2 - GL_ATOMIC_COUNTER_BUFFER_SIZE* = 0x000092C3 - GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE* = 0x000092C4 - GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS* = 0x000092C5 - GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES* = 0x000092C6 - GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER* = 0x000092C7 - GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER* = 0x000092C8 - GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER* = 0x000092C9 - GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER* = 0x000092CA - GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER* = 0x000092CB - GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS* = 0x000092CC - GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS* = 0x000092CD - GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS* = 0x000092CE - GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS* = 0x000092CF - GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS* = 0x000092D0 - GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS* = 0x000092D1 - GL_MAX_VERTEX_ATOMIC_COUNTERS* = 0x000092D2 - GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS* = 0x000092D3 - GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS* = 0x000092D4 - GL_MAX_GEOMETRY_ATOMIC_COUNTERS* = 0x000092D5 - GL_MAX_FRAGMENT_ATOMIC_COUNTERS* = 0x000092D6 - GL_MAX_COMBINED_ATOMIC_COUNTERS* = 0x000092D7 - GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE* = 0x000092D8 - GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS* = 0x000092DC - GL_ACTIVE_ATOMIC_COUNTER_BUFFERS* = 0x000092D9 - GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX* = 0x000092DA - GL_UNSIGNED_INT_ATOMIC_COUNTER* = 0x000092DB # GL_ARB_shader_image_load_store - GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT* = 0x00000001 - GL_ELEMENT_ARRAY_BARRIER_BIT* = 0x00000002 - GL_UNIFORM_BARRIER_BIT* = 0x00000004 - GL_TEXTURE_FETCH_BARRIER_BIT* = 0x00000008 - GL_SHADER_IMAGE_ACCESS_BARRIER_BIT* = 0x00000020 - GL_COMMAND_BARRIER_BIT* = 0x00000040 - GL_PIXEL_BUFFER_BARRIER_BIT* = 0x00000080 - GL_TEXTURE_UPDATE_BARRIER_BIT* = 0x00000100 - GL_BUFFER_UPDATE_BARRIER_BIT* = 0x00000200 - GL_FRAMEBUFFER_BARRIER_BIT* = 0x00000400 - GL_TRANSFORM_FEEDBACK_BARRIER_BIT* = 0x00000800 - GL_ATOMIC_COUNTER_BARRIER_BIT* = 0x00001000 - GL_ALL_BARRIER_BITS* = 0xFFFFFFFF - GL_MAX_IMAGE_UNITS* = 0x00008F38 - GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS* = 0x00008F39 - GL_IMAGE_BINDING_NAME* = 0x00008F3A - GL_IMAGE_BINDING_LEVEL* = 0x00008F3B - GL_IMAGE_BINDING_LAYERED* = 0x00008F3C - GL_IMAGE_BINDING_LAYER* = 0x00008F3D - GL_IMAGE_BINDING_ACCESS* = 0x00008F3E - GL_IMAGE_1D* = 0x0000904C - GL_IMAGE_2D* = 0x0000904D - GL_IMAGE_3D* = 0x0000904E - GL_IMAGE_2D_RECT* = 0x0000904F - GL_IMAGE_CUBE* = 0x00009050 - GL_IMAGE_BUFFER* = 0x00009051 - GL_IMAGE_1D_ARRAY* = 0x00009052 - GL_IMAGE_2D_ARRAY* = 0x00009053 - GL_IMAGE_CUBE_MAP_ARRAY* = 0x00009054 - GL_IMAGE_2D_MULTISAMPLE* = 0x00009055 - GL_IMAGE_2D_MULTISAMPLE_ARRAY* = 0x00009056 - GL_INT_IMAGE_1D* = 0x00009057 - GL_INT_IMAGE_2D* = 0x00009058 - GL_INT_IMAGE_3D* = 0x00009059 - GL_INT_IMAGE_2D_RECT* = 0x0000905A - GL_INT_IMAGE_CUBE* = 0x0000905B - GL_INT_IMAGE_BUFFER* = 0x0000905C - GL_INT_IMAGE_1D_ARRAY* = 0x0000905D - GL_INT_IMAGE_2D_ARRAY* = 0x0000905E - GL_INT_IMAGE_CUBE_MAP_ARRAY* = 0x0000905F - GL_INT_IMAGE_2D_MULTISAMPLE* = 0x00009060 - GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY* = 0x00009061 - GL_UNSIGNED_INT_IMAGE_1D* = 0x00009062 - GL_UNSIGNED_INT_IMAGE_2D* = 0x00009063 - GL_UNSIGNED_INT_IMAGE_3D* = 0x00009064 - GL_UNSIGNED_INT_IMAGE_2D_RECT* = 0x00009065 - GL_UNSIGNED_INT_IMAGE_CUBE* = 0x00009066 - GL_UNSIGNED_INT_IMAGE_BUFFER* = 0x00009067 - GL_UNSIGNED_INT_IMAGE_1D_ARRAY* = 0x00009068 - GL_UNSIGNED_INT_IMAGE_2D_ARRAY* = 0x00009069 - GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY* = 0x0000906A - GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE* = 0x0000906B - GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY* = 0x0000906C - GL_MAX_IMAGE_SAMPLES* = 0x0000906D - GL_IMAGE_BINDING_FORMAT* = 0x0000906E - GL_IMAGE_FORMAT_COMPATIBILITYtyp* = 0x000090C7 - GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE* = 0x000090C8 - GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS* = 0x000090C9 - GL_MAX_VERTEX_IMAGE_UNIFORMS* = 0x000090CA - GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS* = 0x000090CB - GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS* = 0x000090CC - GL_MAX_GEOMETRY_IMAGE_UNIFORMS* = 0x000090CD - GL_MAX_FRAGMENT_IMAGE_UNIFORMS* = 0x000090CE - GL_MAX_COMBINED_IMAGE_UNIFORMS* = 0x000090CF # GL_ARB_texture_storage - GL_TEXTURE_IMMUTABLE_FORMAT* = 0x0000912F # GL_ATI_draw_buffers - GL_MAX_DRAW_BUFFERS_ATI* = 0x00008824 - GL_DRAW_BUFFER0_ATI* = 0x00008825 - GL_DRAW_BUFFER1_ATI* = 0x00008826 - GL_DRAW_BUFFER2_ATI* = 0x00008827 - GL_DRAW_BUFFER3_ATI* = 0x00008828 - GL_DRAW_BUFFER4_ATI* = 0x00008829 - GL_DRAW_BUFFER5_ATI* = 0x0000882A - GL_DRAW_BUFFER6_ATI* = 0x0000882B - GL_DRAW_BUFFER7_ATI* = 0x0000882C - GL_DRAW_BUFFER8_ATI* = 0x0000882D - GL_DRAW_BUFFER9_ATI* = 0x0000882E - GL_DRAW_BUFFER10_ATI* = 0x0000882F - GL_DRAW_BUFFER11_ATI* = 0x00008830 - GL_DRAW_BUFFER12_ATI* = 0x00008831 - GL_DRAW_BUFFER13_ATI* = 0x00008832 - GL_DRAW_BUFFER14_ATI* = 0x00008833 - GL_DRAW_BUFFER15_ATI* = 0x00008834 # GL_ATI_element_array - GL_ELEMENT_ARRAY_ATI* = 0x00008768 - GL_ELEMENT_ARRAYtyp_ATI* = 0x00008769 - GL_ELEMENT_ARRAY_POINTER_ATI* = 0x0000876A # GL_ATI_envmap_bumpmap - GL_BUMP_ROT_MATRIX_ATI* = 0x00008775 - GL_BUMP_ROT_MATRIX_SIZE_ATI* = 0x00008776 - GL_BUMP_NUM_TEX_UNITS_ATI* = 0x00008777 - GL_BUMP_TEX_UNITS_ATI* = 0x00008778 - GL_DUDV_ATI* = 0x00008779 - GL_DU8DV8_ATI* = 0x0000877A - GL_BUMP_ENVMAP_ATI* = 0x0000877B - GL_BUMP_TARGET_ATI* = 0x0000877C # GL_ATI_fragment_shader - GL_FRAGMENT_SHADER_ATI* = 0x00008920 - GL_REG_0_ATI* = 0x00008921 - GL_REG_1_ATI* = 0x00008922 - GL_REG_2_ATI* = 0x00008923 - GL_REG_3_ATI* = 0x00008924 - GL_REG_4_ATI* = 0x00008925 - GL_REG_5_ATI* = 0x00008926 - GL_REG_6_ATI* = 0x00008927 - GL_REG_7_ATI* = 0x00008928 - GL_REG_8_ATI* = 0x00008929 - GL_REG_9_ATI* = 0x0000892A - GL_REG_10_ATI* = 0x0000892B - GL_REG_11_ATI* = 0x0000892C - GL_REG_12_ATI* = 0x0000892D - GL_REG_13_ATI* = 0x0000892E - GL_REG_14_ATI* = 0x0000892F - GL_REG_15_ATI* = 0x00008930 - GL_REG_16_ATI* = 0x00008931 - GL_REG_17_ATI* = 0x00008932 - GL_REG_18_ATI* = 0x00008933 - GL_REG_19_ATI* = 0x00008934 - GL_REG_20_ATI* = 0x00008935 - GL_REG_21_ATI* = 0x00008936 - GL_REG_22_ATI* = 0x00008937 - GL_REG_23_ATI* = 0x00008938 - GL_REG_24_ATI* = 0x00008939 - GL_REG_25_ATI* = 0x0000893A - GL_REG_26_ATI* = 0x0000893B - GL_REG_27_ATI* = 0x0000893C - GL_REG_28_ATI* = 0x0000893D - GL_REG_29_ATI* = 0x0000893E - GL_REG_30_ATI* = 0x0000893F - GL_REG_31_ATI* = 0x00008940 - GL_CON_0_ATI* = 0x00008941 - GL_CON_1_ATI* = 0x00008942 - GL_CON_2_ATI* = 0x00008943 - GL_CON_3_ATI* = 0x00008944 - GL_CON_4_ATI* = 0x00008945 - GL_CON_5_ATI* = 0x00008946 - GL_CON_6_ATI* = 0x00008947 - GL_CON_7_ATI* = 0x00008948 - GL_CON_8_ATI* = 0x00008949 - GL_CON_9_ATI* = 0x0000894A - GL_CON_10_ATI* = 0x0000894B - GL_CON_11_ATI* = 0x0000894C - GL_CON_12_ATI* = 0x0000894D - GL_CON_13_ATI* = 0x0000894E - GL_CON_14_ATI* = 0x0000894F - GL_CON_15_ATI* = 0x00008950 - GL_CON_16_ATI* = 0x00008951 - GL_CON_17_ATI* = 0x00008952 - GL_CON_18_ATI* = 0x00008953 - GL_CON_19_ATI* = 0x00008954 - GL_CON_20_ATI* = 0x00008955 - GL_CON_21_ATI* = 0x00008956 - GL_CON_22_ATI* = 0x00008957 - GL_CON_23_ATI* = 0x00008958 - GL_CON_24_ATI* = 0x00008959 - GL_CON_25_ATI* = 0x0000895A - GL_CON_26_ATI* = 0x0000895B - GL_CON_27_ATI* = 0x0000895C - GL_CON_28_ATI* = 0x0000895D - GL_CON_29_ATI* = 0x0000895E - GL_CON_30_ATI* = 0x0000895F - GL_CON_31_ATI* = 0x00008960 - GL_MOV_ATI* = 0x00008961 - GL_ADD_ATI* = 0x00008963 - GL_MUL_ATI* = 0x00008964 - GL_SUB_ATI* = 0x00008965 - GL_DOT3_ATI* = 0x00008966 - GL_DOT4_ATI* = 0x00008967 - GL_MAD_ATI* = 0x00008968 - GL_LERP_ATI* = 0x00008969 - GL_CND_ATI* = 0x0000896A - GL_CND0_ATI* = 0x0000896B - GL_DOT2_ADD_ATI* = 0x0000896C - GL_SECONDARY_INTERPOLATOR_ATI* = 0x0000896D - GL_NUM_FRAGMENT_REGISTERS_ATI* = 0x0000896E - GL_NUM_FRAGMENT_CONSTANTS_ATI* = 0x0000896F - GL_NUM_PASSES_ATI* = 0x00008970 - GL_NUM_INSTRUCTIONS_PER_PASS_ATI* = 0x00008971 - GL_NUM_INSTRUCTIONS_TOTAL_ATI* = 0x00008972 - GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI* = 0x00008973 - GL_NUM_LOOPBACK_COMPONENTS_ATI* = 0x00008974 - GL_COLOR_ALPHA_PAIRING_ATI* = 0x00008975 - GL_SWIZZLE_STR_ATI* = 0x00008976 - GL_SWIZZLE_STQ_ATI* = 0x00008977 - GL_SWIZZLE_STR_DR_ATI* = 0x00008978 - GL_SWIZZLE_STQ_DQ_ATI* = 0x00008979 - GL_SWIZZLE_STRQ_ATI* = 0x0000897A - GL_SWIZZLE_STRQ_DQ_ATI* = 0x0000897B - GL_RED_BIT_ATI* = 0x00000001 - GL_GREEN_BIT_ATI* = 0x00000002 - GL_BLUE_BIT_ATI* = 0x00000004 - GL_2X_BIT_ATI* = 0x00000001 - GL_4X_BIT_ATI* = 0x00000002 - GL_8X_BIT_ATI* = 0x00000004 - GL_HALF_BIT_ATI* = 0x00000008 - GL_QUARTER_BIT_ATI* = 0x00000010 - GL_EIGHTH_BIT_ATI* = 0x00000020 - GL_SATURATE_BIT_ATI* = 0x00000040 - GL_COMP_BIT_ATI* = 0x00000002 - GL_NEGATE_BIT_ATI* = 0x00000004 - GL_BIAS_BIT_ATI* = 0x00000008 # GL_ATI_pn_triangles - GL_PN_TRIANGLES_ATI* = 0x000087F0 - GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI* = 0x000087F1 - GL_PN_TRIANGLES_POINT_MODE_ATI* = 0x000087F2 - GL_PN_TRIANGLES_NORMAL_MODE_ATI* = 0x000087F3 - GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI* = 0x000087F4 - GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI* = 0x000087F5 - GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI* = 0x000087F6 - GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI* = 0x000087F7 - GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI* = 0x000087F8 # - # GL_ATI_separate_stencil - GL_STENCIL_BACK_FUNC_ATI* = 0x00008800 - GL_STENCIL_BACK_FAIL_ATI* = 0x00008801 - GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI* = 0x00008802 - GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI* = 0x00008803 # GL_ATI_text_fragment_shader - GL_TEXT_FRAGMENT_SHADER_ATI* = 0x00008200 # GL_ATI_texture_env_combine3 - GL_MODULATE_ADD_ATI* = 0x00008744 - GL_MODULATE_SIGNED_ADD_ATI* = 0x00008745 - GL_MODULATE_SUBTRACT_ATI* = 0x00008746 # GL_ATI_texture_float - GL_RGBA_FLOAT32_ATI* = 0x00008814 - GL_RGB_FLOAT32_ATI* = 0x00008815 - GL_ALPHA_FLOAT32_ATI* = 0x00008816 - GL_INTENSITY_FLOAT32_ATI* = 0x00008817 - GL_LUMINANCE_FLOAT32_ATI* = 0x00008818 - GL_LUMINANCE_ALPHA_FLOAT32_ATI* = 0x00008819 - GL_RGBA_FLOAT16_ATI* = 0x0000881A - GL_RGB_FLOAT16_ATI* = 0x0000881B - GL_ALPHA_FLOAT16_ATI* = 0x0000881C - GL_INTENSITY_FLOAT16_ATI* = 0x0000881D - GL_LUMINANCE_FLOAT16_ATI* = 0x0000881E - GL_LUMINANCE_ALPHA_FLOAT16_ATI* = 0x0000881F # GL_ATI_texture_mirror_once - GL_MIRROR_CLAMP_ATI* = 0x00008742 - GL_MIRROR_CLAMP_TO_EDGE_ATI* = 0x00008743 # GL_ATI_vertex_array_object - GL_STATIC_ATI* = 0x00008760 - GL_DYNAMIC_ATI* = 0x00008761 - GL_PRESERVE_ATI* = 0x00008762 - GL_DISCARD_ATI* = 0x00008763 - GL_OBJECT_BUFFER_SIZE_ATI* = 0x00008764 - GL_OBJECT_BUFFER_USAGE_ATI* = 0x00008765 - GL_ARRAY_OBJECT_BUFFER_ATI* = 0x00008766 - GL_ARRAY_OBJECT_OFFSET_ATI* = 0x00008767 # GL_ATI_vertex_streams - GL_MAX_VERTEX_STREAMS_ATI* = 0x0000876B - GL_VERTEX_STREAM0_ATI* = 0x0000876C - GL_VERTEX_STREAM1_ATI* = 0x0000876D - GL_VERTEX_STREAM2_ATI* = 0x0000876E - GL_VERTEX_STREAM3_ATI* = 0x0000876F - GL_VERTEX_STREAM4_ATI* = 0x00008770 - GL_VERTEX_STREAM5_ATI* = 0x00008771 - GL_VERTEX_STREAM6_ATI* = 0x00008772 - GL_VERTEX_STREAM7_ATI* = 0x00008773 - GL_VERTEX_SOURCE_ATI* = 0x00008774 # GL_ATI_meminfo - GL_VBO_FREE_MEMORY_ATI* = 0x000087FB - GL_TEXTURE_FREE_MEMORY_ATI* = 0x000087FC - GL_RENDERBUFFER_FREE_MEMORY_ATI* = 0x000087FD # GL_AMD_performance_monitor - GL_COUNTERtyp_AMD* = 0x00008BC0 - GL_COUNTER_RANGE_AMD* = 0x00008BC1 - GL_UNSIGNED_INT64_AMD* = 0x00008BC2 - GL_PERCENTAGE_AMD* = 0x00008BC3 - GL_PERFMON_RESULT_AVAILABLE_AMD* = 0x00008BC4 - GL_PERFMON_RESULT_SIZE_AMD* = 0x00008BC5 - GL_PERFMON_RESULT_AMD* = 0x00008BC6 # GL_AMD_vertex_shader_tesselator - GL_SAMPLER_BUFFER_AMD* = 0x00009001 - GL_INT_SAMPLER_BUFFER_AMD* = 0x00009002 - GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD* = 0x00009003 - cGL_TESSELLATION_MODE_AMD* = 0x00009004 - cGL_TESSELLATION_FACTOR_AMD* = 0x00009005 - GL_DISCRETE_AMD* = 0x00009006 - GL_CONTINUOUS_AMD* = 0x00009007 # GL_AMD_seamless_cubemap_per_texture - # reuse GL_TEXTURE_CUBE_MAP_SEAMLESS - # GL_AMD_name_gen_delete - GL_DATA_BUFFER_AMD* = 0x00009151 - GL_PERFORMANCE_MONITOR_AMD* = 0x00009152 - GL_QUERY_OBJECT_AMD* = 0x00009153 - GL_VERTEX_ARRAY_OBJECT_AMD* = 0x00009154 - GL_SAMPLER_OBJECT_AMD* = 0x00009155 # GL_AMD_debug_output - GL_MAX_DEBUG_LOGGED_MESSAGES_AMD* = 0x00009144 - GL_DEBUG_LOGGED_MESSAGES_AMD* = 0x00009145 - GL_DEBUG_SEVERITY_HIGH_AMD* = 0x00009146 - GL_DEBUG_SEVERITY_MEDIUM_AMD* = 0x00009147 - GL_DEBUG_SEVERITY_LOW_AMD* = 0x00009148 - GL_DEBUG_CATEGORY_API_ERROR_AMD* = 0x00009149 - GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD* = 0x0000914A - GL_DEBUG_CATEGORY_DEPRECATION_AMD* = 0x0000914B - GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD* = 0x0000914C - GL_DEBUG_CATEGORY_PERFORMANCE_AMD* = 0x0000914D - GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD* = 0x0000914E - GL_DEBUG_CATEGORY_APPLICATION_AMD* = 0x0000914F - GL_DEBUG_CATEGORY_OTHER_AMD* = 0x00009150 # GL_AMD_depth_clamp_separate - GL_DEPTH_CLAMP_NEAR_AMD* = 0x0000901E - GL_DEPTH_CLAMP_FAR_AMD* = 0x0000901F # GL_EXT_422_pixels - GL_422_EXT* = 0x000080CC - GL_422_REV_EXT* = 0x000080CD - GL_422_AVERAGE_EXT* = 0x000080CE - GL_422_REV_AVERAGE_EXT* = 0x000080CF # GL_EXT_abgr - GL_ABGR_EXT* = 0x00008000 # GL_EXT_bgra - GL_BGR_EXT* = 0x000080E0 - GL_BGRA_EXT* = 0x000080E1 # GL_EXT_blend_color - GL_CONSTANT_COLOR_EXT* = 0x00008001 - GL_ONE_MINUS_CONSTANT_COLOR_EXT* = 0x00008002 - GL_CONSTANT_ALPHA_EXT* = 0x00008003 - GL_ONE_MINUS_CONSTANT_ALPHA_EXT* = 0x00008004 - cGL_BLEND_COLOR_EXT* = 0x00008005 # GL_EXT_blend_func_separate - GL_BLEND_DST_RGB_EXT* = 0x000080C8 - GL_BLEND_SRC_RGB_EXT* = 0x000080C9 - GL_BLEND_DST_ALPHA_EXT* = 0x000080CA - GL_BLEND_SRC_ALPHA_EXT* = 0x000080CB # GL_EXT_blend_minmax - GL_FUNC_ADD_EXT* = 0x00008006 - GL_MIN_EXT* = 0x00008007 - GL_MAX_EXT* = 0x00008008 - cGL_BLEND_EQUATION_EXT* = 0x00008009 # GL_EXT_blend_subtract - GL_FUNC_SUBTRACT_EXT* = 0x0000800A - GL_FUNC_REVERSE_SUBTRACT_EXT* = 0x0000800B # GL_EXT_clip_volume_hint - GL_CLIP_VOLUME_CLIPPING_HINT_EXT* = 0x000080F0 # GL_EXT_cmyka - GL_CMYK_EXT* = 0x0000800C - GL_CMYKA_EXT* = 0x0000800D - GL_PACK_CMYK_HINT_EXT* = 0x0000800E - GL_UNPACK_CMYK_HINT_EXT* = 0x0000800F # GL_EXT_compiled_vertex_array - GL_ARRAY_ELEMENT_LOCK_FIRST_EXT* = 0x000081A8 - GL_ARRAY_ELEMENT_LOCK_COUNT_EXT* = 0x000081A9 # GL_EXT_convolution - GL_CONVOLUTION_1D_EXT* = 0x00008010 - GL_CONVOLUTION_2D_EXT* = 0x00008011 - GL_SEPARABLE_2D_EXT* = 0x00008012 - GL_CONVOLUTION_BORDER_MODE_EXT* = 0x00008013 - GL_CONVOLUTION_FILTER_SCALE_EXT* = 0x00008014 - GL_CONVOLUTION_FILTER_BIAS_EXT* = 0x00008015 - GL_REDUCE_EXT* = 0x00008016 - GL_CONVOLUTION_FORMAT_EXT* = 0x00008017 - GL_CONVOLUTION_WIDTH_EXT* = 0x00008018 - GL_CONVOLUTION_HEIGHT_EXT* = 0x00008019 - GL_MAX_CONVOLUTION_WIDTH_EXT* = 0x0000801A - GL_MAX_CONVOLUTION_HEIGHT_EXT* = 0x0000801B - GL_POST_CONVOLUTION_RED_SCALE_EXT* = 0x0000801C - GL_POST_CONVOLUTION_GREEN_SCALE_EXT* = 0x0000801D - GL_POST_CONVOLUTION_BLUE_SCALE_EXT* = 0x0000801E - GL_POST_CONVOLUTION_ALPHA_SCALE_EXT* = 0x0000801F - GL_POST_CONVOLUTION_RED_BIAS_EXT* = 0x00008020 - GL_POST_CONVOLUTION_GREEN_BIAS_EXT* = 0x00008021 - GL_POST_CONVOLUTION_BLUE_BIAS_EXT* = 0x00008022 - GL_POST_CONVOLUTION_ALPHA_BIAS_EXT* = 0x00008023 # GL_EXT_coordinate_frame - GL_TANGENT_ARRAY_EXT* = 0x00008439 - GL_BINORMAL_ARRAY_EXT* = 0x0000843A - GL_CURRENT_TANGENT_EXT* = 0x0000843B - GL_CURRENT_BINORMAL_EXT* = 0x0000843C - GL_TANGENT_ARRAYtyp_EXT* = 0x0000843E - GL_TANGENT_ARRAY_STRIDE_EXT* = 0x0000843F - GL_BINORMAL_ARRAYtyp_EXT* = 0x00008440 - GL_BINORMAL_ARRAY_STRIDE_EXT* = 0x00008441 - GL_TANGENT_ARRAY_POINTER_EXT* = 0x00008442 - GL_BINORMAL_ARRAY_POINTER_EXT* = 0x00008443 - GL_MAP1_TANGENT_EXT* = 0x00008444 - GL_MAP2_TANGENT_EXT* = 0x00008445 - GL_MAP1_BINORMAL_EXT* = 0x00008446 - GL_MAP2_BINORMAL_EXT* = 0x00008447 # GL_EXT_cull_vertex - GL_CULL_VERTEX_EXT* = 0x000081AA - GL_CULL_VERTEX_EYE_POSITION_EXT* = 0x000081AB - GL_CULL_VERTEX_OBJECT_POSITION_EXT* = 0x000081AC # GL_EXT_draw_range_elements - GL_MAX_ELEMENTS_VERTICES_EXT* = 0x000080E8 - GL_MAX_ELEMENTS_INDICES_EXT* = 0x000080E9 # GL_EXT_fog_coord - GL_FOG_COORDINATE_SOURCE_EXT* = 0x00008450 - GL_FOG_COORDINATE_EXT* = 0x00008451 - GL_FRAGMENT_DEPTH_EXT* = 0x00008452 - GL_CURRENT_FOG_COORDINATE_EXT* = 0x00008453 - GL_FOG_COORDINATE_ARRAYtyp_EXT* = 0x00008454 - GL_FOG_COORDINATE_ARRAY_STRIDE_EXT* = 0x00008455 - GL_FOG_COORDINATE_ARRAY_POINTER_EXT* = 0x00008456 - GL_FOG_COORDINATE_ARRAY_EXT* = 0x00008457 # GL_EXT_framebuffer_object - GL_FRAMEBUFFER_EXT* = 0x00008D40 - GL_RENDERBUFFER_EXT* = 0x00008D41 - GL_STENCIL_INDEX_EXT* = 0x00008D45 - GL_STENCIL_INDEX1_EXT* = 0x00008D46 - GL_STENCIL_INDEX4_EXT* = 0x00008D47 - GL_STENCIL_INDEX8_EXT* = 0x00008D48 - GL_STENCIL_INDEX16_EXT* = 0x00008D49 - GL_RENDERBUFFER_WIDTH_EXT* = 0x00008D42 - GL_RENDERBUFFER_HEIGHT_EXT* = 0x00008D43 - GL_RENDERBUFFER_INTERNAL_FORMAT_EXT* = 0x00008D44 - GL_FRAMEBUFFER_ATTACHMENT_OBJECTtyp_EXT* = 0x00008CD0 - GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT* = 0x00008CD1 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT* = 0x00008CD2 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT* = 0x00008CD3 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT* = 0x00008CD4 - GL_COLOR_ATTACHMENT0_EXT* = 0x00008CE0 - GL_COLOR_ATTACHMENT1_EXT* = 0x00008CE1 - GL_COLOR_ATTACHMENT2_EXT* = 0x00008CE2 - GL_COLOR_ATTACHMENT3_EXT* = 0x00008CE3 - GL_COLOR_ATTACHMENT4_EXT* = 0x00008CE4 - GL_COLOR_ATTACHMENT5_EXT* = 0x00008CE5 - GL_COLOR_ATTACHMENT6_EXT* = 0x00008CE6 - GL_COLOR_ATTACHMENT7_EXT* = 0x00008CE7 - GL_COLOR_ATTACHMENT8_EXT* = 0x00008CE8 - GL_COLOR_ATTACHMENT9_EXT* = 0x00008CE9 - GL_COLOR_ATTACHMENT10_EXT* = 0x00008CEA - GL_COLOR_ATTACHMENT11_EXT* = 0x00008CEB - GL_COLOR_ATTACHMENT12_EXT* = 0x00008CEC - GL_COLOR_ATTACHMENT13_EXT* = 0x00008CED - GL_COLOR_ATTACHMENT14_EXT* = 0x00008CEE - GL_COLOR_ATTACHMENT15_EXT* = 0x00008CEF - GL_DEPTH_ATTACHMENT_EXT* = 0x00008D00 - GL_STENCIL_ATTACHMENT_EXT* = 0x00008D20 - GL_FRAMEBUFFER_COMPLETE_EXT* = 0x00008CD5 - GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT* = 0x00008CD6 - GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT* = 0x00008CD7 - GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT* = 0x00008CD8 - GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT* = 0x00008CD9 - GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT* = 0x00008CDA - GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT* = 0x00008CDB - GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT* = 0x00008CDC - GL_FRAMEBUFFER_UNSUPPORTED_EXT* = 0x00008CDD - GL_FRAMEBUFFER_STATUS_ERROR_EXT* = 0x00008CDE - GL_FRAMEBUFFER_BINDING_EXT* = 0x00008CA6 - GL_RENDERBUFFER_BINDING_EXT* = 0x00008CA7 - GL_MAX_COLOR_ATTACHMENTS_EXT* = 0x00008CDF - GL_MAX_RENDERBUFFER_SIZE_EXT* = 0x000084E8 - GL_INVALID_FRAMEBUFFER_OPERATION_EXT* = 0x00000506 # GL_EXT_histogram - cGL_HISTOGRAM_EXT* = 0x00008024 - GL_PROXY_HISTOGRAM_EXT* = 0x00008025 - GL_HISTOGRAM_WIDTH_EXT* = 0x00008026 - GL_HISTOGRAM_FORMAT_EXT* = 0x00008027 - GL_HISTOGRAM_RED_SIZE_EXT* = 0x00008028 - GL_HISTOGRAM_GREEN_SIZE_EXT* = 0x00008029 - GL_HISTOGRAM_BLUE_SIZE_EXT* = 0x0000802A - GL_HISTOGRAM_ALPHA_SIZE_EXT* = 0x0000802B - GL_HISTOGRAM_LUMINANCE_SIZE_EXT* = 0x0000802C - GL_HISTOGRAM_SINK_EXT* = 0x0000802D - cGL_MINMAX_EXT* = 0x0000802E - GL_MINMAX_FORMAT_EXT* = 0x0000802F - GL_MINMAX_SINK_EXT* = 0x00008030 - GL_TABLE_TOO_LARGE_EXT* = 0x00008031 # GL_EXT_index_array_formats - GL_IUI_V2F_EXT* = 0x000081AD - GL_IUI_V3F_EXT* = 0x000081AE - GL_IUI_N3F_V2F_EXT* = 0x000081AF - GL_IUI_N3F_V3F_EXT* = 0x000081B0 - GL_T2F_IUI_V2F_EXT* = 0x000081B1 - GL_T2F_IUI_V3F_EXT* = 0x000081B2 - GL_T2F_IUI_N3F_V2F_EXT* = 0x000081B3 - GL_T2F_IUI_N3F_V3F_EXT* = 0x000081B4 # GL_EXT_index_func - GL_INDEX_TEST_EXT* = 0x000081B5 - GL_INDEX_TEST_FUNC_EXT* = 0x000081B6 - GL_INDEX_TEST_REF_EXT* = 0x000081B7 # GL_EXT_index_material - cGL_INDEX_MATERIAL_EXT* = 0x000081B8 - GL_INDEX_MATERIAL_PARAMETER_EXT* = 0x000081B9 - GL_INDEX_MATERIAL_FACE_EXT* = 0x000081BA # GL_EXT_light_texture - GL_FRAGMENT_MATERIAL_EXT* = 0x00008349 - GL_FRAGMENT_NORMAL_EXT* = 0x0000834A - GL_FRAGMENT_COLOR_EXT* = 0x0000834C - GL_ATTENUATION_EXT* = 0x0000834D - GL_SHADOW_ATTENUATION_EXT* = 0x0000834E - GL_TEXTURE_APPLICATION_MODE_EXT* = 0x0000834F - cGL_TEXTURE_LIGHT_EXT* = 0x00008350 - GL_TEXTURE_MATERIAL_FACE_EXT* = 0x00008351 - GL_TEXTURE_MATERIAL_PARAMETER_EXT* = 0x00008352 # GL_EXT_multisample - GL_MULTISAMPLE_EXT* = 0x0000809D - GL_SAMPLE_ALPHA_TO_MASK_EXT* = 0x0000809E - GL_SAMPLE_ALPHA_TO_ONE_EXT* = 0x0000809F - cGL_SAMPLE_MASK_EXT* = 0x000080A0 - GL_1PASS_EXT* = 0x000080A1 - GL_2PASS_0_EXT* = 0x000080A2 - GL_2PASS_1_EXT* = 0x000080A3 - GL_4PASS_0_EXT* = 0x000080A4 - GL_4PASS_1_EXT* = 0x000080A5 - GL_4PASS_2_EXT* = 0x000080A6 - GL_4PASS_3_EXT* = 0x000080A7 - GL_SAMPLE_BUFFERS_EXT* = 0x000080A8 - GL_SAMPLES_EXT* = 0x000080A9 - GL_SAMPLE_MASK_VALUE_EXT* = 0x000080AA - GL_SAMPLE_MASK_INVERT_EXT* = 0x000080AB - cGL_SAMPLE_PATTERN_EXT* = 0x000080AC - GL_MULTISAMPLE_BIT_EXT* = 0x20000000 # GL_EXT_packed_pixels - GL_UNSIGNED_BYTE_3_3_2_EXT* = 0x00008032 - GL_UNSIGNED_SHORT_4_4_4_4_EXT* = 0x00008033 - GL_UNSIGNED_SHORT_5_5_5_1_EXT* = 0x00008034 - GL_UNSIGNED_INT_8_8_8_8_EXT* = 0x00008035 - GL_UNSIGNED_INT_10_10_10_2_EXT* = 0x00008036 # GL_EXT_paletted_texture - GL_COLOR_INDEX1_EXT* = 0x000080E2 - GL_COLOR_INDEX2_EXT* = 0x000080E3 - GL_COLOR_INDEX4_EXT* = 0x000080E4 - GL_COLOR_INDEX8_EXT* = 0x000080E5 - GL_COLOR_INDEX12_EXT* = 0x000080E6 - GL_COLOR_INDEX16_EXT* = 0x000080E7 - GL_TEXTURE_INDEX_SIZE_EXT* = 0x000080ED # GL_EXT_pixel_transform - GL_PIXEL_TRANSFORM_2D_EXT* = 0x00008330 - GL_PIXEL_MAG_FILTER_EXT* = 0x00008331 - GL_PIXEL_MIN_FILTER_EXT* = 0x00008332 - GL_PIXEL_CUBIC_WEIGHT_EXT* = 0x00008333 - GL_CUBIC_EXT* = 0x00008334 - GL_AVERAGE_EXT* = 0x00008335 - GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT* = 0x00008336 - GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT* = 0x00008337 - GL_PIXEL_TRANSFORM_2D_MATRIX_EXT* = 0x00008338 # GL_EXT_point_parameters - GL_POINT_SIZE_MIN_EXT* = 0x00008126 - GL_POINT_SIZE_MAX_EXT* = 0x00008127 - GL_POINT_FADE_THRESHOLD_SIZE_EXT* = 0x00008128 - GL_DISTANCE_ATTENUATION_EXT* = 0x00008129 # GL_EXT_polygon_offset - cGL_POLYGON_OFFSET_EXT* = 0x00008037 - GL_POLYGON_OFFSET_FACTOR_EXT* = 0x00008038 - GL_POLYGON_OFFSET_BIAS_EXT* = 0x00008039 # GL_EXT_rescale_normal - GL_RESCALE_NORMAL_EXT* = 0x0000803A # GL_EXT_secondary_color - GL_COLOR_SUM_EXT* = 0x00008458 - GL_CURRENT_SECONDARY_COLOR_EXT* = 0x00008459 - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT* = 0x0000845A - GL_SECONDARY_COLOR_ARRAYtyp_EXT* = 0x0000845B - GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT* = 0x0000845C - GL_SECONDARY_COLOR_ARRAY_POINTER_EXT* = 0x0000845D - GL_SECONDARY_COLOR_ARRAY_EXT* = 0x0000845E # GL_EXT_separate_specular_color - GL_LIGHT_MODEL_COLOR_CONTROL_EXT* = 0x000081F8 - GL_SINGLE_COLOR_EXT* = 0x000081F9 - GL_SEPARATE_SPECULAR_COLOR_EXT* = 0x000081FA # GL_EXT_shared_texture_palette - GL_SHARED_TEXTURE_PALETTE_EXT* = 0x000081FB # GL_EXT_stencil_two_side - GL_STENCIL_TEST_TWO_SIDE_EXT* = 0x00008910 - cGL_ACTIVE_STENCIL_FACE_EXT* = 0x00008911 # GL_EXT_stencil_wrap - GL_INCR_WRAP_EXT* = 0x00008507 - GL_DECR_WRAP_EXT* = 0x00008508 # GL_EXT_texture - GL_ALPHA4_EXT* = 0x0000803B - GL_ALPHA8_EXT* = 0x0000803C - GL_ALPHA12_EXT* = 0x0000803D - GL_ALPHA16_EXT* = 0x0000803E - GL_LUMINANCE4_EXT* = 0x0000803F - GL_LUMINANCE8_EXT* = 0x00008040 - GL_LUMINANCE12_EXT* = 0x00008041 - GL_LUMINANCE16_EXT* = 0x00008042 - GL_LUMINANCE4_ALPHA4_EXT* = 0x00008043 - GL_LUMINANCE6_ALPHA2_EXT* = 0x00008044 - GL_LUMINANCE8_ALPHA8_EXT* = 0x00008045 - GL_LUMINANCE12_ALPHA4_EXT* = 0x00008046 - GL_LUMINANCE12_ALPHA12_EXT* = 0x00008047 - GL_LUMINANCE16_ALPHA16_EXT* = 0x00008048 - GL_INTENSITY_EXT* = 0x00008049 - GL_INTENSITY4_EXT* = 0x0000804A - GL_INTENSITY8_EXT* = 0x0000804B - GL_INTENSITY12_EXT* = 0x0000804C - GL_INTENSITY16_EXT* = 0x0000804D - GL_RGB2_EXT* = 0x0000804E - GL_RGB4_EXT* = 0x0000804F - GL_RGB5_EXT* = 0x00008050 - GL_RGB8_EXT* = 0x00008051 - GL_RGB10_EXT* = 0x00008052 - GL_RGB12_EXT* = 0x00008053 - GL_RGB16_EXT* = 0x00008054 - GL_RGBA2_EXT* = 0x00008055 - GL_RGBA4_EXT* = 0x00008056 - GL_RGB5_A1_EXT* = 0x00008057 - GL_RGBA8_EXT* = 0x00008058 - GL_RGB10_A2_EXT* = 0x00008059 - GL_RGBA12_EXT* = 0x0000805A - GL_RGBA16_EXT* = 0x0000805B - GL_TEXTURE_RED_SIZE_EXT* = 0x0000805C - GL_TEXTURE_GREEN_SIZE_EXT* = 0x0000805D - GL_TEXTURE_BLUE_SIZE_EXT* = 0x0000805E - GL_TEXTURE_ALPHA_SIZE_EXT* = 0x0000805F - GL_TEXTURE_LUMINANCE_SIZE_EXT* = 0x00008060 - GL_TEXTURE_INTENSITY_SIZE_EXT* = 0x00008061 - GL_REPLACE_EXT* = 0x00008062 - GL_PROXY_TEXTURE_1D_EXT* = 0x00008063 - GL_PROXY_TEXTURE_2D_EXT* = 0x00008064 - GL_TEXTURE_TOO_LARGE_EXT* = 0x00008065 # GL_EXT_texture3D - GL_PACK_SKIP_IMAGES_EXT* = 0x0000806B - GL_PACK_IMAGE_HEIGHT_EXT* = 0x0000806C - GL_UNPACK_SKIP_IMAGES_EXT* = 0x0000806D - GL_UNPACK_IMAGE_HEIGHT_EXT* = 0x0000806E - GL_TEXTURE_3D_EXT* = 0x0000806F - GL_PROXY_TEXTURE_3D_EXT* = 0x00008070 - GL_TEXTURE_DEPTH_EXT* = 0x00008071 - GL_TEXTURE_WRAP_R_EXT* = 0x00008072 - GL_MAX_3D_TEXTURE_SIZE_EXT* = 0x00008073 # GL_EXT_texture_compression_s3tc - GL_COMPRESSED_RGB_S3TC_DXT1_EXT* = 0x000083F0 - GL_COMPRESSED_RGBA_S3TC_DXT1_EXT* = 0x000083F1 - GL_COMPRESSED_RGBA_S3TC_DXT3_EXT* = 0x000083F2 - GL_COMPRESSED_RGBA_S3TC_DXT5_EXT* = 0x000083F3 # GL_EXT_texture_cube_map - GL_NORMAL_MAP_EXT* = 0x00008511 - GL_REFLECTION_MAP_EXT* = 0x00008512 - GL_TEXTURE_CUBE_MAP_EXT* = 0x00008513 - GL_TEXTURE_BINDING_CUBE_MAP_EXT* = 0x00008514 - GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT* = 0x00008515 - GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT* = 0x00008516 - GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT* = 0x00008517 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT* = 0x00008518 - GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT* = 0x00008519 - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT* = 0x0000851A - GL_PROXY_TEXTURE_CUBE_MAP_EXT* = 0x0000851B - GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT* = 0x0000851C # GL_EXT_texture_edge_clamp - GL_CLAMP_TO_EDGE_EXT* = 0x0000812F # GL_EXT_texture_env_combine - GL_COMBINE_EXT* = 0x00008570 - GL_COMBINE_RGB_EXT* = 0x00008571 - GL_COMBINE_ALPHA_EXT* = 0x00008572 - GL_RGB_SCALE_EXT* = 0x00008573 - GL_ADD_SIGNED_EXT* = 0x00008574 - GL_INTERPOLATE_EXT* = 0x00008575 - GL_CONSTANT_EXT* = 0x00008576 - GL_PRIMARY_COLOR_EXT* = 0x00008577 - GL_PREVIOUS_EXT* = 0x00008578 - GL_SOURCE0_RGB_EXT* = 0x00008580 - GL_SOURCE1_RGB_EXT* = 0x00008581 - GL_SOURCE2_RGB_EXT* = 0x00008582 - GL_SOURCE0_ALPHA_EXT* = 0x00008588 - GL_SOURCE1_ALPHA_EXT* = 0x00008589 - GL_SOURCE2_ALPHA_EXT* = 0x0000858A - GL_OPERAND0_RGB_EXT* = 0x00008590 - GL_OPERAND1_RGB_EXT* = 0x00008591 - GL_OPERAND2_RGB_EXT* = 0x00008592 - GL_OPERAND0_ALPHA_EXT* = 0x00008598 - GL_OPERAND1_ALPHA_EXT* = 0x00008599 - GL_OPERAND2_ALPHA_EXT* = 0x0000859A # GL_EXT_texture_env_dot3 - GL_DOT3_RGB_EXT* = 0x00008740 - GL_DOT3_RGBA_EXT* = 0x00008741 # GL_EXT_texture_filter_anisotropic - GL_TEXTURE_MAX_ANISOTROPY_EXT* = 0x000084FE - GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT* = 0x000084FF # GL_EXT_texture_lod_bias - GL_MAX_TEXTURE_LOD_BIAS_EXT* = 0x000084FD - GL_TEXTURE_FILTER_CONTROL_EXT* = 0x00008500 - GL_TEXTURE_LOD_BIAS_EXT* = 0x00008501 # GL_EXT_texture_object - GL_TEXTURE_PRIORITY_EXT* = 0x00008066 - GL_TEXTURE_RESIDENT_EXT* = 0x00008067 - GL_TEXTURE_1D_BINDING_EXT* = 0x00008068 - GL_TEXTURE_2D_BINDING_EXT* = 0x00008069 - GL_TEXTURE_3D_BINDING_EXT* = 0x0000806A # GL_EXT_texture_perturb_normal - GL_PERTURB_EXT* = 0x000085AE - cGL_TEXTURE_NORMAL_EXT* = 0x000085AF # GL_EXT_texture_rectangle - GL_TEXTURE_RECTANGLE_EXT* = 0x000084F5 - GL_TEXTURE_BINDING_RECTANGLE_EXT* = 0x000084F6 - GL_PROXY_TEXTURE_RECTANGLE_EXT* = 0x000084F7 - GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT* = 0x000084F8 # GL_EXT_vertex_array - GL_VERTEX_ARRAY_EXT* = 0x00008074 - GL_NORMAL_ARRAY_EXT* = 0x00008075 - GL_COLOR_ARRAY_EXT* = 0x00008076 - GL_INDEX_ARRAY_EXT* = 0x00008077 - GL_TEXTURE_COORD_ARRAY_EXT* = 0x00008078 - GL_EDGE_FLAG_ARRAY_EXT* = 0x00008079 - GL_VERTEX_ARRAY_SIZE_EXT* = 0x0000807A - GL_VERTEX_ARRAYtyp_EXT* = 0x0000807B - GL_VERTEX_ARRAY_STRIDE_EXT* = 0x0000807C - GL_VERTEX_ARRAY_COUNT_EXT* = 0x0000807D - GL_NORMAL_ARRAYtyp_EXT* = 0x0000807E - GL_NORMAL_ARRAY_STRIDE_EXT* = 0x0000807F - GL_NORMAL_ARRAY_COUNT_EXT* = 0x00008080 - GL_COLOR_ARRAY_SIZE_EXT* = 0x00008081 - GL_COLOR_ARRAYtyp_EXT* = 0x00008082 - GL_COLOR_ARRAY_STRIDE_EXT* = 0x00008083 - GL_COLOR_ARRAY_COUNT_EXT* = 0x00008084 - GL_INDEX_ARRAYtyp_EXT* = 0x00008085 - GL_INDEX_ARRAY_STRIDE_EXT* = 0x00008086 - GL_INDEX_ARRAY_COUNT_EXT* = 0x00008087 - GL_TEXTURE_COORD_ARRAY_SIZE_EXT* = 0x00008088 - GL_TEXTURE_COORD_ARRAYtyp_EXT* = 0x00008089 - GL_TEXTURE_COORD_ARRAY_STRIDE_EXT* = 0x0000808A - GL_TEXTURE_COORD_ARRAY_COUNT_EXT* = 0x0000808B - GL_EDGE_FLAG_ARRAY_STRIDE_EXT* = 0x0000808C - GL_EDGE_FLAG_ARRAY_COUNT_EXT* = 0x0000808D - GL_VERTEX_ARRAY_POINTER_EXT* = 0x0000808E - GL_NORMAL_ARRAY_POINTER_EXT* = 0x0000808F - GL_COLOR_ARRAY_POINTER_EXT* = 0x00008090 - GL_INDEX_ARRAY_POINTER_EXT* = 0x00008091 - GL_TEXTURE_COORD_ARRAY_POINTER_EXT* = 0x00008092 - GL_EDGE_FLAG_ARRAY_POINTER_EXT* = 0x00008093 # GL_EXT_vertex_shader - GL_VERTEX_SHADER_EXT* = 0x00008780 - GL_VERTEX_SHADER_BINDING_EXT* = 0x00008781 - GL_OP_INDEX_EXT* = 0x00008782 - GL_OP_NEGATE_EXT* = 0x00008783 - GL_OP_DOT3_EXT* = 0x00008784 - GL_OP_DOT4_EXT* = 0x00008785 - GL_OP_MUL_EXT* = 0x00008786 - GL_OP_ADD_EXT* = 0x00008787 - GL_OP_MADD_EXT* = 0x00008788 - GL_OP_FRAC_EXT* = 0x00008789 - GL_OP_MAX_EXT* = 0x0000878A - GL_OP_MIN_EXT* = 0x0000878B - GL_OP_SET_GE_EXT* = 0x0000878C - GL_OP_SET_LT_EXT* = 0x0000878D - GL_OP_CLAMP_EXT* = 0x0000878E - GL_OP_FLOOR_EXT* = 0x0000878F - GL_OP_ROUND_EXT* = 0x00008790 - GL_OP_EXP_BASE_2_EXT* = 0x00008791 - GL_OP_LOG_BASE_2_EXT* = 0x00008792 - GL_OP_POWER_EXT* = 0x00008793 - GL_OP_RECIP_EXT* = 0x00008794 - GL_OP_RECIP_SQRT_EXT* = 0x00008795 - GL_OP_SUB_EXT* = 0x00008796 - GL_OP_CROSS_PRODUCT_EXT* = 0x00008797 - GL_OP_MULTIPLY_MATRIX_EXT* = 0x00008798 - GL_OP_MOV_EXT* = 0x00008799 - GL_OUTPUT_VERTEX_EXT* = 0x0000879A - GL_OUTPUT_COLOR0_EXT* = 0x0000879B - GL_OUTPUT_COLOR1_EXT* = 0x0000879C - GL_OUTPUT_TEXTURE_COORD0_EXT* = 0x0000879D - GL_OUTPUT_TEXTURE_COORD1_EXT* = 0x0000879E - GL_OUTPUT_TEXTURE_COORD2_EXT* = 0x0000879F - GL_OUTPUT_TEXTURE_COORD3_EXT* = 0x000087A0 - GL_OUTPUT_TEXTURE_COORD4_EXT* = 0x000087A1 - GL_OUTPUT_TEXTURE_COORD5_EXT* = 0x000087A2 - GL_OUTPUT_TEXTURE_COORD6_EXT* = 0x000087A3 - GL_OUTPUT_TEXTURE_COORD7_EXT* = 0x000087A4 - GL_OUTPUT_TEXTURE_COORD8_EXT* = 0x000087A5 - GL_OUTPUT_TEXTURE_COORD9_EXT* = 0x000087A6 - GL_OUTPUT_TEXTURE_COORD10_EXT* = 0x000087A7 - GL_OUTPUT_TEXTURE_COORD11_EXT* = 0x000087A8 - GL_OUTPUT_TEXTURE_COORD12_EXT* = 0x000087A9 - GL_OUTPUT_TEXTURE_COORD13_EXT* = 0x000087AA - GL_OUTPUT_TEXTURE_COORD14_EXT* = 0x000087AB - GL_OUTPUT_TEXTURE_COORD15_EXT* = 0x000087AC - GL_OUTPUT_TEXTURE_COORD16_EXT* = 0x000087AD - GL_OUTPUT_TEXTURE_COORD17_EXT* = 0x000087AE - GL_OUTPUT_TEXTURE_COORD18_EXT* = 0x000087AF - GL_OUTPUT_TEXTURE_COORD19_EXT* = 0x000087B0 - GL_OUTPUT_TEXTURE_COORD20_EXT* = 0x000087B1 - GL_OUTPUT_TEXTURE_COORD21_EXT* = 0x000087B2 - GL_OUTPUT_TEXTURE_COORD22_EXT* = 0x000087B3 - GL_OUTPUT_TEXTURE_COORD23_EXT* = 0x000087B4 - GL_OUTPUT_TEXTURE_COORD24_EXT* = 0x000087B5 - GL_OUTPUT_TEXTURE_COORD25_EXT* = 0x000087B6 - GL_OUTPUT_TEXTURE_COORD26_EXT* = 0x000087B7 - GL_OUTPUT_TEXTURE_COORD27_EXT* = 0x000087B8 - GL_OUTPUT_TEXTURE_COORD28_EXT* = 0x000087B9 - GL_OUTPUT_TEXTURE_COORD29_EXT* = 0x000087BA - GL_OUTPUT_TEXTURE_COORD30_EXT* = 0x000087BB - GL_OUTPUT_TEXTURE_COORD31_EXT* = 0x000087BC - GL_OUTPUT_FOG_EXT* = 0x000087BD - GL_SCALAR_EXT* = 0x000087BE - GL_VECTOR_EXT* = 0x000087BF - GL_MATRIX_EXT* = 0x000087C0 - GL_VARIANT_EXT* = 0x000087C1 - GL_INVARIANT_EXT* = 0x000087C2 - GL_LOCAL_CONSTANT_EXT* = 0x000087C3 - GL_LOCAL_EXT* = 0x000087C4 - GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087C5 - GL_MAX_VERTEX_SHADER_VARIANTS_EXT* = 0x000087C6 - GL_MAX_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087C7 - GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087C8 - GL_MAX_VERTEX_SHADER_LOCALS_EXT* = 0x000087C9 - GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087CA - GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT* = 0x000087CB - GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087CC - GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087CD - GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT* = 0x000087CE - GL_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087CF - GL_VERTEX_SHADER_VARIANTS_EXT* = 0x000087D0 - GL_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087D1 - GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087D2 - GL_VERTEX_SHADER_LOCALS_EXT* = 0x000087D3 - GL_VERTEX_SHADER_OPTIMIZED_EXT* = 0x000087D4 - GL_X_EXT* = 0x000087D5 - GL_Y_EXT* = 0x000087D6 - GL_Z_EXT* = 0x000087D7 - GL_W_EXT* = 0x000087D8 - GL_NEGATIVE_X_EXT* = 0x000087D9 - GL_NEGATIVE_Y_EXT* = 0x000087DA - GL_NEGATIVE_Z_EXT* = 0x000087DB - GL_NEGATIVE_W_EXT* = 0x000087DC - GL_ZERO_EXT* = 0x000087DD - GL_ONE_EXT* = 0x000087DE - GL_NEGATIVE_ONE_EXT* = 0x000087DF - GL_NORMALIZED_RANGE_EXT* = 0x000087E0 - GL_FULL_RANGE_EXT* = 0x000087E1 - GL_CURRENT_VERTEX_EXT* = 0x000087E2 - GL_MVP_MATRIX_EXT* = 0x000087E3 - GL_VARIANT_VALUE_EXT* = 0x000087E4 - GL_VARIANT_DATAtypEXT* = 0x000087E5 - GL_VARIANT_ARRAY_STRIDE_EXT* = 0x000087E6 - GL_VARIANT_ARRAYtyp_EXT* = 0x000087E7 - GL_VARIANT_ARRAY_EXT* = 0x000087E8 - GL_VARIANT_ARRAY_POINTER_EXT* = 0x000087E9 - GL_INVARIANT_VALUE_EXT* = 0x000087EA - GL_INVARIANT_DATAtypEXT* = 0x000087EB - GL_LOCAL_CONSTANT_VALUE_EXT* = 0x000087EC - GL_LOCAL_CONSTANT_DATAtypEXT* = 0x000087ED # GL_EXT_vertex_weighting - GL_MODELVIEW0_STACK_DEPTH_EXT* = 0x00000BA3 - GL_MODELVIEW1_STACK_DEPTH_EXT* = 0x00008502 - GL_MODELVIEW0_MATRIX_EXT* = 0x00000BA6 - GL_MODELVIEW1_MATRIX_EXT* = 0x00008506 - GL_VERTEX_WEIGHTING_EXT* = 0x00008509 - GL_MODELVIEW0_EXT* = 0x00001700 - GL_MODELVIEW1_EXT* = 0x0000850A - GL_CURRENT_VERTEX_WEIGHT_EXT* = 0x0000850B - GL_VERTEX_WEIGHT_ARRAY_EXT* = 0x0000850C - GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT* = 0x0000850D - GL_VERTEX_WEIGHT_ARRAYtyp_EXT* = 0x0000850E - GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT* = 0x0000850F - GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT* = 0x00008510 # GL_EXT_depth_bounds_test - GL_DEPTH_BOUNDS_TEST_EXT* = 0x00008890 - cGL_DEPTH_BOUNDS_EXT* = 0x00008891 # GL_EXT_texture_mirror_clamp - GL_MIRROR_CLAMP_EXT* = 0x00008742 - GL_MIRROR_CLAMP_TO_EDGE_EXT* = 0x00008743 - GL_MIRROR_CLAMP_TO_BORDER_EXT* = 0x00008912 # GL_EXT_blend_equation_separate - GL_BLEND_EQUATION_RGB_EXT* = 0x00008009 - GL_BLEND_EQUATION_ALPHA_EXT* = 0x0000883D # GL_EXT_pixel_buffer_object - GL_PIXEL_PACK_BUFFER_EXT* = 0x000088EB - GL_PIXEL_UNPACK_BUFFER_EXT* = 0x000088EC - GL_PIXEL_PACK_BUFFER_BINDING_EXT* = 0x000088ED - GL_PIXEL_UNPACK_BUFFER_BINDING_EXT* = 0x000088EF # GL_EXT_stencil_clear_tag - GL_STENCIL_TAG_BITS_EXT* = 0x000088F2 - GL_STENCIL_CLEAR_TAG_VALUE_EXT* = 0x000088F3 # GL_EXT_packed_depth_stencil - GL_DEPTH_STENCIL_EXT* = 0x000084F9 - GL_UNSIGNED_INT_24_8_EXT* = 0x000084FA - GL_DEPTH24_STENCIL8_EXT* = 0x000088F0 - GL_TEXTURE_STENCIL_SIZE_EXT* = 0x000088F1 # GL_EXT_texture_sRGB - GL_SRGB_EXT* = 0x00008C40 - GL_SRGB8_EXT* = 0x00008C41 - GL_SRGB_ALPHA_EXT* = 0x00008C42 - GL_SRGB8_ALPHA8_EXT* = 0x00008C43 - GL_SLUMINANCE_ALPHA_EXT* = 0x00008C44 - GL_SLUMINANCE8_ALPHA8_EXT* = 0x00008C45 - GL_SLUMINANCE_EXT* = 0x00008C46 - GL_SLUMINANCE8_EXT* = 0x00008C47 - GL_COMPRESSED_SRGB_EXT* = 0x00008C48 - GL_COMPRESSED_SRGB_ALPHA_EXT* = 0x00008C49 - GL_COMPRESSED_SLUMINANCE_EXT* = 0x00008C4A - GL_COMPRESSED_SLUMINANCE_ALPHA_EXT* = 0x00008C4B - GL_COMPRESSED_SRGB_S3TC_DXT1_EXT* = 0x00008C4C - GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT* = 0x00008C4D - GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT* = 0x00008C4E - GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT* = 0x00008C4F # GL_EXT_framebuffer_blit - GL_READ_FRAMEBUFFER_EXT* = 0x00008CA8 - GL_DRAW_FRAMEBUFFER_EXT* = 0x00008CA9 - GL_READ_FRAMEBUFFER_BINDING_EXT* = GL_FRAMEBUFFER_BINDING_EXT - GL_DRAW_FRAMEBUFFER_BINDING_EXT* = 0x00008CAA # GL_EXT_framebuffer_multisample - GL_RENDERBUFFER_SAMPLES_EXT* = 0x00008CAB - GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT* = 0x00008D56 - GL_MAX_SAMPLES_EXT* = 0x00008D57 # GL_EXT_timer_query - GL_TIME_ELAPSED_EXT* = 0x000088BF # GL_EXT_bindable_uniform - GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT* = 0x00008DE2 - GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT* = 0x00008DE3 - GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT* = 0x00008DE4 - GL_MAX_BINDABLE_UNIFORM_SIZE_EXT* = 0x00008DED - cGL_UNIFORM_BUFFER_EXT* = 0x00008DEE - GL_UNIFORM_BUFFER_BINDING_EXT* = 0x00008DEF # GL_EXT_framebuffer_sRGB - GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT* = 0x000020B2 - WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT* = 0x000020A9 - GL_FRAMEBUFFER_SRGB_EXT* = 0x00008DB9 - GL_FRAMEBUFFER_SRGB_CAPABLE_EXT* = 0x00008DBA # GL_EXT_geometry_shader4 - GL_GEOMETRY_SHADER_EXT* = 0x00008DD9 - GL_GEOMETRY_VERTICES_OUT_EXT* = 0x00008DDA - GL_GEOMETRY_INPUTtyp_EXT* = 0x00008DDB - GL_GEOMETRY_OUTPUTtyp_EXT* = 0x00008DDC - GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT* = 0x00008C29 - GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT* = 0x00008DDD - GL_MAX_VERTEX_VARYING_COMPONENTS_EXT* = 0x00008DDE - GL_MAX_VARYING_COMPONENTS_EXT* = 0x00008B4B - GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT* = 0x00008DDF - GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT* = 0x00008DE0 - GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT* = 0x00008DE1 - GL_LINES_ADJACENCY_EXT* = 0x0000000A - GL_LINE_STRIP_ADJACENCY_EXT* = 0x0000000B - GL_TRIANGLES_ADJACENCY_EXT* = 0x0000000C - GL_TRIANGLE_STRIP_ADJACENCY_EXT* = 0x0000000D - GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT* = 0x00008DA8 - GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT* = 0x00008DA9 - GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT* = 0x00008DA7 - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT* = 0x00008CD4 - GL_PROGRAM_POINT_SIZE_EXT* = 0x00008642 # GL_EXT_gpu_shader4 - GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT* = 0x000088FD - GL_SAMPLER_1D_ARRAY_EXT* = 0x00008DC0 - GL_SAMPLER_2D_ARRAY_EXT* = 0x00008DC1 - GL_SAMPLER_BUFFER_EXT* = 0x00008DC2 - GL_SAMPLER_1D_ARRAY_SHADOW_EXT* = 0x00008DC3 - GL_SAMPLER_2D_ARRAY_SHADOW_EXT* = 0x00008DC4 - GL_SAMPLER_CUBE_SHADOW_EXT* = 0x00008DC5 - GL_UNSIGNED_INT_VEC2_EXT* = 0x00008DC6 - GL_UNSIGNED_INT_VEC3_EXT* = 0x00008DC7 - GL_UNSIGNED_INT_VEC4_EXT* = 0x00008DC8 - GL_INT_SAMPLER_1D_EXT* = 0x00008DC9 - GL_INT_SAMPLER_2D_EXT* = 0x00008DCA - GL_INT_SAMPLER_3D_EXT* = 0x00008DCB - GL_INT_SAMPLER_CUBE_EXT* = 0x00008DCC - GL_INT_SAMPLER_2D_RECT_EXT* = 0x00008DCD - GL_INT_SAMPLER_1D_ARRAY_EXT* = 0x00008DCE - GL_INT_SAMPLER_2D_ARRAY_EXT* = 0x00008DCF - GL_INT_SAMPLER_BUFFER_EXT* = 0x00008DD0 - GL_UNSIGNED_INT_SAMPLER_1D_EXT* = 0x00008DD1 - GL_UNSIGNED_INT_SAMPLER_2D_EXT* = 0x00008DD2 - GL_UNSIGNED_INT_SAMPLER_3D_EXT* = 0x00008DD3 - GL_UNSIGNED_INT_SAMPLER_CUBE_EXT* = 0x00008DD4 - GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT* = 0x00008DD5 - GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT* = 0x00008DD6 - GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT* = 0x00008DD7 - GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT* = 0x00008DD8 - GL_MIN_PROGRAM_TEXEL_OFFSET_EXT* = 0x00008904 - GL_MAX_PROGRAM_TEXEL_OFFSET_EXT* = 0x00008905 # GL_EXT_packed_float - GL_R11F_G11F_B10F_EXT* = 0x00008C3A - GL_UNSIGNED_INT_10F_11F_11F_REV_EXT* = 0x00008C3B - RGBA_SIGNED_COMPONENTS_EXT* = 0x00008C3C - WGLtyp_RGBA_UNSIGNED_FLOAT_EXT* = 0x000020A8 - GLX_RGBA_UNSIGNED_FLOATtyp_EXT* = 0x000020B1 - GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT* = 0x00000008 # GL_EXT_texture_array - GL_TEXTURE_1D_ARRAY_EXT* = 0x00008C18 - GL_TEXTURE_2D_ARRAY_EXT* = 0x00008C1A - GL_PROXY_TEXTURE_2D_ARRAY_EXT* = 0x00008C1B - GL_PROXY_TEXTURE_1D_ARRAY_EXT* = 0x00008C19 - GL_TEXTURE_BINDING_1D_ARRAY_EXT* = 0x00008C1C - GL_TEXTURE_BINDING_2D_ARRAY_EXT* = 0x00008C1D - GL_MAX_ARRAY_TEXTURE_LAYERS_EXT* = 0x000088FF - GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT* = 0x0000884E # GL_EXT_texture_buffer_object - cGL_TEXTURE_BUFFER_EXT* = 0x00008C2A - GL_MAX_TEXTURE_BUFFER_SIZE_EXT* = 0x00008C2B - GL_TEXTURE_BINDING_BUFFER_EXT* = 0x00008C2C - GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT* = 0x00008C2D - GL_TEXTURE_BUFFER_FORMAT_EXT* = 0x00008C2E # GL_EXT_texture_compression_latc - GL_COMPRESSED_LUMINANCE_LATC1_EXT* = 0x00008C70 - GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT* = 0x00008C71 - GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT* = 0x00008C72 - GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT* = 0x00008C73 # - # GL_EXT_texture_compression_rgtc - GL_COMPRESSED_RED_RGTC1_EXT* = 0x00008DBB - GL_COMPRESSED_SIGNED_RED_RGTC1_EXT* = 0x00008DBC - GL_COMPRESSED_RED_GREEN_RGTC2_EXT* = 0x00008DBD - GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT* = 0x00008DBE # GL_EXT_texture_integer - GL_RGBA_INTEGER_MODE_EXT* = 0x00008D9E - GL_RGBA32UI_EXT* = 0x00008D70 - GL_RGB32UI_EXT* = 0x00008D71 - GL_ALPHA32UI_EXT* = 0x00008D72 - GL_INTENSITY32UI_EXT* = 0x00008D73 - GL_LUMINANCE32UI_EXT* = 0x00008D74 - GL_LUMINANCE_ALPHA32UI_EXT* = 0x00008D75 - GL_RGBA16UI_EXT* = 0x00008D76 - GL_RGB16UI_EXT* = 0x00008D77 - GL_ALPHA16UI_EXT* = 0x00008D78 - GL_INTENSITY16UI_EXT* = 0x00008D79 - GL_LUMINANCE16UI_EXT* = 0x00008D7A - GL_LUMINANCE_ALPHA16UI_EXT* = 0x00008D7B - GL_RGBA8UI_EXT* = 0x00008D7C - GL_RGB8UI_EXT* = 0x00008D7D - GL_ALPHA8UI_EXT* = 0x00008D7E - GL_INTENSITY8UI_EXT* = 0x00008D7F - GL_LUMINANCE8UI_EXT* = 0x00008D80 - GL_LUMINANCE_ALPHA8UI_EXT* = 0x00008D81 - GL_RGBA32I_EXT* = 0x00008D82 - GL_RGB32I_EXT* = 0x00008D83 - GL_ALPHA32I_EXT* = 0x00008D84 - GL_INTENSITY32I_EXT* = 0x00008D85 - GL_LUMINANCE32I_EXT* = 0x00008D86 - GL_LUMINANCE_ALPHA32I_EXT* = 0x00008D87 - GL_RGBA16I_EXT* = 0x00008D88 - GL_RGB16I_EXT* = 0x00008D89 - GL_ALPHA16I_EXT* = 0x00008D8A - GL_INTENSITY16I_EXT* = 0x00008D8B - GL_LUMINANCE16I_EXT* = 0x00008D8C - GL_LUMINANCE_ALPHA16I_EXT* = 0x00008D8D - GL_RGBA8I_EXT* = 0x00008D8E - GL_RGB8I_EXT* = 0x00008D8F - GL_ALPHA8I_EXT* = 0x00008D90 - GL_INTENSITY8I_EXT* = 0x00008D91 - GL_LUMINANCE8I_EXT* = 0x00008D92 - GL_LUMINANCE_ALPHA8I_EXT* = 0x00008D93 - GL_RED_INTEGER_EXT* = 0x00008D94 - GL_GREEN_INTEGER_EXT* = 0x00008D95 - GL_BLUE_INTEGER_EXT* = 0x00008D96 - GL_ALPHA_INTEGER_EXT* = 0x00008D97 - GL_RGB_INTEGER_EXT* = 0x00008D98 - GL_RGBA_INTEGER_EXT* = 0x00008D99 - GL_BGR_INTEGER_EXT* = 0x00008D9A - GL_BGRA_INTEGER_EXT* = 0x00008D9B - GL_LUMINANCE_INTEGER_EXT* = 0x00008D9C - GL_LUMINANCE_ALPHA_INTEGER_EXT* = 0x00008D9D # GL_EXT_texture_shared_exponent - GL_RGB9_E5_EXT* = 0x00008C3D - GL_UNSIGNED_INT_5_9_9_9_REV_EXT* = 0x00008C3E - GL_TEXTURE_SHARED_SIZE_EXT* = 0x00008C3F # GL_EXT_transform_feedback - GL_TRANSFORM_FEEDBACK_BUFFER_EXT* = 0x00008C8E - GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT* = 0x00008C84 - GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT* = 0x00008C85 - GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT* = 0x00008C8F - GL_INTERLEAVED_ATTRIBS_EXT* = 0x00008C8C - GL_SEPARATE_ATTRIBS_EXT* = 0x00008C8D - GL_PRIMITIVES_GENERATED_EXT* = 0x00008C87 - GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT* = 0x00008C88 - GL_RASTERIZER_DISCARD_EXT* = 0x00008C89 - GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT* = 0x00008C8A - GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT* = 0x00008C8B - GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT* = 0x00008C80 - cGL_TRANSFORM_FEEDBACK_VARYINGS_EXT* = 0x00008C83 - GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT* = 0x00008C7F - GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT* = 0x00008C76 # - # GL_EXT_direct_state_access - GL_PROGRAM_MATRIX_EXT* = 0x00008E2D - GL_TRANSPOSE_PROGRAM_MATRIX_EXT* = 0x00008E2E - GL_PROGRAM_MATRIX_STACK_DEPTH_EXT* = 0x00008E2F # GL_EXT_texture_swizzle - GL_TEXTURE_SWIZZLE_R_EXT* = 0x00008E42 - GL_TEXTURE_SWIZZLE_G_EXT* = 0x00008E43 - GL_TEXTURE_SWIZZLE_B_EXT* = 0x00008E44 - GL_TEXTURE_SWIZZLE_A_EXT* = 0x00008E45 - GL_TEXTURE_SWIZZLE_RGBA_EXT* = 0x00008E46 # GL_EXT_provoking_vertex - GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT* = 0x00008E4C - GL_FIRST_VERTEX_CONVENTION_EXT* = 0x00008E4D - GL_LAST_VERTEX_CONVENTION_EXT* = 0x00008E4E - GL_PROVOKING_VERTEX_EXT* = 0x00008E4F # GL_EXT_texture_snorm - GL_ALPHA_SNORM* = 0x00009010 - GL_LUMINANCE_SNORM* = 0x00009011 - GL_LUMINANCE_ALPHA_SNORM* = 0x00009012 - GL_INTENSITY_SNORM* = 0x00009013 - GL_ALPHA8_SNORM* = 0x00009014 - GL_LUMINANCE8_SNORM* = 0x00009015 - GL_LUMINANCE8_ALPHA8_SNORM* = 0x00009016 - GL_INTENSITY8_SNORM* = 0x00009017 - GL_ALPHA16_SNORM* = 0x00009018 - GL_LUMINANCE16_SNORM* = 0x00009019 - GL_LUMINANCE16_ALPHA16_SNORM* = 0x0000901A - GL_INTENSITY16_SNORM* = 0x0000901B # GL_EXT_separate_shader_objects - cGL_ACTIVE_PROGRAM_EXT* = 0x00008B8D # GL_EXT_shader_image_load_store - GL_MAX_IMAGE_UNITS_EXT* = 0x00008F38 - GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT* = 0x00008F39 - GL_IMAGE_BINDING_NAME_EXT* = 0x00008F3A - GL_IMAGE_BINDING_LEVEL_EXT* = 0x00008F3B - GL_IMAGE_BINDING_LAYERED_EXT* = 0x00008F3C - GL_IMAGE_BINDING_LAYER_EXT* = 0x00008F3D - GL_IMAGE_BINDING_ACCESS_EXT* = 0x00008F3E - GL_IMAGE_1D_EXT* = 0x0000904C - GL_IMAGE_2D_EXT* = 0x0000904D - GL_IMAGE_3D_EXT* = 0x0000904E - GL_IMAGE_2D_RECT_EXT* = 0x0000904F - GL_IMAGE_CUBE_EXT* = 0x00009050 - GL_IMAGE_BUFFER_EXT* = 0x00009051 - GL_IMAGE_1D_ARRAY_EXT* = 0x00009052 - GL_IMAGE_2D_ARRAY_EXT* = 0x00009053 - GL_IMAGE_CUBE_MAP_ARRAY_EXT* = 0x00009054 - GL_IMAGE_2D_MULTISAMPLE_EXT* = 0x00009055 - GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT* = 0x00009056 - GL_INT_IMAGE_1D_EXT* = 0x00009057 - GL_INT_IMAGE_2D_EXT* = 0x00009058 - GL_INT_IMAGE_3D_EXT* = 0x00009059 - GL_INT_IMAGE_2D_RECT_EXT* = 0x0000905A - GL_INT_IMAGE_CUBE_EXT* = 0x0000905B - GL_INT_IMAGE_BUFFER_EXT* = 0x0000905C - GL_INT_IMAGE_1D_ARRAY_EXT* = 0x0000905D - GL_INT_IMAGE_2D_ARRAY_EXT* = 0x0000905E - GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT* = 0x0000905F - GL_INT_IMAGE_2D_MULTISAMPLE_EXT* = 0x00009060 - GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT* = 0x00009061 - GL_UNSIGNED_INT_IMAGE_1D_EXT* = 0x00009062 - GL_UNSIGNED_INT_IMAGE_2D_EXT* = 0x00009063 - GL_UNSIGNED_INT_IMAGE_3D_EXT* = 0x00009064 - GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT* = 0x00009065 - GL_UNSIGNED_INT_IMAGE_CUBE_EXT* = 0x00009066 - GL_UNSIGNED_INT_IMAGE_BUFFER_EXT* = 0x00009067 - GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT* = 0x00009068 - GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT* = 0x00009069 - GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT* = 0x0000906A - GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT* = 0x0000906B - GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT* = 0x0000906C - GL_MAX_IMAGE_SAMPLES_EXT* = 0x0000906D - GL_IMAGE_BINDING_FORMAT_EXT* = 0x0000906E - GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT* = 0x00000001 - GL_ELEMENT_ARRAY_BARRIER_BIT_EXT* = 0x00000002 - GL_UNIFORM_BARRIER_BIT_EXT* = 0x00000004 - GL_TEXTURE_FETCH_BARRIER_BIT_EXT* = 0x00000008 - GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT* = 0x00000020 - GL_COMMAND_BARRIER_BIT_EXT* = 0x00000040 - GL_PIXEL_BUFFER_BARRIER_BIT_EXT* = 0x00000080 - GL_TEXTURE_UPDATE_BARRIER_BIT_EXT* = 0x00000100 - GL_BUFFER_UPDATE_BARRIER_BIT_EXT* = 0x00000200 - GL_FRAMEBUFFER_BARRIER_BIT_EXT* = 0x00000400 - GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT* = 0x00000800 - GL_ATOMIC_COUNTER_BARRIER_BIT_EXT* = 0x00001000 - GL_ALL_BARRIER_BITS_EXT* = 0xFFFFFFFF # GL_EXT_vertex_attrib_64bit - # reuse GL_DOUBLE - GL_DOUBLE_VEC2_EXT* = 0x00008FFC - GL_DOUBLE_VEC3_EXT* = 0x00008FFD - GL_DOUBLE_VEC4_EXT* = 0x00008FFE - GL_DOUBLE_MAT2_EXT* = 0x00008F46 - GL_DOUBLE_MAT3_EXT* = 0x00008F47 - GL_DOUBLE_MAT4_EXT* = 0x00008F48 - GL_DOUBLE_MAT2x3_EXT* = 0x00008F49 - GL_DOUBLE_MAT2x4_EXT* = 0x00008F4A - GL_DOUBLE_MAT3x2_EXT* = 0x00008F4B - GL_DOUBLE_MAT3x4_EXT* = 0x00008F4C - GL_DOUBLE_MAT4x2_EXT* = 0x00008F4D - GL_DOUBLE_MAT4x3_EXT* = 0x00008F4E # GL_EXT_texture_sRGB_decode - GL_TEXTURE_SRGB_DECODE_EXT* = 0x00008A48 - GL_DECODE_EXT* = 0x00008A49 - GL_SKIP_DECODE_EXT* = 0x00008A4A # GL_NV_texture_multisample - GL_TEXTURE_COVERAGE_SAMPLES_NV* = 0x00009045 - GL_TEXTURE_COLOR_SAMPLES_NV* = 0x00009046 # GL_AMD_blend_minmax_factor - GL_FACTOR_MIN_AMD* = 0x0000901C - GL_FACTOR_MAX_AMD* = 0x0000901D # GL_AMD_sample_positions - GL_SUBSAMPLE_DISTANCE_AMD* = 0x0000883F # GL_EXT_x11_sync_object - GL_SYNC_X11_FENCE_EXT* = 0x000090E1 # GL_EXT_framebuffer_multisample_blit_scaled - GL_SCALED_RESOLVE_FASTEST_EXT* = 0x000090BA - GL_SCALED_RESOLVE_NICEST_EXT* = 0x000090BB # GL_FfdMaskSGIX - GL_TEXTURE_DEFORMATION_BIT_SGIX* = 0x00000001 - GL_GEOMETRY_DEFORMATION_BIT_SGIX* = 0x00000002 # GL_HP_convolution_border_modes - GL_IGNORE_BORDER_HP* = 0x00008150 - GL_CONSTANT_BORDER_HP* = 0x00008151 - GL_REPLICATE_BORDER_HP* = 0x00008153 - GL_CONVOLUTION_BORDER_COLOR_HP* = 0x00008154 # GL_HP_image_transform - GL_IMAGE_SCALE_X_HP* = 0x00008155 - GL_IMAGE_SCALE_Y_HP* = 0x00008156 - GL_IMAGE_TRANSLATE_X_HP* = 0x00008157 - GL_IMAGE_TRANSLATE_Y_HP* = 0x00008158 - GL_IMAGE_ROTATE_ANGLE_HP* = 0x00008159 - GL_IMAGE_ROTATE_ORIGIN_X_HP* = 0x0000815A - GL_IMAGE_ROTATE_ORIGIN_Y_HP* = 0x0000815B - GL_IMAGE_MAG_FILTER_HP* = 0x0000815C - GL_IMAGE_MIN_FILTER_HP* = 0x0000815D - GL_IMAGE_CUBIC_WEIGHT_HP* = 0x0000815E - GL_CUBIC_HP* = 0x0000815F - GL_AVERAGE_HP* = 0x00008160 - GL_IMAGE_TRANSFORM_2D_HP* = 0x00008161 - GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP* = 0x00008162 - GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP* = 0x00008163 # - # GL_HP_occlusion_test - GL_OCCLUSION_TEST_HP* = 0x00008165 - GL_OCCLUSION_TEST_RESULT_HP* = 0x00008166 # GL_HP_texture_lighting - GL_TEXTURE_LIGHTING_MODE_HP* = 0x00008167 - GL_TEXTURE_POST_SPECULAR_HP* = 0x00008168 - GL_TEXTURE_PRE_SPECULAR_HP* = 0x00008169 # GL_IBM_cull_vertex - GL_CULL_VERTEX_IBM* = 103050 # GL_IBM_rasterpos_clip - GL_RASTER_POSITION_UNCLIPPED_IBM* = 0x00019262 # GL_IBM_texture_mirrored_repeat - GL_MIRRORED_REPEAT_IBM* = 0x00008370 # GL_IBM_vertex_array_lists - GL_VERTEX_ARRAY_LIST_IBM* = 103070 - GL_NORMAL_ARRAY_LIST_IBM* = 103071 - GL_COLOR_ARRAY_LIST_IBM* = 103072 - GL_INDEX_ARRAY_LIST_IBM* = 103073 - GL_TEXTURE_COORD_ARRAY_LIST_IBM* = 103074 - GL_EDGE_FLAG_ARRAY_LIST_IBM* = 103075 - GL_FOG_COORDINATE_ARRAY_LIST_IBM* = 103076 - GL_SECONDARY_COLOR_ARRAY_LIST_IBM* = 103077 - GL_VERTEX_ARRAY_LIST_STRIDE_IBM* = 103080 - GL_NORMAL_ARRAY_LIST_STRIDE_IBM* = 103081 - GL_COLOR_ARRAY_LIST_STRIDE_IBM* = 103082 - GL_INDEX_ARRAY_LIST_STRIDE_IBM* = 103083 - GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM* = 103084 - GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM* = 103085 - GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM* = 103086 - GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM* = 103087 # GL_INGR_color_clamp - GL_RED_MIN_CLAMP_INGR* = 0x00008560 - GL_GREEN_MIN_CLAMP_INGR* = 0x00008561 - GL_BLUE_MIN_CLAMP_INGR* = 0x00008562 - GL_ALPHA_MIN_CLAMP_INGR* = 0x00008563 - GL_RED_MAX_CLAMP_INGR* = 0x00008564 - GL_GREEN_MAX_CLAMP_INGR* = 0x00008565 - GL_BLUE_MAX_CLAMP_INGR* = 0x00008566 - GL_ALPHA_MAX_CLAMP_INGR* = 0x00008567 # GL_INGR_interlace_read - GL_INTERLACE_READ_INGR* = 0x00008568 # GL_INTEL_parallel_arrays - GL_PARALLEL_ARRAYS_INTEL* = 0x000083F4 - GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL* = 0x000083F5 - GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL* = 0x000083F6 - GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL* = 0x000083F7 - GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL* = 0x000083F8 # - # GL_NV_copy_depth_to_color - GL_DEPTH_STENCIL_TO_RGBA_NV* = 0x0000886E - GL_DEPTH_STENCIL_TO_BGRA_NV* = 0x0000886F # GL_NV_depth_clamp - GL_DEPTH_CLAMP_NV* = 0x0000864F # GL_NV_evaluators - GL_EVAL_2D_NV* = 0x000086C0 - GL_EVAL_TRIANGULAR_2D_NV* = 0x000086C1 - GL_MAP_TESSELLATION_NV* = 0x000086C2 - GL_MAP_ATTRIB_U_ORDER_NV* = 0x000086C3 - GL_MAP_ATTRIB_V_ORDER_NV* = 0x000086C4 - GL_EVAL_FRACTIONAL_TESSELLATION_NV* = 0x000086C5 - GL_EVAL_VERTEX_ATTRIB0_NV* = 0x000086C6 - GL_EVAL_VERTEX_ATTRIB1_NV* = 0x000086C7 - GL_EVAL_VERTEX_ATTRIB2_NV* = 0x000086C8 - GL_EVAL_VERTEX_ATTRIB3_NV* = 0x000086C9 - GL_EVAL_VERTEX_ATTRIB4_NV* = 0x000086CA - GL_EVAL_VERTEX_ATTRIB5_NV* = 0x000086CB - GL_EVAL_VERTEX_ATTRIB6_NV* = 0x000086CC - GL_EVAL_VERTEX_ATTRIB7_NV* = 0x000086CD - GL_EVAL_VERTEX_ATTRIB8_NV* = 0x000086CE - GL_EVAL_VERTEX_ATTRIB9_NV* = 0x000086CF - GL_EVAL_VERTEX_ATTRIB10_NV* = 0x000086D0 - GL_EVAL_VERTEX_ATTRIB11_NV* = 0x000086D1 - GL_EVAL_VERTEX_ATTRIB12_NV* = 0x000086D2 - GL_EVAL_VERTEX_ATTRIB13_NV* = 0x000086D3 - GL_EVAL_VERTEX_ATTRIB14_NV* = 0x000086D4 - GL_EVAL_VERTEX_ATTRIB15_NV* = 0x000086D5 - GL_MAX_MAP_TESSELLATION_NV* = 0x000086D6 - GL_MAX_RATIONAL_EVAL_ORDER_NV* = 0x000086D7 # GL_NV_fence - GL_ALL_COMPLETED_NV* = 0x000084F2 - GL_FENCE_STATUS_NV* = 0x000084F3 - GL_FENCE_CONDITION_NV* = 0x000084F4 # GL_NV_float_buffer - GL_FLOAT_R_NV* = 0x00008880 - GL_FLOAT_RG_NV* = 0x00008881 - GL_FLOAT_RGB_NV* = 0x00008882 - GL_FLOAT_RGBA_NV* = 0x00008883 - GL_FLOAT_R16_NV* = 0x00008884 - GL_FLOAT_R32_NV* = 0x00008885 - GL_FLOAT_RG16_NV* = 0x00008886 - GL_FLOAT_RG32_NV* = 0x00008887 - GL_FLOAT_RGB16_NV* = 0x00008888 - GL_FLOAT_RGB32_NV* = 0x00008889 - GL_FLOAT_RGBA16_NV* = 0x0000888A - GL_FLOAT_RGBA32_NV* = 0x0000888B - GL_TEXTURE_FLOAT_COMPONENTS_NV* = 0x0000888C - GL_FLOAT_CLEAR_COLOR_VALUE_NV* = 0x0000888D - GL_FLOAT_RGBA_MODE_NV* = 0x0000888E # GL_NV_fog_distance - GL_FOG_DISTANCE_MODE_NV* = 0x0000855A - GL_EYE_RADIAL_NV* = 0x0000855B - GL_EYE_PLANE_ABSOLUTE_NV* = 0x0000855C # GL_NV_fragment_program - GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV* = 0x00008868 - GL_FRAGMENT_PROGRAM_NV* = 0x00008870 - GL_MAX_TEXTURE_COORDS_NV* = 0x00008871 - GL_MAX_TEXTURE_IMAGE_UNITS_NV* = 0x00008872 - GL_FRAGMENT_PROGRAM_BINDING_NV* = 0x00008873 - GL_PROGRAM_ERROR_STRING_NV* = 0x00008874 # GL_NV_half_float - GL_HALF_FLOAT_NV* = 0x0000140B # GL_NV_light_max_exponent - GL_MAX_SHININESS_NV* = 0x00008504 - GL_MAX_SPOT_EXPONENT_NV* = 0x00008505 # GL_NV_multisample_filter_hint - GL_MULTISAMPLE_FILTER_HINT_NV* = 0x00008534 # GL_NV_occlusion_query - GL_PIXEL_COUNTER_BITS_NV* = 0x00008864 - GL_CURRENT_OCCLUSION_QUERY_ID_NV* = 0x00008865 - GL_PIXEL_COUNT_NV* = 0x00008866 - GL_PIXEL_COUNT_AVAILABLE_NV* = 0x00008867 # GL_NV_packed_depth_stencil - GL_DEPTH_STENCIL_NV* = 0x000084F9 - GL_UNSIGNED_INT_24_8_NV* = 0x000084FA # GL_NV_pixel_data_range - GL_WRITE_PIXEL_DATA_RANGE_NV* = 0x00008878 - GL_READ_PIXEL_DATA_RANGE_NV* = 0x00008879 - GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV* = 0x0000887A - GL_READ_PIXEL_DATA_RANGE_LENGTH_NV* = 0x0000887B - GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV* = 0x0000887C - GL_READ_PIXEL_DATA_RANGE_POINTER_NV* = 0x0000887D # GL_NV_point_sprite - GL_POINT_SPRITE_NV* = 0x00008861 - GL_COORD_REPLACE_NV* = 0x00008862 - GL_POINT_SPRITE_R_MODE_NV* = 0x00008863 # GL_NV_primitive_restart - cGL_PRIMITIVE_RESTART_NV* = 0x00008558 - cGL_PRIMITIVE_RESTART_INDEX_NV* = 0x00008559 # GL_NV_register_combiners - GL_REGISTER_COMBINERS_NV* = 0x00008522 - GL_VARIABLE_A_NV* = 0x00008523 - GL_VARIABLE_B_NV* = 0x00008524 - GL_VARIABLE_C_NV* = 0x00008525 - GL_VARIABLE_D_NV* = 0x00008526 - GL_VARIABLE_E_NV* = 0x00008527 - GL_VARIABLE_F_NV* = 0x00008528 - GL_VARIABLE_G_NV* = 0x00008529 - GL_CONSTANT_COLOR0_NV* = 0x0000852A - GL_CONSTANT_COLOR1_NV* = 0x0000852B - GL_PRIMARY_COLOR_NV* = 0x0000852C - GL_SECONDARY_COLOR_NV* = 0x0000852D - GL_SPARE0_NV* = 0x0000852E - GL_SPARE1_NV* = 0x0000852F - GL_DISCARD_NV* = 0x00008530 - GL_E_TIMES_F_NV* = 0x00008531 - GL_SPARE0_PLUS_SECONDARY_COLOR_NV* = 0x00008532 - GL_UNSIGNED_IDENTITY_NV* = 0x00008536 - GL_UNSIGNED_INVERT_NV* = 0x00008537 - GL_EXPAND_NORMAL_NV* = 0x00008538 - GL_EXPAND_NEGATE_NV* = 0x00008539 - GL_HALF_BIAS_NORMAL_NV* = 0x0000853A - GL_HALF_BIAS_NEGATE_NV* = 0x0000853B - GL_SIGNED_IDENTITY_NV* = 0x0000853C - GL_SIGNED_NEGATE_NV* = 0x0000853D - GL_SCALE_BY_TWO_NV* = 0x0000853E - GL_SCALE_BY_FOUR_NV* = 0x0000853F - GL_SCALE_BY_ONE_HALF_NV* = 0x00008540 - GL_BIAS_BY_NEGATIVE_ONE_HALF_NV* = 0x00008541 - cGL_COMBINER_INPUT_NV* = 0x00008542 - GL_COMBINER_MAPPING_NV* = 0x00008543 - GL_COMBINER_COMPONENT_USAGE_NV* = 0x00008544 - GL_COMBINER_AB_DOT_PRODUCT_NV* = 0x00008545 - GL_COMBINER_CD_DOT_PRODUCT_NV* = 0x00008546 - GL_COMBINER_MUX_SUM_NV* = 0x00008547 - GL_COMBINER_SCALE_NV* = 0x00008548 - GL_COMBINER_BIAS_NV* = 0x00008549 - GL_COMBINER_AB_OUTPUT_NV* = 0x0000854A - GL_COMBINER_CD_OUTPUT_NV* = 0x0000854B - GL_COMBINER_SUM_OUTPUT_NV* = 0x0000854C - GL_MAX_GENERAL_COMBINERS_NV* = 0x0000854D - GL_NUM_GENERAL_COMBINERS_NV* = 0x0000854E - GL_COLOR_SUM_CLAMP_NV* = 0x0000854F - GL_COMBINER0_NV* = 0x00008550 - GL_COMBINER1_NV* = 0x00008551 - GL_COMBINER2_NV* = 0x00008552 - GL_COMBINER3_NV* = 0x00008553 - GL_COMBINER4_NV* = 0x00008554 - GL_COMBINER5_NV* = 0x00008555 - GL_COMBINER6_NV* = 0x00008556 - GL_COMBINER7_NV* = 0x00008557 # GL_NV_register_combiners2 - GL_PER_STAGE_CONSTANTS_NV* = 0x00008535 # GL_NV_texgen_emboss - GL_EMBOSS_LIGHT_NV* = 0x0000855D - GL_EMBOSS_CONSTANT_NV* = 0x0000855E - GL_EMBOSS_MAP_NV* = 0x0000855F # GL_NV_texgen_reflection - GL_NORMAL_MAP_NV* = 0x00008511 - GL_REFLECTION_MAP_NV* = 0x00008512 # GL_NV_texture_env_combine4 - GL_COMBINE4_NV* = 0x00008503 - GL_SOURCE3_RGB_NV* = 0x00008583 - GL_SOURCE3_ALPHA_NV* = 0x0000858B - GL_OPERAND3_RGB_NV* = 0x00008593 - GL_OPERAND3_ALPHA_NV* = 0x0000859B # GL_NV_texture_expand_normal - GL_TEXTURE_UNSIGNED_REMAP_MODE_NV* = 0x0000888F # GL_NV_texture_rectangle - GL_TEXTURE_RECTANGLE_NV* = 0x000084F5 - GL_TEXTURE_BINDING_RECTANGLE_NV* = 0x000084F6 - GL_PROXY_TEXTURE_RECTANGLE_NV* = 0x000084F7 - GL_MAX_RECTANGLE_TEXTURE_SIZE_NV* = 0x000084F8 # GL_NV_texture_shader - GL_OFFSET_TEXTURE_RECTANGLE_NV* = 0x0000864C - GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV* = 0x0000864D - GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV* = 0x0000864E - GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV* = 0x000086D9 - GL_UNSIGNED_INT_S8_S8_8_8_NV* = 0x000086DA - GL_UNSIGNED_INT_8_8_S8_S8_REV_NV* = 0x000086DB - GL_DSDT_MAG_INTENSITY_NV* = 0x000086DC - GL_SHADER_CONSISTENT_NV* = 0x000086DD - GL_TEXTURE_SHADER_NV* = 0x000086DE - GL_SHADER_OPERATION_NV* = 0x000086DF - GL_CULL_MODES_NV* = 0x000086E0 - GL_OFFSET_TEXTURE_MATRIX_NV* = 0x000086E1 - GL_OFFSET_TEXTURE_SCALE_NV* = 0x000086E2 - GL_OFFSET_TEXTURE_BIAS_NV* = 0x000086E3 - GL_OFFSET_TEXTURE_2D_MATRIX_NV* = GL_OFFSET_TEXTURE_MATRIX_NV - GL_OFFSET_TEXTURE_2D_SCALE_NV* = GL_OFFSET_TEXTURE_SCALE_NV - GL_OFFSET_TEXTURE_2D_BIAS_NV* = GL_OFFSET_TEXTURE_BIAS_NV - GL_PREVIOUS_TEXTURE_INPUT_NV* = 0x000086E4 - GL_CONST_EYE_NV* = 0x000086E5 - GL_PASS_THROUGH_NV* = 0x000086E6 - GL_CULL_FRAGMENT_NV* = 0x000086E7 - GL_OFFSET_TEXTURE_2D_NV* = 0x000086E8 - GL_DEPENDENT_AR_TEXTURE_2D_NV* = 0x000086E9 - GL_DEPENDENT_GB_TEXTURE_2D_NV* = 0x000086EA - GL_DOT_PRODUCT_NV* = 0x000086EC - GL_DOT_PRODUCT_DEPTH_REPLACE_NV* = 0x000086ED - GL_DOT_PRODUCT_TEXTURE_2D_NV* = 0x000086EE - GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV* = 0x000086F0 - GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV* = 0x000086F1 - GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV* = 0x000086F2 - GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV* = 0x000086F3 - GL_HILO_NV* = 0x000086F4 - GL_DSDT_NV* = 0x000086F5 - GL_DSDT_MAG_NV* = 0x000086F6 - GL_DSDT_MAG_VIB_NV* = 0x000086F7 - GL_HILO16_NV* = 0x000086F8 - GL_SIGNED_HILO_NV* = 0x000086F9 - GL_SIGNED_HILO16_NV* = 0x000086FA - GL_SIGNED_RGBA_NV* = 0x000086FB - GL_SIGNED_RGBA8_NV* = 0x000086FC - GL_SIGNED_RGB_NV* = 0x000086FE - GL_SIGNED_RGB8_NV* = 0x000086FF - GL_SIGNED_LUMINANCE_NV* = 0x00008701 - GL_SIGNED_LUMINANCE8_NV* = 0x00008702 - GL_SIGNED_LUMINANCE_ALPHA_NV* = 0x00008703 - GL_SIGNED_LUMINANCE8_ALPHA8_NV* = 0x00008704 - GL_SIGNED_ALPHA_NV* = 0x00008705 - GL_SIGNED_ALPHA8_NV* = 0x00008706 - GL_SIGNED_INTENSITY_NV* = 0x00008707 - GL_SIGNED_INTENSITY8_NV* = 0x00008708 - GL_DSDT8_NV* = 0x00008709 - GL_DSDT8_MAG8_NV* = 0x0000870A - GL_DSDT8_MAG8_INTENSITY8_NV* = 0x0000870B - GL_SIGNED_RGB_UNSIGNED_ALPHA_NV* = 0x0000870C - GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV* = 0x0000870D - GL_HI_SCALE_NV* = 0x0000870E - GL_LO_SCALE_NV* = 0x0000870F - GL_DS_SCALE_NV* = 0x00008710 - GL_DT_SCALE_NV* = 0x00008711 - GL_MAGNITUDE_SCALE_NV* = 0x00008712 - GL_VIBRANCE_SCALE_NV* = 0x00008713 - GL_HI_BIAS_NV* = 0x00008714 - GL_LO_BIAS_NV* = 0x00008715 - GL_DS_BIAS_NV* = 0x00008716 - GL_DT_BIAS_NV* = 0x00008717 - GL_MAGNITUDE_BIAS_NV* = 0x00008718 - GL_VIBRANCE_BIAS_NV* = 0x00008719 - GL_TEXTURE_BORDER_VALUES_NV* = 0x0000871A - GL_TEXTURE_HI_SIZE_NV* = 0x0000871B - GL_TEXTURE_LO_SIZE_NV* = 0x0000871C - GL_TEXTURE_DS_SIZE_NV* = 0x0000871D - GL_TEXTURE_DT_SIZE_NV* = 0x0000871E - GL_TEXTURE_MAG_SIZE_NV* = 0x0000871F # GL_NV_texture_shader2 - GL_DOT_PRODUCT_TEXTURE_3D_NV* = 0x000086EF # GL_NV_texture_shader3 - GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV* = 0x00008850 - GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV* = 0x00008851 - GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV* = 0x00008852 - GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV* = 0x00008853 - GL_OFFSET_HILO_TEXTURE_2D_NV* = 0x00008854 - GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV* = 0x00008855 - GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV* = 0x00008856 - GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV* = 0x00008857 - GL_DEPENDENT_HILO_TEXTURE_2D_NV* = 0x00008858 - GL_DEPENDENT_RGB_TEXTURE_3D_NV* = 0x00008859 - GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV* = 0x0000885A - GL_DOT_PRODUCT_PASS_THROUGH_NV* = 0x0000885B - GL_DOT_PRODUCT_TEXTURE_1D_NV* = 0x0000885C - GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV* = 0x0000885D - GL_HILO8_NV* = 0x0000885E - GL_SIGNED_HILO8_NV* = 0x0000885F - GL_FORCE_BLUE_TO_ONE_NV* = 0x00008860 # GL_NV_vertex_array_range - cGL_VERTEX_ARRAY_RANGE_NV* = 0x0000851D - GL_VERTEX_ARRAY_RANGE_LENGTH_NV* = 0x0000851E - GL_VERTEX_ARRAY_RANGE_VALID_NV* = 0x0000851F - GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV* = 0x00008520 - GL_VERTEX_ARRAY_RANGE_POINTER_NV* = 0x00008521 # GL_NV_vertex_array_range2 - GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV* = 0x00008533 # GL_NV_vertex_program - GL_VERTEX_PROGRAM_NV* = 0x00008620 - GL_VERTEX_STATE_PROGRAM_NV* = 0x00008621 - GL_ATTRIB_ARRAY_SIZE_NV* = 0x00008623 - GL_ATTRIB_ARRAY_STRIDE_NV* = 0x00008624 - GL_ATTRIB_ARRAYtyp_NV* = 0x00008625 - GL_CURRENT_ATTRIB_NV* = 0x00008626 - GL_PROGRAM_LENGTH_NV* = 0x00008627 - GL_PROGRAM_STRING_NV* = 0x00008628 - GL_MODELVIEW_PROJECTION_NV* = 0x00008629 - GL_IDENTITY_NV* = 0x0000862A - GL_INVERSE_NV* = 0x0000862B - GL_TRANSPOSE_NV* = 0x0000862C - GL_INVERSE_TRANSPOSE_NV* = 0x0000862D - GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV* = 0x0000862E - GL_MAX_TRACK_MATRICES_NV* = 0x0000862F - GL_MATRIX0_NV* = 0x00008630 - GL_MATRIX1_NV* = 0x00008631 - GL_MATRIX2_NV* = 0x00008632 - GL_MATRIX3_NV* = 0x00008633 - GL_MATRIX4_NV* = 0x00008634 - GL_MATRIX5_NV* = 0x00008635 - GL_MATRIX6_NV* = 0x00008636 - GL_MATRIX7_NV* = 0x00008637 - GL_CURRENT_MATRIX_STACK_DEPTH_NV* = 0x00008640 - GL_CURRENT_MATRIX_NV* = 0x00008641 - GL_VERTEX_PROGRAM_POINT_SIZE_NV* = 0x00008642 - GL_VERTEX_PROGRAM_TWO_SIDE_NV* = 0x00008643 - GL_PROGRAM_PARAMETER_NV* = 0x00008644 - GL_ATTRIB_ARRAY_POINTER_NV* = 0x00008645 - GL_PROGRAM_TARGET_NV* = 0x00008646 - GL_PROGRAM_RESIDENT_NV* = 0x00008647 - cGL_TRACK_MATRIX_NV* = 0x00008648 - GL_TRACK_MATRIX_TRANSFORM_NV* = 0x00008649 - GL_VERTEX_PROGRAM_BINDING_NV* = 0x0000864A - GL_PROGRAM_ERROR_POSITION_NV* = 0x0000864B - GL_VERTEX_ATTRIB_ARRAY0_NV* = 0x00008650 - GL_VERTEX_ATTRIB_ARRAY1_NV* = 0x00008651 - GL_VERTEX_ATTRIB_ARRAY2_NV* = 0x00008652 - GL_VERTEX_ATTRIB_ARRAY3_NV* = 0x00008653 - GL_VERTEX_ATTRIB_ARRAY4_NV* = 0x00008654 - GL_VERTEX_ATTRIB_ARRAY5_NV* = 0x00008655 - GL_VERTEX_ATTRIB_ARRAY6_NV* = 0x00008656 - GL_VERTEX_ATTRIB_ARRAY7_NV* = 0x00008657 - GL_VERTEX_ATTRIB_ARRAY8_NV* = 0x00008658 - GL_VERTEX_ATTRIB_ARRAY9_NV* = 0x00008659 - GL_VERTEX_ATTRIB_ARRAY10_NV* = 0x0000865A - GL_VERTEX_ATTRIB_ARRAY11_NV* = 0x0000865B - GL_VERTEX_ATTRIB_ARRAY12_NV* = 0x0000865C - GL_VERTEX_ATTRIB_ARRAY13_NV* = 0x0000865D - GL_VERTEX_ATTRIB_ARRAY14_NV* = 0x0000865E - GL_VERTEX_ATTRIB_ARRAY15_NV* = 0x0000865F - GL_MAP1_VERTEX_ATTRIB0_4_NV* = 0x00008660 - GL_MAP1_VERTEX_ATTRIB1_4_NV* = 0x00008661 - GL_MAP1_VERTEX_ATTRIB2_4_NV* = 0x00008662 - GL_MAP1_VERTEX_ATTRIB3_4_NV* = 0x00008663 - GL_MAP1_VERTEX_ATTRIB4_4_NV* = 0x00008664 - GL_MAP1_VERTEX_ATTRIB5_4_NV* = 0x00008665 - GL_MAP1_VERTEX_ATTRIB6_4_NV* = 0x00008666 - GL_MAP1_VERTEX_ATTRIB7_4_NV* = 0x00008667 - GL_MAP1_VERTEX_ATTRIB8_4_NV* = 0x00008668 - GL_MAP1_VERTEX_ATTRIB9_4_NV* = 0x00008669 - GL_MAP1_VERTEX_ATTRIB10_4_NV* = 0x0000866A - GL_MAP1_VERTEX_ATTRIB11_4_NV* = 0x0000866B - GL_MAP1_VERTEX_ATTRIB12_4_NV* = 0x0000866C - GL_MAP1_VERTEX_ATTRIB13_4_NV* = 0x0000866D - GL_MAP1_VERTEX_ATTRIB14_4_NV* = 0x0000866E - GL_MAP1_VERTEX_ATTRIB15_4_NV* = 0x0000866F - GL_MAP2_VERTEX_ATTRIB0_4_NV* = 0x00008670 - GL_MAP2_VERTEX_ATTRIB1_4_NV* = 0x00008671 - GL_MAP2_VERTEX_ATTRIB2_4_NV* = 0x00008672 - GL_MAP2_VERTEX_ATTRIB3_4_NV* = 0x00008673 - GL_MAP2_VERTEX_ATTRIB4_4_NV* = 0x00008674 - GL_MAP2_VERTEX_ATTRIB5_4_NV* = 0x00008675 - GL_MAP2_VERTEX_ATTRIB6_4_NV* = 0x00008676 - GL_MAP2_VERTEX_ATTRIB7_4_NV* = 0x00008677 - GL_MAP2_VERTEX_ATTRIB8_4_NV* = 0x00008678 - GL_MAP2_VERTEX_ATTRIB9_4_NV* = 0x00008679 - GL_MAP2_VERTEX_ATTRIB10_4_NV* = 0x0000867A - GL_MAP2_VERTEX_ATTRIB11_4_NV* = 0x0000867B - GL_MAP2_VERTEX_ATTRIB12_4_NV* = 0x0000867C - GL_MAP2_VERTEX_ATTRIB13_4_NV* = 0x0000867D - GL_MAP2_VERTEX_ATTRIB14_4_NV* = 0x0000867E - GL_MAP2_VERTEX_ATTRIB15_4_NV* = 0x0000867F # GL_NV_fragment_program2 and GL_NV_vertex_program2_option - GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV* = 0x000088F4 - GL_MAX_PROGRAM_CALL_DEPTH_NV* = 0x000088F5 # GL_NV_fragment_program2 - GL_MAX_PROGRAM_IF_DEPTH_NV* = 0x000088F6 - GL_MAX_PROGRAM_LOOP_DEPTH_NV* = 0x000088F7 - GL_MAX_PROGRAM_LOOP_COUNT_NV* = 0x000088F8 # GL_NV_vertex_program3 - MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB* = 0x00008B4C # GL_NV_depth_buffer_float - GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV* = 0x00008DAD - GL_DEPTH_BUFFER_FLOAT_MODE_NV* = 0x00008DAF # - # GL_NV_framebuffer_multisample_coverage - GL_RENDERBUFFER_COVERAGE_SAMPLES_NV* = 0x00008CAB - GL_RENDERBUFFER_COLOR_SAMPLES_NV* = 0x00008E10 # GL_NV_geometry_program4 - GL_GEOMETRY_PROGRAM_NV* = 0x00008C26 - GL_MAX_PROGRAM_OUTPUT_VERTICES_NV* = 0x00008C27 - GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV* = 0x00008C28 # GL_NV_gpu_program4 - GL_PROGRAM_ATTRIB_COMPONENTS_NV* = 0x00008906 - GL_PROGRAM_RESULT_COMPONENTS_NV* = 0x00008907 - GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV* = 0x00008908 - GL_MAX_PROGRAM_RESULT_COMPONENTS_NV* = 0x00008909 - GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV* = 0x00008DA5 - GL_MAX_PROGRAM_GENERIC_RESULTS_NV* = 0x00008DA6 # GL_NV_parameter_buffer_object - GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV* = 0x00008DA0 - GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV* = 0x00008DA1 - GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV* = 0x00008DA2 - GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV* = 0x00008DA3 - GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV* = 0x00008DA4 # GL_NV_transform_feedback - GL_TRANSFORM_FEEDBACK_BUFFER_NV* = 0x00008C8E - GL_TRANSFORM_FEEDBACK_BUFFER_START_NV* = 0x00008C84 - GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV* = 0x00008C85 - GL_TRANSFORM_FEEDBACK_RECORD_NV* = 0x00008C86 - GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV* = 0x00008C8F - GL_INTERLEAVED_ATTRIBS_NV* = 0x00008C8C - GL_SEPARATE_ATTRIBS_NV* = 0x00008C8D - GL_PRIMITIVES_GENERATED_NV* = 0x00008C87 - GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV* = 0x00008C88 - GL_RASTERIZER_DISCARD_NV* = 0x00008C89 - GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV* = 0x00008C8A - GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV* = 0x00008C8B - GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV* = 0x00008C80 - cGL_TRANSFORM_FEEDBACK_ATTRIBS_NV* = 0x00008C7E - GL_ACTIVE_VARYINGS_NV* = 0x00008C81 - GL_ACTIVE_VARYING_MAX_LENGTH_NV* = 0x00008C82 - cGL_TRANSFORM_FEEDBACK_VARYINGS_NV* = 0x00008C83 - GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV* = 0x00008C7F - GL_BACK_PRIMARY_COLOR_NV* = 0x00008C77 - GL_BACK_SECONDARY_COLOR_NV* = 0x00008C78 - GL_TEXTURE_COORD_NV* = 0x00008C79 - GL_CLIP_DISTANCE_NV* = 0x00008C7A - GL_VERTEX_ID_NV* = 0x00008C7B - GL_PRIMITIVE_ID_NV* = 0x00008C7C - GL_GENERIC_ATTRIB_NV* = 0x00008C7D - GL_LAYER_NV* = 0x00008DAA - GL_NEXT_BUFFER_NV* = - 2 - GL_SKIP_COMPONENTS4_NV* = - 3 - GL_SKIP_COMPONENTS3_NV* = - 4 - GL_SKIP_COMPONENTS2_NV* = - 5 - GL_SKIP_COMPONENTS1_NV* = - 6 # GL_NV_conditional_render - GL_QUERY_WAIT_NV* = 0x00008E13 - GL_QUERY_NO_WAIT_NV* = 0x00008E14 - GL_QUERY_BY_REGION_WAIT_NV* = 0x00008E15 - GL_QUERY_BY_REGION_NO_WAIT_NV* = 0x00008E16 # GL_NV_present_video - GL_FRAME_NV* = 0x00008E26 - GL_FIELDS_NV* = 0x00008E27 - GL_CURRENT_TIME_NV* = 0x00008E28 - GL_NUM_FILL_STREAMS_NV* = 0x00008E29 - GL_PRESENT_TIME_NV* = 0x00008E2A - GL_PRESENT_DURATION_NV* = 0x00008E2B # GL_NV_explicit_multisample - GL_SAMPLE_POSITION_NV* = 0x00008E50 - GL_SAMPLE_MASK_NV* = 0x00008E51 - GL_SAMPLE_MASK_VALUE_NV* = 0x00008E52 - GL_TEXTURE_BINDING_RENDERBUFFER_NV* = 0x00008E53 - GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV* = 0x00008E54 - GL_TEXTURE_RENDERBUFFER_NV* = 0x00008E55 - GL_SAMPLER_RENDERBUFFER_NV* = 0x00008E56 - GL_INT_SAMPLER_RENDERBUFFER_NV* = 0x00008E57 - GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV* = 0x00008E58 - GL_MAX_SAMPLE_MASK_WORDS_NV* = 0x00008E59 # GL_NV_transform_feedback2 - GL_TRANSFORM_FEEDBACK_NV* = 0x00008E22 - GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV* = 0x00008E23 - GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV* = 0x00008E24 - GL_TRANSFORM_FEEDBACK_BINDING_NV* = 0x00008E25 # GL_NV_video_capture - GL_VIDEO_BUFFER_NV* = 0x00009020 - GL_VIDEO_BUFFER_BINDING_NV* = 0x00009021 - GL_FIELD_UPPER_NV* = 0x00009022 - GL_FIELD_LOWER_NV* = 0x00009023 - GL_NUM_VIDEO_CAPTURE_STREAMS_NV* = 0x00009024 - GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV* = 0x00009025 - GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV* = 0x00009026 - GL_LAST_VIDEO_CAPTURE_STATUS_NV* = 0x00009027 - GL_VIDEO_BUFFER_PITCH_NV* = 0x00009028 - GL_VIDEO_COLOR_CONVERSION_MATRIX_NV* = 0x00009029 - GL_VIDEO_COLOR_CONVERSION_MAX_NV* = 0x0000902A - GL_VIDEO_COLOR_CONVERSION_MIN_NV* = 0x0000902B - GL_VIDEO_COLOR_CONVERSION_OFFSET_NV* = 0x0000902C - GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV* = 0x0000902D - GL_PARTIAL_SUCCESS_NV* = 0x0000902E - GL_SUCCESS_NV* = 0x0000902F - GL_FAILURE_NV* = 0x00009030 - GL_YCBYCR8_422_NV* = 0x00009031 - GL_YCBAYCR8A_4224_NV* = 0x00009032 - GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV* = 0x00009033 - GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV* = 0x00009034 - GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV* = 0x00009035 - GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV* = 0x00009036 - GL_Z4Y12Z4CB12Z4CR12_444_NV* = 0x00009037 - GL_VIDEO_CAPTURE_FRAME_WIDTH_NV* = 0x00009038 - GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV* = 0x00009039 - GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV* = 0x0000903A - GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV* = 0x0000903B - GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV* = 0x0000903C # GL_NV_shader_buffer_load - GL_BUFFER_GPU_ADDRESS_NV* = 0x00008F1D - GL_GPU_ADDRESS_NV* = 0x00008F34 - GL_MAX_SHADER_BUFFER_ADDRESS_NV* = 0x00008F35 # - # GL_NV_vertex_buffer_unified_memory - GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV* = 0x00008F1E - GL_ELEMENT_ARRAY_UNIFIED_NV* = 0x00008F1F - GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV* = 0x00008F20 - GL_VERTEX_ARRAY_ADDRESS_NV* = 0x00008F21 - GL_NORMAL_ARRAY_ADDRESS_NV* = 0x00008F22 - GL_COLOR_ARRAY_ADDRESS_NV* = 0x00008F23 - GL_INDEX_ARRAY_ADDRESS_NV* = 0x00008F24 - GL_TEXTURE_COORD_ARRAY_ADDRESS_NV* = 0x00008F25 - GL_EDGE_FLAG_ARRAY_ADDRESS_NV* = 0x00008F26 - GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV* = 0x00008F27 - GL_FOG_COORD_ARRAY_ADDRESS_NV* = 0x00008F28 - GL_ELEMENT_ARRAY_ADDRESS_NV* = 0x00008F29 - GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV* = 0x00008F2A - GL_VERTEX_ARRAY_LENGTH_NV* = 0x00008F2B - GL_NORMAL_ARRAY_LENGTH_NV* = 0x00008F2C - GL_COLOR_ARRAY_LENGTH_NV* = 0x00008F2D - GL_INDEX_ARRAY_LENGTH_NV* = 0x00008F2E - GL_TEXTURE_COORD_ARRAY_LENGTH_NV* = 0x00008F2F - GL_EDGE_FLAG_ARRAY_LENGTH_NV* = 0x00008F30 - GL_SECONDARY_COLOR_ARRAY_LENGTH_NV* = 0x00008F31 - GL_FOG_COORD_ARRAY_LENGTH_NV* = 0x00008F32 - GL_ELEMENT_ARRAY_LENGTH_NV* = 0x00008F33 - GL_DRAW_INDIRECT_UNIFIED_NV* = 0x00008F40 - GL_DRAW_INDIRECT_ADDRESS_NV* = 0x00008F41 - GL_DRAW_INDIRECT_LENGTH_NV* = 0x00008F42 # GL_NV_gpu_program5 - GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV* = 0x00008E5A - GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV* = 0x00008E5B - GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV* = 0x00008E5C - GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV* = 0x00008E5D - GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV* = 0x00008E5E - GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV* = 0x00008E5F - GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV* = 0x00008F44 - GL_MAX_PROGRAM_SUBROUTINE_NUM_NV* = 0x00008F45 # GL_NV_gpu_shader5 - GL_INT64_NV* = 0x0000140E - GL_UNSIGNED_INT64_NV* = 0x0000140F - GL_INT8_NV* = 0x00008FE0 - GL_INT8_VEC2_NV* = 0x00008FE1 - GL_INT8_VEC3_NV* = 0x00008FE2 - GL_INT8_VEC4_NV* = 0x00008FE3 - GL_INT16_NV* = 0x00008FE4 - GL_INT16_VEC2_NV* = 0x00008FE5 - GL_INT16_VEC3_NV* = 0x00008FE6 - GL_INT16_VEC4_NV* = 0x00008FE7 - GL_INT64_VEC2_NV* = 0x00008FE9 - GL_INT64_VEC3_NV* = 0x00008FEA - GL_INT64_VEC4_NV* = 0x00008FEB - GL_UNSIGNED_INT8_NV* = 0x00008FEC - GL_UNSIGNED_INT8_VEC2_NV* = 0x00008FED - GL_UNSIGNED_INT8_VEC3_NV* = 0x00008FEE - GL_UNSIGNED_INT8_VEC4_NV* = 0x00008FEF - GL_UNSIGNED_INT16_NV* = 0x00008FF0 - GL_UNSIGNED_INT16_VEC2_NV* = 0x00008FF1 - GL_UNSIGNED_INT16_VEC3_NV* = 0x00008FF2 - GL_UNSIGNED_INT16_VEC4_NV* = 0x00008FF3 - GL_UNSIGNED_INT64_VEC2_NV* = 0x00008FF5 - GL_UNSIGNED_INT64_VEC3_NV* = 0x00008FF6 - GL_UNSIGNED_INT64_VEC4_NV* = 0x00008FF7 - GL_FLOAT16_NV* = 0x00008FF8 - GL_FLOAT16_VEC2_NV* = 0x00008FF9 - GL_FLOAT16_VEC3_NV* = 0x00008FFA - GL_FLOAT16_VEC4_NV* = 0x00008FFB # reuse GL_PATCHES - # GL_NV_shader_buffer_store - GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV* = 0x00000010 # reuse GL_READ_WRITE - # reuse GL_WRITE_ONLY - # - # GL_NV_tessellation_program5 - GL_MAX_PROGRAM_PATCH_ATTRIBS_NV* = 0x000086D8 - GL_TESS_CONTROL_PROGRAM_NV* = 0x0000891E - GL_TESS_EVALUATION_PROGRAM_NV* = 0x0000891F - GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV* = 0x00008C74 - GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV* = 0x00008C75 # - # GL_NV_vertex_attrib_integer_64bit - # reuse GL_INT64_NV - # reuse - # GL_UNSIGNED_INT64_NV - # - # GL_NV_multisample_coverage - GL_COVERAGE_SAMPLES_NV* = 0x000080A9 - GL_COLOR_SAMPLES_NV* = 0x00008E20 # GL_NV_vdpau_interop - GL_SURFACE_STATE_NV* = 0x000086EB - GL_SURFACE_REGISTERED_NV* = 0x000086FD - GL_SURFACE_MAPPED_NV* = 0x00008700 - GL_WRITE_DISCARD_NV* = 0x000088BE # GL_OML_interlace - GL_INTERLACE_OML* = 0x00008980 - GL_INTERLACE_READ_OML* = 0x00008981 # GL_OML_resample - GL_PACK_RESAMPLE_OML* = 0x00008984 - GL_UNPACK_RESAMPLE_OML* = 0x00008985 - GL_RESAMPLE_REPLICATE_OML* = 0x00008986 - GL_RESAMPLE_ZERO_FILL_OML* = 0x00008987 - GL_RESAMPLE_AVERAGE_OML* = 0x00008988 - GL_RESAMPLE_DECIMATE_OML* = 0x00008989 # GL_OML_subsample - GL_FORMAT_SUBSAMPLE_24_24_OML* = 0x00008982 - GL_FORMAT_SUBSAMPLE_244_244_OML* = 0x00008983 # GL_PGI_misc_hints - GL_PREFER_DOUBLEBUFFER_HINT_PGI* = 0x0001A1F8 - GL_CONSERVE_MEMORY_HINT_PGI* = 0x0001A1FD - GL_RECLAIM_MEMORY_HINT_PGI* = 0x0001A1FE - GL_NATIVE_GRAPHICS_HANDLE_PGI* = 0x0001A202 - GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI* = 0x0001A203 - GL_NATIVE_GRAPHICS_END_HINT_PGI* = 0x0001A204 - GL_ALWAYS_FAST_HINT_PGI* = 0x0001A20C - GL_ALWAYS_SOFT_HINT_PGI* = 0x0001A20D - GL_ALLOW_DRAW_OBJ_HINT_PGI* = 0x0001A20E - GL_ALLOW_DRAW_WIN_HINT_PGI* = 0x0001A20F - GL_ALLOW_DRAW_FRG_HINT_PGI* = 0x0001A210 - GL_ALLOW_DRAW_MEM_HINT_PGI* = 0x0001A211 - GL_STRICT_DEPTHFUNC_HINT_PGI* = 0x0001A216 - GL_STRICT_LIGHTING_HINT_PGI* = 0x0001A217 - GL_STRICT_SCISSOR_HINT_PGI* = 0x0001A218 - GL_FULL_STIPPLE_HINT_PGI* = 0x0001A219 - GL_CLIP_NEAR_HINT_PGI* = 0x0001A220 - GL_CLIP_FAR_HINT_PGI* = 0x0001A221 - GL_WIDE_LINE_HINT_PGI* = 0x0001A222 - GL_BACK_NORMALS_HINT_PGI* = 0x0001A223 # GL_PGI_vertex_hints - GL_VERTEX_DATA_HINT_PGI* = 0x0001A22A - GL_VERTEX_CONSISTENT_HINT_PGI* = 0x0001A22B - GL_MATERIAL_SIDE_HINT_PGI* = 0x0001A22C - GL_MAX_VERTEX_HINT_PGI* = 0x0001A22D - GL_COLOR3_BIT_PGI* = 0x00010000 - GL_COLOR4_BIT_PGI* = 0x00020000 - GL_EDGEFLAG_BIT_PGI* = 0x00040000 - GL_INDEX_BIT_PGI* = 0x00080000 - GL_MAT_AMBIENT_BIT_PGI* = 0x00100000 - GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI* = 0x00200000 - GL_MAT_DIFFUSE_BIT_PGI* = 0x00400000 - GL_MAT_EMISSION_BIT_PGI* = 0x00800000 - GL_MAT_COLOR_INDEXES_BIT_PGI* = 0x01000000 - GL_MAT_SHININESS_BIT_PGI* = 0x02000000 - GL_MAT_SPECULAR_BIT_PGI* = 0x04000000 - GL_NORMAL_BIT_PGI* = 0x08000000 - GL_TEXCOORD1_BIT_PGI* = 0x10000000 - GL_TEXCOORD2_BIT_PGI* = 0x20000000 - GL_TEXCOORD3_BIT_PGI* = 0x40000000 - GL_TEXCOORD4_BIT_PGI* = 0x80000000 - GL_VERTEX23_BIT_PGI* = 0x00000004 - GL_VERTEX4_BIT_PGI* = 0x00000008 # GL_REND_screen_coordinates - GL_SCREEN_COORDINATES_REND* = 0x00008490 - GL_INVERTED_SCREEN_W_REND* = 0x00008491 # GL_S3_s3tc - GL_RGB_S3TC* = 0x000083A0 - GL_RGB4_S3TC* = 0x000083A1 - GL_RGBA_S3TC* = 0x000083A2 - GL_RGBA4_S3TC* = 0x000083A3 # GL_SGIS_detail_texture - GL_DETAIL_TEXTURE_2D_SGIS* = 0x00008095 - GL_DETAIL_TEXTURE_2D_BINDING_SGIS* = 0x00008096 - GL_LINEAR_DETAIL_SGIS* = 0x00008097 - GL_LINEAR_DETAIL_ALPHA_SGIS* = 0x00008098 - GL_LINEAR_DETAIL_COLOR_SGIS* = 0x00008099 - GL_DETAIL_TEXTURE_LEVEL_SGIS* = 0x0000809A - GL_DETAIL_TEXTURE_MODE_SGIS* = 0x0000809B - GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS* = 0x0000809C # GL_SGIS_fog_function - cGL_FOG_FUNC_SGIS* = 0x0000812A - GL_FOG_FUNC_POINTS_SGIS* = 0x0000812B - GL_MAX_FOG_FUNC_POINTS_SGIS* = 0x0000812C # GL_SGIS_generate_mipmap - GL_GENERATE_MIPMAP_SGIS* = 0x00008191 - GL_GENERATE_MIPMAP_HINT_SGIS* = 0x00008192 # GL_SGIS_multisample - GL_MULTISAMPLE_SGIS* = 0x0000809D - GL_SAMPLE_ALPHA_TO_MASK_SGIS* = 0x0000809E - GL_SAMPLE_ALPHA_TO_ONE_SGIS* = 0x0000809F - cGL_SAMPLE_MASK_SGIS* = 0x000080A0 - GL_1PASS_SGIS* = 0x000080A1 - GL_2PASS_0_SGIS* = 0x000080A2 - GL_2PASS_1_SGIS* = 0x000080A3 - GL_4PASS_0_SGIS* = 0x000080A4 - GL_4PASS_1_SGIS* = 0x000080A5 - GL_4PASS_2_SGIS* = 0x000080A6 - GL_4PASS_3_SGIS* = 0x000080A7 - GL_SAMPLE_BUFFERS_SGIS* = 0x000080A8 - GL_SAMPLES_SGIS* = 0x000080A9 - GL_SAMPLE_MASK_VALUE_SGIS* = 0x000080AA - GL_SAMPLE_MASK_INVERT_SGIS* = 0x000080AB - cGL_SAMPLE_PATTERN_SGIS* = 0x000080AC # GL_SGIS_pixel_texture - GL_PIXEL_TEXTURE_SGIS* = 0x00008353 - GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS* = 0x00008354 - GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS* = 0x00008355 - GL_PIXEL_GROUP_COLOR_SGIS* = 0x00008356 # GL_SGIS_point_line_texgen - GL_EYE_DISTANCE_TO_POINT_SGIS* = 0x000081F0 - GL_OBJECT_DISTANCE_TO_POINT_SGIS* = 0x000081F1 - GL_EYE_DISTANCE_TO_LINE_SGIS* = 0x000081F2 - GL_OBJECT_DISTANCE_TO_LINE_SGIS* = 0x000081F3 - GL_EYE_POINT_SGIS* = 0x000081F4 - GL_OBJECT_POINT_SGIS* = 0x000081F5 - GL_EYE_LINE_SGIS* = 0x000081F6 - GL_OBJECT_LINE_SGIS* = 0x000081F7 # GL_SGIS_point_parameters - GL_POINT_SIZE_MIN_SGIS* = 0x00008126 - GL_POINT_SIZE_MAX_SGIS* = 0x00008127 - GL_POINT_FADE_THRESHOLD_SIZE_SGIS* = 0x00008128 - GL_DISTANCE_ATTENUATION_SGIS* = 0x00008129 # GL_SGIS_sharpen_texture - GL_LINEAR_SHARPEN_SGIS* = 0x000080AD - GL_LINEAR_SHARPEN_ALPHA_SGIS* = 0x000080AE - GL_LINEAR_SHARPEN_COLOR_SGIS* = 0x000080AF - GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS* = 0x000080B0 # GL_SGIS_texture4D - GL_PACK_SKIP_VOLUMES_SGIS* = 0x00008130 - GL_PACK_IMAGE_DEPTH_SGIS* = 0x00008131 - GL_UNPACK_SKIP_VOLUMES_SGIS* = 0x00008132 - GL_UNPACK_IMAGE_DEPTH_SGIS* = 0x00008133 - GL_TEXTURE_4D_SGIS* = 0x00008134 - GL_PROXY_TEXTURE_4D_SGIS* = 0x00008135 - GL_TEXTURE_4DSIZE_SGIS* = 0x00008136 - GL_TEXTURE_WRAP_Q_SGIS* = 0x00008137 - GL_MAX_4D_TEXTURE_SIZE_SGIS* = 0x00008138 - GL_TEXTURE_4D_BINDING_SGIS* = 0x0000814F # GL_SGIS_texture_color_mask - GL_TEXTURE_COLOR_WRITEMASK_SGIS* = 0x000081EF # GL_SGIS_texture_edge_clamp - GL_CLAMP_TO_EDGE_SGIS* = 0x0000812F # GL_SGIS_texture_filter4 - GL_FILTER4_SGIS* = 0x00008146 - GL_TEXTURE_FILTER4_SIZE_SGIS* = 0x00008147 # GL_SGIS_texture_lod - GL_TEXTURE_MIN_LOD_SGIS* = 0x0000813A - GL_TEXTURE_MAX_LOD_SGIS* = 0x0000813B - GL_TEXTURE_BASE_LEVEL_SGIS* = 0x0000813C - GL_TEXTURE_MAX_LEVEL_SGIS* = 0x0000813D # GL_SGIS_texture_select - GL_DUAL_ALPHA4_SGIS* = 0x00008110 - GL_DUAL_ALPHA8_SGIS* = 0x00008111 - GL_DUAL_ALPHA12_SGIS* = 0x00008112 - GL_DUAL_ALPHA16_SGIS* = 0x00008113 - GL_DUAL_LUMINANCE4_SGIS* = 0x00008114 - GL_DUAL_LUMINANCE8_SGIS* = 0x00008115 - GL_DUAL_LUMINANCE12_SGIS* = 0x00008116 - GL_DUAL_LUMINANCE16_SGIS* = 0x00008117 - GL_DUAL_INTENSITY4_SGIS* = 0x00008118 - GL_DUAL_INTENSITY8_SGIS* = 0x00008119 - GL_DUAL_INTENSITY12_SGIS* = 0x0000811A - GL_DUAL_INTENSITY16_SGIS* = 0x0000811B - GL_DUAL_LUMINANCE_ALPHA4_SGIS* = 0x0000811C - GL_DUAL_LUMINANCE_ALPHA8_SGIS* = 0x0000811D - GL_QUAD_ALPHA4_SGIS* = 0x0000811E - GL_QUAD_ALPHA8_SGIS* = 0x0000811F - GL_QUAD_LUMINANCE4_SGIS* = 0x00008120 - GL_QUAD_LUMINANCE8_SGIS* = 0x00008121 - GL_QUAD_INTENSITY4_SGIS* = 0x00008122 - GL_QUAD_INTENSITY8_SGIS* = 0x00008123 - GL_DUAL_TEXTURE_SELECT_SGIS* = 0x00008124 - GL_QUAD_TEXTURE_SELECT_SGIS* = 0x00008125 # GL_SGIX_async - cGL_ASYNC_MARKER_SGIX* = 0x00008329 # GL_SGIX_async_histogram - GL_ASYNC_HISTOGRAM_SGIX* = 0x0000832C - GL_MAX_ASYNC_HISTOGRAM_SGIX* = 0x0000832D # GL_SGIX_async_pixel - GL_ASYNC_TEX_IMAGE_SGIX* = 0x0000835C - GL_ASYNC_DRAW_PIXELS_SGIX* = 0x0000835D - GL_ASYNC_READ_PIXELS_SGIX* = 0x0000835E - GL_MAX_ASYNC_TEX_IMAGE_SGIX* = 0x0000835F - GL_MAX_ASYNC_DRAW_PIXELS_SGIX* = 0x00008360 - GL_MAX_ASYNC_READ_PIXELS_SGIX* = 0x00008361 # GL_SGIX_blend_alpha_minmax - GL_ALPHA_MIN_SGIX* = 0x00008320 - GL_ALPHA_MAX_SGIX* = 0x00008321 # GL_SGIX_calligraphic_fragment - GL_CALLIGRAPHIC_FRAGMENT_SGIX* = 0x00008183 # GL_SGIX_clipmap - GL_LINEAR_CLIPMAP_LINEAR_SGIX* = 0x00008170 - GL_TEXTURE_CLIPMAP_CENTER_SGIX* = 0x00008171 - GL_TEXTURE_CLIPMAP_FRAME_SGIX* = 0x00008172 - GL_TEXTURE_CLIPMAP_OFFSET_SGIX* = 0x00008173 - GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX* = 0x00008174 - GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX* = 0x00008175 - GL_TEXTURE_CLIPMAP_DEPTH_SGIX* = 0x00008176 - GL_MAX_CLIPMAP_DEPTH_SGIX* = 0x00008177 - GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX* = 0x00008178 - GL_NEAREST_CLIPMAP_NEAREST_SGIX* = 0x0000844D - GL_NEAREST_CLIPMAP_LINEAR_SGIX* = 0x0000844E - GL_LINEAR_CLIPMAP_NEAREST_SGIX* = 0x0000844F # GL_SGIX_convolution_accuracy - GL_CONVOLUTION_HINT_SGIX* = 0x00008316 # GL_SGIX_depth_texture - GL_DEPTH_COMPONENT16_SGIX* = 0x000081A5 - GL_DEPTH_COMPONENT24_SGIX* = 0x000081A6 - GL_DEPTH_COMPONENT32_SGIX* = 0x000081A7 # GL_SGIX_fog_offset - GL_FOG_OFFSET_SGIX* = 0x00008198 - GL_FOG_OFFSET_VALUE_SGIX* = 0x00008199 # GL_SGIX_fog_scale - GL_FOG_SCALE_SGIX* = 0x000081FC - GL_FOG_SCALE_VALUE_SGIX* = 0x000081FD # GL_SGIX_fragment_lighting - GL_FRAGMENT_LIGHTING_SGIX* = 0x00008400 - cGL_FRAGMENT_COLOR_MATERIAL_SGIX* = 0x00008401 - GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX* = 0x00008402 - GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX* = 0x00008403 - GL_MAX_FRAGMENT_LIGHTS_SGIX* = 0x00008404 - GL_MAX_ACTIVE_LIGHTS_SGIX* = 0x00008405 - GL_CURRENT_RASTER_NORMAL_SGIX* = 0x00008406 - GL_LIGHT_ENV_MODE_SGIX* = 0x00008407 - GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX* = 0x00008408 - GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX* = 0x00008409 - GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX* = 0x0000840A - GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX* = 0x0000840B - GL_FRAGMENT_LIGHT0_SGIX* = 0x0000840C - GL_FRAGMENT_LIGHT1_SGIX* = 0x0000840D - GL_FRAGMENT_LIGHT2_SGIX* = 0x0000840E - GL_FRAGMENT_LIGHT3_SGIX* = 0x0000840F - GL_FRAGMENT_LIGHT4_SGIX* = 0x00008410 - GL_FRAGMENT_LIGHT5_SGIX* = 0x00008411 - GL_FRAGMENT_LIGHT6_SGIX* = 0x00008412 - GL_FRAGMENT_LIGHT7_SGIX* = 0x00008413 # GL_SGIX_framezoom - cGL_FRAMEZOOM_SGIX* = 0x0000818B - GL_FRAMEZOOM_FACTOR_SGIX* = 0x0000818C - GL_MAX_FRAMEZOOM_FACTOR_SGIX* = 0x0000818D # GL_SGIX_impact_pixel_texture - GL_PIXEL_TEX_GEN_Q_CEILING_SGIX* = 0x00008184 - GL_PIXEL_TEX_GEN_Q_ROUND_SGIX* = 0x00008185 - GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX* = 0x00008186 - GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX* = 0x00008187 - GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX* = 0x00008188 - GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX* = 0x00008189 - GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX* = 0x0000818A # GL_SGIX_instruments - GL_INSTRUMENT_BUFFER_POINTER_SGIX* = 0x00008180 - GL_INSTRUMENT_MEASUREMENTS_SGIX* = 0x00008181 # GL_SGIX_interlace - GL_INTERLACE_SGIX* = 0x00008094 # GL_SGIX_ir_instrument1 - GL_IR_INSTRUMENT1_SGIX* = 0x0000817F # GL_SGIX_list_priority - GL_LIST_PRIORITY_SGIX* = 0x00008182 # GL_SGIX_pixel_texture - cGL_PIXEL_TEX_GEN_SGIX* = 0x00008139 - GL_PIXEL_TEX_GEN_MODE_SGIX* = 0x0000832B # GL_SGIX_pixel_tiles - GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX* = 0x0000813E - GL_PIXEL_TILE_CACHE_INCREMENT_SGIX* = 0x0000813F - GL_PIXEL_TILE_WIDTH_SGIX* = 0x00008140 - GL_PIXEL_TILE_HEIGHT_SGIX* = 0x00008141 - GL_PIXEL_TILE_GRID_WIDTH_SGIX* = 0x00008142 - GL_PIXEL_TILE_GRID_HEIGHT_SGIX* = 0x00008143 - GL_PIXEL_TILE_GRID_DEPTH_SGIX* = 0x00008144 - GL_PIXEL_TILE_CACHE_SIZE_SGIX* = 0x00008145 # GL_SGIX_polynomial_ffd - GL_GEOMETRY_DEFORMATION_SGIX* = 0x00008194 - GL_TEXTURE_DEFORMATION_SGIX* = 0x00008195 - GL_DEFORMATIONS_MASK_SGIX* = 0x00008196 - GL_MAX_DEFORMATION_ORDER_SGIX* = 0x00008197 # GL_SGIX_reference_plane - cGL_REFERENCE_PLANE_SGIX* = 0x0000817D - GL_REFERENCE_PLANE_EQUATION_SGIX* = 0x0000817E # GL_SGIX_resample - GL_PACK_RESAMPLE_SGIX* = 0x0000842C - GL_UNPACK_RESAMPLE_SGIX* = 0x0000842D - GL_RESAMPLE_REPLICATE_SGIX* = 0x0000842E - GL_RESAMPLE_ZERO_FILL_SGIX* = 0x0000842F - GL_RESAMPLE_DECIMATE_SGIX* = 0x00008430 # GL_SGIX_scalebias_hint - GL_SCALEBIAS_HINT_SGIX* = 0x00008322 # GL_SGIX_shadow - GL_TEXTURE_COMPARE_SGIX* = 0x0000819A - GL_TEXTURE_COMPARE_OPERATOR_SGIX* = 0x0000819B - GL_TEXTURE_LEQUAL_R_SGIX* = 0x0000819C - GL_TEXTURE_GEQUAL_R_SGIX* = 0x0000819D # GL_SGIX_shadow_ambient - GL_SHADOW_AMBIENT_SGIX* = 0x000080BF # GL_SGIX_sprite - GL_SPRITE_SGIX* = 0x00008148 - GL_SPRITE_MODE_SGIX* = 0x00008149 - GL_SPRITE_AXIS_SGIX* = 0x0000814A - GL_SPRITE_TRANSLATION_SGIX* = 0x0000814B - GL_SPRITE_AXIAL_SGIX* = 0x0000814C - GL_SPRITE_OBJECT_ALIGNED_SGIX* = 0x0000814D - GL_SPRITE_EYE_ALIGNED_SGIX* = 0x0000814E # GL_SGIX_subsample - GL_PACK_SUBSAMPLE_RATE_SGIX* = 0x000085A0 - GL_UNPACK_SUBSAMPLE_RATE_SGIX* = 0x000085A1 - GL_PIXEL_SUBSAMPLE_4444_SGIX* = 0x000085A2 - GL_PIXEL_SUBSAMPLE_2424_SGIX* = 0x000085A3 - GL_PIXEL_SUBSAMPLE_4242_SGIX* = 0x000085A4 # GL_SGIX_texture_add_env - GL_TEXTURE_ENV_BIAS_SGIX* = 0x000080BE # GL_SGIX_texture_coordinate_clamp - GL_TEXTURE_MAX_CLAMP_S_SGIX* = 0x00008369 - GL_TEXTURE_MAX_CLAMP_T_SGIX* = 0x0000836A - GL_TEXTURE_MAX_CLAMP_R_SGIX* = 0x0000836B # GL_SGIX_texture_lod_bias - GL_TEXTURE_LOD_BIAS_S_SGIX* = 0x0000818E - GL_TEXTURE_LOD_BIAS_T_SGIX* = 0x0000818F - GL_TEXTURE_LOD_BIAS_R_SGIX* = 0x00008190 # GL_SGIX_texture_multi_buffer - GL_TEXTURE_MULTI_BUFFER_HINT_SGIX* = 0x0000812E # GL_SGIX_texture_scale_bias - GL_POST_TEXTURE_FILTER_BIAS_SGIX* = 0x00008179 - GL_POST_TEXTURE_FILTER_SCALE_SGIX* = 0x0000817A - GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX* = 0x0000817B - GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX* = 0x0000817C # GL_SGIX_vertex_preclip - GL_VERTEX_PRECLIP_SGIX* = 0x000083EE - GL_VERTEX_PRECLIP_HINT_SGIX* = 0x000083EF # GL_SGIX_ycrcb - GL_YCRCB_422_SGIX* = 0x000081BB - GL_YCRCB_444_SGIX* = 0x000081BC # GL_SGIX_ycrcba - GL_YCRCB_SGIX* = 0x00008318 - GL_YCRCBA_SGIX* = 0x00008319 # GL_SGI_color_matrix - GL_COLOR_MATRIX_SGI* = 0x000080B1 - GL_COLOR_MATRIX_STACK_DEPTH_SGI* = 0x000080B2 - GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI* = 0x000080B3 - GL_POST_COLOR_MATRIX_RED_SCALE_SGI* = 0x000080B4 - GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI* = 0x000080B5 - GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI* = 0x000080B6 - GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI* = 0x000080B7 - GL_POST_COLOR_MATRIX_RED_BIAS_SGI* = 0x000080B8 - GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI* = 0x000080B9 - GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI* = 0x000080BA - GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI* = 0x000080BB # GL_SGI_color_table - cGL_COLOR_TABLE_SGI* = 0x000080D0 - GL_POST_CONVOLUTION_COLOR_TABLE_SGI* = 0x000080D1 - GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI* = 0x000080D2 - GL_PROXY_COLOR_TABLE_SGI* = 0x000080D3 - GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI* = 0x000080D4 - GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI* = 0x000080D5 - GL_COLOR_TABLE_SCALE_SGI* = 0x000080D6 - GL_COLOR_TABLE_BIAS_SGI* = 0x000080D7 - GL_COLOR_TABLE_FORMAT_SGI* = 0x000080D8 - GL_COLOR_TABLE_WIDTH_SGI* = 0x000080D9 - GL_COLOR_TABLE_RED_SIZE_SGI* = 0x000080DA - GL_COLOR_TABLE_GREEN_SIZE_SGI* = 0x000080DB - GL_COLOR_TABLE_BLUE_SIZE_SGI* = 0x000080DC - GL_COLOR_TABLE_ALPHA_SIZE_SGI* = 0x000080DD - GL_COLOR_TABLE_LUMINANCE_SIZE_SGI* = 0x000080DE - GL_COLOR_TABLE_INTENSITY_SIZE_SGI* = 0x000080DF # GL_SGI_depth_pass_instrument - GL_DEPTH_PASS_INSTRUMENT_SGIX* = 0x00008310 - GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX* = 0x00008311 - GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX* = 0x00008312 # GL_SGI_texture_color_table - GL_TEXTURE_COLOR_TABLE_SGI* = 0x000080BC - GL_PROXY_TEXTURE_COLOR_TABLE_SGI* = 0x000080BD # GL_SUNX_constant_data - GL_UNPACK_CONSTANT_DATA_SUNX* = 0x000081D5 - GL_TEXTURE_CONSTANT_DATA_SUNX* = 0x000081D6 # GL_SUN_convolution_border_modes - GL_WRAP_BORDER_SUN* = 0x000081D4 # GL_SUN_global_alpha - GL_GLOBAL_ALPHA_SUN* = 0x000081D9 - GL_GLOBAL_ALPHA_FACTOR_SUN* = 0x000081DA # GL_SUN_mesh_array - GL_QUAD_MESH_SUN* = 0x00008614 - GL_TRIANGLE_MESH_SUN* = 0x00008615 # GL_SUN_slice_accum - GL_SLICE_ACCUM_SUN* = 0x000085CC # GL_SUN_triangle_list - GL_RESTART_SUN* = 0x00000001 - GL_REPLACE_MIDDLE_SUN* = 0x00000002 - GL_REPLACE_OLDEST_SUN* = 0x00000003 - GL_TRIANGLE_LIST_SUN* = 0x000081D7 - GL_REPLACEMENT_CODE_SUN* = 0x000081D8 - GL_REPLACEMENT_CODE_ARRAY_SUN* = 0x000085C0 - GL_REPLACEMENT_CODE_ARRAYtyp_SUN* = 0x000085C1 - GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN* = 0x000085C2 - GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN* = 0x000085C3 - GL_R1UI_V3F_SUN* = 0x000085C4 - GL_R1UI_C4UB_V3F_SUN* = 0x000085C5 - GL_R1UI_C3F_V3F_SUN* = 0x000085C6 - GL_R1UI_N3F_V3F_SUN* = 0x000085C7 - GL_R1UI_C4F_N3F_V3F_SUN* = 0x000085C8 - GL_R1UI_T2F_V3F_SUN* = 0x000085C9 - GL_R1UI_T2F_N3F_V3F_SUN* = 0x000085CA - GL_R1UI_T2F_C4F_N3F_V3F_SUN* = 0x000085CB # GL_WIN_phong_shading - GL_PHONG_WIN* = 0x000080EA - GL_PHONG_HINT_WIN* = 0x000080EB # GL_WIN_specular_fog - GL_FOG_SPECULAR_TEXTURE_WIN* = 0x000080EC # GL_ARB_vertex_shader - GL_VERTEX_SHADER_ARB* = 0x00008B31 - GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB* = 0x00008B4A - GL_MAX_VARYING_FLOATS_ARB* = 0x00008B4B - GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB* = 0x00008B4C - GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB* = 0x00008B4D - GL_OBJECT_ACTIVE_ATTRIBUTES_ARB* = 0x00008B89 - GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB* = 0x00008B8A # GL_ARB_fragment_shader - GL_FRAGMENT_SHADER_ARB* = 0x00008B30 - GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB* = 0x00008B49 # 1.4 - GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB* = 0x00008B8B # 1.4 - # GL_ARB_occlusion_query - GL_SAMPLES_PASSED_ARB* = 0x00008914 - GL_QUERY_COUNTER_BITS_ARB* = 0x00008864 - GL_CURRENT_QUERY_ARB* = 0x00008865 - GL_QUERY_RESULT_ARB* = 0x00008866 - GL_QUERY_RESULT_AVAILABLE_ARB* = 0x00008867 # GL_ARB_point_sprite - GL_POINT_SPRITE_ARB* = 0x00008861 - GL_COORD_REPLACE_ARB* = 0x00008862 # GL_ARB_shading_language_100 - GL_SHADING_LANGUAGE_VERSION_ARB* = 0x00008B8C # 1.4 - # GL_ARB_shader_objects - GL_PROGRAM_OBJECT_ARB* = 0x00008B40 - GL_OBJECTtyp_ARB* = 0x00008B4E - GL_OBJECT_SUBtypARB* = 0x00008B4F - GL_OBJECT_DELETE_STATUS_ARB* = 0x00008B80 - GL_OBJECT_COMPILE_STATUS_ARB* = 0x00008B81 - GL_OBJECT_LINK_STATUS_ARB* = 0x00008B82 - GL_OBJECT_VALIDATE_STATUS_ARB* = 0x00008B83 - GL_OBJECT_INFO_LOG_LENGTH_ARB* = 0x00008B84 - GL_OBJECT_ATTACHED_OBJECTS_ARB* = 0x00008B85 - GL_OBJECT_ACTIVE_UNIFORMS_ARB* = 0x00008B86 - GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB* = 0x00008B87 - GL_OBJECT_SHADER_SOURCE_LENGTH_ARB* = 0x00008B88 - GL_SHADER_OBJECT_ARB* = 0x00008B48 - GL_FLOAT_VEC2_ARB* = 0x00008B50 - GL_FLOAT_VEC3_ARB* = 0x00008B51 - GL_FLOAT_VEC4_ARB* = 0x00008B52 - GL_INT_VEC2_ARB* = 0x00008B53 - GL_INT_VEC3_ARB* = 0x00008B54 - GL_INT_VEC4_ARB* = 0x00008B55 - GL_BOOL_ARB* = 0x00008B56 - GL_BOOL_VEC2_ARB* = 0x00008B57 - GL_BOOL_VEC3_ARB* = 0x00008B58 - GL_BOOL_VEC4_ARB* = 0x00008B59 - GL_FLOAT_MAT2_ARB* = 0x00008B5A - GL_FLOAT_MAT3_ARB* = 0x00008B5B - GL_FLOAT_MAT4_ARB* = 0x00008B5C - GL_SAMPLER_1D_ARB* = 0x00008B5D - GL_SAMPLER_2D_ARB* = 0x00008B5E - GL_SAMPLER_3D_ARB* = 0x00008B5F - GL_SAMPLER_CUBE_ARB* = 0x00008B60 - GL_SAMPLER_1D_SHADOW_ARB* = 0x00008B61 - GL_SAMPLER_2D_SHADOW_ARB* = 0x00008B62 - GL_SAMPLER_2D_RECT_ARB* = 0x00008B63 - GL_SAMPLER_2D_RECT_SHADOW_ARB* = 0x00008B64 # WGL_3DFX_multisample - WGL_SAMPLE_BUFFERS_3DFX* = 0x00002060 - WGL_SAMPLES_3DFX* = 0x00002061 # WGL_ARB_buffer_region - WGL_FRONT_COLOR_BUFFER_BIT_ARB* = 0x00000001 - WGL_BACK_COLOR_BUFFER_BIT_ARB* = 0x00000002 - WGL_DEPTH_BUFFER_BIT_ARB* = 0x00000004 - WGL_STENCIL_BUFFER_BIT_ARB* = 0x00000008 # WGL_ARB_make_current_read - ERROR_INVALID_PIXELtyp_ARB* = 0x00002043 - ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB* = 0x00002054 # WGL_ARB_multisample - WGL_SAMPLE_BUFFERS_ARB* = 0x00002041 - WGL_SAMPLES_ARB* = 0x00002042 # WGL_ARB_pbuffer - WGL_DRAW_TO_PBUFFER_ARB* = 0x0000202D - WGL_MAX_PBUFFER_PIXELS_ARB* = 0x0000202E - WGL_MAX_PBUFFER_WIDTH_ARB* = 0x0000202F - WGL_MAX_PBUFFER_HEIGHT_ARB* = 0x00002030 - WGL_PBUFFER_LARGEST_ARB* = 0x00002033 - WGL_PBUFFER_WIDTH_ARB* = 0x00002034 - WGL_PBUFFER_HEIGHT_ARB* = 0x00002035 - WGL_PBUFFER_LOST_ARB* = 0x00002036 # WGL_ARB_pixel_format - WGL_NUMBER_PIXEL_FORMATS_ARB* = 0x00002000 - WGL_DRAW_TO_WINDOW_ARB* = 0x00002001 - WGL_DRAW_TO_BITMAP_ARB* = 0x00002002 - WGL_ACCELERATION_ARB* = 0x00002003 - WGL_NEED_PALETTE_ARB* = 0x00002004 - WGL_NEED_SYSTEM_PALETTE_ARB* = 0x00002005 - WGL_SWAP_LAYER_BUFFERS_ARB* = 0x00002006 - WGL_SWAP_METHOD_ARB* = 0x00002007 - WGL_NUMBER_OVERLAYS_ARB* = 0x00002008 - WGL_NUMBER_UNDERLAYS_ARB* = 0x00002009 - WGL_TRANSPARENT_ARB* = 0x0000200A - WGL_TRANSPARENT_RED_VALUE_ARB* = 0x00002037 - WGL_TRANSPARENT_GREEN_VALUE_ARB* = 0x00002038 - WGL_TRANSPARENT_BLUE_VALUE_ARB* = 0x00002039 - WGL_TRANSPARENT_ALPHA_VALUE_ARB* = 0x0000203A - WGL_TRANSPARENT_INDEX_VALUE_ARB* = 0x0000203B - WGL_SHARE_DEPTH_ARB* = 0x0000200C - WGL_SHARE_STENCIL_ARB* = 0x0000200D - WGL_SHARE_ACCUM_ARB* = 0x0000200E - WGL_SUPPORT_GDI_ARB* = 0x0000200F - WGL_SUPPORT_OPENGL_ARB* = 0x00002010 - WGL_DOUBLE_BUFFER_ARB* = 0x00002011 - WGL_STEREO_ARB* = 0x00002012 - WGL_PIXELtyp_ARB* = 0x00002013 - WGL_COLOR_BITS_ARB* = 0x00002014 - WGL_RED_BITS_ARB* = 0x00002015 - WGL_RED_SHIFT_ARB* = 0x00002016 - WGL_GREEN_BITS_ARB* = 0x00002017 - WGL_GREEN_SHIFT_ARB* = 0x00002018 - WGL_BLUE_BITS_ARB* = 0x00002019 - WGL_BLUE_SHIFT_ARB* = 0x0000201A - WGL_ALPHA_BITS_ARB* = 0x0000201B - WGL_ALPHA_SHIFT_ARB* = 0x0000201C - WGL_ACCUM_BITS_ARB* = 0x0000201D - WGL_ACCUM_RED_BITS_ARB* = 0x0000201E - WGL_ACCUM_GREEN_BITS_ARB* = 0x0000201F - WGL_ACCUM_BLUE_BITS_ARB* = 0x00002020 - WGL_ACCUM_ALPHA_BITS_ARB* = 0x00002021 - WGL_DEPTH_BITS_ARB* = 0x00002022 - WGL_STENCIL_BITS_ARB* = 0x00002023 - WGL_AUX_BUFFERS_ARB* = 0x00002024 - WGL_NO_ACCELERATION_ARB* = 0x00002025 - WGL_GENERIC_ACCELERATION_ARB* = 0x00002026 - WGL_FULL_ACCELERATION_ARB* = 0x00002027 - WGL_SWAP_EXCHANGE_ARB* = 0x00002028 - WGL_SWAP_COPY_ARB* = 0x00002029 - WGL_SWAP_UNDEFINED_ARB* = 0x0000202A - WGLtyp_RGBA_ARB* = 0x0000202B - WGLtyp_COLORINDEX_ARB* = 0x0000202C # WGL_ARB_pixel_format_float - WGL_RGBA_FLOAT_MODE_ARB* = 0x00008820 - WGL_CLAMP_VERTEX_COLOR_ARB* = 0x0000891A - WGL_CLAMP_FRAGMENT_COLOR_ARB* = 0x0000891B - WGL_CLAMP_READ_COLOR_ARB* = 0x0000891C - WGL_FIXED_ONLY_ARB* = 0x0000891D # WGL_ARB_render_texture - WGL_BIND_TO_TEXTURE_RGB_ARB* = 0x00002070 - WGL_BIND_TO_TEXTURE_RGBA_ARB* = 0x00002071 - WGL_TEXTURE_FORMAT_ARB* = 0x00002072 - WGL_TEXTURE_TARGET_ARB* = 0x00002073 - WGL_MIPMAP_TEXTURE_ARB* = 0x00002074 - WGL_TEXTURE_RGB_ARB* = 0x00002075 - WGL_TEXTURE_RGBA_ARB* = 0x00002076 - WGL_NO_TEXTURE_ARB* = 0x00002077 - WGL_TEXTURE_CUBE_MAP_ARB* = 0x00002078 - WGL_TEXTURE_1D_ARB* = 0x00002079 - WGL_TEXTURE_2D_ARB* = 0x0000207A - WGL_MIPMAP_LEVEL_ARB* = 0x0000207B - WGL_CUBE_MAP_FACE_ARB* = 0x0000207C - WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB* = 0x0000207D - WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB* = 0x0000207E - WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB* = 0x0000207F - WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB* = 0x00002080 - WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB* = 0x00002081 - WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB* = 0x00002082 - WGL_FRONT_LEFT_ARB* = 0x00002083 - WGL_FRONT_RIGHT_ARB* = 0x00002084 - WGL_BACK_LEFT_ARB* = 0x00002085 - WGL_BACK_RIGHT_ARB* = 0x00002086 - WGL_AUX0_ARB* = 0x00002087 - WGL_AUX1_ARB* = 0x00002088 - WGL_AUX2_ARB* = 0x00002089 - WGL_AUX3_ARB* = 0x0000208A - WGL_AUX4_ARB* = 0x0000208B - WGL_AUX5_ARB* = 0x0000208C - WGL_AUX6_ARB* = 0x0000208D - WGL_AUX7_ARB* = 0x0000208E - WGL_AUX8_ARB* = 0x0000208F - WGL_AUX9_ARB* = 0x00002090 # WGL_ARB_create_context - WGL_CONTEXT_DEBUG_BIT_ARB* = 0x00000001 - WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB* = 0x00000002 - WGL_CONTEXT_MAJOR_VERSION_ARB* = 0x00002091 - WGL_CONTEXT_MINOR_VERSION_ARB* = 0x00002092 - WGL_CONTEXT_LAYER_PLANE_ARB* = 0x00002093 - WGL_CONTEXT_FLAGS_ARB* = 0x00002094 - ERROR_INVALID_VERSION_ARB* = 0x00002095 # WGL_ARB_create_context_profile - WGL_CONTEXT_PROFILE_MASK_ARB* = 0x00009126 - WGL_CONTEXT_CORE_PROFILE_BIT_ARB* = 0x00000001 - WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB* = 0x00000002 - ERROR_INVALID_PROFILE_ARB* = 0x00002096 # WGL_ARB_framebuffer_sRGB - WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB* = 0x000020A9 # - # WGL_ARB_create_context_robustness - WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB* = 0x00000004 - WGL_LOSE_CONTEXT_ON_RESET_ARB* = 0x00008252 - WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB* = 0x00008256 - WGL_NO_RESET_NOTIFICATION_ARB* = 0x00008261 # WGL_ATI_pixel_format_float - WGLtyp_RGBA_FLOAT_ATI* = 0x000021A0 - GLtyp_RGBA_FLOAT_ATI* = 0x00008820 - GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI* = 0x00008835 # WGL_AMD_gpu_association - WGL_GPU_VENDOR_AMD* = 0x00001F00 - WGL_GPU_RENDERER_STRING_AMD* = 0x00001F01 - WGL_GPU_OPENGL_VERSION_STRING_AMD* = 0x00001F02 - WGL_GPU_FASTEST_TARGET_GPUS_AMD* = 0x000021A2 - WGL_GPU_RAM_AMD* = 0x000021A3 - WGL_GPU_CLOCK_AMD* = 0x000021A4 - WGL_GPU_NUM_PIPES_AMD* = 0x000021A5 - WGL_GPU_NUM_SIMD_AMD* = 0x000021A6 - WGL_GPU_NUM_RB_AMD* = 0x000021A7 - WGL_GPU_NUM_SPI_AMD* = 0x000021A8 # WGL_EXT_depth_float - WGL_DEPTH_FLOAT_EXT* = 0x00002040 # WGL_EXT_make_current_read - ERROR_INVALID_PIXELtyp_EXT* = 0x00002043 # WGL_EXT_multisample - WGL_SAMPLE_BUFFERS_EXT* = 0x00002041 - WGL_SAMPLES_EXT* = 0x00002042 # WGL_EXT_pbuffer - WGL_DRAW_TO_PBUFFER_EXT* = 0x0000202D - WGL_MAX_PBUFFER_PIXELS_EXT* = 0x0000202E - WGL_MAX_PBUFFER_WIDTH_EXT* = 0x0000202F - WGL_MAX_PBUFFER_HEIGHT_EXT* = 0x00002030 - WGL_OPTIMAL_PBUFFER_WIDTH_EXT* = 0x00002031 - WGL_OPTIMAL_PBUFFER_HEIGHT_EXT* = 0x00002032 - WGL_PBUFFER_LARGEST_EXT* = 0x00002033 - WGL_PBUFFER_WIDTH_EXT* = 0x00002034 - WGL_PBUFFER_HEIGHT_EXT* = 0x00002035 # WGL_EXT_pixel_format - WGL_NUMBER_PIXEL_FORMATS_EXT* = 0x00002000 - WGL_DRAW_TO_WINDOW_EXT* = 0x00002001 - WGL_DRAW_TO_BITMAP_EXT* = 0x00002002 - WGL_ACCELERATION_EXT* = 0x00002003 - WGL_NEED_PALETTE_EXT* = 0x00002004 - WGL_NEED_SYSTEM_PALETTE_EXT* = 0x00002005 - WGL_SWAP_LAYER_BUFFERS_EXT* = 0x00002006 - WGL_SWAP_METHOD_EXT* = 0x00002007 - WGL_NUMBER_OVERLAYS_EXT* = 0x00002008 - WGL_NUMBER_UNDERLAYS_EXT* = 0x00002009 - WGL_TRANSPARENT_EXT* = 0x0000200A - WGL_TRANSPARENT_VALUE_EXT* = 0x0000200B - WGL_SHARE_DEPTH_EXT* = 0x0000200C - WGL_SHARE_STENCIL_EXT* = 0x0000200D - WGL_SHARE_ACCUM_EXT* = 0x0000200E - WGL_SUPPORT_GDI_EXT* = 0x0000200F - WGL_SUPPORT_OPENGL_EXT* = 0x00002010 - WGL_DOUBLE_BUFFER_EXT* = 0x00002011 - WGL_STEREO_EXT* = 0x00002012 - WGL_PIXELtyp_EXT* = 0x00002013 - WGL_COLOR_BITS_EXT* = 0x00002014 - WGL_RED_BITS_EXT* = 0x00002015 - WGL_RED_SHIFT_EXT* = 0x00002016 - WGL_GREEN_BITS_EXT* = 0x00002017 - WGL_GREEN_SHIFT_EXT* = 0x00002018 - WGL_BLUE_BITS_EXT* = 0x00002019 - WGL_BLUE_SHIFT_EXT* = 0x0000201A - WGL_ALPHA_BITS_EXT* = 0x0000201B - WGL_ALPHA_SHIFT_EXT* = 0x0000201C - WGL_ACCUM_BITS_EXT* = 0x0000201D - WGL_ACCUM_RED_BITS_EXT* = 0x0000201E - WGL_ACCUM_GREEN_BITS_EXT* = 0x0000201F - WGL_ACCUM_BLUE_BITS_EXT* = 0x00002020 - WGL_ACCUM_ALPHA_BITS_EXT* = 0x00002021 - WGL_DEPTH_BITS_EXT* = 0x00002022 - WGL_STENCIL_BITS_EXT* = 0x00002023 - WGL_AUX_BUFFERS_EXT* = 0x00002024 - WGL_NO_ACCELERATION_EXT* = 0x00002025 - WGL_GENERIC_ACCELERATION_EXT* = 0x00002026 - WGL_FULL_ACCELERATION_EXT* = 0x00002027 - WGL_SWAP_EXCHANGE_EXT* = 0x00002028 - WGL_SWAP_COPY_EXT* = 0x00002029 - WGL_SWAP_UNDEFINED_EXT* = 0x0000202A - WGLtyp_RGBA_EXT* = 0x0000202B - WGLtyp_COLORINDEX_EXT* = 0x0000202C # WGL_I3D_digital_video_control - WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D* = 0x00002050 - WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D* = 0x00002051 - WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D* = 0x00002052 - WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D* = 0x00002053 # WGL_I3D_gamma - WGL_GAMMA_TABLE_SIZE_I3D* = 0x0000204E - WGL_GAMMA_EXCLUDE_DESKTOP_I3D* = 0x0000204F # WGL_I3D_genlock - WGL_GENLOCK_SOURCE_MULTIVIEW_I3D* = 0x00002044 - WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D* = 0x00002045 - WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D* = 0x00002046 - WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D* = 0x00002047 - WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D* = 0x00002048 - WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D* = 0x00002049 - WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D* = 0x0000204A - WGL_GENLOCK_SOURCE_EDGE_RISING_I3D* = 0x0000204B - WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D* = 0x0000204C # WGL_I3D_image_buffer - WGL_IMAGE_BUFFER_MIN_ACCESS_I3D* = 0x00000001 - WGL_IMAGE_BUFFER_LOCK_I3D* = 0x00000002 # WGL_NV_float_buffer - WGL_FLOAT_COMPONENTS_NV* = 0x000020B0 - WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV* = 0x000020B1 - WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV* = 0x000020B2 - WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV* = 0x000020B3 - WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV* = 0x000020B4 - WGL_TEXTURE_FLOAT_R_NV* = 0x000020B5 - WGL_TEXTURE_FLOAT_RG_NV* = 0x000020B6 - WGL_TEXTURE_FLOAT_RGB_NV* = 0x000020B7 - WGL_TEXTURE_FLOAT_RGBA_NV* = 0x000020B8 # WGL_NV_render_depth_texture - WGL_BIND_TO_TEXTURE_DEPTH_NV* = 0x000020A3 - WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV* = 0x000020A4 - WGL_DEPTH_TEXTURE_FORMAT_NV* = 0x000020A5 - WGL_TEXTURE_DEPTH_COMPONENT_NV* = 0x000020A6 - WGL_DEPTH_COMPONENT_NV* = 0x000020A7 # WGL_NV_render_texture_rectangle - WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV* = 0x000020A0 - WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV* = 0x000020A1 - WGL_TEXTURE_RECTANGLE_NV* = 0x000020A2 # WGL_NV_present_video - WGL_NUM_VIDEO_SLOTS_NV* = 0x000020F0 # WGL_NV_video_output - WGL_BIND_TO_VIDEO_RGB_NV* = 0x000020C0 - WGL_BIND_TO_VIDEO_RGBA_NV* = 0x000020C1 - WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV* = 0x000020C2 - WGL_VIDEO_OUT_COLOR_NV* = 0x000020C3 - WGL_VIDEO_OUT_ALPHA_NV* = 0x000020C4 - WGL_VIDEO_OUT_DEPTH_NV* = 0x000020C5 - WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV* = 0x000020C6 - WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV* = 0x000020C7 - WGL_VIDEO_OUT_FRAME* = 0x000020C8 - WGL_VIDEO_OUT_FIELD_1* = 0x000020C9 - WGL_VIDEO_OUT_FIELD_2* = 0x000020CA - WGL_VIDEO_OUT_STACKED_FIELDS_1_2* = 0x000020CB - WGL_VIDEO_OUT_STACKED_FIELDS_2_1* = 0x000020CC # WGL_NV_gpu_affinity - WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV* = 0x000020D0 - WGL_ERROR_MISSING_AFFINITY_MASK_NV* = 0x000020D1 # WGL_NV_video_capture - WGL_UNIQUE_ID_NV* = 0x000020CE - WGL_NUM_VIDEO_CAPTURE_SLOTS_NV* = 0x000020CF # WGL_NV_multisample_coverage - WGL_COVERAGE_SAMPLES_NV* = 0x00002042 - WGL_COLOR_SAMPLES_NV* = 0x000020B9 # WGL_EXT_create_context_es2_profile - WGL_CONTEXT_ES2_PROFILE_BIT_EXT* = 0x00000004 # WGL_NV_DX_interop - WGL_ACCESS_READ_ONLY_NV* = 0x00000000 - WGL_ACCESS_READ_WRITE_NV* = 0x00000001 - WGL_ACCESS_WRITE_DISCARD_NV* = 0x00000002 # WIN_draw_range_elements - GL_MAX_ELEMENTS_VERTICES_WIN* = 0x000080E8 - GL_MAX_ELEMENTS_INDICES_WIN* = 0x000080E9 # GLX 1.1 and later: - GLX_VENDOR* = 1 - GLX_VERSION* = 2 - GLX_EXTENSIONS* = 3 - GLX_USE_GL* = 1 - GLX_BUFFER_SIZE* = 2 - GLX_LEVEL* = 3 - GLX_RGBA* = 4 - GLX_DOUBLEBUFFER* = 5 - GLX_STEREO* = 6 - GLX_AUX_BUFFERS* = 7 - GLX_RED_SIZE* = 8 - GLX_GREEN_SIZE* = 9 - GLX_BLUE_SIZE* = 10 - GLX_ALPHA_SIZE* = 11 - GLX_DEPTH_SIZE* = 12 - GLX_STENCIL_SIZE* = 13 - GLX_ACCUM_RED_SIZE* = 14 - GLX_ACCUM_GREEN_SIZE* = 15 - GLX_ACCUM_BLUE_SIZE* = 16 - GLX_ACCUM_ALPHA_SIZE* = 17 # GLX_VERSION_1_3 - GLX_WINDOW_BIT* = 0x00000001 - GLX_PIXMAP_BIT* = 0x00000002 - GLX_PBUFFER_BIT* = 0x00000004 - GLX_RGBA_BIT* = 0x00000001 - GLX_COLOR_INDEX_BIT* = 0x00000002 - GLX_PBUFFER_CLOBBER_MASK* = 0x08000000 - GLX_FRONT_LEFT_BUFFER_BIT* = 0x00000001 - GLX_FRONT_RIGHT_BUFFER_BIT* = 0x00000002 - GLX_BACK_LEFT_BUFFER_BIT* = 0x00000004 - GLX_BACK_RIGHT_BUFFER_BIT* = 0x00000008 - GLX_AUX_BUFFERS_BIT* = 0x00000010 - GLX_DEPTH_BUFFER_BIT* = 0x00000020 - GLX_STENCIL_BUFFER_BIT* = 0x00000040 - GLX_ACCUM_BUFFER_BIT* = 0x00000080 - GLX_CONFIG_CAVEAT* = 0x00000020 - GLX_X_VISUALtyp* = 0x00000022 - GLX_TRANSPARENTtyp* = 0x00000023 - GLX_TRANSPARENT_INDEX_VALUE* = 0x00000024 - GLX_TRANSPARENT_RED_VALUE* = 0x00000025 - GLX_TRANSPARENT_GREEN_VALUE* = 0x00000026 - GLX_TRANSPARENT_BLUE_VALUE* = 0x00000027 - GLX_TRANSPARENT_ALPHA_VALUE* = 0x00000028 - GLX_DONT_CARE* = 0xFFFFFFFF - GLX_NONE* = 0x00008000 - GLX_SLOW_CONFIG* = 0x00008001 - GLX_TRUE_COLOR* = 0x00008002 - GLX_DIRECT_COLOR* = 0x00008003 - GLX_PSEUDO_COLOR* = 0x00008004 - GLX_STATIC_COLOR* = 0x00008005 - GLX_GRAY_SCALE* = 0x00008006 - GLX_STATIC_GRAY* = 0x00008007 - GLX_TRANSPARENT_RGB* = 0x00008008 - GLX_TRANSPARENT_INDEX* = 0x00008009 - GLX_VISUAL_ID* = 0x0000800B - GLX_SCREEN* = 0x0000800C - GLX_NON_CONFORMANT_CONFIG* = 0x0000800D - GLX_DRAWABLEtyp* = 0x00008010 - GLX_RENDERtyp* = 0x00008011 - GLX_X_RENDERABLE* = 0x00008012 - GLX_FBCONFIG_ID* = 0x00008013 - GLX_RGBAtyp* = 0x00008014 - GLX_COLOR_INDEXtyp* = 0x00008015 - GLX_MAX_PBUFFER_WIDTH* = 0x00008016 - GLX_MAX_PBUFFER_HEIGHT* = 0x00008017 - GLX_MAX_PBUFFER_PIXELS* = 0x00008018 - GLX_PRESERVED_CONTENTS* = 0x0000801B - GLX_LARGEST_PBUFFER* = 0x0000801C - GLX_WIDTH* = 0x0000801D - GLX_HEIGHT* = 0x0000801E - GLX_EVENT_MASK* = 0x0000801F - GLX_DAMAGED* = 0x00008020 - GLX_SAVED* = 0x00008021 - cGLX_WINDOW* = 0x00008022 - cGLX_PBUFFER* = 0x00008023 - GLX_PBUFFER_HEIGHT* = 0x00008040 - GLX_PBUFFER_WIDTH* = 0x00008041 # GLX_VERSION_1_4 - GLX_SAMPLE_BUFFERS* = 100000 - GLX_SAMPLES* = 100001 # GLX_ARB_multisample - GLX_SAMPLE_BUFFERS_ARB* = 100000 - GLX_SAMPLES_ARB* = 100001 # GLX_ARB_fbconfig_float - GLX_RGBA_FLOATtyp_ARB* = 0x000020B9 - GLX_RGBA_FLOAT_BIT_ARB* = 0x00000004 # GLX_ARB_create_context - GLX_CONTEXT_DEBUG_BIT_ARB* = 0x00000001 - GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB* = 0x00000002 - GLX_CONTEXT_MAJOR_VERSION_ARB* = 0x00002091 - GLX_CONTEXT_MINOR_VERSION_ARB* = 0x00002092 - GLX_CONTEXT_FLAGS_ARB* = 0x00002094 # GLX_ARB_create_context_profile - GLX_CONTEXT_CORE_PROFILE_BIT_ARB* = 0x00000001 - GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB* = 0x00000002 - GLX_CONTEXT_PROFILE_MASK_ARB* = 0x00009126 # GLX_ARB_vertex_buffer_object - GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB* = 0x00002095 # - # GLX_ARB_framebuffer_sRGB - GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB* = 0x000020B2 # - # GLX_ARB_create_context_robustness - GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB* = 0x00000004 - GLX_LOSE_CONTEXT_ON_RESET_ARB* = 0x00008252 - GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB* = 0x00008256 - GLX_NO_RESET_NOTIFICATION_ARB* = 0x00008261 # GLX_EXT_visual_info - GLX_X_VISUALtyp_EXT* = 0x00000022 - GLX_TRANSPARENTtyp_EXT* = 0x00000023 - GLX_TRANSPARENT_INDEX_VALUE_EXT* = 0x00000024 - GLX_TRANSPARENT_RED_VALUE_EXT* = 0x00000025 - GLX_TRANSPARENT_GREEN_VALUE_EXT* = 0x00000026 - GLX_TRANSPARENT_BLUE_VALUE_EXT* = 0x00000027 - GLX_TRANSPARENT_ALPHA_VALUE_EXT* = 0x00000028 - GLX_NONE_EXT* = 0x00008000 - GLX_TRUE_COLOR_EXT* = 0x00008002 - GLX_DIRECT_COLOR_EXT* = 0x00008003 - GLX_PSEUDO_COLOR_EXT* = 0x00008004 - GLX_STATIC_COLOR_EXT* = 0x00008005 - GLX_GRAY_SCALE_EXT* = 0x00008006 - GLX_STATIC_GRAY_EXT* = 0x00008007 - GLX_TRANSPARENT_RGB_EXT* = 0x00008008 - GLX_TRANSPARENT_INDEX_EXT* = 0x00008009 # GLX_EXT_visual_rating - GLX_VISUAL_CAVEAT_EXT* = 0x00000020 - GLX_SLOW_VISUAL_EXT* = 0x00008001 - GLX_NON_CONFORMANT_VISUAL_EXT* = 0x0000800D # reuse GLX_NONE_EXT - # GLX_EXT_import_context - GLX_SHARE_CONTEXT_EXT* = 0x0000800A - GLX_VISUAL_ID_EXT* = 0x0000800B - GLX_SCREEN_EXT* = 0x0000800C # GLX_EXT_fbconfig_packed_float - # GLX_RGBA_UNSIGNED_FLOATtyp_EXT = $20B1; - # GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT = $00000008; - # GLX_EXT_framebuffer_sRGB - # GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT = $20B2; - # GLX_EXT_texture_from_pixmap - GLX_TEXTURE_1D_BIT_EXT* = 0x00000001 - GLX_TEXTURE_2D_BIT_EXT* = 0x00000002 - GLX_TEXTURE_RECTANGLE_BIT_EXT* = 0x00000004 - GLX_BIND_TO_TEXTURE_RGB_EXT* = 0x000020D0 - GLX_BIND_TO_TEXTURE_RGBA_EXT* = 0x000020D1 - GLX_BIND_TO_MIPMAP_TEXTURE_EXT* = 0x000020D2 - GLX_BIND_TO_TEXTURE_TARGETS_EXT* = 0x000020D3 - GLX_Y_INVERTED_EXT* = 0x000020D4 - GLX_TEXTURE_FORMAT_EXT* = 0x000020D5 - GLX_TEXTURE_TARGET_EXT* = 0x000020D6 - GLX_MIPMAP_TEXTURE_EXT* = 0x000020D7 - GLX_TEXTURE_FORMAT_NONE_EXT* = 0x000020D8 - GLX_TEXTURE_FORMAT_RGB_EXT* = 0x000020D9 - GLX_TEXTURE_FORMAT_RGBA_EXT* = 0x000020DA - GLX_TEXTURE_1D_EXT* = 0x000020DB - GLX_TEXTURE_2D_EXT* = 0x000020DC - GLX_TEXTURE_RECTANGLE_EXT* = 0x000020DD - GLX_FRONT_LEFT_EXT* = 0x000020DE - GLX_FRONT_RIGHT_EXT* = 0x000020DF - GLX_BACK_LEFT_EXT* = 0x000020E0 - GLX_BACK_RIGHT_EXT* = 0x000020E1 - GLX_FRONT_EXT* = GLX_FRONT_LEFT_EXT - GLX_BACK_EXT* = GLX_BACK_LEFT_EXT - GLX_AUX0_EXT* = 0x000020E2 - GLX_AUX1_EXT* = 0x000020E3 - GLX_AUX2_EXT* = 0x000020E4 - GLX_AUX3_EXT* = 0x000020E5 - GLX_AUX4_EXT* = 0x000020E6 - GLX_AUX5_EXT* = 0x000020E7 - GLX_AUX6_EXT* = 0x000020E8 - GLX_AUX7_EXT* = 0x000020E9 - GLX_AUX8_EXT* = 0x000020EA - GLX_AUX9_EXT* = 0x000020EB # GLX_EXT_swap_control - GLX_SWAP_INTERVAL_EXT* = 0x000020F1 - GLX_MAX_SWAP_INTERVAL_EXT* = 0x000020F2 # GLX_EXT_create_context_es2_profile - GLX_CONTEXT_ES2_PROFILE_BIT_EXT* = 0x00000004 # GLU - GLU_INVALID_ENUM* = 100900 - GLU_INVALID_VALUE* = 100901 - GLU_OUT_OF_MEMORY* = 100902 - GLU_INCOMPATIBLE_GL_VERSION* = 100903 - GLU_VERSION* = 100800 - GLU_EXTENSIONS* = 100801 - GLU_TRUE* = GL_TRUE - GLU_FALSE* = GL_FALSE - GLU_SMOOTH* = 100000 - GLU_FLAT* = 100001 - GLU_NONE* = 100002 - GLU_POINT* = 100010 - GLU_LINE* = 100011 - GLU_FILL* = 100012 - GLU_SILHOUETTE* = 100013 - GLU_OUTSIDE* = 100020 - GLU_INSIDE* = 100021 - GLU_TESS_MAX_COORD* = 1.0000000000000005e+150 - GLU_TESS_WINDING_RULE* = 100140 - GLU_TESS_BOUNDARY_ONLY* = 100141 - GLU_TESS_TOLERANCE* = 100142 - GLU_TESS_WINDING_ODD* = 100130 - GLU_TESS_WINDING_NONZERO* = 100131 - GLU_TESS_WINDING_POSITIVE* = 100132 - GLU_TESS_WINDING_NEGATIVE* = 100133 - GLU_TESS_WINDING_ABS_GEQ_TWO* = 100134 - GLU_TESS_BEGIN* = 100100 # TGLUTessBeginProc - cGLU_TESS_VERTEX* = 100101 # TGLUTessVertexProc - GLU_TESS_END* = 100102 # TGLUTessEndProc - GLU_TESS_ERROR* = 100103 # TGLUTessErrorProc - GLU_TESS_EDGE_FLAG* = 100104 # TGLUTessEdgeFlagProc - GLU_TESS_COMBINE* = 100105 # TGLUTessCombineProc - GLU_TESS_BEGIN_DATA* = 100106 # TGLUTessBeginDataProc - GLU_TESS_VERTEX_DATA* = 100107 # TGLUTessVertexDataProc - GLU_TESS_END_DATA* = 100108 # TGLUTessEndDataProc - GLU_TESS_ERROR_DATA* = 100109 # TGLUTessErrorDataProc - GLU_TESS_EDGE_FLAG_DATA* = 100110 # TGLUTessEdgeFlagDataProc - GLU_TESS_COMBINE_DATA* = 100111 # TGLUTessCombineDataProc - GLU_TESS_ERROR1* = 100151 - GLU_TESS_ERROR2* = 100152 - GLU_TESS_ERROR3* = 100153 - GLU_TESS_ERROR4* = 100154 - GLU_TESS_ERROR5* = 100155 - GLU_TESS_ERROR6* = 100156 - GLU_TESS_ERROR7* = 100157 - GLU_TESS_ERROR8* = 100158 - GLU_TESS_MISSING_BEGIN_POLYGON* = GLU_TESS_ERROR1 - GLU_TESS_MISSING_BEGIN_CONTOUR* = GLU_TESS_ERROR2 - GLU_TESS_MISSING_END_POLYGON* = GLU_TESS_ERROR3 - GLU_TESS_MISSING_END_CONTOUR* = GLU_TESS_ERROR4 - GLU_TESS_COORD_TOO_LARGE* = GLU_TESS_ERROR5 - GLU_TESS_NEED_COMBINE_CALLBACK* = GLU_TESS_ERROR6 - GLU_AUTO_LOAD_MATRIX* = 100200 - GLU_CULLING* = 100201 - GLU_SAMPLING_TOLERANCE* = 100203 - GLU_DISPLAY_MODE* = 100204 - GLU_PARAMETRIC_TOLERANCE* = 100202 - GLU_SAMPLING_METHOD* = 100205 - GLU_U_STEP* = 100206 - GLU_V_STEP* = 100207 - GLU_PATH_LENGTH* = 100215 - GLU_PARAMETRIC_ERROR* = 100216 - GLU_DOMAIN_DISTANCE* = 100217 - GLU_MAP1_TRIM_2* = 100210 - GLU_MAP1_TRIM_3* = 100211 - GLU_OUTLINE_POLYGON* = 100240 - GLU_OUTLINE_PATCH* = 100241 - GLU_NURBS_ERROR1* = 100251 - GLU_NURBS_ERROR2* = 100252 - GLU_NURBS_ERROR3* = 100253 - GLU_NURBS_ERROR4* = 100254 - GLU_NURBS_ERROR5* = 100255 - GLU_NURBS_ERROR6* = 100256 - GLU_NURBS_ERROR7* = 100257 - GLU_NURBS_ERROR8* = 100258 - GLU_NURBS_ERROR9* = 100259 - GLU_NURBS_ERROR10* = 100260 - GLU_NURBS_ERROR11* = 100261 - GLU_NURBS_ERROR12* = 100262 - GLU_NURBS_ERROR13* = 100263 - GLU_NURBS_ERROR14* = 100264 - GLU_NURBS_ERROR15* = 100265 - GLU_NURBS_ERROR16* = 100266 - GLU_NURBS_ERROR17* = 100267 - GLU_NURBS_ERROR18* = 100268 - GLU_NURBS_ERROR19* = 100269 - GLU_NURBS_ERROR20* = 100270 - GLU_NURBS_ERROR21* = 100271 - GLU_NURBS_ERROR22* = 100272 - GLU_NURBS_ERROR23* = 100273 - GLU_NURBS_ERROR24* = 100274 - GLU_NURBS_ERROR25* = 100275 - GLU_NURBS_ERROR26* = 100276 - GLU_NURBS_ERROR27* = 100277 - GLU_NURBS_ERROR28* = 100278 - GLU_NURBS_ERROR29* = 100279 - GLU_NURBS_ERROR30* = 100280 - GLU_NURBS_ERROR31* = 100281 - GLU_NURBS_ERROR32* = 100282 - GLU_NURBS_ERROR33* = 100283 - GLU_NURBS_ERROR34* = 100284 - GLU_NURBS_ERROR35* = 100285 - GLU_NURBS_ERROR36* = 100286 - GLU_NURBS_ERROR37* = 100287 - GLU_CW* = 100120 - GLU_CCW* = 100121 - GLU_INTERIOR* = 100122 - GLU_EXTERIOR* = 100123 - GLU_UNKNOWN* = 100124 - GLU_BEGIN* = GLU_TESS_BEGIN - GLU_VERTEX* = cGLU_TESS_VERTEX - GLU_END* = GLU_TESS_END - GLU_ERROR* = GLU_TESS_ERROR - GLU_EDGE_FLAG* = GLU_TESS_EDGE_FLAG - -proc glCullFace*(mode: GLenum){.stdcall, importc, ogl.} -proc glFrontFace*(mode: GLenum){.stdcall, importc, ogl.} -proc glHint*(target: GLenum, mode: GLenum){.stdcall, importc, ogl.} -proc glLineWidth*(width: GLfloat){.stdcall, importc, ogl.} -proc glPointSize*(size: GLfloat){.stdcall, importc, ogl.} -proc glPolygonMode*(face: GLenum, mode: GLenum){.stdcall, importc, ogl.} -proc glScissor*(x: GLint, y: GLint, width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glTexParameterf*(target: GLenum, pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glTexParameterfv*(target: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glTexParameteri*(target: GLenum, pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glTexParameteriv*(target: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glTexImage1D*(target: GLenum, level: GLint, internalformat: GLint, - width: GLsizei, border: GLint, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTexImage2D*(target: GLenum, level: GLint, internalformat: GLint, - width: GLsizei, height: GLsizei, border: GLint, - format: GLenum, typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glDrawBuffer*(mode: GLenum){.stdcall, importc, ogl.} -proc glClear*(mask: GLbitfield){.stdcall, importc, ogl.} -proc glClearColor*(red: GLclampf, green: GLclampf, blue: GLclampf, - alpha: GLclampf){.stdcall, importc, ogl.} -proc glClearStencil*(s: GLint){.stdcall, importc, ogl.} -proc glClearDepth*(depth: GLclampd){.stdcall, importc, ogl.} -proc glStencilMask*(mask: GLuint){.stdcall, importc, ogl.} -proc glColorMask*(red: GLboolean, green: GLboolean, blue: GLboolean, - alpha: GLboolean){.stdcall, importc, ogl.} -proc glDepthMask*(flag: GLboolean){.stdcall, importc, ogl.} -proc glDisable*(cap: GLenum){.stdcall, importc, ogl.} -proc glEnable*(cap: GLenum){.stdcall, importc, ogl.} -proc glFinish*(){.stdcall, importc, ogl.} -proc glFlush*(){.stdcall, importc, ogl.} -proc glBlendFunc*(sfactor: GLenum, dfactor: GLenum){.stdcall, importc, ogl.} -proc glLogicOp*(opcode: GLenum){.stdcall, importc, ogl.} -proc glStencilFunc*(func: GLenum, theRef: GLint, mask: GLuint){.stdcall, importc, ogl.} -proc glStencilOp*(fail: GLenum, zfail: GLenum, zpass: GLenum){.stdcall, importc, ogl.} -proc glDepthFunc*(func: GLenum){.stdcall, importc, ogl.} -proc glPixelStoref*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glPixelStorei*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glReadBuffer*(mode: GLenum){.stdcall, importc, ogl.} -proc glReadPixels*(x: GLint, y: GLint, width: GLsizei, height: GLsizei, - format: GLenum, typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glGetBooleanv*(pname: GLenum, params: PGLboolean){.stdcall, importc, ogl.} -proc glGetDoublev*(pname: GLenum, params: PGLdouble){.stdcall, importc, ogl.} -proc glGetError*(): GLenum{.stdcall, importc, ogl.} -proc glGetFloatv*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetIntegerv*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetString*(name: GLenum): cstring{.stdcall, importc, ogl.} -proc glGetTexImage*(target: GLenum, level: GLint, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glGetTexParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetTexParameterfv*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetTexLevelParameterfv*(target: GLenum, level: GLint, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetTexLevelParameteriv*(target: GLenum, level: GLint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glIsEnabled*(cap: GLenum): GLboolean{.stdcall, importc, ogl.} -proc glDepthRange*(zNear: GLclampd, zFar: GLclampd){.stdcall, importc, ogl.} -proc glViewport*(x: GLint, y: GLint, width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} - # GL_VERSION_1_1 -proc glDrawArrays*(mode: GLenum, first: GLint, count: GLsizei){.stdcall, importc, ogl.} -proc glDrawElements*(mode: GLenum, count: GLsizei, typ: GLenum, indices: PGLvoid){. - stdcall, importc, ogl.} -proc glGetPointerv*(pname: GLenum, params: PGLvoid){.stdcall, importc, ogl.} -proc glPolygonOffset*(factor: GLfloat, units: GLfloat){.stdcall, importc, ogl.} -proc glCopyTexImage1D*(target: GLenum, level: GLint, internalFormat: GLenum, - x: GLint, y: GLint, width: GLsizei, border: GLint){. - stdcall, importc, ogl.} -proc glCopyTexImage2D*(target: GLenum, level: GLint, internalFormat: GLenum, - x: GLint, y: GLint, width: GLsizei, height: GLsizei, - border: GLint){.stdcall, importc, ogl.} -proc glCopyTexSubImage1D*(target: GLenum, level: GLint, xoffset: GLint, - x: GLint, y: GLint, width: GLsizei){.stdcall, importc, ogl.} -proc glCopyTexSubImage2D*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, x: GLint, y: GLint, width: GLsizei, - height: GLsizei){.stdcall, importc, ogl.} -proc glTexSubImage1D*(target: GLenum, level: GLint, xoffset: GLint, - width: GLsizei, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTexSubImage2D*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, width: GLsizei, height: GLsizei, - format: GLenum, typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glBindTexture*(target: GLenum, texture: GLuint){.stdcall, importc, ogl.} -proc glDeleteTextures*(n: GLsizei, textures: PGLuint){.stdcall, importc, ogl.} -proc glGenTextures*(n: GLsizei, textures: PGLuint){.stdcall, importc, ogl.} -proc glAccum*(op: GLenum, value: GLfloat){.stdcall, importc, ogl.} -proc glAlphaFunc*(func: GLenum, theRef: GLclampf){.stdcall, importc, ogl.} -proc glAreTexturesResident*(n: GLsizei, textures: PGLuint, - residences: PGLboolean): GLboolean{.stdcall, importc, ogl.} -proc glArrayElement*(i: GLint){.stdcall, importc, ogl.} -proc glBegin*(mode: GLenum){.stdcall, importc, ogl.} -proc glBitmap*(width: GLsizei, height: GLsizei, xorig: GLfloat, yorig: GLfloat, - xmove: GLfloat, ymove: GLfloat, bitmap: PGLubyte){.stdcall, importc, ogl.} -proc glCallList*(list: GLuint){.stdcall, importc, ogl.} -proc glCallLists*(n: GLsizei, typ: GLenum, lists: PGLvoid){.stdcall, importc, ogl.} -proc glClearAccum*(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat){. - stdcall, importc, ogl.} -proc glClearIndex*(c: GLfloat){.stdcall, importc, ogl.} -proc glClipPlane*(plane: GLenum, equation: PGLdouble){.stdcall, importc, ogl.} -proc glColor3b*(red: GLbyte, green: GLbyte, blue: GLbyte){.stdcall, importc, ogl.} -proc glColor3bv*(v: PGLbyte){.stdcall, importc, ogl.} -proc glColor3bv*(v: TGLVectorb3){.stdcall, importc, ogl.} -proc glColor3d*(red: GLdouble, green: GLdouble, blue: GLdouble){.stdcall, importc, ogl.} -proc glColor3dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glColor3dv*(v: TGLVectord3){.stdcall, importc, ogl.} -proc glColor3f*(red: GLfloat, green: GLfloat, blue: GLfloat){.stdcall, importc, ogl.} -proc glColor3fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glColor3fv*(v: TGLVectorf3){.stdcall, importc, ogl.} -proc glColor3i*(red: GLint, green: GLint, blue: GLint){.stdcall, importc, ogl.} -proc glColor3iv*(v: PGLint){.stdcall, importc, ogl.} -proc glColor3iv*(v: TGLVectori3){.stdcall, importc, ogl.} -proc glColor3s*(red: GLshort, green: GLshort, blue: GLshort){.stdcall, importc, ogl.} -proc glColor3sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glColor3sv*(v: TGLVectors3){.stdcall, importc, ogl.} -proc glColor3ub*(red: GLubyte, green: GLubyte, blue: GLubyte){.stdcall, importc, ogl.} -proc glColor3ubv*(v: PGLubyte){.stdcall, importc, ogl.} -proc glColor3ubv*(v: TGLVectorub3){.stdcall, importc, ogl.} -proc glColor3ui*(red: GLuint, green: GLuint, blue: GLuint){.stdcall, importc, ogl.} -proc glColor3uiv*(v: PGLuint){.stdcall, importc, ogl.} -proc glColor3uiv*(v: TGLVectorui3){.stdcall, importc, ogl.} -proc glColor3us*(red: GLushort, green: GLushort, blue: GLushort){.stdcall, importc, ogl.} -proc glColor3usv*(v: PGLushort){.stdcall, importc, ogl.} -proc glColor3usv*(v: TGLVectorus3){.stdcall, importc, ogl.} -proc glColor4b*(red: GLbyte, green: GLbyte, blue: GLbyte, alpha: GLbyte){. - stdcall, importc, ogl.} -proc glColor4bv*(v: PGLbyte){.stdcall, importc, ogl.} -proc glColor4bv*(v: TGLVectorb4){.stdcall, importc, ogl.} -proc glColor4d*(red: GLdouble, green: GLdouble, blue: GLdouble, alpha: GLdouble){. - stdcall, importc, ogl.} -proc glColor4dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glColor4dv*(v: TGLVectord4){.stdcall, importc, ogl.} -proc glColor4f*(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat){. - stdcall, importc, ogl.} -proc glColor4fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glColor4fv*(v: TGLVectorf4){.stdcall, importc, ogl.} -proc glColor4i*(red: GLint, green: GLint, blue: GLint, alpha: GLint){.stdcall, importc, ogl.} -proc glColor4iv*(v: PGLint){.stdcall, importc, ogl.} -proc glColor4iv*(v: TGLVectori4){.stdcall, importc, ogl.} -proc glColor4s*(red: GLshort, green: GLshort, blue: GLshort, alpha: GLshort){. - stdcall, importc, ogl.} -proc glColor4sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glColor4sv*(v: TGLVectors4){.stdcall, importc, ogl.} -proc glColor4ub*(red: GLubyte, green: GLubyte, blue: GLubyte, alpha: GLubyte){. - stdcall, importc, ogl.} -proc glColor4ubv*(v: PGLubyte){.stdcall, importc, ogl.} -proc glColor4ubv*(v: TGLVectorub4){.stdcall, importc, ogl.} -proc glColor4ui*(red: GLuint, green: GLuint, blue: GLuint, alpha: GLuint){. - stdcall, importc, ogl.} -proc glColor4uiv*(v: PGLuint){.stdcall, importc, ogl.} -proc glColor4uiv*(v: TGLVectorui4){.stdcall, importc, ogl.} -proc glColor4us*(red: GLushort, green: GLushort, blue: GLushort, alpha: GLushort){. - stdcall, importc, ogl.} -proc glColor4usv*(v: PGLushort){.stdcall, importc, ogl.} -proc glColorMaterial*(face: GLenum, mode: GLenum){.stdcall, importc, ogl.} -proc glColorPointer*(size: GLint, typ: GLenum, stride: GLsizei, pointer: PGLvoid){. - stdcall, importc, ogl.} -proc glCopyPixels*(x: GLint, y: GLint, width: GLsizei, height: GLsizei, - typ: GLenum){.stdcall, importc, ogl.} -proc glDeleteLists*(list: GLuint, range: GLsizei){.stdcall, importc, ogl.} -proc glDisableClientState*(arr: GLenum){.stdcall, importc, ogl.} -proc glDrawPixels*(width: GLsizei, height: GLsizei, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glEdgeFlag*(flag: GLboolean){.stdcall, importc, ogl.} -proc glEdgeFlagPointer*(stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glEdgeFlagv*(flag: PGLboolean){.stdcall, importc, ogl.} -proc glEnableClientState*(arr: GLenum){.stdcall, importc, ogl.} -proc glEnd*(){.stdcall, importc, ogl.} -proc glEndList*(){.stdcall, importc, ogl.} -proc glEvalCoord1d*(u: GLdouble){.stdcall, importc, ogl.} -proc glEvalCoord1dv*(u: PGLdouble){.stdcall, importc, ogl.} -proc glEvalCoord1f*(u: GLfloat){.stdcall, importc, ogl.} -proc glEvalCoord1fv*(u: PGLfloat){.stdcall, importc, ogl.} -proc glEvalCoord2d*(u: GLdouble, v: GLdouble){.stdcall, importc, ogl.} -proc glEvalCoord2dv*(u: PGLdouble){.stdcall, importc, ogl.} -proc glEvalCoord2f*(u: GLfloat, v: GLfloat){.stdcall, importc, ogl.} -proc glEvalCoord2fv*(u: PGLfloat){.stdcall, importc, ogl.} -proc glEvalMesh1*(mode: GLenum, i1: GLint, i2: GLint){.stdcall, importc, ogl.} -proc glEvalMesh2*(mode: GLenum, i1: GLint, i2: GLint, j1: GLint, j2: GLint){. - stdcall, importc, ogl.} -proc glEvalPoint1*(i: GLint){.stdcall, importc, ogl.} -proc glEvalPoint2*(i: GLint, j: GLint){.stdcall, importc, ogl.} -proc glFeedbackBuffer*(size: GLsizei, typ: GLenum, buffer: PGLfloat){.stdcall, importc, ogl.} -proc glFogf*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glFogfv*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glFogi*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glFogiv*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glFrustum*(left: GLdouble, right: GLdouble, bottom: GLdouble, - top: GLdouble, zNear: GLdouble, zFar: GLdouble){.stdcall, importc, ogl.} -proc glGenLists*(range: GLsizei): GLuint{.stdcall, importc, ogl.} -proc glGetClipPlane*(plane: GLenum, equation: PGLdouble){.stdcall, importc, ogl.} -proc glGetLightfv*(light: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetLightiv*(light: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetMapdv*(target: GLenum, query: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glGetMapfv*(target: GLenum, query: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glGetMapiv*(target: GLenum, query: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glGetMaterialfv*(face: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetMaterialiv*(face: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetPixelMapfv*(map: GLenum, values: PGLfloat){.stdcall, importc, ogl.} -proc glGetPixelMapuiv*(map: GLenum, values: PGLuint){.stdcall, importc, ogl.} -proc glGetPixelMapusv*(map: GLenum, values: PGLushort){.stdcall, importc, ogl.} -proc glGetPolygonStipple*(mask: PGLubyte){.stdcall, importc, ogl.} -proc glGetTexEnvfv*(target: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetTexEnviv*(target: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetTexGendv*(coord: GLenum, pname: GLenum, params: PGLdouble){.stdcall, importc, ogl.} -proc glGetTexGenfv*(coord: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetTexGeniv*(coord: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glIndexMask*(mask: GLuint){.stdcall, importc, ogl.} -proc glIndexPointer*(typ: GLenum, stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glIndexd*(c: GLdouble){.stdcall, importc, ogl.} -proc glIndexdv*(c: PGLdouble){.stdcall, importc, ogl.} -proc glIndexf*(c: GLfloat){.stdcall, importc, ogl.} -proc glIndexfv*(c: PGLfloat){.stdcall, importc, ogl.} -proc glIndexi*(c: GLint){.stdcall, importc, ogl.} -proc glIndexiv*(c: PGLint){.stdcall, importc, ogl.} -proc glIndexs*(c: GLshort){.stdcall, importc, ogl.} -proc glIndexsv*(c: PGLshort){.stdcall, importc, ogl.} -proc glIndexub*(c: GLubyte){.stdcall, importc, ogl.} -proc glIndexubv*(c: PGLubyte){.stdcall, importc, ogl.} -proc glInitNames*(){.stdcall, importc, ogl.} -proc glInterleavedArrays*(format: GLenum, stride: GLsizei, pointer: PGLvoid){. - stdcall, importc, ogl.} -proc glIsList*(list: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glIsTexture*(texture: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glLightModelf*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glLightModelfv*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glLightModeli*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glLightModeliv*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glLightf*(light: GLenum, pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glLightfv*(light: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glLighti*(light: GLenum, pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glLightiv*(light: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glLineStipple*(factor: GLint, pattern: GLushort){.stdcall, importc, ogl.} -proc glListBase*(base: GLuint){.stdcall, importc, ogl.} -proc glLoadIdentity*(){.stdcall, importc, ogl.} -proc glLoadMatrixd*(m: PGLdouble){.stdcall, importc, ogl.} -proc glLoadMatrixf*(m: PGLfloat){.stdcall, importc, ogl.} -proc glLoadName*(name: GLuint){.stdcall, importc, ogl.} -proc glMap1d*(target: GLenum, u1: GLdouble, u2: GLdouble, stride: GLint, - order: GLint, points: PGLdouble){.stdcall, importc, ogl.} -proc glMap1f*(target: GLenum, u1: GLfloat, u2: GLfloat, stride: GLint, - order: GLint, points: PGLfloat){.stdcall, importc, ogl.} -proc glMap2d*(target: GLenum, u1: GLdouble, u2: GLdouble, ustride: GLint, - uorder: GLint, v1: GLdouble, v2: GLdouble, vstride: GLint, - vorder: GLint, points: PGLdouble){.stdcall, importc, ogl.} -proc glMap2f*(target: GLenum, u1: GLfloat, u2: GLfloat, ustride: GLint, - uorder: GLint, v1: GLfloat, v2: GLfloat, vstride: GLint, - vorder: GLint, points: PGLfloat){.stdcall, importc, ogl.} -proc glMapGrid1d*(un: GLint, u1: GLdouble, u2: GLdouble){.stdcall, importc, ogl.} -proc glMapGrid1f*(un: GLint, u1: GLfloat, u2: GLfloat){.stdcall, importc, ogl.} -proc glMapGrid2d*(un: GLint, u1: GLdouble, u2: GLdouble, vn: GLint, - v1: GLdouble, v2: GLdouble){.stdcall, importc, ogl.} -proc glMapGrid2f*(un: GLint, u1: GLfloat, u2: GLfloat, vn: GLint, v1: GLfloat, - v2: GLfloat){.stdcall, importc, ogl.} -proc glMaterialf*(face: GLenum, pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glMaterialfv*(face: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glMateriali*(face: GLenum, pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glMaterialiv*(face: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glMatrixMode*(mode: GLenum){.stdcall, importc, ogl.} -proc glMultMatrixd*(m: PGLdouble){.stdcall, importc, ogl.} -proc glMultMatrixf*(m: PGLfloat){.stdcall, importc, ogl.} -proc glNewList*(list: GLuint, mode: GLenum){.stdcall, importc, ogl.} -proc glNormal3b*(nx: GLbyte, ny: GLbyte, nz: GLbyte){.stdcall, importc, ogl.} -proc glNormal3bv*(v: PGLbyte){.stdcall, importc, ogl.} -proc glNormal3d*(nx: GLdouble, ny: GLdouble, nz: GLdouble){.stdcall, importc, ogl.} -proc glNormal3dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glNormal3f*(nx: GLfloat, ny: GLfloat, nz: GLfloat){.stdcall, importc, ogl.} -proc glNormal3fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glNormal3i*(nx: GLint, ny: GLint, nz: GLint){.stdcall, importc, ogl.} -proc glNormal3iv*(v: PGLint){.stdcall, importc, ogl.} -proc glNormal3s*(nx: GLshort, ny: GLshort, nz: GLshort){.stdcall, importc, ogl.} -proc glNormal3sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glNormalPointer*(typ: GLenum, stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glOrtho*(left: GLdouble, right: GLdouble, bottom: GLdouble, top: GLdouble, - zNear: GLdouble, zFar: GLdouble){.stdcall, importc, ogl.} -proc glPassThrough*(token: GLfloat){.stdcall, importc, ogl.} -proc glPixelMapfv*(map: GLenum, mapsize: GLsizei, values: PGLfloat){.stdcall, importc, ogl.} -proc glPixelMapuiv*(map: GLenum, mapsize: GLsizei, values: PGLuint){.stdcall, importc, ogl.} -proc glPixelMapusv*(map: GLenum, mapsize: GLsizei, values: PGLushort){.stdcall, importc, ogl.} -proc glPixelTransferf*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glPixelTransferi*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glPixelZoom*(xfactor: GLfloat, yfactor: GLfloat){.stdcall, importc, ogl.} -proc glPolygonStipple*(mask: PGLubyte){.stdcall, importc, ogl.} -proc glPopAttrib*(){.stdcall, importc, ogl.} -proc glPopClientAttrib*(){.stdcall, importc, ogl.} -proc glPopMatrix*(){.stdcall, importc, ogl.} -proc glPopName*(){.stdcall, importc, ogl.} -proc glPrioritizeTextures*(n: GLsizei, textures: PGLuint, priorities: PGLclampf){. - stdcall, importc, ogl.} -proc glPushAttrib*(mask: GLbitfield){.stdcall, importc, ogl.} -proc glPushClientAttrib*(mask: GLbitfield){.stdcall, importc, ogl.} -proc glPushMatrix*(){.stdcall, importc, ogl.} -proc glPushName*(name: GLuint){.stdcall, importc, ogl.} -proc glRasterPos2d*(x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glRasterPos2dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glRasterPos2f*(x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glRasterPos2fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glRasterPos2i*(x: GLint, y: GLint){.stdcall, importc, ogl.} -proc glRasterPos2iv*(v: PGLint){.stdcall, importc, ogl.} -proc glRasterPos2s*(x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glRasterPos2sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glRasterPos3d*(x: GLdouble, y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glRasterPos3dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glRasterPos3f*(x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glRasterPos3fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glRasterPos3i*(x: GLint, y: GLint, z: GLint){.stdcall, importc, ogl.} -proc glRasterPos3iv*(v: PGLint){.stdcall, importc, ogl.} -proc glRasterPos3s*(x: GLshort, y: GLshort, z: GLshort){.stdcall, importc, ogl.} -proc glRasterPos3sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glRasterPos4d*(x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble){.stdcall, importc, ogl.} -proc glRasterPos4dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glRasterPos4f*(x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat){.stdcall, importc, ogl.} -proc glRasterPos4fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glRasterPos4i*(x: GLint, y: GLint, z: GLint, w: GLint){.stdcall, importc, ogl.} -proc glRasterPos4iv*(v: PGLint){.stdcall, importc, ogl.} -proc glRasterPos4s*(x: GLshort, y: GLshort, z: GLshort, w: GLshort){.stdcall, importc, ogl.} -proc glRasterPos4sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glRectd*(x1: GLdouble, y1: GLdouble, x2: GLdouble, y2: GLdouble){.stdcall, importc, ogl.} -proc glRectdv*(v1: PGLdouble, v2: PGLdouble){.stdcall, importc, ogl.} -proc glRectf*(x1: GLfloat, y1: GLfloat, x2: GLfloat, y2: GLfloat){.stdcall, importc, ogl.} -proc glRectfv*(v1: PGLfloat, v2: PGLfloat){.stdcall, importc, ogl.} -proc glRecti*(x1: GLint, y1: GLint, x2: GLint, y2: GLint){.stdcall, importc, ogl.} -proc glRectiv*(v1: PGLint, v2: PGLint){.stdcall, importc, ogl.} -proc glRects*(x1: GLshort, y1: GLshort, x2: GLshort, y2: GLshort){.stdcall, importc, ogl.} -proc glRectsv*(v1: PGLshort, v2: PGLshort){.stdcall, importc, ogl.} -proc glRenderMode*(mode: GLenum): GLint{.stdcall, importc, ogl.} -proc glRotated*(angle: GLdouble, x: GLdouble, y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glRotatef*(angle: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glScaled*(x: GLdouble, y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glScalef*(x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glSelectBuffer*(size: GLsizei, buffer: PGLuint){.stdcall, importc, ogl.} -proc glShadeModel*(mode: GLenum){.stdcall, importc, ogl.} -proc glTexCoord1d*(s: GLdouble){.stdcall, importc, ogl.} -proc glTexCoord1dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glTexCoord1f*(s: GLfloat){.stdcall, importc, ogl.} -proc glTexCoord1fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glTexCoord1i*(s: GLint){.stdcall, importc, ogl.} -proc glTexCoord1iv*(v: PGLint){.stdcall, importc, ogl.} -proc glTexCoord1s*(s: GLshort){.stdcall, importc, ogl.} -proc glTexCoord1sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glTexCoord2d*(s: GLdouble, t: GLdouble){.stdcall, importc, ogl.} -proc glTexCoord2dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glTexCoord2f*(s: GLfloat, t: GLfloat){.stdcall, importc, ogl.} -proc glTexCoord2fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glTexCoord2i*(s: GLint, t: GLint){.stdcall, importc, ogl.} -proc glTexCoord2iv*(v: PGLint){.stdcall, importc, ogl.} -proc glTexCoord2s*(s: GLshort, t: GLshort){.stdcall, importc, ogl.} -proc glTexCoord2sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glTexCoord3d*(s: GLdouble, t: GLdouble, r: GLdouble){.stdcall, importc, ogl.} -proc glTexCoord3dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glTexCoord3f*(s: GLfloat, t: GLfloat, r: GLfloat){.stdcall, importc, ogl.} -proc glTexCoord3fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glTexCoord3i*(s: GLint, t: GLint, r: GLint){.stdcall, importc, ogl.} -proc glTexCoord3iv*(v: PGLint){.stdcall, importc, ogl.} -proc glTexCoord3s*(s: GLshort, t: GLshort, r: GLshort){.stdcall, importc, ogl.} -proc glTexCoord3sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glTexCoord4d*(s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble){.stdcall, importc, ogl.} -proc glTexCoord4dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glTexCoord4f*(s: GLfloat, t: GLfloat, r: GLfloat, q: GLfloat){.stdcall, importc, ogl.} -proc glTexCoord4fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glTexCoord4i*(s: GLint, t: GLint, r: GLint, q: GLint){.stdcall, importc, ogl.} -proc glTexCoord4iv*(v: PGLint){.stdcall, importc, ogl.} -proc glTexCoord4s*(s: GLshort, t: GLshort, r: GLshort, q: GLshort){.stdcall, importc, ogl.} -proc glTexCoord4sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glTexCoordPointer*(size: GLint, typ: GLenum, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} -proc glTexEnvf*(target: GLenum, pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glTexEnvfv*(target: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glTexEnvi*(target: GLenum, pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glTexEnviv*(target: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glTexGend*(coord: GLenum, pname: GLenum, param: GLdouble){.stdcall, importc, ogl.} -proc glTexGendv*(coord: GLenum, pname: GLenum, params: PGLdouble){.stdcall, importc, ogl.} -proc glTexGenf*(coord: GLenum, pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glTexGenfv*(coord: GLenum, pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glTexGeni*(coord: GLenum, pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glTexGeniv*(coord: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glTranslated*(x: GLdouble, y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glTranslatef*(x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glVertex2d*(x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glVertex2dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glVertex2f*(x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glVertex2fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glVertex2i*(x: GLint, y: GLint){.stdcall, importc, ogl.} -proc glVertex2iv*(v: PGLint){.stdcall, importc, ogl.} -proc glVertex2s*(x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glVertex2sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glVertex3d*(x: GLdouble, y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glVertex3dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glVertex3f*(x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glVertex3fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glVertex3i*(x: GLint, y: GLint, z: GLint){.stdcall, importc, ogl.} -proc glVertex3iv*(v: PGLint){.stdcall, importc, ogl.} -proc glVertex3s*(x: GLshort, y: GLshort, z: GLshort){.stdcall, importc, ogl.} -proc glVertex3sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glVertex4d*(x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble){.stdcall, importc, ogl.} -proc glVertex4dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glVertex4f*(x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat){.stdcall, importc, ogl.} -proc glVertex4fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glVertex4i*(x: GLint, y: GLint, z: GLint, w: GLint){.stdcall, importc, ogl.} -proc glVertex4iv*(v: PGLint){.stdcall, importc, ogl.} -proc glVertex4s*(x: GLshort, y: GLshort, z: GLshort, w: GLshort){.stdcall, importc, ogl.} -proc glVertex4sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glVertexPointer*(size: GLint, typ: GLenum, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} - # GL_VERSION_1_2 -proc glBlendColor*(red: GLclampf, green: GLclampf, blue: GLclampf, - alpha: GLclampf){.stdcall, importc, ogl.} -proc glBlendEquation*(mode: GLenum){.stdcall, importc, ogl.} -proc glDrawRangeElements*(mode: GLenum, start: GLuint, ending: GLuint, - count: GLsizei, typ: GLenum, indices: PGLvoid){. - stdcall, importc, ogl.} -proc glTexImage3D*(target: GLenum, level: GLint, internalformat: GLint, - width: GLsizei, height: GLsizei, depth: GLsizei, - border: GLint, format: GLenum, typ: GLenum, pixels: PGLvoid){. - stdcall, importc, ogl.} -proc glTexSubImage3D*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, width: GLsizei, - height: GLsizei, depth: GLsizei, format: GLenum, - typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glCopyTexSubImage3D*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glColorTable*(target: GLenum, internalformat: GLenum, width: GLsizei, - format: GLenum, typ: GLenum, table: PGLvoid){.stdcall, importc, ogl.} -proc glColorTableParameterfv*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glColorTableParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glCopyColorTable*(target: GLenum, internalformat: GLenum, x: GLint, - y: GLint, width: GLsizei){.stdcall, importc, ogl.} -proc glGetColorTable*(target: GLenum, format: GLenum, typ: GLenum, - table: PGLvoid){.stdcall, importc, ogl.} -proc glGetColorTableParameterfv*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetColorTableParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glColorSubTable*(target: GLenum, start: GLsizei, count: GLsizei, - format: GLenum, typ: GLenum, data: PGLvoid){.stdcall, importc, ogl.} -proc glCopyColorSubTable*(target: GLenum, start: GLsizei, x: GLint, y: GLint, - width: GLsizei){.stdcall, importc, ogl.} -proc glConvolutionFilter1D*(target: GLenum, internalformat: GLenum, - width: GLsizei, format: GLenum, typ: GLenum, - image: PGLvoid){.stdcall, importc, ogl.} -proc glConvolutionFilter2D*(target: GLenum, internalformat: GLenum, - width: GLsizei, height: GLsizei, format: GLenum, - typ: GLenum, image: PGLvoid){.stdcall, importc, ogl.} -proc glConvolutionParameterf*(target: GLenum, pname: GLenum, params: GLfloat){. - stdcall, importc, ogl.} -proc glConvolutionParameterfv*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glConvolutionParameteri*(target: GLenum, pname: GLenum, params: GLint){. - stdcall, importc, ogl.} -proc glConvolutionParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glCopyConvolutionFilter1D*(target: GLenum, internalformat: GLenum, - x: GLint, y: GLint, width: GLsizei){.stdcall, importc, ogl.} -proc glCopyConvolutionFilter2D*(target: GLenum, internalformat: GLenum, - x: GLint, y: GLint, width: GLsizei, - height: GLsizei){.stdcall, importc, ogl.} -proc glGetConvolutionFilter*(target: GLenum, format: GLenum, typ: GLenum, - image: PGLvoid){.stdcall, importc, ogl.} -proc glGetConvolutionParameterfv*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetConvolutionParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetSeparableFilter*(target: GLenum, format: GLenum, typ: GLenum, - row: PGLvoid, column: PGLvoid, span: PGLvoid){. - stdcall, importc, ogl.} -proc glSeparableFilter2D*(target: GLenum, internalformat: GLenum, - width: GLsizei, height: GLsizei, format: GLenum, - typ: GLenum, row: PGLvoid, column: PGLvoid){.stdcall, importc, ogl.} -proc glGetHistogram*(target: GLenum, reset: GLboolean, format: GLenum, - typ: GLenum, values: PGLvoid){.stdcall, importc, ogl.} -proc glGetHistogramParameterfv*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetHistogramParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetMinmax*(target: GLenum, reset: GLboolean, format: GLenum, typ: GLenum, - values: PGLvoid){.stdcall, importc, ogl.} -proc glGetMinmaxParameterfv*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetMinmaxParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glHistogram*(target: GLenum, width: GLsizei, internalformat: GLenum, - sink: GLboolean){.stdcall, importc, ogl.} -proc glMinmax*(target: GLenum, internalformat: GLenum, sink: GLboolean){.stdcall, importc, ogl.} -proc glResetHistogram*(target: GLenum){.stdcall, importc, ogl.} -proc glResetMinmax*(target: GLenum){.stdcall, importc, ogl.} - # GL_VERSION_1_3 -proc glActiveTexture*(texture: GLenum){.stdcall, importc, ogl.} -proc glSampleCoverage*(value: GLclampf, invert: GLboolean){.stdcall, importc, ogl.} -proc glCompressedTexImage3D*(target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - height: GLsizei, depth: GLsizei, border: GLint, - imageSize: GLsizei, data: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTexImage2D*(target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - height: GLsizei, border: GLint, imageSize: GLsizei, - data: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTexImage1D*(target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - border: GLint, imageSize: GLsizei, data: PGLvoid){. - stdcall, importc, ogl.} -proc glCompressedTexSubImage3D*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, width: GLsizei, - height: GLsizei, depth: GLsizei, format: GLenum, - imageSize: GLsizei, data: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTexSubImage2D*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, width: GLsizei, height: GLsizei, - format: GLenum, imageSize: GLsizei, - data: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTexSubImage1D*(target: GLenum, level: GLint, xoffset: GLint, - width: GLsizei, format: GLenum, - imageSize: GLsizei, data: PGLvoid){.stdcall, importc, ogl.} -proc glGetCompressedTexImage*(target: GLenum, level: GLint, img: PGLvoid){. - stdcall, importc, ogl.} -proc glClientActiveTexture*(texture: GLenum){.stdcall, importc, ogl.} -proc glMultiTexCoord1d*(target: GLenum, s: GLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord1dv*(target: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord1f*(target: GLenum, s: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord1fv*(target: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord1i*(target: GLenum, s: GLint){.stdcall, importc, ogl.} -proc glMultiTexCoord1iv*(target: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glMultiTexCoord1s*(target: GLenum, s: GLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord1sv*(target: GLenum, v: PGLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord2d*(target: GLenum, s: GLdouble, t: GLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord2dv*(target: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord2f*(target: GLenum, s: GLfloat, t: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord2fv*(target: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord2i*(target: GLenum, s: GLint, t: GLint){.stdcall, importc, ogl.} -proc glMultiTexCoord2iv*(target: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glMultiTexCoord2s*(target: GLenum, s: GLshort, t: GLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord2sv*(target: GLenum, v: PGLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord3d*(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble){. - stdcall, importc, ogl.} -proc glMultiTexCoord3dv*(target: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord3f*(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat){. - stdcall, importc, ogl.} -proc glMultiTexCoord3fv*(target: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord3i*(target: GLenum, s: GLint, t: GLint, r: GLint){.stdcall, importc, ogl.} -proc glMultiTexCoord3iv*(target: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glMultiTexCoord3s*(target: GLenum, s: GLshort, t: GLshort, r: GLshort){. - stdcall, importc, ogl.} -proc glMultiTexCoord3sv*(target: GLenum, v: PGLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord4d*(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble, - q: GLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord4dv*(target: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord4f*(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat, - q: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord4fv*(target: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord4i*(target: GLenum, s: GLint, t: GLint, r: GLint, q: GLint){. - stdcall, importc, ogl.} -proc glMultiTexCoord4iv*(target: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glMultiTexCoord4s*(target: GLenum, s: GLshort, t: GLshort, r: GLshort, - q: GLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord4sv*(target: GLenum, v: PGLshort){.stdcall, importc, ogl.} -proc glLoadTransposeMatrixf*(m: PGLfloat){.stdcall, importc, ogl.} -proc glLoadTransposeMatrixd*(m: PGLdouble){.stdcall, importc, ogl.} -proc glMultTransposeMatrixf*(m: PGLfloat){.stdcall, importc, ogl.} -proc glMultTransposeMatrixd*(m: PGLdouble){.stdcall, importc, ogl.} - # GL_VERSION_1_4 -proc glBlendFuncSeparate*(sfactorRGB: GLenum, dfactorRGB: GLenum, - sfactorAlpha: GLenum, dfactorAlpha: GLenum){.stdcall, importc, ogl.} -proc glMultiDrawArrays*(mode: GLenum, first: PGLint, count: PGLsizei, - primcount: GLsizei){.stdcall, importc, ogl.} -proc glMultiDrawElements*(mode: GLenum, count: PGLsizei, typ: GLenum, - indices: PGLvoid, primcount: GLsizei){.stdcall, importc, ogl.} -proc glPointParameterf*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glPointParameterfv*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glPointParameteri*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glPointParameteriv*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glFogCoordf*(coord: GLfloat){.stdcall, importc, ogl.} -proc glFogCoordfv*(coord: PGLfloat){.stdcall, importc, ogl.} -proc glFogCoordd*(coord: GLdouble){.stdcall, importc, ogl.} -proc glFogCoorddv*(coord: PGLdouble){.stdcall, importc, ogl.} -proc glFogCoordPointer*(typ: GLenum, stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glSecondaryColor3b*(red: GLbyte, green: GLbyte, blue: GLbyte){.stdcall, importc, ogl.} -proc glSecondaryColor3bv*(v: PGLbyte){.stdcall, importc, ogl.} -proc glSecondaryColor3d*(red: GLdouble, green: GLdouble, blue: GLdouble){. - stdcall, importc, ogl.} -proc glSecondaryColor3dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glSecondaryColor3f*(red: GLfloat, green: GLfloat, blue: GLfloat){.stdcall, importc, ogl.} -proc glSecondaryColor3fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glSecondaryColor3i*(red: GLint, green: GLint, blue: GLint){.stdcall, importc, ogl.} -proc glSecondaryColor3iv*(v: PGLint){.stdcall, importc, ogl.} -proc glSecondaryColor3s*(red: GLshort, green: GLshort, blue: GLshort){.stdcall, importc, ogl.} -proc glSecondaryColor3sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glSecondaryColor3ub*(red: GLubyte, green: GLubyte, blue: GLubyte){.stdcall, importc, ogl.} -proc glSecondaryColor3ubv*(v: PGLubyte){.stdcall, importc, ogl.} -proc glSecondaryColor3ui*(red: GLuint, green: GLuint, blue: GLuint){.stdcall, importc, ogl.} -proc glSecondaryColor3uiv*(v: PGLuint){.stdcall, importc, ogl.} -proc glSecondaryColor3us*(red: GLushort, green: GLushort, blue: GLushort){. - stdcall, importc, ogl.} -proc glSecondaryColor3usv*(v: PGLushort){.stdcall, importc, ogl.} -proc glSecondaryColorPointer*(size: GLint, typ: GLenum, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} -proc glWindowPos2d*(x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glWindowPos2dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glWindowPos2f*(x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glWindowPos2fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glWindowPos2i*(x: GLint, y: GLint){.stdcall, importc, ogl.} -proc glWindowPos2iv*(v: PGLint){.stdcall, importc, ogl.} -proc glWindowPos2s*(x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glWindowPos2sv*(v: PGLshort){.stdcall, importc, ogl.} -proc glWindowPos3d*(x: GLdouble, y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glWindowPos3dv*(v: PGLdouble){.stdcall, importc, ogl.} -proc glWindowPos3f*(x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glWindowPos3fv*(v: PGLfloat){.stdcall, importc, ogl.} -proc glWindowPos3i*(x: GLint, y: GLint, z: GLint){.stdcall, importc, ogl.} -proc glWindowPos3iv*(v: PGLint){.stdcall, importc, ogl.} -proc glWindowPos3s*(x: GLshort, y: GLshort, z: GLshort){.stdcall, importc, ogl.} -proc glWindowPos3sv*(v: PGLshort){.stdcall, importc, ogl.} - # GL_VERSION_1_5 -proc glGenQueries*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glDeleteQueries*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glIsQuery*(id: GLuint): bool{.stdcall, importc, ogl.} -proc glBeginQuery*(target: GLenum, id: GLuint){.stdcall, importc, ogl.} -proc glEndQuery*(target: GLenum){.stdcall, importc, ogl.} -proc glGetQueryiv*(target, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetQueryObjectiv*(id: GLuint, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetQueryObjectuiv*(id: GLuint, pname: GLenum, params: PGLuint){.stdcall, importc, ogl.} -proc glBindBuffer*(target: GLenum, buffer: GLuint){.stdcall, importc, ogl.} -proc glDeleteBuffers*(n: GLsizei, buffers: PGLuint){.stdcall, importc, ogl.} -proc glGenBuffers*(n: GLsizei, buffers: PGLuint){.stdcall, importc, ogl.} -proc glIsBuffer*(buffer: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glBufferData*(target: GLenum, size: GLsizeiptr, data: PGLvoid, - usage: GLenum){.stdcall, importc, ogl.} -proc glBufferSubData*(target: GLenum, offset: GLintptr, size: GLsizeiptr, - data: PGLvoid){.stdcall, importc, ogl.} -proc glGetBufferSubData*(target: GLenum, offset: GLintptr, size: GLsizeiptr, - data: PGLvoid){.stdcall, importc, ogl.} -proc glMapBuffer*(target: GLenum, access: GLenum): PGLvoid{.stdcall, importc, ogl.} -proc glUnmapBuffer*(target: GLenum): GLboolean{.stdcall, importc, ogl.} -proc glGetBufferParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetBufferPointerv*(target: GLenum, pname: GLenum, params: PGLvoid){. - stdcall, importc, ogl.} - # GL_VERSION_2_0 -proc glBlendEquationSeparate*(modeRGB: GLenum, modeAlpha: GLenum){.stdcall, importc, ogl.} -proc glDrawBuffers*(n: GLsizei, bufs: PGLenum){.stdcall, importc, ogl.} -proc glStencilOpSeparate*(face: GLenum, sfail: GLenum, dpfail: GLenum, - dppass: GLenum){.stdcall, importc, ogl.} -proc glStencilFuncSeparate*(face: GLenum, func: GLenum, theRef: GLint, mask: GLuint){. - stdcall, importc, ogl.} -proc glStencilMaskSeparate*(face: GLenum, mask: GLuint){.stdcall, importc, ogl.} -proc glAttachShader*(programObj, shaderObj: GLhandle){.stdcall, importc, ogl.} -proc glBindAttribLocation*(programObj: GLhandle, index: GLuint, name: PGLChar){. - stdcall, importc, ogl.} -proc glCompileShader*(shaderObj: GLhandle){.stdcall, importc, ogl.} -proc glCreateProgram*(): GLhandle{.stdcall, importc, ogl.} -proc glCreateShader*(shaderType: GLenum): GLhandle{.stdcall, importc, ogl.} -proc glDeleteProgram*(programObj: GLhandle){.stdcall, importc, ogl.} -proc glDeleteShader*(shaderObj: GLhandle){.stdcall, importc, ogl.} -proc glDetachShader*(programObj, shaderObj: GLhandle){.stdcall, importc, ogl.} -proc glDisableVertexAttribArray*(index: GLuint){.stdcall, importc, ogl.} -proc glEnableVertexAttribArray*(index: GLuint){.stdcall, importc, ogl.} -proc glGetActiveAttrib*(programObj: GLhandle, index: GLuint, maxlength: GLsizei, - len: var GLint, size: var GLint, typ: var GLenum, - name: PGLChar){.stdcall, importc, ogl.} -proc glGetActiveUniform*(programObj: GLhandle, index: GLuint, - maxLength: GLsizei, len: var GLsizei, size: var GLint, - typ: var GLenum, name: PGLChar){.stdcall, importc, ogl.} -proc glGetAttachedShaders*(programObj: GLhandle, MaxCount: GLsizei, - Count: var GLint, shaders: PGLuint){.stdcall, importc, ogl.} -proc glGetAttribLocation*(programObj: GLhandle, char: PGLChar): glint{.stdcall, importc, ogl.} -proc glGetProgramiv*(programObj: GLhandle, pname: GLenum, params: PGLInt){. - stdcall, importc, ogl.} -proc glGetProgramInfoLog*(programObj: GLHandle, maxLength: glsizei, - len: var GLint, infoLog: PGLChar){.stdcall, importc, ogl.} -proc glGetShaderiv*(shaderObj: GLhandle, pname: GLenum, params: PGLInt){.stdcall, importc, ogl.} -proc glGetShaderInfoLog*(shaderObj: GLHandle, maxLength: glsizei, - len: var glint, infoLog: PGLChar){.stdcall, importc, ogl.} -proc glGetShaderSource*(shaderObj: GLhandle, maxlength: GLsizei, - len: var GLsizei, source: PGLChar){.stdcall, importc, ogl.} -proc glGetUniformLocation*(programObj: GLhandle, char: PGLChar): glint{.stdcall, importc, ogl.} -proc glGetUniformfv*(programObj: GLhandle, location: GLint, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetUniformiv*(programObj: GLhandle, location: GLint, params: PGLInt){. - stdcall, importc, ogl.} -proc glGetVertexAttribfv*(index: GLuint, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetVertexAttribiv*(index: GLuint, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetVertexAttribPointerv*(index: GLuint, pname: GLenum, pointer: PGLvoid){. - stdcall, importc, ogl.} -proc glIsProgram*(programObj: GLhandle): GLboolean{.stdcall, importc, ogl.} -proc glIsShader*(shaderObj: GLhandle): GLboolean{.stdcall, importc, ogl.} -proc glLinkProgram*(programObj: GLHandle){.stdcall, importc, ogl.} -proc glShaderSource*(shaderObj: GLHandle, count: glsizei, string: cstringArray, - lengths: pglint){.stdcall, importc, ogl.} -proc glUseProgram*(programObj: GLhandle){.stdcall, importc, ogl.} -proc glUniform1f*(location: GLint, v0: GLfloat){.stdcall, importc, ogl.} -proc glUniform2f*(location: GLint, v0, v1: GLfloat){.stdcall, importc, ogl.} -proc glUniform3f*(location: GLint, v0, v1, v2: GLfloat){.stdcall, importc, ogl.} -proc glUniform4f*(location: GLint, v0, v1, v2, v3: GLfloat){.stdcall, importc, ogl.} -proc glUniform1i*(location: GLint, v0: GLint){.stdcall, importc, ogl.} -proc glUniform2i*(location: GLint, v0, v1: GLint){.stdcall, importc, ogl.} -proc glUniform3i*(location: GLint, v0, v1, v2: GLint){.stdcall, importc, ogl.} -proc glUniform4i*(location: GLint, v0, v1, v2, v3: GLint){.stdcall, importc, ogl.} -proc glUniform1fv*(location: GLint, count: GLsizei, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniform2fv*(location: GLint, count: GLsizei, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniform3fv*(location: GLint, count: GLsizei, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniform4fv*(location: GLint, count: GLsizei, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniform1iv*(location: GLint, count: GLsizei, value: PGLint){.stdcall, importc, ogl.} -proc glUniform2iv*(location: GLint, count: GLsizei, value: PGLint){.stdcall, importc, ogl.} -proc glUniform3iv*(location: GLint, count: GLsizei, value: PGLint){.stdcall, importc, ogl.} -proc glUniform4iv*(location: GLint, count: GLsizei, value: PGLint){.stdcall, importc, ogl.} -proc glUniformMatrix2fv*(location: GLint, count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glUniformMatrix3fv*(location: GLint, count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glUniformMatrix4fv*(location: GLint, count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glValidateProgram*(programObj: GLhandle){.stdcall, importc, ogl.} -proc glVertexAttrib1d*(index: GLuint, x: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib1dv*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib1f*(index: GLuint, x: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib1fv*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib1s*(index: GLuint, x: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib1sv*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib2d*(index: GLuint, x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib2dv*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib2f*(index: GLuint, x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib2fv*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib2s*(index: GLuint, x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib2sv*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib3d*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glVertexAttrib3dv*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib3f*(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat){. - stdcall, importc, ogl.} -proc glVertexAttrib3fv*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib3s*(index: GLuint, x: GLshort, y: GLshort, z: GLshort){. - stdcall, importc, ogl.} -proc glVertexAttrib3sv*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4Nbv*(index: GLuint, v: PGLbyte){.stdcall, importc, ogl.} -proc glVertexAttrib4Niv*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttrib4Nsv*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4Nub*(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, - w: GLubyte){.stdcall, importc, ogl.} -proc glVertexAttrib4Nubv*(index: GLuint, v: PGLubyte){.stdcall, importc, ogl.} -proc glVertexAttrib4Nuiv*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttrib4Nusv*(index: GLuint, v: PGLushort){.stdcall, importc, ogl.} -proc glVertexAttrib4bv*(index: GLuint, v: PGLbyte){.stdcall, importc, ogl.} -proc glVertexAttrib4d*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, - w: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib4dv*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib4f*(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, - w: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib4fv*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib4iv*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttrib4s*(index: GLuint, x: GLshort, y: GLshort, z: GLshort, - w: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4sv*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4ubv*(index: GLuint, v: PGLubyte){.stdcall, importc, ogl.} -proc glVertexAttrib4uiv*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttrib4usv*(index: GLuint, v: PGLushort){.stdcall, importc, ogl.} -proc glVertexAttribPointer*(index: GLuint, size: GLint, typ: GLenum, - normalized: GLboolean, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} - # GL_VERSION_2_1 -proc glUniformMatrix2x3fv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniformMatrix3x2fv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniformMatrix2x4fv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniformMatrix4x2fv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniformMatrix3x4fv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} -proc glUniformMatrix4x3fv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} - # GL_VERSION_3_0 - # OpenGL 3.0 also reuses entry points from these extensions: - # ARB_framebuffer_object - # ARB_map_buffer_range - # ARB_vertex_array_object -proc glColorMaski*(index: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, - a: GLboolean){.stdcall, importc, ogl.} -proc glGetBooleani_v*(target: GLenum, index: GLuint, data: PGLboolean){.stdcall, importc, ogl.} -proc glGetIntegeri_v*(target: GLenum, index: GLuint, data: PGLint){.stdcall, importc, ogl.} -proc glEnablei*(target: GLenum, index: GLuint){.stdcall, importc, ogl.} -proc glDisablei*(target: GLenum, index: GLuint){.stdcall, importc, ogl.} -proc glIsEnabledi*(target: GLenum, index: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glBeginTransformFeedback*(primitiveMode: GLenum){.stdcall, importc, ogl.} -proc glEndTransformFeedback*(){.stdcall, importc, ogl.} -proc glBindBufferRange*(target: GLenum, index: GLuint, buffer: GLuint, - offset: GLintptr, size: GLsizeiptr){.stdcall, importc, ogl.} -proc glBindBufferBase*(target: GLenum, index: GLuint, buffer: GLuint){.stdcall, importc, ogl.} -proc glTransformFeedbackVaryings*(prog: GLuint, count: GLsizei, - varyings: cstringArray, bufferMode: GLenum){. - stdcall, importc, ogl.} -proc glGetTransformFeedbackVarying*(prog: GLuint, index: GLuint, - bufSize: GLsizei, len: PGLsizei, - size: PGLsizei, typ: PGLsizei, name: PGLchar){. - stdcall, importc, ogl.} -proc glClampColor*(targe: GLenum, clamp: GLenum){.stdcall, importc, ogl.} -proc glBeginConditionalRender*(id: GLuint, mode: GLenum){.stdcall, importc, ogl.} -proc glEndConditionalRender*(){.stdcall, importc, ogl.} -proc glVertexAttribIPointer*(index: GLuint, size: GLint, typ: GLenum, - stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glGetVertexAttribIiv*(index: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetVertexAttribIuiv*(index: GLuint, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} -proc glVertexAttribI1i*(index: GLuint, x: GLint){.stdcall, importc, ogl.} -proc glVertexAttribI2i*(index: GLuint, x: GLint, y: GLint){.stdcall, importc, ogl.} -proc glVertexAttribI3i*(index: GLuint, x: GLint, y: GLint, z: GLint){.stdcall, importc, ogl.} -proc glVertexAttribI4i*(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint){. - stdcall, importc, ogl.} -proc glVertexAttribI1ui*(index: GLuint, x: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribI2ui*(index: GLuint, x: GLuint, y: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribI3ui*(index: GLuint, x: GLuint, y: GLuint, z: GLuint){. - stdcall, importc, ogl.} -proc glVertexAttribI4ui*(index: GLuint, x: GLuint, y: GLuint, z: GLuint, - w: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribI1iv*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttribI2iv*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttribI3iv*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttribI4iv*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttribI1uiv*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribI2uiv*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribI3uiv*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribI4uiv*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribI4bv*(index: GLuint, v: PGLbyte){.stdcall, importc, ogl.} -proc glVertexAttribI4sv*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttribI4ubv*(index: GLuint, v: PGLubyte){.stdcall, importc, ogl.} -proc glVertexAttribI4usv*(index: GLuint, v: PGLushort){.stdcall, importc, ogl.} -proc glGetUniformuiv*(prog: GLuint, location: GLint, params: PGLuint){.stdcall, importc, ogl.} -proc glBindFragDataLocation*(prog: GLuint, color: GLuint, name: PGLChar){. - stdcall, importc, ogl.} -proc glGetFragDataLocation*(prog: GLuint, name: PGLChar): GLint{.stdcall, importc, ogl.} -proc glUniform1ui*(location: GLint, v0: GLuint){.stdcall, importc, ogl.} -proc glUniform2ui*(location: GLint, v0: GLuint, v1: GLuint){.stdcall, importc, ogl.} -proc glUniform3ui*(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint){.stdcall, importc, ogl.} -proc glUniform4ui*(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, - v3: GLuint){.stdcall, importc, ogl.} -proc glUniform1uiv*(location: GLint, count: GLsizei, value: PGLuint){.stdcall, importc, ogl.} -proc glUniform2uiv*(location: GLint, count: GLsizei, value: PGLuint){.stdcall, importc, ogl.} -proc glUniform3uiv*(location: GLint, count: GLsizei, value: PGLuint){.stdcall, importc, ogl.} -proc glUniform4uiv*(location: GLint, count: GLsizei, value: PGLuint){.stdcall, importc, ogl.} -proc glTexParameterIiv*(target: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glTexParameterIuiv*(target: GLenum, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} -proc glGetTexParameterIiv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetTexParameterIuiv*(target: GLenum, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} -proc glClearBufferiv*(buffer: GLenum, drawbuffer: GLint, value: PGLint){.stdcall, importc, ogl.} -proc glClearBufferuiv*(buffer: GLenum, drawbuffer: GLint, value: PGLuint){. - stdcall, importc, ogl.} -proc glClearBufferfv*(buffer: GLenum, drawbuffer: GLint, value: PGLfloat){. - stdcall, importc, ogl.} -proc glClearBufferfi*(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, - stencil: GLint){.stdcall, importc, ogl.} -proc glGetStringi*(name: GLenum, index: GLuint): PGLubyte{.stdcall, importc, ogl.} - # GL_VERSION_3_1 - # OpenGL 3.1 also reuses entry points from these extensions: - # ARB_copy_buffer - # ARB_uniform_buffer_object -proc glDrawArraysInstanced*(mode: GLenum, first: GLint, count: GLsizei, - primcount: GLsizei){.stdcall, importc, ogl.} -proc glDrawElementsInstanced*(mode: GLenum, count: GLsizei, typ: GLenum, - indices: PGLvoid, primcount: GLsizei){.stdcall, importc, ogl.} -proc glTexBuffer*(target: GLenum, internalformat: GLenum, buffer: GLuint){. - stdcall, importc, ogl.} -proc glPrimitiveRestartIndex*(index: GLuint){.stdcall, importc, ogl.} - # GL_VERSION_3_2 - # OpenGL 3.2 also reuses entry points from these extensions: - # ARB_draw_elements_base_vertex - # ARB_provoking_vertex - # ARB_sync - # ARB_texture_multisample -proc glGetInteger64i_v*(target: GLenum, index: GLuint, data: PGLint64){.stdcall, importc, ogl.} -proc glGetBufferParameteri64v*(target: GLenum, pname: GLenum, params: PGLint64){. - stdcall, importc, ogl.} -proc glFramebufferTexture*(target: GLenum, attachment: GLenum, texture: GLuint, - level: GLint){.stdcall, importc, ogl.} - #procedure glFramebufferTextureFace(target: GLenum; attachment: GLenum; texture: GLuint; level: GLint; face: GLenum); stdcall, importc, ogl; - # GL_VERSION_3_3 - # OpenGL 3.3 also reuses entry points from these extensions: - # ARB_blend_func_extended - # ARB_sampler_objects - # ARB_explicit_attrib_location, but it has none - # ARB_occlusion_query2 (no entry points) - # ARB_shader_bit_encoding (no entry points) - # ARB_texture_rgb10_a2ui (no entry points) - # ARB_texture_swizzle (no entry points) - # ARB_timer_query - # ARB_vertextyp_2_10_10_10_rev -proc glVertexAttribDivisor*(index: GLuint, divisor: GLuint){.stdcall, importc, ogl.} - # GL_VERSION_4_0 - # OpenGL 4.0 also reuses entry points from these extensions: - # ARB_texture_query_lod (no entry points) - # ARB_draw_indirect - # ARB_gpu_shader5 (no entry points) - # ARB_gpu_shader_fp64 - # ARB_shader_subroutine - # ARB_tessellation_shader - # ARB_texture_buffer_object_rgb32 (no entry points) - # ARB_texture_cube_map_array (no entry points) - # ARB_texture_gather (no entry points) - # ARB_transform_feedback2 - # ARB_transform_feedback3 -proc glMinSampleShading*(value: GLclampf){.stdcall, importc, ogl.} -proc glBlendEquationi*(buf: GLuint, mode: GLenum){.stdcall, importc, ogl.} -proc glBlendEquationSeparatei*(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum){. - stdcall, importc, ogl.} -proc glBlendFunci*(buf: GLuint, src: GLenum, dst: GLenum){.stdcall, importc, ogl.} -proc glBlendFuncSeparatei*(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, - srcAlpha: GLenum, dstAlpha: GLenum){.stdcall, importc, ogl.} - # GL_VERSION_4_1 - # OpenGL 4.1 also reuses entry points from these extensions: - # ARB_ES2_compatibility - # ARB_get_program_binary - # ARB_separate_shader_objects - # ARB_shader_precision (no entry points) - # ARB_vertex_attrib_64bit - # ARB_viewport_array - # GL_3DFX_tbuffer -proc glTbufferMask3DFX*(mask: GLuint){.stdcall, importc, ogl.} - # GL_APPLE_element_array -proc glElementPointerAPPLE*(typ: GLenum, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glDrawElementArrayAPPLE*(mode: GLenum, first: GLint, count: GLsizei){. - stdcall, importc, ogl.} -proc glDrawRangeElementArrayAPPLE*(mode: GLenum, start: GLuint, ending: GLuint, - first: GLint, count: GLsizei){.stdcall, importc, ogl.} -proc glMultiDrawElementArrayAPPLE*(mode: GLenum, first: PGLint, count: PGLsizei, - primcount: GLsizei){.stdcall, importc, ogl.} -proc glMultiDrawRangeElementArrayAPPLE*(mode: GLenum, start: GLuint, - ending: GLuint, first: PGLint, - count: PGLsizei, primcount: GLsizei){. - stdcall, importc, ogl.} - # GL_APPLE_fence -proc glGenFencesAPPLE*(n: GLsizei, fences: PGLuint){.stdcall, importc, ogl.} -proc glDeleteFencesAPPLE*(n: GLsizei, fences: PGLuint){.stdcall, importc, ogl.} -proc glSetFenceAPPLE*(fence: GLuint){.stdcall, importc, ogl.} -proc glIsFenceAPPLE*(fence: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glTestFenceAPPLE*(fence: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glFinishFenceAPPLE*(fence: GLuint){.stdcall, importc, ogl.} -proc glTestObjectAPPLE*(obj: GLenum, name: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glFinishObjectAPPLE*(obj: GLenum, name: GLint){.stdcall, importc, ogl.} - # GL_APPLE_vertex_array_object -proc glBindVertexArrayAPPLE*(arr: GLuint){.stdcall, importc, ogl.} -proc glDeleteVertexArraysAPPLE*(n: GLsizei, arrays: PGLuint){.stdcall, importc, ogl.} -proc glGenVertexArraysAPPLE*(n: GLsizei, arrays: PGLuint){.stdcall, importc, ogl.} -proc glIsVertexArrayAPPLE*(arr: GLuint): GLboolean{.stdcall, importc, ogl.} - # GL_APPLE_vertex_array_range -proc glVertexArrayRangeAPPLE*(len: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glFlushVertexArrayRangeAPPLE*(len: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glVertexArrayParameteriAPPLE*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} - # GL_APPLE_texture_range -proc glTextureRangeAPPLE*(target: GLenum, len: GLsizei, Pointer: PGLvoid){. - stdcall, importc, ogl.} -proc glGetTexParameterPointervAPPLE*(target: GLenum, pname: GLenum, - params: PPGLvoid){.stdcall, importc, ogl.} - # GL_APPLE_vertex_program_evaluators -proc glEnableVertexAttribAPPLE*(index: GLuint, pname: GLenum){.stdcall, importc, ogl.} -proc glDisableVertexAttribAPPLE*(index: GLuint, pname: GLenum){.stdcall, importc, ogl.} -proc glIsVertexAttribEnabledAPPLE*(index: GLuint, pname: GLenum): GLboolean{. - stdcall, importc, ogl.} -proc glMapVertexAttrib1dAPPLE*(index: GLuint, size: GLuint, u1: GLdouble, - u2: GLdouble, stride: GLint, order: GLint, - points: PGLdouble){.stdcall, importc, ogl.} -proc glMapVertexAttrib1fAPPLE*(index: GLuint, size: GLuint, u1: GLfloat, - u2: GLfloat, stride: GLint, order: GLint, - points: PGLfloat){.stdcall, importc, ogl.} -proc glMapVertexAttrib2dAPPLE*(index: GLuint, size: GLuint, u1: GLdouble, - u2: GLdouble, ustride: GLint, uorder: GLint, - v1: GLdouble, v2: GLdouble, vstride: GLint, - vorder: GLint, points: PGLdouble){.stdcall, importc, ogl.} -proc glMapVertexAttrib2fAPPLE*(index: GLuint, size: GLuint, u1: GLfloat, - u2: GLfloat, ustride: GLint, order: GLint, - v1: GLfloat, v2: GLfloat, vstride: GLint, - vorder: GLint, points: GLfloat){.stdcall, importc, ogl.} - # GL_APPLE_object_purgeable -proc glObjectPurgeableAPPLE*(objectType: GLenum, name: GLuint, option: GLenum): GLenum{. - stdcall, importc, ogl.} -proc glObjectUnpurgeableAPPLE*(objectType: GLenum, name: GLuint, option: GLenum): GLenum{. - stdcall, importc, ogl.} -proc glGetObjectParameterivAPPLE*(objectType: GLenum, name: GLuint, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} - # GL_ARB_matrix_palette -proc glCurrentPaletteMatrixARB*(index: GLint){.stdcall, importc, ogl.} -proc glMatrixIndexubvARB*(size: GLint, indices: PGLubyte){.stdcall, importc, ogl.} -proc glMatrixIndexusvARB*(size: GLint, indices: PGLushort){.stdcall, importc, ogl.} -proc glMatrixIndexuivARB*(size: GLint, indices: PGLuint){.stdcall, importc, ogl.} -proc glMatrixIndexPointerARB*(size: GLint, typ: GLenum, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} - # GL_ARB_multisample -proc glSampleCoverageARB*(value: GLclampf, invert: GLboolean){.stdcall, importc, ogl.} - # GL_ARB_multitexture -proc glActiveTextureARB*(texture: GLenum){.stdcall, importc, ogl.} -proc glClientActiveTextureARB*(texture: GLenum){.stdcall, importc, ogl.} -proc glMultiTexCoord1dARB*(target: GLenum, s: GLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord1dvARB*(target: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord1fARB*(target: GLenum, s: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord1fvARB*(target: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord1iARB*(target: GLenum, s: GLint){.stdcall, importc, ogl.} -proc glMultiTexCoord1ivARB*(target: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glMultiTexCoord1sARB*(target: GLenum, s: GLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord1svARB*(target: GLenum, v: PGLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord2dARB*(target: GLenum, s: GLdouble, t: GLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord2dvARB*(target: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord2fARB*(target: GLenum, s: GLfloat, t: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord2fvARB*(target: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord2iARB*(target: GLenum, s: GLint, t: GLint){.stdcall, importc, ogl.} -proc glMultiTexCoord2ivARB*(target: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glMultiTexCoord2sARB*(target: GLenum, s: GLshort, t: GLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord2svARB*(target: GLenum, v: PGLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord3dARB*(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble){. - stdcall, importc, ogl.} -proc glMultiTexCoord3dvARB*(target: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord3fARB*(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat){. - stdcall, importc, ogl.} -proc glMultiTexCoord3fvARB*(target: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord3iARB*(target: GLenum, s: GLint, t: GLint, r: GLint){. - stdcall, importc, ogl.} -proc glMultiTexCoord3ivARB*(target: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glMultiTexCoord3sARB*(target: GLenum, s: GLshort, t: GLshort, r: GLshort){. - stdcall, importc, ogl.} -proc glMultiTexCoord3svARB*(target: GLenum, v: PGLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord4dARB*(target: GLenum, s: GLdouble, t: GLdouble, - r: GLdouble, q: GLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord4dvARB*(target: GLenum, v: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexCoord4fARB*(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat, - q: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord4fvARB*(target: GLenum, v: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexCoord4iARB*(target: GLenum, s: GLint, t: GLint, r: GLint, - q: GLint){.stdcall, importc, ogl.} -proc glMultiTexCoord4ivARB*(target: GLenum, v: PGLint){.stdcall, importc, ogl.} -proc glMultiTexCoord4sARB*(target: GLenum, s: GLshort, t: GLshort, r: GLshort, - q: GLshort){.stdcall, importc, ogl.} -proc glMultiTexCoord4svARB*(target: GLenum, v: PGLshort){.stdcall, importc, ogl.} - # GL_ARB_point_parameters -proc glPointParameterfARB*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glPointParameterfvARB*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} - # GL_ARB_texture_compression -proc glCompressedTexImage3DARB*(target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - height: GLsizei, depth: GLsizei, border: GLint, - imageSize: GLsizei, data: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTexImage2DARB*(target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - height: GLsizei, border: GLint, - imageSize: GLsizei, data: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTexImage1DARB*(target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - border: GLint, imageSize: GLsizei, data: PGLvoid){. - stdcall, importc, ogl.} -proc glCompressedTexSubImage3DARB*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, - width: GLsizei, height: GLsizei, - depth: GLsizei, format: GLenum, - imageSize: GLsizei, data: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTexSubImage2DARB*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, width: GLsizei, - height: GLsizei, format: GLenum, - imageSize: GLsizei, data: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTexSubImage1DARB*(target: GLenum, level: GLint, xoffset: GLint, - width: GLsizei, format: GLenum, - imageSize: GLsizei, data: PGLvoid){.stdcall, importc, ogl.} -proc glGetCompressedTexImageARB*(target: GLenum, level: GLint, img: PGLvoid){. - stdcall, importc, ogl.} - # GL_ARB_transpose_matrix -proc glLoadTransposeMatrixfARB*(m: PGLfloat){.stdcall, importc, ogl.} -proc glLoadTransposeMatrixdARB*(m: PGLdouble){.stdcall, importc, ogl.} -proc glMultTransposeMatrixfARB*(m: PGLfloat){.stdcall, importc, ogl.} -proc glMultTransposeMatrixdARB*(m: PGLdouble){.stdcall, importc, ogl.} - # GL_ARB_vertex_blend -proc glWeightbvARB*(size: GLint, weights: PGLbyte){.stdcall, importc, ogl.} -proc glWeightsvARB*(size: GLint, weights: PGLshort){.stdcall, importc, ogl.} -proc glWeightivARB*(size: GLint, weights: PGLint){.stdcall, importc, ogl.} -proc glWeightfvARB*(size: GLint, weights: PGLfloat){.stdcall, importc, ogl.} -proc glWeightdvARB*(size: GLint, weights: PGLdouble){.stdcall, importc, ogl.} -proc glWeightubvARB*(size: GLint, weights: PGLubyte){.stdcall, importc, ogl.} -proc glWeightusvARB*(size: GLint, weights: PGLushort){.stdcall, importc, ogl.} -proc glWeightuivARB*(size: GLint, weights: PGLuint){.stdcall, importc, ogl.} -proc glWeightPointerARB*(size: GLint, typ: GLenum, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} -proc glVertexBlendARB*(count: GLint){.stdcall, importc, ogl.} - # GL_ARB_vertex_buffer_object -proc glBindBufferARB*(target: GLenum, buffer: GLuint){.stdcall, importc, ogl.} -proc glDeleteBuffersARB*(n: GLsizei, buffers: PGLuint){.stdcall, importc, ogl.} -proc glGenBuffersARB*(n: GLsizei, buffers: PGLuint){.stdcall, importc, ogl.} -proc glIsBufferARB*(buffer: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glBufferDataARB*(target: GLenum, size: GLsizeiptrARB, data: PGLvoid, - usage: GLenum){.stdcall, importc, ogl.} -proc glBufferSubDataARB*(target: GLenum, offset: GLintptrARB, - size: GLsizeiptrARB, data: PGLvoid){.stdcall, importc, ogl.} -proc glGetBufferSubDataARB*(target: GLenum, offset: GLintptrARB, - size: GLsizeiptrARB, data: PGLvoid){.stdcall, importc, ogl.} -proc glMapBufferARB*(target: GLenum, access: GLenum): PGLvoid{.stdcall, importc, ogl.} -proc glUnmapBufferARB*(target: GLenum): GLboolean{.stdcall, importc, ogl.} -proc glGetBufferParameterivARB*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetBufferPointervARB*(target: GLenum, pname: GLenum, params: PGLvoid){. - stdcall, importc, ogl.} - # GL_ARB_vertex_program -proc glVertexAttrib1dARB*(index: GLuint, x: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib1dvARB*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib1fARB*(index: GLuint, x: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib1fvARB*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib1sARB*(index: GLuint, x: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib1svARB*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib2dARB*(index: GLuint, x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib2dvARB*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib2fARB*(index: GLuint, x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib2fvARB*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib2sARB*(index: GLuint, x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib2svARB*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib3dARB*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glVertexAttrib3dvARB*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib3fARB*(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat){. - stdcall, importc, ogl.} -proc glVertexAttrib3fvARB*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib3sARB*(index: GLuint, x: GLshort, y: GLshort, z: GLshort){. - stdcall, importc, ogl.} -proc glVertexAttrib3svARB*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4NbvARB*(index: GLuint, v: PGLbyte){.stdcall, importc, ogl.} -proc glVertexAttrib4NivARB*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttrib4NsvARB*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4NubARB*(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, - w: GLubyte){.stdcall, importc, ogl.} -proc glVertexAttrib4NubvARB*(index: GLuint, v: PGLubyte){.stdcall, importc, ogl.} -proc glVertexAttrib4NuivARB*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttrib4NusvARB*(index: GLuint, v: PGLushort){.stdcall, importc, ogl.} -proc glVertexAttrib4bvARB*(index: GLuint, v: PGLbyte){.stdcall, importc, ogl.} -proc glVertexAttrib4dARB*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, - w: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib4dvARB*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib4fARB*(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, - w: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib4fvARB*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib4ivARB*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttrib4sARB*(index: GLuint, x: GLshort, y: GLshort, z: GLshort, - w: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4svARB*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4ubvARB*(index: GLuint, v: PGLubyte){.stdcall, importc, ogl.} -proc glVertexAttrib4uivARB*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttrib4usvARB*(index: GLuint, v: PGLushort){.stdcall, importc, ogl.} -proc glVertexAttribPointerARB*(index: GLuint, size: GLint, typ: GLenum, - normalized: GLboolean, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} -proc glEnableVertexAttribArrayARB*(index: GLuint){.stdcall, importc, ogl.} -proc glDisableVertexAttribArrayARB*(index: GLuint){.stdcall, importc, ogl.} -proc glProgramStringARB*(target: GLenum, format: GLenum, length: GLsizei, - string: PGLvoid){.stdcall, importc, ogl.} -proc glBindProgramARB*(target: GLenum, prog: GLuint){.stdcall, importc, ogl.} -proc glDeleteProgramsARB*(n: GLsizei, programs: PGLuint){.stdcall, importc, ogl.} -proc glGenProgramsARB*(n: GLsizei, programs: PGLuint){.stdcall, importc, ogl.} -proc glProgramEnvParameter4dARB*(target: GLenum, index: GLuint, x: GLdouble, - y: GLdouble, z: GLdouble, w: GLdouble){.stdcall, importc, ogl.} -proc glProgramEnvParameter4dvARB*(target: GLenum, index: GLuint, - params: PGLdouble){.stdcall, importc, ogl.} -proc glProgramEnvParameter4fARB*(target: GLenum, index: GLuint, x: GLfloat, - y: GLfloat, z: GLfloat, w: GLfloat){.stdcall, importc, ogl.} -proc glProgramEnvParameter4fvARB*(target: GLenum, index: GLuint, - params: PGLfloat){.stdcall, importc, ogl.} -proc glProgramLocalParameter4dARB*(target: GLenum, index: GLuint, x: GLdouble, - y: GLdouble, z: GLdouble, w: GLdouble){. - stdcall, importc, ogl.} -proc glProgramLocalParameter4dvARB*(target: GLenum, index: GLuint, - params: PGLdouble){.stdcall, importc, ogl.} -proc glProgramLocalParameter4fARB*(target: GLenum, index: GLuint, x: GLfloat, - y: GLfloat, z: GLfloat, w: GLfloat){.stdcall, importc, ogl.} -proc glProgramLocalParameter4fvARB*(target: GLenum, index: GLuint, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetProgramEnvParameterdvARB*(target: GLenum, index: GLuint, - params: PGLdouble){.stdcall, importc, ogl.} -proc glGetProgramEnvParameterfvARB*(target: GLenum, index: GLuint, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetProgramLocalParameterdvARB*(target: GLenum, index: GLuint, - params: PGLdouble){.stdcall, importc, ogl.} -proc glGetProgramLocalParameterfvARB*(target: GLenum, index: GLuint, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetProgramivARB*(target: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetProgramStringARB*(target: GLenum, pname: GLenum, string: PGLvoid){. - stdcall, importc, ogl.} -proc glGetVertexAttribdvARB*(index: GLuint, pname: GLenum, params: PGLdouble){. - stdcall, importc, ogl.} -proc glGetVertexAttribfvARB*(index: GLuint, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetVertexAttribivARB*(index: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetVertexAttribPointervARB*(index: GLuint, pname: GLenum, - pointer: PGLvoid){.stdcall, importc, ogl.} -proc glIsProgramARB*(prog: GLuint): GLboolean{.stdcall, importc, ogl.} - # GL_ARB_window_pos -proc glWindowPos2dARB*(x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glWindowPos2dvARB*(v: PGLdouble){.stdcall, importc, ogl.} -proc glWindowPos2fARB*(x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glWindowPos2fvARB*(v: PGLfloat){.stdcall, importc, ogl.} -proc glWindowPos2iARB*(x: GLint, y: GLint){.stdcall, importc, ogl.} -proc glWindowPos2ivARB*(v: PGLint){.stdcall, importc, ogl.} -proc glWindowPos2sARB*(x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glWindowPos2svARB*(v: PGLshort){.stdcall, importc, ogl.} -proc glWindowPos3dARB*(x: GLdouble, y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glWindowPos3dvARB*(v: PGLdouble){.stdcall, importc, ogl.} -proc glWindowPos3fARB*(x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glWindowPos3fvARB*(v: PGLfloat){.stdcall, importc, ogl.} -proc glWindowPos3iARB*(x: GLint, y: GLint, z: GLint){.stdcall, importc, ogl.} -proc glWindowPos3ivARB*(v: PGLint){.stdcall, importc, ogl.} -proc glWindowPos3sARB*(x: GLshort, y: GLshort, z: GLshort){.stdcall, importc, ogl.} -proc glWindowPos3svARB*(v: PGLshort){.stdcall, importc, ogl.} - # GL_ARB_draw_buffers -proc glDrawBuffersARB*(n: GLsizei, bufs: PGLenum){.stdcall, importc, ogl.} - # GL_ARB_color_buffer_float -proc glClampColorARB*(target: GLenum, clamp: GLenum){.stdcall, importc, ogl.} - # GL_ARB_vertex_shader -proc glGetActiveAttribARB*(programobj: GLhandleARB, index: GLuint, - maxLength: GLsizei, len: var GLsizei, - size: var GLint, typ: var GLenum, name: PGLcharARB){. - stdcall, importc, ogl.} -proc glGetAttribLocationARB*(programObj: GLhandleARB, char: PGLcharARB): glint{. - stdcall, importc, ogl.} -proc glBindAttribLocationARB*(programObj: GLhandleARB, index: GLuint, - name: PGLcharARB){.stdcall, importc, ogl.} - # GL_ARB_shader_objects -proc glDeleteObjectARB*(Obj: GLHandleARB){.stdcall, importc, ogl.} -proc glGetHandleARB*(pname: GlEnum): GLHandleARB{.stdcall, importc, ogl.} -proc glDetachObjectARB*(container, attached: GLHandleARB){.stdcall, importc, ogl.} -proc glCreateShaderObjectARB*(shaderType: glenum): GLHandleARB{.stdcall, importc, ogl.} -proc glShaderSourceARB*(shaderObj: GLHandleARB, count: glsizei, - string: cstringArray, lengths: pglint){.stdcall, importc, ogl.} -proc glCompileShaderARB*(shaderObj: GLHandleARB){.stdcall, importc, ogl.} -proc glCreateProgramObjectARB*(): GLHandleARB{.stdcall, importc, ogl.} -proc glAttachObjectARB*(programObj, shaderObj: GLhandleARB){.stdcall, importc, ogl.} -proc glLinkProgramARB*(programObj: GLHandleARB){.stdcall, importc, ogl.} -proc glUseProgramObjectARB*(programObj: GLHandleARB){.stdcall, importc, ogl.} -proc glValidateProgramARB*(programObj: GLhandleARB){.stdcall, importc, ogl.} -proc glUniform1fARB*(location: glint, v0: glfloat){.stdcall, importc, ogl.} -proc glUniform2fARB*(location: glint, v0, v1: glfloat){.stdcall, importc, ogl.} -proc glUniform3fARB*(location: glint, v0, v1, v2: glfloat){.stdcall, importc, ogl.} -proc glUniform4fARB*(location: glint, v0, v1, v2, v3: glfloat){.stdcall, importc, ogl.} -proc glUniform1iARB*(location: glint, v0: glint){.stdcall, importc, ogl.} -proc glUniform2iARB*(location: glint, v0, v1: glint){.stdcall, importc, ogl.} -proc glUniform3iARB*(location: glint, v0, v1, v2: glint){.stdcall, importc, ogl.} -proc glUniform4iARB*(location: glint, v0, v1, v2, v3: glint){.stdcall, importc, ogl.} -proc glUniform1fvARB*(location: glint, count: GLsizei, value: pglfloat){.stdcall, importc, ogl.} -proc glUniform2fvARB*(location: glint, count: GLsizei, value: pglfloat){.stdcall, importc, ogl.} -proc glUniform3fvARB*(location: glint, count: GLsizei, value: pglfloat){.stdcall, importc, ogl.} -proc glUniform4fvARB*(location: glint, count: GLsizei, value: pglfloat){.stdcall, importc, ogl.} -proc glUniform1ivARB*(location: glint, count: GLsizei, value: pglint){.stdcall, importc, ogl.} -proc glUniform2ivARB*(location: glint, count: GLsizei, value: pglint){.stdcall, importc, ogl.} -proc glUniform3ivARB*(location: glint, count: GLsizei, value: pglint){.stdcall, importc, ogl.} -proc glUniform4ivARB*(location: glint, count: GLsizei, value: pglint){.stdcall, importc, ogl.} -proc glUniformMatrix2fvARB*(location: glint, count: glsizei, - transpose: glboolean, value: pglfloat){.stdcall, importc, ogl.} -proc glUniformMatrix3fvARB*(location: glint, count: glsizei, - transpose: glboolean, value: pglfloat){.stdcall, importc, ogl.} -proc glUniformMatrix4fvARB*(location: glint, count: glsizei, - transpose: glboolean, value: pglfloat){.stdcall, importc, ogl.} -proc glGetObjectParameterfvARB*(Obj: GLHandleARB, pname: GLEnum, - params: PGLFloat){.stdcall, importc, ogl.} -proc glGetObjectParameterivARB*(Obj: GLHandleARB, pname: GLEnum, params: PGLInt){. - stdcall, importc, ogl.} -proc glGetInfoLogARB*(shaderObj: GLHandleARB, maxLength: glsizei, - len: var glint, infoLog: PGLcharARB){.stdcall, importc, ogl.} -proc glGetAttachedObjectsARB*(programobj: GLhandleARB, maxCount: GLsizei, - count: var GLsizei, objects: PGLhandleARB){. - stdcall, importc, ogl.} -proc glGetUniformLocationARB*(programObj: GLhandleARB, char: PGLcharARB): glint{. - stdcall, importc, ogl.} -proc glGetActiveUniformARB*(programobj: GLhandleARB, index: GLuint, - maxLength: GLsizei, len: var GLsizei, - size: var GLint, typ: var GLenum, name: PGLcharARB){. - stdcall, importc, ogl.} -proc glGetUniformfvARB*(programObj: GLhandleARB, location: GLint, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetUniformivARB*(programObj: GLhandleARB, location: GLint, params: PGLInt){. - stdcall, importc, ogl.} -proc glGetShaderSourceARB*(shader: GLhandleARB, maxLength: GLsizei, - len: var GLsizei, source: PGLcharARB){.stdcall, importc, ogl.} - # GL_ARB_Occlusion_Query -proc glGenQueriesARB*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glDeleteQueriesARB*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glIsQueryARB*(id: GLuint): bool{.stdcall, importc, ogl.} -proc glBeginQueryARB*(target: GLenum, id: GLuint){.stdcall, importc, ogl.} -proc glEndQueryARB*(target: GLenum){.stdcall, importc, ogl.} -proc glGetQueryivARB*(target, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetQueryObjectivARB*(id: GLuint, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetQueryObjectuivARB*(id: GLuint, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} - # GL_ARB_draw_instanced -proc glDrawArraysInstancedARB*(mode: GLenum, first: GLint, count: GLsizei, - primcount: GLsizei){.stdcall, importc, ogl.} -proc glDrawElementsInstancedARB*(mode: GLenum, count: GLsizei, typ: GLenum, - indices: PGLvoid, primcount: GLsizei){.stdcall, importc, ogl.} - # GL_ARB_framebuffer_object -proc glIsRenderbuffer*(renderbuffer: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glBindRenderbuffer*(target: GLenum, renderbuffer: GLuint){.stdcall, importc, ogl.} -proc glDeleteRenderbuffers*(n: GLsizei, renderbuffers: PGLuint){.stdcall, importc, ogl.} -proc glGenRenderbuffers*(n: GLsizei, renderbuffers: PGLuint){.stdcall, importc, ogl.} -proc glRenderbufferStorage*(target: GLenum, internalformat: GLenum, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glGetRenderbufferParameteriv*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glIsFramebuffer*(framebuffer: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glBindFramebuffer*(target: GLenum, framebuffer: GLuint){.stdcall, importc, ogl.} -proc glDeleteFramebuffers*(n: GLsizei, framebuffers: PGLuint){.stdcall, importc, ogl.} -proc glGenFramebuffers*(n: GLsizei, framebuffers: PGLuint){.stdcall, importc, ogl.} -proc glCheckFramebufferStatus*(target: GLenum): GLenum{.stdcall, importc, ogl.} -proc glFramebufferTexture1D*(target: GLenum, attachment: GLenum, - textarget: GLenum, texture: GLuint, level: GLint){. - stdcall, importc, ogl.} -proc glFramebufferTexture2D*(target: GLenum, attachment: GLenum, - textarget: GLenum, texture: GLuint, level: GLint){. - stdcall, importc, ogl.} -proc glFramebufferTexture3D*(target: GLenum, attachment: GLenum, - textarget: GLenum, texture: GLuint, level: GLint, - zoffset: GLint){.stdcall, importc, ogl.} -proc glFramebufferRenderbuffer*(target: GLenum, attachment: GLenum, - renderbuffertarget: GLenum, renderbuffer: GLuint){. - stdcall, importc, ogl.} -proc glGetFramebufferAttachmentParameteriv*(target: GLenum, attachment: GLenum, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGenerateMipmap*(target: GLenum){.stdcall, importc, ogl.} -proc glBlitFramebuffer*(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, - dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, - mask: GLbitfield, filter: GLenum){.stdcall, importc, ogl.} -proc glRenderbufferStorageMultisample*(target: GLenum, samples: GLsizei, - internalformat: GLenum, width: GLsizei, - height: GLsizei){.stdcall, importc, ogl.} -proc glFramebufferTextureLayer*(target: GLenum, attachment: GLenum, - texture: GLuint, level: GLint, layer: GLint){. - stdcall, importc, ogl.} - # GL_ARB_geometry_shader4 -proc glProgramParameteriARB*(prog: GLuint, pname: GLenum, value: GLint){.stdcall, importc, ogl.} -proc glFramebufferTextureARB*(target: GLenum, attachment: GLenum, - texture: GLuint, level: GLint){.stdcall, importc, ogl.} -proc glFramebufferTextureLayerARB*(target: GLenum, attachment: GLenum, - texture: GLuint, level: GLint, layer: GLint){. - stdcall, importc, ogl.} -proc glFramebufferTextureFaceARB*(target: GLenum, attachment: GLenum, - texture: GLuint, level: GLint, face: GLenum){. - stdcall, importc, ogl.} - # GL_ARB_instanced_arrays -proc glVertexAttribDivisorARB*(index: GLuint, divisor: GLuint){.stdcall, importc, ogl.} - # GL_ARB_map_buffer_range -proc glMapBufferRange*(target: GLenum, offset: GLintptr, len: GLsizeiptr, - access: GLbitfield): PGLvoid{.stdcall, importc, ogl.} -proc glFlushMappedBufferRange*(target: GLenum, offset: GLintptr, len: GLsizeiptr){. - stdcall, importc, ogl.} - # GL_ARB_texture_buffer_object -proc glTexBufferARB*(target: GLenum, internalformat: GLenum, buffer: GLuint){. - stdcall, importc, ogl.} - # GL_ARB_vertex_array_object -proc glBindVertexArray*(arr: GLuint){.stdcall, importc, ogl.} -proc glDeleteVertexArrays*(n: GLsizei, arrays: PGLuint){.stdcall, importc, ogl.} -proc glGenVertexArrays*(n: GLsizei, arrays: PGLuint){.stdcall, importc, ogl.} -proc glIsVertexArray*(arr: GLuint): GLboolean{.stdcall, importc, ogl.} - # GL_ARB_uniform_buffer_object -proc glGetUniformIndices*(prog: GLuint, uniformCount: GLsizei, - uniformNames: cstringArray, uniformIndices: PGLuint){. - stdcall, importc, ogl.} -proc glGetActiveUniformsiv*(prog: GLuint, uniformCount: GLsizei, - uniformIndices: PGLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetActiveUniformName*(prog: GLuint, uniformIndex: GLuint, - bufSize: GLsizei, len: PGLsizei, - uniformName: PGLchar){.stdcall, importc, ogl.} -proc glGetUniformBlockIndex*(prog: GLuint, uniformBlockName: PGLchar): GLuint{. - stdcall, importc, ogl.} -proc glGetActiveUniformBlockiv*(prog: GLuint, uniformBlockIndex: GLuint, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetActiveUniformBlockName*(prog: GLuint, uniformBlockIndex: GLuint, - bufSize: GLsizei, len: PGLsizei, - uniformBlockName: PGLchar){.stdcall, importc, ogl.} -proc glUniformBlockBinding*(prog: GLuint, uniformBlockIndex: GLuint, - uniformBlockBinding: GLuint){.stdcall, importc, ogl.} - # GL_ARB_copy_buffer -proc glCopyBufferSubData*(readTarget: GLenum, writeTarget: GLenum, - readOffset: GLintptr, writeOffset: GLintptr, - size: GLsizeiptr){.stdcall, importc, ogl.} - # GL_ARB_draw_elements_base_vertex -proc glDrawElementsBaseVertex*(mode: GLenum, count: GLsizei, typ: GLenum, - indices: PGLvoid, basevertex: GLint){.stdcall, importc, ogl.} -proc glDrawRangeElementsBaseVertex*(mode: GLenum, start: GLuint, ending: GLuint, - count: GLsizei, typ: GLenum, - indices: PGLvoid, basevertex: GLint){. - stdcall, importc, ogl.} -proc glDrawElementsInstancedBaseVertex*(mode: GLenum, count: GLsizei, - typ: GLenum, indices: PGLvoid, - primcount: GLsizei, basevertex: GLint){. - stdcall, importc, ogl.} -proc glMultiDrawElementsBaseVertex*(mode: GLenum, count: PGLsizei, typ: GLenum, - indices: PPGLvoid, primcount: GLsizei, - basevertex: PGLint){.stdcall, importc, ogl.} - # GL_ARB_provoking_vertex -proc glProvokingVertex*(mode: GLenum){.stdcall, importc, ogl.} - # GL_ARB_sync -proc glFenceSync*(condition: GLenum, flags: GLbitfield): GLsync{.stdcall, importc, ogl.} -proc glIsSync*(sync: GLsync): GLboolean{.stdcall, importc, ogl.} -proc glDeleteSync*(sync: GLsync){.stdcall, importc, ogl.} -proc glClientWaitSync*(sync: GLsync, flags: GLbitfield, timeout: GLuint64): GLenum{. - stdcall, importc, ogl.} -proc glWaitSync*(sync: GLsync, flags: GLbitfield, timeout: GLuint64){.stdcall, importc, ogl.} -proc glGetInteger64v*(pname: GLenum, params: PGLint64){.stdcall, importc, ogl.} -proc glGetSynciv*(sync: GLsync, pname: GLenum, butSize: GLsizei, len: PGLsizei, - values: PGLint){.stdcall, importc, ogl.} - # GL_ARB_texture_multisample -proc glTexImage2DMultisample*(target: GLenum, samples: GLsizei, - internalformat: GLint, width: GLsizei, - height: GLsizei, fixedsamplelocations: GLboolean){. - stdcall, importc, ogl.} -proc glTexImage3DMultisample*(target: GLenum, samples: GLsizei, - internalformat: GLint, width: GLsizei, - height: GLsizei, depth: GLsizei, - fixedsamplelocations: GLboolean){.stdcall, importc, ogl.} -proc glGetMultisamplefv*(pname: GLenum, index: GLuint, val: PGLfloat){.stdcall, importc, ogl.} -proc glSampleMaski*(index: GLuint, mask: GLbitfield){.stdcall, importc, ogl.} - # GL_ARB_draw_buffers_blend -proc glBlendEquationiARB*(buf: GLuint, mode: GLenum){.stdcall, importc, ogl.} -proc glBlendEquationSeparateiARB*(buf: GLuint, modeRGB: GLenum, - modeAlpha: GLenum){.stdcall, importc, ogl.} -proc glBlendFunciARB*(buf: GLuint, src: GLenum, dst: GLenum){.stdcall, importc, ogl.} -proc glBlendFuncSeparateiARB*(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, - srcAlpha: GLenum, dstAlpha: GLenum){.stdcall, importc, ogl.} - # GL_ARB_sample_shading -proc glMinSampleShadingARB*(value: GLclampf){.stdcall, importc, ogl.} - # GL_ARB_shading_language_include -proc glNamedStringARB*(typ: GLenum, namelen: GLint, name: PGLchar, - stringlen: GLint, string: PGLchar){.stdcall, importc, ogl.} -proc glDeleteNamedStringARB*(namelen: GLint, name: PGLchar){.stdcall, importc, ogl.} -proc glCompileShaderIncludeARB*(shader: GLuint, count: GLsizei, path: PPGLchar, - len: PGLint){.stdcall, importc, ogl.} -proc glIsNamedStringARB*(namelen: GLint, name: PGLchar): GLboolean{.stdcall, importc, ogl.} -proc glGetNamedStringARB*(namelen: GLint, name: PGLchar, bufSize: GLsizei, - stringlen: GLint, string: PGLchar){.stdcall, importc, ogl.} -proc glGetNamedStringivARB*(namelen: GLint, name: PGLchar, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} - # GL_ARB_blend_func_extended -proc glBindFragDataLocationIndexed*(prog: GLuint, colorNumber: GLuint, - index: GLuint, name: PGLchar){.stdcall, importc, ogl.} -proc glGetFragDataIndex*(prog: GLuint, name: PGLchar): GLint{.stdcall, importc, ogl.} - # GL_ARB_sampler_objects -proc glGenSamplers*(count: GLsizei, samplers: PGLuint){.stdcall, importc, ogl.} -proc glDeleteSamplers*(count: GLsizei, samplers: PGLuint){.stdcall, importc, ogl.} -proc glIsSampler*(sampler: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glBindSampler*(theUnit: GLuint, sampler: GLuint){.stdcall, importc, ogl.} -proc glSamplerParameteri*(sampler: GLuint, pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glSamplerParameteriv*(sampler: GLuint, pname: GLenum, param: PGLint){. - stdcall, importc, ogl.} -proc glSamplerParameterf*(sampler: GLuint, pname: GLenum, param: GLfloat){. - stdcall, importc, ogl.} -proc glSamplerParameterfv*(sampler: GLuint, pname: GLenum, param: PGLfloat){. - stdcall, importc, ogl.} -proc glSamplerParameterIiv*(sampler: GLuint, pname: GLenum, param: PGLint){. - stdcall, importc, ogl.} -proc glSamplerParameterIuiv*(sampler: GLuint, pname: GLenum, param: PGLuint){. - stdcall, importc, ogl.} -proc glGetSamplerParameteriv*(sampler: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetSamplerParameterIiv*(sampler: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetSamplerParameterfv*(sampler: GLuint, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetSamplerParameterIuiv*(sampler: GLuint, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} - # GL_ARB_timer_query -proc glQueryCounter*(id: GLuint, target: GLenum){.stdcall, importc, ogl.} -proc glGetQueryObjecti64v*(id: GLuint, pname: GLenum, params: PGLint64){.stdcall, importc, ogl.} -proc glGetQueryObjectui64v*(id: GLuint, pname: GLenum, params: PGLuint64){. - stdcall, importc, ogl.} - # GL_ARB_vertextyp_2_10_10_10_rev -proc glVertexP2ui*(typ: GLenum, value: GLuint){.stdcall, importc, ogl.} -proc glVertexP2uiv*(typ: GLenum, value: PGLuint){.stdcall, importc, ogl.} -proc glVertexP3ui*(typ: GLenum, value: GLuint){.stdcall, importc, ogl.} -proc glVertexP3uiv*(typ: GLenum, value: PGLuint){.stdcall, importc, ogl.} -proc glVertexP4ui*(typ: GLenum, value: GLuint){.stdcall, importc, ogl.} -proc glVertexP4uiv*(typ: GLenum, value: PGLuint){.stdcall, importc, ogl.} -proc glTexCoordP1ui*(typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glTexCoordP1uiv*(typ: GLenum, coords: PGLuint){.stdcall, importc, ogl.} -proc glTexCoordP2ui*(typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glTexCoordP2uiv*(typ: GLenum, coords: PGLuint){.stdcall, importc, ogl.} -proc glTexCoordP3ui*(typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glTexCoordP3uiv*(typ: GLenum, coords: PGLuint){.stdcall, importc, ogl.} -proc glTexCoordP4ui*(typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glTexCoordP4uiv*(typ: GLenum, coords: PGLuint){.stdcall, importc, ogl.} -proc glMultiTexCoordP1ui*(texture: GLenum, typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glMultiTexCoordP1uiv*(texture: GLenum, typ: GLenum, coords: GLuint){. - stdcall, importc, ogl.} -proc glMultiTexCoordP2ui*(texture: GLenum, typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glMultiTexCoordP2uiv*(texture: GLenum, typ: GLenum, coords: PGLuint){. - stdcall, importc, ogl.} -proc glMultiTexCoordP3ui*(texture: GLenum, typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glMultiTexCoordP3uiv*(texture: GLenum, typ: GLenum, coords: PGLuint){. - stdcall, importc, ogl.} -proc glMultiTexCoordP4ui*(texture: GLenum, typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glMultiTexCoordP4uiv*(texture: GLenum, typ: GLenum, coords: PGLuint){. - stdcall, importc, ogl.} -proc glNormalP3ui*(typ: GLenum, coords: GLuint){.stdcall, importc, ogl.} -proc glNormalP3uiv*(typ: GLenum, coords: PGLuint){.stdcall, importc, ogl.} -proc glColorP3ui*(typ: GLenum, color: GLuint){.stdcall, importc, ogl.} -proc glColorP3uiv*(typ: GLenum, color: PGLuint){.stdcall, importc, ogl.} -proc glColorP4ui*(typ: GLenum, color: GLuint){.stdcall, importc, ogl.} -proc glColorP4uiv*(typ: GLenum, color: GLuint){.stdcall, importc, ogl.} -proc glSecondaryColorP3ui*(typ: GLenum, color: GLuint){.stdcall, importc, ogl.} -proc glSecondaryColorP3uiv*(typ: GLenum, color: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribP1ui*(index: GLuint, typ: GLenum, normalized: GLboolean, - value: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribP1uiv*(index: GLuint, typ: GLenum, normalized: GLboolean, - value: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribP2ui*(index: GLuint, typ: GLenum, normalized: GLboolean, - value: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribP2uiv*(index: GLuint, typ: GLenum, normalized: GLboolean, - value: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribP3ui*(index: GLuint, typ: GLenum, normalized: GLboolean, - value: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribP3uiv*(index: GLuint, typ: GLenum, normalized: GLboolean, - value: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribP4ui*(index: GLuint, typ: GLenum, normalized: GLboolean, - value: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribP4uiv*(index: GLuint, typ: GLenum, normalized: GLboolean, - value: PGLuint){.stdcall, importc, ogl.} - # GL_ARB_draw_indirect -proc glDrawArraysIndirect*(mode: GLenum, indirect: PGLvoid){.stdcall, importc, ogl.} -proc glDrawElementsIndirect*(mode: GLenum, typ: GLenum, indirect: PGLvoid){. - stdcall, importc, ogl.} - # GL_ARB_gpu_shader_fp64 -proc glUniform1d*(location: GLint, x: GLdouble){.stdcall, importc, ogl.} -proc glUniform2d*(location: GLint, x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glUniform3d*(location: GLint, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glUniform4d*(location: GLint, x: GLdouble, y: GLdouble, z: GLdouble, - w: GLdouble){.stdcall, importc, ogl.} -proc glUniform1dv*(location: GLint, count: GLsizei, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniform2dv*(location: GLint, count: GLsizei, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniform3dv*(location: GLint, count: GLsizei, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniform4dv*(location: GLint, count: GLsizei, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix2dv*(location: GLint, count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix3dv*(location: GLint, count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix4dv*(location: GLint, count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix2x3dv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix2x4dv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix3x2dv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix3x4dv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix4x2dv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glUniformMatrix4x3dv*(location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glGetUniformdv*(prog: GLuint, location: GLint, params: PGLdouble){.stdcall, importc, ogl.} - # GL_ARB_shader_subroutine -proc glGetSubroutineUniformLocation*(prog: GLuint, shadertype: GLenum, - name: PGLchar): GLint{.stdcall, importc, ogl.} -proc glGetSubroutineIndex*(prog: GLuint, shadertype: GLenum, name: PGLchar): GLuint{. - stdcall, importc, ogl.} -proc glGetActiveSubroutineUniformiv*(prog: GLuint, shadertype: GLenum, - index: GLuint, pname: GLenum, - values: PGLint){.stdcall, importc, ogl.} -proc glGetActiveSubroutineUniformName*(prog: GLuint, shadertype: GLenum, - index: GLuint, bufsize: GLsizei, - len: PGLsizei, name: PGLchar){.stdcall, importc, ogl.} -proc glGetActiveSubroutineName*(prog: GLuint, shadertype: GLenum, index: GLuint, - bufsize: GLsizei, len: PGLsizei, name: PGLchar){. - stdcall, importc, ogl.} -proc glUniformSubroutinesuiv*(shadertype: GLenum, count: GLsizei, - indices: PGLuint){.stdcall, importc, ogl.} -proc glGetUniformSubroutineuiv*(shadertype: GLenum, location: GLint, - params: PGLuint){.stdcall, importc, ogl.} -proc glGetProgramStageiv*(prog: GLuint, shadertype: GLenum, pname: GLenum, - values: PGLint){.stdcall, importc, ogl.} - # GL_ARB_tessellation_shader -proc glPatchParameteri*(pname: GLenum, value: GLint){.stdcall, importc, ogl.} -proc glPatchParameterfv*(pname: GLenum, values: PGLfloat){.stdcall, importc, ogl.} - # GL_ARB_transform_feedback2 -proc glBindTransformFeedback*(target: GLenum, id: GLuint){.stdcall, importc, ogl.} -proc glDeleteTransformFeedbacks*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glGenTransformFeedbacks*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glIsTransformFeedback*(id: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glPauseTransformFeedback*(){.stdcall, importc, ogl.} -proc glResumeTransformFeedback*(){.stdcall, importc, ogl.} -proc glDrawTransformFeedback*(mode: GLenum, id: GLuint){.stdcall, importc, ogl.} - # GL_ARB_transform_feedback3 -proc glDrawTransformFeedbackStream*(mode: GLenum, id: GLuint, stream: GLuint){. - stdcall, importc, ogl.} -proc glBeginQueryIndexed*(target: GLenum, index: GLuint, id: GLuint){.stdcall, importc, ogl.} -proc glEndQueryIndexed*(target: GLenum, index: GLuint){.stdcall, importc, ogl.} -proc glGetQueryIndexediv*(target: GLenum, index: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} - # GL_ARB_ES2_compatibility -proc glReleaseShaderCompiler*(){.stdcall, importc, ogl.} -proc glShaderBinary*(count: GLsizei, shaders: PGLuint, binaryformat: GLenum, - binary: PGLvoid, len: GLsizei){.stdcall, importc, ogl.} -proc glGetShaderPrecisionFormat*(shadertype: GLenum, precisiontype: GLenum, - range: PGLint, precision: PGLint){.stdcall, importc, ogl.} -proc glDepthRangef*(n: GLclampf, f: GLclampf){.stdcall, importc, ogl.} -proc glClearDepthf*(d: GLclampf){.stdcall, importc, ogl.} - # GL_ARB_get_prog_binary -proc glGetProgramBinary*(prog: GLuint, bufSize: GLsizei, len: PGLsizei, - binaryFormat: PGLenum, binary: PGLvoid){.stdcall, importc, ogl.} -proc glProgramBinary*(prog: GLuint, binaryFormat: GLenum, binary: PGLvoid, - len: GLsizei){.stdcall, importc, ogl.} -proc glProgramParameteri*(prog: GLuint, pname: GLenum, value: GLint){.stdcall, importc, ogl.} - # GL_ARB_separate_shader_objects -proc glUseProgramStages*(pipeline: GLuint, stages: GLbitfield, prog: GLuint){. - stdcall, importc, ogl.} -proc glActiveShaderProgram*(pipeline: GLuint, prog: GLuint){.stdcall, importc, ogl.} -proc glCreateShaderProgramv*(typ: GLenum, count: GLsizei, strings: cstringArray): GLuint{. - stdcall, importc, ogl.} -proc glBindProgramPipeline*(pipeline: GLuint){.stdcall, importc, ogl.} -proc glDeleteProgramPipelines*(n: GLsizei, pipelines: PGLuint){.stdcall, importc, ogl.} -proc glGenProgramPipelines*(n: GLsizei, pipelines: PGLuint){.stdcall, importc, ogl.} -proc glIsProgramPipeline*(pipeline: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glGetProgramPipelineiv*(pipeline: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glProgramUniform1i*(prog: GLuint, location: GLint, v0: GLint){.stdcall, importc, ogl.} -proc glProgramUniform1iv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint){.stdcall, importc, ogl.} -proc glProgramUniform1f*(prog: GLuint, location: GLint, v0: GLfloat){.stdcall, importc, ogl.} -proc glProgramUniform1fv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform1d*(prog: GLuint, location: GLint, v0: GLdouble){.stdcall, importc, ogl.} -proc glProgramUniform1dv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniform1ui*(prog: GLuint, location: GLint, v0: GLuint){.stdcall, importc, ogl.} -proc glProgramUniform1uiv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint){.stdcall, importc, ogl.} -proc glProgramUniform2i*(prog: GLuint, location: GLint, v0: GLint, v1: GLint){. - stdcall, importc, ogl.} -proc glProgramUniform2iv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint){.stdcall, importc, ogl.} -proc glProgramUniform2f*(prog: GLuint, location: GLint, v0: GLfloat, v1: GLfloat){. - stdcall, importc, ogl.} -proc glProgramUniform2fv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform2d*(prog: GLuint, location: GLint, v0: GLdouble, - v1: GLdouble){.stdcall, importc, ogl.} -proc glProgramUniform2dv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniform2ui*(prog: GLuint, location: GLint, v0: GLuint, v1: GLuint){. - stdcall, importc, ogl.} -proc glProgramUniform2uiv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint){.stdcall, importc, ogl.} -proc glProgramUniform3i*(prog: GLuint, location: GLint, v0: GLint, v1: GLint, - v2: GLint){.stdcall, importc, ogl.} -proc glProgramUniform3iv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint){.stdcall, importc, ogl.} -proc glProgramUniform3f*(prog: GLuint, location: GLint, v0: GLfloat, - v1: GLfloat, v2: GLfloat){.stdcall, importc, ogl.} -proc glProgramUniform3fv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform3d*(prog: GLuint, location: GLint, v0: GLdouble, - v1: GLdouble, v2: GLdouble){.stdcall, importc, ogl.} -proc glProgramUniform3dv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniform3ui*(prog: GLuint, location: GLint, v0: GLuint, v1: GLuint, - v2: GLuint){.stdcall, importc, ogl.} -proc glProgramUniform3uiv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint){.stdcall, importc, ogl.} -proc glProgramUniform4i*(prog: GLuint, location: GLint, v0: GLint, v1: GLint, - v2: GLint, v3: GLint){.stdcall, importc, ogl.} -proc glProgramUniform4iv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint){.stdcall, importc, ogl.} -proc glProgramUniform4f*(prog: GLuint, location: GLint, v0: GLfloat, - v1: GLfloat, v2: GLfloat, v3: GLfloat){.stdcall, importc, ogl.} -proc glProgramUniform4fv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform4d*(prog: GLuint, location: GLint, v0: GLdouble, - v1: GLdouble, v2: GLdouble, v3: GLdouble){.stdcall, importc, ogl.} -proc glProgramUniform4dv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniform4ui*(prog: GLuint, location: GLint, v0: GLuint, v1: GLuint, - v2: GLuint, v3: GLuint){.stdcall, importc, ogl.} -proc glProgramUniform4uiv*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix3fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix4fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix3dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix4dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2x3fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix3x2fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix2x4fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix4x2fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix3x4fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix4x3fv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLfloat){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix2x3dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix3x2dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix2x4dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix4x2dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix3x4dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){. - stdcall, importc, ogl.} -proc glProgramUniformMatrix4x3dv*(prog: GLuint, location: GLint, count: GLsizei, - transpose: GLboolean, value: PGLdouble){. - stdcall, importc, ogl.} -proc glValidateProgramPipeline*(pipeline: GLuint){.stdcall, importc, ogl.} -proc glGetProgramPipelineInfoLog*(pipeline: GLuint, bufSize: GLsizei, - len: PGLsizei, infoLog: PGLchar){.stdcall, importc, ogl.} - # GL_ARB_vertex_attrib_64bit -proc glVertexAttribL1d*(index: GLuint, x: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL2d*(index: GLuint, x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL3d*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glVertexAttribL4d*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, - w: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL1dv*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL2dv*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL3dv*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL4dv*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribLPointer*(index: GLuint, size: GLint, typ: GLenum, - stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glGetVertexAttribLdv*(index: GLuint, pname: GLenum, params: PGLdouble){. - stdcall, importc, ogl.} - # GL_ARB_viewport_array -proc glViewportArrayv*(first: GLuint, count: GLsizei, v: PGLfloat){.stdcall, importc, ogl.} -proc glViewportIndexedf*(index: GLuint, x: GLfloat, y: GLfloat, w: GLfloat, - h: GLfloat){.stdcall, importc, ogl.} -proc glViewportIndexedfv*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glScissorArrayv*(first: GLuint, count: GLsizei, v: PGLint){.stdcall, importc, ogl.} -proc glScissorIndexed*(index: GLuint, left: GLint, bottom: GLint, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glScissorIndexedv*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glDepthRangeArrayv*(first: GLuint, count: GLsizei, v: PGLclampd){.stdcall, importc, ogl.} -proc glDepthRangeIndexed*(index: GLuint, n: GLclampd, f: GLclampd){.stdcall, importc, ogl.} -proc glGetFloati_v*(target: GLenum, index: GLuint, data: PGLfloat){.stdcall, importc, ogl.} -proc glGetDoublei_v*(target: GLenum, index: GLuint, data: PGLdouble){.stdcall, importc, ogl.} - # GL 4.2 - # GL_ARB_base_instance -proc glDrawArraysInstancedBaseInstance*(mode: GLenum, first: GLint, - count: GLsizei, primcount: GLsizei, - baseinstance: GLUint){.stdcall, importc, ogl.} -proc glDrawElementsInstancedBaseInstance*(mode: GLEnum, count: GLsizei, - typ: GLenum, indices: PGLVoid, primcount: GLsizei, baseinstance: GLUInt){. - stdcall, importc, ogl.} -proc glDrawElementsInstancedBaseVertexBaseInstance*(mode: GLEnum, - count: GLsizei, typ: GLenum, indices: PGLVoid, primcount: GLsizei, - basevertex: GLint, baseinstance: GLuint){.stdcall, importc, ogl.} - # GL_ARB_transform_feedback_instanced -proc glDrawTransformFeedbackInstanced*(mode: GLenum, id: GLuint, - primcount: GLsizei){.stdcall, importc, ogl.} -proc glDrawTransformFeedbackStreamInstanced*(mode: GLenum, id: GLUInt, - stream: GLUint, primcount: GLsizei){.stdcall, importc, ogl.} - # GL_ARB_internalformat_query -proc glGetInternalformativ*(target: GLenum, internalformat: GLenum, - pname: GLenum, bufSize: GLsizei, params: PGLint){. - stdcall, importc, ogl.} - # GL_ARB_shader_atomic_counters -proc glGetActiveAtomicCounterBufferiv*(prog: GLuint, bufferIndex: GLuint, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} - #/ GL_ARB_shader_image_load_store -proc glBindImageTexture*(theUnit: GLuint, texture: GLuint, level: GLint, - layered: GLboolean, layer: GLint, access: GLenum, - format: GLenum){.stdcall, importc, ogl.} -proc glMemoryBarrier*(barriers: GLbitfield){.stdcall, importc, ogl.} - # GL_ARB_texture_storage -proc glTexStorage1D*(target: GLenum, levels: GLsizei, internalformat: GLenum, - width: GLsizei){.stdcall, importc, ogl.} -proc glTexStorage2D*(target: GLenum, levels: GLsizei, internalformat: GLenum, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glTexStorage3D*(target: GLenum, levels: GLsizei, internalformat: GLenum, - width: GLsizei, height: GLsizei, depth: GLsizei){.stdcall, importc, ogl.} -proc glTextureStorage1DEXT*(texture: GLuint, target: GLenum, levels: GLsizei, - internalformat: GLenum, width: GLsizei){.stdcall, importc, ogl.} -proc glTextureStorage2DEXT*(texture: GLuint, target: GLenum, levels: GLsizei, - internalformat: GLenum, width: GLsizei, - height: GLsizei){.stdcall, importc, ogl.} -proc glTextureStorage3DEXT*(texture: GLuint, target: GLenum, levels: GLsizei, - internalformat: GLenum, width: GLsizei, - height: GLsizei, depth: GLsizei){.stdcall, importc, ogl.} - # - # GL_ARB_cl_event -proc glCreateSyncFromCLeventARB*(context: p_cl_context, event: p_cl_event, - flags: GLbitfield): GLsync{.stdcall, importc, ogl.} - # GL_ARB_debug_output -proc glDebugMessageControlARB*(source: GLenum, typ: GLenum, severity: GLenum, - count: GLsizei, ids: PGLuint, enabled: GLboolean){. - stdcall, importc, ogl.} -proc glDebugMessageInsertARB*(source: GLenum, typ: GLenum, id: GLuint, - severity: GLenum, len: GLsizei, buf: PGLchar){. - stdcall, importc, ogl.} -proc glDebugMessageCallbackARB*(callback: TglDebugProcARB, userParam: PGLvoid){. - stdcall, importc, ogl.} -proc glGetDebugMessageLogARB*(count: GLuint, bufsize: GLsizei, sources: PGLenum, - types: PGLenum, ids: PGLuint, severities: PGLenum, - lengths: PGLsizei, messageLog: PGLchar): GLuint{. - stdcall, importc, ogl.} - # GL_ARB_robustness -proc glGetGraphicsResetStatusARB*(): GLenum{.stdcall, importc, ogl.} -proc glGetnMapdvARB*(target: GLenum, query: GLenum, bufSize: GLsizei, - v: PGLdouble){.stdcall, importc, ogl.} -proc glGetnMapfvARB*(target: GLenum, query: GLenum, bufSize: GLsizei, - v: PGLfloat){.stdcall, importc, ogl.} -proc glGetnMapivARB*(target: GLenum, query: GLenum, bufSize: GLsizei, v: PGLint){. - stdcall, importc, ogl.} -proc glGetnPixelMapfvARB*(map: GLenum, bufSize: GLsizei, values: PGLfloat){. - stdcall, importc, ogl.} -proc glGetnPixelMapuivARB*(map: GLenum, bufSize: GLsizei, values: PGLuint){. - stdcall, importc, ogl.} -proc glGetnPixelMapusvARB*(map: GLenum, bufSize: GLsizei, values: PGLushort){. - stdcall, importc, ogl.} -proc glGetnPolygonStippleARB*(bufSize: GLsizei, pattern: PGLubyte){.stdcall, importc, ogl.} -proc glGetnColorTableARB*(target: GLenum, format: GLenum, typ: GLenum, - bufSize: GLsizei, table: PGLvoid){.stdcall, importc, ogl.} -proc glGetnConvolutionFilterARB*(target: GLenum, format: GLenum, typ: GLenum, - bufSize: GLsizei, image: PGLvoid){.stdcall, importc, ogl.} -proc glGetnSeparableFilterARB*(target: GLenum, format: GLenum, typ: GLenum, - rowBufSize: GLsizei, row: PGLvoid, - columnBufSize: GLsizei, column: PGLvoid, - span: PGLvoid){.stdcall, importc, ogl.} -proc glGetnHistogramARB*(target: GLenum, reset: GLboolean, format: GLenum, - typ: GLenum, bufSize: GLsizei, values: PGLvoid){. - stdcall, importc, ogl.} -proc glGetnMinmaxARB*(target: GLenum, reset: GLboolean, format: GLenum, - typ: GLenum, bufSize: GLsizei, values: PGLvoid){.stdcall, importc, ogl.} -proc glGetnTexImageARB*(target: GLenum, level: GLint, format: GLenum, - typ: GLenum, bufSize: GLsizei, img: PGLvoid){.stdcall, importc, ogl.} -proc glReadnPixelsARB*(x: GLint, y: GLint, width: GLsizei, height: GLsizei, - format: GLenum, typ: GLenum, bufSize: GLsizei, - data: PGLvoid){.stdcall, importc, ogl.} -proc glGetnCompressedTexImageARB*(target: GLenum, lod: GLint, bufSize: GLsizei, - img: PGLvoid){.stdcall, importc, ogl.} -proc glGetnUniformfvARB*(prog: GLuint, location: GLint, bufSize: GLsizei, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetnUniformivARB*(prog: GLuint, location: GLint, bufSize: GLsizei, - params: PGLint){.stdcall, importc, ogl.} -proc glGetnUniformuivARB*(prog: GLuint, location: GLint, bufSize: GLsizei, - params: PGLuint){.stdcall, importc, ogl.} -proc glGetnUniformdvARB*(prog: GLuint, location: GLint, bufSize: GLsizei, - params: PGLdouble){.stdcall, importc, ogl.} - # GL_ATI_draw_buffers -proc glDrawBuffersATI*(n: GLsizei, bufs: PGLenum){.stdcall, importc, ogl.} - # GL_ATI_element_array -proc glElementPointerATI*(typ: GLenum, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glDrawElementArrayATI*(mode: GLenum, count: GLsizei){.stdcall, importc, ogl.} -proc glDrawRangeElementArrayATI*(mode: GLenum, start: GLuint, ending: GLuint, - count: GLsizei){.stdcall, importc, ogl.} - # GL_ATI_envmap_bumpmap -proc glTexBumpParameterivATI*(pname: GLenum, param: PGLint){.stdcall, importc, ogl.} -proc glTexBumpParameterfvATI*(pname: GLenum, param: PGLfloat){.stdcall, importc, ogl.} -proc glGetTexBumpParameterivATI*(pname: GLenum, param: PGLint){.stdcall, importc, ogl.} -proc glGetTexBumpParameterfvATI*(pname: GLenum, param: PGLfloat){.stdcall, importc, ogl.} - # GL_ATI_fragment_shader -proc glGenFragmentShadersATI*(range: GLuint): GLuint{.stdcall, importc, ogl.} -proc glBindFragmentShaderATI*(id: GLuint){.stdcall, importc, ogl.} -proc glDeleteFragmentShaderATI*(id: GLuint){.stdcall, importc, ogl.} -proc glBeginFragmentShaderATI*(){.stdcall, importc, ogl.} -proc glEndFragmentShaderATI*(){.stdcall, importc, ogl.} -proc glPassTexCoordATI*(dst: GLuint, coord: GLuint, swizzle: GLenum){.stdcall, importc, ogl.} -proc glSampleMapATI*(dst: GLuint, interp: GLuint, swizzle: GLenum){.stdcall, importc, ogl.} -proc glColorFragmentOp1ATI*(op: GLenum, dst: GLuint, dstMask: GLuint, - dstMod: GLuint, arg1: GLuint, arg1Rep: GLuint, - arg1Mod: GLuint){.stdcall, importc, ogl.} -proc glColorFragmentOp2ATI*(op: GLenum, dst: GLuint, dstMask: GLuint, - dstMod: GLuint, arg1: GLuint, arg1Rep: GLuint, - arg1Mod: GLuint, arg2: GLuint, arg2Rep: GLuint, - arg2Mod: GLuint){.stdcall, importc, ogl.} -proc glColorFragmentOp3ATI*(op: GLenum, dst: GLuint, dstMask: GLuint, - dstMod: GLuint, arg1: GLuint, arg1Rep: GLuint, - arg1Mod: GLuint, arg2: GLuint, arg2Rep: GLuint, - arg2Mod: GLuint, arg3: GLuint, arg3Rep: GLuint, - arg3Mod: GLuint){.stdcall, importc, ogl.} -proc glAlphaFragmentOp1ATI*(op: GLenum, dst: GLuint, dstMod: GLuint, - arg1: GLuint, arg1Rep: GLuint, arg1Mod: GLuint){. - stdcall, importc, ogl.} -proc glAlphaFragmentOp2ATI*(op: GLenum, dst: GLuint, dstMod: GLuint, - arg1: GLuint, arg1Rep: GLuint, arg1Mod: GLuint, - arg2: GLuint, arg2Rep: GLuint, arg2Mod: GLuint){. - stdcall, importc, ogl.} -proc glAlphaFragmentOp3ATI*(op: GLenum, dst: GLuint, dstMod: GLuint, - arg1: GLuint, arg1Rep: GLuint, arg1Mod: GLuint, - arg2: GLuint, arg2Rep: GLuint, arg2Mod: GLuint, - arg3: GLuint, arg3Rep: GLuint, arg3Mod: GLuint){. - stdcall, importc, ogl.} -proc glSetFragmentShaderConstantATI*(dst: GLuint, value: PGLfloat){.stdcall, importc, ogl.} - # GL_ATI_map_object_buffer -proc glMapObjectBufferATI*(buffer: GLuint): PGLvoid{.stdcall, importc, ogl.} -proc glUnmapObjectBufferATI*(buffer: GLuint){.stdcall, importc, ogl.} - # GL_ATI_pn_triangles -proc glPNTrianglesiATI*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glPNTrianglesfATI*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} - # GL_ATI_separate_stencil -proc glStencilOpSeparateATI*(face: GLenum, sfail: GLenum, dpfail: GLenum, - dppass: GLenum){.stdcall, importc, ogl.} -proc glStencilFuncSeparateATI*(frontfunc: GLenum, backfunc: GLenum, theRef: GLint, - mask: GLuint){.stdcall, importc, ogl.} - # GL_ATI_vertex_array_object -proc glNewObjectBufferATI*(size: GLsizei, pointer: PGLvoid, usage: GLenum): GLuint{. - stdcall, importc, ogl.} -proc glIsObjectBufferATI*(buffer: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glUpdateObjectBufferATI*(buffer: GLuint, offset: GLuint, size: GLsizei, - pointer: PGLvoid, preserve: GLenum){.stdcall, importc, ogl.} -proc glGetObjectBufferfvATI*(buffer: GLuint, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetObjectBufferivATI*(buffer: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glFreeObjectBufferATI*(buffer: GLuint){.stdcall, importc, ogl.} -proc glArrayObjectATI*(arr: GLenum, size: GLint, typ: GLenum, stride: GLsizei, - buffer: GLuint, offset: GLuint){.stdcall, importc, ogl.} -proc glGetArrayObjectfvATI*(arr: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetArrayObjectivATI*(arr: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glVariantArrayObjectATI*(id: GLuint, typ: GLenum, stride: GLsizei, - buffer: GLuint, offset: GLuint){.stdcall, importc, ogl.} -proc glGetVariantArrayObjectfvATI*(id: GLuint, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetVariantArrayObjectivATI*(id: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} - # GL_ATI_vertex_attrib_array_object -proc glVertexAttribArrayObjectATI*(index: GLuint, size: GLint, typ: GLenum, - normalized: GLboolean, stride: GLsizei, - buffer: GLuint, offset: GLuint){.stdcall, importc, ogl.} -proc glGetVertexAttribArrayObjectfvATI*(index: GLuint, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetVertexAttribArrayObjectivATI*(index: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} - # GL_ATI_vertex_streams -proc glVertexStream1sATI*(stream: GLenum, x: GLshort){.stdcall, importc, ogl.} -proc glVertexStream1svATI*(stream: GLenum, coords: PGLshort){.stdcall, importc, ogl.} -proc glVertexStream1iATI*(stream: GLenum, x: GLint){.stdcall, importc, ogl.} -proc glVertexStream1ivATI*(stream: GLenum, coords: PGLint){.stdcall, importc, ogl.} -proc glVertexStream1fATI*(stream: GLenum, x: GLfloat){.stdcall, importc, ogl.} -proc glVertexStream1fvATI*(stream: GLenum, coords: PGLfloat){.stdcall, importc, ogl.} -proc glVertexStream1dATI*(stream: GLenum, x: GLdouble){.stdcall, importc, ogl.} -proc glVertexStream1dvATI*(stream: GLenum, coords: PGLdouble){.stdcall, importc, ogl.} -proc glVertexStream2sATI*(stream: GLenum, x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glVertexStream2svATI*(stream: GLenum, coords: PGLshort){.stdcall, importc, ogl.} -proc glVertexStream2iATI*(stream: GLenum, x: GLint, y: GLint){.stdcall, importc, ogl.} -proc glVertexStream2ivATI*(stream: GLenum, coords: PGLint){.stdcall, importc, ogl.} -proc glVertexStream2fATI*(stream: GLenum, x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glVertexStream2fvATI*(stream: GLenum, coords: PGLfloat){.stdcall, importc, ogl.} -proc glVertexStream2dATI*(stream: GLenum, x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glVertexStream2dvATI*(stream: GLenum, coords: PGLdouble){.stdcall, importc, ogl.} -proc glVertexStream3sATI*(stream: GLenum, x: GLshort, y: GLshort, z: GLshort){. - stdcall, importc, ogl.} -proc glVertexStream3svATI*(stream: GLenum, coords: PGLshort){.stdcall, importc, ogl.} -proc glVertexStream3iATI*(stream: GLenum, x: GLint, y: GLint, z: GLint){.stdcall, importc, ogl.} -proc glVertexStream3ivATI*(stream: GLenum, coords: PGLint){.stdcall, importc, ogl.} -proc glVertexStream3fATI*(stream: GLenum, x: GLfloat, y: GLfloat, z: GLfloat){. - stdcall, importc, ogl.} -proc glVertexStream3fvATI*(stream: GLenum, coords: PGLfloat){.stdcall, importc, ogl.} -proc glVertexStream3dATI*(stream: GLenum, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glVertexStream3dvATI*(stream: GLenum, coords: PGLdouble){.stdcall, importc, ogl.} -proc glVertexStream4sATI*(stream: GLenum, x: GLshort, y: GLshort, z: GLshort, - w: GLshort){.stdcall, importc, ogl.} -proc glVertexStream4svATI*(stream: GLenum, coords: PGLshort){.stdcall, importc, ogl.} -proc glVertexStream4iATI*(stream: GLenum, x: GLint, y: GLint, z: GLint, w: GLint){. - stdcall, importc, ogl.} -proc glVertexStream4ivATI*(stream: GLenum, coords: PGLint){.stdcall, importc, ogl.} -proc glVertexStream4fATI*(stream: GLenum, x: GLfloat, y: GLfloat, z: GLfloat, - w: GLfloat){.stdcall, importc, ogl.} -proc glVertexStream4fvATI*(stream: GLenum, coords: PGLfloat){.stdcall, importc, ogl.} -proc glVertexStream4dATI*(stream: GLenum, x: GLdouble, y: GLdouble, z: GLdouble, - w: GLdouble){.stdcall, importc, ogl.} -proc glVertexStream4dvATI*(stream: GLenum, coords: PGLdouble){.stdcall, importc, ogl.} -proc glNormalStream3bATI*(stream: GLenum, nx: GLbyte, ny: GLbyte, nz: GLbyte){. - stdcall, importc, ogl.} -proc glNormalStream3bvATI*(stream: GLenum, coords: PGLbyte){.stdcall, importc, ogl.} -proc glNormalStream3sATI*(stream: GLenum, nx: GLshort, ny: GLshort, nz: GLshort){. - stdcall, importc, ogl.} -proc glNormalStream3svATI*(stream: GLenum, coords: PGLshort){.stdcall, importc, ogl.} -proc glNormalStream3iATI*(stream: GLenum, nx: GLint, ny: GLint, nz: GLint){. - stdcall, importc, ogl.} -proc glNormalStream3ivATI*(stream: GLenum, coords: PGLint){.stdcall, importc, ogl.} -proc glNormalStream3fATI*(stream: GLenum, nx: GLfloat, ny: GLfloat, nz: GLfloat){. - stdcall, importc, ogl.} -proc glNormalStream3fvATI*(stream: GLenum, coords: PGLfloat){.stdcall, importc, ogl.} -proc glNormalStream3dATI*(stream: GLenum, nx: GLdouble, ny: GLdouble, - nz: GLdouble){.stdcall, importc, ogl.} -proc glNormalStream3dvATI*(stream: GLenum, coords: PGLdouble){.stdcall, importc, ogl.} -proc glClientActiveVertexStreamATI*(stream: GLenum){.stdcall, importc, ogl.} -proc glVertexBlendEnviATI*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glVertexBlendEnvfATI*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} - # GL_AMD_performance_monitor -proc glGetPerfMonitorGroupsAMD*(numGroups: PGLint, groupsSize: GLsizei, - groups: PGLuint){.stdcall, importc, ogl.} -proc glGetPerfMonitorCountersAMD*(group: GLuint, numCounters: PGLint, - maxActiveCouters: PGLint, - counterSize: GLsizei, counters: PGLuint){. - stdcall, importc, ogl.} -proc glGetPerfMonitorGroupStringAMD*(group: GLuint, bufSize: GLsizei, - len: PGLsizei, groupString: PGLchar){. - stdcall, importc, ogl.} -proc glGetPerfMonitorCounterStringAMD*(group: GLuint, counter: GLuint, - bufSize: GLsizei, len: PGLsizei, - counterString: PGLchar){.stdcall, importc, ogl.} -proc glGetPerfMonitorCounterInfoAMD*(group: GLuint, counter: GLuint, - pname: GLenum, data: PGLvoid){.stdcall, importc, ogl.} -proc glGenPerfMonitorsAMD*(n: GLsizei, monitors: PGLuint){.stdcall, importc, ogl.} -proc glDeletePerfMonitorsAMD*(n: GLsizei, monitors: PGLuint){.stdcall, importc, ogl.} -proc glSelectPerfMonitorCountersAMD*(monitor: GLuint, enable: GLboolean, - group: GLuint, numCounters: GLint, - counterList: PGLuint){.stdcall, importc, ogl.} -proc glBeginPerfMonitorAMD*(monitor: GLuint){.stdcall, importc, ogl.} -proc glEndPerfMonitorAMD*(monitor: GLuint){.stdcall, importc, ogl.} -proc glGetPerfMonitorCounterDataAMD*(monitor: GLuint, pname: GLenum, - dataSize: GLsizei, data: PGLuint, - bytesWritten: PGLint){.stdcall, importc, ogl.} - # GL_AMD_vertex_shader_tesselator -proc glTessellationFactorAMD*(factor: GLfloat){.stdcall, importc, ogl.} -proc glTessellationModeAMD*(mode: GLenum){.stdcall, importc, ogl.} - # GL_AMD_draw_buffers_blend -proc glBlendFuncIndexedAMD*(buf: GLuint, src: GLenum, dst: GLenum){.stdcall, importc, ogl.} -proc glBlendFuncSeparateIndexedAMD*(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, - srcAlpha: GLenum, dstAlpha: GLenum){.stdcall, importc, ogl.} -proc glBlendEquationIndexedAMD*(buf: GLuint, mode: GLenum){.stdcall, importc, ogl.} -proc glBlendEquationSeparateIndexedAMD*(buf: GLuint, modeRGB: GLenum, - modeAlpha: GLenum){.stdcall, importc, ogl.} - # GL_AMD_name_gen_delete -proc glGenNamesAMD*(identifier: GLenum, num: GLuint, names: PGLuint){.stdcall, importc, ogl.} -proc glDeleteNamesAMD*(identifier: GLenum, num: GLuint, names: PGLuint){.stdcall, importc, ogl.} -proc glIsNameAMD*(identifier: GLenum, name: GLuint): GLboolean{.stdcall, importc, ogl.} - # GL_AMD_debug_output -proc glDebugMessageEnableAMD*(category: GLenum, severity: GLenum, - count: GLsizei, ids: PGLuint, enabled: GLboolean){. - stdcall, importc, ogl.} -proc glDebugMessageInsertAMD*(category: GLenum, severity: GLenum, id: GLuint, - len: GLsizei, buf: PGLchar){.stdcall, importc, ogl.} -proc glDebugMessageCallbackAMD*(callback: TGLDebugProcAMD, userParam: PGLvoid){. - stdcall, importc, ogl.} -proc glGetDebugMessageLogAMD*(count: GLuint, bufsize: GLsizei, - categories: PGLenum, severities: PGLuint, - ids: PGLuint, lengths: PGLsizei, message: PGLchar): GLuint{. - stdcall, importc, ogl.} - # GL_EXT_blend_color -proc glBlendColorEXT*(red: GLclampf, green: GLclampf, blue: GLclampf, - alpha: GLclampf){.stdcall, importc, ogl.} - # GL_EXT_blend_func_separate -proc glBlendFuncSeparateEXT*(sfactorRGB: GLenum, dfactorRGB: GLenum, - sfactorAlpha: GLenum, dfactorAlpha: GLenum){. - stdcall, importc, ogl.} - # GL_EXT_blend_minmax -proc glBlendEquationEXT*(mode: GLenum){.stdcall, importc, ogl.} - # GL_EXT_color_subtable -proc glColorSubTableEXT*(target: GLenum, start: GLsizei, count: GLsizei, - format: GLenum, typ: GLenum, data: PGLvoid){.stdcall, importc, ogl.} -proc glCopyColorSubTableEXT*(target: GLenum, start: GLsizei, x: GLint, y: GLint, - width: GLsizei){.stdcall, importc, ogl.} - # GL_EXT_compiled_vertex_array -proc glLockArraysEXT*(first: GLint, count: GLsizei){.stdcall, importc, ogl.} -proc glUnlockArraysEXT*(){.stdcall, importc, ogl.} - # GL_EXT_convolution -proc glConvolutionFilter1DEXT*(target: GLenum, internalformat: GLenum, - width: GLsizei, format: GLenum, typ: GLenum, - image: PGLvoid){.stdcall, importc, ogl.} -proc glConvolutionFilter2DEXT*(target: GLenum, internalformat: GLenum, - width: GLsizei, height: GLsizei, format: GLenum, - typ: GLenum, image: PGLvoid){.stdcall, importc, ogl.} -proc glConvolutionParameterfEXT*(target: GLenum, pname: GLenum, params: GLfloat){. - stdcall, importc, ogl.} -proc glConvolutionParameterfvEXT*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glConvolutionParameteriEXT*(target: GLenum, pname: GLenum, params: GLint){. - stdcall, importc, ogl.} -proc glConvolutionParameterivEXT*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glCopyConvolutionFilter1DEXT*(target: GLenum, internalformat: GLenum, - x: GLint, y: GLint, width: GLsizei){.stdcall, importc, ogl.} -proc glCopyConvolutionFilter2DEXT*(target: GLenum, internalformat: GLenum, - x: GLint, y: GLint, width: GLsizei, - height: GLsizei){.stdcall, importc, ogl.} -proc glGetConvolutionFilterEXT*(target: GLenum, format: GLenum, typ: GLenum, - image: PGLvoid){.stdcall, importc, ogl.} -proc glGetConvolutionParameterfvEXT*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetConvolutionParameterivEXT*(target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetSeparableFilterEXT*(target: GLenum, format: GLenum, typ: GLenum, - row: PGLvoid, column: PGLvoid, span: PGLvoid){. - stdcall, importc, ogl.} -proc glSeparableFilter2DEXT*(target: GLenum, internalformat: GLenum, - width: GLsizei, height: GLsizei, format: GLenum, - typ: GLenum, row: PGLvoid, column: PGLvoid){. - stdcall, importc, ogl.} - # GL_EXT_coordinate_frame -proc glTangent3bEXT*(tx: GLbyte, ty: GLbyte, tz: GLbyte){.stdcall, importc, ogl.} -proc glTangent3bvEXT*(v: PGLbyte){.stdcall, importc, ogl.} -proc glTangent3dEXT*(tx: GLdouble, ty: GLdouble, tz: GLdouble){.stdcall, importc, ogl.} -proc glTangent3dvEXT*(v: PGLdouble){.stdcall, importc, ogl.} -proc glTangent3fEXT*(tx: GLfloat, ty: GLfloat, tz: GLfloat){.stdcall, importc, ogl.} -proc glTangent3fvEXT*(v: PGLfloat){.stdcall, importc, ogl.} -proc glTangent3iEXT*(tx: GLint, ty: GLint, tz: GLint){.stdcall, importc, ogl.} -proc glTangent3ivEXT*(v: PGLint){.stdcall, importc, ogl.} -proc glTangent3sEXT*(tx: GLshort, ty: GLshort, tz: GLshort){.stdcall, importc, ogl.} -proc glTangent3svEXT*(v: PGLshort){.stdcall, importc, ogl.} -proc glBinormal3bEXT*(bx: GLbyte, by: GLbyte, bz: GLbyte){.stdcall, importc, ogl.} -proc glBinormal3bvEXT*(v: PGLbyte){.stdcall, importc, ogl.} -proc glBinormal3dEXT*(bx: GLdouble, by: GLdouble, bz: GLdouble){.stdcall, importc, ogl.} -proc glBinormal3dvEXT*(v: PGLdouble){.stdcall, importc, ogl.} -proc glBinormal3fEXT*(bx: GLfloat, by: GLfloat, bz: GLfloat){.stdcall, importc, ogl.} -proc glBinormal3fvEXT*(v: PGLfloat){.stdcall, importc, ogl.} -proc glBinormal3iEXT*(bx: GLint, by: GLint, bz: GLint){.stdcall, importc, ogl.} -proc glBinormal3ivEXT*(v: PGLint){.stdcall, importc, ogl.} -proc glBinormal3sEXT*(bx: GLshort, by: GLshort, bz: GLshort){.stdcall, importc, ogl.} -proc glBinormal3svEXT*(v: PGLshort){.stdcall, importc, ogl.} -proc glTangentPointerEXT*(typ: GLenum, stride: GLsizei, pointer: PGLvoid){. - stdcall, importc, ogl.} -proc glBinormalPointerEXT*(typ: GLenum, stride: GLsizei, pointer: PGLvoid){. - stdcall, importc, ogl.} - # GL_EXT_copy_texture -proc glCopyTexImage1DEXT*(target: GLenum, level: GLint, internalformat: GLenum, - x: GLint, y: GLint, width: GLsizei, border: GLint){. - stdcall, importc, ogl.} -proc glCopyTexImage2DEXT*(target: GLenum, level: GLint, internalformat: GLenum, - x: GLint, y: GLint, width: GLsizei, height: GLsizei, - border: GLint){.stdcall, importc, ogl.} -proc glCopyTexSubImage1DEXT*(target: GLenum, level: GLint, xoffset: GLint, - x: GLint, y: GLint, width: GLsizei){.stdcall, importc, ogl.} -proc glCopyTexSubImage2DEXT*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, x: GLint, y: GLint, width: GLsizei, - height: GLsizei){.stdcall, importc, ogl.} -proc glCopyTexSubImage3DEXT*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} - # GL_EXT_cull_vertex -proc glCullParameterdvEXT*(pname: GLenum, params: PGLdouble){.stdcall, importc, ogl.} -proc glCullParameterfvEXT*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} - # GL_EXT_draw_range_elements -proc glDrawRangeElementsEXT*(mode: GLenum, start: GLuint, ending: GLuint, - count: GLsizei, typ: GLenum, indices: PGLvoid){. - stdcall, importc, ogl.} - # GL_EXT_fog_coord -proc glFogCoordfEXT*(coord: GLfloat){.stdcall, importc, ogl.} -proc glFogCoordfvEXT*(coord: PGLfloat){.stdcall, importc, ogl.} -proc glFogCoorddEXT*(coord: GLdouble){.stdcall, importc, ogl.} -proc glFogCoorddvEXT*(coord: PGLdouble){.stdcall, importc, ogl.} -proc glFogCoordPointerEXT*(typ: GLenum, stride: GLsizei, pointer: PGLvoid){. - stdcall, importc, ogl.} - # GL_EXT_framebuffer_object -proc glIsRenderbufferEXT*(renderbuffer: GLuint): bool{.stdcall, importc, ogl.} -proc glBindRenderbufferEXT*(target: GLenum, renderbuffer: GLuint){.stdcall, importc, ogl.} -proc glDeleteRenderbuffersEXT*(n: GLsizei, renderbuffers: PGLuint){.stdcall, importc, ogl.} -proc glGenRenderbuffersEXT*(n: GLsizei, renderbuffers: PGLuint){.stdcall, importc, ogl.} -proc glRenderbufferStorageEXT*(target: GLenum, internalformat: GLenum, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glGetRenderbufferParameterivEXT*(target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glIsFramebufferEXT*(framebuffer: GLuint): bool{.stdcall, importc, ogl.} -proc glBindFramebufferEXT*(target: GLenum, framebuffer: GLuint){.stdcall, importc, ogl.} -proc glDeleteFramebuffersEXT*(n: GLsizei, framebuffers: PGLuint){.stdcall, importc, ogl.} -proc glGenFramebuffersEXT*(n: GLsizei, framebuffers: PGLuint){.stdcall, importc, ogl.} -proc glCheckFramebufferStatusEXT*(target: GLenum): GLenum{.stdcall, importc, ogl.} -proc glFramebufferTexture1DEXT*(target: GLenum, attachment: GLenum, - textarget: GLenum, texture: GLuint, level: GLint){. - stdcall, importc, ogl.} -proc glFramebufferTexture2DEXT*(target: GLenum, attachment: GLenum, - textarget: GLenum, texture: GLuint, level: GLint){. - stdcall, importc, ogl.} -proc glFramebufferTexture3DEXT*(target: GLenum, attachment: GLenum, - textarget: GLenum, texture: GLuint, - level: GLint, zoffset: GLint){.stdcall, importc, ogl.} -proc glFramebufferRenderbufferEXT*(target: GLenum, attachment: GLenum, - renderbuffertarget: GLenum, - renderbuffer: GLuint){.stdcall, importc, ogl.} -proc glGetFramebufferAttachmentParameterivEXT*(target: GLenum, - attachment: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGenerateMipmapEXT*(target: GLenum){.stdcall, importc, ogl.} - # GL_EXT_histogram -proc glGetHistogramEXT*(target: GLenum, reset: GLboolean, format: GLenum, - typ: GLenum, values: PGLvoid){.stdcall, importc, ogl.} -proc glGetHistogramParameterfvEXT*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetHistogramParameterivEXT*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetMinmaxEXT*(target: GLenum, reset: GLboolean, format: GLenum, - typ: GLenum, values: PGLvoid){.stdcall, importc, ogl.} -proc glGetMinmaxParameterfvEXT*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetMinmaxParameterivEXT*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glHistogramEXT*(target: GLenum, width: GLsizei, internalformat: GLenum, - sink: GLboolean){.stdcall, importc, ogl.} -proc glMinmaxEXT*(target: GLenum, internalformat: GLenum, sink: GLboolean){. - stdcall, importc, ogl.} -proc glResetHistogramEXT*(target: GLenum){.stdcall, importc, ogl.} -proc glResetMinmaxEXT*(target: GLenum){.stdcall, importc, ogl.} - # GL_EXT_index_func -proc glIndexFuncEXT*(func: GLenum, theRef: GLclampf){.stdcall, importc, ogl.} - # GL_EXT_index_material -proc glIndexMaterialEXT*(face: GLenum, mode: GLenum){.stdcall, importc, ogl.} - # GL_EXT_light_texture -proc glApplyTextureEXT*(mode: GLenum){.stdcall, importc, ogl.} -proc glTextureLightEXT*(pname: GLenum){.stdcall, importc, ogl.} -proc glTextureMaterialEXT*(face: GLenum, mode: GLenum){.stdcall, importc, ogl.} - # GL_EXT_multi_draw_arrays -proc glMultiDrawArraysEXT*(mode: GLenum, first: PGLint, count: PGLsizei, - primcount: GLsizei){.stdcall, importc, ogl.} -proc glMultiDrawElementsEXT*(mode: GLenum, count: PGLsizei, typ: GLenum, - indices: PGLvoid, primcount: GLsizei){.stdcall, importc, ogl.} - # GL_EXT_multisample -proc glSampleMaskEXT*(value: GLclampf, invert: GLboolean){.stdcall, importc, ogl.} -proc glSamplePatternEXT*(pattern: GLenum){.stdcall, importc, ogl.} - # GL_EXT_paletted_texture -proc glColorTableEXT*(target: GLenum, internalFormat: GLenum, width: GLsizei, - format: GLenum, typ: GLenum, table: PGLvoid){.stdcall, importc, ogl.} -proc glGetColorTableEXT*(target: GLenum, format: GLenum, typ: GLenum, - data: PGLvoid){.stdcall, importc, ogl.} -proc glGetColorTableParameterivEXT*(target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetColorTableParameterfvEXT*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} - # GL_EXT_pixel_transform -proc glPixelTransformParameteriEXT*(target: GLenum, pname: GLenum, param: GLint){. - stdcall, importc, ogl.} -proc glPixelTransformParameterfEXT*(target: GLenum, pname: GLenum, - param: GLfloat){.stdcall, importc, ogl.} -proc glPixelTransformParameterivEXT*(target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glPixelTransformParameterfvEXT*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} - # GL_EXT_point_parameters -proc glPointParameterfEXT*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glPointParameterfvEXT*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} - # GL_EXT_polygon_offset -proc glPolygonOffsetEXT*(factor: GLfloat, bias: GLfloat){.stdcall, importc, ogl.} - # GL_EXT_secondary_color -proc glSecondaryColor3bEXT*(red: GLbyte, green: GLbyte, blue: GLbyte){.stdcall, importc, ogl.} -proc glSecondaryColor3bvEXT*(v: PGLbyte){.stdcall, importc, ogl.} -proc glSecondaryColor3dEXT*(red: GLdouble, green: GLdouble, blue: GLdouble){. - stdcall, importc, ogl.} -proc glSecondaryColor3dvEXT*(v: PGLdouble){.stdcall, importc, ogl.} -proc glSecondaryColor3fEXT*(red: GLfloat, green: GLfloat, blue: GLfloat){. - stdcall, importc, ogl.} -proc glSecondaryColor3fvEXT*(v: PGLfloat){.stdcall, importc, ogl.} -proc glSecondaryColor3iEXT*(red: GLint, green: GLint, blue: GLint){.stdcall, importc, ogl.} -proc glSecondaryColor3ivEXT*(v: PGLint){.stdcall, importc, ogl.} -proc glSecondaryColor3sEXT*(red: GLshort, green: GLshort, blue: GLshort){. - stdcall, importc, ogl.} -proc glSecondaryColor3svEXT*(v: PGLshort){.stdcall, importc, ogl.} -proc glSecondaryColor3ubEXT*(red: GLubyte, green: GLubyte, blue: GLubyte){. - stdcall, importc, ogl.} -proc glSecondaryColor3ubvEXT*(v: PGLubyte){.stdcall, importc, ogl.} -proc glSecondaryColor3uiEXT*(red: GLuint, green: GLuint, blue: GLuint){.stdcall, importc, ogl.} -proc glSecondaryColor3uivEXT*(v: PGLuint){.stdcall, importc, ogl.} -proc glSecondaryColor3usEXT*(red: GLushort, green: GLushort, blue: GLushort){. - stdcall, importc, ogl.} -proc glSecondaryColor3usvEXT*(v: PGLushort){.stdcall, importc, ogl.} -proc glSecondaryColorPointerEXT*(size: GLint, typ: GLenum, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} - # GL_EXT_stencil_two_side -proc glActiveStencilFaceEXT*(face: GLenum){.stdcall, importc, ogl.} - # GL_EXT_subtexture -proc glTexSubImage1DEXT*(target: GLenum, level: GLint, xoffset: GLint, - width: GLsizei, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTexSubImage2DEXT*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, width: GLsizei, height: GLsizei, - format: GLenum, typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} - # GL_EXT_texture3D -proc glTexImage3DEXT*(target: GLenum, level: GLint, internalformat: GLenum, - width: GLsizei, height: GLsizei, depth: GLsizei, - border: GLint, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTexSubImage3DEXT*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, width: GLsizei, - height: GLsizei, depth: GLsizei, format: GLenum, - typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} - # GL_EXT_texture_object -proc glAreTexturesResidentEXT*(n: GLsizei, textures: PGLuint, - residences: PGLboolean): GLboolean{.stdcall, importc, ogl.} -proc glBindTextureEXT*(target: GLenum, texture: GLuint){.stdcall, importc, ogl.} -proc glDeleteTexturesEXT*(n: GLsizei, textures: PGLuint){.stdcall, importc, ogl.} -proc glGenTexturesEXT*(n: GLsizei, textures: PGLuint){.stdcall, importc, ogl.} -proc glIsTextureEXT*(texture: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glPrioritizeTexturesEXT*(n: GLsizei, textures: PGLuint, - priorities: PGLclampf){.stdcall, importc, ogl.} - # GL_EXT_texture_perturb_normal -proc glTextureNormalEXT*(mode: GLenum){.stdcall, importc, ogl.} - # GL_EXT_vertex_array -proc glArrayElementEXT*(i: GLint){.stdcall, importc, ogl.} -proc glColorPointerEXT*(size: GLint, typ: GLenum, stride: GLsizei, - count: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glDrawArraysEXT*(mode: GLenum, first: GLint, count: GLsizei){.stdcall, importc, ogl.} -proc glEdgeFlagPointerEXT*(stride: GLsizei, count: GLsizei, pointer: PGLboolean){. - stdcall, importc, ogl.} -proc glGetPointervEXT*(pname: GLenum, params: PGLvoid){.stdcall, importc, ogl.} -proc glIndexPointerEXT*(typ: GLenum, stride: GLsizei, count: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} -proc glNormalPointerEXT*(typ: GLenum, stride: GLsizei, count: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} -proc glTexCoordPointerEXT*(size: GLint, typ: GLenum, stride: GLsizei, - count: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glVertexPointerEXT*(size: GLint, typ: GLenum, stride: GLsizei, - count: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} - # GL_EXT_vertex_shader -proc glBeginVertexShaderEXT*(){.stdcall, importc, ogl.} -proc glEndVertexShaderEXT*(){.stdcall, importc, ogl.} -proc glBindVertexShaderEXT*(id: GLuint){.stdcall, importc, ogl.} -proc glGenVertexShadersEXT*(range: GLuint): GLuint{.stdcall, importc, ogl.} -proc glDeleteVertexShaderEXT*(id: GLuint){.stdcall, importc, ogl.} -proc glShaderOp1EXT*(op: GLenum, res: GLuint, arg1: GLuint){.stdcall, importc, ogl.} -proc glShaderOp2EXT*(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint){. - stdcall, importc, ogl.} -proc glShaderOp3EXT*(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint, - arg3: GLuint){.stdcall, importc, ogl.} -proc glSwizzleEXT*(res: GLuint, ain: GLuint, outX: GLenum, outY: GLenum, - outZ: GLenum, outW: GLenum){.stdcall, importc, ogl.} -proc glWriteMaskEXT*(res: GLuint, ain: GLuint, outX: GLenum, outY: GLenum, - outZ: GLenum, outW: GLenum){.stdcall, importc, ogl.} -proc glInsertComponentEXT*(res: GLuint, src: GLuint, num: GLuint){.stdcall, importc, ogl.} -proc glExtractComponentEXT*(res: GLuint, src: GLuint, num: GLuint){.stdcall, importc, ogl.} -proc glGenSymbolsEXT*(datatype: GLenum, storagetype: GLenum, range: GLenum, - components: GLuint): GLuint{.stdcall, importc, ogl.} -proc glSetInvariantEXT*(id: GLuint, typ: GLenum, theAddr: PGLvoid){.stdcall, importc, ogl.} -proc glSetLocalConstantEXT*(id: GLuint, typ: GLenum, theAddr: PGLvoid){.stdcall, importc, ogl.} -proc glVariantbvEXT*(id: GLuint, theAddr: PGLbyte){.stdcall, importc, ogl.} -proc glVariantsvEXT*(id: GLuint, theAddr: PGLshort){.stdcall, importc, ogl.} -proc glVariantivEXT*(id: GLuint, theAddr: PGLint){.stdcall, importc, ogl.} -proc glVariantfvEXT*(id: GLuint, theAddr: PGLfloat){.stdcall, importc, ogl.} -proc glVariantdvEXT*(id: GLuint, theAddr: PGLdouble){.stdcall, importc, ogl.} -proc glVariantubvEXT*(id: GLuint, theAddr: PGLubyte){.stdcall, importc, ogl.} -proc glVariantusvEXT*(id: GLuint, theAddr: PGLushort){.stdcall, importc, ogl.} -proc glVariantuivEXT*(id: GLuint, theAddr: PGLuint){.stdcall, importc, ogl.} -proc glVariantPointerEXT*(id: GLuint, typ: GLenum, stride: GLuint, theAddr: PGLvoid){. - stdcall, importc, ogl.} -proc glEnableVariantClientStateEXT*(id: GLuint){.stdcall, importc, ogl.} -proc glDisableVariantClientStateEXT*(id: GLuint){.stdcall, importc, ogl.} -proc glBindLightParameterEXT*(light: GLenum, value: GLenum): GLuint{.stdcall, importc, ogl.} -proc glBindMaterialParameterEXT*(face: GLenum, value: GLenum): GLuint{.stdcall, importc, ogl.} -proc glBindTexGenParameterEXT*(theUnit: GLenum, coord: GLenum, value: GLenum): GLuint{. - stdcall, importc, ogl.} -proc glBindTextureUnitParameterEXT*(theUnit: GLenum, value: GLenum): GLuint{. - stdcall, importc, ogl.} -proc glBindParameterEXT*(value: GLenum): GLuint{.stdcall, importc, ogl.} -proc glIsVariantEnabledEXT*(id: GLuint, cap: GLenum): GLboolean{.stdcall, importc, ogl.} -proc glGetVariantBooleanvEXT*(id: GLuint, value: GLenum, data: PGLboolean){. - stdcall, importc, ogl.} -proc glGetVariantIntegervEXT*(id: GLuint, value: GLenum, data: PGLint){.stdcall, importc, ogl.} -proc glGetVariantFloatvEXT*(id: GLuint, value: GLenum, data: PGLfloat){.stdcall, importc, ogl.} -proc glGetVariantPointervEXT*(id: GLuint, value: GLenum, data: PGLvoid){.stdcall, importc, ogl.} -proc glGetInvariantBooleanvEXT*(id: GLuint, value: GLenum, data: PGLboolean){. - stdcall, importc, ogl.} -proc glGetInvariantIntegervEXT*(id: GLuint, value: GLenum, data: PGLint){. - stdcall, importc, ogl.} -proc glGetInvariantFloatvEXT*(id: GLuint, value: GLenum, data: PGLfloat){. - stdcall, importc, ogl.} -proc glGetLocalConstantBooleanvEXT*(id: GLuint, value: GLenum, data: PGLboolean){. - stdcall, importc, ogl.} -proc glGetLocalConstantIntegervEXT*(id: GLuint, value: GLenum, data: PGLint){. - stdcall, importc, ogl.} -proc glGetLocalConstantFloatvEXT*(id: GLuint, value: GLenum, data: PGLfloat){. - stdcall, importc, ogl.} - # GL_EXT_vertex_weighting -proc glVertexWeightfEXT*(weight: GLfloat){.stdcall, importc, ogl.} -proc glVertexWeightfvEXT*(weight: PGLfloat){.stdcall, importc, ogl.} -proc glVertexWeightPointerEXT*(size: GLsizei, typ: GLenum, stride: GLsizei, - pointer: PGLvoid){.stdcall, importc, ogl.} - # GL_EXT_stencil_clear_tag -proc glStencilClearTagEXT*(stencilTagBits: GLsizei, stencilClearTag: GLuint){. - stdcall, importc, ogl.} - # GL_EXT_framebuffer_blit -proc glBlitFramebufferEXT*(srcX0: GLint, srcY0: GLint, srcX1: GLint, - srcY1: GLint, dstX0: GLint, dstY0: GLint, - dstX1: GLint, dstY1: GLint, mask: GLbitfield, - filter: GLenum){.stdcall, importc, ogl.} - # GL_EXT_framebuffer_multisample -proc glRenderbufferStorageMultisampleEXT*(target: GLenum, samples: GLsizei, - internalformat: GLenum, width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} - # GL_EXT_timer_query -proc glGetQueryObjecti64vEXT*(id: GLuint, pname: GLenum, params: PGLint64EXT){. - stdcall, importc, ogl.} -proc glGetQueryObjectui64vEXT*(id: GLuint, pname: GLenum, params: PGLuint64EXT){. - stdcall, importc, ogl.} - # GL_EXT_gpu_program_parameters -proc glProgramEnvParameters4fvEXT*(target: GLenum, index: GLuint, - count: GLsizei, params: PGLfloat){.stdcall, importc, ogl.} -proc glProgramLocalParameters4fvEXT*(target: GLenum, index: GLuint, - count: GLsizei, params: PGLfloat){.stdcall, importc, ogl.} - # GL_EXT_bindable_uniform -proc glUniformBufferEXT*(prog: GLuint, location: GLint, buffer: GLuint){.stdcall, importc, ogl.} -proc glGetUniformBufferSizeEXT*(prog: GLuint, location: GLint): GLint{.stdcall, importc, ogl.} -proc glGetUniformOffsetEXT*(prog: GLuint, location: GLint): GLintptr{.stdcall, importc, ogl.} - # GL_EXT_draw_buffers2 -proc glColorMaskIndexedEXT*(buf: GLuint, r: GLboolean, g: GLboolean, - b: GLboolean, a: GLboolean){.stdcall, importc, ogl.} -proc glGetBooleanIndexedvEXT*(value: GLenum, index: GLuint, data: PGLboolean){. - stdcall, importc, ogl.} -proc glGetIntegerIndexedvEXT*(value: GLenum, index: GLuint, data: PGLint){. - stdcall, importc, ogl.} -proc glEnableIndexedEXT*(target: GLenum, index: GLuint){.stdcall, importc, ogl.} -proc glDisableIndexedEXT*(target: GLenum, index: GLuint){.stdcall, importc, ogl.} -proc glIsEnabledIndexedEXT*(target: GLenum, index: GLuint): GLboolean{.stdcall, importc, ogl.} - # GL_EXT_draw_instanced -proc glDrawArraysInstancedEXT*(mode: GLenum, first: GLint, count: GLsizei, - primcount: GLsizei){.stdcall, importc, ogl.} -proc glDrawElementsInstancedEXT*(mode: GLenum, count: GLsizei, typ: GLenum, - indices: Pointer, primcount: GLsizei){.stdcall, importc, ogl.} - # GL_EXT_geometry_shader4 -proc glProgramParameteriEXT*(prog: GLuint, pname: GLenum, value: GLint){.stdcall, importc, ogl.} -proc glFramebufferTextureEXT*(target: GLenum, attachment: GLenum, - texture: GLuint, level: GLint){.stdcall, importc, ogl.} - #procedure glFramebufferTextureLayerEXT(target: GLenum; attachment: GLenum; texture: GLuint; level: GLint; layer: GLint); stdcall, importc, ogl; -proc glFramebufferTextureFaceEXT*(target: GLenum, attachment: GLenum, - texture: GLuint, level: GLint, face: GLenum){. - stdcall, importc, ogl.} - # GL_EXT_gpu_shader4 -proc glVertexAttribI1iEXT*(index: GLuint, x: GLint){.stdcall, importc, ogl.} -proc glVertexAttribI2iEXT*(index: GLuint, x: GLint, y: GLint){.stdcall, importc, ogl.} -proc glVertexAttribI3iEXT*(index: GLuint, x: GLint, y: GLint, z: GLint){.stdcall, importc, ogl.} -proc glVertexAttribI4iEXT*(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint){. - stdcall, importc, ogl.} -proc glVertexAttribI1uiEXT*(index: GLuint, x: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribI2uiEXT*(index: GLuint, x: GLuint, y: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribI3uiEXT*(index: GLuint, x: GLuint, y: GLuint, z: GLuint){. - stdcall, importc, ogl.} -proc glVertexAttribI4uiEXT*(index: GLuint, x: GLuint, y: GLuint, z: GLuint, - w: GLuint){.stdcall, importc, ogl.} -proc glVertexAttribI1ivEXT*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttribI2ivEXT*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttribI3ivEXT*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttribI4ivEXT*(index: GLuint, v: PGLint){.stdcall, importc, ogl.} -proc glVertexAttribI1uivEXT*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribI2uivEXT*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribI3uivEXT*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribI4uivEXT*(index: GLuint, v: PGLuint){.stdcall, importc, ogl.} -proc glVertexAttribI4bvEXT*(index: GLuint, v: PGLbyte){.stdcall, importc, ogl.} -proc glVertexAttribI4svEXT*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttribI4ubvEXT*(index: GLuint, v: PGLubyte){.stdcall, importc, ogl.} -proc glVertexAttribI4usvEXT*(index: GLuint, v: PGLushort){.stdcall, importc, ogl.} -proc glVertexAttribIPointerEXT*(index: GLuint, size: GLint, typ: GLenum, - stride: GLsizei, pointer: Pointer){.stdcall, importc, ogl.} -proc glGetVertexAttribIivEXT*(index: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetVertexAttribIuivEXT*(index: GLuint, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} -proc glUniform1uiEXT*(location: GLint, v0: GLuint){.stdcall, importc, ogl.} -proc glUniform2uiEXT*(location: GLint, v0: GLuint, v1: GLuint){.stdcall, importc, ogl.} -proc glUniform3uiEXT*(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint){. - stdcall, importc, ogl.} -proc glUniform4uiEXT*(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, - v3: GLuint){.stdcall, importc, ogl.} -proc glUniform1uivEXT*(location: GLint, count: GLsizei, value: PGLuint){.stdcall, importc, ogl.} -proc glUniform2uivEXT*(location: GLint, count: GLsizei, value: PGLuint){.stdcall, importc, ogl.} -proc glUniform3uivEXT*(location: GLint, count: GLsizei, value: PGLuint){.stdcall, importc, ogl.} -proc glUniform4uivEXT*(location: GLint, count: GLsizei, value: PGLuint){.stdcall, importc, ogl.} -proc glGetUniformuivEXT*(prog: GLuint, location: GLint, params: PGLuint){. - stdcall, importc, ogl.} -proc glBindFragDataLocationEXT*(prog: GLuint, colorNumber: GLuint, name: PGLchar){. - stdcall, importc, ogl.} -proc glGetFragDataLocationEXT*(prog: GLuint, name: PGLchar): GLint{.stdcall, importc, ogl.} - # GL_EXT_texture_array -proc glFramebufferTextureLayerEXT*(target: GLenum, attachment: GLenum, - texture: GLuint, level: GLint, layer: GLint){. - stdcall, importc, ogl.} - # GL_EXT_texture_buffer_object -proc glTexBufferEXT*(target: GLenum, internalformat: GLenum, buffer: GLuint){. - stdcall, importc, ogl.} - # GL_EXT_texture_integer -proc glClearColorIiEXT*(r: GLint, g: GLint, b: GLint, a: GLint){.stdcall, importc, ogl.} -proc glClearColorIuiEXT*(r: GLuint, g: GLuint, b: GLuint, a: GLuint){.stdcall, importc, ogl.} -proc glTexParameterIivEXT*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glTexParameterIuivEXT*(target: GLenum, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} -proc glGetTexParameterIivEXT*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetTexParameterIiuvEXT*(target: GLenum, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} - # GL_HP_image_transform -proc glImageTransformParameteriHP*(target: GLenum, pname: GLenum, param: GLint){. - stdcall, importc, ogl.} -proc glImageTransformParameterfHP*(target: GLenum, pname: GLenum, param: GLfloat){. - stdcall, importc, ogl.} -proc glImageTransformParameterivHP*(target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glImageTransformParameterfvHP*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetImageTransformParameterivHP*(target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetImageTransformParameterfvHP*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} - # GL_EXT_depth_bounds_test -proc glDepthBoundsEXT*(zmin: GLclampd, zmax: GLclampd){.stdcall, importc, ogl.} - # GL_EXT_blend_equation_separate -proc glBlendEquationSeparateEXT*(modeRGB: GLenum, modeAlpha: GLenum){.stdcall, importc, ogl.} - # GL_EXT_transform_feedback -proc glBeginTransformFeedbackEXT*(primitiveMode: GLenum){.stdcall, importc, ogl.} -proc glEndTransformFeedbackEXT*(){.stdcall, importc, ogl.} -proc glBindBufferRangeEXT*(target: GLenum, index: GLuint, buffer: GLuint, - offset: GLintptr, size: GLsizeiptr){.stdcall, importc, ogl.} -proc glBindBufferOffsetEXT*(target: GLenum, index: GLuint, buffer: GLuint, - offset: GLintptr){.stdcall, importc, ogl.} -proc glBindBufferBaseEXT*(target: GLenum, index: GLuint, buffer: GLuint){. - stdcall, importc, ogl.} -proc glTransformFeedbackVaryingsEXT*(prog: GLuint, count: GLsizei, - locations: PGLint, bufferMode: GLenum){. - stdcall, importc, ogl.} -proc glGetTransformFeedbackVaryingEXT*(prog: GLuint, index: GLuint, - location: PGLint){.stdcall, importc, ogl.} - # GL_EXT_direct_state_access -proc glClientAttribDefaultEXT*(mask: GLbitfield){.stdcall, importc, ogl.} -proc glPushClientAttribDefaultEXT*(mask: GLbitfield){.stdcall, importc, ogl.} -proc glMatrixLoadfEXT*(mode: GLenum, m: PGLfloat){.stdcall, importc, ogl.} -proc glMatrixLoaddEXT*(mode: GLenum, m: PGLdouble){.stdcall, importc, ogl.} -proc glMatrixMultfEXT*(mode: GLenum, m: PGLfloat){.stdcall, importc, ogl.} -proc glMatrixMultdEXT*(mode: GLenum, m: PGLdouble){.stdcall, importc, ogl.} -proc glMatrixLoadIdentityEXT*(mode: GLenum){.stdcall, importc, ogl.} -proc glMatrixRotatefEXT*(mode: GLenum, angle: GLfloat, x: GLfloat, y: GLfloat, - z: GLfloat){.stdcall, importc, ogl.} -proc glMatrixRotatedEXT*(mode: GLenum, angle: GLdouble, x: GLdouble, - y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glMatrixScalefEXT*(mode: GLenum, x: GLfloat, y: GLfloat, z: GLfloat){. - stdcall, importc, ogl.} -proc glMatrixScaledEXT*(mode: GLenum, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glMatrixTranslatefEXT*(mode: GLenum, x: GLfloat, y: GLfloat, z: GLfloat){. - stdcall, importc, ogl.} -proc glMatrixTranslatedEXT*(mode: GLenum, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glMatrixFrustumEXT*(mode: GLenum, left: GLdouble, right: GLdouble, - bottom: GLdouble, top: GLdouble, zNear: GLdouble, - zFar: GLdouble){.stdcall, importc, ogl.} -proc glMatrixOrthoEXT*(mode: GLenum, left: GLdouble, right: GLdouble, - bottom: GLdouble, top: GLdouble, zNear: GLdouble, - zFar: GLdouble){.stdcall, importc, ogl.} -proc glMatrixPopEXT*(mode: GLenum){.stdcall, importc, ogl.} -proc glMatrixPushEXT*(mode: GLenum){.stdcall, importc, ogl.} -proc glMatrixLoadTransposefEXT*(mode: GLenum, m: PGLfloat){.stdcall, importc, ogl.} -proc glMatrixLoadTransposedEXT*(mode: GLenum, m: PGLdouble){.stdcall, importc, ogl.} -proc glMatrixMultTransposefEXT*(mode: GLenum, m: PGLfloat){.stdcall, importc, ogl.} -proc glMatrixMultTransposedEXT*(mode: GLenum, m: PGLdouble){.stdcall, importc, ogl.} -proc glTextureParameterfEXT*(texture: GLuint, target: GLenum, pname: GLenum, - param: GLfloat){.stdcall, importc, ogl.} -proc glTextureParameterfvEXT*(texture: GLuint, target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glTextureParameteriEXT*(texture: GLuint, target: GLenum, pname: GLenum, - param: GLint){.stdcall, importc, ogl.} -proc glTextureParameterivEXT*(texture: GLuint, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glTextureImage1DEXT*(texture: GLuint, target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, border: GLint, - format: GLenum, typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTextureImage2DEXT*(texture: GLuint, target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - height: GLsizei, border: GLint, format: GLenum, - typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTextureSubImage1DEXT*(texture: GLuint, target: GLenum, level: GLint, - xoffset: GLint, width: GLsizei, format: GLenum, - typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTextureSubImage2DEXT*(texture: GLuint, target: GLenum, level: GLint, - xoffset: GLint, yoffset: GLint, width: GLsizei, - height: GLsizei, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glCopyTextureImage1DEXT*(texture: GLuint, target: GLenum, level: GLint, - internalformat: GLenum, x: GLint, y: GLint, - width: GLsizei, border: GLint){.stdcall, importc, ogl.} -proc glCopyTextureImage2DEXT*(texture: GLuint, target: GLenum, level: GLint, - internalformat: GLenum, x: GLint, y: GLint, - width: GLsizei, height: GLsizei, border: GLint){. - stdcall, importc, ogl.} -proc glCopyTextureSubImage1DEXT*(texture: GLuint, target: GLenum, level: GLint, - xoffset: GLint, x: GLint, y: GLint, - width: GLsizei){.stdcall, importc, ogl.} -proc glCopyTextureSubImage2DEXT*(texture: GLuint, target: GLenum, level: GLint, - xoffset: GLint, yoffset: GLint, x: GLint, - y: GLint, width: GLsizei, height: GLsizei){. - stdcall, importc, ogl.} -proc glGetTextureImageEXT*(texture: GLuint, target: GLenum, level: GLint, - format: GLenum, typ: GLenum, pixels: PGLvoid){. - stdcall, importc, ogl.} -proc glGetTextureParameterfvEXT*(texture: GLuint, target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetTextureParameterivEXT*(texture: GLuint, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetTextureLevelParameterfvEXT*(texture: GLuint, target: GLenum, - level: GLint, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetTextureLevelParameterivEXT*(texture: GLuint, target: GLenum, - level: GLint, pname: GLenum, params: GLint){. - stdcall, importc, ogl.} -proc glTextureImage3DEXT*(texture: GLuint, target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - height: GLsizei, depth: GLsizei, border: GLint, - format: GLenum, typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTextureSubImage3DEXT*(texture: GLuint, target: GLenum, level: GLint, - xoffset: GLint, yoffset: GLint, zoffset: GLint, - width: GLsizei, height: GLsizei, depth: GLsizei, - format: GLenum, typ: GLenum, pixels: PGLvoid){. - stdcall, importc, ogl.} -proc glCopyTextureSubImage3DEXT*(texture: GLuint, target: GLenum, level: GLint, - xoffset: GLint, yoffset: GLint, zoffset: GLint, - x: GLint, y: GLint, width: GLsizei, - height: GLsizei){.stdcall, importc, ogl.} -proc glMultiTexParameterfEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - param: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexParameterfvEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexParameteriEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - param: GLint){.stdcall, importc, ogl.} -proc glMultiTexParameterivEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glMultiTexImage1DEXT*(texunit: GLenum, target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - border: GLint, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glMultiTexImage2DEXT*(texunit: GLenum, target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - height: GLsizei, border: GLint, format: GLenum, - typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glMultiTexSubImage1DEXT*(texunit: GLenum, target: GLenum, level: GLint, - xoffset: GLint, width: GLsizei, format: GLenum, - typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glMultiTexSubImage2DEXT*(texunit: GLenum, target: GLenum, level: GLint, - xoffset: GLint, yoffset: GLint, width: GLsizei, - height: GLsizei, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} -proc glCopyMultiTexImage1DEXT*(texunit: GLenum, target: GLenum, level: GLint, - internalformat: GLenum, x: GLint, y: GLint, - width: GLsizei, border: GLint){.stdcall, importc, ogl.} -proc glCopyMultiTexImage2DEXT*(texunit: GLenum, target: GLenum, level: GLint, - internalformat: GLenum, x: GLint, y: GLint, - width: GLsizei, height: GLsizei, border: GLint){. - stdcall, importc, ogl.} -proc glCopyMultiTexSubImage1DEXT*(texunit: GLenum, target: GLenum, level: GLint, - xoffset: GLint, x: GLint, y: GLint, - width: GLsizei){.stdcall, importc, ogl.} -proc glCopyMultiTexSubImage2DEXT*(texunit: GLenum, target: GLenum, level: GLint, - xoffset: GLint, yoffset: GLint, x: GLint, - y: GLint, width: GLsizei, height: GLsizei){. - stdcall, importc, ogl.} -proc glGetMultiTexImageEXT*(texunit: GLenum, target: GLenum, level: GLint, - format: GLenum, typ: GLenum, pixels: PGLvoid){. - stdcall, importc, ogl.} -proc glGetMultiTexParameterfvEXT*(texunit: GLenum, target: GLenum, - pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetMultiTexParameterivEXT*(texunit: GLenum, target: GLenum, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetMultiTexLevelParameterfvEXT*(texunit: GLenum, target: GLenum, - level: GLint, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetMultiTexLevelParameterivEXT*(texunit: GLenum, target: GLenum, - level: GLint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glMultiTexImage3DEXT*(texunit: GLenum, target: GLenum, level: GLint, - internalformat: GLenum, width: GLsizei, - height: GLsizei, depth: GLsizei, border: GLint, - format: GLenum, typ: GLenum, pixels: PGLvoid){. - stdcall, importc, ogl.} -proc glMultiTexSubImage3DEXT*(texunit: GLenum, target: GLenum, level: GLint, - xoffset: GLint, yoffset: GLint, zoffset: GLint, - width: GLsizei, height: GLsizei, depth: GLsizei, - format: GLenum, typ: GLenum, pixels: PGLvoid){. - stdcall, importc, ogl.} -proc glCopyMultiTexSubImage3DEXT*(texunit: GLenum, target: GLenum, level: GLint, - xoffset: GLint, yoffset: GLint, - zoffset: GLint, x: GLint, y: GLint, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glBindMultiTextureEXT*(texunit: GLenum, target: GLenum, texture: GLuint){. - stdcall, importc, ogl.} -proc glEnableClientStateIndexedEXT*(arr: GLenum, index: GLuint){.stdcall, importc, ogl.} -proc glDisableClientStateIndexedEXT*(arr: GLenum, index: GLuint){.stdcall, importc, ogl.} -proc glMultiTexCoordPointerEXT*(texunit: GLenum, size: GLint, typ: GLenum, - stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glMultiTexEnvfEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - param: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexEnvfvEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexEnviEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - param: GLint){.stdcall, importc, ogl.} -proc glMultiTexEnvivEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glMultiTexGendEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - param: GLdouble){.stdcall, importc, ogl.} -proc glMultiTexGendvEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLdouble){.stdcall, importc, ogl.} -proc glMultiTexGenfEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - param: GLfloat){.stdcall, importc, ogl.} -proc glMultiTexGenfvEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glMultiTexGeniEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - param: GLint){.stdcall, importc, ogl.} -proc glMultiTexGenivEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetMultiTexEnvfvEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetMultiTexEnvivEXT*(texunit: GLenum, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetMultiTexGendvEXT*(texunit: GLenum, coord: GLenum, pname: GLenum, - params: PGLdouble){.stdcall, importc, ogl.} -proc glGetMultiTexGenfvEXT*(texunit: GLenum, coord: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetMultiTexGenivEXT*(texunit: GLenum, coord: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetFloatIndexedvEXT*(target: GLenum, index: GLuint, data: PGLfloat){. - stdcall, importc, ogl.} -proc glGetDoubleIndexedvEXT*(target: GLenum, index: GLuint, data: PGLdouble){. - stdcall, importc, ogl.} -proc glGetPointerIndexedvEXT*(target: GLenum, index: GLuint, data: PPGLvoid){. - stdcall, importc, ogl.} -proc glCompressedTextureImage3DEXT*(texture: GLuint, target: GLenum, - level: GLint, internalformat: GLenum, - width: GLsizei, height: GLsizei, - depth: GLsizei, border: GLint, - imageSize: GLsizei, bits: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTextureImage2DEXT*(texture: GLuint, target: GLenum, - level: GLint, internalformat: GLenum, - width: GLsizei, height: GLsizei, - border: GLint, imageSize: GLsizei, - bits: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTextureImage1DEXT*(texture: GLuint, target: GLenum, - level: GLint, internalformat: GLenum, - width: GLsizei, border: GLint, - imageSize: GLsizei, bits: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedTextureSubImage3DEXT*(texture: GLuint, target: GLenum, - level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, - width: GLsizei, height: GLsizei, - depth: GLsizei, format: GLenum, - imageSize: GLsizei, bits: PGLvoid){. - stdcall, importc, ogl.} -proc glCompressedTextureSubImage2DEXT*(texture: GLuint, target: GLenum, - level: GLint, xoffset: GLint, - yoffset: GLint, width: GLsizei, - height: GLsizei, format: GLenum, - imageSize: GLsizei, bits: PGLvoid){. - stdcall, importc, ogl.} -proc glCompressedTextureSubImage1DEXT*(texture: GLuint, target: GLenum, - level: GLint, xoffset: GLint, - width: GLsizei, format: GLenum, - imageSize: GLsizei, bits: PGLvoid){. - stdcall, importc, ogl.} -proc glGetCompressedTextureImageEXT*(texture: GLuint, target: GLenum, - lod: GLint, img: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedMultiTexImage3DEXT*(texunit: GLenum, target: GLenum, - level: GLint, internalformat: GLenum, - width: GLsizei, height: GLsizei, - depth: GLsizei, border: GLint, - imageSize: GLsizei, bits: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedMultiTexImage2DEXT*(texunit: GLenum, target: GLenum, - level: GLint, internalformat: GLenum, - width: GLsizei, height: GLsizei, - border: GLint, imageSize: GLsizei, - bits: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedMultiTexImage1DEXT*(texunit: GLenum, target: GLenum, - level: GLint, internalformat: GLenum, - width: GLsizei, border: GLint, - imageSize: GLsizei, bits: PGLvoid){.stdcall, importc, ogl.} -proc glCompressedMultiTexSubImage3DEXT*(texunit: GLenum, target: GLenum, - level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, - width: GLsizei, height: GLsizei, - depth: GLsizei, format: GLenum, - imageSize: GLsizei, bits: PGLvoid){. - stdcall, importc, ogl.} -proc glCompressedMultiTexSubImage2DEXT*(texunit: GLenum, target: GLenum, - level: GLint, xoffset: GLint, - yoffset: GLint, width: GLsizei, - height: GLsizei, format: GLenum, - imageSize: GLsizei, bits: PGLvoid){. - stdcall, importc, ogl.} -proc glCompressedMultiTexSubImage1DEXT*(texunit: GLenum, target: GLenum, - level: GLint, xoffset: GLint, - width: GLsizei, format: GLenum, - imageSize: GLsizei, bits: PGLvoid){. - stdcall, importc, ogl.} -proc glGetCompressedMultiTexImageEXT*(texunit: GLenum, target: GLenum, - lod: GLint, img: PGLvoid){.stdcall, importc, ogl.} -proc glNamedProgramStringEXT*(prog: GLuint, target: GLenum, format: GLenum, - length: GLsizei, string: PGLvoid){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameter4dEXT*(prog: GLuint, target: GLenum, - index: GLuint, x: GLdouble, y: GLdouble, - z: GLdouble, w: GLdouble){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameter4dvEXT*(prog: GLuint, target: GLenum, - index: GLuint, params: PGLdouble){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameter4fEXT*(prog: GLuint, target: GLenum, - index: GLuint, x: GLfloat, y: GLfloat, - z: GLfloat, w: GLfloat){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameter4fvEXT*(prog: GLuint, target: GLenum, - index: GLuint, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetNamedProgramLocalParameterdvEXT*(prog: GLuint, target: GLenum, - index: GLuint, params: PGLdouble){.stdcall, importc, ogl.} -proc glGetNamedProgramLocalParameterfvEXT*(prog: GLuint, target: GLenum, - index: GLuint, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetNamedProgramivEXT*(prog: GLuint, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetNamedProgramStringEXT*(prog: GLuint, target: GLenum, pname: GLenum, - string: PGLvoid){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameters4fvEXT*(prog: GLuint, target: GLenum, - index: GLuint, count: GLsizei, params: PGLfloat){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameterI4iEXT*(prog: GLuint, target: GLenum, - index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameterI4ivEXT*(prog: GLuint, target: GLenum, - index: GLuint, params: PGLint){.stdcall, importc, ogl.} -proc glNamedProgramLocalParametersI4ivEXT*(prog: GLuint, target: GLenum, - index: GLuint, count: GLsizei, params: PGLint){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameterI4uiEXT*(prog: GLuint, target: GLenum, - index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint){.stdcall, importc, ogl.} -proc glNamedProgramLocalParameterI4uivEXT*(prog: GLuint, target: GLenum, - index: GLuint, params: PGLuint){.stdcall, importc, ogl.} -proc glNamedProgramLocalParametersI4uivEXT*(prog: GLuint, target: GLenum, - index: GLuint, count: GLsizei, params: PGLuint){.stdcall, importc, ogl.} -proc glGetNamedProgramLocalParameterIivEXT*(prog: GLuint, target: GLenum, - index: GLuint, params: PGLint){.stdcall, importc, ogl.} -proc glGetNamedProgramLocalParameterIuivEXT*(prog: GLuint, target: GLenum, - index: GLuint, params: PGLuint){.stdcall, importc, ogl.} -proc glTextureParameterIivEXT*(texture: GLuint, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glTextureParameterIuivEXT*(texture: GLuint, target: GLenum, pname: GLenum, - params: PGLuint){.stdcall, importc, ogl.} -proc glGetTextureParameterIivEXT*(texture: GLuint, target: GLenum, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetTextureParameterIuivEXT*(texture: GLuint, target: GLenum, - pname: GLenum, params: PGLuint){.stdcall, importc, ogl.} -proc glMultiTexParameterIivEXT*(texture: GLuint, target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glMultiTexParameterIuivEXT*(texture: GLuint, target: GLenum, pname: GLenum, - params: PGLuint){.stdcall, importc, ogl.} -proc glGetMultiTexParameterIivEXT*(texture: GLuint, target: GLenum, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetMultiTexParameterIuivEXT*(texture: GLuint, target: GLenum, - pname: GLenum, params: PGLuint){.stdcall, importc, ogl.} -proc glProgramUniform1fEXT*(prog: GLuint, location: GLint, v0: GLfloat){.stdcall, importc, ogl.} -proc glProgramUniform2fEXT*(prog: GLuint, location: GLint, v0: GLfloat, - v1: GLfloat){.stdcall, importc, ogl.} -proc glProgramUniform3fEXT*(prog: GLuint, location: GLint, v0: GLfloat, - v1: GLfloat, v2: GLfloat){.stdcall, importc, ogl.} -proc glProgramUniform4fEXT*(prog: GLuint, location: GLint, v0: GLfloat, - v1: GLfloat, v2: GLfloat, v3: GLfloat){.stdcall, importc, ogl.} -proc glProgramUniform1iEXT*(prog: GLuint, location: GLint, v0: GLint){.stdcall, importc, ogl.} -proc glProgramUniform2iEXT*(prog: GLuint, location: GLint, v0: GLint, v1: GLint){. - stdcall, importc, ogl.} -proc glProgramUniform3iEXT*(prog: GLuint, location: GLint, v0: GLint, v1: GLint, - v2: GLint){.stdcall, importc, ogl.} -proc glProgramUniform4iEXT*(prog: GLuint, location: GLint, v0: GLint, v1: GLint, - v2: GLint, v3: GLint){.stdcall, importc, ogl.} -proc glProgramUniform1fvEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform2fvEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform3fvEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform4fvEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform1ivEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint){.stdcall, importc, ogl.} -proc glProgramUniform2ivEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint){.stdcall, importc, ogl.} -proc glProgramUniform3ivEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint){.stdcall, importc, ogl.} -proc glProgramUniform4ivEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix3fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix4fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2x3fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix3x2fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2x4fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix4x2fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix3x4fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniformMatrix4x3fvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLfloat){.stdcall, importc, ogl.} -proc glProgramUniform1uiEXT*(prog: GLuint, location: GLint, v0: GLuint){.stdcall, importc, ogl.} -proc glProgramUniform2uiEXT*(prog: GLuint, location: GLint, v0: GLuint, - v1: GLuint){.stdcall, importc, ogl.} -proc glProgramUniform3uiEXT*(prog: GLuint, location: GLint, v0: GLuint, - v1: GLuint, v2: GLuint){.stdcall, importc, ogl.} -proc glProgramUniform4uiEXT*(prog: GLuint, location: GLint, v0: GLuint, - v1: GLuint, v2: GLuint, v3: GLuint){.stdcall, importc, ogl.} -proc glProgramUniform1uivEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint){.stdcall, importc, ogl.} -proc glProgramUniform2uivEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint){.stdcall, importc, ogl.} -proc glProgramUniform3uivEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint){.stdcall, importc, ogl.} -proc glProgramUniform4uivEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint){.stdcall, importc, ogl.} -proc glNamedBufferDataEXT*(buffer: GLuint, size: GLsizei, data: PGLvoid, - usage: GLenum){.stdcall, importc, ogl.} -proc glNamedBufferSubDataEXT*(buffer: GLuint, offset: GLintptr, - size: GLsizeiptr, data: PGLvoid){.stdcall, importc, ogl.} -proc glMapNamedBufferEXT*(buffer: GLuint, access: GLenum): PGLvoid{.stdcall, importc, ogl.} -proc glUnmapNamedBufferEXT*(buffer: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glMapNamedBufferRangeEXT*(buffer: GLuint, offset: GLintptr, - len: GLsizeiptr, access: GLbitfield): PGLvoid{. - stdcall, importc, ogl.} -proc glFlushMappedNamedBufferRangeEXT*(buffer: GLuint, offset: GLintptr, - len: GLsizeiptr){.stdcall, importc, ogl.} -proc glNamedCopyBufferSubDataEXT*(readBuffer: GLuint, writeBuffer: GLuint, - readOffset: GLintptr, writeOffset: GLintptr, - size: GLsizeiptr){.stdcall, importc, ogl.} -proc glGetNamedBufferParameterivEXT*(buffer: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetNamedBufferPointervEXT*(buffer: GLuint, pname: GLenum, - params: PPGLvoid){.stdcall, importc, ogl.} -proc glGetNamedBufferSubDataEXT*(buffer: GLuint, offset: GLintptr, - size: GLsizeiptr, data: PGLvoid){.stdcall, importc, ogl.} -proc glTextureBufferEXT*(texture: GLuint, target: GLenum, - internalformat: GLenum, buffer: GLuint){.stdcall, importc, ogl.} -proc glMultiTexBufferEXT*(texunit: GLenum, target: GLenum, interformat: GLenum, - buffer: GLuint){.stdcall, importc, ogl.} -proc glNamedRenderbufferStorageEXT*(renderbuffer: GLuint, interformat: GLenum, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glGetNamedRenderbufferParameterivEXT*(renderbuffer: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glCheckNamedFramebufferStatusEXT*(framebuffer: GLuint, target: GLenum): GLenum{. - stdcall, importc, ogl.} -proc glNamedFramebufferTexture1DEXT*(framebuffer: GLuint, attachment: GLenum, - textarget: GLenum, texture: GLuint, - level: GLint){.stdcall, importc, ogl.} -proc glNamedFramebufferTexture2DEXT*(framebuffer: GLuint, attachment: GLenum, - textarget: GLenum, texture: GLuint, - level: GLint){.stdcall, importc, ogl.} -proc glNamedFramebufferTexture3DEXT*(framebuffer: GLuint, attachment: GLenum, - textarget: GLenum, texture: GLuint, - level: GLint, zoffset: GLint){.stdcall, importc, ogl.} -proc glNamedFramebufferRenderbufferEXT*(framebuffer: GLuint, attachment: GLenum, - renderbuffertarget: GLenum, - renderbuffer: GLuint){.stdcall, importc, ogl.} -proc glGetNamedFramebufferAttachmentParameterivEXT*(framebuffer: GLuint, - attachment: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGenerateTextureMipmapEXT*(texture: GLuint, target: GLenum){.stdcall, importc, ogl.} -proc glGenerateMultiTexMipmapEXT*(texunit: GLenum, target: GLenum){.stdcall, importc, ogl.} -proc glFramebufferDrawBufferEXT*(framebuffer: GLuint, mode: GLenum){.stdcall, importc, ogl.} -proc glFramebufferDrawBuffersEXT*(framebuffer: GLuint, n: GLsizei, bufs: PGLenum){. - stdcall, importc, ogl.} -proc glFramebufferReadBufferEXT*(framebuffer: GLuint, mode: GLenum){.stdcall, importc, ogl.} -proc glGetFramebufferParameterivEXT*(framebuffer: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glNamedRenderbufferStorageMultisampleEXT*(renderbuffer: GLuint, - samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei){. - stdcall, importc, ogl.} -proc glNamedRenderbufferStorageMultisampleCoverageEXT*(renderbuffer: GLuint, - coverageSamples: GLsizei, colorSamples: GLsizei, internalformat: GLenum, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} -proc glNamedFramebufferTextureEXT*(framebuffer: GLuint, attachment: GLenum, - texture: GLuint, level: GLint){.stdcall, importc, ogl.} -proc glNamedFramebufferTextureLayerEXT*(framebuffer: GLuint, attachment: GLenum, - texture: GLuint, level: GLint, - layer: GLint){.stdcall, importc, ogl.} -proc glNamedFramebufferTextureFaceEXT*(framebuffer: GLuint, attachment: GLenum, - texture: GLuint, level: GLint, - face: GLenum){.stdcall, importc, ogl.} -proc glTextureRenderbufferEXT*(texture: GLuint, target: GLenum, - renderbuffer: GLuint){.stdcall, importc, ogl.} -proc glMultiTexRenderbufferEXT*(texunit: GLenum, target: GLenum, - renderbuffer: GLuint){.stdcall, importc, ogl.} -proc glProgramUniform1dEXT*(prog: GLuint, location: GLint, x: GLdouble){.stdcall, importc, ogl.} -proc glProgramUniform2dEXT*(prog: GLuint, location: GLint, x: GLdouble, - y: GLdouble){.stdcall, importc, ogl.} -proc glProgramUniform3dEXT*(prog: GLuint, location: GLint, x: GLdouble, - y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glProgramUniform4dEXT*(prog: GLuint, location: GLint, x: GLdouble, - y: GLdouble, z: GLdouble, w: GLdouble){.stdcall, importc, ogl.} -proc glProgramUniform1dvEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniform2dvEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniform3dvEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniform4dvEXT*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix3dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix4dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2x3dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix2x4dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix3x2dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix3x4dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix4x2dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} -proc glProgramUniformMatrix4x3dvEXT*(prog: GLuint, location: GLint, - count: GLsizei, transpose: GLboolean, - value: PGLdouble){.stdcall, importc, ogl.} - # GL_EXT_separate_shader_objects -proc glUseShaderProgramEXT*(typ: GLenum, prog: GLuint){.stdcall, importc, ogl.} -proc glActiveProgramEXT*(prog: GLuint){.stdcall, importc, ogl.} -proc glCreateShaderProgramEXT*(typ: GLenum, string: PGLchar): GLuint{.stdcall, importc, ogl.} - # GL_EXT_shader_image_load_store -proc glBindImageTextureEXT*(index: GLuint, texture: GLuint, level: GLint, - layered: GLboolean, layer: GLint, access: GLenum, - format: GLint){.stdcall, importc, ogl.} -proc glMemoryBarrierEXT*(barriers: GLbitfield){.stdcall, importc, ogl.} - # GL_EXT_vertex_attrib_64bit -proc glVertexAttribL1dEXT*(index: GLuint, x: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL2dEXT*(index: GLuint, x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL3dEXT*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glVertexAttribL4dEXT*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, - w: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL1dvEXT*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL2dvEXT*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL3dvEXT*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribL4dvEXT*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribLPointerEXT*(index: GLuint, size: GLint, typ: GLenum, - stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glGetVertexAttribLdvEXT*(index: GLuint, pname: GLenum, params: PGLdouble){. - stdcall, importc, ogl.} -proc glVertexArrayVertexAttribLOffsetEXT*(vaobj: GLuint, buffer: GLuint, - index: GLuint, size: GLint, typ: GLenum, stride: GLsizei, offset: GLintptr){. - stdcall, importc, ogl.} - # GL_IBM_multimode_draw_arrays -proc glMultiModeDrawArraysIBM*(mode: GLenum, first: PGLint, count: PGLsizei, - primcount: GLsizei, modestride: GLint){.stdcall, importc, ogl.} -proc glMultiModeDrawElementsIBM*(mode: PGLenum, count: PGLsizei, typ: GLenum, - indices: PGLvoid, primcount: GLsizei, - modestride: GLint){.stdcall, importc, ogl.} - # GL_IBM_vertex_array_lists -proc glColorPointerListIBM*(size: GLint, typ: GLenum, stride: GLint, - pointer: PGLvoid, ptrstride: GLint){.stdcall, importc, ogl.} -proc glSecondaryColorPointerListIBM*(size: GLint, typ: GLenum, stride: GLint, - pointer: PGLvoid, ptrstride: GLint){. - stdcall, importc, ogl.} -proc glEdgeFlagPointerListIBM*(stride: GLint, pointer: PGLboolean, - ptrstride: GLint){.stdcall, importc, ogl.} -proc glFogCoordPointerListIBM*(typ: GLenum, stride: GLint, pointer: PGLvoid, - ptrstride: GLint){.stdcall, importc, ogl.} -proc glIndexPointerListIBM*(typ: GLenum, stride: GLint, pointer: PGLvoid, - ptrstride: GLint){.stdcall, importc, ogl.} -proc glNormalPointerListIBM*(typ: GLenum, stride: GLint, pointer: PGLvoid, - ptrstride: GLint){.stdcall, importc, ogl.} -proc glTexCoordPointerListIBM*(size: GLint, typ: GLenum, stride: GLint, - pointer: PGLvoid, ptrstride: GLint){.stdcall, importc, ogl.} -proc glVertexPointerListIBM*(size: GLint, typ: GLenum, stride: GLint, - pointer: PGLvoid, ptrstride: GLint){.stdcall, importc, ogl.} - # GL_INGR_blend_func_separate -proc glBlendFuncSeparateINGR*(sfactorRGB: GLenum, dfactorRGB: GLenum, - sfactorAlpha: GLenum, dfactorAlpha: GLenum){. - stdcall, importc, ogl.} - # GL_INTEL_parallel_arrays -proc glVertexPointervINTEL*(size: GLint, typ: GLenum, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glNormalPointervINTEL*(typ: GLenum, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glColorPointervINTEL*(size: GLint, typ: GLenum, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glTexCoordPointervINTEL*(size: GLint, typ: GLenum, pointer: PGLvoid){. - stdcall, importc, ogl.} - # GL_MESA_resize_buffers -proc glResizeBuffersMESA*(){.stdcall, importc, ogl.} - # GL_MESA_window_pos -proc glWindowPos2dMESA*(x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glWindowPos2dvMESA*(v: PGLdouble){.stdcall, importc, ogl.} -proc glWindowPos2fMESA*(x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glWindowPos2fvMESA*(v: PGLfloat){.stdcall, importc, ogl.} -proc glWindowPos2iMESA*(x: GLint, y: GLint){.stdcall, importc, ogl.} -proc glWindowPos2ivMESA*(v: PGLint){.stdcall, importc, ogl.} -proc glWindowPos2sMESA*(x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glWindowPos2svMESA*(v: PGLshort){.stdcall, importc, ogl.} -proc glWindowPos3dMESA*(x: GLdouble, y: GLdouble, z: GLdouble){.stdcall, importc, ogl.} -proc glWindowPos3dvMESA*(v: PGLdouble){.stdcall, importc, ogl.} -proc glWindowPos3fMESA*(x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glWindowPos3fvMESA*(v: PGLfloat){.stdcall, importc, ogl.} -proc glWindowPos3iMESA*(x: GLint, y: GLint, z: GLint){.stdcall, importc, ogl.} -proc glWindowPos3ivMESA*(v: PGLint){.stdcall, importc, ogl.} -proc glWindowPos3sMESA*(x: GLshort, y: GLshort, z: GLshort){.stdcall, importc, ogl.} -proc glWindowPos3svMESA*(v: PGLshort){.stdcall, importc, ogl.} -proc glWindowPos4dMESA*(x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble){. - stdcall, importc, ogl.} -proc glWindowPos4dvMESA*(v: PGLdouble){.stdcall, importc, ogl.} -proc glWindowPos4fMESA*(x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat){.stdcall, importc, ogl.} -proc glWindowPos4fvMESA*(v: PGLfloat){.stdcall, importc, ogl.} -proc glWindowPos4iMESA*(x: GLint, y: GLint, z: GLint, w: GLint){.stdcall, importc, ogl.} -proc glWindowPos4ivMESA*(v: PGLint){.stdcall, importc, ogl.} -proc glWindowPos4sMESA*(x: GLshort, y: GLshort, z: GLshort, w: GLshort){.stdcall, importc, ogl.} -proc glWindowPos4svMESA*(v: PGLshort){.stdcall, importc, ogl.} - # GL_NV_evaluators -proc glMapControlPointsNV*(target: GLenum, index: GLuint, typ: GLenum, - ustride: GLsizei, vstride: GLsizei, uorder: GLint, - vorder: GLint, pack: GLboolean, points: PGLvoid){. - stdcall, importc, ogl.} -proc glMapParameterivNV*(target: GLenum, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glMapParameterfvNV*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetMapControlPointsNV*(target: GLenum, index: GLuint, typ: GLenum, - ustride: GLsizei, vstride: GLsizei, - pack: GLboolean, points: PGLvoid){.stdcall, importc, ogl.} -proc glGetMapParameterivNV*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetMapParameterfvNV*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetMapAttribParameterivNV*(target: GLenum, index: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetMapAttribParameterfvNV*(target: GLenum, index: GLuint, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glEvalMapsNV*(target: GLenum, mode: GLenum){.stdcall, importc, ogl.} - # GL_NV_fence -proc glDeleteFencesNV*(n: GLsizei, fences: PGLuint){.stdcall, importc, ogl.} -proc glGenFencesNV*(n: GLsizei, fences: PGLuint){.stdcall, importc, ogl.} -proc glIsFenceNV*(fence: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glTestFenceNV*(fence: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glGetFenceivNV*(fence: GLuint, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glFinishFenceNV*(fence: GLuint){.stdcall, importc, ogl.} -proc glSetFenceNV*(fence: GLuint, condition: GLenum){.stdcall, importc, ogl.} - # GL_NV_fragment_prog -proc glProgramNamedParameter4fNV*(id: GLuint, length: GLsizei, name: PGLubyte, - x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat){. - stdcall, importc, ogl.} -proc glProgramNamedParameter4dNV*(id: GLuint, length: GLsizei, name: PGLubyte, - x: GLdouble, y: GLdouble, z: GLdouble, - w: GLdouble){.stdcall, importc, ogl.} -proc glProgramNamedParameter4fvNV*(id: GLuint, length: GLsizei, name: PGLubyte, - v: PGLfloat){.stdcall, importc, ogl.} -proc glProgramNamedParameter4dvNV*(id: GLuint, length: GLsizei, name: PGLubyte, - v: PGLdouble){.stdcall, importc, ogl.} -proc glGetProgramNamedParameterfvNV*(id: GLuint, length: GLsizei, - name: PGLubyte, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetProgramNamedParameterdvNV*(id: GLuint, length: GLsizei, - name: PGLubyte, params: PGLdouble){.stdcall, importc, ogl.} - # GL_NV_half_float -proc glVertex2hNV*(x: GLhalfNV, y: GLhalfNV){.stdcall, importc, ogl.} -proc glVertex2hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertex3hNV*(x: GLhalfNV, y: GLhalfNV, z: GLhalfNV){.stdcall, importc, ogl.} -proc glVertex3hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertex4hNV*(x: GLhalfNV, y: GLhalfNV, z: GLhalfNV, w: GLhalfNV){.stdcall, importc, ogl.} -proc glVertex4hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glNormal3hNV*(nx: GLhalfNV, ny: GLhalfNV, nz: GLhalfNV){.stdcall, importc, ogl.} -proc glNormal3hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glColor3hNV*(red: GLhalfNV, green: GLhalfNV, blue: GLhalfNV){.stdcall, importc, ogl.} -proc glColor3hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glColor4hNV*(red: GLhalfNV, green: GLhalfNV, blue: GLhalfNV, - alpha: GLhalfNV){.stdcall, importc, ogl.} -proc glColor4hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glTexCoord1hNV*(s: GLhalfNV){.stdcall, importc, ogl.} -proc glTexCoord1hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glTexCoord2hNV*(s: GLhalfNV, t: GLhalfNV){.stdcall, importc, ogl.} -proc glTexCoord2hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glTexCoord3hNV*(s: GLhalfNV, t: GLhalfNV, r: GLhalfNV){.stdcall, importc, ogl.} -proc glTexCoord3hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glTexCoord4hNV*(s: GLhalfNV, t: GLhalfNV, r: GLhalfNV, q: GLhalfNV){. - stdcall, importc, ogl.} -proc glTexCoord4hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glMultiTexCoord1hNV*(target: GLenum, s: GLhalfNV){.stdcall, importc, ogl.} -proc glMultiTexCoord1hvNV*(target: GLenum, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glMultiTexCoord2hNV*(target: GLenum, s: GLhalfNV, t: GLhalfNV){.stdcall, importc, ogl.} -proc glMultiTexCoord2hvNV*(target: GLenum, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glMultiTexCoord3hNV*(target: GLenum, s: GLhalfNV, t: GLhalfNV, r: GLhalfNV){. - stdcall, importc, ogl.} -proc glMultiTexCoord3hvNV*(target: GLenum, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glMultiTexCoord4hNV*(target: GLenum, s: GLhalfNV, t: GLhalfNV, r: GLhalfNV, - q: GLhalfNV){.stdcall, importc, ogl.} -proc glMultiTexCoord4hvNV*(target: GLenum, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glFogCoordhNV*(fog: GLhalfNV){.stdcall, importc, ogl.} -proc glFogCoordhvNV*(fog: PGLhalfNV){.stdcall, importc, ogl.} -proc glSecondaryColor3hNV*(red: GLhalfNV, green: GLhalfNV, blue: GLhalfNV){. - stdcall, importc, ogl.} -proc glSecondaryColor3hvNV*(v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexWeighthNV*(weight: GLhalfNV){.stdcall, importc, ogl.} -proc glVertexWeighthvNV*(weight: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttrib1hNV*(index: GLuint, x: GLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttrib1hvNV*(index: GLuint, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttrib2hNV*(index: GLuint, x: GLhalfNV, y: GLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttrib2hvNV*(index: GLuint, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttrib3hNV*(index: GLuint, x: GLhalfNV, y: GLhalfNV, z: GLhalfNV){. - stdcall, importc, ogl.} -proc glVertexAttrib3hvNV*(index: GLuint, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttrib4hNV*(index: GLuint, x: GLhalfNV, y: GLhalfNV, z: GLhalfNV, - w: GLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttrib4hvNV*(index: GLuint, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttribs1hvNV*(index: GLuint, n: GLsizei, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttribs2hvNV*(index: GLuint, n: GLsizei, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttribs3hvNV*(index: GLuint, n: GLsizei, v: PGLhalfNV){.stdcall, importc, ogl.} -proc glVertexAttribs4hvNV*(index: GLuint, n: GLsizei, v: PGLhalfNV){.stdcall, importc, ogl.} - # GL_NV_occlusion_query -proc glGenOcclusionQueriesNV*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glDeleteOcclusionQueriesNV*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glIsOcclusionQueryNV*(id: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glBeginOcclusionQueryNV*(id: GLuint){.stdcall, importc, ogl.} -proc glEndOcclusionQueryNV*(){.stdcall, importc, ogl.} -proc glGetOcclusionQueryivNV*(id: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetOcclusionQueryuivNV*(id: GLuint, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} - # GL_NV_pixel_data_range -proc glPixelDataRangeNV*(target: GLenum, len: GLsizei, pointer: PGLvoid){. - stdcall, importc, ogl.} -proc glFlushPixelDataRangeNV*(target: GLenum){.stdcall, importc, ogl.} - # GL_NV_point_sprite -proc glPointParameteriNV*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glPointParameterivNV*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} - # GL_NV_primitive_restart -proc glPrimitiveRestartNV*(){.stdcall, importc, ogl.} -proc glPrimitiveRestartIndexNV*(index: GLuint){.stdcall, importc, ogl.} - # GL_NV_register_combiners -proc glCombinerParameterfvNV*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glCombinerParameterfNV*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glCombinerParameterivNV*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glCombinerParameteriNV*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glCombinerInputNV*(stage: GLenum, portion: GLenum, variable: GLenum, - input: GLenum, mapping: GLenum, componentUsage: GLenum){. - stdcall, importc, ogl.} -proc glCombinerOutputNV*(stage: GLenum, portion: GLenum, abOutput: GLenum, - cdOutput: GLenum, sumOutput: GLenum, scale: GLenum, - bias: GLenum, abDotProduct: GLboolean, - cdDotProduct: GLboolean, muxSum: GLboolean){.stdcall, importc, ogl.} -proc glFinalCombinerInputNV*(variable: GLenum, input: GLenum, mapping: GLenum, - componentUsage: GLenum){.stdcall, importc, ogl.} -proc glGetCombinerInputParameterfvNV*(stage: GLenum, portion: GLenum, - variable: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetCombinerInputParameterivNV*(stage: GLenum, portion: GLenum, - variable: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetCombinerOutputParameterfvNV*(stage: GLenum, portion: GLenum, - pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetCombinerOutputParameterivNV*(stage: GLenum, portion: GLenum, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetFinalCombinerInputParameterfvNV*(variable: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetFinalCombinerInputParameterivNV*(variable: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} - # GL_NV_register_combiners2 -proc glCombinerStageParameterfvNV*(stage: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetCombinerStageParameterfvNV*(stage: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} - # GL_NV_vertex_array_range -proc glFlushVertexArrayRangeNV*(){.stdcall, importc, ogl.} -proc glVertexArrayRangeNV*(len: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} - # GL_NV_vertex_prog -proc glAreProgramsResidentNV*(n: GLsizei, programs: PGLuint, - residences: PGLboolean): GLboolean{.stdcall, importc, ogl.} -proc glBindProgramNV*(target: GLenum, id: GLuint){.stdcall, importc, ogl.} -proc glDeleteProgramsNV*(n: GLsizei, programs: PGLuint){.stdcall, importc, ogl.} -proc glExecuteProgramNV*(target: GLenum, id: GLuint, params: PGLfloat){.stdcall, importc, ogl.} -proc glGenProgramsNV*(n: GLsizei, programs: PGLuint){.stdcall, importc, ogl.} -proc glGetProgramParameterdvNV*(target: GLenum, index: GLuint, pname: GLenum, - params: PGLdouble){.stdcall, importc, ogl.} -proc glGetProgramParameterfvNV*(target: GLenum, index: GLuint, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetProgramivNV*(id: GLuint, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetProgramStringNV*(id: GLuint, pname: GLenum, prog: PGLubyte){.stdcall, importc, ogl.} -proc glGetTrackMatrixivNV*(target: GLenum, address: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetVertexAttribdvNV*(index: GLuint, pname: GLenum, params: PGLdouble){. - stdcall, importc, ogl.} -proc glGetVertexAttribfvNV*(index: GLuint, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetVertexAttribivNV*(index: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetVertexAttribPointervNV*(index: GLuint, pname: GLenum, pointer: PGLvoid){. - stdcall, importc, ogl.} -proc glIsProgramNV*(id: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glLoadProgramNV*(target: GLenum, id: GLuint, length: GLsizei, - prog: PGLubyte){.stdcall, importc, ogl.} -proc glProgramParameter4dNV*(target: GLenum, index: GLuint, x: GLdouble, - y: GLdouble, z: GLdouble, w: GLdouble){.stdcall, importc, ogl.} -proc glProgramParameter4dvNV*(target: GLenum, index: GLuint, v: PGLdouble){. - stdcall, importc, ogl.} -proc glProgramParameter4fNV*(target: GLenum, index: GLuint, x: GLfloat, - y: GLfloat, z: GLfloat, w: GLfloat){.stdcall, importc, ogl.} -proc glProgramParameter4fvNV*(target: GLenum, index: GLuint, v: PGLfloat){. - stdcall, importc, ogl.} -proc glProgramParameters4dvNV*(target: GLenum, index: GLuint, count: GLuint, - v: PGLdouble){.stdcall, importc, ogl.} -proc glProgramParameters4fvNV*(target: GLenum, index: GLuint, count: GLuint, - v: PGLfloat){.stdcall, importc, ogl.} -proc glRequestResidentProgramsNV*(n: GLsizei, programs: PGLuint){.stdcall, importc, ogl.} -proc glTrackMatrixNV*(target: GLenum, address: GLuint, matrix: GLenum, - transform: GLenum){.stdcall, importc, ogl.} -proc glVertexAttribPointerNV*(index: GLuint, fsize: GLint, typ: GLenum, - stride: GLsizei, pointer: PGLvoid){.stdcall, importc, ogl.} -proc glVertexAttrib1dNV*(index: GLuint, x: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib1dvNV*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib1fNV*(index: GLuint, x: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib1fvNV*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib1sNV*(index: GLuint, x: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib1svNV*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib2dNV*(index: GLuint, x: GLdouble, y: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib2dvNV*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib2fNV*(index: GLuint, x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib2fvNV*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib2sNV*(index: GLuint, x: GLshort, y: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib2svNV*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib3dNV*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble){. - stdcall, importc, ogl.} -proc glVertexAttrib3dvNV*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib3fNV*(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat){. - stdcall, importc, ogl.} -proc glVertexAttrib3fvNV*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib3sNV*(index: GLuint, x: GLshort, y: GLshort, z: GLshort){. - stdcall, importc, ogl.} -proc glVertexAttrib3svNV*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4dNV*(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, - w: GLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib4dvNV*(index: GLuint, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttrib4fNV*(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, - w: GLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib4fvNV*(index: GLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttrib4sNV*(index: GLuint, x: GLshort, y: GLshort, z: GLshort, - w: GLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4svNV*(index: GLuint, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttrib4ubNV*(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, - w: GLubyte){.stdcall, importc, ogl.} -proc glVertexAttrib4ubvNV*(index: GLuint, v: PGLubyte){.stdcall, importc, ogl.} -proc glVertexAttribs1dvNV*(index: GLuint, count: GLsizei, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribs1fvNV*(index: GLuint, count: GLsizei, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttribs1svNV*(index: GLuint, count: GLsizei, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttribs2dvNV*(index: GLuint, count: GLsizei, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribs2fvNV*(index: GLuint, count: GLsizei, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttribs2svNV*(index: GLuint, count: GLsizei, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttribs3dvNV*(index: GLuint, count: GLsizei, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribs3fvNV*(index: GLuint, count: GLsizei, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttribs3svNV*(index: GLuint, count: GLsizei, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttribs4dvNV*(index: GLuint, count: GLsizei, v: PGLdouble){.stdcall, importc, ogl.} -proc glVertexAttribs4fvNV*(index: GLuint, count: GLsizei, v: PGLfloat){.stdcall, importc, ogl.} -proc glVertexAttribs4svNV*(index: GLuint, count: GLsizei, v: PGLshort){.stdcall, importc, ogl.} -proc glVertexAttribs4ubvNV*(index: GLuint, count: GLsizei, v: PGLubyte){.stdcall, importc, ogl.} - # GL_NV_depth_buffer_float -proc glDepthRangedNV*(n: GLdouble, f: GLdouble){.stdcall, importc, ogl.} -proc glClearDepthdNV*(d: GLdouble){.stdcall, importc, ogl.} -proc glDepthBoundsdNV*(zmin: GLdouble, zmax: GLdouble){.stdcall, importc, ogl.} - # GL_NV_framebuffer_multisample_coverage -proc glRenderbufferStorageMultsampleCoverageNV*(target: GLenum, - coverageSamples: GLsizei, colorSamples: GLsizei, internalformat: GLenum, - width: GLsizei, height: GLsizei){.stdcall, importc, ogl.} - # GL_NV_geometry_program4 -proc glProgramVertexLimitNV*(target: GLenum, limit: GLint){.stdcall, importc, ogl.} - # GL_NV_gpu_program4 -proc glProgramLocalParameterI4iNV*(target: GLenum, index: GLuint, x: GLint, - y: GLint, z: GLint, w: GLint){.stdcall, importc, ogl.} -proc glProgramLocalParameterI4ivNV*(target: GLenum, index: GLuint, - params: PGLint){.stdcall, importc, ogl.} -proc glProgramLocalParametersI4ivNV*(target: GLenum, index: GLuint, - count: GLsizei, params: PGLint){.stdcall, importc, ogl.} -proc glProgramLocalParameterI4uiNV*(target: GLenum, index: GLuint, x: GLuint, - y: GLuint, z: GLuint, w: GLuint){.stdcall, importc, ogl.} -proc glProgramLocalParameterI4uivNV*(target: GLenum, index: GLuint, - params: PGLuint){.stdcall, importc, ogl.} -proc glProgramLocalParametersI4uivNV*(target: GLenum, index: GLuint, - count: GLsizei, params: PGLuint){.stdcall, importc, ogl.} -proc glProgramEnvParameterI4iNV*(target: GLenum, index: GLuint, x: GLint, - y: GLint, z: GLint, w: GLint){.stdcall, importc, ogl.} -proc glProgramEnvParameterI4ivNV*(target: GLenum, index: GLuint, params: PGLint){. - stdcall, importc, ogl.} -proc glProgramEnvParametersI4ivNV*(target: GLenum, index: GLuint, - count: GLsizei, params: PGLint){.stdcall, importc, ogl.} -proc glProgramEnvParameterI4uiNV*(target: GLenum, index: GLuint, x: GLuint, - y: GLuint, z: GLuint, w: GLuint){.stdcall, importc, ogl.} -proc glProgramEnvParameterI4uivNV*(target: GLenum, index: GLuint, - params: PGLuint){.stdcall, importc, ogl.} -proc glProgramEnvParametersI4uivNV*(target: GLenum, index: GLuint, - count: GLsizei, params: PGLuint){.stdcall, importc, ogl.} -proc glGetProgramLocalParameterIivNV*(target: GLenum, index: GLuint, - params: PGLint){.stdcall, importc, ogl.} -proc glGetProgramLocalParameterIuivNV*(target: GLenum, index: GLuint, - params: PGLuint){.stdcall, importc, ogl.} -proc glGetProgramEnvParameterIivNV*(target: GLenum, index: GLuint, - params: PGLint){.stdcall, importc, ogl.} -proc glGetProgramEnvParameterIuivNV*(target: GLenum, index: GLuint, - params: PGLuint){.stdcall, importc, ogl.} - # GL_NV_parameter_buffer_object -proc glProgramBufferParametersfvNV*(target: GLenum, buffer: GLuint, - index: GLuint, count: GLsizei, - params: PGLfloat){.stdcall, importc, ogl.} -proc glProgramBufferParametersIivNV*(target: GLenum, buffer: GLuint, - index: GLuint, count: GLsizei, - params: GLint){.stdcall, importc, ogl.} -proc glProgramBufferParametersIuivNV*(target: GLenum, buffer: GLuint, - index: GLuint, count: GLuint, - params: PGLuint){.stdcall, importc, ogl.} - # GL_NV_transform_feedback -proc glBeginTransformFeedbackNV*(primitiveMode: GLenum){.stdcall, importc, ogl.} -proc glEndTransformFeedbackNV*(){.stdcall, importc, ogl.} -proc glTransformFeedbackAttribsNV*(count: GLsizei, attribs: GLint, - bufferMode: GLenum){.stdcall, importc, ogl.} -proc glBindBufferRangeNV*(target: GLenum, index: GLuint, buffer: GLuint, - offset: GLintptr, size: GLsizeiptr){.stdcall, importc, ogl.} -proc glBindBufferOffsetNV*(target: GLenum, index: GLuint, buffer: GLuint, - offset: GLintptr){.stdcall, importc, ogl.} -proc glBindBufferBaseNV*(target: GLenum, index: GLuint, buffer: GLuint){.stdcall, importc, ogl.} -proc glTransformFeedbackVaryingsNV*(prog: GLuint, count: GLsizei, - locations: PGLint, bufferMode: GLenum){. - stdcall, importc, ogl.} -proc glActiveVaryingNV*(prog: GLuint, name: PGLchar){.stdcall, importc, ogl.} -proc glGetVaryingLocationNV*(prog: GLuint, name: PGLchar): GLint{.stdcall, importc, ogl.} -proc glGetActiveVaryingNV*(prog: GLuint, index: GLuint, bufSize: GLsizei, - len: PGLsizei, size: PGLsizei, typ: PGLenum, - name: PGLchar){.stdcall, importc, ogl.} -proc glGetTransformFeedbackVaryingNV*(prog: GLuint, index: GLuint, - location: PGLint){.stdcall, importc, ogl.} -proc glTransformFeedbackStreamAttribsNV*(count: GLsizei, attribs: PGLint, - nbuffers: GLsizei, bufstreams: PGLint, bufferMode: GLenum){.stdcall, importc, ogl.} - # GL_NV_conditional_render -proc glBeginConditionalRenderNV*(id: GLuint, mode: GLenum){.stdcall, importc, ogl.} -proc glEndConditionalRenderNV*(){.stdcall, importc, ogl.} - # GL_NV_present_video -proc glPresentFrameKeyedNV*(video_slot: GLuint, minPresentTime: GLuint64EXT, - beginPresentTimeId: GLuint, - presentDuratioId: GLuint, typ: GLenum, - target0: GLenum, fill0: GLuint, key0: GLuint, - target1: GLenum, fill1: GLuint, key1: GLuint){. - stdcall, importc, ogl.} -proc glPresentFrameDualFillNV*(video_slot: GLuint, minPresentTime: GLuint64EXT, - beginPresentTimeId: GLuint, - presentDurationId: GLuint, typ: GLenum, - target0: GLenum, fill0: GLuint, target1: GLenum, - fill1: GLuint, target2: GLenum, fill2: GLuint, - target3: GLenum, fill3: GLuint){.stdcall, importc, ogl.} -proc glGetVideoivNV*(video_slot: GLuint, pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetVideouivNV*(video_slot: GLuint, pname: GLenum, params: PGLuint){. - stdcall, importc, ogl.} -proc glGetVideoi64vNV*(video_slot: GLuint, pname: GLenum, params: PGLint64EXT){. - stdcall, importc, ogl.} -proc glGetVideoui64vNV*(video_slot: GLuint, pname: GLenum, params: PGLuint64EXT){. - stdcall, importc, ogl.} - #procedure glVideoParameterivNV(video_slot: GLuint; pname: GLenum; const params: PGLint); stdcall, importc, ogl; - # GL_NV_explicit_multisample -proc glGetMultisamplefvNV*(pname: GLenum, index: GLuint, val: PGLfloat){.stdcall, importc, ogl.} -proc glSampleMaskIndexedNV*(index: GLuint, mask: GLbitfield){.stdcall, importc, ogl.} -proc glTexRenderbufferNV*(target: GLenum, renderbuffer: GLuint){.stdcall, importc, ogl.} - # GL_NV_transform_feedback2 -proc glBindTransformFeedbackNV*(target: GLenum, id: GLuint){.stdcall, importc, ogl.} -proc glDeleteTransformFeedbacksNV*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glGenTransformFeedbacksNV*(n: GLsizei, ids: PGLuint){.stdcall, importc, ogl.} -proc glIsTransformFeedbackNV*(id: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glPauseTransformFeedbackNV*(){.stdcall, importc, ogl.} -proc glResumeTransformFeedbackNV*(){.stdcall, importc, ogl.} -proc glDrawTransformFeedbackNV*(mode: GLenum, id: GLuint){.stdcall, importc, ogl.} - # GL_NV_video_capture -proc glBeginVideoCaptureNV*(video_capture_slot: GLuint){.stdcall, importc, ogl.} -proc glBindVideoCaptureStreamBufferNV*(video_capture_slot: GLuint, - stream: GLuint, frame_region: GLenum, - offset: GLintptrARB){.stdcall, importc, ogl.} -proc glBindVideoCaptureStreamTextureNV*(video_capture_slot: GLuint, - stream: GLuint, frame_region: GLenum, - target: GLenum, texture: GLuint){. - stdcall, importc, ogl.} -proc glEndVideoCaptureNV*(video_capture_slot: GLuint){.stdcall, importc, ogl.} -proc glGetVideoCaptureivNV*(video_capture_slot: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glGetVideoCaptureStreamivNV*(video_capture_slot: GLuint, stream: GLuint, - pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetVideoCaptureStreamfvNV*(video_capture_slot: GLuint, stream: GLuint, - pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetVideoCaptureStreamdvNV*(video_capture_slot: GLuint, stream: GLuint, - pname: GLenum, params: PGLdouble){.stdcall, importc, ogl.} -proc glVideoCaptureNV*(video_capture_slot: GLuint, sequence_num: PGLuint, - capture_time: PGLuint64EXT): GLenum{.stdcall, importc, ogl.} -proc glVideoCaptureStreamParameterivNV*(video_capture_slot: GLuint, - stream: GLuint, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} -proc glVideoCaptureStreamParameterfvNV*(video_capture_slot: GLuint, - stream: GLuint, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glVideoCaptureStreamParameterdvNV*(video_capture_slot: GLuint, - stream: GLuint, pname: GLenum, - params: PGLdouble){.stdcall, importc, ogl.} - # GL_NV_copy_image -proc glCopyImageSubDataNV*(srcName: GLuint, srcTarget: GLenum, srcLevel: GLint, - srcX: GLint, srcY: GLint, srcZ: GLint, - dstName: GLuint, dstTarget: GLenum, dstLevel: GLint, - dstX: GLint, dstY: GLint, dstZ: GLint, - width: GLsizei, height: GLsizei, depth: GLsizei){. - stdcall, importc, ogl.} - # GL_NV_shader_buffer_load -proc glMakeBufferResidentNV*(target: GLenum, access: GLenum){.stdcall, importc, ogl.} -proc glMakeBufferNonResidentNV*(target: GLenum){.stdcall, importc, ogl.} -proc glIsBufferResidentNV*(target: GLenum): GLboolean{.stdcall, importc, ogl.} -proc glMakeNamedBufferResidentNV*(buffer: GLuint, access: GLenum){.stdcall, importc, ogl.} -proc glMakeNamedBufferNonResidentNV*(buffer: GLuint){.stdcall, importc, ogl.} -proc glIsNamedBufferResidentNV*(buffer: GLuint): GLboolean{.stdcall, importc, ogl.} -proc glGetBufferParameterui64vNV*(target: GLenum, pname: GLenum, - params: PGLuint64EXT){.stdcall, importc, ogl.} -proc glGetNamedBufferParameterui64vNV*(buffer: GLuint, pname: GLenum, - params: PGLuint64EXT){.stdcall, importc, ogl.} -proc glGetIntegerui64vNV*(value: GLenum, result: PGLuint64EXT){.stdcall, importc, ogl.} -proc glUniformui64NV*(location: GLint, value: GLuint64EXT){.stdcall, importc, ogl.} -proc glUniformui64vNV*(location: GLint, count: GLsizei, value: PGLuint64EXT){. - stdcall, importc, ogl.} -proc glGetUniformui64vNV*(prog: GLuint, location: GLint, params: PGLuint64EXT){. - stdcall, importc, ogl.} -proc glProgramUniformui64NV*(prog: GLuint, location: GLint, value: GLuint64EXT){. - stdcall, importc, ogl.} -proc glProgramUniformui64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint64EXT){.stdcall, importc, ogl.} - # GL_NV_vertex_buffer_unified_memory -proc glBufferAddressRangeNV*(pname: GLenum, index: GLuint, adress: GLuint64EXT, - len: GLsizeiptr){.stdcall, importc, ogl.} -proc glVertexFormatNV*(size: GLint, typ: GLenum, stride: GLsizei){.stdcall, importc, ogl.} -proc glNormalFormatNV*(typ: GLenum, stride: GLsizei){.stdcall, importc, ogl.} -proc glColorFormatNV*(size: GLint, typ: GLenum, stride: GLsizei){.stdcall, importc, ogl.} -proc glIndexFormatNV*(typ: GLenum, stride: GLsizei){.stdcall, importc, ogl.} -proc glTexCoordFormatNV*(size: GLint, typ: GLenum, stride: GLsizei){.stdcall, importc, ogl.} -proc glEdgeFlagFormatNV*(stride: GLsizei){.stdcall, importc, ogl.} -proc glSecondaryColorFormatNV*(size: GLint, typ: GLenum, stride: GLsizei){. - stdcall, importc, ogl.} -proc glFogCoordFormatNV*(typ: GLenum, stride: GLsizei){.stdcall, importc, ogl.} -proc glVertexAttribFormatNV*(index: GLuint, size: GLint, typ: GLenum, - normalized: GLboolean, stride: GLsizei){.stdcall, importc, ogl.} -proc glVertexAttribIFormatNV*(index: GLuint, size: GLint, typ: GLenum, - stride: GLsizei){.stdcall, importc, ogl.} -proc glGetIntegerui64i_vNV*(value: GLenum, index: GLuint, Result: PGLuint64EXT){. - stdcall, importc, ogl.} - # GL_NV_gpu_program5 -proc glProgramSubroutineParametersuivNV*(target: GLenum, count: GLsizei, - params: PGLuint){.stdcall, importc, ogl.} -proc glGetProgramSubroutineParameteruivNV*(target: GLenum, index: GLuint, - param: PGLuint){.stdcall, importc, ogl.} - # GL_NV_gpu_shader5 -proc glUniform1i64NV*(location: GLint, x: GLint64EXT){.stdcall, importc, ogl.} -proc glUniform2i64NV*(location: GLint, x: GLint64EXT, y: GLint64EXT){.stdcall, importc, ogl.} -proc glUniform3i64NV*(location: GLint, x: GLint64EXT, y: GLint64EXT, - z: GLint64EXT){.stdcall, importc, ogl.} -proc glUniform4i64NV*(location: GLint, x: GLint64EXT, y: GLint64EXT, - z: GLint64EXT, w: GLint64EXT){.stdcall, importc, ogl.} -proc glUniform1i64vNV*(location: GLint, count: GLsizei, value: PGLint64EXT){. - stdcall, importc, ogl.} -proc glUniform2i64vNV*(location: GLint, count: GLsizei, value: PGLint64EXT){. - stdcall, importc, ogl.} -proc glUniform3i64vNV*(location: GLint, count: GLsizei, value: PGLint64EXT){. - stdcall, importc, ogl.} -proc glUniform4i64vNV*(location: GLint, count: GLsizei, value: PGLint64EXT){. - stdcall, importc, ogl.} -proc glUniform1ui64NV*(location: GLint, x: GLuint64EXT){.stdcall, importc, ogl.} -proc glUniform2ui64NV*(location: GLint, x: GLuint64EXT, y: GLuint64EXT){.stdcall, importc, ogl.} -proc glUniform3ui64NV*(location: GLint, x: GLuint64EXT, y: GLuint64EXT, - z: GLuint64EXT){.stdcall, importc, ogl.} -proc glUniform4ui64NV*(location: GLint, x: GLuint64EXT, y: GLuint64EXT, - z: GLuint64EXT, w: GLuint64EXT){.stdcall, importc, ogl.} -proc glUniform1ui64vNV*(location: GLint, count: GLsizei, value: PGLuint64EXT){. - stdcall, importc, ogl.} -proc glUniform2ui64vNV*(location: GLint, count: GLsizei, value: PGLuint64EXT){. - stdcall, importc, ogl.} -proc glUniform3ui64vNV*(location: GLint, count: GLsizei, value: PGLuint64EXT){. - stdcall, importc, ogl.} -proc glUniform4ui64vNV*(location: GLint, count: GLsizei, value: PGLuint64EXT){. - stdcall, importc, ogl.} -proc glGetUniformi64vNV*(prog: GLuint, location: GLint, params: PGLint64EXT){. - stdcall, importc, ogl.} -proc glProgramUniform1i64NV*(prog: GLuint, location: GLint, x: GLint64EXT){. - stdcall, importc, ogl.} -proc glProgramUniform2i64NV*(prog: GLuint, location: GLint, x: GLint64EXT, - y: GLint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform3i64NV*(prog: GLuint, location: GLint, x: GLint64EXT, - y: GLint64EXT, z: GLint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform4i64NV*(prog: GLuint, location: GLint, x: GLint64EXT, - y: GLint64EXT, z: GLint64EXT, w: GLint64EXT){. - stdcall, importc, ogl.} -proc glProgramUniform1i64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform2i64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform3i64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform4i64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform1ui64NV*(prog: GLuint, location: GLint, x: GLuint64EXT){. - stdcall, importc, ogl.} -proc glProgramUniform2ui64NV*(prog: GLuint, location: GLint, x: GLuint64EXT, - y: GLuint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform3ui64NV*(prog: GLuint, location: GLint, x: GLuint64EXT, - y: GLuint64EXT, z: GLuint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform4ui64NV*(prog: GLuint, location: GLint, x: GLuint64EXT, - y: GLuint64EXT, z: GLuint64EXT, w: GLuint64EXT){. - stdcall, importc, ogl.} -proc glProgramUniform1ui64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform2ui64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform3ui64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint64EXT){.stdcall, importc, ogl.} -proc glProgramUniform4ui64vNV*(prog: GLuint, location: GLint, count: GLsizei, - value: PGLuint64EXT){.stdcall, importc, ogl.} - # GL_NV_vertex_attrib_integer_64bit -proc glVertexAttribL1i64NV*(index: GLuint, x: GLint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL2i64NV*(index: GLuint, x: GLint64EXT, y: GLint64EXT){. - stdcall, importc, ogl.} -proc glVertexAttribL3i64NV*(index: GLuint, x: GLint64EXT, y: GLint64EXT, - z: GLint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL4i64NV*(index: GLuint, x: GLint64EXT, y: GLint64EXT, - z: GLint64EXT, w: GLint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL1i64vNV*(index: GLuint, v: PGLint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL2i64vNV*(index: GLuint, v: PGLint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL3i64vNV*(index: GLuint, v: PGLint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL4i64vNV*(index: GLuint, v: PGLint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL1ui64NV*(index: GLuint, x: GLuint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL2ui64NV*(index: GLuint, x: GLuint64EXT, y: GLuint64EXT){. - stdcall, importc, ogl.} -proc glVertexAttribL3ui64NV*(index: GLuint, x: GLuint64EXT, y: GLuint64EXT, - z: GLuint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL4ui64NV*(index: GLuint, x: GLuint64EXT, y: GLuint64EXT, - z: GLuint64EXT, w: GLuint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL1ui64vNV*(index: GLuint, v: PGLuint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL2ui64vNV*(index: GLuint, v: PGLuint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL3ui64vNV*(index: GLuint, v: PGLuint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribL4ui64vNV*(index: GLuint, v: PGLuint64EXT){.stdcall, importc, ogl.} -proc glGetVertexAttribLi64vNV*(index: GLuint, pname: GLenum, params: PGLint64EXT){. - stdcall, importc, ogl.} -proc glGetVertexAttribLui64vNV*(index: GLuint, pname: GLenum, - params: PGLuint64EXT){.stdcall, importc, ogl.} -proc glVertexAttribLFormatNV*(index: GLuint, size: GLint, typ: GLenum, - stride: GLsizei){.stdcall, importc, ogl.} - # GL_NV_vdpau_interop -proc glVDPAUInitNV*(vdpDevice: PGLvoid, getProcAddress: PGLvoid){.stdcall, importc, ogl.} -proc glVDPAUFiniNV*(){.stdcall, importc, ogl.} -proc glVDPAURegisterVideoSurfaceNV*(vdpSurface: PGLvoid, target: GLenum, - numTextureNames: GLsizei, - textureNames: PGLuint): GLvdpauSurfaceNV{. - stdcall, importc, ogl.} -proc glVDPAURegisterOutputSurfaceNV*(vdpSurface: PGLvoid, target: GLenum, - numTextureNames: GLsizei, - textureNames: PGLuint): GLvdpauSurfaceNV{. - stdcall, importc, ogl.} -proc glVDPAUIsSurfaceNV*(surface: GLvdpauSurfaceNV){.stdcall, importc, ogl.} -proc glVDPAUUnregisterSurfaceNV*(surface: GLvdpauSurfaceNV){.stdcall, importc, ogl.} -proc glVDPAUGetSurfaceivNV*(surface: GLvdpauSurfaceNV, pname: GLenum, - bufSize: GLsizei, len: PGLsizei, values: PGLint){. - stdcall, importc, ogl.} -proc glVDPAUSurfaceAccessNV*(surface: GLvdpauSurfaceNV, access: GLenum){.stdcall, importc, ogl.} -proc glVDPAUMapSurfacesNV*(numSurfaces: GLsizei, surfaces: PGLvdpauSurfaceNV){. - stdcall, importc, ogl.} -proc glVDPAUUnmapSurfacesNV*(numSurface: GLsizei, surfaces: PGLvdpauSurfaceNV){. - stdcall, importc, ogl.} - # GL_NV_texture_barrier -proc glTextureBarrierNV*(){.stdcall, importc, ogl.} - # GL_PGI_misc_hints -proc glHintPGI*(target: GLenum, mode: GLint){.stdcall, importc, ogl.} - # GL_SGIS_detail_texture -proc glDetailTexFuncSGIS*(target: GLenum, n: GLsizei, points: PGLfloat){.stdcall, importc, ogl.} -proc glGetDetailTexFuncSGIS*(target: GLenum, points: PGLfloat){.stdcall, importc, ogl.} - # GL_SGIS_fog_function -proc glFogFuncSGIS*(n: GLsizei, points: PGLfloat){.stdcall, importc, ogl.} -proc glGetFogFuncSGIS*(points: PGLfloat){.stdcall, importc, ogl.} - # GL_SGIS_multisample -proc glSampleMaskSGIS*(value: GLclampf, invert: GLboolean){.stdcall, importc, ogl.} -proc glSamplePatternSGIS*(pattern: GLenum){.stdcall, importc, ogl.} - # GL_SGIS_pixel_texture -proc glPixelTexGenParameteriSGIS*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glPixelTexGenParameterivSGIS*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glPixelTexGenParameterfSGIS*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glPixelTexGenParameterfvSGIS*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glGetPixelTexGenParameterivSGIS*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glGetPixelTexGenParameterfvSGIS*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} - # GL_SGIS_point_parameters -proc glPointParameterfSGIS*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glPointParameterfvSGIS*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} - # GL_SGIS_sharpen_texture -proc glSharpenTexFuncSGIS*(target: GLenum, n: GLsizei, points: PGLfloat){. - stdcall, importc, ogl.} -proc glGetSharpenTexFuncSGIS*(target: GLenum, points: PGLfloat){.stdcall, importc, ogl.} - # GL_SGIS_texture4D -proc glTexImage4DSGIS*(target: GLenum, level: GLint, internalformat: GLenum, - width: GLsizei, height: GLsizei, depth: GLsizei, - size4d: GLsizei, border: GLint, format: GLenum, - typ: GLenum, pixels: PGLvoid){.stdcall, importc, ogl.} -proc glTexSubImage4DSGIS*(target: GLenum, level: GLint, xoffset: GLint, - yoffset: GLint, zoffset: GLint, woffset: GLint, - width: GLsizei, height: GLsizei, depth: GLsizei, - size4d: GLsizei, format: GLenum, typ: GLenum, - pixels: PGLvoid){.stdcall, importc, ogl.} - # GL_SGIS_texture_color_mask -proc glTextureColorMaskSGIS*(red: GLboolean, green: GLboolean, blue: GLboolean, - alpha: GLboolean){.stdcall, importc, ogl.} - # GL_SGIS_texture_filter4 -proc glGetTexFilterFuncSGIS*(target: GLenum, filter: GLenum, weights: PGLfloat){. - stdcall, importc, ogl.} -proc glTexFilterFuncSGIS*(target: GLenum, filter: GLenum, n: GLsizei, - weights: PGLfloat){.stdcall, importc, ogl.} - # GL_SGIX_async -proc glAsyncMarkerSGIX*(marker: GLuint){.stdcall, importc, ogl.} -proc glFinishAsyncSGIX*(markerp: PGLuint): GLint{.stdcall, importc, ogl.} -proc glPollAsyncSGIX*(markerp: PGLuint): GLint{.stdcall, importc, ogl.} -proc glGenAsyncMarkersSGIX*(range: GLsizei): GLuint{.stdcall, importc, ogl.} -proc glDeleteAsyncMarkersSGIX*(marker: GLuint, range: GLsizei){.stdcall, importc, ogl.} -proc glIsAsyncMarkerSGIX*(marker: GLuint): GLboolean{.stdcall, importc, ogl.} - # GL_SGIX_flush_raster -proc glFlushRasterSGIX*(){.stdcall, importc, ogl.} - # GL_SGIX_fragment_lighting -proc glFragmentColorMaterialSGIX*(face: GLenum, mode: GLenum){.stdcall, importc, ogl.} -proc glFragmentLightfSGIX*(light: GLenum, pname: GLenum, param: GLfloat){. - stdcall, importc, ogl.} -proc glFragmentLightfvSGIX*(light: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glFragmentLightiSGIX*(light: GLenum, pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glFragmentLightivSGIX*(light: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glFragmentLightModelfSGIX*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glFragmentLightModelfvSGIX*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glFragmentLightModeliSGIX*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glFragmentLightModelivSGIX*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} -proc glFragmentMaterialfSGIX*(face: GLenum, pname: GLenum, param: GLfloat){. - stdcall, importc, ogl.} -proc glFragmentMaterialfvSGIX*(face: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glFragmentMaterialiSGIX*(face: GLenum, pname: GLenum, param: GLint){. - stdcall, importc, ogl.} -proc glFragmentMaterialivSGIX*(face: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetFragmentLightfvSGIX*(light: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetFragmentLightivSGIX*(light: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glGetFragmentMaterialfvSGIX*(face: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetFragmentMaterialivSGIX*(face: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glLightEnviSGIX*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} - # GL_SGIX_framezoom -proc glFrameZoomSGIX*(factor: GLint){.stdcall, importc, ogl.} - # GL_SGIX_igloo_interface -proc glIglooInterfaceSGIX*(pname: GLenum, params: PGLvoid){.stdcall, importc, ogl.} - # GL_SGIX_instruments -proc glGetInstrumentsSGIX*(): GLint{.stdcall, importc, ogl.} -proc glInstrumentsBufferSGIX*(size: GLsizei, buffer: PGLint){.stdcall, importc, ogl.} -proc glPollInstrumentsSGIX*(marker_p: PGLint): GLint{.stdcall, importc, ogl.} -proc glReadInstrumentsSGIX*(marker: GLint){.stdcall, importc, ogl.} -proc glStartInstrumentsSGIX*(){.stdcall, importc, ogl.} -proc glStopInstrumentsSGIX*(marker: GLint){.stdcall, importc, ogl.} - # GL_SGIX_list_priority -proc glGetListParameterfvSGIX*(list: GLuint, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glGetListParameterivSGIX*(list: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glListParameterfSGIX*(list: GLuint, pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glListParameterfvSGIX*(list: GLuint, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glListParameteriSGIX*(list: GLuint, pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glListParameterivSGIX*(list: GLuint, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} - # GL_SGIX_pixel_texture -proc glPixelTexGenSGIX*(mode: GLenum){.stdcall, importc, ogl.} - # GL_SGIX_polynomial_ffd -proc glDeformationMap3dSGIX*(target: GLenum, u1: GLdouble, u2: GLdouble, - ustride: GLint, uorder: GLint, v1: GLdouble, - v2: GLdouble, vstride: GLint, vorder: GLint, - w1: GLdouble, w2: GLdouble, wstride: GLint, - worder: GLint, points: PGLdouble){.stdcall, importc, ogl.} -proc glDeformationMap3fSGIX*(target: GLenum, u1: GLfloat, u2: GLfloat, - ustride: GLint, uorder: GLint, v1: GLfloat, - v2: GLfloat, vstride: GLint, vorder: GLint, - w1: GLfloat, w2: GLfloat, wstride: GLint, - worder: GLint, points: PGLfloat){.stdcall, importc, ogl.} -proc glDeformSGIX*(mask: GLbitfield){.stdcall, importc, ogl.} -proc glLoadIdentityDeformationMapSGIX*(mask: GLbitfield){.stdcall, importc, ogl.} - # GL_SGIX_reference_plane -proc glReferencePlaneSGIX*(equation: PGLdouble){.stdcall, importc, ogl.} - # GL_SGIX_sprite -proc glSpriteParameterfSGIX*(pname: GLenum, param: GLfloat){.stdcall, importc, ogl.} -proc glSpriteParameterfvSGIX*(pname: GLenum, params: PGLfloat){.stdcall, importc, ogl.} -proc glSpriteParameteriSGIX*(pname: GLenum, param: GLint){.stdcall, importc, ogl.} -proc glSpriteParameterivSGIX*(pname: GLenum, params: PGLint){.stdcall, importc, ogl.} - # GL_SGIX_tag_sample_buffer -proc glTagSampleBufferSGIX*(){.stdcall, importc, ogl.} - # GL_SGI_color_table -proc glColorTableSGI*(target: GLenum, internalformat: GLenum, width: GLsizei, - format: GLenum, typ: GLenum, table: PGLvoid){.stdcall, importc, ogl.} -proc glColorTableParameterfvSGI*(target: GLenum, pname: GLenum, params: PGLfloat){. - stdcall, importc, ogl.} -proc glColorTableParameterivSGI*(target: GLenum, pname: GLenum, params: PGLint){. - stdcall, importc, ogl.} -proc glCopyColorTableSGI*(target: GLenum, internalformat: GLenum, x: GLint, - y: GLint, width: GLsizei){.stdcall, importc, ogl.} -proc glGetColorTableSGI*(target: GLenum, format: GLenum, typ: GLenum, - table: PGLvoid){.stdcall, importc, ogl.} -proc glGetColorTableParameterfvSGI*(target: GLenum, pname: GLenum, - params: PGLfloat){.stdcall, importc, ogl.} -proc glGetColorTableParameterivSGI*(target: GLenum, pname: GLenum, - params: PGLint){.stdcall, importc, ogl.} - # GL_SUNX_constant_data -proc glFinishTextureSUNX*(){.stdcall, importc, ogl.} - # GL_SUN_global_alpha -proc glGlobalAlphaFactorbSUN*(factor: GLbyte){.stdcall, importc, ogl.} -proc glGlobalAlphaFactorsSUN*(factor: GLshort){.stdcall, importc, ogl.} -proc glGlobalAlphaFactoriSUN*(factor: GLint){.stdcall, importc, ogl.} -proc glGlobalAlphaFactorfSUN*(factor: GLfloat){.stdcall, importc, ogl.} -proc glGlobalAlphaFactordSUN*(factor: GLdouble){.stdcall, importc, ogl.} -proc glGlobalAlphaFactorubSUN*(factor: GLubyte){.stdcall, importc, ogl.} -proc glGlobalAlphaFactorusSUN*(factor: GLushort){.stdcall, importc, ogl.} -proc glGlobalAlphaFactoruiSUN*(factor: GLuint){.stdcall, importc, ogl.} - # GL_SUN_mesh_array -proc glDrawMeshArraysSUN*(mode: GLenum, first: GLint, count: GLsizei, - width: GLsizei){.stdcall, importc, ogl.} - # GL_SUN_triangle_list -proc glReplacementCodeuiSUN*(code: GLuint){.stdcall, importc, ogl.} -proc glReplacementCodeusSUN*(code: GLushort){.stdcall, importc, ogl.} -proc glReplacementCodeubSUN*(code: GLubyte){.stdcall, importc, ogl.} -proc glReplacementCodeuivSUN*(code: PGLuint){.stdcall, importc, ogl.} -proc glReplacementCodeusvSUN*(code: PGLushort){.stdcall, importc, ogl.} -proc glReplacementCodeubvSUN*(code: PGLubyte){.stdcall, importc, ogl.} -proc glReplacementCodePointerSUN*(typ: GLenum, stride: GLsizei, pointer: PGLvoid){. - stdcall, importc, ogl.} - # GL_SUN_vertex -proc glColor4ubVertex2fSUN*(r: GLubyte, g: GLubyte, b: GLubyte, a: GLubyte, - x: GLfloat, y: GLfloat){.stdcall, importc, ogl.} -proc glColor4ubVertex2fvSUN*(c: PGLubyte, v: PGLfloat){.stdcall, importc, ogl.} -proc glColor4ubVertex3fSUN*(r: GLubyte, g: GLubyte, b: GLubyte, a: GLubyte, - x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glColor4ubVertex3fvSUN*(c: PGLubyte, v: PGLfloat){.stdcall, importc, ogl.} -proc glColor3fVertex3fSUN*(r: GLfloat, g: GLfloat, b: GLfloat, x: GLfloat, - y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glColor3fVertex3fvSUN*(c: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} -proc glNormal3fVertex3fSUN*(nx: GLfloat, ny: GLfloat, nz: GLfloat, x: GLfloat, - y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glNormal3fVertex3fvSUN*(n: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} -proc glColor4fNormal3fVertex3fSUN*(r: GLfloat, g: GLfloat, b: GLfloat, - a: GLfloat, nx: GLfloat, ny: GLfloat, - nz: GLfloat, x: GLfloat, y: GLfloat, - z: GLfloat){.stdcall, importc, ogl.} -proc glColor4fNormal3fVertex3fvSUN*(c: PGLfloat, n: PGLfloat, v: PGLfloat){. - stdcall, importc, ogl.} -proc glTexCoord2fVertex3fSUN*(s: GLfloat, t: GLfloat, x: GLfloat, y: GLfloat, - z: GLfloat){.stdcall, importc, ogl.} -proc glTexCoord2fVertex3fvSUN*(tc: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} -proc glTexCoord4fVertex4fSUN*(s: GLfloat, t: GLfloat, p: GLfloat, q: GLfloat, - x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat){. - stdcall, importc, ogl.} -proc glTexCoord4fVertex4fvSUN*(tc: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} -proc glTexCoord2fColor4ubVertex3fSUN*(s: GLfloat, t: GLfloat, r: GLubyte, - g: GLubyte, b: GLubyte, a: GLubyte, - x: GLfloat, y: GLfloat, z: GLfloat){. - stdcall, importc, ogl.} -proc glTexCoord2fColor4ubVertex3fvSUN*(tc: PGLfloat, c: PGLubyte, v: PGLfloat){. - stdcall, importc, ogl.} -proc glTexCoord2fColor3fVertex3fSUN*(s: GLfloat, t: GLfloat, r: GLfloat, - g: GLfloat, b: GLfloat, x: GLfloat, - y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glTexCoord2fColor3fVertex3fvSUN*(tc: PGLfloat, c: PGLfloat, v: PGLfloat){. - stdcall, importc, ogl.} -proc glTexCoord2fNormal3fVertex3fSUN*(s: GLfloat, t: GLfloat, nx: GLfloat, - ny: GLfloat, nz: GLfloat, x: GLfloat, - y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glTexCoord2fNormal3fVertex3fvSUN*(tc: PGLfloat, n: PGLfloat, v: PGLfloat){. - stdcall, importc, ogl.} -proc glTexCoord2fColor4fNormal3fVertex3fSUN*(s: GLfloat, t: GLfloat, r: GLfloat, - g: GLfloat, b: GLfloat, a: GLfloat, nx: GLfloat, ny: GLfloat, nz: GLfloat, - x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glTexCoord2fColor4fNormal3fVertex3fvSUN*(tc: PGLfloat, c: PGLfloat, - n: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} -proc glTexCoord4fColor4fNormal3fVertex4fSUN*(s: GLfloat, t: GLfloat, p: GLfloat, - q: GLfloat, r: GLfloat, g: GLfloat, b: GLfloat, a: GLfloat, nx: GLfloat, - ny: GLfloat, nz: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat){. - stdcall, importc, ogl.} -proc glTexCoord4fColor4fNormal3fVertex4fvSUN*(tc: PGLfloat, c: PGLfloat, - n: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiVertex3fSUN*(rc: GLuint, x: GLfloat, y: GLfloat, - z: GLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiVertex3fvSUN*(rc: PGLuint, v: PGLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiColor4ubVertex3fSUN*(rc: GLuint, r: GLubyte, g: GLubyte, - b: GLubyte, a: GLubyte, x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiColor4ubVertex3fvSUN*(rc: PGLuint, c: PGLubyte, - v: PGLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiColor3fVertex3fSUN*(rc: GLuint, r: GLfloat, g: GLfloat, - b: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiColor3fVertex3fvSUN*(rc: PGLuint, c: PGLfloat, - v: PGLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiNormal3fVertex3fSUN*(rc: GLuint, nx: GLfloat, - ny: GLfloat, nz: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiNormal3fVertex3fvSUN*(rc: PGLuint, n: PGLfloat, - v: PGLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiColor4fNormal3fVertex3fSUN*(rc: GLuint, r: GLfloat, - g: GLfloat, b: GLfloat, a: GLfloat, nx: GLfloat, ny: GLfloat, nz: GLfloat, - x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiColor4fNormal3fVertex3fvSUN*(rc: PGLuint, c: PGLfloat, - n: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiTexCoord2fVertex3fSUN*(rc: GLuint, s: GLfloat, - t: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiTexCoord2fVertex3fvSUN*(rc: PGLuint, tc: PGLfloat, - v: PGLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN*(rc: GLuint, s: GLfloat, - t: GLfloat, nx: GLfloat, ny: GLfloat, nz: GLfloat, x: GLfloat, y: GLfloat, - z: GLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN*(rc: PGLuint, - tc: PGLfloat, n: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} -proc glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN*(rc: GLuint, - s: GLfloat, t: GLfloat, r: GLfloat, g: GLfloat, b: GLfloat, a: GLfloat, - nx: GLfloat, ny: GLfloat, nz: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat){. - stdcall, importc, ogl.} -proc glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN*(rc: PGLuint, - tc: PGLfloat, c: PGLfloat, n: PGLfloat, v: PGLfloat){.stdcall, importc, ogl.} - # window support functions -when defined(windows): - when not defined(wglGetProcAddress): - proc wglGetProcAddress*(ProcName: cstring): Pointer{.stdcall, importc, wgl.} - proc wglCopyContext*(p1: HGLRC, p2: HGLRC, p3: int): BOOL{.stdcall, importc, wgl.} - proc wglCreateContext*(DC: HDC): HGLRC{.stdcall, importc, wgl.} - proc wglCreateLayerContext*(p1: HDC, p2: int): HGLRC{.stdcall, importc, wgl.} - proc wglDeleteContext*(p1: HGLRC): BOOL{.stdcall, importc, wgl.} - proc wglDescribeLayerPlane*(p1: HDC, p2, p3: int, p4: int, - LayerPlaneDescriptor: pointer): BOOL{.stdcall, importc, wgl.} - proc wglGetCurrentContext*(): HGLRC{.stdcall, importc, wgl.} - proc wglGetCurrentDC*(): HDC{.stdcall, importc, wgl.} - proc wglGetLayerPaletteEntries*(p1: HDC, p2, p3, p4: int, pcr: pointer): int{. - stdcall, importc, wgl.} - proc wglMakeCurrent*(DC: HDC, p2: HGLRC): BOOL{.stdcall, importc, wgl.} - proc wglRealizeLayerPalette*(p1: HDC, p2: int, p3: BOOL): BOOL{.stdcall, importc, wgl.} - proc wglSetLayerPaletteEntries*(p1: HDC, p2, p3, p4: int, pcr: pointer): int{. - stdcall, importc, wgl.} - proc wglShareLists*(p1, p2: HGLRC): BOOL{.stdcall, importc, wgl.} - proc wglSwapLayerBuffers*(p1: HDC, p2: int): BOOL{.stdcall, importc, wgl.} - proc wglSwapMultipleBuffers*(p1: int32, p2: PWGLSWAP): int32{.stdcall, importc, wgl.} - proc wglUseFontBitmapsA*(DC: HDC, p2, p3, p4: int32): BOOL{.stdcall, importc, wgl.} - proc wglUseFontBitmapsW*(DC: HDC, p2, p3, p4: int32): BOOL{.stdcall, importc, wgl.} - proc wglUseFontBitmaps*(DC: HDC, p2, p3, p4: int32): BOOL{.stdcall, importc, wgl.} - proc wglUseFontOutlinesA*(p1: HDC, p2, p3, p4: int32, p5, p6: float32, - p7: int, GlyphMetricsFloat: pointer): BOOL{.stdcall, importc, wgl.} - proc wglUseFontOutlinesW*(p1: HDC, p2, p3, p4: int32, p5, p6: float32, - p7: int, GlyphMetricsFloat: pointer): BOOL{.stdcall, importc, wgl.} - proc wglUseFontOutlines*(p1: HDC, p2, p3, p4: int32, p5, p6: float32, p7: int, - GlyphMetricsFloat: pointer): BOOL{.stdcall, importc, wgl.} - # WGL_ARB_buffer_region - proc wglCreateBufferRegionARB*(hDC: HDC, iLayerPlane: GLint, uType: GLuint): THandle{. - stdcall, importc, wgl.} - proc wglDeleteBufferRegionARB*(hRegion: THandle){.stdcall, importc, wgl.} - proc wglSaveBufferRegionARB*(hRegion: THandle, x: GLint, y: GLint, - width: GLint, height: GLint): bool{.stdcall, importc, wgl.} - proc wglRestoreBufferRegionARB*(hRegion: THandle, x: GLint, y: GLint, - width: GLint, height: GLint, xSrc: GLint, - ySrc: GLint): bool{.stdcall, importc, wgl.} - # WGL_ARB_extensions_string - proc wglGetExtensionsStringARB*(hdc: HDC): cstring{.stdcall, importc, wgl.} - # WGL_ARB_make_current_read - proc wglMakeContextCurrentARB*(hDrawDC: HDC, hReadDC: HDC, hglrc: HGLRC): bool{. - stdcall, importc, wgl.} - proc wglGetCurrentReadDCARB*(): HDC{.stdcall, importc, wgl.} - # WGL_ARB_pbuffer - proc wglCreatePbufferARB*(hDC: HDC, iPixelFormat: GLint, iWidth: GLint, - iHeight: GLint, piAttribList: PGLint): HPBUFFERARB{. - stdcall, importc, wgl.} - proc wglGetPbufferDCARB*(hPbuffer: HPBUFFERARB): HDC{.stdcall, importc, wgl.} - proc wglReleasePbufferDCARB*(hPbuffer: HPBUFFERARB, hDC: HDC): GLint{.stdcall, importc, wgl.} - proc wglDestroyPbufferARB*(hPbuffer: HPBUFFERARB): bool{.stdcall, importc, wgl.} - proc wglQueryPbufferARB*(hPbuffer: HPBUFFERARB, iAttribute: GLint, - piValue: PGLint): bool{.stdcall, importc, wgl.} - # WGL_ARB_pixel_format - proc wglGetPixelFormatAttribivARB*(hdc: HDC, iPixelFormat: GLint, - iLayerPlane: GLint, nAttributes: GLuint, - piAttributes: PGLint, piValues: PGLint): bool{. - stdcall, importc, wgl.} - proc wglGetPixelFormatAttribfvARB*(hdc: HDC, iPixelFormat: GLint, - iLayerPlane: GLint, nAttributes: GLuint, - piAttributes: PGLint, pfValues: PGLfloat): bool{. - stdcall, importc, wgl.} - proc wglChoosePixelFormatARB*(hdc: HDC, piAttribIList: PGLint, - pfAttribFList: PGLfloat, nMaxFormats: GLuint, - piFormats: PGLint, nNumFormats: PGLuint): BOOL{. - stdcall, importc, wgl.} - # WGL_ARB_color_buffer_float - proc wglClampColorARB*(target: GLenum, clamp: GLenum){.stdcall, importc, wgl.} - # WGL_ARB_render_texture - proc wglBindTexImageARB*(hPbuffer: HPBUFFERARB, iBuffer: GLint): bool{.stdcall, importc, wgl.} - proc wglReleaseTexImageARB*(hPbuffer: HPBUFFERARB, iBuffer: GLint): bool{. - stdcall, importc, wgl.} - proc wglSetPbufferAttribARB*(hPbuffer: HPBUFFERARB, piAttribList: PGLint): bool{. - stdcall, importc, wgl.} - # WGL_ARB_create_context - proc wglCreateContextAttribsARB*(hDC: HDC, hShareContext: HGLRC, - attribList: PGLint): HGLRC{.stdcall, importc, wgl.} - # WGL_AMD_gpu_association - proc wglGetGPUIDsAMD*(maxCount: int, ids: ptr int): int{.stdcall, importc, wgl.} - proc wglGetGPUInfoAMD*(id: int, prop: int, dataType: GLenum, size: int, - data: Pointer): int{.stdcall, importc, wgl.} - proc wglGetContextGPUIDAMD*(hglrc: HGLRC): int{.stdcall, importc, wgl.} - proc wglCreateAssociatedContextAMD*(id: int): HGLRC{.stdcall, importc, wgl.} - proc wglCreateAssociatedContextAttribsAMD*(id: int, hShareContext: HGLRC, - attribList: ptr int32): HGLRC{.stdcall, importc, wgl.} - proc wglDeleteAssociatedContextAMD*(hglrc: HGLRC): bool{.stdcall, importc, wgl.} - proc wglMakeAssociatedContextCurrentAMD*(hglrc: HGLRC): bool{.stdcall, importc, wgl.} - proc wglGetCurrentAssociatedContextAMD*(): HGLRC{.stdcall, importc, wgl.} - proc wglBlitContextFramebufferAMD*(dstCtx: HGLRC, srcX0: GLint, srcY0: GLint, - srcX1: GLint, srcY1: GLint, dstX0: GLint, - dstY0: GLint, dstX1: GLint, dstY1: GLint, - mask: GLbitfield, filter: GLenum){.stdcall, importc, wgl.} - # WGL_EXT_display_color_table - proc wglCreateDisplayColorTableEXT*(id: GLushort): GLboolean{.stdcall, importc, wgl.} - proc wglLoadDisplayColorTableEXT*(table: PGLushort, len: GLuint): GLboolean{. - stdcall, importc, wgl.} - proc wglBindDisplayColorTableEXT*(id: GLushort): GLboolean{.stdcall, importc, wgl.} - proc wglDestroyDisplayColorTableEXT*(id: GLushort){.stdcall, importc, wgl.} - # WGL_EXT_extensions_string - proc wglGetExtensionsStringEXT*(): cstring{.stdcall, importc, wgl.} - # WGL_EXT_make_current_read - proc wglMakeContextCurrentEXT*(hDrawDC: HDC, hReadDC: HDC, hglrc: HGLRC): bool{. - stdcall, importc, wgl.} - proc wglGetCurrentReadDCEXT*(): HDC{.stdcall, importc, wgl.} - # WGL_EXT_pbuffer - proc wglCreatePbufferEXT*(hDC: HDC, iPixelFormat: GLint, iWidth: GLint, - iHeight: GLint, piAttribList: PGLint): HPBUFFEREXT{. - stdcall, importc, wgl.} - proc wglGetPbufferDCEXT*(hPbuffer: HPBUFFEREXT): HDC{.stdcall, importc, wgl.} - proc wglReleasePbufferDCEXT*(hPbuffer: HPBUFFEREXT, hDC: HDC): GLint{.stdcall, importc, wgl.} - proc wglDestroyPbufferEXT*(hPbuffer: HPBUFFEREXT): bool{.stdcall, importc, wgl.} - proc wglQueryPbufferEXT*(hPbuffer: HPBUFFEREXT, iAttribute: GLint, - piValue: PGLint): bool{.stdcall, importc, wgl.} - # WGL_EXT_pixel_format - proc wglGetPixelFormatAttribivEXT*(hdc: HDC, iPixelFormat: GLint, - iLayerPlane: GLint, nAttributes: GLuint, - piAttributes: PGLint, piValues: PGLint): bool{. - stdcall, importc, wgl.} - proc wglGetPixelFormatAttribfvEXT*(hdc: HDC, iPixelFormat: GLint, - iLayerPlane: GLint, nAttributes: GLuint, - piAttributes: PGLint, pfValues: PGLfloat): bool{. - stdcall, importc, wgl.} - proc wglChoosePixelFormatEXT*(hdc: HDC, piAttribIList: PGLint, - pfAttribFList: PGLfloat, nMaxFormats: GLuint, - piFormats: PGLint, nNumFormats: PGLuint): bool{. - stdcall, importc, wgl.} - # WGL_EXT_swap_control - proc wglSwapIntervalEXT*(interval: GLint): bool{.stdcall, importc, wgl.} - proc wglGetSwapIntervalEXT*(): GLint{.stdcall, importc, wgl.} - # WGL_I3D_digital_video_control - proc wglGetDigitalVideoParametersI3D*(hDC: HDC, iAttribute: GLint, - piValue: PGLint): bool{.stdcall, importc, wgl.} - proc wglSetDigitalVideoParametersI3D*(hDC: HDC, iAttribute: GLint, - piValue: PGLint): bool{.stdcall, importc, wgl.} - # WGL_I3D_gamma - proc wglGetGammaTableParametersI3D*(hDC: HDC, iAttribute: GLint, - piValue: PGLint): bool{.stdcall, importc, wgl.} - proc wglSetGammaTableParametersI3D*(hDC: HDC, iAttribute: GLint, - piValue: PGLint): bool{.stdcall, importc, wgl.} - proc wglGetGammaTableI3D*(hDC: HDC, iEntries: GLint, puRed: PGLushort, - puGreen: PGLushort, puBlue: PGLushort): bool{. - stdcall, importc, wgl.} - proc wglSetGammaTableI3D*(hDC: HDC, iEntries: GLint, puRed: PGLushort, - puGreen: PGLushort, puBlue: PGLushort): bool{. - stdcall, importc, wgl.} - # WGL_I3D_genlock - proc wglEnableGenlockI3D*(hDC: HDC): bool{.stdcall, importc, wgl.} - proc wglDisableGenlockI3D*(hDC: HDC): bool{.stdcall, importc, wgl.} - proc wglIsEnabledGenlockI3D*(hDC: HDC, pFlag: bool): bool{.stdcall, importc, wgl.} - proc wglGenlockSourceI3D*(hDC: HDC, uSource: GLuint): bool{.stdcall, importc, wgl.} - proc wglGetGenlockSourceI3D*(hDC: HDC, uSource: PGLuint): bool{.stdcall, importc, wgl.} - proc wglGenlockSourceEdgeI3D*(hDC: HDC, uEdge: GLuint): bool{.stdcall, importc, wgl.} - proc wglGetGenlockSourceEdgeI3D*(hDC: HDC, uEdge: PGLuint): bool{.stdcall, importc, wgl.} - proc wglGenlockSampleRateI3D*(hDC: HDC, uRate: GLuint): bool{.stdcall, importc, wgl.} - proc wglGetGenlockSampleRateI3D*(hDC: HDC, uRate: PGLuint): bool{.stdcall, importc, wgl.} - proc wglGenlockSourceDelayI3D*(hDC: HDC, uDelay: GLuint): bool{.stdcall, importc, wgl.} - proc wglGetGenlockSourceDelayI3D*(hDC: HDC, uDelay: PGLuint): bool{.stdcall, importc, wgl.} - proc wglQueryGenlockMaxSourceDelayI3D*(hDC: HDC, uMaxLineDelay: PGLuint, - uMaxPixelDelay: PGLuint): bool{.stdcall, importc, wgl.} - # WGL_I3D_image_buffer - proc wglCreateImageBufferI3D*(hDC: HDC, dwSize: GLuint, uFlags: GLuint): GLvoid{. - stdcall, importc, wgl.} - proc wglDestroyImageBufferI3D*(hDC: HDC, pAddress: GLvoid): bool{.stdcall, importc, wgl.} - proc wglAssociateImageBufferEventsI3D*(hDC: HDC, pEvent: THandle, - pAddress: PGLvoid, pSize: PGLuint, count: GLuint): bool{.stdcall, importc, wgl.} - proc wglReleaseImageBufferEventsI3D*(hDC: HDC, pAddress: PGLvoid, - count: GLuint): bool{.stdcall, importc, wgl.} - # WGL_I3D_swap_frame_lock - proc wglEnableFrameLockI3D*(): bool{.stdcall, importc, wgl.} - proc wglDisableFrameLockI3D*(): bool{.stdcall, importc, wgl.} - proc wglIsEnabledFrameLockI3D*(pFlag: bool): bool{.stdcall, importc, wgl.} - proc wglQueryFrameLockMasterI3D*(pFlag: bool): bool{.stdcall, importc, wgl.} - # WGL_I3D_swap_frame_usage - proc wglGetFrameUsageI3D*(pUsage: PGLfloat): bool{.stdcall, importc, wgl.} - proc wglBeginFrameTrackingI3D*(): bool{.stdcall, importc, wgl.} - proc wglEndFrameTrackingI3D*(): bool{.stdcall, importc, wgl.} - proc wglQueryFrameTrackingI3D*(pFrameCount: PGLuint, pMissedFrames: PGLuint, - pLastMissedUsage: PGLfloat): bool{.stdcall, importc, wgl.} - # WGL_NV_vertex_array_range - proc wglAllocateMemoryNV*(size: GLsizei, readfreq: GLfloat, - writefreq: GLfloat, priority: GLfloat){.stdcall, importc, wgl.} - proc wglFreeMemoryNV*(pointer: Pointer){.stdcall, importc, wgl.} - # WGL_NV_present_video - proc wglEnumerateVideoDevicesNV*(hdc: HDC, phDeviceList: PHVIDEOOUTPUTDEVICENV): int{. - stdcall, importc, wgl.} - proc wglBindVideoDeviceNV*(hd: HDC, uVideoSlot: int, - hVideoDevice: HVIDEOOUTPUTDEVICENV, - piAttribList: ptr int32): bool{.stdcall, importc, wgl.} - proc wglQueryCurrentContextNV*(iAttribute: int, piValue: ptr int32): bool{. - stdcall, importc, wgl.} - # WGL_NV_video_output - proc wglGetVideoDeviceNV*(hDC: HDC, numDevices: int, hVideoDevice: PHPVIDEODEV): bool{. - stdcall, importc, wgl.} - proc wglReleaseVideoDeviceNV*(hVideoDevice: HPVIDEODEV): bool{.stdcall, importc, wgl.} - proc wglBindVideoImageNV*(hVideoDevice: HPVIDEODEV, hPbuffer: HPBUFFERARB, - iVideoBuffer: int): bool{.stdcall, importc, wgl.} - proc wglReleaseVideoImageNV*(hPbuffer: HPBUFFERARB, iVideoBuffer: int): bool{. - stdcall, importc, wgl.} - proc wglSendPbufferToVideoNV*(hPbuffer: HPBUFFERARB, iBufferType: int, - pulCounterPbuffer: ptr int, bBlock: bool): bool{. - stdcall, importc, wgl.} - proc wglGetVideoInfoNV*(hpVideoDevice: HPVIDEODEV, - pulCounterOutputPbuffer: ptr int, - pulCounterOutputVideo: ptr int): bool{.stdcall, importc, wgl.} - # WGL_NV_swap_group - proc wglJoinSwapGroupNV*(hDC: HDC, group: GLuint): bool{.stdcall, importc, wgl.} - proc wglBindSwapBarrierNV*(group: GLuint, barrier: GLuint): bool{.stdcall, importc, wgl.} - proc wglQuerySwapGroupNV*(hDC: HDC, group: PGLuint, barrier: PGLuint): bool{. - stdcall, importc, wgl.} - proc wglQueryMaxSwapGroupsNV*(hDC: HDC, mxGroups: PGLuint, - maxBarriers: PGLuint): bool{.stdcall, importc, wgl.} - proc wglQueryFrameCountNV*(hDC: HDC, count: PGLuint): bool{.stdcall, importc, wgl.} - proc wglResetFrameCountNV*(hDC: HDC): bool{.stdcall, importc, wgl.} - # WGL_NV_gpu_affinity - proc wglEnumGpusNV*(iGpuIndex: int, phGpu: PHGPUNV): bool{.stdcall, importc, wgl.} - proc wglEnumGpuDevicesNV*(hGpu: HGPUNV, iDeviceIndex: int, - lpGpuDevice: PGPU_DEVICE): bool{.stdcall, importc, wgl.} - proc wglCreateAffinityDCNV*(phGpuList: PHGPUNV): HDC{.stdcall, importc, wgl.} - proc wglEnumGpusFromAffinityDCNV*(hAffinityDC: HDC, iGpuIndex: int, - hGpu: PHGPUNV): bool{.stdcall, importc, wgl.} - proc wglDeleteDCNV*(hDC: HDC): bool{.stdcall, importc, wgl.} - # WGL_NV_video_capture - proc wglBindVideoCaptureDeviceNV*(uVideoSlot: int, - hDevice: HVIDEOINPUTDEVICENV): bool{.stdcall, importc, wgl.} - proc wglEnumerateVideoCaptureDevicesNV*(hDc: HDC, - phDeviceList: PHVIDEOINPUTDEVICENV): int{.stdcall, importc, wgl.} - proc wglLockVideoCaptureDeviceNV*(hDc: HDC, hDevice: HVIDEOINPUTDEVICENV): bool{. - stdcall, importc, wgl.} - proc wglQueryVideoCaptureDeviceNV*(hDc: HDC, hDevice: HVIDEOINPUTDEVICENV, - iAttribute: int, piValue: ptr int32): bool{. - stdcall, importc, wgl.} - proc wglReleaseVideoCaptureDeviceNV*(hDc: HDC, hDevice: HVIDEOINPUTDEVICENV): bool{. - stdcall, importc, wgl.} - # WGL_NV_copy_image - proc wglCopyImageSubDataNV*(hSrcRc: HGLRC, srcName: GLuint, srcTarget: GLenum, - srcLevel: GLint, srcX: GLint, srcY: GLint, - srcZ: GLint, hDstRC: HGLRC, dstName: GLuint, - dstTarget: GLenum, dstLevel: GLint, dstX: GLint, - dstY: GLint, dstZ: GLint, width: GLsizei, - height: GLsizei, depth: GLsizei): bool{.stdcall, importc, wgl.} - # WGL_NV_DX_interop - proc wglDXSetResourceShareHandleNV*(dxObject: PGLVoid, hareHandle: int): bool{. - stdcall, importc, wgl.} - proc wglDXOpenDeviceNV*(dxDevice: PGLVoid): int{.stdcall, importc, wgl.} - proc wglDXCloseDeviceNV*(hDevice: int): bool{.stdcall, importc, wgl.} - proc wglDXRegisterObjectNV*(hDevice: int, dxObject: PGLVoid, name: GLUInt, - typ: TGLEnum, access: TGLenum): int{.stdcall, importc, wgl.} - proc wglDXUnregisterObjectNV*(hDevice: int, hObject: int): bool{.stdcall, importc, wgl.} - proc wglDXObjectAccessNV*(hObject: int, access: GLenum): bool{.stdcall, importc, wgl.} - proc wglDXLockObjectsNV*(hDevice: int, count: GLint, hObjects: ptr int): bool{. - stdcall, importc, wgl.} - proc wglDXUnlockObjectsNV*(hDevice: int, count: GLint, hObjects: ptr int): bool{. - stdcall, importc, wgl.} - # WGL_OML_sync_control - proc wglGetSyncValuesOML*(hdc: HDC, ust: PGLint64, msc: PGLint64, - sbc: PGLint64): bool{.stdcall, importc, wgl.} - proc wglGetMscRateOML*(hdc: HDC, numerator: PGLint, denominator: PGLint): bool{. - stdcall, importc, wgl.} - proc wglSwapBuffersMscOML*(hdc: HDC, target_msc: GLint64, divisor: GLint64, - remainder: GLint64): GLint64{.stdcall, importc, wgl.} - proc wglSwapLayerBuffersMscOML*(hdc: HDC, fuPlanes: GLint, - target_msc: GLint64, divisor: GLint64, - remainder: GLint64): GLint64{.stdcall, importc, wgl.} - proc wglWaitForMscOML*(hdc: HDC, target_msc: GLint64, divisor: GLint64, - remainder: GLint64, ust: PGLint64, msc: PGLint64, - sbc: PGLint64): bool{.stdcall, importc, wgl.} - proc wglWaitForSbcOML*(hdc: HDC, target_sbc: GLint64, ust: PGLint64, - msc: PGLint64, sbc: PGLint64): bool{.stdcall, importc, wgl.} - # WGL_3DL_stereo_control - proc wglSetStereoEmitterState3DL*(hDC: HDC, uState: int32): bool{.stdcall, importc, wgl.} - # WIN_draw_range_elements - proc glDrawRangeElementsWIN*(mode: GLenum, start: GLuint, ending: GLuint, - count: GLsizei, typ: GLenum, indices: PGLvoid){. - stdcall, importc, wgl.} - # WIN_swap_hint - proc glAddSwapHintRectWIN*(x: GLint, y: GLint, width: GLsizei, height: GLsizei){. - stdcall, importc, wgl.} -when defined(LINUX): - proc glXChooseVisual*(dpy: PDisplay, screen: GLint, attribList: PGLint): PXVisualInfo{. - stdcall, importc, oglx.} - proc glXCopyContext*(dpy: PDisplay, src: GLXContext, dst: GLXContext, - mask: GLuint){.stdcall, importc, oglx.} - proc glXCreateContext*(dpy: PDisplay, vis: PXVisualInfo, - shareList: GLXContext, direct: GLboolean): GLXContext{. - stdcall, importc, oglx.} - proc glXCreateGLXPixmap*(dpy: PDisplay, vis: PXVisualInfo, pixmap: Pixmap): GLXPixmap{. - stdcall, importc, oglx.} - proc glXDestroyContext*(dpy: PDisplay, ctx: GLXContext){.stdcall, importc, oglx.} - proc glXDestroyGLXPixmap*(dpy: PDisplay, pix: GLXPixmap){.stdcall, importc, oglx.} - proc glXGetConfig*(dpy: PDisplay, vis: PXVisualInfo, attrib: GLint, - value: PGLint): GLint{.stdcall, importc, oglx.} - proc glXGetCurrentContext*(): GLXContext{.stdcall, importc, oglx.} - proc glXGetCurrentDrawable*(): GLXDrawable{.stdcall, importc, oglx.} - proc glXIsDirect*(dpy: PDisplay, ctx: GLXContext): glboolean{.stdcall, importc, oglx.} - proc glXMakeCurrent*(dpy: PDisplay, drawable: GLXDrawable, ctx: GLXContext): GLboolean{. - stdcall, importc, oglx.} - proc glXQueryExtension*(dpy: PDisplay, errorBase: PGLint, eventBase: PGLint): GLboolean{. - stdcall, importc, oglx.} - proc glXQueryVersion*(dpy: PDisplay, major: PGLint, minor: PGLint): GLboolean{. - stdcall, importc, oglx.} - proc glXSwapBuffers*(dpy: PDisplay, drawable: GLXDrawable){.stdcall, importc, oglx.} - proc glXUseXFont*(font: Font, first: GLint, count: GLint, listBase: GLint){. - stdcall, importc, oglx.} - proc glXWaitGL*(){.stdcall, importc, oglx.} - proc glXWaitX*(){.stdcall, importc, oglx.} - proc glXGetClientString*(dpy: PDisplay, name: GLint): PGLchar{.stdcall, importc, oglx.} - proc glXQueryServerString*(dpy: PDisplay, screen: GLint, name: GLint): PGLchar{. - stdcall, importc, oglx.} - proc glXQueryExtensionsString*(dpy: PDisplay, screen: GLint): PGLchar{.stdcall, importc, oglx.} - # GLX_VERSION_1_3 - proc glXGetFBConfigs*(dpy: PDisplay, screen: GLint, nelements: PGLint): GLXFBConfig{. - stdcall, importc, oglx.} - proc glXChooseFBConfig*(dpy: PDisplay, screen: GLint, attrib_list: PGLint, - nelements: PGLint): GLXFBConfig{.stdcall, importc, oglx.} - proc glXGetFBConfigAttrib*(dpy: PDisplay, config: GLXFBConfig, - attribute: GLint, value: PGLint): glint{.stdcall, importc, oglx.} - proc glXGetVisualFromFBConfig*(dpy: PDisplay, config: GLXFBConfig): PXVisualInfo{.stdcall, importc, oglx.} - proc glXCreateWindow*(dpy: PDisplay, config: GLXFBConfig, win: Window, - attrib_list: PGLint): GLXWindow{.stdcall, importc, oglx.} - proc glXDestroyWindow*(dpy: PDisplay, win: GLXWindow){.stdcall, importc, oglx.} - proc glXCreatePixmap*(dpy: PDisplay, config: GLXFBConfig, pixmap: Pixmap, - attrib_list: PGLint): GLXPixmap{.stdcall, importc, oglx.} - proc glXDestroyPixmap*(dpy: PDisplay, pixmap: GLXPixmap){.stdcall, importc, oglx.} - proc glXCreatePbuffer*(dpy: PDisplay, config: GLXFBConfig, attrib_list: PGLint): GLXPbuffer{. - stdcall, importc, oglx.} - proc glXDestroyPbuffer*(dpy: PDisplay, pbuf: GLXPbuffer){.stdcall, importc, oglx.} - proc glXQueryDrawable*(dpy: PDisplay, draw: GLXDrawable, attribute: GLint, - value: PGLuint){.stdcall, importc, oglx.} - proc glXCreateNewContext*(dpy: PDisplay, config: GLXFBConfig, - rendertyp: GLint, share_list: GLXContext, - direct: GLboolean): GLXContext{.stdcall, importc, oglx.} - proc glXMakeContextCurrent*(display: PDisplay, draw: GLXDrawable, - read: GLXDrawable, ctx: GLXContext): GLboolean{. - stdcall, importc, oglx.} - proc glXGetCurrentReadDrawable*(): GLXDrawable{.stdcall, importc, oglx.} - proc glXGetCurreentDisplay*(): PDisplay{.stdcall, importc, oglx.} - proc glXQueryContext*(dpy: PDisplay, ctx: GLXContext, attribute: GLint, - value: PGLint): GLint{.stdcall, importc, oglx.} - proc glXSelectEvent*(dpy: PDisplay, draw: GLXDrawable, event_mask: GLuint){. - stdcall, importc, oglx.} - proc glXGetSelectedEvent*(dpy: PDisplay, draw: GLXDrawable, - event_mask: PGLuint){.stdcall, importc, oglx.} - # GLX_VERSION_1_4 - when not defined(glXGetProcAddress): - proc glXGetProcAddress*(name: cstring): pointer{.stdcall, importc, oglx.} - # GLX_ARB_get_proc_address - when not defined(glXGetProcAddressARB): - proc glXGetProcAddressARB*(name: cstring): pointer{.stdcall, importc, oglx.} - # GLX_ARB_create_context - proc glXCreateContextAttribsARB*(dpy: PDisplay, config: GLXFBConfig, - share_context: GLXContext, direct: GLboolean, - attrib_list: PGLint): GLXContext{.stdcall, importc, oglx.} - # GLX_EXT_import_context - proc glXGetCurrentDisplayEXT*(): PDisplay{.stdcall, importc, oglx.} - proc glXQueryContextInfoEXT*(dpy: PDisplay, context: GLXContext, - attribute: GLint, value: PGLint): GLint{.stdcall, importc, oglx.} - proc glXGetContextIDEXT*(context: GLXContext): GLXContextID{.stdcall, importc, oglx.} - proc glXImportContextEXT*(dpy: PDisplay, contextID: GLXContextID): GLXContext{. - stdcall, importc, oglx.} - proc glXFreeContextEXT*(dpy: PDisplay, context: GLXContext){.stdcall, importc, oglx.} - # GLX_EXT_texture_from_pixmap - proc glXBindTexImageEXT*(dpy: PDisplay, drawable: GLXDrawable, buffer: GLint, - attrib_list: PGLint){.stdcall, importc, oglx.} - proc glXReleaseTexImageEXT*(dpy: PDisplay, drawable: GLXDrawable, - buffer: GLint){.stdcall, importc, oglx.} -# GL utility functions and procedures - -proc gluErrorString*(errCode: GLEnum): cstring{.stdcall, importc, glu.} -proc gluGetString*(name: GLEnum): cstring{.stdcall, importc, glu.} -proc gluOrtho2D*(left, right, bottom, top: GLdouble){.stdcall, importc, glu.} -proc gluPerspective*(fovy, aspect, zNear, zFar: GLdouble){.stdcall, importc, glu.} -proc gluPickMatrix*(x, y, width, height: GLdouble, viewport: TVector4i){.stdcall, importc, glu.} -proc gluLookAt*(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: GLdouble){. - stdcall, importc, glu.} -proc gluProject*(objx, objy, objz: GLdouble, modelMatrix: TGLMatrixd4, - projMatrix: TGLMatrixd4, viewport: TVector4i, - winx, winy, winz: PGLdouble): GLint{.stdcall, importc, glu.} -proc gluUnProject*(winx, winy, winz: GLdouble, modelMatrix: TGLMatrixd4, - projMatrix: TGLMatrixd4, viewport: TVector4i, - objx, objy, objz: PGLdouble): GLint{.stdcall, importc, glu.} -proc gluScaleImage*(format: GLEnum, widthin, heightin: GLint, typein: GLEnum, - datain: Pointer, widthout, heightout: GLint, - typeout: GLEnum, dataout: Pointer): GLint{.stdcall, importc, glu.} -proc gluBuild1DMipmaps*(target: GLEnum, components, width: GLint, - format, atype: GLEnum, data: Pointer): GLint{.stdcall, importc, glu.} -proc gluBuild2DMipmaps*(target: GLEnum, components, width, height: GLint, - format, atype: GLEnum, Data: Pointer): GLint{.stdcall, importc, glu.} -proc gluNewQuadric*(): PGLUquadric{.stdcall, importc, glu.} -proc gluDeleteQuadric*(state: PGLUquadric){.stdcall, importc, glu.} -proc gluQuadricNormals*(quadObject: PGLUquadric, normals: GLEnum){.stdcall, importc, glu.} -proc gluQuadricTexture*(quadObject: PGLUquadric, textureCoords: GLboolean){. - stdcall, importc, glu.} -proc gluQuadricOrientation*(quadObject: PGLUquadric, orientation: GLEnum){. - stdcall, importc, glu.} -proc gluQuadricDrawStyle*(quadObject: PGLUquadric, drawStyle: GLEnum){.stdcall, importc, glu.} -proc gluCylinder*(quadObject: PGLUquadric, - baseRadius, topRadius, height: GLdouble, slices, stacks: GLint){. - stdcall, importc, glu.} -proc gluDisk*(quadObject: PGLUquadric, innerRadius, outerRadius: GLdouble, - slices, loops: GLint){.stdcall, importc, glu.} -proc gluPartialDisk*(quadObject: PGLUquadric, - innerRadius, outerRadius: GLdouble, slices, loops: GLint, - startAngle, sweepAngle: GLdouble){.stdcall, importc, glu.} -proc gluSphere*(quadObject: PGLUquadric, radius: GLdouble, slices, stacks: GLint){. - stdcall, importc, glu.} -proc gluQuadricCallback*(quadObject: PGLUquadric, which: GLEnum, - fn: TGLUQuadricErrorProc){.stdcall, importc, glu.} -proc gluNewTess*(): PGLUtesselator{.stdcall, importc, glu.} -proc gluDeleteTess*(tess: PGLUtesselator){.stdcall, importc, glu.} -proc gluTessBeginPolygon*(tess: PGLUtesselator, polygon_data: Pointer){.stdcall, importc, glu.} -proc gluTessBeginContour*(tess: PGLUtesselator){.stdcall, importc, glu.} -proc gluTessVertex*(tess: PGLUtesselator, coords: TGLArrayd3, data: Pointer){. - stdcall, importc, glu.} -proc gluTessEndContour*(tess: PGLUtesselator){.stdcall, importc, glu.} -proc gluTessEndPolygon*(tess: PGLUtesselator){.stdcall, importc, glu.} -proc gluTessProperty*(tess: PGLUtesselator, which: GLEnum, value: GLdouble){. - stdcall, importc, glu.} -proc gluTessNormal*(tess: PGLUtesselator, x, y, z: GLdouble){.stdcall, importc, glu.} -proc gluTessCallback*(tess: PGLUtesselator, which: GLEnum, fn: Pointer){.stdcall, importc, glu.} -proc gluGetTessProperty*(tess: PGLUtesselator, which: GLEnum, value: PGLdouble){. - stdcall, importc, glu.} -proc gluNewNurbsRenderer*(): PGLUnurbs{.stdcall, importc, glu.} -proc gluDeleteNurbsRenderer*(nobj: PGLUnurbs){.stdcall, importc, glu.} -proc gluBeginSurface*(nobj: PGLUnurbs){.stdcall, importc, glu.} -proc gluBeginCurve*(nobj: PGLUnurbs){.stdcall, importc, glu.} -proc gluEndCurve*(nobj: PGLUnurbs){.stdcall, importc, glu.} -proc gluEndSurface*(nobj: PGLUnurbs){.stdcall, importc, glu.} -proc gluBeginTrim*(nobj: PGLUnurbs){.stdcall, importc, glu.} -proc gluEndTrim*(nobj: PGLUnurbs){.stdcall, importc, glu.} -proc gluPwlCurve*(nobj: PGLUnurbs, count: GLint, points: PGLfloat, - stride: GLint, atype: GLEnum){.stdcall, importc, glu.} -proc gluNurbsCurve*(nobj: PGLUnurbs, nknots: GLint, knot: PGLfloat, - stride: GLint, ctlarray: PGLfloat, order: GLint, - atype: GLEnum){.stdcall, importc, glu.} -proc gluNurbsSurface*(nobj: PGLUnurbs, sknot_count: GLint, sknot: PGLfloat, - tknot_count: GLint, tknot: PGLfloat, - s_stride, t_stride: GLint, ctlarray: PGLfloat, - sorder, torder: GLint, atype: GLEnum){.stdcall, importc, glu.} -proc gluLoadSamplingMatrices*(nobj: PGLUnurbs, - modelMatrix, projMatrix: TGLMatrixf4, - viewport: TVector4i){.stdcall, importc, glu.} -proc gluNurbsProperty*(nobj: PGLUnurbs, aproperty: GLEnum, value: GLfloat){. - stdcall, importc, glu.} -proc gluGetNurbsProperty*(nobj: PGLUnurbs, aproperty: GLEnum, value: PGLfloat){. - stdcall, importc, glu.} -proc gluNurbsCallback*(nobj: PGLUnurbs, which: GLEnum, fn: TGLUNurbsErrorProc){. - stdcall, importc, glu.} -proc gluBeginPolygon*(tess: PGLUtesselator){.stdcall, importc, glu.} -proc gluNextContour*(tess: PGLUtesselator, atype: GLEnum){.stdcall, importc, glu.} -proc gluEndPolygon*(tess: PGLUtesselator){.stdcall, importc, glu.} - -type - TRCOption* = enum - opDoubleBuffered, opGDI, opStereo - TRCOptions* = set[TRCOption] - -var LastPixelFormat*: int - -when defined(windows): - proc CreateRenderingContext*(DC: HDC, Options: TRCOptions, ColorBits, ZBits, - StencilBits, AccumBits, AuxBuffers: int, Layer: int): HGLRC - proc DestroyRenderingContext*(RC: HGLRC) - proc ActivateRenderingContext*(DC: HDC, RC: HGLRC) - proc DeactivateRenderingContext*() -# implementation - -proc GetExtensionString*(): string = - when defined(windows): - result = $glGetString(GL_EXTENSIONS) & ' ' & $wglGetExtensionsStringEXT() & - ' ' & $wglGetExtensionsStringARB(wglGetCurrentDC()) - else: - result = $glGetString(GL_EXTENSIONS) - -when defined(windows): - proc CreateRenderingContext(DC: HDC, Options: TRCOptions, ColorBits, ZBits, - StencilBits, AccumBits, AuxBuffers: int, Layer: int): HGLRC = - type - TPIXELFORMATDESCRIPTOR {.final, pure.} = object - nSize: int16 - nVersion: int16 - dwFlags: DWORD - iPixelType: int8 - cColorBits: int8 - cRedBits: int8 - cRedShift: int8 - cGreenBits: int8 - cGreenShift: int8 - cBlueBits: int8 - cBlueShift: int8 - cAlphaBits: int8 - cAlphaShift: int8 - cAccumBits: int8 - cAccumRedBits: int8 - cAccumGreenBits: int8 - cAccumBlueBits: int8 - cAccumAlphaBits: int8 - cDepthBits: int8 - cStencilBits: int8 - cAuxBuffers: int8 - iLayerType: int8 - bReserved: int8 - dwLayerMask: DWORD - dwVisibleMask: DWORD - dwDamageMask: DWORD - - proc GetObjectType(h: HDC): DWORD{.stdcall, dynlib: "gdi32", - importc: "GetObjectType".} - proc ChoosePixelFormat(para1: HDC, para2: ptr TPIXELFORMATDESCRIPTOR): int32{. - stdcall, dynlib: "gdi32", importc: "ChoosePixelFormat".} - proc GetPixelFormat(para1: HDC): int32{.stdcall, dynlib: "gdi32", - importc: "GetPixelFormat".} - proc SetPixelFormat(para1: HDC, para2: int32, - para3: ptr TPIXELFORMATDESCRIPTOR): WINBOOL{. - stdcall, dynlib: "gdi32", importc: "SetPixelFormat".} - proc DescribePixelFormat(para1: HDC, para2, para3: int32, - para4: ptr TPIXELFORMATDESCRIPTOR) {.stdcall, - dynlib: "gdi32", importc: "DescribePixelFormat".} - - const - OBJ_MEMDC = 10'i32 - OBJ_ENHMETADC = 12'i32 - OBJ_METADC = 4'i32 - PFD_DOUBLEBUFFER = 0x00000001 - PFD_STEREO = 0x00000002 - PFD_DRAW_TO_WINDOW = 0x00000004 - PFD_DRAW_TO_BITMAP = 0x00000008 - PFD_SUPPORT_GDI = 0x00000010 - PFD_SUPPORT_OPENGL = 0x00000020 - PFDtyp_RGBA = 0'i8 - PFD_MAIN_PLANE = 0'i8 - PFD_OVERLAY_PLANE = 1'i8 - PFD_UNDERLAY_PLANE = int32(- 1) - var - PFDescriptor: TPixelFormatDescriptor - PixelFormat: int32 - AType: int32 - PFDescriptor.nSize = SizeOf(PFDescriptor).int16 - PFDescriptor.nVersion = 1'i16 - PFDescriptor.dwFlags = PFD_SUPPORT_OPENGL - AType = GetObjectType(DC) - if AType == 0: OSError() - if AType == OBJ_MEMDC or AType == OBJ_METADC or AType == OBJ_ENHMETADC: - PFDescriptor.dwFlags = PFDescriptor.dwFlags or PFD_DRAW_TO_BITMAP - else: - PFDescriptor.dwFlags = PFDescriptor.dwFlags or PFD_DRAW_TO_WINDOW - if opDoubleBuffered in Options: - PFDescriptor.dwFlags = PFDescriptor.dwFlags or PFD_DOUBLEBUFFER - if opGDI in Options: - PFDescriptor.dwFlags = PFDescriptor.dwFlags or PFD_SUPPORT_GDI - if opStereo in Options: - PFDescriptor.dwFlags = PFDescriptor.dwFlags or PFD_STEREO - PFDescriptor.iPixelType = PFDtyp_RGBA - PFDescriptor.cColorBits = ColorBits.toU8 - PFDescriptor.cDepthBits = zBits.toU8 - PFDescriptor.cStencilBits = StencilBits.toU8 - PFDescriptor.cAccumBits = AccumBits.toU8 - PFDescriptor.cAuxBuffers = AuxBuffers.toU8 - if Layer == 0: PFDescriptor.iLayerType = PFD_MAIN_PLANE - elif Layer > 0: PFDescriptor.iLayerType = PFD_OVERLAY_PLANE - else: PFDescriptor.iLayerType = int8(PFD_UNDERLAY_PLANE) - PixelFormat = ChoosePixelFormat(DC, addr(PFDescriptor)) - if PixelFormat == 0: OSError() - if GetPixelFormat(DC) != PixelFormat: - if SetPixelFormat(DC, PixelFormat, addr(PFDescriptor)) == 0'i32: - OSError() - DescribePixelFormat(DC, PixelFormat.int32, SizeOf(PFDescriptor).int32, - addr(PFDescriptor)) - Result = wglCreateContext(DC) - if Result == 0: OSError() - else: LastPixelFormat = 0 - - proc DestroyRenderingContext(RC: HGLRC) = - discard wglDeleteContext(RC) - - proc ActivateRenderingContext(DC: HDC, RC: HGLRC) = - discard wglMakeCurrent(DC, RC) - - proc DeactivateRenderingContext() = - discard wglMakeCurrent(0, 0) diff --git a/lib/wrappers/opengl/wingl.nim b/lib/wrappers/opengl/wingl.nim deleted file mode 100644 index 7ed78f9707..0000000000 --- a/lib/wrappers/opengl/wingl.nim +++ /dev/null @@ -1,368 +0,0 @@ -import - gl, windows - -proc wglGetExtensionsStringARB*(hdc: HDC): cstring{.dynlib: dllname, - importc: "wglGetExtensionsStringARB".} -const - WGL_FRONT_COLOR_BUFFER_BIT_ARB* = 0x00000001 - WGL_BACK_COLOR_BUFFER_BIT_ARB* = 0x00000002 - WGL_DEPTH_BUFFER_BIT_ARB* = 0x00000004 - WGL_STENCIL_BUFFER_BIT_ARB* = 0x00000008 - -proc WinChoosePixelFormat*(DC: HDC, p2: PPixelFormatDescriptor): int{. - dynlib: "gdi32", importc: "ChoosePixelFormat".} -proc wglCreateBufferRegionARB*(hDC: HDC, iLayerPlane: TGLint, uType: TGLuint): THandle{. - dynlib: dllname, importc: "wglCreateBufferRegionARB".} -proc wglDeleteBufferRegionARB*(hRegion: THandle){.dynlib: dllname, - importc: "wglDeleteBufferRegionARB".} -proc wglSaveBufferRegionARB*(hRegion: THandle, x: TGLint, y: TGLint, - width: TGLint, height: TGLint): BOOL{. - dynlib: dllname, importc: "wglSaveBufferRegionARB".} -proc wglRestoreBufferRegionARB*(hRegion: THandle, x: TGLint, y: TGLint, - width: TGLint, height: TGLint, xSrc: TGLint, - ySrc: TGLint): BOOL{.dynlib: dllname, - importc: "wglRestoreBufferRegionARB".} -proc wglAllocateMemoryNV*(size: TGLsizei, readFrequency: TGLfloat, - writeFrequency: TGLfloat, priority: TGLfloat): PGLvoid{. - dynlib: dllname, importc: "wglAllocateMemoryNV".} -proc wglFreeMemoryNV*(pointer: PGLvoid){.dynlib: dllname, - importc: "wglFreeMemoryNV".} -const - WGL_IMAGE_BUFFER_MIN_ACCESS_I3D* = 0x00000001 - WGL_IMAGE_BUFFER_LOCK_I3D* = 0x00000002 - -proc wglCreateImageBufferI3D*(hDC: HDC, dwSize: DWORD, uFlags: UINT): PGLvoid{. - dynlib: dllname, importc: "wglCreateImageBufferI3D".} -proc wglDestroyImageBufferI3D*(hDC: HDC, pAddress: PGLvoid): BOOL{. - dynlib: dllname, importc: "wglDestroyImageBufferI3D".} -proc wglAssociateImageBufferEventsI3D*(hdc: HDC, pEvent: PHandle, - pAddress: PGLvoid, pSize: PDWORD, - count: UINT): BOOL{.dynlib: dllname, - importc: "wglAssociateImageBufferEventsI3D".} -proc wglReleaseImageBufferEventsI3D*(hdc: HDC, pAddress: PGLvoid, count: UINT): BOOL{. - dynlib: dllname, importc: "wglReleaseImageBufferEventsI3D".} -proc wglEnableFrameLockI3D*(): BOOL{.dynlib: dllname, - importc: "wglEnableFrameLockI3D".} -proc wglDisableFrameLockI3D*(): BOOL{.dynlib: dllname, - importc: "wglDisableFrameLockI3D".} -proc wglIsEnabledFrameLockI3D*(pFlag: PBOOL): BOOL{.dynlib: dllname, - importc: "wglIsEnabledFrameLockI3D".} -proc wglQueryFrameLockMasterI3D*(pFlag: PBOOL): BOOL{.dynlib: dllname, - importc: "wglQueryFrameLockMasterI3D".} -proc wglGetFrameUsageI3D*(pUsage: PGLfloat): BOOL{.dynlib: dllname, - importc: "wglGetFrameUsageI3D".} -proc wglBeginFrameTrackingI3D*(): BOOL{.dynlib: dllname, - importc: "wglBeginFrameTrackingI3D".} -proc wglEndFrameTrackingI3D*(): BOOL{.dynlib: dllname, - importc: "wglEndFrameTrackingI3D".} -proc wglQueryFrameTrackingI3D*(pFrameCount: PDWORD, pMissedFrames: PDWORD, - pLastMissedUsage: PGLfloat): BOOL{. - dynlib: dllname, importc: "wglQueryFrameTrackingI3D".} -const - WGL_NUMBER_PIXEL_FORMATS_ARB* = 0x00002000 - WGL_DRAW_TO_WINDOW_ARB* = 0x00002001 - WGL_DRAW_TO_BITMAP_ARB* = 0x00002002 - WGL_ACCELERATION_ARB* = 0x00002003 - WGL_NEED_PALETTE_ARB* = 0x00002004 - WGL_NEED_SYSTEM_PALETTE_ARB* = 0x00002005 - WGL_SWAP_LAYER_BUFFERS_ARB* = 0x00002006 - WGL_SWAP_METHOD_ARB* = 0x00002007 - WGL_NUMBER_OVERLAYS_ARB* = 0x00002008 - WGL_NUMBER_UNDERLAYS_ARB* = 0x00002009 - WGL_TRANSPARENT_ARB* = 0x0000200A - WGL_TRANSPARENT_RED_VALUE_ARB* = 0x00002037 - WGL_TRANSPARENT_GREEN_VALUE_ARB* = 0x00002038 - WGL_TRANSPARENT_BLUE_VALUE_ARB* = 0x00002039 - WGL_TRANSPARENT_ALPHA_VALUE_ARB* = 0x0000203A - WGL_TRANSPARENT_INDEX_VALUE_ARB* = 0x0000203B - WGL_SHARE_DEPTH_ARB* = 0x0000200C - WGL_SHARE_STENCIL_ARB* = 0x0000200D - WGL_SHARE_ACCUM_ARB* = 0x0000200E - WGL_SUPPORT_GDI_ARB* = 0x0000200F - WGL_SUPPORT_OPENGL_ARB* = 0x00002010 - WGL_DOUBLE_BUFFER_ARB* = 0x00002011 - WGL_STEREO_ARB* = 0x00002012 - WGL_PIXEL_TYPE_ARB* = 0x00002013 - WGL_COLOR_BITS_ARB* = 0x00002014 - WGL_RED_BITS_ARB* = 0x00002015 - WGL_RED_SHIFT_ARB* = 0x00002016 - WGL_GREEN_BITS_ARB* = 0x00002017 - WGL_GREEN_SHIFT_ARB* = 0x00002018 - WGL_BLUE_BITS_ARB* = 0x00002019 - WGL_BLUE_SHIFT_ARB* = 0x0000201A - WGL_ALPHA_BITS_ARB* = 0x0000201B - WGL_ALPHA_SHIFT_ARB* = 0x0000201C - WGL_ACCUM_BITS_ARB* = 0x0000201D - WGL_ACCUM_RED_BITS_ARB* = 0x0000201E - WGL_ACCUM_GREEN_BITS_ARB* = 0x0000201F - WGL_ACCUM_BLUE_BITS_ARB* = 0x00002020 - WGL_ACCUM_ALPHA_BITS_ARB* = 0x00002021 - WGL_DEPTH_BITS_ARB* = 0x00002022 - WGL_STENCIL_BITS_ARB* = 0x00002023 - WGL_AUX_BUFFERS_ARB* = 0x00002024 - WGL_NO_ACCELERATION_ARB* = 0x00002025 - WGL_GENERIC_ACCELERATION_ARB* = 0x00002026 - WGL_FULL_ACCELERATION_ARB* = 0x00002027 - WGL_SWAP_EXCHANGE_ARB* = 0x00002028 - WGL_SWAP_COPY_ARB* = 0x00002029 - WGL_SWAP_UNDEFINED_ARB* = 0x0000202A - WGL_TYPE_RGBA_ARB* = 0x0000202B - WGL_TYPE_COLORINDEX_ARB* = 0x0000202C - -proc wglGetPixelFormatAttribivARB*(hdc: HDC, iPixelFormat: TGLint, - iLayerPlane: TGLint, nAttributes: TGLuint, - piAttributes: PGLint, piValues: PGLint): BOOL{. - dynlib: dllname, importc: "wglGetPixelFormatAttribivARB".} -proc wglGetPixelFormatAttribfvARB*(hdc: HDC, iPixelFormat: TGLint, - iLayerPlane: TGLint, nAttributes: TGLuint, - piAttributes: PGLint, pfValues: PGLfloat): BOOL{. - dynlib: dllname, importc: "wglGetPixelFormatAttribfvARB".} -proc wglChoosePixelFormatARB*(hdc: HDC, piAttribIList: PGLint, - pfAttribFList: PGLfloat, nMaxFormats: TGLuint, - piFormats: PGLint, nNumFormats: PGLuint): BOOL{. - dynlib: dllname, importc: "wglChoosePixelFormatARB".} -const - WGL_ERROR_INVALID_PIXEL_TYPE_ARB* = 0x00002043 - WGL_ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB* = 0x00002054 - -proc wglMakeContextCurrentARB*(hDrawDC: HDC, hReadDC: HDC, hglrc: HGLRC): BOOL{. - dynlib: dllname, importc: "wglMakeContextCurrentARB".} -proc wglGetCurrentReadDCARB*(): HDC{.dynlib: dllname, - importc: "wglGetCurrentReadDCARB".} -const - WGL_DRAW_TO_PBUFFER_ARB* = 0x0000202D # WGL_DRAW_TO_PBUFFER_ARB { already defined } - WGL_MAX_PBUFFER_PIXELS_ARB* = 0x0000202E - WGL_MAX_PBUFFER_WIDTH_ARB* = 0x0000202F - WGL_MAX_PBUFFER_HEIGHT_ARB* = 0x00002030 - WGL_PBUFFER_LARGEST_ARB* = 0x00002033 - WGL_PBUFFER_WIDTH_ARB* = 0x00002034 - WGL_PBUFFER_HEIGHT_ARB* = 0x00002035 - WGL_PBUFFER_LOST_ARB* = 0x00002036 - -proc wglCreatePbufferARB*(hDC: HDC, iPixelFormat: TGLint, iWidth: TGLint, - iHeight: TGLint, piAttribList: PGLint): THandle{. - dynlib: dllname, importc: "wglCreatePbufferARB".} -proc wglGetPbufferDCARB*(hPbuffer: THandle): HDC{.dynlib: dllname, - importc: "wglGetPbufferDCARB".} -proc wglReleasePbufferDCARB*(hPbuffer: THandle, hDC: HDC): TGLint{. - dynlib: dllname, importc: "wglReleasePbufferDCARB".} -proc wglDestroyPbufferARB*(hPbuffer: THandle): BOOL{.dynlib: dllname, - importc: "wglDestroyPbufferARB".} -proc wglQueryPbufferARB*(hPbuffer: THandle, iAttribute: TGLint, piValue: PGLint): BOOL{. - dynlib: dllname, importc: "wglQueryPbufferARB".} -proc wglSwapIntervalEXT*(interval: TGLint): BOOL{.dynlib: dllname, - importc: "wglSwapIntervalEXT".} -proc wglGetSwapIntervalEXT*(): TGLint{.dynlib: dllname, - importc: "wglGetSwapIntervalEXT".} -const - WGL_BIND_TO_TEXTURE_RGB_ARB* = 0x00002070 - WGL_BIND_TO_TEXTURE_RGBA_ARB* = 0x00002071 - WGL_TEXTURE_FORMAT_ARB* = 0x00002072 - WGL_TEXTURE_TARGET_ARB* = 0x00002073 - WGL_MIPMAP_TEXTURE_ARB* = 0x00002074 - WGL_TEXTURE_RGB_ARB* = 0x00002075 - WGL_TEXTURE_RGBA_ARB* = 0x00002076 - WGL_NO_TEXTURE_ARB* = 0x00002077 - WGL_TEXTURE_CUBE_MAP_ARB* = 0x00002078 - WGL_TEXTURE_1D_ARB* = 0x00002079 - WGL_TEXTURE_2D_ARB* = 0x0000207A # WGL_NO_TEXTURE_ARB { already defined } - WGL_MIPMAP_LEVEL_ARB* = 0x0000207B - WGL_CUBE_MAP_FACE_ARB* = 0x0000207C - WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB* = 0x0000207D - WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB* = 0x0000207E - WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB* = 0x0000207F - WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB* = 0x00002080 - WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB* = 0x00002081 - WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB* = 0x00002082 - WGL_FRONT_LEFT_ARB* = 0x00002083 - WGL_FRONT_RIGHT_ARB* = 0x00002084 - WGL_BACK_LEFT_ARB* = 0x00002085 - WGL_BACK_RIGHT_ARB* = 0x00002086 - WGL_AUX0_ARB* = 0x00002087 - WGL_AUX1_ARB* = 0x00002088 - WGL_AUX2_ARB* = 0x00002089 - WGL_AUX3_ARB* = 0x0000208A - WGL_AUX4_ARB* = 0x0000208B - WGL_AUX5_ARB* = 0x0000208C - WGL_AUX6_ARB* = 0x0000208D - WGL_AUX7_ARB* = 0x0000208E - WGL_AUX8_ARB* = 0x0000208F - WGL_AUX9_ARB* = 0x00002090 - -proc wglBindTexImageARB*(hPbuffer: THandle, iBuffer: TGLint): BOOL{. - dynlib: dllname, importc: "wglBindTexImageARB".} -proc wglReleaseTexImageARB*(hPbuffer: THandle, iBuffer: TGLint): BOOL{. - dynlib: dllname, importc: "wglReleaseTexImageARB".} -proc wglSetPbufferAttribARB*(hPbuffer: THandle, piAttribList: PGLint): BOOL{. - dynlib: dllname, importc: "wglSetPbufferAttribARB".} -proc wglGetExtensionsStringEXT*(): cstring{.dynlib: dllname, - importc: "wglGetExtensionsStringEXT".} -proc wglMakeContextCurrentEXT*(hDrawDC: HDC, hReadDC: HDC, hglrc: HGLRC): BOOL{. - dynlib: dllname, importc: "wglMakeContextCurrentEXT".} -proc wglGetCurrentReadDCEXT*(): HDC{.dynlib: dllname, - importc: "wglGetCurrentReadDCEXT".} -const - WGL_DRAW_TO_PBUFFER_EXT* = 0x0000202D - WGL_MAX_PBUFFER_PIXELS_EXT* = 0x0000202E - WGL_MAX_PBUFFER_WIDTH_EXT* = 0x0000202F - WGL_MAX_PBUFFER_HEIGHT_EXT* = 0x00002030 - WGL_OPTIMAL_PBUFFER_WIDTH_EXT* = 0x00002031 - WGL_OPTIMAL_PBUFFER_HEIGHT_EXT* = 0x00002032 - WGL_PBUFFER_LARGEST_EXT* = 0x00002033 - WGL_PBUFFER_WIDTH_EXT* = 0x00002034 - WGL_PBUFFER_HEIGHT_EXT* = 0x00002035 - -proc wglCreatePbufferEXT*(hDC: HDC, iPixelFormat: TGLint, iWidth: TGLint, - iHeight: TGLint, piAttribList: PGLint): THandle{. - dynlib: dllname, importc: "wglCreatePbufferEXT".} -proc wglGetPbufferDCEXT*(hPbuffer: THandle): HDC{.dynlib: dllname, - importc: "wglGetPbufferDCEXT".} -proc wglReleasePbufferDCEXT*(hPbuffer: THandle, hDC: HDC): TGLint{. - dynlib: dllname, importc: "wglReleasePbufferDCEXT".} -proc wglDestroyPbufferEXT*(hPbuffer: THandle): BOOL{.dynlib: dllname, - importc: "wglDestroyPbufferEXT".} -proc wglQueryPbufferEXT*(hPbuffer: THandle, iAttribute: TGLint, piValue: PGLint): BOOL{. - dynlib: dllname, importc: "wglQueryPbufferEXT".} -const - WGL_NUMBER_PIXEL_FORMATS_EXT* = 0x00002000 - WGL_DRAW_TO_WINDOW_EXT* = 0x00002001 - WGL_DRAW_TO_BITMAP_EXT* = 0x00002002 - WGL_ACCELERATION_EXT* = 0x00002003 - WGL_NEED_PALETTE_EXT* = 0x00002004 - WGL_NEED_SYSTEM_PALETTE_EXT* = 0x00002005 - WGL_SWAP_LAYER_BUFFERS_EXT* = 0x00002006 - WGL_SWAP_METHOD_EXT* = 0x00002007 - WGL_NUMBER_OVERLAYS_EXT* = 0x00002008 - WGL_NUMBER_UNDERLAYS_EXT* = 0x00002009 - WGL_TRANSPARENT_EXT* = 0x0000200A - WGL_TRANSPARENT_VALUE_EXT* = 0x0000200B - WGL_SHARE_DEPTH_EXT* = 0x0000200C - WGL_SHARE_STENCIL_EXT* = 0x0000200D - WGL_SHARE_ACCUM_EXT* = 0x0000200E - WGL_SUPPORT_GDI_EXT* = 0x0000200F - WGL_SUPPORT_OPENGL_EXT* = 0x00002010 - WGL_DOUBLE_BUFFER_EXT* = 0x00002011 - WGL_STEREO_EXT* = 0x00002012 - WGL_PIXEL_TYPE_EXT* = 0x00002013 - WGL_COLOR_BITS_EXT* = 0x00002014 - WGL_RED_BITS_EXT* = 0x00002015 - WGL_RED_SHIFT_EXT* = 0x00002016 - WGL_GREEN_BITS_EXT* = 0x00002017 - WGL_GREEN_SHIFT_EXT* = 0x00002018 - WGL_BLUE_BITS_EXT* = 0x00002019 - WGL_BLUE_SHIFT_EXT* = 0x0000201A - WGL_ALPHA_BITS_EXT* = 0x0000201B - WGL_ALPHA_SHIFT_EXT* = 0x0000201C - WGL_ACCUM_BITS_EXT* = 0x0000201D - WGL_ACCUM_RED_BITS_EXT* = 0x0000201E - WGL_ACCUM_GREEN_BITS_EXT* = 0x0000201F - WGL_ACCUM_BLUE_BITS_EXT* = 0x00002020 - WGL_ACCUM_ALPHA_BITS_EXT* = 0x00002021 - WGL_DEPTH_BITS_EXT* = 0x00002022 - WGL_STENCIL_BITS_EXT* = 0x00002023 - WGL_AUX_BUFFERS_EXT* = 0x00002024 - WGL_NO_ACCELERATION_EXT* = 0x00002025 - WGL_GENERIC_ACCELERATION_EXT* = 0x00002026 - WGL_FULL_ACCELERATION_EXT* = 0x00002027 - WGL_SWAP_EXCHANGE_EXT* = 0x00002028 - WGL_SWAP_COPY_EXT* = 0x00002029 - WGL_SWAP_UNDEFINED_EXT* = 0x0000202A - WGL_TYPE_RGBA_EXT* = 0x0000202B - WGL_TYPE_COLORINDEX_EXT* = 0x0000202C - -proc wglGetPixelFormatAttribivEXT*(hdc: HDC, iPixelFormat: TGLint, - iLayerPlane: TGLint, nAttributes: TGLuint, - piAttributes: PGLint, piValues: PGLint): BOOL{. - dynlib: dllname, importc: "wglGetPixelFormatAttribivEXT".} -proc wglGetPixelFormatAttribfvEXT*(hdc: HDC, iPixelFormat: TGLint, - iLayerPlane: TGLint, nAttributes: TGLuint, - piAttributes: PGLint, pfValues: PGLfloat): BOOL{. - dynlib: dllname, importc: "wglGetPixelFormatAttribfvEXT".} -proc wglChoosePixelFormatEXT*(hdc: HDC, piAttribIList: PGLint, - pfAttribFList: PGLfloat, nMaxFormats: TGLuint, - piFormats: PGLint, nNumFormats: PGLuint): BOOL{. - dynlib: dllname, importc: "wglChoosePixelFormatEXT".} -const - WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D* = 0x00002050 - WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D* = 0x00002051 - WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D* = 0x00002052 - WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D* = 0x00002053 - -proc wglGetDigitalVideoParametersI3D*(hDC: HDC, iAttribute: TGLint, - piValue: PGLint): BOOL{.dynlib: dllname, - importc: "wglGetDigitalVideoParametersI3D".} -proc wglSetDigitalVideoParametersI3D*(hDC: HDC, iAttribute: TGLint, - piValue: PGLint): BOOL{.dynlib: dllname, - importc: "wglSetDigitalVideoParametersI3D".} -const - WGL_GAMMA_TABLE_SIZE_I3D* = 0x0000204E - WGL_GAMMA_EXCLUDE_DESKTOP_I3D* = 0x0000204F - -proc wglGetGammaTableParametersI3D*(hDC: HDC, iAttribute: TGLint, - piValue: PGLint): BOOL{.dynlib: dllname, - importc: "wglGetGammaTableParametersI3D".} -proc wglSetGammaTableParametersI3D*(hDC: HDC, iAttribute: TGLint, - piValue: PGLint): BOOL{.dynlib: dllname, - importc: "wglSetGammaTableParametersI3D".} -proc wglGetGammaTableI3D*(hDC: HDC, iEntries: TGLint, puRed: PGLUSHORT, - puGreen: PGLUSHORT, puBlue: PGLUSHORT): BOOL{. - dynlib: dllname, importc: "wglGetGammaTableI3D".} -proc wglSetGammaTableI3D*(hDC: HDC, iEntries: TGLint, puRed: PGLUSHORT, - puGreen: PGLUSHORT, puBlue: PGLUSHORT): BOOL{. - dynlib: dllname, importc: "wglSetGammaTableI3D".} -const - WGL_GENLOCK_SOURCE_MULTIVIEW_I3D* = 0x00002044 - WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D* = 0x00002045 - WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D* = 0x00002046 - WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D* = 0x00002047 - WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D* = 0x00002048 - WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D* = 0x00002049 - WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D* = 0x0000204A - WGL_GENLOCK_SOURCE_EDGE_RISING_I3D* = 0x0000204B - WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D* = 0x0000204C - WGL_FLOAT_COMPONENTS_NV* = 0x000020B0 - WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV* = 0x000020B1 - WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV* = 0x000020B2 - WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV* = 0x000020B3 - WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV* = 0x000020B4 - WGL_TEXTURE_FLOAT_R_NV* = 0x000020B5 - WGL_TEXTURE_FLOAT_RG_NV* = 0x000020B6 - WGL_TEXTURE_FLOAT_RGB_NV* = 0x000020B7 - WGL_TEXTURE_FLOAT_RGBA_NV* = 0x000020B8 - -proc wglEnableGenlockI3D*(hDC: HDC): BOOL{.dynlib: dllname, - importc: "wglEnableGenlockI3D".} -proc wglDisableGenlockI3D*(hDC: HDC): BOOL{.dynlib: dllname, - importc: "wglDisableGenlockI3D".} -proc wglIsEnabledGenlockI3D*(hDC: HDC, pFlag: PBOOL): BOOL{.dynlib: dllname, - importc: "wglIsEnabledGenlockI3D".} -proc wglGenlockSourceI3D*(hDC: HDC, uSource: TGLuint): BOOL{.dynlib: dllname, - importc: "wglGenlockSourceI3D".} -proc wglGetGenlockSourceI3D*(hDC: HDC, uSource: PGLUINT): BOOL{.dynlib: dllname, - importc: "wglGetGenlockSourceI3D".} -proc wglGenlockSourceEdgeI3D*(hDC: HDC, uEdge: TGLuint): BOOL{.dynlib: dllname, - importc: "wglGenlockSourceEdgeI3D".} -proc wglGetGenlockSourceEdgeI3D*(hDC: HDC, uEdge: PGLUINT): BOOL{. - dynlib: dllname, importc: "wglGetGenlockSourceEdgeI3D".} -proc wglGenlockSampleRateI3D*(hDC: HDC, uRate: TGLuint): BOOL{.dynlib: dllname, - importc: "wglGenlockSampleRateI3D".} -proc wglGetGenlockSampleRateI3D*(hDC: HDC, uRate: PGLUINT): BOOL{. - dynlib: dllname, importc: "wglGetGenlockSampleRateI3D".} -proc wglGenlockSourceDelayI3D*(hDC: HDC, uDelay: TGLuint): BOOL{. - dynlib: dllname, importc: "wglGenlockSourceDelayI3D".} -proc wglGetGenlockSourceDelayI3D*(hDC: HDC, uDelay: PGLUINT): BOOL{. - dynlib: dllname, importc: "wglGetGenlockSourceDelayI3D".} -proc wglQueryGenlockMaxSourceDelayI3D*(hDC: HDC, uMaxLineDelay: PGLUINT, - uMaxPixelDelay: PGLUINT): BOOL{. - dynlib: dllname, importc: "wglQueryGenlockMaxSourceDelayI3D".} -const - WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV* = 0x000020A0 - WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV* = 0x000020A1 - WGL_TEXTURE_RECTANGLE_NV* = 0x000020A2 - -const - WGL_RGBA_FLOAT_MODE_ATI* = 0x00008820 - WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI* = 0x00008835 - WGL_TYPE_RGBA_FLOAT_ATI* = 0x000021A0 - -# implementation From 6577093d2d318b6351984a9f8f8166c6f37c6525 Mon Sep 17 00:00:00 2001 From: fowlmouth Date: Sun, 1 Dec 2013 21:19:32 -0600 Subject: [PATCH 056/326] Removed lua, python, tcl, cairo --- examples/cairoex.nim | 15 - examples/luaex.nim | 15 - examples/pythonex.nim | 11 - examples/tclex.nim | 25 - lib/wrappers/cairo/cairo.nim | 733 ------------- lib/wrappers/cairo/cairo_pragma.nim | 16 - lib/wrappers/cairo/cairoft.nim | 36 - lib/wrappers/cairo/cairowin32.nim | 37 - lib/wrappers/cairo/cairoxlib.nim | 41 - lib/wrappers/lua/lauxlib.nim | 208 ---- lib/wrappers/lua/lua.nim | 364 ------ lib/wrappers/lua/lualib.nim | 64 -- lib/wrappers/python.nim | 1587 --------------------------- lib/wrappers/tcl.nim | 865 --------------- 14 files changed, 4017 deletions(-) delete mode 100644 examples/cairoex.nim delete mode 100644 examples/luaex.nim delete mode 100644 examples/pythonex.nim delete mode 100644 examples/tclex.nim delete mode 100644 lib/wrappers/cairo/cairo.nim delete mode 100644 lib/wrappers/cairo/cairo_pragma.nim delete mode 100644 lib/wrappers/cairo/cairoft.nim delete mode 100644 lib/wrappers/cairo/cairowin32.nim delete mode 100644 lib/wrappers/cairo/cairoxlib.nim delete mode 100644 lib/wrappers/lua/lauxlib.nim delete mode 100644 lib/wrappers/lua/lua.nim delete mode 100644 lib/wrappers/lua/lualib.nim delete mode 100644 lib/wrappers/python.nim delete mode 100644 lib/wrappers/tcl.nim diff --git a/examples/cairoex.nim b/examples/cairoex.nim deleted file mode 100644 index 492428705d..0000000000 --- a/examples/cairoex.nim +++ /dev/null @@ -1,15 +0,0 @@ -import cairo - -var surface = image_surface_create(FORMAT_ARGB32, 240, 80) -var cr = create(surface) - -select_font_face(cr, "serif", FONT_SLANT_NORMAL, - FONT_WEIGHT_BOLD) -set_font_size(cr, 32.0) -set_source_rgb(cr, 0.0, 0.0, 1.0) -move_to(cr, 10.0, 50.0) -show_text(cr, "Hello, world") -destroy(cr) -discard write_to_png(surface, "hello.png") -destroy(surface) - diff --git a/examples/luaex.nim b/examples/luaex.nim deleted file mode 100644 index 7628ddd12a..0000000000 --- a/examples/luaex.nim +++ /dev/null @@ -1,15 +0,0 @@ -# Embedds Lua into a Nimrod application - -import - lua, lualib, lauxlib - -const - code = """ -print 'hi' -""" - -var L = newstate() -openlibs(L) -discard loadbuffer(L, code, code.len, "line") -discard pcall(L, 0, 0, 0) - diff --git a/examples/pythonex.nim b/examples/pythonex.nim deleted file mode 100644 index 310d801512..0000000000 --- a/examples/pythonex.nim +++ /dev/null @@ -1,11 +0,0 @@ -# Example to embed Python into your application - -import python - -# IMPORTANT: Python on Windows does not like CR characters, so -# we use only \L here. - -Py_Initialize() -discard PyRun_SimpleString("from time import time,ctime\L" & - "print 'Today is',ctime(time())\L") -Py_Finalize() diff --git a/examples/tclex.nim b/examples/tclex.nim deleted file mode 100644 index daf2d52e2f..0000000000 --- a/examples/tclex.nim +++ /dev/null @@ -1,25 +0,0 @@ -# Example to embed TCL in Nimrod - -import tcl, os - -const - myScript = """puts "Hello, World - In quotes" """ - myScript2 = """ -package require Tk -pack [entry .e -textvar e -width 50] -bind .e { - set e [regsub { *=.*} $e ""] ;# remove evaluation (Chris) - catch {expr [string map {/ *1./} $e]} res - append e " = $res" -} -""" - -FindExecutable(getAppFilename()) -var interp = CreateInterp() -if interp == nil: quit("cannot create TCL interpreter") -if Init(interp) != TCL_OK: - quit("cannot init interpreter") -if tcl.Eval(interp, myScript) != TCL_OK: - quit("cannot execute script.tcl") - - diff --git a/lib/wrappers/cairo/cairo.nim b/lib/wrappers/cairo/cairo.nim deleted file mode 100644 index 172880529c..0000000000 --- a/lib/wrappers/cairo/cairo.nim +++ /dev/null @@ -1,733 +0,0 @@ -#* 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 -# #* -# * This FreePascal binding generated August 26, 2005 -# * by Jeffrey Pohlmeyer -# - -# -# - 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 -# - -include "cairo_pragma.nim" - -type - PByte = cstring - TStatus* = enum - STATUS_SUCCESS = 0, - STATUS_NO_MEMORY, - STATUS_INVALID_RESTORE, - STATUS_INVALID_POP_GROUP, - STATUS_NO_CURRENT_POINT, - STATUS_INVALID_MATRIX, - STATUS_INVALID_STATUS, - STATUS_NULL_POINTER, - STATUS_INVALID_STRING, - STATUS_INVALID_PATH_DATA, - STATUS_READ_ERROR, - STATUS_WRITE_ERROR, - STATUS_SURFACE_FINISHED, - STATUS_SURFACE_TYPE_MISMATCH, - STATUS_PATTERN_TYPE_MISMATCH, - STATUS_INVALID_CONTENT, - STATUS_INVALID_FORMAT, - STATUS_INVALID_VISUAL, - STATUS_FILE_NOT_FOUND, - STATUS_INVALID_DASH, - STATUS_INVALID_DSC_COMMENT, - STATUS_INVALID_INDEX, - STATUS_CLIP_NOT_REPRESENTABLE, - STATUS_TEMP_FILE_ERROR, - STATUS_INVALID_STRIDE, - STATUS_FONT_TYPE_MISMATCH, - STATUS_USER_FONT_IMMUTABLE, - STATUS_USER_FONT_ERROR, - STATUS_NEGATIVE_COUNT, - STATUS_INVALID_CLUSTERS, - STATUS_INVALID_SLANT, - STATUS_INVALID_WEIGHT - - - TOperator* = enum - OPERATOR_CLEAR, OPERATOR_SOURCE, OPERATOR_OVER, OPERATOR_IN, OPERATOR_OUT, - OPERATOR_ATOP, OPERATOR_DEST, OPERATOR_DEST_OVER, OPERATOR_DEST_IN, - OPERATOR_DEST_OUT, OPERATOR_DEST_ATOP, OPERATOR_XOR, OPERATOR_ADD, - OPERATOR_SATURATE - TAntialias* = enum - ANTIALIAS_DEFAULT, ANTIALIAS_NONE, ANTIALIAS_GRAY, ANTIALIAS_SUBPIXEL - TFillRule* = enum - FILL_RULE_WINDING, FILL_RULE_EVEN_ODD - TLineCap* = enum - LINE_CAP_BUTT, LINE_CAP_ROUND, LINE_CAP_SQUARE - TLineJoin* = enum - LINE_JOIN_MITER, LINE_JOIN_ROUND, LINE_JOIN_BEVEL - TFontSlant* = enum - FONT_SLANT_NORMAL, FONT_SLANT_ITALIC, FONT_SLANT_OBLIQUE - TFontWeight* = enum - FONT_WEIGHT_NORMAL, FONT_WEIGHT_BOLD - TSubpixelOrder* = enum - SUBPIXEL_ORDER_DEFAULT, SUBPIXEL_ORDER_RGB, SUBPIXEL_ORDER_BGR, - SUBPIXEL_ORDER_VRGB, SUBPIXEL_ORDER_VBGR - THintStyle* = enum - HINT_STYLE_DEFAULT, HINT_STYLE_NONE, HINT_STYLE_SLIGHT, HINT_STYLE_MEDIUM, - HINT_STYLE_FULL - THintMetrics* = enum - HINT_METRICS_DEFAULT, HINT_METRICS_OFF, HINT_METRICS_ON - TPathDataType* = enum - PATH_MOVE_TO, PATH_LINE_TO, PATH_CURVE_TO, PATH_CLOSE_PATH - TContent* = enum - CONTENT_COLOR = 0x00001000, CONTENT_ALPHA = 0x00002000, - CONTENT_COLOR_ALPHA = 0x00003000 - TFormat* = enum - FORMAT_ARGB32, FORMAT_RGB24, FORMAT_A8, FORMAT_A1 - TExtend* = enum - EXTEND_NONE, EXTEND_REPEAT, EXTEND_REFLECT, EXTEND_PAD - TFilter* = enum - FILTER_FAST, FILTER_GOOD, FILTER_BEST, FILTER_NEAREST, FILTER_BILINEAR, - FILTER_GAUSSIAN - TFontType* = enum - FONT_TYPE_TOY, FONT_TYPE_FT, FONT_TYPE_WIN32, FONT_TYPE_ATSUI - TPatternType* = enum - PATTERN_TYPE_SOLID, PATTERN_TYPE_SURFACE, PATTERN_TYPE_LINEAR, - PATTERN_TYPE_RADIAL - TSurfaceType* = enum - SURFACE_TYPE_IMAGE, SURFACE_TYPE_PDF, SURFACE_TYPE_PS, SURFACE_TYPE_XLIB, - SURFACE_TYPE_XCB, SURFACE_TYPE_GLITZ, SURFACE_TYPE_QUARTZ, - SURFACE_TYPE_WIN32, SURFACE_TYPE_BEOS, SURFACE_TYPE_DIRECTFB, - SURFACE_TYPE_SVG, SURFACE_TYPE_OS2 - TSvgVersion* = enum - SVG_VERSION_1_1, SVG_VERSION_1_2 - PSurface* = ptr TSurface - PPSurface* = ptr PSurface - PContext* = ptr TContext - PPattern* = ptr TPattern - PFontOptions* = ptr TFontOptions - PFontFace* = ptr TFontFace - PScaledFont* = ptr TScaledFont - PBool* = ptr TBool - TBool* = int32 - PMatrix* = ptr TMatrix - PUserDataKey* = ptr TUserDataKey - PGlyph* = ptr TGlyph - PTextExtents* = ptr TTextExtents - PFontExtents* = ptr TFontExtents - PPathDataType* = ptr TPathDataType - PPathData* = ptr TPathData - PPath* = ptr TPath - PRectangle* = ptr TRectangle - PRectangleList* = ptr TRectangleList - TDestroyFunc* = proc (data: Pointer){.cdecl.} - TWriteFunc* = proc (closure: Pointer, data: PByte, len: int32): TStatus{.cdecl.} - TReadFunc* = proc (closure: Pointer, data: PByte, len: int32): TStatus{.cdecl.} - TContext*{.final.} = object #OPAQUE - TSurface*{.final.} = object #OPAQUE - TPattern*{.final.} = object #OPAQUE - TScaledFont*{.final.} = object #OPAQUE - TFontFace*{.final.} = object #OPAQUE - TFontOptions*{.final.} = object #OPAQUE - TMatrix*{.final.} = object - xx: float64 - yx: float64 - xy: float64 - yy: float64 - x0: float64 - y0: float64 - - TUserDataKey*{.final.} = object - unused: int32 - - TGlyph*{.final.} = object - index: int32 - x: float64 - y: float64 - - TTextExtents*{.final.} = object - x_bearing: float64 - y_bearing: float64 - width: float64 - height: float64 - x_advance: float64 - y_advance: float64 - - TFontExtents*{.final.} = object - ascent: float64 - descent: float64 - height: float64 - max_x_advance: float64 - max_y_advance: float64 - - TPathData*{.final.} = object #* _type : TCairoPathDataType; - # length : LongInt; - # end - x: float64 - y: float64 - - TPath*{.final.} = object - status: TStatus - data: PPathData - num_data: int32 - - TRectangle*{.final.} = object - x, y, width, height: float64 - - TRectangleList*{.final.} = object - status: TStatus - rectangles: PRectangle - num_rectangles: int32 - - -proc version*(): int32{.cdecl, importc: "cairo_version", libcairo.} -proc version_string*(): cstring{.cdecl, importc: "cairo_version_string", - libcairo.} - #Helper function to retrieve decoded version -proc version*(major, minor, micro: var int32) - #* Functions for manipulating state objects -proc create*(target: PSurface): PContext{.cdecl, importc: "cairo_create", - libcairo.} -proc reference*(cr: PContext): PContext{.cdecl, importc: "cairo_reference", libcairo.} -proc destroy*(cr: PContext){.cdecl, importc: "cairo_destroy", libcairo.} -proc get_reference_count*(cr: PContext): int32{.cdecl, - importc: "cairo_get_reference_count", libcairo.} -proc get_user_data*(cr: PContext, key: PUserDataKey): pointer{.cdecl, - importc: "cairo_get_user_data", libcairo.} -proc set_user_data*(cr: PContext, key: PUserDataKey, user_data: Pointer, - destroy: TDestroyFunc): TStatus{.cdecl, - importc: "cairo_set_user_data", libcairo.} -proc save*(cr: PContext){.cdecl, importc: "cairo_save", libcairo.} -proc restore*(cr: PContext){.cdecl, importc: "cairo_restore", libcairo.} -proc push_group*(cr: PContext){.cdecl, importc: "cairo_push_group", libcairo.} -proc push_group_with_content*(cr: PContext, content: TContent){.cdecl, - importc: "cairo_push_group_with_content", libcairo.} -proc pop_group*(cr: PContext): PPattern{.cdecl, importc: "cairo_pop_group", - libcairo.} -proc pop_group_to_source*(cr: PContext){.cdecl, importc: "cairo_pop_group_to_source", - libcairo.} - #* Modify state -proc set_operator*(cr: PContext, op: TOperator){.cdecl, importc: "cairo_set_operator", - libcairo.} -proc set_source*(cr: PContext, source: PPattern){.cdecl, importc: "cairo_set_source", - libcairo.} -proc set_source_rgb*(cr: PContext, red, green, blue: float64){.cdecl, - importc: "cairo_set_source_rgb", libcairo.} -proc set_source_rgba*(cr: PContext, red, green, blue, alpha: float64){.cdecl, - importc: "cairo_set_source_rgba", libcairo.} -proc set_source*(cr: PContext, surface: PSurface, x, y: float64){.cdecl, - importc: "cairo_set_source_surface", libcairo.} -proc set_tolerance*(cr: PContext, tolerance: float64){.cdecl, - importc: "cairo_set_tolerance", libcairo.} -proc set_antialias*(cr: PContext, antialias: TAntialias){.cdecl, - importc: "cairo_set_antialias", libcairo.} -proc set_fill_rule*(cr: PContext, fill_rule: TFillRule){.cdecl, - importc: "cairo_set_fill_rule", libcairo.} -proc set_line_width*(cr: PContext, width: float64){.cdecl, - importc: "cairo_set_line_width", libcairo.} -proc set_line_cap*(cr: PContext, line_cap: TLineCap){.cdecl, - importc: "cairo_set_line_cap", libcairo.} -proc set_line_join*(cr: PContext, line_join: TLineJoin){.cdecl, - importc: "cairo_set_line_join", libcairo.} -proc set_dash*(cr: PContext, dashes: openarray[float64], offset: float64){.cdecl, - importc: "cairo_set_dash", libcairo.} -proc set_miter_limit*(cr: PContext, limit: float64){.cdecl, - importc: "cairo_set_miter_limit", libcairo.} -proc translate*(cr: PContext, tx, ty: float64){.cdecl, importc: "cairo_translate", - libcairo.} -proc scale*(cr: PContext, sx, sy: float64){.cdecl, importc: "cairo_scale", - libcairo.} -proc rotate*(cr: PContext, angle: float64){.cdecl, importc: "cairo_rotate", - libcairo.} -proc transform*(cr: PContext, matrix: PMatrix){.cdecl, importc: "cairo_transform", - libcairo.} -proc set_matrix*(cr: PContext, matrix: PMatrix){.cdecl, importc: "cairo_set_matrix", - libcairo.} -proc identity_matrix*(cr: PContext){.cdecl, importc: "cairo_identity_matrix", - libcairo.} -proc user_to_device*(cr: PContext, x, y: var float64){.cdecl, - importc: "cairo_user_to_device", libcairo.} -proc user_to_device_distance*(cr: PContext, dx, dy: var float64){.cdecl, - importc: "cairo_user_to_device_distance", libcairo.} -proc device_to_user*(cr: PContext, x, y: var float64){.cdecl, - importc: "cairo_device_to_user", libcairo.} -proc device_to_user_distance*(cr: PContext, dx, dy: var float64){.cdecl, - importc: "cairo_device_to_user_distance", libcairo.} - #* Path creation functions -proc new_path*(cr: PContext){.cdecl, importc: "cairo_new_path", libcairo.} -proc move_to*(cr: PContext, x, y: float64){.cdecl, importc: "cairo_move_to", - libcairo.} -proc new_sub_path*(cr: PContext){.cdecl, importc: "cairo_new_sub_path", - libcairo.} -proc line_to*(cr: PContext, x, y: float64){.cdecl, importc: "cairo_line_to", - libcairo.} -proc curve_to*(cr: PContext, x1, y1, x2, y2, x3, y3: float64){.cdecl, - importc: "cairo_curve_to", libcairo.} -proc arc*(cr: PContext, xc, yc, radius, angle1, angle2: float64){.cdecl, - importc: "cairo_arc", libcairo.} -proc arc_negative*(cr: PContext, xc, yc, radius, angle1, angle2: float64){.cdecl, - importc: "cairo_arc_negative", libcairo.} -proc rel_move_to*(cr: PContext, dx, dy: float64){.cdecl, importc: "cairo_rel_move_to", - libcairo.} -proc rel_line_to*(cr: PContext, dx, dy: float64){.cdecl, importc: "cairo_rel_line_to", - libcairo.} -proc rel_curve_to*(cr: PContext, dx1, dy1, dx2, dy2, dx3, dy3: float64){.cdecl, - importc: "cairo_rel_curve_to", libcairo.} -proc rectangle*(cr: PContext, x, y, width, height: float64){.cdecl, - importc: "cairo_rectangle", libcairo.} -proc close_path*(cr: PContext){.cdecl, importc: "cairo_close_path", libcairo.} - #* Painting functions -proc paint*(cr: PContext){.cdecl, importc: "cairo_paint", libcairo.} -proc paint_with_alpha*(cr: PContext, alpha: float64){.cdecl, - importc: "cairo_paint_with_alpha", libcairo.} -proc mask*(cr: PContext, pattern: PPattern){.cdecl, importc: "cairo_mask", - libcairo.} -proc mask*(cr: PContext, surface: PSurface, surface_x, surface_y: float64){. - cdecl, importc: "cairo_mask_surface", libcairo.} -proc stroke*(cr: PContext){.cdecl, importc: "cairo_stroke", libcairo.} -proc stroke_preserve*(cr: PContext){.cdecl, importc: "cairo_stroke_preserve", - libcairo.} -proc fill*(cr: PContext){.cdecl, importc: "cairo_fill", libcairo.} -proc fill_preserve*(cr: PContext){.cdecl, importc: "cairo_fill_preserve", - libcairo.} -proc copy_page*(cr: PContext){.cdecl, importc: "cairo_copy_page", libcairo.} -proc show_page*(cr: PContext){.cdecl, importc: "cairo_show_page", libcairo.} - #* Insideness testing -proc in_stroke*(cr: PContext, x, y: float64): TBool{.cdecl, importc: "cairo_in_stroke", - libcairo.} -proc in_fill*(cr: PContext, x, y: float64): TBool{.cdecl, importc: "cairo_in_fill", - libcairo.} - #* Rectangular extents -proc stroke_extents*(cr: PContext, x1, y1, x2, y2: var float64){.cdecl, - importc: "cairo_stroke_extents", libcairo.} -proc fill_extents*(cr: PContext, x1, y1, x2, y2: var float64){.cdecl, - importc: "cairo_fill_extents", libcairo.} - #* Clipping -proc reset_clip*(cr: PContext){.cdecl, importc: "cairo_reset_clip", libcairo.} -proc clip*(cr: PContext){.cdecl, importc: "cairo_clip", libcairo.} -proc clip_preserve*(cr: PContext){.cdecl, importc: "cairo_clip_preserve", - libcairo.} -proc clip_extents*(cr: PContext, x1, y1, x2, y2: var float64){.cdecl, - importc: "cairo_clip_extents", libcairo.} -proc copy_clip_rectangle_list*(cr: PContext): PRectangleList{.cdecl, - importc: "cairo_copy_clip_rectangle_list", libcairo.} -proc rectangle_list_destroy*(rectangle_list: PRectangleList){.cdecl, - importc: "cairo_rectangle_list_destroy", libcairo.} - #* Font/Text functions -proc font_options_create*(): PFontOptions{.cdecl, - importc: "cairo_font_options_create", libcairo.} -proc copy*(original: PFontOptions): PFontOptions{.cdecl, - importc: "cairo_font_options_copy", libcairo.} -proc destroy*(options: PFontOptions){.cdecl, - importc: "cairo_font_options_destroy", libcairo.} -proc status*(options: PFontOptions): TStatus{.cdecl, - importc: "cairo_font_options_status", libcairo.} -proc merge*(options, other: PFontOptions){.cdecl, - importc: "cairo_font_options_merge", libcairo.} -proc equal*(options, other: PFontOptions): TBool{.cdecl, - importc: "cairo_font_options_equal", libcairo.} -proc hash*(options: PFontOptions): int32{.cdecl, - importc: "cairo_font_options_hash", libcairo.} -proc set_antialias*(options: PFontOptions, antialias: TAntialias){. - cdecl, importc: "cairo_font_options_set_antialias", libcairo.} -proc get_antialias*(options: PFontOptions): TAntialias{.cdecl, - importc: "cairo_font_options_get_antialias", libcairo.} -proc set_subpixel_order*(options: PFontOptions, - subpixel_order: TSubpixelOrder){.cdecl, - importc: "cairo_font_options_set_subpixel_order", libcairo.} -proc get_subpixel_order*(options: PFontOptions): TSubpixelOrder{. - cdecl, importc: "cairo_font_options_get_subpixel_order", libcairo.} -proc set_hint_style*(options: PFontOptions, hint_style: THintStyle){. - cdecl, importc: "cairo_font_options_set_hint_style", libcairo.} -proc get_hint_style*(options: PFontOptions): THintStyle{.cdecl, - importc: "cairo_font_options_get_hint_style", libcairo.} -proc set_hint_metrics*(options: PFontOptions, - hint_metrics: THintMetrics){.cdecl, - importc: "cairo_font_options_set_hint_metrics", libcairo.} -proc get_hint_metrics*(options: PFontOptions): THintMetrics{.cdecl, - importc: "cairo_font_options_get_hint_metrics", libcairo.} - #* This interface is for dealing with text as text, not caring about the - # font object inside the the TCairo. -proc select_font_face*(cr: PContext, family: cstring, slant: TFontSlant, - weight: TFontWeight){.cdecl, - importc: "cairo_select_font_face", libcairo.} -proc set_font_size*(cr: PContext, size: float64){.cdecl, - importc: "cairo_set_font_size", libcairo.} -proc set_font_matrix*(cr: PContext, matrix: PMatrix){.cdecl, - importc: "cairo_set_font_matrix", libcairo.} -proc get_font_matrix*(cr: PContext, matrix: PMatrix){.cdecl, - importc: "cairo_get_font_matrix", libcairo.} -proc set_font_options*(cr: PContext, options: PFontOptions){.cdecl, - importc: "cairo_set_font_options", libcairo.} -proc get_font_options*(cr: PContext, options: PFontOptions){.cdecl, - importc: "cairo_get_font_options", libcairo.} -proc set_font_face*(cr: PContext, font_face: PFontFace){.cdecl, - importc: "cairo_set_font_face", libcairo.} -proc get_font_face*(cr: PContext): PFontFace{.cdecl, importc: "cairo_get_font_face", - libcairo.} -proc set_scaled_font*(cr: PContext, scaled_font: PScaledFont){.cdecl, - importc: "cairo_set_scaled_font", libcairo.} -proc get_scaled_font*(cr: PContext): PScaledFont{.cdecl, - importc: "cairo_get_scaled_font", libcairo.} -proc show_text*(cr: PContext, utf8: cstring){.cdecl, importc: "cairo_show_text", - libcairo.} -proc show_glyphs*(cr: PContext, glyphs: PGlyph, num_glyphs: int32){.cdecl, - importc: "cairo_show_glyphs", libcairo.} -proc text_path*(cr: PContext, utf8: cstring){.cdecl, importc: "cairo_text_path", - libcairo.} -proc glyph_path*(cr: PContext, glyphs: PGlyph, num_glyphs: int32){.cdecl, - importc: "cairo_glyph_path", libcairo.} -proc text_extents*(cr: PContext, utf8: cstring, extents: PTextExtents){.cdecl, - importc: "cairo_text_extents", libcairo.} -proc glyph_extents*(cr: PContext, glyphs: PGlyph, num_glyphs: int32, - extents: PTextExtents){.cdecl, - importc: "cairo_glyph_extents", libcairo.} -proc font_extents*(cr: PContext, extents: PFontExtents){.cdecl, - importc: "cairo_font_extents", libcairo.} - #* Generic identifier for a font style -proc reference*(font_face: PFontFace): PFontFace{.cdecl, - importc: "cairo_font_face_reference", libcairo.} -proc destroy*(font_face: PFontFace){.cdecl, - importc: "cairo_font_face_destroy", libcairo.} -proc get_reference_count*(font_face: PFontFace): int32{.cdecl, - importc: "cairo_font_face_get_reference_count", libcairo.} -proc status*(font_face: PFontFace): TStatus{.cdecl, - importc: "cairo_font_face_status", libcairo.} -proc get_type*(font_face: PFontFace): TFontType{.cdecl, - importc: "cairo_font_face_get_type", libcairo.} -proc get_user_data*(font_face: PFontFace, key: PUserDataKey): pointer{. - cdecl, importc: "cairo_font_face_get_user_data", libcairo.} -proc set_user_data*(font_face: PFontFace, key: PUserDataKey, - user_data: pointer, destroy: TDestroyFunc): TStatus{. - cdecl, importc: "cairo_font_face_set_user_data", libcairo.} - #* Portable interface to general font features -proc scaled_font_create*(font_face: PFontFace, font_matrix: PMatrix, - ctm: PMatrix, options: PFontOptions): PScaledFont{. - cdecl, importc: "cairo_scaled_font_create", libcairo.} -proc reference*(scaled_font: PScaledFont): PScaledFont{.cdecl, - importc: "cairo_scaled_font_reference", libcairo.} -proc destroy*(scaled_font: PScaledFont){.cdecl, - importc: "cairo_scaled_font_destroy", libcairo.} -proc get_reference_count*(scaled_font: PScaledFont): int32{.cdecl, - importc: "cairo_scaled_font_get_reference_count", libcairo.} -proc status*(scaled_font: PScaledFont): TStatus{.cdecl, - importc: "cairo_scaled_font_status", libcairo.} -proc get_type*(scaled_font: PScaledFont): TFontType{.cdecl, - importc: "cairo_scaled_font_get_type", libcairo.} -proc get_user_data*(scaled_font: PScaledFont, key: PUserDataKey): Pointer{. - cdecl, importc: "cairo_scaled_font_get_user_data", libcairo.} -proc set_user_data*(scaled_font: PScaledFont, key: PUserDataKey, - user_data: Pointer, destroy: TDestroyFunc): TStatus{. - cdecl, importc: "cairo_scaled_font_set_user_data", libcairo.} -proc extents*(scaled_font: PScaledFont, extents: PFontExtents){. - cdecl, importc: "cairo_scaled_font_extents", libcairo.} -proc text_extents*(scaled_font: PScaledFont, utf8: cstring, - extents: PTextExtents){.cdecl, - importc: "cairo_scaled_font_text_extents", libcairo.} -proc glyph_extents*(scaled_font: PScaledFont, glyphs: PGlyph, - num_glyphs: int32, extents: PTextExtents){. - cdecl, importc: "cairo_scaled_font_glyph_extents", libcairo.} -proc get_font_face*(scaled_font: PScaledFont): PFontFace{.cdecl, - importc: "cairo_scaled_font_get_font_face", libcairo.} -proc get_font_matrix*(scaled_font: PScaledFont, font_matrix: PMatrix){. - cdecl, importc: "cairo_scaled_font_get_font_matrix", libcairo.} -proc get_ctm*(scaled_font: PScaledFont, ctm: PMatrix){.cdecl, - importc: "cairo_scaled_font_get_ctm", libcairo.} -proc get_font_options*(scaled_font: PScaledFont, - options: PFontOptions){.cdecl, - importc: "cairo_scaled_font_get_font_options", libcairo.} - #* Query functions -proc get_operator*(cr: PContext): TOperator{.cdecl, importc: "cairo_get_operator", - libcairo.} -proc get_source*(cr: PContext): PPattern{.cdecl, importc: "cairo_get_source", - libcairo.} -proc get_tolerance*(cr: PContext): float64{.cdecl, importc: "cairo_get_tolerance", - libcairo.} -proc get_antialias*(cr: PContext): TAntialias{.cdecl, importc: "cairo_get_antialias", - libcairo.} -proc get_current_point*(cr: PContext, x, y: var float64){.cdecl, - importc: "cairo_get_current_point", libcairo.} -proc get_fill_rule*(cr: PContext): TFillRule{.cdecl, importc: "cairo_get_fill_rule", - libcairo.} -proc get_line_width*(cr: PContext): float64{.cdecl, importc: "cairo_get_line_width", - libcairo.} -proc get_line_cap*(cr: PContext): TLineCap{.cdecl, importc: "cairo_get_line_cap", - libcairo.} -proc get_line_join*(cr: PContext): TLineJoin{.cdecl, importc: "cairo_get_line_join", - libcairo.} -proc get_miter_limit*(cr: PContext): float64{.cdecl, importc: "cairo_get_miter_limit", - libcairo.} -proc get_dash_count*(cr: PContext): int32{.cdecl, importc: "cairo_get_dash_count", - libcairo.} -proc get_dash*(cr: PContext, dashes, offset: var float64){.cdecl, - importc: "cairo_get_dash", libcairo.} -proc get_matrix*(cr: PContext, matrix: PMatrix){.cdecl, importc: "cairo_get_matrix", - libcairo.} -proc get_target*(cr: PContext): PSurface{.cdecl, importc: "cairo_get_target", - libcairo.} -proc get_group_target*(cr: PContext): PSurface{.cdecl, - importc: "cairo_get_group_target", libcairo.} -proc copy_path*(cr: PContext): PPath{.cdecl, importc: "cairo_copy_path", - libcairo.} -proc copy_path_flat*(cr: PContext): PPath{.cdecl, importc: "cairo_copy_path_flat", - libcairo.} -proc append_path*(cr: PContext, path: PPath){.cdecl, importc: "cairo_append_path", - libcairo.} -proc destroy*(path: PPath){.cdecl, importc: "cairo_path_destroy", - libcairo.} - #* Error status queries -proc status*(cr: PContext): TStatus{.cdecl, importc: "cairo_status", libcairo.} -proc status_to_string*(status: TStatus): cstring{.cdecl, - importc: "cairo_status_to_string", libcairo.} - #* Surface manipulation -proc surface_create_similar*(other: PSurface, content: TContent, - width, height: int32): PSurface{.cdecl, - importc: "cairo_surface_create_similar", libcairo.} -proc reference*(surface: PSurface): PSurface{.cdecl, - importc: "cairo_surface_reference", libcairo.} -proc finish*(surface: PSurface){.cdecl, importc: "cairo_surface_finish", - libcairo.} -proc destroy*(surface: PSurface){.cdecl, - importc: "cairo_surface_destroy", libcairo.} -proc get_reference_count*(surface: PSurface): int32{.cdecl, - importc: "cairo_surface_get_reference_count", libcairo.} -proc status*(surface: PSurface): TStatus{.cdecl, - importc: "cairo_surface_status", libcairo.} -proc get_type*(surface: PSurface): TSurfaceType{.cdecl, - importc: "cairo_surface_get_type", libcairo.} -proc get_content*(surface: PSurface): TContent{.cdecl, - importc: "cairo_surface_get_content", libcairo.} -proc write_to_png*(surface: PSurface, filename: cstring): TStatus{. - cdecl, importc: "cairo_surface_write_to_png", libcairo.} -proc write_to_png*(surface: PSurface, write_func: TWriteFunc, - closure: pointer): TStatus{.cdecl, - importc: "cairo_surface_write_to_png_stream", libcairo.} -proc get_user_data*(surface: PSurface, key: PUserDataKey): pointer{. - cdecl, importc: "cairo_surface_get_user_data", libcairo.} -proc set_user_data*(surface: PSurface, key: PUserDataKey, - user_data: pointer, destroy: TDestroyFunc): TStatus{. - cdecl, importc: "cairo_surface_set_user_data", libcairo.} -proc get_font_options*(surface: PSurface, options: PFontOptions){.cdecl, - importc: "cairo_surface_get_font_options", libcairo.} -proc flush*(surface: PSurface){.cdecl, importc: "cairo_surface_flush", - libcairo.} -proc mark_dirty*(surface: PSurface){.cdecl, - importc: "cairo_surface_mark_dirty", libcairo.} -proc mark_dirty_rectangle*(surface: PSurface, x, y, width, height: int32){. - cdecl, importc: "cairo_surface_mark_dirty_rectangle", libcairo.} -proc set_device_offset*(surface: PSurface, x_offset, y_offset: float64){. - cdecl, importc: "cairo_surface_set_device_offset", libcairo.} -proc get_device_offset*(surface: PSurface, - x_offset, y_offset: var float64){.cdecl, - importc: "cairo_surface_get_device_offset", libcairo.} -proc set_fallback_resolution*(surface: PSurface, x_pixels_per_inch, - y_pixels_per_inch: float64){.cdecl, importc: "cairo_surface_set_fallback_resolution", - libcairo.} - #* Image-surface functions -proc image_surface_create*(format: TFormat, width, height: int32): PSurface{. - cdecl, importc: "cairo_image_surface_create", libcairo.} -proc image_surface_create*(data: Pbyte, format: TFormat, - width, height, stride: int32): PSurface{. - cdecl, importc: "cairo_image_surface_create_for_data", libcairo.} -proc get_data*(surface: PSurface): cstring{.cdecl, - importc: "cairo_image_surface_get_data", libcairo.} -proc get_format*(surface: PSurface): TFormat{.cdecl, - importc: "cairo_image_surface_get_format", libcairo.} -proc get_width*(surface: PSurface): int32{.cdecl, - importc: "cairo_image_surface_get_width", libcairo.} -proc get_height*(surface: PSurface): int32{.cdecl, - importc: "cairo_image_surface_get_height", libcairo.} -proc get_stride*(surface: PSurface): int32{.cdecl, - importc: "cairo_image_surface_get_stride", libcairo.} -proc image_surface_create_from_png*(filename: cstring): PSurface{.cdecl, - importc: "cairo_image_surface_create_from_png", libcairo.} -proc image_surface_create_from_png*(read_func: TReadFunc, - closure: pointer): PSurface{.cdecl, importc: "cairo_image_surface_create_from_png_stream", - libcairo.} - #* Pattern creation functions -proc pattern_create_rgb*(red, green, blue: float64): PPattern{.cdecl, - importc: "cairo_pattern_create_rgb", libcairo.} -proc pattern_create_rgba*(red, green, blue, alpha: float64): PPattern{.cdecl, - importc: "cairo_pattern_create_rgba", libcairo.} -proc pattern_create_for_surface*(surface: PSurface): PPattern{.cdecl, - importc: "cairo_pattern_create_for_surface", libcairo.} -proc pattern_create_linear*(x0, y0, x1, y1: float64): PPattern{.cdecl, - importc: "cairo_pattern_create_linear", libcairo.} -proc pattern_create_radial*(cx0, cy0, radius0, cx1, cy1, radius1: float64): PPattern{. - cdecl, importc: "cairo_pattern_create_radial", libcairo.} -proc reference*(pattern: PPattern): PPattern{.cdecl, - importc: "cairo_pattern_reference", libcairo.} -proc destroy*(pattern: PPattern){.cdecl, - importc: "cairo_pattern_destroy", libcairo.} -proc get_reference_count*(pattern: PPattern): int32{.cdecl, - importc: "cairo_pattern_get_reference_count", libcairo.} -proc status*(pattern: PPattern): TStatus{.cdecl, - importc: "cairo_pattern_status", libcairo.} -proc get_user_data*(pattern: PPattern, key: PUserDataKey): Pointer{. - cdecl, importc: "cairo_pattern_get_user_data", libcairo.} -proc set_user_data*(pattern: PPattern, key: PUserDataKey, - user_data: Pointer, destroy: TDestroyFunc): TStatus{. - cdecl, importc: "cairo_pattern_set_user_data", libcairo.} -proc get_type*(pattern: PPattern): TPatternType{.cdecl, - importc: "cairo_pattern_get_type", libcairo.} -proc add_color_stop_rgb*(pattern: PPattern, - offset, red, green, blue: float64){.cdecl, - importc: "cairo_pattern_add_color_stop_rgb", libcairo.} -proc add_color_stop_rgba*(pattern: PPattern, - offset, red, green, blue, alpha: float64){. - cdecl, importc: "cairo_pattern_add_color_stop_rgba", libcairo.} -proc set_matrix*(pattern: PPattern, matrix: PMatrix){.cdecl, - importc: "cairo_pattern_set_matrix", libcairo.} -proc get_matrix*(pattern: PPattern, matrix: PMatrix){.cdecl, - importc: "cairo_pattern_get_matrix", libcairo.} -proc set_extend*(pattern: PPattern, extend: TExtend){.cdecl, - importc: "cairo_pattern_set_extend", libcairo.} -proc get_extend*(pattern: PPattern): TExtend{.cdecl, - importc: "cairo_pattern_get_extend", libcairo.} -proc set_filter*(pattern: PPattern, filter: TFilter){.cdecl, - importc: "cairo_pattern_set_filter", libcairo.} -proc get_filter*(pattern: PPattern): TFilter{.cdecl, - importc: "cairo_pattern_get_filter", libcairo.} -proc get_rgba*(pattern: PPattern, - red, green, blue, alpha: var float64): TStatus{. - cdecl, importc: "cairo_pattern_get_rgba", libcairo.} -proc get_surface*(pattern: PPattern, surface: PPSurface): TStatus{. - cdecl, importc: "cairo_pattern_get_surface", libcairo.} -proc get_color_stop_rgba*(pattern: PPattern, index: int32, - offset, red, green, blue, alpha: var float64): TStatus{. - cdecl, importc: "cairo_pattern_get_color_stop_rgba", libcairo.} -proc get_color_stop_count*(pattern: PPattern, count: var int32): TStatus{. - cdecl, importc: "cairo_pattern_get_color_stop_count", libcairo.} -proc get_linear_points*(pattern: PPattern, - x0, y0, x1, y1: var float64): TStatus{. - cdecl, importc: "cairo_pattern_get_linear_points", libcairo.} -proc get_radial_circles*(pattern: PPattern, - x0, y0, r0, x1, y1, r1: var float64): TStatus{. - cdecl, importc: "cairo_pattern_get_radial_circles", libcairo.} - #* Matrix functions -proc init*(matrix: PMatrix, xx, yx, xy, yy, x0, y0: float64){.cdecl, - importc: "cairo_matrix_init", libcairo.} -proc init_identity*(matrix: PMatrix){.cdecl, - importc: "cairo_matrix_init_identity", libcairo.} -proc init_translate*(matrix: PMatrix, tx, ty: float64){.cdecl, - importc: "cairo_matrix_init_translate", libcairo.} -proc init_scale*(matrix: PMatrix, sx, sy: float64){.cdecl, - importc: "cairo_matrix_init_scale", libcairo.} -proc init_rotate*(matrix: PMatrix, radians: float64){.cdecl, - importc: "cairo_matrix_init_rotate", libcairo.} -proc translate*(matrix: PMatrix, tx, ty: float64){.cdecl, - importc: "cairo_matrix_translate", libcairo.} -proc scale*(matrix: PMatrix, sx, sy: float64){.cdecl, - importc: "cairo_matrix_scale", libcairo.} -proc rotate*(matrix: PMatrix, radians: float64){.cdecl, - importc: "cairo_matrix_rotate", libcairo.} -proc invert*(matrix: PMatrix): TStatus{.cdecl, - importc: "cairo_matrix_invert", libcairo.} -proc multiply*(result, a, b: PMatrix){.cdecl, - importc: "cairo_matrix_multiply", libcairo.} -proc transform_distance*(matrix: PMatrix, dx, dy: var float64){.cdecl, - importc: "cairo_matrix_transform_distance", libcairo.} -proc transform_point*(matrix: PMatrix, x, y: var float64){.cdecl, - importc: "cairo_matrix_transform_point", libcairo.} - #* PDF functions -proc pdf_surface_create*(filename: cstring, - width_in_points, height_in_points: float64): PSurface{. - cdecl, importc: "cairo_pdf_surface_create", libcairo.} -proc pdf_surface_create_for_stream*(write_func: TWriteFunc, closure: Pointer, - width_in_points, height_in_points: float64): PSurface{. - cdecl, importc: "cairo_pdf_surface_create_for_stream", libcairo.} -proc pdf_surface_set_size*(surface: PSurface, - width_in_points, height_in_points: float64){.cdecl, - importc: "cairo_pdf_surface_set_size", libcairo.} - #* PS functions -proc ps_surface_create*(filename: cstring, - width_in_points, height_in_points: float64): PSurface{. - cdecl, importc: "cairo_ps_surface_create", libcairo.} -proc ps_surface_create_for_stream*(write_func: TWriteFunc, closure: Pointer, - width_in_points, height_in_points: float64): PSurface{. - cdecl, importc: "cairo_ps_surface_create_for_stream", libcairo.} -proc ps_surface_set_size*(surface: PSurface, - width_in_points, height_in_points: float64){.cdecl, - importc: "cairo_ps_surface_set_size", libcairo.} -proc ps_surface_dsc_comment*(surface: PSurface, comment: cstring){.cdecl, - importc: "cairo_ps_surface_dsc_comment", libcairo.} -proc ps_surface_dsc_begin_setup*(surface: PSurface){.cdecl, - importc: "cairo_ps_surface_dsc_begin_setup", libcairo.} -proc ps_surface_dsc_begin_page_setup*(surface: PSurface){.cdecl, - importc: "cairo_ps_surface_dsc_begin_page_setup", libcairo.} - #* SVG functions -proc svg_surface_create*(filename: cstring, - width_in_points, height_in_points: float64): PSurface{. - cdecl, importc: "cairo_svg_surface_create", libcairo.} -proc svg_surface_create_for_stream*(write_func: TWriteFunc, closure: Pointer, - width_in_points, height_in_points: float64): PSurface{. - cdecl, importc: "cairo_svg_surface_create_for_stream", libcairo.} -proc svg_surface_restrict_to_version*(surface: PSurface, version: TSvgVersion){. - cdecl, importc: "cairo_svg_surface_restrict_to_version", libcairo.} - #todo: see how translate this - #procedure cairo_svg_get_versions(TCairoSvgVersion const **versions, - # int *num_versions); -proc svg_version_to_string*(version: TSvgVersion): cstring{.cdecl, - importc: "cairo_svg_version_to_string", libcairo.} - #* Functions to be used while debugging (not intended for use in production code) -proc debug_reset_static_data*(){.cdecl, - importc: "cairo_debug_reset_static_data", - libcairo.} -# implementation - -proc version(major, minor, micro: var int32) = - var version: int32 - version = version() - major = version div 10000'i32 - minor = (version mod (major * 10000'i32)) div 100'i32 - micro = (version mod ((major * 10000'i32) + (minor * 100'i32))) - -proc checkStatus*(s: cairo.TStatus) {.noinline.} = - ## if ``s != StatusSuccess`` the error is turned into an appropirate Nimrod - ## exception and raised. - case s - of StatusSuccess: nil - of StatusNoMemory: - raise newException(EOutOfMemory, $statusToString(s)) - of STATUS_READ_ERROR, STATUS_WRITE_ERROR, STATUS_FILE_NOT_FOUND, - STATUS_TEMP_FILE_ERROR: - raise newException(EIO, $statusToString(s)) - else: - raise newException(EAssertionFailed, $statusToString(s)) - - diff --git a/lib/wrappers/cairo/cairo_pragma.nim b/lib/wrappers/cairo/cairo_pragma.nim deleted file mode 100644 index 11bf237f95..0000000000 --- a/lib/wrappers/cairo/cairo_pragma.nim +++ /dev/null @@ -1,16 +0,0 @@ -# included by cairo bindings - -when defined(use_pkg_config) or defined(use_pkg_config_static): - {.pragma: libcairo, cdecl.} - when defined(use_pkg_config_static): - {.passl: gorge("pkg-config cairo --libs --static").} - else: - {.passl: gorge("pkg-config cairo --libs").} -else: - when defined(windows): - const LIB_CAIRO* = "libcairo-2.dll" - elif defined(macosx): - const LIB_CAIRO* = "libcairo.dylib" - else: - const LIB_CAIRO* = "libcairo.so(|.2)" - {.pragma: libcairo, cdecl, dynlib: LIB_CAIRO.} diff --git a/lib/wrappers/cairo/cairoft.nim b/lib/wrappers/cairo/cairoft.nim deleted file mode 100644 index 5f4e476628..0000000000 --- a/lib/wrappers/cairo/cairoft.nim +++ /dev/null @@ -1,36 +0,0 @@ -# -# Translation of cairo-ft.h -# by Jeffrey Pohlmeyer -# updated to version 1.4 by Luiz Américo Pereira Câmara 2007 -# - -import - cairo, freetypeh - -include "cairo_pragma.nim" -#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* = ptr FcPattern - -proc ft_font_face_create_for_pattern*(pattern: PFcPattern): PFontFace{.libcairo, - importc: "cairo_ft_font_face_create_for_pattern".} -proc ft_font_options_substitute*(options: PFontOptions, pattern: PFcPattern){. - libcairo, importc: "cairo_ft_font_options_substitute".} -proc ft_font_face_create_for_ft_face*(face: TFT_Face, load_flags: int32): PFontFace{.libcairo, - importc: "cairo_ft_font_face_create_for_ft_face".} -proc ft_scaled_font_lock_face*(scaled_font: PScaledFont): TFT_Face{.libcairo, - importc: "cairo_ft_scaled_font_lock_face".} -proc ft_scaled_font_unlock_face*(scaled_font: PScaledFont){.libcairo, - importc: "cairo_ft_scaled_font_unlock_face".} diff --git a/lib/wrappers/cairo/cairowin32.nim b/lib/wrappers/cairo/cairowin32.nim deleted file mode 100644 index cec3a5bc5a..0000000000 --- a/lib/wrappers/cairo/cairowin32.nim +++ /dev/null @@ -1,37 +0,0 @@ -# -# Translation of cairo-win32.h version 1.4 -# by Luiz Américo Pereira Câmara 2007 -# - -import - cairo, windows - -proc win32_surface_create*(hdc: HDC): PSurface{.cdecl, - importc: "cairo_win32_surface_create", dynlib: LIB_CAIRO.} -proc win32_surface_create_with_ddb*(hdc: HDC, format: TFormat, - width, height: int32): PSurface{.cdecl, - importc: "cairo_win32_surface_create_with_ddb", dynlib: LIB_CAIRO.} -proc win32_surface_create_with_dib*(format: TFormat, width, height: int32): PSurface{. - cdecl, importc: "cairo_win32_surface_create_with_dib", dynlib: LIB_CAIRO.} -proc win32_surface_get_dc*(surface: PSurface): HDC{.cdecl, - importc: "cairo_win32_surface_get_dc", dynlib: LIB_CAIRO.} -proc win32_surface_get_image*(surface: PSurface): PSurface{.cdecl, - importc: "cairo_win32_surface_get_image", dynlib: LIB_CAIRO.} -proc win32_font_face_create_for_logfontw*(logfont: pLOGFONTW): PFontFace{.cdecl, - importc: "cairo_win32_font_face_create_for_logfontw", dynlib: LIB_CAIRO.} -proc win32_font_face_create_for_hfont*(font: HFONT): PFontFace{.cdecl, - importc: "cairo_win32_font_face_create_for_hfont", dynlib: LIB_CAIRO.} -proc win32_scaled_font_select_font*(scaled_font: PScaledFont, hdc: HDC): TStatus{. - cdecl, importc: "cairo_win32_scaled_font_select_font", dynlib: LIB_CAIRO.} -proc win32_scaled_font_done_font*(scaled_font: PScaledFont){.cdecl, - importc: "cairo_win32_scaled_font_done_font", dynlib: LIB_CAIRO.} -proc win32_scaled_font_get_metrics_factor*(scaled_font: PScaledFont): float64{. - cdecl, importc: "cairo_win32_scaled_font_get_metrics_factor", - dynlib: LIB_CAIRO.} -proc win32_scaled_font_get_logical_to_device*(scaled_font: PScaledFont, - logical_to_device: PMatrix){.cdecl, importc: "cairo_win32_scaled_font_get_logical_to_device", - dynlib: LIB_CAIRO.} -proc win32_scaled_font_get_device_to_logical*(scaled_font: PScaledFont, - device_to_logical: PMatrix){.cdecl, importc: "cairo_win32_scaled_font_get_device_to_logical", - dynlib: LIB_CAIRO.} -# implementation diff --git a/lib/wrappers/cairo/cairoxlib.nim b/lib/wrappers/cairo/cairoxlib.nim deleted file mode 100644 index 273a8b42f0..0000000000 --- a/lib/wrappers/cairo/cairoxlib.nim +++ /dev/null @@ -1,41 +0,0 @@ -# -# 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 - -include "cairo_pragma.nim" - -proc xlib_surface_create*(dpy: PDisplay, drawable: TDrawable, visual: PVisual, - width, height: int32): PSurface{.cdecl, - importc: "cairo_xlib_surface_create", libcairo.} -proc xlib_surface_create_for_bitmap*(dpy: PDisplay, bitmap: TPixmap, - screen: PScreen, width, height: int32): PSurface{. - cdecl, importc: "cairo_xlib_surface_create_for_bitmap", libcairo.} -proc xlib_surface_create_with_xrender_format*(dpy: PDisplay, - drawable: TDrawable, screen: PScreen, format: PXRenderPictFormat, - width, height: int32): PSurface{.cdecl, importc: "cairo_xlib_surface_create_with_xrender_format", - libcairo.} -proc xlib_surface_get_depth*(surface: PSurface): int32{.cdecl, - importc: "cairo_xlib_surface_get_depth", libcairo.} -proc xlib_surface_get_display*(surface: PSurface): PDisplay{.cdecl, - importc: "cairo_xlib_surface_get_display", libcairo.} -proc xlib_surface_get_drawable*(surface: PSurface): TDrawable{.cdecl, - importc: "cairo_xlib_surface_get_drawable", libcairo.} -proc xlib_surface_get_height*(surface: PSurface): int32{.cdecl, - importc: "cairo_xlib_surface_get_height", libcairo.} -proc xlib_surface_get_screen*(surface: PSurface): PScreen{.cdecl, - importc: "cairo_xlib_surface_get_screen", libcairo.} -proc xlib_surface_get_visual*(surface: PSurface): PVisual{.cdecl, - importc: "cairo_xlib_surface_get_visual", libcairo.} -proc xlib_surface_get_width*(surface: PSurface): int32{.cdecl, - importc: "cairo_xlib_surface_get_width", libcairo.} -proc xlib_surface_set_size*(surface: PSurface, width, height: int32){.cdecl, - importc: "cairo_xlib_surface_set_size", libcairo.} -proc xlib_surface_set_drawable*(surface: PSurface, drawable: TDrawable, - width, height: int32){.cdecl, - importc: "cairo_xlib_surface_set_drawable", libcairo.} -# implementation diff --git a/lib/wrappers/lua/lauxlib.nim b/lib/wrappers/lua/lauxlib.nim deleted file mode 100644 index b985858d33..0000000000 --- a/lib/wrappers/lua/lauxlib.nim +++ /dev/null @@ -1,208 +0,0 @@ -#***************************************************************************** -# * * -# * File: lauxlib.pas * -# * Authors: TeCGraf (C headers + actual Lua libraries) * -# * Lavergne Thomas (original translation to Pascal) * -# * Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal) * -# * Description: Lua auxiliary library * -# * * -# ***************************************************************************** -# -#** $Id: lauxlib.h,v 1.59 2003/03/18 12:25:32 roberto Exp $ -#** Auxiliary functions for building Lua libraries -#** See Copyright Notice in lua.h -# -# -#** Translated to pascal by Lavergne Thomas -#** Notes : -#** - Pointers type was prefixed with 'P' -#** Bug reports : -#** - thomas.lavergne@laposte.net -#** In french or in english -# - -import - lua - -proc pushstring*(L: PState, s: string) - # compatibilty macros -proc getn*(L: PState, n: cint): cint - # calls lua_objlen -proc setn*(L: PState, t, n: cint) - # does nothing! -type - Treg*{.final.} = object - name*: cstring - func*: CFunction - - Preg* = ptr Treg - - -{.push callConv: cdecl, dynlib: lua.LIB_NAME.} -{.push importc: "luaL_$1".} - -proc openlib*(L: PState, libname: cstring, lr: Preg, nup: cint) -proc register*(L: PState, libname: cstring, lr: Preg) - -proc getmetafield*(L: PState, obj: cint, e: cstring): cint -proc callmeta*(L: PState, obj: cint, e: cstring): cint -proc typerror*(L: PState, narg: cint, tname: cstring): cint -proc argerror*(L: PState, numarg: cint, extramsg: cstring): cint -proc checklstring*(L: PState, numArg: cint, len: ptr int): cstring -proc optlstring*(L: PState, numArg: cint, def: cstring, len: ptr cint): cstring -proc checknumber*(L: PState, numArg: cint): Number -proc optnumber*(L: PState, nArg: cint, def: Number): Number -proc checkinteger*(L: PState, numArg: cint): Integer -proc optinteger*(L: PState, nArg: cint, def: Integer): Integer -proc checkstack*(L: PState, sz: cint, msg: cstring) -proc checktype*(L: PState, narg, t: cint) - -proc checkany*(L: PState, narg: cint) -proc newmetatable*(L: PState, tname: cstring): cint - -proc checkudata*(L: PState, ud: cint, tname: cstring): Pointer -proc where*(L: PState, lvl: cint) -proc error*(L: PState, fmt: cstring): cint{.varargs.} -proc checkoption*(L: PState, narg: cint, def: cstring, lst: cstringArray): cint - -proc unref*(L: PState, t, theref: cint) -proc loadfile*(L: PState, filename: cstring): cint -proc loadbuffer*(L: PState, buff: cstring, size: cint, name: cstring): cint -proc loadstring*(L: PState, s: cstring): cint -proc newstate*(): PState - -{.pop.} -proc reference*(L: PState, t: cint): cint{.importc: "luaL_ref".} - -{.pop.} - -proc open*(): PState - # compatibility; moved from unit lua to lauxlib because it needs luaL_newstate - # - #** =============================================================== - #** some useful macros - #** =============================================================== - # -proc argcheck*(L: PState, cond: bool, numarg: cint, extramsg: cstring) -proc checkstring*(L: PState, n: cint): cstring -proc optstring*(L: PState, n: cint, d: cstring): cstring -proc checkint*(L: PState, n: cint): cint -proc checklong*(L: PState, n: cint): clong -proc optint*(L: PState, n: cint, d: float64): cint -proc optlong*(L: PState, n: cint, d: float64): clong -proc dofile*(L: PState, filename: cstring): cint -proc dostring*(L: PState, str: cstring): cint -proc getmetatable*(L: PState, tname: cstring) - # not translated: - # #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) - # - #** ======================================================= - #** Generic Buffer manipulation - #** ======================================================= - # -const # note: this is just arbitrary, as it related to the BUFSIZ defined in stdio.h ... - BUFFERSIZE* = 4096 - -type - Buffer*{.final.} = object - p*: cstring # current position in buffer - lvl*: cint # number of strings in the stack (level) - L*: PState - buffer*: array[0..BUFFERSIZE - 1, Char] # warning: see note above about LUAL_BUFFERSIZE - - PBuffer* = ptr Buffer - -proc addchar*(B: PBuffer, c: Char) - # warning: see note above about LUAL_BUFFERSIZE - # compatibility only (alias for luaL_addchar) -proc putchar*(B: PBuffer, c: Char) - # warning: see note above about LUAL_BUFFERSIZE -proc addsize*(B: PBuffer, n: cint) - -{.push callConv: cdecl, dynlib: lua.LIB_NAME, importc: "luaL_$1".} -proc buffinit*(L: PState, B: PBuffer) -proc prepbuffer*(B: PBuffer): cstring -proc addlstring*(B: PBuffer, s: cstring, L: cint) -proc addstring*(B: PBuffer, s: cstring) -proc addvalue*(B: PBuffer) -proc pushresult*(B: PBuffer) -proc gsub*(L: PState, s, p, r: cstring): cstring -proc findtable*(L: PState, idx: cint, fname: cstring, szhint: cint): cstring - # compatibility with ref system - # pre-defined references -{.pop.} - -const - NOREF* = - 2 - REFNIL* = - 1 - -proc unref*(L: PState, theref: cint) -proc getref*(L: PState, theref: cint) - # - #** Compatibility macros and functions - # -# implementation - -proc pushstring(L: PState, s: string) = - pushlstring(L, cstring(s), s.len.cint) - -proc getn(L: PState, n: cint): cint = - Result = objlen(L, n) - -proc setn(L: PState, t, n: cint) = - # does nothing as this operation is deprecated - nil - -proc open(): PState = - Result = newstate() - -proc dofile(L: PState, filename: cstring): cint = - Result = loadfile(L, filename) - if Result == 0: Result = pcall(L, 0, MULTRET, 0) - -proc dostring(L: PState, str: cstring): cint = - Result = loadstring(L, str) - if Result == 0: Result = pcall(L, 0, MULTRET, 0) - -proc getmetatable(L: PState, tname: cstring) = - getfield(L, REGISTRYINDEX, tname) - -proc argcheck(L: PState, cond: bool, numarg: cint, extramsg: cstring) = - if not cond: - discard argerror(L, numarg, extramsg) - -proc checkstring(L: PState, n: cint): cstring = - Result = checklstring(L, n, nil) - -proc optstring(L: PState, n: cint, d: cstring): cstring = - Result = optlstring(L, n, d, nil) - -proc checkint(L: PState, n: cint): cint = - Result = cint(checknumber(L, n)) - -proc checklong(L: PState, n: cint): clong = - Result = int32(ToInt(checknumber(L, n))) - -proc optint(L: PState, n: cint, d: float64): cint = - Result = optnumber(L, n, d).cint - -proc optlong(L: PState, n: cint, d: float64): clong = - Result = int32(ToInt(optnumber(L, n, d))) - -proc addchar(B: PBuffer, c: Char) = - if cast[int](addr((B.p))) < (cast[int](addr((B.buffer[0]))) + BUFFERSIZE): - discard prepbuffer(B) - B.p[1] = c - B.p = cast[cstring](cast[int](B.p) + 1) - -proc putchar(B: PBuffer, c: Char) = - addchar(B, c) - -proc addsize(B: PBuffer, n: cint) = - B.p = cast[cstring](cast[int](B.p) + n) - -proc unref(L: PState, theref: cint) = - unref(L, REGISTRYINDEX, theref) - -proc getref(L: PState, theref: cint) = - rawgeti(L, REGISTRYINDEX, theref) diff --git a/lib/wrappers/lua/lua.nim b/lib/wrappers/lua/lua.nim deleted file mode 100644 index 153714cee4..0000000000 --- a/lib/wrappers/lua/lua.nim +++ /dev/null @@ -1,364 +0,0 @@ -#***************************************************************************** -# * * -# * File: lua.pas * -# * Authors: TeCGraf (C headers + actual Lua libraries) * -# * Lavergne Thomas (original translation to Pascal) * -# * Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal) * -# * Description: Basic Lua library * -# * * -# ***************************************************************************** -# -#** $Id: lua.h,v 1.175 2003/03/18 12:31:39 roberto Exp $ -#** Lua - An Extensible Extension Language -#** TeCGraf: Computer Graphics Technology Group, PUC-Rio, Brazil -#** http://www.lua.org mailto:info@lua.org -#** See Copyright Notice at the end of this file -# -# -#** Updated to Lua 5.1.1 by Bram Kuijvenhoven (bram at kuijvenhoven dot net), -#** Hexis BV (http://www.hexis.nl), the Netherlands -#** Notes: -#** - Only tested with FPC (FreePascal Compiler) -#** - Using LuaBinaries styled DLL/SO names, which include version names -#** - LUA_YIELD was suffixed by '_' for avoiding name collision -# -# -#** Translated to pascal by Lavergne Thomas -#** Notes : -#** - Pointers type was prefixed with 'P' -#** - lua_upvalueindex constant was transformed to function -#** - Some compatibility function was isolated because with it you must have -#** lualib. -#** - LUA_VERSION was suffixed by '_' for avoiding name collision. -#** Bug reports : -#** - thomas.lavergne@laposte.net -#** In french or in english -# - -when defined(useLuajit): - when defined(MACOSX): - const - NAME* = "libluajit.dylib" - LIB_NAME* = "libluajit.dylib" - elif defined(UNIX): - const - NAME* = "libluajit.so(|.0)" - LIB_NAME* = "libluajit.so(|.0)" - else: - const - NAME* = "luajit.dll" - LIB_NAME* = "luajit.dll" -else: - when defined(MACOSX): - const - NAME* = "liblua(|5.1|5.0).dylib" - LIB_NAME* = "liblua(|5.1|5.0).dylib" - elif defined(UNIX): - const - NAME* = "liblua(|5.1|5.0).so(|.0)" - LIB_NAME* = "liblua(|5.1|5.0).so(|.0)" - else: - const - NAME* = "lua(|5.1|5.0).dll" - LIB_NAME* = "lua(|5.1|5.0).dll" - -const - VERSION* = "Lua 5.1" - RELEASE* = "Lua 5.1.1" - VERSION_NUM* = 501 - COPYRIGHT* = "Copyright (C) 1994-2006 Lua.org, PUC-Rio" - AUTHORS* = "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" - # option for multiple returns in `lua_pcall' and `lua_call' - MULTRET* = - 1 # - #** pseudo-indices - # - REGISTRYINDEX* = - 10000 - ENVIRONINDEX* = - 10001 - GLOBALSINDEX* = - 10002 - -proc upvalueindex*(I: cint): cint -const # thread status; 0 is OK - constYIELD* = 1 - ERRRUN* = 2 - ERRSYNTAX* = 3 - ERRMEM* = 4 - ERRERR* = 5 - -type - PState* = Pointer - CFunction* = proc (L: PState): cint{.cdecl.} - -# -#** functions that read/write blocks when loading/dumping Lua chunks -# - -type - Reader* = proc (L: PState, ud: Pointer, sz: ptr cint): cstring{.cdecl.} - Writer* = proc (L: PState, p: Pointer, sz: cint, ud: Pointer): cint{.cdecl.} - Alloc* = proc (ud, theptr: Pointer, osize, nsize: cint){.cdecl.} - -const - TNONE* = - 1 - TNIL* = 0 - TBOOLEAN* = 1 - TLIGHTUSERDATA* = 2 - TNUMBER* = 3 - TSTRING* = 4 - TTABLE* = 5 - TFUNCTION* = 6 - TUSERDATA* = 7 - TTHREAD* = 8 # minimum Lua stack available to a C function - MINSTACK* = 20 - -type # Type of Numbers in Lua - Number* = float - Integer* = cint - -{.pragma: ilua, importc: "lua_$1".} - -{.push callConv: cdecl, dynlib: LibName.} -#{.push importc: "lua_$1".} - -proc newstate*(f: Alloc, ud: Pointer): PState {.ilua.} - -proc close*(L: PState){.ilua.} -proc newthread*(L: PState): PState{.ilua.} -proc atpanic*(L: PState, panicf: CFunction): CFunction{.ilua.} - -proc gettop*(L: PState): cint{.ilua.} -proc settop*(L: PState, idx: cint){.ilua.} -proc pushvalue*(L: PState, Idx: cint){.ilua.} -proc remove*(L: PState, idx: cint){.ilua.} -proc insert*(L: PState, idx: cint){.ilua.} -proc replace*(L: PState, idx: cint){.ilua.} -proc checkstack*(L: PState, sz: cint): cint{.ilua.} -proc xmove*(`from`, `to`: PState, n: cint){.ilua.} -proc isnumber*(L: PState, idx: cint): cint{.ilua.} -proc isstring*(L: PState, idx: cint): cint{.ilua.} -proc iscfunction*(L: PState, idx: cint): cint{.ilua.} -proc isuserdata*(L: PState, idx: cint): cint{.ilua.} -proc luatype*(L: PState, idx: cint): cint{.importc: "lua_type".} -proc typename*(L: PState, tp: cint): cstring{.ilua.} -proc equal*(L: PState, idx1, idx2: cint): cint{.ilua.} -proc rawequal*(L: PState, idx1, idx2: cint): cint{.ilua.} -proc lessthan*(L: PState, idx1, idx2: cint): cint{.ilua.} -proc tonumber*(L: PState, idx: cint): Number{.ilua.} -proc tointeger*(L: PState, idx: cint): Integer{.ilua.} -proc toboolean*(L: PState, idx: cint): cint{.ilua.} -proc tolstring*(L: PState, idx: cint, length: ptr cint): cstring{.ilua.} -proc objlen*(L: PState, idx: cint): cint{.ilua.} -proc tocfunction*(L: PState, idx: cint): CFunction{.ilua.} -proc touserdata*(L: PState, idx: cint): Pointer{.ilua.} -proc tothread*(L: PState, idx: cint): PState{.ilua.} -proc topointer*(L: PState, idx: cint): Pointer{.ilua.} -proc pushnil*(L: PState){.ilua.} -proc pushnumber*(L: PState, n: Number){.ilua.} -proc pushinteger*(L: PState, n: Integer){.ilua.} -proc pushlstring*(L: PState, s: cstring, len: cint){.ilua.} -proc pushstring*(L: PState, s: cstring){.ilua.} -proc pushvfstring*(L: PState, fmt: cstring, argp: Pointer): cstring{.ilua.} -proc pushfstring*(L: PState, fmt: cstring): cstring{.varargs,ilua.} -proc pushcclosure*(L: PState, fn: CFunction, n: cint){.ilua.} -proc pushboolean*(L: PState, b: cint){.ilua.} -proc pushlightuserdata*(L: PState, p: Pointer){.ilua.} -proc pushthread*(L: PState){.ilua.} -proc gettable*(L: PState, idx: cint){.ilua.} -proc getfield*(L: Pstate, idx: cint, k: cstring){.ilua.} -proc rawget*(L: PState, idx: cint){.ilua.} -proc rawgeti*(L: PState, idx, n: cint){.ilua.} -proc createtable*(L: PState, narr, nrec: cint){.ilua.} -proc newuserdata*(L: PState, sz: cint): Pointer{.ilua.} -proc getmetatable*(L: PState, objindex: cint): cint{.ilua.} -proc getfenv*(L: PState, idx: cint){.ilua.} -proc settable*(L: PState, idx: cint){.ilua.} -proc setfield*(L: PState, idx: cint, k: cstring){.ilua.} -proc rawset*(L: PState, idx: cint){.ilua.} -proc rawseti*(L: PState, idx, n: cint){.ilua.} -proc setmetatable*(L: PState, objindex: cint): cint{.ilua.} -proc setfenv*(L: PState, idx: cint): cint{.ilua.} -proc call*(L: PState, nargs, nresults: cint){.ilua.} -proc pcall*(L: PState, nargs, nresults, errf: cint): cint{.ilua.} -proc cpcall*(L: PState, func: CFunction, ud: Pointer): cint{.ilua.} -proc load*(L: PState, reader: Reader, dt: Pointer, chunkname: cstring): cint{.ilua.} -proc dump*(L: PState, writer: Writer, data: Pointer): cint{.ilua.} -proc luayield*(L: PState, nresults: cint): cint{.importc: "lua_yield".} -proc resume*(L: PState, narg: cint): cint{.ilua.} -proc status*(L: PState): cint{.ilua.} -proc gc*(L: PState, what, data: cint): cint{.ilua.} -proc error*(L: PState): cint{.ilua.} -proc next*(L: PState, idx: cint): cint{.ilua.} -proc concat*(L: PState, n: cint){.ilua.} -proc getallocf*(L: PState, ud: ptr Pointer): Alloc{.ilua.} -proc setallocf*(L: PState, f: Alloc, ud: Pointer){.ilua.} -{.pop.} - -# -#** Garbage-collection functions and options -# - -const - GCSTOP* = 0 - GCRESTART* = 1 - GCCOLLECT* = 2 - GCCOUNT* = 3 - GCCOUNTB* = 4 - GCSTEP* = 5 - GCSETPAUSE* = 6 - GCSETSTEPMUL* = 7 - -# -#** =============================================================== -#** some useful macros -#** =============================================================== -# - -proc pop*(L: PState, n: cint) -proc newtable*(L: Pstate) -proc register*(L: PState, n: cstring, f: CFunction) -proc pushcfunction*(L: PState, f: CFunction) -proc strlen*(L: Pstate, i: cint): cint -proc isfunction*(L: PState, n: cint): bool -proc istable*(L: PState, n: cint): bool -proc islightuserdata*(L: PState, n: cint): bool -proc isnil*(L: PState, n: cint): bool -proc isboolean*(L: PState, n: cint): bool -proc isthread*(L: PState, n: cint): bool -proc isnone*(L: PState, n: cint): bool -proc isnoneornil*(L: PState, n: cint): bool -proc pushliteral*(L: PState, s: cstring) -proc setglobal*(L: PState, s: cstring) -proc getglobal*(L: PState, s: cstring) -proc tostring*(L: PState, i: cint): cstring -# -#** compatibility macros and functions -# - -proc getregistry*(L: PState) -proc getgccount*(L: PState): cint -type - Chunkreader* = Reader - Chunkwriter* = Writer - -# -#** ====================================================================== -#** Debug API -#** ====================================================================== -# - -const - HOOKCALL* = 0 - HOOKRET* = 1 - HOOKLINE* = 2 - HOOKCOUNT* = 3 - HOOKTAILRET* = 4 - -const - MASKCALL* = 1 shl Ord(HOOKCALL) - MASKRET* = 1 shl Ord(HOOKRET) - MASKLINE* = 1 shl Ord(HOOKLINE) - MASKCOUNT* = 1 shl Ord(HOOKCOUNT) - -const - IDSIZE* = 60 - -type - TDebug*{.final.} = object # activation record - event*: cint - name*: cstring # (n) - namewhat*: cstring # (n) `global', `local', `field', `method' - what*: cstring # (S) `Lua', `C', `main', `tail' - source*: cstring # (S) - currentline*: cint # (l) - nups*: cint # (u) number of upvalues - linedefined*: cint # (S) - lastlinedefined*: cint # (S) - short_src*: array[0.. 0 - # XXX Should this have the same value as Py_TPFLAGS_HAVE_RICHCOMPARE? - # These both indicate a feature that appeared in the same alpha release. - Py_TPFLAGS_HAVE_WEAKREFS* = (1 shl 6) # tp_iter is defined - Py_TPFLAGS_HAVE_ITER* = (1 shl 7) # New members introduced by Python 2.2 exist - Py_TPFLAGS_HAVE_CLASS* = (1 shl 8) # Set if the type object is dynamically allocated - Py_TPFLAGS_HEAPTYPE* = (1 shl 9) # Set if the type allows subclassing - Py_TPFLAGS_BASETYPE* = (1 shl 10) # Set if the type is 'ready' -- fully initialized - Py_TPFLAGS_READY* = (1 shl 12) # Set while the type is being 'readied', to prevent recursive ready calls - Py_TPFLAGS_READYING* = (1 shl 13) # Objects support garbage collection (see objimp.h) - Py_TPFLAGS_HAVE_GC* = (1 shl 14) - Py_TPFLAGS_DEFAULT* = Py_TPFLAGS_HAVE_GETCHARBUFFER or - Py_TPFLAGS_HAVE_SEQUENCE_IN or Py_TPFLAGS_HAVE_INPLACEOPS or - Py_TPFLAGS_HAVE_RICHCOMPARE or Py_TPFLAGS_HAVE_WEAKREFS or - Py_TPFLAGS_HAVE_ITER or Py_TPFLAGS_HAVE_CLASS - -type - TPFlag* = enum - tpfHaveGetCharBuffer, tpfHaveSequenceIn, tpfGC, tpfHaveInplaceOps, - tpfCheckTypes, tpfHaveRichCompare, tpfHaveWeakRefs, tpfHaveIter, - tpfHaveClass, tpfHeapType, tpfBaseType, tpfReady, tpfReadying, tpfHaveGC - TPFlags* = set[TPFlag] - -const - TPFLAGS_DEFAULT* = {tpfHaveGetCharBuffer, tpfHaveSequenceIn, - tpfHaveInplaceOps, tpfHaveRichCompare, tpfHaveWeakRefs, tpfHaveIter, - tpfHaveClass} - -const # Python opcodes - single_input* = 256 - file_input* = 257 - eval_input* = 258 - funcdef* = 259 - parameters* = 260 - varargslist* = 261 - fpdef* = 262 - fplist* = 263 - stmt* = 264 - simple_stmt* = 265 - small_stmt* = 266 - expr_stmt* = 267 - augassign* = 268 - print_stmt* = 269 - del_stmt* = 270 - pass_stmt* = 271 - flow_stmt* = 272 - break_stmt* = 273 - continue_stmt* = 274 - return_stmt* = 275 - raise_stmt* = 276 - import_stmt* = 277 - import_as_name* = 278 - dotted_as_name* = 279 - dotted_name* = 280 - global_stmt* = 281 - exec_stmt* = 282 - assert_stmt* = 283 - compound_stmt* = 284 - if_stmt* = 285 - while_stmt* = 286 - for_stmt* = 287 - try_stmt* = 288 - except_clause* = 289 - suite* = 290 - test* = 291 - and_test* = 291 - not_test* = 293 - comparison* = 294 - comp_op* = 295 - expr* = 296 - xor_expr* = 297 - and_expr* = 298 - shift_expr* = 299 - arith_expr* = 300 - term* = 301 - factor* = 302 - power* = 303 - atom* = 304 - listmaker* = 305 - lambdef* = 306 - trailer* = 307 - subscriptlist* = 308 - subscript* = 309 - sliceop* = 310 - exprlist* = 311 - testlist* = 312 - dictmaker* = 313 - classdef* = 314 - arglist* = 315 - argument* = 316 - list_iter* = 317 - list_for* = 318 - list_if* = 319 - -const - T_SHORT* = 0 - T_INT* = 1 - T_LONG* = 2 - T_FLOAT* = 3 - T_DOUBLE* = 4 - T_STRING* = 5 - T_OBJECT* = 6 - T_CHAR* = 7 # 1-character string - T_BYTE* = 8 # 8-bit signed int - T_UBYTE* = 9 - T_USHORT* = 10 - T_UINT* = 11 - T_ULONG* = 12 - T_STRING_INPLACE* = 13 - T_OBJECT_EX* = 16 - READONLY* = 1 - RO* = READONLY # Shorthand - READ_RESTRICTED* = 2 - WRITE_RESTRICTED* = 4 - RESTRICTED* = (READ_RESTRICTED or WRITE_RESTRICTED) - -type - TPyMemberType* = enum - mtShort, mtInt, mtLong, mtFloat, mtDouble, mtString, mtObject, mtChar, - mtByte, mtUByte, mtUShort, mtUInt, mtULong, mtStringInplace, mtObjectEx - TPyMemberFlag* = enum - mfDefault, mfReadOnly, mfReadRestricted, mfWriteRestricted, mfRestricted - -type - PInt* = ptr int - -# PLong* = ptr int32 -# PFloat* = ptr float32 -# PShort* = ptr int8 - -type - PP_frozen* = ptr Pfrozen - P_frozen* = ptr Tfrozen - PPyObject* = ptr TPyObject - PPPyObject* = ptr PPyObject - PPPPyObject* = ptr PPPyObject - PPyIntObject* = ptr TPyIntObject - PPyTypeObject* = ptr TPyTypeObject - PPySliceObject* = ptr TPySliceObject - TPyCFunction* = proc (self, args: PPyObject): PPyObject{.cdecl.} - Tunaryfunc* = proc (ob1: PPyObject): PPyObject{.cdecl.} - Tbinaryfunc* = proc (ob1, ob2: PPyObject): PPyObject{.cdecl.} - Tternaryfunc* = proc (ob1, ob2, ob3: PPyObject): PPyObject{.cdecl.} - Tinquiry* = proc (ob1: PPyObject): int{.cdecl.} - Tcoercion* = proc (ob1, ob2: PPPyObject): int{.cdecl.} - Tintargfunc* = proc (ob1: PPyObject, i: int): PPyObject{.cdecl.} - Tintintargfunc* = proc (ob1: PPyObject, i1, i2: int): PPyObject{.cdecl.} - Tintobjargproc* = proc (ob1: PPyObject, i: int, ob2: PPyObject): int{.cdecl.} - Tintintobjargproc* = proc (ob1: PPyObject, i1, i2: int, ob2: PPyObject): int{. - cdecl.} - Tobjobjargproc* = proc (ob1, ob2, ob3: PPyObject): int{.cdecl.} - Tpydestructor* = proc (ob: PPyObject){.cdecl.} - Tprintfunc* = proc (ob: PPyObject, f: TFile, i: int): int{.cdecl.} - Tgetattrfunc* = proc (ob1: PPyObject, name: cstring): PPyObject{.cdecl.} - Tsetattrfunc* = proc (ob1: PPyObject, name: cstring, ob2: PPyObject): int{. - cdecl.} - Tcmpfunc* = proc (ob1, ob2: PPyObject): int{.cdecl.} - Treprfunc* = proc (ob: PPyObject): PPyObject{.cdecl.} - Thashfunc* = proc (ob: PPyObject): int32{.cdecl.} - Tgetattrofunc* = proc (ob1, ob2: PPyObject): PPyObject{.cdecl.} - Tsetattrofunc* = proc (ob1, ob2, ob3: PPyObject): int{.cdecl.} - Tgetreadbufferproc* = proc (ob1: PPyObject, i: int, p: Pointer): int{.cdecl.} - Tgetwritebufferproc* = proc (ob1: PPyObject, i: int, p: Pointer): int{.cdecl.} - Tgetsegcountproc* = proc (ob1: PPyObject, i: int): int{.cdecl.} - Tgetcharbufferproc* = proc (ob1: PPyObject, i: int, pstr: cstring): int{.cdecl.} - Tobjobjproc* = proc (ob1, ob2: PPyObject): int{.cdecl.} - Tvisitproc* = proc (ob1: PPyObject, p: Pointer): int{.cdecl.} - Ttraverseproc* = proc (ob1: PPyObject, prc: TVisitproc, p: Pointer): int{. - cdecl.} - Trichcmpfunc* = proc (ob1, ob2: PPyObject, i: int): PPyObject{.cdecl.} - Tgetiterfunc* = proc (ob1: PPyObject): PPyObject{.cdecl.} - Titernextfunc* = proc (ob1: PPyObject): PPyObject{.cdecl.} - Tdescrgetfunc* = proc (ob1, ob2, ob3: PPyObject): PPyObject{.cdecl.} - Tdescrsetfunc* = proc (ob1, ob2, ob3: PPyObject): int{.cdecl.} - Tinitproc* = proc (self, args, kwds: PPyObject): int{.cdecl.} - Tnewfunc* = proc (subtype: PPyTypeObject, args, kwds: PPyObject): PPyObject{. - cdecl.} - Tallocfunc* = proc (self: PPyTypeObject, nitems: int): PPyObject{.cdecl.} - TPyNumberMethods*{.final.} = object - nb_add*: Tbinaryfunc - nb_substract*: Tbinaryfunc - nb_multiply*: Tbinaryfunc - nb_divide*: Tbinaryfunc - nb_remainder*: Tbinaryfunc - nb_divmod*: Tbinaryfunc - nb_power*: Tternaryfunc - nb_negative*: Tunaryfunc - nb_positive*: Tunaryfunc - nb_absolute*: Tunaryfunc - nb_nonzero*: Tinquiry - nb_invert*: Tunaryfunc - nb_lshift*: Tbinaryfunc - nb_rshift*: Tbinaryfunc - nb_and*: Tbinaryfunc - nb_xor*: Tbinaryfunc - nb_or*: Tbinaryfunc - nb_coerce*: Tcoercion - nb_int*: Tunaryfunc - nb_long*: Tunaryfunc - nb_float*: Tunaryfunc - nb_oct*: Tunaryfunc - nb_hex*: Tunaryfunc #/ jah 29-sep-2000: updated for python 2.0 - #/ added from .h - nb_inplace_add*: Tbinaryfunc - nb_inplace_subtract*: Tbinaryfunc - nb_inplace_multiply*: Tbinaryfunc - nb_inplace_divide*: Tbinaryfunc - nb_inplace_remainder*: Tbinaryfunc - nb_inplace_power*: Tternaryfunc - nb_inplace_lshift*: Tbinaryfunc - nb_inplace_rshift*: Tbinaryfunc - nb_inplace_and*: Tbinaryfunc - nb_inplace_xor*: Tbinaryfunc - nb_inplace_or*: Tbinaryfunc # Added in release 2.2 - # The following require the Py_TPFLAGS_HAVE_CLASS flag - nb_floor_divide*: Tbinaryfunc - nb_true_divide*: Tbinaryfunc - nb_inplace_floor_divide*: Tbinaryfunc - nb_inplace_true_divide*: Tbinaryfunc - - PPyNumberMethods* = ptr TPyNumberMethods - TPySequenceMethods*{.final.} = object - sq_length*: Tinquiry - sq_concat*: Tbinaryfunc - sq_repeat*: Tintargfunc - sq_item*: Tintargfunc - sq_slice*: Tintintargfunc - sq_ass_item*: Tintobjargproc - sq_ass_slice*: Tintintobjargproc - sq_contains*: Tobjobjproc - sq_inplace_concat*: Tbinaryfunc - sq_inplace_repeat*: Tintargfunc - - PPySequenceMethods* = ptr TPySequenceMethods - TPyMappingMethods*{.final.} = object - mp_length*: Tinquiry - mp_subscript*: Tbinaryfunc - mp_ass_subscript*: Tobjobjargproc - - PPyMappingMethods* = ptr TPyMappingMethods - TPyBufferProcs*{.final.} = object - bf_getreadbuffer*: Tgetreadbufferproc - bf_getwritebuffer*: Tgetwritebufferproc - bf_getsegcount*: Tgetsegcountproc - bf_getcharbuffer*: Tgetcharbufferproc - - PPyBufferProcs* = ptr TPyBufferProcs - TPy_complex*{.final.} = object - float*: float64 - imag*: float64 - - TPyObject*{.pure, inheritable.} = object - ob_refcnt*: int - ob_type*: PPyTypeObject - - TPyIntObject* = object of TPyObject - ob_ival*: int32 - - PByte* = ptr int8 - Tfrozen*{.final.} = object - name*: cstring - code*: PByte - size*: int - - TPySliceObject* = object of TPyObject - start*, stop*, step*: PPyObject - - PPyMethodDef* = ptr TPyMethodDef - TPyMethodDef*{.final.} = object # structmember.h - ml_name*: cstring - ml_meth*: TPyCFunction - ml_flags*: int - ml_doc*: cstring - - PPyMemberDef* = ptr TPyMemberDef - TPyMemberDef*{.final.} = object # descrobject.h - # Descriptors - name*: cstring - theType*: int - offset*: int - flags*: int - doc*: cstring - - Tgetter* = proc (obj: PPyObject, context: Pointer): PPyObject{.cdecl.} - Tsetter* = proc (obj, value: PPyObject, context: Pointer): int{.cdecl.} - PPyGetSetDef* = ptr TPyGetSetDef - TPyGetSetDef*{.final.} = object - name*: cstring - get*: Tgetter - setter*: Tsetter - doc*: cstring - closure*: Pointer - - Twrapperfunc* = proc (self, args: PPyObject, wrapped: Pointer): PPyObject{. - cdecl.} - pwrapperbase* = ptr Twrapperbase - Twrapperbase*{.final.} = object # Various kinds of descriptor objects - ##define PyDescr_COMMON \ - # PyObject_HEAD \ - # PyTypeObject *d_type; \ - # PyObject *d_name - # - name*: cstring - wrapper*: Twrapperfunc - doc*: cstring - - PPyDescrObject* = ptr TPyDescrObject - TPyDescrObject* = object of TPyObject - d_type*: PPyTypeObject - d_name*: PPyObject - - PPyMethodDescrObject* = ptr TPyMethodDescrObject - TPyMethodDescrObject* = object of TPyDescrObject - d_method*: PPyMethodDef - - PPyMemberDescrObject* = ptr TPyMemberDescrObject - TPyMemberDescrObject* = object of TPyDescrObject - d_member*: PPyMemberDef - - PPyGetSetDescrObject* = ptr TPyGetSetDescrObject - TPyGetSetDescrObject* = object of TPyDescrObject - d_getset*: PPyGetSetDef - - PPyWrapperDescrObject* = ptr TPyWrapperDescrObject - TPyWrapperDescrObject* = object of TPyDescrObject # object.h - d_base*: pwrapperbase - d_wrapped*: Pointer # This can be any function pointer - - TPyTypeObject* = object of TPyObject - ob_size*: int # Number of items in variable part - tp_name*: cstring # For printing - tp_basicsize*, tp_itemsize*: int # For allocation - # Methods to implement standard operations - tp_dealloc*: Tpydestructor - tp_print*: Tprintfunc - tp_getattr*: Tgetattrfunc - tp_setattr*: Tsetattrfunc - tp_compare*: Tcmpfunc - tp_repr*: Treprfunc # Method suites for standard classes - tp_as_number*: PPyNumberMethods - tp_as_sequence*: PPySequenceMethods - tp_as_mapping*: PPyMappingMethods # More standard operations (here for binary compatibility) - tp_hash*: Thashfunc - tp_call*: Tternaryfunc - tp_str*: Treprfunc - tp_getattro*: Tgetattrofunc - tp_setattro*: Tsetattrofunc #/ jah 29-sep-2000: updated for python 2.0 - # Functions to access object as input/output buffer - tp_as_buffer*: PPyBufferProcs # Flags to define presence of optional/expanded features - tp_flags*: int32 - tp_doc*: cstring # Documentation string - # call function for all accessible objects - tp_traverse*: Ttraverseproc # delete references to contained objects - tp_clear*: Tinquiry # rich comparisons - tp_richcompare*: Trichcmpfunc # weak reference enabler - tp_weaklistoffset*: int32 # Iterators - tp_iter*: Tgetiterfunc - tp_iternext*: Titernextfunc # Attribute descriptor and subclassing stuff - tp_methods*: PPyMethodDef - tp_members*: PPyMemberDef - tp_getset*: PPyGetSetDef - tp_base*: PPyTypeObject - tp_dict*: PPyObject - tp_descr_get*: Tdescrgetfunc - tp_descr_set*: Tdescrsetfunc - tp_dictoffset*: int32 - tp_init*: Tinitproc - tp_alloc*: Tallocfunc - tp_new*: Tnewfunc - tp_free*: Tpydestructor # Low-level free-memory routine - tp_is_gc*: Tinquiry # For PyObject_IS_GC - tp_bases*: PPyObject - tp_mro*: PPyObject # method resolution order - tp_cache*: PPyObject - tp_subclasses*: PPyObject - tp_weaklist*: PPyObject #More spares - tp_xxx7*: pointer - tp_xxx8*: pointer - - PPyMethodChain* = ptr TPyMethodChain - TPyMethodChain*{.final.} = object - methods*: PPyMethodDef - link*: PPyMethodChain - - PPyClassObject* = ptr TPyClassObject - TPyClassObject* = object of TPyObject - cl_bases*: PPyObject # A tuple of class objects - cl_dict*: PPyObject # A dictionary - cl_name*: PPyObject # A string - # The following three are functions or NULL - cl_getattr*: PPyObject - cl_setattr*: PPyObject - cl_delattr*: PPyObject - - PPyInstanceObject* = ptr TPyInstanceObject - TPyInstanceObject* = object of TPyObject - in_class*: PPyClassObject # The class object - in_dict*: PPyObject # A dictionary - - PPyMethodObject* = ptr TPyMethodObject - TPyMethodObject* = object of TPyObject # Bytecode object, compile.h - im_func*: PPyObject # The function implementing the method - im_self*: PPyObject # The instance it is bound to, or NULL - im_class*: PPyObject # The class that defined the method - - PPyCodeObject* = ptr TPyCodeObject - TPyCodeObject* = object of TPyObject # from pystate.h - co_argcount*: int # #arguments, except *args - co_nlocals*: int # #local variables - co_stacksize*: int # #entries needed for evaluation stack - co_flags*: int # CO_..., see below - co_code*: PPyObject # instruction opcodes (it hides a PyStringObject) - co_consts*: PPyObject # list (constants used) - co_names*: PPyObject # list of strings (names used) - co_varnames*: PPyObject # tuple of strings (local variable names) - co_freevars*: PPyObject # tuple of strings (free variable names) - co_cellvars*: PPyObject # tuple of strings (cell variable names) - # The rest doesn't count for hash/cmp - co_filename*: PPyObject # string (where it was loaded from) - co_name*: PPyObject # string (name, for reference) - co_firstlineno*: int # first source line number - co_lnotab*: PPyObject # string (encoding addr<->lineno mapping) - - PPyInterpreterState* = ptr TPyInterpreterState - PPyThreadState* = ptr TPyThreadState - PPyFrameObject* = ptr TPyFrameObject # Interpreter environments - TPyInterpreterState*{.final.} = object # Thread specific information - next*: PPyInterpreterState - tstate_head*: PPyThreadState - modules*: PPyObject - sysdict*: PPyObject - builtins*: PPyObject - checkinterval*: int - - TPyThreadState*{.final.} = object # from frameobject.h - next*: PPyThreadState - interp*: PPyInterpreterState - frame*: PPyFrameObject - recursion_depth*: int - ticker*: int - tracing*: int - sys_profilefunc*: PPyObject - sys_tracefunc*: PPyObject - curexc_type*: PPyObject - curexc_value*: PPyObject - curexc_traceback*: PPyObject - exc_type*: PPyObject - exc_value*: PPyObject - exc_traceback*: PPyObject - dict*: PPyObject - - PPyTryBlock* = ptr TPyTryBlock - TPyTryBlock*{.final.} = object - b_type*: int # what kind of block this is - b_handler*: int # where to jump to find handler - b_level*: int # value stack level to pop to - - CO_MAXBLOCKS* = range[0..19] - TPyFrameObject* = object of TPyObject # start of the VAR_HEAD of an object - # From traceback.c - ob_size*: int # Number of items in variable part - # End of the Head of an object - f_back*: PPyFrameObject # previous frame, or NULL - f_code*: PPyCodeObject # code segment - f_builtins*: PPyObject # builtin symbol table (PyDictObject) - f_globals*: PPyObject # global symbol table (PyDictObject) - f_locals*: PPyObject # local symbol table (PyDictObject) - f_valuestack*: PPPyObject # points after the last local - # Next free slot in f_valuestack. Frame creation sets to f_valuestack. - # Frame evaluation usually NULLs it, but a frame that yields sets it - # to the current stack top. - f_stacktop*: PPPyObject - f_trace*: PPyObject # Trace function - f_exc_type*, f_exc_value*, f_exc_traceback*: PPyObject - f_tstate*: PPyThreadState - f_lasti*: int # Last instruction if called - f_lineno*: int # Current line number - f_restricted*: int # Flag set if restricted operations - # in this scope - f_iblock*: int # index in f_blockstack - f_blockstack*: array[CO_MAXBLOCKS, TPyTryBlock] # for try and loop blocks - f_nlocals*: int # number of locals - f_ncells*: int - f_nfreevars*: int - f_stacksize*: int # size of value stack - f_localsplus*: array[0..0, PPyObject] # locals+stack, dynamically sized - - PPyTraceBackObject* = ptr TPyTraceBackObject - TPyTraceBackObject* = object of TPyObject # Parse tree node interface - tb_next*: PPyTraceBackObject - tb_frame*: PPyFrameObject - tb_lasti*: int - tb_lineno*: int - - PNode* = ptr Tnode - Tnode*{.final.} = object # From weakrefobject.h - n_type*: int16 - n_str*: cstring - n_lineno*: int16 - n_nchildren*: int16 - n_child*: PNode - - PPyWeakReference* = ptr TPyWeakReference - TPyWeakReference* = object of TPyObject - wr_object*: PPyObject - wr_callback*: PPyObject - hash*: int32 - wr_prev*: PPyWeakReference - wr_next*: PPyWeakReference - - -const - PyDateTime_DATE_DATASIZE* = 4 # # of bytes for year, month, and day - PyDateTime_TIME_DATASIZE* = 6 # # of bytes for hour, minute, second, and usecond - PyDateTime_DATETIME_DATASIZE* = 10 # # of bytes for year, month, - # day, hour, minute, second, and usecond. - -type - TPyDateTime_Delta* = object of TPyObject - hashcode*: int # -1 when unknown - days*: int # -MAX_DELTA_DAYS <= days <= MAX_DELTA_DAYS - seconds*: int # 0 <= seconds < 24*3600 is invariant - microseconds*: int # 0 <= microseconds < 1000000 is invariant - - PPyDateTime_Delta* = ptr TPyDateTime_Delta - TPyDateTime_TZInfo* = object of TPyObject # a pure abstract base clase - PPyDateTime_TZInfo* = ptr TPyDateTime_TZInfo - TPyDateTime_BaseTZInfo* = object of TPyObject - hashcode*: int - hastzinfo*: bool # boolean flag - - PPyDateTime_BaseTZInfo* = ptr TPyDateTime_BaseTZInfo - TPyDateTime_BaseTime* = object of TPyDateTime_BaseTZInfo - data*: array[0..Pred(PyDateTime_TIME_DATASIZE), int8] - - PPyDateTime_BaseTime* = ptr TPyDateTime_BaseTime - TPyDateTime_Time* = object of TPyDateTime_BaseTime # hastzinfo true - tzinfo*: PPyObject - - PPyDateTime_Time* = ptr TPyDateTime_Time - TPyDateTime_Date* = object of TPyDateTime_BaseTZInfo - data*: array[0..Pred(PyDateTime_DATE_DATASIZE), int8] - - PPyDateTime_Date* = ptr TPyDateTime_Date - TPyDateTime_BaseDateTime* = object of TPyDateTime_BaseTZInfo - data*: array[0..Pred(PyDateTime_DATETIME_DATASIZE), int8] - - PPyDateTime_BaseDateTime* = ptr TPyDateTime_BaseDateTime - TPyDateTime_DateTime* = object of TPyDateTime_BaseTZInfo - data*: array[0..Pred(PyDateTime_DATETIME_DATASIZE), int8] - tzinfo*: PPyObject - - PPyDateTime_DateTime* = ptr TPyDateTime_DateTime - -#----------------------------------------------------# -# # -# New exception classes # -# # -#----------------------------------------------------# - -# -# // Python's exceptions -# EPythonError = object(Exception) -# EName: String; -# EValue: String; -# end; -# EPyExecError = object(EPythonError) -# end; -# -# // Standard exception classes of Python -# -#/// jah 29-sep-2000: updated for python 2.0 -#/// base classes updated according python documentation -# -#{ Hierarchy of Python exceptions, Python 2.3, copied from \Python\exceptions.c -# -#Exception\n\ -# |\n\ -# +-- SystemExit\n\ -# +-- StopIteration\n\ -# +-- StandardError\n\ -# | |\n\ -# | +-- KeyboardInterrupt\n\ -# | +-- ImportError\n\ -# | +-- EnvironmentError\n\ -# | | |\n\ -# | | +-- IOError\n\ -# | | +-- OSError\n\ -# | | |\n\ -# | | +-- WindowsError\n\ -# | | +-- VMSError\n\ -# | |\n\ -# | +-- EOFError\n\ -# | +-- RuntimeError\n\ -# | | |\n\ -# | | +-- NotImplementedError\n\ -# | |\n\ -# | +-- NameError\n\ -# | | |\n\ -# | | +-- UnboundLocalError\n\ -# | |\n\ -# | +-- AttributeError\n\ -# | +-- SyntaxError\n\ -# | | |\n\ -# | | +-- IndentationError\n\ -# | | |\n\ -# | | +-- TabError\n\ -# | |\n\ -# | +-- TypeError\n\ -# | +-- AssertionError\n\ -# | +-- LookupError\n\ -# | | |\n\ -# | | +-- IndexError\n\ -# | | +-- KeyError\n\ -# | |\n\ -# | +-- ArithmeticError\n\ -# | | |\n\ -# | | +-- OverflowError\n\ -# | | +-- ZeroDivisionError\n\ -# | | +-- FloatingPointError\n\ -# | |\n\ -# | +-- ValueError\n\ -# | | |\n\ -# | | +-- UnicodeError\n\ -# | | |\n\ -# | | +-- UnicodeEncodeError\n\ -# | | +-- UnicodeDecodeError\n\ -# | | +-- UnicodeTranslateError\n\ -# | |\n\ -# | +-- ReferenceError\n\ -# | +-- SystemError\n\ -# | +-- MemoryError\n\ -# |\n\ -# +---Warning\n\ -# |\n\ -# +-- UserWarning\n\ -# +-- DeprecationWarning\n\ -# +-- PendingDeprecationWarning\n\ -# +-- SyntaxWarning\n\ -# +-- OverflowWarning\n\ -# +-- RuntimeWarning\n\ -# +-- FutureWarning" -#} -# EPyException = class (EPythonError); -# EPyStandardError = class (EPyException); -# EPyArithmeticError = class (EPyStandardError); -# EPyLookupError = class (EPyStandardError); -# EPyAssertionError = class (EPyStandardError); -# EPyAttributeError = class (EPyStandardError); -# EPyEOFError = class (EPyStandardError); -# EPyFloatingPointError = class (EPyArithmeticError); -# EPyEnvironmentError = class (EPyStandardError); -# EPyIOError = class (EPyEnvironmentError); -# EPyOSError = class (EPyEnvironmentError); -# EPyImportError = class (EPyStandardError); -# EPyIndexError = class (EPyLookupError); -# EPyKeyError = class (EPyLookupError); -# EPyKeyboardInterrupt = class (EPyStandardError); -# EPyMemoryError = class (EPyStandardError); -# EPyNameError = class (EPyStandardError); -# EPyOverflowError = class (EPyArithmeticError); -# EPyRuntimeError = class (EPyStandardError); -# EPyNotImplementedError = class (EPyRuntimeError); -# EPySyntaxError = class (EPyStandardError) -# public -# EFileName: string; -# ELineStr: string; -# ELineNumber: Integer; -# EOffset: Integer; -# end; -# EPyIndentationError = class (EPySyntaxError); -# EPyTabError = class (EPyIndentationError); -# EPySystemError = class (EPyStandardError); -# EPySystemExit = class (EPyException); -# EPyTypeError = class (EPyStandardError); -# EPyUnboundLocalError = class (EPyNameError); -# EPyValueError = class (EPyStandardError); -# EPyUnicodeError = class (EPyValueError); -# UnicodeEncodeError = class (EPyUnicodeError); -# UnicodeDecodeError = class (EPyUnicodeError); -# UnicodeTranslateError = class (EPyUnicodeError); -# EPyZeroDivisionError = class (EPyArithmeticError); -# EPyStopIteration = class(EPyException); -# EPyWarning = class (EPyException); -# EPyUserWarning = class (EPyWarning); -# EPyDeprecationWarning = class (EPyWarning); -# PendingDeprecationWarning = class (EPyWarning); -# FutureWarning = class (EPyWarning); -# EPySyntaxWarning = class (EPyWarning); -# EPyOverflowWarning = class (EPyWarning); -# EPyRuntimeWarning = class (EPyWarning); -# EPyReferenceError = class (EPyStandardError); -# - -var - PyArg_Parse*: proc (args: PPyObject, format: cstring): int{.cdecl, varargs.} - PyArg_ParseTuple*: proc (args: PPyObject, format: cstring, x1: Pointer = nil, - x2: Pointer = nil, x3: Pointer = nil): int{.cdecl, varargs.} - Py_BuildValue*: proc (format: cstring): PPyObject{.cdecl, varargs.} - PyCode_Addr2Line*: proc (co: PPyCodeObject, addrq: int): int{.cdecl.} - DLL_Py_GetBuildInfo*: proc (): cstring{.cdecl.} - -var - Py_DebugFlag*: PInt - Py_VerboseFlag*: PInt - Py_InteractiveFlag*: PInt - Py_OptimizeFlag*: PInt - Py_NoSiteFlag*: PInt - Py_UseClassExceptionsFlag*: PInt - Py_FrozenFlag*: PInt - Py_TabcheckFlag*: PInt - Py_UnicodeFlag*: PInt - Py_IgnoreEnvironmentFlag*: PInt - Py_DivisionWarningFlag*: PInt - #_PySys_TraceFunc: PPPyObject; - #_PySys_ProfileFunc: PPPPyObject; - PyImport_FrozenModules*: PP_frozen - Py_None*: PPyObject - Py_Ellipsis*: PPyObject - Py_False*: PPyIntObject - Py_True*: PPyIntObject - Py_NotImplemented*: PPyObject - PyExc_AttributeError*: PPPyObject - PyExc_EOFError*: PPPyObject - PyExc_IOError*: PPPyObject - PyExc_ImportError*: PPPyObject - PyExc_IndexError*: PPPyObject - PyExc_KeyError*: PPPyObject - PyExc_KeyboardInterrupt*: PPPyObject - PyExc_MemoryError*: PPPyObject - PyExc_NameError*: PPPyObject - PyExc_OverflowError*: PPPyObject - PyExc_RuntimeError*: PPPyObject - PyExc_SyntaxError*: PPPyObject - PyExc_SystemError*: PPPyObject - PyExc_SystemExit*: PPPyObject - PyExc_TypeError*: PPPyObject - PyExc_ValueError*: PPPyObject - PyExc_ZeroDivisionError*: PPPyObject - PyExc_ArithmeticError*: PPPyObject - PyExc_Exception*: PPPyObject - PyExc_FloatingPointError*: PPPyObject - PyExc_LookupError*: PPPyObject - PyExc_StandardError*: PPPyObject - PyExc_AssertionError*: PPPyObject - PyExc_EnvironmentError*: PPPyObject - PyExc_IndentationError*: PPPyObject - PyExc_MemoryErrorInst*: PPPyObject - PyExc_NotImplementedError*: PPPyObject - PyExc_OSError*: PPPyObject - PyExc_TabError*: PPPyObject - PyExc_UnboundLocalError*: PPPyObject - PyExc_UnicodeError*: PPPyObject - PyExc_Warning*: PPPyObject - PyExc_DeprecationWarning*: PPPyObject - PyExc_RuntimeWarning*: PPPyObject - PyExc_SyntaxWarning*: PPPyObject - PyExc_UserWarning*: PPPyObject - PyExc_OverflowWarning*: PPPyObject - PyExc_ReferenceError*: PPPyObject - PyExc_StopIteration*: PPPyObject - PyExc_FutureWarning*: PPPyObject - PyExc_PendingDeprecationWarning*: PPPyObject - PyExc_UnicodeDecodeError*: PPPyObject - PyExc_UnicodeEncodeError*: PPPyObject - PyExc_UnicodeTranslateError*: PPPyObject - PyType_Type*: PPyTypeObject - PyCFunction_Type*: PPyTypeObject - PyCObject_Type*: PPyTypeObject - PyClass_Type*: PPyTypeObject - PyCode_Type*: PPyTypeObject - PyComplex_Type*: PPyTypeObject - PyDict_Type*: PPyTypeObject - PyFile_Type*: PPyTypeObject - PyFloat_Type*: PPyTypeObject - PyFrame_Type*: PPyTypeObject - PyFunction_Type*: PPyTypeObject - PyInstance_Type*: PPyTypeObject - PyInt_Type*: PPyTypeObject - PyList_Type*: PPyTypeObject - PyLong_Type*: PPyTypeObject - PyMethod_Type*: PPyTypeObject - PyModule_Type*: PPyTypeObject - PyObject_Type*: PPyTypeObject - PyRange_Type*: PPyTypeObject - PySlice_Type*: PPyTypeObject - PyString_Type*: PPyTypeObject - PyTuple_Type*: PPyTypeObject - PyBaseObject_Type*: PPyTypeObject - PyBuffer_Type*: PPyTypeObject - PyCallIter_Type*: PPyTypeObject - PyCell_Type*: PPyTypeObject - PyClassMethod_Type*: PPyTypeObject - PyProperty_Type*: PPyTypeObject - PySeqIter_Type*: PPyTypeObject - PyStaticMethod_Type*: PPyTypeObject - PySuper_Type*: PPyTypeObject - PySymtableEntry_Type*: PPyTypeObject - PyTraceBack_Type*: PPyTypeObject - PyUnicode_Type*: PPyTypeObject - PyWrapperDescr_Type*: PPyTypeObject - PyBaseString_Type*: PPyTypeObject - PyBool_Type*: PPyTypeObject - PyEnum_Type*: PPyTypeObject - - #PyArg_GetObject: proc(args: PPyObject; nargs, i: integer; p_a: PPPyObject): integer; cdecl; - #PyArg_GetLong: proc(args: PPyObject; nargs, i: integer; p_a: PLong): integer; cdecl; - #PyArg_GetShort: proc(args: PPyObject; nargs, i: integer; p_a: PShort): integer; cdecl; - #PyArg_GetFloat: proc(args: PPyObject; nargs, i: integer; p_a: PFloat): integer; cdecl; - #PyArg_GetString: proc(args: PPyObject; nargs, i: integer; p_a: PString): integer; cdecl; - #PyArgs_VaParse: proc (args: PPyObject; format: PChar; - # va_list: array of const): integer; cdecl; - # Does not work! - # Py_VaBuildValue: proc (format: PChar; va_list: array of const): PPyObject; cdecl; - #PyBuiltin_Init: proc; cdecl; -proc PyComplex_FromCComplex*(c: TPy_complex): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyComplex_FromDoubles*(realv, imag: float64): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyComplex_RealAsDouble*(op: PPyObject): float64{.cdecl, importc, dynlib: dllname.} -proc PyComplex_ImagAsDouble*(op: PPyObject): float64{.cdecl, importc, dynlib: dllname.} -proc PyComplex_AsCComplex*(op: PPyObject): TPy_complex{.cdecl, importc, dynlib: dllname.} -proc PyCFunction_GetFunction*(ob: PPyObject): Pointer{.cdecl, importc, dynlib: dllname.} -proc PyCFunction_GetSelf*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyCallable_Check*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} -proc PyCObject_FromVoidPtr*(cobj, destruct: Pointer): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyCObject_AsVoidPtr*(ob: PPyObject): Pointer{.cdecl, importc, dynlib: dllname.} -proc PyClass_New*(ob1, ob2, ob3: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyClass_IsSubclass*(ob1, ob2: PPyObject): int{.cdecl, importc, dynlib: dllname.} -proc Py_InitModule4*(name: cstring, methods: PPyMethodDef, doc: cstring, - passthrough: PPyObject, Api_Version: int): PPyObject{. - cdecl, importc, dynlib: dllname.} -proc PyErr_BadArgument*(): int{.cdecl, importc, dynlib: dllname.} -proc PyErr_BadInternalCall*(){.cdecl, importc, dynlib: dllname.} -proc PyErr_CheckSignals*(): int{.cdecl, importc, dynlib: dllname.} -proc PyErr_Clear*(){.cdecl, importc, dynlib: dllname.} -proc PyErr_Fetch*(errtype, errvalue, errtraceback: PPPyObject){.cdecl, importc, dynlib: dllname.} -proc PyErr_NoMemory*(): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyErr_Occurred*(): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyErr_Print*(){.cdecl, importc, dynlib: dllname.} -proc PyErr_Restore*(errtype, errvalue, errtraceback: PPyObject){.cdecl, importc, dynlib: dllname.} -proc PyErr_SetFromErrno*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyErr_SetNone*(value: PPyObject){.cdecl, importc, dynlib: dllname.} -proc PyErr_SetObject*(ob1, ob2: PPyObject){.cdecl, importc, dynlib: dllname.} -proc PyErr_SetString*(ErrorObject: PPyObject, text: cstring){.cdecl, importc, dynlib: dllname.} -proc PyImport_GetModuleDict*(): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyInt_FromLong*(x: int32): PPyObject{.cdecl, importc, dynlib: dllname.} -proc Py_Initialize*(){.cdecl, importc, dynlib: dllname.} -proc Py_Exit*(RetVal: int){.cdecl, importc, dynlib: dllname.} -proc PyEval_GetBuiltins*(): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyDict_GetItem*(mp, key: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyDict_SetItem*(mp, key, item: PPyObject): int{.cdecl, importc, dynlib: dllname.} -proc PyDict_DelItem*(mp, key: PPyObject): int{.cdecl, importc, dynlib: dllname.} -proc PyDict_Clear*(mp: PPyObject){.cdecl, importc, dynlib: dllname.} -proc PyDict_Next*(mp: PPyObject, pos: PInt, key, value: PPPyObject): int{. - cdecl, importc, dynlib: dllname.} -proc PyDict_Keys*(mp: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyDict_Values*(mp: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyDict_Items*(mp: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyDict_Size*(mp: PPyObject): int{.cdecl, importc, dynlib: dllname.} -proc PyDict_DelItemString*(dp: PPyObject, key: cstring): int{.cdecl, importc, dynlib: dllname.} -proc PyDict_New*(): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyDict_GetItemString*(dp: PPyObject, key: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyDict_SetItemString*(dp: PPyObject, key: cstring, item: PPyObject): int{. - cdecl, importc, dynlib: dllname.} -proc PyDictProxy_New*(obj: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyModule_GetDict*(module: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyObject_Str*(v: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyRun_String*(str: cstring, start: int, globals: PPyObject, - locals: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyRun_SimpleString*(str: cstring): int{.cdecl, importc, dynlib: dllname.} -proc PyString_AsString*(ob: PPyObject): cstring{.cdecl, importc, dynlib: dllname.} -proc PyString_FromString*(str: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PySys_SetArgv*(argc: int, argv: cstringArray){.cdecl, importc, dynlib: dllname.} - #+ means, Grzegorz or me has tested his non object version of this function - #+ -proc PyCFunction_New*(md: PPyMethodDef, ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyEval_CallObject*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyEval_CallObjectWithKeywords*(ob1, ob2, ob3: PPyObject): PPyObject{. - cdecl, importc, dynlib: dllname.} #- -proc PyEval_GetFrame*(): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyEval_GetGlobals*(): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyEval_GetLocals*(): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyEval_GetOwner*(): PPyObject {.cdecl, importc, dynlib: dllname.} -proc PyEval_GetRestricted*(): int{.cdecl, importc, dynlib: dllname.} #- -proc PyEval_InitThreads*(){.cdecl, importc, dynlib: dllname.} #- -proc PyEval_RestoreThread*(tstate: PPyThreadState){.cdecl, importc, dynlib: dllname.} #- -proc PyEval_SaveThread*(): PPyThreadState{.cdecl, importc, dynlib: dllname.} #- -proc PyFile_FromString*(pc1, pc2: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyFile_GetLine*(ob: PPyObject, i: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyFile_Name*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyFile_SetBufSize*(ob: PPyObject, i: int){.cdecl, importc, dynlib: dllname.} #- -proc PyFile_SoftSpace*(ob: PPyObject, i: int): int{.cdecl, importc, dynlib: dllname.} #- -proc PyFile_WriteObject*(ob1, ob2: PPyObject, i: int): int{.cdecl, importc, dynlib: dllname.} #- -proc PyFile_WriteString*(s: cstring, ob: PPyObject){.cdecl, importc, dynlib: dllname.} #+ -proc PyFloat_AsDouble*(ob: PPyObject): float64{.cdecl, importc, dynlib: dllname.} #+ -proc PyFloat_FromDouble*(db: float64): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyFunction_GetCode*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyFunction_GetGlobals*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyFunction_New*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyImport_AddModule*(name: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyImport_Cleanup*(){.cdecl, importc, dynlib: dllname.} #- -proc PyImport_GetMagicNumber*(): int32{.cdecl, importc, dynlib: dllname.} #+ -proc PyImport_ImportFrozenModule*(key: cstring): int{.cdecl, importc, dynlib: dllname.} #+ -proc PyImport_ImportModule*(name: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyImport_Import*(name: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- - -proc PyImport_Init*() {.cdecl, importc, dynlib: dllname.} -proc PyImport_ReloadModule*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyInstance_New*(obClass, obArg, obKW: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyInt_AsLong*(ob: PPyObject): int32{.cdecl, importc, dynlib: dllname.} #- -proc PyList_Append*(ob1, ob2: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyList_AsTuple*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyList_GetItem*(ob: PPyObject, i: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyList_GetSlice*(ob: PPyObject, i1, i2: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyList_Insert*(dp: PPyObject, idx: int, item: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyList_New*(size: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyList_Reverse*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyList_SetItem*(dp: PPyObject, idx: int, item: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyList_SetSlice*(ob: PPyObject, i1, i2: int, ob2: PPyObject): int{. - cdecl, importc, dynlib: dllname.} #+ -proc PyList_Size*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyList_Sort*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyLong_AsDouble*(ob: PPyObject): float64{.cdecl, importc, dynlib: dllname.} #+ -proc PyLong_AsLong*(ob: PPyObject): int32{.cdecl, importc, dynlib: dllname.} #+ -proc PyLong_FromDouble*(db: float64): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyLong_FromLong*(L: int32): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyLong_FromString*(pc: cstring, ppc: var cstring, i: int): PPyObject{. - cdecl, importc, dynlib: dllname.} #- -proc PyLong_FromUnsignedLong*(val: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyLong_AsUnsignedLong*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyLong_FromUnicode*(ob: PPyObject, a, b: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyLong_FromLongLong*(val: Int64): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyLong_AsLongLong*(ob: PPyObject): Int64{.cdecl, importc, dynlib: dllname.} #- -proc PyMapping_Check*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyMapping_GetItemString*(ob: PPyObject, key: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyMapping_HasKey*(ob, key: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyMapping_HasKeyString*(ob: PPyObject, key: cstring): int{.cdecl, importc, dynlib: dllname.} #- -proc PyMapping_Length*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyMapping_SetItemString*(ob: PPyObject, key: cstring, value: PPyObject): int{. - cdecl, importc, dynlib: dllname.} #- -proc PyMethod_Class*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyMethod_Function*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyMethod_New*(ob1, ob2, ob3: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyMethod_Self*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyModule_GetName*(ob: PPyObject): cstring{.cdecl, importc, dynlib: dllname.} #- -proc PyModule_New*(key: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Absolute*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Add*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_And*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Check*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Coerce*(ob1, ob2: var PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Divide*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_FloorDivide*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_TrueDivide*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Divmod*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Float*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Int*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Invert*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Long*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Lshift*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Multiply*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Negative*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Or*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Positive*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Power*(ob1, ob2, ob3: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Remainder*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Rshift*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Subtract*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyNumber_Xor*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyOS_InitInterrupts*(){.cdecl, importc, dynlib: dllname.} #- -proc PyOS_InterruptOccurred*(): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_CallObject*(ob, args: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_Compare*(ob1, ob2: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GetAttr*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyObject_GetAttrString*(ob: PPyObject, c: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GetItem*(ob, key: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_DelItem*(ob, key: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_HasAttrString*(ob: PPyObject, key: cstring): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_Hash*(ob: PPyObject): int32{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_IsTrue*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_Length*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_Repr*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_SetAttr*(ob1, ob2, ob3: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_SetAttrString*(ob: PPyObject, key: cstring, value: PPyObject): int{. - cdecl, importc, dynlib: dllname.} #- -proc PyObject_SetItem*(ob1, ob2, ob3: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_Init*(ob: PPyObject, t: PPyTypeObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_InitVar*(ob: PPyObject, t: PPyTypeObject, size: int): PPyObject{. - cdecl, importc, dynlib: dllname.} #- -proc PyObject_New*(t: PPyTypeObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_NewVar*(t: PPyTypeObject, size: int): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyObject_Free*(ob: PPyObject){.cdecl, importc, dynlib: dllname.} #- -proc PyObject_IsInstance*(inst, cls: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_IsSubclass*(derived, cls: PPyObject): int{.cdecl, importc, dynlib: dllname.} -proc PyObject_GenericGetAttr*(obj, name: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyObject_GenericSetAttr*(obj, name, value: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GC_Malloc*(size: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GC_New*(t: PPyTypeObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GC_NewVar*(t: PPyTypeObject, size: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GC_Resize*(t: PPyObject, newsize: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GC_Del*(ob: PPyObject){.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GC_Track*(ob: PPyObject){.cdecl, importc, dynlib: dllname.} #- -proc PyObject_GC_UnTrack*(ob: PPyObject){.cdecl, importc, dynlib: dllname.} #- -proc PyRange_New*(l1, l2, l3: int32, i: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_Check*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_Concat*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_Count*(ob1, ob2: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_GetItem*(ob: PPyObject, i: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_GetSlice*(ob: PPyObject, i1, i2: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_In*(ob1, ob2: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_Index*(ob1, ob2: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_Length*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_Repeat*(ob: PPyObject, count: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_SetItem*(ob: PPyObject, i: int, value: PPyObject): int{. - cdecl, importc, dynlib: dllname.} #- -proc PySequence_SetSlice*(ob: PPyObject, i1, i2: int, value: PPyObject): int{. - cdecl, importc, dynlib: dllname.} #- -proc PySequence_DelSlice*(ob: PPyObject, i1, i2: int): int{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_Tuple*(ob: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PySequence_Contains*(ob, value: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PySlice_GetIndices*(ob: PPySliceObject, len: int, - start, stop, step: var int): int{.cdecl, importc, dynlib: dllname.} #- -proc PySlice_GetIndicesEx*(ob: PPySliceObject, len: int, - start, stop, step, slicelength: var int): int{. - cdecl, importc, dynlib: dllname.} #- -proc PySlice_New*(start, stop, step: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyString_Concat*(ob1: var PPyObject, ob2: PPyObject){.cdecl, importc, dynlib: dllname.} #- -proc PyString_ConcatAndDel*(ob1: var PPyObject, ob2: PPyObject){.cdecl, importc, dynlib: dllname.} #- -proc PyString_Format*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyString_FromStringAndSize*(s: cstring, i: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyString_Size*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyString_DecodeEscape*(s: cstring, length: int, errors: cstring, - unicode: int, recode_encoding: cstring): PPyObject{. - cdecl, importc, dynlib: dllname.} #- -proc PyString_Repr*(ob: PPyObject, smartquotes: int): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PySys_GetObject*(s: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} -#- -#PySys_Init:procedure; cdecl, importc, dynlib: dllname; -#- -proc PySys_SetObject*(s: cstring, ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PySys_SetPath*(path: cstring){.cdecl, importc, dynlib: dllname.} #- -#PyTraceBack_Fetch:function:PPyObject; cdecl, importc, dynlib: dllname; -#- -proc PyTraceBack_Here*(p: pointer): int{.cdecl, importc, dynlib: dllname.} #- -proc PyTraceBack_Print*(ob1, ob2: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -#PyTraceBack_Store:function (ob:PPyObject):integer; cdecl, importc, dynlib: dllname; -#+ -proc PyTuple_GetItem*(ob: PPyObject, i: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc PyTuple_GetSlice*(ob: PPyObject, i1, i2: int): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyTuple_New*(size: int): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyTuple_SetItem*(ob: PPyObject, key: int, value: PPyObject): int{.cdecl, importc, dynlib: dllname.} #+ -proc PyTuple_Size*(ob: PPyObject): int{.cdecl, importc, dynlib: dllname.} #+ -proc PyType_IsSubtype*(a, b: PPyTypeObject): int{.cdecl, importc, dynlib: dllname.} -proc PyType_GenericAlloc*(atype: PPyTypeObject, nitems: int): PPyObject{. - cdecl, importc, dynlib: dllname.} -proc PyType_GenericNew*(atype: PPyTypeObject, args, kwds: PPyObject): PPyObject{. - cdecl, importc, dynlib: dllname.} -proc PyType_Ready*(atype: PPyTypeObject): int{.cdecl, importc, dynlib: dllname.} #+ -proc PyUnicode_FromWideChar*(w: pointer, size: int): PPyObject{.cdecl, importc, dynlib: dllname.} #+ -proc PyUnicode_AsWideChar*(unicode: PPyObject, w: pointer, size: int): int{. - cdecl, importc, dynlib: dllname.} #- -proc PyUnicode_FromOrdinal*(ordinal: int): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyWeakref_GetObject*(theRef: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyWeakref_NewProxy*(ob, callback: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyWeakref_NewRef*(ob, callback: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyWrapper_New*(ob1, ob2: PPyObject): PPyObject{.cdecl, importc, dynlib: dllname.} -proc PyBool_FromLong*(ok: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc Py_AtExit*(prc: proc () {.cdecl.}): int{.cdecl, importc, dynlib: dllname.} #- -#Py_Cleanup:procedure; cdecl, importc, dynlib: dllname; -#- -proc Py_CompileString*(s1, s2: cstring, i: int): PPyObject{.cdecl, importc, dynlib: dllname.} #- -proc Py_FatalError*(s: cstring){.cdecl, importc, dynlib: dllname.} #- -proc Py_FindMethod*(md: PPyMethodDef, ob: PPyObject, key: cstring): PPyObject{. - cdecl, importc, dynlib: dllname.} #- -proc Py_FindMethodInChain*(mc: PPyMethodChain, ob: PPyObject, key: cstring): PPyObject{. - cdecl, importc, dynlib: dllname.} #- -proc Py_FlushLine*(){.cdecl, importc, dynlib: dllname.} #+ -proc Py_Finalize*(){.cdecl, importc, dynlib: dllname.} #- -proc PyErr_ExceptionMatches*(exc: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyErr_GivenExceptionMatches*(raised_exc, exc: PPyObject): int{.cdecl, importc, dynlib: dllname.} #- -proc PyEval_EvalCode*(co: PPyCodeObject, globals, locals: PPyObject): PPyObject{. - cdecl, importc, dynlib: dllname.} #+ -proc Py_GetVersion*(): cstring{.cdecl, importc, dynlib: dllname.} #+ -proc Py_GetCopyright*(): cstring{.cdecl, importc, dynlib: dllname.} #+ -proc Py_GetExecPrefix*(): cstring{.cdecl, importc, dynlib: dllname.} #+ -proc Py_GetPath*(): cstring{.cdecl, importc, dynlib: dllname.} #+ -proc Py_GetPrefix*(): cstring{.cdecl, importc, dynlib: dllname.} #+ -proc Py_GetProgramName*(): cstring{.cdecl, importc, dynlib: dllname.} #- -proc PyParser_SimpleParseString*(str: cstring, start: int): PNode{.cdecl, importc, dynlib: dllname.} #- -proc PyNode_Free*(n: PNode){.cdecl, importc, dynlib: dllname.} #- -proc PyErr_NewException*(name: cstring, base, dict: PPyObject): PPyObject{. - cdecl, importc, dynlib: dllname.} #- -proc Py_Malloc*(size: int): Pointer {.cdecl, importc, dynlib: dllname.} -proc PyMem_Malloc*(size: int): Pointer {.cdecl, importc, dynlib: dllname.} -proc PyObject_CallMethod*(obj: PPyObject, theMethod, - format: cstring): PPyObject{.cdecl, importc, dynlib: dllname.} -proc Py_SetProgramName*(name: cstring){.cdecl, importc, dynlib: dllname.} -proc Py_IsInitialized*(): int{.cdecl, importc, dynlib: dllname.} -proc Py_GetProgramFullPath*(): cstring{.cdecl, importc, dynlib: dllname.} -proc Py_NewInterpreter*(): PPyThreadState{.cdecl, importc, dynlib: dllname.} -proc Py_EndInterpreter*(tstate: PPyThreadState){.cdecl, importc, dynlib: dllname.} -proc PyEval_AcquireLock*(){.cdecl, importc, dynlib: dllname.} -proc PyEval_ReleaseLock*(){.cdecl, importc, dynlib: dllname.} -proc PyEval_AcquireThread*(tstate: PPyThreadState){.cdecl, importc, dynlib: dllname.} -proc PyEval_ReleaseThread*(tstate: PPyThreadState){.cdecl, importc, dynlib: dllname.} -proc PyInterpreterState_New*(): PPyInterpreterState{.cdecl, importc, dynlib: dllname.} -proc PyInterpreterState_Clear*(interp: PPyInterpreterState){.cdecl, importc, dynlib: dllname.} -proc PyInterpreterState_Delete*(interp: PPyInterpreterState){.cdecl, importc, dynlib: dllname.} -proc PyThreadState_New*(interp: PPyInterpreterState): PPyThreadState{.cdecl, importc, dynlib: dllname.} -proc PyThreadState_Clear*(tstate: PPyThreadState){.cdecl, importc, dynlib: dllname.} -proc PyThreadState_Delete*(tstate: PPyThreadState){.cdecl, importc, dynlib: dllname.} -proc PyThreadState_Get*(): PPyThreadState{.cdecl, importc, dynlib: dllname.} -proc PyThreadState_Swap*(tstate: PPyThreadState): PPyThreadState{.cdecl, importc, dynlib: dllname.} - -#Further exported Objects, may be implemented later -# -# PyCode_New: Pointer; -# PyErr_SetInterrupt: Pointer; -# PyFile_AsFile: Pointer; -# PyFile_FromFile: Pointer; -# PyFloat_AsString: Pointer; -# PyFrame_BlockPop: Pointer; -# PyFrame_BlockSetup: Pointer; -# PyFrame_ExtendStack: Pointer; -# PyFrame_FastToLocals: Pointer; -# PyFrame_LocalsToFast: Pointer; -# PyFrame_New: Pointer; -# PyGrammar_AddAccelerators: Pointer; -# PyGrammar_FindDFA: Pointer; -# PyGrammar_LabelRepr: Pointer; -# PyInstance_DoBinOp: Pointer; -# PyInt_GetMax: Pointer; -# PyMarshal_Init: Pointer; -# PyMarshal_ReadLongFromFile: Pointer; -# PyMarshal_ReadObjectFromFile: Pointer; -# PyMarshal_ReadObjectFromString: Pointer; -# PyMarshal_WriteLongToFile: Pointer; -# PyMarshal_WriteObjectToFile: Pointer; -# PyMember_Get: Pointer; -# PyMember_Set: Pointer; -# PyNode_AddChild: Pointer; -# PyNode_Compile: Pointer; -# PyNode_New: Pointer; -# PyOS_GetLastModificationTime: Pointer; -# PyOS_Readline: Pointer; -# PyOS_strtol: Pointer; -# PyOS_strtoul: Pointer; -# PyObject_CallFunction: Pointer; -# PyObject_CallMethod: Pointer; -# PyObject_Print: Pointer; -# PyParser_AddToken: Pointer; -# PyParser_Delete: Pointer; -# PyParser_New: Pointer; -# PyParser_ParseFile: Pointer; -# PyParser_ParseString: Pointer; -# PyParser_SimpleParseFile: Pointer; -# PyRun_AnyFile: Pointer; -# PyRun_File: Pointer; -# PyRun_InteractiveLoop: Pointer; -# PyRun_InteractiveOne: Pointer; -# PyRun_SimpleFile: Pointer; -# PySys_GetFile: Pointer; -# PyToken_OneChar: Pointer; -# PyToken_TwoChars: Pointer; -# PyTokenizer_Free: Pointer; -# PyTokenizer_FromFile: Pointer; -# PyTokenizer_FromString: Pointer; -# PyTokenizer_Get: Pointer; -# Py_Main: Pointer; -# _PyObject_NewVar: Pointer; -# _PyParser_Grammar: Pointer; -# _PyParser_TokenNames: Pointer; -# _PyThread_Started: Pointer; -# _Py_c_diff: Pointer; -# _Py_c_neg: Pointer; -# _Py_c_pow: Pointer; -# _Py_c_prod: Pointer; -# _Py_c_quot: Pointer; -# _Py_c_sum: Pointer; -# - -# This function handles all cardinals, pointer types (with no adjustment of pointers!) -# (Extended) floats, which are handled as Python doubles and currencies, handled -# as (normalized) Python doubles. -proc PyImport_ExecCodeModule*(name: String, codeobject: PPyObject): PPyObject -proc PyString_Check*(obj: PPyObject): bool -proc PyString_CheckExact*(obj: PPyObject): bool -proc PyFloat_Check*(obj: PPyObject): bool -proc PyFloat_CheckExact*(obj: PPyObject): bool -proc PyInt_Check*(obj: PPyObject): bool -proc PyInt_CheckExact*(obj: PPyObject): bool -proc PyLong_Check*(obj: PPyObject): bool -proc PyLong_CheckExact*(obj: PPyObject): bool -proc PyTuple_Check*(obj: PPyObject): bool -proc PyTuple_CheckExact*(obj: PPyObject): bool -proc PyInstance_Check*(obj: PPyObject): bool -proc PyClass_Check*(obj: PPyObject): bool -proc PyMethod_Check*(obj: PPyObject): bool -proc PyList_Check*(obj: PPyObject): bool -proc PyList_CheckExact*(obj: PPyObject): bool -proc PyDict_Check*(obj: PPyObject): bool -proc PyDict_CheckExact*(obj: PPyObject): bool -proc PyModule_Check*(obj: PPyObject): bool -proc PyModule_CheckExact*(obj: PPyObject): bool -proc PySlice_Check*(obj: PPyObject): bool -proc PyFunction_Check*(obj: PPyObject): bool -proc PyUnicode_Check*(obj: PPyObject): bool -proc PyUnicode_CheckExact*(obj: PPyObject): bool -proc PyType_IS_GC*(t: PPyTypeObject): bool -proc PyObject_IS_GC*(obj: PPyObject): bool -proc PyBool_Check*(obj: PPyObject): bool -proc PyBaseString_Check*(obj: PPyObject): bool -proc PyEnum_Check*(obj: PPyObject): bool -proc PyObject_TypeCheck*(obj: PPyObject, t: PPyTypeObject): bool -proc Py_InitModule*(name: cstring, md: PPyMethodDef): PPyObject -proc PyType_HasFeature*(AType: PPyTypeObject, AFlag: int): bool -# implementation - -proc Py_INCREF*(op: PPyObject) {.inline.} = - Inc(op.ob_refcnt) - -proc Py_DECREF*(op: PPyObject) {.inline.} = - Dec(op.ob_refcnt) - if op.ob_refcnt == 0: - op.ob_type.tp_dealloc(op) - -proc Py_XINCREF*(op: PPyObject) {.inline.} = - if op != nil: Py_INCREF(op) - -proc Py_XDECREF*(op: PPyObject) {.inline.} = - if op != nil: Py_DECREF(op) - -proc PyImport_ExecCodeModule(name: string, codeobject: PPyObject): PPyObject = - var m, d, v, modules: PPyObject - m = PyImport_AddModule(cstring(name)) - if m == nil: - return nil - d = PyModule_GetDict(m) - if PyDict_GetItemString(d, "__builtins__") == nil: - if PyDict_SetItemString(d, "__builtins__", PyEval_GetBuiltins()) != 0: - return nil - if PyDict_SetItemString(d, "__file__", - PPyCodeObject(codeobject).co_filename) != 0: - PyErr_Clear() # Not important enough to report - v = PyEval_EvalCode(PPyCodeObject(codeobject), d, d) # XXX owner ? - if v == nil: - return nil - Py_XDECREF(v) - modules = PyImport_GetModuleDict() - if PyDict_GetItemString(modules, cstring(name)) == nil: - PyErr_SetString(PyExc_ImportError[] , cstring( - "Loaded module " & name & "not found in sys.modules")) - return nil - Py_XINCREF(m) - Result = m - -proc PyString_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyString_Type) - -proc PyString_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj.ob_type == PyString_Type) - -proc PyFloat_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyFloat_Type) - -proc PyFloat_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj.ob_type == PyFloat_Type) - -proc PyInt_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyInt_Type) - -proc PyInt_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj.ob_type == PyInt_Type) - -proc PyLong_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyLong_Type) - -proc PyLong_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj.ob_type == PyLong_Type) - -proc PyTuple_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyTuple_Type) - -proc PyTuple_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj[].ob_type == PyTuple_Type) - -proc PyInstance_Check(obj: PPyObject): bool = - Result = (obj != nil) and (obj[].ob_type == PyInstance_Type) - -proc PyClass_Check(obj: PPyObject): bool = - Result = (obj != nil) and (obj[].ob_type == PyClass_Type) - -proc PyMethod_Check(obj: PPyObject): bool = - Result = (obj != nil) and (obj[].ob_type == PyMethod_Type) - -proc PyList_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyList_Type) - -proc PyList_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj[].ob_type == PyList_Type) - -proc PyDict_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyDict_Type) - -proc PyDict_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj[].ob_type == PyDict_Type) - -proc PyModule_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyModule_Type) - -proc PyModule_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj[].ob_type == PyModule_Type) - -proc PySlice_Check(obj: PPyObject): bool = - Result = (obj != nil) and (obj[].ob_type == PySlice_Type) - -proc PyFunction_Check(obj: PPyObject): bool = - Result = (obj != nil) and - ((obj.ob_type == PyCFunction_Type) or - (obj.ob_type == PyFunction_Type)) - -proc PyUnicode_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyUnicode_Type) - -proc PyUnicode_CheckExact(obj: PPyObject): bool = - Result = (obj != nil) and (obj.ob_type == PyUnicode_Type) - -proc PyType_IS_GC(t: PPyTypeObject): bool = - Result = PyType_HasFeature(t, Py_TPFLAGS_HAVE_GC) - -proc PyObject_IS_GC(obj: PPyObject): bool = - Result = PyType_IS_GC(obj.ob_type) and - ((obj.ob_type.tp_is_gc == nil) or (obj.ob_type.tp_is_gc(obj) == 1)) - -proc PyBool_Check(obj: PPyObject): bool = - Result = (obj != nil) and (obj.ob_type == PyBool_Type) - -proc PyBaseString_Check(obj: PPyObject): bool = - Result = PyObject_TypeCheck(obj, PyBaseString_Type) - -proc PyEnum_Check(obj: PPyObject): bool = - Result = (obj != nil) and (obj.ob_type == PyEnum_Type) - -proc PyObject_TypeCheck(obj: PPyObject, t: PPyTypeObject): bool = - Result = (obj != nil) and (obj.ob_type == t) - if not Result and (obj != nil) and (t != nil): - Result = PyType_IsSubtype(obj.ob_type, t) == 1 - -proc Py_InitModule(name: cstring, md: PPyMethodDef): PPyObject = - result = Py_InitModule4(name, md, nil, nil, 1012) - -proc PyType_HasFeature(AType: PPyTypeObject, AFlag: int): bool = - #(((t)->tp_flags & (f)) != 0) - Result = (AType.tp_flags and AFlag) != 0 - -proc init(lib: TLibHandle) = - Py_DebugFlag = cast[PInt](symAddr(lib, "Py_DebugFlag")) - Py_VerboseFlag = cast[PInt](symAddr(lib, "Py_VerboseFlag")) - Py_InteractiveFlag = cast[PInt](symAddr(lib, "Py_InteractiveFlag")) - Py_OptimizeFlag = cast[PInt](symAddr(lib, "Py_OptimizeFlag")) - Py_NoSiteFlag = cast[PInt](symAddr(lib, "Py_NoSiteFlag")) - Py_UseClassExceptionsFlag = cast[PInt](symAddr(lib, "Py_UseClassExceptionsFlag")) - Py_FrozenFlag = cast[PInt](symAddr(lib, "Py_FrozenFlag")) - Py_TabcheckFlag = cast[PInt](symAddr(lib, "Py_TabcheckFlag")) - Py_UnicodeFlag = cast[PInt](symAddr(lib, "Py_UnicodeFlag")) - Py_IgnoreEnvironmentFlag = cast[PInt](symAddr(lib, "Py_IgnoreEnvironmentFlag")) - Py_DivisionWarningFlag = cast[PInt](symAddr(lib, "Py_DivisionWarningFlag")) - Py_None = cast[PPyObject](symAddr(lib, "_Py_NoneStruct")) - Py_Ellipsis = cast[PPyObject](symAddr(lib, "_Py_EllipsisObject")) - Py_False = cast[PPyIntObject](symAddr(lib, "_Py_ZeroStruct")) - Py_True = cast[PPyIntObject](symAddr(lib, "_Py_TrueStruct")) - Py_NotImplemented = cast[PPyObject](symAddr(lib, "_Py_NotImplementedStruct")) - PyImport_FrozenModules = cast[PP_frozen](symAddr(lib, "PyImport_FrozenModules")) - PyExc_AttributeError = cast[PPPyObject](symAddr(lib, "PyExc_AttributeError")) - PyExc_EOFError = cast[PPPyObject](symAddr(lib, "PyExc_EOFError")) - PyExc_IOError = cast[PPPyObject](symAddr(lib, "PyExc_IOError")) - PyExc_ImportError = cast[PPPyObject](symAddr(lib, "PyExc_ImportError")) - PyExc_IndexError = cast[PPPyObject](symAddr(lib, "PyExc_IndexError")) - PyExc_KeyError = cast[PPPyObject](symAddr(lib, "PyExc_KeyError")) - PyExc_KeyboardInterrupt = cast[PPPyObject](symAddr(lib, "PyExc_KeyboardInterrupt")) - PyExc_MemoryError = cast[PPPyObject](symAddr(lib, "PyExc_MemoryError")) - PyExc_NameError = cast[PPPyObject](symAddr(lib, "PyExc_NameError")) - PyExc_OverflowError = cast[PPPyObject](symAddr(lib, "PyExc_OverflowError")) - PyExc_RuntimeError = cast[PPPyObject](symAddr(lib, "PyExc_RuntimeError")) - PyExc_SyntaxError = cast[PPPyObject](symAddr(lib, "PyExc_SyntaxError")) - PyExc_SystemError = cast[PPPyObject](symAddr(lib, "PyExc_SystemError")) - PyExc_SystemExit = cast[PPPyObject](symAddr(lib, "PyExc_SystemExit")) - PyExc_TypeError = cast[PPPyObject](symAddr(lib, "PyExc_TypeError")) - PyExc_ValueError = cast[PPPyObject](symAddr(lib, "PyExc_ValueError")) - PyExc_ZeroDivisionError = cast[PPPyObject](symAddr(lib, "PyExc_ZeroDivisionError")) - PyExc_ArithmeticError = cast[PPPyObject](symAddr(lib, "PyExc_ArithmeticError")) - PyExc_Exception = cast[PPPyObject](symAddr(lib, "PyExc_Exception")) - PyExc_FloatingPointError = cast[PPPyObject](symAddr(lib, "PyExc_FloatingPointError")) - PyExc_LookupError = cast[PPPyObject](symAddr(lib, "PyExc_LookupError")) - PyExc_StandardError = cast[PPPyObject](symAddr(lib, "PyExc_StandardError")) - PyExc_AssertionError = cast[PPPyObject](symAddr(lib, "PyExc_AssertionError")) - PyExc_EnvironmentError = cast[PPPyObject](symAddr(lib, "PyExc_EnvironmentError")) - PyExc_IndentationError = cast[PPPyObject](symAddr(lib, "PyExc_IndentationError")) - PyExc_MemoryErrorInst = cast[PPPyObject](symAddr(lib, "PyExc_MemoryErrorInst")) - PyExc_NotImplementedError = cast[PPPyObject](symAddr(lib, "PyExc_NotImplementedError")) - PyExc_OSError = cast[PPPyObject](symAddr(lib, "PyExc_OSError")) - PyExc_TabError = cast[PPPyObject](symAddr(lib, "PyExc_TabError")) - PyExc_UnboundLocalError = cast[PPPyObject](symAddr(lib, "PyExc_UnboundLocalError")) - PyExc_UnicodeError = cast[PPPyObject](symAddr(lib, "PyExc_UnicodeError")) - PyExc_Warning = cast[PPPyObject](symAddr(lib, "PyExc_Warning")) - PyExc_DeprecationWarning = cast[PPPyObject](symAddr(lib, "PyExc_DeprecationWarning")) - PyExc_RuntimeWarning = cast[PPPyObject](symAddr(lib, "PyExc_RuntimeWarning")) - PyExc_SyntaxWarning = cast[PPPyObject](symAddr(lib, "PyExc_SyntaxWarning")) - PyExc_UserWarning = cast[PPPyObject](symAddr(lib, "PyExc_UserWarning")) - PyExc_OverflowWarning = cast[PPPyObject](symAddr(lib, "PyExc_OverflowWarning")) - PyExc_ReferenceError = cast[PPPyObject](symAddr(lib, "PyExc_ReferenceError")) - PyExc_StopIteration = cast[PPPyObject](symAddr(lib, "PyExc_StopIteration")) - PyExc_FutureWarning = cast[PPPyObject](symAddr(lib, "PyExc_FutureWarning")) - PyExc_PendingDeprecationWarning = cast[PPPyObject](symAddr(lib, - "PyExc_PendingDeprecationWarning")) - PyExc_UnicodeDecodeError = cast[PPPyObject](symAddr(lib, "PyExc_UnicodeDecodeError")) - PyExc_UnicodeEncodeError = cast[PPPyObject](symAddr(lib, "PyExc_UnicodeEncodeError")) - PyExc_UnicodeTranslateError = cast[PPPyObject](symAddr(lib, "PyExc_UnicodeTranslateError")) - PyType_Type = cast[PPyTypeObject](symAddr(lib, "PyType_Type")) - PyCFunction_Type = cast[PPyTypeObject](symAddr(lib, "PyCFunction_Type")) - PyCObject_Type = cast[PPyTypeObject](symAddr(lib, "PyCObject_Type")) - PyClass_Type = cast[PPyTypeObject](symAddr(lib, "PyClass_Type")) - PyCode_Type = cast[PPyTypeObject](symAddr(lib, "PyCode_Type")) - PyComplex_Type = cast[PPyTypeObject](symAddr(lib, "PyComplex_Type")) - PyDict_Type = cast[PPyTypeObject](symAddr(lib, "PyDict_Type")) - PyFile_Type = cast[PPyTypeObject](symAddr(lib, "PyFile_Type")) - PyFloat_Type = cast[PPyTypeObject](symAddr(lib, "PyFloat_Type")) - PyFrame_Type = cast[PPyTypeObject](symAddr(lib, "PyFrame_Type")) - PyFunction_Type = cast[PPyTypeObject](symAddr(lib, "PyFunction_Type")) - PyInstance_Type = cast[PPyTypeObject](symAddr(lib, "PyInstance_Type")) - PyInt_Type = cast[PPyTypeObject](symAddr(lib, "PyInt_Type")) - PyList_Type = cast[PPyTypeObject](symAddr(lib, "PyList_Type")) - PyLong_Type = cast[PPyTypeObject](symAddr(lib, "PyLong_Type")) - PyMethod_Type = cast[PPyTypeObject](symAddr(lib, "PyMethod_Type")) - PyModule_Type = cast[PPyTypeObject](symAddr(lib, "PyModule_Type")) - PyObject_Type = cast[PPyTypeObject](symAddr(lib, "PyObject_Type")) - PyRange_Type = cast[PPyTypeObject](symAddr(lib, "PyRange_Type")) - PySlice_Type = cast[PPyTypeObject](symAddr(lib, "PySlice_Type")) - PyString_Type = cast[PPyTypeObject](symAddr(lib, "PyString_Type")) - PyTuple_Type = cast[PPyTypeObject](symAddr(lib, "PyTuple_Type")) - PyUnicode_Type = cast[PPyTypeObject](symAddr(lib, "PyUnicode_Type")) - PyBaseObject_Type = cast[PPyTypeObject](symAddr(lib, "PyBaseObject_Type")) - PyBuffer_Type = cast[PPyTypeObject](symAddr(lib, "PyBuffer_Type")) - PyCallIter_Type = cast[PPyTypeObject](symAddr(lib, "PyCallIter_Type")) - PyCell_Type = cast[PPyTypeObject](symAddr(lib, "PyCell_Type")) - PyClassMethod_Type = cast[PPyTypeObject](symAddr(lib, "PyClassMethod_Type")) - PyProperty_Type = cast[PPyTypeObject](symAddr(lib, "PyProperty_Type")) - PySeqIter_Type = cast[PPyTypeObject](symAddr(lib, "PySeqIter_Type")) - PyStaticMethod_Type = cast[PPyTypeObject](symAddr(lib, "PyStaticMethod_Type")) - PySuper_Type = cast[PPyTypeObject](symAddr(lib, "PySuper_Type")) - PySymtableEntry_Type = cast[PPyTypeObject](symAddr(lib, "PySymtableEntry_Type")) - PyTraceBack_Type = cast[PPyTypeObject](symAddr(lib, "PyTraceBack_Type")) - PyWrapperDescr_Type = cast[PPyTypeObject](symAddr(lib, "PyWrapperDescr_Type")) - PyBaseString_Type = cast[PPyTypeObject](symAddr(lib, "PyBaseString_Type")) - PyBool_Type = cast[PPyTypeObject](symAddr(lib, "PyBool_Type")) - PyEnum_Type = cast[PPyTypeObject](symAddr(lib, "PyEnum_Type")) - -# Unfortunately we have to duplicate the loading mechanism here, because Nimrod -# used to not support variables from dynamic libraries. Well designed API's -# don't require this anyway. Python is an exception. - -var - lib: TLibHandle - -when defined(windows): - const - LibNames = ["python27.dll", "python26.dll", "python25.dll", - "python24.dll", "python23.dll", "python22.dll", "python21.dll", - "python20.dll", "python16.dll", "python15.dll"] -elif defined(macosx): - const - LibNames = ["libpython2.7.dylib", "libpython2.6.dylib", - "libpython2.5.dylib", "libpython2.4.dylib", "libpython2.3.dylib", - "libpython2.2.dylib", "libpython2.1.dylib", "libpython2.0.dylib", - "libpython1.6.dylib", "libpython1.5.dylib"] -else: - const - LibNames = [ - "libpython2.7.so" & dllver, - "libpython2.6.so" & dllver, - "libpython2.5.so" & dllver, - "libpython2.4.so" & dllver, - "libpython2.3.so" & dllver, - "libpython2.2.so" & dllver, - "libpython2.1.so" & dllver, - "libpython2.0.so" & dllver, - "libpython1.6.so" & dllver, - "libpython1.5.so" & dllver] - -for libName in items(libNames): - lib = loadLib(libName) - if lib != nil: break - -if lib == nil: quit("could not load python library") -init(lib) - diff --git a/lib/wrappers/tcl.nim b/lib/wrappers/tcl.nim deleted file mode 100644 index 8cd7158382..0000000000 --- a/lib/wrappers/tcl.nim +++ /dev/null @@ -1,865 +0,0 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2010 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -## This module is a wrapper for the TCL programming language. - -# -# tcl.h -- -# -# This header file describes the externally-visible facilities of the Tcl -# interpreter. -# -# Translated to Pascal Copyright (c) 2002 by Max Artemev -# aka Bert Raccoon (bert@furry.ru, bert_raccoon@freemail.ru) -# -# -# Copyright (c) 1998-2000 by Scriptics Corporation. -# Copyright (c) 1994-1998 Sun Microsystems, Inc. -# Copyright (c) 1993-1996 Lucent Technologies. -# Copyright (c) 1987-1994 John Ousterhout, The Regents of the -# University of California, Berkeley. -# -# *********************************************************************** -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# *********************************************************************** -# - -{.deadCodeElim: on.} - -when defined(WIN32): - const - dllName = "tcl(85|84|83|82|81|80).dll" -elif defined(macosx): - const - dllName = "libtcl(8.5|8.4|8.3|8.2|8.1).dylib" -else: - const - dllName = "libtcl(8.5|8.4|8.3|8.2|8.1).so(|.1|.0)" -const - TCL_DESTROYED* = 0xDEADDEAD - TCL_OK* = 0 - TCL_ERROR* = 1 - TCL_RETURN* = 2 - TCL_BREAK* = 3 - TCL_CONTINUE* = 4 - RESULT_SIZE* = 200 - MAX_ARGV* = 0x00007FFF - VERSION_MAJOR* = 0 - VERSION_MINOR* = 0 - NO_EVAL* = 0x00010000 - EVAL_GLOBAL* = 0x00020000 # Flag values passed to variable-related proc - GLOBAL_ONLY* = 1 - NAMESPACE_ONLY* = 2 - APPEND_VALUE* = 4 - LIST_ELEMENT* = 8 - TRACE_READS* = 0x00000010 - TRACE_WRITES* = 0x00000020 - TRACE_UNSETS* = 0x00000040 - TRACE_DESTROYED* = 0x00000080 - INTERP_DESTROYED* = 0x00000100 - LEAVE_ERR_MSG* = 0x00000200 - PARSE_PART1* = 0x00000400 # Types for linked variables: * - LINK_INT* = 1 - LINK_DOUBLE* = 2 - LINK_BOOLEAN* = 3 - LINK_STRING* = 4 - LINK_READ_ONLY* = 0x00000080 - SMALL_HASH_TABLE* = 4 # Hash Table * - STRING_KEYS* = 0 - ONE_WORD_KEYS* = 1 # Const/enums Tcl_QueuePosition * - - QUEUE_TAIL* = 0 - QUEUE_HEAD* = 1 - QUEUE_MARK* = 2 # Tcl_QueuePosition; - # Event Flags - DONT_WAIT* = 1 shl 1 - WINDOW_EVENTS* = 1 shl 2 - FILE_EVENTS* = 1 shl 3 - TIMER_EVENTS* = 1 shl 4 - IDLE_EVENTS* = 1 shl 5 # WAS 0x10 ???? * - ALL_EVENTS* = not DONT_WAIT - VOLATILE* = 1 - TCL_STATIC* = 0 - DYNAMIC* = 3 # Channel - TCL_STDIN* = 1 shl 1 - TCL_STDOUT* = 1 shl 2 - TCL_STDERR* = 1 shl 3 - ENFORCE_MODE* = 1 shl 4 - READABLE* = 1 shl 1 - WRITABLE* = 1 shl 2 - EXCEPTION* = 1 shl 3 # POSIX * - EPERM* = 1 # Operation not permitted; only the owner of the file (or other - # resource) or processes with special privileges can perform the - # operation. - # - ENOENT* = 2 # No such file or directory. This is a "file doesn't exist" error - # for ordinary files that are referenced in contexts where they are - # expected to already exist. - # - ESRCH* = 3 # No process matches the specified process ID. * - EINTR* = 4 # Interrupted function call; an asynchronous signal occurred and - # prevented completion of the call. When this happens, you should - # try the call again. - # - EIO* = 5 # Input/output error; usually used for physical read or write errors. * - ENXIO* = 6 # No such device or address. The system tried to use the device - # represented by a file you specified, and it couldn't find the - # device. This can mean that the device file was installed - # incorrectly, or that the physical device is missing or not - # correctly attached to the computer. - # - E2BIG* = 7 # Argument list too long; used when the arguments passed to a new - # program being executed with one of the `exec' functions (*note - # Executing a File::.) occupy too much memory space. This condition - # never arises in the GNU system. - # - ENOEXEC* = 8 # Invalid executable file format. This condition is detected by the - # `exec' functions; see *Note Executing a File::. - # - EBADF* = 9 # Bad file descriptor; for example, I/O on a descriptor that has been - # closed or reading from a descriptor open only for writing (or vice - # versa). - # - ECHILD* = 10 # There are no child processes. This error happens on operations - # that are supposed to manipulate child processes, when there aren't - # any processes to manipulate. - # - EDEADLK* = 11 # Deadlock avoided; allocating a system resource would have resulted - # in a deadlock situation. The system does not guarantee that it - # will notice all such situations. This error means you got lucky - # and the system noticed; it might just hang. *Note File Locks::, - # for an example. - # - ENOMEM* = 12 # No memory available. The system cannot allocate more virtual - # memory because its capacity is full. - # - EACCES* = 13 # Permission denied; the file permissions do not allow the attempted - # operation. - # - EFAULT* = 14 # Bad address; an invalid pointer was detected. In the GNU system, - # this error never happens; you get a signal instead. - # - ENOTBLK* = 15 # A file that isn't a block special file was given in a situation - # that requires one. For example, trying to mount an ordinary file - # as a file system in Unix gives this error. - # - EBUSY* = 16 # Resource busy; a system resource that can't be shared is already - # in use. For example, if you try to delete a file that is the root - # of a currently mounted filesystem, you get this error. - # - EEXIST* = 17 # File exists; an existing file was specified in a context where it - # only makes sense to specify a new file. - # - EXDEV* = 18 # An attempt to make an improper link across file systems was - # detected. This happens not only when you use `link' (*note Hard - # Links::.) but also when you rename a file with `rename' (*note - # Renaming Files::.). - # - ENODEV* = 19 # The wrong type of device was given to a function that expects a - # particular sort of device. - # - ENOTDIR* = 20 # A file that isn't a directory was specified when a directory is - # required. - # - EISDIR* = 21 # File is a directory; you cannot open a directory for writing, or - # create or remove hard links to it. - # - EINVAL* = 22 # Invalid argument. This is used to indicate various kinds of - # problems with passing the wrong argument to a library function. - # - EMFILE* = 24 # The current process has too many files open and can't open any - # more. Duplicate descriptors do count toward this limit. - # - # In BSD and GNU, the number of open files is controlled by a - # resource limit that can usually be increased. If you get this - # error, you might want to increase the `RLIMIT_NOFILE' limit or - # make it unlimited; *note Limits on Resources::.. - # - ENFILE* = 23 # There are too many distinct file openings in the entire system. - # Note that any number of linked channels count as just one file - # opening; see *Note Linked Channels::. This error never occurs in - # the GNU system. - # - ENOTTY* = 25 # Inappropriate I/O control operation, such as trying to set terminal - # modes on an ordinary file. - # - ETXTBSY* = 26 # An attempt to execute a file that is currently open for writing, or - # write to a file that is currently being executed. Often using a - # debugger to run a program is considered having it open for writing - # and will cause this error. (The name stands for "text file - # busy".) This is not an error in the GNU system; the text is - # copied as necessary. - # - EFBIG* = 27 # File too big; the size of a file would be larger than allowed by - # the system. - # - ENOSPC* = 28 # No space left on device; write operation on a file failed because - # the disk is full. - # - ESPIPE* = 29 # Invalid seek operation (such as on a pipe). * - EROFS* = 30 # An attempt was made to modify something on a read-only file system. * - EMLINK* = 31 # Too many links; the link count of a single file would become too - # large. `rename' can cause this error if the file being renamed - # already has as many links as it can take (*note Renaming Files::.). - # - EPIPE* = 32 # Broken pipe; there is no process reading from the other end of a - # pipe. Every library function that returns this error code also - # generates a `SIGPIPE' signal; this signal terminates the program - # if not handled or blocked. Thus, your program will never actually - # see `EPIPE' unless it has handled or blocked `SIGPIPE'. - # - EDOM* = 33 # Domain error; used by mathematical functions when an argument - # value does not fall into the domain over which the function is - # defined. - # - ERANGE* = 34 # Range error; used by mathematical functions when the result value - # is not representable because of overflow or underflow. - # - EAGAIN* = 35 # Resource temporarily unavailable; the call might work if you try - # again later. The macro `EWOULDBLOCK' is another name for `EAGAIN'; - # they are always the same in the GNU C library. - # - EWOULDBLOCK* = EAGAIN # In the GNU C library, this is another name for `EAGAIN' (above). - # The values are always the same, on every operating system. - # C libraries in many older Unix systems have `EWOULDBLOCK' as a - # separate error code. - # - EINPROGRESS* = 36 # An operation that cannot complete immediately was initiated on an - # object that has non-blocking mode selected. Some functions that - # must always block (such as `connect'; *note Connecting::.) never - # return `EAGAIN'. Instead, they return `EINPROGRESS' to indicate - # that the operation has begun and will take some time. Attempts to - # manipulate the object before the call completes return `EALREADY'. - # You can use the `select' function to find out when the pending - # operation has completed; *note Waiting for I/O::.. - # - EALREADY* = 37 # An operation is already in progress on an object that has - # non-blocking mode selected. - # - ENOTSOCK* = 38 # A file that isn't a socket was specified when a socket is required. * - EDESTADDRREQ* = 39 # No default destination address was set for the socket. You get - # this error when you try to transmit data over a connectionless - # socket, without first specifying a destination for the data with - # `connect'. - # - EMSGSIZE* = 40 # The size of a message sent on a socket was larger than the - # supported maximum size. - # - EPROTOTYPE* = 41 # The socket type does not support the requested communications - # protocol. - # - ENOPROTOOPT* = 42 # You specified a socket option that doesn't make sense for the - # particular protocol being used by the socket. *Note Socket - # Options::. - # - EPROTONOSUPPORT* = 43 # The socket domain does not support the requested communications - # protocol (perhaps because the requested protocol is completely - # invalid.) *Note Creating a Socket::. - # - ESOCKTNOSUPPORT* = 44 # The socket type is not supported. * - EOPNOTSUPP* = 45 # The operation you requested is not supported. Some socket - # functions don't make sense for all types of sockets, and others - # may not be implemented for all communications protocols. In the - # GNU system, this error can happen for many calls when the object - # does not support the particular operation; it is a generic - # indication that the server knows nothing to do for that call. - # - EPFNOSUPPORT* = 46 # The socket communications protocol family you requested is not - # supported. - # - EAFNOSUPPORT* = 47 # The address family specified for a socket is not supported; it is - # inconsistent with the protocol being used on the socket. *Note - # Sockets::. - # - EADDRINUSE* = 48 # The requested socket address is already in use. *Note Socket - # Addresses::. - # - EADDRNOTAVAIL* = 49 # The requested socket address is not available; for example, you - # tried to give a socket a name that doesn't match the local host - # name. *Note Socket Addresses::. - # - ENETDOWN* = 50 # A socket operation failed because the network was down. * - ENETUNREACH* = 51 # A socket operation failed because the subnet containing the remote - # host was unreachable. - # - ENETRESET* = 52 # A network connection was reset because the remote host crashed. * - ECONNABORTED* = 53 # A network connection was aborted locally. * - ECONNRESET* = 54 # A network connection was closed for reasons outside the control of - # the local host, such as by the remote machine rebooting or an - # unrecoverable protocol violation. - # - ENOBUFS* = 55 # The kernel's buffers for I/O operations are all in use. In GNU, - # this error is always synonymous with `ENOMEM'; you may get one or - # the other from network operations. - # - EISCONN* = 56 # You tried to connect a socket that is already connected. *Note - # Connecting::. - # - ENOTCONN* = 57 # The socket is not connected to anything. You get this error when - # you try to transmit data over a socket, without first specifying a - # destination for the data. For a connectionless socket (for - # datagram protocols, such as UDP), you get `EDESTADDRREQ' instead. - # - ESHUTDOWN* = 58 # The socket has already been shut down. * - ETOOMANYREFS* = 59 # ??? * - ETIMEDOUT* = 60 # A socket operation with a specified timeout received no response - # during the timeout period. - # - ECONNREFUSED* = 61 # A remote host refused to allow the network connection (typically - # because it is not running the requested service). - # - ELOOP* = 62 # Too many levels of symbolic links were encountered in looking up a - # file name. This often indicates a cycle of symbolic links. - # - ENAMETOOLONG* = 63 # Filename too long (longer than `PATH_MAX'; *note Limits for - # Files::.) or host name too long (in `gethostname' or - # `sethostname'; *note Host Identification::.). - # - EHOSTDOWN* = 64 # The remote host for a requested network connection is down. * - EHOSTUNREACH* = 65 # The remote host for a requested network connection is not - # reachable. - # - ENOTEMPTY* = 66 # Directory not empty, where an empty directory was expected. - # Typically, this error occurs when you are trying to delete a - # directory. - # - EPROCLIM* = 67 # This means that the per-user limit on new process would be - # exceeded by an attempted `fork'. *Note Limits on Resources::, for - # details on the `RLIMIT_NPROC' limit. - # - EUSERS* = 68 # The file quota system is confused because there are too many users. * - EDQUOT* = 69 # The user's disk quota was exceeded. * - ESTALE* = 70 # Stale NFS file handle. This indicates an internal confusion in - # the NFS system which is due to file system rearrangements on the - # server host. Repairing this condition usually requires unmounting - # and remounting the NFS file system on the local host. - # - EREMOTE* = 71 # An attempt was made to NFS-mount a remote file system with a file - # name that already specifies an NFS-mounted file. (This is an - # error on some operating systems, but we expect it to work properly - # on the GNU system, making this error code impossible.) - # - EBADRPC* = 72 # ??? * - ERPCMISMATCH* = 73 # ??? * - EPROGUNAVAIL* = 74 # ??? * - EPROGMISMATCH* = 75 # ??? * - EPROCUNAVAIL* = 76 # ??? * - ENOLCK* = 77 # No locks available. This is used by the file locking facilities; - # see *Note File Locks::. This error is never generated by the GNU - # system, but it can result from an operation to an NFS server - # running another operating system. - # - ENOSYS* = 78 # Function not implemented. Some functions have commands or options - # defined that might not be supported in all implementations, and - # this is the kind of error you get if you request them and they are - # not supported. - # - EFTYPE* = 79 # Inappropriate file type or format. The file was the wrong type - # for the operation, or a data file had the wrong format. - # On some systems `chmod' returns this error if you try to set the - # sticky bit on a non-directory file; *note Setting Permissions::.. - # - -type - TArgv* = cstringArray - TClientData* = pointer - TFreeProc* = proc (theBlock: pointer){.cdecl.} - PInterp* = ptr TInterp - TInterp*{.final.} = object # Event Definitions - result*: cstring # Do not access this directly. Use - # Tcl_GetStringResult since result - # may be pointing to an object - freeProc*: TFreeProc - errorLine*: int - - TEventSetupProc* = proc (clientData: TClientData, flags: int){.cdecl.} - TEventCheckProc* = TEventSetupProc - PEvent* = ptr TEvent - TEventProc* = proc (evPtr: PEvent, flags: int): int{.cdecl.} - TEvent*{.final.} = object - prc*: TEventProc - nextPtr*: PEvent - ClientData*: TObject # ClientData is just pointer.* - - PTime* = ptr TTime - TTime*{.final.} = object - sec*: int32 # Seconds. * - usec*: int32 # Microseconds. * - - TTimerToken* = pointer - PInteger* = ptr int - PHashTable* = ptr THashTable - PHashEntry* = ptr THashEntry - PPHashEntry* = ptr PHashEntry - THashEntry*{.final.} = object - nextPtr*: PHashEntry - tablePtr*: PHashTable - bucketPtr*: PPHashEntry - clientData*: TClientData - key*: cstring - - THashFindProc* = proc (tablePtr: PHashTable, key: cstring): PHashEntry{. - cdecl.} - THashCreateProc* = proc (tablePtr: PHashTable, key: cstring, - newPtr: PInteger): PHashEntry{.cdecl.} - THashTable*{.final.} = object - buckets*: ppHashEntry - staticBuckets*: array[0..SMALL_HASH_TABLE - 1, PHashEntry] - numBuckets*: int - numEntries*: int - rebuildSize*: int - downShift*: int - mask*: int - keyType*: int - findProc*: THashFindProc - createProc*: THashCreateProc - - PHashSearch* = ptr THashSearch - THashSearch*{.final.} = object - tablePtr*: PHashTable - nextIndex*: int - nextEntryPtr*: PHashEntry - - TAppInitProc* = proc (interp: pInterp): int{.cdecl.} - TPackageInitProc* = proc (interp: pInterp): int{.cdecl.} - TCmdProc* = proc (clientData: TClientData, interp: pInterp, argc: int, - argv: TArgv): int{.cdecl.} - TVarTraceProc* = proc (clientData: TClientData, interp: pInterp, - varName: cstring, elemName: cstring, flags: int): cstring{. - cdecl.} - TInterpDeleteProc* = proc (clientData: TClientData, interp: pInterp){.cdecl.} - TCmdDeleteProc* = proc (clientData: TClientData){.cdecl.} - TNamespaceDeleteProc* = proc (clientData: TClientData){.cdecl.} - -const - DSTRING_STATIC_SIZE* = 200 - -type - PDString* = ptr TDString - TDString*{.final.} = object - str*: cstring - len*: int - spaceAvl*: int - staticSpace*: array[0..DSTRING_STATIC_SIZE - 1, char] - - PChannel* = ptr TChannel - TChannel*{.final.} = object - TDriverBlockModeProc* = proc (instanceData: TClientData, mode: int): int{. - cdecl.} - TDriverCloseProc* = proc (instanceData: TClientData, interp: PInterp): int{. - cdecl.} - TDriverInputProc* = proc (instanceData: TClientData, buf: cstring, - toRead: int, errorCodePtr: PInteger): int{.cdecl.} - TDriverOutputProc* = proc (instanceData: TClientData, buf: cstring, - toWrite: int, errorCodePtr: PInteger): int{.cdecl.} - TDriverSeekProc* = proc (instanceData: TClientData, offset: int32, - mode: int, errorCodePtr: PInteger): int{.cdecl.} - TDriverSetOptionProc* = proc (instanceData: TClientData, interp: PInterp, - optionName: cstring, value: cstring): int{.cdecl.} - TDriverGetOptionProc* = proc (instanceData: TClientData, interp: pInterp, - optionName: cstring, dsPtr: PDString): int{. - cdecl.} - TDriverWatchProc* = proc (instanceData: TClientData, mask: int){.cdecl.} - TDriverGetHandleProc* = proc (instanceData: TClientData, direction: int, - handlePtr: var TClientData): int{.cdecl.} - PChannelType* = ptr TChannelType - TChannelType*{.final.} = object - typeName*: cstring - blockModeProc*: TDriverBlockModeProc - closeProc*: TDriverCloseProc - inputProc*: TDriverInputProc - ouputProc*: TDriverOutputProc - seekProc*: TDriverSeekProc - setOptionProc*: TDriverSetOptionProc - getOptionProc*: TDriverGetOptionProc - watchProc*: TDriverWatchProc - getHandleProc*: TDriverGetHandleProc - - TChannelProc* = proc (clientData: TClientData, mask: int){.cdecl.} - PObj* = ptr TObj - PPObj* = ptr PObj - TObj*{.final.} = object - refCount*: int # ... - - TObjCmdProc* = proc (clientData: TClientData, interp: PInterp, objc: int, - PPObj: PPObj): int{.cdecl.} - PNamespace* = ptr TNamespace - TNamespace*{.final.} = object - name*: cstring - fullName*: cstring - clientData*: TClientData - deleteProc*: TNamespaceDeleteProc - parentPtr*: PNamespace - - PCallFrame* = ptr TCallFrame - TCallFrame*{.final.} = object - nsPtr*: PNamespace - dummy1*: int - dummy2*: int - dummy3*: cstring - dummy4*: cstring - dummy5*: cstring - dummy6*: int - dummy7*: cstring - dummy8*: cstring - dummy9*: int - dummy10*: cstring - - PCmdInfo* = ptr TCmdInfo - TCmdInfo*{.final.} = object - isNativeObjectProc*: int - objProc*: TObjCmdProc - objClientData*: TClientData - prc*: TCmdProc - clientData*: TClientData - deleteProc*: TCmdDeleteProc - deleteData*: TClientData - namespacePtr*: pNamespace - - pCommand* = ptr TCommand - TCommand*{.final.} = object # hPtr : pTcl_HashEntry; - # nsPtr : pTcl_Namespace; - # refCount : integer; - # isCmdEpoch : integer; - # compileProc : pointer; - # objProc : pointer; - # objClientData : Tcl_ClientData; - # proc : pointer; - # clientData : Tcl_ClientData; - # deleteProc : TTclCmdDeleteProc; - # deleteData : Tcl_ClientData; - # deleted : integer; - # importRefPtr : pointer; - # - -type - TPanicProc* = proc (fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8: cstring){. - cdecl.} # 1/15/97 orig. Tcl style - TClientDataProc* = proc (clientData: TClientData){.cdecl.} - TIdleProc* = proc (clientData: TClientData){.cdecl.} - TTimerProc* = TIdleProc - TCreateCloseHandler* = proc (channel: pChannel, prc: TClientDataProc, - clientData: TClientData){.cdecl.} - TDeleteCloseHandler* = TCreateCloseHandler - TEventDeleteProc* = proc (evPtr: pEvent, clientData: TClientData): int{. - cdecl.} - -proc Alloc*(size: int): cstring{.cdecl, dynlib: dllName, - importc: "Tcl_Alloc".} -proc CreateInterp*(): pInterp{.cdecl, dynlib: dllName, - importc: "Tcl_CreateInterp".} -proc DeleteInterp*(interp: pInterp){.cdecl, dynlib: dllName, - importc: "Tcl_DeleteInterp".} -proc ResetResult*(interp: pInterp){.cdecl, dynlib: dllName, - importc: "Tcl_ResetResult".} -proc Eval*(interp: pInterp, script: cstring): int{.cdecl, dynlib: dllName, - importc: "Tcl_Eval".} -proc EvalFile*(interp: pInterp, filename: cstring): int{.cdecl, - dynlib: dllName, importc: "Tcl_EvalFile".} -proc AddErrorInfo*(interp: pInterp, message: cstring){.cdecl, - dynlib: dllName, importc: "Tcl_AddErrorInfo".} -proc BackgroundError*(interp: pInterp){.cdecl, dynlib: dllName, - importc: "Tcl_BackgroundError".} -proc CreateCommand*(interp: pInterp, name: cstring, cmdProc: TCmdProc, - clientData: TClientData, deleteProc: TCmdDeleteProc): pCommand{. - cdecl, dynlib: dllName, importc: "Tcl_CreateCommand".} -proc DeleteCommand*(interp: pInterp, name: cstring): int{.cdecl, - dynlib: dllName, importc: "Tcl_DeleteCommand".} -proc CallWhenDeleted*(interp: pInterp, prc: TInterpDeleteProc, - clientData: TClientData){.cdecl, dynlib: dllName, - importc: "Tcl_CallWhenDeleted".} -proc DontCallWhenDeleted*(interp: pInterp, prc: TInterpDeleteProc, - clientData: TClientData){.cdecl, - dynlib: dllName, importc: "Tcl_DontCallWhenDeleted".} -proc CommandComplete*(cmd: cstring): int{.cdecl, dynlib: dllName, - importc: "Tcl_CommandComplete".} -proc LinkVar*(interp: pInterp, varName: cstring, varAddr: pointer, typ: int): int{. - cdecl, dynlib: dllName, importc: "Tcl_LinkVar".} -proc UnlinkVar*(interp: pInterp, varName: cstring){.cdecl, dynlib: dllName, - importc: "Tcl_UnlinkVar".} -proc TraceVar*(interp: pInterp, varName: cstring, flags: int, - prc: TVarTraceProc, clientData: TClientData): int{.cdecl, - dynlib: dllName, importc: "Tcl_TraceVar".} -proc TraceVar2*(interp: pInterp, varName: cstring, elemName: cstring, - flags: int, prc: TVarTraceProc, clientData: TClientData): int{. - cdecl, dynlib: dllName, importc: "Tcl_TraceVar2".} -proc UntraceVar*(interp: pInterp, varName: cstring, flags: int, - prc: TVarTraceProc, clientData: TClientData){.cdecl, - dynlib: dllName, importc: "Tcl_UntraceVar".} -proc UntraceVar2*(interp: pInterp, varName: cstring, elemName: cstring, - flags: int, prc: TVarTraceProc, clientData: TClientData){. - cdecl, dynlib: dllName, importc: "Tcl_UntraceVar2".} -proc GetVar*(interp: pInterp, varName: cstring, flags: int): cstring{.cdecl, - dynlib: dllName, importc: "Tcl_GetVar".} -proc GetVar2*(interp: pInterp, varName: cstring, elemName: cstring, - flags: int): cstring{.cdecl, dynlib: dllName, - importc: "Tcl_GetVar2".} -proc SetVar*(interp: pInterp, varName: cstring, newValue: cstring, - flags: int): cstring{.cdecl, dynlib: dllName, - importc: "Tcl_SetVar".} -proc SetVar2*(interp: pInterp, varName: cstring, elemName: cstring, - newValue: cstring, flags: int): cstring{.cdecl, - dynlib: dllName, importc: "Tcl_SetVar2".} -proc UnsetVar*(interp: pInterp, varName: cstring, flags: int): int{.cdecl, - dynlib: dllName, importc: "Tcl_UnsetVar".} -proc UnsetVar2*(interp: pInterp, varName: cstring, elemName: cstring, - flags: int): int{.cdecl, dynlib: dllName, - importc: "Tcl_UnsetVar2".} -proc SetResult*(interp: pInterp, newValue: cstring, freeProc: TFreeProc){. - cdecl, dynlib: dllName, importc: "Tcl_SetResult".} -proc FirstHashEntry*(hashTbl: pHashTable, searchInfo: var THashSearch): pHashEntry{. - cdecl, dynlib: dllName, importc: "Tcl_FirstHashEntry".} -proc NextHashEntry*(searchInfo: var THashSearch): pHashEntry{.cdecl, - dynlib: dllName, importc: "Tcl_NextHashEntry".} -proc InitHashTable*(hashTbl: pHashTable, keyType: int){.cdecl, - dynlib: dllName, importc: "Tcl_InitHashTable".} -proc StringMatch*(str: cstring, pattern: cstring): int{.cdecl, - dynlib: dllName, importc: "Tcl_StringMatch".} -proc GetErrno*(): int{.cdecl, dynlib: dllName, importc: "Tcl_GetErrno".} -proc SetErrno*(val: int){.cdecl, dynlib: dllName, importc: "Tcl_SetErrno".} -proc SetPanicProc*(prc: TPanicProc){.cdecl, dynlib: dllName, - importc: "Tcl_SetPanicProc".} -proc PkgProvide*(interp: pInterp, name: cstring, version: cstring): int{. - cdecl, dynlib: dllName, importc: "Tcl_PkgProvide".} -proc StaticPackage*(interp: pInterp, pkgName: cstring, - initProc: TPackageInitProc, - safeInitProc: TPackageInitProc){.cdecl, dynlib: dllName, - importc: "Tcl_StaticPackage".} -proc CreateEventSource*(setupProc: TEventSetupProc, - checkProc: TEventCheckProc, - clientData: TClientData){.cdecl, dynlib: dllName, - importc: "Tcl_CreateEventSource".} -proc DeleteEventSource*(setupProc: TEventSetupProc, - checkProc: TEventCheckProc, - clientData: TClientData){.cdecl, dynlib: dllName, - importc: "Tcl_DeleteEventSource".} -proc QueueEvent*(evPtr: pEvent, pos: int){.cdecl, dynlib: dllName, - importc: "Tcl_QueueEvent".} -proc SetMaxBlockTime*(timePtr: pTime){.cdecl, dynlib: dllName, - importc: "Tcl_SetMaxBlockTime".} -proc DeleteEvents*(prc: TEventDeleteProc, clientData: TClientData){. - cdecl, dynlib: dllName, importc: "Tcl_DeleteEvents".} -proc DoOneEvent*(flags: int): int{.cdecl, dynlib: dllName, - importc: "Tcl_DoOneEvent".} -proc DoWhenIdle*(prc: TIdleProc, clientData: TClientData){.cdecl, - dynlib: dllName, importc: "Tcl_DoWhenIdle".} -proc CancelIdleCall*(prc: TIdleProc, clientData: TClientData){.cdecl, - dynlib: dllName, importc: "Tcl_CancelIdleCall".} -proc CreateTimerHandler*(milliseconds: int, prc: TTimerProc, - clientData: TClientData): TTimerToken{.cdecl, - dynlib: dllName, importc: "Tcl_CreateTimerHandler".} -proc DeleteTimerHandler*(token: TTimerToken){.cdecl, dynlib: dllName, - importc: "Tcl_DeleteTimerHandler".} - # procedure Tcl_CreateModalTimeout(milliseconds: integer; prc: TTclTimerProc; clientData: Tcl_ClientData); cdecl; external dllName; - # procedure Tcl_DeleteModalTimeout(prc: TTclTimerProc; clientData: Tcl_ClientData); cdecl; external dllName; -proc SplitList*(interp: pInterp, list: cstring, argcPtr: var int, - argvPtr: var TArgv): int{.cdecl, dynlib: dllName, - importc: "Tcl_SplitList".} -proc Merge*(argc: int, argv: TArgv): cstring{.cdecl, dynlib: dllName, - importc: "Tcl_Merge".} -proc Free*(p: cstring){.cdecl, dynlib: dllName, importc: "Tcl_Free".} -proc Init*(interp: pInterp): int{.cdecl, dynlib: dllName, - importc: "Tcl_Init".} - # procedure Tcl_InterpDeleteProc(clientData: Tcl_ClientData; interp: pTcl_Interp); cdecl; external dllName; -proc GetAssocData*(interp: pInterp, key: cstring, prc: var TInterpDeleteProc): TClientData{. - cdecl, dynlib: dllName, importc: "Tcl_GetAssocData".} -proc DeleteAssocData*(interp: pInterp, key: cstring){.cdecl, - dynlib: dllName, importc: "Tcl_DeleteAssocData".} -proc SetAssocData*(interp: pInterp, key: cstring, prc: TInterpDeleteProc, - clientData: TClientData){.cdecl, dynlib: dllName, - importc: "Tcl_SetAssocData".} -proc IsSafe*(interp: pInterp): int{.cdecl, dynlib: dllName, - importc: "Tcl_IsSafe".} -proc MakeSafe*(interp: pInterp): int{.cdecl, dynlib: dllName, - importc: "Tcl_MakeSafe".} -proc CreateSlave*(interp: pInterp, slaveName: cstring, isSafe: int): pInterp{. - cdecl, dynlib: dllName, importc: "Tcl_CreateSlave".} -proc GetSlave*(interp: pInterp, slaveName: cstring): pInterp{.cdecl, - dynlib: dllName, importc: "Tcl_GetSlave".} -proc GetMaster*(interp: pInterp): pInterp{.cdecl, dynlib: dllName, - importc: "Tcl_GetMaster".} -proc GetInterpPath*(askingInterp: pInterp, slaveInterp: pInterp): int{. - cdecl, dynlib: dllName, importc: "Tcl_GetInterpPath".} -proc CreateAlias*(slaveInterp: pInterp, srcCmd: cstring, - targetInterp: pInterp, targetCmd: cstring, argc: int, - argv: TArgv): int{.cdecl, dynlib: dllName, - importc: "Tcl_CreateAlias".} -proc GetAlias*(interp: pInterp, srcCmd: cstring, targetInterp: var pInterp, - targetCmd: var cstring, argc: var int, argv: var TArgv): int{. - cdecl, dynlib: dllName, importc: "Tcl_GetAlias".} -proc ExposeCommand*(interp: pInterp, hiddenCmdName: cstring, - cmdName: cstring): int{.cdecl, dynlib: dllName, - importc: "Tcl_ExposeCommand".} -proc HideCommand*(interp: pInterp, cmdName: cstring, hiddenCmdName: cstring): int{. - cdecl, dynlib: dllName, importc: "Tcl_HideCommand".} -proc EventuallyFree*(clientData: TClientData, freeProc: TFreeProc){. - cdecl, dynlib: dllName, importc: "Tcl_EventuallyFree".} -proc Preserve*(clientData: TClientData){.cdecl, dynlib: dllName, - importc: "Tcl_Preserve".} -proc Release*(clientData: TClientData){.cdecl, dynlib: dllName, - importc: "Tcl_Release".} -proc InterpDeleted*(interp: pInterp): int{.cdecl, dynlib: dllName, - importc: "Tcl_InterpDeleted".} -proc GetCommandInfo*(interp: pInterp, cmdName: cstring, - info: var TCmdInfo): int{.cdecl, dynlib: dllName, - importc: "Tcl_GetCommandInfo".} -proc SetCommandInfo*(interp: pInterp, cmdName: cstring, - info: var TCmdInfo): int{.cdecl, dynlib: dllName, - importc: "Tcl_SetCommandInfo".} -proc FindExecutable*(path: cstring){.cdecl, dynlib: dllName, - importc: "Tcl_FindExecutable".} -proc GetStringResult*(interp: pInterp): cstring{.cdecl, dynlib: dllName, - importc: "Tcl_GetStringResult".} - #v1.0 -proc FindCommand*(interp: pInterp, cmdName: cstring, - contextNsPtr: pNamespace, flags: int): TCommand{.cdecl, - dynlib: dllName, importc: "Tcl_FindCommand".} - #v1.0 -proc DeleteCommandFromToken*(interp: pInterp, cmd: pCommand): int{.cdecl, - dynlib: dllName, importc: "Tcl_DeleteCommandFromToken".} -proc CreateNamespace*(interp: pInterp, name: cstring, - clientData: TClientData, - deleteProc: TNamespaceDeleteProc): pNamespace{.cdecl, - dynlib: dllName, importc: "Tcl_CreateNamespace".} - #v1.0 -proc DeleteNamespace*(namespacePtr: pNamespace){.cdecl, dynlib: dllName, - importc: "Tcl_DeleteNamespace".} -proc FindNamespace*(interp: pInterp, name: cstring, - contextNsPtr: pNamespace, flags: int): pNamespace{. - cdecl, dynlib: dllName, importc: "Tcl_FindNamespace".} -proc Tcl_Export*(interp: pInterp, namespacePtr: pNamespace, pattern: cstring, - resetListFirst: int): int{.cdecl, dynlib: dllName, - importc: "Tcl_Export".} -proc Tcl_Import*(interp: pInterp, namespacePtr: pNamespace, pattern: cstring, - allowOverwrite: int): int{.cdecl, dynlib: dllName, - importc: "Tcl_Import".} -proc GetCurrentNamespace*(interp: pInterp): pNamespace{.cdecl, - dynlib: dllName, importc: "Tcl_GetCurrentNamespace".} -proc GetGlobalNamespace*(interp: pInterp): pNamespace{.cdecl, - dynlib: dllName, importc: "Tcl_GetGlobalNamespace".} -proc PushCallFrame*(interp: pInterp, callFramePtr: var TCallFrame, - namespacePtr: pNamespace, isProcCallFrame: int): int{. - cdecl, dynlib: dllName, importc: "Tcl_PushCallFrame".} -proc PopCallFrame*(interp: pInterp){.cdecl, dynlib: dllName, - importc: "Tcl_PopCallFrame".} -proc VarEval*(interp: pInterp): int{.cdecl, varargs, dynlib: dllName, - importc: "Tcl_VarEval".} - # For TkConsole.c * -proc RecordAndEval*(interp: pInterp, cmd: cstring, flags: int): int{.cdecl, - dynlib: dllName, importc: "Tcl_RecordAndEval".} -proc GlobalEval*(interp: pInterp, command: cstring): int{.cdecl, - dynlib: dllName, importc: "Tcl_GlobalEval".} -proc DStringFree*(dsPtr: pDString){.cdecl, dynlib: dllName, - importc: "Tcl_DStringFree".} -proc DStringAppend*(dsPtr: pDString, str: cstring, length: int): cstring{. - cdecl, dynlib: dllName, importc: "Tcl_DStringAppend".} -proc DStringAppendElement*(dsPtr: pDString, str: cstring): cstring{.cdecl, - dynlib: dllName, importc: "Tcl_DStringAppendElement".} -proc DStringInit*(dsPtr: pDString){.cdecl, dynlib: dllName, - importc: "Tcl_DStringInit".} -proc AppendResult*(interp: pInterp){.cdecl, varargs, dynlib: dllName, - importc: "Tcl_AppendResult".} - # actually a "C" var array -proc SetStdChannel*(channel: pChannel, typ: int){.cdecl, dynlib: dllName, - importc: "Tcl_SetStdChannel".} -proc SetChannelOption*(interp: pInterp, chan: pChannel, optionName: cstring, - newValue: cstring): int{.cdecl, dynlib: dllName, - importc: "Tcl_SetChannelOption".} -proc GetChannelOption*(interp: pInterp, chan: pChannel, optionName: cstring, - dsPtr: pDString): int{.cdecl, dynlib: dllName, - importc: "Tcl_GetChannelOption".} -proc CreateChannel*(typePtr: pChannelType, chanName: cstring, - instanceData: TClientData, mask: int): pChannel{. - cdecl, dynlib: dllName, importc: "Tcl_CreateChannel".} -proc RegisterChannel*(interp: pInterp, channel: pChannel){.cdecl, - dynlib: dllName, importc: "Tcl_RegisterChannel".} -proc UnregisterChannel*(interp: pInterp, channel: pChannel): int{.cdecl, - dynlib: dllName, importc: "Tcl_UnregisterChannel".} -proc CreateChannelHandler*(chan: pChannel, mask: int, prc: TChannelProc, - clientData: TClientData){.cdecl, - dynlib: dllName, importc: "Tcl_CreateChannelHandler".} -proc GetChannel*(interp: pInterp, chanName: cstring, modePtr: pInteger): pChannel{. - cdecl, dynlib: dllName, importc: "Tcl_GetChannel".} -proc GetStdChannel*(typ: int): pChannel{.cdecl, dynlib: dllName, - importc: "Tcl_GetStdChannel".} -proc Gets*(chan: pChannel, dsPtr: pDString): int{.cdecl, dynlib: dllName, - importc: "Tcl_Gets".} -proc Write*(chan: pChannel, s: cstring, slen: int): int{.cdecl, - dynlib: dllName, importc: "Tcl_Write".} -proc Flush*(chan: pChannel): int{.cdecl, dynlib: dllName, - importc: "Tcl_Flush".} - # TclWinLoadLibrary = function(name: PChar): HMODULE; cdecl; external dllName; -proc CreateExitHandler*(prc: TClientDataProc, clientData: TClientData){. - cdecl, dynlib: dllName, importc: "Tcl_CreateExitHandler".} -proc DeleteExitHandler*(prc: TClientDataProc, clientData: TClientData){. - cdecl, dynlib: dllName, importc: "Tcl_DeleteExitHandler".} -proc GetStringFromObj*(pObj: pObj, pLen: pInteger): cstring{.cdecl, - dynlib: dllName, importc: "Tcl_GetStringFromObj".} -proc CreateObjCommand*(interp: pInterp, name: cstring, cmdProc: TObjCmdProc, - clientData: TClientData, - deleteProc: TCmdDeleteProc): pCommand{.cdecl, - dynlib: dllName, importc: "Tcl_CreateObjCommand".} -proc NewStringObj*(bytes: cstring, length: int): pObj{.cdecl, - dynlib: dllName, importc: "Tcl_NewStringObj".} - # procedure TclFreeObj(pObj: pTcl_Obj); cdecl; external dllName; -proc EvalObj*(interp: pInterp, pObj: pObj): int{.cdecl, dynlib: dllName, - importc: "Tcl_EvalObj".} -proc GlobalEvalObj*(interp: pInterp, pObj: pObj): int{.cdecl, - dynlib: dllName, importc: "Tcl_GlobalEvalObj".} -proc RegComp*(exp: cstring): pointer{.cdecl, dynlib: dllName, - importc: "TclRegComp".} - -proc RegExec*(prog: pointer, str: cstring, start: cstring): int{.cdecl, - dynlib: dllName, importc: "TclRegExec".} - -proc RegError*(msg: cstring){.cdecl, dynlib: dllName, importc: "TclRegError".} - -proc GetRegError*(): cstring{.cdecl, dynlib: dllName, - importc: "TclGetRegError".} - -proc RegExpRange*(prog: pointer, index: int, head: var cstring, - tail: var cstring){.cdecl, dynlib: dllName, - importc: "Tcl_RegExpRange".} - -proc GetCommandTable*(interp: pInterp): pHashTable = - if interp != nil: - result = cast[pHashTable](cast[int](interp) + sizeof(Interp) + - sizeof(pointer)) - -proc CreateHashEntry*(tablePtr: pHashTable, key: cstring, - newPtr: pInteger): pHashEntry = - result = cast[pHashTable](tablePtr).createProc(tablePtr, key, newPtr) - -proc FindHashEntry*(tablePtr: pHashTable, key: cstring): pHashEntry = - result = cast[pHashTable](tablePtr).findProc(tablePtr, key) - -proc SetHashValue*(h: pHashEntry, clientData: TClientData) = - h.clientData = clientData - -proc GetHashValue*(h: pHashEntry): TClientData = - result = h.clientData - -proc IncrRefCount*(pObj: pObj) = - inc(pObj.refCount) - -proc DecrRefCount*(pObj: pObj) = - dec(pObj.refCount) - if pObj.refCount <= 0: - dealloc(pObj) - -proc IsShared*(pObj: pObj): bool = - return pObj.refCount > 1 - -proc GetHashKey*(hashTbl: pHashTable, hashEntry: pHashEntry): cstring = - if hashTbl == nil or hashEntry == nil: - result = nil - else: - result = hashEntry.key From dc9e17503ea38ab2b5cf1f7675cae234f2c9dc3a Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Mon, 2 Dec 2013 20:50:56 +0100 Subject: [PATCH 057/326] Makes htmlparser handle whitespace. Refs #694. Without the flag, htmlparser will ignore some significant whitespace in HTML files. A more correct fix would be to not reuse the xml parser since the rules for HTML are slightly different, but this will do for the moment. --- lib/pure/htmlparser.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim index d60d2e5830..7bcc501a7a 100644 --- a/lib/pure/htmlparser.nim +++ b/lib/pure/htmlparser.nim @@ -528,7 +528,7 @@ proc parseHtml*(s: PStream, filename: string, ## parses the XML from stream `s` and returns a ``PXmlNode``. Every ## occured parsing error is added to the `errors` sequence. var x: TXmlParser - open(x, s, filename, {reportComments}) + open(x, s, filename, {reportComments, reportWhitespace}) next(x) # skip the DOCTYPE: if x.kind == xmlSpecial: next(x) From e145231a1d24676da07731a3d57a72dbc62c42a4 Mon Sep 17 00:00:00 2001 From: Erik O'Leary Date: Sun, 1 Dec 2013 17:29:28 -0600 Subject: [PATCH 058/326] Updated cfg file processing No longer look at deprecated file.cfg, compiler will only look at file.nimrod.cfg --- compiler/nimconf.nim | 5 ----- 1 file changed, 5 deletions(-) diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index 507812d9c8..7ec566a01f 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -243,11 +243,6 @@ proc LoadConfigs*(cfg: string) = readConfigFile(pd / cfg) if gProjectName.len != 0: - var conffile = changeFileExt(gProjectFull, "cfg") - if conffile != pd / cfg and existsFile(conffile): - readConfigFile(conffile) - rawMessage(warnConfigDeprecated, conffile) - # new project wide config file: readConfigFile(changeFileExt(gProjectFull, "nimrod.cfg")) From b5ac23477157ed8bcdac854d3ac000ace7aa8942 Mon Sep 17 00:00:00 2001 From: onionhammer Date: Sun, 1 Dec 2013 17:30:09 -0600 Subject: [PATCH 059/326] Renamed nimrod.cfg to nimrod.nimrod.cfg --- compiler/{nimrod.cfg => nimrod.nimrod.cfg} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename compiler/{nimrod.cfg => nimrod.nimrod.cfg} (100%) diff --git a/compiler/nimrod.cfg b/compiler/nimrod.nimrod.cfg similarity index 100% rename from compiler/nimrod.cfg rename to compiler/nimrod.nimrod.cfg From fe983b13099dd8d8a93ebefc00174e98eb048dea Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 3 Dec 2013 01:59:38 +0100 Subject: [PATCH 060/326] fixes a regression where memset was used without including --- compiler/ccgexprs.nim | 6 ++++++ compiler/cgen.nim | 8 ++++++++ compiler/cgendata.nim | 1 + lib/system/gc.nim | 3 +-- tests/reject/twrongiter.nim | 13 +++++++++++++ 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tests/reject/twrongiter.nim diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index c50fd4536c..873c61ed4a 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -240,6 +240,7 @@ proc genGenericAsgn(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = if needToCopy notin flags or tfShallow in skipTypes(dest.t, abstractVarRange).flags: if dest.s == OnStack or not usesNativeGC(): + useStringh(p.module) linefmt(p, cpsStmts, "memcpy((void*)$1, (NIM_CONST void*)$2, sizeof($3));$n", addrLoc(dest), addrLoc(src), rdLoc(dest)) @@ -316,6 +317,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = if needsComplexAssignment(dest.t): genGenericAsgn(p, dest, src, flags) else: + useStringh(p.module) linefmt(p, cpsStmts, "memcpy((void*)$1, (NIM_CONST void*)$2, sizeof($1));$n", rdLoc(dest), rdLoc(src)) @@ -327,11 +329,13 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = "#genericAssignOpenArray((void*)$1, (void*)$2, $1Len0, $3);$n", addrLoc(dest), addrLoc(src), genTypeInfo(p.module, dest.t)) else: + useStringh(p.module) linefmt(p, cpsStmts, "memcpy((void*)$1, (NIM_CONST void*)$2, sizeof($1[0])*$1Len0);$n", rdLoc(dest), rdLoc(src)) of tySet: if mapType(ty) == ctArray: + useStringh(p.module) linefmt(p, cpsStmts, "memcpy((void*)$1, (NIM_CONST void*)$2, $3);$n", rdLoc(dest), rdLoc(src), toRope(getSize(dest.t))) else: @@ -1361,6 +1365,7 @@ proc genSetOp(p: BProc, e: PNode, d: var TLoc, op: TMagic) = lineF(p, cpsStmts, lookupOpr[op], [rdLoc(i), toRope(size), rdLoc(d), rdLoc(a), rdLoc(b)]) of mEqSet: + useStringh(p.module) binaryExprChar(p, e, d, "(memcmp($1, $2, " & $(size) & ")==0)") of mMulSet, mPlusSet, mMinusSet, mSymDiffSet: # we inline the simple for loop for better code generation: @@ -1612,6 +1617,7 @@ proc genSetConstr(p: BProc, e: PNode, d: var TLoc) = if d.k == locNone: getTemp(p, e.typ, d) if getSize(e.typ) > 8: # big set: + useStringh(p.module) lineF(p, cpsStmts, "memset($1, 0, sizeof($1));$n", [rdLoc(d)]) for i in countup(0, sonsLen(e) - 1): if e.sons[i].kind == nkRange: diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 910e675e1c..24d3c2923f 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -72,6 +72,11 @@ proc isSimpleConst(typ: PType): bool = {tyTuple, tyObject, tyArray, tyArrayConstr, tySet, tySequence} and not (t.kind == tyProc and t.callConv == ccClosure) +proc useStringh(m: BModule) = + if not m.includesStringh: + m.includesStringh = true + discard lists.IncludeStr(m.headerFiles, "") + proc useHeader(m: BModule, sym: PSym) = if lfHeader in sym.loc.Flags: assert(sym.annex != nil) @@ -358,6 +363,7 @@ proc resetLoc(p: BProc, loc: var TLoc) = # field, so disabling this should be safe: genObjectInit(p, cpsStmts, loc.t, loc, true) else: + useStringh(p.module) linefmt(p, cpsStmts, "memset((void*)$1, 0, sizeof($2));$n", addrLoc(loc), rdLoc(loc)) # XXX: We can be extra clever here and call memset only @@ -368,6 +374,7 @@ proc constructLoc(p: BProc, loc: TLoc, section = cpsStmts) = if not isComplexValueType(skipTypes(loc.t, abstractRange)): linefmt(p, section, "$1 = 0;$n", rdLoc(loc)) else: + useStringh(p.module) linefmt(p, section, "memset((void*)$1, 0, sizeof($2));$n", addrLoc(loc), rdLoc(loc)) genObjectInit(p, section, loc.t, loc, true) @@ -418,6 +425,7 @@ proc keepAlive(p: BProc, toKeepAlive: TLoc) = if not isComplexValueType(skipTypes(toKeepAlive.t, abstractVarRange)): linefmt(p, cpsStmts, "$1 = $2;$n", rdLoc(result), rdLoc(toKeepAlive)) else: + useStringh(p.module) linefmt(p, cpsStmts, "memcpy((void*)$1, (NIM_CONST void*)$2, sizeof($3));$n", addrLoc(result), addrLoc(toKeepAlive), rdLoc(result)) diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index b5888d0f47..c156c40fe5 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -91,6 +91,7 @@ type FrameDeclared*: bool # hack for ROD support so that we don't declare # a frame var twice in an init proc isHeaderFile*: bool # C source file is the header file + includesStringh*: bool # C source file already includes ```` cfilename*: string # filename of the module (including path, # without extension) typeCache*: TIdTable # cache the generated types diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 48705db96a..d2b065d6bd 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -629,8 +629,7 @@ proc doOperation(p: pointer, op: TWalkOp) = case op of waZctDecRef: #if not isAllocatedPtr(gch.region, c): - # return - # c_fprintf(c_stdout, "[GC] decref bug: %p", c) + # c_fprintf(c_stdout, "[GC] decref bug: %p", c) gcAssert(isAllocatedPtr(gch.region, c), "decRef: waZctDecRef") gcAssert(c.refcount >=% rcIncrement, "doOperation 2") #c.refcount = c.refcount -% rcIncrement diff --git a/tests/reject/twrongiter.nim b/tests/reject/twrongiter.nim new file mode 100644 index 0000000000..2d2502a6a9 --- /dev/null +++ b/tests/reject/twrongiter.nim @@ -0,0 +1,13 @@ +discard """ +line: 14 +errormsg: "type mismatch" +""" + +proc first(it: iterator(): int): seq[int] = + return @[] + +iterator primes(): int = + yield 1 + +for i in first(primes): + break From 4f0eeaa55ef88fc61acf4dc67ddbae47d8fc8052 Mon Sep 17 00:00:00 2001 From: fowlmouth Date: Mon, 2 Dec 2013 23:47:56 -0600 Subject: [PATCH 061/326] fixes compiler.lists.bringToFront --- compiler/lists.nim | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/compiler/lists.nim b/compiler/lists.nim index 67b32f919e..22b1a183ae 100644 --- a/compiler/lists.nim +++ b/compiler/lists.nim @@ -91,13 +91,17 @@ proc Remove*(list: var TLinkedList, entry: PListEntry) = if entry.prev != nil: entry.prev.next = entry.next proc bringToFront*(list: var TLinkedList, entry: PListEntry) = - if entry == list.head: return - if entry == list.tail: list.tail = entry.prev - if entry.next != nil: entry.next.prev = entry.prev - if entry.prev != nil: entry.prev.next = entry.next - entry.prev = nil - entry.next = list.head - list.head = entry + when true: + list.remove entry + list.prepend entry + else: + if entry == list.head: return + if entry == list.tail: list.tail = entry.prev + if entry.next != nil: entry.next.prev = entry.prev + if entry.prev != nil: entry.prev.next = entry.next + entry.prev = nil + entry.next = list.head + list.head = entry proc ExcludeStr*(list: var TLinkedList, data: string) = var it = list.head From dc27f87257cb0385c5dd58714f90a15beab7e87d Mon Sep 17 00:00:00 2001 From: fowlmouth Date: Mon, 2 Dec 2013 23:48:22 -0600 Subject: [PATCH 062/326] removed deprecated libraries from nimrod.cfg --- config/nimrod.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/nimrod.cfg b/config/nimrod.cfg index 77cc742b22..37024f3de9 100644 --- a/config/nimrod.cfg +++ b/config/nimrod.cfg @@ -18,14 +18,14 @@ path="$lib/pure" path="$lib/pure/collections" path="$lib/impure" path="$lib/wrappers" -path="$lib/wrappers/cairo" -path="$lib/wrappers/gtk" -path="$lib/wrappers/lua" -path="$lib/wrappers/opengl" +# path="$lib/wrappers/cairo" +# path="$lib/wrappers/gtk" +# path="$lib/wrappers/lua" +# path="$lib/wrappers/opengl" path="$lib/wrappers/pcre" path="$lib/wrappers/readline" path="$lib/wrappers/sdl" -path="$lib/wrappers/x11" +# path="$lib/wrappers/x11" path="$lib/wrappers/zip" path="$lib/windows" path="$lib/posix" From 5ab3d661440f42f0dc74970ec73a051dd2e2bfb5 Mon Sep 17 00:00:00 2001 From: fowlmouth Date: Tue, 3 Dec 2013 00:14:20 -0600 Subject: [PATCH 063/326] removed windows --- examples/wingui.nim | 9 - lib/windows/mmsystem.nim | 2655 ---- lib/windows/nb30.nim | 232 - lib/windows/ole2.nim | 208 - lib/windows/psapi.nim | 202 - lib/windows/shellapi.nim | 863 -- lib/windows/shfolder.nim | 93 - lib/windows/windows.nim | 23945 ------------------------------------- 8 files changed, 28207 deletions(-) delete mode 100644 examples/wingui.nim delete mode 100644 lib/windows/mmsystem.nim delete mode 100644 lib/windows/nb30.nim delete mode 100644 lib/windows/ole2.nim delete mode 100644 lib/windows/psapi.nim delete mode 100644 lib/windows/shellapi.nim delete mode 100644 lib/windows/shfolder.nim delete mode 100644 lib/windows/windows.nim diff --git a/examples/wingui.nim b/examples/wingui.nim deleted file mode 100644 index 2c2c387bbe..0000000000 --- a/examples/wingui.nim +++ /dev/null @@ -1,9 +0,0 @@ -# test a Windows GUI application - -import - windows, shellapi, nb30, mmsystem, shfolder - -#proc MessageBox(hWnd: int, lpText, lpCaption: CString, uType: uint): int -# {stdcall, import: "MessageBox", header: ""} - -discard MessageBox(0, "Hello World!", "Nimrod GUI Application", 0) diff --git a/lib/windows/mmsystem.nim b/lib/windows/mmsystem.nim deleted file mode 100644 index 91279a5ef3..0000000000 --- a/lib/windows/mmsystem.nim +++ /dev/null @@ -1,2655 +0,0 @@ -# -# -# 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 -#******************************* - -{.deadCodeElim: on.} - -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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] - dwFormats*: DWORD - wChannels*: int16 - wReserved1*: int16 - dwSupport*: DWORD - - PWAVEOUTCAPSW* = ptr WAVEOUTCAPSW - NPWAVEOUTCAPSW* = ptr WAVEOUTCAPSW - LPWAVEOUTCAPSW* = ptr WAVEOUTCAPSW - TWAVEOUTCAPSW* = WAVEOUTCAPSW - -when defined(UNICODE): - type - WAVEOUTCAPS* = WAVEOUTCAPSW - PWAVEOUTCAPS* = PWAVEOUTCAPSW - NPWAVEOUTCAPS* = NPWAVEOUTCAPSW - LPWAVEOUTCAPS* = LPWAVEOUTCAPSW -else: - type - WAVEOUTCAPS* = WAVEOUTCAPSA - PWAVEOUTCAPS* = PWAVEOUTCAPSA - NPWAVEOUTCAPS* = NPWAVEOUTCAPSA - LPWAVEOUTCAPS* = LPWAVEOUTCAPSA -type - TWAVEOUTCAPS* = WAVEOUTCAPS - WAVEINCAPSA* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), CHAR] - dwFormats*: DWORD - wChannels*: int16 - wReserved1*: int16 - - PWAVEINCAPSA* = ptr WAVEINCAPSA - NPWAVEINCAPSA* = ptr WAVEINCAPSA - LPWAVEINCAPSA* = ptr WAVEINCAPSA - TWAVEINCAPSA* = WAVEINCAPSA - WAVEINCAPSW* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] - dwFormats*: DWORD - wChannels*: int16 - wReserved1*: int16 - - PWAVEINCAPSW* = ptr WAVEINCAPSW - NPWAVEINCAPSW* = ptr WAVEINCAPSW - LPWAVEINCAPSW* = ptr WAVEINCAPSW - TWAVEINCAPSW* = WAVEINCAPSW - -when defined(UNICODE): - type - WAVEINCAPS* = WAVEINCAPSW - PWAVEINCAPS* = PWAVEINCAPSW - NPWAVEINCAPS* = NPWAVEINCAPSW - LPWAVEINCAPS* = LPWAVEINCAPSW -else: - type - WAVEINCAPS* = WAVEINCAPSA - PWAVEINCAPS* = PWAVEINCAPSA - NPWAVEINCAPS* = NPWAVEINCAPSA - LPWAVEINCAPS* = LPWAVEINCAPSA -type - TWAVEINCAPS* = WAVEINCAPS - waveformat* {.final.} = object - wFormatTag*: int16 - nChannels*: int16 - nSamplesPerSec*: DWORD - nAvgBytesPerSec*: DWORD - nBlockAlign*: int16 - - PWAVEFORMAT* = ptr waveformat - NPWAVEFORMAT* = ptr waveformat - LPWAVEFORMAT* = ptr waveformat - TWAVEFORMAT* = waveformat - -const - WAVE_FORMAT_PCM* = 1 - -type - pcmwaveformat* {.final.} = object - wf*: WAVEFORMAT - wBitsPerSample*: int16 - - PPCMWAVEFORMAT* = ptr pcmwaveformat - NPPCMWAVEFORMAT* = ptr pcmwaveformat - LPPCMWAVEFORMAT* = ptr pcmwaveformat - TPCMWAVEFORMAT* = PCMWAVEFORMAT - WAVEFORMATEX* {.final.} = object - wFormatTag*: int16 - nChannels*: int16 - nSamplesPerSec*: DWORD - nAvgBytesPerSec*: DWORD - nBlockAlign*: int16 - wBitsPerSample*: int16 - cbSize*: int16 - - PWAVEFORMATEX* = ptr WAVEFORMATEX - NPWAVEFORMATEX* = ptr WAVEFORMATEX - LPWAVEFORMATEX* = ptr WAVEFORMATEX - LPCWAVEFORMATEX* = ptr WAVEFORMATEX - TWAVEFORMATEX* = WAVEFORMATEX - HMIDI* = 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* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), CHAR] - wTechnology*: int16 - wVoices*: int16 - wNotes*: int16 - wChannelMask*: int16 - dwSupport*: DWORD - - PMIDIOUTCAPSA* = ptr MIDIOUTCAPSA - NPMIDIOUTCAPSA* = ptr MIDIOUTCAPSA - LPMIDIOUTCAPSA* = ptr MIDIOUTCAPSA - TMIDIOUTCAPSA* = MIDIOUTCAPSA - MIDIOUTCAPSW* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] - wTechnology*: int16 - wVoices*: int16 - wNotes*: int16 - wChannelMask*: int16 - dwSupport*: DWORD - - PMIDIOUTCAPSW* = ptr MIDIOUTCAPSW - NPMIDIOUTCAPSW* = ptr MIDIOUTCAPSW - LPMIDIOUTCAPSW* = ptr MIDIOUTCAPSW - TMIDIOUTCAPSW* = MIDIOUTCAPSW - MIDIINCAPSA* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), CHAR] - dwSupport*: DWORD - - PMIDIINCAPSA* = ptr MIDIINCAPSA - NPMIDIINCAPSA* = ptr MIDIINCAPSA - LPMIDIINCAPSA* = ptr MIDIINCAPSA - TMIDIINCAPSA* = MIDIINCAPSA - MIDIINCAPSW* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] - dwSupport*: DWORD - - PMIDIINCAPSW* = ptr MIDIINCAPSW - NPMIDIINCAPSW* = ptr MIDIINCAPSW - LPMIDIINCAPSW* = ptr MIDIINCAPSW - TMIDIINCAPSW* = MIDIINCAPSW - -when defined(UNICODE): - type - MIDIINCAPS* = MIDIINCAPSW - PMIDIINCAPS* = PMIDIINCAPSW - NPMIDIINCAPS* = NPMIDIINCAPSW - LPMIDIINCAPS* = LPMIDIINCAPSW - MIDIOUTCAPS* = MIDIOUTCAPSW - PMIDIOUTCAPS* = PMIDIOUTCAPSW - NPMIDIOUTCAPS* = NPMIDIOUTCAPSW - LPMIDIOUTCAPS* = LPMIDIOUTCAPSW -else: - type - MIDIOUTCAPS* = MIDIOUTCAPSA - PMIDIOUTCAPS* = PMIDIOUTCAPSA - NPMIDIOUTCAPS* = NPMIDIOUTCAPSA - LPMIDIOUTCAPS* = LPMIDIOUTCAPSA - MIDIINCAPS* = MIDIINCAPSA - PMIDIINCAPS* = PMIDIINCAPSA - NPMIDIINCAPS* = NPMIDIINCAPSA - LPMIDIINCAPS* = LPMIDIINCAPSA -type - TMIDIINCAPS* = MIDIINCAPS - PMIDIHDR* = ptr midihdr - midihdr* {.final.} = object - lpData*: cstring - dwBufferLength*: DWORD - dwBytesRecorded*: DWORD - dwUser*: DWORD - dwFlags*: DWORD - lpNext*: PMIDIHDR - reserved*: DWORD - dwOffset*: DWORD - dwReserved*: array[0..Pred(8), DWORD] - - NPMIDIHDR* = ptr midihdr - LPMIDIHDR* = ptr midihdr - TMIDIHDR* = MIDIHDR - midievent* {.final.} = object - dwDeltaTime*: DWORD - dwStreamID*: DWORD - dwEvent*: DWORD - dwParms*: array[0..Pred(1), DWORD] - - TMIDIEVENT* = MIDIEVENT - midistrmbuffver* {.final.} = object - dwVersion*: DWORD - dwMid*: DWORD - dwOEMVersion*: DWORD - - TMIDISTRMBUFFVER* = MIDISTRMBUFFVER - Tmidiproptimediv* {.final.} = object - cbStruct*: DWORD - dwTimeDiv*: DWORD - - LPMIDIPROPTIMEDIV* = ptr Tmidiproptimediv - Tmidiproptempo* {.final.} = object - cbStruct*: DWORD - dwTempo*: DWORD - - LPMIDIPROPTEMPO* = ptr Tmidiproptempo - AUXCAPSA* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), CHAR] - wTechnology*: int16 - wReserved1*: int16 - dwSupport*: DWORD - - PAUXCAPSA* = ptr AUXCAPSA - NPAUXCAPSA* = ptr AUXCAPSA - LPAUXCAPSA* = ptr AUXCAPSA - TAUXCAPSA* = AUXCAPSA - AUXCAPSW* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] - wTechnology*: int16 - wReserved1*: int16 - dwSupport*: DWORD - - PAUXCAPSW* = ptr AUXCAPSW - NPAUXCAPSW* = ptr AUXCAPSW - LPAUXCAPSW* = ptr AUXCAPSW - TAUXCAPSW* = AUXCAPSW - -when defined(UNICODE): - type - AUXCAPS* = AUXCAPSW - PAUXCAPS* = PAUXCAPSW - NPAUXCAPS* = NPAUXCAPSW - LPAUXCAPS* = LPAUXCAPSW -else: - type - AUXCAPS* = AUXCAPSA - PAUXCAPS* = PAUXCAPSA - NPAUXCAPS* = NPAUXCAPSA - LPAUXCAPS* = LPAUXCAPSA -type - TAUXCAPS* = AUXCAPS - HMIXEROBJ* = THandle - LPHMIXEROBJ* = ptr HMIXEROBJ - HMIXER* = THandle - LPHMIXER* = ptr HMIXER - -proc mixerGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll", - importc: "mixerGetNumDevs".} -type - MIXERCAPSA* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), CHAR] - fdwSupport*: DWORD - cDestinations*: DWORD - - PMIXERCAPSA* = ptr MIXERCAPSA - LPMIXERCAPSA* = ptr MIXERCAPSA - TMIXERCAPSA* = MIXERCAPSA - MIXERCAPSW* {.final.} = object - wMid*: int16 - wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] - fdwSupport*: DWORD - cDestinations*: DWORD - - PMIXERCAPSW* = ptr MIXERCAPSW - LPMIXERCAPSW* = ptr MIXERCAPSW - TMIXERCAPSW* = MIXERCAPSW - -when defined(UNICODE): - type - MIXERCAPS* = MIXERCAPSW - PMIXERCAPS* = PMIXERCAPSW - LPMIXERCAPS* = LPMIXERCAPSW -else: - type - MIXERCAPS* = MIXERCAPSA - PMIXERCAPS* = PMIXERCAPSA - LPMIXERCAPS* = LPMIXERCAPSA -type - TMIXERCAPS* = MIXERCAPS - MIXERLINEA* {.final.} = object - cbStruct*: DWORD - dwDestination*: DWORD - dwSource*: DWORD - dwLineID*: DWORD - fdwLine*: DWORD - dwUser*: DWORD - dwComponentType*: DWORD - cChannels*: DWORD - cConnections*: DWORD - cControls*: DWORD - szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR] - szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR] - dwType*, dwDeviceID*: DWORD - wMid*, wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..pred(MAXPNAMELEN), Char] - - PMIXERLINEA* = ptr MIXERLINEA - LPMIXERLINEA* = ptr MIXERLINEA - TMIXERLINEA* = MIXERLINEA - MIXERLINEW* {.final.} = object - cbStruct*: DWORD - dwDestination*: DWORD - dwSource*: DWORD - dwLineID*: DWORD - fdwLine*: DWORD - dwUser*: DWORD - dwComponentType*: DWORD - cChannels*: DWORD - cConnections*: DWORD - cControls*: DWORD - szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR] - szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR] - dwType*, dwDeviceID*: DWORD - wMid*, wPid*: int16 - vDriverVersion*: MMVERSION - szPname*: array[0..pred(MAXPNAMELEN), WChar] - - TMIXERLINEW* = MIXERLINEW - PMIXERLINEW* = ptr MIXERLINEW - LPMIXERLINEW* = ptr MIXERLINEW - -when defined(UNICODE): - type - MIXERLINE* = MIXERLINEW - PMIXERLINE* = PMIXERLINEW - LPMIXERLINE* = LPMIXERLINEW -else: - type - MIXERLINE* = MIXERLINEA - PMIXERLINE* = PMIXERLINEA - LPMIXERLINE* = LPMIXERLINEA -type - TMIXERLINE* = MIXERLINE - MIXERCONTROLA* {.final.} = object - cbStruct*: DWORD - dwControlID*: DWORD - dwControlType*: DWORD - fdwControl*: DWORD - cMultipleItems*: DWORD - szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR] - szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR] - dwMinimum*, dwMaximum*: DWORD - dwReserved*: array[0..3, DWORD] - cSteps*: DWORD - dwReserved2*: array[0..4, DWORD] - - PMIXERCONTROLA* = ptr MIXERCONTROLA - LPMIXERCONTROLA* = ptr MIXERCONTROLA - TMIXERCONTROLA* = MIXERCONTROLA - MIXERCONTROLW* {.final.} = object - cbStruct*: DWORD - dwControlID*: DWORD - dwControlType*: DWORD - fdwControl*: DWORD - cMultipleItems*: DWORD - szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR] - szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR] - dwMinimum*, dwMaximum*: DWORD - dwReserved*: array[0..3, DWORD] - cSteps*: DWORD - dwReserved2*: array[0..4, DWORD] - - PMIXERCONTROLW* = ptr MIXERCONTROLW - LPMIXERCONTROLW* = ptr MIXERCONTROLW - TMIXERCONTROLW* = MIXERCONTROLW - -when defined(UNICODE): - type - MIXERCONTROL* = MIXERCONTROLW - PMIXERCONTROL* = PMIXERCONTROLW - LPMIXERCONTROL* = LPMIXERCONTROLW -else: - type - MIXERCONTROL* = MIXERCONTROLA - PMIXERCONTROL* = PMIXERCONTROLA - LPMIXERCONTROL* = LPMIXERCONTROLA -type - TMIXERCONTROL* = MIXERCONTROL - MIXERLINECONTROLSA* {.final.} = object - cbStruct*: DWORD - dwLineID*: DWORD - dwControlType*, cControls*, cbmxctrl*: DWORD - pamxctrl*: PMIXERCONTROLA - - PMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA - LPMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA - TMIXERLINECONTROLSA* = MIXERLINECONTROLSA - MIXERLINECONTROLSW* {.final.} = object - cbStruct*: DWORD - dwLineID*: DWORD - dwControlType*, cControls*, cbmxctrl*: DWORD - pamxctrl*: PMIXERCONTROLW - - PMIXERLINECONTROLSW* = ptr MIXERLINECONTROLSW - LPMIXERLINECONTROLSW* = ptr MIXERLINECONTROLSW - TMIXERLINECONTROLSW* = MIXERLINECONTROLSW - -when defined(UNICODE): - type - MIXERLINECONTROLS* = MIXERLINECONTROLSW - PMIXERLINECONTROLS* = PMIXERLINECONTROLSW - LPMIXERLINECONTROLS* = LPMIXERLINECONTROLSW -else: - type - MIXERLINECONTROLS* = MIXERLINECONTROLSA - PMIXERLINECONTROLS* = PMIXERLINECONTROLSA - LPMIXERLINECONTROLS* = LPMIXERLINECONTROLSA -type - TMIXERLINECONTROLS* = MIXERLINECONTROLS - TMIXERCONTROLDETAILS* {.final.} = object - cbStruct*: DWORD - dwControlID*: DWORD - cChannels*: DWORD - cMultipleItems*, cbDetails*: DWORD - paDetails*: Pointer - - MIXERCONTROLDETAILS* = tMIXERCONTROLDETAILS - PMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS - LPMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS - MIXERCONTROLDETAILS_LISTTEXTA* {.final.} = object - dwParam1*: DWORD - dwParam2*: DWORD - szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR] - - PMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA - LPMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA - TMIXERCONTROLDETAILS_LISTTEXTA* = MIXERCONTROLDETAILS_LISTTEXTA - MIXERCONTROLDETAILS_LISTTEXTW* {.final.} = object - dwParam1*: DWORD - dwParam2*: DWORD - szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR] - - PMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW - LPMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW - TMIXERCONTROLDETAILS_LISTTEXTW* = MIXERCONTROLDETAILS_LISTTEXTW - -when defined(UNICODE): - type - MIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXTW - PMIXERCONTROLDETAILS_LISTTEXT* = PMIXERCONTROLDETAILS_LISTTEXTW - LPMIXERCONTROLDETAILS_LISTTEXT* = LPMIXERCONTROLDETAILS_LISTTEXTW -else: - type - MIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXTA - PMIXERCONTROLDETAILS_LISTTEXT* = PMIXERCONTROLDETAILS_LISTTEXTA - LPMIXERCONTROLDETAILS_LISTTEXT* = LPMIXERCONTROLDETAILS_LISTTEXTA -type - TMIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXT - MIXERCONTROLDETAILS_BOOLEAN* {.final.} = object - fValue*: int32 - - PMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN - LPMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN - TMIXERCONTROLDETAILS_BOOLEAN* = MIXERCONTROLDETAILS_BOOLEAN - MIXERCONTROLDETAILS_SIGNED* {.final.} = object - lValue*: int32 - - PMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED - LPMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED - TMIXERCONTROLDETAILS_SIGNED* = MIXERCONTROLDETAILS_SIGNED - MIXERCONTROLDETAILS_UNSIGNED* {.final.} = object - dwValue*: DWORD - - PMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED - LPMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED - TMIXERCONTROLDETAILS_UNSIGNED* = MIXERCONTROLDETAILS_UNSIGNED - LPTIMECALLBACK* = proc (uTimerID, uMsg: UINT, dwUser, dw1, dw2: DWORD){. - stdcall.} - TTIMECALLBACK* = LPTIMECALLBACK - timecaps* {.final.} = object - wPeriodMin*: UINT - wPeriodMax*: UINT - - PTIMECAPS* = ptr timecaps - NPTIMECAPS* = ptr timecaps - LPTIMECAPS* = ptr timecaps - TTIMECAS* = TIMECAPS - JOYCAPSA* {.final.} = object - wMid*: int16 - wPid*: int16 - szPname*: array[0..Pred(MAXPNAMELEN), CHAR] - wXmin*: 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* {.final.} = object - 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* {.final.} = object - wXpos*: UINT - wYpos*: UINT - wZpos*: UINT - wButtons*: UINT - - PJOYINFO* = ptr joyinfo - NPJOYINFO* = ptr joyinfo - LPJOYINFO* = ptr joyinfo - TJOYINFO* = JOYINFO - joyinfoex* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - ckid*: FOURCC - cksize*: DWORD - fccType*: FOURCC - dwDataOffset*: DWORD - dwFlags*: DWORD - - PMMCKINFO* = ptr MMCKINFO - NPMMCKINFO* = ptr MMCKINFO - LPMMCKINFO* = ptr MMCKINFO - LPCMMCKINFO* = ptr MMCKINFO - TMMCKINFO* = MMCKINFO - MCIERROR* = DWORD - MCIDEVICEID* = UINT - YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): UINT{.stdcall.} - TYIELDPROC* = YIELDPROC - MCI_GENERIC_PARMS* {.final.} = object - dwCallback*: DWORD - - PMCI_GENERIC_PARMS* = ptr MCI_GENERIC_PARMS - LPMCI_GENERIC_PARMS* = ptr MCI_GENERIC_PARMS - TMCI_GENERIC_PARMS* = MCI_GENERIC_PARMS - MCI_OPEN_PARMSA* {.final.} = object - dwCallback*: DWORD - wDeviceID*: MCIDEVICEID - lpstrDeviceType*: LPCSTR - lpstrElementName*: LPCSTR - lpstrAlias*: LPCSTR - - PMCI_OPEN_PARMSA* = ptr MCI_OPEN_PARMSA - LPMCI_OPEN_PARMSA* = ptr MCI_OPEN_PARMSA - TMCI_OPEN_PARMSA* = MCI_OPEN_PARMSA - MCI_OPEN_PARMSW* {.final.} = object - dwCallback*: DWORD - wDeviceID*: MCIDEVICEID - lpstrDeviceType*: LPCWSTR - lpstrElementName*: LPCWSTR - lpstrAlias*: LPCWSTR - - PMCI_OPEN_PARMSW* = ptr MCI_OPEN_PARMSW - LPMCI_OPEN_PARMSW* = ptr MCI_OPEN_PARMSW - TMCI_OPEN_PARMSW* = MCI_OPEN_PARMSW - -when defined(UNICODE): - type - MCI_OPEN_PARMS* = MCI_OPEN_PARMSW - PMCI_OPEN_PARMS* = PMCI_OPEN_PARMSW - LPMCI_OPEN_PARMS* = LPMCI_OPEN_PARMSW -else: - type - MCI_OPEN_PARMS* = MCI_OPEN_PARMSA - PMCI_OPEN_PARMS* = PMCI_OPEN_PARMSA - LPMCI_OPEN_PARMS* = LPMCI_OPEN_PARMSA -type - TMCI_OPEN_PARMS* = MCI_OPEN_PARMS - MCI_PLAY_PARMS* {.final.} = object - dwCallback*: DWORD - dwFrom*: DWORD - dwTo*: DWORD - - PMCI_PLAY_PARMS* = ptr MCI_PLAY_PARMS - LPMCI_PLAY_PARMS* = ptr MCI_PLAY_PARMS - TMCI_PLAY_PARMS* = MCI_PLAY_PARMS - MCI_SEEK_PARMS* {.final.} = object - dwCallback*: DWORD - dwTo*: DWORD - - PMCI_SEEK_PARMS* = ptr MCI_SEEK_PARMS - LPMCI_SEEK_PARMS* = ptr MCI_SEEK_PARMS - TMCI_SEEK_PARMS* = MCI_SEEK_PARMS - MCI_STATUS_PARMS* {.final.} = object - dwCallback*: DWORD - dwReturn*: DWORD - dwItem*: DWORD - dwTrack*: DWORD - - PMCI_STATUS_PARMS* = ptr MCI_STATUS_PARMS - LPMCI_STATUS_PARMS* = ptr MCI_STATUS_PARMS - TMCI_STATUS_PARMS* = MCI_STATUS_PARMS - MCI_INFO_PARMSA* {.final.} = object - dwCallback*: DWORD - lpstrReturn*: cstring - dwRetSize*: DWORD - - LPMCI_INFO_PARMSA* = ptr MCI_INFO_PARMSA - TMCI_INFO_PARMSA* = MCI_INFO_PARMSA - MCI_INFO_PARMSW* {.final.} = object - dwCallback*: DWORD - lpstrReturn*: LPWSTR - dwRetSize*: DWORD - - LPMCI_INFO_PARMSW* = ptr MCI_INFO_PARMSW - TMCI_INFO_PARMSW* = MCI_INFO_PARMSW - -when defined(UNICODE): - type - MCI_INFO_PARMS* = MCI_INFO_PARMSW - LPMCI_INFO_PARMS* = LPMCI_INFO_PARMSW -else: - type - MCI_INFO_PARMS* = MCI_INFO_PARMSA - LPMCI_INFO_PARMS* = LPMCI_INFO_PARMSA -type - TMCI_INFO_PARMS* = MCI_INFO_PARMS - MCI_GETDEVCAPS_PARMS* {.final.} = object - dwCallback*: DWORD - dwReturn*: DWORD - dwItem*: DWORD - - PMCI_GETDEVCAPS_PARMS* = ptr MCI_GETDEVCAPS_PARMS - LPMCI_GETDEVCAPS_PARMS* = ptr MCI_GETDEVCAPS_PARMS - TMCI_GETDEVCAPS_PARMS* = MCI_GETDEVCAPS_PARMS - MCI_SYSINFO_PARMSA* {.final.} = object - dwCallback*: DWORD - lpstrReturn*: cstring - dwRetSize*: DWORD - dwNumber*: DWORD - wDeviceType*: UINT - - PMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA - LPMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA - TMCI_SYSINFO_PARMSA* = MCI_SYSINFO_PARMSA - MCI_SYSINFO_PARMSW* {.final.} = object - dwCallback*: DWORD - lpstrReturn*: LPWSTR - dwRetSize*: DWORD - dwNumber*: DWORD - wDeviceType*: 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* {.final.} = object - dwCallback*: DWORD - dwTimeFormat*: DWORD - dwAudio*: DWORD - - PMCI_SET_PARMS* = ptr MCI_SET_PARMS - LPMCI_SET_PARMS* = ptr MCI_SET_PARMS - TMCI_SET_PARMS* = MCI_SET_PARMS - MCI_BREAK_PARMS* {.final.} = object - dwCallback*: DWORD - nVirtKey*: int32 - hwndBreak*: HWND - - PMCI_BREAK_PARMS* = ptr MCI_BREAK_PARMS - LPMCI_BREAK_PARMS* = ptr MCI_BREAK_PARMS - TMCI_BREAK_PARMS* = MCI_BREAK_PARMS - MCI_SAVE_PARMSA* {.final.} = object - dwCallback*: DWORD - lpfilename*: LPCSTR - - PMCI_SAVE_PARMSA* = ptr MCI_SAVE_PARMSA - LPMCI_SAVE_PARMSA* = ptr MCI_SAVE_PARMSA - TMCI_SAVE_PARMSA* = MCI_SAVE_PARMSA - MCI_SAVE_PARMSW* {.final.} = object - dwCallback*: DWORD - lpfilename*: LPCWSTR - - PMCI_SAVE_PARMSW* = ptr MCI_SAVE_PARMSW - LPMCI_SAVE_PARMSW* = ptr MCI_SAVE_PARMSW - TMCI_SAVE_PARMSW* = MCI_SAVE_PARMSW - -when defined(UNICODE): - type - MCI_SAVE_PARMS* = MCI_SAVE_PARMSW - PMCI_SAVE_PARMS* = PMCI_SAVE_PARMSW - LPMCI_SAVE_PARMS* = LPMCI_SAVE_PARMSW -else: - type - MCI_SAVE_PARMS* = MCI_SAVE_PARMSA - PMCI_SAVE_PARMS* = PMCI_SAVE_PARMSA - LPMCI_SAVE_PARMS* = LPMCI_SAVE_PARMSA -type - TMCI_SAVE_PARMS* = MCI_SAVE_PARMS - MCI_LOAD_PARMSA* {.final.} = object - dwCallback*: DWORD - lpfilename*: LPCSTR - - PMCI_LOAD_PARMSA* = ptr MCI_LOAD_PARMSA - LPMCI_LOAD_PARMSA* = ptr MCI_LOAD_PARMSA - TMCI_LOAD_PARMSA* = MCI_LOAD_PARMSA - MCI_LOAD_PARMSW* {.final.} = object - dwCallback*: DWORD - lpfilename*: LPCWSTR - - PMCI_LOAD_PARMSW* = ptr MCI_LOAD_PARMSW - LPMCI_LOAD_PARMSW* = ptr MCI_LOAD_PARMSW - TMCI_LOAD_PARMSW* = MCI_LOAD_PARMSW - -when defined(UNICODE): - type - MCI_LOAD_PARMS* = MCI_LOAD_PARMSW - PMCI_LOAD_PARMS* = PMCI_LOAD_PARMSW - LPMCI_LOAD_PARMS* = LPMCI_LOAD_PARMSW -else: - type - MCI_LOAD_PARMS* = MCI_LOAD_PARMSA - PMCI_LOAD_PARMS* = PMCI_LOAD_PARMSA - LPMCI_LOAD_PARMS* = LPMCI_LOAD_PARMSA -type - TMCI_LOAD_PARMS* = MCI_LOAD_PARMS - MCI_RECORD_PARMS* {.final.} = object - dwCallback*: DWORD - dwFrom*: DWORD - dwTo*: DWORD - - LPMCI_RECORD_PARMS* = ptr MCI_RECORD_PARMS - TMCI_RECORD_PARMS* = MCI_RECORD_PARMS - MCI_VD_PLAY_PARMS* {.final.} = object - dwCallback*: DWORD - dwFrom*: DWORD - dwTo*: DWORD - dwSpeed*: DWORD - - PMCI_VD_PLAY_PARMS* = ptr MCI_VD_PLAY_PARMS - LPMCI_VD_PLAY_PARMS* = ptr MCI_VD_PLAY_PARMS - TMCI_VD_PLAY_PARMS* = MCI_VD_PLAY_PARMS - MCI_VD_STEP_PARMS* {.final.} = object - dwCallback*: DWORD - dwFrames*: DWORD - - PMCI_VD_STEP_PARMS* = ptr MCI_VD_STEP_PARMS - LPMCI_VD_STEP_PARMS* = ptr MCI_VD_STEP_PARMS - MCI_VD_ESCAPE_PARMSA* {.final.} = object - dwCallback*: DWORD - lpstrCommand*: LPCSTR - - PMCI_VD_ESCAPE_PARMSA* = ptr MCI_VD_ESCAPE_PARMSA - LPMCI_VD_ESCAPE_PARMSA* = ptr MCI_VD_ESCAPE_PARMSA - TMCI_VD_ESCAPE_PARMSA* = MCI_VD_ESCAPE_PARMSA - MCI_VD_ESCAPE_PARMSW* {.final.} = object - dwCallback*: DWORD - lpstrCommand*: LPCWSTR - - PMCI_VD_ESCAPE_PARMSW* = ptr MCI_VD_ESCAPE_PARMSW - LPMCI_VD_ESCAPE_PARMSW* = ptr MCI_VD_ESCAPE_PARMSW - TMCI_VD_ESCAPE_PARMSW* = MCI_VD_ESCAPE_PARMSW - -when defined(UNICODE): - type - MCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMSW - PMCI_VD_ESCAPE_PARMS* = PMCI_VD_ESCAPE_PARMSW - LPMCI_VD_ESCAPE_PARMS* = LPMCI_VD_ESCAPE_PARMSW -else: - type - MCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMSA - PMCI_VD_ESCAPE_PARMS* = PMCI_VD_ESCAPE_PARMSA - LPMCI_VD_ESCAPE_PARMS* = LPMCI_VD_ESCAPE_PARMSA -type - TMCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMS - MCI_WAVE_OPEN_PARMSA* {.final.} = object - dwCallback*: DWORD - wDeviceID*: MCIDEVICEID - lpstrDeviceType*: LPCSTR - lpstrElementName*: LPCSTR - lpstrAlias*: LPCSTR - dwBufferSeconds*: DWORD - - PMCI_WAVE_OPEN_PARMSA* = ptr MCI_WAVE_OPEN_PARMSA - LPMCI_WAVE_OPEN_PARMSA* = ptr MCI_WAVE_OPEN_PARMSA - TMCI_WAVE_OPEN_PARMSA* = MCI_WAVE_OPEN_PARMSA - MCI_WAVE_OPEN_PARMSW* {.final.} = object - dwCallback*: DWORD - wDeviceID*: MCIDEVICEID - lpstrDeviceType*: LPCWSTR - lpstrElementName*: LPCWSTR - lpstrAlias*: LPCWSTR - dwBufferSeconds*: DWORD - - PMCI_WAVE_OPEN_PARMSW* = ptr MCI_WAVE_OPEN_PARMSW - LPMCI_WAVE_OPEN_PARMSW* = ptr MCI_WAVE_OPEN_PARMSW - TMCI_WAVE_OPEN_PARMSW* = MCI_WAVE_OPEN_PARMSW - -when defined(UNICODE): - type - MCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMSW - PMCI_WAVE_OPEN_PARMS* = PMCI_WAVE_OPEN_PARMSW - LPMCI_WAVE_OPEN_PARMS* = LPMCI_WAVE_OPEN_PARMSW -else: - type - MCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMSA - PMCI_WAVE_OPEN_PARMS* = PMCI_WAVE_OPEN_PARMSA - LPMCI_WAVE_OPEN_PARMS* = LPMCI_WAVE_OPEN_PARMSA -type - TMCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMS - MCI_WAVE_DELETE_PARMS* {.final.} = object - dwCallback*: DWORD - dwFrom*: DWORD - dwTo*: DWORD - - PMCI_WAVE_DELETE_PARMS* = ptr MCI_WAVE_DELETE_PARMS - LPMCI_WAVE_DELETE_PARMS* = ptr MCI_WAVE_DELETE_PARMS - TMCI_WAVE_DELETE_PARMS* = MCI_WAVE_DELETE_PARMS - MCI_WAVE_SET_PARMS* {.final.} = object - dwCallback*: DWORD - dwTimeFormat*: DWORD - dwAudio*: DWORD - wInput*: 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* {.final.} = object - dwCallback*: DWORD - dwTimeFormat*: DWORD - dwAudio*: DWORD - dwTempo*: DWORD - dwPort*: DWORD - dwSlave*: DWORD - dwMaster*: DWORD - dwOffset*: DWORD - - PMCI_SEQ_SET_PARMS* = ptr MCI_SEQ_SET_PARMS - LPMCI_SEQ_SET_PARMS* = ptr MCI_SEQ_SET_PARMS - TMCI_SEQ_SET_PARMS* = MCI_SEQ_SET_PARMS - MCI_ANIM_OPEN_PARMSA* {.final.} = object - dwCallback*: DWORD - wDeviceID*: MCIDEVICEID - lpstrDeviceType*: LPCSTR - lpstrElementName*: LPCSTR - lpstrAlias*: LPCSTR - dwStyle*: DWORD - hWndParent*: HWND - - PMCI_ANIM_OPEN_PARMSA* = ptr MCI_ANIM_OPEN_PARMSA - LPMCI_ANIM_OPEN_PARMSA* = ptr MCI_ANIM_OPEN_PARMSA - TMCI_ANIM_OPEN_PARMSA* = MCI_ANIM_OPEN_PARMSA - MCI_ANIM_OPEN_PARMSW* {.final.} = object - dwCallback*: DWORD - wDeviceID*: MCIDEVICEID - lpstrDeviceType*: LPCWSTR - lpstrElementName*: LPCWSTR - lpstrAlias*: LPCWSTR - dwStyle*: DWORD - hWndParent*: HWND - - PMCI_ANIM_OPEN_PARMSW* = ptr MCI_ANIM_OPEN_PARMSW - LPMCI_ANIM_OPEN_PARMSW* = ptr MCI_ANIM_OPEN_PARMSW - -when defined(UNICODE): - type - MCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMSW - PMCI_ANIM_OPEN_PARMS* = PMCI_ANIM_OPEN_PARMSW - LPMCI_ANIM_OPEN_PARMS* = LPMCI_ANIM_OPEN_PARMSW -else: - type - MCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMSA - PMCI_ANIM_OPEN_PARMS* = PMCI_ANIM_OPEN_PARMSA - LPMCI_ANIM_OPEN_PARMS* = LPMCI_ANIM_OPEN_PARMSA -type - TMCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMS - MCI_ANIM_WINDOW_PARMSW* {.final.} = object - dwCallback*: DWORD - hWnd*: HWND - nCmdShow*: 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* {.final.} = object - dwCallback*: DWORD - dwFrames*: DWORD - - PMCI_ANIM_STEP_PARMS* = ptr MCI_ANIM_STEP_PARMS - LPMCI_ANIM_STEP_PARMS* = ptr MCI_ANIM_STEP_PARMS - TMCI_ANIM_STEP_PARMS* = MCI_ANIM_STEP_PARMS - MCI_ANIM_WINDOW_PARMSA* {.final.} = object - dwCallback*: DWORD - hWnd*: HWND - nCmdShow*: 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* {.final.} = object - dwCallback*: DWORD - dwFrom*: DWORD - dwTo*: DWORD - dwSpeed*: DWORD - - PMCI_ANIM_PLAY_PARMS* = ptr MCI_ANIM_PLAY_PARMS - LPMCI_ANIM_PLAY_PARMS* = ptr MCI_ANIM_PLAY_PARMS - -when defined(UNICODE): - type - MCI_ANIM_WINDOW_PARMS* = MCI_ANIM_WINDOW_PARMSW - PMCI_ANIM_WINDOW_PARMS* = PMCI_ANIM_WINDOW_PARMSW - LPMCI_ANIM_WINDOW_PARMS* = LPMCI_ANIM_WINDOW_PARMSW -else: - type - MCI_ANIM_WINDOW_PARMS* = MCI_ANIM_WINDOW_PARMSA - PMCI_ANIM_WINDOW_PARMS* = PMCI_ANIM_WINDOW_PARMSA - LPMCI_ANIM_WINDOW_PARMS* = LPMCI_ANIM_WINDOW_PARMSA -type - MCI_ANIM_RECT_PARMS* {.final.} = object - dwCallback*: DWORD - rc*: 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* {.final.} = object - 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* {.final.} = object - dwCallback*: DWORD - wDeviceID*: MCIDEVICEID - lpstrDeviceType*: LPCSTR - lpstrElementName*: LPCSTR - lpstrAlias*: LPCSTR - dwStyle*: DWORD - hWndParent*: HWND - - PMCI_OVLY_OPEN_PARMSA* = ptr MCI_OVLY_OPEN_PARMSA - LPMCI_OVLY_OPEN_PARMSA* = ptr MCI_OVLY_OPEN_PARMSA - TMCI_OVLY_OPEN_PARMSA* = MCI_OVLY_OPEN_PARMSA - MCI_OVLY_OPEN_PARMSW* {.final.} = object - dwCallback*: DWORD - wDeviceID*: MCIDEVICEID - lpstrDeviceType*: LPCWSTR - lpstrElementName*: LPCWSTR - lpstrAlias*: LPCWSTR - dwStyle*: DWORD - hWndParent*: HWND - - PMCI_OVLY_OPEN_PARMSW* = ptr MCI_OVLY_OPEN_PARMSW - LPMCI_OVLY_OPEN_PARMSW* = ptr MCI_OVLY_OPEN_PARMSW - TMCI_OVLY_OPEN_PARMSW* = MCI_OVLY_OPEN_PARMSW - -when defined(UNICODE): - type - MCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMSW - PMCI_OVLY_OPEN_PARMS* = PMCI_OVLY_OPEN_PARMSW - LPMCI_OVLY_OPEN_PARMS* = LPMCI_OVLY_OPEN_PARMSW -else: - type - MCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMSA - PMCI_OVLY_OPEN_PARMS* = PMCI_OVLY_OPEN_PARMSA - LPMCI_OVLY_OPEN_PARMS* = LPMCI_OVLY_OPEN_PARMSA -type - TMCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMS - MCI_OVLY_WINDOW_PARMSA* {.final.} = object - dwCallback*: DWORD - hWnd*: HWND - nCmdShow*: 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - 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 = toU8(x shr 24) - -proc MEVT_EVENTPARM(x: DWORD): DWORD = - result = x And 0x00FFFFFF - -proc MCI_MSF_MINUTE(msf: int32): int8 = - result = toU8(msf and 0xff) - -proc MCI_TMSF_TRACK(tmsf: int32): int8 = - result = toU8(tmsf and 0xff) - -proc MCI_HMS_HOUR(h: int32): int8 = - result = toU8(h and 0xff) - -proc MCI_MSF_SECOND(msf: int32): int8 = - result = toU8(msf shr 8) - -proc MCI_TMSF_MINUTE(tmsf: int32): int8 = - result = toU8(tmsf shr 8) - -proc MCI_HMS_MINUTE(h: int32): int8 = - result = toU8(h shr 8) - -proc MCI_MSF_FRAME(msf: int32): int8 = - result = toU8(msf shr 16) - -proc MCI_TMSF_SECOND(tmsf: int32): int8 = - result = toU8(tmsf shr 16) - -proc MCI_HMS_SECOND(h: int32): int8 = - result = toU8(h shr 16) - -proc MCI_MAKE_MSF(m, s, f: int8): int32 = - result = toU32(ze(m) or ze(s) shl 8 or ze(f) shl 16) - -proc MCI_MAKE_HMS(h, m, s: int8): int32 = - result = toU32(ze(h) or ze(m) shl 8 or ze(s) shl 16) - -proc MCI_TMSF_FRAME(tmsf: int32): int8 = - result = toU8(tmsf shr 24) - -proc mci_Make_TMSF(t, m, s, f: int8): int32 = - result = (ze(t) or ze(m) shl 8 or ze(s) shl 16 or ze(f) shl 24).int32 - -proc DIBINDEX(n: int32): int32 = - result = n Or 0x000010FF'i32 shl 16'i32 diff --git a/lib/windows/nb30.nim b/lib/windows/nb30.nim deleted file mode 100644 index a7fd526aaf..0000000000 --- a/lib/windows/nb30.nim +++ /dev/null @@ -1,232 +0,0 @@ -# -# -# 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 module contains the definitions for portable NetBIOS 3.0 support. - -{.deadCodeElim: on.} - -import # Data structure templates - Windows - -const - NCBNAMSZ* = 16 # absolute length of a net name - MAX_LANA* = 254 # lana's in range 0 to MAX_LANA inclusive - -type # Network Control Block - PNCB* = ptr TNCB - TNCBPostProc* = proc (P: PNCB) {.stdcall.} - TNCB* {.final.} = object # Structure returned to the NCB command NCBASTAT is ADAPTER_STATUS followed - # by an array of NAME_BUFFER structures. - ncb_command*: Char # command code - ncb_retcode*: Char # return code - ncb_lsn*: Char # local session number - ncb_num*: Char # number of our network name - ncb_buffer*: cstring # address of message buffer - ncb_length*: int16 # size of message buffer - ncb_callname*: array[0..NCBNAMSZ - 1, char] # blank-padded name of remote - ncb_name*: array[0..NCBNAMSZ - 1, char] # our blank-padded netname - ncb_rto*: Char # rcv timeout/retry count - ncb_sto*: Char # send timeout/sys timeout - ncb_post*: 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* {.final.} = object - adapter_address*: array[0..5, Char] - rev_major*: Char - reserved0*: Char - adapter_type*: Char - rev_minor*: Char - duration*: int16 - frmr_recv*: int16 - frmr_xmit*: int16 - iframe_recv_err*: int16 - xmit_aborts*: int16 - xmit_success*: DWORD - recv_success*: DWORD - iframe_xmit_err*: int16 - recv_buff_unavail*: int16 - t1_timeouts*: int16 - ti_timeouts*: int16 - reserved1*: DWORD - free_ncbs*: int16 - max_cfg_ncbs*: int16 - max_ncbs*: int16 - xmit_buf_unavail*: int16 - max_dgram_size*: int16 - pending_sess*: int16 - max_cfg_sess*: int16 - max_sess*: int16 - max_sess_pkt_size*: int16 - name_count*: int16 - - PNameBuffer* = ptr TNameBuffer - TNameBuffer* {.final.} = object - 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* {.final.} = object - sess_name*: Char - num_sess*: Char - rcv_dg_outstanding*: Char - rcv_any_outstanding*: Char - - PSessionBuffer* = ptr TSessionBuffer - TSessionBuffer* {.final.} = object - lsn*: Char - state*: Char - local_name*: array[0..NCBNAMSZ - 1, Char] - remote_name*: array[0..NCBNAMSZ - 1, Char] - rcvs_outstanding*: Char - sends_outstanding*: Char - - -const # Values for state - LISTEN_OUTSTANDING* = 0x00000001 - CALL_PENDING* = 0x00000002 - SESSION_ESTABLISHED* = 0x00000003 - HANGUP_PENDING* = 0x00000004 - HANGUP_COMPLETE* = 0x00000005 - SESSION_ABORTED* = 0x00000006 - -type # Structure returned to the NCB command NCBENUM. - # On a system containing lana's 0, 2 and 3, a structure with - # length =3, lana[0]=0, lana[1]=2 and lana[2]=3 will be returned. - PLanaEnum* = ptr TLanaEnum - TLanaEnum* {.final.} = object # Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed - # by an array of FIND_NAME_BUFFER structures. - len*: Char # Number of valid entries in lana[] - lana*: array[0..MAX_LANA, Char] - - PFindNameHeader* = ptr TFindNameHeader - TFindNameHeader* {.final.} = object - node_count*: int16 - reserved*: Char - unique_group*: Char - - PFindNameBuffer* = ptr TFindNameBuffer - TFindNameBuffer* {.final.} = object # Structure provided with NCBACTION. The purpose of NCBACTION is to provide - # transport specific extensions to netbios. - len*: Char - access_control*: Char - frame_control*: Char - destination_addr*: array[0..5, Char] - source_addr*: array[0..5, Char] - routing_info*: array[0..17, Char] - - PActionHeader* = ptr TActionHeader - TActionHeader* {.final.} = object - 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 deleted file mode 100644 index ec0ab8f5da..0000000000 --- a/lib/windows/ole2.nim +++ /dev/null @@ -1,208 +0,0 @@ -# -# -# 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/psapi.nim b/lib/windows/psapi.nim deleted file mode 100644 index 7d53cf7ca8..0000000000 --- a/lib/windows/psapi.nim +++ /dev/null @@ -1,202 +0,0 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2009 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -# PSAPI interface unit - -# Contains the definitions for the APIs provided by PSAPI.DLL - -import # Data structure templates - Windows - -const - psapiDll = "psapi.dll" - -proc EnumProcesses*(lpidProcess: ptr DWORD, cb: DWORD, - cbNeeded: ptr DWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "EnumProcesses".} -proc EnumProcessModules*(hProcess: HANDLE, lphModule: ptr HMODULE, cb: DWORD, lpcbNeeded: LPDWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "EnumProcessModules".} - -proc GetModuleBaseNameA*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetModuleBaseNameA".} -proc GetModuleBaseNameW*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetModuleBaseNameW".} -when defined(winUnicode): - proc GetModuleBaseName*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetModuleBaseNameW".} -else: - proc GetModuleBaseName*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetModuleBaseNameA".} - -proc GetModuleFileNameExA*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetModuleFileNameExA".} -proc GetModuleFileNameExW*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetModuleFileNameExW".} -when defined(winUnicode): - proc GetModuleFileNameEx*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetModuleFileNameExW".} -else: - proc GetModuleFileNameEx*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetModuleFileNameExA".} - -type - MODULEINFO* {.final.} = object - lpBaseOfDll*: LPVOID - SizeOfImage*: DWORD - EntryPoint*: LPVOID - LPMODULEINFO* = ptr MODULEINFO - -proc GetModuleInformation*(hProcess: HANDLE, hModule: HMODULE, lpmodinfo: LPMODULEINFO, cb: DWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "GetModuleInformation".} -proc EmptyWorkingSet*(hProcess: HANDLE): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "EmptyWorkingSet".} -proc QueryWorkingSet*(hProcess: HANDLE, pv: PVOID, cb: DWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "QueryWorkingSet".} -proc QueryWorkingSetEx*(hProcess: HANDLE, pv: PVOID, cb: DWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "QueryWorkingSetEx".} -proc InitializeProcessForWsWatch*(hProcess: HANDLE): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "InitializeProcessForWsWatch".} - -type - PSAPI_WS_WATCH_INFORMATION* {.final.} = object - FaultingPc*: LPVOID - FaultingVa*: LPVOID - PPSAPI_WS_WATCH_INFORMATION* = ptr PSAPI_WS_WATCH_INFORMATION - -proc GetWsChanges*(hProcess: HANDLE, lpWatchInfo: PPSAPI_WS_WATCH_INFORMATION, cb: DWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "GetWsChanges".} - -proc GetMappedFileNameA*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetMappedFileNameA".} -proc GetMappedFileNameW*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetMappedFileNameW".} -when defined(winUnicode): - proc GetMappedFileName*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetMappedFileNameW".} -else: - proc GetMappedFileName*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetMappedFileNameA".} - -proc EnumDeviceDrivers*(lpImageBase: LPVOID, cb: DWORD, lpcbNeeded: LPDWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "EnumDeviceDrivers".} - -proc GetDeviceDriverBaseNameA*(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetDeviceDriverBaseNameA".} -proc GetDeviceDriverBaseNameW*(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetDeviceDriverBaseNameW".} -when defined(winUnicode): - proc GetDeviceDriverBaseName*(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetDeviceDriverBaseNameW".} -else: - proc GetDeviceDriverBaseName*(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetDeviceDriverBaseNameA".} - -proc GetDeviceDriverFileNameA*(ImageBase: LPVOID, lpFileName: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetDeviceDriverFileNameA".} -proc GetDeviceDriverFileNameW*(ImageBase: LPVOID, lpFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetDeviceDriverFileNameW".} -when defined(winUnicode): - proc GetDeviceDriverFileName*(ImageBase: LPVOID, lpFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetDeviceDriverFileNameW".} -else: - proc GetDeviceDriverFileName*(ImageBase: LPVOID, lpFileName: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetDeviceDriverFileNameA".} - -type - PROCESS_MEMORY_COUNTERS* {.final.} = object - cb*: DWORD - PageFaultCount*: DWORD - PeakWorkingSetSize: SIZE_T - WorkingSetSize: SIZE_T - QuotaPeakPagedPoolUsage: SIZE_T - QuotaPagedPoolUsage: SIZE_T - QuotaPeakNonPagedPoolUsage: SIZE_T - QuotaNonPagedPoolUsage: SIZE_T - PagefileUsage: SIZE_T - PeakPagefileUsage: SIZE_T - PPROCESS_MEMORY_COUNTERS* = ptr PROCESS_MEMORY_COUNTERS - -type - PROCESS_MEMORY_COUNTERS_EX* {.final.} = object - cb*: DWORD - PageFaultCount*: DWORD - PeakWorkingSetSize: SIZE_T - WorkingSetSize: SIZE_T - QuotaPeakPagedPoolUsage: SIZE_T - QuotaPagedPoolUsage: SIZE_T - QuotaPeakNonPagedPoolUsage: SIZE_T - QuotaNonPagedPoolUsage: SIZE_T - PagefileUsage: SIZE_T - PeakPagefileUsage: SIZE_T - PrivateUsage: SIZE_T - PPROCESS_MEMORY_COUNTERS_EX* = ptr PROCESS_MEMORY_COUNTERS_EX - -proc GetProcessMemoryInfo*(hProcess: HANDLE, ppsmemCounters: PPROCESS_MEMORY_COUNTERS, cb: DWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "GetProcessMemoryInfo".} - -type - PERFORMANCE_INFORMATION* {.final.} = object - cb*: DWORD - CommitTotal: SIZE_T - CommitLimit: SIZE_T - CommitPeak: SIZE_T - PhysicalTotal: SIZE_T - PhysicalAvailable: SIZE_T - SystemCache: SIZE_T - KernelTotal: SIZE_T - KernelPaged: SIZE_T - KernelNonpaged: SIZE_T - PageSize: SIZE_T - HandleCount*: DWORD - ProcessCount*: DWORD - ThreadCount*: DWORD - PPERFORMANCE_INFORMATION* = ptr PERFORMANCE_INFORMATION - # Skip definition of PERFORMACE_INFORMATION... - -proc GetPerformanceInfo*(pPerformanceInformation: PPERFORMANCE_INFORMATION, cb: DWORD): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "GetPerformanceInfo".} - -type - ENUM_PAGE_FILE_INFORMATION* {.final.} = object - cb*: DWORD - Reserved*: DWORD - TotalSize: SIZE_T - TotalInUse: SIZE_T - PeakUsage: SIZE_T - PENUM_PAGE_FILE_INFORMATION* = ptr ENUM_PAGE_FILE_INFORMATION - -# Callback procedure -type - PENUM_PAGE_FILE_CALLBACKW* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCWSTR): WINBOOL{.stdcall.} - PENUM_PAGE_FILE_CALLBACKA* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCSTR): WINBOOL{.stdcall.} - -#TODO -proc EnumPageFilesA*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "EnumPageFilesA".} -proc EnumPageFilesW*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "EnumPageFilesW".} -when defined(winUnicode): - proc EnumPageFiles*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "EnumPageFilesW".} - type PENUM_PAGE_FILE_CALLBACK* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCWSTR): WINBOOL{.stdcall.} -else: - proc EnumPageFiles*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID): WINBOOL {.stdcall, - dynlib: psapiDll, importc: "EnumPageFilesA".} - type PENUM_PAGE_FILE_CALLBACK* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCSTR): WINBOOL{.stdcall.} - -proc GetProcessImageFileNameA*(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetProcessImageFileNameA".} -proc GetProcessImageFileNameW*(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetProcessImageFileNameW".} -when defined(winUnicode): - proc GetProcessImageFileName*(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetProcessImageFileNameW".} -else: - proc GetProcessImageFileName*(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD): DWORD {.stdcall, - dynlib: psapiDll, importc: "GetProcessImageFileNameA".} diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim deleted file mode 100644 index 41f2a60d5f..0000000000 --- a/lib/windows/shellapi.nim +++ /dev/null @@ -1,863 +0,0 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2006 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -{.deadCodeElim: on.} - -# leave out unused functions so the unit can be used on win2000 as well - -#+------------------------------------------------------------------------- -# -# Microsoft Windows -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# File: shellapi.h -# -# Header translation by Marco van de Voort for Free Pascal Platform -# SDK dl'ed January 2002 -# -#-------------------------------------------------------------------------- - -# -# shellapi.h - SHELL.DLL functions, types, and definitions -# Copyright (c) Microsoft Corporation. All rights reserved. - -import - Windows - -type - HDROP* = THandle - UINT_PTR* = ptr UINT - DWORD_PTR* = ptr DWORD - pHICON* = ptr HICON - pBool* = ptr BOOL - STARTUPINFOW* {.final.} = object # a guess. Omission should get fixed in Windows. - cb*: DWORD - lpReserved*: LPTSTR - lpDesktop*: LPTSTR - lpTitle*: LPTSTR - dwX*: DWORD - dwY*: DWORD - dwXSize*: DWORD - dwYSize*: DWORD - dwXCountChars*: DWORD - dwYCountChars*: DWORD - dwFillAttribute*: DWORD - dwFlags*: DWORD - wShowWindow*: int16 - cbReserved2*: int16 - lpReserved2*: LPBYTE - hStdInput*: HANDLE - hStdOutput*: HANDLE - hStdError*: HANDLE - - LPSTARTUPINFOW* = ptr STARTUPINFOW - 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*(inst: HINST, icon: HICON): HIcon{.stdcall, - dynlib: "shell32.dll", importc: "DuplicateIcon".} -proc ExtractAssociatedIconA*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{. - stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".} -proc ExtractAssociatedIconW*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{. - stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".} -proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{. - stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".} -proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{. - stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".} -proc ExtractIconA*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: 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* {.final.} = object - uSize*: UINT - pt*: POINT - fNC*: BOOL - lpFileList*: LPSTR - grfKeyState*: DWORD - - TDRAGINFOA* = DRAGINFOA - LPDRAGINFOA* = ptr DRAGINFOA # init with sizeof(DRAGINFO) - DRAGINFOW* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - pszOldPath*: LPSTR - pszNewPath*: LPSTR - cchOldPath*: int32 - cchNewPath*: int32 - - TSHNAMEMAPPINGA* = SHNAMEMAPPINGA - LPSHNAMEMAPPINGA* = ptr SHNAMEMAPPINGA - SHNAMEMAPPINGW* {.final.} = object - 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* {.final.} = object - cbSize*: DWORD - fMask*: ULONG - hwnd*: HWND - lpVerb*: LPCSTR - lpFile*: LPCSTR - lpParameters*: LPCSTR - lpDirectory*: LPCSTR - nShow*: int32 - hInstApp*: HINST - lpIDList*: LPVOID - lpClass*: LPCSTR - hkeyClass*: HKEY - dwHotKey*: DWORD - hMonitor*: HANDLE # also: hIcon - hProcess*: HANDLE - - TSHELLEXECUTEINFOA* = SHELLEXECUTEINFOA - LPSHELLEXECUTEINFOA* = ptr SHELLEXECUTEINFOA - SHELLEXECUTEINFOW* {.final.} = object - cbSize*: DWORD - fMask*: ULONG - hwnd*: HWND - lpVerb*: lpcwstr - lpFile*: lpcwstr - lpParameters*: lpcwstr - lpDirectory*: lpcwstr - nShow*: int32 - hInstApp*: HINST - lpIDList*: LPVOID - lpClass*: LPCWSTR - hkeyClass*: HKEY - dwHotKey*: DWORD - hMonitor*: HANDLE # also: hIcon - hProcess*: HANDLE - - 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* {.final.} = object - cbSize*: DWORD - fMask*: ULONG - hwnd*: HWND - pszFile*: LPCWSTR - pszParameters*: LPCWSTR - pszCurrentDirectory*: LPCWSTR - hUserToken*: HANDLE - lpProcessAttributes*: LPSECURITY_ATTRIBUTES - lpThreadAttributes*: LPSECURITY_ATTRIBUTES - bInheritHandles*: BOOL - dwCreationFlags*: DWORD - lpStartupInfo*: LPSTARTUPINFOW - lpProcessInformation*: LPPROCESS_INFORMATION - - 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - 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* {.final.} = object - hIcon*: HICON # out: icon - iIcon*: int32 # out: icon index - dwAttributes*: DWORD # out: SFGAO_ flags - szDisplayName*: array[0..(MAX_PATH) - 1, CHAR] # out: display name (or path) - szTypeName*: array[0..79, CHAR] # out: type name - - TSHFILEINFOA* = SHFILEINFOA - pSHFILEINFOA* = ptr SHFILEINFOA - SHFILEINFOW* {.final.} = object - hIcon*: HICON # out: icon - iIcon*: int32 # out: icon index - dwAttributes*: DWORD # out: SFGAO_ flags - szDisplayName*: array[0..(MAX_PATH) - 1, WCHAR] # out: display name (or path) - szTypeName*: array[0..79, WCHAR] # out: type name - - 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 = -x diff --git a/lib/windows/shfolder.nim b/lib/windows/shfolder.nim deleted file mode 100644 index 253b1c77ab..0000000000 --- a/lib/windows/shfolder.nim +++ /dev/null @@ -1,93 +0,0 @@ -# -# -# 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. -# --------------------------------------------------------------------- - -{.deadCodeElim: on.} - -import - windows - -const - LibName* = "SHFolder.dll" - -const - CSIDL_PROGRAMS* = 0x00000002 # %SYSTEMDRIVE%\Program Files - CSIDL_PERSONAL* = 0x00000005 # %USERPROFILE%\My Documents - CSIDL_FAVORITES* = 0x00000006 # %USERPROFILE%\Favorites - CSIDL_STARTUP* = 0x00000007 # %USERPROFILE%\Start menu\Programs\Startup - CSIDL_RECENT* = 0x00000008 # %USERPROFILE%\Recent - CSIDL_SENDTO* = 0x00000009 # %USERPROFILE%\Sendto - CSIDL_STARTMENU* = 0x0000000B # %USERPROFILE%\Start menu - CSIDL_MYMUSIC* = 0x0000000D # %USERPROFILE%\Documents\My Music - CSIDL_MYVIDEO* = 0x0000000E # %USERPROFILE%\Documents\My Videos - CSIDL_DESKTOPDIRECTORY* = 0x00000010 # %USERPROFILE%\Desktop - CSIDL_NETHOOD* = 0x00000013 # %USERPROFILE%\NetHood - CSIDL_TEMPLATES* = 0x00000015 # %USERPROFILE%\Templates - CSIDL_COMMON_STARTMENU* = 0x00000016 # %PROFILEPATH%\All users\Start menu - CSIDL_COMMON_PROGRAMS* = 0x00000017 # %PROFILEPATH%\All users\Start menu\Programs - CSIDL_COMMON_STARTUP* = 0x00000018 # %PROFILEPATH%\All users\Start menu\Programs\Startup - CSIDL_COMMON_DESKTOPDIRECTORY* = 0x00000019 # %PROFILEPATH%\All users\Desktop - CSIDL_APPDATA* = 0x0000001A # %USERPROFILE%\Application Data (roaming) - CSIDL_PRINTHOOD* = 0x0000001B # %USERPROFILE%\Printhood - CSIDL_LOCAL_APPDATA* = 0x0000001C # %USERPROFILE%\Local Settings\Application Data (non roaming) - CSIDL_COMMON_FAVORITES* = 0x0000001F # %PROFILEPATH%\All users\Favorites - CSIDL_INTERNET_CACHE* = 0x00000020 # %USERPROFILE%\Local Settings\Temporary Internet Files - CSIDL_COOKIES* = 0x00000021 # %USERPROFILE%\Cookies - CSIDL_HISTORY* = 0x00000022 # %USERPROFILE%\Local settings\History - CSIDL_COMMON_APPDATA* = 0x00000023 # %PROFILESPATH%\All Users\Application Data - CSIDL_WINDOWS* = 0x00000024 # %SYSTEMROOT% - CSIDL_SYSTEM* = 0x00000025 # %SYSTEMROOT%\SYSTEM32 (may be system on 95/98/ME) - CSIDL_PROGRAM_FILES* = 0x00000026 # %SYSTEMDRIVE%\Program Files - CSIDL_MYPICTURES* = 0x00000027 # %USERPROFILE%\My Documents\My Pictures - CSIDL_PROFILE* = 0x00000028 # %USERPROFILE% - CSIDL_PROGRAM_FILES_COMMON* = 0x0000002B # %SYSTEMDRIVE%\Program Files\Common - CSIDL_COMMON_TEMPLATES* = 0x0000002D # %PROFILEPATH%\All Users\Templates - CSIDL_COMMON_DOCUMENTS* = 0x0000002E # %PROFILEPATH%\All Users\Documents - CSIDL_COMMON_ADMINTOOLS* = 0x0000002F # %PROFILEPATH%\All Users\Start Menu\Programs\Administrative Tools - CSIDL_ADMINTOOLS* = 0x00000030 # %USERPROFILE%\Start Menu\Programs\Administrative Tools - CSIDL_COMMON_MUSIC* = 0x00000035 # %PROFILEPATH%\All Users\Documents\my music - CSIDL_COMMON_PICTURES* = 0x00000036 # %PROFILEPATH%\All Users\Documents\my pictures - CSIDL_COMMON_VIDEO* = 0x00000037 # %PROFILEPATH%\All Users\Documents\my videos - CSIDL_CDBURN_AREA* = 0x0000003B # %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning - CSIDL_PROFILES* = 0x0000003E # %PROFILEPATH% - CSIDL_FLAG_CREATE* = 0x00008000 # (force creation of requested folder if it doesn't exist yet) - # Original entry points - -proc SHGetFolderPathA*(Ahwnd: HWND, Csidl: int, Token: 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 deleted file mode 100644 index 9b55b47b92..0000000000 --- a/lib/windows/windows.nim +++ /dev/null @@ -1,23945 +0,0 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2010 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -## Define ``winUnicode`` before importing this module for the -## Unicode version. - -{.deadCodeElim: on.} - -type - WideChar* = uint16 - PWideChar* = ptr uint16 - -type # WinNT.h -- Defines the 32-Bit Windows types and constants - SHORT* = int16 - LONG* = int32 - # UNICODE (Wide Character) types - PWCHAR* = PWideChar - LPWCH* = PWideChar - PWCH* = PWideChar - LPCWCH* = PWideChar - PCWCH* = PWideChar - NWPSTR* = PWideChar - LPWSTR* = PWideChar - LPCWSTR* = PWideChar - PCWSTR* = PWideChar - # ANSI (Multi-byte Character) types - LPCH* = cstring - PCH* = cstring - LPCCH* = cstring - PCCH* = cstring - LPSTR* = cstring - PSTR* = cstring - LPCSTR* = cstring - PCSTR* = cstring - -type # BaseTsd.h -- Type definitions for the basic sized types - # Give here only the bare minimum, to be expanded as needs arise - LONG32* = int32 - ULONG32* = int32 - DWORD32* = int32 - LONG64* = int64 - ULONG64* = int64 - DWORD64* = int64 - PDWORD64* = ptr DWORD64 - # int32 on Win32, int64 on Win64 - INT_PTR* = TAddress - UINT_PTR* = TAddress - LONG_PTR* = TAddress - ULONG_PTR* = TAddress - SIZE_T* = TAddress - SSIZE_T* = TAddress - DWORD_PTR* = TAddress - # Thread affinity - KAFFINITY* = TAddress - PKAFFINITY* = ptr KAFFINITY - -type # WinDef.h -- Basic Windows Type Definitions - # BaseTypes - UINT = int32 - ULONG* = int - PULONG* = ptr int - USHORT* = int16 - PUSHORT* = ptr int16 - UCHAR* = int8 - PUCHAR* = ptr int8 - PSZ* = cstring - - DWORD* = int32 - WINBOOL* = int32 - WORD* = int16 - # FLOAT* = float - PFLOAT* = ptr FLOAT - PWINBOOL* = ptr WINBOOL - LPWINBOOL* = ptr WINBOOL - PBYTE* = ptr int8 - LPBYTE* = ptr int8 - PINT* = ptr int32 - LPINT* = ptr int32 - PWORD* = ptr int16 - LPWORD* = ptr int16 - LPLONG* = ptr int32 - PDWORD* = ptr DWORD - LPDWORD* = ptr DWORD - LPVOID* = pointer - LPCVOID* = pointer - - # INT* = int # Cannot work and not necessary anyway - PUINT* = ptr int - - WPARAM* = LONG_PTR - LPARAM* = LONG_PTR - LRESULT* = LONG_PTR - - ATOM* = int16 - TAtom* = ATOM - HANDLE* = int - THandle* = HANDLE - PHANDLE* = ptr HANDLE - LPHANDLE* = ptr HANDLE - HWND* = HANDLE - HHOOK* = HANDLE - HEVENT* = HANDLE - HGLOBAL* = HANDLE - HLOCAL* = HANDLE - HGDIOBJ* = HANDLE - HKEY* = HANDLE - PHKEY* = ptr HKEY - HACCEL* = HANDLE - HBITMAP* = HANDLE - HBRUSH* = HANDLE - HCOLORSPACE* = HANDLE - HDC* = HANDLE - HGLRC* = HANDLE - HDESK* = HANDLE - HENHMETAFILE* = HANDLE - HFONT* = HANDLE - HICON* = HANDLE - HMETAFILE* = HANDLE - HINST* = HANDLE # Not HINSTANCE, else it has problems with the var HInstance - HMODULE* = HANDLE - HPALETTE* = HANDLE - HPEN* = HANDLE - HRGN* = HANDLE - HRSRC* = HANDLE - HTASK* = HANDLE - HWINSTA* = HANDLE - HKL* = HANDLE - HMONITOR* = HANDLE - HWINEVENTHOOK* = HANDLE - HUMPD* = HANDLE - - HFILE* = HANDLE - HCURSOR* = HANDLE # = HICON - COLORREF* = int - LPCOLORREF* = ptr COLORREF - - POINT* {.final, pure.} = object - x*: LONG - y*: LONG - PPOINT* = ptr POINT - LPPOINT* = ptr POINT - POINTL* {.final, pure.} = object - x*: LONG - y*: LONG - PPOINTL* = ptr POINTL - - TPOINT* = POINT - TPOINTL* = POINTL - - RECT* {.final, pure.} = object - TopLeft*, BottomRight*: TPoint - PRECT* = ptr RECT - LPRECT* = ptr RECT - - RECTL* {.final, pure.} = object - left*: LONG - top*: LONG - right*: LONG - bottom*: LONG - PRECTL* = ptr RECTL - - SIZE* {.final, pure.} = object - cx*: LONG - cy*: LONG - PSIZE* = ptr SIZE - LPSIZE* = ptr SIZE - SIZEL* = SIZE - PSIZEL* = ptr SIZE - LPSIZEL* = ptr SIZE - - POINTS* {.final, pure.} = object - x*: SHORT - y*: SHORT - PPOINTS* = ptr POINTS - - TRECT* = RECT - TRECTL* = RECTL - TSIZE* = SIZE - TSIZEL* = SIZE - TPOINTS* = POINTS - - FILETIME* {.final, pure.} = object - dwLowDateTime*: DWORD - dwHighDateTime*: DWORD - PFILETIME* = ptr FILETIME - LPFILETIME* = ptr FILETIME - - TFILETIME* = FILETIME - -const - MAX_PATH* = 260 - HFILE_ERROR* = HFILE(-1) - - # mode selections for the device mode function - # DocumentProperties - DM_UPDATE* = 1 - DM_COPY* = 2 - DM_PROMPT* = 4 - DM_MODIFY* = 8 - - DM_IN_BUFFER* = DM_MODIFY - DM_IN_PROMPT* = DM_PROMPT - DM_OUT_BUFFER* = DM_COPY - DM_OUT_DEFAULT* = DM_UPDATE - - # device capabilities indices - DC_FIELDS* = 1 - DC_PAPERS* = 2 - DC_PAPERSIZE* = 3 - DC_MINEXTENT* = 4 - DC_MAXEXTENT* = 5 - DC_BINS* = 6 - DC_DUPLEX* = 7 - DC_SIZE* = 8 - DC_EXTRA* = 9 - DC_VERSION* = 10 - DC_DRIVER* = 11 - DC_BINNAMES* = 12 - DC_ENUMRESOLUTIONS* = 13 - DC_FILEDEPENDENCIES* = 14 - DC_TRUETYPE* = 15 - DC_PAPERNAMES* = 16 - DC_ORIENTATION* = 17 - DC_COPIES* = 18 - - DC_BINADJUST* = 19 - DC_EMF_COMPLIANT* = 20 - DC_DATATYPE_PRODUCED* = 21 - -type - WORDBOOL* = int16 # XXX: not a bool - CALTYPE* = int - CALID* = int - CCHAR* = char - TCOLORREF* = int - WINT* = int32 - PINTEGER* = ptr int32 - PBOOL* = ptr WINBOOL - LONGLONG* = int64 - PLONGLONG* = ptr LONGLONG - LPLONGLONG* = ptr LONGLONG - ULONGLONG* = int64 # used in AMD64 CONTEXT - PULONGLONG* = ptr ULONGLONG # - DWORDLONG* = int64 # was unsigned long - PDWORDLONG* = ptr DWORDLONG - HRESULT* = int - PHRESULT* = ptr HRESULT - HCONV* = HANDLE - HCONVLIST* = HANDLE - HDBC* = HANDLE - HDDEDATA* = HANDLE - HDROP* = HANDLE - HDWP* = HANDLE - HENV* = HANDLE - HIMAGELIST* = HANDLE - HMENU* = HANDLE - HRASCONN* = HANDLE - HSTMT* = HANDLE - HSTR* = HANDLE - HSZ* = HANDLE - LANGID* = int16 - LCID* = DWORD - LCTYPE* = DWORD - LP* = ptr int16 - LPBOOL* = ptr WINBOOL - -when defined(winUnicode): - type - LPCTSTR* = PWideChar -else: - type - LPCTSTR* = cstring -type - LPPCSTR* = ptr LPCSTR - LPPCTSTR* = ptr LPCTSTR - LPPCWSTR* = ptr LPCWSTR - -when defined(winUnicode): - type - LPTCH* = PWideChar - LPTSTR* = PWideChar -else: - type - LPTCH* = cstring - LPTSTR* = cstring -type - PBOOLEAN* = ptr int8 - PLONG* = ptr int32 - PSHORT* = ptr SHORT - -when defined(winUnicode): - type - PTBYTE* = ptr uint16 - PTCH* = PWideChar - PTCHAR* = PWideChar - PTSTR* = PWideChar -else: - type - PTBYTE* = ptr byte - PTCH* = cstring - PTCHAR* = cstring - PTSTR* = cstring -type - PVOID* = pointer - RETCODE* = SHORT - SC_HANDLE* = HANDLE - SC_LOCK* = LPVOID - LPSC_HANDLE* = ptr SC_HANDLE - SERVICE_STATUS_HANDLE* = DWORD - -when defined(winUnicode): - type - TBYTE* = uint16 - TCHAR* = widechar - BCHAR* = int16 -else: - type - TBYTE* = uint8 - TCHAR* = char - BCHAR* = int8 -type - WCHAR* = WideChar - PLPSTR* = ptr LPSTR - PLPWStr* = ptr LPWStr - ACL_INFORMATION_CLASS* = enum - AclRevisionInformation = 1, AclSizeInformation - MEDIA_TYPE* = enum - Unknown, F5_1Pt2_512, F3_1Pt44_512, F3_2Pt88_512, F3_20Pt8_512, F3_720_512, - F5_360_512, F5_320_512, F5_320_1024, F5_180_512, F5_160_512, RemovableMedia, - FixedMedia - -const - RASCS_DONE* = 0x00002000 - RASCS_PAUSED* = 0x00001000 - -type - RASCONNSTATE* = enum - RASCS_OpenPort = 0, RASCS_PortOpened, RASCS_ConnectDevice, - RASCS_DeviceConnected, RASCS_AllDevicesConnected, RASCS_Authenticate, - RASCS_AuthNotify, RASCS_AuthRetry, RASCS_AuthCallback, - RASCS_AuthChangePassword, RASCS_AuthProject, RASCS_AuthLinkSpeed, - RASCS_AuthAck, RASCS_ReAuthenticate, RASCS_Authenticated, - RASCS_PrepareForCallback, RASCS_WaitForModemReset, RASCS_WaitForCallback, - RASCS_Projected, RASCS_StartAuthentication, RASCS_CallbackComplete, - RASCS_LogonNetwork, RASCS_Interactive = RASCS_PAUSED, - RASCS_RetryAuthentication, RASCS_CallbackSetByCaller, RASCS_PasswordExpired, - RASCS_Connected = RASCS_DONE, RASCS_Disconnected - RASPROJECTION* = enum - RASP_PppIp = 0x00008021, RASP_PppIpx = 0x0000802B, RASP_PppNbf = 0x0000803F, - RASP_Amb = 0x00010000 - SECURITY_IMPERSONATION_LEVEL* = enum - - - SecurityAnonymous, SecurityIdentification, SecurityImpersonation, - SecurityDelegation - SID_NAME_USE* = enum - SidTypeUser = 1, SidTypeGroup, SidTypeDomain, SidTypeAlias, - SidTypeWellKnownGroup, SidTypeDeletedAccount, SidTypeInvalid, SidTypeUnknown - PSID_NAME_USE* = ptr SID_NAME_USE - TOKEN_INFORMATION_CLASS* = enum - TokenUser = 1, TokenGroups, TokenPrivileges, TokenOwner, TokenPrimaryGroup, - TokenDefaultDacl, TokenSource, TokenType, TokenImpersonationLevel, - TokenStatistics - TTOKEN_TYPE* = enum - TokenPrimary = 1, TokenImpersonation - MakeIntResourceA* = cstring - MakeIntResourceW* = PWideChar - MakeIntResource* = MakeIntResourceA - -# -# 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.} - -const - SE_CREATE_TOKEN_NAME* = "SeCreateTokenPrivilege" - SE_ASSIGNPRIMARYTOKEN_NAME* = "SeAssignPrimaryTokenPrivilege" - SE_LOCK_MEMORY_NAME* = "SeLockMemoryPrivilege" - SE_INCREASE_QUOTA_NAME* = "SeIncreaseQuotaPrivilege" - SE_UNSOLICITED_INPUT_NAME* = "SeUnsolicitedInputPrivilege" - SE_MACHINE_ACCOUNT_NAME* = "SeMachineAccountPrivilege" - SE_TCB_NAME* = "SeTcbPrivilege" - SE_SECURITY_NAME* = "SeSecurityPrivilege" - SE_TAKE_OWNERSHIP_NAME* = "SeTakeOwnershipPrivilege" - SE_LOAD_DRIVER_NAME* = "SeLoadDriverPrivilege" - SE_SYSTEM_PROFILE_NAME* = "SeSystemProfilePrivilege" - SE_SYSTEMTIME_NAME* = "SeSystemtimePrivilege" - SE_PROF_SINGLE_PROCESS_NAME* = "SeProfileSingleProcessPrivilege" - SE_INC_BASE_PRIORITY_NAME* = "SeIncreaseBasePriorityPrivilege" - SE_CREATE_PAGEFILE_NAME* = "SeCreatePagefilePrivilege" - SE_CREATE_PERMANENT_NAME* = "SeCreatePermanentPrivilege" - SE_BACKUP_NAME* = "SeBackupPrivilege" - SE_RESTORE_NAME* = "SeRestorePrivilege" - SE_SHUTDOWN_NAME* = "SeShutdownPrivilege" - SE_DEBUG_NAME* = "SeDebugPrivilege" - SE_AUDIT_NAME* = "SeAuditPrivilege" - SE_SYSTEM_ENVIRONMENT_NAME* = "SeSystemEnvironmentPrivilege" - SE_CHANGE_NOTIFY_NAME* = "SeChangeNotifyPrivilege" - SE_REMOTE_SHUTDOWN_NAME* = "SeRemoteShutdownPrivilege" - SERVICES_ACTIVE_DATABASEW* = "ServicesActive" - SERVICES_FAILED_DATABASEW* = "ServicesFailed" - SERVICES_ACTIVE_DATABASEA* = "ServicesActive" - SERVICES_FAILED_DATABASEA* = "ServicesFailed" - SC_GROUP_IDENTIFIERW* = "+" - SC_GROUP_IDENTIFIERA* = "+" - -when defined(winUnicode): - const - SERVICES_ACTIVE_DATABASE* = SERVICES_ACTIVE_DATABASEW - SERVICES_FAILED_DATABASE* = SERVICES_FAILED_DATABASEW - SC_GROUP_IDENTIFIER* = SC_GROUP_IDENTIFIERW -else: - const - SERVICES_ACTIVE_DATABASE* = SERVICES_ACTIVE_DATABASEA - SERVICES_FAILED_DATABASE* = SERVICES_FAILED_DATABASEA - SC_GROUP_IDENTIFIER* = SC_GROUP_IDENTIFIERA -type - PFNCALLBACK* = proc (para1, para2: UINT, para3: HCONV, para4, para5: HSZ, - para6: HDDEDATA, para7, para8: DWORD): HDDEData{.stdcall.} - CALLB* = PFNCALLBACK - SECURITY_CONTEXT_TRACKING_MODE* = WINBOOL - # End of stuff from ddeml.h in old Cygnus headers - - WNDENUMPROC* = FARPROC - ENHMFENUMPROC* = FARPROC - CCSTYLE* = DWORD - PCCSTYLE* = ptr CCSTYLE - LPCCSTYLE* = ptr CCSTYLE - CCSTYLEFLAGA* = DWORD - PCCSTYLEFLAGA* = ptr CCSTYLEFLAGA - LPCCSTYLEFLAGA* = ptr CCSTYLEFLAGA - -const - LZERROR_UNKNOWNALG* = -8 - LZERROR_BADVALUE* = -7 - LZERROR_GLOBLOCK* = -6 - LZERROR_GLOBALLOC* = -5 - LZERROR_WRITE* = -4 - LZERROR_READ* = -3 - LZERROR_BADOUTHANDLE* = -2 - LZERROR_BADINHANDLE* = -1 - NO_ERROR* = 0 - ERROR_SUCCESS* = 0 - ERROR_INVALID_FUNCTION* = 1 - ERROR_FILE_NOT_FOUND* = 2 - ERROR_PATH_NOT_FOUND* = 3 - ERROR_TOO_MANY_OPEN_FILES* = 4 - ERROR_ACCESS_DENIED* = 5 - ERROR_INVALID_HANDLE* = 6 - ERROR_ARENA_TRASHED* = 7 - ERROR_NOT_ENOUGH_MEMORY* = 8 - ERROR_INVALID_BLOCK* = 9 - ERROR_BAD_ENVIRONMENT* = 10 - ERROR_BAD_FORMAT* = 11 - ERROR_INVALID_ACCESS* = 12 - ERROR_INVALID_DATA* = 13 - ERROR_OUTOFMEMORY* = 14 - ERROR_INVALID_DRIVE* = 15 - ERROR_CURRENT_DIRECTORY* = 16 - ERROR_NOT_SAME_DEVICE* = 17 - ERROR_NO_MORE_FILES* = 18 - ERROR_WRITE_PROTECT* = 19 - ERROR_BAD_UNIT* = 20 - ERROR_NOT_READY* = 21 - ERROR_BAD_COMMAND* = 22 - ERROR_CRC* = 23 - ERROR_BAD_LENGTH* = 24 - ERROR_SEEK* = 25 - ERROR_NOT_DOS_DISK* = 26 - ERROR_SECTOR_NOT_FOUND* = 27 - ERROR_OUT_OF_PAPER* = 28 - ERROR_WRITE_FAULT* = 29 - ERROR_READ_FAULT* = 30 - ERROR_GEN_FAILURE* = 31 - ERROR_SHARING_VIOLATION* = 32 - ERROR_LOCK_VIOLATION* = 33 - ERROR_WRONG_DISK* = 34 - ERROR_SHARING_BUFFER_EXCEEDED* = 36 - ERROR_HANDLE_EOF* = 38 - ERROR_HANDLE_DISK_FULL* = 39 - ERROR_NOT_SUPPORTED* = 50 - ERROR_REM_NOT_LIST* = 51 - ERROR_DUP_NAME* = 52 - ERROR_BAD_NETPATH* = 53 - ERROR_NETWORK_BUSY* = 54 - ERROR_DEV_NOT_EXIST* = 55 - ERROR_TOO_MANY_CMDS* = 56 - ERROR_ADAP_HDW_ERR* = 57 - ERROR_BAD_NET_RESP* = 58 - ERROR_UNEXP_NET_ERR* = 59 - ERROR_BAD_REM_ADAP* = 60 - ERROR_PRINTQ_FULL* = 61 - ERROR_NO_SPOOL_SPACE* = 62 - ERROR_PRINT_CANCELLED* = 63 - ERROR_NETNAME_DELETED* = 64 - ERROR_NETWORK_ACCESS_DENIED* = 65 - ERROR_BAD_DEV_TYPE* = 66 - ERROR_BAD_NET_NAME* = 67 - ERROR_TOO_MANY_NAMES* = 68 - ERROR_TOO_MANY_SESS* = 69 - ERROR_SHARING_PAUSED* = 70 - ERROR_REQ_NOT_ACCEP* = 71 - ERROR_REDIR_PAUSED* = 72 - ERROR_FILE_EXISTS* = 80 - ERROR_CANNOT_MAKE* = 82 - ERROR_FAIL_I24* = 83 - ERROR_OUT_OF_STRUCTURES* = 84 - ERROR_ALREADY_ASSIGNED* = 85 - ERROR_INVALID_PASSWORD* = 86 - ERROR_INVALID_PARAMETER* = 87 - ERROR_NET_WRITE_FAULT* = 88 - ERROR_NO_PROC_SLOTS* = 89 - ERROR_TOO_MANY_SEMAPHORES* = 100 - ERROR_EXCL_SEM_ALREADY_OWNED* = 101 - ERROR_SEM_IS_SET* = 102 - ERROR_TOO_MANY_SEM_REQUESTS* = 103 - ERROR_INVALID_AT_INTERRUPT_TIME* = 104 - ERROR_SEM_OWNER_DIED* = 105 - ERROR_SEM_USER_LIMIT* = 106 - ERROR_DISK_CHANGE* = 107 - ERROR_DRIVE_LOCKED* = 108 - ERROR_BROKEN_PIPE* = 109 - ERROR_OPEN_FAILED* = 110 - ERROR_BUFFER_OVERFLOW* = 111 - ERROR_DISK_FULL* = 112 - ERROR_NO_MORE_SEARCH_HANDLES* = 113 - ERROR_INVALID_TARGET_HANDLE* = 114 - ERROR_INVALID_CATEGORY* = 117 - ERROR_INVALID_VERIFY_SWITCH* = 118 - ERROR_BAD_DRIVER_LEVEL* = 119 - ERROR_CALL_NOT_IMPLEMENTED* = 120 - ERROR_SEM_TIMEOUT* = 121 - ERROR_INSUFFICIENT_BUFFER* = 122 - ERROR_INVALID_NAME* = 123 - ERROR_INVALID_LEVEL* = 124 - ERROR_NO_VOLUME_LABEL* = 125 - ERROR_MOD_NOT_FOUND* = 126 - ERROR_PROC_NOT_FOUND* = 127 - ERROR_WAIT_NO_CHILDREN* = 128 - ERROR_CHILD_NOT_COMPLETE* = 129 - ERROR_DIRECT_ACCESS_HANDLE* = 130 - ERROR_NEGATIVE_SEEK* = 131 - ERROR_SEEK_ON_DEVICE* = 132 - ERROR_IS_JOIN_TARGET* = 133 - ERROR_IS_JOINED* = 134 - ERROR_IS_SUBSTED* = 135 - ERROR_NOT_JOINED* = 136 - ERROR_NOT_SUBSTED* = 137 - ERROR_JOIN_TO_JOIN* = 138 - ERROR_SUBST_TO_SUBST* = 139 - ERROR_JOIN_TO_SUBST* = 140 - ERROR_SUBST_TO_JOIN* = 141 - ERROR_BUSY_DRIVE* = 142 - ERROR_SAME_DRIVE* = 143 - ERROR_DIR_NOT_ROOT* = 144 - ERROR_DIR_NOT_EMPTY* = 145 - ERROR_IS_SUBST_PATH* = 146 - ERROR_IS_JOIN_PATH* = 147 - ERROR_PATH_BUSY* = 148 - ERROR_IS_SUBST_TARGET* = 149 - ERROR_SYSTEM_TRACE* = 150 - ERROR_INVALID_EVENT_COUNT* = 151 - ERROR_TOO_MANY_MUXWAITERS* = 152 - ERROR_INVALID_LIST_FORMAT* = 153 - ERROR_LABEL_TOO_LONG* = 154 - ERROR_TOO_MANY_TCBS* = 155 - ERROR_SIGNAL_REFUSED* = 156 - ERROR_DISCARDED* = 157 - ERROR_NOT_LOCKED* = 158 - ERROR_BAD_THREADID_ADDR* = 159 - ERROR_BAD_ARGUMENTS* = 160 - ERROR_BAD_PATHNAME* = 161 - ERROR_SIGNAL_PENDING* = 162 - ERROR_MAX_THRDS_REACHED* = 164 - ERROR_LOCK_FAILED* = 167 - ERROR_BUSY* = 170 - ERROR_CANCEL_VIOLATION* = 173 - ERROR_ATOMIC_LOCKS_NOT_SUPPORTED* = 174 - ERROR_INVALID_SEGMENT_NUMBER* = 180 - ERROR_INVALID_ORDINAL* = 182 - ERROR_ALREADY_EXISTS* = 183 - ERROR_INVALID_FLAG_NUMBER* = 186 - ERROR_SEM_NOT_FOUND* = 187 - ERROR_INVALID_STARTING_CODESEG* = 188 - ERROR_INVALID_STACKSEG* = 189 - ERROR_INVALID_MODULETYPE* = 190 - ERROR_INVALID_EXE_SIGNATURE* = 191 - ERROR_EXE_MARKED_INVALID* = 192 - ERROR_BAD_EXE_FORMAT* = 193 - ERROR_ITERATED_DATA_EXCEEDS_64k* = 194 - ERROR_INVALID_MINALLOCSIZE* = 195 - ERROR_DYNLINK_FROM_INVALID_RING* = 196 - ERROR_IOPL_NOT_ENABLED* = 197 - ERROR_INVALID_SEGDPL* = 198 - ERROR_AUTODATASEG_EXCEEDS_64k* = 199 - ERROR_RING2SEG_MUST_BE_MOVABLE* = 200 - ERROR_RELOC_CHAIN_XEEDS_SEGLIM* = 201 - ERROR_INFLOOP_IN_RELOC_CHAIN* = 202 - ERROR_ENVVAR_NOT_FOUND* = 203 - ERROR_NO_SIGNAL_SENT* = 205 - ERROR_FILENAME_EXCED_RANGE* = 206 - ERROR_RING2_STACK_IN_USE* = 207 - ERROR_META_EXPANSION_TOO_LONG* = 208 - ERROR_INVALID_SIGNAL_NUMBER* = 209 - ERROR_THREAD_1_INACTIVE* = 210 - ERROR_LOCKED* = 212 - ERROR_TOO_MANY_MODULES* = 214 - ERROR_NESTING_NOT_ALLOWED* = 215 - ERROR_BAD_PIPE* = 230 - ERROR_PIPE_BUSY* = 231 - ERROR_NO_DATA* = 232 - ERROR_PIPE_NOT_CONNECTED* = 233 - ERROR_MORE_DATA* = 234 - ERROR_VC_DISCONNECTED* = 240 - ERROR_INVALID_EA_NAME* = 254 - ERROR_EA_LIST_INCONSISTENT* = 255 - ERROR_NO_MORE_ITEMS* = 259 - ERROR_CANNOT_COPY* = 266 - ERROR_DIRECTORY* = 267 - ERROR_EAS_DIDNT_FIT* = 275 - ERROR_EA_FILE_CORRUPT* = 276 - ERROR_EA_TABLE_FULL* = 277 - ERROR_INVALID_EA_HANDLE* = 278 - ERROR_EAS_NOT_SUPPORTED* = 282 - ERROR_NOT_OWNER* = 288 - ERROR_TOO_MANY_POSTS* = 298 - ERROR_PARTIAL_COPY* = 299 - ERROR_MR_MID_NOT_FOUND* = 317 - ERROR_INVALID_ADDRESS* = 487 - ERROR_ARITHMETIC_OVERFLOW* = 534 - ERROR_PIPE_CONNECTED* = 535 - ERROR_PIPE_LISTENING* = 536 - ERROR_EA_ACCESS_DENIED* = 994 - ERROR_OPERATION_ABORTED* = 995 - ERROR_IO_INCOMPLETE* = 996 - ERROR_IO_PENDING* = 997 - ERROR_NOACCESS* = 998 - ERROR_SWAPERROR* = 999 - ERROR_STACK_OVERFLOW* = 1001 - ERROR_INVALID_MESSAGE* = 1002 - ERROR_CAN_NOT_COMPLETE* = 1003 - ERROR_INVALID_FLAGS* = 1004 - ERROR_UNRECOGNIZED_VOLUME* = 1005 - ERROR_FILE_INVALID* = 1006 - ERROR_FULLSCREEN_MODE* = 1007 - ERROR_NO_TOKEN* = 1008 - ERROR_BADDB* = 1009 - ERROR_BADKEY* = 1010 - ERROR_CANTOPEN* = 1011 - ERROR_CANTREAD* = 1012 - ERROR_CANTWRITE* = 1013 - ERROR_REGISTRY_RECOVERED* = 1014 - ERROR_REGISTRY_CORRUPT* = 1015 - ERROR_REGISTRY_IO_FAILED* = 1016 - ERROR_NOT_REGISTRY_FILE* = 1017 - ERROR_KEY_DELETED* = 1018 - ERROR_NO_LOG_SPACE* = 1019 - ERROR_KEY_HAS_CHILDREN* = 1020 - ERROR_CHILD_MUST_BE_VOLATILE* = 1021 - ERROR_NOTIFY_ENUM_DIR* = 1022 - ERROR_DEPENDENT_SERVICES_RUNNING* = 1051 - ERROR_INVALID_SERVICE_CONTROL* = 1052 - ERROR_SERVICE_REQUEST_TIMEOUT* = 1053 - ERROR_SERVICE_NO_THREAD* = 1054 - ERROR_SERVICE_DATABASE_LOCKED* = 1055 - ERROR_SERVICE_ALREADY_RUNNING* = 1056 - ERROR_INVALID_SERVICE_ACCOUNT* = 1057 - ERROR_SERVICE_DISABLED* = 1058 - ERROR_CIRCULAR_DEPENDENCY* = 1059 - ERROR_SERVICE_DOES_NOT_EXIST* = 1060 - ERROR_SERVICE_CANNOT_ACCEPT_CTRL* = 1061 - ERROR_SERVICE_NOT_ACTIVE* = 1062 - ERROR_FAILED_SERVICE_CONTROLLER_CONNECT* = 1063 - ERROR_EXCEPTION_IN_SERVICE* = 1064 - ERROR_DATABASE_DOES_NOT_EXIST* = 1065 - ERROR_SERVICE_SPECIFIC_ERROR* = 1066 - ERROR_PROCESS_ABORTED* = 1067 - ERROR_SERVICE_DEPENDENCY_FAIL* = 1068 - ERROR_SERVICE_LOGON_FAILED* = 1069 - ERROR_SERVICE_START_HANG* = 1070 - ERROR_INVALID_SERVICE_LOCK* = 1071 - ERROR_SERVICE_MARKED_FOR_DELETE* = 1072 - ERROR_SERVICE_EXISTS* = 1073 - ERROR_ALREADY_RUNNING_LKG* = 1074 - ERROR_SERVICE_DEPENDENCY_DELETED* = 1075 - ERROR_BOOT_ALREADY_ACCEPTED* = 1076 - ERROR_SERVICE_NEVER_STARTED* = 1077 - ERROR_DUPLICATE_SERVICE_NAME* = 1078 - ERROR_END_OF_MEDIA* = 1100 - ERROR_FILEMARK_DETECTED* = 1101 - ERROR_BEGINNING_OF_MEDIA* = 1102 - ERROR_SETMARK_DETECTED* = 1103 - ERROR_NO_DATA_DETECTED* = 1104 - ERROR_PARTITION_FAILURE* = 1105 - ERROR_INVALID_BLOCK_LENGTH* = 1106 - ERROR_DEVICE_NOT_PARTITIONED* = 1107 - ERROR_UNABLE_TO_LOCK_MEDIA* = 1108 - ERROR_UNABLE_TO_UNLOAD_MEDIA* = 1109 - ERROR_MEDIA_CHANGED* = 1110 - ERROR_BUS_RESET* = 1111 - ERROR_NO_MEDIA_IN_DRIVE* = 1112 - ERROR_NO_UNICODE_TRANSLATION* = 1113 - ERROR_DLL_INIT_FAILED* = 1114 - ERROR_SHUTDOWN_IN_PROGRESS* = 1115 - ERROR_NO_SHUTDOWN_IN_PROGRESS* = 1116 - ERROR_IO_DEVICE* = 1117 - ERROR_SERIAL_NO_DEVICE* = 1118 - ERROR_IRQ_BUSY* = 1119 - ERROR_MORE_WRITES* = 1120 - ERROR_COUNTER_TIMEOUT* = 1121 - ERROR_FLOPPY_ID_MARK_NOT_FOUND* = 1122 - ERROR_FLOPPY_WRONG_CYLINDER* = 1123 - ERROR_FLOPPY_UNKNOWN_ERROR* = 1124 - ERROR_FLOPPY_BAD_REGISTERS* = 1125 - ERROR_DISK_RECALIBRATE_FAILED* = 1126 - ERROR_DISK_OPERATION_FAILED* = 1127 - ERROR_DISK_RESET_FAILED* = 1128 - ERROR_EOM_OVERFLOW* = 1129 - ERROR_NOT_ENOUGH_SERVER_MEMORY* = 1130 - ERROR_POSSIBLE_DEADLOCK* = 1131 - ERROR_MAPPED_ALIGNMENT* = 1132 - ERROR_SET_POWER_STATE_VETOED* = 1140 - ERROR_SET_POWER_STATE_FAILED* = 1141 - ERROR_OLD_WIN_VERSION* = 1150 - ERROR_APP_WRONG_OS* = 1151 - ERROR_SINGLE_INSTANCE_APP* = 1152 - ERROR_RMODE_APP* = 1153 - ERROR_INVALID_DLL* = 1154 - ERROR_NO_ASSOCIATION* = 1155 - ERROR_DDE_FAIL* = 1156 - ERROR_DLL_NOT_FOUND* = 1157 - ERROR_BAD_USERNAME* = 2202 - ERROR_NOT_CONNECTED* = 2250 - ERROR_OPEN_FILES* = 2401 - ERROR_ACTIVE_CONNECTIONS* = 2402 - ERROR_DEVICE_IN_USE* = 2404 - ERROR_BAD_DEVICE* = 1200 - ERROR_CONNECTION_UNAVAIL* = 1201 - ERROR_DEVICE_ALREADY_REMEMBERED* = 1202 - ERROR_NO_NET_OR_BAD_PATH* = 1203 - ERROR_BAD_PROVIDER* = 1204 - ERROR_CANNOT_OPEN_PROFILE* = 1205 - ERROR_BAD_PROFILE* = 1206 - ERROR_NOT_CONTAINER* = 1207 - ERROR_EXTENDED_ERROR* = 1208 - ERROR_INVALID_GROUPNAME* = 1209 - ERROR_INVALID_COMPUTERNAME* = 1210 - ERROR_INVALID_EVENTNAME* = 1211 - ERROR_INVALID_DOMAINNAME* = 1212 - ERROR_INVALID_SERVICENAME* = 1213 - ERROR_INVALID_NETNAME* = 1214 - ERROR_INVALID_SHARENAME* = 1215 - ERROR_INVALID_PASSWORDNAME* = 1216 - ERROR_INVALID_MESSAGENAME* = 1217 - ERROR_INVALID_MESSAGEDEST* = 1218 - ERROR_SESSION_CREDENTIAL_CONFLICT* = 1219 - ERROR_REMOTE_SESSION_LIMIT_EXCEEDED* = 1220 - ERROR_DUP_DOMAINNAME* = 1221 - ERROR_NO_NETWORK* = 1222 - ERROR_CANCELLED* = 1223 - ERROR_USER_MAPPED_FILE* = 1224 - ERROR_CONNECTION_REFUSED* = 1225 - ERROR_GRACEFUL_DISCONNECT* = 1226 - ERROR_ADDRESS_ALREADY_ASSOCIATED* = 1227 - ERROR_ADDRESS_NOT_ASSOCIATED* = 1228 - ERROR_CONNECTION_INVALID* = 1229 - ERROR_CONNECTION_ACTIVE* = 1230 - ERROR_NETWORK_UNREACHABLE* = 1231 - ERROR_HOST_UNREACHABLE* = 1232 - ERROR_PROTOCOL_UNREACHABLE* = 1233 - ERROR_PORT_UNREACHABLE* = 1234 - ERROR_REQUEST_ABORTED* = 1235 - ERROR_CONNECTION_ABORTED* = 1236 - ERROR_RETRY* = 1237 - ERROR_CONNECTION_COUNT_LIMIT* = 1238 - ERROR_LOGIN_TIME_RESTRICTION* = 1239 - ERROR_LOGIN_WKSTA_RESTRICTION* = 1240 - ERROR_INCORRECT_ADDRESS* = 1241 - ERROR_ALREADY_REGISTERED* = 1242 - ERROR_SERVICE_NOT_FOUND* = 1243 - ERROR_NOT_AUTHENTICATED* = 1244 - ERROR_NOT_LOGGED_ON* = 1245 - ERROR_CONTINUE* = 1246 - ERROR_ALREADY_INITIALIZED* = 1247 - ERROR_NO_MORE_DEVICES* = 1248 - ERROR_NOT_ALL_ASSIGNED* = 1300 - ERROR_SOME_NOT_MAPPED* = 1301 - ERROR_NO_QUOTAS_FOR_ACCOUNT* = 1302 - ERROR_LOCAL_USER_SESSION_KEY* = 1303 - ERROR_NULL_LM_PASSWORD* = 1304 - ERROR_UNKNOWN_REVISION* = 1305 - ERROR_REVISION_MISMATCH* = 1306 - ERROR_INVALID_OWNER* = 1307 - ERROR_INVALID_PRIMARY_GROUP* = 1308 - ERROR_NO_IMPERSONATION_TOKEN* = 1309 - ERROR_CANT_DISABLE_MANDATORY* = 1310 - ERROR_NO_LOGON_SERVERS* = 1311 - ERROR_NO_SUCH_LOGON_SESSION* = 1312 - ERROR_NO_SUCH_PRIVILEGE* = 1313 - ERROR_PRIVILEGE_NOT_HELD* = 1314 - ERROR_INVALID_ACCOUNT_NAME* = 1315 - ERROR_USER_EXISTS* = 1316 - ERROR_NO_SUCH_USER* = 1317 - ERROR_GROUP_EXISTS* = 1318 - ERROR_NO_SUCH_GROUP* = 1319 - ERROR_MEMBER_IN_GROUP* = 1320 - ERROR_MEMBER_NOT_IN_GROUP* = 1321 - ERROR_LAST_ADMIN* = 1322 - ERROR_WRONG_PASSWORD* = 1323 - ERROR_ILL_FORMED_PASSWORD* = 1324 - ERROR_PASSWORD_RESTRICTION* = 1325 - ERROR_LOGON_FAILURE* = 1326 - ERROR_ACCOUNT_RESTRICTION* = 1327 - ERROR_INVALID_LOGON_HOURS* = 1328 - ERROR_INVALID_WORKSTATION* = 1329 - ERROR_PASSWORD_EXPIRED* = 1330 - ERROR_ACCOUNT_DISABLED* = 1331 - ERROR_NONE_MAPPED* = 1332 - ERROR_TOO_MANY_LUIDS_REQUESTED* = 1333 - ERROR_LUIDS_EXHAUSTED* = 1334 - ERROR_INVALID_SUB_AUTHORITY* = 1335 - ERROR_INVALID_ACL* = 1336 - ERROR_INVALID_SID* = 1337 - ERROR_INVALID_SECURITY_DESCR* = 1338 - ERROR_BAD_INHERITANCE_ACL* = 1340 - ERROR_SERVER_DISABLED* = 1341 - ERROR_SERVER_NOT_DISABLED* = 1342 - ERROR_INVALID_ID_AUTHORITY* = 1343 - ERROR_ALLOTTED_SPACE_EXCEEDED* = 1344 - ERROR_INVALID_GROUP_ATTRIBUTES* = 1345 - ERROR_BAD_IMPERSONATION_LEVEL* = 1346 - ERROR_CANT_OPEN_ANONYMOUS* = 1347 - ERROR_BAD_VALIDATION_CLASS* = 1348 - ERROR_BAD_TOKEN_TYPE* = 1349 - ERROR_NO_SECURITY_ON_OBJECT* = 1350 - ERROR_CANT_ACCESS_DOMAIN_INFO* = 1351 - ERROR_INVALID_SERVER_STATE* = 1352 - ERROR_INVALID_DOMAIN_STATE* = 1353 - ERROR_INVALID_DOMAIN_ROLE* = 1354 - ERROR_NO_SUCH_DOMAIN* = 1355 - ERROR_DOMAIN_EXISTS* = 1356 - ERROR_DOMAIN_LIMIT_EXCEEDED* = 1357 - ERROR_INTERNAL_DB_CORRUPTION* = 1358 - ERROR_INTERNAL_ERROR* = 1359 - ERROR_GENERIC_NOT_MAPPED* = 1360 - ERROR_BAD_DESCRIPTOR_FORMAT* = 1361 - ERROR_NOT_LOGON_PROCESS* = 1362 - ERROR_LOGON_SESSION_EXISTS* = 1363 - ERROR_NO_SUCH_PACKAGE* = 1364 - ERROR_BAD_LOGON_SESSION_STATE* = 1365 - ERROR_LOGON_SESSION_COLLISION* = 1366 - ERROR_INVALID_LOGON_TYPE* = 1367 - ERROR_CANNOT_IMPERSONATE* = 1368 - ERROR_RXACT_INVALID_STATE* = 1369 - ERROR_RXACT_COMMIT_FAILURE* = 1370 - ERROR_SPECIAL_ACCOUNT* = 1371 - ERROR_SPECIAL_GROUP* = 1372 - ERROR_SPECIAL_USER* = 1373 - ERROR_MEMBERS_PRIMARY_GROUP* = 1374 - ERROR_TOKEN_ALREADY_IN_USE* = 1375 - ERROR_NO_SUCH_ALIAS* = 1376 - ERROR_MEMBER_NOT_IN_ALIAS* = 1377 - ERROR_MEMBER_IN_ALIAS* = 1378 - ERROR_ALIAS_EXISTS* = 1379 - ERROR_LOGON_NOT_GRANTED* = 1380 - ERROR_TOO_MANY_SECRETS* = 1381 - ERROR_SECRET_TOO_LONG* = 1382 - ERROR_INTERNAL_DB_ERROR* = 1383 - ERROR_TOO_MANY_CONTEXT_IDS* = 1384 - ERROR_LOGON_TYPE_NOT_GRANTED* = 1385 - ERROR_NT_CROSS_ENCRYPTION_REQUIRED* = 1386 - ERROR_NO_SUCH_MEMBER* = 1387 - ERROR_INVALID_MEMBER* = 1388 - ERROR_TOO_MANY_SIDS* = 1389 - ERROR_LM_CROSS_ENCRYPTION_REQUIRED* = 1390 - ERROR_NO_INHERITANCE* = 1391 - ERROR_FILE_CORRUPT* = 1392 - ERROR_DISK_CORRUPT* = 1393 - ERROR_NO_USER_SESSION_KEY* = 1394 - ERROR_LICENSE_QUOTA_EXCEEDED* = 1395 - ERROR_INVALID_WINDOW_HANDLE* = 1400 - ERROR_INVALID_MENU_HANDLE* = 1401 - ERROR_INVALID_CURSOR_HANDLE* = 1402 - ERROR_INVALID_ACCEL_HANDLE* = 1403 - ERROR_INVALID_HOOK_HANDLE* = 1404 - ERROR_INVALID_DWP_HANDLE* = 1405 - ERROR_TLW_WITH_WSCHILD* = 1406 - ERROR_CANNOT_FIND_WND_CLASS* = 1407 - ERROR_WINDOW_OF_OTHER_THREAD* = 1408 - ERROR_HOTKEY_ALREADY_REGISTERED* = 1409 - ERROR_CLASS_ALREADY_EXISTS* = 1410 - ERROR_CLASS_DOES_NOT_EXIST* = 1411 - ERROR_CLASS_HAS_WINDOWS* = 1412 - ERROR_INVALID_INDEX* = 1413 - ERROR_INVALID_ICON_HANDLE* = 1414 - ERROR_PRIVATE_DIALOG_INDEX* = 1415 - ERROR_LISTBOX_ID_NOT_FOUND* = 1416 - ERROR_NO_WILDCARD_CHARACTERS* = 1417 - ERROR_CLIPBOARD_NOT_OPEN* = 1418 - ERROR_HOTKEY_NOT_REGISTERED* = 1419 - ERROR_WINDOW_NOT_DIALOG* = 1420 - ERROR_CONTROL_ID_NOT_FOUND* = 1421 - ERROR_INVALID_COMBOBOX_MESSAGE* = 1422 - ERROR_WINDOW_NOT_COMBOBOX* = 1423 - ERROR_INVALID_EDIT_HEIGHT* = 1424 - ERROR_DC_NOT_FOUND* = 1425 - ERROR_INVALID_HOOK_FILTER* = 1426 - ERROR_INVALID_FILTER_PROC* = 1427 - ERROR_HOOK_NEEDS_HMOD* = 1428 - ERROR_GLOBAL_ONLY_HOOK* = 1429 - ERROR_JOURNAL_HOOK_SET* = 1430 - ERROR_HOOK_NOT_INSTALLED* = 1431 - ERROR_INVALID_LB_MESSAGE* = 1432 - ERROR_SETCOUNT_ON_BAD_LB* = 1433 - ERROR_LB_WITHOUT_TABSTOPS* = 1434 - ERROR_DESTROY_OBJECT_OF_OTHER_THREAD* = 1435 - ERROR_CHILD_WINDOW_MENU* = 1436 - ERROR_NO_SYSTEM_MENU* = 1437 - ERROR_INVALID_MSGBOX_STYLE* = 1438 - ERROR_INVALID_SPI_VALUE* = 1439 - ERROR_SCREEN_ALREADY_LOCKED* = 1440 - ERROR_HWNDS_HAVE_DIFF_PARENT* = 1441 - ERROR_NOT_CHILD_WINDOW* = 1442 - ERROR_INVALID_GW_COMMAND* = 1443 - ERROR_INVALID_THREAD_ID* = 1444 - ERROR_NON_MDICHILD_WINDOW* = 1445 - ERROR_POPUP_ALREADY_ACTIVE* = 1446 - ERROR_NO_SCROLLBARS* = 1447 - ERROR_INVALID_SCROLLBAR_RANGE* = 1448 - ERROR_INVALID_SHOWWIN_COMMAND* = 1449 - ERROR_NO_SYSTEM_RESOURCES* = 1450 - ERROR_NONPAGED_SYSTEM_RESOURCES* = 1451 - ERROR_PAGED_SYSTEM_RESOURCES* = 1452 - ERROR_WORKING_SET_QUOTA* = 1453 - ERROR_PAGEFILE_QUOTA* = 1454 - ERROR_COMMITMENT_LIMIT* = 1455 - ERROR_MENU_ITEM_NOT_FOUND* = 1456 - ERROR_INVALID_KEYBOARD_HANDLE* = 1457 - ERROR_HOOK_TYPE_NOT_ALLOWED* = 1458 - ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION* = 1459 - ERROR_TIMEOUT* = 1460 - ERROR_EVENTLOG_FILE_CORRUPT* = 1500 - ERROR_EVENTLOG_CANT_START* = 1501 - ERROR_LOG_FILE_FULL* = 1502 - ERROR_EVENTLOG_FILE_CHANGED* = 1503 - RPC_S_INVALID_STRING_BINDING* = 1700 - RPC_S_WRONG_KIND_OF_BINDING* = 1701 - RPC_S_INVALID_BINDING* = 1702 - RPC_S_PROTSEQ_NOT_SUPPORTED* = 1703 - RPC_S_INVALID_RPC_PROTSEQ* = 1704 - RPC_S_INVALID_STRING_UUID* = 1705 - RPC_S_INVALID_ENDPOINT_FORMAT* = 1706 - RPC_S_INVALID_NET_ADDR* = 1707 - RPC_S_NO_ENDPOINT_FOUND* = 1708 - RPC_S_INVALID_TIMEOUT* = 1709 - RPC_S_OBJECT_NOT_FOUND* = 1710 - RPC_S_ALREADY_REGISTERED* = 1711 - RPC_S_TYPE_ALREADY_REGISTERED* = 1712 - RPC_S_ALREADY_LISTENING* = 1713 - RPC_S_NO_PROTSEQS_REGISTERED* = 1714 - RPC_S_NOT_LISTENING* = 1715 - RPC_S_UNKNOWN_MGR_TYPE* = 1716 - RPC_S_UNKNOWN_IF* = 1717 - RPC_S_NO_BINDINGS* = 1718 - RPC_S_NO_PROTSEQS* = 1719 - RPC_S_CANT_CREATE_ENDPOINT* = 1720 - RPC_S_OUT_OF_RESOURCES* = 1721 - RPC_S_SERVER_UNAVAILABLE* = 1722 - RPC_S_SERVER_TOO_BUSY* = 1723 - RPC_S_INVALID_NETWORK_OPTIONS* = 1724 - RPC_S_NO_CALL_ACTIVE* = 1725 - RPC_S_CALL_FAILED* = 1726 - RPC_S_CALL_FAILED_DNE* = 1727 - RPC_S_PROTOCOL_ERROR* = 1728 - RPC_S_UNSUPPORTED_TRANS_SYN* = 1730 - RPC_S_UNSUPPORTED_TYPE* = 1732 - RPC_S_INVALID_TAG* = 1733 - RPC_S_INVALID_BOUND* = 1734 - RPC_S_NO_ENTRY_NAME* = 1735 - RPC_S_INVALID_NAME_SYNTAX* = 1736 - RPC_S_UNSUPPORTED_NAME_SYNTAX* = 1737 - RPC_S_UUID_NO_ADDRESS* = 1739 - RPC_S_DUPLICATE_ENDPOINT* = 1740 - RPC_S_UNKNOWN_AUTHN_TYPE* = 1741 - RPC_S_MAX_CALLS_TOO_SMALL* = 1742 - RPC_S_STRING_TOO_LONG* = 1743 - RPC_S_PROTSEQ_NOT_FOUND* = 1744 - RPC_S_PROCNUM_OUT_OF_RANGE* = 1745 - RPC_S_BINDING_HAS_NO_AUTH* = 1746 - RPC_S_UNKNOWN_AUTHN_SERVICE* = 1747 - RPC_S_UNKNOWN_AUTHN_LEVEL* = 1748 - RPC_S_INVALID_AUTH_IDENTITY* = 1749 - RPC_S_UNKNOWN_AUTHZ_SERVICE* = 1750 - EPT_S_INVALID_ENTRY* = 1751 - EPT_S_CANT_PERFORM_OP* = 1752 - EPT_S_NOT_REGISTERED* = 1753 - RPC_S_NOTHING_TO_EXPORT* = 1754 - RPC_S_INCOMPLETE_NAME* = 1755 - RPC_S_INVALID_VERS_OPTION* = 1756 - RPC_S_NO_MORE_MEMBERS* = 1757 - RPC_S_NOT_ALL_OBJS_UNEXPORTED* = 1758 - RPC_S_INTERFACE_NOT_FOUND* = 1759 - RPC_S_ENTRY_ALREADY_EXISTS* = 1760 - RPC_S_ENTRY_NOT_FOUND* = 1761 - RPC_S_NAME_SERVICE_UNAVAILABLE* = 1762 - RPC_S_INVALID_NAF_ID* = 1763 - RPC_S_CANNOT_SUPPORT* = 1764 - RPC_S_NO_CONTEXT_AVAILABLE* = 1765 - RPC_S_INTERNAL_ERROR* = 1766 - RPC_S_ZERO_DIVIDE* = 1767 - RPC_S_ADDRESS_ERROR* = 1768 - RPC_S_FP_DIV_ZERO* = 1769 - RPC_S_FP_UNDERFLOW* = 1770 - RPC_S_FP_OVERFLOW* = 1771 - RPC_X_NO_MORE_ENTRIES* = 1772 - RPC_X_SS_CHAR_TRANS_OPEN_FAIL* = 1773 - RPC_X_SS_CHAR_TRANS_SHORT_FILE* = 1774 - RPC_X_SS_IN_NULL_CONTEXT* = 1775 - RPC_X_SS_CONTEXT_DAMAGED* = 1777 - RPC_X_SS_HANDLES_MISMATCH* = 1778 - RPC_X_SS_CANNOT_GET_CALL_HANDLE* = 1779 - RPC_X_NULL_REF_POINTER* = 1780 - RPC_X_ENUM_VALUE_OUT_OF_RANGE* = 1781 - RPC_X_BYTE_COUNT_TOO_SMALL* = 1782 - RPC_X_BAD_STUB_DATA* = 1783 - ERROR_INVALID_USER_BUFFER* = 1784 - ERROR_UNRECOGNIZED_MEDIA* = 1785 - ERROR_NO_TRUST_LSA_SECRET* = 1786 - ERROR_NO_TRUST_SAM_ACCOUNT* = 1787 - ERROR_TRUSTED_DOMAIN_FAILURE* = 1788 - ERROR_TRUSTED_RELATIONSHIP_FAILURE* = 1789 - ERROR_TRUST_FAILURE* = 1790 - RPC_S_CALL_IN_PROGRESS* = 1791 - ERROR_NETLOGON_NOT_STARTED* = 1792 - ERROR_ACCOUNT_EXPIRED* = 1793 - ERROR_REDIRECTOR_HAS_OPEN_HANDLES* = 1794 - ERROR_PRINTER_DRIVER_ALREADY_INSTALLED* = 1795 - ERROR_UNKNOWN_PORT* = 1796 - ERROR_UNKNOWN_PRINTER_DRIVER* = 1797 - ERROR_UNKNOWN_PRINTPROCESSOR* = 1798 - ERROR_INVALID_SEPARATOR_FILE* = 1799 - ERROR_INVALID_PRIORITY* = 1800 - ERROR_INVALID_PRINTER_NAME* = 1801 - ERROR_PRINTER_ALREADY_EXISTS* = 1802 - ERROR_INVALID_PRINTER_COMMAND* = 1803 - ERROR_INVALID_DATATYPE* = 1804 - ERROR_INVALID_ENVIRONMENT* = 1805 - RPC_S_NO_MORE_BINDINGS* = 1806 - ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT* = 1807 - ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT* = 1808 - ERROR_NOLOGON_SERVER_TRUST_ACCOUNT* = 1809 - ERROR_DOMAIN_TRUST_INCONSISTENT* = 1810 - ERROR_SERVER_HAS_OPEN_HANDLES* = 1811 - ERROR_RESOURCE_DATA_NOT_FOUND* = 1812 - ERROR_RESOURCE_TYPE_NOT_FOUND* = 1813 - ERROR_RESOURCE_NAME_NOT_FOUND* = 1814 - ERROR_RESOURCE_LANG_NOT_FOUND* = 1815 - ERROR_NOT_ENOUGH_QUOTA* = 1816 - RPC_S_NO_INTERFACES* = 1817 - RPC_S_CALL_CANCELLED* = 1818 - RPC_S_BINDING_INCOMPLETE* = 1819 - RPC_S_COMM_FAILURE* = 1820 - RPC_S_UNSUPPORTED_AUTHN_LEVEL* = 1821 - RPC_S_NO_PRINC_NAME* = 1822 - RPC_S_NOT_RPC_ERROR* = 1823 - RPC_S_UUID_LOCAL_ONLY* = 1824 - RPC_S_SEC_PKG_ERROR* = 1825 - RPC_S_NOT_CANCELLED* = 1826 - RPC_X_INVALID_ES_ACTION* = 1827 - RPC_X_WRONG_ES_VERSION* = 1828 - RPC_X_WRONG_STUB_VERSION* = 1829 - RPC_X_INVALID_PIPE_OBJECT* = 1830 - RPC_X_INVALID_PIPE_OPERATION* = 1831 - RPC_S_GROUP_MEMBER_NOT_FOUND* = 1898 - EPT_S_CANT_CREATE* = 1899 - RPC_S_INVALID_OBJECT* = 1900 - ERROR_INVALID_TIME* = 1901 - ERROR_INVALID_FORM_NAME* = 1902 - ERROR_INVALID_FORM_SIZE* = 1903 - ERROR_ALREADY_WAITING* = 1904 - ERROR_PRINTER_DELETED* = 1905 - ERROR_INVALID_PRINTER_STATE* = 1906 - ERROR_PASSWORD_MUST_CHANGE* = 1907 - ERROR_DOMAIN_CONTROLLER_NOT_FOUND* = 1908 - ERROR_ACCOUNT_LOCKED_OUT* = 1909 - OR_INVALID_OXID* = 1910 - OR_INVALID_OID* = 1911 - OR_INVALID_SET* = 1912 - RPC_S_SEND_INCOMPLETE* = 1913 - ERROR_NO_BROWSER_SERVERS_FOUND* = 6118 - ERROR_INVALID_PIXEL_FORMAT* = 2000 - ERROR_BAD_DRIVER* = 2001 - ERROR_INVALID_WINDOW_STYLE* = 2002 - ERROR_METAFILE_NOT_SUPPORTED* = 2003 - ERROR_TRANSFORM_NOT_SUPPORTED* = 2004 - ERROR_CLIPPING_NOT_SUPPORTED* = 2005 - ERROR_UNKNOWN_PRINT_MONITOR* = 3000 - ERROR_PRINTER_DRIVER_IN_USE* = 3001 - ERROR_SPOOL_FILE_NOT_FOUND* = 3002 - ERROR_SPL_NO_STARTDOC* = 3003 - ERROR_SPL_NO_ADDJOB* = 3004 - ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED* = 3005 - ERROR_PRINT_MONITOR_ALREADY_INSTALLED* = 3006 - ERROR_INVALID_PRINT_MONITOR* = 3007 - ERROR_PRINT_MONITOR_IN_USE* = 3008 - ERROR_PRINTER_HAS_JOBS_QUEUED* = 3009 - ERROR_SUCCESS_REBOOT_REQUIRED* = 3010 - ERROR_SUCCESS_RESTART_REQUIRED* = 3011 - ERROR_WINS_INTERNAL* = 4000 - ERROR_CAN_NOT_DEL_LOCAL_WINS* = 4001 - ERROR_STATIC_INIT* = 4002 - ERROR_INC_BACKUP* = 4003 - ERROR_FULL_BACKUP* = 4004 - ERROR_REC_NON_EXISTENT* = 4005 - ERROR_RPL_NOT_ALLOWED* = 4006 - E_UNEXPECTED* = HRESULT(0x8000FFFF) - E_NOTIMPL* = HRESULT(0x80004001) - E_OUTOFMEMORY* = HRESULT(0x8007000E) - E_INVALIDARG* = HRESULT(0x80070057) - E_NOINTERFACE* = HRESULT(0x80004002) - E_POINTER* = HRESULT(0x80004003) - E_HANDLE* = HRESULT(0x80070006) - E_ABORT* = HRESULT(0x80004004) - E_FAIL* = HRESULT(0x80004005) - E_ACCESSDENIED* = HRESULT(0x80070005) - E_PENDING* = HRESULT(0x8000000A) - CO_E_INIT_TLS* = HRESULT(0x80004006) - CO_E_INIT_SHARED_ALLOCATOR* = HRESULT(0x80004007) - CO_E_INIT_MEMORY_ALLOCATOR* = HRESULT(0x80004008) - CO_E_INIT_CLASS_CACHE* = HRESULT(0x80004009) - CO_E_INIT_RPC_CHANNEL* = HRESULT(0x8000400A) - CO_E_INIT_TLS_SET_CHANNEL_CONTROL* = HRESULT(0x8000400B) - CO_E_INIT_TLS_CHANNEL_CONTROL* = HRESULT(0x8000400C) - CO_E_INIT_UNACCEPTED_USER_ALLOCATOR* = HRESULT(0x8000400D) - CO_E_INIT_SCM_MUTEX_EXISTS* = HRESULT(0x8000400E) - CO_E_INIT_SCM_FILE_MAPPING_EXISTS* = HRESULT(0x8000400F) - CO_E_INIT_SCM_MAP_VIEW_OF_FILE* = HRESULT(0x80004010) - CO_E_INIT_SCM_EXEC_FAILURE* = HRESULT(0x80004011) - CO_E_INIT_ONLY_SINGLE_THREADED* = HRESULT(0x80004012) - CO_E_CANT_REMOTE* = HRESULT(0x80004013) - CO_E_BAD_SERVER_NAME* = HRESULT(0x80004014) - CO_E_WRONG_SERVER_IDENTITY* = HRESULT(0x80004015) - CO_E_OLE1DDE_DISABLED* = HRESULT(0x80004016) - CO_E_RUNAS_SYNTAX* = HRESULT(0x80004017) - CO_E_CREATEPROCESS_FAILURE* = HRESULT(0x80004018) - CO_E_RUNAS_CREATEPROCESS_FAILURE* = HRESULT(0x80004019) - CO_E_RUNAS_LOGON_FAILURE* = HRESULT(0x8000401A) - CO_E_LAUNCH_PERMSSION_DENIED* = HRESULT(0x8000401B) - CO_E_START_SERVICE_FAILURE* = HRESULT(0x8000401C) - CO_E_REMOTE_COMMUNICATION_FAILURE* = HRESULT(0x8000401D) - CO_E_SERVER_START_TIMEOUT* = HRESULT(0x8000401E) - CO_E_CLSREG_INCONSISTENT* = HRESULT(0x8000401F) - CO_E_IIDREG_INCONSISTENT* = HRESULT(0x80004020) - CO_E_NOT_SUPPORTED* = HRESULT(0x80004021) - CO_E_FIRST* = DWORD(0x800401F0) - CO_E_LAST* = DWORD(0x800401FF) - CO_S_FIRST* = DWORD(0x000401F0) - CO_S_LAST* = DWORD(0x000401FF) - S_OK* = HRESULT(0x00000000) - S_FALSE* = HRESULT(0x00000001) - CO_E_NOTINITIALIZED* = HRESULT(0x800401F0) - CO_E_ALREADYINITIALIZED* = HRESULT(0x800401F1) - CO_E_CANTDETERMINECLASS* = HRESULT(0x800401F2) - CO_E_CLASSSTRING* = HRESULT(0x800401F3) - CO_E_IIDSTRING* = HRESULT(0x800401F4) - CO_E_APPNOTFOUND* = HRESULT(0x800401F5) - CO_E_APPSINGLEUSE* = HRESULT(0x800401F6) - CO_E_ERRORINAPP* = HRESULT(0x800401F7) - CO_E_DLLNOTFOUND* = HRESULT(0x800401F8) - CO_E_ERRORINDLL* = HRESULT(0x800401F9) - CO_E_WRONGOSFORAPP* = HRESULT(0x800401FA) - CO_E_OBJNOTREG* = HRESULT(0x800401FB) - CO_E_OBJISREG* = HRESULT(0x800401FC) - CO_E_OBJNOTCONNECTED* = HRESULT(0x800401FD) - CO_E_APPDIDNTREG* = HRESULT(0x800401FE) - CO_E_RELEASED* = HRESULT(0x800401FF) - OLE_E_FIRST* = HRESULT(0x80040000) - OLE_E_LAST* = HRESULT(0x800400FF) - OLE_S_FIRST* = HRESULT(0x00040000) - OLE_S_LAST* = HRESULT(0x000400FF) - OLE_E_OLEVERB* = HRESULT(0x80040000) - OLE_E_ADVF* = HRESULT(0x80040001) - OLE_E_ENUM_NOMORE* = HRESULT(0x80040002) - OLE_E_ADVISENOTSUPPORTED* = HRESULT(0x80040003) - OLE_E_NOCONNECTION* = HRESULT(0x80040004) - OLE_E_NOTRUNNING* = HRESULT(0x80040005) - OLE_E_NOCACHE* = HRESULT(0x80040006) - OLE_E_BLANK* = HRESULT(0x80040007) - OLE_E_CLASSDIFF* = HRESULT(0x80040008) - OLE_E_CANT_GETMONIKER* = HRESULT(0x80040009) - OLE_E_CANT_BINDTOSOURCE* = HRESULT(0x8004000A) - OLE_E_STATIC* = HRESULT(0x8004000B) - OLE_E_PROMPTSAVECANCELLED* = HRESULT(0x8004000C) - OLE_E_INVALIDRECT* = HRESULT(0x8004000D) - OLE_E_WRONGCOMPOBJ* = HRESULT(0x8004000E) - OLE_E_INVALIDHWND* = HRESULT(0x8004000F) - OLE_E_NOT_INPLACEACTIVE* = HRESULT(0x80040010) - OLE_E_CANTCONVERT* = HRESULT(0x80040011) - OLE_E_NOSTORAGE* = HRESULT(0x80040012) - DV_E_FORMATETC* = HRESULT(0x80040064) - DV_E_DVTARGETDEVICE* = HRESULT(0x80040065) - DV_E_STGMEDIUM* = HRESULT(0x80040066) - DV_E_STATDATA* = HRESULT(0x80040067) - DV_E_LINDEX* = HRESULT(0x80040068) - DV_E_TYMED* = HRESULT(0x80040069) - DV_E_CLIPFORMAT* = HRESULT(0x8004006A) - DV_E_DVASPECT* = HRESULT(0x8004006B) - DV_E_DVTARGETDEVICE_SIZE* = HRESULT(0x8004006C) - DV_E_NOIVIEWOBJECT* = HRESULT(0x8004006D) - DRAGDROP_E_FIRST* = DWORD(0x80040100) - DRAGDROP_E_LAST* = DWORD(0x8004010F) - DRAGDROP_S_FIRST* = DWORD(0x00040100) - DRAGDROP_S_LAST* = DWORD(0x0004010F) - DRAGDROP_E_NOTREGISTERED* = HRESULT(0x80040100) - DRAGDROP_E_ALREADYREGISTERED* = HRESULT(0x80040101) - DRAGDROP_E_INVALIDHWND* = HRESULT(0x80040102) - CLASSFACTORY_E_FIRST* = DWORD(0x80040110) - CLASSFACTORY_E_LAST* = DWORD(0x8004011F) - CLASSFACTORY_S_FIRST* = DWORD(0x00040110) - CLASSFACTORY_S_LAST* = DWORD(0x0004011F) - CLASS_E_NOAGGREGATION* = HRESULT(0x80040110) - CLASS_E_CLASSNOTAVAILABLE* = HRESULT(0x80040111) - MARSHAL_E_FIRST* = DWORD(0x80040120) - MARSHAL_E_LAST* = DWORD(0x8004012F) - MARSHAL_S_FIRST* = DWORD(0x00040120) - MARSHAL_S_LAST* = DWORD(0x0004012F) - DATA_E_FIRST* = DWORD(0x80040130) - DATA_E_LAST* = DWORD(0x8004013F) - DATA_S_FIRST* = DWORD(0x00040130) - DATA_S_LAST* = DWORD(0x0004013F) - VIEW_E_FIRST* = DWORD(0x80040140) - VIEW_E_LAST* = DWORD(0x8004014F) - VIEW_S_FIRST* = DWORD(0x00040140) - VIEW_S_LAST* = DWORD(0x0004014F) - VIEW_E_DRAW* = HRESULT(0x80040140) - REGDB_E_FIRST* = DWORD(0x80040150) - REGDB_E_LAST* = DWORD(0x8004015F) - REGDB_S_FIRST* = DWORD(0x00040150) - REGDB_S_LAST* = DWORD(0x0004015F) - REGDB_E_READREGDB* = HRESULT(0x80040150) - REGDB_E_WRITEREGDB* = HRESULT(0x80040151) - REGDB_E_KEYMISSING* = HRESULT(0x80040152) - REGDB_E_INVALIDVALUE* = HRESULT(0x80040153) - REGDB_E_CLASSNOTREG* = HRESULT(0x80040154) - REGDB_E_IIDNOTREG* = HRESULT(0x80040155) - CACHE_E_FIRST* = DWORD(0x80040170) - CACHE_E_LAST* = DWORD(0x8004017F) - CACHE_S_FIRST* = DWORD(0x00040170) - CACHE_S_LAST* = DWORD(0x0004017F) - CACHE_E_NOCACHE_UPDATED* = HRESULT(0x80040170) - OLEOBJ_E_FIRST* = DWORD(0x80040180) - OLEOBJ_E_LAST* = DWORD(0x8004018F) - OLEOBJ_S_FIRST* = DWORD(0x00040180) - OLEOBJ_S_LAST* = DWORD(0x0004018F) - OLEOBJ_E_NOVERBS* = HRESULT(0x80040180) - OLEOBJ_E_INVALIDVERB* = HRESULT(0x80040181) - CLIENTSITE_E_FIRST* = DWORD(0x80040190) - CLIENTSITE_E_LAST* = DWORD(0x8004019F) - CLIENTSITE_S_FIRST* = DWORD(0x00040190) - CLIENTSITE_S_LAST* = DWORD(0x0004019F) - INPLACE_E_NOTUNDOABLE* = HRESULT(0x800401A0) - INPLACE_E_NOTOOLSPACE* = HRESULT(0x800401A1) - INPLACE_E_FIRST* = DWORD(0x800401A0) - INPLACE_E_LAST* = DWORD(0x800401AF) - INPLACE_S_FIRST* = DWORD(0x000401A0) - INPLACE_S_LAST* = DWORD(0x000401AF) - ENUM_E_FIRST* = DWORD(0x800401B0) - ENUM_E_LAST* = DWORD(0x800401BF) - ENUM_S_FIRST* = DWORD(0x000401B0) - ENUM_S_LAST* = DWORD(0x000401BF) - CONVERT10_E_FIRST* = DWORD(0x800401C0) - CONVERT10_E_LAST* = DWORD(0x800401CF) - CONVERT10_S_FIRST* = DWORD(0x000401C0) - CONVERT10_S_LAST* = DWORD(0x000401CF) - CONVERT10_E_OLESTREAM_GET* = HRESULT(0x800401C0) - CONVERT10_E_OLESTREAM_PUT* = HRESULT(0x800401C1) - CONVERT10_E_OLESTREAM_FMT* = HRESULT(0x800401C2) - CONVERT10_E_OLESTREAM_BITMAP_TO_DIB* = HRESULT(0x800401C3) - CONVERT10_E_STG_FMT* = HRESULT(0x800401C4) - CONVERT10_E_STG_NO_STD_STREAM* = HRESULT(0x800401C5) - CONVERT10_E_STG_DIB_TO_BITMAP* = HRESULT(0x800401C6) - CLIPBRD_E_FIRST* = DWORD(0x800401D0) - CLIPBRD_E_LAST* = DWORD(0x800401DF) - CLIPBRD_S_FIRST* = DWORD(0x000401D0) - CLIPBRD_S_LAST* = DWORD(0x000401DF) - CLIPBRD_E_CANT_OPEN* = HRESULT(0x800401D0) - CLIPBRD_E_CANT_EMPTY* = HRESULT(0x800401D1) - CLIPBRD_E_CANT_SET* = HRESULT(0x800401D2) - CLIPBRD_E_BAD_DATA* = HRESULT(0x800401D3) - CLIPBRD_E_CANT_CLOSE* = HRESULT(0x800401D4) - MK_E_FIRST* = DWORD(0x800401E0) - MK_E_LAST* = DWORD(0x800401EF) - MK_S_FIRST* = DWORD(0x000401E0) - MK_S_LAST* = DWORD(0x000401EF) - MK_E_CONNECTMANUALLY* = HRESULT(0x800401E0) - MK_E_EXCEEDEDDEADLINE* = HRESULT(0x800401E1) - MK_E_NEEDGENERIC* = HRESULT(0x800401E2) - MK_E_UNAVAILABLE* = HRESULT(0x800401E3) - MK_E_SYNTAX* = HRESULT(0x800401E4) - MK_E_NOOBJECT* = HRESULT(0x800401E5) - MK_E_INVALIDEXTENSION* = HRESULT(0x800401E6) - MK_E_INTERMEDIATEINTERFACENOTSUPPORTED* = HRESULT(0x800401E7) - MK_E_NOTBINDABLE* = HRESULT(0x800401E8) - MK_E_NOTBOUND* = HRESULT(0x800401E9) - MK_E_CANTOPENFILE* = HRESULT(0x800401EA) - MK_E_MUSTBOTHERUSER* = HRESULT(0x800401EB) - MK_E_NOINVERSE* = HRESULT(0x800401EC) - MK_E_NOSTORAGE* = HRESULT(0x800401ED) - MK_E_NOPREFIX* = HRESULT(0x800401EE) - MK_E_ENUMERATION_FAILED* = HRESULT(0x800401EF) - OLE_S_USEREG* = HRESULT(0x00040000) - OLE_S_STATIC* = HRESULT(0x00040001) - OLE_S_MAC_CLIPFORMAT* = HRESULT(0x00040002) - DRAGDROP_S_DROP* = HRESULT(0x00040100) - DRAGDROP_S_CANCEL* = HRESULT(0x00040101) - DRAGDROP_S_USEDEFAULTCURSORS* = HRESULT(0x00040102) - DATA_S_SAMEFORMATETC* = HRESULT(0x00040130) - VIEW_S_ALREADY_FROZEN* = HRESULT(0x00040140) - CACHE_S_FORMATETC_NOTSUPPORTED* = HRESULT(0x00040170) - CACHE_S_SAMECACHE* = HRESULT(0x00040171) - CACHE_S_SOMECACHES_NOTUPDATED* = HRESULT(0x00040172) - OLEOBJ_S_INVALIDVERB* = HRESULT(0x00040180) - OLEOBJ_S_CANNOT_DOVERB_NOW* = HRESULT(0x00040181) - OLEOBJ_S_INVALIDHWND* = HRESULT(0x00040182) - INPLACE_S_TRUNCATED* = HRESULT(0x000401A0) - CONVERT10_S_NO_PRESENTATION* = HRESULT(0x000401C0) - MK_S_REDUCED_TO_SELF* = HRESULT(0x000401E2) - MK_S_ME* = HRESULT(0x000401E4) - MK_S_HIM* = HRESULT(0x000401E5) - MK_S_US* = HRESULT(0x000401E6) - MK_S_MONIKERALREADYREGISTERED* = HRESULT(0x000401E7) - CO_E_CLASS_CREATE_FAILED* = HRESULT(0x80080001) - CO_E_SCM_ERROR* = HRESULT(0x80080002) - CO_E_SCM_RPC_FAILURE* = HRESULT(0x80080003) - CO_E_BAD_PATH* = HRESULT(0x80080004) - CO_E_SERVER_EXEC_FAILURE* = HRESULT(0x80080005) - CO_E_OBJSRV_RPC_FAILURE* = HRESULT(0x80080006) - MK_E_NO_NORMALIZED* = HRESULT(0x80080007) - CO_E_SERVER_STOPPING* = HRESULT(0x80080008) - MEM_E_INVALID_ROOT* = HRESULT(0x80080009) - MEM_E_INVALID_LINK* = HRESULT(0x80080010) - MEM_E_INVALID_SIZE* = HRESULT(0x80080011) - CO_S_NOTALLINTERFACES* = HRESULT(0x00080012) - DISP_E_UNKNOWNINTERFACE* = HRESULT(0x80020001) - DISP_E_MEMBERNOTFOUND* = HRESULT(0x80020003) - DISP_E_PARAMNOTFOUND* = HRESULT(0x80020004) - DISP_E_TYPEMISMATCH* = HRESULT(0x80020005) - DISP_E_UNKNOWNNAME* = HRESULT(0x80020006) - DISP_E_NONAMEDARGS* = HRESULT(0x80020007) - DISP_E_BADVARTYPE* = HRESULT(0x80020008) - DISP_E_EXCEPTION* = HRESULT(0x80020009) - DISP_E_OVERFLOW* = HRESULT(0x8002000A) - DISP_E_BADINDEX* = HRESULT(0x8002000B) - DISP_E_UNKNOWNLCID* = HRESULT(0x8002000C) - DISP_E_ARRAYISLOCKED* = HRESULT(0x8002000D) - DISP_E_BADPARAMCOUNT* = HRESULT(0x8002000E) - DISP_E_PARAMNOTOPTIONAL* = HRESULT(0x8002000F) - DISP_E_BADCALLEE* = HRESULT(0x80020010) - DISP_E_NOTACOLLECTION* = HRESULT(0x80020011) - TYPE_E_BUFFERTOOSMALL* = HRESULT(0x80028016) - TYPE_E_INVDATAREAD* = HRESULT(0x80028018) - TYPE_E_UNSUPFORMAT* = HRESULT(0x80028019) - TYPE_E_REGISTRYACCESS* = HRESULT(0x8002801C) - TYPE_E_LIBNOTREGISTERED* = HRESULT(0x8002801D) - TYPE_E_UNDEFINEDTYPE* = HRESULT(0x80028027) - TYPE_E_QUALIFIEDNAMEDISALLOWED* = HRESULT(0x80028028) - TYPE_E_INVALIDSTATE* = HRESULT(0x80028029) - TYPE_E_WRONGTYPEKIND* = HRESULT(0x8002802A) - TYPE_E_ELEMENTNOTFOUND* = HRESULT(0x8002802B) - TYPE_E_AMBIGUOUSNAME* = HRESULT(0x8002802C) - TYPE_E_NAMECONFLICT* = HRESULT(0x8002802D) - TYPE_E_UNKNOWNLCID* = HRESULT(0x8002802E) - TYPE_E_DLLFUNCTIONNOTFOUND* = HRESULT(0x8002802F) - TYPE_E_BADMODULEKIND* = HRESULT(0x800288BD) - TYPE_E_SIZETOOBIG* = HRESULT(0x800288C5) - TYPE_E_DUPLICATEID* = HRESULT(0x800288C6) - TYPE_E_INVALIDID* = HRESULT(0x800288CF) - TYPE_E_TYPEMISMATCH* = HRESULT(0x80028CA0) - TYPE_E_OUTOFBOUNDS* = HRESULT(0x80028CA1) - TYPE_E_IOERROR* = HRESULT(0x80028CA2) - TYPE_E_CANTCREATETMPFILE* = HRESULT(0x80028CA3) - TYPE_E_CANTLOADLIBRARY* = HRESULT(0x80029C4A) - TYPE_E_INCONSISTENTPROPFUNCS* = HRESULT(0x80029C83) - TYPE_E_CIRCULARTYPE* = HRESULT(0x80029C84) - STG_E_INVALIDFUNCTION* = HRESULT(0x80030001) - STG_E_FILENOTFOUND* = HRESULT(0x80030002) - STG_E_PATHNOTFOUND* = HRESULT(0x80030003) - STG_E_TOOMANYOPENFILES* = HRESULT(0x80030004) - STG_E_ACCESSDENIED* = HRESULT(0x80030005) - STG_E_INVALIDHANDLE* = HRESULT(0x80030006) - STG_E_INSUFFICIENTMEMORY* = HRESULT(0x80030008) - STG_E_INVALIDPOINTER* = HRESULT(0x80030009) - STG_E_NOMOREFILES* = HRESULT(0x80030012) - STG_E_DISKISWRITEPROTECTED* = HRESULT(0x80030013) - STG_E_SEEKERROR* = HRESULT(0x80030019) - STG_E_WRITEFAULT* = HRESULT(0x8003001D) - STG_E_READFAULT* = HRESULT(0x8003001E) - STG_E_SHAREVIOLATION* = HRESULT(0x80030020) - STG_E_LOCKVIOLATION* = HRESULT(0x80030021) - STG_E_FILEALREADYEXISTS* = HRESULT(0x80030050) - STG_E_INVALIDPARAMETER* = HRESULT(0x80030057) - STG_E_MEDIUMFULL* = HRESULT(0x80030070) - STG_E_PROPSETMISMATCHED* = HRESULT(0x800300F0) - STG_E_ABNORMALAPIEXIT* = HRESULT(0x800300FA) - STG_E_INVALIDHEADER* = HRESULT(0x800300FB) - STG_E_INVALIDNAME* = HRESULT(0x800300FC) - STG_E_UNKNOWN* = HRESULT(0x800300FD) - STG_E_UNIMPLEMENTEDFUNCTION* = HRESULT(0x800300FE) - STG_E_INVALIDFLAG* = HRESULT(0x800300FF) - STG_E_INUSE* = HRESULT(0x80030100) - STG_E_NOTCURRENT* = HRESULT(0x80030101) - STG_E_REVERTED* = HRESULT(0x80030102) - STG_E_CANTSAVE* = HRESULT(0x80030103) - STG_E_OLDFORMAT* = HRESULT(0x80030104) - STG_E_OLDDLL* = HRESULT(0x80030105) - STG_E_SHAREREQUIRED* = HRESULT(0x80030106) - STG_E_NOTFILEBASEDSTORAGE* = HRESULT(0x80030107) - STG_E_EXTANTMARSHALLINGS* = HRESULT(0x80030108) - STG_E_DOCFILECORRUPT* = HRESULT(0x80030109) - STG_E_BADBASEADDRESS* = HRESULT(0x80030110) - STG_E_INCOMPLETE* = HRESULT(0x80030201) - STG_E_TERMINATED* = HRESULT(0x80030202) - STG_S_CONVERTED* = HRESULT(0x00030200) - STG_S_BLOCK* = HRESULT(0x00030201) - STG_S_RETRYNOW* = HRESULT(0x00030202) - STG_S_MONITORING* = HRESULT(0x00030203) - RPC_E_CALL_REJECTED* = HRESULT(0x80010001) - RPC_E_CALL_CANCELED* = HRESULT(0x80010002) - RPC_E_CANTPOST_INSENDCALL* = HRESULT(0x80010003) - RPC_E_CANTCALLOUT_INASYNCCALL* = HRESULT(0x80010004) - RPC_E_CANTCALLOUT_INEXTERNALCALL* = HRESULT(0x80010005) - RPC_E_CONNECTION_TERMINATED* = HRESULT(0x80010006) - RPC_E_SERVER_DIED* = HRESULT(0x80010007) - RPC_E_CLIENT_DIED* = HRESULT(0x80010008) - RPC_E_INVALID_DATAPACKET* = HRESULT(0x80010009) - RPC_E_CANTTRANSMIT_CALL* = HRESULT(0x8001000A) - RPC_E_CLIENT_CANTMARSHAL_DATA* = HRESULT(0x8001000B) - RPC_E_CLIENT_CANTUNMARSHAL_DATA* = HRESULT(0x8001000C) - RPC_E_SERVER_CANTMARSHAL_DATA* = HRESULT(0x8001000D) - RPC_E_SERVER_CANTUNMARSHAL_DATA* = HRESULT(0x8001000E) - RPC_E_INVALID_DATA* = HRESULT(0x8001000F) - RPC_E_INVALID_PARAMETER* = HRESULT(0x80010010) - RPC_E_CANTCALLOUT_AGAIN* = HRESULT(0x80010011) - RPC_E_SERVER_DIED_DNE* = HRESULT(0x80010012) - RPC_E_SYS_CALL_FAILED* = HRESULT(0x80010100) - RPC_E_OUT_OF_RESOURCES* = HRESULT(0x80010101) - RPC_E_ATTEMPTED_MULTITHREAD* = HRESULT(0x80010102) - RPC_E_NOT_REGISTERED* = HRESULT(0x80010103) - RPC_E_FAULT* = HRESULT(0x80010104) - RPC_E_SERVERFAULT* = HRESULT(0x80010105) - RPC_E_CHANGED_MODE* = HRESULT(0x80010106) - RPC_E_INVALIDMETHOD* = HRESULT(0x80010107) - RPC_E_DISCONNECTED* = HRESULT(0x80010108) - RPC_E_RETRY* = HRESULT(0x80010109) - RPC_E_SERVERCALL_RETRYLATER* = HRESULT(0x8001010A) - RPC_E_SERVERCALL_REJECTED* = HRESULT(0x8001010B) - RPC_E_INVALID_CALLDATA* = HRESULT(0x8001010C) - RPC_E_CANTCALLOUT_ININPUTSYNCCALL* = HRESULT(0x8001010D) - RPC_E_WRONG_THREAD* = HRESULT(0x8001010E) - RPC_E_THREAD_NOT_INIT* = HRESULT(0x8001010F) - RPC_E_VERSION_MISMATCH* = HRESULT(0x80010110) - RPC_E_INVALID_HEADER* = HRESULT(0x80010111) - RPC_E_INVALID_EXTENSION* = HRESULT(0x80010112) - RPC_E_INVALID_IPID* = HRESULT(0x80010113) - RPC_E_INVALID_OBJECT* = HRESULT(0x80010114) - RPC_S_CALLPENDING* = HRESULT(0x80010115) - RPC_S_WAITONTIMER* = HRESULT(0x80010116) - RPC_E_CALL_COMPLETE* = HRESULT(0x80010117) - RPC_E_UNSECURE_CALL* = HRESULT(0x80010118) - RPC_E_TOO_LATE* = HRESULT(0x80010119) - RPC_E_NO_GOOD_SECURITY_PACKAGES* = HRESULT(0x8001011A) - RPC_E_ACCESS_DENIED* = HRESULT(0x8001011B) - RPC_E_REMOTE_DISABLED* = HRESULT(0x8001011C) - RPC_E_INVALID_OBJREF* = HRESULT(0x8001011D) - RPC_E_UNEXPECTED* = HRESULT(0x8001FFFF) - NTE_BAD_UID* = HRESULT(0x80090001) - NTE_BAD_HASH* = HRESULT(0x80090002) - NTE_BAD_KEY* = HRESULT(0x80090003) - NTE_BAD_LEN* = HRESULT(0x80090004) - NTE_BAD_DATA* = HRESULT(0x80090005) - NTE_BAD_SIGNATURE* = HRESULT(0x80090006) - NTE_BAD_VER* = HRESULT(0x80090007) - NTE_BAD_ALGID* = HRESULT(0x80090008) - NTE_BAD_FLAGS* = HRESULT(0x80090009) - NTE_BAD_TYPE* = HRESULT(0x8009000A) - NTE_BAD_KEY_STATE* = HRESULT(0x8009000B) - NTE_BAD_HASH_STATE* = HRESULT(0x8009000C) - NTE_NO_KEY* = HRESULT(0x8009000D) - NTE_NO_MEMORY* = HRESULT(0x8009000E) - NTE_EXISTS* = HRESULT(0x8009000F) - NTE_PERM* = HRESULT(0x80090010) - NTE_NOT_FOUND* = HRESULT(0x80090011) - NTE_DOUBLE_ENCRYPT* = HRESULT(0x80090012) - NTE_BAD_PROVIDER* = HRESULT(0x80090013) - NTE_BAD_PROV_TYPE* = HRESULT(0x80090014) - NTE_BAD_PUBLIC_KEY* = HRESULT(0x80090015) - NTE_BAD_KEYSET* = HRESULT(0x80090016) - NTE_PROV_TYPE_NOT_DEF* = HRESULT(0x80090017) - NTE_PROV_TYPE_ENTRY_BAD* = HRESULT(0x80090018) - NTE_KEYSET_NOT_DEF* = HRESULT(0x80090019) - NTE_KEYSET_ENTRY_BAD* = HRESULT(0x8009001A) - NTE_PROV_TYPE_NO_MATCH* = HRESULT(0x8009001B) - NTE_SIGNATURE_FILE_BAD* = HRESULT(0x8009001C) - NTE_PROVIDER_DLL_FAIL* = HRESULT(0x8009001D) - NTE_PROV_DLL_NOT_FOUND* = HRESULT(0x8009001E) - NTE_BAD_KEYSET_PARAM* = HRESULT(0x8009001F) - NTE_FAIL* = HRESULT(0x80090020) - NTE_SYS_ERR* = HRESULT(0x80090021) - NTE_OP_OK* = HRESULT(0) - TRUST_E_PROVIDER_UNKNOWN* = HRESULT(0x800B0001) - TRUST_E_ACTION_UNKNOWN* = HRESULT(0x800B0002) - TRUST_E_SUBJECT_FORM_UNKNOWN* = HRESULT(0x800B0003) - TRUST_E_SUBJECT_NOT_TRUSTED* = HRESULT(0x800B0004) - DIGSIG_E_ENCODE* = HRESULT(0x800B0005) - DIGSIG_E_DECODE* = HRESULT(0x800B0006) - DIGSIG_E_EXTENSIBILITY* = HRESULT(0x800B0007) - DIGSIG_E_CRYPTO* = HRESULT(0x800B0008) - PERSIST_E_SIZEDEFINITE* = HRESULT(0x800B0009) - PERSIST_E_SIZEINDEFINITE* = HRESULT(0x800B000A) - PERSIST_E_NOTSELFSIZING* = HRESULT(0x800B000B) - TRUST_E_NOSIGNATURE* = HRESULT(0x800B0100) - CERT_E_EXPIRED* = HRESULT(0x800B0101) - CERT_E_VALIDIYPERIODNESTING* = HRESULT(0x800B0102) - CERT_E_ROLE* = HRESULT(0x800B0103) - CERT_E_PATHLENCONST* = HRESULT(0x800B0104) - CERT_E_CRITICAL* = HRESULT(0x800B0105) - CERT_E_PURPOSE* = HRESULT(0x800B0106) - CERT_E_ISSUERCHAINING* = HRESULT(0x800B0107) - CERT_E_MALFORMED* = HRESULT(0x800B0108) - CERT_E_UNTRUSTEDROOT* = HRESULT(0x800B0109) - CERT_E_CHAINING* = HRESULT(0x800B010A) - -proc UNICODE_NULL*(): WCHAR -const - LF_FACESIZE* = 32 - LF_FULLFACESIZE* = 64 - ELF_VENDOR_SIZE* = 4 - SECURITY_STATIC_TRACKING* = 0 - SECURITY_DYNAMIC_TRACKING* = 1 - MAX_DEFAULTCHAR* = 2 - MAX_LEADBYTES* = 12 - EXCEPTION_MAXIMUM_PARAMETERS* = 15 - CCHDEVICENAME* = 32 - CCHFORMNAME* = 32 - MENU_TEXT_LEN* = 40 - MAX_LANA* = 254 - NCBNAMSZ* = 16 - NETBIOS_NAME_LEN* = 16 - OFS_MAXPATHNAME* = 128 - MAX_TAB_STOPS* = 32 - ANYSIZE_ARRAY* = 1 - RAS_MaxCallbackNumber* = 128 - RAS_MaxDeviceName* = 128 - RAS_MaxDeviceType* = 16 - RAS_MaxEntryName* = 256 - RAS_MaxIpAddress* = 15 - RAS_MaxIpxAddress* = 21 - RAS_MaxPhoneNumber* = 128 - UNLEN* = 256 - PWLEN* = 256 - CNLEN* = 15 - DNLEN* = 15 - # Unsigned types max - MAXDWORD* = 0xFFFFFFFF - MAXWORD* = 0x0000FFFF - MAXBYTE* = 0x000000FF - # Signed types max/min - MINCHAR* = 0x00000080 - MAXCHAR* = 0x0000007F - MINSHORT* = 0x00008000 - MAXSHORT* = 0x00007FFF - MINLONG* = 0x80000000 - MAXLONG* = 0x7FFFFFFF - # _llseek - FILE_BEGIN* = 0 - FILE_CURRENT* = 1 - FILE_END* = 2 - # _lopen, LZOpenFile, OpenFile - OF_READ* = 0 - OF_READWRITE* = 2 - OF_WRITE* = 1 - OF_SHARE_COMPAT* = 0 - OF_SHARE_DENY_NONE* = 64 - OF_SHARE_DENY_READ* = 48 - OF_SHARE_DENY_WRITE* = 32 - OF_SHARE_EXCLUSIVE* = 16 - OF_CANCEL* = 2048 - OF_CREATE* = 4096 - OF_DELETE* = 512 - OF_EXIST* = 16384 - OF_PARSE* = 256 - OF_PROMPT* = 8192 - OF_REOPEN* = 32768 - OF_VERIFY* = 1024 - # ActivateKeyboardLayout, LoadKeyboardLayout - HKL_NEXT* = 1 - HKL_PREV* = 0 - KLF_REORDER* = 8 - KLF_UNLOADPREVIOUS* = 4 - KLF_ACTIVATE* = 1 - KLF_NOTELLSHELL* = 128 - KLF_REPLACELANG* = 16 - KLF_SUBSTITUTE_OK* = 2 - # AppendMenu - MF_BITMAP* = 0x00000004 - MF_DISABLED* = 0x00000002 - MF_ENABLED* = 0 - MF_GRAYED* = 0x00000001 - MF_HELP* = 0x00004000 - MF_MENUBARBREAK* = 0x00000020 - MF_MENUBREAK* = 0x00000040 - MF_MOUSESELECT* = 0x00008000 - MF_OWNERDRAW* = 0x00000100 - MF_POPUP* = 0x00000010 - MF_SEPARATOR* = 0x00000800 - MF_STRING* = 0 - MF_SYSMENU* = 0x00002000 - MF_USECHECKBITMAPS* = 0x00000200 - # Ternary Raster Operations - BitBlt - BLACKNESS* = 0x00000042 - NOTSRCERASE* = 0x001100A6 - NOTSRCCOPY* = 0x00330008 - SRCERASE* = 0x00440328 - DSTINVERT* = 0x00550009 - PATINVERT* = 0x005A0049 - SRCINVERT* = 0x00660046 - SRCAND* = 0x008800C6 - MERGEPAINT* = 0x00BB0226 - MERGECOPY* = 0x00C000CA - SRCCOPY* = 0x00CC0020 - SRCPAINT* = 0x00EE0086 - PATCOPY* = 0x00F00021 - PATPAINT* = 0x00FB0A09 - WHITENESS* = 0x00FF0062 - # Binary Raster Operations - R2_BLACK* = 1 - R2_COPYPEN* = 13 - R2_MASKNOTPEN* = 3 - R2_MASKPEN* = 9 - R2_MASKPENNOT* = 5 - R2_MERGENOTPEN* = 12 - R2_MERGEPEN* = 15 - R2_MERGEPENNOT* = 14 - R2_NOP* = 11 - R2_NOT* = 6 - R2_NOTCOPYPEN* = 4 - R2_NOTMASKPEN* = 8 - R2_NOTMERGEPEN* = 2 - R2_NOTXORPEN* = 10 - R2_WHITE* = 16 - R2_XORPEN* = 7 - # BroadcastSystemMessage - BSF_FLUSHDISK* = 4 - BSF_FORCEIFHUNG* = 32 - BSF_IGNORECURRENTTASK* = 2 - BSF_NOHANG* = 8 - BSF_POSTMESSAGE* = 16 - BSF_QUERY* = 1 - BSM_ALLCOMPONENTS* = 0 - BSM_APPLICATIONS* = 8 - BSM_INSTALLABLEDRIVERS* = 4 - BSM_NETDRIVER* = 2 - BSM_VXDS* = 1 - BROADCAST_QUERY_DENY* = 1112363332 - # CallNamedPipe - NMPWAIT_NOWAIT* = 1 - NMPWAIT_WAIT_FOREVER* = -1 - NMPWAIT_USE_DEFAULT_WAIT* = 0 - # CascadeWindows, TileWindows - MDITILE_SKIPDISABLED* = 2 - MDITILE_HORIZONTAL* = 1 - MDITILE_VERTICAL* = 0 - # CBTProc - HCBT_ACTIVATE* = 5 - HCBT_CLICKSKIPPED* = 6 - HCBT_CREATEWND* = 3 - HCBT_DESTROYWND* = 4 - HCBT_KEYSKIPPED* = 7 - HCBT_MINMAX* = 1 - HCBT_MOVESIZE* = 0 - HCBT_QS* = 2 - HCBT_SETFOCUS* = 9 - HCBT_SYSCOMMAND* = 8 - - CDS_UPDATEREGISTRY* = 1 - CDS_TEST* = 2 - CDS_FULLSCREEN* = 4 - CDS_GLOBAL* = 8 - CDS_SET_PRIMARY* = 0x00000010 - CDS_RESET* = 0x40000000 - CDS_SETRECT* = 0x20000000 - CDS_NORESET* = 0x10000000 - DISP_CHANGE_SUCCESSFUL* = 0 - DISP_CHANGE_RESTART* = 1 - DISP_CHANGE_BADFLAGS* = -4 - DISP_CHANGE_FAILED* = -1 - DISP_CHANGE_BADMODE* = -2 - DISP_CHANGE_NOTUPDATED* = -3 - # ChangeServiceConfig - SERVICE_NO_CHANGE* = -1 - SERVICE_WIN32_OWN_PROCESS* = 16 - SERVICE_WIN32_SHARE_PROCESS* = 32 - SERVICE_KERNEL_DRIVER* = 1 - SERVICE_FILE_SYSTEM_DRIVER* = 2 - SERVICE_INTERACTIVE_PROCESS* = 256 - SERVICE_BOOT_START* = 0 - SERVICE_SYSTEM_START* = 1 - SERVICE_AUTO_START* = 2 - SERVICE_DEMAND_START* = 3 - SERVICE_DISABLED* = 4 - SERVICE_STOPPED* = 1 - SERVICE_START_PENDING* = 2 - SERVICE_STOP_PENDING* = 3 - SERVICE_RUNNING* = 4 - SERVICE_CONTINUE_PENDING* = 5 - SERVICE_PAUSE_PENDING* = 6 - SERVICE_PAUSED* = 7 - SERVICE_ACCEPT_STOP* = 1 - SERVICE_ACCEPT_PAUSE_CONTINUE* = 2 - SERVICE_ACCEPT_SHUTDOWN* = 4 - # CheckDlgButton - BST_CHECKED* = 1 - BST_INDETERMINATE* = 2 - BST_UNCHECKED* = 0 - BST_FOCUS* = 8 - BST_PUSHED* = 4 - # CheckMenuItem, HiliteMenuItem - MF_BYCOMMAND* = 0 - MF_BYPOSITION* = 0x00000400 - MF_CHECKED* = 0x00000008 - MF_UNCHECKED* = 0 - MF_HILITE* = 0x00000080 - MF_UNHILITE* = 0 - # ChildWindowFromPointEx - CWP_ALL* = 0 - CWP_SKIPINVISIBLE* = 1 - CWP_SKIPDISABLED* = 2 - CWP_SKIPTRANSPARENT* = 4 - # ClearCommError - CE_BREAK* = 16 - CE_DNS* = 2048 - CE_FRAME* = 8 - CE_IOE* = 1024 - CE_MODE* = 32768 - CE_OOP* = 4096 - CE_OVERRUN* = 2 - CE_PTO* = 512 - CE_RXOVER* = 1 - CE_RXPARITY* = 4 - CE_TXFULL* = 256 - # CombineRgn - RGN_AND* = 1 - RGN_COPY* = 5 - RGN_DIFF* = 4 - RGN_OR* = 2 - RGN_XOR* = 3 - NULLREGION* = 1 - SIMPLEREGION* = 2 - COMPLEXREGION* = 3 - ERROR* = 0 - # CommonDlgExtendedError - CDERR_DIALOGFAILURE* = 0x0000FFFF - CDERR_FINDRESFAILURE* = 6 - CDERR_INITIALIZATION* = 2 - CDERR_LOADRESFAILURE* = 7 - CDERR_LOADSTRFAILURE* = 5 - CDERR_LOCKRESFAILURE* = 8 - CDERR_MEMALLOCFAILURE* = 9 - CDERR_MEMLOCKFAILURE* = 10 - CDERR_NOHINSTANCE* = 4 - CDERR_NOHOOK* = 11 - CDERR_NOTEMPLATE* = 3 - CDERR_REGISTERMSGFAIL* = 12 - CDERR_STRUCTSIZE* = 1 - PDERR_CREATEICFAILURE* = 0x00001000 + 10 - PDERR_DEFAULTDIFFERENT* = 0x00001000 + 12 - PDERR_DNDMMISMATCH* = 0x00001000 + 9 - PDERR_GETDEVMODEFAIL* = 0x00001000 + 5 - PDERR_INITFAILURE* = 0x00001000 + 6 - PDERR_LOADDRVFAILURE* = 0x00001000 + 4 - PDERR_NODEFAULTPRN* = 0x00001000 + 8 - PDERR_NODEVICES* = 0x00001000 + 7 - PDERR_PARSEFAILURE* = 0x00001000 + 2 - PDERR_PRINTERNOTFOUND* = 0x00001000 + 11 - PDERR_RETDEFFAILURE* = 0x00001000 + 3 - PDERR_SETUPFAILURE* = 0x00001000 + 1 - CFERR_MAXLESSTHANMIN* = 0x00002000 + 2 - CFERR_NOFONTS* = 0x00002000 + 1 - FNERR_BUFFERTOOSMALL* = 0x00003000 + 3 - FNERR_INVALIDFILENAME* = 0x00003000 + 2 - FNERR_SUBCLASSFAILURE* = 0x00003000 + 1 - FRERR_BUFFERLENGTHZERO* = 0x00004000 + 1 - # CompareString, LCMapString - LOCALE_SYSTEM_DEFAULT* = 0x00000800 - LOCALE_USER_DEFAULT* = 0x00000400 - NORM_IGNORECASE* = 1 - NORM_IGNOREKANATYPE* = 65536 - NORM_IGNORENONSPACE* = 2 - NORM_IGNORESYMBOLS* = 4 - NORM_IGNOREWIDTH* = 131072 - SORT_STRINGSORT* = 4096 - LCMAP_BYTEREV* = 2048 - LCMAP_FULLWIDTH* = 8388608 - LCMAP_HALFWIDTH* = 4194304 - LCMAP_HIRAGANA* = 1048576 - LCMAP_KATAKANA* = 2097152 - LCMAP_LOWERCASE* = 256 - LCMAP_SORTKEY* = 1024 - LCMAP_UPPERCASE* = 512 - # ContinueDebugEvent - DBG_CONTINUE* = 0x00010002 - DBG_CONTROL_BREAK* = 0x40010008 - DBG_CONTROL_C* = 0x40010005 - DBG_EXCEPTION_NOT_HANDLED* = 0x80010001 - DBG_TERMINATE_THREAD* = 0x40010003 - DBG_TERMINATE_PROCESS* = 0x40010004 - # ControlService - SERVICE_CONTROL_STOP* = 1 - SERVICE_CONTROL_PAUSE* = 2 - SERVICE_CONTROL_CONTINUE* = 3 - SERVICE_CONTROL_INTERROGATE* = 4 - SERVICE_CONTROL_SHUTDOWN* = 5 - # CopyImage, LoadImage - IMAGE_BITMAP* = 0 - IMAGE_CURSOR* = 2 - IMAGE_ENHMETAFILE* = 1 - IMAGE_ICON* = 1 - LR_MONOCHROME* = 1 - LR_COLOR* = 2 - LR_COPYRETURNORG* = 4 - LR_COPYDELETEORG* = 8 - LR_DEFAULTSIZE* = 64 - LR_CREATEDIBSECTION* = 8192 - LR_COPYFROMRESOURCE* = 0x00004000 - LR_SHARED* = 0x00008000 - # CreateDesktop - DF_ALLOWOTHERACCOUNTHOOK* = 0x00000001 - DESKTOP_CREATEMENU* = 0x00000004 - DESKTOP_CREATEWINDOW* = 0x00000002 - DESKTOP_ENUMERATE* = 0x00000040 - DESKTOP_HOOKCONTROL* = 0x00000008 - DESKTOP_JOURNALPLAYBACK* = 0x00000020 - DESKTOP_JOURNALRECORD* = 0x00000010 - DESKTOP_READOBJECTS* = 0x00000001 - DESKTOP_SWITCHDESKTOP* = 0x00000100 - DESKTOP_WRITEOBJECTS* = 0x00000080 - WSF_VISIBLE* = 0x00000001 - # CreateDIBitmap - CBM_INIT* = 0x00000004 - DIB_PAL_COLORS* = 1 - DIB_RGB_COLORS* = 0 - # CreateFile, GetFileAttributes, SetFileAttributes - GENERIC_READ* = 0x80000000 - GENERIC_WRITE* = 0x40000000 - FILE_READ_DATA* = 0x00000001 # file & pipe - FILE_LIST_DIRECTORY* = 0x00000001 # directory - FILE_WRITE_DATA* = 0x00000002 # file & pipe - FILE_ADD_FILE* = 0x00000002 # directory - FILE_APPEND_DATA* = 0x00000004 # file - FILE_ADD_SUBDIRECTORY* = 0x00000004 # directory - FILE_CREATE_PIPE_INSTANCE* = 0x00000004 # named pipe - FILE_READ_EA* = 0x00000008 # file & directory - FILE_READ_PROPERTIES* = FILE_READ_EA - FILE_WRITE_EA* = 0x00000010 # file & directory - FILE_WRITE_PROPERTIES* = FILE_WRITE_EA - FILE_EXECUTE* = 0x00000020 # file - FILE_TRAVERSE* = 0x00000020 # directory - FILE_DELETE_CHILD* = 0x00000040 # directory - FILE_READ_ATTRIBUTES* = 0x00000080 # all - FILE_WRITE_ATTRIBUTES* = 0x00000100 # all - FILE_SHARE_DELETE* = 4 - FILE_SHARE_READ* = 1 - FILE_SHARE_WRITE* = 2 - CONSOLE_TEXTMODE_BUFFER* = 1 - CREATE_NEW* = 1 - CREATE_ALWAYS* = 2 - OPEN_EXISTING* = 3 - OPEN_ALWAYS* = 4 - TRUNCATE_EXISTING* = 5 - FILE_ATTRIBUTE_ARCHIVE* = 32 - FILE_ATTRIBUTE_COMPRESSED* = 2048 - FILE_ATTRIBUTE_NORMAL* = 128 - FILE_ATTRIBUTE_DIRECTORY* = 16 - FILE_ATTRIBUTE_HIDDEN* = 2 - FILE_ATTRIBUTE_READONLY* = 1 - FILE_ATTRIBUTE_SYSTEM* = 4 - FILE_ATTRIBUTE_TEMPORARY* = 256 - FILE_FLAG_WRITE_THROUGH* = 0x80000000 - FILE_FLAG_OVERLAPPED* = 1073741824 - FILE_FLAG_NO_BUFFERING* = 536870912 - FILE_FLAG_RANDOM_ACCESS* = 268435456 - FILE_FLAG_SEQUENTIAL_SCAN* = 134217728 - FILE_FLAG_DELETE_ON_CLOSE* = 67108864 - FILE_FLAG_BACKUP_SEMANTICS* = 33554432 - FILE_FLAG_POSIX_SEMANTICS* = 16777216 - cSECURITY_ANONYMOUS* = 0 - cSECURITY_IDENTIFICATION* = 65536 - cSECURITY_IMPERSONATION* = 131072 - cSECURITY_DELEGATION* = 196608 - cSECURITY_CONTEXT_TRACKING* = 262144 - cSECURITY_EFFECTIVE_ONLY* = 524288 - cSECURITY_SQOS_PRESENT* = 1048576 - # CreateFileMapping, VirtualAlloc, VirtualFree, VirtualProtect - SEC_COMMIT* = 134217728 - SEC_IMAGE* = 16777216 - SEC_NOCACHE* = 268435456 - SEC_RESERVE* = 67108864 - PAGE_READONLY* = 2 - PAGE_READWRITE* = 4 - PAGE_WRITECOPY* = 8 - PAGE_EXECUTE* = 16 - PAGE_EXECUTE_READ* = 32 - PAGE_EXECUTE_READWRITE* = 64 - PAGE_EXECUTE_WRITECOPY* = 128 - PAGE_GUARD* = 256 - PAGE_NOACCESS* = 1 - PAGE_NOCACHE* = 512 - MEM_COMMIT* = 4096 - MEM_FREE* = 65536 - MEM_RESERVE* = 8192 - MEM_IMAGE* = 16777216 - MEM_MAPPED* = 262144 - MEM_PRIVATE* = 131072 - MEM_DECOMMIT* = 16384 - MEM_RELEASE* = 32768 - MEM_TOP_DOWN* = 1048576 - EXCEPTION_GUARD_PAGE* = 0x80000001 - SECTION_EXTEND_SIZE* = 0x00000010 - SECTION_MAP_READ* = 0x00000004 - SECTION_MAP_WRITE* = 0x00000002 - SECTION_QUERY* = 0x00000001 - SECTION_ALL_ACCESS* = 0x000F001F - # CreateFont - FW_DONTCARE* = 0 - FW_THIN* = 100 - FW_EXTRALIGHT* = 200 - FW_LIGHT* = 300 - FW_NORMAL* = 400 - FW_REGULAR* = FW_NORMAL - FW_MEDIUM* = 500 - FW_SEMIBOLD* = 600 - FW_BOLD* = 700 - FW_EXTRABOLD* = 800 - FW_HEAVY* = 900 - ANSI_CHARSET* = 0 - DEFAULT_CHARSET* = 1 - SYMBOL_CHARSET* = 2 - SHIFTJIS_CHARSET* = 128 - HANGEUL_CHARSET* = 129 - GB2312_CHARSET* = 134 - CHINESEBIG5_CHARSET* = 136 - GREEK_CHARSET* = 161 - TURKISH_CHARSET* = 162 - HEBREW_CHARSET* = 177 - ARABIC_CHARSET* = 178 - BALTIC_CHARSET* = 186 - RUSSIAN_CHARSET* = 204 - THAI_CHARSET* = 222 - EASTEUROPE_CHARSET* = 238 - OEM_CHARSET* = 255 - OUT_DEFAULT_PRECIS* = 0 - OUT_STRING_PRECIS* = 1 - OUT_CHARACTER_PRECIS* = 2 - OUT_STROKE_PRECIS* = 3 - OUT_TT_PRECIS* = 4 - OUT_DEVICE_PRECIS* = 5 - OUT_RASTER_PRECIS* = 6 - OUT_TT_ONLY_PRECIS* = 7 - OUT_OUTLINE_PRECIS* = 8 - CLIP_DEFAULT_PRECIS* = 0 - CLIP_CHARACTER_PRECIS* = 1 - CLIP_STROKE_PRECIS* = 2 - CLIP_MASK* = 15 - CLIP_LH_ANGLES* = 16 - CLIP_TT_ALWAYS* = 32 - CLIP_EMBEDDED* = 128 - DEFAULT_QUALITY* = 0 - DRAFT_QUALITY* = 1 - PROOF_QUALITY* = 2 - NONANTIALIASED_QUALITY* = 3 - ANTIALIASED_QUALITY* = 4 - DEFAULT_PITCH* = 0 - FIXED_PITCH* = 1 - VARIABLE_PITCH* = 2 - MONO_FONT* = 8 - FF_DECORATIVE* = 80 - FF_DONTCARE* = 0 - FF_MODERN* = 48 - FF_ROMAN* = 16 - FF_SCRIPT* = 64 - FF_SWISS* = 32 - # CreateHatchBrush - HS_BDIAGONAL* = 3 - HS_CROSS* = 4 - HS_DIAGCROSS* = 5 - HS_FDIAGONAL* = 2 - HS_HORIZONTAL* = 0 - HS_VERTICAL* = 1 - # CreateIconFromResourceEx - LR_DEFAULTCOLOR* = 0 - LR_LOADREALSIZE* = 128 - # CreateMailslot, GetMailslotInfo - MAILSLOT_WAIT_FOREVER* = 0xFFFFFFFF - MAILSLOT_NO_MESSAGE* = 0xFFFFFFFF - # CreateMappedBitmap - CMB_MASKED* = 2 - # CreateNamedPipe - PIPE_ACCESS_DUPLEX* = 3 - PIPE_ACCESS_INBOUND* = 1 - PIPE_ACCESS_OUTBOUND* = 2 - WRITE_DAC* = 0x00040000 - WRITE_OWNER* = 0x00080000 - ACCESS_SYSTEM_SECURITY* = 0x01000000 - PIPE_TYPE_BYTE* = 0 - PIPE_TYPE_MESSAGE* = 4 - PIPE_READMODE_BYTE* = 0 - PIPE_READMODE_MESSAGE* = 2 - PIPE_WAIT* = 0 - PIPE_NOWAIT* = 1 - # CreatePen, ExtCreatePen - PS_GEOMETRIC* = 65536 - PS_COSMETIC* = 0 - PS_ALTERNATE* = 8 - PS_SOLID* = 0 - PS_DASH* = 1 - PS_DOT* = 2 - PS_DASHDOT* = 3 - PS_DASHDOTDOT* = 4 - PS_NULL* = 5 - PS_USERSTYLE* = 7 - PS_INSIDEFRAME* = 6 - PS_ENDCAP_ROUND* = 0 - PS_ENDCAP_SQUARE* = 256 - PS_ENDCAP_FLAT* = 512 - PS_JOIN_BEVEL* = 4096 - PS_JOIN_MITER* = 8192 - PS_JOIN_ROUND* = 0 - PS_STYLE_MASK* = 15 - PS_ENDCAP_MASK* = 3840 - PS_TYPE_MASK* = 983040 - # CreatePolygonRgn - ALTERNATE* = 1 - WINDING* = 2 - # CreateProcess - CREATE_DEFAULT_ERROR_MODE* = 67108864 - CREATE_NEW_CONSOLE* = 16 - CREATE_NEW_PROCESS_GROUP* = 512 - CREATE_SEPARATE_WOW_VDM* = 2048 - CREATE_SUSPENDED* = 4 - CREATE_UNICODE_ENVIRONMENT* = 1024 - DEBUG_PROCESS* = 1 - DEBUG_ONLY_THIS_PROCESS* = 2 - DETACHED_PROCESS* = 8 - HIGH_PRIORITY_CLASS* = 128 - IDLE_PRIORITY_CLASS* = 64 - NORMAL_PRIORITY_CLASS* = 32 - REALTIME_PRIORITY_CLASS* = 256 - # CreateService - SERVICE_ALL_ACCESS* = 0x000F01FF - SERVICE_CHANGE_CONFIG* = 2 - SERVICE_ENUMERATE_DEPENDENTS* = 8 - SERVICE_INTERROGATE* = 128 - SERVICE_PAUSE_CONTINUE* = 64 - SERVICE_QUERY_CONFIG* = 1 - SERVICE_QUERY_STATUS* = 4 - SERVICE_START* = 16 - SERVICE_STOP* = 32 - SERVICE_USER_DEFINED_CONTROL* = 256 - SERVICE_DELETE* = 0x00010000 - SERVICE_READ_CONTROL* = 0x00020000 - SERVICE_GENERIC_EXECUTE* = 0x20000000 - SERVICE_ERROR_IGNORE* = 0 - SERVICE_ERROR_NORMAL* = 1 - SERVICE_ERROR_SEVERE* = 2 - SERVICE_ERROR_CRITICAL* = 3 - # CreateTapePartition, WriteTapemark - TAPE_FIXED_PARTITIONS* = 0 - TAPE_INITIATOR_PARTITIONS* = 0x00000002 - TAPE_SELECT_PARTITIONS* = 0x00000001 - TAPE_FILEMARKS* = 0x00000001 - TAPE_LONG_FILEMARKS* = 0x00000003 - TAPE_SETMARKS* = 0 - TAPE_SHORT_FILEMARKS* = 0x00000002 - # CreateWindow - CW_USEDEFAULT* = int32(0x80000000) - WS_BORDER* = 0x00800000 - WS_CAPTION* = 0x00C00000 - WS_CHILD* = 0x40000000 - WS_CHILDWINDOW* = 0x40000000 - WS_CLIPCHILDREN* = 0x02000000 - WS_CLIPSIBLINGS* = 0x04000000 - WS_DISABLED* = 0x08000000 - WS_DLGFRAME* = 0x00400000 - WS_GROUP* = 0x00020000 - WS_HSCROLL* = 0x00100000 - WS_ICONIC* = 0x20000000 - WS_MAXIMIZE* = 0x01000000 - WS_MAXIMIZEBOX* = 0x00010000 - WS_MINIMIZE* = 0x20000000 - WS_MINIMIZEBOX* = 0x00020000 - WS_OVERLAPPED* = 0 - WS_OVERLAPPEDWINDOW* = 0x00CF0000 - WS_POPUP* = LONG(0x80000000) - WS_POPUPWINDOW* = LONG(0x80880000) - WS_SIZEBOX* = 0x00040000 - WS_SYSMENU* = 0x00080000 - WS_TABSTOP* = 0x00010000 - WS_THICKFRAME* = 0x00040000 - - WS_TILED* = 0 - WS_TILEDWINDOW* = 0x00CF0000 - WS_VISIBLE* = 0x10000000 - WS_VSCROLL* = 0x00200000 - MDIS_ALLCHILDSTYLES* = 0x00000001 - BS_3STATE* = 0x00000005 - BS_AUTO3STATE* = 0x00000006 - BS_AUTOCHECKBOX* = 0x00000003 - BS_AUTORADIOBUTTON* = 0x00000009 - BS_BITMAP* = 0x00000080 - BS_BOTTOM* = 0x00000800 - BS_CENTER* = 0x00000300 - BS_CHECKBOX* = 0x00000002 - BS_DEFPUSHBUTTON* = 0x00000001 - BS_GROUPBOX* = 0x00000007 - BS_ICON* = 0x00000040 - BS_LEFT* = 0x00000100 - BS_LEFTTEXT* = 0x00000020 - BS_MULTILINE* = 0x00002000 - BS_NOTIFY* = 0x00004000 - BS_OWNERDRAW* = 0x0000000B - BS_PUSHBUTTON* = 0 - BS_PUSHLIKE* = 0x00001000 - BS_RADIOBUTTON* = 0x00000004 - BS_RIGHT* = 0x00000200 - BS_RIGHTBUTTON* = 0x00000020 - BS_TEXT* = 0 - BS_TOP* = 0x00000400 - BS_USERBUTTON* = 0x00000008 - BS_VCENTER* = 0x00000C00 - BS_FLAT* = 0x00008000 - CBS_AUTOHSCROLL* = 0x00000040 - CBS_DISABLENOSCROLL* = 0x00000800 - CBS_DROPDOWN* = 0x00000002 - CBS_DROPDOWNLIST* = 0x00000003 - CBS_HASSTRINGS* = 0x00000200 - CBS_LOWERCASE* = 0x00004000 - CBS_NOINTEGRALHEIGHT* = 0x00000400 - CBS_OEMCONVERT* = 0x00000080 - CBS_OWNERDRAWFIXED* = 0x00000010 - CBS_OWNERDRAWVARIABLE* = 0x00000020 - CBS_SIMPLE* = 0x00000001 - CBS_SORT* = 0x00000100 - CBS_UPPERCASE* = 0x00002000 - ES_AUTOHSCROLL* = 0x00000080 - ES_AUTOVSCROLL* = 0x00000040 - ES_CENTER* = 0x00000001 - ES_LEFT* = 0 - ES_LOWERCASE* = 0x00000010 - ES_MULTILINE* = 0x00000004 - ES_NOHIDESEL* = 0x00000100 - ES_NUMBER* = 0x00002000 - ES_OEMCONVERT* = 0x00000400 - ES_PASSWORD* = 0x00000020 - ES_READONLY* = 0x00000800 - ES_RIGHT* = 0x00000002 - ES_UPPERCASE* = 0x00000008 - ES_WANTRETURN* = 0x00001000 - LBS_DISABLENOSCROLL* = 0x00001000 - LBS_EXTENDEDSEL* = 0x00000800 - LBS_HASSTRINGS* = 0x00000040 - LBS_MULTICOLUMN* = 0x00000200 - LBS_MULTIPLESEL* = 0x00000008 - LBS_NODATA* = 0x00002000 - LBS_NOINTEGRALHEIGHT* = 0x00000100 - LBS_NOREDRAW* = 0x00000004 - LBS_NOSEL* = 0x00004000 - LBS_NOTIFY* = 0x00000001 - LBS_OWNERDRAWFIXED* = 0x00000010 - LBS_OWNERDRAWVARIABLE* = 0x00000020 - LBS_SORT* = 0x00000002 - LBS_STANDARD* = 0x00A00003 - LBS_USETABSTOPS* = 0x00000080 - LBS_WANTKEYBOARDINPUT* = 0x00000400 - SBS_BOTTOMALIGN* = 0x00000004 - SBS_HORZ* = 0 - SBS_LEFTALIGN* = 0x00000002 - SBS_RIGHTALIGN* = 0x00000004 - SBS_SIZEBOX* = 0x00000008 - SBS_SIZEBOXBOTTOMRIGHTALIGN* = 0x00000004 - SBS_SIZEBOXTOPLEFTALIGN* = 0x00000002 - SBS_SIZEGRIP* = 0x00000010 - SBS_TOPALIGN* = 0x00000002 - SBS_VERT* = 0x00000001 - SS_BITMAP* = 0x0000000E - SS_BLACKFRAME* = 0x00000007 - SS_BLACKRECT* = 0x00000004 - SS_CENTER* = 0x00000001 - SS_CENTERIMAGE* = 0x00000200 - SS_ENHMETAFILE* = 0x0000000F - SS_ETCHEDFRAME* = 0x00000012 - SS_ETCHEDHORZ* = 0x00000010 - SS_ETCHEDVERT* = 0x00000011 - SS_GRAYFRAME* = 0x00000008 - SS_GRAYRECT* = 0x00000005 - SS_ICON* = 0x00000003 - SS_LEFT* = 0 - SS_LEFTNOWORDWRAP* = 0x0000000C - SS_NOPREFIX* = 0x00000080 - SS_NOTIFY* = 0x00000100 - SS_OWNERDRAW* = 0x0000000D - SS_REALSIZEIMAGE* = 0x00000800 - SS_RIGHT* = 0x00000002 - SS_RIGHTJUST* = 0x00000400 - SS_SIMPLE* = 0x0000000B - SS_SUNKEN* = 0x00001000 - SS_USERITEM* = 0x0000000A - SS_WHITEFRAME* = 0x00000009 - SS_WHITERECT* = 0x00000006 - DS_3DLOOK* = 0x00000004 - DS_ABSALIGN* = 0x00000001 - DS_CENTER* = 0x00000800 - DS_CENTERMOUSE* = 0x00001000 - DS_CONTEXTHELP* = 0x00002000 - DS_CONTROL* = 0x00000400 - DS_FIXEDSYS* = 0x00000008 - DS_LOCALEDIT* = 0x00000020 - DS_MODALFRAME* = 0x00000080 - DS_NOFAILCREATE* = 0x00000010 - DS_NOIDLEMSG* = 0x00000100 - DS_SETFONT* = 0x00000040 - DS_SETFOREGROUND* = 0x00000200 - DS_SYSMODAL* = 0x00000002 - # CreateWindowEx - WS_EX_ACCEPTFILES* = 0x00000010 - WS_EX_APPWINDOW* = 0x00040000 - WS_EX_CLIENTEDGE* = 0x00000200 - WS_EX_CONTEXTHELP* = 0x00000400 - WS_EX_CONTROLPARENT* = 0x00010000 - WS_EX_DLGMODALFRAME* = 0x00000001 - WS_EX_LEFT* = 0 - WS_EX_LEFTSCROLLBAR* = 0x00004000 - WS_EX_LTRREADING* = 0 - WS_EX_MDICHILD* = 0x00000040 - WS_EX_NOPARENTNOTIFY* = 0x00000004 - WS_EX_OVERLAPPEDWINDOW* = 0x00000300 - WS_EX_PALETTEWINDOW* = 0x00000188 - WS_EX_RIGHT* = 0x00001000 - WS_EX_RIGHTSCROLLBAR* = 0 - WS_EX_RTLREADING* = 0x00002000 - WS_EX_STATICEDGE* = 0x00020000 - WS_EX_TOOLWINDOW* = 0x00000080 - WS_EX_TOPMOST* = 0x00000008 - WS_EX_TRANSPARENT* = 0x00000020 - WS_EX_WINDOWEDGE* = 0x00000100 - # CreateWindowStation - WINSTA_ACCESSCLIPBOARD* = 0x00000004 - WINSTA_ACCESSGLOBALATOMS* = 0x00000020 - WINSTA_CREATEDESKTOP* = 0x00000008 - WINSTA_ENUMDESKTOPS* = 0x00000001 - WINSTA_ENUMERATE* = 0x00000100 - WINSTA_EXITWINDOWS* = 0x00000040 - WINSTA_READATTRIBUTES* = 0x00000002 - WINSTA_READSCREEN* = 0x00000200 - WINSTA_WRITEATTRIBUTES* = 0x00000010 - # DdeCallback - # DdeClientTransaction - # DdeEnableCallback - # DdeGetLastError - # DdeInitialize - # DdeNameService - # DebugProc - WH_CALLWNDPROC* = 4 - WH_CALLWNDPROCRET* = 12 - WH_CBT* = 5 - WH_DEBUG* = 9 - WH_GETMESSAGE* = 3 - WH_JOURNALPLAYBACK* = 1 - WH_JOURNALRECORD* = 0 - WH_KEYBOARD* = 2 - WH_MOUSE* = 7 - WH_MSGFILTER* = -1 - WH_SHELL* = 10 - WH_SYSMSGFILTER* = 6 - WH_FOREGROUNDIDLE* = 11 - # DefineDosDevice - DDD_RAW_TARGET_PATH* = 1 - DDD_REMOVE_DEFINITION* = 2 - DDD_EXACT_MATCH_ON_REMOVE* = 4 - # DeviceCapbilities - DCTT_BITMAP* = 0x00000001 - DCTT_DOWNLOAD* = 0x00000002 - DCTT_SUBDEV* = 0x00000004 - # DlgDirList - DDL_ARCHIVE* = 32 - DDL_DIRECTORY* = 16 - DDL_DRIVES* = 16384 - DDL_EXCLUSIVE* = 32768 - DDL_HIDDEN* = 2 - DDL_READONLY* = 1 - DDL_READWRITE* = 0 - DDL_SYSTEM* = 4 - DDL_POSTMSGS* = 8192 - # DllEntryPoint - DLL_PROCESS_ATTACH* = 1 - DLL_THREAD_ATTACH* = 2 - DLL_PROCESS_DETACH* = 0 - DLL_THREAD_DETACH* = 3 - # DrawAnimatedRects - IDANI_OPEN* = 1 - IDANI_CLOSE* = 2 - # DrawCaption - DC_ACTIVE* = 1 - DC_SMALLCAP* = 2 - # DrawEdge - BDR_RAISEDINNER* = 4 - BDR_SUNKENINNER* = 8 - BDR_RAISEDOUTER* = 1 - BDR_SUNKENOUTER* = 2 - BDR_OUTER* = BDR_RAISEDOUTER or BDR_SUNKENOUTER - BDR_INNER* = BDR_RAISEDINNER or BDR_SUNKENINNER - BDR_RAISED* = BDR_RAISEDOUTER or BDR_RAISEDINNER - BDR_SUNKEN* = BDR_SUNKENOUTER or BDR_SUNKENINNER - EDGE_BUMP* = 9 - EDGE_ETCHED* = 6 - EDGE_RAISED* = 5 - EDGE_SUNKEN* = 10 - BF_ADJUST* = 8192 - BF_BOTTOM* = 8 - BF_BOTTOMLEFT* = 9 - BF_BOTTOMRIGHT* = 12 - BF_DIAGONAL* = 16 - BF_DIAGONAL_ENDBOTTOMLEFT* = 25 - BF_DIAGONAL_ENDBOTTOMRIGHT* = 28 - BF_DIAGONAL_ENDTOPLEFT* = 19 - BF_DIAGONAL_ENDTOPRIGHT* = 22 - BF_FLAT* = 16384 - BF_LEFT* = 1 - BF_MIDDLE* = 2048 - BF_MONO* = 32768 - BF_RECT* = 15 - BF_RIGHT* = 4 - BF_SOFT* = 4096 - BF_TOP* = 2 - BF_TOPLEFT* = 3 - BF_TOPRIGHT* = 6 - # DrawFrameControl - DFC_BUTTON* = 4 - DFC_CAPTION* = 1 - DFC_MENU* = 2 - DFC_SCROLL* = 3 - DFCS_BUTTON3STATE* = 8 - DFCS_BUTTONCHECK* = 0 - DFCS_BUTTONPUSH* = 16 - DFCS_BUTTONRADIO* = 4 - DFCS_BUTTONRADIOIMAGE* = 1 - DFCS_BUTTONRADIOMASK* = 2 - DFCS_CAPTIONCLOSE* = 0 - DFCS_CAPTIONHELP* = 4 - DFCS_CAPTIONMAX* = 2 - DFCS_CAPTIONMIN* = 1 - DFCS_CAPTIONRESTORE* = 3 - DFCS_MENUARROW* = 0 - DFCS_MENUBULLET* = 2 - DFCS_MENUCHECK* = 1 - DFCS_SCROLLCOMBOBOX* = 5 - DFCS_SCROLLDOWN* = 1 - DFCS_SCROLLLEFT* = 2 - DFCS_SCROLLRIGHT* = 3 - DFCS_SCROLLSIZEGRIP* = 8 - DFCS_SCROLLUP* = 0 - DFCS_ADJUSTRECT* = 8192 - DFCS_CHECKED* = 1024 - DFCS_FLAT* = 16384 - DFCS_INACTIVE* = 256 - DFCS_MONO* = 32768 - DFCS_PUSHED* = 512 - # DrawIconEx - DI_COMPAT* = 4 - DI_DEFAULTSIZE* = 8 - DI_IMAGE* = 2 - DI_MASK* = 1 - DI_NORMAL* = 3 - # DrawState - DST_BITMAP* = 4 - DST_COMPLEX* = 0 - DST_ICON* = 3 - DST_PREFIXTEXT* = 2 - DST_TEXT* = 1 - DSS_NORMAL* = 0 - DSS_UNION* = 16 - DSS_DISABLED* = 32 - DSS_MONO* = 128 - # DrawStatusText - SBT_NOBORDERS* = 256 - SBT_OWNERDRAW* = 4096 - SBT_POPOUT* = 512 - SBT_RTLREADING* = 1024 - # DrawText, DrawTextEx - DT_BOTTOM* = 8 - DT_CALCRECT* = 1024 - DT_CENTER* = 1 - DT_EDITCONTROL* = 8192 - DT_END_ELLIPSIS* = 32768 - DT_PATH_ELLIPSIS* = 16384 - DT_EXPANDTABS* = 64 - DT_EXTERNALLEADING* = 512 - DT_LEFT* = 0 - DT_MODIFYSTRING* = 65536 - DT_NOCLIP* = 256 - DT_NOPREFIX* = 2048 - DT_RIGHT* = 2 - DT_RTLREADING* = 131072 - DT_SINGLELINE* = 32 - DT_TABSTOP* = 128 - DT_TOP* = 0 - DT_VCENTER* = 4 - DT_WORDBREAK* = 16 - DT_INTERNAL* = 4096 - DT_WORD_ELLIPSIS* = 0x00040000 - DT_HIDEPREFIX* = 0x00100000 - DT_PREFIXONLY* = 0x00200000 - # DuplicateHandle, MapViewOfFile - DUPLICATE_CLOSE_SOURCE* = 1 - DUPLICATE_SAME_ACCESS* = 2 - FILE_MAP_ALL_ACCESS* = 0x000F001F - FILE_MAP_READ* = 4 - FILE_MAP_WRITE* = 2 - FILE_MAP_COPY* = 1 - MUTEX_ALL_ACCESS* = 0x001F0001 - MUTEX_MODIFY_STATE* = 1 - SYNCHRONIZE* = 0x00100000 - SEMAPHORE_ALL_ACCESS* = 0x001F0003 - SEMAPHORE_MODIFY_STATE* = 2 - EVENT_ALL_ACCESS* = 0x001F0003 - EVENT_MODIFY_STATE* = 2 - KEY_ALL_ACCESS* = 0x000F003F - KEY_CREATE_LINK* = 32 - KEY_CREATE_SUB_KEY* = 4 - KEY_ENUMERATE_SUB_KEYS* = 8 - KEY_EXECUTE* = 0x00020019 - KEY_NOTIFY* = 16 - KEY_QUERY_VALUE* = 1 - KEY_READ* = 0x00020019 - KEY_SET_VALUE* = 2 - KEY_WRITE* = 0x00020006 - PROCESS_ALL_ACCESS* = 0x001F0FFF - PROCESS_CREATE_PROCESS* = 128 - PROCESS_CREATE_THREAD* = 2 - PROCESS_DUP_HANDLE* = 64 - PROCESS_QUERY_INFORMATION* = 1024 - PROCESS_SET_INFORMATION* = 512 - PROCESS_TERMINATE* = 1 - PROCESS_VM_OPERATION* = 8 - PROCESS_VM_READ* = 16 - PROCESS_VM_WRITE* = 32 - THREAD_ALL_ACCESS* = 0x001F03FF - THREAD_DIRECT_IMPERSONATION* = 512 - THREAD_GET_CONTEXT* = 8 - THREAD_IMPERSONATE* = 256 - THREAD_QUERY_INFORMATION* = 64 - THREAD_SET_CONTEXT* = 16 - THREAD_SET_INFORMATION* = 32 - THREAD_SET_THREAD_TOKEN* = 128 - THREAD_SUSPEND_RESUME* = 2 - THREAD_TERMINATE* = 1 - # EditWordBreakProc - WB_ISDELIMITER* = 2 - WB_LEFT* = 0 - WB_RIGHT* = 1 - # EnableScrollBar - SB_BOTH* = 3 - SB_CTL* = 2 - SB_HORZ* = 0 - SB_VERT* = 1 - ESB_DISABLE_BOTH* = 3 - ESB_DISABLE_DOWN* = 2 - ESB_DISABLE_LEFT* = 1 - ESB_DISABLE_LTUP* = 1 - ESB_DISABLE_RIGHT* = 2 - ESB_DISABLE_RTDN* = 2 - ESB_DISABLE_UP* = 1 - ESB_ENABLE_BOTH* = 0 - # Scroll Bar notifications - SB_LINEUP* = 0 - SB_LINEDOWN* = 1 - SB_LINELEFT* = 0 - SB_LINERIGHT* = 1 - SB_PAGEUP* = 2 - SB_PAGEDOWN* = 3 - SB_PAGELEFT* = 2 - SB_PAGERIGHT* = 3 - SB_THUMBPOSITION* = 4 - SB_THUMBTRACK* = 5 - SB_ENDSCROLL* = 8 - SB_LEFT* = 6 - SB_RIGHT* = 7 - SB_BOTTOM* = 7 - SB_TOP* = 6 - # EnumCalendarInfo - ENUM_ALL_CALENDARS* = -1 - # EnumDateFormats - # GetDateFormat - DATE_SHORTDATE* = 1 - DATE_LONGDATE* = 2 - DATE_USE_ALT_CALENDAR* = 4 - # EnumDependentServices - SERVICE_ACTIVE* = 1 - SERVICE_INACTIVE* = 2 - # EnumFontFamExProc - DEVICE_FONTTYPE* = 2 - RASTER_FONTTYPE* = 1 - TRUETYPE_FONTTYPE* = 4 - # EnumObjects, GetCurrentObject, GetObjectType - OBJ_BRUSH* = 2 - OBJ_PEN* = 1 - OBJ_PAL* = 5 - OBJ_FONT* = 6 - OBJ_BITMAP* = 7 - OBJ_EXTPEN* = 11 - OBJ_REGION* = 8 - OBJ_DC* = 3 - OBJ_MEMDC* = 10 - OBJ_METAFILE* = 9 - OBJ_METADC* = 4 - OBJ_ENHMETAFILE* = 13 - OBJ_ENHMETADC* = 12 - - # - # Predefined Resource Types - # -const - RT_CURSOR* = cast[MAKEINTRESOURCE](1) - RT_BITMAP* = cast[MAKEINTRESOURCE](2) - RT_ICON* = cast[MAKEINTRESOURCE](3) - RT_MENU* = cast[MAKEINTRESOURCE](4) - RT_DIALOG* = cast[MAKEINTRESOURCE](5) - RT_STRING* = cast[MAKEINTRESOURCE](6) - RT_FONTDIR* = cast[MAKEINTRESOURCE](7) - RT_FONT* = cast[MAKEINTRESOURCE](8) - RT_ACCELERATOR* = cast[MAKEINTRESOURCE](9) - RT_RCDATA* = cast[MAKEINTRESOURCE](10) - RT_MESSAGETABLE* = cast[MAKEINTRESOURCE](11) - DIFFERENCE* = 11 - RT_GROUP_CURSOR* = cast[MAKEINTRESOURCE](12) - RT_GROUP_ICON* = cast[MAKEINTRESOURCE](14) - RT_VERSION* = cast[MAKEINTRESOURCE](16) - RT_DLGINCLUDE* = cast[MAKEINTRESOURCE](17) - RT_PLUGPLAY* = cast[MAKEINTRESOURCE](19) - RT_VXD* = cast[MAKEINTRESOURCE](20) - RT_ANICURSOR* = cast[MAKEINTRESOURCE](21) - RT_ANIICON* = cast[MAKEINTRESOURCE](22) - RT_HTML* = cast[MAKEINTRESOURCE](23) - RT_MANIFEST* = cast[MAKEINTRESOURCE](24) - -const - # EnumServicesStatus - SERVICE_WIN32* = 48 - SERVICE_DRIVER* = 11 - # EnumSystemCodePages - CP_INSTALLED* = 1 - CP_SUPPORTED* = 2 - # EnumSystemLocales - LCID_INSTALLED* = 1 - LCID_SUPPORTED* = 2 - # EraseTape - TAPE_ERASE_LONG* = 0x00000001 - TAPE_ERASE_SHORT* = 0 - # Escape - SP_ERROR* = -1 - SP_OUTOFDISK* = -4 - SP_OUTOFMEMORY* = -5 - SP_USERABORT* = -3 - PHYSICALWIDTH* = 110 - PHYSICALHEIGHT* = 111 - PHYSICALOFFSETX* = 112 - PHYSICALOFFSETY* = 113 - SCALINGFACTORX* = 114 - SCALINGFACTORY* = 115 - QUERYESCSUPPORT* = 8 - #ABORTDOC = 2; conflicts with AbortDoc function - cABORTDOC* = 2 - #ENDDOC = 11; conflicts with AbortDoc function - cENDDOC* = 11 - GETPHYSPAGESIZE* = 12 - GETPRINTINGOFFSET* = 13 - GETSCALINGFACTOR* = 14 - NEWFRAME* = 1 - NEXTBAND* = 3 - PASSTHROUGH* = 19 - #SETABORTPROC = 9; conflicts with AbortDoc function - cSETABORTPROC* = 9 - #STARTDOC = 10; conflicts with AbortDoc function - cSTARTDOC* = 10 - # EscapeCommFunction - CLRDTR* = 6 - CLRRTS* = 4 - SETDTR* = 5 - SETRTS* = 3 - SETXOFF* = 1 - SETXON* = 2 - SETBREAK* = 8 - CLRBREAK* = 9 - # ExitWindowsEx - EWX_FORCE* = 4 - EWX_LOGOFF* = 0 - EWX_POWEROFF* = 8 - EWX_REBOOT* = 2 - EWX_SHUTDOWN* = 1 - # ExtFloodFill - FLOODFILLBORDER* = 0 - FLOODFILLSURFACE* = 1 - # ExtTextOut - ETO_CLIPPED* = 4 - ETO_GLYPH_INDEX* = 16 - ETO_OPAQUE* = 2 - ETO_RTLREADING* = 128 - # FillConsoleOutputAttribute - FOREGROUND_BLUE* = 1 - FOREGROUND_GREEN* = 2 - FOREGROUND_RED* = 4 - FOREGROUND_INTENSITY* = 8 - BACKGROUND_BLUE* = 16 - BACKGROUND_GREEN* = 32 - BACKGROUND_RED* = 64 - BACKGROUND_INTENSITY* = 128 - # FindFirstChangeNotification - FILE_NOTIFY_CHANGE_FILE_NAME* = 1 - FILE_NOTIFY_CHANGE_DIR_NAME* = 2 - FILE_NOTIFY_CHANGE_ATTRIBUTES* = 4 - FILE_NOTIFY_CHANGE_SIZE* = 8 - FILE_NOTIFY_CHANGE_LAST_WRITE* = 16 - FILE_NOTIFY_CHANGE_SECURITY* = 256 - # FindFirstPrinterChangeNotification - # FindNextPrinterNotification - # FMExtensionProc - # FoldString - MAP_FOLDCZONE* = 16 - MAP_FOLDDIGITS* = 128 - MAP_PRECOMPOSED* = 32 - MAP_COMPOSITE* = 64 - # ForegroundIdleProc - HC_ACTION* = 0 - # FormatMessage - FORMAT_MESSAGE_ALLOCATE_BUFFER* = 256 - FORMAT_MESSAGE_IGNORE_INSERTS* = 512 - FORMAT_MESSAGE_FROM_STRING* = 1024 - FORMAT_MESSAGE_FROM_HMODULE* = 2048 - FORMAT_MESSAGE_FROM_SYSTEM* = 4096 - FORMAT_MESSAGE_ARGUMENT_ARRAY* = 8192 - FORMAT_MESSAGE_MAX_WIDTH_MASK* = 255 - # GdiComment - GDICOMMENT_WINDOWS_METAFILE* = -2147483647 - GDICOMMENT_BEGINGROUP* = 2 - GDICOMMENT_ENDGROUP* = 3 - GDICOMMENT_MULTIFORMATS* = 1073741828 - GDICOMMENT_IDENTIFIER* = 1128875079 - # GenerateConsoleCtrlEvent, HandlerRoutine - CTRL_C_EVENT* = 0 - CTRL_BREAK_EVENT* = 1 - CTRL_CLOSE_EVENT* = 2 - CTRL_LOGOFF_EVENT* = 5 - CTRL_SHUTDOWN_EVENT* = 6 - # GetAddressByName - # GetArcDirection - AD_COUNTERCLOCKWISE* = 1 - AD_CLOCKWISE* = 2 - # GetBinaryTypes - SCS_32BIT_BINARY* = 0 - SCS_DOS_BINARY* = 1 - SCS_OS216_BINARY* = 5 - SCS_PIF_BINARY* = 3 - SCS_POSIX_BINARY* = 4 - SCS_WOW_BINARY* = 2 - # GetBoundsRect, SetBoundsRect - DCB_DISABLE* = 8 - DCB_ENABLE* = 4 - DCB_RESET* = 1 - DCB_SET* = 3 - DCB_ACCUMULATE* = 2 - # GetCharacterPlacement, GetFontLanguageInfo - GCP_DBCS* = 1 - GCP_ERROR* = 0x00008000 - GCP_CLASSIN* = 0x00080000 - GCP_DIACRITIC* = 256 - GCP_DISPLAYZWG* = 0x00400000 - GCP_GLYPHSHAPE* = 16 - GCP_JUSTIFY* = 0x00010000 - GCP_JUSTIFYIN* = 0x00200000 - GCP_KASHIDA* = 1024 - GCP_LIGATE* = 32 - GCP_MAXEXTENT* = 0x00100000 - GCP_NEUTRALOVERRIDE* = 0x02000000 - GCP_NUMERICOVERRIDE* = 0x01000000 - GCP_NUMERICSLATIN* = 0x04000000 - GCP_NUMERICSLOCAL* = 0x08000000 - GCP_REORDER* = 2 - GCP_SYMSWAPOFF* = 0x00800000 - GCP_USEKERNING* = 8 - FLI_GLYPHS* = 0x00040000 - FLI_MASK* = 0x0000103B - # GetClassLong, GetClassWord - GCW_ATOM* = -32 - GCL_CBCLSEXTRA* = -20 - GCL_CBWNDEXTRA* = -18 - GCL_HBRBACKGROUND* = -10 - GCL_HCURSOR* = -12 - GCL_HICON* = -14 - GCL_HICONSM* = -34 - GCL_HMODULE* = -16 - GCL_MENUNAME* = -8 - GCL_STYLE* = -26 - GCL_WNDPROC* = -24 - # GetClipboardFormat, SetClipboardData - CF_BITMAP* = 2 - CF_DIB* = 8 - CF_PALETTE* = 9 - CF_ENHMETAFILE* = 14 - CF_METAFILEPICT* = 3 - CF_OEMTEXT* = 7 - CF_TEXT* = 1 - CF_UNICODETEXT* = 13 - CF_DIF* = 5 - CF_DSPBITMAP* = 130 - CF_DSPENHMETAFILE* = 142 - CF_DSPMETAFILEPICT* = 131 - CF_DSPTEXT* = 129 - CF_GDIOBJFIRST* = 768 - CF_GDIOBJLAST* = 1023 - CF_HDROP* = 15 - CF_LOCALE* = 16 - CF_OWNERDISPLAY* = 128 - CF_PENDATA* = 10 - CF_PRIVATEFIRST* = 512 - CF_PRIVATELAST* = 767 - CF_RIFF* = 11 - CF_SYLK* = 4 - CF_WAVE* = 12 - CF_TIFF* = 6 - # GetCommMask - EV_BREAK* = 64 - EV_CTS* = 8 - EV_DSR* = 16 - EV_ERR* = 128 - EV_EVENT1* = 2048 - EV_EVENT2* = 4096 - EV_PERR* = 512 - EV_RING* = 256 - EV_RLSD* = 32 - EV_RX80FULL* = 1024 - EV_RXCHAR* = 1 - EV_RXFLAG* = 2 - EV_TXEMPTY* = 4 - # GetCommModemStatus - MS_CTS_ON* = 0x00000010 - MS_DSR_ON* = 0x00000020 - MS_RING_ON* = 0x00000040 - MS_RLSD_ON* = 0x00000080 - # GetComputerName - MAX_COMPUTERNAME_LENGTH* = 15 - # GetConsoleMode - ENABLE_LINE_INPUT* = 2 - ENABLE_ECHO_INPUT* = 4 - ENABLE_PROCESSED_INPUT* = 1 - ENABLE_WINDOW_INPUT* = 8 - ENABLE_MOUSE_INPUT* = 16 - ENABLE_PROCESSED_OUTPUT* = 1 - ENABLE_WRAP_AT_EOL_OUTPUT* = 2 - # GetCPInfo - CP_ACP* = 0 - CP_MACCP* = 2 - CP_OEMCP* = 1 - # GetDCEx - DCX_WINDOW* = 0x00000001 - DCX_CACHE* = 0x00000002 - DCX_PARENTCLIP* = 0x00000020 - DCX_CLIPSIBLINGS* = 0x00000010 - DCX_CLIPCHILDREN* = 0x00000008 - DCX_NORESETATTRS* = 0x00000004 - DCX_LOCKWINDOWUPDATE* = 0x00000400 - DCX_EXCLUDERGN* = 0x00000040 - DCX_INTERSECTRGN* = 0x00000080 - DCX_VALIDATE* = 0x00200000 - # GetDeviceCaps - DRIVERVERSION* = 0 - TECHNOLOGY* = 2 - DT_PLOTTER* = 0 - DT_RASDISPLAY* = 1 - DT_RASPRINTER* = 2 - DT_RASCAMERA* = 3 - DT_CHARSTREAM* = 4 - DT_METAFILE* = 5 - DT_DISPFILE* = 6 - HORZSIZE* = 4 - VERTSIZE* = 6 - HORZRES* = 8 - VERTRES* = 10 - LOGPIXELSX* = 88 - LOGPIXELSY* = 90 - BITSPIXEL* = 12 - PLANES* = 14 - NUMBRUSHES* = 16 - NUMPENS* = 18 - NUMFONTS* = 22 - NUMCOLORS* = 24 - ASPECTX* = 40 - ASPECTY* = 42 - ASPECTXY* = 44 - PDEVICESIZE* = 26 - CLIPCAPS* = 36 - SIZEPALETTE* = 104 - NUMRESERVED* = 106 - COLORRES* = 108 - VREFRESH* = 116 - DESKTOPHORZRES* = 118 - DESKTOPVERTRES* = 117 - BLTALIGNMENT* = 119 - RASTERCAPS* = 38 - RC_BANDING* = 2 - RC_BITBLT* = 1 - RC_BITMAP64* = 8 - RC_DI_BITMAP* = 128 - RC_DIBTODEV* = 512 - RC_FLOODFILL* = 4096 - RC_GDI20_OUTPUT* = 16 - RC_PALETTE* = 256 - RC_SCALING* = 4 - RC_STRETCHBLT* = 2048 - RC_STRETCHDIB* = 8192 - CURVECAPS* = 28 - CC_NONE* = 0 - CC_CIRCLES* = 1 - CC_PIE* = 2 - CC_CHORD* = 4 - CC_ELLIPSES* = 8 - CC_WIDE* = 16 - CC_STYLED* = 32 - CC_WIDESTYLED* = 64 - CC_INTERIORS* = 128 - CC_ROUNDRECT* = 256 - LINECAPS* = 30 - LC_NONE* = 0 - LC_POLYLINE* = 2 - LC_MARKER* = 4 - LC_POLYMARKER* = 8 - LC_WIDE* = 16 - LC_STYLED* = 32 - LC_WIDESTYLED* = 64 - LC_INTERIORS* = 128 - POLYGONALCAPS* = 32 - PC_NONE* = 0 - PC_POLYGON* = 1 - PC_RECTANGLE* = 2 - PC_WINDPOLYGON* = 4 - PC_SCANLINE* = 8 - PC_WIDE* = 16 - PC_STYLED* = 32 - PC_WIDESTYLED* = 64 - PC_INTERIORS* = 128 - TEXTCAPS* = 34 - TC_OP_CHARACTER* = 1 - TC_OP_STROKE* = 2 - TC_CP_STROKE* = 4 - TC_CR_90* = 8 - TC_CR_ANY* = 16 - TC_SF_X_YINDEP* = 32 - TC_SA_DOUBLE* = 64 - TC_SA_INTEGER* = 128 - TC_SA_CONTIN* = 256 - TC_EA_DOUBLE* = 512 - TC_IA_ABLE* = 1024 - TC_UA_ABLE* = 2048 - TC_SO_ABLE* = 4096 - TC_RA_ABLE* = 8192 - TC_VA_ABLE* = 16384 - TC_RESERVED* = 32768 - TC_SCROLLBLT* = 65536 - PC_PATHS* = 512 - # GetDriveType - DRIVE_REMOVABLE* = 2 - DRIVE_FIXED* = 3 - DRIVE_REMOTE* = 4 - DRIVE_CDROM* = 5 - DRIVE_RAMDISK* = 6 - DRIVE_UNKNOWN* = 0 - DRIVE_NO_ROOT_DIR* = 1 - # GetExceptionCode - EXCEPTION_ACCESS_VIOLATION* = 0xC0000005 - EXCEPTION_BREAKPOINT* = 0x80000003 - EXCEPTION_DATATYPE_MISALIGNMENT* = 0x80000002 - EXCEPTION_SINGLE_STEP* = 0x80000004 - EXCEPTION_ARRAY_BOUNDS_EXCEEDED* = 0xC000008C - EXCEPTION_FLT_DENORMAL_OPERAND* = 0xC000008D - EXCEPTION_FLT_DIVIDE_BY_ZERO* = 0xC000008E - EXCEPTION_FLT_INEXACT_RESULT* = 0xC000008F - EXCEPTION_FLT_INVALID_OPERATION* = 0xC0000090 - EXCEPTION_FLT_OVERFLOW* = 0xC0000091 - EXCEPTION_FLT_STACK_CHECK* = 0xC0000092 - EXCEPTION_FLT_UNDERFLOW* = 0xC0000093 - EXCEPTION_INT_DIVIDE_BY_ZERO* = 0xC0000094 - EXCEPTION_INT_OVERFLOW* = 0xC0000095 - EXCEPTION_INVALID_HANDLE* = 0xC0000008 - EXCEPTION_PRIV_INSTRUCTION* = 0xC0000096 - EXCEPTION_NONCONTINUABLE_EXCEPTION* = 0xC0000025 - EXCEPTION_NONCONTINUABLE* = 0x00000001 - EXCEPTION_STACK_OVERFLOW* = 0xC00000FD - EXCEPTION_INVALID_DISPOSITION* = 0xC0000026 - EXCEPTION_IN_PAGE_ERROR* = 0xC0000006 - EXCEPTION_ILLEGAL_INSTRUCTION* = 0xC000001D - EXCEPTION_POSSIBLE_DEADLOCK* = 0xC0000194 - # GetFileType - FILE_TYPE_UNKNOWN* = 0 - FILE_TYPE_DISK* = 1 - FILE_TYPE_CHAR* = 2 - FILE_TYPE_PIPE* = 3 - # GetGlyphOutline - GGO_BITMAP* = 1 - GGO_NATIVE* = 2 - GGO_METRICS* = 0 - GGO_GRAY2_BITMAP* = 4 - GGO_GRAY4_BITMAP* = 5 - GGO_GRAY8_BITMAP* = 6 - GDI_ERROR* = 0xFFFFFFFF - # GetGraphicsMode - GM_COMPATIBLE* = 1 - GM_ADVANCED* = 2 - # GetHandleInformation - HANDLE_FLAG_INHERIT* = 1 - HANDLE_FLAG_PROTECT_FROM_CLOSE* = 2 - # GetIconInfo - IDC_ARROW* = cast[MAKEINTRESOURCE](32512) - IDC_IBEAM* = cast[MAKEINTRESOURCE](32513) - IDC_WAIT* = cast[MAKEINTRESOURCE](32514) - IDC_CROSS* = cast[MAKEINTRESOURCE](32515) - IDC_UPARROW* = cast[MAKEINTRESOURCE](32516) - IDC_SIZE* = cast[MAKEINTRESOURCE](32640) # OBSOLETE: use IDC_SIZEALL - IDC_ICON* = cast[MAKEINTRESOURCE](32641) # OBSOLETE: use IDC_ARROW - IDC_SIZENWSE* = cast[MAKEINTRESOURCE](32642) - IDC_SIZENESW* = cast[MAKEINTRESOURCE](32643) - IDC_SIZEWE* = cast[MAKEINTRESOURCE](32644) - IDC_SIZENS* = cast[MAKEINTRESOURCE](32645) - IDC_SIZEALL* = cast[MAKEINTRESOURCE](32646) - IDC_NO* = cast[MAKEINTRESOURCE](32648) - IDC_HAND* = cast[MAKEINTRESOURCE](32649) - IDC_APPSTARTING* = cast[MAKEINTRESOURCE](32650) - IDC_HELP* = cast[MAKEINTRESOURCE](32651) - - IDI_APPLICATION* = cast[MAKEINTRESOURCE](32512) - IDI_HAND* = cast[MAKEINTRESOURCE](32513) - IDI_QUESTION* = cast[MAKEINTRESOURCE](32514) - IDI_EXCLAMATION* = cast[MAKEINTRESOURCE](32515) - IDI_ASTERISK* = cast[MAKEINTRESOURCE](32516) - IDI_WINLOGO* = cast[MAKEINTRESOURCE](32517) - IDI_WARNING* = IDI_EXCLAMATION - IDI_ERROR* = IDI_HAND - IDI_INFORMATION* = IDI_ASTERISK - -const - # GetMapMode - MM_ANISOTROPIC* = 8 - MM_HIENGLISH* = 5 - MM_HIMETRIC* = 3 - MM_ISOTROPIC* = 7 - MM_LOENGLISH* = 4 - MM_LOMETRIC* = 2 - MM_TEXT* = 1 - MM_TWIPS* = 6 - # GetMenuDefaultItem - GMDI_GOINTOPOPUPS* = 0x00000002 - GMDI_USEDISABLED* = 0x00000001 - # PeekMessage - PM_NOREMOVE* = 0 - PM_REMOVE* = 1 - PM_NOYIELD* = 2 - # GetNamedPipeHandleState - # PIPE_NOWAIT = 1; already above - # PIPE_READMODE_MESSAGE = 2;already above - # GetNamedPipeInfo - PIPE_CLIENT_END* = 0 - PIPE_SERVER_END* = 1 - # PIPE_TYPE_MESSAGE = 4;already above - # GetNextWindow, GetWindow - GW_HWNDNEXT* = 2 - GW_HWNDPREV* = 3 - GW_CHILD* = 5 - GW_HWNDFIRST* = 0 - GW_HWNDLAST* = 1 - GW_OWNER* = 4 - # GetPath - PT_MOVETO* = 6 - PT_LINETO* = 2 - PT_BEZIERTO* = 4 - PT_CLOSEFIGURE* = 1 - # GetProcessShutdownParameters - SHUTDOWN_NORETRY* = 1 - # GetQueueStatus - QS_ALLEVENTS* = 191 - QS_ALLINPUT* = 255 - QS_HOTKEY* = 128 - QS_INPUT* = 7 - QS_KEY* = 1 - QS_MOUSE* = 6 - QS_MOUSEBUTTON* = 4 - QS_MOUSEMOVE* = 2 - QS_PAINT* = 32 - QS_POSTMESSAGE* = 8 - QS_SENDMESSAGE* = 64 - QS_TIMER* = 16 - # GetScrollInfo, SetScrollInfo - SIF_ALL* = 23 - SIF_PAGE* = 2 - SIF_POS* = 4 - SIF_RANGE* = 1 - SIF_DISABLENOSCROLL* = 8 - - # GetStdHandle - STD_INPUT_HANDLE* = DWORD(-10) - STD_OUTPUT_HANDLE* = DWORD(-11) - STD_ERROR_HANDLE* = DWORD(-12) - - INVALID_HANDLE_VALUE* = HANDLE(-1) - INVALID_SET_FILE_POINTER* = ULONG(-1) - INVALID_FILE_SIZE* = ULONG(-1) - INVALID_FILE_ATTRIBUTES* = ULONG(-1) - -const - # GetStockObject - BLACK_BRUSH* = 4 - DKGRAY_BRUSH* = 3 - GRAY_BRUSH* = 2 - HOLLOW_BRUSH* = 5 - LTGRAY_BRUSH* = 1 - NULL_BRUSH* = 5 - WHITE_BRUSH* = 0 - BLACK_PEN* = 7 - NULL_PEN* = 8 - WHITE_PEN* = 6 - ANSI_FIXED_FONT* = 11 - ANSI_VAR_FONT* = 12 - DEVICE_DEFAULT_FONT* = 14 - DEFAULT_GUI_FONT* = 17 - OEM_FIXED_FONT* = 10 - SYSTEM_FONT* = 13 - SYSTEM_FIXED_FONT* = 16 - DEFAULT_PALETTE* = 15 - # GetStringTypeA - CT_CTYPE1* = 1 - CT_CTYPE2* = 2 - CT_CTYPE3* = 4 - C1_UPPER* = 1 - C1_LOWER* = 2 - C1_DIGIT* = 4 - C1_SPACE* = 8 - C1_PUNCT* = 16 - C1_CNTRL* = 32 - C1_BLANK* = 64 - C1_XDIGIT* = 128 - C1_ALPHA* = 256 - C2_LEFTTORIGHT* = 1 - C2_RIGHTTOLEFT* = 2 - C2_EUROPENUMBER* = 3 - C2_EUROPESEPARATOR* = 4 - C2_EUROPETERMINATOR* = 5 - C2_ARABICNUMBER* = 6 - C2_COMMONSEPARATOR* = 7 - C2_BLOCKSEPARATOR* = 8 - C2_SEGMENTSEPARATOR* = 9 - C2_WHITESPACE* = 10 - C2_OTHERNEUTRAL* = 11 - C2_NOTAPPLICABLE* = 0 - C3_NONSPACING* = 1 - C3_DIACRITIC* = 2 - C3_VOWELMARK* = 4 - C3_SYMBOL* = 8 - C3_KATAKANA* = 16 - C3_HIRAGANA* = 32 - C3_HALFWIDTH* = 64 - C3_FULLWIDTH* = 128 - C3_IDEOGRAPH* = 256 - C3_KASHIDA* = 512 - C3_ALPHA* = 32768 - C3_NOTAPPLICABLE* = 0 - # GetSysColor - COLOR_3DDKSHADOW* = 21 - COLOR_3DFACE* = 15 - COLOR_3DHILIGHT* = 20 - COLOR_3DLIGHT* = 22 - COLOR_BTNHILIGHT* = 20 - COLOR_3DSHADOW* = 16 - COLOR_ACTIVEBORDER* = 10 - COLOR_ACTIVECAPTION* = 2 - COLOR_APPWORKSPACE* = 12 - COLOR_BACKGROUND* = 1 - COLOR_DESKTOP* = 1 - COLOR_BTNFACE* = 15 - COLOR_BTNHIGHLIGHT* = 20 - COLOR_BTNSHADOW* = 16 - COLOR_BTNTEXT* = 18 - COLOR_CAPTIONTEXT* = 9 - COLOR_GRAYTEXT* = 17 - COLOR_HIGHLIGHT* = 13 - COLOR_HIGHLIGHTTEXT* = 14 - COLOR_INACTIVEBORDER* = 11 - COLOR_INACTIVECAPTION* = 3 - COLOR_INACTIVECAPTIONTEXT* = 19 - COLOR_INFOBK* = 24 - COLOR_INFOTEXT* = 23 - COLOR_MENU* = 4 - COLOR_MENUTEXT* = 7 - COLOR_SCROLLBAR* = 0 - COLOR_WINDOW* = 5 - COLOR_WINDOWFRAME* = 6 - COLOR_WINDOWTEXT* = 8 - # GetSystemMetrics - SM_CYMIN* = 29 - SM_CXMIN* = 28 - SM_ARRANGE* = 56 - SM_CLEANBOOT* = 67 - # The right value for SM_CEMETRICS for NT 3.5 is 75. For Windows 95 - # and NT 4.0, it is 76. The meaning is undocumented, anyhow. - SM_CMETRICS* = 76 - SM_CMOUSEBUTTONS* = 43 - SM_CXBORDER* = 5 - SM_CYBORDER* = 6 - SM_CXCURSOR* = 13 - SM_CYCURSOR* = 14 - SM_CXDLGFRAME* = 7 - SM_CYDLGFRAME* = 8 - SM_CXDOUBLECLK* = 36 - SM_CYDOUBLECLK* = 37 - SM_CXDRAG* = 68 - SM_CYDRAG* = 69 - SM_CXEDGE* = 45 - SM_CYEDGE* = 46 - SM_CXFIXEDFRAME* = 7 - SM_CYFIXEDFRAME* = 8 - SM_CXFRAME* = 32 - SM_CYFRAME* = 33 - SM_CXFULLSCREEN* = 16 - SM_CYFULLSCREEN* = 17 - SM_CXHSCROLL* = 21 - SM_CYHSCROLL* = 3 - SM_CXHTHUMB* = 10 - SM_CXICON* = 11 - SM_CYICON* = 12 - SM_CXICONSPACING* = 38 - SM_CYICONSPACING* = 39 - SM_CXMAXIMIZED* = 61 - SM_CYMAXIMIZED* = 62 - SM_CXMAXTRACK* = 59 - SM_CYMAXTRACK* = 60 - SM_CXMENUCHECK* = 71 - SM_CYMENUCHECK* = 72 - SM_CXMENUSIZE* = 54 - SM_CYMENUSIZE* = 55 - SM_CXMINIMIZED* = 57 - SM_CYMINIMIZED* = 58 - SM_CXMINSPACING* = 47 - SM_CYMINSPACING* = 48 - SM_CXMINTRACK* = 34 - SM_CYMINTRACK* = 35 - SM_CXSCREEN* = 0 - SM_CYSCREEN* = 1 - SM_CXSIZE* = 30 - SM_CYSIZE* = 31 - SM_CXSIZEFRAME* = 32 - SM_CYSIZEFRAME* = 33 - SM_CXSMICON* = 49 - SM_CYSMICON* = 50 - SM_CXSMSIZE* = 52 - SM_CYSMSIZE* = 53 - SM_CXVSCROLL* = 2 - #SM_CYHSCROLL = 3;already above - #SM_CXHSCROLL = 21;already above - SM_CYVSCROLL* = 20 - SM_CYVTHUMB* = 9 - SM_CYCAPTION* = 4 - SM_CYKANJIWINDOW* = 18 - SM_CYMENU* = 15 - SM_CYSMCAPTION* = 51 - SM_DBCSENABLED* = 42 - SM_DEBUG* = 22 - SM_MENUDROPALIGNMENT* = 40 - SM_MIDEASTENABLED* = 74 - SM_MOUSEPRESENT* = 19 - SM_MOUSEWHEELPRESENT* = 75 - SM_NETWORK* = 63 - SM_PENWINDOWS* = 41 - SM_SECURE* = 44 - SM_SHOWSOUNDS* = 70 - SM_SLOWMACHINE* = 73 - SM_SWAPBUTTON* = 23 - ARW_BOTTOMLEFT* = 0 - ARW_BOTTOMRIGHT* = 0x00000001 - ARW_HIDE* = 0x00000008 - ARW_TOPLEFT* = 0x00000002 - ARW_TOPRIGHT* = 0x00000003 - ARW_DOWN* = 0x00000004 - ARW_LEFT* = 0 - ARW_RIGHT* = 0 - ARW_UP* = 0x00000004 - # GetSystemPaletteUse - SYSPAL_NOSTATIC* = 2 - SYSPAL_STATIC* = 1 - SYSPAL_ERROR* = 0 - # GetTapeParameters, SetTapeParameters - GET_TAPE_MEDIA_INFORMATION* = 0 - GET_TAPE_DRIVE_INFORMATION* = 1 - SET_TAPE_MEDIA_INFORMATION* = 0 - SET_TAPE_DRIVE_INFORMATION* = 1 - # GetTapePosition - TAPE_ABSOLUTE_POSITION* = 0 - TAPE_LOGICAL_POSITION* = 0x00000001 - # GetTextAlign - TA_BASELINE* = 24 - TA_BOTTOM* = 8 - TA_TOP* = 0 - TA_CENTER* = 6 - TA_LEFT* = 0 - TA_RIGHT* = 2 - TA_RTLREADING* = 256 - TA_NOUPDATECP* = 0 - TA_UPDATECP* = 1 - VTA_BASELINE* = 24 - VTA_CENTER* = 6 - # GetThreadPriority - THREAD_PRIORITY_ABOVE_NORMAL* = 1 - THREAD_PRIORITY_BELOW_NORMAL* = -1 - THREAD_PRIORITY_HIGHEST* = 2 - THREAD_PRIORITY_IDLE* = -15 - THREAD_PRIORITY_LOWEST* = -2 - THREAD_PRIORITY_NORMAL* = 0 - THREAD_PRIORITY_TIME_CRITICAL* = 15 - THREAD_PRIORITY_ERROR_RETURN* = 2147483647 - TLS_MINIMUM_AVAILABLE* = 64 - # GetTimeFormat - TIME_NOMINUTESORSECONDS* = 1 - TIME_NOSECONDS* = 2 - TIME_NOTIMEMARKER* = 4 - TIME_FORCE24HOURFORMAT* = 8 - -const - # GetTimeZoneInformation - TIME_ZONE_ID_INVALID* = DWORD(- 1) - TIME_ZONE_ID_UNKNOWN* = 0 - TIME_ZONE_ID_STANDARD* = 1 - TIME_ZONE_ID_DAYLIGHT* = 2 - # GetUserObjectInformation - UOI_FLAGS* = 1 - UOI_NAME* = 2 - UOI_TYPE* = 3 - # GetVolumeInformation - FS_CASE_IS_PRESERVED* = 2 - FS_CASE_SENSITIVE* = 1 - FS_UNICODE_STORED_ON_DISK* = 4 - FS_PERSISTENT_ACLS* = 8 - FS_FILE_COMPRESSION* = 16 - FS_VOL_IS_COMPRESSED* = 32768 - # GetWindowLong - GWL_EXSTYLE* = -20 - GWL_STYLE* = -16 - GWL_WNDPROC* = -4 - GWL_HINSTANCE* = -6 - GWL_HWNDPARENT* = -8 - GWL_ID* = -12 - GWL_USERDATA* = -21 - DWL_DLGPROC* = 4 - DWL_MSGRESULT* = 0 - DWL_USER* = 8 - # GlobalAlloc, GlobalFlags - GMEM_FIXED* = 0 - GMEM_MOVEABLE* = 2 - GPTR* = 64 - GHND* = 66 - GMEM_DDESHARE* = 8192 - GMEM_DISCARDABLE* = 256 - GMEM_LOWER* = 4096 - GMEM_NOCOMPACT* = 16 - GMEM_NODISCARD* = 32 - GMEM_NOT_BANKED* = 4096 - GMEM_NOTIFY* = 16384 - GMEM_SHARE* = 8192 - GMEM_ZEROINIT* = 64 - GMEM_DISCARDED* = 16384 - GMEM_INVALID_HANDLE* = 32768 - GMEM_LOCKCOUNT* = 255 - # HeapAlloc, HeapReAlloc - HEAP_GENERATE_EXCEPTIONS* = 4 - HEAP_NO_SERIALIZE* = 1 - HEAP_ZERO_MEMORY* = 8 - STATUS_NO_MEMORY* = 0xC0000017 - STATUS_ACCESS_VIOLATION* = 0xC0000005 - HEAP_REALLOC_IN_PLACE_ONLY* = 16 - # ImageList_Create - ILC_COLOR* = 0 - ILC_COLOR4* = 4 - ILC_COLOR8* = 8 - ILC_COLOR16* = 16 - ILC_COLOR24* = 24 - ILC_COLOR32* = 32 - ILC_COLORDDB* = 254 - ILC_MASK* = 1 - ILC_PALETTE* = 2048 - # ImageList_Draw, ImageList_DrawEx - ILD_BLEND25* = 2 - ILD_BLEND50* = 4 - ILD_SELECTED* = 4 - ILD_BLEND* = 4 - ILD_FOCUS* = 2 - ILD_MASK* = 16 - ILD_NORMAL* = 0 - ILD_TRANSPARENT* = 1 - CLR_NONE* = 0xFFFFFFFF - CLR_DEFAULT* = 0xFF000000 - CLR_INVALID* = 0xFFFFFFFF - # ImageList_LoadImage - #LR_DEFAULTCOLOR = 0;already above - LR_LOADFROMFILE* = 16 - LR_LOADMAP3DCOLORS* = 4096 - LR_LOADTRANSPARENT* = 32 - # ImmConfigureIME - IME_CONFIG_GENERAL* = 1 - IME_CONFIG_REGISTERWORD* = 2 - IME_CONFIG_SELECTDICTIONARY* = 3 - # ImmGetConversionList - GCL_CONVERSION* = 1 - GCL_REVERSECONVERSION* = 2 - GCL_REVERSE_LENGTH* = 3 - # ImmGetGuideLine - GGL_LEVEL* = 1 - GGL_INDEX* = 2 - GGL_STRING* = 3 - GGL_PRIVATE* = 4 - GL_LEVEL_ERROR* = 2 - GL_LEVEL_FATAL* = 1 - GL_LEVEL_INFORMATION* = 4 - GL_LEVEL_NOGUIDELINE* = 0 - GL_LEVEL_WARNING* = 3 - GL_ID_CANNOTSAVE* = 17 - GL_ID_NOCONVERT* = 32 - GL_ID_NODICTIONARY* = 16 - GL_ID_NOMODULE* = 1 - GL_ID_READINGCONFLICT* = 35 - GL_ID_TOOMANYSTROKE* = 34 - GL_ID_TYPINGERROR* = 33 - GL_ID_UNKNOWN* = 0 - GL_ID_INPUTREADING* = 36 - GL_ID_INPUTRADICAL* = 37 - GL_ID_INPUTCODE* = 38 - GL_ID_CHOOSECANDIDATE* = 40 - GL_ID_REVERSECONVERSION* = 41 - # ImmGetProperty - IGP_PROPERTY* = 4 - IGP_CONVERSION* = 8 - IGP_SENTENCE* = 12 - IGP_UI* = 16 - IGP_SETCOMPSTR* = 20 - IGP_SELECT* = 24 - IME_PROP_AT_CARET* = 65536 - IME_PROP_SPECIAL_UI* = 131072 - IME_PROP_CANDLIST_START_FROM_1* = 262144 - IME_PROP_UNICODE* = 524288 - UI_CAP_2700* = 1 - UI_CAP_ROT90* = 2 - UI_CAP_ROTANY* = 4 - SCS_CAP_COMPSTR* = 1 - SCS_CAP_MAKEREAD* = 2 - SELECT_CAP_CONVERSION* = 1 - SELECT_CAP_SENTENCE* = 2 - # ImmNotifyIME - NI_CHANGECANDIDATELIST* = 19 - NI_CLOSECANDIDATE* = 17 - NI_COMPOSITIONSTR* = 21 - NI_OPENCANDIDATE* = 16 - NI_SELECTCANDIDATESTR* = 18 - NI_SETCANDIDATE_PAGESIZE* = 23 - NI_SETCANDIDATE_PAGESTART* = 22 - CPS_CANCEL* = 4 - CPS_COMPLETE* = 1 - CPS_CONVERT* = 2 - CPS_REVERT* = 3 - # ImmSetCompositionString - SCS_SETSTR* = 9 - SCS_CHANGEATTR* = 18 - SCS_CHANGECLAUSE* = 36 - # ImmUnregisterWord - IME_REGWORD_STYLE_EUDC* = 1 - IME_REGWORD_STYLE_USER_FIRST* = 0x80000000 - IME_REGWORD_STYLE_USER_LAST* = -1 - # InitializeSecurityDescriptor - SECURITY_DESCRIPTOR_REVISION* = 1 - # IsTextUnicode - IS_TEXT_UNICODE_ASCII16* = 1 - IS_TEXT_UNICODE_REVERSE_ASCII16* = 16 - IS_TEXT_UNICODE_STATISTICS* = 2 - IS_TEXT_UNICODE_REVERSE_STATISTICS* = 32 - IS_TEXT_UNICODE_CONTROLS* = 4 - IS_TEXT_UNICODE_REVERSE_CONTROLS* = 64 - IS_TEXT_UNICODE_SIGNATURE* = 8 - IS_TEXT_UNICODE_REVERSE_SIGNATURE* = 128 - IS_TEXT_UNICODE_ILLEGAL_CHARS* = 256 - IS_TEXT_UNICODE_ODD_LENGTH* = 512 - IS_TEXT_UNICODE_NULL_BYTES* = 4096 - IS_TEXT_UNICODE_UNICODE_MASK* = 15 - IS_TEXT_UNICODE_REVERSE_MASK* = 240 - IS_TEXT_UNICODE_NOT_UNICODE_MASK* = 3840 - IS_TEXT_UNICODE_NOT_ASCII_MASK* = 61440 - # JournalPlaybackProc, KeyboardProc - HC_GETNEXT* = 1 - HC_SKIP* = 2 - HC_SYSMODALOFF* = 5 - HC_SYSMODALON* = 4 - HC_NOREMOVE* = 3 - # keybd_event - KEYEVENTF_EXTENDEDKEY* = 1 - KEYEVENTF_KEYUP* = 2 - # LoadBitmap - OBM_BTNCORNERS* = 32758 - OBM_BTSIZE* = 32761 - OBM_CHECK* = 32760 - OBM_CHECKBOXES* = 32759 - OBM_CLOSE* = 32754 - OBM_COMBO* = 32738 - OBM_DNARROW* = 32752 - OBM_DNARROWD* = 32742 - OBM_DNARROWI* = 32736 - OBM_LFARROW* = 32750 - OBM_LFARROWI* = 32734 - OBM_LFARROWD* = 32740 - OBM_MNARROW* = 32739 - OBM_OLD_CLOSE* = 32767 - OBM_OLD_DNARROW* = 32764 - OBM_OLD_LFARROW* = 32762 - OBM_OLD_REDUCE* = 32757 - OBM_OLD_RESTORE* = 32755 - OBM_OLD_RGARROW* = 32763 - OBM_OLD_UPARROW* = 32765 - OBM_OLD_ZOOM* = 32756 - OBM_REDUCE* = 32749 - OBM_REDUCED* = 32746 - OBM_RESTORE* = 32747 - OBM_RESTORED* = 32744 - OBM_RGARROW* = 32751 - OBM_RGARROWD* = 32741 - OBM_RGARROWI* = 32735 - OBM_SIZE* = 32766 - OBM_UPARROW* = 32753 - OBM_UPARROWD* = 32743 - OBM_UPARROWI* = 32737 - OBM_ZOOM* = 32748 - OBM_ZOOMD* = 32745 - # LoadLibraryEx - DONT_RESOLVE_DLL_REFERENCES* = 1 - LOAD_LIBRARY_AS_DATAFILE* = 2 - LOAD_WITH_ALTERED_SEARCH_PATH* = 8 - # LocalAlloc, LocalFlags - LPTR* = 64 - LHND* = 66 - NONZEROLHND* = 2 - NONZEROLPTR* = 0 - LMEM_NONZEROLHND* = 2 - LMEM_NONZEROLPTR* = 0 - LMEM_FIXED* = 0 - LMEM_MOVEABLE* = 2 - LMEM_NOCOMPACT* = 16 - LMEM_NODISCARD* = 32 - LMEM_ZEROINIT* = 64 - LMEM_MODIFY* = 128 - LMEM_LOCKCOUNT* = 255 - LMEM_DISCARDABLE* = 3840 - LMEM_DISCARDED* = 16384 - LMEM_INVALID_HANDLE* = 32768 - # LockFileEx - LOCKFILE_FAIL_IMMEDIATELY* = 1 - LOCKFILE_EXCLUSIVE_LOCK* = 2 - # LogonUser - # LZCopy, LZInit, LZRead - # MessageBeep, MessageBox - MB_USERICON* = 0x00000080 - MB_ICONASTERISK* = 0x00000040 - MB_ICONEXCLAMATION* = 0x00000030 - MB_ICONWARNING* = 0x00000030 - MB_ICONERROR* = 0x00000010 - MB_ICONHAND* = 0x00000010 - MB_ICONQUESTION* = 0x00000020 - MB_OK* = 0 - MB_ABORTRETRYIGNORE* = 0x00000002 - MB_APPLMODAL* = 0 - MB_DEFAULT_DESKTOP_ONLY* = 0x00020000 - MB_HELP* = 0x00004000 - MB_RIGHT* = 0x00080000 - MB_RTLREADING* = 0x00100000 - MB_TOPMOST* = 0x00040000 - MB_DEFBUTTON1* = 0 - MB_DEFBUTTON2* = 0x00000100 - MB_DEFBUTTON3* = 0x00000200 - MB_DEFBUTTON4* = 0x00000300 - MB_ICONINFORMATION* = 0x00000040 - MB_ICONSTOP* = 0x00000010 - MB_OKCANCEL* = 0x00000001 - MB_RETRYCANCEL* = 0x00000005 - MB_SERVICE_NOTIFICATION* = 0x00040000 - MB_SETFOREGROUND* = 0x00010000 - MB_SYSTEMMODAL* = 0x00001000 - MB_TASKMODAL* = 0x00002000 - MB_YESNO* = 0x00000004 - MB_YESNOCANCEL* = 0x00000003 - IDABORT* = 3 - IDCANCEL* = 2 - IDCLOSE* = 8 - IDHELP* = 9 - IDIGNORE* = 5 - IDNO* = 7 - IDOK* = 1 - IDRETRY* = 4 - IDYES* = 6 - # MessageProc - MSGF_DIALOGBOX* = 0 - MSGF_MENU* = 2 - MSGF_NEXTWINDOW* = 6 - MSGF_SCROLLBAR* = 5 - MSGF_MAINLOOP* = 8 - MSGF_USER* = 4096 - # ModifyWorldTransform - MWT_IDENTITY* = 1 - MWT_LEFTMULTIPLY* = 2 - MWT_RIGHTMULTIPLY* = 3 - # mouse_event - MOUSEEVENTF_ABSOLUTE* = 32768 - MOUSEEVENTF_MOVE* = 1 - MOUSEEVENTF_LEFTDOWN* = 2 - MOUSEEVENTF_LEFTUP* = 4 - MOUSEEVENTF_RIGHTDOWN* = 8 - MOUSEEVENTF_RIGHTUP* = 16 - MOUSEEVENTF_MIDDLEDOWN* = 32 - MOUSEEVENTF_MIDDLEUP* = 64 - # MoveFileEx - MOVEFILE_REPLACE_EXISTING* = 1 - MOVEFILE_COPY_ALLOWED* = 2 - MOVEFILE_DELAY_UNTIL_REBOOT* = 4 - # MsgWaitForMultipleObjects, WaitForMultipleObjectsEx - WAIT_OBJECT_0* = 0 - WAIT_ABANDONED_0* = 0x00000080 - WAIT_TIMEOUT* = 0x00000102 - WAIT_IO_COMPLETION* = 0x000000C0 - WAIT_ABANDONED* = 0x00000080 - WAIT_FAILED* = 0xFFFFFFFF - MAXIMUM_WAIT_OBJECTS* = 0x00000040 - MAXIMUM_SUSPEND_COUNT* = 0x0000007F - # MultiByteToWideChar - MB_PRECOMPOSED* = 1 - MB_COMPOSITE* = 2 - MB_ERR_INVALID_CHARS* = 8 - MB_USEGLYPHCHARS* = 4 - # NDdeSetTrustedShare - # NetAccessCheck - # NetServerEnum - # NetServiceControl - # NetUserEnum - # OpenProcessToken - TOKEN_ADJUST_DEFAULT* = 128 - TOKEN_ADJUST_GROUPS* = 64 - TOKEN_ADJUST_PRIVILEGES* = 32 - TOKEN_ALL_ACCESS* = 0x000F00FF - TOKEN_ASSIGN_PRIMARY* = 1 - TOKEN_DUPLICATE* = 2 - TOKEN_EXECUTE* = 0x00020000 - TOKEN_IMPERSONATE* = 4 - TOKEN_QUERY* = 8 - TOKEN_QUERY_SOURCE* = 16 - TOKEN_READ* = 0x00020008 - TOKEN_WRITE* = 0x000200E0 - # OpenSCManager - SC_MANAGER_ALL_ACCESS* = 0x000F003F - SC_MANAGER_CONNECT* = 1 - SC_MANAGER_CREATE_SERVICE* = 2 - SC_MANAGER_ENUMERATE_SERVICE* = 4 - SC_MANAGER_LOCK* = 8 - SC_MANAGER_QUERY_LOCK_STATUS* = 16 - SC_MANAGER_MODIFY_BOOT_CONFIG* = 32 - # PostMessage - HWND_BROADCAST* = HWND(0xffff) - -const - # PrepareTape - TAPE_FORMAT* = 0x00000005 - TAPE_LOAD* = 0 - TAPE_LOCK* = 0x00000003 - TAPE_TENSION* = 0x00000002 - TAPE_UNLOAD* = 0x00000001 - TAPE_UNLOCK* = 0x00000004 - # PropertySheet - IS_PSREBOOTSYSTEM* = 3 - IS_PSRESTARTWINDOWS* = 2 - # PropSheetPageProc - PSPCB_CREATE* = 2 - PSPCB_RELEASE* = 1 - # PurgeComm - PURGE_TXABORT* = 1 - PURGE_RXABORT* = 2 - PURGE_TXCLEAR* = 4 - PURGE_RXCLEAR* = 8 - # QueryServiceObjectSecurity - OWNER_SECURITY_INFORMATION* = 0x00000001 - GROUP_SECURITY_INFORMATION* = 0x00000002 - DACL_SECURITY_INFORMATION* = 0x00000004 - SACL_SECURITY_INFORMATION* = 0x00000008 - # ReadEventLog, ReportEvent - EVENTLOG_FORWARDS_READ* = 4 - EVENTLOG_BACKWARDS_READ* = 8 - EVENTLOG_SEEK_READ* = 2 - EVENTLOG_SEQUENTIAL_READ* = 1 - EVENTLOG_ERROR_TYPE* = 1 - EVENTLOG_WARNING_TYPE* = 2 - EVENTLOG_INFORMATION_TYPE* = 4 - EVENTLOG_AUDIT_SUCCESS* = 8 - - EVENTLOG_AUDIT_FAILURE* = 16 - # RedrawWindow - RDW_ERASE* = 4 - RDW_FRAME* = 1024 - RDW_INTERNALPAINT* = 2 - RDW_INVALIDATE* = 1 - RDW_NOERASE* = 32 - RDW_NOFRAME* = 2048 - RDW_NOINTERNALPAINT* = 16 - RDW_VALIDATE* = 8 - RDW_ERASENOW* = 512 - RDW_UPDATENOW* = 256 - RDW_ALLCHILDREN* = 128 - RDW_NOCHILDREN* = 64 - - # RegCreateKey - HKEY_CLASSES_ROOT* = HKEY(0x80000000) - HKEY_CURRENT_USER* = HKEY(0x80000001) - HKEY_LOCAL_MACHINE* = HKEY(0x80000002) - HKEY_USERS* = HKEY(0x80000003) - HKEY_PERFORMANCE_DATA* = HKEY(0x80000004) - HKEY_CURRENT_CONFIG* = HKEY(0x80000005) - HKEY_DYN_DATA* = HKEY(0x80000006) - -const - # RegCreateKeyEx - REG_OPTION_VOLATILE* = 0x00000001 - REG_OPTION_NON_VOLATILE* = 0 - REG_CREATED_NEW_KEY* = 0x00000001 - REG_OPENED_EXISTING_KEY* = 0x00000002 - # RegEnumValue - REG_BINARY* = 3 - REG_DWORD* = 4 - REG_DWORD_LITTLE_ENDIAN* = 4 - REG_DWORD_BIG_ENDIAN* = 5 - REG_EXPAND_SZ* = 2 - REG_FULL_RESOURCE_DESCRIPTOR* = 9 - REG_LINK* = 6 - REG_MULTI_SZ* = 7 - REG_NONE* = 0 - REG_RESOURCE_LIST* = 8 - REG_RESOURCE_REQUIREMENTS_LIST* = 10 - REG_SZ* = 1 - # RegisterHotKey - MOD_ALT* = 1 - MOD_CONTROL* = 2 - MOD_SHIFT* = 4 - MOD_WIN* = 8 - IDHOT_SNAPDESKTOP* = -2 - IDHOT_SNAPWINDOW* = -1 - # RegNotifyChangeKeyValue - REG_NOTIFY_CHANGE_NAME* = 0x00000001 - REG_NOTIFY_CHANGE_ATTRIBUTES* = 0x00000002 - REG_NOTIFY_CHANGE_LAST_SET* = 0x00000004 - REG_NOTIFY_CHANGE_SECURITY* = 0x00000008 - # ScrollWindowEx - SW_ERASE* = 4 - SW_INVALIDATE* = 2 - SW_SCROLLCHILDREN* = 1 - # SendMessageTimeout - SMTO_ABORTIFHUNG* = 2 - SMTO_BLOCK* = 1 - SMTO_NORMAL* = 0 - # SetBkMode - OPAQUE* = 2 - - TRANSPARENT* = 1 - # SetDebugErrorLevel - SLE_ERROR* = 1 - SLE_MINORERROR* = 2 - SLE_WARNING* = 3 - # SetErrorMode - SEM_FAILCRITICALERRORS* = 1 - SEM_NOALIGNMENTFAULTEXCEPT* = 4 - SEM_NOGPFAULTERRORBOX* = 2 - SEM_NOOPENFILEERRORBOX* = 32768 - # SetICMMode - ICM_ON* = 2 - ICM_OFF* = 1 - ICM_QUERY* = 3 - # SetJob - # Locale Information - LOCALE_ILANGUAGE* = 1 - LOCALE_SLANGUAGE* = 2 - LOCALE_SENGLANGUAGE* = 4097 - LOCALE_SABBREVLANGNAME* = 3 - LOCALE_SNATIVELANGNAME* = 4 - LOCALE_ICOUNTRY* = 5 - LOCALE_SCOUNTRY* = 6 - LOCALE_SENGCOUNTRY* = 4098 - LOCALE_SABBREVCTRYNAME* = 7 - LOCALE_SNATIVECTRYNAME* = 8 - LOCALE_IDEFAULTLANGUAGE* = 9 - LOCALE_IDEFAULTCOUNTRY* = 10 - LOCALE_IDEFAULTANSICODEPAGE* = 4100 - LOCALE_IDEFAULTCODEPAGE* = 11 - LOCALE_SLIST* = 12 - LOCALE_IMEASURE* = 13 - LOCALE_SDECIMAL* = 14 - LOCALE_STHOUSAND* = 15 - LOCALE_SGROUPING* = 16 - LOCALE_IDIGITS* = 17 - LOCALE_ILZERO* = 18 - LOCALE_INEGNUMBER* = 4112 - LOCALE_SCURRENCY* = 20 - LOCALE_SMONDECIMALSEP* = 22 - LOCALE_SMONTHOUSANDSEP* = 23 - LOCALE_SMONGROUPING* = 24 - LOCALE_ICURRDIGITS* = 25 - LOCALE_ICURRENCY* = 27 - LOCALE_INEGCURR* = 28 - LOCALE_SDATE* = 29 - LOCALE_STIME* = 30 - LOCALE_STIMEFORMAT* = 4099 - LOCALE_SSHORTDATE* = 31 - LOCALE_SLONGDATE* = 32 - LOCALE_IDATE* = 33 - LOCALE_ILDATE* = 34 - LOCALE_ITIME* = 35 - LOCALE_ITLZERO* = 37 - LOCALE_IDAYLZERO* = 38 - LOCALE_IMONLZERO* = 39 - LOCALE_S1159* = 40 - LOCALE_S2359* = 41 - LOCALE_ICALENDARTYPE* = 4105 - LOCALE_IOPTIONALCALENDAR* = 4107 - LOCALE_IFIRSTDAYOFWEEK* = 4108 - LOCALE_IFIRSTWEEKOFYEAR* = 4109 - LOCALE_SDAYNAME1* = 42 - LOCALE_SDAYNAME2* = 43 - LOCALE_SDAYNAME3* = 44 - LOCALE_SDAYNAME4* = 45 - LOCALE_SDAYNAME5* = 46 - LOCALE_SDAYNAME6* = 47 - LOCALE_SDAYNAME7* = 48 - LOCALE_SABBREVDAYNAME1* = 49 - LOCALE_SABBREVDAYNAME2* = 50 - LOCALE_SABBREVDAYNAME3* = 51 - LOCALE_SABBREVDAYNAME4* = 52 - LOCALE_SABBREVDAYNAME5* = 53 - LOCALE_SABBREVDAYNAME6* = 54 - LOCALE_SABBREVDAYNAME7* = 55 - LOCALE_SMONTHNAME1* = 56 - LOCALE_SMONTHNAME2* = 57 - LOCALE_SMONTHNAME3* = 58 - LOCALE_SMONTHNAME4* = 59 - LOCALE_SMONTHNAME5* = 60 - LOCALE_SMONTHNAME6* = 61 - LOCALE_SMONTHNAME7* = 62 - LOCALE_SMONTHNAME8* = 63 - LOCALE_SMONTHNAME9* = 64 - LOCALE_SMONTHNAME10* = 65 - LOCALE_SMONTHNAME11* = 66 - LOCALE_SMONTHNAME12* = 67 - LOCALE_SMONTHNAME13* = 4110 - LOCALE_SABBREVMONTHNAME1* = 68 - LOCALE_SABBREVMONTHNAME2* = 69 - LOCALE_SABBREVMONTHNAME3* = 70 - LOCALE_SABBREVMONTHNAME4* = 71 - LOCALE_SABBREVMONTHNAME5* = 72 - LOCALE_SABBREVMONTHNAME6* = 73 - LOCALE_SABBREVMONTHNAME7* = 74 - LOCALE_SABBREVMONTHNAME8* = 75 - LOCALE_SABBREVMONTHNAME9* = 76 - LOCALE_SABBREVMONTHNAME10* = 77 - LOCALE_SABBREVMONTHNAME11* = 78 - LOCALE_SABBREVMONTHNAME12* = 79 - LOCALE_SABBREVMONTHNAME13* = 4111 - LOCALE_SPOSITIVESIGN* = 80 - LOCALE_SNEGATIVESIGN* = 81 - LOCALE_IPOSSIGNPOSN* = 82 - LOCALE_INEGSIGNPOSN* = 83 - LOCALE_IPOSSYMPRECEDES* = 84 - LOCALE_IPOSSEPBYSPACE* = 85 - LOCALE_INEGSYMPRECEDES* = 86 - LOCALE_INEGSEPBYSPACE* = 87 - LOCALE_NOUSEROVERRIDE* = 0x80000000 - LOCALE_USE_CP_ACP* = 0x40000000 # use the system ACP - LOCALE_RETURN_NUMBER* = 0x20000000 # return number instead - LOCALE_SISO639LANGNAME* = 0x00000059 - LOCALE_SISO3166CTRYNAME* = 0x0000005A - # Calendar Type Information - CAL_ICALINTVALUE* = 1 - CAL_IYEAROFFSETRANGE* = 3 - CAL_SABBREVDAYNAME1* = 14 - CAL_SABBREVDAYNAME2* = 15 - CAL_SABBREVDAYNAME3* = 16 - CAL_SABBREVDAYNAME4* = 17 - CAL_SABBREVDAYNAME5* = 18 - CAL_SABBREVDAYNAME6* = 19 - CAL_SABBREVDAYNAME7* = 20 - CAL_SABBREVMONTHNAME1* = 34 - CAL_SABBREVMONTHNAME2* = 35 - CAL_SABBREVMONTHNAME3* = 36 - CAL_SABBREVMONTHNAME4* = 37 - CAL_SABBREVMONTHNAME5* = 38 - CAL_SABBREVMONTHNAME6* = 39 - CAL_SABBREVMONTHNAME7* = 40 - CAL_SABBREVMONTHNAME8* = 41 - CAL_SABBREVMONTHNAME9* = 42 - CAL_SABBREVMONTHNAME10* = 43 - CAL_SABBREVMONTHNAME11* = 44 - CAL_SABBREVMONTHNAME12* = 45 - CAL_SABBREVMONTHNAME13* = 46 - CAL_SCALNAME* = 2 - CAL_SDAYNAME1* = 7 - CAL_SDAYNAME2* = 8 - CAL_SDAYNAME3* = 9 - CAL_SDAYNAME4* = 10 - CAL_SDAYNAME5* = 11 - CAL_SDAYNAME6* = 12 - CAL_SDAYNAME7* = 13 - CAL_SERASTRING* = 4 - CAL_SLONGDATE* = 6 - CAL_SMONTHNAME1* = 21 - CAL_SMONTHNAME2* = 22 - CAL_SMONTHNAME3* = 23 - CAL_SMONTHNAME4* = 24 - CAL_SMONTHNAME5* = 25 - CAL_SMONTHNAME6* = 26 - CAL_SMONTHNAME7* = 27 - CAL_SMONTHNAME8* = 28 - CAL_SMONTHNAME9* = 29 - CAL_SMONTHNAME10* = 30 - CAL_SMONTHNAME11* = 31 - CAL_SMONTHNAME12* = 32 - CAL_SMONTHNAME13* = 33 - CAL_SSHORTDATE* = 5 - # SetProcessWorkingSetSize - PROCESS_SET_QUOTA* = 256 - # SetPrinter - # SetService - # SetStretchBltMode - BLACKONWHITE* = 1 - COLORONCOLOR* = 3 - HALFTONE* = 4 - STRETCH_ANDSCANS* = 1 - STRETCH_DELETESCANS* = 3 - STRETCH_HALFTONE* = 4 - STRETCH_ORSCANS* = 2 - WHITEONBLACK* = 2 - # SetSystemCursor - OCR_NORMAL* = 32512 - OCR_IBEAM* = 32513 - OCR_WAIT* = 32514 - OCR_CROSS* = 32515 - OCR_UP* = 32516 - OCR_SIZE* = 32640 - OCR_ICON* = 32641 - OCR_SIZENWSE* = 32642 - OCR_SIZENESW* = 32643 - OCR_SIZEWE* = 32644 - OCR_SIZENS* = 32645 - OCR_SIZEALL* = 32646 - OCR_NO* = 32648 - OCR_APPSTARTING* = 32650 - # SetTapePosition - TAPE_ABSOLUTE_BLOCK* = 0x00000001 - TAPE_LOGICAL_BLOCK* = 0x00000002 - TAPE_REWIND* = 0 - TAPE_SPACE_END_OF_DATA* = 0x00000004 - TAPE_SPACE_FILEMARKS* = 0x00000006 - TAPE_SPACE_RELATIVE_BLOCKS* = 0x00000005 - TAPE_SPACE_SEQUENTIAL_FMKS* = 0x00000007 - TAPE_SPACE_SEQUENTIAL_SMKS* = 0x00000009 - TAPE_SPACE_SETMARKS* = 0x00000008 - # SetUnhandledExceptionFilter - EXCEPTION_EXECUTE_HANDLER* = 1 - EXCEPTION_CONTINUE_EXECUTION* = -1 - EXCEPTION_CONTINUE_SEARCH* = 0 - - # SetWindowPos, DeferWindowPos - HWND_BOTTOM* = HWND(1) - HWND_NOTOPMOST* = HWND(-2) - HWND_TOP* = HWND(0) - HWND_TOPMOST* = HWND(-1) - -const - SWP_DRAWFRAME* = 32 - SWP_FRAMECHANGED* = 32 - SWP_HIDEWINDOW* = 128 - SWP_NOACTIVATE* = 16 - SWP_NOCOPYBITS* = 256 - SWP_NOMOVE* = 2 - SWP_NOSIZE* = 1 - SWP_NOREDRAW* = 8 - SWP_NOZORDER* = 4 - SWP_SHOWWINDOW* = 64 - SWP_NOOWNERZORDER* = 512 - SWP_NOREPOSITION* = 512 - SWP_NOSENDCHANGING* = 1024 - # SHAddToRecentDocs - # SHAppBarMessage - # SHChangeNotify - # ShellProc - HSHELL_ACTIVATESHELLWINDOW* = 3 - HSHELL_GETMINRECT* = 5 - HSHELL_LANGUAGE* = 8 - HSHELL_REDRAW* = 6 - HSHELL_TASKMAN* = 7 - HSHELL_WINDOWACTIVATED* = 4 - HSHELL_WINDOWCREATED* = 1 - HSHELL_WINDOWDESTROYED* = 2 - # SHGetFileInfo - # SHGetSpecialFolderLocation - # ShowWindow - SW_HIDE* = 0 - SW_MAXIMIZE* = 3 - SW_MINIMIZE* = 6 - SW_NORMAL* = 1 - SW_RESTORE* = 9 - SW_SHOW* = 5 - SW_SHOWDEFAULT* = 10 - SW_SHOWMAXIMIZED* = 3 - SW_SHOWMINIMIZED* = 2 - SW_SHOWMINNOACTIVE* = 7 - SW_SHOWNA* = 8 - SW_SHOWNOACTIVATE* = 4 - SW_SHOWNORMAL* = 1 - WPF_RESTORETOMAXIMIZED* = 2 - WPF_SETMINPOSITION* = 1 - # Sleep - INFINITE* = -1'i32 - # SystemParametersInfo - SPI_GETBEEP* = 1 - SPI_SETBEEP* = 2 - SPI_GETMOUSE* = 3 - SPI_SETMOUSE* = 4 - SPI_GETBORDER* = 5 - SPI_SETBORDER* = 6 - SPI_GETKEYBOARDSPEED* = 10 - SPI_SETKEYBOARDSPEED* = 11 - SPI_LANGDRIVER* = 12 - SPI_ICONHORIZONTALSPACING* = 13 - SPI_GETSCREENSAVETIMEOUT* = 14 - SPI_SETSCREENSAVETIMEOUT* = 15 - SPI_GETSCREENSAVEACTIVE* = 16 - SPI_SETSCREENSAVEACTIVE* = 17 - SPI_GETGRIDGRANULARITY* = 18 - SPI_SETGRIDGRANULARITY* = 19 - SPI_SETDESKWALLPAPER* = 20 - SPI_SETDESKPATTERN* = 21 - SPI_GETKEYBOARDDELAY* = 22 - SPI_SETKEYBOARDDELAY* = 23 - SPI_ICONVERTICALSPACING* = 24 - SPI_GETICONTITLEWRAP* = 25 - SPI_SETICONTITLEWRAP* = 26 - SPI_GETMENUDROPALIGNMENT* = 27 - SPI_SETMENUDROPALIGNMENT* = 28 - SPI_SETDOUBLECLKWIDTH* = 29 - SPI_SETDOUBLECLKHEIGHT* = 30 - SPI_GETICONTITLELOGFONT* = 31 - SPI_SETDOUBLECLICKTIME* = 32 - SPI_SETMOUSEBUTTONSWAP* = 33 - SPI_SETICONTITLELOGFONT* = 34 - SPI_GETFASTTASKSWITCH* = 35 - SPI_SETFASTTASKSWITCH* = 36 - SPI_SETDRAGFULLWINDOWS* = 37 - SPI_GETDRAGFULLWINDOWS* = 38 - SPI_GETNONCLIENTMETRICS* = 41 - SPI_SETNONCLIENTMETRICS* = 42 - - SPI_GETMINIMIZEDMETRICS* = 43 - SPI_SETMINIMIZEDMETRICS* = 44 - SPI_GETICONMETRICS* = 45 - SPI_SETICONMETRICS* = 46 - SPI_SETWORKAREA* = 47 - SPI_GETWORKAREA* = 48 - SPI_SETPENWINDOWS* = 49 - SPI_GETFILTERKEYS* = 50 - SPI_SETFILTERKEYS* = 51 - SPI_GETTOGGLEKEYS* = 52 - SPI_SETTOGGLEKEYS* = 53 - SPI_GETMOUSEKEYS* = 54 - SPI_SETMOUSEKEYS* = 55 - SPI_GETSHOWSOUNDS* = 56 - SPI_SETSHOWSOUNDS* = 57 - SPI_GETSTICKYKEYS* = 58 - SPI_SETSTICKYKEYS* = 59 - SPI_GETACCESSTIMEOUT* = 60 - SPI_SETACCESSTIMEOUT* = 61 - SPI_GETSERIALKEYS* = 62 - SPI_SETSERIALKEYS* = 63 - SPI_GETSOUNDSENTRY* = 64 - SPI_SETSOUNDSENTRY* = 65 - SPI_GETHIGHCONTRAST* = 66 - SPI_SETHIGHCONTRAST* = 67 - SPI_GETKEYBOARDPREF* = 68 - SPI_SETKEYBOARDPREF* = 69 - SPI_GETSCREENREADER* = 70 - SPI_SETSCREENREADER* = 71 - SPI_GETANIMATION* = 72 - SPI_SETANIMATION* = 73 - SPI_GETFONTSMOOTHING* = 74 - SPI_SETFONTSMOOTHING* = 75 - SPI_SETDRAGWIDTH* = 76 - SPI_SETDRAGHEIGHT* = 77 - SPI_SETHANDHELD* = 78 - SPI_GETLOWPOWERTIMEOUT* = 79 - SPI_GETPOWEROFFTIMEOUT* = 80 - SPI_SETLOWPOWERTIMEOUT* = 81 - SPI_SETPOWEROFFTIMEOUT* = 82 - SPI_GETLOWPOWERACTIVE* = 83 - SPI_GETPOWEROFFACTIVE* = 84 - SPI_SETLOWPOWERACTIVE* = 85 - SPI_SETPOWEROFFACTIVE* = 86 - SPI_SETCURSORS* = 87 - SPI_SETICONS* = 88 - SPI_GETDEFAULTINPUTLANG* = 89 - SPI_SETDEFAULTINPUTLANG* = 90 - SPI_SETLANGTOGGLE* = 91 - SPI_GETWINDOWSEXTENSION* = 92 - SPI_SETMOUSETRAILS* = 93 - SPI_GETMOUSETRAILS* = 94 - SPI_GETSNAPTODEFBUTTON* = 95 - SPI_SETSNAPTODEFBUTTON* = 96 - SPI_SCREENSAVERRUNNING* = 97 - SPI_SETSCREENSAVERRUNNING* = 97 - SPI_GETMOUSEHOVERWIDTH* = 98 - SPI_SETMOUSEHOVERWIDTH* = 99 - SPI_GETMOUSEHOVERHEIGHT* = 100 - SPI_SETMOUSEHOVERHEIGHT* = 101 - SPI_GETMOUSEHOVERTIME* = 102 - SPI_SETMOUSEHOVERTIME* = 103 - SPI_GETWHEELSCROLLLINES* = 104 - SPI_SETWHEELSCROLLLINES* = 105 - SPI_GETMENUSHOWDELAY* = 106 - SPI_SETMENUSHOWDELAY* = 107 - SPI_GETSHOWIMEUI* = 110 - SPI_SETSHOWIMEUI* = 111 - # Windows Me/2000 and higher - SPI_GETMOUSESPEED* = 112 - SPI_SETMOUSESPEED* = 113 - SPI_GETSCREENSAVERRUNNING* = 114 - SPI_GETDESKWALLPAPER* = 115 - SPI_GETACTIVEWINDOWTRACKING* = 4096 - SPI_SETACTIVEWINDOWTRACKING* = 4097 - SPI_GETMENUANIMATION* = 4098 - SPI_SETMENUANIMATION* = 4099 - SPI_GETCOMBOBOXANIMATION* = 4100 - SPI_SETCOMBOBOXANIMATION* = 4101 - SPI_GETLISTBOXSMOOTHSCROLLING* = 4102 - SPI_SETLISTBOXSMOOTHSCROLLING* = 4103 - SPI_GETGRADIENTCAPTIONS* = 4104 - SPI_SETGRADIENTCAPTIONS* = 4105 - SPI_GETKEYBOARDCUES* = 4106 - SPI_SETKEYBOARDCUES* = 4107 - SPI_GETMENUUNDERLINES* = 4106 - SPI_SETMENUUNDERLINES* = 4107 - SPI_GETACTIVEWNDTRKZORDER* = 4108 - SPI_SETACTIVEWNDTRKZORDER* = 4109 - SPI_GETHOTTRACKING* = 4110 - SPI_SETHOTTRACKING* = 4111 - SPI_GETMENUFADE* = 4114 - SPI_SETMENUFADE* = 4115 - SPI_GETSELECTIONFADE* = 4116 - SPI_SETSELECTIONFADE* = 4117 - SPI_GETTOOLTIPANIMATION* = 4118 - SPI_SETTOOLTIPANIMATION* = 4119 - SPI_GETTOOLTIPFADE* = 4120 - SPI_SETTOOLTIPFADE* = 4121 - SPI_GETCURSORSHADOW* = 4122 - SPI_SETCURSORSHADOW* = 4123 - SPI_GETUIEFFECTS* = 4158 - SPI_SETUIEFFECTS* = 4159 - SPI_GETFOREGROUNDLOCKTIMEOUT* = 8192 - SPI_SETFOREGROUNDLOCKTIMEOUT* = 8193 - SPI_GETACTIVEWNDTRKTIMEOUT* = 8194 - SPI_SETACTIVEWNDTRKTIMEOUT* = 8195 - SPI_GETFOREGROUNDFLASHCOUNT* = 8196 - SPI_SETFOREGROUNDFLASHCOUNT* = 8197 - SPI_GETCARETWIDTH* = 8198 - SPI_SETCARETWIDTH* = 8199 - # Windows XP and higher - SPI_GETMOUSESONAR* = 4124 - SPI_SETMOUSESONAR* = 4125 - SPI_GETMOUSECLICKLOCK* = 4126 - SPI_SETMOUSECLICKLOCK* = 4127 - SPI_GETMOUSEVANISH* = 4128 - SPI_SETMOUSEVANISH* = 4129 - SPI_GETFLATMENU* = 4130 - SPI_SETFLATMENU* = 4131 - SPI_GETDROPSHADOW* = 4132 - SPI_SETDROPSHADOW* = 4133 - SPI_GETBLOCKSENDINPUTRESETS* = 4134 - SPI_SETBLOCKSENDINPUTRESETS* = 4135 - SPI_GETMOUSECLICKLOCKTIME* = 8200 - SPI_SETMOUSECLICKLOCKTIME* = 8201 - SPI_GETFONTSMOOTHINGTYPE* = 8202 - SPI_SETFONTSMOOTHINGTYPE* = 8203 - SPI_GETFONTSMOOTHINGCONTRAST* = 8204 - SPI_SETFONTSMOOTHINGCONTRAST* = 8205 - SPI_GETFOCUSBORDERWIDTH* = 8206 - SPI_SETFOCUSBORDERWIDTH* = 8207 - SPI_GETFOCUSBORDERHEIGHT* = 8208 - SPI_SETFOCUSBORDERHEIGHT* = 8209 - SPI_GETFONTSMOOTHINGORIENTATION* = 8210 - SPI_SETFONTSMOOTHINGORIENTATION* = 8211 - # constants for SPI_GETFONTSMOOTHINGTYPE and SPI_SETFONTSMOOTHINGTYPE: - FE_FONTSMOOTHINGSTANDARD* = 1 - FE_FONTSMOOTHINGCLEARTYPE* = 2 - FE_FONTSMOOTHINGDOCKING* = 32768 - # constants for SPI_GETFONTSMOOTHINGORIENTATION and SPI_SETFONTSMOOTHINGORIENTATION: - FE_FONTSMOOTHINGORIENTATIONBGR* = 0 - FE_FONTSMOOTHINGORIENTATIONRGB* = 1 - # Flags - SPIF_UPDATEINIFILE* = 1 - SPIF_SENDWININICHANGE* = 2 - SPIF_SENDCHANGE* = 2 - # TrackPopupMenu, TrackPopMenuEx - TPM_CENTERALIGN* = 0x00000004 - TPM_LEFTALIGN* = 0 - TPM_RIGHTALIGN* = 0x00000008 - TPM_LEFTBUTTON* = 0 - TPM_RIGHTBUTTON* = 0x00000002 - TPM_HORIZONTAL* = 0 - TPM_VERTICAL* = 0x00000040 - # TranslateCharsetInfo - TCI_SRCCHARSET* = 1 - TCI_SRCCODEPAGE* = 2 - TCI_SRCFONTSIG* = 3 - # VerFindFile - VFFF_ISSHAREDFILE* = 1 - VFF_CURNEDEST* = 1 - VFF_FILEINUSE* = 2 - VFF_BUFFTOOSMALL* = 4 - # VerInstallFile - VIFF_FORCEINSTALL* = 1 - VIFF_DONTDELETEOLD* = 2 - VIF_TEMPFILE* = 0x00000001 - VIF_MISMATCH* = 0x00000002 - VIF_SRCOLD* = 0x00000004 - VIF_DIFFLANG* = 0x00000008 - VIF_DIFFCODEPG* = 0x00000010 - VIF_DIFFTYPE* = 0x00000020 - VIF_WRITEPROT* = 0x00000040 - VIF_FILEINUSE* = 0x00000080 - VIF_OUTOFSPACE* = 0x00000100 - VIF_ACCESSVIOLATION* = 0x00000200 - VIF_SHARINGVIOLATION* = 0x00000400 - VIF_CANNOTCREATE* = 0x00000800 - VIF_CANNOTDELETE* = 0x00001000 - VIF_CANNOTDELETECUR* = 0x00004000 - VIF_CANNOTRENAME* = 0x00002000 - VIF_OUTOFMEMORY* = 0x00008000 - VIF_CANNOTREADSRC* = 0x00010000 - VIF_CANNOTREADDST* = 0x00020000 - VIF_BUFFTOOSMALL* = 0x00040000 - # WideCharToMultiByte - WC_COMPOSITECHECK* = 512 - WC_DISCARDNS* = 16 - WC_SEPCHARS* = 32 - WC_DEFAULTCHAR* = 64 - # WinHelp - HELP_COMMAND* = 0x00000102 - HELP_CONTENTS* = 0x00000003 - HELP_CONTEXT* = 0x00000001 - HELP_CONTEXTPOPUP* = 0x00000008 - HELP_FORCEFILE* = 0x00000009 - HELP_HELPONHELP* = 0x00000004 - HELP_INDEX* = 0x00000003 - HELP_KEY* = 0x00000101 - HELP_MULTIKEY* = 0x00000201 - HELP_PARTIALKEY* = 0x00000105 - HELP_QUIT* = 0x00000002 - HELP_SETCONTENTS* = 0x00000005 - HELP_SETINDEX* = 0x00000005 - HELP_CONTEXTMENU* = 0x0000000A - HELP_FINDER* = 0x0000000B - HELP_WM_HELP* = 0x0000000C - HELP_TCARD* = 0x00008000 - HELP_TCARD_DATA* = 0x00000010 - HELP_TCARD_OTHER_CALLER* = 0x00000011 - # WNetAddConnectino2 - CONNECT_UPDATE_PROFILE* = 1 - # WNetConnectionDialog, WNetDisconnectDialog, WNetOpenEnum - RESOURCETYPE_DISK* = 1 - RESOURCETYPE_PRINT* = 2 - RESOURCETYPE_ANY* = 0 - RESOURCE_CONNECTED* = 1 - RESOURCE_GLOBALNET* = 2 - RESOURCE_REMEMBERED* = 3 - RESOURCEUSAGE_CONNECTABLE* = 1 - RESOURCEUSAGE_CONTAINER* = 2 - # WNetGetResourceInformation, WNetGetResourceParent - WN_BAD_NETNAME* = 0x00000043 - WN_EXTENDED_ERROR* = 0x000004B8 - WN_MORE_DATA* = 0x000000EA - WN_NO_NETWORK* = 0x000004C6 - WN_SUCCESS* = 0 - WN_ACCESS_DENIED* = 0x00000005 - WN_BAD_PROVIDER* = 0x000004B4 - WN_NOT_AUTHENTICATED* = 0x000004DC - # WNetGetUniversalName - UNIVERSAL_NAME_INFO_LEVEL* = 1 - REMOTE_NAME_INFO_LEVEL* = 2 - # GetExitCodeThread - STILL_ACTIVE* = 0x00000103 - # COMMPROP structure - SP_SERIALCOMM* = 0x00000001 - BAUD_075* = 0x00000001 - BAUD_110* = 0x00000002 - BAUD_134_5* = 0x00000004 - BAUD_150* = 0x00000008 - BAUD_300* = 0x00000010 - BAUD_600* = 0x00000020 - BAUD_1200* = 0x00000040 - BAUD_1800* = 0x00000080 - BAUD_2400* = 0x00000100 - BAUD_4800* = 0x00000200 - BAUD_7200* = 0x00000400 - BAUD_9600* = 0x00000800 - BAUD_14400* = 0x00001000 - BAUD_19200* = 0x00002000 - BAUD_38400* = 0x00004000 - BAUD_56K* = 0x00008000 - BAUD_57600* = 0x00040000 - BAUD_115200* = 0x00020000 - BAUD_128K* = 0x00010000 - BAUD_USER* = 0x10000000 - PST_FAX* = 0x00000021 - PST_LAT* = 0x00000101 - PST_MODEM* = 0x00000006 - PST_NETWORK_BRIDGE* = 0x00000100 - PST_PARALLELPORT* = 0x00000002 - PST_RS232* = 0x00000001 - PST_RS422* = 0x00000003 - PST_RS423* = 0x00000004 - PST_RS449* = 0x00000005 - PST_SCANNER* = 0x00000022 - PST_TCPIP_TELNET* = 0x00000102 - PST_UNSPECIFIED* = 0 - PST_X25* = 0x00000103 - PCF_16BITMODE* = 0x00000200 - PCF_DTRDSR* = 0x00000001 - PCF_INTTIMEOUTS* = 0x00000080 - PCF_PARITY_CHECK* = 0x00000008 - PCF_RLSD* = 0x00000004 - PCF_RTSCTS* = 0x00000002 - PCF_SETXCHAR* = 0x00000020 - PCF_SPECIALCHARS* = 0x00000100 - PCF_TOTALTIMEOUTS* = 0x00000040 - PCF_XONXOFF* = 0x00000010 - SP_BAUD* = 0x00000002 - SP_DATABITS* = 0x00000004 - SP_HANDSHAKING* = 0x00000010 - SP_PARITY* = 0x00000001 - SP_PARITY_CHECK* = 0x00000020 - SP_RLSD* = 0x00000040 - SP_STOPBITS* = 0x00000008 - DATABITS_5* = 1 - DATABITS_6* = 2 - DATABITS_7* = 4 - DATABITS_8* = 8 - DATABITS_16* = 16 - DATABITS_16X* = 32 - STOPBITS_10* = 1 - STOPBITS_15* = 2 - STOPBITS_20* = 4 - PARITY_NONE* = 256 - PARITY_ODD* = 512 - PARITY_EVEN* = 1024 - PARITY_MARK* = 2048 - PARITY_SPACE* = 4096 - COMMPROP_INITIALIZED* = 0xE73CF52E - # DCB structure - CBR_110* = 110 - CBR_300* = 300 - CBR_600* = 600 - CBR_1200* = 1200 - CBR_2400* = 2400 - CBR_4800* = 4800 - CBR_9600* = 9600 - CBR_14400* = 14400 - CBR_19200* = 19200 - CBR_38400* = 38400 - CBR_56000* = 56000 - CBR_57600* = 57600 - CBR_115200* = 115200 - CBR_128000* = 128000 - CBR_256000* = 256000 - DTR_CONTROL_DISABLE* = 0 - DTR_CONTROL_ENABLE* = 1 - DTR_CONTROL_HANDSHAKE* = 2 - RTS_CONTROL_DISABLE* = 0 - RTS_CONTROL_ENABLE* = 1 - RTS_CONTROL_HANDSHAKE* = 2 - RTS_CONTROL_TOGGLE* = 3 - EVENPARITY* = 2 - MARKPARITY* = 3 - NOPARITY* = 0 - ODDPARITY* = 1 - SPACEPARITY* = 4 - ONESTOPBIT* = 0 - ONE5STOPBITS* = 1 - TWOSTOPBITS* = 2 - # Debugging events - CREATE_PROCESS_DEBUG_EVENT* = 3 - CREATE_THREAD_DEBUG_EVENT* = 2 - EXCEPTION_DEBUG_EVENT* = 1 - EXIT_PROCESS_DEBUG_EVENT* = 5 - EXIT_THREAD_DEBUG_EVENT* = 4 - LOAD_DLL_DEBUG_EVENT* = 6 - OUTPUT_DEBUG_STRING_EVENT* = 8 - UNLOAD_DLL_DEBUG_EVENT* = 7 - RIP_EVENT* = 9 - # PROCESS_HEAP_ENTRY structure - PROCESS_HEAP_REGION* = 1 - PROCESS_HEAP_UNCOMMITTED_RANGE* = 2 - PROCESS_HEAP_ENTRY_BUSY* = 4 - PROCESS_HEAP_ENTRY_MOVEABLE* = 16 - PROCESS_HEAP_ENTRY_DDESHARE* = 32 - # Win32s - HINSTANCE_ERROR* = 32 - # WIN32_STREAM_ID structure - BACKUP_DATA* = 1 - BACKUP_EA_DATA* = 2 - BACKUP_SECURITY_DATA* = 3 - BACKUP_ALTERNATE_DATA* = 4 - BACKUP_LINK* = 5 - STREAM_MODIFIED_WHEN_READ* = 1 - STREAM_CONTAINS_SECURITY* = 2 - # STARTUPINFO structure - STARTF_USESHOWWINDOW* = 1 - STARTF_USEPOSITION* = 4 - STARTF_USESIZE* = 2 - STARTF_USECOUNTCHARS* = 8 - STARTF_USEFILLATTRIBUTE* = 16 - STARTF_RUNFULLSCREEN* = 32 - STARTF_FORCEONFEEDBACK* = 64 - STARTF_FORCEOFFFEEDBACK* = 128 - STARTF_USESTDHANDLES* = 256 - STARTF_USEHOTKEY* = 512 - # OSVERSIONINFO structure - VER_PLATFORM_WIN32s* = 0 - VER_PLATFORM_WIN32_WINDOWS* = 1 - VER_PLATFORM_WIN32_NT* = 2 - # More versions - VER_SERVER_NT* = 0x80000000 - VER_WORKSTATION_NT* = 0x40000000 - VER_SUITE_SMALLBUSINESS* = 0x00000001 - VER_SUITE_ENTERPRISE* = 0x00000002 - VER_SUITE_BACKOFFICE* = 0x00000004 - VER_SUITE_COMMUNICATIONS* = 0x00000008 - VER_SUITE_TERMINAL* = 0x00000010 - VER_SUITE_SMALLBUSINESS_RESTRICTED* = 0x00000020 - VER_SUITE_EMBEDDEDNT* = 0x00000040 - VER_SUITE_DATACENTER* = 0x00000080 - VER_SUITE_SINGLEUSERTS* = 0x00000100 - VER_SUITE_PERSONAL* = 0x00000200 - VER_SUITE_BLADE* = 0x00000400 - VER_SUITE_EMBEDDED_RESTRICTED* = 0x00000800 - # PROPSHEETPAGE structure - MAXPROPPAGES* = 100 - PSP_DEFAULT* = 0 - PSP_DLGINDIRECT* = 1 - PSP_HASHELP* = 32 - PSP_USECALLBACK* = 128 - PSP_USEHICON* = 2 - PSP_USEICONID* = 4 - PSP_USEREFPARENT* = 64 - PSP_USETITLE* = 8 - PSP_RTLREADING* = 16 - # PROPSHEETHEADER structure - PSH_DEFAULT* = 0 - PSH_HASHELP* = 512 - PSH_MODELESS* = 1024 - PSH_NOAPPLYNOW* = 128 - PSH_PROPSHEETPAGE* = 8 - PSH_PROPTITLE* = 1 - PSH_USECALLBACK* = 256 - PSH_USEHICON* = 2 - PSH_USEICONID* = 4 - PSH_USEPSTARTPAGE* = 64 - PSH_WIZARD* = 32 - PSH_RTLREADING* = 2048 - PSCB_INITIALIZED* = 1 - PSCB_PRECREATE* = 2 - # PSN_APPLY message - PSNRET_NOERROR* = 0 - PSNRET_INVALID_NOCHANGEPAGE* = 2 - # Property Sheet - PSBTN_APPLYNOW* = 4 - PSBTN_BACK* = 0 - PSBTN_CANCEL* = 5 - PSBTN_FINISH* = 2 - PSBTN_HELP* = 6 - PSBTN_NEXT* = 1 - PSBTN_OK* = 3 - PSWIZB_BACK* = 1 - PSWIZB_NEXT* = 2 - PSWIZB_FINISH* = 4 - PSWIZB_DISABLEDFINISH* = 8 - ID_PSREBOOTSYSTEM* = 3 - ID_PSRESTARTWINDOWS* = 2 - WIZ_BODYCX* = 184 - WIZ_BODYX* = 92 - WIZ_CXBMP* = 80 - WIZ_CXDLG* = 276 - WIZ_CYDLG* = 140 - - # VX_FIXEDFILEINFO structure - VS_FILE_INFO* = cast[MAKEINTRESOURCE](16) - -const - VS_VERSION_INFO* = 1 - VS_FF_DEBUG* = 0x00000001 - VS_FF_INFOINFERRED* = 0x00000010 - VS_FF_PATCHED* = 0x00000004 - VS_FF_PRERELEASE* = 0x00000002 - VS_FF_PRIVATEBUILD* = 0x00000008 - VS_FF_SPECIALBUILD* = 0x00000020 - VOS_UNKNOWN* = 0 - VOS_DOS* = 0x00010000 - VOS_OS216* = 0x00020000 - VOS_OS232* = 0x00030000 - VOS_NT* = 0x00040000 - VOS_DOS_WINDOWS16* = 0x00010001 - VOS_DOS_WINDOWS32* = 0x00010004 - VOS_OS216_PM16* = 0x00020002 - VOS_OS232_PM32* = 0x00030003 - VOS_NT_WINDOWS32* = 0x00040004 - VFT_UNKNOWN* = 0 - VFT_APP* = 0x00000001 - VFT_DLL* = 0x00000002 - VFT_DRV* = 0x00000003 - VFT_FONT* = 0x00000004 - VFT_VXD* = 0x00000005 - VFT_STATIC_LIB* = 0x00000007 - VFT2_UNKNOWN* = 0 - VFT2_DRV_PRINTER* = 0x00000001 - VFT2_DRV_KEYBOARD* = 0x00000002 - VFT2_DRV_LANGUAGE* = 0x00000003 - VFT2_DRV_DISPLAY* = 0x00000004 - VFT2_DRV_MOUSE* = 0x00000005 - VFT2_DRV_NETWORK* = 0x00000006 - VFT2_DRV_SYSTEM* = 0x00000007 - VFT2_DRV_INSTALLABLE* = 0x00000008 - VFT2_DRV_SOUND* = 0x00000009 - VFT2_FONT_RASTER* = 0x00000001 - VFT2_FONT_VECTOR* = 0x00000002 - VFT2_FONT_TRUETYPE* = 0x00000003 - # PANOSE structure - PAN_ANY* = 0 - PAN_NO_FIT* = 1 - PAN_FAMILY_TEXT_DISPLAY* = 2 - PAN_FAMILY_SCRIPT* = 3 - PAN_FAMILY_DECORATIVE* = 4 - PAN_FAMILY_PICTORIAL* = 5 - PAN_SERIF_COVE* = 2 - PAN_SERIF_OBTUSE_COVE* = 3 - PAN_SERIF_SQUARE_COVE* = 4 - PAN_SERIF_OBTUSE_SQUARE_COVE* = 5 - PAN_SERIF_SQUARE* = 6 - PAN_SERIF_THIN* = 7 - PAN_SERIF_BONE* = 8 - PAN_SERIF_EXAGGERATED* = 9 - PAN_SERIF_TRIANGLE* = 10 - PAN_SERIF_NORMAL_SANS* = 11 - PAN_SERIF_OBTUSE_SANS* = 12 - PAN_SERIF_PERP_SANS* = 13 - PAN_SERIF_FLARED* = 14 - PAN_SERIF_ROUNDED* = 15 - PAN_WEIGHT_VERY_LIGHT* = 2 - PAN_WEIGHT_LIGHT* = 3 - PAN_WEIGHT_THIN* = 4 - PAN_WEIGHT_BOOK* = 5 - PAN_WEIGHT_MEDIUM* = 6 - PAN_WEIGHT_DEMI* = 7 - PAN_WEIGHT_BOLD* = 8 - PAN_WEIGHT_HEAVY* = 9 - PAN_WEIGHT_BLACK* = 10 - PAN_WEIGHT_NORD* = 11 - PAN_PROP_OLD_STYLE* = 2 - PAN_PROP_MODERN* = 3 - PAN_PROP_EVEN_WIDTH* = 4 - PAN_PROP_EXPANDED* = 5 - PAN_PROP_CONDENSED* = 6 - PAN_PROP_VERY_EXPANDED* = 7 - PAN_PROP_VERY_CONDENSED* = 8 - PAN_PROP_MONOSPACED* = 9 - PAN_CONTRAST_NONE* = 2 - PAN_CONTRAST_VERY_LOW* = 3 - PAN_CONTRAST_LOW* = 4 - PAN_CONTRAST_MEDIUM_LOW* = 5 - PAN_CONTRAST_MEDIUM* = 6 - PAN_CONTRAST_MEDIUM_HIGH* = 7 - PAN_CONTRAST_HIGH* = 8 - PAN_CONTRAST_VERY_HIGH* = 9 - PAN_STROKE_GRADUAL_DIAG* = 2 - PAN_STROKE_GRADUAL_TRAN* = 3 - PAN_STROKE_GRADUAL_VERT* = 4 - PAN_STROKE_GRADUAL_HORZ* = 5 - PAN_STROKE_RAPID_VERT* = 6 - PAN_STROKE_RAPID_HORZ* = 7 - PAN_STROKE_INSTANT_VERT* = 8 - PAN_STRAIGHT_ARMS_HORZ* = 2 - PAN_STRAIGHT_ARMS_WEDGE* = 3 - PAN_STRAIGHT_ARMS_VERT* = 4 - PAN_STRAIGHT_ARMS_SINGLE_SERIF* = 5 - PAN_STRAIGHT_ARMS_DOUBLE_SERIF* = 6 - PAN_BENT_ARMS_HORZ* = 7 - PAN_BENT_ARMS_VERT* = 9 - PAN_BENT_ARMS_WEDGE* = 8 - PAN_BENT_ARMS_SINGLE_SERIF* = 10 - PAN_BENT_ARMS_DOUBLE_SERIF* = 11 - PAN_LETT_NORMAL_CONTACT* = 2 - PAN_LETT_NORMAL_WEIGHTED* = 3 - PAN_LETT_NORMAL_BOXED* = 4 - PAN_LETT_NORMAL_FLATTENED* = 5 - PAN_LETT_NORMAL_ROUNDED* = 6 - PAN_LETT_NORMAL_OFF_CENTER* = 7 - PAN_LETT_NORMAL_SQUARE* = 8 - PAN_LETT_OBLIQUE_CONTACT* = 9 - PAN_LETT_OBLIQUE_WEIGHTED* = 10 - PAN_LETT_OBLIQUE_BOXED* = 11 - PAN_LETT_OBLIQUE_FLATTENED* = 12 - PAN_LETT_OBLIQUE_ROUNDED* = 13 - PAN_LETT_OBLIQUE_OFF_CENTER* = 14 - PAN_LETT_OBLIQUE_SQUARE* = 15 - PAN_MIDLINE_STANDARD_TRIMMED* = 2 - PAN_MIDLINE_STANDARD_POINTED* = 3 - PAN_MIDLINE_STANDARD_SERIFED* = 4 - PAN_MIDLINE_HIGH_TRIMMED* = 5 - PAN_MIDLINE_HIGH_POINTED* = 6 - PAN_MIDLINE_HIGH_SERIFED* = 7 - PAN_MIDLINE_CONSTANT_TRIMMED* = 8 - PAN_MIDLINE_CONSTANT_POINTED* = 9 - PAN_MIDLINE_CONSTANT_SERIFED* = 10 - PAN_MIDLINE_LOW_TRIMMED* = 11 - PAN_MIDLINE_LOW_POINTED* = 12 - PAN_MIDLINE_LOW_SERIFED* = 13 - PAN_XHEIGHT_CONSTANT_SMALL* = 2 - PAN_XHEIGHT_CONSTANT_STD* = 3 - PAN_XHEIGHT_CONSTANT_LARGE* = 4 - PAN_XHEIGHT_DUCKING_SMALL* = 5 - PAN_XHEIGHT_DUCKING_STD* = 6 - PAN_XHEIGHT_DUCKING_LARGE* = 7 - # PALETTENTRY structure - PC_EXPLICIT* = 2 - PC_NOCOLLAPSE* = 4 - PC_RESERVED* = 1 - # LOGBRUSH structure - BS_DIBPATTERN* = 5 - BS_DIBPATTERN8X8* = 8 - BS_DIBPATTERNPT* = 6 - BS_HATCHED* = 2 - BS_HOLLOW* = 1 - BS_NULL* = 1 - BS_PATTERN* = 3 - BS_PATTERN8X8* = 7 - BS_SOLID* = 0 - # DEVMODE structure, field selection bits - DM_ORIENTATION* = 0x00000001 - DM_PAPERSIZE* = 0x00000002 - DM_PAPERLENGTH* = 0x00000004 - DM_PAPERWIDTH* = 0x00000008 - DM_SCALE* = 0x00000010 - DM_POSITION* = 0x00000020 - DM_NUP* = 0x00000040 - DM_DISPLAYORIENTATION* = 0x00000080 - DM_COPIES* = 0x00000100 - DM_DEFAULTSOURCE* = 0x00000200 - DM_PRINTQUALITY* = 0x00000400 - DM_COLOR* = 0x00000800 - DM_DUPLEX* = 0x00001000 - DM_YRESOLUTION* = 0x00002000 - DM_TTOPTION* = 0x00004000 - DM_COLLATE* = 0x00008000 - DM_FORMNAME* = 0x00010000 - DM_LOGPIXELS* = 0x00020000 - DM_BITSPERPEL* = 0x00040000 - DM_PELSWIDTH* = 0x00080000 - DM_PELSHEIGHT* = 0x00100000 - DM_DISPLAYFLAGS* = 0x00200000 - DM_DISPLAYFREQUENCY* = 0x00400000 - DM_ICMMETHOD* = 0x00800000 - DM_ICMINTENT* = 0x01000000 - DM_MEDIATYPE* = 0x02000000 - DM_DITHERTYPE* = 0x04000000 - DM_PANNINGWIDTH* = 0x08000000 - DM_PANNINGHEIGHT* = 0x10000000 - DM_DISPLAYFIXEDOUTPUT* = 0x20000000 - # orientation selections - DMORIENT_LANDSCAPE* = 2 - DMORIENT_PORTRAIT* = 1 - # paper selections - DMPAPER_LETTER* = 1 - DMPAPER_LEGAL* = 5 - DMPAPER_A4* = 9 - DMPAPER_CSHEET* = 24 - DMPAPER_DSHEET* = 25 - DMPAPER_ESHEET* = 26 - DMPAPER_LETTERSMALL* = 2 - DMPAPER_TABLOID* = 3 - DMPAPER_LEDGER* = 4 - DMPAPER_STATEMENT* = 6 - DMPAPER_EXECUTIVE* = 7 - DMPAPER_A3* = 8 - DMPAPER_A4SMALL* = 10 - DMPAPER_A5* = 11 - DMPAPER_B4* = 12 - DMPAPER_B5* = 13 - DMPAPER_FOLIO* = 14 - DMPAPER_QUARTO* = 15 - DMPAPER_10X14* = 16 - DMPAPER_11X17* = 17 - DMPAPER_NOTE* = 18 - DMPAPER_ENV_9* = 19 - DMPAPER_ENV_10* = 20 - DMPAPER_ENV_11* = 21 - DMPAPER_ENV_12* = 22 - DMPAPER_ENV_14* = 23 - DMPAPER_ENV_DL* = 27 - DMPAPER_ENV_C5* = 28 - DMPAPER_ENV_C3* = 29 - DMPAPER_ENV_C4* = 30 - DMPAPER_ENV_C6* = 31 - DMPAPER_ENV_C65* = 32 - DMPAPER_ENV_B4* = 33 - DMPAPER_ENV_B5* = 34 - DMPAPER_ENV_B6* = 35 - DMPAPER_ENV_ITALY* = 36 - DMPAPER_ENV_MONARCH* = 37 - DMPAPER_ENV_PERSONAL* = 38 - DMPAPER_FANFOLD_US* = 39 - DMPAPER_FANFOLD_STD_GERMAN* = 40 - DMPAPER_FANFOLD_LGL_GERMAN* = 41 - DMPAPER_ISO_B4* = 42 - DMPAPER_JAPANESE_POSTCARD* = 43 - DMPAPER_9X11* = 44 - DMPAPER_10X11* = 45 - DMPAPER_15X11* = 46 - DMPAPER_ENV_INVITE* = 47 - DMPAPER_RESERVED_48* = 48 - DMPAPER_RESERVED_49* = 49 - DMPAPER_LETTER_EXTRA* = 50 - DMPAPER_LEGAL_EXTRA* = 51 - DMPAPER_TABLOID_EXTRA* = 52 - DMPAPER_A4_EXTRA* = 53 - DMPAPER_LETTER_TRANSVERSE* = 54 - DMPAPER_A4_TRANSVERSE* = 55 - DMPAPER_LETTER_EXTRA_TRANSVERSE* = 56 - DMPAPER_A_PLUS* = 57 - DMPAPER_B_PLUS* = 58 - DMPAPER_LETTER_PLUS* = 59 - DMPAPER_A4_PLUS* = 60 - DMPAPER_A5_TRANSVERSE* = 61 - DMPAPER_B5_TRANSVERSE* = 62 - DMPAPER_A3_EXTRA* = 63 - DMPAPER_A5_EXTRA* = 64 - DMPAPER_B5_EXTRA* = 65 - DMPAPER_A2* = 66 - DMPAPER_A3_TRANSVERSE* = 67 - DMPAPER_A3_EXTRA_TRANSVERSE* = 68 - DMPAPER_DBL_JAPANESE_POSTCARD* = 69 - DMPAPER_A6* = 70 - DMPAPER_JENV_KAKU2* = 71 - DMPAPER_JENV_KAKU3* = 72 - DMPAPER_JENV_CHOU3* = 73 - DMPAPER_JENV_CHOU4* = 74 - DMPAPER_LETTER_ROTATED* = 75 - DMPAPER_A3_ROTATED* = 76 - DMPAPER_A4_ROTATED* = 77 - DMPAPER_A5_ROTATED* = 78 - DMPAPER_B4_JIS_ROTATED* = 79 - DMPAPER_B5_JIS_ROTATED* = 80 - DMPAPER_JAPANESE_POSTCARD_ROTATED* = 81 - DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED* = 82 - DMPAPER_A6_ROTATED* = 83 - DMPAPER_JENV_KAKU2_ROTATED* = 84 - DMPAPER_JENV_KAKU3_ROTATED* = 85 - DMPAPER_JENV_CHOU3_ROTATED* = 86 - DMPAPER_JENV_CHOU4_ROTATED* = 87 - DMPAPER_B6_JIS* = 88 - DMPAPER_B6_JIS_ROTATED* = 89 - DMPAPER_12X11* = 90 - DMPAPER_JENV_YOU4* = 91 - DMPAPER_JENV_YOU4_ROTATED* = 92 - DMPAPER_P16K* = 93 - DMPAPER_P32K* = 94 - DMPAPER_P32KBIG* = 95 - DMPAPER_PENV_1* = 96 - DMPAPER_PENV_2* = 97 - DMPAPER_PENV_3* = 98 - DMPAPER_PENV_4* = 99 - DMPAPER_PENV_5* = 100 - DMPAPER_PENV_6* = 101 - DMPAPER_PENV_7* = 102 - DMPAPER_PENV_8* = 103 - DMPAPER_PENV_9* = 104 - DMPAPER_PENV_10* = 105 - DMPAPER_P16K_ROTATED* = 106 - DMPAPER_P32K_ROTATED* = 107 - DMPAPER_P32KBIG_ROTATED* = 108 - DMPAPER_PENV_1_ROTATED* = 109 - DMPAPER_PENV_2_ROTATED* = 110 - DMPAPER_PENV_3_ROTATED* = 111 - DMPAPER_PENV_4_ROTATED* = 112 - DMPAPER_PENV_5_ROTATED* = 113 - DMPAPER_PENV_6_ROTATED* = 114 - DMPAPER_PENV_7_ROTATED* = 115 - DMPAPER_PENV_8_ROTATED* = 116 - DMPAPER_PENV_9_ROTATED* = 117 - DMPAPER_PENV_10_ROTATED* = 118 - DMPAPER_USER* = 256 - # bin selections - DMBIN_UPPER* = 1 - DMBIN_ONLYONE* = 1 - DMBIN_LOWER* = 2 - DMBIN_MIDDLE* = 3 - DMBIN_MANUAL* = 4 - DMBIN_ENVELOPE* = 5 - DMBIN_ENVMANUAL* = 6 - DMBIN_AUTO* = 7 - DMBIN_TRACTOR* = 8 - DMBIN_SMALLFMT* = 9 - DMBIN_LARGEFMT* = 10 - DMBIN_LARGECAPACITY* = 11 - DMBIN_CASSETTE* = 14 - DMBIN_FORMSOURCE* = 15 - DMBIN_USER* = 256 - # print qualities - DMRES_DRAFT* = -1 - DMRES_LOW* = -2 - DMRES_MEDIUM* = -3 - DMRES_HIGH* = -4 - # color enable/disable for color printers - DMCOLOR_MONOCHROME* = 1 - DMCOLOR_COLOR* = 2 - # duplex enable - DMDUP_SIMPLEX* = 1 - DMDUP_VERTICAL* = 2 - DMDUP_HORIZONTAL* = 3 - # TrueType options - DMTT_BITMAP* = 1 - DMTT_DOWNLOAD* = 2 - DMTT_SUBDEV* = 3 - # Collation selections - DMCOLLATE_TRUE* = 1 - DMCOLLATE_FALSE* = 0 - # DEVMODE dmDisplayOrientation specifiations - DMDO_DEFAULT* = 0 - DMDO_90* = 1 - DMDO_180* = 2 - DMDO_270* = 3 - # DEVMODE dmDisplayFixedOutput specifiations - DMDFO_DEFAULT* = 0 - DMDFO_STRETCH* = 1 - DMDFO_CENTER* = 2 - # Deprecated - #DM_GRAYSCALE* = 1 - #DM_INTERLACED* = 2 - DMDISPLAYFLAGS_TEXTMODE* = 0x00000004 - # dmNup , multiple logical page per physical page options - DMNUP_SYSTEM* = 1 - DMNUP_ONEUP* = 2 - # ICM methods - DMICMMETHOD_NONE* = 1 - DMICMMETHOD_SYSTEM* = 2 - DMICMMETHOD_DRIVER* = 3 - DMICMMETHOD_DEVICE* = 4 - DMICMMETHOD_USER* = 256 - # ICM Intents - DMICM_SATURATE* = 1 - DMICM_CONTRAST* = 2 - DMICM_COLORMETRIC* = 3 - DMICM_USER* = 256 - # Media types - DMMEDIA_STANDARD* = 1 - DMMEDIA_TRANSPARENCY* = 2 - DMMEDIA_GLOSSY* = 3 - DMMEDIA_USER* = 256 - # Dither types - DMDITHER_NONE* = 1 - DMDITHER_COARSE* = 2 - DMDITHER_FINE* = 3 - DMDITHER_LINEART* = 4 - DMDITHER_GRAYSCALE* = 10 - DMDITHER_USER* = 256 - # RGNDATAHEADER structure - RDH_RECTANGLES* = 1 - # TTPOLYGONHEADER structure - TT_POLYGON_TYPE* = 24 - # TTPOLYCURVE structure - TT_PRIM_LINE* = 1 - TT_PRIM_QSPLINE* = 2 - # GCP_RESULTS structure - GCPCLASS_ARABIC* = 2 - GCPCLASS_HEBREW* = 2 - GCPCLASS_LATIN* = 1 - GCPCLASS_LATINNUMBER* = 5 - GCPCLASS_LOCALNUMBER* = 4 - GCPCLASS_LATINNUMERICSEPARATOR* = 7 - GCPCLASS_LATINNUMERICTERMINATOR* = 6 - GCPCLASS_NEUTRAL* = 3 - GCPCLASS_NUMERICSEPARATOR* = 8 - GCPCLASS_PREBOUNDLTR* = 128 - GCPCLASS_PREBOUNDRTL* = 64 - GCPCLASS_POSTBOUNDLTR* = 32 - GCPCLASS_POSTBOUNDRTL* = 16 - GCPGLYPH_LINKBEFORE* = 32768 - GCPGLYPH_LINKAFTER* = 16384 - # RASTERIZER_STATUS structure - TT_AVAILABLE* = 1 - TT_ENABLED* = 2 - # COLORADJUSTMENT structure - CA_NEGATIVE* = 1 - CA_LOG_FILTER* = 2 - ILLUMINANT_DEVICE_DEFAULT* = 0 - ILLUMINANT_A* = 1 - ILLUMINANT_B* = 2 - ILLUMINANT_C* = 3 - ILLUMINANT_D50* = 4 - ILLUMINANT_D55* = 5 - ILLUMINANT_D65* = 6 - ILLUMINANT_D75* = 7 - ILLUMINANT_F2* = 8 - ILLUMINANT_TUNGSTEN* = 1 - ILLUMINANT_DAYLIGHT* = 3 - ILLUMINANT_FLUORESCENT* = 8 - ILLUMINANT_NTSC* = 3 - # DOCINFO structure - DI_APPBANDING* = 1 - # EMRMETAHEADER structure - EMR_HEADER* = 1 - ENHMETA_SIGNATURE* = 1179469088 - # RTF event masks - ENM_CHANGE* = 1 - ENM_CORRECTTEXT* = 4194304 - ENM_DROPFILES* = 1048576 - ENM_KEYEVENTS* = 65536 - ENM_MOUSEEVENTS* = 131072 - ENM_PROTECTED* = 2097152 - ENM_REQUESTRESIZE* = 262144 - ENM_SCROLL* = 4 - ENM_SELCHANGE* = 524288 - ENM_UPDATE* = 2 - ENM_NONE* = 0 - # RTF styles - ES_DISABLENOSCROLL* = 8192 - ES_EX_NOCALLOLEINIT* = 16777216 - ES_NOIME* = 524288 - ES_SAVESEL* = 32768 - ES_SELFIME* = 262144 - ES_SUNKEN* = 16384 - ES_VERTICAL* = 4194304 - ES_SELECTIONBAR* = 16777216 - # EM_SETOPTIONS message - ECOOP_SET* = 1 - ECOOP_OR* = 2 - ECOOP_AND* = 3 - ECOOP_XOR* = 4 - ECO_AUTOWORDSELECTION* = 1 - ECO_AUTOVSCROLL* = 64 - ECO_AUTOHSCROLL* = 128 - ECO_NOHIDESEL* = 256 - ECO_READONLY* = 2048 - ECO_WANTRETURN* = 4096 - ECO_SAVESEL* = 32768 - ECO_SELECTIONBAR* = 16777216 - ECO_VERTICAL* = 4194304 - # EM_SETCHARFORMAT message - SCF_WORD* = 2 - SCF_SELECTION* = 1 - # EM_STREAMOUT message - SF_TEXT* = 1 - SF_RTF* = 2 - SF_RTFNOOBJS* = 3 - SF_TEXTIZED* = 4 - SFF_SELECTION* = 32768 - SFF_PLAINRTF* = 16384 - # EM_FINDWORDBREAK message - WB_CLASSIFY* = 3 - #WB_ISDELIMITER = 2; - # WB_LEFT = 0; already above - WB_LEFTBREAK* = 6 - WB_PREVBREAK* = 6 - WB_MOVEWORDLEFT* = 4 - WB_MOVEWORDPREV* = 4 - WB_MOVEWORDRIGHT* = 5 - WB_MOVEWORDNEXT* = 5 - #WB_RIGHT = 1;already above - WB_RIGHTBREAK* = 7 - WB_NEXTBREAK* = 7 - # EM_GETPUNCTUATION message - PC_LEADING* = 2 - PC_FOLLOWING* = 1 - PC_DELIMITER* = 4 - PC_OVERFLOW* = 3 - # EM_SETWORDWRAPMODE message - WBF_WORDWRAP* = 16 - WBF_WORDBREAK* = 32 - WBF_OVERFLOW* = 64 - WBF_LEVEL1* = 128 - WBF_LEVEL2* = 256 - WBF_CUSTOM* = 512 - WBF_BREAKAFTER* = 64 - WBF_BREAKLINE* = 32 - WBF_ISWHITE* = 16 - # CHARFORMAT structure - CFM_BOLD* = 1 - CFM_COLOR* = 1073741824 - CFM_FACE* = 536870912 - CFM_ITALIC* = 2 - CFM_OFFSET* = 268435456 - CFM_PROTECTED* = 16 - CFM_SIZE* = 0x80000000 - CFM_STRIKEOUT* = 8 - CFM_UNDERLINE* = 4 - CFE_AUTOCOLOR* = 1073741824 - CFE_BOLD* = 1 - CFE_ITALIC* = 2 - CFE_STRIKEOUT* = 8 - CFE_UNDERLINE* = 4 - CFE_PROTECTED* = 16 - # PARAFORMAT structure - PFM_ALIGNMENT* = 8 - PFM_NUMBERING* = 32 - PFM_OFFSET* = 4 - PFM_OFFSETINDENT* = 0x80000000 - PFM_RIGHTINDENT* = 2 - PFM_STARTINDENT* = 1 - PFM_TABSTOPS* = 16 - PFN_BULLET* = 1 - PFA_LEFT* = 1 - PFA_RIGHT* = 2 - PFA_CENTER* = 3 - # SELCHANGE structure - SEL_EMPTY* = 0 - SEL_TEXT* = 1 - SEL_OBJECT* = 2 - SEL_MULTICHAR* = 4 - SEL_MULTIOBJECT* = 8 - # RTF clipboard formats - CF_RTF* = "Rich Text Format" - CF_RETEXTOBJ* = "RichEdit Text and Objects" - # DRAWITEMSTRUCT structure - ODT_BUTTON* = 4 - ODT_COMBOBOX* = 3 - ODT_LISTBOX* = 2 - ODT_LISTVIEW* = 102 - ODT_MENU* = 1 - ODT_STATIC* = 5 - ODT_TAB* = 101 - ODT_HEADER* = 100 - ODA_DRAWENTIRE* = 1 - ODA_FOCUS* = 4 - ODA_SELECT* = 2 - ODS_SELECTED* = 1 - ODS_GRAYED* = 2 - ODS_DISABLED* = 4 - ODS_CHECKED* = 8 - ODS_FOCUS* = 16 - ODS_DEFAULT* = 32 - ODS_HOTLIGHT* = 0x00000040 - ODS_INACTIVE* = 0x00000080 - ODS_NOACCEL* = 0x00000100 - ODS_NOFOCUSRECT* = 0x00000200 - ODS_COMBOBOXEDIT* = 0x00001000 - # Common control styles - CCS_ADJUSTABLE* = 0x00000020 - CCS_BOTTOM* = 0x00000003 - CCS_NODIVIDER* = 0x00000040 - CCS_NOMOVEY* = 0x00000002 - CCS_NOPARENTALIGN* = 0x00000008 - CCS_NORESIZE* = 0x00000004 - CCS_TOP* = 0x00000001 - - # Common control window classes - ANIMATE_CLASSW* = "SysAnimate32" - HOTKEY_CLASSW* = "msctls_hotkey32" - PROGRESS_CLASSW* = "msctls_progress32" - STATUSCLASSNAMEW* = "msctls_statusbar32" - TOOLBARCLASSNAMEW* = "ToolbarWindow32" - TOOLTIPS_CLASSW* = "tooltips_class32" - TRACKBAR_CLASSW* = "msctls_trackbar32" - UPDOWN_CLASSW* = "msctls_updown32" - WC_HEADERW* = "SysHeader32" - WC_LISTVIEWW* = "SysListView32" - WC_TABCONTROLW* = "SysTabControl32" - WC_TREEVIEWW* = "SysTreeView32" - - ANIMATE_CLASSA* = "SysAnimate32" - HOTKEY_CLASSA* = "msctls_hotkey32" - PROGRESS_CLASSA* = "msctls_progress32" - STATUSCLASSNAMEA* = "msctls_statusbar32" - TOOLBARCLASSNAMEA* = "ToolbarWindow32" - TOOLTIPS_CLASSA* = "tooltips_class32" - TRACKBAR_CLASSA* = "msctls_trackbar32" - UPDOWN_CLASSA* = "msctls_updown32" - WC_HEADERA* = "SysHeader32" - WC_LISTVIEWA* = "SysListView32" - WC_TABCONTROLA* = "SysTabControl32" - WC_TREEVIEWA* = "SysTreeView32" - -when defined(winUnicode): - const - ANIMATE_CLASS* = ANIMATE_CLASSW - HOTKEY_CLASS* = HOTKEY_CLASSW - PROGRESS_CLASS* = PROGRESS_CLASSW - STATUSCLASSNAME* = STATUSCLASSNAMEW - TOOLBARCLASSNAME* = TOOLBARCLASSNAMEW - TOOLTIPS_CLASS* = TOOLTIPS_CLASSW - TRACKBAR_CLASS* = TRACKBAR_CLASSW - UPDOWN_CLASS* = UPDOWN_CLASSW - WC_HEADER* = WC_HEADERW - WC_LISTVIEW* = WC_LISTVIEWW - WC_TABCONTROL* = WC_TABCONTROLW - WC_TREEVIEW* = WC_TREEVIEWW -else: - const - ANIMATE_CLASS* = ANIMATE_CLASSA - HOTKEY_CLASS* = HOTKEY_CLASSA - PROGRESS_CLASS* = PROGRESS_CLASSA - STATUSCLASSNAME* = STATUSCLASSNAMEA - TOOLBARCLASSNAME* = TOOLBARCLASSNAMEA - TOOLTIPS_CLASS* = TOOLTIPS_CLASSA - TRACKBAR_CLASS* = TRACKBAR_CLASSA - UPDOWN_CLASS* = UPDOWN_CLASSA - WC_HEADER* = WC_HEADERA - WC_LISTVIEW* = WC_LISTVIEWA - WC_TABCONTROL* = WC_TABCONTROLA - WC_TREEVIEW* = WC_TREEVIEWA -# UNICODE - -const - # Header control styles - HDS_BUTTONS* = 2 - HDS_HIDDEN* = 8 - HDS_HORZ* = 0 - # HD_ITEM structure - HDI_BITMAP* = 16 - HDI_FORMAT* = 4 - HDI_HEIGHT* = 1 - HDI_LPARAM* = 8 - HDI_TEXT* = 2 - HDI_WIDTH* = 1 - HDF_CENTER* = 2 - HDF_LEFT* = 0 - HDF_RIGHT* = 1 - HDF_RTLREADING* = 4 - HDF_BITMAP* = 8192 - HDF_OWNERDRAW* = 32768 - HDF_STRING* = 16384 - HDF_JUSTIFYMASK* = 3 - # HD_HITTESTINFO structure - HHT_NOWHERE* = 1 - HHT_ONDIVIDER* = 4 - HHT_ONDIVOPEN* = 8 - HHT_ONHEADER* = 2 - HHT_TOLEFT* = 2048 - HHT_TORIGHT* = 1024 - # TBADDBITMAP structure - HINST_COMMCTRL* = HINST(-1) - -const - IDB_STD_LARGE_COLOR* = 1 - IDB_STD_SMALL_COLOR* = 0 - IDB_VIEW_LARGE_COLOR* = 5 - IDB_VIEW_SMALL_COLOR* = 4 - STD_COPY* = 1 - STD_CUT* = 0 - STD_DELETE* = 5 - STD_FILENEW* = 6 - STD_FILEOPEN* = 7 - STD_FILESAVE* = 8 - STD_FIND* = 12 - STD_HELP* = 11 - STD_PASTE* = 2 - STD_PRINT* = 14 - STD_PRINTPRE* = 9 - STD_PROPERTIES* = 10 - STD_REDOW* = 4 - STD_REPLACE* = 13 - STD_UNDO* = 3 - VIEW_LARGEICONS* = 0 - VIEW_SMALLICONS* = 1 - VIEW_LIST* = 2 - VIEW_DETAILS* = 3 - VIEW_SORTNAME* = 4 - VIEW_SORTSIZE* = 5 - VIEW_SORTDATE* = 6 - VIEW_SORTTYPE* = 7 - # Toolbar styles - TBSTYLE_ALTDRAG* = 1024 - TBSTYLE_TOOLTIPS* = 256 - TBSTYLE_WRAPABLE* = 512 - TBSTYLE_BUTTON* = 0 - TBSTYLE_CHECK* = 2 - TBSTYLE_CHECKGROUP* = 6 - TBSTYLE_GROUP* = 4 - TBSTYLE_SEP* = 1 - # Toolbar states - TBSTATE_CHECKED* = 1 - TBSTATE_ENABLED* = 4 - TBSTATE_HIDDEN* = 8 - TBSTATE_INDETERMINATE* = 16 - TBSTATE_PRESSED* = 2 - TBSTATE_WRAP* = 32 - # Tooltip styles - TTS_ALWAYSTIP* = 1 - TTS_NOPREFIX* = 2 - # TOOLINFO structure - TTF_IDISHWND* = 1 - TTF_CENTERTIP* = 2 - TTF_RTLREADING* = 4 - TTF_SUBCLASS* = 16 - # TTM_SETDELAYTIME message - TTDT_AUTOMATIC* = 0 - TTDT_AUTOPOP* = 2 - TTDT_INITIAL* = 3 - TTDT_RESHOW* = 1 - # Status window - SBARS_SIZEGRIP* = 256 - #SBARS_SIZEGRIP = 256;already above - # DL_DRAGGING message - DL_MOVECURSOR* = 3 - DL_COPYCURSOR* = 2 - DL_STOPCURSOR* = 1 - # Up-down control styles - UDS_ALIGNLEFT* = 8 - UDS_ALIGNRIGHT* = 4 - UDS_ARROWKEYS* = 32 - UDS_AUTOBUDDY* = 16 - UDS_HORZ* = 64 - UDS_NOTHOUSANDS* = 128 - UDS_SETBUDDYINT* = 2 - UDS_WRAP* = 1 - # UDM_SETRANGE message - UD_MAXVAL* = 32767 - UD_MINVAL* = -32767 - # HKM_GETHOTKEY message - HOTKEYF_ALT* = 4 - HOTKEYF_CONTROL* = 2 - HOTKEYF_EXT* = 8 - HOTKEYF_SHIFT* = 1 - # HKM_SETRULES message - HKCOMB_A* = 8 - HKCOMB_C* = 4 - HKCOMB_CA* = 64 - HKCOMB_NONE* = 1 - HKCOMB_S* = 2 - HKCOMB_SA* = 32 - HKCOMB_SC* = 16 - HKCOMB_SCA* = 128 - # Trackbar styles - TBS_HORZ* = 0 - TBS_VERT* = 2 - TBS_AUTOTICKS* = 1 - TBS_NOTICKS* = 16 - TBS_TOP* = 4 - TBS_BOTTOM* = 0 - TBS_LEFT* = 4 - TBS_RIGHT* = 0 - TBS_BOTH* = 8 - TBS_ENABLESELRANGE* = 32 - TBS_FIXEDLENGTH* = 64 - TBS_NOTHUMB* = 128 - TB_BOTTOM* = 7 - TB_ENDTRACK* = 8 - TB_LINEDOWN* = 1 - TB_LINEUP* = 0 - TB_PAGEDOWN* = 3 - TB_PAGEUP* = 2 - TB_THUMBPOSITION* = 4 - TB_THUMBTRACK* = 5 - TB_TOP* = 6 - # List view styles - LVS_ALIGNLEFT* = 2048 - LVS_ALIGNTOP* = 0 - LVS_AUTOARRANGE* = 256 - LVS_EDITLABELS* = 512 - LVS_ICON* = 0 - LVS_LIST* = 3 - LVS_NOCOLUMNHEADER* = 16384 - LVS_NOLABELWRAP* = 128 - LVS_NOSCROLL* = 8192 - LVS_NOSORTHEADER* = 32768 - LVS_OWNERDRAWFIXED* = 1024 - LVS_REPORT* = 1 - LVS_SHAREIMAGELISTS* = 64 - LVS_SHOWSELALWAYS* = 8 - LVS_SINGLESEL* = 4 - LVS_SMALLICON* = 2 - LVS_SORTASCENDING* = 16 - LVS_SORTDESCENDING* = 32 - LVS_TYPESTYLEMASK* = 64512 - LVSIL_NORMAL* = 0 - LVSIL_SMALL* = 1 - LVSIL_STATE* = 2 - LVIS_CUT* = 4 - LVIS_DROPHILITED* = 8 - LVIS_FOCUSED* = 1 - LVIS_SELECTED* = 2 - LVIS_OVERLAYMASK* = 3840 - LVIS_STATEIMAGEMASK* = 61440 - - LPSTR_TEXTCALLBACKW* = cast[LPWSTR](-1) - LPSTR_TEXTCALLBACKA* = cast[LPSTR](-1) -when defined(winUnicode): - const LPSTR_TEXTCALLBACK* = cast[LPWSTR](-1) -else: - const LPSTR_TEXTCALLBACK* = cast[LPSTR](-1) - -const - LVIF_TEXT* = 1 - LVIF_IMAGE* = 2 - LVIF_PARAM* = 4 - LVIF_STATE* = 8 - LVIF_DI_SETITEM* = 4096 - # LVM_GETNEXTITEM structure - LVNI_ABOVE* = 256 - LVNI_ALL* = 0 - LVNI_BELOW* = 512 - LVNI_TOLEFT* = 1024 - LVNI_TORIGHT* = 2048 - LVNI_CUT* = 4 - LVNI_DROPHILITED* = 8 - LVNI_FOCUSED* = 1 - LVNI_SELECTED* = 2 - # LV_FINDINFO structure - LVFI_PARAM* = 1 - LVFI_PARTIAL* = 8 - LVFI_STRING* = 2 - LVFI_WRAP* = 32 - LVFI_NEARESTXY* = 64 - # LV_HITTESTINFO structure - LVHT_ABOVE* = 8 - LVHT_BELOW* = 16 - LVHT_NOWHERE* = 1 - LVHT_ONITEMICON* = 2 - LVHT_ONITEMLABEL* = 4 - LVHT_ONITEMSTATEICON* = 8 - LVHT_TOLEFT* = 64 - LVHT_TORIGHT* = 32 - # LV_COLUMN structure - LVCF_FMT* = 1 - LVCF_SUBITEM* = 8 - LVCF_TEXT* = 4 - LVCF_WIDTH* = 2 - LVCFMT_CENTER* = 2 - LVCFMT_LEFT* = 0 - LVCFMT_RIGHT* = 1 - # ListView_GetItemRect - LVIR_BOUNDS* = 0 - LVIR_ICON* = 1 - LVIR_LABEL* = 2 - LVIR_SELECTBOUNDS* = 3 - # LVM_ARRANGE message - LVA_ALIGNLEFT* = 1 - LVA_ALIGNTOP* = 2 - LVA_DEFAULT* = 0 - LVA_SNAPTOGRID* = 5 - # LVM_SETCOLUMNWIDTH message - LVSCW_AUTOSIZE* = -1 - LVSCW_AUTOSIZE_USEHEADER* = -2 - # Tree View styles - TVS_DISABLEDRAGDROP* = 16 - TVS_EDITLABELS* = 8 - TVS_HASBUTTONS* = 1 - TVS_HASLINES* = 2 - TVS_LINESATROOT* = 4 - TVS_SHOWSELALWAYS* = 32 - # Tree View states - TVIS_BOLD* = 16 - TVIS_CUT* = 4 - TVIS_DROPHILITED* = 8 - TVIS_EXPANDED* = 32 - TVIS_EXPANDEDONCE* = 64 - TVIS_FOCUSED* = 1 - TVIS_OVERLAYMASK* = 3840 - TVIS_SELECTED* = 2 - TVIS_STATEIMAGEMASK* = 61440 - TVIS_USERMASK* = 61440 - # TV_ITEM structure - TVIF_CHILDREN* = 64 - TVIF_HANDLE* = 16 - TVIF_IMAGE* = 2 - TVIF_PARAM* = 4 - TVIF_SELECTEDIMAGE* = 32 - TVIF_STATE* = 8 - TVIF_TEXT* = 1 - I_CHILDRENCALLBACK* = -1 - I_IMAGECALLBACK* = -1 - # TV_INSERTSTRUCT structure - -type - TTREEITEM* {.final, pure.} = object - HTREEITEM* = ptr TTREEITEM - PTREEITEM* = ptr TTREEITEM - -const - TVI_ROOT* = cast[HTREEITEM](0xFFFF0000) - TVI_FIRST* = cast[HTREEITEM](0xFFFF0001) - TVI_LAST* = cast[HTREEITEM](0xFFFF0002) - TVI_SORT* = cast[HTREEITEM](0xFFFF0003) - -const - # TV_HITTESTINFO structure - TVHT_ABOVE* = 256 - TVHT_BELOW* = 512 - TVHT_NOWHERE* = 1 - TVHT_ONITEM* = 70 - TVHT_ONITEMBUTTON* = 16 - TVHT_ONITEMICON* = 2 - TVHT_ONITEMINDENT* = 8 - TVHT_ONITEMLABEL* = 4 - TVHT_ONITEMRIGHT* = 32 - TVHT_ONITEMSTATEICON* = 64 - TVHT_TOLEFT* = 2048 - TVHT_TORIGHT* = 1024 - # TVM_EXPAND message - TVE_COLLAPSE* = 1 - TVE_COLLAPSERESET* = 32768 - TVE_EXPAND* = 2 - TVE_TOGGLE* = 3 - # TVM_GETIMAGELIST message - TVSIL_NORMAL* = 0 - TVSIL_STATE* = 2 - # TVM_GETNEXTITEM message - TVGN_CARET* = 9 - TVGN_CHILD* = 4 - TVGN_DROPHILITE* = 8 - TVGN_FIRSTVISIBLE* = 5 - TVGN_NEXT* = 1 - TVGN_NEXTVISIBLE* = 6 - TVGN_PARENT* = 3 - TVGN_PREVIOUS* = 2 - TVGN_PREVIOUSVISIBLE* = 7 - TVGN_ROOT* = 0 - # TVN_SELCHANGED message - TVC_BYKEYBOARD* = 2 - TVC_BYMOUSE* = 1 - TVC_UNKNOWN* = 0 - # Tab control styles - TCS_BUTTONS* = 256 - TCS_FIXEDWIDTH* = 1024 - TCS_FOCUSNEVER* = 32768 - TCS_FOCUSONBUTTONDOWN* = 4096 - TCS_FORCEICONLEFT* = 16 - TCS_FORCELABELLEFT* = 32 - TCS_MULTILINE* = 512 - TCS_OWNERDRAWFIXED* = 8192 - TCS_RAGGEDRIGHT* = 2048 - TCS_RIGHTJUSTIFY* = 0 - TCS_SINGLELINE* = 0 - TCS_TABS* = 0 - TCS_TOOLTIPS* = 16384 - # TC_ITEM structure - TCIF_TEXT* = 1 - TCIF_IMAGE* = 2 - TCIF_PARAM* = 8 - TCIF_RTLREADING* = 4 - # TC_HITTESTINFO structure - TCHT_NOWHERE* = 1 - TCHT_ONITEM* = 6 - TCHT_ONITEMICON* = 2 - TCHT_ONITEMLABEL* = 4 - # Animation control styles - ACS_AUTOPLAY* = 4 - ACS_CENTER* = 1 - ACS_TRANSPARENT* = 2 - # MODEMDEVCAPS structure - DIALOPTION_BILLING* = 64 - DIALOPTION_QUIET* = 128 - DIALOPTION_DIALTONE* = 256 - MDMVOLFLAG_LOW* = 1 - MDMVOLFLAG_MEDIUM* = 2 - MDMVOLFLAG_HIGH* = 4 - MDMVOL_LOW* = 0 - MDMVOL_MEDIUM* = 1 - MDMVOL_HIGH* = 2 - MDMSPKRFLAG_OFF* = 1 - MDMSPKRFLAG_DIAL* = 2 - MDMSPKRFLAG_ON* = 4 - MDMSPKRFLAG_CALLSETUP* = 8 - MDMSPKR_OFF* = 0 - MDMSPKR_DIAL* = 1 - MDMSPKR_ON* = 2 - MDMSPKR_CALLSETUP* = 3 - MDM_BLIND_DIAL* = 512 - MDM_CCITT_OVERRIDE* = 64 - MDM_CELLULAR* = 8 - MDM_COMPRESSION* = 1 - MDM_ERROR_CONTROL* = 2 - MDM_FLOWCONTROL_HARD* = 16 - MDM_FLOWCONTROL_SOFT* = 32 - MDM_FORCED_EC* = 4 - MDM_SPEED_ADJUST* = 128 - MDM_TONE_DIAL* = 256 - MDM_V23_OVERRIDE* = 1024 - - # Languages - # - # Language IDs. - # - # The following two combinations of primary language ID and - # sublanguage ID have special semantics: - # - # Primary Language ID Sublanguage ID Result - # ------------------- --------------- ------------------------ - # LANG_NEUTRAL SUBLANG_NEUTRAL Language neutral - # LANG_NEUTRAL SUBLANG_DEFAULT User default language - # LANG_NEUTRAL SUBLANG_SYS_DEFAULT System default language - # LANG_INVARIANT SUBLANG_NEUTRAL Invariant locale - # - # - # Primary language IDs. - # - LANG_NEUTRAL* = 0x00000000 - LANG_INVARIANT* = 0x0000007F - LANG_AFRIKAANS* = 0x00000036 - LANG_ALBANIAN* = 0x0000001C - LANG_ARABIC* = 0x00000001 - LANG_ARMENIAN* = 0x0000002B - LANG_ASSAMESE* = 0x0000004D - LANG_AZERI* = 0x0000002C - LANG_BASQUE* = 0x0000002D - LANG_BELARUSIAN* = 0x00000023 - LANG_BENGALI* = 0x00000045 - LANG_BULGARIAN* = 0x00000002 - LANG_CATALAN* = 0x00000003 - LANG_CHINESE* = 0x00000004 - LANG_CROATIAN* = 0x0000001A - LANG_CZECH* = 0x00000005 - LANG_DANISH* = 0x00000006 - LANG_DIVEHI* = 0x00000065 - LANG_DUTCH* = 0x00000013 - LANG_ENGLISH* = 0x00000009 - LANG_ESTONIAN* = 0x00000025 - LANG_FAEROESE* = 0x00000038 - LANG_FARSI* = 0x00000029 - LANG_FINNISH* = 0x0000000B - LANG_FRENCH* = 0x0000000C - LANG_GALICIAN* = 0x00000056 - LANG_GEORGIAN* = 0x00000037 - LANG_GERMAN* = 0x00000007 - LANG_GREEK* = 0x00000008 - LANG_GUJARATI* = 0x00000047 - LANG_HEBREW* = 0x0000000D - LANG_HINDI* = 0x00000039 - LANG_HUNGARIAN* = 0x0000000E - LANG_ICELANDIC* = 0x0000000F - LANG_INDONESIAN* = 0x00000021 - LANG_ITALIAN* = 0x00000010 - LANG_JAPANESE* = 0x00000011 - LANG_KANNADA* = 0x0000004B - LANG_KASHMIRI* = 0x00000060 - LANG_KAZAK* = 0x0000003F - LANG_KONKANI* = 0x00000057 - LANG_KOREAN* = 0x00000012 - LANG_KYRGYZ* = 0x00000040 - LANG_LATVIAN* = 0x00000026 - LANG_LITHUANIAN* = 0x00000027 - LANG_MACEDONIAN* = 0x0000002F # the Former Yugoslav Republic of Macedonia - LANG_MALAY* = 0x0000003E - LANG_MALAYALAM* = 0x0000004C - LANG_MANIPURI* = 0x00000058 - LANG_MARATHI* = 0x0000004E - LANG_MONGOLIAN* = 0x00000050 - LANG_NEPALI* = 0x00000061 - LANG_NORWEGIAN* = 0x00000014 - LANG_ORIYA* = 0x00000048 - LANG_POLISH* = 0x00000015 - LANG_PORTUGUESE* = 0x00000016 - LANG_PUNJABI* = 0x00000046 - LANG_ROMANIAN* = 0x00000018 - LANG_RUSSIAN* = 0x00000019 - LANG_SANSKRIT* = 0x0000004F - LANG_SERBIAN* = 0x0000001A - LANG_SINDHI* = 0x00000059 - LANG_SLOVAK* = 0x0000001B - LANG_SLOVENIAN* = 0x00000024 - LANG_SPANISH* = 0x0000000A - LANG_SWAHILI* = 0x00000041 - LANG_SWEDISH* = 0x0000001D - LANG_SYRIAC* = 0x0000005A - LANG_TAMIL* = 0x00000049 - LANG_TATAR* = 0x00000044 - LANG_TELUGU* = 0x0000004A - LANG_THAI* = 0x0000001E - LANG_TURKISH* = 0x0000001F - LANG_UKRAINIAN* = 0x00000022 - LANG_URDU* = 0x00000020 - LANG_UZBEK* = 0x00000043 - LANG_VIETNAMESE* = 0x0000002A - # - # Sublanguage IDs. - # - # The name immediately following SUBLANG_ dictates which primary - # language ID that sublanguage ID can be combined with to form a - # valid language ID. - # - SUBLANG_NEUTRAL* = 0x00000000 # language neutral - SUBLANG_DEFAULT* = 0x00000001 # user default - SUBLANG_SYS_DEFAULT* = 0x00000002 # system default - SUBLANG_ARABIC_SAUDI_ARABIA* = 0x00000001 # Arabic (Saudi Arabia) - SUBLANG_ARABIC_IRAQ* = 0x00000002 # Arabic (Iraq) - SUBLANG_ARABIC_EGYPT* = 0x00000003 # Arabic (Egypt) - SUBLANG_ARABIC_LIBYA* = 0x00000004 # Arabic (Libya) - SUBLANG_ARABIC_ALGERIA* = 0x00000005 # Arabic (Algeria) - SUBLANG_ARABIC_MOROCCO* = 0x00000006 # Arabic (Morocco) - SUBLANG_ARABIC_TUNISIA* = 0x00000007 # Arabic (Tunisia) - SUBLANG_ARABIC_OMAN* = 0x00000008 # Arabic (Oman) - SUBLANG_ARABIC_YEMEN* = 0x00000009 # Arabic (Yemen) - SUBLANG_ARABIC_SYRIA* = 0x0000000A # Arabic (Syria) - SUBLANG_ARABIC_JORDAN* = 0x0000000B # Arabic (Jordan) - SUBLANG_ARABIC_LEBANON* = 0x0000000C # Arabic (Lebanon) - SUBLANG_ARABIC_KUWAIT* = 0x0000000D # Arabic (Kuwait) - SUBLANG_ARABIC_UAE* = 0x0000000E # Arabic (U.A.E) - SUBLANG_ARABIC_BAHRAIN* = 0x0000000F # Arabic (Bahrain) - SUBLANG_ARABIC_QATAR* = 0x00000010 # Arabic (Qatar) - SUBLANG_AZERI_LATIN* = 0x00000001 # Azeri (Latin) - SUBLANG_AZERI_CYRILLIC* = 0x00000002 # Azeri (Cyrillic) - SUBLANG_CHINESE_TRADITIONAL* = 0x00000001 # Chinese (Taiwan) - SUBLANG_CHINESE_SIMPLIFIED* = 0x00000002 # Chinese (PR China) - SUBLANG_CHINESE_HONGKONG* = 0x00000003 # Chinese (Hong Kong S.A.R., P.R.C.) - SUBLANG_CHINESE_SINGAPORE* = 0x00000004 # Chinese (Singapore) - SUBLANG_CHINESE_MACAU* = 0x00000005 # Chinese (Macau S.A.R.) - SUBLANG_DUTCH* = 0x00000001 # Dutch - SUBLANG_DUTCH_BELGIAN* = 0x00000002 # Dutch (Belgian) - SUBLANG_ENGLISH_US* = 0x00000001 # English (USA) - SUBLANG_ENGLISH_UK* = 0x00000002 # English (UK) - SUBLANG_ENGLISH_AUS* = 0x00000003 # English (Australian) - SUBLANG_ENGLISH_CAN* = 0x00000004 # English (Canadian) - SUBLANG_ENGLISH_NZ* = 0x00000005 # English (New Zealand) - SUBLANG_ENGLISH_EIRE* = 0x00000006 # English (Irish) - SUBLANG_ENGLISH_SOUTH_AFRICA* = 0x00000007 # English (South Africa) - SUBLANG_ENGLISH_JAMAICA* = 0x00000008 # English (Jamaica) - SUBLANG_ENGLISH_CARIBBEAN* = 0x00000009 # English (Caribbean) - SUBLANG_ENGLISH_BELIZE* = 0x0000000A # English (Belize) - SUBLANG_ENGLISH_TRINIDAD* = 0x0000000B # English (Trinidad) - SUBLANG_ENGLISH_ZIMBABWE* = 0x0000000C # English (Zimbabwe) - SUBLANG_ENGLISH_PHILIPPINES* = 0x0000000D # English (Philippines) - SUBLANG_FRENCH* = 0x00000001 # French - SUBLANG_FRENCH_BELGIAN* = 0x00000002 # French (Belgian) - SUBLANG_FRENCH_CANADIAN* = 0x00000003 # French (Canadian) - SUBLANG_FRENCH_SWISS* = 0x00000004 # French (Swiss) - SUBLANG_FRENCH_LUXEMBOURG* = 0x00000005 # French (Luxembourg) - SUBLANG_FRENCH_MONACO* = 0x00000006 # French (Monaco) - SUBLANG_GERMAN* = 0x00000001 # German - SUBLANG_GERMAN_SWISS* = 0x00000002 # German (Swiss) - SUBLANG_GERMAN_AUSTRIAN* = 0x00000003 # German (Austrian) - SUBLANG_GERMAN_LUXEMBOURG* = 0x00000004 # German (Luxembourg) - SUBLANG_GERMAN_LIECHTENSTEIN* = 0x00000005 # German (Liechtenstein) - SUBLANG_ITALIAN* = 0x00000001 # Italian - SUBLANG_ITALIAN_SWISS* = 0x00000002 # Italian (Swiss) - SUBLANG_KASHMIRI_SASIA* = 0x00000002 # Kashmiri (South Asia) - SUBLANG_KASHMIRI_INDIA* = 0x00000002 # For app compatibility only - SUBLANG_KOREAN* = 0x00000001 # Korean (Extended Wansung) - SUBLANG_LITHUANIAN* = 0x00000001 # Lithuanian - SUBLANG_MALAY_MALAYSIA* = 0x00000001 # Malay (Malaysia) - SUBLANG_MALAY_BRUNEI_DARUSSALAM* = 0x00000002 # Malay (Brunei Darussalam) - SUBLANG_NEPALI_INDIA* = 0x00000002 # Nepali (India) - SUBLANG_NORWEGIAN_BOKMAL* = 0x00000001 # Norwegian (Bokmal) - SUBLANG_NORWEGIAN_NYNORSK* = 0x00000002 # Norwegian (Nynorsk) - SUBLANG_PORTUGUESE* = 0x00000002 # Portuguese - SUBLANG_PORTUGUESE_BRAZILIAN* = 0x00000001 # Portuguese (Brazilian) - SUBLANG_SERBIAN_LATIN* = 0x00000002 # Serbian (Latin) - SUBLANG_SERBIAN_CYRILLIC* = 0x00000003 # Serbian (Cyrillic) - SUBLANG_SPANISH* = 0x00000001 # Spanish (Castilian) - SUBLANG_SPANISH_MEXICAN* = 0x00000002 # Spanish (Mexican) - SUBLANG_SPANISH_MODERN* = 0x00000003 # Spanish (Spain) - SUBLANG_SPANISH_GUATEMALA* = 0x00000004 # Spanish (Guatemala) - SUBLANG_SPANISH_COSTA_RICA* = 0x00000005 # Spanish (Costa Rica) - SUBLANG_SPANISH_PANAMA* = 0x00000006 # Spanish (Panama) - SUBLANG_SPANISH_DOMINICAN_REPUBLIC* = 0x00000007 # Spanish (Dominican Republic) - SUBLANG_SPANISH_VENEZUELA* = 0x00000008 # Spanish (Venezuela) - SUBLANG_SPANISH_COLOMBIA* = 0x00000009 # Spanish (Colombia) - SUBLANG_SPANISH_PERU* = 0x0000000A # Spanish (Peru) - SUBLANG_SPANISH_ARGENTINA* = 0x0000000B # Spanish (Argentina) - SUBLANG_SPANISH_ECUADOR* = 0x0000000C # Spanish (Ecuador) - SUBLANG_SPANISH_CHILE* = 0x0000000D # Spanish (Chile) - SUBLANG_SPANISH_URUGUAY* = 0x0000000E # Spanish (Uruguay) - SUBLANG_SPANISH_PARAGUAY* = 0x0000000F # Spanish (Paraguay) - SUBLANG_SPANISH_BOLIVIA* = 0x00000010 # Spanish (Bolivia) - SUBLANG_SPANISH_EL_SALVADOR* = 0x00000011 # Spanish (El Salvador) - SUBLANG_SPANISH_HONDURAS* = 0x00000012 # Spanish (Honduras) - SUBLANG_SPANISH_NICARAGUA* = 0x00000013 # Spanish (Nicaragua) - SUBLANG_SPANISH_PUERTO_RICO* = 0x00000014 # Spanish (Puerto Rico) - SUBLANG_SWEDISH* = 0x00000001 # Swedish - SUBLANG_SWEDISH_FINLAND* = 0x00000002 # Swedish (Finland) - SUBLANG_URDU_PAKISTAN* = 0x00000001 # Urdu (Pakistan) - SUBLANG_URDU_INDIA* = 0x00000002 # Urdu (India) - SUBLANG_UZBEK_LATIN* = 0x00000001 # Uzbek (Latin) - SUBLANG_UZBEK_CYRILLIC* = 0x00000002 # Uzbek (Cyrillic) - # - # Sorting IDs. - # - SORT_DEFAULT* = 0x00000000 # sorting default - SORT_JAPANESE_XJIS* = 0x00000000 # Japanese XJIS order - SORT_JAPANESE_UNICODE* = 0x00000001 # Japanese Unicode order - SORT_CHINESE_BIG5* = 0x00000000 # Chinese BIG5 order - SORT_CHINESE_PRCP* = 0x00000000 # PRC Chinese Phonetic order - SORT_CHINESE_UNICODE* = 0x00000001 # Chinese Unicode order - SORT_CHINESE_PRC* = 0x00000002 # PRC Chinese Stroke Count order - SORT_CHINESE_BOPOMOFO* = 0x00000003 # Traditional Chinese Bopomofo order - SORT_KOREAN_KSC* = 0x00000000 # Korean KSC order - SORT_KOREAN_UNICODE* = 0x00000001 # Korean Unicode order - SORT_GERMAN_PHONE_BOOK* = 0x00000001 # German Phone Book order - SORT_HUNGARIAN_DEFAULT* = 0x00000000 # Hungarian Default order - SORT_HUNGARIAN_TECHNICAL* = 0x00000001 # Hungarian Technical order - SORT_GEORGIAN_TRADITIONAL* = 0x00000000 # Georgian Traditional order - SORT_GEORGIAN_MODERN* = 0x00000001 # Georgian Modern order - # SYSTEM_INFO structure - PROCESSOR_INTEL_386* = 386 - PROCESSOR_INTEL_486* = 486 - PROCESSOR_INTEL_PENTIUM* = 586 - PROCESSOR_MIPS_R4000* = 4000 - PROCESSOR_ALPHA_21064* = 21064 - # FSCTL_SET_COMPRESSION - COMPRESSION_FORMAT_NONE* = 0 - COMPRESSION_FORMAT_DEFAULT* = 1 - COMPRESSION_FORMAT_LZNT1* = 2 - # TAPE_GET_DRIVE_PARAMETERS structure - TAPE_DRIVE_COMPRESSION* = 131072 - TAPE_DRIVE_ECC* = 65536 - TAPE_DRIVE_ERASE_BOP_ONLY* = 64 - TAPE_DRIVE_ERASE_LONG* = 32 - TAPE_DRIVE_ERASE_IMMEDIATE* = 128 - TAPE_DRIVE_ERASE_SHORT* = 16 - TAPE_DRIVE_FIXED* = 1 - TAPE_DRIVE_FIXED_BLOCK* = 1024 - TAPE_DRIVE_INITIATOR* = 4 - TAPE_DRIVE_PADDING* = 262144 - TAPE_DRIVE_GET_ABSOLUTE_BLK* = 1048576 - TAPE_DRIVE_GET_LOGICAL_BLK* = 2097152 - TAPE_DRIVE_REPORT_SMKS* = 524288 - TAPE_DRIVE_SELECT* = 2 - TAPE_DRIVE_SET_EOT_WZ_SIZE* = 4194304 - TAPE_DRIVE_TAPE_CAPACITY* = 256 - TAPE_DRIVE_TAPE_REMAINING* = 512 - TAPE_DRIVE_VARIABLE_BLOCK* = 2048 - TAPE_DRIVE_WRITE_PROTECT* = 4096 - TAPE_DRIVE_ABS_BLK_IMMED* = -2147475456 - TAPE_DRIVE_ABSOLUTE_BLK* = -2147479552 - TAPE_DRIVE_END_OF_DATA* = -2147418112 - TAPE_DRIVE_FILEMARKS* = -2147221504 - TAPE_DRIVE_LOAD_UNLOAD* = -2147483647 - TAPE_DRIVE_LOAD_UNLD_IMMED* = -2147483616 - TAPE_DRIVE_LOCK_UNLOCK* = -2147483644 - TAPE_DRIVE_LOCK_UNLK_IMMED* = -2147483520 - TAPE_DRIVE_LOG_BLK_IMMED* = -2147450880 - TAPE_DRIVE_LOGICAL_BLK* = -2147467264 - TAPE_DRIVE_RELATIVE_BLKS* = -2147352576 - TAPE_DRIVE_REVERSE_POSITION* = -2143289344 - TAPE_DRIVE_REWIND_IMMEDIATE* = -2147483640 - TAPE_DRIVE_SEQUENTIAL_FMKS* = -2146959360 - TAPE_DRIVE_SEQUENTIAL_SMKS* = -2145386496 - TAPE_DRIVE_SET_BLOCK_SIZE* = -2147483632 - TAPE_DRIVE_SET_COMPRESSION* = -2147483136 - TAPE_DRIVE_SET_ECC* = -2147483392 - TAPE_DRIVE_SET_PADDING* = -2147482624 - TAPE_DRIVE_SET_REPORT_SMKS* = -2147481600 - TAPE_DRIVE_SETMARKS* = -2146435072 - TAPE_DRIVE_SPACE_IMMEDIATE* = -2139095040 - TAPE_DRIVE_TENSION* = -2147483646 - TAPE_DRIVE_TENSION_IMMED* = -2147483584 - TAPE_DRIVE_WRITE_FILEMARKS* = -2113929216 - TAPE_DRIVE_WRITE_LONG_FMKS* = -2013265920 - TAPE_DRIVE_WRITE_MARK_IMMED* = -1879048192 - TAPE_DRIVE_WRITE_SETMARKS* = -2130706432 - TAPE_DRIVE_WRITE_SHORT_FMKS* = -2080374784 - # Standard rights - STANDARD_RIGHTS_REQUIRED* = 0x000F0000 - STANDARD_RIGHTS_WRITE* = 0x00020000 - STANDARD_RIGHTS_READ* = 0x00020000 - STANDARD_RIGHTS_EXECUTE* = 0x00020000 - STANDARD_RIGHTS_ALL* = 0x001F0000 - SPECIFIC_RIGHTS_ALL* = 0x0000FFFF - - FILE_GENERIC_READ* = STANDARD_RIGHTS_READ or - FILE_READ_DATA or - FILE_READ_ATTRIBUTES or - FILE_READ_EA or - SYNCHRONIZE - FILE_GENERIC_WRITE* = STANDARD_RIGHTS_WRITE or - FILE_WRITE_DATA or - FILE_WRITE_ATTRIBUTES or - FILE_WRITE_EA or - FILE_APPEND_DATA or - SYNCHRONIZE - FILE_GENERIC_EXECUTE* = STANDARD_RIGHTS_EXECUTE or - FILE_READ_ATTRIBUTES or - FILE_EXECUTE or - SYNCHRONIZE - FILE_ALL_ACCESS* = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or 0x1FF - - # ACCESS_MASK - MAXIMUM_ALLOWED* = 0x02000000 - GENERIC_ALL* = 0x10000000 - # SID - SECURITY_NULL_RID* = 0 - SECURITY_WORLD_RID* = 0 - SECURITY_LOCAL_RID* = 0 - SECURITY_CREATOR_OWNER_RID* = 0 - SECURITY_CREATOR_GROUP_RID* = 0x00000001 - SECURITY_DIALUP_RID* = 0x00000001 - SECURITY_NETWORK_RID* = 0x00000002 - SECURITY_BATCH_RID* = 0x00000003 - SECURITY_INTERACTIVE_RID* = 0x00000004 - SECURITY_LOGON_IDS_RID* = 0x00000005 - SECURITY_LOGON_IDS_RID_COUNT* = 0x00000003 - SECURITY_SERVICE_RID* = 0x00000006 - SECURITY_LOCAL_SYSTEM_RID* = 0x00000012 - SECURITY_BUILTIN_DOMAIN_RID* = 0x00000020 - DOMAIN_USER_RID_ADMIN* = 0x000001F4 - DOMAIN_USER_RID_GUEST* = 0x000001F5 - DOMAIN_GROUP_RID_ADMINS* = 0x00000200 - DOMAIN_GROUP_RID_USERS* = 0x00000201 - DOMAIN_ALIAS_RID_ADMINS* = 0x00000220 - DOMAIN_ALIAS_RID_USERS* = 0x00000221 - DOMAIN_ALIAS_RID_GUESTS* = 0x00000222 - DOMAIN_ALIAS_RID_POWER_USERS* = 0x00000223 - DOMAIN_ALIAS_RID_ACCOUNT_OPS* = 0x00000224 - DOMAIN_ALIAS_RID_SYSTEM_OPS* = 0x00000225 - DOMAIN_ALIAS_RID_PRINT_OPS* = 0x00000226 - DOMAIN_ALIAS_RID_BACKUP_OPS* = 0x00000227 - DOMAIN_ALIAS_RID_REPLICATOR* = 0x00000228 - # TOKEN_GROUPS structure - SE_GROUP_MANDATORY* = 0x00000001 - SE_GROUP_ENABLED_BY_DEFAULT* = 0x00000002 - SE_GROUP_ENABLED* = 0x00000004 - SE_GROUP_OWNER* = 0x00000008 - SE_GROUP_LOGON_ID* = 0xC0000000 - # ACL Defines - ACL_REVISION* = 2 - # ACE_HEADER structure - ACCESS_ALLOWED_ACE_TYPE* = 0x00000000 - ACCESS_DENIED_ACE_TYPE* = 0x00000001 - SYSTEM_AUDIT_ACE_TYPE* = 0x00000002 - SYSTEM_ALARM_ACE_TYPE* = 0x00000003 - # ACE flags in the ACE_HEADER structure - OBJECT_INHERIT_ACE* = 0x00000001 - CONTAINER_INHERIT_ACE* = 0x00000002 - NO_PROPAGATE_INHERIT_ACE* = 0x00000004 - INHERIT_ONLY_ACE* = 0x00000008 - SUCCESSFUL_ACCESS_ACE_FLAG* = 0x00000040 - FAILED_ACCESS_ACE_FLAG* = 0x00000080 - # SECURITY_DESCRIPTOR_CONTROL - #SECURITY_DESCRIPTOR_REVISION = 1;already defined above - SECURITY_DESCRIPTOR_MIN_LENGTH* = 20 - SE_OWNER_DEFAULTED* = 1 - SE_GROUP_DEFAULTED* = 2 - SE_DACL_PRESENT* = 4 - SE_DACL_DEFAULTED* = 8 - SE_SACL_PRESENT* = 16 - SE_SACL_DEFAULTED* = 32 - SE_SELF_RELATIVE* = 32768 - # PRIVILEGE_SET - SE_PRIVILEGE_ENABLED_BY_DEFAULT* = 0x00000001 - SE_PRIVILEGE_ENABLED* = 0x00000002 - SE_PRIVILEGE_USED_FOR_ACCESS* = 0x80000000 - PRIVILEGE_SET_ALL_NECESSARY* = 0x00000001 - # OPENFILENAME structure - OFN_ALLOWMULTISELECT* = 0x00000200 - OFN_CREATEPROMPT* = 0x00002000 - OFN_ENABLEHOOK* = 0x00000020 - OFN_ENABLETEMPLATE* = 0x00000040 - OFN_ENABLETEMPLATEHANDLE* = 0x00000080 - OFN_EXPLORER* = 0x00080000 - OFN_EXTENSIONDIFFERENT* = 0x00000400 - OFN_FILEMUSTEXIST* = 0x00001000 - OFN_HIDEREADONLY* = 0x00000004 - OFN_LONGNAMES* = 0x00200000 - OFN_NOCHANGEDIR* = 0x00000008 - OFN_NODEREFERENCELINKS* = 0x00100000 - OFN_NOLONGNAMES* = 0x00040000 - OFN_NONETWORKBUTTON* = 0x00020000 - OFN_NOREADONLYRETURN* = 0x00008000 - OFN_NOTESTFILECREATE* = 0x00010000 - OFN_NOVALIDATE* = 0x00000100 - OFN_OVERWRITEPROMPT* = 0x00000002 - OFN_PATHMUSTEXIST* = 0x00000800 - OFN_READONLY* = 0x00000001 - OFN_SHAREAWARE* = 0x00004000 - OFN_SHOWHELP* = 0x00000010 - # SHAREVISTRING message - OFN_SHAREFALLTHROUGH* = 0x00000002 - OFN_SHARENOWARN* = 0x00000001 - OFN_SHAREWARN* = 0 - # Open/Save notifications - CDN_INITDONE* = 0xFFFFFDA7 - CDN_SELCHANGE* = 0xFFFFFDA6 - CDN_FOLDERCHANGE* = 0xFFFFFDA5 - CDN_SHAREVIOLATION* = 0xFFFFFDA4 - CDN_HELP* = 0xFFFFFDA3 - CDN_FILEOK* = 0xFFFFFDA2 - CDN_TYPECHANGE* = 0xFFFFFDA1 - # Open/Save messages - CDM_GETFILEPATH* = 0x00000465 - CDM_GETFOLDERIDLIST* = 0x00000467 - CDM_GETFOLDERPATH* = 0x00000466 - CDM_GETSPEC* = 0x00000464 - CDM_HIDECONTROL* = 0x00000469 - CDM_SETCONTROLTEXT* = 0x00000468 - CDM_SETDEFEXT* = 0x0000046A - # CHOOSECOLOR structure - CC_ENABLEHOOK* = 0x00000010 - CC_ENABLETEMPLATE* = 0x00000020 - CC_ENABLETEMPLATEHANDLE* = 0x00000040 - CC_FULLOPEN* = 0x00000002 - CC_PREVENTFULLOPEN* = 0x00000004 - CC_RGBINIT* = 0x00000001 - CC_SHOWHELP* = 0x00000008 - CC_SOLIDCOLOR* = 0x00000080 - # FINDREPLACE structure - FR_DIALOGTERM* = 0x00000040 - FR_DOWN* = 0x00000001 - FR_ENABLEHOOK* = 0x00000100 - FR_ENABLETEMPLATE* = 0x00000200 - FR_ENABLETEMPLATEHANDLE* = 0x00002000 - FR_FINDNEXT* = 0x00000008 - FR_HIDEUPDOWN* = 0x00004000 - FR_HIDEMATCHCASE* = 0x00008000 - FR_HIDEWHOLEWORD* = 0x00010000 - FR_MATCHCASE* = 0x00000004 - FR_NOMATCHCASE* = 0x00000800 - FR_NOUPDOWN* = 0x00000400 - FR_NOWHOLEWORD* = 0x00001000 - FR_REPLACE* = 0x00000010 - FR_REPLACEALL* = 0x00000020 - FR_SHOWHELP* = 0x00000080 - FR_WHOLEWORD* = 0x00000002 - # CHOOSEFONT structure - CF_APPLY* = 0x00000200 - CF_ANSIONLY* = 0x00000400 - CF_BOTH* = 0x00000003 - CF_TTONLY* = 0x00040000 - CF_EFFECTS* = 0x00000100 - CF_ENABLEHOOK* = 0x00000008 - CF_ENABLETEMPLATE* = 0x00000010 - CF_ENABLETEMPLATEHANDLE* = 0x00000020 - CF_FIXEDPITCHONLY* = 0x00004000 - CF_FORCEFONTEXIST* = 0x00010000 - CF_INITTOLOGFONTSTRUCT* = 0x00000040 - CF_LIMITSIZE* = 0x00002000 - CF_NOOEMFONTS* = 0x00000800 - CF_NOFACESEL* = 0x00080000 - CF_NOSCRIPTSEL* = 0x00800000 - CF_NOSTYLESEL* = 0x00100000 - CF_NOSIZESEL* = 0x00200000 - CF_NOSIMULATIONS* = 0x00001000 - CF_NOVECTORFONTS* = 0x00000800 - CF_NOVERTFONTS* = 0x01000000 - CF_PRINTERFONTS* = 0x00000002 - CF_SCALABLEONLY* = 0x00020000 - CF_SCREENFONTS* = 0x00000001 - CF_SCRIPTSONLY* = 0x00000400 - CF_SELECTSCRIPT* = 0x00400000 - CF_SHOWHELP* = 0x00000004 - CF_USESTYLE* = 0x00000080 - CF_WYSIWYG* = 0x00008000 - BOLD_FONTTYPE* = 0x00000100 - ITALIC_FONTTYPE* = 0x00000200 - PRINTER_FONTTYPE* = 0x00004000 - REGULAR_FONTTYPE* = 0x00000400 - SCREEN_FONTTYPE* = 0x00002000 - SIMULATED_FONTTYPE* = 0x00008000 - # Common dialog messages - COLOROKSTRINGW* = "commdlg_ColorOK" - FILEOKSTRINGW* = "commdlg_FileNameOK" - FINDMSGSTRINGW* = "commdlg_FindReplace" - HELPMSGSTRINGW* = "commdlg_help" - LBSELCHSTRINGW* = "commdlg_LBSelChangedNotify" - SETRGBSTRINGW* = "commdlg_SetRGBColor" - SHAREVISTRINGW* = "commdlg_ShareViolation" - COLOROKSTRINGA* = "commdlg_ColorOK" - FILEOKSTRINGA* = "commdlg_FileNameOK" - FINDMSGSTRINGA* = "commdlg_FindReplace" - HELPMSGSTRINGA* = "commdlg_help" - LBSELCHSTRINGA* = "commdlg_LBSelChangedNotify" - SETRGBSTRINGA* = "commdlg_SetRGBColor" - SHAREVISTRINGA* = "commdlg_ShareViolation" - -when defined(winUnicode): - const - COLOROKSTRING* = COLOROKSTRINGW - FILEOKSTRING* = FILEOKSTRINGW - FINDMSGSTRING* = FINDMSGSTRINGW - HELPMSGSTRING* = HELPMSGSTRINGW - LBSELCHSTRING* = LBSELCHSTRINGW - SETRGBSTRING* = SETRGBSTRINGW - SHAREVISTRING* = SHAREVISTRINGW -else: - const - COLOROKSTRING* = COLOROKSTRINGA - FILEOKSTRING* = FILEOKSTRINGA - FINDMSGSTRING* = FINDMSGSTRINGA - HELPMSGSTRING* = HELPMSGSTRINGA - LBSELCHSTRING* = LBSELCHSTRINGA - SETRGBSTRING* = SETRGBSTRINGA - SHAREVISTRING* = SHAREVISTRINGA - -const - # LBSELCHSTRING message - CD_LBSELCHANGE* = 0 - CD_LBSELADD* = 2 - CD_LBSELSUB* = 1 - CD_LBSELNOITEMS* = -1 - # DEVNAMES structure - DN_DEFAULTPRN* = 1 - # PRINTDLG structure - PD_ALLPAGES* = 0 - PD_COLLATE* = 16 - PD_DISABLEPRINTTOFILE* = 524288 - PD_ENABLEPRINTHOOK* = 4096 - PD_ENABLEPRINTTEMPLATE* = 16384 - PD_ENABLEPRINTTEMPLATEHANDLE* = 65536 - PD_ENABLESETUPHOOK* = 8192 - PD_ENABLESETUPTEMPLATE* = 32768 - PD_ENABLESETUPTEMPLATEHANDLE* = 131072 - PD_HIDEPRINTTOFILE* = 1048576 - PD_NOPAGENUMS* = 8 - PD_NOSELECTION* = 4 - PD_NOWARNING* = 128 - PD_PAGENUMS* = 2 - PD_PRINTSETUP* = 64 - PD_PRINTTOFILE* = 32 - PD_RETURNDC* = 256 - PD_RETURNDEFAULT* = 1024 - PD_RETURNIC* = 512 - PD_SELECTION* = 1 - PD_SHOWHELP* = 2048 - PD_USEDEVMODECOPIES* = 262144 - PD_USEDEVMODECOPIESANDCOLLATE* = 262144 - # PAGESETUPDLG structure - PSD_DEFAULTMINMARGINS* = 0 - PSD_DISABLEMARGINS* = 16 - PSD_DISABLEORIENTATION* = 256 - PSD_DISABLEPAGEPAINTING* = 524288 - PSD_DISABLEPAPER* = 512 - PSD_DISABLEPRINTER* = 32 - PSD_ENABLEPAGEPAINTHOOK* = 262144 - PSD_ENABLEPAGESETUPHOOK* = 8192 - PSD_ENABLEPAGESETUPTEMPLATE* = 32768 - PSD_ENABLEPAGESETUPTEMPLATEHANDLE* = 131072 - PSD_INHUNDREDTHSOFMILLIMETERS* = 8 - PSD_INTHOUSANDTHSOFINCHES* = 4 - PSD_INWININIINTLMEASURE* = 0 - PSD_MARGINS* = 2 - PSD_MINMARGINS* = 1 - PSD_NOWARNING* = 128 - PSD_RETURNDEFAULT* = 1024 - PSD_SHOWHELP* = 2048 - # WM_SHOWWINDOW message - SW_OTHERUNZOOM* = 4 - SW_OTHERZOOM* = 2 - SW_PARENTCLOSING* = 1 - SW_PARENTOPENING* = 3 - # Virtual Key codes - VK_LBUTTON* = 1 - VK_RBUTTON* = 2 - VK_CANCEL* = 3 - VK_MBUTTON* = 4 - VK_BACK* = 8 - VK_TAB* = 9 - VK_CLEAR* = 12 - VK_RETURN* = 13 - VK_SHIFT* = 16 - VK_CONTROL* = 17 - VK_MENU* = 18 - VK_PAUSE* = 19 - VK_CAPITAL* = 20 - VK_ESCAPE* = 27 - VK_SPACE* = 32 - VK_PRIOR* = 33 - VK_NEXT* = 34 - VK_END* = 35 - VK_HOME* = 36 - VK_LEFT* = 37 - VK_UP* = 38 - VK_RIGHT* = 39 - VK_DOWN* = 40 - VK_SELECT* = 41 - VK_PRINT* = 42 - VK_EXECUTE* = 43 - VK_SNAPSHOT* = 44 - VK_INSERT* = 45 - VK_DELETE* = 46 - VK_HELP* = 47 - VK_0* = 48 - VK_1* = 49 - VK_2* = 50 - VK_3* = 51 - VK_4* = 52 - VK_5* = 53 - VK_6* = 54 - VK_7* = 55 - VK_8* = 56 - VK_9* = 57 - VK_A* = 65 - VK_B* = 66 - VK_C* = 67 - VK_D* = 68 - VK_E* = 69 - VK_F* = 70 - VK_G* = 71 - VK_H* = 72 - VK_I* = 73 - VK_J* = 74 - VK_K* = 75 - VK_L* = 76 - VK_M* = 77 - VK_N* = 78 - VK_O* = 79 - VK_P* = 80 - VK_Q* = 81 - VK_R* = 82 - VK_S* = 83 - VK_T* = 84 - VK_U* = 85 - VK_V* = 86 - VK_W* = 87 - VK_X* = 88 - VK_Y* = 89 - VK_Z* = 90 - VK_LWIN* = 91 - VK_RWIN* = 92 - VK_APPS* = 93 - VK_NUMPAD0* = 96 - VK_NUMPAD1* = 97 - VK_NUMPAD2* = 98 - VK_NUMPAD3* = 99 - VK_NUMPAD4* = 100 - VK_NUMPAD5* = 101 - VK_NUMPAD6* = 102 - VK_NUMPAD7* = 103 - VK_NUMPAD8* = 104 - VK_NUMPAD9* = 105 - VK_MULTIPLY* = 106 - VK_ADD* = 107 - VK_SEPARATOR* = 108 - VK_SUBTRACT* = 109 - VK_DECIMAL* = 110 - VK_DIVIDE* = 111 - VK_F1* = 112 - VK_F2* = 113 - VK_F3* = 114 - VK_F4* = 115 - VK_F5* = 116 - VK_F6* = 117 - VK_F7* = 118 - VK_F8* = 119 - VK_F9* = 120 - VK_F10* = 121 - VK_F11* = 122 - VK_F12* = 123 - VK_F13* = 124 - VK_F14* = 125 - VK_F15* = 126 - VK_F16* = 127 - VK_F17* = 128 - VK_F18* = 129 - VK_F19* = 130 - VK_F20* = 131 - VK_F21* = 132 - VK_F22* = 133 - VK_F23* = 134 - VK_F24* = 135 - # GetAsyncKeyState - VK_NUMLOCK* = 144 - VK_SCROLL* = 145 - VK_LSHIFT* = 160 - VK_LCONTROL* = 162 - VK_LMENU* = 164 - VK_RSHIFT* = 161 - VK_RCONTROL* = 163 - VK_RMENU* = 165 - # ImmGetVirtualKey - VK_PROCESSKEY* = 229 - # Keystroke Message Flags - KF_ALTDOWN* = 8192 - KF_DLGMODE* = 2048 - KF_EXTENDED* = 256 - KF_MENUMODE* = 4096 - KF_REPEAT* = 16384 - KF_UP* = 32768 - # GetKeyboardLayoutName - KL_NAMELENGTH* = 9 - # WM_ACTIVATE message - WA_ACTIVE* = 1 - WA_CLICKACTIVE* = 2 - WA_INACTIVE* = 0 - # WM_ACTIVATE message - PWR_CRITICALRESUME* = 3 - PWR_SUSPENDREQUEST* = 1 - PWR_SUSPENDRESUME* = 2 - PWR_FAIL* = -1 - PWR_OK* = 1 - # WM_NOTIFYFORMAT message - NF_QUERY* = 3 - NF_REQUERY* = 4 - NFR_ANSI* = 1 - NFR_UNICODE* = 2 - # WM_SIZING message - WMSZ_BOTTOM* = 6 - WMSZ_BOTTOMLEFT* = 7 - WMSZ_BOTTOMRIGHT* = 8 - WMSZ_LEFT* = 1 - WMSZ_RIGHT* = 2 - WMSZ_TOP* = 3 - WMSZ_TOPLEFT* = 4 - WMSZ_TOPRIGHT* = 5 - # WM_MOUSEACTIVATE message - MA_ACTIVATE* = 1 - MA_ACTIVATEANDEAT* = 2 - MA_NOACTIVATE* = 3 - MA_NOACTIVATEANDEAT* = 4 - # WM_SIZE message - SIZE_MAXHIDE* = 4 - SIZE_MAXIMIZED* = 2 - SIZE_MAXSHOW* = 3 - SIZE_MINIMIZED* = 1 - SIZE_RESTORED* = 0 - # WM_NCCALCSIZE message - WVR_ALIGNTOP* = 16 - WVR_ALIGNLEFT* = 32 - WVR_ALIGNBOTTOM* = 64 - WVR_ALIGNRIGHT* = 128 - WVR_HREDRAW* = 256 - WVR_VREDRAW* = 512 - WVR_REDRAW* = 768 - WVR_VALIDRECTS* = 1024 - # WM_NCHITTEST message - HTBOTTOM* = 15 - HTBOTTOMLEFT* = 16 - HTBOTTOMRIGHT* = 17 - HTCAPTION* = 2 - HTCLIENT* = 1 - HTERROR* = -2 - HTGROWBOX* = 4 - HTHSCROLL* = 6 - HTLEFT* = 10 - HTMENU* = 5 - HTNOWHERE* = 0 - HTREDUCE* = 8 - - HTRIGHT* = 11 - HTSIZE* = 4 - HTSYSMENU* = 3 - HTTOP* = 12 - HTTOPLEFT* = 13 - HTTOPRIGHT* = 14 - HTTRANSPARENT* = -1 - HTVSCROLL* = 7 - HTZOOM* = 9 - # Mouse messages - MK_CONTROL* = 8 - MK_LBUTTON* = 1 - MK_MBUTTON* = 16 - MK_RBUTTON* = 2 - MK_SHIFT* = 4 - # WNDCLASS structure - CS_BYTEALIGNCLIENT* = 4096 - CS_BYTEALIGNWINDOW* = 8192 - CS_CLASSDC* = 64 - CS_DBLCLKS* = 8 - CS_GLOBALCLASS* = 16384 - CS_HREDRAW* = 2 - CS_KEYCVTWINDOW* = 4 - CS_NOCLOSE* = 512 - CS_NOKEYCVT* = 256 - CS_OWNDC* = 32 - CS_PARENTDC* = 128 - CS_SAVEBITS* = 2048 - CS_VREDRAW* = 1 - DLGWINDOWEXTRA* = 30 - # ACCEL structure - FALT* = 16 - FCONTROL* = 8 - FNOINVERT* = 2 - FSHIFT* = 4 - FVIRTKEY* = 1 - # WM_MENUCHAR return constants - MNC_IGNORE* = 0 - MNC_CLOSE* = 1 - MNC_EXECUTE* = 2 - MNC_SELECT* = 3 - # MENUINFO structure - MIM_MAXHEIGHT* = 1 - MIM_BACKGROUND* = 2 - MIM_HELPID* = 4 - MIM_MENUDATA* = 8 - MIM_STYLE* = 16 - MIM_APPLYTOSUBMENUS* = 0x80000000 - MNS_CHECKORBMP* = 0x04000000 - MNS_NOTIFYBYPOS* = 0x08000000 - MNS_AUTODISMISS* = 0x10000000 - MNS_DRAGDROP* = 0x20000000 - MNS_MODELESS* = 0x40000000 - MNS_NOCHECK* = 0x80000000 - # MENUITEMINFO structure - MIIM_CHECKMARKS* = 8 - MIIM_DATA* = 32 - MIIM_ID* = 2 - MIIM_STATE* = 1 - MIIM_SUBMENU* = 4 - MIIM_TYPE* = 16 - MIIM_STRING* = 64 - MIIM_BITMAP* = 128 - MIIM_FTYPE* = 256 - MFT_BITMAP* = 0x00000004 - MFT_MENUBARBREAK* = 0x00000020 - MFT_MENUBREAK* = 0x00000040 - MFT_OWNERDRAW* = 0x00000100 - MFT_RADIOCHECK* = 0x00000200 - MFT_RIGHTJUSTIFY* = 0x00004000 - MFT_SEPARATOR* = 0x00000800 - MFT_RIGHTORDER* = 0x00002000 - MFT_STRING* = 0 - MFS_CHECKED* = 0x00000008 - MFS_DEFAULT* = 0x00001000 - MFS_DISABLED* = 0x00000003 - MFS_ENABLED* = 0 - MFS_GRAYED* = 0x00000003 - MFS_HILITE* = 0x00000080 - MFS_UNCHECKED* = 0 - MFS_UNHILITE* = 0 - HBMMENU_CALLBACK* = - 1 - HBMMENU_SYSTEM* = 1 - HBMMENU_MBAR_RESTORE* = 2 - HBMMENU_MBAR_MINIMIZE* = 3 - HBMMENU_MBAR_CLOSE* = 5 - HBMMENU_MBAR_CLOSE_D* = 6 - HBMMENU_MBAR_MINIMIZE_D* = 7 - HBMMENU_POPUP_CLOSE* = 8 - HBMMENU_POPUP_RESTORE* = 9 - HBMMENU_POPUP_MAXIMIZE* = 10 - HBMMENU_POPUP_MINIMIZE* = 11 - # SERIALKEYS structure - SERKF_AVAILABLE* = 2 - SERKF_INDICATOR* = 4 - SERKF_SERIALKEYSON* = 1 - # FILTERKEYS structure - FKF_AVAILABLE* = 2 - FKF_CLICKON* = 64 - FKF_FILTERKEYSON* = 1 - FKF_HOTKEYACTIVE* = 4 - FKF_HOTKEYSOUND* = 16 - FKF_CONFIRMHOTKEY* = 8 - FKF_INDICATOR* = 32 - # HELPINFO structure - HELPINFO_MENUITEM* = 2 - HELPINFO_WINDOW* = 1 - # WM_PRINT message - PRF_CHECKVISIBLE* = 0x00000001 - PRF_CHILDREN* = 0x00000010 - PRF_CLIENT* = 0x00000004 - PRF_ERASEBKGND* = 0x00000008 - PRF_NONCLIENT* = 0x00000002 - PRF_OWNED* = 0x00000020 - - # MapWindowPoints - HWND_DESKTOP* = HWND(0) - -const - # WM_SYSCOMMAND message - SC_CLOSE* = 61536 - SC_CONTEXTHELP* = 61824 - SC_DEFAULT* = 61792 - SC_HOTKEY* = 61776 - SC_HSCROLL* = 61568 - SC_KEYMENU* = 61696 - SC_MAXIMIZE* = 61488 - SC_ZOOM* = 61488 - SC_MINIMIZE* = 61472 - SC_ICON* = 61472 - SC_MONITORPOWER* = 61808 - SC_MOUSEMENU* = 61584 - SC_MOVE* = 61456 - SC_NEXTWINDOW* = 61504 - SC_PREVWINDOW* = 61520 - SC_RESTORE* = 61728 - SC_SCREENSAVE* = 61760 - SC_SIZE* = 61440 - SC_TASKLIST* = 61744 - SC_VSCROLL* = 61552 - # DM_GETDEFID message - DC_HASDEFID* = 21323 - # WM_GETDLGCODE message - DLGC_BUTTON* = 8192 - DLGC_DEFPUSHBUTTON* = 16 - DLGC_HASSETSEL* = 8 - DLGC_RADIOBUTTON* = 64 - DLGC_STATIC* = 256 - DLGC_UNDEFPUSHBUTTON* = 32 - DLGC_WANTALLKEYS* = 4 - DLGC_WANTARROWS* = 1 - DLGC_WANTCHARS* = 128 - DLGC_WANTMESSAGE* = 4 - DLGC_WANTTAB* = 2 - # EM_SETMARGINS message - EC_LEFTMARGIN* = 1 - EC_RIGHTMARGIN* = 2 - EC_USEFONTINFO* = 65535 - # LB_SETCOUNT message - LB_ERR* = -1 - LB_ERRSPACE* = -2 - LB_OKAY* = 0 - # CB_DIR message - CB_ERR* = -1 - CB_ERRSPACE* = -2 - # WM_IME_CONTROL message - IMC_GETCANDIDATEPOS* = 7 - IMC_GETCOMPOSITIONFONT* = 9 - IMC_GETCOMPOSITIONWINDOW* = 11 - IMC_GETSTATUSWINDOWPOS* = 15 - IMC_CLOSESTATUSWINDOW* = 33 - IMC_OPENSTATUSWINDOW* = 34 - IMC_SETCANDIDATEPOS* = 8 - IMC_SETCOMPOSITIONFONT* = 10 - IMC_SETCOMPOSITIONWINDOW* = 12 - IMC_SETSTATUSWINDOWPOS* = 16 - # WM_IME_CONTROL message - IMN_CHANGECANDIDATE* = 3 - IMN_CLOSECANDIDATE* = 4 - IMN_CLOSESTATUSWINDOW* = 1 - IMN_GUIDELINE* = 13 - IMN_OPENCANDIDATE* = 5 - IMN_OPENSTATUSWINDOW* = 2 - IMN_SETCANDIDATEPOS* = 9 - IMN_SETCOMPOSITIONFONT* = 10 - IMN_SETCOMPOSITIONWINDOW* = 11 - IMN_SETCONVERSIONMODE* = 6 - IMN_SETOPENSTATUS* = 8 - IMN_SETSENTENCEMODE* = 7 - IMN_SETSTATUSWINDOWPOS* = 12 - IMN_PRIVATE* = 14 - # STICKYKEYS structure - SKF_AUDIBLEFEEDBACK* = 64 - SKF_AVAILABLE* = 2 - SKF_CONFIRMHOTKEY* = 8 - SKF_HOTKEYACTIVE* = 4 - SKF_HOTKEYSOUND* = 16 - SKF_INDICATOR* = 32 - SKF_STICKYKEYSON* = 1 - SKF_TRISTATE* = 128 - SKF_TWOKEYSOFF* = 256 - # MOUSEKEYS structure - MKF_AVAILABLE* = 2 - MKF_CONFIRMHOTKEY* = 8 - MKF_HOTKEYACTIVE* = 4 - MKF_HOTKEYSOUND* = 16 - MKF_INDICATOR* = 32 - MKF_MOUSEKEYSON* = 1 - MKF_MODIFIERS* = 64 - MKF_REPLACENUMBERS* = 128 - # SOUNDSENTRY structure - SSF_AVAILABLE* = 2 - SSF_SOUNDSENTRYON* = 1 - SSTF_BORDER* = 2 - SSTF_CHARS* = 1 - SSTF_DISPLAY* = 3 - SSTF_NONE* = 0 - SSGF_DISPLAY* = 3 - SSGF_NONE* = 0 - SSWF_CUSTOM* = 4 - SSWF_DISPLAY* = 3 - SSWF_NONE* = 0 - SSWF_TITLE* = 1 - SSWF_WINDOW* = 2 - # ACCESSTIMEOUT structure - ATF_ONOFFFEEDBACK* = 2 - ATF_TIMEOUTON* = 1 - # HIGHCONTRAST structure - HCF_AVAILABLE* = 2 - HCF_CONFIRMHOTKEY* = 8 - HCF_HIGHCONTRASTON* = 1 - HCF_HOTKEYACTIVE* = 4 - HCF_HOTKEYAVAILABLE* = 64 - HCF_HOTKEYSOUND* = 16 - HCF_INDICATOR* = 32 - # TOGGLEKEYS structure - TKF_AVAILABLE* = 2 - TKF_CONFIRMHOTKEY* = 8 - TKF_HOTKEYACTIVE* = 4 - TKF_HOTKEYSOUND* = 16 - TKF_TOGGLEKEYSON* = 1 - # Installable Policy - PP_DISPLAYERRORS* = 1 - # SERVICE_INFO structure - RESOURCEDISPLAYTYPE_DOMAIN* = 1 - RESOURCEDISPLAYTYPE_FILE* = 4 - RESOURCEDISPLAYTYPE_GENERIC* = 0 - RESOURCEDISPLAYTYPE_GROUP* = 5 - RESOURCEDISPLAYTYPE_SERVER* = 2 - RESOURCEDISPLAYTYPE_SHARE* = 3 - # KEY_EVENT_RECORD structure - CAPSLOCK_ON* = 128 - ENHANCED_KEY* = 256 - LEFT_ALT_PRESSED* = 2 - LEFT_CTRL_PRESSED* = 8 - NUMLOCK_ON* = 32 - RIGHT_ALT_PRESSED* = 1 - RIGHT_CTRL_PRESSED* = 4 - SCROLLLOCK_ON* = 64 - SHIFT_PRESSED* = 16 - # MOUSE_EVENT_RECORD structure - FROM_LEFT_1ST_BUTTON_PRESSED* = 1 - RIGHTMOST_BUTTON_PRESSED* = 2 - FROM_LEFT_2ND_BUTTON_PRESSED* = 4 - FROM_LEFT_3RD_BUTTON_PRESSED* = 8 - FROM_LEFT_4TH_BUTTON_PRESSED* = 16 - DOUBLE_CLICK* = 2 - MOUSE_MOVED* = 1 - # INPUT_RECORD structure - KEY_EVENT* = 1 - cMOUSE_EVENT* = 2 - WINDOW_BUFFER_SIZE_EVENT* = 4 - MENU_EVENT* = 8 - FOCUS_EVENT* = 16 - # BITMAPINFOHEADER structure - BI_RGB* = 0 - BI_RLE8* = 1 - BI_RLE4* = 2 - BI_BITFIELDS* = 3 - # Extensions to OpenGL - # ChoosePixelFormat - PFD_DOUBLEBUFFER* = 0x00000001 - PFD_STEREO* = 0x00000002 - PFD_DRAW_TO_WINDOW* = 0x00000004 - PFD_DRAW_TO_BITMAP* = 0x00000008 - PFD_SUPPORT_GDI* = 0x00000010 - PFD_SUPPORT_OPENGL* = 0x00000020 - PFD_DEPTH_DONTCARE* = 0x20000000 - PFD_DOUBLEBUFFER_DONTCARE* = 0x40000000 - PFD_STEREO_DONTCARE* = 0x80000000 - PFD_TYPE_RGBA* = 0 - PFD_TYPE_COLORINDEX* = 1 - PFD_MAIN_PLANE* = 0 - PFD_OVERLAY_PLANE* = 1 - PFD_UNDERLAY_PLANE* = -1 - # wglUseFontOutlines - WGL_FONT_LINES* = 0 - WGL_FONT_POLYGONS* = 1 - PFD_GENERIC_FORMAT* = 0x00000040 - PFD_NEED_PALETTE* = 0x00000080 - PFD_NEED_SYSTEM_PALETTE* = 0x00000100 - PFD_SWAP_EXCHANGE* = 0x00000200 - PFD_SWAP_COPY* = 0x00000400 - PFD_SWAP_LAYER_BUFFERS* = 0x00000800 - PFD_GENERIC_ACCELERATED* = 0x00001000 - PFD_SUPPORT_DIRECTDRAW* = 0x00002000 - TMPF_FIXED_PITCH* = 0x00000001 - TMPF_VECTOR* = 0x00000002 - TMPF_TRUETYPE* = 0x00000004 - TMPF_DEVICE* = 0x00000008 - WM_CTLCOLOR* = 25 - LWA_COLORKEY* = 0x00000001 - LWA_ALPHA* = 0x00000002 - ULW_COLORKEY* = 0x00000001 - ULW_ALPHA* = 0x00000002 - ULW_OPAQUE* = 0x00000004 - WS_EX_LAYERED* = 0x00080000 - WS_EX_NOINHERITLAYOUT* = 0x00100000 - WS_EX_LAYOUTRTL* = 0x00400000 - WS_EX_COMPOSITED* = 0x02000000 - WS_EX_NOACTIVATE* = 0x08000000 - C3_LEXICAL* = 1024 - -# --------------------- old stuff, need to organize! --------------- -# BEGINNING of windowsx.h stuff from old headers: - -# was #define dname(params) def_expr -proc GetFirstChild*(h: HWND): HWND - # was #define dname(params) def_expr -proc GetNextSibling*(h: HWND): HWND - # was #define dname(params) def_expr -proc GetWindowID*(h: HWND): int32 - # was #define dname(params) def_expr -proc SubclassWindow*(h: HWND, p: LONG): LONG - # was #define dname(params) def_expr - # argument types are unknown - # return type might be wrong -proc GET_WM_COMMAND_CMD*(w, L: int32): int32 - # return type might be wrong - # was #define dname(params) def_expr - # argument types are unknown - # return type might be wrong -proc GET_WM_COMMAND_ID*(w, L: int32): int32 - # return type might be wrong - # was #define dname(params) def_expr - # argument types are unknown -proc GET_WM_CTLCOLOR_HDC*(w, L, msg: int32): HDC - # was #define dname(params) def_expr - # argument types are unknown -proc GET_WM_CTLCOLOR_HWND*(w, L, msg: int32): HWND - # was #define dname(params) def_expr - # argument types are unknown - # return type might be wrong -proc GET_WM_HSCROLL_CODE*(w, L: int32): int32 - # return type might be wrong - # was #define dname(params) def_expr - # argument types are unknown -proc GET_WM_HSCROLL_HWND*(w, L: int32): HWND - # was #define dname(params) def_expr - # argument types are unknown - # return type might be wrong -proc GET_WM_HSCROLL_POS*(w, L: int32): int32 - # return type might be wrong - # was #define dname(params) def_expr - # argument types are unknown - # return type might be wrong -proc GET_WM_MDIACTIVATE_FACTIVATE*(h, a, b: int32): int32 - # return type might be wrong - # was #define dname(params) def_expr - # argument types are unknown -proc GET_WM_MDIACTIVATE_HWNDACTIVATE*(a, b: int32): HWND - # was #define dname(params) def_expr - # argument types are unknown -proc GET_WM_MDIACTIVATE_HWNDDEACT*(a, b: int32): HWND - # was #define dname(params) def_expr - # argument types are unknown - # return type might be wrong -proc GET_WM_VSCROLL_CODE*(w, L: int32): int32 - # return type might be wrong - # was #define dname(params) def_expr - # argument types are unknown -proc GET_WM_VSCROLL_HWND*(w, L: int32): HWND - # was #define dname(params) def_expr - # argument types are unknown - # return type might be wrong -proc GET_WM_VSCROLL_POS*(w, L: int32): int32 - # return type might be wrong - # Not convertable by H2PAS - # END OF windowsx.h stuff from old headers - # ------------------------------------------------------------------ - -const - # BEGINNING of shellapi.h stuff from old headers - SE_ERR_SHARE* = 26 - SE_ERR_ASSOCINCOMPLETE* = 27 - SE_ERR_DDETIMEOUT* = 28 - SE_ERR_DDEFAIL* = 29 - SE_ERR_DDEBUSY* = 30 - SE_ERR_NOASSOC* = 31 - # END OF shellapi.h stuff from old headers - # - # ------------------------------------------------------------------ - # From ddeml.h in old Cygnus headers - XCLASS_BOOL* = 0x00001000 - XCLASS_DATA* = 0x00002000 - XCLASS_FLAGS* = 0x00004000 - XCLASS_MASK* = 0x0000FC00 - XCLASS_NOTIFICATION* = 0x00008000 - XTYPF_NOBLOCK* = 0x00000002 - XTYP_ADVDATA* = 0x00004010 - XTYP_ADVREQ* = 0x00002022 - XTYP_ADVSTART* = 0x00001030 - XTYP_ADVSTOP* = 0x00008040 - XTYP_CONNECT* = 0x00001062 - XTYP_CONNECT_CONFIRM* = 0x00008072 - XTYP_DISCONNECT* = 0x000080C2 - XTYP_EXECUTE* = 0x00004050 - XTYP_POKE* = 0x00004090 - XTYP_REQUEST* = 0x000020B0 - XTYP_WILDCONNECT* = 0x000020E2 - XTYP_REGISTER* = 0x000080A2 - XTYP_ERROR* = 0x00008002 - XTYP_XACT_COMPLETE* = 0x00008080 - XTYP_UNREGISTER* = 0x000080D2 - DMLERR_DLL_USAGE* = 0x00004004 - DMLERR_INVALIDPARAMETER* = 0x00004006 - DMLERR_NOTPROCESSED* = 0x00004009 - DMLERR_POSTMSG_FAILED* = 0x0000400C - DMLERR_SERVER_DIED* = 0x0000400E - DMLERR_SYS_ERROR* = 0x0000400F - DMLERR_BUSY* = 0x00004001 - DMLERR_DATAACKTIMEOUT* = 0x00004002 - DMLERR_ADVACKTIMEOUT* = 0x00004000 - DMLERR_DLL_NOT_INITIALIZED* = 0x00004003 - DMLERR_LOW_MEMORY* = 0x00004007 - DMLERR_MEMORY_ERROR* = 0x00004008 - DMLERR_POKEACKTIMEOUT* = 0x0000400B - DMLERR_NO_CONV_ESTABLISHED* = 0x0000400A - DMLERR_REENTRANCY* = 0x0000400D - DMLERR_UNFOUND_QUEUE_ID* = 0x00004011 - DMLERR_UNADVACKTIMEOUT* = 0x00004010 - DMLERR_EXECACKTIMEOUT* = 0x00004005 - DDE_FACK* = 0x00008000 - DDE_FNOTPROCESSED* = 0x00000000 - DNS_REGISTER* = 0x00000001 - DNS_UNREGISTER* = 0x00000002 - CP_WINANSI* = 1004 - CP_WINUNICODE* = 1200 - # Not convertable by H2PAS - # #define EXPENTRY CALLBACK - APPCLASS_STANDARD* = 0x00000000 - # End of stuff from ddeml.h in old Cygnus headers - - BKMODE_LAST* = 2 - CTLCOLOR_MSGBOX* = 0 - CTLCOLOR_EDIT* = 1 - CTLCOLOR_LISTBOX* = 2 - CTLCOLOR_BTN* = 3 - CTLCOLOR_DLG* = 4 - CTLCOLOR_SCROLLBAR* = 5 - CTLCOLOR_STATIC* = 6 - CTLCOLOR_MAX* = 7 - META_SETMAPMODE* = 0x00000103 - META_SETWINDOWORG* = 0x0000020B - META_SETWINDOWEXT* = 0x0000020C - POLYFILL_LAST* = 2 - STATUS_WAIT_0* = 0x00000000 - STATUS_ABANDONED_WAIT_0* = 0x00000080 - STATUS_USER_APC* = 0x000000C0 - STATUS_TIMEOUT* = 0x00000102 - STATUS_PENDING* = 0x00000103 - STATUS_GUARD_PAGE_VIOLATION* = 0x80000001 - STATUS_DATATYPE_MISALIGNMENT* = 0x80000002 - STATUS_BREAKPOINT* = 0x80000003 - STATUS_SINGLE_STEP* = 0x80000004 - STATUS_IN_PAGE_ERROR* = 0xC0000006 - STATUS_INVALID_HANDLE* = 0xC0000008 - STATUS_ILLEGAL_INSTRUCTION* = 0xC000001D - STATUS_NONCONTINUABLE_EXCEPTION* = 0xC0000025 - STATUS_INVALID_DISPOSITION* = 0xC0000026 - STATUS_ARRAY_BOUNDS_EXCEEDED* = 0xC000008C - STATUS_FLOAT_DENORMAL_OPERAND* = 0xC000008D - STATUS_FLOAT_DIVIDE_BY_ZERO* = 0xC000008E - STATUS_FLOAT_INEXACT_RESULT* = 0xC000008F - STATUS_FLOAT_INVALID_OPERATION* = 0xC0000090 - STATUS_FLOAT_OVERFLOW* = 0xC0000091 - STATUS_FLOAT_STACK_CHECK* = 0xC0000092 - STATUS_FLOAT_UNDERFLOW* = 0xC0000093 - STATUS_INTEGER_DIVIDE_BY_ZERO* = 0xC0000094 - STATUS_INTEGER_OVERFLOW* = 0xC0000095 - STATUS_PRIVILEGED_INSTRUCTION* = 0xC0000096 - STATUS_STACK_OVERFLOW* = 0xC00000FD - STATUS_CONTROL_C_EXIT* = 0xC000013A - PROCESSOR_ARCHITECTURE_INTEL* = 0 - PROCESSOR_ARCHITECTURE_MIPS* = 1 - PROCESSOR_ARCHITECTURE_ALPHA* = 2 - PROCESSOR_ARCHITECTURE_PPC* = 3 - -const - SIZEFULLSCREEN* = SIZE_MAXIMIZED - SIZENORMAL* = SIZE_RESTORED - SIZEICONIC* = SIZE_MINIMIZED - -const - EXCEPTION_READ_FAULT* = 0 # Access violation was caused by a read - EXCEPTION_WRITE_FAULT* = 1 # Access violation was caused by a write - -when 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 - -const - # Define the facility codes - FACILITY_WINDOWS* = 8 - FACILITY_STORAGE* = 3 - FACILITY_RPC* = 1 - FACILITY_SSPI* = 9 - FACILITY_WIN32* = 7 - FACILITY_CONTROL* = 10 - FACILITY_NULL* = 0 - FACILITY_INTERNET* = 12 - FACILITY_ITF* = 4 - FACILITY_DISPATCH* = 2 - FACILITY_CERT* = 11 # Manually added, bug 2672 - ICON_SMALL* = 0 - ICON_BIG* = 1 - # For the TrackMouseEvent - TME_HOVER* = 0x00000001 - TME_LEAVE* = 0x00000002 - TME_QUERY* = 0x40000000 - TME_CANCEL* = DWORD(0x80000000) - HOVER_DEFAULT* = DWORD(0xFFFFFFFF) # Manually added, bug 3270 - COLOR_HOTLIGHT* = 26 - COLOR_GRADIENTACTIVECAPTION* = 27 - COLOR_GRADIENTINACTIVECAPTION* = 28 - COLOR_MENUHILIGHT* = 29 - COLOR_MENUBAR* = 30 - WM_APP* = 0x00008000 - SYSRGN* = 4 - UIS_SET* = 1 - UIS_CLEAR* = 2 - UIS_INITIALIZE* = 3 - UISF_HIDEFOCUS* = 0x00000001 - UISF_HIDEACCEL* = 0x00000002 - UISF_ACTIVE* = 0x00000004 - -type - # WARNING - # the variable argument list - # is not implemented for FPC - # va_list is just a dummy record - # MvdV: Nevertheless it should be a pointer type, not a record - va_list* = cstring - TABC* {.final, pure.} = object - abcA*: int32 - abcB*: UINT - abcC*: int32 - - LPABC* = ptr TABC - PABC* = ptr TABC - TABCFLOAT* {.final, pure.} = object - abcfA*: float32 - abcfB*: float32 - abcfC*: float32 - LPABCFLOAT* = ptr TABCFLOAT - PABCFLOAT* = ptr TABCFLOAT - - TACCEL* {.final, pure.} = object - fVirt*: int8 - key*: int16 - cmd*: int16 - LPACCEL* = ptr TACCEL - PACCEL* = ptr TACCEL - ACE_HEADER* {.final, pure.} = object - AceType*: int8 - AceFlags*: int8 - AceSize*: int16 - - TACE_HEADER* = ACE_HEADER - PACE_HEADER* = ptr ACE_HEADER - ACCESS_MASK* = DWORD - REGSAM* = ACCESS_MASK - ACCESS_ALLOWED_ACE* {.final, pure.} = object - Header*: ACE_HEADER - Mask*: ACCESS_MASK - SidStart*: DWORD - - TACCESS_ALLOWED_ACE* = ACCESS_ALLOWED_ACE - PACCESS_ALLOWED_ACE* = ptr ACCESS_ALLOWED_ACE - ACCESS_DENIED_ACE* {.final, pure.} = object - Header*: ACE_HEADER - Mask*: ACCESS_MASK - SidStart*: DWORD - - TACCESS_DENIED_ACE* = ACCESS_DENIED_ACE - ACCESSTIMEOUT* {.final, pure.} = object - cbSize*: UINT - dwFlags*: DWORD - iTimeOutMSec*: DWORD - - TACCESSTIMEOUT* = ACCESSTIMEOUT - PACCESSTIMEOUT* = ptr ACCESSTIMEOUT - ACL* {.final, pure.} = object - AclRevision*: int8 - Sbz1*: int8 - AclSize*: int16 - AceCount*: int16 - Sbz2*: int16 - - PACL* = ptr ACL - TACL* = ACL - TACL_REVISION_INFORMATION* {.final, pure.} = object - AclRevision*: DWORD - PACLREVISIONINFORMATION* = ptr TACL_REVISION_INFORMATION - - TACL_SIZE_INFORMATION* {.final, pure.} = object - AceCount*: DWORD - AclBytesInUse*: DWORD - AclBytesFree*: DWORD - PACLSIZEINFORMATION* = ptr TACL_SIZE_INFORMATION - ACTION_HEADER* {.final, pure.} = object - transport_id*: ULONG - action_code*: USHORT - reserved*: USHORT - - TACTIONHEADER* = ACTION_HEADER - PACTIONHEADER* = ptr ACTION_HEADER - ADAPTER_STATUS* {.final, pure.} = object - adapter_address*: array[0..5, UCHAR] - rev_major*: UCHAR - reserved0*: UCHAR - adapter_type*: UCHAR - rev_minor*: UCHAR - duration*: int16 - frmr_recv*: int16 - frmr_xmit*: int16 - iframe_recv_err*: int16 - xmit_aborts*: int16 - xmit_success*: DWORD - recv_success*: DWORD - iframe_xmit_err*: int16 - recv_buff_unavail*: int16 - t1_timeouts*: int16 - ti_timeouts*: int16 - reserved1*: DWORD - free_ncbs*: int16 - max_cfg_ncbs*: int16 - max_ncbs*: int16 - xmit_buf_unavail*: int16 - max_dgram_size*: int16 - pending_sess*: int16 - max_cfg_sess*: int16 - max_sess*: int16 - max_sess_pkt_size*: int16 - name_count*: int16 - - TADAPTERSTATUS* = ADAPTER_STATUS - PADAPTERSTATUS* = ptr ADAPTER_STATUS - ADDJOB_INFO_1* {.final, pure.} = object - Path*: LPTSTR - JobId*: DWORD - - TADDJOB_INFO_1* = ADDJOB_INFO_1 - PADDJOB_INFO_1* = ptr ADDJOB_INFO_1 - ANIMATIONINFO* {.final, pure.} = object - cbSize*: UINT - iMinAnimate*: int32 - - LPANIMATIONINFO* = ptr ANIMATIONINFO - TANIMATIONINFO* = ANIMATIONINFO - PANIMATIONINFO* = ptr ANIMATIONINFO - - APPBARDATA* {.final, pure.} = object - cbSize*: DWORD - hWnd*: HWND - uCallbackMessage*: UINT - uEdge*: UINT - rc*: RECT - lParam*: LPARAM - - TAppBarData* = APPBARDATA - PAppBarData* = ptr APPBARDATA - BITMAP* {.final, pure.} = object - bmType*: LONG - bmWidth*: LONG - bmHeight*: LONG - bmWidthBytes*: LONG - bmPlanes*: int16 - bmBitsPixel*: int16 - bmBits*: LPVOID - - PBITMAP* = ptr BITMAP - NPBITMAP* = ptr BITMAP - LPBITMAP* = ptr BITMAP - TBITMAP* = BITMAP - BITMAPCOREHEADER* {.final, pure.} = object - bcSize*: DWORD - bcWidth*: int16 - bcHeight*: int16 - bcPlanes*: int16 - bcBitCount*: int16 - - TBITMAPCOREHEADER* = BITMAPCOREHEADER - PBITMAPCOREHEADER* = ptr BITMAPCOREHEADER - RGBTRIPLE* {.final, pure.} = object - rgbtBlue*: int8 - rgbtGreen*: int8 - rgbtRed*: int8 - - TRGBTRIPLE* = RGBTRIPLE - PRGBTRIPLE* = ptr RGBTRIPLE - BITMAPCOREINFO* {.final, pure.} = object - bmciHeader*: BITMAPCOREHEADER - bmciColors*: array[0..0, RGBTRIPLE] - - PBITMAPCOREINFO* = ptr BITMAPCOREINFO - LPBITMAPCOREINFO* = ptr BITMAPCOREINFO - TBITMAPCOREINFO* = BITMAPCOREINFO # error - # WORD bfReserved1; - # WORD bfReserved2; - # in declarator_list - BITMAPINFOHEADER* {.final, pure.} = object - biSize*: DWORD - biWidth*: LONG - biHeight*: LONG - biPlanes*: int16 - biBitCount*: int16 - biCompression*: DWORD - biSizeImage*: DWORD - biXPelsPerMeter*: LONG - biYPelsPerMeter*: LONG - biClrUsed*: DWORD - biClrImportant*: DWORD - - LPBITMAPINFOHEADER* = ptr BITMAPINFOHEADER - TBITMAPINFOHEADER* = BITMAPINFOHEADER - PBITMAPINFOHEADER* = ptr BITMAPINFOHEADER - RGBQUAD* {.final, pure.} = object - rgbBlue*: int8 - rgbGreen*: int8 - rgbRed*: int8 - rgbReserved*: int8 - - TRGBQUAD* = RGBQUAD - PRGBQUAD* = ptr RGBQUAD - BITMAPINFO* {.final, pure.} = object - 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* {.final, pure.} = object - ciexyzX*: FXPT2DOT30 - ciexyzY*: FXPT2DOT30 - ciexyzZ*: FXPT2DOT30 - - LPCIEXYZ* = ptr CIEXYZ - TPCIEXYZ* = CIEXYZ - PCIEXYZ* = ptr CIEXYZ - CIEXYZTRIPLE* {.final, pure.} = object - ciexyzRed*: CIEXYZ - ciexyzGreen*: CIEXYZ - ciexyzBlue*: CIEXYZ - - LPCIEXYZTRIPLE* = ptr CIEXYZTRIPLE - TCIEXYZTRIPLE* = CIEXYZTRIPLE - PCIEXYZTRIPLE* = ptr CIEXYZTRIPLE - BITMAPV4HEADER* {.final, pure.} = object - bV4Size*: DWORD - bV4Width*: LONG - bV4Height*: LONG - bV4Planes*: int16 - bV4BitCount*: int16 - bV4V4Compression*: DWORD - bV4SizeImage*: DWORD - bV4XPelsPerMeter*: LONG - bV4YPelsPerMeter*: LONG - bV4ClrUsed*: DWORD - bV4ClrImportant*: DWORD - bV4RedMask*: DWORD - bV4GreenMask*: DWORD - bV4BlueMask*: DWORD - bV4AlphaMask*: DWORD - bV4CSType*: DWORD - bV4Endpoints*: CIEXYZTRIPLE - bV4GammaRed*: DWORD - bV4GammaGreen*: DWORD - bV4GammaBlue*: DWORD - - LPBITMAPV4HEADER* = ptr BITMAPV4HEADER - TBITMAPV4HEADER* = BITMAPV4HEADER - PBITMAPV4HEADER* = ptr BITMAPV4HEADER - BITMAPFILEHEADER* {.final, pure.} = object - bfType*: int16 - bfSize*: DWord - bfReserved1*: int16 - bfReserved2*: int16 - bfOffBits*: DWord - - BLOB* {.final, pure.} = object - cbSize*: ULONG - pBlobData*: ptr int8 - - TBLOB* = BLOB - PBLOB* = ptr BLOB - SHITEMID* {.final, pure.} = object - cb*: USHORT - abID*: array[0..0, int8] - - LPSHITEMID* = ptr SHITEMID - LPCSHITEMID* = ptr SHITEMID - TSHITEMID* = SHITEMID - PSHITEMID* = ptr SHITEMID - ITEMIDLIST* {.final, pure.} = object - mkid*: SHITEMID - - LPITEMIDLIST* = ptr ITEMIDLIST - LPCITEMIDLIST* = ptr ITEMIDLIST - TITEMIDLIST* = ITEMIDLIST - PITEMIDLIST* = ptr ITEMIDLIST - BROWSEINFO* {.final, pure.} = object - hwndOwner*: HWND - pidlRoot*: LPCITEMIDLIST - pszDisplayName*: LPSTR - lpszTitle*: LPCSTR - ulFlags*: UINT - lpfn*: BFFCALLBACK - lParam*: LPARAM - iImage*: int32 - - LPBROWSEINFO* = ptr BROWSEINFO - Tbrowseinfo* = BROWSEINFO - PBROWSEINFO* = ptr BROWSEINFO - - BY_HANDLE_FILE_INFORMATION* {.final, pure.} = object - dwFileAttributes*: DWORD - ftCreationTime*: FILETIME - ftLastAccessTime*: FILETIME - ftLastWriteTime*: FILETIME - dwVolumeSerialNumber*: DWORD - nFileSizeHigh*: DWORD - nFileSizeLow*: DWORD - nNumberOfLinks*: DWORD - nFileIndexHigh*: DWORD - nFileIndexLow*: DWORD - - LPBY_HANDLE_FILE_INFORMATION* = ptr BY_HANDLE_FILE_INFORMATION - TBYHANDLEFILEINFORMATION* = BY_HANDLE_FILE_INFORMATION - PBYHANDLEFILEINFORMATION* = ptr BY_HANDLE_FILE_INFORMATION - FIXED* {.final, pure.} = object - fract*: int16 - value*: SHORT - - TFIXED* = FIXED - PFIXED* = ptr FIXED - POINTFX* {.final, pure.} = object - x*: FIXED - y*: FIXED - - TPOINTFX* = POINTFX - PPOINTFX* = ptr POINTFX - - TSmallPoint* {.final, pure.} = object - X*, Y*: SHORT - - CANDIDATEFORM* {.final, pure.} = object - dwIndex*: DWORD - dwStyle*: DWORD - ptCurrentPos*: POINT - rcArea*: RECT - - LPCANDIDATEFORM* = ptr CANDIDATEFORM - TCANDIDATEFORM* = CANDIDATEFORM - PCANDIDATEFORM* = ptr CANDIDATEFORM - CANDIDATELIST* {.final, pure.} = object - dwSize*: DWORD - dwStyle*: DWORD - dwCount*: DWORD - dwSelection*: DWORD - dwPageStart*: DWORD - dwPageSize*: DWORD - dwOffset*: array[0..0, DWORD] - - LPCANDIDATELIST* = ptr CANDIDATELIST - TCANDIDATELIST* = CANDIDATELIST - PCANDIDATELIST* = ptr CANDIDATELIST - CREATESTRUCT* {.final, pure.} = object - lpCreateParams*: LPVOID - hInstance*: HINST - hMenu*: HMENU - hwndParent*: HWND - cy*: int32 - cx*: int32 - y*: int32 - x*: int32 - style*: LONG - lpszName*: LPCTSTR - lpszClass*: LPCTSTR - dwExStyle*: DWORD - - LPCREATESTRUCT* = ptr CREATESTRUCT - TCREATESTRUCT* = CREATESTRUCT - PCREATESTRUCT* = ptr CREATESTRUCT - CBT_CREATEWND* {.final, pure.} = object - lpcs*: LPCREATESTRUCT - hwndInsertAfter*: HWND - - TCBT_CREATEWND* = CBT_CREATEWND - PCBT_CREATEWND* = ptr CBT_CREATEWND - CBTACTIVATESTRUCT* {.final, pure.} = object - fMouse*: WINBOOL - hWndActive*: HWND - - TCBTACTIVATESTRUCT* = CBTACTIVATESTRUCT - PCBTACTIVATESTRUCT* = ptr CBTACTIVATESTRUCT - CHAR_INFO* {.final, pure.} = object - UnicodeChar*: WCHAR - Attributes*: int16 # other union part: AsciiChar : CHAR - - TCHAR_INFO* = CHAR_INFO - PCHAR_INFO* = ptr CHAR_INFO - CHARFORMAT* {.final, pure.} = object - 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* {.final, pure.} = object - cpMin*: LONG - cpMax*: LONG - - Tcharrange* = CHARRANGE - Pcharrange* = ptr CHARRANGE - CHARSET* {.final, pure.} = object - aflBlock*: array[0..2, DWORD] - flLang*: DWORD - - TCHARSET* = CHARSET - PCHARSET* = ptr CHARSET - FONTSIGNATURE* {.final, pure.} = object - fsUsb*: array[0..3, DWORD] - fsCsb*: array[0..1, DWORD] - - LPFONTSIGNATURE* = ptr FONTSIGNATURE - TFONTSIGNATURE* = FONTSIGNATURE - PFONTSIGNATURE* = ptr FONTSIGNATURE - CHARSETINFO* {.final, pure.} = object - ciCharset*: UINT - ciACP*: UINT - fs*: FONTSIGNATURE - - LPCHARSETINFO* = ptr CHARSETINFO - TCHARSETINFO* = CHARSETINFO - PCHARSETINFO* = ptr CHARSETINFO - #CHOOSECOLOR = record confilcts with function ChooseColor - TCHOOSECOLOR* {.final, pure.} = object - lStructSize*: DWORD - hwndOwner*: HWND - hInstance*: HWND - rgbResult*: COLORREF - lpCustColors*: ptr COLORREF - Flags*: DWORD - lCustData*: LPARAM - lpfnHook*: LPCCHOOKPROC - lpTemplateName*: LPCTSTR - - LPCHOOSECOLOR* = ptr TCHOOSECOLOR - PCHOOSECOLOR* = ptr TCHOOSECOLOR - LOGFONT* {.final, pure.} = object - lfHeight*: LONG - lfWidth*: LONG - lfEscapement*: LONG - lfOrientation*: LONG - lfWeight*: LONG - lfItalic*: int8 - lfUnderline*: int8 - lfStrikeOut*: int8 - lfCharSet*: int8 - lfOutPrecision*: int8 - lfClipPrecision*: int8 - lfQuality*: int8 - lfPitchAndFamily*: int8 - lfFaceName*: array[0..(LF_FACESIZE) - 1, TCHAR] - - LPLOGFONT* = ptr LOGFONT - TLOGFONT* = LOGFONT - TLOGFONTA* = LOGFONT - PLOGFONT* = ptr LOGFONT - PLOGFONTA* = PLOGFONT - LOGFONTW* {.final, pure.} = object - lfHeight*: LONG - lfWidth*: LONG - lfEscapement*: LONG - lfOrientation*: LONG - lfWeight*: LONG - lfItalic*: int8 - lfUnderline*: int8 - lfStrikeOut*: int8 - lfCharSet*: int8 - lfOutPrecision*: int8 - lfClipPrecision*: int8 - lfQuality*: int8 - lfPitchAndFamily*: int8 - lfFaceName*: array[0..LF_FACESIZE - 1, WCHAR] - - LPLOGFONTW* = ptr LOGFONTW - NPLOGFONTW* = ptr LOGFONTW - TLogFontW* = LOGFONTW - PLogFontW* = ptr TLogFontW - TCHOOSEFONT* {.final, pure.} = object - lStructSize*: DWORD - hwndOwner*: HWND - hDC*: HDC - lpLogFont*: LPLOGFONT - iPointSize*: WINT - Flags*: DWORD - rgbColors*: DWORD - lCustData*: LPARAM - lpfnHook*: LPCFHOOKPROC - lpTemplateName*: LPCTSTR - hInstance*: HINST - lpszStyle*: LPTSTR - nFontType*: int16 - MISSING_ALIGNMENT*: int16 - nSizeMin*: WINT - nSizeMax*: WINT - - LPCHOOSEFONT* = ptr TCHOOSEFONT - PCHOOSEFONT* = ptr TCHOOSEFONT - CIDA* {.final, pure.} = object - cidl*: UINT - aoffset*: array[0..0, UINT] - - LPIDA* = ptr CIDA - TIDA* = CIDA - PIDA* = ptr CIDA - CLIENTCREATESTRUCT* {.final, pure.} = object - hWindowMenu*: HANDLE - idFirstChild*: UINT - - LPCLIENTCREATESTRUCT* = ptr CLIENTCREATESTRUCT - TCLIENTCREATESTRUCT* = CLIENTCREATESTRUCT - PCLIENTCREATESTRUCT* = ptr CLIENTCREATESTRUCT - CMINVOKECOMMANDINFO* {.final, pure.} = object - cbSize*: DWORD - fMask*: DWORD - hwnd*: HWND - lpVerb*: LPCSTR - lpParameters*: LPCSTR - lpDirectory*: LPCSTR - nShow*: int32 - dwHotKey*: DWORD - hIcon*: HANDLE - - LPCMINVOKECOMMANDINFO* = ptr CMINVOKECOMMANDINFO - TCMInvokeCommandInfo* = CMINVOKECOMMANDINFO - PCMInvokeCommandInfo* = ptr CMINVOKECOMMANDINFO - COLORADJUSTMENT* {.final, pure.} = object - caSize*: int16 - caFlags*: int16 - caIlluminantIndex*: int16 - caRedGamma*: int16 - caGreenGamma*: int16 - caBlueGamma*: int16 - caReferenceBlack*: int16 - caReferenceWhite*: int16 - caContrast*: SHORT - caBrightness*: SHORT - caColorfulness*: SHORT - caRedGreenTint*: SHORT - - LPCOLORADJUSTMENT* = ptr COLORADJUSTMENT - TCOLORADJUSTMENT* = COLORADJUSTMENT - PCOLORADJUSTMENT* = ptr COLORADJUSTMENT - COLORMAP* {.final, pure.} = object - `from`*: COLORREF - `to`*: COLORREF # XXX! - - LPCOLORMAP* = ptr COLORMAP - TCOLORMAP* = COLORMAP - PCOLORMAP* = ptr COLORMAP - DCB* {.final, pure.} = object - DCBlength*: DWORD - BaudRate*: DWORD - flags*: DWORD - wReserved*: int16 - XonLim*: int16 - XoffLim*: int16 - ByteSize*: int8 - Parity*: int8 - StopBits*: int8 - XonChar*: char - XoffChar*: char - ErrorChar*: char - EofChar*: char - EvtChar*: char - wReserved1*: int16 - - LPDCB* = ptr DCB - TDCB* = DCB - PDCB* = ptr DCB - -const - bm_DCB_fBinary* = 1 - bp_DCB_fBinary* = 0'i32 - bm_DCB_fParity* = 0x00000002 - bp_DCB_fParity* = 1'i32 - bm_DCB_fOutxCtsFlow* = 0x00000004 - bp_DCB_fOutxCtsFlow* = 2'i32 - bm_DCB_fOutxDsrFlow* = 0x00000008 - bp_DCB_fOutxDsrFlow* = 3'i32 - bm_DCB_fDtrControl* = 0x00000030 - bp_DCB_fDtrControl* = 4'i32 - bm_DCB_fDsrSensitivity* = 0x00000040 - bp_DCB_fDsrSensitivity* = 6'i32 - bm_DCB_fTXContinueOnXoff* = 0x00000080 - bp_DCB_fTXContinueOnXoff* = 7'i32 - bm_DCB_fOutX* = 0x00000100 - bp_DCB_fOutX* = 8'i32 - bm_DCB_fInX* = 0x00000200 - bp_DCB_fInX* = 9'i32 - bm_DCB_fErrorChar* = 0x00000400 - bp_DCB_fErrorChar* = 10'i32 - bm_DCB_fNull* = 0x00000800 - bp_DCB_fNull* = 11'i32 - bm_DCB_fRtsControl* = 0x00003000 - bp_DCB_fRtsControl* = 12'i32 - bm_DCB_fAbortOnError* = 0x00004000 - bp_DCB_fAbortOnError* = 14'i32 - bm_DCB_fDummy2* = 0xFFFF8000'i32 - bp_DCB_fDummy2* = 15'i32 - -proc fBinary*(a: var DCB): DWORD -proc set_fBinary*(a: var DCB, fBinary: DWORD) -proc fParity*(a: var DCB): DWORD -proc set_fParity*(a: var DCB, fParity: DWORD) -proc fOutxCtsFlow*(a: var DCB): DWORD -proc set_fOutxCtsFlow*(a: var DCB, fOutxCtsFlow: DWORD) -proc fOutxDsrFlow*(a: var DCB): DWORD -proc set_fOutxDsrFlow*(a: var DCB, fOutxDsrFlow: DWORD) -proc fDtrControl*(a: var DCB): DWORD -proc set_fDtrControl*(a: var DCB, fDtrControl: DWORD) -proc fDsrSensitivity*(a: var DCB): DWORD -proc set_fDsrSensitivity*(a: var DCB, fDsrSensitivity: DWORD) -proc fTXContinueOnXoff*(a: var DCB): DWORD -proc set_fTXContinueOnXoff*(a: var DCB, fTXContinueOnXoff: DWORD) -proc fOutX*(a: var DCB): DWORD -proc set_fOutX*(a: var DCB, fOutX: DWORD) -proc fInX*(a: var DCB): DWORD -proc set_fInX*(a: var DCB, fInX: DWORD) -proc fErrorChar*(a: var DCB): DWORD -proc set_fErrorChar*(a: var DCB, fErrorChar: DWORD) -proc fNull*(a: var DCB): DWORD -proc set_fNull*(a: var DCB, fNull: DWORD) -proc fRtsControl*(a: var DCB): DWORD -proc set_fRtsControl*(a: var DCB, fRtsControl: DWORD) -proc fAbortOnError*(a: var DCB): DWORD -proc set_fAbortOnError*(a: var DCB, fAbortOnError: DWORD) -proc fDummy2*(a: var DCB): DWORD -proc set_fDummy2*(a: var DCB, fDummy2: DWORD) -type - COMMCONFIG* {.final, pure.} = object - dwSize*: DWORD - wVersion*: int16 - wReserved*: int16 - dcb*: DCB - dwProviderSubType*: DWORD - dwProviderOffset*: DWORD - dwProviderSize*: DWORD - wcProviderData*: array[0..0, WCHAR] - - LPCOMMCONFIG* = ptr COMMCONFIG - TCOMMCONFIG* = COMMCONFIG - PCOMMCONFIG* = ptr COMMCONFIG - COMMPROP* {.final, pure.} = object - wPacketLength*: int16 - wPacketVersion*: int16 - dwServiceMask*: DWORD - dwReserved1*: DWORD - dwMaxTxQueue*: DWORD - dwMaxRxQueue*: DWORD - dwMaxBaud*: DWORD - dwProvSubType*: DWORD - dwProvCapabilities*: DWORD - dwSettableParams*: DWORD - dwSettableBaud*: DWORD - wSettableData*: int16 - wSettableStopParity*: int16 - dwCurrentTxQueue*: DWORD - dwCurrentRxQueue*: DWORD - dwProvSpec1*: DWORD - dwProvSpec2*: DWORD - wcProvChar*: array[0..0, WCHAR] - - LPCOMMPROP* = ptr COMMPROP - TCOMMPROP* = COMMPROP - PCOMMPROP* = ptr COMMPROP - COMMTIMEOUTS* {.final, pure.} = object - ReadIntervalTimeout*: DWORD - ReadTotalTimeoutMultiplier*: DWORD - ReadTotalTimeoutConstant*: DWORD - WriteTotalTimeoutMultiplier*: DWORD - WriteTotalTimeoutConstant*: DWORD - - LPCOMMTIMEOUTS* = ptr COMMTIMEOUTS - TCOMMTIMEOUTS* = COMMTIMEOUTS - PCOMMTIMEOUTS* = ptr COMMTIMEOUTS - COMPAREITEMSTRUCT* {.final, pure.} = object - CtlType*: UINT - CtlID*: UINT - hwndItem*: HWND - itemID1*: UINT - itemData1*: ULONG_PTR - itemID2*: UINT - itemData2*: ULONG_PTR - - TCOMPAREITEMSTRUCT* = COMPAREITEMSTRUCT - PCOMPAREITEMSTRUCT* = ptr COMPAREITEMSTRUCT - COMPCOLOR* {.final, pure.} = object - crText*: COLORREF - crBackground*: COLORREF - dwEffects*: DWORD - - TCOMPCOLOR* = COMPCOLOR - PCOMPCOLOR* = ptr COMPCOLOR - COMPOSITIONFORM* {.final, pure.} = object - 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* {.final, pure.} = object - 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'i32 - bm_COMSTAT_fDsrHold* = 0x00000002 - bp_COMSTAT_fDsrHold* = 1'i32 - bm_COMSTAT_fRlsdHold* = 0x00000004 - bp_COMSTAT_fRlsdHold* = 2'i32 - bm_COMSTAT_fXoffHold* = 0x00000008 - bp_COMSTAT_fXoffHold* = 3'i32 - bm_COMSTAT_fXoffSent* = 0x00000010 - bp_COMSTAT_fXoffSent* = 4'i32 - bm_COMSTAT_fEof* = 0x00000020 - bp_COMSTAT_fEof* = 5'i32 - bm_COMSTAT_fTxim* = 0x00000040 - bp_COMSTAT_fTxim* = 6'i32 - bm_COMSTAT_fReserved* = 0xFFFFFF80'i32 - bp_COMSTAT_fReserved* = 7'i32 - -proc fCtsHold*(a: var COMSTAT): DWORD - # should be renamed to get_? -proc set_fCtsHold*(a: var COMSTAT, fCtsHold: DWORD) -proc fDsrHold*(a: var COMSTAT): DWORD -proc set_fDsrHold*(a: var COMSTAT, fDsrHold: DWORD) -proc fRlsdHold*(a: var COMSTAT): DWORD -proc set_fRlsdHold*(a: var COMSTAT, fRlsdHold: DWORD) -proc fXoffHold*(a: var COMSTAT): DWORD -proc set_fXoffHold*(a: var COMSTAT, fXoffHold: DWORD) -proc fXoffSent*(a: var COMSTAT): DWORD -proc set_fXoffSent*(a: var COMSTAT, fXoffSent: DWORD) -proc fEof*(a: var COMSTAT): DWORD -proc set_fEof*(a: var COMSTAT, fEof: DWORD) -proc fTxim*(a: var COMSTAT): DWORD -proc set_fTxim*(a: var COMSTAT, fTxim: DWORD) -proc fReserved*(a: var COMSTAT): DWORD -proc set_fReserved*(a: var COMSTAT, fReserved: DWORD) -type - CONSOLE_CURSOR_INFO* {.final, pure.} = object - dwSize*: DWORD - bVisible*: WINBOOL - - PCONSOLE_CURSOR_INFO* = ptr CONSOLE_CURSOR_INFO - TCONSOLECURSORINFO* = CONSOLE_CURSOR_INFO - TCURSORINFO* = CONSOLE_CURSOR_INFO - COORD* {.final, pure.} = object - X*: SHORT - Y*: SHORT - - TCOORD* = COORD - PCOORD* = ptr COORD - SMALL_RECT* {.final, pure.} = object - Left*: SHORT - Top*: SHORT - Right*: SHORT - Bottom*: SHORT - - TSMALL_RECT* = SMALL_RECT - PSMALL_RECT* = ptr SMALL_RECT - CONSOLE_SCREEN_BUFFER_INFO* {.final, pure.} = object - dwSize*: COORD - dwCursorPosition*: COORD - wAttributes*: int16 - srWindow*: SMALL_RECT - dwMaximumWindowSize*: COORD - - PCONSOLE_SCREEN_BUFFER_INFO* = ptr CONSOLE_SCREEN_BUFFER_INFO - TCONSOLESCREENBUFFERINFO* = CONSOLE_SCREEN_BUFFER_INFO - -when defined(i386): - type - FLOATING_SAVE_AREA* {.final, pure.} = object - ControlWord*: DWORD - StatusWord*: DWORD - TagWord*: DWORD - ErrorOffset*: DWORD - ErrorSelector*: DWORD - DataOffset*: DWORD - DataSelector*: DWORD - RegisterArea*: array[0..79, int8] - Cr0NpxState*: DWORD - - TFLOATINGSAVEAREA* = FLOATING_SAVE_AREA - PFLOATINGSAVEAREA* = ptr FLOATING_SAVE_AREA - CONTEXT* {.final, pure.} = object - ContextFlags*: DWORD - Dr0*: DWORD - Dr1*: DWORD - Dr2*: DWORD - Dr3*: DWORD - Dr6*: DWORD - Dr7*: DWORD - FloatSave*: FLOATING_SAVE_AREA - SegGs*: DWORD - SegFs*: DWORD - SegEs*: DWORD - SegDs*: DWORD - Edi*: DWORD - Esi*: DWORD - Ebx*: DWORD - Edx*: DWORD - Ecx*: DWORD - Eax*: DWORD - Ebp*: DWORD - Eip*: DWORD - SegCs*: DWORD - EFlags*: DWORD - Esp*: DWORD - SegSs*: DWORD - -elif defined(x86_64): - # - # Define 128-bit 16-byte aligned xmm register type. - # - type - M128A* {.final, pure.} = object - Low*: ULONGLONG - High*: LONGLONG - - TM128A* = M128A - PM128A* = TM128A #typedef struct _XMM_SAVE_AREA32 { - XMM_SAVE_AREA32* {.final, pure.} = object - ControlWord*: int16 - StatusWord*: int16 - TagWord*: int8 - Reserved1*: int8 - ErrorOpcode*: int16 - ErrorOffset*: DWORD - ErrorSelector*: int16 - Reserved2*: int16 - DataOffset*: DWORD - DataSelector*: int16 - Reserved3*: int16 - MxCsr*: DWORD - MxCsr_Mask*: DWORD - FloatRegisters*: array[0..7, M128A] - XmmRegisters*: array[0..16, M128A] - Reserved4*: array[0..95, int8] - - TXmmSaveArea* = XMM_SAVE_AREA32 - PXmmSaveArea* = ptr TXmmSaveArea - type - CONTEXT* {.final, pure.} = object - P1Home*: DWORD64 - P2Home*: DWORD64 - P3Home*: DWORD64 - P4Home*: DWORD64 - P5Home*: DWORD64 - P6Home*: DWORD64 # - # Control flags. - # - ContextFlags*: DWORD - MxCsr*: DWORD # - # Segment Registers and processor flags. - # - SegCs*: int16 - SegDs*: int16 - SegEs*: int16 - SegFs*: int16 - SegGs*: int16 - SegSs*: int16 - EFlags*: DWORD # - # Debug registers - # - Dr0*: DWORD64 - Dr1*: DWORD64 - Dr2*: DWORD64 - Dr3*: DWORD64 - Dr6*: DWORD64 - Dr7*: DWORD64 # - # Integer registers. - # - Rax*: DWORD64 - Rcx*: DWORD64 - Rdx*: DWORD64 - Rbx*: DWORD64 - Rsp*: DWORD64 - Rbp*: DWORD64 - Rsi*: DWORD64 - Rdi*: DWORD64 - R8*: DWORD64 - R9*: DWORD64 - R10*: DWORD64 - R11*: DWORD64 - R12*: DWORD64 - R13*: DWORD64 - R14*: DWORD64 - R15*: DWORD64 # - # Program counter. - # - Rip*: DWORD64 # - # Floating point state. - # - FltSave*: XMM_SAVE_AREA32 # MWE: only translated the FltSave part of the union - # - # Vector registers. - # - VectorRegister*: array[0..25, M128A] - VectorControl*: DWORD64 # - # Special debug control registers. - # - DebugControl*: DWORD64 - LastBranchToRip*: DWORD64 - LastBranchFromRip*: DWORD64 - LastExceptionToRip*: DWORD64 - LastExceptionFromRip*: DWORD64 - -elif 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* {.final, pure.} = object - Fpr0*: float64 - Fpr1*: float64 - Fpr2*: float64 - Fpr3*: float64 - Fpr4*: float64 - Fpr5*: float64 - Fpr6*: float64 - Fpr7*: float64 - Fpr8*: float64 - Fpr9*: float64 - Fpr10*: float64 - Fpr11*: float64 - Fpr12*: float64 - Fpr13*: float64 - Fpr14*: float64 - Fpr15*: float64 - Fpr16*: float64 - Fpr17*: float64 - Fpr18*: float64 - Fpr19*: float64 - Fpr20*: float64 - Fpr21*: float64 - Fpr22*: float64 - Fpr23*: float64 - Fpr24*: float64 - Fpr25*: float64 - Fpr26*: float64 - Fpr27*: float64 - Fpr28*: float64 - Fpr29*: float64 - Fpr30*: float64 - Fpr31*: float64 - Fpscr*: float64 - Gpr0*: DWORD - Gpr1*: DWORD - Gpr2*: DWORD - Gpr3*: DWORD - Gpr4*: DWORD - Gpr5*: DWORD - Gpr6*: DWORD - Gpr7*: DWORD - Gpr8*: DWORD - Gpr9*: DWORD - Gpr10*: DWORD - Gpr11*: DWORD - Gpr12*: DWORD - Gpr13*: DWORD - Gpr14*: DWORD - Gpr15*: DWORD - Gpr16*: DWORD - Gpr17*: DWORD - Gpr18*: DWORD - Gpr19*: DWORD - Gpr20*: DWORD - Gpr21*: DWORD - Gpr22*: DWORD - Gpr23*: DWORD - Gpr24*: DWORD - Gpr25*: DWORD - Gpr26*: DWORD - Gpr27*: DWORD - Gpr28*: DWORD - Gpr29*: DWORD - Gpr30*: DWORD - Gpr31*: DWORD - Cr*: DWORD - Xer*: DWORD - Msr*: DWORD - Iar*: DWORD - Lr*: DWORD - Ctr*: DWORD - ContextFlags*: DWORD - Fill*: array[0..2, DWORD] - Dr0*: DWORD - Dr1*: DWORD - Dr2*: DWORD - Dr3*: DWORD - Dr4*: DWORD - Dr5*: DWORD - Dr6*: DWORD - Dr7*: DWORD - -else: - # dummy CONTEXT so that it compiles: - type - CONTEXT* {.final, pure.} = object - data: array [0..255, float64] - -type - LPCONTEXT* = ptr CONTEXT - TCONTEXT* = CONTEXT - PCONTEXT* = ptr CONTEXT - -type - LIST_ENTRY* {.final, pure.} = object - Flink*: ptr LIST_ENTRY - Blink*: ptr LIST_ENTRY - - TLISTENTRY* = LIST_ENTRY - PLISTENTRY* = ptr LIST_ENTRY - CRITICAL_SECTION_DEBUG* {.final, pure.} = object - `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* {.final, pure.} = object - DebugInfo*: ptr CRITICAL_SECTION_DEBUG - LockCount*: int32 - RecursionCount*: int32 - OwningThread*: Handle - LockSemaphore*: Handle - Reserved*: DWORD - - PRTLCriticalSection* = ptr TRTLCriticalSection - - LPCRITICAL_SECTION_DEBUG* = ptr CRITICAL_SECTION_DEBUG - PCRITICAL_SECTION_DEBUG* = ptr CRITICAL_SECTION_DEBUG - TCRITICALSECTIONDEBUG* = CRITICAL_SECTION_DEBUG - TCRITICAL_SECTION* = TRTLCriticalSection - PCRITICAL_SECTION* = PRTLCriticalSection - LPCRITICAL_SECTION* = PRTLCriticalSection - SECURITY_QUALITY_OF_SERVICE* {.final, pure.} = object - len*: DWORD - ImpersonationLevel*: SECURITY_IMPERSONATION_LEVEL - ContextTrackingMode*: WINBOOL - EffectiveOnly*: bool - - PSECURITY_QUALITY_OF_SERVICE* = ptr SECURITY_QUALITY_OF_SERVICE - TSECURITYQUALITYOFSERVICE* = SECURITY_QUALITY_OF_SERVICE - CONVCONTEXT* {.final, pure.} = object - cb*: UINT - wFlags*: UINT - wCountryID*: UINT - iCodePage*: int32 - dwLangID*: DWORD - dwSecurity*: DWORD - qos*: SECURITY_QUALITY_OF_SERVICE - - TCONVCONTEXT* = CONVCONTEXT - PCONVCONTEXT* = ptr CONVCONTEXT - CONVINFO* {.final, pure.} = object - 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 - - TCONVINFO* = CONVINFO - PCONVINFO* = ptr CONVINFO - COPYDATASTRUCT* {.final, pure.} = object - dwData*: DWORD - cbData*: DWORD - lpData*: PVOID - - TCOPYDATASTRUCT* = COPYDATASTRUCT - PCOPYDATASTRUCT* = ptr COPYDATASTRUCT - CPINFO* {.final, pure.} = object - 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* {.final, pure.} = object - idIcon*: int32 - idName*: int32 - idInfo*: int32 - lData*: LONG - - TCPLINFO* = CPLINFO - PCPLINFO* = ptr CPLINFO - CREATE_PROCESS_DEBUG_INFO* {.final, pure.} = object - hFile*: HANDLE - hProcess*: HANDLE - hThread*: HANDLE - lpBaseOfImage*: LPVOID - dwDebugInfoFileOffset*: DWORD - nDebugInfoSize*: DWORD - lpThreadLocalBase*: LPVOID - lpStartAddress*: LPTHREAD_START_ROUTINE - lpImageName*: LPVOID - fUnicode*: int16 - - TCREATEPROCESSDEBUGINFO* = CREATE_PROCESS_DEBUG_INFO - PCREATEPROCESSDEBUGINFO* = ptr CREATE_PROCESS_DEBUG_INFO - CREATE_THREAD_DEBUG_INFO* {.final, pure.} = object - hThread*: HANDLE - lpThreadLocalBase*: LPVOID - lpStartAddress*: LPTHREAD_START_ROUTINE - - TCREATETHREADDEBUGINFO* = CREATE_THREAD_DEBUG_INFO - PCREATETHREADDEBUGINFO* = ptr CREATE_THREAD_DEBUG_INFO - - CURRENCYFMT* {.final, pure.} = object - NumDigits*: UINT - LeadingZero*: UINT - Grouping*: UINT - lpDecimalSep*: LPTSTR - lpThousandSep*: LPTSTR - NegativeOrder*: UINT - PositiveOrder*: UINT - lpCurrencySymbol*: LPTSTR - - Tcurrencyfmt* = CURRENCYFMT - Pcurrencyfmt* = ptr CURRENCYFMT - CURSORSHAPE* {.final, pure.} = object - xHotSpot*: int32 - yHotSpot*: int32 - cx*: int32 - cy*: int32 - cbWidth*: int32 - Planes*: int8 - BitsPixel*: int8 - - LPCURSORSHAPE* = ptr CURSORSHAPE - TCURSORSHAPE* = CURSORSHAPE - PCURSORSHAPE* = ptr CURSORSHAPE - CWPRETSTRUCT* {.final, pure.} = object - lResult*: LRESULT - lParam*: LPARAM - wParam*: WPARAM - message*: DWORD - hwnd*: HWND - - TCWPRETSTRUCT* = CWPRETSTRUCT - PCWPRETSTRUCT* = ptr CWPRETSTRUCT - CWPSTRUCT* {.final, pure.} = object - lParam*: LPARAM - wParam*: WPARAM - message*: UINT - hwnd*: HWND - - TCWPSTRUCT* = CWPSTRUCT - PCWPSTRUCT* = ptr CWPSTRUCT - DATATYPES_INFO_1* {.final, pure.} = object - pName*: LPTSTR - - TDATATYPESINFO1* = DATATYPES_INFO_1 - PDATATYPESINFO1* = ptr DATATYPES_INFO_1 - DDEACK* {.final, pure.} = object - flag0*: int16 - - TDDEACK* = DDEACK - PDDEACK* = ptr DDEACK - -const - bm_DDEACK_bAppReturnCode* = 0x000000FF'i16 - bp_DDEACK_bAppReturnCode* = 0'i16 - bm_DDEACK_reserved* = 0x00003F00'i16 - bp_DDEACK_reserved* = 8'i16 - bm_DDEACK_fBusy* = 0x00004000'i16 - bp_DDEACK_fBusy* = 14'i16 - bm_DDEACK_fAck* = 0x00008000'i16 - bp_DDEACK_fAck* = 15'i16 - -proc bAppReturnCode*(a: var DDEACK): int16 -proc set_bAppReturnCode*(a: var DDEACK, bAppReturnCode: int16) -proc reserved*(a: var DDEACK): int16 -proc set_reserved*(a: var DDEACK, reserved: int16) -proc fBusy*(a: var DDEACK): int16 -proc set_fBusy*(a: var DDEACK, fBusy: int16) -proc fAck*(a: var DDEACK): int16 -proc set_fAck*(a: var DDEACK, fAck: int16) -type - DDEADVISE* {.final, pure.} = object - flag0*: int16 - cfFormat*: SHORT - - TDDEADVISE* = DDEADVISE - PDDEADVISE* = ptr DDEADVISE - -const - bm_DDEADVISE_reserved* = 0x00003FFF'i16 - bp_DDEADVISE_reserved* = 0'i16 - bm_DDEADVISE_fDeferUpd* = 0x00004000'i16 - bp_DDEADVISE_fDeferUpd* = 14'i16 - bm_DDEADVISE_fAckReq* = 0x00008000'i16 - bp_DDEADVISE_fAckReq* = 15'i16 - -proc reserved*(a: var DDEADVISE): int16 -proc set_reserved*(a: var DDEADVISE, reserved: int16) -proc fDeferUpd*(a: var DDEADVISE): int16 -proc set_fDeferUpd*(a: var DDEADVISE, fDeferUpd: int16) -proc fAckReq*(a: var DDEADVISE): int16 -proc set_fAckReq*(a: var DDEADVISE, fAckReq: int16) -type - DDEDATA* {.final, pure.} = object - flag0*: int16 - cfFormat*: SHORT - Value*: array[0..0, int8] - - PDDEDATA* = ptr DDEDATA - -const - bm_DDEDATA_unused* = 0x00000FFF'i16 - bp_DDEDATA_unused* = 0'i16 - bm_DDEDATA_fResponse* = 0x00001000'i16 - bp_DDEDATA_fResponse* = 12'i16 - bm_DDEDATA_fRelease* = 0x00002000'i16 - bp_DDEDATA_fRelease* = 13'i16 - bm_DDEDATA_reserved* = 0x00004000'i16 - bp_DDEDATA_reserved* = 14'i16 - bm_DDEDATA_fAckReq* = 0x00008000'i16 - bp_DDEDATA_fAckReq* = 15'i16 - -proc unused*(a: var DDEDATA): int16 -proc set_unused*(a: var DDEDATA, unused: int16) -proc fResponse*(a: var DDEDATA): int16 -proc set_fResponse*(a: var DDEDATA, fResponse: int16) -proc fRelease*(a: var DDEDATA): int16 -proc set_fRelease*(a: var DDEDATA, fRelease: int16) -proc reserved*(a: var DDEDATA): int16 -proc set_reserved*(a: var DDEDATA, reserved: int16) -proc fAckReq*(a: var DDEDATA): int16 -proc set_fAckReq*(a: var DDEDATA, fAckReq: int16) -type - DDELN* {.final, pure.} = object - flag0*: int16 - cfFormat*: SHORT - - TDDELN* = DDELN - PDDELN* = ptr DDELN - -const - bm_DDELN_unused* = 0x00001FFF'i16 - bp_DDELN_unused* = 0'i16 - bm_DDELN_fRelease* = 0x00002000'i16 - bp_DDELN_fRelease* = 13'i16 - bm_DDELN_fDeferUpd* = 0x00004000'i16 - bp_DDELN_fDeferUpd* = 14'i16 - bm_DDELN_fAckReq* = 0x00008000'i16 - bp_DDELN_fAckReq* = 15'i16 - -proc unused*(a: var DDELN): int16 -proc set_unused*(a: var DDELN, unused: int16) -proc fRelease*(a: var DDELN): int16 -proc set_fRelease*(a: var DDELN, fRelease: int16) -proc fDeferUpd*(a: var DDELN): int16 -proc set_fDeferUpd*(a: var DDELN, fDeferUpd: int16) -proc fAckReq*(a: var DDELN): int16 -proc set_fAckReq*(a: var DDELN, fAckReq: int16) -type - DDEML_MSG_HOOK_DATA* {.final, pure.} = object - uiLo*: UINT - uiHi*: UINT - cbData*: DWORD - Data*: array[0..7, DWORD] - - TDDEMLMSGHOOKDATA* = DDEML_MSG_HOOK_DATA - PDDEMLMSGHOOKDATA* = ptr DDEML_MSG_HOOK_DATA - DDEPOKE* {.final, pure.} = object - flag0*: int16 - cfFormat*: SHORT - Value*: array[0..0, int8] - - TDDEPOKE* = DDEPOKE - PDDEPOKE* = ptr DDEPOKE - -const - bm_DDEPOKE_unused* = 0x00001FFF'i16 - bp_DDEPOKE_unused* = 0'i16 - bm_DDEPOKE_fRelease* = 0x00002000'i16 - bp_DDEPOKE_fRelease* = 13'i16 - bm_DDEPOKE_fReserved* = 0x0000C000'i16 - bp_DDEPOKE_fReserved* = 14'i16 - -proc unused*(a: var DDEPOKE): int16 -proc set_unused*(a: var DDEPOKE, unused: int16) -proc fRelease*(a: var DDEPOKE): int16 -proc set_fRelease*(a: var DDEPOKE, fRelease: int16) -proc fReserved*(a: var DDEPOKE): int16 -proc set_fReserved*(a: var DDEPOKE, fReserved: int16) -type - DDEUP* {.final, pure.} = object - flag0*: int16 - cfFormat*: SHORT - rgb*: array[0..0, int8] - - TDDEUP* = DDEUP - PDDEUP* = ptr DDEUP - -const - bm_DDEUP_unused* = 0x00000FFF'i16 - bp_DDEUP_unused* = 0'i16 - bm_DDEUP_fAck* = 0x00001000'i16 - bp_DDEUP_fAck* = 12'i16 - bm_DDEUP_fRelease* = 0x00002000'i16 - bp_DDEUP_fRelease* = 13'i16 - bm_DDEUP_fReserved* = 0x00004000'i16 - bp_DDEUP_fReserved* = 14'i16 - bm_DDEUP_fAckReq* = 0x00008000'i16 - bp_DDEUP_fAckReq* = 15'i16 - -proc unused*(a: var DDEUP): int16 -proc set_unused*(a: var DDEUP, unused: int16) -proc fAck*(a: var DDEUP): int16 -proc set_fAck*(a: var DDEUP, fAck: int16) -proc fRelease*(a: var DDEUP): int16 -proc set_fRelease*(a: var DDEUP, fRelease: int16) -proc fReserved*(a: var DDEUP): int16 -proc set_fReserved*(a: var DDEUP, fReserved: int16) -proc fAckReq*(a: var DDEUP): int16 -proc set_fAckReq*(a: var DDEUP, fAckReq: int16) -type - EXCEPTION_RECORD* {.final, pure.} = object - ExceptionCode*: DWORD - ExceptionFlags*: DWORD - ExceptionRecord*: ptr EXCEPTION_RECORD - ExceptionAddress*: PVOID - NumberParameters*: DWORD - ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, - ULONG_PTR] - - PEXCEPTION_RECORD* = ptr EXCEPTION_RECORD - TEXCEPTIONRECORD* = EXCEPTION_RECORD - EXCEPTION_DEBUG_INFO* {.final, pure.} = object - ExceptionRecord*: EXCEPTION_RECORD - dwFirstChance*: DWORD - - PEXCEPTION_DEBUG_INFO* = ptr EXCEPTION_DEBUG_INFO - TEXCEPTIONDEBUGINFO* = EXCEPTION_DEBUG_INFO - EXCEPTION_RECORD32* {.final, pure.} = object - ExceptionCode*: DWORD - ExceptionFlags*: DWORD - ExceptionRecord*: DWORD - ExceptionAddress*: DWORD - NumberParameters*: DWORD - ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, DWORD] - - PEXCEPTION_RECORD32* = ptr EXCEPTION_RECORD32 - TExceptionRecord32* = EXCEPTION_RECORD32 - EXCEPTION_DEBUG_INFO32* {.final, pure.} = object - ExceptionRecord*: EXCEPTION_RECORD32 - dwFirstChance*: DWORD - - PEXCEPTION_DEBUG_INFO32* = ptr EXCEPTION_DEBUG_INFO32 - TExceptionDebugInfo32* = EXCEPTION_DEBUG_INFO32 - EXCEPTION_RECORD64* {.final, pure.} = object - ExceptionCode*: DWORD - ExceptionFlags*: DWORD - ExceptionRecord*: DWORD64 - ExceptionAddress*: DWORD64 - NumberParameters*: DWORD - unusedAlignment*: DWORD - ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, DWORD64] - - PEXCEPTION_RECORD64* = ptr EXCEPTION_RECORD64 - TExceptionRecord64* = EXCEPTION_RECORD64 - EXCEPTION_DEBUG_INFO64* {.final, pure.} = object - ExceptionRecord*: EXCEPTION_RECORD64 - dwFirstChance*: DWORD - - PEXCEPTION_DEBUG_INFO64* = ptr EXCEPTION_DEBUG_INFO64 - TExceptionDebugInfo64* = EXCEPTION_DEBUG_INFO64 - EXIT_PROCESS_DEBUG_INFO* {.final, pure.} = object - dwExitCode*: DWORD - - TEXITPROCESSDEBUGINFO* = EXIT_PROCESS_DEBUG_INFO - PEXITPROCESSDEBUGINFO* = ptr EXIT_PROCESS_DEBUG_INFO - EXIT_THREAD_DEBUG_INFO* {.final, pure.} = object - dwExitCode*: DWORD - - TEXITTHREADDEBUGINFO* = EXIT_THREAD_DEBUG_INFO - PEXITTHREADDEBUGINFO* = ptr EXIT_THREAD_DEBUG_INFO - LOAD_DLL_DEBUG_INFO* {.final, pure.} = object - hFile*: HANDLE - lpBaseOfDll*: LPVOID - dwDebugInfoFileOffset*: DWORD - nDebugInfoSize*: DWORD - lpImageName*: LPVOID - fUnicode*: int16 - - TLOADDLLDEBUGINFO* = LOAD_DLL_DEBUG_INFO - PLOADDLLDEBUGINFO* = ptr LOAD_DLL_DEBUG_INFO - UNLOAD_DLL_DEBUG_INFO* {.final, pure.} = object - lpBaseOfDll*: LPVOID - - TUNLOADDLLDEBUGINFO* = UNLOAD_DLL_DEBUG_INFO - PUNLOADDLLDEBUGINFO* = ptr UNLOAD_DLL_DEBUG_INFO - OUTPUT_DEBUG_STRING_INFO* {.final, pure.} = object - lpDebugStringData*: LPSTR - fUnicode*: int16 - nDebugStringLength*: int16 - - TOUTPUTDEBUGSTRINGINFO* = OUTPUT_DEBUG_STRING_INFO - POUTPUTDEBUGSTRINGINFO* = ptr OUTPUT_DEBUG_STRING_INFO - RIP_INFO* {.final, pure.} = object - dwError*: DWORD - dwType*: DWORD - - TRIPINFO* = RIP_INFO - PRIPINFO* = ptr RIP_INFO - DEBUG_EVENT* {.final, pure.} = object - dwDebugEventCode*: DWORD - dwProcessId*: DWORD - dwThreadId*: DWORD - data*: array[0..15, DWORD] - - LPDEBUG_EVENT* = ptr DEBUG_EVENT - TDEBUGEVENT* = DEBUG_EVENT - PDEBUGEVENT* = ptr DEBUG_EVENT - DEBUGHOOKINFO* {.final, pure.} = object - idThread*: DWORD - idThreadInstaller*: DWORD - lParam*: LPARAM - wParam*: WPARAM - code*: int32 - - TDEBUGHOOKINFO* = DEBUGHOOKINFO - PDEBUGHOOKINFO* = ptr DEBUGHOOKINFO - DELETEITEMSTRUCT* {.final, pure.} = object - CtlType*: UINT - CtlID*: UINT - itemID*: UINT - hwndItem*: HWND - itemData*: ULONG_PTR - - TDELETEITEMSTRUCT* = DELETEITEMSTRUCT - PDELETEITEMSTRUCT* = ptr DELETEITEMSTRUCT - DEV_BROADCAST_HDR* {.final, pure.} = object - dbch_size*: ULONG - dbch_devicetype*: ULONG - dbch_reserved*: ULONG - - PDEV_BROADCAST_HDR* = ptr DEV_BROADCAST_HDR - TDEVBROADCASTHDR* = DEV_BROADCAST_HDR - DEV_BROADCAST_OEM* {.final, pure.} = object - dbco_size*: ULONG - dbco_devicetype*: ULONG - dbco_reserved*: ULONG - dbco_identifier*: ULONG - dbco_suppfunc*: ULONG - - PDEV_BROADCAST_OEM* = ptr DEV_BROADCAST_OEM - TDEVBROADCASTOEM* = DEV_BROADCAST_OEM - DEV_BROADCAST_PORT* {.final, pure.} = object - dbcp_size*: ULONG - dbcp_devicetype*: ULONG - dbcp_reserved*: ULONG - dbcp_name*: array[0..0, char] - - PDEV_BROADCAST_PORT* = ptr DEV_BROADCAST_PORT - TDEVBROADCASTPORT* = DEV_BROADCAST_PORT - DEV_BROADCAST_USERDEFINED* {.final, pure.} = object - dbud_dbh*: DEV_BROADCAST_HDR - dbud_szName*: array[0..0, char] - dbud_rgbUserDefined*: array[0..0, int8] - - TDEVBROADCASTUSERDEFINED* = DEV_BROADCAST_USERDEFINED - PDEVBROADCASTUSERDEFINED* = ptr DEV_BROADCAST_USERDEFINED - DEV_BROADCAST_VOLUME* {.final, pure.} = object - dbcv_size*: ULONG - dbcv_devicetype*: ULONG - dbcv_reserved*: ULONG - dbcv_unitmask*: ULONG - dbcv_flags*: USHORT - - PDEV_BROADCAST_VOLUME* = ptr DEV_BROADCAST_VOLUME - TDEVBROADCASTVOLUME* = DEV_BROADCAST_VOLUME - DEVMODE* {.final, pure.} = object - dmDeviceName*: array[0..(CCHDEVICENAME) - 1, BCHAR] - dmSpecVersion*: int16 - dmDriverVersion*: int16 - dmSize*: int16 - dmDriverExtra*: int16 - dmFields*: DWORD - dmOrientation*: int16 - dmPaperSize*: int16 - dmPaperLength*: int16 - dmPaperWidth*: int16 - dmScale*: int16 - dmCopies*: int16 - dmDefaultSource*: int16 - dmPrintQuality*: int16 - dmColor*: int16 - dmDuplex*: int16 - dmYResolution*: int16 - dmTTOption*: int16 - dmCollate*: int16 - dmFormName*: array[0..(CCHFORMNAME) - 1, BCHAR] - dmLogPixels*: int16 - dmBitsPerPel*: DWORD - dmPelsWidth*: DWORD - dmPelsHeight*: DWORD - dmDisplayFlags*: DWORD - dmDisplayFrequency*: DWORD - dmICMMethod*: DWORD - dmICMIntent*: DWORD - dmMediaType*: DWORD - dmDitherType*: DWORD - dmICCManufacturer*: DWORD - dmICCModel*: DWORD # other union part: - # dmPosition: POINTL; - # dmDisplayOrientation: DWORD; - # dmDisplayFixedOutput: DWORD; - - LPDEVMODE* = ptr DEVMODE - devicemode* = DEVMODE - tdevicemode* = DEVMODE - tdevicemodeA* = DEVMODE - PDeviceModeA* = LPDEVMODE - PDeviceMode* = LPDEVMODE - TDEVMODE* = DEVMODE - PDEVMODE* = LPDEVMODE - devmodeW* {.final, pure.} = object - dmDeviceName*: array[0..CCHDEVICENAME - 1, WCHAR] - dmSpecVersion*: int16 - dmDriverVersion*: int16 - dmSize*: int16 - dmDriverExtra*: int16 - dmFields*: DWORD - dmOrientation*: short - dmPaperSize*: short - dmPaperLength*: short - dmPaperWidth*: short - dmScale*: short - dmCopies*: short - dmDefaultSource*: short - dmPrintQuality*: short - dmColor*: short - dmDuplex*: short - dmYResolution*: short - dmTTOption*: short - dmCollate*: short - dmFormName*: array[0..CCHFORMNAME - 1, wchar] - dmLogPixels*: int16 - dmBitsPerPel*: DWORD - dmPelsWidth*: DWORD - dmPelsHeight*: DWORD - dmDisplayFlags*: DWORD - dmDisplayFrequency*: DWORD - dmICMMethod*: DWORD - dmICMIntent*: DWORD - dmMediaType*: DWORD - dmDitherType*: DWORD - dmReserved1*: DWORD - dmReserved2*: DWORD - dmPanningWidth*: DWORD - dmPanningHeight*: DWORD - - LPDEVMODEW* = ptr DEVMODEW - devicemodeW* = DEVMODEW - TDeviceModeW* = DEVMODEW - PDeviceModeW* = LPDEVMODEW - TDEVMODEW* = DEVMODEW - PDEVMODEW* = LPDEVMODEW - DEVNAMES* {.final, pure.} = object - wDriverOffset*: int16 - wDeviceOffset*: int16 - wOutputOffset*: int16 - wDefault*: int16 - - LPDEVNAMES* = ptr DEVNAMES - TDEVNAMES* = DEVNAMES - PDEVNAMES* = ptr DEVNAMES - DIBSECTION* {.final, pure.} = object - dsBm*: BITMAP - dsBmih*: BITMAPINFOHEADER - dsBitfields*: array[0..2, DWORD] - dshSection*: HANDLE - dsOffset*: DWORD - - 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* {.final, pure.} = object - Cylinders*: LARGE_INTEGER - MediaType*: MEDIA_TYPE - TracksPerCylinder*: DWORD - SectorsPerTrack*: DWORD - BytesPerSector*: DWORD - - TDISKGEOMETRY* = DISK_GEOMETRY - PDISKGEOMETRY* = ptr DISK_GEOMETRY - DISK_PERFORMANCE* {.final, pure.} = object - BytesRead*: LARGE_INTEGER - BytesWritten*: LARGE_INTEGER - ReadTime*: LARGE_INTEGER - WriteTime*: LARGE_INTEGER - ReadCount*: DWORD - WriteCount*: DWORD - QueueDepth*: DWORD - - TDISKPERFORMANCE* = DISK_PERFORMANCE - PDISKPERFORMANCE* = ptr DISK_PERFORMANCE - DLGITEMTEMPLATE* {.final, pure.} = object - style*: DWORD - dwExtendedStyle*: DWORD - x*: int16 - y*: int16 - cx*: int16 - cy*: int16 - id*: int16 - - LPDLGITEMTEMPLATE* = ptr DLGITEMTEMPLATE - TDLGITEMTEMPLATE* = DLGITEMTEMPLATE - PDLGITEMTEMPLATE* = ptr DLGITEMTEMPLATE - DLGTEMPLATE* {.final, pure.} = object - style*: DWORD - dwExtendedStyle*: DWORD - cdit*: int16 - x*: int16 - y*: int16 - cx*: int16 - cy*: int16 - - LPDLGTEMPLATE* = ptr DLGTEMPLATE - LPCDLGTEMPLATE* = ptr DLGTEMPLATE - TDLGTEMPLATE* = DLGTEMPLATE - PDLGTEMPLATE* = ptr DLGTEMPLATE - DOC_INFO_1* {.final, pure.} = object - pDocName*: LPTSTR - pOutputFile*: LPTSTR - pDatatype*: LPTSTR - - TDOCINFO1* = DOC_INFO_1 - PDOCINFO1* = ptr DOC_INFO_1 - DOC_INFO_2* {.final, pure.} = object - pDocName*: LPTSTR - pOutputFile*: LPTSTR - pDatatype*: LPTSTR - dwMode*: DWORD - JobId*: DWORD - - TDOCINFO2* = DOC_INFO_2 - PDOCINFO2* = ptr DOC_INFO_2 - DOCINFO* {.final, pure.} = object - cbSize*: int32 - lpszDocName*: LPCTSTR - lpszOutput*: LPCTSTR - lpszDatatype*: LPCTSTR - fwType*: DWORD - - TDOCINFO* = DOCINFO - TDOCINFOA* = DOCINFO - PDOCINFO* = ptr DOCINFO - DRAGLISTINFO* {.final, pure.} = object - uNotification*: UINT - hWnd*: HWND - ptCursor*: POINT - - LPDRAGLISTINFO* = ptr DRAGLISTINFO - TDRAGLISTINFO* = DRAGLISTINFO - PDRAGLISTINFO* = ptr DRAGLISTINFO - DRAWITEMSTRUCT* {.final, pure.} = object - CtlType*: UINT - CtlID*: UINT - itemID*: UINT - itemAction*: UINT - itemState*: UINT - hwndItem*: HWND - hDC*: HDC - rcItem*: RECT - itemData*: ULONG_PTR - - LPDRAWITEMSTRUCT* = ptr DRAWITEMSTRUCT - TDRAWITEMSTRUCT* = DRAWITEMSTRUCT - PDRAWITEMSTRUCT* = ptr DRAWITEMSTRUCT - DRAWTEXTPARAMS* {.final, pure.} = object - cbSize*: UINT - iTabLength*: int32 - iLeftMargin*: int32 - iRightMargin*: int32 - uiLengthDrawn*: UINT - - LPDRAWTEXTPARAMS* = ptr DRAWTEXTPARAMS - TDRAWTEXTPARAMS* = DRAWTEXTPARAMS - PDRAWTEXTPARAMS* = ptr DRAWTEXTPARAMS - PARTITION_INFORMATION* {.final, pure.} = object - PartitionType*: int8 - BootIndicator*: bool - RecognizedPartition*: bool - RewritePartition*: bool - StartingOffset*: LARGE_INTEGER - PartitionLength*: LARGE_INTEGER - HiddenSectors*: LARGE_INTEGER - - TPARTITIONINFORMATION* = PARTITION_INFORMATION - PPARTITIONINFORMATION* = ptr PARTITION_INFORMATION - DRIVE_LAYOUT_INFORMATION* {.final, pure.} = object - PartitionCount*: DWORD - Signature*: DWORD - PartitionEntry*: array[0..0, PARTITION_INFORMATION] - - TDRIVELAYOUTINFORMATION* = DRIVE_LAYOUT_INFORMATION - PDRIVELAYOUTINFORMATION* = ptr DRIVE_LAYOUT_INFORMATION - DRIVER_INFO_1* {.final, pure.} = object - pName*: LPTSTR - - TDRIVERINFO1* = DRIVER_INFO_1 - PDRIVERINFO1* = ptr DRIVER_INFO_1 - DRIVER_INFO_2* {.final, pure.} = object - cVersion*: DWORD - pName*: LPTSTR - pEnvironment*: LPTSTR - pDriverPath*: LPTSTR - pDataFile*: LPTSTR - pConfigFile*: LPTSTR - - TDRIVERINFO2* = DRIVER_INFO_2 - PDRIVERINFO2* = ptr DRIVER_INFO_2 - DRIVER_INFO_3* {.final, pure.} = object - cVersion*: DWORD - pName*: LPTSTR - pEnvironment*: LPTSTR - pDriverPath*: LPTSTR - pDataFile*: LPTSTR - pConfigFile*: LPTSTR - pHelpFile*: LPTSTR - pDependentFiles*: LPTSTR - pMonitorName*: LPTSTR - pDefaultDataType*: LPTSTR - - TDRIVERINFO3* = DRIVER_INFO_3 - PDRIVERINFO3* = ptr DRIVER_INFO_3 - EDITSTREAM* {.final, pure.} = object - dwCookie*: DWORD - dwError*: DWORD - pfnCallback*: EDITSTREAMCALLBACK - - Teditstream* = EDITSTREAM - Peditstream* = ptr EDITSTREAM - EMR* {.final, pure.} = object - iType*: DWORD - nSize*: DWORD - - TEMR* = EMR - PEMR* = ptr EMR - EMRANGLEARC* {.final, pure.} = object - emr*: EMR - ptlCenter*: POINTL - nRadius*: DWORD - eStartAngle*: float32 - eSweepAngle*: float32 - - TEMRANGLEARC* = EMRANGLEARC - PEMRANGLEARC* = ptr EMRANGLEARC - EMRARC* {.final, pure.} = object - emr*: EMR - rclBox*: RECTL - ptlStart*: POINTL - ptlEnd*: POINTL - - 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* {.final, pure.} = object - eM11*: float32 - eM12*: float32 - eM21*: float32 - eM22*: float32 - eDx*: float32 - eDy*: float32 - - LPXFORM* = ptr XFORM - TXFORM* = XFORM - PXFORM* = ptr XFORM - EMRBITBLT* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - xDest*: LONG - yDest*: LONG - cxDest*: LONG - cyDest*: LONG - dwRop*: DWORD - xSrc*: LONG - ySrc*: LONG - xformSrc*: XFORM - crBkColorSrc*: COLORREF - iUsageSrc*: DWORD - offBmiSrc*: DWORD - offBitsSrc*: DWORD - cbBitsSrc*: DWORD - - TEMRBITBLT* = EMRBITBLT - PEMRBITBLT* = ptr EMRBITBLT - LOGBRUSH* {.final, pure.} = object - lbStyle*: UINT - lbColor*: COLORREF - lbHatch*: LONG - - TLOGBRUSH* = LOGBRUSH - PLOGBRUSH* = ptr LOGBRUSH - EMRCREATEBRUSHINDIRECT* {.final, pure.} = object - emr*: EMR - ihBrush*: DWORD - lb*: LOGBRUSH - - TEMRCREATEBRUSHINDIRECT* = EMRCREATEBRUSHINDIRECT - PEMRCREATEBRUSHINDIRECT* = ptr EMRCREATEBRUSHINDIRECT - LCSCSTYPE* = LONG - LCSGAMUTMATCH* = LONG - LOGCOLORSPACE* {.final, pure.} = object - lcsSignature*: DWORD - lcsVersion*: DWORD - lcsSize*: DWORD - lcsCSType*: LCSCSTYPE - lcsIntent*: LCSGAMUTMATCH - lcsEndpoints*: CIEXYZTRIPLE - lcsGammaRed*: DWORD - lcsGammaGreen*: DWORD - lcsGammaBlue*: DWORD - lcsFilename*: array[0..(MAX_PATH) - 1, TCHAR] - - LPLOGCOLORSPACE* = ptr LOGCOLORSPACE - TLOGCOLORSPACE* = LOGCOLORSPACE - TLOGCOLORSPACEA* = LOGCOLORSPACE - PLOGCOLORSPACE* = ptr LOGCOLORSPACE - EMRCREATECOLORSPACE* {.final, pure.} = object - emr*: EMR - ihCS*: DWORD - lcs*: LOGCOLORSPACE - - TEMRCREATECOLORSPACE* = EMRCREATECOLORSPACE - PEMRCREATECOLORSPACE* = ptr EMRCREATECOLORSPACE - EMRCREATEDIBPATTERNBRUSHPT* {.final, pure.} = object - emr*: EMR - ihBrush*: DWORD - iUsage*: DWORD - offBmi*: DWORD - cbBmi*: DWORD - offBits*: DWORD - cbBits*: DWORD - - TEMRCREATEDIBPATTERNBRUSHPT* = EMRCREATEDIBPATTERNBRUSHPT - PEMRCREATEDIBPATTERNBRUSHPT* = EMRCREATEDIBPATTERNBRUSHPT - EMRCREATEMONOBRUSH* {.final, pure.} = object - emr*: EMR - ihBrush*: DWORD - iUsage*: DWORD - offBmi*: DWORD - cbBmi*: DWORD - offBits*: DWORD - cbBits*: DWORD - - TEMRCREATEMONOBRUSH* = EMRCREATEMONOBRUSH - PEMRCREATEMONOBRUSH* = ptr EMRCREATEMONOBRUSH - PALETTEENTRY* {.final, pure.} = object - peRed*: int8 - peGreen*: int8 - peBlue*: int8 - peFlags*: int8 - - LPPALETTEENTRY* = ptr PALETTEENTRY - TPALETTEENTRY* = PALETTEENTRY - PPALETTEENTRY* = ptr PALETTEENTRY - LOGPALETTE* {.final, pure.} = object - palVersion*: int16 - palNumEntries*: int16 - palPalEntry*: array[0..0, PALETTEENTRY] - - LPLOGPALETTE* = ptr LOGPALETTE - NPLOGPALETTE* = ptr LOGPALETTE - TLOGPALETTE* = LOGPALETTE - PLOGPALETTE* = ptr LOGPALETTE - EMRCREATEPALETTE* {.final, pure.} = object - emr*: EMR - ihPal*: DWORD - lgpl*: LOGPALETTE - - TEMRCREATEPALETTE* = EMRCREATEPALETTE - PEMRCREATEPALETTE* = ptr EMRCREATEPALETTE - LOGPEN* {.final, pure.} = object - lopnStyle*: UINT - lopnWidth*: POINT - lopnColor*: COLORREF - - TLOGPEN* = LOGPEN - PLOGPEN* = ptr LOGPEN - EMRCREATEPEN* {.final, pure.} = object - emr*: EMR - ihPen*: DWORD - lopn*: LOGPEN - - TEMRCREATEPEN* = EMRCREATEPEN - PEMRCREATEPEN* = ptr EMRCREATEPEN - EMRELLIPSE* {.final, pure.} = object - emr*: EMR - rclBox*: RECTL - - TEMRELLIPSE* = EMRELLIPSE - PEMRELLIPSE* = ptr EMRELLIPSE - EMRRECTANGLE* = EMRELLIPSE - TEMRRECTANGLE* = EMRELLIPSE - PEMRRECTANGLE* = ptr EMRELLIPSE - EMREOF* {.final, pure.} = object - emr*: EMR - nPalEntries*: DWORD - offPalEntries*: DWORD - nSizeLast*: DWORD - - TEMREOF* = EMREOF - PEMREOF* = ptr EMREOF - EMREXCLUDECLIPRECT* {.final, pure.} = object - emr*: EMR - rclClip*: RECTL - - TEMREXCLUDECLIPRECT* = EMREXCLUDECLIPRECT - PEMREXCLUDECLIPRECT* = ptr EMREXCLUDECLIPRECT - EMRINTERSECTCLIPRECT* = EMREXCLUDECLIPRECT - TEMRINTERSECTCLIPRECT* = EMREXCLUDECLIPRECT - PEMRINTERSECTCLIPRECT* = ptr EMREXCLUDECLIPRECT - PANOSE* {.final, pure.} = object - bFamilyType*: int8 - bSerifStyle*: int8 - bWeight*: int8 - bProportion*: int8 - bContrast*: int8 - bStrokeVariation*: int8 - bArmStyle*: int8 - bLetterform*: int8 - bMidline*: int8 - bXHeight*: int8 - - TPANOSE* = PANOSE - PPANOSE* = ptr PANOSE - EXTLOGFONT* {.final, pure.} = object - elfLogFont*: LOGFONT - elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR] - elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR] - elfVersion*: DWORD - elfStyleSize*: DWORD - elfMatch*: DWORD - elfReserved*: DWORD - elfVendorId*: array[0..(ELF_VENDOR_SIZE) - 1, int8] - elfCulture*: DWORD - elfPanose*: PANOSE - - TEXTLOGFONT* = EXTLOGFONT - PEXTLOGFONT* = ptr EXTLOGFONT - EMREXTCREATEFONTINDIRECTW* {.final, pure.} = object - emr*: EMR - ihFont*: DWORD - elfw*: EXTLOGFONT - - TEMREXTCREATEFONTINDIRECTW* = EMREXTCREATEFONTINDIRECTW - PEMREXTCREATEFONTINDIRECTW* = ptr EMREXTCREATEFONTINDIRECTW - EXTLOGPEN* {.final, pure.} = object - elpPenStyle*: UINT - elpWidth*: UINT - elpBrushStyle*: UINT - elpColor*: COLORREF - elpHatch*: LONG - elpNumEntries*: DWORD - elpStyleEntry*: array[0..0, DWORD] - - TEXTLOGPEN* = EXTLOGPEN - PEXTLOGPEN* = ptr EXTLOGPEN - EMREXTCREATEPEN* {.final, pure.} = object - emr*: EMR - ihPen*: DWORD - offBmi*: DWORD - cbBmi*: DWORD - offBits*: DWORD - cbBits*: DWORD - elp*: EXTLOGPEN - - TEMREXTCREATEPEN* = EMREXTCREATEPEN - PEMREXTCREATEPEN* = ptr EMREXTCREATEPEN - EMREXTFLOODFILL* {.final, pure.} = object - emr*: EMR - ptlStart*: POINTL - crColor*: COLORREF - iMode*: DWORD - - TEMREXTFLOODFILL* = EMREXTFLOODFILL - PEMREXTFLOODFILL* = ptr EMREXTFLOODFILL - EMREXTSELECTCLIPRGN* {.final, pure.} = object - emr*: EMR - cbRgnData*: DWORD - iMode*: DWORD - RgnData*: array[0..0, int8] - - TEMREXTSELECTCLIPRGN* = EMREXTSELECTCLIPRGN - PEMREXTSELECTCLIPRGN* = ptr EMREXTSELECTCLIPRGN - EMRTEXT* {.final, pure.} = object - ptlReference*: POINTL - nChars*: DWORD - offString*: DWORD - fOptions*: DWORD - rcl*: RECTL - offDx*: DWORD - - TEMRTEXT* = EMRTEXT - PEMRTEXT* = ptr EMRTEXT - EMREXTTEXTOUTA* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - iGraphicsMode*: DWORD - exScale*: float32 - eyScale*: float32 - emrtext*: EMRTEXT - - TEMREXTTEXTOUTA* = EMREXTTEXTOUTA - PEMREXTTEXTOUTA* = ptr EMREXTTEXTOUTA - EMREXTTEXTOUTW* = EMREXTTEXTOUTA - TEMREXTTEXTOUTW* = EMREXTTEXTOUTA - PEMREXTTEXTOUTW* = ptr EMREXTTEXTOUTA - EMRFILLPATH* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - - TEMRFILLPATH* = EMRFILLPATH - PEMRFILLPATH* = ptr EMRFILLPATH - EMRSTROKEANDFILLPATH* = EMRFILLPATH - TEMRSTROKEANDFILLPATH* = EMRFILLPATH - PEMRSTROKEANDFILLPATH* = ptr EMRFILLPATH - EMRSTROKEPATH* = EMRFILLPATH - TEMRSTROKEPATH* = EMRFILLPATH - PEMRSTROKEPATH* = ptr EMRFILLPATH - EMRFILLRGN* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - cbRgnData*: DWORD - ihBrush*: DWORD - RgnData*: array[0..0, int8] - - TEMRFILLRGN* = EMRFILLRGN - PEMRFILLRGN* = ptr EMRFILLRGN - EMRFORMAT* {.final, pure.} = object - dSignature*: DWORD - nVersion*: DWORD - cbData*: DWORD - offData*: DWORD - - TEMRFORMAT* = EMRFORMAT - PEMRFORMAT* = ptr EMRFORMAT - - EMRFRAMERGN* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - cbRgnData*: DWORD - ihBrush*: DWORD - szlStroke*: SIZEL - RgnData*: array[0..0, int8] - - TEMRFRAMERGN* = EMRFRAMERGN - PEMRFRAMERGN* = ptr EMRFRAMERGN - EMRGDICOMMENT* {.final, pure.} = object - emr*: EMR - cbData*: DWORD - Data*: array[0..0, int8] - - TEMRGDICOMMENT* = EMRGDICOMMENT - PEMRGDICOMMENT* = ptr EMRGDICOMMENT - EMRINVERTRGN* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - cbRgnData*: DWORD - RgnData*: array[0..0, int8] - - TEMRINVERTRGN* = EMRINVERTRGN - PEMRINVERTRGN* = ptr EMRINVERTRGN - EMRPAINTRGN* = EMRINVERTRGN - TEMRPAINTRGN* = EMRINVERTRGN - PEMRPAINTRGN* = ptr EMRINVERTRGN - EMRLINETO* {.final, pure.} = object - emr*: EMR - ptl*: POINTL - - TEMRLINETO* = EMRLINETO - PEMRLINETO* = ptr EMRLINETO - EMRMOVETOEX* = EMRLINETO - TEMRMOVETOEX* = EMRLINETO - PEMRMOVETOEX* = ptr EMRLINETO - EMRMASKBLT* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - xDest*: LONG - yDest*: LONG - cxDest*: LONG - cyDest*: LONG - dwRop*: DWORD - xSrc*: LONG - ySrc*: LONG - xformSrc*: XFORM - crBkColorSrc*: COLORREF - iUsageSrc*: DWORD - offBmiSrc*: DWORD - cbBmiSrc*: DWORD - offBitsSrc*: DWORD - cbBitsSrc*: DWORD - xMask*: LONG - yMask*: LONG - iUsageMask*: DWORD - offBmiMask*: DWORD - cbBmiMask*: DWORD - offBitsMask*: DWORD - cbBitsMask*: DWORD - - TEMRMASKBLT* = EMRMASKBLT - PEMRMASKBLT* = ptr EMRMASKBLT - EMRMODIFYWORLDTRANSFORM* {.final, pure.} = object - emr*: EMR - xform*: XFORM - iMode*: DWORD - - TEMRMODIFYWORLDTRANSFORM* = EMRMODIFYWORLDTRANSFORM - PEMRMODIFYWORLDTRANSFORM* = EMRMODIFYWORLDTRANSFORM - EMROFFSETCLIPRGN* {.final, pure.} = object - emr*: EMR - ptlOffset*: POINTL - - TEMROFFSETCLIPRGN* = EMROFFSETCLIPRGN - PEMROFFSETCLIPRGN* = ptr EMROFFSETCLIPRGN - EMRPLGBLT* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - aptlDest*: array[0..2, POINTL] - xSrc*: LONG - ySrc*: LONG - cxSrc*: LONG - cySrc*: LONG - xformSrc*: XFORM - crBkColorSrc*: COLORREF - iUsageSrc*: DWORD - offBmiSrc*: DWORD - cbBmiSrc*: DWORD - offBitsSrc*: DWORD - cbBitsSrc*: DWORD - xMask*: LONG - yMask*: LONG - iUsageMask*: DWORD - offBmiMask*: DWORD - cbBmiMask*: DWORD - offBitsMask*: DWORD - cbBitsMask*: DWORD - - TEMRPLGBLT* = EMRPLGBLT - PEMRPLGBLT* = ptr EMRPLGBLT - EMRPOLYDRAW* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - cptl*: DWORD - aptl*: array[0..0, POINTL] - abTypes*: array[0..0, int8] - - TEMRPOLYDRAW* = EMRPOLYDRAW - PEMRPOLYDRAW* = ptr EMRPOLYDRAW - EMRPOLYDRAW16* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - cpts*: DWORD - apts*: array[0..0, POINTS] - abTypes*: array[0..0, int8] - - TEMRPOLYDRAW16* = EMRPOLYDRAW16 - PEMRPOLYDRAW16* = ptr EMRPOLYDRAW16 - EMRPOLYLINE* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - cptl*: DWORD - aptl*: array[0..0, POINTL] - - 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* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - cpts*: DWORD - apts*: array[0..0, POINTL] - - 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* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - nPolys*: DWORD - cptl*: DWORD - aPolyCounts*: array[0..0, DWORD] - aptl*: array[0..0, POINTL] - - TEMRPOLYPOLYLINE* = EMRPOLYPOLYLINE - PEMRPOLYPOLYLINE* = ptr EMRPOLYPOLYLINE - EMRPOLYPOLYGON* = EMRPOLYPOLYLINE - TEMRPOLYPOLYGON* = EMRPOLYPOLYLINE - PEMRPOLYPOLYGON* = ptr EMRPOLYPOLYLINE - EMRPOLYPOLYLINE16* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - nPolys*: DWORD - cpts*: DWORD - aPolyCounts*: array[0..0, DWORD] - apts*: array[0..0, POINTS] - - TEMRPOLYPOLYLINE16* = EMRPOLYPOLYLINE16 - PEMRPOLYPOLYLINE16* = ptr EMRPOLYPOLYLINE16 - EMRPOLYPOLYGON16* = EMRPOLYPOLYLINE16 - TEMRPOLYPOLYGON16* = EMRPOLYPOLYLINE16 - PEMRPOLYPOLYGON16* = ptr EMRPOLYPOLYLINE16 - EMRPOLYTEXTOUTA* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - iGraphicsMode*: DWORD - exScale*: float32 - eyScale*: float32 - cStrings*: LONG - aemrtext*: array[0..0, EMRTEXT] - - TEMRPOLYTEXTOUTA* = EMRPOLYTEXTOUTA - PEMRPOLYTEXTOUTA* = ptr EMRPOLYTEXTOUTA - EMRPOLYTEXTOUTW* = EMRPOLYTEXTOUTA - TEMRPOLYTEXTOUTW* = EMRPOLYTEXTOUTA - PEMRPOLYTEXTOUTW* = ptr EMRPOLYTEXTOUTA - EMRRESIZEPALETTE* {.final, pure.} = object - emr*: EMR - ihPal*: DWORD - cEntries*: DWORD - - TEMRRESIZEPALETTE* = EMRRESIZEPALETTE - PEMRRESIZEPALETTE* = ptr EMRRESIZEPALETTE - EMRRESTOREDC* {.final, pure.} = object - emr*: EMR - iRelative*: LONG - - TEMRRESTOREDC* = EMRRESTOREDC - PEMRRESTOREDC* = ptr EMRRESTOREDC - EMRROUNDRECT* {.final, pure.} = object - emr*: EMR - rclBox*: RECTL - szlCorner*: SIZEL - - TEMRROUNDRECT* = EMRROUNDRECT - PEMRROUNDRECT* = ptr EMRROUNDRECT - EMRSCALEVIEWPORTEXTEX* {.final, pure.} = object - emr*: EMR - xNum*: LONG - xDenom*: LONG - yNum*: LONG - yDenom*: LONG - - TEMRSCALEVIEWPORTEXTEX* = EMRSCALEVIEWPORTEXTEX - PEMRSCALEVIEWPORTEXTEX* = ptr EMRSCALEVIEWPORTEXTEX - EMRSCALEWINDOWEXTEX* = EMRSCALEVIEWPORTEXTEX - TEMRSCALEWINDOWEXTEX* = EMRSCALEVIEWPORTEXTEX - PEMRSCALEWINDOWEXTEX* = ptr EMRSCALEVIEWPORTEXTEX - EMRSELECTCOLORSPACE* {.final, pure.} = object - emr*: EMR - - ihCS*: DWORD - - TEMRSELECTCOLORSPACE* = EMRSELECTCOLORSPACE - PEMRSELECTCOLORSPACE* = ptr EMRSELECTCOLORSPACE - EMRDELETECOLORSPACE* = EMRSELECTCOLORSPACE - TEMRDELETECOLORSPACE* = EMRSELECTCOLORSPACE - PEMRDELETECOLORSPACE* = ptr EMRSELECTCOLORSPACE - EMRSELECTOBJECT* {.final, pure.} = object - emr*: EMR - ihObject*: DWORD - - TEMRSELECTOBJECT* = EMRSELECTOBJECT - PEMRSELECTOBJECT* = ptr EMRSELECTOBJECT - EMRDELETEOBJECT* = EMRSELECTOBJECT - TEMRDELETEOBJECT* = EMRSELECTOBJECT - PEMRDELETEOBJECT* = ptr EMRSELECTOBJECT - EMRSELECTPALETTE* {.final, pure.} = object - emr*: EMR - ihPal*: DWORD - - TEMRSELECTPALETTE* = EMRSELECTPALETTE - PEMRSELECTPALETTE* = ptr EMRSELECTPALETTE - EMRSETARCDIRECTION* {.final, pure.} = object - emr*: EMR - iArcDirection*: DWORD - - TEMRSETARCDIRECTION* = EMRSETARCDIRECTION - PEMRSETARCDIRECTION* = ptr EMRSETARCDIRECTION - EMRSETBKCOLOR* {.final, pure.} = object - emr*: EMR - crColor*: COLORREF - - TEMRSETBKCOLOR* = EMRSETBKCOLOR - PEMRSETBKCOLOR* = ptr EMRSETBKCOLOR - EMRSETTEXTCOLOR* = EMRSETBKCOLOR - TEMRSETTEXTCOLOR* = EMRSETBKCOLOR - PEMRSETTEXTCOLOR* = ptr EMRSETBKCOLOR - EMRSETCOLORADJUSTMENT* {.final, pure.} = object - emr*: EMR - ColorAdjustment*: COLORADJUSTMENT - - TEMRSETCOLORADJUSTMENT* = EMRSETCOLORADJUSTMENT - PEMRSETCOLORADJUSTMENT* = ptr EMRSETCOLORADJUSTMENT - EMRSETDIBITSTODEVICE* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - xDest*: LONG - yDest*: LONG - xSrc*: LONG - ySrc*: LONG - cxSrc*: LONG - cySrc*: LONG - offBmiSrc*: DWORD - cbBmiSrc*: DWORD - offBitsSrc*: DWORD - cbBitsSrc*: DWORD - iUsageSrc*: DWORD - iStartScan*: DWORD - cScans*: DWORD - - TEMRSETDIBITSTODEVICE* = EMRSETDIBITSTODEVICE - PEMRSETDIBITSTODEVICE* = ptr EMRSETDIBITSTODEVICE - EMRSETMAPPERFLAGS* {.final, pure.} = object - emr*: EMR - dwFlags*: DWORD - - TEMRSETMAPPERFLAGS* = EMRSETMAPPERFLAGS - PEMRSETMAPPERFLAGS* = ptr EMRSETMAPPERFLAGS - EMRSETMITERLIMIT* {.final, pure.} = object - emr*: EMR - eMiterLimit*: float32 - - TEMRSETMITERLIMIT* = EMRSETMITERLIMIT - PEMRSETMITERLIMIT* = ptr EMRSETMITERLIMIT - EMRSETPALETTEENTRIES* {.final, pure.} = object - emr*: EMR - ihPal*: DWORD - iStart*: DWORD - cEntries*: DWORD - aPalEntries*: array[0..0, PALETTEENTRY] - - TEMRSETPALETTEENTRIES* = EMRSETPALETTEENTRIES - PEMRSETPALETTEENTRIES* = ptr EMRSETPALETTEENTRIES - EMRSETPIXELV* {.final, pure.} = object - emr*: EMR - ptlPixel*: POINTL - crColor*: COLORREF - - TEMRSETPIXELV* = EMRSETPIXELV - PEMRSETPIXELV* = ptr EMRSETPIXELV - EMRSETVIEWPORTEXTEX* {.final, pure.} = object - emr*: EMR - szlExtent*: SIZEL - - TEMRSETVIEWPORTEXTEX* = EMRSETVIEWPORTEXTEX - PEMRSETVIEWPORTEXTEX* = ptr EMRSETVIEWPORTEXTEX - EMRSETWINDOWEXTEX* = EMRSETVIEWPORTEXTEX - TEMRSETWINDOWEXTEX* = EMRSETVIEWPORTEXTEX - PEMRSETWINDOWEXTEX* = ptr EMRSETVIEWPORTEXTEX - EMRSETVIEWPORTORGEX* {.final, pure.} = object - emr*: EMR - ptlOrigin*: POINTL - - TEMRSETVIEWPORTORGEX* = EMRSETVIEWPORTORGEX - PEMRSETVIEWPORTORGEX* = ptr EMRSETVIEWPORTORGEX - EMRSETWINDOWORGEX* = EMRSETVIEWPORTORGEX - TEMRSETWINDOWORGEX* = EMRSETVIEWPORTORGEX - PEMRSETWINDOWORGEX* = ptr EMRSETVIEWPORTORGEX - EMRSETBRUSHORGEX* = EMRSETVIEWPORTORGEX - TEMRSETBRUSHORGEX* = EMRSETVIEWPORTORGEX - PEMRSETBRUSHORGEX* = ptr EMRSETVIEWPORTORGEX - EMRSETWORLDTRANSFORM* {.final, pure.} = object - emr*: EMR - xform*: XFORM - - TEMRSETWORLDTRANSFORM* = EMRSETWORLDTRANSFORM - PEMRSETWORLDTRANSFORM* = ptr EMRSETWORLDTRANSFORM - EMRSTRETCHBLT* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - xDest*: LONG - yDest*: LONG - cxDest*: LONG - cyDest*: LONG - dwRop*: DWORD - xSrc*: LONG - ySrc*: LONG - xformSrc*: XFORM - crBkColorSrc*: COLORREF - iUsageSrc*: DWORD - offBmiSrc*: DWORD - cbBmiSrc*: DWORD - offBitsSrc*: DWORD - cbBitsSrc*: DWORD - cxSrc*: LONG - cySrc*: LONG - - TEMRSTRETCHBLT* = EMRSTRETCHBLT - PEMRSTRETCHBLT* = ptr EMRSTRETCHBLT - EMRSTRETCHDIBITS* {.final, pure.} = object - emr*: EMR - rclBounds*: RECTL - xDest*: LONG - yDest*: LONG - xSrc*: LONG - ySrc*: LONG - cxSrc*: LONG - cySrc*: LONG - offBmiSrc*: DWORD - cbBmiSrc*: DWORD - offBitsSrc*: DWORD - cbBitsSrc*: DWORD - iUsageSrc*: DWORD - dwRop*: DWORD - cxDest*: LONG - cyDest*: LONG - - TEMRSTRETCHDIBITS* = EMRSTRETCHDIBITS - PEMRSTRETCHDIBITS* = ptr EMRSTRETCHDIBITS - EMRABORTPATH* {.final, pure.} = object - emr*: EMR - - TEMRABORTPATH* = EMRABORTPATH - PEMRABORTPATH* = ptr 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* {.final, pure.} = object - emr*: EMR - iMode*: DWORD - - 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* {.final, pure.} = object - hwndFrom*: HWND - idFrom*: UINT - code*: UINT - - TNMHDR* = NMHDR - PNMHDR* = ptr NMHDR - TENCORRECTTEXT* {.final, pure.} = object - nmhdr*: NMHDR - chrg*: CHARRANGE - seltyp*: int16 - - Pencorrecttext* = ptr TENCORRECTTEXT - TENDROPFILES* {.final, pure.} = object - nmhdr*: NMHDR - hDrop*: HANDLE - cp*: LONG - fProtected*: WINBOOL - - Pendropfiles* = ptr TENDROPFILES - TENSAVECLIPBOARD* {.final, pure.} = object - nmhdr*: NMHDR - cObjectCount*: LONG - cch*: LONG - - PENSAVECLIPBOARD* = ptr TENSAVECLIPBOARD - TENOLEOPFAILED* {.final, pure.} = object - nmhdr*: NMHDR - iob*: LONG - lOper*: LONG - hr*: HRESULT - - PENOLEOPFAILED* = ptr TENOLEOPFAILED - TENHMETAHEADER* {.final, pure.} = object - iType*: DWORD - nSize*: DWORD - rclBounds*: RECTL - rclFrame*: RECTL - dSignature*: DWORD - nVersion*: DWORD - nBytes*: DWORD - nRecords*: DWORD - nHandles*: int16 - sReserved*: int16 - nDescription*: DWORD - offDescription*: DWORD - nPalEntries*: DWORD - szlDevice*: SIZEL - szlMillimeters*: SIZEL - - LPENHMETAHEADER* = ptr TENHMETAHEADER - PENHMETAHEADER* = ptr TENHMETAHEADER - TENHMETARECORD* {.final, pure.} = object - iType*: DWORD - nSize*: DWORD - dParm*: array[0..0, DWORD] - - LPENHMETARECORD* = ptr TENHMETARECORD - PENHMETARECORD* = ptr TENHMETARECORD - TENPROTECTED* {.final, pure.} = object - nmhdr*: NMHDR - msg*: UINT - wParam*: WPARAM - lParam*: LPARAM - chrg*: CHARRANGE - - Penprotected* = ptr TENPROTECTED - SERVICE_STATUS* {.final, pure.} = object - dwServiceType*: DWORD - dwCurrentState*: DWORD - dwControlsAccepted*: DWORD - dwWin32ExitCode*: DWORD - dwServiceSpecificExitCode*: DWORD - dwCheckPoint*: DWORD - dwWaitHint*: DWORD - - LPSERVICE_STATUS* = ptr SERVICE_STATUS - TSERVICESTATUS* = SERVICE_STATUS - PSERVICESTATUS* = ptr SERVICE_STATUS - ENUM_SERVICE_STATUS* {.final, pure.} = object - lpServiceName*: LPTSTR - lpDisplayName*: LPTSTR - ServiceStatus*: SERVICE_STATUS - - LPENUM_SERVICE_STATUS* = ptr ENUM_SERVICE_STATUS - TENUMSERVICESTATUS* = ENUM_SERVICE_STATUS - PENUMSERVICESTATUS* = ptr ENUM_SERVICE_STATUS - ENUMLOGFONT* {.final, pure.} = object - elfLogFont*: LOGFONT - elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR] - elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR] - - TENUMLOGFONT* = ENUMLOGFONT - PENUMLOGFONT* = ptr ENUMLOGFONT - ENUMLOGFONTEX* {.final, pure.} = object - elfLogFont*: LOGFONT - elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR] - elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR] - elfScript*: array[0..(LF_FACESIZE) - 1, BCHAR] - - TENUMLOGFONTEX* = ENUMLOGFONTEX - PENUMLOGFONTEX* = ptr ENUMLOGFONTEX - - EVENTLOGRECORD* {.final, pure.} = object - Length*: DWORD - Reserved*: DWORD - RecordNumber*: DWORD - TimeGenerated*: DWORD - TimeWritten*: DWORD - EventID*: DWORD - EventType*: int16 - NumStrings*: int16 - EventCategory*: int16 - ReservedFlags*: int16 - ClosingRecordNumber*: DWORD - StringOffset*: DWORD - UserSidLength*: DWORD - UserSidOffset*: DWORD - DataLength*: DWORD - DataOffset*: DWORD - - TEVENTLOGRECORD* = EVENTLOGRECORD - PEVENTLOGRECORD* = ptr EVENTLOGRECORD - EVENTMSG* {.final, pure.} = object - message*: UINT - paramL*: UINT - paramH*: UINT - time*: DWORD - hwnd*: HWND - - TEVENTMSG* = EVENTMSG - PEVENTMSG* = ptr EVENTMSG - EXCEPTION_POINTERS* {.final, pure.} = object - ExceptionRecord*: PEXCEPTION_RECORD - ContextRecord*: PCONTEXT - - LPEXCEPTION_POINTERS* = ptr EXCEPTION_POINTERS - PEXCEPTION_POINTERS* = ptr EXCEPTION_POINTERS - TEXCEPTIONPOINTERS* = EXCEPTION_POINTERS - EXT_BUTTON* {.final, pure.} = object - idCommand*: int16 - idsHelp*: int16 - fsStyle*: int16 - - LPEXT_BUTTON* = ptr EXT_BUTTON - TEXTBUTTON* = EXT_BUTTON - PEXTBUTTON* = ptr EXT_BUTTON - FILTERKEYS* {.final, pure.} = object - cbSize*: UINT - dwFlags*: DWORD - iWaitMSec*: DWORD - iDelayMSec*: DWORD - iRepeatMSec*: DWORD - iBounceMSec*: DWORD - - TFILTERKEYS* = FILTERKEYS - PFILTERKEYS* = ptr FILTERKEYS - FIND_NAME_BUFFER* {.final, pure.} = object - len*: UCHAR - access_control*: UCHAR - frame_control*: UCHAR - destination_addr*: array[0..5, UCHAR] - source_addr*: array[0..5, UCHAR] - routing_info*: array[0..17, UCHAR] - - TFINDNAMEBUFFER* = FIND_NAME_BUFFER - PFINDNAMEBUFFER* = ptr FIND_NAME_BUFFER - FIND_NAME_HEADER* {.final, pure.} = object - node_count*: int16 - reserved*: UCHAR - unique_group*: UCHAR - - TFINDNAMEHEADER* = FIND_NAME_HEADER - PFINDNAMEHEADER* = ptr FIND_NAME_HEADER - FINDREPLACE* {.final, pure.} = object - lStructSize*: DWORD - hwndOwner*: HWND - hInstance*: HINST - Flags*: DWORD - lpstrFindWhat*: LPTSTR - lpstrReplaceWith*: LPTSTR - wFindWhatLen*: int16 - wReplaceWithLen*: int16 - lCustData*: LPARAM - lpfnHook*: LPFRHOOKPROC - lpTemplateName*: LPCTSTR - - LPFINDREPLACE* = ptr FINDREPLACE - TFINDREPLACE* = FINDREPLACE - PFINDREPLACE* = ptr FINDREPLACE - #FINDTEXT = record conflicts with FindText function - TFINDTEXT* {.final, pure.} = object - chrg*: CHARRANGE - lpstrText*: LPSTR - - Pfindtext* = ptr TFINDTEXT - FINDTEXTEX* {.final, pure.} = object - chrg*: CHARRANGE - lpstrText*: LPSTR - chrgText*: CHARRANGE - - Tfindtextex* = FINDTEXTEX - Pfindtextex* = ptr FINDTEXTEX - FMS_GETDRIVEINFO* {.final, pure.} = object - 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* {.final, pure.} = object - ftTime*: FILETIME - dwSize*: DWORD - bAttr*: int8 - szName*: array[0..259, TCHAR] - - TFMSGETFILESEL* = FMS_GETFILESEL - PFMSGETFILESEL* = ptr FMS_GETFILESEL - FMS_LOAD* {.final, pure.} = object - dwSize*: DWORD - szMenuName*: array[0..(MENU_TEXT_LEN) - 1, TCHAR] - hMenu*: HMENU - wMenuDelta*: UINT - - TFMSLOAD* = FMS_LOAD - PFMSLOAD* = ptr FMS_LOAD - FMS_TOOLBARLOAD* {.final, pure.} = object - dwSize*: DWORD - lpButtons*: LPEXT_BUTTON - cButtons*: int16 - cBitmaps*: int16 - idBitmap*: int16 - hBitmap*: HBITMAP - - TFMSTOOLBARLOAD* = FMS_TOOLBARLOAD - PFMSTOOLBARLOAD* = ptr FMS_TOOLBARLOAD - FOCUS_EVENT_RECORD* {.final, pure.} = object - bSetFocus*: WINBOOL - - TFOCUSEVENTRECORD* = FOCUS_EVENT_RECORD - PFOCUSEVENTRECORD* = ptr FOCUS_EVENT_RECORD - FORM_INFO_1* {.final, pure.} = object - Flags*: DWORD - pName*: LPTSTR - Size*: SIZEL - ImageableArea*: RECTL - - TFORMINFO1* = FORM_INFO_1 - PFORMINFO1* = ptr FORM_INFO_1 - FORMAT_PARAMETERS* {.final, pure.} = object - MediaType*: MEDIA_TYPE - StartCylinderNumber*: DWORD - EndCylinderNumber*: DWORD - StartHeadNumber*: DWORD - EndHeadNumber*: DWORD - - TFORMATPARAMETERS* = FORMAT_PARAMETERS - PFORMATPARAMETERS* = ptr FORMAT_PARAMETERS - FORMATRANGE* {.final, pure.} = object - hdc*: HDC - hdcTarget*: HDC - rc*: RECT - rcPage*: RECT - chrg*: CHARRANGE - - Tformatrange* = FORMATRANGE - Pformatrange* = ptr FORMATRANGE - GCP_RESULTS* {.final, pure.} = object - 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 - TGCPRESULTS* = GCP_RESULTS - PGCPRESULTS* = ptr GCP_RESULTS - GENERIC_MAPPING* {.final, pure.} = object - GenericRead*: ACCESS_MASK - GenericWrite*: ACCESS_MASK - GenericExecute*: ACCESS_MASK - GenericAll*: ACCESS_MASK - - PGENERIC_MAPPING* = ptr GENERIC_MAPPING - TGENERICMAPPING* = GENERIC_MAPPING - GLYPHMETRICS* {.final, pure.} = object - gmBlackBoxX*: UINT - gmBlackBoxY*: UINT - gmptGlyphOrigin*: POINT - gmCellIncX*: SHORT - gmCellIncY*: SHORT - - LPGLYPHMETRICS* = ptr GLYPHMETRICS - TGLYPHMETRICS* = GLYPHMETRICS - PGLYPHMETRICS* = ptr GLYPHMETRICS - HANDLETABLE* {.final, pure.} = object - objectHandle*: array[0..0, HGDIOBJ] - - THANDLETABLE* = HANDLETABLE - LPHANDLETABLE* = ptr HANDLETABLE - HD_HITTESTINFO* {.final, pure.} = object - pt*: POINT - flags*: UINT - iItem*: int32 - - THDHITTESTINFO* = HD_HITTESTINFO - PHDHITTESTINFO* = ptr HD_HITTESTINFO - HD_ITEM* {.final, pure.} = object - mask*: UINT - cxy*: int32 - pszText*: LPTSTR - hbm*: HBITMAP - cchTextMax*: int32 - fmt*: int32 - lParam*: LPARAM - - THDITEM* = HD_ITEM - PHDITEM* = ptr HD_ITEM - WINDOWPOS* {.final, pure.} = object - hwnd*: HWND - hwndInsertAfter*: HWND - x*: int32 - y*: int32 - cx*: int32 - cy*: int32 - flags*: UINT - - LPWINDOWPOS* = ptr WINDOWPOS - TWINDOWPOS* = WINDOWPOS - PWINDOWPOS* = ptr WINDOWPOS - HD_LAYOUT* {.final, pure.} = object - prc*: ptr RECT - pwpos*: ptr WINDOWPOS - - THDLAYOUT* = HD_LAYOUT - PHDLAYOUT* = ptr HD_LAYOUT - HD_NOTIFY* {.final, pure.} = object - hdr*: NMHDR - iItem*: int32 - iButton*: int32 - pitem*: ptr HD_ITEM - - THDNOTIFY* = HD_NOTIFY - PHDNOTIFY* = ptr HD_NOTIFY - HELPINFO* {.final, pure.} = object - cbSize*: UINT - iContextType*: int32 - iCtrlId*: int32 - hItemHandle*: HANDLE - dwContextId*: DWORD - MousePos*: POINT - - LPHELPINFO* = ptr HELPINFO - THELPINFO* = HELPINFO - PHELPINFO* = ptr HELPINFO - HELPWININFO* {.final, pure.} = object - wStructSize*: int32 - x*: int32 - y*: int32 - dx*: int32 - dy*: int32 - wMax*: int32 - rgchMember*: array[0..1, TCHAR] - - THELPWININFO* = HELPWININFO - PHELPWININFO* = ptr HELPWININFO - HIGHCONTRAST* {.final, pure.} = object - cbSize*: UINT - dwFlags*: DWORD - lpszDefaultScheme*: LPTSTR - - LPHIGHCONTRAST* = ptr HIGHCONTRAST - THIGHCONTRAST* = HIGHCONTRAST - PHIGHCONTRAST* = ptr HIGHCONTRAST - HSZPAIR* {.final, pure.} = object - hszSvc*: HSZ - hszTopic*: HSZ - - THSZPAIR* = HSZPAIR - PHSZPAIR* = ptr HSZPAIR - ICONINFO* {.final, pure.} = object - fIcon*: WINBOOL - xHotspot*: DWORD - yHotspot*: DWORD - hbmMask*: HBITMAP - hbmColor*: HBITMAP - - TICONINFO* = ICONINFO - PICONINFO* = ptr ICONINFO - ICONMETRICS* {.final, pure.} = object - cbSize*: UINT - iHorzSpacing*: int32 - iVertSpacing*: int32 - iTitleWrap*: int32 - lfFont*: LOGFONT - - LPICONMETRICS* = ptr ICONMETRICS - TICONMETRICS* = ICONMETRICS - PICONMETRICS* = ptr ICONMETRICS - IMAGEINFO* {.final, pure.} = object - hbmImage*: HBITMAP - hbmMask*: HBITMAP - Unused1*: int32 - Unused2*: int32 - rcImage*: RECT - - TIMAGEINFO* = IMAGEINFO - PIMAGEINFO* = ptr IMAGEINFO - KEY_EVENT_RECORD* {.final, pure.} = object - bKeyDown*: WINBOOL - wRepeatCount*: int16 - wVirtualKeyCode*: int16 - wVirtualScanCode*: int16 - UnicodeChar*: WCHAR - dwControlKeyState*: DWORD # other union part: AsciiChar: CHAR - - TKEYEVENTRECORD* = KEY_EVENT_RECORD - PKEYEVENTRECORD* = ptr KEY_EVENT_RECORD - MOUSE_EVENT_RECORD* {.final, pure.} = object - dwMousePosition*: COORD - dwButtonState*: DWORD - dwControlKeyState*: DWORD - dwEventFlags*: DWORD - - TMOUSEEVENTRECORD* = MOUSE_EVENT_RECORD - PMOUSEEVENTRECORD* = ptr MOUSE_EVENT_RECORD - WINDOW_BUFFER_SIZE_RECORD* {.final, pure.} = object - dwSize*: COORD - - TWINDOWBUFFERSIZERECORD* = WINDOW_BUFFER_SIZE_RECORD - PWINDOWBUFFERSIZERECORD* = ptr WINDOW_BUFFER_SIZE_RECORD - MENU_EVENT_RECORD* {.final, pure.} = object - dwCommandId*: UINT - - PMENU_EVENT_RECORD* = ptr MENU_EVENT_RECORD - TMENUEVENTRECORD* = MENU_EVENT_RECORD - INPUT_RECORD* {.final, pure.} = object - EventType*: int16 - Reserved*: int16 - event*: array[0..5, DWORD] - - PINPUT_RECORD* = ptr INPUT_RECORD - TINPUTRECORD* = INPUT_RECORD - SYSTEMTIME* {.final, pure.} = object - wYear*: int16 - wMonth*: int16 - wDayOfWeek*: int16 - wDay*: int16 - wHour*: int16 - wMinute*: int16 - wSecond*: int16 - wMilliseconds*: int16 - - LPSYSTEMTIME* = ptr SYSTEMTIME - TSYSTEMTIME* = SYSTEMTIME - PSYSTEMTIME* = ptr SYSTEMTIME - JOB_INFO_1* {.final, pure.} = object - JobId*: DWORD - pPrinterName*: LPTSTR - pMachineName*: LPTSTR - pUserName*: LPTSTR - pDocument*: LPTSTR - pDatatype*: LPTSTR - pStatus*: LPTSTR - Status*: DWORD - Priority*: DWORD - Position*: DWORD - TotalPages*: DWORD - PagesPrinted*: DWORD - Submitted*: SYSTEMTIME - - TJOBINFO1* = JOB_INFO_1 - PJOBINFO1* = ptr JOB_INFO_1 - SID_IDENTIFIER_AUTHORITY* {.final, pure.} = object - Value*: array[0..5, int8] - - LPSID_IDENTIFIER_AUTHORITY* = ptr SID_IDENTIFIER_AUTHORITY - PSID_IDENTIFIER_AUTHORITY* = ptr SID_IDENTIFIER_AUTHORITY - TSIDIDENTIFIERAUTHORITY* = SID_IDENTIFIER_AUTHORITY - SID* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - JobId*: DWORD - pPrinterName*: LPTSTR - pMachineName*: LPTSTR - pUserName*: LPTSTR - pDocument*: LPTSTR - pNotifyName*: LPTSTR - pDatatype*: LPTSTR - pPrintProcessor*: LPTSTR - pParameters*: LPTSTR - pDriverName*: LPTSTR - pDevMode*: LPDEVMODE - pStatus*: LPTSTR - pSecurityDescriptor*: PSECURITY_DESCRIPTOR - Status*: DWORD - Priority*: DWORD - Position*: DWORD - StartTime*: DWORD - UntilTime*: DWORD - TotalPages*: DWORD - Size*: DWORD - Submitted*: SYSTEMTIME - Time*: DWORD - PagesPrinted*: DWORD - - TJOBINFO2* = JOB_INFO_2 - PJOBINFO2* = ptr JOB_INFO_2 - KERNINGPAIR* {.final, pure.} = object - wFirst*: int16 - wSecond*: int16 - iKernAmount*: int32 - - LPKERNINGPAIR* = ptr KERNINGPAIR - TKERNINGPAIR* = KERNINGPAIR - PKERNINGPAIR* = ptr KERNINGPAIR - LANA_ENUM* {.final, pure.} = object - len*: UCHAR - lana*: array[0..(MAX_LANA) - 1, UCHAR] - - TLANAENUM* = LANA_ENUM - PLANAENUM* = ptr LANA_ENUM - LDT_ENTRY* {.final, pure.} = object - LimitLow*: int16 - BaseLow*: int16 - BaseMid*: int8 - Flags1*: int8 - Flags2*: int8 - BaseHi*: int8 - - LPLDT_ENTRY* = ptr LDT_ENTRY - PLDT_ENTRY* = ptr LDT_ENTRY - TLDTENTRY* = LDT_ENTRY - -const - bm_LDT_ENTRY_BaseMid* = 0x000000FF - bp_LDT_ENTRY_BaseMid* = 0'i32 - bm_LDT_ENTRY_Type* = 0x00001F00 - bp_LDT_ENTRY_Type* = 8'i32 - bm_LDT_ENTRY_Dpl* = 0x00006000 - bp_LDT_ENTRY_Dpl* = 13'i32 - bm_LDT_ENTRY_Pres* = 0x00008000 - bp_LDT_ENTRY_Pres* = 15'i32 - bm_LDT_ENTRY_LimitHi* = 0x000F0000 - bp_LDT_ENTRY_LimitHi* = 16'i32 - bm_LDT_ENTRY_Sys* = 0x00100000 - bp_LDT_ENTRY_Sys* = 20'i32 - bm_LDT_ENTRY_Reserved_0* = 0x00200000 - bp_LDT_ENTRY_Reserved_0* = 21'i32 - bm_LDT_ENTRY_Default_Big* = 0x00400000 - bp_LDT_ENTRY_Default_Big* = 22'i32 - bm_LDT_ENTRY_Granularity* = 0x00800000 - bp_LDT_ENTRY_Granularity* = 23'i32 - bm_LDT_ENTRY_BaseHi* = 0xFF000000 - bp_LDT_ENTRY_BaseHi* = 24'i32 - -type - LOCALESIGNATURE* {.final, pure.} = object - lsUsb*: array[0..3, DWORD] - lsCsbDefault*: array[0..1, DWORD] - lsCsbSupported*: array[0..1, DWORD] - - TLOCALESIGNATURE* = LOCALESIGNATURE - PLOCALESIGNATURE* = ptr LOCALESIGNATURE - LOCALGROUP_MEMBERS_INFO_0* {.final, pure.} = object - lgrmi0_sid*: PSID - - TLOCALGROUPMEMBERSINFO0* = LOCALGROUP_MEMBERS_INFO_0 - PLOCALGROUPMEMBERSINFO0* = ptr LOCALGROUP_MEMBERS_INFO_0 - LOCALGROUP_MEMBERS_INFO_3* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - mask*: UINT - fmt*: int32 - cx*: int32 - pszText*: LPTSTR - cchTextMax*: int32 - iSubItem*: int32 - - TLVCOLUMN* = LV_COLUMN - PLVCOLUMN* = ptr LV_COLUMN - LV_ITEM* {.final, pure.} = object - 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* {.final, pure.} = object - hdr*: NMHDR - item*: LV_ITEM - - TLVDISPINFO* = LV_DISPINFO - PLVDISPINFO* = ptr LV_DISPINFO - LV_FINDINFO* {.final, pure.} = object - flags*: UINT - psz*: LPCTSTR - lParam*: LPARAM - pt*: POINT - vkDirection*: UINT - - TLVFINDINFO* = LV_FINDINFO - PLVFINDINFO* = ptr LV_FINDINFO - LV_HITTESTINFO* {.final, pure.} = object - pt*: POINT - flags*: UINT - iItem*: int32 - - TLVHITTESTINFO* = LV_HITTESTINFO - PLVHITTESTINFO* = ptr LV_HITTESTINFO - LV_KEYDOWN* {.final, pure.} = object - hdr*: NMHDR - wVKey*: int16 - flags*: UINT - - TLVKEYDOWN* = LV_KEYDOWN - PLVKEYDOWN* = ptr LV_KEYDOWN - MAT2* {.final, pure.} = object - eM11*: FIXED - eM12*: FIXED - eM21*: FIXED - eM22*: FIXED - - TMAT2* = MAT2 - PMAT2* = ptr MAT2 - MDICREATESTRUCT* {.final, pure.} = object - szClass*: LPCTSTR - szTitle*: LPCTSTR - hOwner*: HANDLE - x*: int32 - y*: int32 - cx*: int32 - cy*: int32 - style*: DWORD - lParam*: LPARAM - - LPMDICREATESTRUCT* = ptr MDICREATESTRUCT - TMDICREATESTRUCT* = MDICREATESTRUCT - PMDICREATESTRUCT* = ptr MDICREATESTRUCT - MEASUREITEMSTRUCT* {.final, pure.} = object - CtlType*: UINT - CtlID*: UINT - itemID*: UINT - itemWidth*: UINT - itemHeight*: UINT - itemData*: ULONG_PTR - - LPMEASUREITEMSTRUCT* = ptr MEASUREITEMSTRUCT - TMEASUREITEMSTRUCT* = MEASUREITEMSTRUCT - PMEASUREITEMSTRUCT* = ptr MEASUREITEMSTRUCT - MEMORY_BASIC_INFORMATION* {.final, pure.} = object - BaseAddress*: PVOID - AllocationBase*: PVOID - AllocationProtect*: DWORD - RegionSize*: DWORD - State*: DWORD - Protect*: DWORD - `type`*: DWORD - - PMEMORY_BASIC_INFORMATION* = ptr MEMORY_BASIC_INFORMATION - TMEMORYBASICINFORMATION* = MEMORY_BASIC_INFORMATION - MEMORYSTATUS* {.final, pure.} = object - dwLength*: DWORD - dwMemoryLoad*: DWORD - dwTotalPhys*: int - dwAvailPhys*: int - dwTotalPageFile*: int - dwAvailPageFile*: int - dwTotalVirtual*: int - dwAvailVirtual*: int - - TGUID* {.final, pure.} = object - D1*: int32 - D2*: int16 - D3*: int16 - D4*: array [0..7, int8] - - LPMEMORYSTATUS* = ptr MEMORYSTATUS - TMEMORYSTATUS* = MEMORYSTATUS - PMEMORYSTATUS* = ptr MEMORYSTATUS - MENUEX_TEMPLATE_HEADER* {.final, pure.} = object - wVersion*: int16 - wOffset*: int16 - dwHelpId*: DWORD - - TMENUXTEMPLATEHEADER* = MENUEX_TEMPLATE_HEADER - PMENUXTEMPLATEHEADER* = ptr MENUEX_TEMPLATE_HEADER - MENUEX_TEMPLATE_ITEM* {.final, pure.} = object - 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* {.final, pure.} = object - cbSize*: DWORD - fMask*: DWORD - dwStyle*: DWORD - cyMax*: UINT - hbrBack*: HBRUSH - dwContextHelpID*: DWORD - dwMenuData*: ULONG_PTR - - LPMENUINFO* = ptr MENUINFO - LPCMENUINFO* = ptr MENUINFO - TMENUINFO* = MENUINFO - PMENUINFO* = ptr MENUINFO - MENUITEMINFO* {.final, pure.} = object - 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 - TMENUITEMINFO* = MENUITEMINFO - TMENUITEMINFOA* = MENUITEMINFO - PMENUITEMINFO* = ptr MENUITEMINFO - MENUITEMTEMPLATE* {.final, pure.} = object - mtOption*: int16 - mtID*: int16 - mtString*: array[0..0, WCHAR] - - TMENUITEMTEMPLATE* = MENUITEMTEMPLATE - PMENUITEMTEMPLATE* = ptr MENUITEMTEMPLATE - MENUITEMTEMPLATEHEADER* {.final, pure.} = object - versionNumber*: int16 - offset*: int16 - - TMENUITEMTEMPLATEHEADER* = MENUITEMTEMPLATEHEADER - PMENUITEMTEMPLATEHEADER* = ptr MENUITEMTEMPLATEHEADER - MENUTEMPLATE* {.final, pure.} = object - LPMENUTEMPLATE* = ptr MENUTEMPLATE - TMENUTEMPLATE* = MENUTEMPLATE - PMENUTEMPLATE* = ptr MENUTEMPLATE - METAFILEPICT* {.final, pure.} = object - mm*: LONG - xExt*: LONG - yExt*: LONG - hMF*: HMETAFILE - - LPMETAFILEPICT* = ptr METAFILEPICT - TMETAFILEPICT* = METAFILEPICT - PMETAFILEPICT* = ptr METAFILEPICT - METAHEADER* {.final, pure.} = object - mtType*: int16 - mtHeaderSize*: int16 - mtVersion*: int16 - mtSize*: DWORD - mtNoObjects*: int16 - mtMaxRecord*: DWORD - mtNoParameters*: int16 - - TMETAHEADER* = METAHEADER - PMETAHEADER* = ptr METAHEADER - METARECORD* {.final, pure.} = object - rdSize*: DWORD - rdFunction*: int16 - rdParm*: array[0..0, int16] - - LPMETARECORD* = ptr METARECORD - TMETARECORD* = METARECORD - PMETARECORD* = ptr METARECORD - MINIMIZEDMETRICS* {.final, pure.} = object - cbSize*: UINT - iWidth*: int32 - iHorzGap*: int32 - iVertGap*: int32 - iArrange*: int32 - - LPMINIMIZEDMETRICS* = ptr MINIMIZEDMETRICS - TMINIMIZEDMETRICS* = MINIMIZEDMETRICS - PMINIMIZEDMETRICS* = ptr MINIMIZEDMETRICS - MINMAXINFO* {.final, pure.} = object - ptReserved*: POINT - ptMaxSize*: POINT - ptMaxPosition*: POINT - ptMinTrackSize*: POINT - ptMaxTrackSize*: POINT - - TMINMAXINFO* = MINMAXINFO - PMINMAXINFO* = ptr MINMAXINFO - MODEMDEVCAPS* {.final, pure.} = object - dwActualSize*: DWORD - dwRequiredSize*: DWORD - dwDevSpecificOffset*: DWORD - dwDevSpecificSize*: DWORD - dwModemProviderVersion*: DWORD - dwModemManufacturerOffset*: DWORD - dwModemManufacturerSize*: DWORD - dwModemModelOffset*: DWORD - dwModemModelSize*: DWORD - dwModemVersionOffset*: DWORD - dwModemVersionSize*: DWORD - dwDialOptions*: DWORD - dwCallSetupFailTimer*: DWORD - dwInactivityTimeout*: DWORD - dwSpeakerVolume*: DWORD - dwSpeakerMode*: DWORD - dwModemOptions*: DWORD - dwMaxDTERate*: DWORD - dwMaxDCERate*: DWORD - abVariablePortion*: array[0..0, int8] - - LPMODEMDEVCAPS* = ptr MODEMDEVCAPS - TMODEMDEVCAPS* = MODEMDEVCAPS - PMODEMDEVCAPS* = ptr MODEMDEVCAPS - MODEMSETTINGS* {.final, pure.} = object - dwActualSize*: DWORD - dwRequiredSize*: DWORD - dwDevSpecificOffset*: DWORD - dwDevSpecificSize*: DWORD - dwCallSetupFailTimer*: DWORD - dwInactivityTimeout*: DWORD - dwSpeakerVolume*: DWORD - dwSpeakerMode*: DWORD - dwPreferredModemOptions*: DWORD - dwNegotiatedModemOptions*: DWORD - dwNegotiatedDCERate*: DWORD - abVariablePortion*: array[0..0, int8] - - LPMODEMSETTINGS* = ptr MODEMSETTINGS - TMODEMSETTINGS* = MODEMSETTINGS - PMODEMSETTINGS* = ptr MODEMSETTINGS - MONCBSTRUCT* {.final, pure.} = object - 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] - - TMONCBSTRUCT* = MONCBSTRUCT - PMONCBSTRUCT* = ptr MONCBSTRUCT - MONCONVSTRUCT* {.final, pure.} = object - cb*: UINT - fConnect*: WINBOOL - dwTime*: DWORD - hTask*: HANDLE - hszSvc*: HSZ - hszTopic*: HSZ - hConvClient*: HCONV - hConvServer*: HCONV - - TMONCONVSTRUCT* = MONCONVSTRUCT - PMONCONVSTRUCT* = ptr MONCONVSTRUCT - MONERRSTRUCT* {.final, pure.} = object - cb*: UINT - wLastError*: UINT - dwTime*: DWORD - hTask*: HANDLE - - TMONERRSTRUCT* = MONERRSTRUCT - PMONERRSTRUCT* = ptr MONERRSTRUCT - MONHSZSTRUCT* {.final, pure.} = object - cb*: UINT - fsAction*: WINBOOL - dwTime*: DWORD - hsz*: HSZ - hTask*: HANDLE - str*: array[0..0, TCHAR] - - TMONHSZSTRUCT* = MONHSZSTRUCT - PMONHSZSTRUCT* = ptr MONHSZSTRUCT - MONITOR_INFO_1* {.final, pure.} = object - pName*: LPTSTR - - TMONITORINFO1* = MONITOR_INFO_1 - PMONITORINFO1* = ptr MONITOR_INFO_1 - MONITOR_INFO_2* {.final, pure.} = object - pName*: LPTSTR - pEnvironment*: LPTSTR - pDLLName*: LPTSTR - - TMONITORINFO2* = MONITOR_INFO_2 - PMONITORINFO2* = ptr MONITOR_INFO_2 - MONLINKSTRUCT* {.final, pure.} = object - cb*: UINT - dwTime*: DWORD - hTask*: HANDLE - fEstablished*: WINBOOL - fNoData*: WINBOOL - hszSvc*: HSZ - hszTopic*: HSZ - hszItem*: HSZ - wFmt*: UINT - fServer*: WINBOOL - hConvServer*: HCONV - hConvClient*: HCONV - - TMONLINKSTRUCT* = MONLINKSTRUCT - PMONLINKSTRUCT* = ptr MONLINKSTRUCT - MONMSGSTRUCT* {.final, pure.} = object - cb*: UINT - hwndTo*: HWND - dwTime*: DWORD - hTask*: HANDLE - wMsg*: UINT - wParam*: WPARAM - lParam*: LPARAM - dmhd*: DDEML_MSG_HOOK_DATA - - TMONMSGSTRUCT* = MONMSGSTRUCT - PMONMSGSTRUCT* = ptr MONMSGSTRUCT - MOUSEHOOKSTRUCT* {.final, pure.} = object - pt*: POINT - hwnd*: HWND - wHitTestCode*: UINT - dwExtraInfo*: DWORD - - LPMOUSEHOOKSTRUCT* = ptr MOUSEHOOKSTRUCT - TMOUSEHOOKSTRUCT* = MOUSEHOOKSTRUCT - PMOUSEHOOKSTRUCT* = ptr MOUSEHOOKSTRUCT - MOUSEKEYS* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - nmhdr*: NMHDR - msg*: UINT - wParam*: WPARAM - lParam*: LPARAM - - Tmsgfilter* = MSGFILTER - Pmsgfilter* = ptr MSGFILTER - MULTIKEYHELP* {.final, pure.} = object - mkSize*: DWORD - mkKeylist*: TCHAR - szKeyphrase*: array[0..0, TCHAR] - - TMULTIKEYHELP* = MULTIKEYHELP - PMULTIKEYHELP* = ptr MULTIKEYHELP - NAME_BUFFER* {.final, pure.} = object - name*: array[0..(NCBNAMSZ) - 1, UCHAR] - name_num*: UCHAR - name_flags*: UCHAR - - TNAMEBUFFER* = NAME_BUFFER - PNAMEBUFFER* = ptr NAME_BUFFER - p_NCB* = ptr NCB - NCB* {.final, pure.} = object - ncb_command*: UCHAR - ncb_retcode*: UCHAR - ncb_lsn*: UCHAR - ncb_num*: UCHAR - ncb_buffer*: PUCHAR - ncb_length*: int16 - ncb_callname*: array[0..(NCBNAMSZ) - 1, UCHAR] - ncb_name*: array[0..(NCBNAMSZ) - 1, UCHAR] - ncb_rto*: UCHAR - ncb_sto*: UCHAR - ncb_post*: proc (para1: p_NCB){.CDECL.} - ncb_lana_num*: UCHAR - ncb_cmd_cplt*: UCHAR - ncb_reserve*: array[0..9, UCHAR] - ncb_event*: HANDLE - - TNCB* = NCB - NCCALCSIZE_PARAMS* {.final, pure.} = object - rgrc*: array[0..2, RECT] - lppos*: PWINDOWPOS - - TNCCALCSIZEPARAMS* = NCCALCSIZE_PARAMS - PNCCALCSIZEPARAMS* = ptr NCCALCSIZE_PARAMS - NDDESHAREINFO* {.final, pure.} = object - lRevision*: LONG - lpszShareName*: LPTSTR - lShareType*: LONG - lpszAppTopicList*: LPTSTR - fSharedFlag*: LONG - fService*: LONG - fStartAppFlag*: LONG - nCmdShow*: LONG - qModifyId*: array[0..1, LONG] - cNumItems*: LONG - lpszItemList*: LPTSTR - - TNDDESHAREINFO* = NDDESHAREINFO - PNDDESHAREINFO* = ptr NDDESHAREINFO - NETRESOURCE* {.final, pure.} = object - dwScope*: DWORD - dwType*: DWORD - dwDisplayType*: DWORD - dwUsage*: DWORD - lpLocalName*: LPTSTR - lpRemoteName*: LPTSTR - lpComment*: LPTSTR - lpProvider*: LPTSTR - - LPNETRESOURCE* = ptr NETRESOURCE - TNETRESOURCE* = NETRESOURCE - TNETRESOURCEA* = NETRESOURCE - PNETRESOURCE* = ptr NETRESOURCE - PNETRESOURCEA* = ptr NETRESOURCE - NEWCPLINFO* {.final, pure.} = object - dwSize*: DWORD - dwFlags*: DWORD - dwHelpContext*: DWORD - lData*: LONG - hIcon*: HICON - szName*: array[0..31, TCHAR] - szInfo*: array[0..63, TCHAR] - szHelpFile*: array[0..127, TCHAR] - - TNEWCPLINFO* = NEWCPLINFO - PNEWCPLINFO* = ptr NEWCPLINFO - NEWTEXTMETRIC* {.final, pure.} = object - tmHeight*: LONG - tmAscent*: LONG - tmDescent*: LONG - tmInternalLeading*: LONG - tmExternalLeading*: LONG - tmAveCharWidth*: LONG - tmMaxCharWidth*: LONG - tmWeight*: LONG - tmOverhang*: LONG - tmDigitizedAspectX*: LONG - tmDigitizedAspectY*: LONG - tmFirstChar*: BCHAR - tmLastChar*: BCHAR - tmDefaultChar*: BCHAR - tmBreakChar*: BCHAR - tmItalic*: int8 - tmUnderlined*: int8 - tmStruckOut*: int8 - tmPitchAndFamily*: int8 - tmCharSet*: int8 - ntmFlags*: DWORD - ntmSizeEM*: UINT - ntmCellHeight*: UINT - ntmAvgWidth*: UINT - - TNEWTEXTMETRIC* = NEWTEXTMETRIC - PNEWTEXTMETRIC* = ptr NEWTEXTMETRIC - NEWTEXTMETRICEX* {.final, pure.} = object - ntmentm*: NEWTEXTMETRIC - ntmeFontSignature*: FONTSIGNATURE - - TNEWTEXTMETRICEX* = NEWTEXTMETRICEX - PNEWTEXTMETRICEX* = ptr NEWTEXTMETRICEX - NM_LISTVIEW* {.final, pure.} = object - hdr*: NMHDR - iItem*: int32 - iSubItem*: int32 - uNewState*: UINT - uOldState*: UINT - uChanged*: UINT - ptAction*: POINT - lParam*: LPARAM - - TNMLISTVIEW* = NM_LISTVIEW - PNMLISTVIEW* = ptr NM_LISTVIEW - TV_ITEM* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - hdr*: NMHDR - iPos*: int32 - iDelta*: int32 - - TNMUPDOWN* = NM_UPDOWNW - PNMUPDOWN* = ptr NM_UPDOWNW - NONCLIENTMETRICS* {.final, pure.} = object - 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 - TNONCLIENTMETRICS* = NONCLIENTMETRICS - PNONCLIENTMETRICS* = ptr NONCLIENTMETRICS - SERVICE_ADDRESS* {.final, pure.} = object - dwAddressType*: DWORD - dwAddressFlags*: DWORD - dwAddressLength*: DWORD - dwPrincipalLength*: DWORD - lpAddress*: ptr int8 - lpPrincipal*: ptr int8 - - TSERVICEADDRESS* = SERVICE_ADDRESS - PSERVICEADDRESS* = ptr SERVICE_ADDRESS - SERVICE_ADDRESSES* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - dwNameSpace*: DWORD - ServiceInfo*: SERVICE_INFO - - TNSSERVICEINFO* = NS_SERVICE_INFO - PNSSERVICEINFO* = ptr NS_SERVICE_INFO - NUMBERFMT* {.final, pure.} = object - NumDigits*: UINT - LeadingZero*: UINT - Grouping*: UINT - lpDecimalSep*: LPTSTR - lpThousandSep*: LPTSTR - NegativeOrder*: UINT - - Tnumberfmt* = NUMBERFMT - Pnumberfmt* = ptr NUMBERFMT - OFSTRUCT* {.final, pure.} = object - cBytes*: int8 - fFixedDisk*: int8 - nErrCode*: int16 - Reserved1*: int16 - Reserved2*: int16 - szPathName*: array[0..(OFS_MAXPATHNAME) - 1, CHAR] - - LPOFSTRUCT* = ptr OFSTRUCT - TOFSTRUCT* = OFSTRUCT - POFSTRUCT* = ptr OFSTRUCT - OPENFILENAME_NT4* {.final, pure.} = object - lStructSize*: DWORD - hwndOwner*: HWND - hInstance*: HINST - lpstrFilter*: LPCTSTR - lpstrCustomFilter*: LPTSTR - nMaxCustFilter*: DWORD - nFilterIndex*: DWORD - lpstrFile*: LPTSTR - nMaxFile*: DWORD - lpstrFileTitle*: LPTSTR - nMaxFileTitle*: DWORD - lpstrInitialDir*: LPCTSTR - lpstrTitle*: LPCTSTR - Flags*: DWORD - nFileOffset*: int16 - nFileExtension*: int16 - lpstrDefExt*: LPCTSTR - lCustData*: LPARAM - lpfnHook*: LPOFNHOOKPROC - lpTemplateName*: LPCTSTR - - LPOPENFILENAME_NT4* = ptr OPENFILENAME_NT4 - TOPENFILENAME_NT4* = OPENFILENAME_NT4 - POPENFILENAME_NT4* = ptr OPENFILENAME_NT4 - TOPENFILENAME* {.final, pure.} = object - lStructSize*: DWORD - hwndOwner*: HWND - hInstance*: HINST - lpstrFilter*: LPCTSTR - lpstrCustomFilter*: LPTSTR - nMaxCustFilter*: DWORD - nFilterIndex*: DWORD - lpstrFile*: LPTSTR - nMaxFile*: DWORD - lpstrFileTitle*: LPTSTR - nMaxFileTitle*: DWORD - lpstrInitialDir*: LPCTSTR - lpstrTitle*: LPCTSTR - Flags*: DWORD - nFileOffset*: int16 - nFileExtension*: int16 - lpstrDefExt*: LPCTSTR - lCustData*: LPARAM - lpfnHook*: LPOFNHOOKPROC - lpTemplateName*: LPCTSTR - pvReserved*: pointer - dwreserved*: dword - FlagsEx*: dword - - LPOPENFILENAME* = ptr TOPENFILENAME - POPENFILENAME* = ptr TOPENFILENAME - OFN* = TOPENFILENAME - POFN* = ptr TOPENFILENAME - OFNOTIFY* {.final, pure.} = object - hdr*: NMHDR - lpOFN*: LPOPENFILENAME - pszFile*: LPTSTR - - LPOFNOTIFY* = ptr OFNOTIFY - TOFNOTIFY* = OFNOTIFY - POFNOTIFY* = ptr OFNOTIFY - OSVERSIONINFO* {.final, pure.} = object - dwOSVersionInfoSize*: DWORD - dwMajorVersion*: DWORD - dwMinorVersion*: DWORD - dwBuildNumber*: DWORD - dwPlatformId*: DWORD - szCSDVersion*: array[0..127, TCHAR] - - LPOSVERSIONINFO* = ptr OSVERSIONINFO - TOSVERSIONINFO* = OSVERSIONINFO - POSVERSIONINFO* = ptr OSVERSIONINFO - OSVERSIONINFOW* {.final, pure.} = object - dwOSVersionInfoSize*: DWORD - dwMajorVersion*: DWORD - dwMinorVersion*: DWORD - dwBuildNumber*: DWORD - dwPlatformId*: DWORD - szCSDVersion*: array[0..127, WCHAR] - - LPOSVERSIONINFOW* = ptr OSVERSIONINFOW - TOSVERSIONINFOW* = OSVERSIONINFOW - POSVERSIONINFOW* = ptr OSVERSIONINFOW - TEXTMETRIC* {.final, pure.} = object - tmHeight*: LONG - tmAscent*: LONG - tmDescent*: LONG - tmInternalLeading*: LONG - tmExternalLeading*: LONG - tmAveCharWidth*: LONG - tmMaxCharWidth*: LONG - tmWeight*: LONG - tmOverhang*: LONG - tmDigitizedAspectX*: LONG - tmDigitizedAspectY*: LONG - tmFirstChar*: BCHAR - tmLastChar*: BCHAR - tmDefaultChar*: BCHAR - tmBreakChar*: BCHAR - tmItalic*: int8 - tmUnderlined*: int8 - tmStruckOut*: int8 - tmPitchAndFamily*: int8 - tmCharSet*: int8 - - LPTEXTMETRIC* = ptr TEXTMETRIC - TTEXTMETRIC* = TEXTMETRIC - PTEXTMETRIC* = ptr TEXTMETRIC - TEXTMETRICW* {.final, pure.} = object - tmHeight*: LONG - tmAscent*: LONG - tmDescent*: LONG - tmInternalLeading*: LONG - tmExternalLeading*: LONG - tmAveCharWidth*: LONG - tmMaxCharWidth*: LONG - tmWeight*: LONG - tmOverhang*: LONG - tmDigitizedAspectX*: LONG - tmDigitizedAspectY*: LONG - tmFirstChar*: WCHAR - tmLastChar*: WCHAR - tmDefaultChar*: WCHAR - tmBreakChar*: WCHAR - tmItalic*: int8 - tmUnderlined*: int8 - tmStruckOut*: int8 - tmPitchAndFamily*: int8 - tmCharSet*: int8 - - LPTEXTMETRICW* = ptr TEXTMETRICW - TTEXTMETRICW* = TEXTMETRICW - PTEXTMETRICW* = ptr TEXTMETRICW - OUTLINETEXTMETRIC* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - lStructSize*: DWORD - hwndOwner*: HWND - hDevMode*: HGLOBAL - hDevNames*: HGLOBAL - Flags*: DWORD - ptPaperSize*: POINT - rtMinMargin*: RECT - rtMargin*: RECT - hInstance*: HINST - lCustData*: LPARAM - lpfnPageSetupHook*: LPPAGESETUPHOOK - lpfnPagePaintHook*: LPPAGEPAINTHOOK - lpPageSetupTemplateName*: LPCTSTR - hPageSetupTemplate*: HGLOBAL - - LPPAGESETUPDLG* = ptr TPAGESETUPDLG - PPAGESETUPDLG* = ptr TPAGESETUPDLG - TPSD* = TPAGESETUPDLG - PPSD* = ptr TPAGESETUPDLG - PAINTSTRUCT* {.final, pure.} = object - hdc*: HDC - fErase*: WINBOOL - rcPaint*: RECT - fRestore*: WINBOOL - fIncUpdate*: WINBOOL - rgbReserved*: array[0..31, int8] - - LPPAINTSTRUCT* = ptr PAINTSTRUCT - TPAINTSTRUCT* = PAINTSTRUCT - PPAINTSTRUCT* = ptr PAINTSTRUCT - PARAFORMAT* {.final, pure.} = object - 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* {.final, pure.} = object - ByteLength*: DWORD - - TPERFCOUNTERBLOCK* = PERF_COUNTER_BLOCK - PPERFCOUNTERBLOCK* = ptr PERF_COUNTER_BLOCK - PERF_COUNTER_DEFINITION* {.final, pure.} = object - ByteLength*: DWORD - CounterNameTitleIndex*: DWORD - CounterNameTitle*: LPWSTR - CounterHelpTitleIndex*: DWORD - CounterHelpTitle*: LPWSTR - DefaultScale*: DWORD - DetailLevel*: DWORD - CounterType*: DWORD - CounterSize*: DWORD - CounterOffset*: DWORD - - TPERFCOUNTERDEFINITION* = PERF_COUNTER_DEFINITION - PPERFCOUNTERDEFINITION* = ptr PERF_COUNTER_DEFINITION - PERF_DATA_BLOCK* {.final, pure.} = object - Signature*: array[0..3, WCHAR] - LittleEndian*: DWORD - Version*: DWORD - Revision*: DWORD - TotalByteLength*: DWORD - HeaderLength*: DWORD - NumObjectTypes*: DWORD - DefaultObject*: DWORD - SystemTime*: SYSTEMTIME - PerfTime*: LARGE_INTEGER - PerfFreq*: LARGE_INTEGER - PerfTime100nSec*: LARGE_INTEGER - SystemNameLength*: DWORD - SystemNameOffset*: DWORD - - TPERFDATABLOCK* = PERF_DATA_BLOCK - PPERFDATABLOCK* = ptr PERF_DATA_BLOCK - PERF_INSTANCE_DEFINITION* {.final, pure.} = object - ByteLength*: DWORD - ParentObjectTitleIndex*: DWORD - ParentObjectInstance*: DWORD - UniqueID*: DWORD - NameOffset*: DWORD - NameLength*: DWORD - - TPERFINSTANCEDEFINITION* = PERF_INSTANCE_DEFINITION - PPERFINSTANCEDEFINITION* = PERF_INSTANCE_DEFINITION - PERF_OBJECT_TYPE* {.final, pure.} = object - TotalByteLength*: DWORD - DefinitionLength*: DWORD - HeaderLength*: DWORD - ObjectNameTitleIndex*: DWORD - ObjectNameTitle*: LPWSTR - ObjectHelpTitleIndex*: DWORD - ObjectHelpTitle*: LPWSTR - DetailLevel*: DWORD - NumCounters*: DWORD - DefaultCounter*: DWORD - NumInstances*: DWORD - CodePage*: DWORD - PerfTime*: LARGE_INTEGER - PerfFreq*: LARGE_INTEGER - - TPERFOBJECTTYPE* = PERF_OBJECT_TYPE - PPERFOBJECTTYPE* = ptr PERF_OBJECT_TYPE - POLYTEXT* {.final, pure.} = object - x*: int32 - y*: int32 - n*: UINT - lpstr*: LPCTSTR - uiFlags*: UINT - rcl*: RECT - pdx*: ptr int32 - - TPOLYTEXT* = POLYTEXT - PPOLYTEXT* = ptr POLYTEXT - PORT_INFO_1* {.final, pure.} = object - pName*: LPTSTR - - TPORTINFO1* = PORT_INFO_1 - PPORTINFO1* = ptr PORT_INFO_1 - PORT_INFO_2* {.final, pure.} = object - pPortName*: LPSTR - pMonitorName*: LPSTR - pDescription*: LPSTR - fPortType*: DWORD - Reserved*: DWORD - - TPORTINFO2* = PORT_INFO_2 - PPORTINFO2* = ptr PORT_INFO_2 - PREVENT_MEDIA_REMOVAL* {.final, pure.} = object - PreventMediaRemoval*: bool - - TPREVENTMEDIAREMOVAL* = PREVENT_MEDIA_REMOVAL - PPREVENTMEDIAREMOVAL* = ptr PREVENT_MEDIA_REMOVAL - #PRINTDLG = record conflicts with PrintDlg function - TPRINTDLG* {.final, pure.} = object - lStructSize*: DWORD - hwndOwner*: HWND - hDevMode*: HANDLE - hDevNames*: HANDLE - hDC*: HDC - Flags*: DWORD - nFromPage*: int16 - nToPage*: int16 - nMinPage*: int16 - nMaxPage*: int16 - nCopies*: int16 - hInstance*: HINST - lCustData*: DWORD - lpfnPrintHook*: LPPRINTHOOKPROC - lpfnSetupHook*: LPSETUPHOOKPROC - lpPrintTemplateName*: LPCTSTR - lpSetupTemplateName*: LPCTSTR - hPrintTemplate*: HANDLE - hSetupTemplate*: HANDLE - - LPPRINTDLG* = ptr TPRINTDLG - PPRINTDLG* = ptr TPRINTDLG - TPD* = TPRINTDLG - PPD* = ptr TPRINTDLG - PRINTER_DEFAULTS* {.final, pure.} = object - pDatatype*: LPTSTR - pDevMode*: LPDEVMODE - DesiredAccess*: ACCESS_MASK - - TPRINTERDEFAULTS* = PRINTER_DEFAULTS - PPRINTERDEFAULTS* = ptr PRINTER_DEFAULTS - PRINTER_INFO_1* {.final, pure.} = object - Flags*: DWORD - pDescription*: LPTSTR - pName*: LPTSTR - pComment*: LPTSTR - - LPPRINTER_INFO_1* = ptr PRINTER_INFO_1 - PPRINTER_INFO_1* = ptr PRINTER_INFO_1 - TPRINTERINFO1* = PRINTER_INFO_1 - PRINTER_INFO_2* {.final, pure.} = object - pServerName*: LPTSTR - pPrinterName*: LPTSTR - pShareName*: LPTSTR - pPortName*: LPTSTR - pDriverName*: LPTSTR - pComment*: LPTSTR - pLocation*: LPTSTR - pDevMode*: LPDEVMODE - pSepFile*: LPTSTR - pPrintProcessor*: LPTSTR - pDatatype*: LPTSTR - pParameters*: LPTSTR - pSecurityDescriptor*: PSECURITY_DESCRIPTOR - Attributes*: DWORD - Priority*: DWORD - DefaultPriority*: DWORD - StartTime*: DWORD - UntilTime*: DWORD - Status*: DWORD - cJobs*: DWORD - AveragePPM*: DWORD - - TPRINTERINFO2* = PRINTER_INFO_2 - PPRINTERINFO2* = ptr PRINTER_INFO_2 - PRINTER_INFO_3* {.final, pure.} = object - pSecurityDescriptor*: PSECURITY_DESCRIPTOR - - TPRINTERINFO3* = PRINTER_INFO_3 - PPRINTERINFO3* = ptr PRINTER_INFO_3 - PRINTER_INFO_4* {.final, pure.} = object - pPrinterName*: LPTSTR - pServerName*: LPTSTR - Attributes*: DWORD - - TPRINTERINFO4* = PRINTER_INFO_4 - PPRINTERINFO4* = ptr PRINTER_INFO_4 - PRINTER_INFO_5* {.final, pure.} = object - pPrinterName*: LPTSTR - pPortName*: LPTSTR - Attributes*: DWORD - DeviceNotSelectedTimeout*: DWORD - TransmissionRetryTimeout*: DWORD - - TPRINTERINFO5* = PRINTER_INFO_5 - PPRINTERINFO5* = ptr PRINTER_INFO_5 - PRINTER_NOTIFY_INFO_DATA* {.final, pure.} = object - `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* {.final, pure.} = object - 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* {.final, pure.} = object - `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* {.final, pure.} = object - Version*: DWORD - Flags*: DWORD - Count*: DWORD - pTypes*: PPRINTER_NOTIFY_OPTIONS_TYPE - - TPRINTERNOTIFYOPTIONS* = PRINTER_NOTIFY_OPTIONS - PPRINTERNOTIFYOPTIONS* = ptr PRINTER_NOTIFY_OPTIONS - PRINTPROCESSOR_INFO_1* {.final, pure.} = object - pName*: LPTSTR - - TPRINTPROCESSORINFO1* = PRINTPROCESSOR_INFO_1 - PPRINTPROCESSORINFO1* = ptr PRINTPROCESSOR_INFO_1 - PRIVILEGE_SET* {.final, pure.} = object - PrivilegeCount*: DWORD - Control*: DWORD - Privilege*: array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES] - - LPPRIVILEGE_SET* = ptr PRIVILEGE_SET - PPRIVILEGE_SET* = ptr PRIVILEGE_SET - TPRIVILEGESET* = PRIVILEGE_SET - PROCESS_HEAPENTRY* {.final, pure.} = object - lpData*: PVOID - cbData*: DWORD - cbOverhead*: int8 - iRegionIndex*: int8 - wFlags*: int16 - dwCommittedSize*: DWORD - dwUnCommittedSize*: DWORD - lpFirstBlock*: LPVOID - lpLastBlock*: LPVOID - hMem*: HANDLE - - LPPROCESS_HEAP_ENTRY* = ptr PROCESS_HEAPENTRY - TPROCESSHEAPENTRY* = PROCESS_HEAPENTRY - PPROCESSHEAPENTRY* = ptr PROCESS_HEAPENTRY - PROCESS_INFORMATION* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - lpemptyrecord* = ptr emptyrecord - HPROPSHEETPAGE* = ptr emptyrecord - PROPSHEETHEADER* {.final, pure.} = object - dwSize*: DWORD - dwFlags*: DWORD - hwndParent*: HWND - hInstance*: HINST - pszIcon*: LPCTSTR - pszCaption*: LPCTSTR - nPages*: 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* {.final, pure.} = object - 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* {.final, pure.} = object - pName*: LPTSTR - pEnvironment*: LPTSTR - pDLLName*: LPTSTR - - TPROVIDORINFO1* = PROVIDOR_INFO_1 - PPROVIDORINFO1* = ptr PROVIDOR_INFO_1 - PSHNOTIFY* {.final, pure.} = object - hdr*: NMHDR - lParam*: LPARAM - - LPPSHNOTIFY* = ptr PSHNOTIFY - TPSHNOTIFY* = PSHNOTIFY - PPSHNOTIFY* = ptr PSHNOTIFY - PUNCTUATION* {.final, pure.} = object - iSize*: UINT - szPunctuation*: LPSTR - - Tpunctuation* = PUNCTUATION - Ppunctuation* = ptr PUNCTUATION - TQUERY_SERVICE_CONFIG* {.final, pure.} = object - dwServiceType*: DWORD - dwStartType*: DWORD - dwErrorControl*: DWORD - lpBinaryPathName*: LPTSTR - lpLoadOrderGroup*: LPTSTR - dwTagId*: DWORD - lpDependencies*: LPTSTR - lpServiceStartName*: LPTSTR - lpDisplayName*: LPTSTR - - LPQUERY_SERVICE_CONFIG* = ptr TQUERY_SERVICE_CONFIG - PQUERYSERVICECONFIG* = ptr TQUERY_SERVICE_CONFIG - TQUERY_SERVICE_LOCK_STATUS* {.final, pure.} = object - fIsLocked*: DWORD - lpLockOwner*: LPTSTR - dwLockDuration*: DWORD - - LPQUERY_SERVICE_LOCK_STATUS* = ptr TQUERY_SERVICE_LOCK_STATUS - PQUERYSERVICELOCKSTATUS* = ptr TQUERY_SERVICE_LOCK_STATUS - RASAMB* {.final, pure.} = object - dwSize*: DWORD - dwError*: DWORD - szNetBiosError*: array[0..(NETBIOS_NAME_LEN + 1) - 1, TCHAR] - bLana*: int8 - - TRASAMB* = RASAMB - PRASAMB* = ptr RASAMB - RASCONN* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - dwSize*: DWORD - dwfOptions*: DWORD - hwndParent*: HWND - reserved*: DWORD - - TRASDIALEXTENSIONS* = RASDIALEXTENSIONS - PRASDIALEXTENSIONS* = ptr RASDIALEXTENSIONS - RASDIALPARAMS* {.final, pure.} = object - 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* {.final, pure.} = object - dwSize*: DWORD - szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, TCHAR] - - TRASENTRYNAME* = RASENTRYNAME - PRASENTRYNAME* = ptr RASENTRYNAME - RASPPPIP* {.final, pure.} = object - dwSize*: DWORD - dwError*: DWORD - szIpAddress*: array[0..(RAS_MaxIpAddress + 1) - 1, TCHAR] - - TRASPPPIP* = RASPPPIP - PRASPPPIP* = ptr RASPPPIP - RASPPPIPX* {.final, pure.} = object - dwSize*: DWORD - dwError*: DWORD - szIpxAddress*: array[0..(RAS_MaxIpxAddress + 1) - 1, TCHAR] - - TRASPPPIPX* = RASPPPIPX - PRASPPPIPX* = ptr RASPPPIPX - RASPPPNBF* {.final, pure.} = object - 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* {.final, pure.} = object - nSize*: short - wFlags*: short - nLanguageID*: short - - LPRASTERIZER_STATUS* = ptr RASTERIZER_STATUS - TRASTERIZERSTATUS* = RASTERIZER_STATUS - PRASTERIZERSTATUS* = ptr RASTERIZER_STATUS - REASSIGN_BLOCKS* {.final, pure.} = object - Reserved*: int16 - Count*: int16 - BlockNumber*: array[0..0, DWORD] - - TREASSIGNBLOCKS* = REASSIGN_BLOCKS - PREASSIGNBLOCKS* = ptr REASSIGN_BLOCKS - REMOTE_NAME_INFO* {.final, pure.} = object - lpUniversalName*: LPTSTR - lpConnectionName*: LPTSTR - lpRemainingPath*: LPTSTR - - TREMOTENAMEINFO* = REMOTE_NAME_INFO - PREMOTENAMEINFO* = ptr REMOTE_NAME_INFO - - REPASTESPECIAL* {.final, pure.} = object - dwAspect*: DWORD - dwParam*: DWORD - - Trepastespecial* = REPASTESPECIAL - Prepastespecial* = ptr REPASTESPECIAL - REQRESIZE* {.final, pure.} = object - nmhdr*: NMHDR - rc*: RECT - - Treqresize* = REQRESIZE - Preqresize* = ptr REQRESIZE - RGNDATAHEADER* {.final, pure.} = object - dwSize*: DWORD - iType*: DWORD - nCount*: DWORD - nRgnSize*: DWORD - rcBound*: RECT - - TRGNDATAHEADER* = RGNDATAHEADER - PRGNDATAHEADER* = ptr RGNDATAHEADER - RGNDATA* {.final, pure.} = object - rdh*: RGNDATAHEADER - Buffer*: array[0..0, char] - - LPRGNDATA* = ptr RGNDATA - TRGNDATA* = RGNDATA - PRGNDATA* = ptr RGNDATA - SCROLLINFO* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - nmhdr*: NMHDR - chrg*: CHARRANGE - seltyp*: int16 - - Tselchange* = SELCHANGE - Pselchange* = ptr SELCHANGE - SERIALKEYS* {.final, pure.} = object - cbSize*: DWORD - dwFlags*: DWORD - lpszActivePort*: LPSTR - lpszPort*: LPSTR - iBaudRate*: DWORD - iPortState*: DWORD - - LPSERIALKEYS* = ptr SERIALKEYS - TSERIALKEYS* = SERIALKEYS - PSERIALKEYS* = ptr SERIALKEYS - SERVICE_TABLE_ENTRY* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - lsn*: UCHAR - state*: UCHAR - local_name*: array[0..(NCBNAMSZ) - 1, UCHAR] - remote_name*: array[0..(NCBNAMSZ) - 1, UCHAR] - rcvs_outstanding*: UCHAR - sends_outstanding*: UCHAR - - TSESSIONBUFFER* = SESSION_BUFFER - PSESSIONBUFFER* = ptr SESSION_BUFFER - SESSION_HEADER* {.final, pure.} = object - sess_name*: UCHAR - num_sess*: UCHAR - rcv_dg_outstanding*: UCHAR - rcv_any_outstanding*: UCHAR - - TSESSIONHEADER* = SESSION_HEADER - PSESSIONHEADER* = ptr SESSION_HEADER - SET_PARTITION_INFORMATION* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - 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 - TSHGDN* = SHGNO - SHNAMEMAPPING* {.final, pure.} = object - pszOldPath*: LPSTR - pszNewPath*: LPSTR - cchOldPath*: int32 - cchNewPath*: int32 - - LPSHNAMEMAPPING* = ptr SHNAMEMAPPING - TSHNAMEMAPPING* = SHNAMEMAPPING - PSHNAMEMAPPING* = ptr SHNAMEMAPPING - SID_AND_ATTRIBUTES* {.final, pure.} = object - 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* {.final, pure.} = object - Next*: ptr SINGLE_LIST_ENTRY - - TSINGLELISTENTRY* = SINGLE_LIST_ENTRY - PSINGLELISTENTRY* = ptr SINGLE_LIST_ENTRY - SOUNDSENTRY* {.final, pure.} = object - 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 - TSOUNDSENTRY* = SOUNDSENTRY - PSOUNDSENTRY* = ptr SOUNDSENTRY - STARTUPINFO* {.final, pure.} = object - cb*: DWORD - lpReserved*: LPTSTR - lpDesktop*: LPTSTR - lpTitle*: LPTSTR - dwX*: DWORD - dwY*: DWORD - dwXSize*: DWORD - dwYSize*: DWORD - dwXCountChars*: DWORD - dwYCountChars*: DWORD - dwFillAttribute*: DWORD - dwFlags*: DWORD - wShowWindow*: int16 - cbReserved2*: int16 - lpReserved2*: LPBYTE - hStdInput*: HANDLE - hStdOutput*: HANDLE - hStdError*: HANDLE - - LPSTARTUPINFO* = ptr STARTUPINFO - TSTARTUPINFO* = STARTUPINFO - PSTARTUPINFO* = ptr STARTUPINFO - STICKYKEYS* {.final, pure.} = object - cbSize*: DWORD - dwFlags*: DWORD - - LPSTICKYKEYS* = ptr STICKYKEYS - TSTICKYKEYS* = STICKYKEYS - PSTICKYKEYS* = ptr STICKYKEYS - STRRET* {.final, pure.} = object - uType*: UINT - cStr*: array[0..(MAX_PATH) - 1, char] - - LPSTRRET* = ptr STRRET - TSTRRET* = STRRET - PSTRRET* = ptr STRRET - STYLEBUF* {.final, pure.} = object - dwStyle*: DWORD - szDescription*: array[0..31, CHAR] - - LPSTYLEBUF* = ptr STYLEBUF - TSTYLEBUF* = STYLEBUF - PSTYLEBUF* = ptr STYLEBUF - STYLESTRUCT* {.final, pure.} = object - styleOld*: DWORD - styleNew*: DWORD - - LPSTYLESTRUCT* = ptr STYLESTRUCT - TSTYLESTRUCT* = STYLESTRUCT - PSTYLESTRUCT* = ptr STYLESTRUCT - SYSTEM_AUDIT_ACE* {.final, pure.} = object - Header*: ACE_HEADER - Mask*: ACCESS_MASK - SidStart*: DWORD - - TSYSTEMAUDITACE* = SYSTEM_AUDIT_ACE - PSYSTEMAUDITACE* = ptr SYSTEM_AUDIT_ACE - SYSTEM_INFO* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - `type`*: ULONG - - TTAPEERASE* = TAPE_ERASE - PTAPEERASE* = ptr TAPE_ERASE - TAPE_GET_DRIVE_PARAMETERS* {.final, pure.} = object - ECC*: bool - Compression*: bool - DataPadding*: bool - ReportSetmarks*: bool - DefaultBlockSize*: ULONG - MaximumBlockSize*: ULONG - MinimumBlockSize*: ULONG - MaximumPartitionCount*: ULONG - FeaturesLow*: ULONG - FeaturesHigh*: ULONG - EOTWarningZoneSize*: ULONG - - TTAPEGETDRIVEPARAMETERS* = TAPE_GET_DRIVE_PARAMETERS - PTAPEGETDRIVEPARAMETERS* = ptr TAPE_GET_DRIVE_PARAMETERS - TAPE_GET_MEDIA_PARAMETERS* {.final, pure.} = object - Capacity*: LARGE_INTEGER - Remaining*: LARGE_INTEGER - BlockSize*: DWORD - PartitionCount*: DWORD - WriteProtected*: bool - - TTAPEGETMEDIAPARAMETERS* = TAPE_GET_MEDIA_PARAMETERS - PTAPEGETMEDIAPARAMETERS* = ptr TAPE_GET_MEDIA_PARAMETERS - TAPE_GET_POSITION* {.final, pure.} = object - `type`*: ULONG - Partition*: ULONG - OffsetLow*: ULONG - OffsetHigh*: ULONG - - TTAPEGETPOSITION* = TAPE_GET_POSITION - PTAPEGETPOSITION* = ptr TAPE_GET_POSITION - TAPE_PREPARE* {.final, pure.} = object - Operation*: ULONG - - TTAPEPREPARE* = TAPE_PREPARE - PTAPEPREPARE* = ptr TAPE_PREPARE - TAPE_SET_DRIVE_PARAMETERS* {.final, pure.} = object - 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* {.final, pure.} = object - BlockSize*: ULONG - - TTAPESETMEDIAPARAMETERS* = TAPE_SET_MEDIA_PARAMETERS - PTAPESETMEDIAPARAMETERS* = ptr TAPE_SET_MEDIA_PARAMETERS - TAPE_SET_POSITION* {.final, pure.} = object - `Method`*: ULONG - Partition*: ULONG - OffsetLow*: ULONG - OffsetHigh*: ULONG - - TTAPESETPOSITION* = TAPE_SET_POSITION - PTAPESETPOSITION* = ptr TAPE_SET_POSITION - TAPE_WRITE_MARKS* {.final, pure.} = object - `type`*: ULONG - Count*: ULONG - - TTAPEWRITEMARKS* = TAPE_WRITE_MARKS - PTAPEWRITEMARKS* = ptr TAPE_WRITE_MARKS - TTBADDBITMAP* {.final, pure.} = object - hInst*: HINST - nID*: UINT - - LPTBADDBITMAP* = ptr TTBADDBITMAP - PTBADDBITMAP* = ptr TTBADDBITMAP - TBBUTTON* {.final, pure.} = object - iBitmap*: int32 - idCommand*: int32 - fsState*: int8 - fsStyle*: int8 - dwData*: DWORD - iString*: int32 - - LPTBBUTTON* = ptr TBBUTTON - LPCTBBUTTON* = ptr TBBUTTON - TTBBUTTON* = TBBUTTON - PTBBUTTON* = ptr TBBUTTON - TBNOTIFY* {.final, pure.} = object - hdr*: NMHDR - iItem*: int32 - tbButton*: TBBUTTON - cchText*: int32 - pszText*: LPTSTR - - LPTBNOTIFY* = ptr TBNOTIFY - TTBNOTIFY* = TBNOTIFY - PTBNOTIFY* = ptr TBNOTIFY - TBSAVEPARAMS* {.final, pure.} = object - hkr*: HKEY - pszSubKey*: LPCTSTR - pszValueName*: LPCTSTR - - TTBSAVEPARAMS* = TBSAVEPARAMS - PTBSAVEPARAMS* = ptr TBSAVEPARAMS - TC_HITTESTINFO* {.final, pure.} = object - pt*: POINT - flags*: UINT - - TTCHITTESTINFO* = TC_HITTESTINFO - PTCHITTESTINFO* = ptr TC_HITTESTINFO - TC_ITEM* {.final, pure.} = object - mask*: UINT - lpReserved1*: UINT - lpReserved2*: UINT - pszText*: LPTSTR - cchTextMax*: int32 - iImage*: int32 - lParam*: LPARAM - - TTCITEM* = TC_ITEM - PTCITEM* = ptr TC_ITEM - TC_ITEMHEADER* {.final, pure.} = object - mask*: UINT - lpReserved1*: UINT - lpReserved2*: UINT - pszText*: LPTSTR - cchTextMax*: int32 - iImage*: int32 - - TTCITEMHEADER* = TC_ITEMHEADER - PTCITEMHEADER* = ptr TC_ITEMHEADER - TC_KEYDOWN* {.final, pure.} = object - hdr*: NMHDR - wVKey*: int16 - flags*: UINT - - TTCKEYDOWN* = TC_KEYDOWN - PTCKEYDOWN* = ptr TC_KEYDOWN - TEXTRANGE* {.final, pure.} = object - chrg*: CHARRANGE - lpstrText*: LPSTR - - Ttextrange* = TEXTRANGE - Ptextrange* = ptr TEXTRANGE - TIME_ZONE_INFORMATION* {.final, pure.} = object - Bias*: LONG - StandardName*: array[0..31, WCHAR] - StandardDate*: SYSTEMTIME - StandardBias*: LONG - DaylightName*: array[0..31, WCHAR] - DaylightDate*: SYSTEMTIME - DaylightBias*: LONG - - LPTIME_ZONE_INFORMATION* = ptr TIME_ZONE_INFORMATION - TTIMEZONEINFORMATION* = TIME_ZONE_INFORMATION - PTIMEZONEINFORMATION* = ptr TIME_ZONE_INFORMATION - TOGGLEKEYS* {.final, pure.} = object - cbSize*: DWORD - dwFlags*: DWORD - - TTOGGLEKEYS* = TOGGLEKEYS - PTOGGLEKEYS* = ptr TOGGLEKEYS - TTOKEN_SOURCE* {.final, pure.} = object - SourceName*: array[0..7, CHAR] - SourceIdentifier*: LUID - - PTOKENSOURCE* = ptr TTOKEN_SOURCE - TOKEN_CONTROL* {.final, pure.} = object - TokenId*: LUID - AuthenticationId*: LUID - ModifiedId*: LUID - TokenSource*: TTOKEN_SOURCE - - TTOKENCONTROL* = TOKEN_CONTROL - PTOKENCONTROL* = ptr TOKEN_CONTROL - TTOKEN_DEFAULT_DACL* {.final, pure.} = object - DefaultDacl*: PACL - - PTOKENDEFAULTDACL* = ptr TTOKEN_DEFAULT_DACL - TTOKEN_GROUPS* {.final, pure.} = object - GroupCount*: DWORD - Groups*: array[0..(ANYSIZE_ARRAY) - 1, SID_AND_ATTRIBUTES] - - LPTOKEN_GROUPS* = ptr TTOKEN_GROUPS - PTOKENGROUPS* = ptr TTOKEN_GROUPS - TTOKEN_OWNER* {.final, pure.} = object - Owner*: PSID - - PTOKENOWNER* = ptr TTOKEN_OWNER - TTOKEN_PRIMARY_GROUP* {.final, pure.} = object - PrimaryGroup*: PSID - - PTOKENPRIMARYGROUP* = ptr TTOKEN_PRIMARY_GROUP - TTOKEN_PRIVILEGES* {.final, pure.} = object - PrivilegeCount*: DWORD - Privileges*: array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES] - - PTOKEN_PRIVILEGES* = ptr TTOKEN_PRIVILEGES - LPTOKEN_PRIVILEGES* = ptr TTOKEN_PRIVILEGES - TTOKEN_STATISTICS* {.final, pure.} = object - TokenId*: LUID - AuthenticationId*: LUID - ExpirationTime*: LARGE_INTEGER - TokenType*: TTOKEN_TYPE - ImpersonationLevel*: SECURITY_IMPERSONATION_LEVEL - DynamicCharged*: DWORD - DynamicAvailable*: DWORD - GroupCount*: DWORD - PrivilegeCount*: DWORD - ModifiedId*: LUID - - PTOKENSTATISTICS* = ptr TTOKEN_STATISTICS - TTOKEN_USER* {.final, pure.} = object - User*: SID_AND_ATTRIBUTES - - PTOKENUSER* = ptr TTOKEN_USER - TOOLINFO* {.final, pure.} = object - cbSize*: UINT - uFlags*: UINT - hwnd*: HWND - uId*: UINT - rect*: RECT - hinst*: HINST - lpszText*: LPTSTR - - LPTOOLINFO* = ptr TOOLINFO - TTOOLINFO* = TOOLINFO - PTOOLINFO* = ptr TOOLINFO - TOOLTIPTEXT* {.final, pure.} = object - hdr*: NMHDR - lpszText*: LPTSTR - szText*: array[0..79, char] - hinst*: HINST - uFlags*: UINT - - LPTOOLTIPTEXT* = ptr TOOLTIPTEXT - TTOOLTIPTEXT* = TOOLTIPTEXT - PTOOLTIPTEXT* = ptr TOOLTIPTEXT - TPMPARAMS* {.final, pure.} = object - cbSize*: UINT - rcExclude*: RECT - - LPTPMPARAMS* = ptr TPMPARAMS - TTPMPARAMS* = TPMPARAMS - PTPMPARAMS* = ptr TPMPARAMS - TRANSMIT_FILE_BUFFERS* {.final, pure.} = object - Head*: PVOID - HeadLength*: DWORD - Tail*: PVOID - TailLength*: DWORD - - TTRANSMITFILEBUFFERS* = TRANSMIT_FILE_BUFFERS - PTRANSMITFILEBUFFERS* = ptr TRANSMIT_FILE_BUFFERS - TTHITTESTINFO* {.final, pure.} = object - hwnd*: HWND - pt*: POINT - ti*: TOOLINFO - - LPHITTESTINFO* = ptr TTHITTESTINFO - TTTHITTESTINFO* = TTHITTESTINFO - PTTHITTESTINFO* = ptr TTHITTESTINFO - TTPOLYCURVE* {.final, pure.} = object - wType*: int16 - cpfx*: int16 - apfx*: array[0..0, POINTFX] - - LPTTPOLYCURVE* = ptr TTPOLYCURVE - TTTPOLYCURVE* = TTPOLYCURVE - PTTPOLYCURVE* = ptr TTPOLYCURVE - TTPOLYGONHEADER* {.final, pure.} = object - cb*: DWORD - dwType*: DWORD - pfxStart*: POINTFX - - LPTTPOLYGONHEADER* = ptr TTPOLYGONHEADER - TTTPOLYGONHEADER* = TTPOLYGONHEADER - PTTPOLYGONHEADER* = ptr TTPOLYGONHEADER - TV_DISPINFO* {.final, pure.} = object - hdr*: NMHDR - item*: TV_ITEM - - TTVDISPINFO* = TV_DISPINFO - PTVDISPINFO* = ptr TV_DISPINFO - TV_HITTESTINFO* {.final, pure.} = object - pt*: POINT - flags*: UINT - hItem*: HTREEITEM - - LPTV_HITTESTINFO* = ptr TV_HITTESTINFO - TTVHITTESTINFO* = TV_HITTESTINFO - PTVHITTESTINFO* = ptr TV_HITTESTINFO - TV_INSERTSTRUCT* {.final, pure.} = object - hParent*: HTREEITEM - hInsertAfter*: HTREEITEM - item*: TV_ITEM - - LPTV_INSERTSTRUCT* = ptr TV_INSERTSTRUCT - TTVINSERTSTRUCT* = TV_INSERTSTRUCT - PTVINSERTSTRUCT* = ptr TV_INSERTSTRUCT - TV_KEYDOWN* {.final, pure.} = object - hdr*: NMHDR - wVKey*: int16 - flags*: UINT - - TTVKEYDOWN* = TV_KEYDOWN - PTVKEYDOWN* = ptr TV_KEYDOWN - TV_SORTCB* {.final, pure.} = object - hParent*: HTREEITEM - lpfnCompare*: PFNTVCOMPARE - lParam*: LPARAM - - LPTV_SORTCB* = ptr TV_SORTCB - TTVSORTCB* = TV_SORTCB - PTVSORTCB* = ptr TV_SORTCB - UDACCEL* {.final, pure.} = object - nSec*: UINT - nInc*: UINT - - TUDACCEL* = UDACCEL - PUDACCEL* = ptr UDACCEL - UNIVERSAL_NAME_INFO* {.final, pure.} = object - lpUniversalName*: LPTSTR - - TUNIVERSALNAMEINFO* = UNIVERSAL_NAME_INFO - PUNIVERSALNAMEINFO* = ptr UNIVERSAL_NAME_INFO - USEROBJECTFLAGS* {.final, pure.} = object - fInherit*: WINBOOL - fReserved*: WINBOOL - dwFlags*: DWORD - - TUSEROBJECTFLAGS* = USEROBJECTFLAGS - PUSEROBJECTFLAGS* = ptr USEROBJECTFLAGS - VALENT* {.final, pure.} = object - 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* {.final, pure.} = object - StartingOffset*: LARGE_INTEGER - len*: DWORD - - TVERIFYINFORMATION* = VERIFY_INFORMATION - PVERIFYINFORMATION* = ptr VERIFY_INFORMATION - VS_FIXEDFILEINFO* {.final, pure.} = object - dwSignature*: DWORD - dwStrucVersion*: DWORD - dwFileVersionMS*: DWORD - dwFileVersionLS*: DWORD - dwProductVersionMS*: DWORD - dwProductVersionLS*: DWORD - dwFileFlagsMask*: DWORD - dwFileFlags*: DWORD - dwFileOS*: DWORD - dwFileType*: DWORD - dwFileSubtype*: DWORD - dwFileDateMS*: DWORD - dwFileDateLS*: DWORD - - TVSFIXEDFILEINFO* = VS_FIXEDFILEINFO - PVSFIXEDFILEINFO* = ptr VS_FIXEDFILEINFO - WIN32_FIND_DATA* {.final, pure.} = object - dwFileAttributes*: DWORD - ftCreationTime*: FILETIME - ftLastAccessTime*: FILETIME - ftLastWriteTime*: FILETIME - nFileSizeHigh*: DWORD - nFileSizeLow*: DWORD - dwReserved0*: DWORD - dwReserved1*: DWORD - cFileName*: array[0..(MAX_PATH) - 1, 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* {.final, pure.} = object - dwFileAttributes*: DWORD - ftCreationTime*: FILETIME - ftLastAccessTime*: FILETIME - ftLastWriteTime*: FILETIME - nFileSizeHigh*: DWORD - nFileSizeLow*: DWORD - dwReserved0*: DWORD - dwReserved1*: DWORD - cFileName*: array[0..(MAX_PATH) - 1, WCHAR] - cAlternateFileName*: array[0..13, WCHAR] - - LPWIN32_FIND_DATAW* = ptr WIN32_FIND_DATAW - PWIN32_FIND_DATAW* = ptr WIN32_FIND_DATAW - TWIN32FINDDATAW* = WIN32_FIND_DATAW - WIN32_STREAM_ID* {.final, pure.} = object - dwStreamId*: DWORD - dwStreamAttributes*: DWORD - Size*: LARGE_INTEGER - dwStreamNameSize*: DWORD - cStreamName*: ptr WCHAR - - TWIN32STREAMID* = WIN32_STREAM_ID - PWIN32STREAMID* = ptr WIN32_STREAM_ID - WINDOWPLACEMENT* {.final, pure.} = object - len*: UINT - flags*: UINT - showCmd*: UINT - ptMinPosition*: POINT - ptMaxPosition*: POINT - rcNormalPosition*: RECT - - TWINDOWPLACEMENT* = WINDOWPLACEMENT - PWINDOWPLACEMENT* = ptr WINDOWPLACEMENT - WNDCLASS* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - cbStructure*: DWORD - hwndOwner*: HWND - lpConnRes*: LPNETRESOURCE - dwFlags*: DWORD - dwDevNum*: DWORD - - LPCONNECTDLGSTRUCT* = ptr CONNECTDLGSTRUCT - TCONNECTDLGSTRUCT* = CONNECTDLGSTRUCT - PCONNECTDLGSTRUCT* = ptr CONNECTDLGSTRUCT - DISCDLGSTRUCT* {.final, pure.} = object - cbStructure*: DWORD - hwndOwner*: HWND - lpLocalName*: LPTSTR - lpRemoteName*: LPTSTR - dwFlags*: DWORD - - LPDISCDLGSTRUCT* = ptr DISCDLGSTRUCT - TDISCDLGSTRUCT* = DISCDLGSTRUCT - TDISCDLGSTRUCTA* = DISCDLGSTRUCT - PDISCDLGSTRUCT* = ptr DISCDLGSTRUCT - NETINFOSTRUCT* {.final, pure.} = object - cbStructure*: DWORD - dwProviderVersion*: DWORD - dwStatus*: DWORD - dwCharacteristics*: DWORD - dwHandle*: DWORD - wNetType*: int16 - dwPrinters*: DWORD - dwDrives*: DWORD - - LPNETINFOSTRUCT* = ptr NETINFOSTRUCT - TNETINFOSTRUCT* = NETINFOSTRUCT - PNETINFOSTRUCT* = ptr NETINFOSTRUCT - NETCONNECTINFOSTRUCT* {.final, pure.} = object - 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* {.final, pure.} = object - x*: float32 - y*: float32 - - TPOINTFLOAT* = POINTFLOAT - PPOINTFLOAT* = ptr POINTFLOAT - GLYPHMETRICSFLOAT* {.final, pure.} = object - gmfBlackBoxX*: float32 - gmfBlackBoxY*: float32 - gmfptGlyphOrigin*: POINTFLOAT - gmfCellIncX*: float32 - gmfCellIncY*: float32 - - LPGLYPHMETRICSFLOAT* = ptr GLYPHMETRICSFLOAT - TGLYPHMETRICSFLOAT* = GLYPHMETRICSFLOAT - PGLYPHMETRICSFLOAT* = ptr GLYPHMETRICSFLOAT - LAYERPLANEDESCRIPTOR* {.final, pure.} = object - nSize*: int16 - nVersion*: int16 - dwFlags*: DWORD - iPixelType*: int8 - cColorBits*: int8 - cRedBits*: int8 - cRedShift*: int8 - cGreenBits*: int8 - cGreenShift*: int8 - cBlueBits*: int8 - cBlueShift*: int8 - cAlphaBits*: int8 - cAlphaShift*: int8 - cAccumBits*: int8 - cAccumRedBits*: int8 - cAccumGreenBits*: int8 - cAccumBlueBits*: int8 - cAccumAlphaBits*: int8 - cDepthBits*: int8 - cStencilBits*: int8 - cAuxBuffers*: int8 - iLayerPlane*: int8 - bReserved*: int8 - crTransparent*: COLORREF - - LPLAYERPLANEDESCRIPTOR* = ptr LAYERPLANEDESCRIPTOR - TLAYERPLANEDESCRIPTOR* = LAYERPLANEDESCRIPTOR - PLAYERPLANEDESCRIPTOR* = ptr LAYERPLANEDESCRIPTOR - PIXELFORMATDESCRIPTOR* {.final, pure.} = object - nSize*: int16 - nVersion*: int16 - dwFlags*: DWORD - iPixelType*: int8 - cColorBits*: int8 - cRedBits*: int8 - cRedShift*: int8 - cGreenBits*: int8 - cGreenShift*: int8 - cBlueBits*: int8 - cBlueShift*: int8 - cAlphaBits*: int8 - cAlphaShift*: int8 - cAccumBits*: int8 - cAccumRedBits*: int8 - cAccumGreenBits*: int8 - cAccumBlueBits*: int8 - cAccumAlphaBits*: int8 - cDepthBits*: int8 - cStencilBits*: int8 - cAuxBuffers*: int8 - iLayerType*: int8 - bReserved*: int8 - dwLayerMask*: DWORD - dwVisibleMask*: DWORD - dwDamageMask*: DWORD - - LPPIXELFORMATDESCRIPTOR* = ptr PIXELFORMATDESCRIPTOR - TPIXELFORMATDESCRIPTOR* = PIXELFORMATDESCRIPTOR - PPIXELFORMATDESCRIPTOR* = ptr PIXELFORMATDESCRIPTOR - USER_INFO_2* {.final, pure.} = object - usri2_name*: LPWSTR - usri2_password*: LPWSTR - usri2_password_age*: DWORD - usri2_priv*: DWORD - usri2_home_dir*: LPWSTR - usri2_comment*: LPWSTR - usri2_flags*: DWORD - usri2_script_path*: LPWSTR - usri2_auth_flags*: DWORD - usri2_full_name*: LPWSTR - usri2_usr_comment*: LPWSTR - usri2_parms*: LPWSTR - usri2_workstations*: LPWSTR - usri2_last_logon*: DWORD - usri2_last_logoff*: DWORD - usri2_acct_expires*: DWORD - usri2_max_storage*: DWORD - usri2_units_per_week*: DWORD - usri2_logon_hours*: PBYTE - usri2_bad_pw_count*: DWORD - usri2_num_logons*: DWORD - usri2_logon_server*: LPWSTR - usri2_country_code*: DWORD - usri2_code_page*: DWORD - - PUSER_INFO_2* = ptr USER_INFO_2 - LPUSER_INFO_2* = ptr USER_INFO_2 - TUSERINFO2* = USER_INFO_2 - USER_INFO_0* {.final, pure.} = object - usri0_name*: LPWSTR - - PUSER_INFO_0* = ptr USER_INFO_0 - LPUSER_INFO_0* = ptr USER_INFO_0 - TUSERINFO0* = USER_INFO_0 - USER_INFO_3* {.final, pure.} = object - usri3_name*: LPWSTR - usri3_password*: LPWSTR - usri3_password_age*: DWORD - usri3_priv*: DWORD - usri3_home_dir*: LPWSTR - usri3_comment*: LPWSTR - usri3_flags*: DWORD - usri3_script_path*: LPWSTR - usri3_auth_flags*: DWORD - usri3_full_name*: LPWSTR - usri3_usr_comment*: LPWSTR - usri3_parms*: LPWSTR - usri3_workstations*: LPWSTR - usri3_last_logon*: DWORD - usri3_last_logoff*: DWORD - usri3_acct_expires*: DWORD - usri3_max_storage*: DWORD - usri3_units_per_week*: DWORD - usri3_logon_hours*: PBYTE - usri3_bad_pw_count*: DWORD - usri3_num_logons*: DWORD - usri3_logon_server*: LPWSTR - usri3_country_code*: DWORD - usri3_code_page*: DWORD - usri3_user_id*: DWORD - usri3_primary_group_id*: DWORD - usri3_profile*: LPWSTR - usri3_home_dir_drive*: LPWSTR - usri3_password_expired*: DWORD - - PUSER_INFO_3* = ptr USER_INFO_3 - LPUSER_INFO_3* = ptr USER_INFO_3 - TUSERINFO3* = USER_INFO_3 - GROUP_INFO_2* {.final, pure.} = object - grpi2_name*: LPWSTR - grpi2_comment*: LPWSTR - grpi2_group_id*: DWORD - grpi2_attributes*: DWORD - - PGROUP_INFO_2* = ptr GROUP_INFO_2 - TGROUPINFO2* = GROUP_INFO_2 - LOCALGROUP_INFO_0* {.final, pure.} = object - lgrpi0_name*: LPWSTR - - PLOCALGROUP_INFO_0* = ptr LOCALGROUP_INFO_0 - LPLOCALGROUP_INFO_0* = ptr LOCALGROUP_INFO_0 - TLOCALGROUPINFO0* = LOCALGROUP_INFO_0 - IMAGE_DOS_HEADER* {.final, pure.} = object - e_magic*: int16 - e_cblp*: int16 - e_cp*: int16 - e_crlc*: int16 - e_cparhdr*: int16 - e_minalloc*: int16 - e_maxalloc*: int16 - e_ss*: int16 - e_sp*: int16 - e_csum*: int16 - e_ip*: int16 - e_cs*: int16 - e_lfarlc*: int16 - e_ovno*: int16 - e_res*: array[0..3, int16] - e_oemid*: int16 - e_oeminfo*: int16 - e_res2*: array[0..9, int16] - e_lfanew*: LONG - - PIMAGE_DOS_HEADER* = ptr IMAGE_DOS_HEADER - TIMAGEDOSHEADER* = IMAGE_DOS_HEADER - NOTIFYICONDATAA* {.final, pure.} = object - cbSize*: DWORD - Wnd*: HWND - uID*: UINT - uFlags*: UINT - uCallbackMessage*: UINT - hIcon*: HICON - szTip*: array[0..63, Char] - - NOTIFYICONDATA* = NOTIFYICONDATAA - NOTIFYICONDATAW* {.final, pure.} = object - 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* {.final, pure.} = object - wFormatTag*: int16 # format type - nChannels*: int16 # number of channels (i.e. mono, stereo, etc.) - nSamplesPerSec*: DWORD # sample rate - nAvgBytesPerSec*: DWORD # for buffer estimation - nBlockAlign*: int16 # block size of data - wBitsPerSample*: int16 # number of bits per sample of mono data - cbSize*: int16 # the count in bytes of the size of - - WIN32_FILE_ATTRIBUTE_DATA* {.final, pure.} = object - dwFileAttributes*: DWORD - ftCreationTime*: FILETIME - ftLastAccessTime*: FILETIME - ftLastWriteTime*: FILETIME - nFileSizeHigh*: DWORD - nFileSizeLow*: DWORD - - LPWIN32_FILE_ATTRIBUTE_DATA* = ptr WIN32_FILE_ATTRIBUTE_DATA - TWIN32FILEATTRIBUTEDATA* = WIN32_FILE_ATTRIBUTE_DATA - PWIN32FILEATTRIBUTEDATA* = ptr WIN32_FILE_ATTRIBUTE_DATA - # TrackMouseEvent. NT or higher only. - TTrackMouseEvent* {.final, pure.} = object - cbSize*: DWORD - dwFlags*: DWORD - hwndTrack*: HWND - dwHoverTime*: DWORD - - PTrackMouseEvent* = ptr TTrackMouseEvent - -const - ACM_OPENW* = 1127 - ACM_OPENA* = 1124 - -when defined(winUnicode): - const - ACM_OPEN* = ACM_OPENW -else: - const - ACM_OPEN* = ACM_OPENA -# UNICODE - -const - ACM_PLAY* = 1125 - ACM_STOP* = 1126 - ACN_START* = 1 - ACN_STOP* = 2 - # Buttons - BM_CLICK* = 245 - BM_GETCHECK* = 240 - BM_GETIMAGE* = 246 - BM_GETSTATE* = 242 - BM_SETCHECK* = 241 - BM_SETIMAGE* = 247 - BM_SETSTATE* = 243 - BM_SETSTYLE* = 244 - BN_CLICKED* = 0 - BN_DBLCLK* = 5 - BN_DISABLE* = 4 - BN_DOUBLECLICKED* = 5 - BN_HILITE* = 2 - BN_KILLFOCUS* = 7 - BN_PAINT* = 1 - BN_PUSHED* = 2 - BN_SETFOCUS* = 6 - BN_UNHILITE* = 3 - BN_UNPUSHED* = 3 - # Combo Box - CB_ADDSTRING* = 323 - CB_DELETESTRING* = 324 - CB_DIR* = 325 - CB_FINDSTRING* = 332 - CB_FINDSTRINGEXACT* = 344 - CB_GETCOUNT* = 326 - CB_GETCURSEL* = 327 - CB_GETDROPPEDCONTROLRECT* = 338 - CB_GETDROPPEDSTATE* = 343 - CB_GETDROPPEDWIDTH* = 351 - CB_GETEDITSEL* = 320 - CB_GETEXTENDEDUI* = 342 - CB_GETHORIZONTALEXTENT* = 349 - CB_GETITEMDATA* = 336 - CB_GETITEMHEIGHT* = 340 - CB_GETLBTEXT* = 328 - CB_GETLBTEXTLEN* = 329 - CB_GETLOCALE* = 346 - CB_GETTOPINDEX* = 347 - CB_INITSTORAGE* = 353 - CB_INSERTSTRING* = 330 - CB_LIMITTEXT* = 321 - CB_RESETCONTENT* = 331 - CB_SELECTSTRING* = 333 - CB_SETCURSEL* = 334 - CB_SETDROPPEDWIDTH* = 352 - CB_SETEDITSEL* = 322 - CB_SETEXTENDEDUI* = 341 - CB_SETHORIZONTALEXTENT* = 350 - CB_SETITEMDATA* = 337 - CB_SETITEMHEIGHT* = 339 - CB_SETLOCALE* = 345 - CB_SETTOPINDEX* = 348 - CB_SHOWDROPDOWN* = 335 - # Combo Box notifications - CBN_CLOSEUP* = 8 - CBN_DBLCLK* = 2 - CBN_DROPDOWN* = 7 - CBN_EDITCHANGE* = 5 - CBN_EDITUPDATE* = 6 - CBN_ERRSPACE* = -1 - CBN_KILLFOCUS* = 4 - CBN_SELCHANGE* = 1 - CBN_SELENDCANCEL* = 10 - CBN_SELENDOK* = 9 - CBN_SETFOCUS* = 3 - # Control Panel - # Device messages - # Drag list box - DL_BEGINDRAG* = 1157 - DL_CANCELDRAG* = 1160 - DL_DRAGGING* = 1158 - DL_DROPPED* = 1159 - # Default push button - DM_GETDEFID* = 1024 - DM_REPOSITION* = 1026 - DM_SETDEFID* = 1025 - # RTF control - EM_CANPASTE* = 1074 - EM_CANUNDO* = 198 - EM_CHARFROMPOS* = 215 - EM_DISPLAYBAND* = 1075 - EM_EMPTYUNDOBUFFER* = 205 - EM_EXGETSEL* = 1076 - EM_EXLIMITTEXT* = 1077 - EM_EXLINEFROMCHAR* = 1078 - EM_EXSETSEL* = 1079 - EM_FINDTEXT* = 1080 - EM_FINDTEXTEX* = 1103 - EM_FINDWORDBREAK* = 1100 - EM_FMTLINES* = 200 - EM_FORMATRANGE* = 1081 - EM_GETCHARFORMAT* = 1082 - EM_GETEVENTMASK* = 1083 - EM_GETFIRSTVISIBLELINE* = 206 - EM_GETHANDLE* = 189 - EM_GETLIMITTEXT* = 213 - EM_GETLINE* = 196 - EM_GETLINECOUNT* = 186 - EM_GETMARGINS* = 212 - EM_GETMODIFY* = 184 - EM_GETIMECOLOR* = 1129 - EM_GETIMEOPTIONS* = 1131 - EM_GETOPTIONS* = 1102 - EM_GETOLEINTERFACE* = 1084 - EM_GETPARAFORMAT* = 1085 - EM_GETPASSWORDCHAR* = 210 - EM_GETPUNCTUATION* = 1125 - EM_GETRECT* = 178 - EM_GETSEL* = 176 - EM_GETSELTEXT* = 1086 - EM_GETTEXTRANGE* = 1099 - EM_GETTHUMB* = 190 - EM_GETWORDBREAKPROC* = 209 - EM_GETWORDBREAKPROCEX* = 1104 - EM_GETWORDWRAPMODE* = 1127 - EM_HIDESELECTION* = 1087 - EM_LIMITTEXT* = 197 - EM_LINEFROMCHAR* = 201 - EM_LINEINDEX* = 187 - EM_LINELENGTH* = 193 - EM_LINESCROLL* = 182 - EM_PASTESPECIAL* = 1088 - EM_POSFROMCHAR* = 214 - EM_REPLACESEL* = 194 - EM_REQUESTRESIZE* = 1089 - EM_SCROLL* = 181 - EM_SCROLLCARET* = 183 - EM_SELECTIONTYPE* = 1090 - EM_SETBKGNDCOLOR* = 1091 - EM_SETCHARFORMAT* = 1092 - EM_SETEVENTMASK* = 1093 - EM_SETHANDLE* = 188 - EM_SETIMECOLOR* = 1128 - EM_SETIMEOPTIONS* = 1130 - EM_SETLIMITTEXT* = 197 - EM_SETMARGINS* = 211 - EM_SETMODIFY* = 185 - EM_SETOLECALLBACK* = 1094 - EM_SETOPTIONS* = 1101 - EM_SETPARAFORMAT* = 1095 - EM_SETPASSWORDCHAR* = 204 - EM_SETPUNCTUATION* = 1124 - EM_SETREADONLY* = 207 - EM_SETRECT* = 179 - EM_SETRECTNP* = 180 - EM_SETSEL* = 177 - EM_SETTABSTOPS* = 203 - EM_SETTARGETDEVICE* = 1096 - EM_SETWORDBREAKPROC* = 208 - EM_SETWORDBREAKPROCEX* = 1105 - EM_SETWORDWRAPMODE* = 1126 - EM_STREAMIN* = 1097 - EM_STREAMOUT* = 1098 - EM_UNDO* = 199 - # Edit control - EN_CHANGE* = 768 - EN_CORRECTTEXT* = 1797 - EN_DROPFILES* = 1795 - EN_ERRSPACE* = 1280 - EN_HSCROLL* = 1537 - EN_IMECHANGE* = 1799 - EN_KILLFOCUS* = 512 - EN_MAXTEXT* = 1281 - EN_MSGFILTER* = 1792 - EN_OLEOPFAILED* = 1801 - EN_PROTECTED* = 1796 - EN_REQUESTRESIZE* = 1793 - EN_SAVECLIPBOARD* = 1800 - EN_SELCHANGE* = 1794 - EN_SETFOCUS* = 256 - EN_STOPNOUNDO* = 1798 - EN_UPDATE* = 1024 - EN_VSCROLL* = 1538 - # File Manager extensions - # File Manager extensions DLL events - # Header control - HDM_DELETEITEM* = 4610 - HDM_GETITEMW* = 4619 - HDM_INSERTITEMW* = 4618 - HDM_SETITEMW* = 4620 - HDM_GETITEMA* = 4611 - HDM_INSERTITEMA* = 4609 - HDM_SETITEMA* = 4612 - -when defined(winUnicode): - const - HDM_GETITEM* = HDM_GETITEMW - HDM_INSERTITEM* = HDM_INSERTITEMW - HDM_SETITEM* = HDM_SETITEMW -else: - const - HDM_GETITEM* = HDM_GETITEMA - HDM_INSERTITEM* = HDM_INSERTITEMA - HDM_SETITEM* = HDM_SETITEMA -# UNICODE - -const - HDM_GETITEMCOUNT* = 4608 - HDM_HITTEST* = 4614 - HDM_LAYOUT* = 4613 - # Header control notifications - HDN_BEGINTRACKW* = -326 - HDN_DIVIDERDBLCLICKW* = -325 - HDN_ENDTRACKW* = -327 - HDN_ITEMCHANGEDW* = -321 - HDN_ITEMCHANGINGW* = -320 - HDN_ITEMCLICKW* = -322 - HDN_ITEMDBLCLICKW* = -323 - HDN_TRACKW* = -328 - HDN_BEGINTRACKA* = -306 - HDN_DIVIDERDBLCLICKA* = -305 - HDN_ENDTRACKA* = -307 - HDN_ITEMCHANGEDA* = -301 - HDN_ITEMCHANGINGA* = -300 - HDN_ITEMCLICKA* = -302 - HDN_ITEMDBLCLICKA* = -303 - HDN_TRACKA* = -308 - -when defined(winUnicode): - const - HDN_BEGINTRACK* = HDN_BEGINTRACKW - HDN_DIVIDERDBLCLICK* = HDN_DIVIDERDBLCLICKW - HDN_ENDTRACK* = HDN_ENDTRACKW - HDN_ITEMCHANGED* = HDN_ITEMCHANGEDW - HDN_ITEMCHANGING* = HDN_ITEMCHANGINGW - HDN_ITEMCLICK* = HDN_ITEMCLICKW - HDN_ITEMDBLCLICK* = HDN_ITEMDBLCLICKW - HDN_TRACK* = HDN_TRACKW -else: - const - HDN_BEGINTRACK* = HDN_BEGINTRACKA - HDN_DIVIDERDBLCLICK* = HDN_DIVIDERDBLCLICKA - HDN_ENDTRACK* = HDN_ENDTRACKA - HDN_ITEMCHANGED* = HDN_ITEMCHANGEDA - HDN_ITEMCHANGING* = HDN_ITEMCHANGINGA - HDN_ITEMCLICK* = HDN_ITEMCLICKA - HDN_ITEMDBLCLICK* = HDN_ITEMDBLCLICKA - HDN_TRACK* = HDN_TRACKA -# UNICODE - -const - # Hot key control - HKM_GETHOTKEY* = 1026 - HKM_SETHOTKEY* = 1025 - HKM_SETRULES* = 1027 - # List box - LB_ADDFILE* = 406 - LB_ADDSTRING* = 384 - LB_DELETESTRING* = 386 - LB_DIR* = 397 - LB_FINDSTRING* = 399 - LB_FINDSTRINGEXACT* = 418 - LB_GETANCHORINDEX* = 413 - LB_GETCARETINDEX* = 415 - LB_GETCOUNT* = 395 - LB_GETCURSEL* = 392 - LB_GETHORIZONTALEXTENT* = 403 - LB_GETITEMDATA* = 409 - LB_GETITEMHEIGHT* = 417 - LB_GETITEMRECT* = 408 - LB_GETLOCALE* = 422 - LB_GETSEL* = 391 - LB_GETSELCOUNT* = 400 - LB_GETSELITEMS* = 401 - LB_GETTEXT* = 393 - LB_GETTEXTLEN* = 394 - LB_GETTOPINDEX* = 398 - LB_INITSTORAGE* = 424 - LB_INSERTSTRING* = 385 - LB_ITEMFROMPOINT* = 425 - LB_RESETCONTENT* = 388 - LB_SELECTSTRING* = 396 - LB_SELITEMRANGE* = 411 - LB_SELITEMRANGEEX* = 387 - LB_SETANCHORINDEX* = 412 - LB_SETCARETINDEX* = 414 - LB_SETCOLUMNWIDTH* = 405 - LB_SETCOUNT* = 423 - LB_SETCURSEL* = 390 - LB_SETHORIZONTALEXTENT* = 404 - LB_SETITEMDATA* = 410 - LB_SETITEMHEIGHT* = 416 - LB_SETLOCALE* = 421 - LB_SETSEL* = 389 - LB_SETTABSTOPS* = 402 - LB_SETTOPINDEX* = 407 - # List box notifications - LBN_DBLCLK* = 2 - LBN_ERRSPACE* = -2 - LBN_KILLFOCUS* = 5 - LBN_SELCANCEL* = 3 - LBN_SELCHANGE* = 1 - LBN_SETFOCUS* = 4 - # List view control - LVM_ARRANGE* = 4118 - LVM_CREATEDRAGIMAGE* = 4129 - LVM_DELETEALLITEMS* = 4105 - LVM_DELETECOLUMN* = 4124 - LVM_DELETEITEM* = 4104 - LVM_ENSUREVISIBLE* = 4115 - LVM_GETBKCOLOR* = 4096 - LVM_GETCALLBACKMASK* = 4106 - LVM_GETCOLUMNWIDTH* = 4125 - LVM_GETCOUNTPERPAGE* = 4136 - LVM_GETEDITCONTROL* = 4120 - LVM_GETIMAGELIST* = 4098 - LVM_EDITLABELW* = 4214 - LVM_FINDITEMW* = 4179 - LVM_GETCOLUMNW* = 4191 - LVM_GETISEARCHSTRINGW* = 4213 - LVM_GETITEMW* = 4171 - LVM_GETITEMTEXTW* = 4211 - LVM_GETSTRINGWIDTHW* = 4183 - LVM_INSERTCOLUMNW* = 4193 - LVM_INSERTITEMW* = 4173 - LVM_SETCOLUMNW* = 4192 - LVM_SETITEMW* = 4172 - LVM_SETITEMTEXTW* = 4212 - LVM_EDITLABELA* = 4119 - LVM_FINDITEMA* = 4109 - LVM_GETCOLUMNA* = 4121 - LVM_GETISEARCHSTRINGA* = 4148 - LVM_GETITEMA* = 4101 - LVM_GETITEMTEXTA* = 4141 - LVM_GETSTRINGWIDTHA* = 4113 - LVM_INSERTCOLUMNA* = 4123 - LVM_INSERTITEMA* = 4103 - LVM_SETCOLUMNA* = 4122 - LVM_SETITEMA* = 4102 - LVM_SETITEMTEXTA* = 4142 - -when defined(winUnicode): - const - LVM_EDITLABEL* = LVM_EDITLABELW - LVM_FINDITEM* = LVM_FINDITEMW - LVM_GETCOLUMN* = LVM_GETCOLUMNW - LVM_GETISEARCHSTRING* = LVM_GETISEARCHSTRINGW - LVM_GETITEM* = LVM_GETITEMW - LVM_GETITEMTEXT* = LVM_GETITEMTEXTW - LVM_GETSTRINGWIDTH* = LVM_GETSTRINGWIDTHW - LVM_INSERTCOLUMN* = LVM_INSERTCOLUMNW - LVM_INSERTITEM* = LVM_INSERTITEMW - LVM_SETCOLUMN* = LVM_SETCOLUMNW - LVM_SETITEM* = LVM_SETITEMW - LVM_SETITEMTEXT* = LVM_SETITEMTEXTW -else: - const - LVM_EDITLABEL* = LVM_EDITLABELA - LVM_FINDITEM* = LVM_FINDITEMA - LVM_GETCOLUMN* = LVM_GETCOLUMNA - LVM_GETISEARCHSTRING* = LVM_GETISEARCHSTRINGA - LVM_GETITEM* = LVM_GETITEMA - LVM_GETITEMTEXT* = LVM_GETITEMTEXTA - LVM_GETSTRINGWIDTH* = LVM_GETSTRINGWIDTHA - LVM_INSERTCOLUMN* = LVM_INSERTCOLUMNA - LVM_INSERTITEM* = LVM_INSERTITEMA - LVM_SETCOLUMN* = LVM_SETCOLUMNA - LVM_SETITEM* = LVM_SETITEMA - LVM_SETITEMTEXT* = LVM_SETITEMTEXTA -# UNICODE - -const - LVM_GETITEMCOUNT* = 4100 - LVM_GETITEMPOSITION* = 4112 - LVM_GETITEMRECT* = 4110 - LVM_GETITEMSPACING* = 4147 - LVM_GETITEMSTATE* = 4140 - LVM_GETNEXTITEM* = 4108 - LVM_GETORIGIN* = 4137 - LVM_GETSELECTEDCOUNT* = 4146 - LVM_GETTEXTBKCOLOR* = 4133 - LVM_GETTEXTCOLOR* = 4131 - LVM_GETTOPINDEX* = 4135 - LVM_GETVIEWRECT* = 4130 - LVM_HITTEST* = 4114 - LVM_REDRAWITEMS* = 4117 - LVM_SCROLL* = 4116 - LVM_SETBKCOLOR* = 4097 - LVM_SETCALLBACKMASK* = 4107 - LVM_SETCOLUMNWIDTH* = 4126 - LVM_SETIMAGELIST* = 4099 - LVM_SETITEMCOUNT* = 4143 - LVM_SETITEMPOSITION* = 4111 - LVM_SETITEMPOSITION32* = 4145 - LVM_SETITEMSTATE* = 4139 - LVM_SETTEXTBKCOLOR* = 4134 - LVM_SETTEXTCOLOR* = 4132 - LVM_SORTITEMS* = 4144 - LVM_UPDATE* = 4138 - # List view control notifications - LVN_BEGINDRAG* = -109 - LVN_BEGINRDRAG* = -111 - LVN_COLUMNCLICK* = -108 - LVN_DELETEALLITEMS* = -104 - LVN_DELETEITEM* = -103 - LVN_BEGINLABELEDITW* = -175 - LVN_ENDLABELEDITW* = -176 - LVN_GETDISPINFOW* = -177 - LVN_SETDISPINFOW* = -178 - LVN_BEGINLABELEDITA* = -105 - LVN_ENDLABELEDITA* = -106 - LVN_GETDISPINFOA* = -150 - LVN_SETDISPINFOA* = -151 - -when defined(winUnicode): - const - LVN_BEGINLABELEDIT* = LVN_BEGINLABELEDITW - LVN_ENDLABELEDIT* = LVN_ENDLABELEDITW - LVN_GETDISPINFO* = LVN_GETDISPINFOW - LVN_SETDISPINFO* = LVN_SETDISPINFOW -else: - const - LVN_BEGINLABELEDIT* = LVN_BEGINLABELEDITA - LVN_ENDLABELEDIT* = LVN_ENDLABELEDITA - LVN_GETDISPINFO* = LVN_GETDISPINFOA - LVN_SETDISPINFO* = LVN_SETDISPINFOA -# UNICODE - -const - LVN_INSERTITEM* = -102 - LVN_ITEMCHANGED* = -101 - LVN_ITEMCHANGING* = -100 - LVN_KEYDOWN* = -155 - # Control notification - NM_CLICK* = -2 - NM_DBLCLK* = -3 - NM_KILLFOCUS* = -8 - NM_OUTOFMEMORY* = -1 - NM_RCLICK* = -5 - NM_RDBLCLK* = -6 - NM_RETURN* = -4 - NM_SETFOCUS* = -7 - # Power status - # Progress bar control - PBM_DELTAPOS* = 1027 - PBM_SETPOS* = 1026 - PBM_SETRANGE* = 1025 - PBM_SETRANGE32* = 1030 - PBM_SETSTEP* = 1028 - PBM_STEPIT* = 1029 - # Property sheets - PSM_ADDPAGE* = 1127 - PSM_APPLY* = 1134 - PSM_CANCELTOCLOSE* = 1131 - PSM_CHANGED* = 1128 - PSM_GETTABCONTROL* = 1140 - PSM_GETCURRENTPAGEHWND* = 1142 - PSM_ISDIALOGMESSAGE* = 1141 - PSM_PRESSBUTTON* = 1137 - PSM_QUERYSIBLINGS* = 1132 - PSM_REBOOTSYSTEM* = 1130 - PSM_REMOVEPAGE* = 1126 - PSM_RESTARTWINDOWS* = 1129 - PSM_SETCURSEL* = 1125 - PSM_SETCURSELID* = 1138 - PSM_SETFINISHTEXTW* = 1145 - PSM_SETTITLEW* = 1144 - PSM_SETFINISHTEXTA* = 1139 - PSM_SETTITLEA* = 1135 - -when defined(winUnicode): - const - PSM_SETFINISHTEXT* = PSM_SETFINISHTEXTW - PSM_SETTITLE* = PSM_SETTITLEW -else: - const - PSM_SETFINISHTEXT* = PSM_SETFINISHTEXTA - PSM_SETTITLE* = PSM_SETTITLEA -# UNICODE - -const - PSM_SETWIZBUTTONS* = 1136 - PSM_UNCHANGED* = 1133 - # Property sheet notifications - PSN_APPLY* = -202 - PSN_HELP* = -205 - PSN_KILLACTIVE* = -201 - PSN_QUERYCANCEL* = -209 - PSN_RESET* = -203 - PSN_SETACTIVE* = -200 - PSN_WIZBACK* = -206 - PSN_WIZFINISH* = -208 - PSN_WIZNEXT* = -207 - # Status window - SB_GETBORDERS* = 1031 - SB_GETPARTS* = 1030 - SB_GETRECT* = 1034 - SB_GETTEXTW* = 1037 - SB_GETTEXTLENGTHW* = 1036 - SB_SETTEXTW* = 1035 - SB_GETTEXTA* = 1026 - SB_GETTEXTLENGTHA* = 1027 - SB_SETTEXTA* = 1025 - -when defined(winUnicode): - const - SB_GETTEXT* = SB_GETTEXTW - SB_GETTEXTLENGTH* = SB_GETTEXTLENGTHW - SB_SETTEXT* = SB_SETTEXTW -else: - const - SB_GETTEXT* = SB_GETTEXTA - SB_GETTEXTLENGTH* = SB_GETTEXTLENGTHA - SB_SETTEXT* = SB_SETTEXTA -# UNICODE - -const - SB_SETMINHEIGHT* = 1032 - SB_SETPARTS* = 1028 - SB_SIMPLE* = 1033 - # Scroll bar control - SBM_ENABLE_ARROWS* = 228 - SBM_GETPOS* = 225 - SBM_GETRANGE* = 227 - SBM_GETSCROLLINFO* = 234 - SBM_SETPOS* = 224 - SBM_SETRANGE* = 226 - SBM_SETRANGEREDRAW* = 230 - SBM_SETSCROLLINFO* = 233 - # Static control - STM_GETICON* = 369 - STM_GETIMAGE* = 371 - STM_SETICON* = 368 - STM_SETIMAGE* = 370 - # Static control notifications - STN_CLICKED* = 0 - STN_DBLCLK* = 1 - STN_DISABLE* = 3 - STN_ENABLE* = 2 - # Toolbar control - TB_ADDBITMAP* = 1043 - TB_ADDBUTTONS* = 1044 - TB_AUTOSIZE* = 1057 - TB_BUTTONCOUNT* = 1048 - TB_BUTTONSTRUCTSIZE* = 1054 - TB_CHANGEBITMAP* = 1067 - TB_CHECKBUTTON* = 1026 - TB_COMMANDTOINDEX* = 1049 - TB_CUSTOMIZE* = 1051 - TB_DELETEBUTTON* = 1046 - TB_ENABLEBUTTON* = 1025 - TB_GETBITMAP* = 1068 - TB_GETBITMAPFLAGS* = 1065 - TB_GETBUTTON* = 1047 - TB_ADDSTRINGW* = 1101 - TB_GETBUTTONTEXTW* = 1099 - TB_SAVERESTOREW* = 1100 - TB_ADDSTRINGA* = 1052 - TB_GETBUTTONTEXTA* = 1069 - TB_SAVERESTOREA* = 1050 - -when defined(winUnicode): - const - TB_ADDSTRING* = TB_ADDSTRINGW - TB_GETBUTTONTEXT* = TB_GETBUTTONTEXTW - TB_SAVERESTORE* = TB_SAVERESTOREW -else: - const - TB_ADDSTRING* = TB_ADDSTRINGA - TB_GETBUTTONTEXT* = TB_GETBUTTONTEXTA - TB_SAVERESTORE* = TB_SAVERESTOREA -# UNICODE - -const - TB_GETITEMRECT* = 1053 - TB_GETROWS* = 1064 - TB_GETSTATE* = 1042 - TB_GETTOOLTIPS* = 1059 - TB_HIDEBUTTON* = 1028 - TB_INDETERMINATE* = 1029 - TB_INSERTBUTTON* = 1045 - TB_ISBUTTONCHECKED* = 1034 - TB_ISBUTTONENABLED* = 1033 - TB_ISBUTTONHIDDEN* = 1036 - TB_ISBUTTONINDETERMINATE* = 1037 - TB_ISBUTTONPRESSED* = 1035 - TB_PRESSBUTTON* = 1027 - TB_SETBITMAPSIZE* = 1056 - TB_SETBUTTONSIZE* = 1055 - TB_SETCMDID* = 1066 - TB_SETPARENT* = 1061 - TB_SETROWS* = 1063 - TB_SETSTATE* = 1041 - TB_SETTOOLTIPS* = 1060 - # Track bar control - TBM_CLEARSEL* = 1043 - TBM_CLEARTICS* = 1033 - TBM_GETCHANNELRECT* = 1050 - TBM_GETLINESIZE* = 1048 - TBM_GETNUMTICS* = 1040 - TBM_GETPAGESIZE* = 1046 - TBM_GETPOS* = 1024 - TBM_GETPTICS* = 1038 - TBM_GETRANGEMAX* = 1026 - TBM_GETRANGEMIN* = 1025 - TBM_GETSELEND* = 1042 - TBM_GETSELSTART* = 1041 - TBM_GETTHUMBLENGTH* = 1052 - TBM_GETTHUMBRECT* = 1049 - TBM_GETTIC* = 1027 - TBM_GETTICPOS* = 1039 - TBM_SETLINESIZE* = 1047 - TBM_SETPAGESIZE* = 1045 - TBM_SETPOS* = 1029 - TBM_SETRANGE* = 1030 - TBM_SETRANGEMAX* = 1032 - TBM_SETRANGEMIN* = 1031 - TBM_SETSEL* = 1034 - TBM_SETSELEND* = 1036 - TBM_SETSELSTART* = 1035 - TBM_SETTHUMBLENGTH* = 1051 - TBM_SETTIC* = 1028 - TBM_SETTICFREQ* = 1044 - # Tool bar control notifications - TBN_BEGINADJUST* = -703 - TBN_BEGINDRAG* = -701 - TBN_CUSTHELP* = -709 - TBN_ENDADJUST* = -704 - TBN_ENDDRAG* = -702 - TBN_GETBUTTONINFOW* = -720 - TBN_GETBUTTONINFOA* = -700 - -when defined(winUnicode): - const - TBN_GETBUTTONINFO* = TBN_GETBUTTONINFOW -else: - const - TBN_GETBUTTONINFO* = TBN_GETBUTTONINFOA -# UNICODE - -const - TBN_QUERYDELETE* = -707 - TBN_QUERYINSERT* = -706 - TBN_RESET* = -705 - TBN_TOOLBARCHANGE* = -708 - # Tab control - TCM_ADJUSTRECT* = 4904 - TCM_DELETEALLITEMS* = 4873 - TCM_DELETEITEM* = 4872 - TCM_GETCURFOCUS* = 4911 - TCM_GETCURSEL* = 4875 - TCM_GETIMAGELIST* = 4866 - TCM_GETITEMW* = 4924 - TCM_INSERTITEMW* = 4926 - TCM_SETITEMW* = 4925 - TCM_GETITEMA* = 4869 - TCM_INSERTITEMA* = 4871 - TCM_SETITEMA* = 4870 - -when defined(winUnicode): - const - TCM_GETITEM* = TCM_GETITEM - TCM_INSERTITEM* = TCM_INSERTITEMW - TCM_SETITEM* = TCM_SETITEMW -else: - const - TCM_GETITEM* = TCM_GETITEMA - TCM_INSERTITEM* = TCM_INSERTITEMA - TCM_SETITEM* = TCM_SETITEMA -# UNICODE - -const - TCM_GETITEMCOUNT* = 4868 - TCM_GETITEMRECT* = 4874 - TCM_GETROWCOUNT* = 4908 - TCM_GETTOOLTIPS* = 4909 - TCM_HITTEST* = 4877 - TCM_REMOVEIMAGE* = 4906 - TCM_SETCURFOCUS* = 4912 - TCM_SETCURSEL* = 4876 - TCM_SETIMAGELIST* = 4867 - TCM_SETITEMEXTRA* = 4878 - TCM_SETITEMSIZE* = 4905 - TCM_SETPADDING* = 4907 - TCM_SETTOOLTIPS* = 4910 - # Tab control notifications - TCN_KEYDOWN* = -550 - TCN_SELCHANGE* = -551 - TCN_SELCHANGING* = -552 - # Tool tip control - TTM_ACTIVATE* = 1025 - TTM_ADDTOOLW* = 1074 - TTM_DELTOOLW* = 1075 - TTM_ENUMTOOLSW* = 1082 - TTM_GETCURRENTTOOLW* = 1083 - TTM_GETTEXTW* = 1080 - TTM_GETTOOLINFOW* = 1077 - TTM_HITTESTW* = 1079 - TTM_NEWTOOLRECTW* = 1076 - TTM_SETTOOLINFOW* = 1078 - TTM_UPDATETIPTEXTW* = 1081 - TTM_ADDTOOLA* = 1028 - TTM_DELTOOLA* = 1029 - TTM_ENUMTOOLSA* = 1038 - TTM_GETCURRENTTOOLA* = 1039 - TTM_GETTEXTA* = 1035 - TTM_GETTOOLINFOA* = 1032 - TTM_HITTESTA* = 1034 - TTM_NEWTOOLRECTA* = 1030 - TTM_SETTOOLINFOA* = 1033 - TTM_UPDATETIPTEXTA* = 1036 - -when defined(winUnicode): - const - TTM_ADDTOOL* = TTM_ADDTOOLW - TTM_DELTOOL* = TTM_DELTOOLW - TTM_ENUMTOOLS* = TTM_ENUMTOOLSW - TTM_GETCURRENTTOOL* = TTM_GETCURRENTTOOLW - TTM_GETTEXT* = TTM_GETTEXTW - TTM_GETTOOLINFO* = TTM_GETTOOLINFOW - TTM_HITTEST* = TTM_HITTESTW - TTM_NEWTOOLRECT* = TTM_NEWTOOLRECTW - TTM_SETTOOLINFO* = TTM_SETTOOLINFOW - TTM_UPDATETIPTEXT* = TTM_UPDATETIPTEXTW -else: - const - TTM_ADDTOOL* = TTM_ADDTOOLA - TTM_DELTOOL* = TTM_DELTOOLA - TTM_ENUMTOOLS* = TTM_ENUMTOOLSA - TTM_GETCURRENTTOOL* = TTM_GETCURRENTTOOLA - TTM_GETTEXT* = TTM_GETTEXTA - TTM_GETTOOLINFO* = TTM_GETTOOLINFOA - TTM_HITTEST* = TTM_HITTESTA - TTM_NEWTOOLRECT* = TTM_NEWTOOLRECTA - TTM_SETTOOLINFO* = TTM_SETTOOLINFOA - TTM_UPDATETIPTEXT* = TTM_UPDATETIPTEXTA -# UNICODE - -const - TTM_GETTOOLCOUNT* = 1037 - TTM_RELAYEVENT* = 1031 - TTM_SETDELAYTIME* = 1027 - TTM_WINDOWFROMPOINT* = 1040 - # Tool tip control notification - TTN_NEEDTEXTW* = -530 - TTN_NEEDTEXTA* = -520 - -when defined(winUnicode): - const - TTN_NEEDTEXT* = TTN_NEEDTEXTW -else: - const - TTN_NEEDTEXT* = TTN_NEEDTEXTA -# UNICODE - -const - TTN_POP* = -522 - TTN_SHOW* = -521 - # Tree view control - TVM_CREATEDRAGIMAGE* = 4370 - TVM_DELETEITEM* = 4353 - TVM_ENDEDITLABELNOW* = 4374 - TVM_ENSUREVISIBLE* = 4372 - TVM_EXPAND* = 4354 - TVM_GETCOUNT* = 4357 - TVM_GETEDITCONTROL* = 4367 - TVM_GETIMAGELIST* = 4360 - TVM_GETINDENT* = 4358 - TVM_GETITEMRECT* = 4356 - TVM_GETNEXTITEM* = 4362 - TVM_GETVISIBLECOUNT* = 4368 - TVM_HITTEST* = 4369 - TVM_EDITLABELW* = 4417 - TVM_GETISEARCHSTRINGW* = 4416 - TVM_GETITEMW* = 4414 - TVM_INSERTITEMW* = 4402 - TVM_SETITEMW* = 4415 - TVM_EDITLABELA* = 4366 - TVM_GETISEARCHSTRINGA* = 4375 - TVM_GETITEMA* = 4364 - TVM_INSERTITEMA* = 4352 - TVM_SETITEMA* = 4365 - -when defined(winUnicode): - const - TVM_EDITLABEL* = TVM_EDITLABELW - TVM_GETISEARCHSTRING* = TVM_GETISEARCHSTRINGW - TVM_GETITEM* = TVM_GETITEMW - TVM_INSERTITEM* = TVM_INSERTITEMW - TVM_SETITEM* = TVM_SETITEMW -else: - const - TVM_EDITLABEL* = TVM_EDITLABELA - TVM_GETISEARCHSTRING* = TVM_GETISEARCHSTRINGA - TVM_GETITEM* = TVM_GETITEMA - TVM_INSERTITEM* = TVM_INSERTITEMA - TVM_SETITEM* = TVM_SETITEMA -# UNICODE - -const - TVM_SELECTITEM* = 4363 - TVM_SETIMAGELIST* = 4361 - TVM_SETINDENT* = 4359 - TVM_SORTCHILDREN* = 4371 - TVM_SORTCHILDRENCB* = 4373 - # Tree view control notification - TVN_KEYDOWN* = -412 - TVN_BEGINDRAGW* = -456 - TVN_BEGINLABELEDITW* = -459 - TVN_BEGINRDRAGW* = -457 - TVN_DELETEITEMW* = -458 - TVN_ENDLABELEDITW* = -460 - TVN_GETDISPINFOW* = -452 - TVN_ITEMEXPANDEDW* = -455 - TVN_ITEMEXPANDINGW* = -454 - TVN_SELCHANGEDW* = -451 - TVN_SELCHANGINGW* = -450 - TVN_SETDISPINFOW* = -453 - TVN_BEGINDRAGA* = -407 - TVN_BEGINLABELEDITA* = -410 - TVN_BEGINRDRAGA* = -408 - TVN_DELETEITEMA* = -409 - TVN_ENDLABELEDITA* = -411 - TVN_GETDISPINFOA* = -403 - TVN_ITEMEXPANDEDA* = -406 - TVN_ITEMEXPANDINGA* = -405 - TVN_SELCHANGEDA* = -402 - TVN_SELCHANGINGA* = -401 - TVN_SETDISPINFOA* = -404 - -when defined(winUnicode): - const - TVN_BEGINDRAG* = TVN_BEGINDRAGW - TVN_BEGINLABELEDIT* = TVN_BEGINLABELEDITW - TVN_BEGINRDRAG* = TVN_BEGINRDRAGW - TVN_DELETEITEM* = TVN_DELETEITEMW - TVN_ENDLABELEDIT* = TVN_ENDLABELEDITW - TVN_GETDISPINFO* = TVN_GETDISPINFOW - TVN_ITEMEXPANDED* = TVN_ITEMEXPANDEDW - TVN_ITEMEXPANDING* = TVN_ITEMEXPANDINGW - TVN_SELCHANGED* = TVN_SELCHANGEDW - TVN_SELCHANGING* = TVN_SELCHANGINGW - TVN_SETDISPINFO* = TVN_SETDISPINFOW -else: - const - TVN_BEGINDRAG* = TVN_BEGINDRAGA - TVN_BEGINLABELEDIT* = TVN_BEGINLABELEDITA - TVN_BEGINRDRAG* = TVN_BEGINRDRAGA - TVN_DELETEITEM* = TVN_DELETEITEMA - TVN_ENDLABELEDIT* = TVN_ENDLABELEDITA - TVN_GETDISPINFO* = TVN_GETDISPINFOA - TVN_ITEMEXPANDED* = TVN_ITEMEXPANDEDA - TVN_ITEMEXPANDING* = TVN_ITEMEXPANDINGA - TVN_SELCHANGED* = TVN_SELCHANGEDA - TVN_SELCHANGING* = TVN_SELCHANGINGA - TVN_SETDISPINFO* = TVN_SETDISPINFOA -# UNICODE - -const - # Up/down control - UDM_GETACCEL* = 1132 - UDM_GETBASE* = 1134 - UDM_GETBUDDY* = 1130 - UDM_GETPOS* = 1128 - UDM_GETPOS32* = 1138 - UDM_GETRANGE* = 1126 - UDM_GETRANGE32* = 1136 - UDM_SETACCEL* = 1131 - UDM_SETBASE* = 1133 - UDM_SETBUDDY* = 1129 - UDM_SETPOS* = 1127 - UDM_SETPOS32* = 1137 - UDM_SETRANGE* = 1125 - UDM_SETRANGE32* = 1135 - # Up/down control notification - UDN_DELTAPOS* = -722 - # Window messages - WM_ACTIVATE* = 6 - WM_ACTIVATEAPP* = 28 - WM_ASKCBFORMATNAME* = 780 - WM_CANCELJOURNAL* = 75 - WM_CANCELMODE* = 31 - WM_CAPTURECHANGED* = 533 - WM_CHANGECBCHAIN* = 781 - WM_CHAR* = 258 - WM_CHARTOITEM* = 47 - WM_CHILDACTIVATE* = 34 - WM_CHOOSEFONT_GETLOGFONT* = 1025 - WM_CHOOSEFONT_SETLOGFONT* = 1125 - WM_CHOOSEFONT_SETFLAGS* = 1126 - WM_CLEAR* = 771 - WM_CLOSE* = 16 - WM_COMMAND* = 273 - WM_COMPACTING* = 65 - WM_COMPAREITEM* = 57 - WM_CONTEXTMENU* = 123 - WM_COPY* = 769 - WM_COPYDATA* = 74 - WM_CREATE* = 1 - WM_CTLCOLORBTN* = 309 - WM_CTLCOLORDLG* = 310 - WM_CTLCOLOREDIT* = 307 - WM_CTLCOLORLISTBOX* = 308 - WM_CTLCOLORMSGBOX* = 306 - WM_CTLCOLORSCROLLBAR* = 311 - WM_CTLCOLORSTATIC* = 312 - WM_CUT* = 768 - WM_DEADCHAR* = 259 - WM_DELETEITEM* = 45 - WM_DESTROY* = 2 - WM_DESTROYCLIPBOARD* = 775 - WM_DEVICECHANGE* = 537 - WM_DEVMODECHANGE* = 27 - WM_DISPLAYCHANGE* = 126 - WM_DRAWCLIPBOARD* = 776 - WM_DRAWITEM* = 43 - WM_DROPFILES* = 563 - WM_ENABLE* = 10 - WM_ENDSESSION* = 22 - WM_ENTERIDLE* = 289 - WM_ENTERMENULOOP* = 529 - WM_ENTERSIZEMOVE* = 561 - WM_ERASEBKGND* = 20 - WM_EXITMENULOOP* = 530 - WM_EXITSIZEMOVE* = 562 - WM_FONTCHANGE* = 29 - WM_GETDLGCODE* = 135 - WM_GETFONT* = 49 - WM_GETHOTKEY* = 51 - WM_GETICON* = 127 - WM_GETMINMAXINFO* = 36 - WM_GETTEXT* = 13 - WM_GETTEXTLENGTH* = 14 - WM_HELP* = 83 - WM_HOTKEY* = 786 - WM_HSCROLL* = 276 - WM_HSCROLLCLIPBOARD* = 782 - WM_ICONERASEBKGND* = 39 - WM_IME_CHAR* = 646 - WM_IME_COMPOSITION* = 271 - WM_IME_COMPOSITIONFULL* = 644 - WM_IME_CONTROL* = 643 - WM_IME_ENDCOMPOSITION* = 270 - WM_IME_KEYDOWN* = 656 - WM_IME_KEYUP* = 657 - WM_IME_NOTIFY* = 642 - WM_IME_SELECT* = 645 - WM_IME_SETCONTEXT* = 641 - WM_IME_STARTCOMPOSITION* = 269 - WM_INITDIALOG* = 272 - WM_INITMENU* = 278 - WM_INITMENUPOPUP* = 279 - WM_INPUTLANGCHANGE* = 81 - WM_INPUTLANGCHANGEREQUEST* = 80 - WM_KEYDOWN* = 256 - WM_KEYUP* = 257 - WM_KILLFOCUS* = 8 - WM_LBUTTONDBLCLK* = 515 - WM_LBUTTONDOWN* = 513 - WM_LBUTTONUP* = 514 - WM_MBUTTONDBLCLK* = 521 - WM_MBUTTONDOWN* = 519 - WM_MBUTTONUP* = 520 - WM_MDIACTIVATE* = 546 - WM_MDICASCADE* = 551 - WM_MDICREATE* = 544 - WM_MDIDESTROY* = 545 - WM_MDIGETACTIVE* = 553 - WM_MDIICONARRANGE* = 552 - WM_MDIMAXIMIZE* = 549 - WM_MDINEXT* = 548 - WM_MDIREFRESHMENU* = 564 - WM_MDIRESTORE* = 547 - WM_MDISETMENU* = 560 - WM_MDITILE* = 550 - WM_MEASUREITEM* = 44 - WM_MENUCHAR* = 288 - WM_MENUSELECT* = 287 - WM_MOUSEACTIVATE* = 33 - WM_MOUSEMOVE* = 512 - WM_MOUSEWHEEL* = 522 - WM_MOUSEHOVER* = 673 - WM_MOUSELEAVE* = 675 - WM_MOVE* = 3 - WM_MOVING* = 534 - WM_NCACTIVATE* = 134 - WM_NCCALCSIZE* = 131 - WM_NCCREATE* = 129 - WM_NCDESTROY* = 130 - WM_NCHITTEST* = 132 - WM_NCLBUTTONDBLCLK* = 163 - WM_NCLBUTTONDOWN* = 161 - WM_NCLBUTTONUP* = 162 - WM_NCMBUTTONDBLCLK* = 169 - WM_NCMBUTTONDOWN* = 167 - WM_NCMBUTTONUP* = 168 - WM_NCMOUSEMOVE* = 160 - WM_NCPAINT* = 133 - WM_NCRBUTTONDBLCLK* = 166 - WM_NCRBUTTONDOWN* = 164 - WM_NCRBUTTONUP* = 165 - WM_NEXTDLGCTL* = 40 - WM_NOTIFY* = 78 - WM_NOTIFYFORMAT* = 85 - WM_NULL* = 0 - WM_PAINT* = 15 - WM_PAINTCLIPBOARD* = 777 - WM_PAINTICON* = 38 - WM_PALETTECHANGED* = 785 - WM_PALETTEISCHANGING* = 784 - WM_PARENTNOTIFY* = 528 - WM_PASTE* = 770 - WM_PENWINFIRST* = 896 - WM_PENWINLAST* = 911 - WM_POWER* = 72 - WM_POWERBROADCAST* = 536 - WM_PRINT* = 791 - WM_PRINTCLIENT* = 792 - WM_PSD_ENVSTAMPRECT* = 1029 - WM_PSD_FULLPAGERECT* = 1025 - WM_PSD_GREEKTEXTRECT* = 1028 - WM_PSD_MARGINRECT* = 1027 - WM_PSD_MINMARGINRECT* = 1026 - WM_PSD_PAGESETUPDLG* = 1024 - WM_PSD_YAFULLPAGERECT* = 1030 - WM_QUERYDRAGICON* = 55 - WM_QUERYENDSESSION* = 17 - WM_QUERYNEWPALETTE* = 783 - WM_QUERYOPEN* = 19 - WM_QUEUESYNC* = 35 - WM_QUIT* = 18 - WM_RBUTTONDBLCLK* = 518 - WM_RBUTTONDOWN* = 516 - WM_RBUTTONUP* = 517 - WM_RENDERALLFORMATS* = 774 - WM_RENDERFORMAT* = 773 - WM_SETCURSOR* = 32 - WM_SETFOCUS* = 7 - WM_SETFONT* = 48 - WM_SETHOTKEY* = 50 - WM_SETICON* = 128 - WM_SETREDRAW* = 11 - WM_SETTEXT* = 12 - WM_SETTINGCHANGE* = 26 - WM_SHOWWINDOW* = 24 - WM_SIZE* = 5 - WM_SIZECLIPBOARD* = 779 - WM_SIZING* = 532 - WM_SPOOLERSTATUS* = 42 - WM_STYLECHANGED* = 125 - WM_STYLECHANGING* = 124 - WM_SYSCHAR* = 262 - WM_SYSCOLORCHANGE* = 21 - WM_SYSCOMMAND* = 274 - WM_SYSDEADCHAR* = 263 - WM_SYSKEYDOWN* = 260 - WM_SYSKEYUP* = 261 - WM_TCARD* = 82 - WM_TIMECHANGE* = 30 - WM_TIMER* = 275 - WM_UNDO* = 772 - WM_USER* = 1024 - WM_USERCHANGED* = 84 - WM_VKEYTOITEM* = 46 - WM_VSCROLL* = 277 - WM_VSCROLLCLIPBOARD* = 778 - WM_WINDOWPOSCHANGED* = 71 - WM_WINDOWPOSCHANGING* = 70 - WM_WININICHANGE* = 26 - # Window message ranges - WM_KEYFIRST* = 256 - WM_KEYLAST* = 264 - WM_MOUSEFIRST* = 512 - WM_MOUSELAST* = 525 - WM_XBUTTONDOWN* = 523 - WM_XBUTTONUP* = 524 - WM_XBUTTONDBLCLK* = 525 - -when defined(cpu64): - type - HALFLRESULT* = DWORD - HALFPARAM* = DWORD - HALFPARAMBOOL* = WINBOOL -else: - type - HALFLRESULT* = int16 - HALFPARAM* = int16 - HALFPARAMBOOL* = WORDBOOL -type - MSG* {.final, pure.} = object - hwnd*: HWND - message*: UINT - wParam*: WPARAM - lParam*: LPARAM - time*: DWORD - pt*: POINT - - LPMSG* = ptr MSG - TMSG* = MSG - PMSG* = ptr MSG - PMessage* = ptr TMessage - TMessage* {.final, pure.} = object #fields according to ICS - msg*: UINT - wParam*: WPARAM - lParam*: LPARAM - Result*: LRESULT - - TWMSize* {.final, pure.} = object - Msg*: UINT - SizeType*: WPARAM - Width*: HALFPARAM - Height*: HALFPARAM - Result*: LRESULT - - TWMNoParams* {.final, pure.} = object - Msg*: UINT - Unused*: array[0..3, HALFPARAM] - Result*: LRESULT - - TWMCancelMode* = TWMNoParams - TWMNCDestroy* = TWMNoParams - TWMDestroy* = TWMNoParams - TWMClose* = TWMNoParams - TWMQueryUIState* = TWMNoParams - TWMUIState* {.final, pure.} = object - Msg*: UINT - Action*: int16 - Flags*: int16 - Unused*: HRESULT - - TWMChangeUIState* = TWMUIState - TWMUpdateUIState* = TWMUIState - TWMKey* {.final, pure.} = object - Msg*: UINT - CharCode*: int16 - Unused*: int16 - KeyData*: int32 - Result*: LRESULT - - TWMKeyDown* = TWMKey - TWMKeyUp* = TWMKey - TWMChar* = TWMKey - TWMSysChar* = TWMKey - TWMSysKeyDown* = TWMKey - TWMSysKeyUp* = TWMKey - TWMMenuChar* {.final, pure.} = object - Msg*: UINT - User*: Char - MenuFlag*: int16 - Menu*: HMENU - Result*: LRESULT - - TWMGetDlgCode* = TWMNoParams - TWMFontChange* = TWMNoParams - TWMGetFont* = TWMNoParams - TWMSysColorChange* = TWMNoParams - TWMQueryDragIcon* = TWMNoParams - TWMScroll* {.final, pure.} = object - Msg*: UINT - ScrollCode*: HALFPARAM - Pos*: HALFPARAM - ScrollBar*: HWND - Result*: LRESULT - - TWMHScroll* = TWMScroll - TWMVScroll* = TWMScroll - TWMGetText* {.final, pure.} = object - Msg*: UINT - TextMax*: LPARAM - Text*: cstring - Result*: LRESULT - - TWMGetTextLength* = TWMNoParams - TWMKillFocus* {.final, pure.} = object - Msg*: UINT - FocusedWnd*: HWND - UnUsed*: WPARAM - Result*: LRESULT - - TWMSetCursor* {.final, pure.} = object - Msg*: UINT - CursorWnd*: HWND - HitTest*: HALFPARAM - MouseMsg*: HALFPARAM - Result*: LRESULT - - TWMSetFocus* {.final, pure.} = object - Msg*: UINT - FocusedWnd*: HWND - Unused*: WPARAM - Result*: LRESULT - - TWMSetFont* {.final, pure.} = object - Msg*: UINT - Font*: HFONT - Redraw*: HALFPARAMBOOL - Unused*: HALFPARAM - Result*: LRESULT - - TWMShowWindow* {.final, pure.} = object - Msg*: UINT - Show*: HALFPARAMBOOL - Unused*: HALFPARAM - Status*: WPARAM - Result*: LRESULT - - TWMEraseBkgnd* {.final, pure.} = object - Msg*: UINT - DC*: HDC - Unused*: LPARAM - Result*: LRESULT - - TWMNCHitTest* {.final, pure.} = object - Msg*: UINT - Unused*: int32 - Pos*: TSmallPoint - Result*: LRESULT - - TWMMouse* {.final, pure.} = object - Msg*: UINT - Keys*: int32 - Pos*: TSmallPoint - Result*: LRESULT - - TWMLButtonDblClk* = TWMMouse - TWMLButtonDown* = TWMMouse - TWMLButtonUp* = TWMMouse - TWMMButtonDblClk* = TWMMouse - TWMMButtonDown* = TWMMouse - TWMMButtonUp* = TWMMouse - TWMMouseWheel* {.final, pure.} = object - Msg*: UINT - Keys*: int16 - WheelDelta*: int16 - Pos*: TSmallPoint - Result*: LRESULT - - TWMNCHitMessage* {.final, pure.} = object - 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* {.final, pure.} = object - Msg*: UINT - DC*: HDC - Unused*: int32 - Result*: LRESULT - - TWMCommand* {.final, pure.} = object - Msg*: UINT - ItemID*: int16 - NotifyCode*: int16 - Ctl*: HWND - Result*: LRESULT - - TWMNotify* {.final, pure.} = object - Msg*: UINT - IDCtrl*: int32 - NMHdr*: PNMHdr - Result*: LRESULT - - TWMPrint* {.final, pure.} = object - Msg*: UINT - DC*: HDC - Flags*: int - Result*: LRESULT - - TWMPrintClient* = TWMPrint - TWMWinIniChange* {.final, pure.} = object - Msg*: UINT - Unused*: int - Section*: cstring - Result*: LRESULT - - TWMContextMenu* {.final, pure.} = object - Msg*: UINT - hWnd*: HWND - Pos*: TSmallPoint - Result*: LRESULT - - TWMNCCalcSize* {.final, pure.} = object - Msg*: UINT - CalcValidRects*: WINBOOL - CalcSize_Params*: PNCCalcSizeParams - Result*: LRESULT - - TWMCharToItem* {.final, pure.} = object - Msg*: UINT - Key*: int16 - CaretPos*: int16 - ListBox*: HWND - Result*: LRESULT - - TWMVKeyToItem* = TWMCharToItem - TMyEventRange = range[0'i16..16000'i16] - TWMParentNotify* {.final, pure.} = object - 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* {.final, pure.} = object - 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* {.final, pure.} = object - Msg*: UINT - Unused*: int - Pos*: TSmallPoint - Result*: LRESULT - - TWMWindowPosMsg* {.final, pure.} = object - Msg*: UINT - Unused*: int - WindowPos*: PWindowPos - Result*: LRESULT - - TWMWindowPosChanged* = TWMWindowPosMsg - TWMWindowPosChanging* = TWMWindowPosMsg - TWMCompareItem* {.final, pure.} = object - Msg*: UINT - Ctl*: HWnd - CompareItemStruct*: PCompareItemStruct - Result*: LRESULT - - TWMDeleteItem* {.final, pure.} = object - Msg*: UINT - Ctl*: HWND - DeleteItemStruct*: PDeleteItemStruct - Result*: LRESULT - - TWMDrawItem* {.final, pure.} = object - Msg*: UINT - Ctl*: HWND - DrawItemStruct*: PDrawItemStruct - Result*: LRESULT - - TWMMeasureItem* {.final, pure.} = object - Msg*: UINT - IDCtl*: HWnd - MeasureItemStruct*: PMeasureItemStruct - Result*: LRESULT - - TWMNCCreate* {.final, pure.} = object - Msg*: UINT - Unused*: int - CreateStruct*: PCreateStruct - Result*: LRESULT - - TWMInitMenuPopup* {.final, pure.} = object - Msg*: UINT - MenuPopup*: HMENU - Pos*: int16 - SystemMenu*: WordBool - Result*: LRESULT - - TWMMenuSelect* {.final, pure.} = object - Msg*: UINT - IDItem*: int16 - MenuFlag*: int16 - Menu*: HMENU - Result*: LRESULT - - TWMActivate* {.final, pure.} = object - Msg*: UINT - Active*: int16 - Minimized*: WordBool - ActiveWindow*: HWND - Result*: LRESULT - - TWMQueryEndSession* {.final, pure.} = object - Msg*: UINT - Source*: int32 - Unused*: int32 - Result*: LRESULT - - TWMMDIActivate* {.final, pure.} = object - Msg*: UINT - DeactiveWnd*: HWND - ActiveWnd*: HWND - Result*: LRESULT - - TWMNextDlgCtl* {.final, pure.} = object - Msg*: UINT - CtlFocus*: int32 - Handle*: WordBool - Unused*: int16 - Result*: LRESULT - - TWMHelp* {.final, pure.} = object - Msg*: UINT - Unused*: int - HelpInfo*: PHelpInfo - Result*: LRESULT - - TWMGetMinMaxInfo* {.final, pure.} = object - Msg*: UINT - Unused*: int - MinMaxInfo*: PMinMaxInfo - Result*: LRESULT - - TWMSettingChange* {.final, pure.} = object - Msg*: UINT - Flag*: int - Section*: cstring - Result*: LRESULT - - TWMCreate* {.final, pure.} = object - Msg*: UINT - Unused*: int - CreateStruct*: PCreateStruct - Result*: LRESULT - - TWMCtlColor* {.final, pure.} = object - Msg*: UINT - ChildDC*: HDC - ChildWnd*: HWND - Result*: LRESULT - - TWMCtlColorScrollbar* = TWMCtlColor - TWMCtlColorStatic* = TWMCtlColor - TWMCtlColorBtn* = TWMCtlColor - TWMCtlColorListbox* = TWMCtlColor - TWMCtlColorMsgbox* = TWMCtlColor - TWMCtlColorDlg* = TWMCtlColor - TWMCtlColorEdit* = TWMCtlColor - TWMInitDialog* {.final, pure.} = object - Msg*: UINT - Focus*: HWND - InitParam*: int32 - Result*: LRESULT - - TWMNCPaint* {.final, pure.} = object - Msg*: UINT - RGN*: HRGN - Unused*: int32 - Result*: LRESULT - - TWMSetText* {.final, pure.} = object - Msg*: UINT - Unused*: int32 - Text*: cstring - Result*: LRESULT - - TWMSizeClipboard* {.final, pure.} = object - Msg*: UINT - Viewer*: HWND - RC*: THandle - Result*: LRESULT - - TWMSpoolerStatus* {.final, pure.} = object - Msg*: UINT - JobStatus*: LPARAM - JobsLeft*: WPARAM - Unused*: WPARAM - Result*: LRESULT - - TWMStyleChange* {.final, pure.} = object - Msg*: UINT - StyleType*: LPARAM - StyleStruct*: PStyleStruct - Result*: LRESULT - - TWMStyleChanged* = TWMStyleChange - TWMStyleChanging* = TWMStyleChange - TWMSysDeadChar* {.final, pure.} = object - Msg*: UINT - CharCode*: WPARAM - Unused*: WPARAM - KeyData*: LPARAM - Result*: LRESULT - - TWMSystemError* {.final, pure.} = object - Msg*: UINT - ErrSpec*: WPARAM - Unused*: LPARAM - Result*: LRESULT - - TWMTimeChange* = TWMNoParams - TWMTimer* {.final, pure.} = object - Msg*: UINT - TimerID*: LPARAM - TimerProc*: TFarProc - Result*: LRESULT - - TWMUndo* = TWMNoParams - TWMVScrollClipboard* {.final, pure.} = object - Msg*: UINT - Viewer*: HWND - ScollCode*: WPARAM - ThumbPos*: WPARAM - Result*: LRESULT - - TWMDisplayChange* {.final, pure.} = object - Msg*: UINT - BitsPerPixel*: int - Width*: WPARAM - Height*: WPARAM - Result*: LRESULT - - TWMDropFiles* {.final, pure.} = object - Msg*: UINT - Drop*: THANDLE - Unused*: LPARAM - Result*: LRESULT - - TWMEnable* {.final, pure.} = object - Msg*: int - Enabled*: WINBOOL - Unused*: int32 - Result*: int32 - - TWMMouseActivate* {.final, pure.} = object - Msg*: int - TopLevel*: HWND - HitTestCode*: int16 - MouseMsg*: int16 - Result*: int32 - - -proc GetBinaryTypeA*(lpApplicationName: LPCSTR, lpBinaryType: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "GetBinaryTypeA".} - -proc GetShortPathNameA*(lpszLongPath: LPCSTR, lpszShortPath: LPSTR, - cchBuffer: DWORD): DWORD{.stdcall, - dynlib: "kernel32", importc.} -proc GetEnvironmentStringsA*(): LPSTR{.stdcall, dynlib: "kernel32", importc.} -proc FreeEnvironmentStringsA*(para1: LPSTR): WINBOOL{.stdcall, dynlib: "kernel32", importc.} -proc FormatMessageA*(dwFlags: DWORD, lpSource: LPCVOID, dwMessageId: DWORD, - dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, - Arguments: va_list): DWORD{.stdcall,dynlib: "kernel32", importc.} -proc CreateMailslotA*(lpName: LPCSTR, nMaxMessageSize: DWORD, - lReadTimeout: DWORD, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{. - stdcall, dynlib: "kernel32", importc.} -proc lstrcmpA*(lpString1: LPCSTR, lpString2: LPCSTR): int32{.stdcall, - dynlib: "kernel32", importc.} -proc lstrcmpiA*(lpString1: LPCSTR, lpString2: LPCSTR): int32{.stdcall, dynlib: "kernel32", importc.} -proc lstrcpynA*(lpString1: LPSTR, lpString2: LPCSTR, iMaxLength: int32): LPSTR{. - stdcall, dynlib: "kernel32", importc.} -proc CreateMutexA*(lpMutexAttributes: LPSECURITY_ATTRIBUTES, - bInitialOwner: WINBOOL, lpName: LPCSTR): HANDLE{.stdcall, - dynlib: "kernel32", importc.} -proc OpenMutexA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCSTR): HANDLE{. - stdcall, dynlib: "kernel32", importc.} -proc CreateEventA*(lpEventAttributes: LPSECURITY_ATTRIBUTES, - bManualReset: WINBOOL, bInitialState: WINBOOL, lpName: LPCSTR): HANDLE{. - stdcall, dynlib: "kernel32", importc.} -proc OpenEventA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCSTR): HANDLE{. - stdcall, dynlib: "kernel32", importc.} -proc CreateSemaphoreA*(lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES, - lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCSTR): HANDLE{. - stdcall, dynlib: "kernel32", importc.} -proc OpenSemaphoreA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, - lpName: LPCSTR): HANDLE{.stdcall, - dynlib: "kernel32", importc.} -proc CreateFileMappingA*(hFile: HANDLE, - lpFileMappingAttributes: LPSECURITY_ATTRIBUTES, - flProtect: DWORD, dwMaximumSizeHigh: DWORD, - dwMaximumSizeLow: DWORD, lpName: LPCSTR): HANDLE{. - stdcall, dynlib: "kernel32", importc.} -proc OpenFileMappingA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, - lpName: LPCSTR): HANDLE{.stdcall, - dynlib: "kernel32", importc.} -proc GetLogicalDriveStringsA*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{. - stdcall, dynlib: "kernel32", importc.} -proc LoadLibraryA*(lpLibFileName: LPCSTR): HINST{.stdcall, - dynlib: "kernel32", importc.} -proc LoadLibraryExA*(lpLibFileName: LPCSTR, hFile: HANDLE, dwFlags: DWORD): HINST{. - stdcall, dynlib: "kernel32", importc.} -proc GetModuleFileNameA*(hModule: HINST, lpFilename: LPSTR, nSize: DWORD): DWORD{. - stdcall, dynlib: "kernel32", importc.} -proc GetModuleHandleA*(lpModuleName: LPCSTR): HMODULE{.stdcall, - dynlib: "kernel32", importc.} -proc FatalAppExitA*(uAction: 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, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".} -proc GetDefaultCommConfigA*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, - lpdwSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetDefaultCommConfigA".} -proc SetDefaultCommConfigA*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigA".} -proc GetComputerNameA*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetComputerNameA".} -proc SetComputerNameA*(lpComputerName: LPCSTR): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetComputerNameA".} -proc GetUserNameA*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "GetUserNameA".} -proc LoadKeyboardLayoutA*(pwszKLID: LPCSTR, Flags: 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, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "EnumDesktopsA".} -proc CreateWindowStationA*(lpwinsta: LPSTR, dwReserved: DWORD, - dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{. - stdcall, dynlib: "user32", importc: "CreateWindowStationA".} -proc OpenWindowStationA*(lpszWinSta: LPSTR, fInherit: WINBOOL, - dwDesiredAccess: DWORD): HWINSTA{.stdcall, - dynlib: "user32", importc: "OpenWindowStationA".} -proc EnumWindowStationsA*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnumWindowStationsA".} -proc GetUserObjectInformationA*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, - nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".} -proc SetUserObjectInformationA*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, - nLength: DWORD): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetUserObjectInformationA".} -proc RegisterWindowMessageA*(lpString: LPCSTR): UINT{.stdcall, dynlib: "user32", - importc: "RegisterWindowMessageA".} -proc GetMessageA*(lpMsg: LPMSG, wnd: 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, wnd: HWND, wMsgFilterMin: UINT, - wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "PeekMessageA".} -proc SendMessageA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "SendMessageA".} -proc SendMessageTimeoutA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM, - fuFlags: UINT, uTimeout: UINT, lpdwResult: LPDWORD): LRESULT{. - stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".} -proc SendNotifyMessageA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "SendNotifyMessageA".} -proc SendMessageCallbackA*(wnd: HWND, Msg: UINT, wp: WPARAM, - lp: LPARAM, lpResultCallBack: SENDASYNCPROC, - dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32", - importc: "SendMessageCallbackA".} -proc PostMessageA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "PostMessageA".} -proc PostThreadMessageA*(idThread: DWORD, Msg: UINT, wp: WPARAM, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "PostThreadMessageA".} -proc DefWindowProcA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefWindowProcA".} -proc CallWindowProcA*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: UINT, - wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, - dynlib: "user32", importc: "CallWindowProcA".} -proc RegisterClassA*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32", - importc: "RegisterClassA".} -proc UnregisterClassA*(lpClassName: LPCSTR, hInstance: HINST): WINBOOL{.stdcall, - dynlib: "user32", importc: "UnregisterClassA".} -proc GetClassInfoA*(hInstance: HINST, lpClassName: LPCSTR, - lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, dynlib: "user32", - importc: "GetClassInfoA".} -proc RegisterClassExA*(para1: LPWNDCLASSEX): ATOM{.stdcall, dynlib: "user32", - importc: "RegisterClassExA".} -proc GetClassInfoExA*(para1: HINST, para2: LPCSTR, para3: LPWNDCLASSEX): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetClassInfoExA".} -proc CreateWindowExA*(dwExStyle: DWORD, lpClassName: LPCSTR, - lpWindowName: LPCSTR, dwStyle: DWORD, X: int32, Y: int32, - nWidth: int32, nHeight: int32, hWndParent: HWND, - menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{. - stdcall, dynlib: "user32", importc: "CreateWindowExA".} -proc CreateDialogParamA*(hInstance: HINST, lpTemplateName: LPCSTR, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", - importc: "CreateDialogParamA".} -proc CreateDialogIndirectParamA*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): HWND{.stdcall, - dynlib: "user32", importc: "CreateDialogIndirectParamA".} -proc DialogBoxParamA*(hInstance: HINST, lpTemplateName: LPCSTR, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32", - importc: "DialogBoxParamA".} -proc DialogBoxIndirectParamA*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): int32{.stdcall, - dynlib: "user32", importc: "DialogBoxIndirectParamA".} -proc SetDlgItemTextA*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCSTR): WINBOOL{. - stdcall, dynlib: "user32", importc: "SetDlgItemTextA".} -proc GetDlgItemTextA*(hDlg: HWND, nIDDlgItem: int32, lpString: LPSTR, - nMaxCount: int32): UINT{.stdcall, dynlib: "user32", - importc: "GetDlgItemTextA".} -proc SendDlgItemMessageA*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT, - wp: WPARAM, lp: LPARAM): LONG{.stdcall, - dynlib: "user32", importc: "SendDlgItemMessageA".} -proc DefDlgProcA*(hDlg: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefDlgProcA".} -proc CallMsgFilterA*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall, - dynlib: "user32", importc: "CallMsgFilterA".} -proc RegisterClipboardFormatA*(lpszFormat: LPCSTR): 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{. - stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".} -proc LoadMenuA*(hInstance: HINST, lpMenuName: LPCSTR): HMENU{.stdcall, - dynlib: "user32", importc: "LoadMenuA".} -proc LoadMenuIndirectA*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall, - dynlib: "user32", importc: "LoadMenuIndirectA".} -proc ChangeMenuA*(menu: HMENU, cmd: UINT, lpszNewItem: LPCSTR, cmdInsert: UINT, - flags: UINT): WINBOOL{.stdcall, dynlib: "user32", - importc: "ChangeMenuA".} -proc GetMenuStringA*(menu: HMENU, uIDItem: UINT, lpString: LPSTR, - nMaxCount: int32, uFlag: UINT): int32{.stdcall, - dynlib: "user32", importc: "GetMenuStringA".} -proc InsertMenuA*(menu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT, - lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32", - importc: "InsertMenuA".} -proc AppendMenuA*(menu: 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*(wnd: HWND, lpString: LPCSTR, hData: HANDLE): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetPropA".} -proc GetPropA*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, dynlib: "user32", - importc: "GetPropA".} -proc RemovePropA*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, - dynlib: "user32", importc: "RemovePropA".} -proc EnumPropsExA*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{. - stdcall, dynlib: "user32", importc: "EnumPropsExA".} -proc EnumPropsA*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall, - dynlib: "user32", importc: "EnumPropsA".} -proc SetWindowTextA*(wnd: HWND, lpString: LPCSTR): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetWindowTextA".} -proc GetWindowTextA*(wnd: HWND, lpString: LPSTR, nMaxCount: int32): int32{. - stdcall, dynlib: "user32", importc: "GetWindowTextA".} -proc GetWindowTextLengthA*(wnd: HWND): int32{.stdcall, dynlib: "user32", - importc: "GetWindowTextLengthA".} -proc MessageBoxA*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: int): int32{. - stdcall, dynlib: "user32", importc: "MessageBoxA".} -proc MessageBoxExA*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT, - wLanguageId: int16): int32{.stdcall, dynlib: "user32", - importc: "MessageBoxExA".} -proc MessageBoxIndirectA*(para1: LPMSGBOXPARAMS): int32{.stdcall, - dynlib: "user32", importc: "MessageBoxIndirectA".} -proc GetWindowLongA*(wnd: HWND, nIndex: int32): LONG{.stdcall, - dynlib: "user32", importc: "GetWindowLongA".} -proc SetWindowLongA*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.stdcall, - dynlib: "user32", importc: "SetWindowLongA".} -proc GetClassLongA*(wnd: HWND, nIndex: int32): DWORD{.stdcall, - dynlib: "user32", importc: "GetClassLongA".} -proc SetClassLongA*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.stdcall, - dynlib: "user32", importc: "SetClassLongA".} -when defined(cpu64): - proc GetWindowLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetWindowLongPtrA".} - proc SetWindowLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetWindowLongPtrA".} - proc GetClassLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetClassLongPtrA".} - proc SetClassLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetClassLongPtrA".} -else: - proc GetWindowLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetWindowLongA".} - proc SetWindowLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetWindowLongA".} - proc GetClassLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetClassLongA".} - proc SetClassLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetClassLongA".} -proc FindWindowA*(lpClassName: LPCSTR, lpWindowName: LPCSTR): HWND{.stdcall, - dynlib: "user32", importc: "FindWindowA".} -proc FindWindowExA*(para1: HWND, para2: HWND, para3: LPCSTR, para4: LPCSTR): HWND{. - stdcall, dynlib: "user32", importc: "FindWindowExA".} -proc GetClassNameA*(wnd: HWND, lpClassName: LPSTR, nMaxCount: int32): int32{. - stdcall, dynlib: "user32", importc: "GetClassNameA".} -proc SetWindowsHookExA*(idHook: int32, lpfn: HOOKPROC, hmod: HINST, - dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32", - importc: "SetWindowsHookExA".} -proc LoadBitmapA*(hInstance: HINST, lpBitmapName: LPCSTR): HBITMAP{.stdcall, - dynlib: "user32", importc: "LoadBitmapA".} -proc LoadCursorA*(hInstance: HINST, lpCursorName: LPCSTR): HCURSOR{.stdcall, - dynlib: "user32", importc: "LoadCursorA".} -proc LoadCursorFromFileA*(lpFileName: LPCSTR): HCURSOR{.stdcall, - dynlib: "user32", importc: "LoadCursorFromFileA".} -proc LoadIconA*(hInstance: HINST, lpIconName: LPCSTR): HICON{.stdcall, - dynlib: "user32", importc: "LoadIconA".} -proc LoadImageA*(para1: HINST, para2: LPCSTR, para3: 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*(wnd: HWND, hWndMDIClient: HWND, uMsg: UINT, wp: WPARAM, - lp: LPARAM): LRESULT{.stdcall, dynlib: "user32", - importc: "DefFrameProcA".} -proc DefMDIChildProcA*(wnd: HWND, uMsg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefMDIChildProcA".} -proc CreateMDIWindowA*(lpClassName: LPSTR, lpWindowName: LPSTR, dwStyle: DWORD, - X: int32, Y: int32, nWidth: int32, nHeight: int32, - hWndParent: HWND, hInstance: HINST, lp: LPARAM): HWND{. - stdcall, dynlib: "user32", importc: "CreateMDIWindowA".} -proc WinHelpA*(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: 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, menu: HMENU, hInstance: HINST, - lpParam: LPVOID): HWND -proc CreateDialogA*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): HWND -proc CreateDialogIndirectA*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): HWND -proc DialogBoxA*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): int32 -proc DialogBoxIndirectA*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): int32 -proc CreateDCA*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: pDEVMODE): HDC{. - stdcall, dynlib: "gdi32", importc: "CreateDCA".} -proc VerInstallFileA*(uFlags: DWORD, szSrcFileName: LPSTR, - szDestFileName: LPSTR, szSrcDir: LPSTR, szDestDir: LPSTR, - szCurDir: LPSTR, szTmpFile: LPSTR, lpuTmpFileLen: PUINT): DWORD{. - stdcall, dynlib: "version", importc: "VerInstallFileA".} -proc GetFileVersionInfoSizeA*(lptstrFilename: LPSTR, lpdwHandle: LPDWORD): DWORD{. - stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeA".} -proc GetFileVersionInfoA*(lptstrFilename: LPSTR, dwHandle: DWORD, dwLen: DWORD, - lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version", - importc: "GetFileVersionInfoA".} -proc VerLanguageNameA*(wLang: DWORD, szLang: LPSTR, nSize: DWORD): DWORD{. - stdcall, dynlib: "kernel32", importc: "VerLanguageNameA".} -proc VerQueryValueA*(pBlock: LPVOID, lpSubBlock: LPSTR, lplpBuffer: LPVOID, - puLen: PUINT): WINBOOL{.stdcall, dynlib: "version", - importc: "VerQueryValueA".} -proc VerFindFileA*(uFlags: DWORD, szFileName: LPSTR, szWinDir: LPSTR, - szAppDir: LPSTR, szCurDir: LPSTR, lpuCurDirLen: PUINT, - szDestDir: LPSTR, lpuDestDirLen: PUINT): DWORD{.stdcall, - dynlib: "version", importc: "VerFindFileA".} -proc RegConnectRegistryA*(lpMachineName: LPSTR, key: HKEY, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".} -proc RegCreateKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".} -proc RegCreateKeyExA*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD, - lpClass: LPSTR, dwOptions: DWORD, samDesired: REGSAM, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES, - phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".} -proc RegDeleteKeyA*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegDeleteKeyA".} -proc RegDeleteValueA*(key: HKEY, lpValueName: LPCSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegDeleteValueA".} -proc RegEnumKeyA*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, cbName: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyA".} -proc RegEnumKeyExA*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, - lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPSTR, - lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".} -proc RegEnumValueA*(key: HKEY, dwIndex: DWORD, lpValueName: LPSTR, - lpcbValueName: LPDWORD, lpReserved: LPDWORD, - lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumValueA".} -proc RegLoadKeyA*(key: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegLoadKeyA".} -proc RegOpenKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".} -proc RegOpenKeyExA*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD, - samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall, - dynlib: "advapi32", importc: "RegOpenKeyExA".} -proc RegQueryInfoKeyA*(key: HKEY, lpClass: LPSTR, lpcbClass: LPDWORD, - lpReserved: LPDWORD, lpcSubKeys: LPDWORD, - lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD, - lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD, - lpcbMaxValueLen: LPDWORD, - lpcbSecurityDescriptor: LPDWORD, - lpftLastWriteTime: PFILETIME): LONG{.stdcall, - dynlib: "advapi32", importc: "RegQueryInfoKeyA".} -proc RegQueryValueA*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPSTR, - lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32", - importc: "RegQueryValueA".} -proc RegQueryMultipleValuesA*(key: HKEY, val_list: PVALENT, num_vals: DWORD, - lpValueBuf: LPSTR, ldwTotsize: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".} -proc RegQueryValueExA*(key: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD, - lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegQueryValueExA".} -proc RegReplaceKeyA*(key: HKEY, lpSubKey: LPCSTR, lpNewFile: LPCSTR, - lpOldFile: LPCSTR): LONG{.stdcall, dynlib: "advapi32", - importc: "RegReplaceKeyA".} -proc RegRestoreKeyA*(key: HKEY, lpFile: LPCSTR, dwFlags: DWORD): LONG{.stdcall, - dynlib: "advapi32", importc: "RegRestoreKeyA".} -proc RegSaveKeyA*(key: HKEY, lpFile: LPCSTR, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall, - dynlib: "advapi32", importc: "RegSaveKeyA".} -proc RegSetValueA*(key: HKEY, lpSubKey: LPCSTR, dwType: DWORD, lpData: LPCSTR, - cbData: DWORD): LONG{.stdcall, dynlib: "advapi32", - importc: "RegSetValueA".} -proc RegSetValueExA*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD, - dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegSetValueExA".} -proc RegUnLoadKeyA*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegUnLoadKeyA".} -proc InitiateSystemShutdownA*(lpMachineName: LPSTR, lpMessage: LPSTR, - dwTimeout: DWORD, bForceAppsClosed: WINBOOL, - bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "InitiateSystemShutdownA".} -proc AbortSystemShutdownA*(lpMachineName: LPSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "AbortSystemShutdownA".} -proc CompareStringA*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCSTR, - cchCount1: int32, lpString2: LPCSTR, cchCount2: int32): int32{. - stdcall, dynlib: "kernel32", importc: "CompareStringA".} -proc LCMapStringA*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCSTR, - cchSrc: int32, lpDestStr: LPSTR, cchDest: int32): int32{. - stdcall, dynlib: "kernel32", importc: "LCMapStringA".} -proc GetLocaleInfoA*(Locale: LCID, LCType: LCTYPE, lpLCData: LPSTR, - cchData: int32): int32{.stdcall, dynlib: "kernel32", - importc: "GetLocaleInfoA".} -proc SetLocaleInfoA*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCSTR): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetLocaleInfoA".} -proc GetTimeFormatA*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME, - lpFormat: LPCSTR, lpTimeStr: LPSTR, cchTime: int32): int32{. - stdcall, dynlib: "kernel32", importc: "GetTimeFormatA".} -proc GetDateFormatA*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME, - lpFormat: LPCSTR, lpDateStr: LPSTR, cchDate: int32): int32{. - stdcall, dynlib: "kernel32", importc: "GetDateFormatA".} -proc GetNumberFormatA*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR, - lpFormat: PNUMBERFMT, lpNumberStr: LPSTR, - cchNumber: int32): int32{.stdcall, dynlib: "kernel32", - importc: "GetNumberFormatA".} -proc GetCurrencyFormatA*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR, - lpFormat: PCURRENCYFMT, lpCurrencyStr: LPSTR, - cchCurrency: int32): int32{.stdcall, - dynlib: "kernel32", importc: "GetCurrencyFormatA".} -proc EnumCalendarInfoA*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID, - Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "EnumCalendarInfoA".} -proc EnumTimeFormatsA*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID, - dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "EnumTimeFormatsA".} -proc EnumDateFormatsA*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID, - dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "EnumDateFormatsA".} -proc GetStringTypeExA*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR, - cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetStringTypeExA".} -proc GetStringTypeA*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR, - cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetStringTypeA".} -proc FoldStringA*(dwMapFlags: DWORD, lpSrcStr: LPCSTR, cchSrc: int32, - lpDestStr: LPSTR, cchDest: int32): int32{.stdcall, - dynlib: "kernel32", importc: "FoldStringA".} -proc EnumSystemLocalesA*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesA".} -proc EnumSystemCodePagesA*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, dwFlags: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "EnumSystemCodePagesA".} -proc PeekConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".} -proc ReadConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".} -proc WriteConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".} -proc ReadConsoleOutputA*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, - dwBufferSize: COORD, dwBufferCoord: COORD, - lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "ReadConsoleOutputA".} -proc WriteConsoleOutputA*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, - dwBufferSize: COORD, dwBufferCoord: COORD, - lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "WriteConsoleOutputA".} -proc ReadConsoleOutputCharacterA*(hConsoleOutput: HANDLE, lpCharacter: LPSTR, - nLength: DWORD, dwReadCoord: COORD, - lpNumberOfCharsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".} -proc WriteConsoleOutputCharacterA*(hConsoleOutput: HANDLE, lpCharacter: LPCSTR, - nLength: DWORD, dwWriteCoord: COORD, - lpNumberOfCharsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".} -proc FillConsoleOutputCharacterA*(hConsoleOutput: HANDLE, cCharacter: CHAR, - nLength: DWORD, dwWriteCoord: COORD, - lpNumberOfCharsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".} -proc ScrollConsoleScreenBufferA*(hConsoleOutput: HANDLE, - lpScrollRectangle: PSMALL_RECT, - lpClipRectangle: PSMALL_RECT, - dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".} -proc GetConsoleTitleA*(lpConsoleTitle: LPSTR, nSize: DWORD): DWORD{.stdcall, - dynlib: "kernel32", importc: "GetConsoleTitleA".} -proc SetConsoleTitleA*(lpConsoleTitle: LPCSTR): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetConsoleTitleA".} -proc ReadConsoleA*(hConsoleInput: HANDLE, lpBuffer: LPVOID, - nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, - lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "ReadConsoleA".} -proc WriteConsoleA*(hConsoleOutput: HANDLE, lpBuffer: pointer, - nNumberOfCharsToWrite: DWORD, - lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleA".} -proc WNetAddConnectionA*(lpRemoteName: LPCSTR, lpPassword: LPCSTR, - lpLocalName: LPCSTR): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetAddConnectionA".} -proc WNetAddConnection2A*(lpNetResource: LPNETRESOURCE, lpPassword: LPCSTR, - lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetAddConnection2A".} -proc WNetAddConnection3A*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, - lpPassword: LPCSTR, lpUserName: LPCSTR, dwFlags: DWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetAddConnection3A".} -proc WNetCancelConnectionA*(lpName: LPCSTR, fForce: WINBOOL): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetCancelConnectionA".} -proc WNetCancelConnection2A*(lpName: LPCSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetCancelConnection2A".} -proc WNetGetConnectionA*(lpLocalName: LPCSTR, lpRemoteName: LPSTR, - lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetGetConnectionA".} -proc WNetUseConnectionA*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, - lpUserID: LPCSTR, lpPassword: LPCSTR, dwFlags: DWORD, - lpAccessName: LPSTR, lpBufferSize: LPDWORD, - lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetUseConnectionA".} -proc WNetSetConnectionA*(lpName: LPCSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetSetConnectionA".} -proc WNetConnectionDialog1A*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".} -proc WNetDisconnectDialog1A*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetDisconnectDialog1A".} -proc WNetOpenEnumA*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD, - lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetOpenEnumA".} -proc WNetEnumResourceA*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID, - lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetEnumResourceA".} -proc WNetGetUniversalNameA*(lpLocalPath: LPCSTR, dwInfoLevel: DWORD, - lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".} -proc WNetGetUserA*(lpName: LPCSTR, lpUserName: LPSTR, lpnLength: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetUserA".} -proc WNetGetProviderNameA*(dwNetType: DWORD, lpProviderName: LPSTR, - lpBufferSize: LPDWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetGetProviderNameA".} -proc WNetGetNetworkInformationA*(lpProvider: LPCSTR, - lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".} -proc WNetGetLastErrorA*(lpError: LPDWORD, lpErrorBuf: LPSTR, - nErrorBufSize: DWORD, lpNameBuf: LPSTR, - nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetGetLastErrorA".} -proc MultinetGetConnectionPerformanceA*(lpNetResource: LPNETRESOURCE, - lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall, - dynlib: "mpr", importc: "MultinetGetConnectionPerformanceA".} -proc ChangeServiceConfigA*(hService: SC_HANDLE, dwServiceType: DWORD, - dwStartType: DWORD, dwErrorControl: DWORD, - lpBinaryPathName: LPCSTR, lpLoadOrderGroup: LPCSTR, - lpdwTagId: LPDWORD, lpDependencies: LPCSTR, - lpServiceStartName: LPCSTR, lpPassword: LPCSTR, - lpDisplayName: LPCSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "ChangeServiceConfigA".} -proc CreateServiceA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, - lpDisplayName: LPCSTR, dwDesiredAccess: DWORD, - dwServiceType: DWORD, dwStartType: DWORD, - dwErrorControl: DWORD, lpBinaryPathName: LPCSTR, - lpLoadOrderGroup: LPCSTR, lpdwTagId: LPDWORD, - lpDependencies: LPCSTR, lpServiceStartName: LPCSTR, - lpPassword: LPCSTR): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "CreateServiceA".} -proc EnumDependentServicesA*(hService: SC_HANDLE, dwServiceState: DWORD, - lpServices: LPENUM_SERVICE_STATUS, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD, - lpServicesReturned: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EnumDependentServicesA".} -proc EnumServicesStatusA*(hSCManager: SC_HANDLE, dwServiceType: DWORD, - dwServiceState: DWORD, - lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD, - pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD, - lpResumeHandle: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EnumServicesStatusA".} -proc GetServiceKeyNameA*(hSCManager: SC_HANDLE, lpDisplayName: LPCSTR, - lpServiceName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameA".} -proc GetServiceDisplayNameA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, - lpDisplayName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameA".} -proc OpenSCManagerA*(lpMachineName: LPCSTR, lpDatabaseName: LPCSTR, - dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "OpenSCManagerA".} -proc OpenServiceA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, - dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "OpenServiceA".} -proc QueryServiceConfigA*(hService: SC_HANDLE, - lpServiceConfig: LPQUERY_SERVICE_CONFIG, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceConfigA".} -proc QueryServiceLockStatusA*(hSCManager: SC_HANDLE, - lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusA".} -proc RegisterServiceCtrlHandlerA*(lpServiceName: LPCSTR, - lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{. - stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerA".} -proc StartServiceCtrlDispatcherA*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherA".} -proc StartServiceA*(hService: SC_HANDLE, dwNumServiceArgs: DWORD, - lpServiceArgVectors: LPCSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "StartServiceA".} -proc DragQueryFileA*(para1: HDROP, para2: int, para3: cstring, para4: int): int{. - stdcall, dynlib: "shell32", importc: "DragQueryFileA".} -proc ExtractAssociatedIconA*(para1: HINST, para2: cstring, para3: LPWORD): HICON{. - stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconA".} -proc ExtractIconA*(para1: HINST, para2: cstring, para3: int): HICON{.stdcall, - dynlib: "shell32", importc: "ExtractIconA".} -proc FindExecutableA*(para1: cstring, para2: cstring, para3: cstring): HINST{. - stdcall, dynlib: "shell32", importc: "FindExecutableA".} -proc ShellAboutA*(para1: HWND, para2: cstring, para3: cstring, para4: HICON): int32{. - stdcall, dynlib: "shell32", importc: "ShellAboutA".} -proc ShellExecuteA*(para1: HWND, para2: cstring, para3: cstring, para4: cstring, - para5: cstring, para6: int32): HINST{.stdcall, - dynlib: "shell32", importc: "ShellExecuteA".} -proc Shell_NotifyIconA*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{. - stdcall, dynlib: "shell32", importc: "Shell_NotifyIconA".} -proc DdeCreateStringHandleA*(para1: DWORD, para2: cstring, para3: int32): HSZ{. - stdcall, dynlib: "user32", importc: "DdeCreateStringHandleA".} -proc DdeInitializeA*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD, - para4: DWORD): 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, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "CommConfigDialogW".} -proc GetDefaultCommConfigW*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, - lpdwSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetDefaultCommConfigW".} -proc SetDefaultCommConfigW*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigW".} -proc GetComputerNameW*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetComputerNameW".} -proc SetComputerNameW*(lpComputerName: LPCWSTR): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetComputerNameW".} -proc GetUserNameW*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "GetUserNameW".} -proc LoadKeyboardLayoutW*(pwszKLID: LPCWSTR, Flags: 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, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "EnumDesktopsW".} -proc CreateWindowStationW*(lpwinsta: LPWSTR, dwReserved: DWORD, - dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{. - stdcall, dynlib: "user32", importc: "CreateWindowStationW".} -proc OpenWindowStationW*(lpszWinSta: LPWSTR, fInherit: WINBOOL, - dwDesiredAccess: DWORD): HWINSTA{.stdcall, - dynlib: "user32", importc: "OpenWindowStationW".} -proc EnumWindowStationsW*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnumWindowStationsW".} -proc GetUserObjectInformationW*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, - nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".} -proc SetUserObjectInformationW*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, - nLength: DWORD): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetUserObjectInformationW".} -proc RegisterWindowMessageW*(lpString: LPCWSTR): UINT{.stdcall, - dynlib: "user32", importc: "RegisterWindowMessageW".} -proc GetMessageW*(lpMsg: LPMSG, wnd: 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, wnd: HWND, wMsgFilterMin: UINT, - wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "PeekMessageW".} -proc SendMessageW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "SendMessageW".} -proc SendMessageTimeoutW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM, - fuFlags: UINT, uTimeout: UINT, lpdwResult: LPDWORD): LRESULT{. - stdcall, dynlib: "user32", importc: "SendMessageTimeoutW".} -proc SendNotifyMessageW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "SendNotifyMessageW".} -proc SendMessageCallbackW*(wnd: HWND, Msg: UINT, wp: WPARAM, - lp: LPARAM, lpResultCallBack: SENDASYNCPROC, - dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32", - importc: "SendMessageCallbackW".} -proc PostMessageW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "PostMessageW".} -proc PostThreadMessageW*(idThread: DWORD, Msg: UINT, wp: WPARAM, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "PostThreadMessageW".} -proc DefWindowProcW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefWindowProcW".} -proc CallWindowProcW*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: UINT, - wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, - dynlib: "user32", importc: "CallWindowProcW".} -proc RegisterClassW*(lpWndClass: LPWNDCLASSW): ATOM{.stdcall, dynlib: "user32", - importc: "RegisterClassW".} -proc UnregisterClassW*(lpClassName: LPCWSTR, hInstance: HINST): WINBOOL{. - stdcall, dynlib: "user32", importc: "UnregisterClassW".} -proc GetClassInfoW*(hInstance: HINST, lpClassName: LPCWSTR, - lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, dynlib: "user32", - importc: "GetClassInfoW".} -proc RegisterClassExW*(para1: LPWNDCLASSEXW): ATOM{.stdcall, dynlib: "user32", - importc: "RegisterClassExW".} -proc GetClassInfoExW*(para1: HINST, para2: LPCWSTR, para3: LPWNDCLASSEX): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetClassInfoExW".} -proc CreateWindowExW*(dwExStyle: DWORD, lpClassName: LPCWSTR, - lpWindowName: LPCWSTR, dwStyle: DWORD, X: int32, Y: int32, - nWidth: int32, nHeight: int32, hWndParent: HWND, - menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{. - stdcall, dynlib: "user32", importc: "CreateWindowExW".} -proc CreateDialogParamW*(hInstance: HINST, lpTemplateName: LPCWSTR, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", - importc: "CreateDialogParamW".} -proc CreateDialogIndirectParamW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): HWND{.stdcall, - dynlib: "user32", importc: "CreateDialogIndirectParamW".} -proc DialogBoxParamW*(hInstance: HINST, lpTemplateName: LPCWSTR, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32", - importc: "DialogBoxParamW".} -proc DialogBoxIndirectParamW*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): int32{.stdcall, - dynlib: "user32", importc: "DialogBoxIndirectParamW".} -proc SetDlgItemTextW*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCWSTR): WINBOOL{. - stdcall, dynlib: "user32", importc: "SetDlgItemTextW".} -proc GetDlgItemTextW*(hDlg: HWND, nIDDlgItem: int32, lpString: LPWSTR, - nMaxCount: int32): UINT{.stdcall, dynlib: "user32", - importc: "GetDlgItemTextW".} -proc SendDlgItemMessageW*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT, - wp: WPARAM, lp: LPARAM): LONG{.stdcall, - dynlib: "user32", importc: "SendDlgItemMessageW".} -proc DefDlgProcW*(hDlg: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefDlgProcW".} -proc CallMsgFilterW*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall, - dynlib: "user32", importc: "CallMsgFilterW".} -proc RegisterClipboardFormatW*(lpszFormat: LPCWSTR): 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{. - stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".} -proc LoadMenuW*(hInstance: HINST, lpMenuName: LPCWSTR): HMENU{.stdcall, - dynlib: "user32", importc: "LoadMenuW".} -proc LoadMenuIndirectW*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall, - dynlib: "user32", importc: "LoadMenuIndirectW".} -proc ChangeMenuW*(menu: HMENU, cmd: UINT, lpszNewItem: LPCWSTR, - cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "ChangeMenuW".} -proc GetMenuStringW*(menu: HMENU, uIDItem: UINT, lpString: LPWSTR, - nMaxCount: int32, uFlag: UINT): int32{.stdcall, - dynlib: "user32", importc: "GetMenuStringW".} -proc InsertMenuW*(menu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT, - lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32", - importc: "InsertMenuW".} -proc AppendMenuW*(menu: 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*(wnd: HWND, lpString: LPCWSTR, hData: HANDLE): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetPropW".} -proc GetPropW*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall, - dynlib: "user32", importc: "GetPropW".} -proc RemovePropW*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall, - dynlib: "user32", importc: "RemovePropW".} -proc EnumPropsExW*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{. - stdcall, dynlib: "user32", importc: "EnumPropsExW".} -proc EnumPropsW*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall, - dynlib: "user32", importc: "EnumPropsW".} -proc SetWindowTextW*(wnd: HWND, lpString: LPCWSTR): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetWindowTextW".} -proc GetWindowTextW*(wnd: HWND, lpString: LPWSTR, nMaxCount: int32): int32{. - stdcall, dynlib: "user32", importc: "GetWindowTextW".} -proc GetWindowTextLengthW*(wnd: HWND): int32{.stdcall, dynlib: "user32", - importc: "GetWindowTextLengthW".} -proc MessageBoxW*(wnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT): int32{. - stdcall, dynlib: "user32", importc: "MessageBoxW".} -proc MessageBoxExW*(wnd: 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*(wnd: HWND, nIndex: int32): LONG{.stdcall, - dynlib: "user32", importc: "GetWindowLongW".} -proc SetWindowLongW*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.stdcall, - dynlib: "user32", importc: "SetWindowLongW".} -proc GetClassLongW*(wnd: HWND, nIndex: int32): DWORD{.stdcall, - dynlib: "user32", importc: "GetClassLongW".} -proc SetClassLongW*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.stdcall, - dynlib: "user32", importc: "SetClassLongW".} -when defined(cpu64): - proc GetWindowLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetWindowLongPtrW".} - proc SetWindowLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetWindowLongPtrW".} - proc GetClassLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetClassLongPtrW".} - proc SetClassLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetClassLongPtrW".} -else: - proc GetWindowLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetWindowLongW".} - proc SetWindowLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetWindowLongW".} - proc GetClassLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetClassLongW".} - proc SetClassLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetClassLongW".} -proc FindWindowW*(lpClassName: LPCWSTR, lpWindowName: LPCWSTR): HWND{.stdcall, - dynlib: "user32", importc: "FindWindowW".} -proc FindWindowExW*(para1: HWND, para2: HWND, para3: LPCWSTR, para4: LPCWSTR): HWND{. - stdcall, dynlib: "user32", importc: "FindWindowExW".} -proc GetClassNameW*(wnd: HWND, lpClassName: LPWSTR, nMaxCount: int32): int32{. - stdcall, dynlib: "user32", importc: "GetClassNameW".} -proc SetWindowsHookExW*(idHook: int32, lpfn: HOOKPROC, hmod: HINST, - dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32", - importc: "SetWindowsHookExW".} -proc LoadBitmapW*(hInstance: HINST, lpBitmapName: LPCWSTR): HBITMAP{.stdcall, - dynlib: "user32", importc: "LoadBitmapW".} -proc LoadCursorW*(hInstance: HINST, lpCursorName: LPCWSTR): HCURSOR{.stdcall, - dynlib: "user32", importc: "LoadCursorW".} -proc LoadCursorFromFileW*(lpFileName: LPCWSTR): HCURSOR{.stdcall, - dynlib: "user32", importc: "LoadCursorFromFileW".} -proc LoadIconW*(hInstance: HINST, lpIconName: LPCWSTR): HICON{.stdcall, - dynlib: "user32", importc: "LoadIconW".} -proc LoadImageW*(para1: HINST, para2: LPCWSTR, para3: 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*(wnd: HWND, hWndMDIClient: HWND, uMsg: UINT, w: WPARAM, - lp: LPARAM): LRESULT{.stdcall, dynlib: "user32", - importc: "DefFrameProcW".} -proc DefMDIChildProcW*(wnd: HWND, uMsg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefMDIChildProcW".} -proc CreateMDIWindowW*(lpClassName: LPWSTR, lpWindowName: LPWSTR, - dwStyle: DWORD, X: int32, Y: int32, nWidth: int32, - nHeight: int32, hWndParent: HWND, hInstance: HINST, - lp: LPARAM): HWND{.stdcall, dynlib: "user32", - importc: "CreateMDIWindowW".} -proc WinHelpW*(hWndMain: HWND, lpszHelp: LPCWSTR, uCommand: 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, menu: HMENU, hInstance: HINST, - lpParam: LPVOID): HWND -proc CreateDialogW*(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): HWND -proc CreateDialogIndirectW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): HWND -proc DialogBoxW*(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): int32 -proc DialogBoxIndirectW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): int32 -proc CreateDCW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: pDEVMODEW): HDC{. - stdcall, dynlib: "gdi32", importc: "CreateDCW".} -proc VerInstallFileW*(uFlags: DWORD, szSrcFileName: LPWSTR, - szDestFileName: LPWSTR, szSrcDir: LPWSTR, - szDestDir: LPWSTR, szCurDir: LPWSTR, szTmpFile: LPWSTR, - lpuTmpFileLen: PUINT): DWORD{.stdcall, dynlib: "version", - importc: "VerInstallFileW".} -proc GetFileVersionInfoSizeW*(lptstrFilename: LPWSTR, lpdwHandle: LPDWORD): DWORD{. - stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeW".} -proc GetFileVersionInfoW*(lptstrFilename: LPWSTR, dwHandle: DWORD, dwLen: DWORD, - lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version", - importc: "GetFileVersionInfoW".} -proc VerLanguageNameW*(wLang: DWORD, szLang: LPWSTR, nSize: DWORD): DWORD{. - stdcall, dynlib: "kernel32", importc: "VerLanguageNameW".} -proc VerQueryValueW*(pBlock: LPVOID, lpSubBlock: LPWSTR, lplpBuffer: LPVOID, - puLen: PUINT): WINBOOL{.stdcall, dynlib: "version", - importc: "VerQueryValueW".} -proc VerFindFileW*(uFlags: DWORD, szFileName: LPWSTR, szWinDir: LPWSTR, - szAppDir: LPWSTR, szCurDir: LPWSTR, lpuCurDirLen: PUINT, - szDestDir: LPWSTR, lpuDestDirLen: PUINT): DWORD{.stdcall, - dynlib: "version", importc: "VerFindFileW".} -proc RegSetValueExW*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD, - dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegSetValueExW".} -proc RegUnLoadKeyW*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegUnLoadKeyW".} -proc InitiateSystemShutdownW*(lpMachineName: LPWSTR, lpMessage: LPWSTR, - dwTimeout: DWORD, bForceAppsClosed: WINBOOL, - bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "InitiateSystemShutdownW".} -proc AbortSystemShutdownW*(lpMachineName: LPWSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "AbortSystemShutdownW".} -proc RegRestoreKeyW*(key: HKEY, lpFile: LPCWSTR, dwFlags: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegRestoreKeyW".} -proc RegSaveKeyW*(key: HKEY, lpFile: LPCWSTR, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall, - dynlib: "advapi32", importc: "RegSaveKeyW".} -proc RegSetValueW*(key: HKEY, lpSubKey: LPCWSTR, dwType: DWORD, - lpData: LPCWSTR, cbData: DWORD): LONG{.stdcall, - dynlib: "advapi32", importc: "RegSetValueW".} -proc RegQueryValueW*(key: HKEY, lpSubKey: LPCWSTR, lpValue: LPWSTR, - lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32", - importc: "RegQueryValueW".} -proc RegQueryMultipleValuesW*(key: HKEY, val_list: PVALENT, num_vals: DWORD, - lpValueBuf: LPWSTR, ldwTotsize: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".} -proc RegQueryValueExW*(key: HKEY, lpValueName: LPCWSTR, lpReserved: LPDWORD, - lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegQueryValueExW".} -proc RegReplaceKeyW*(key: HKEY, lpSubKey: LPCWSTR, lpNewFile: LPCWSTR, - lpOldFile: LPCWSTR): LONG{.stdcall, dynlib: "advapi32", - importc: "RegReplaceKeyW".} -proc RegConnectRegistryW*(lpMachineName: LPWSTR, key: HKEY, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".} -proc RegCreateKeyW*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".} -proc RegCreateKeyExW*(key: HKEY, lpSubKey: LPCWSTR, Reserved: DWORD, - lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES, - phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".} -proc RegDeleteKeyW*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegDeleteKeyW".} -proc RegDeleteValueW*(key: HKEY, lpValueName: LPCWSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegDeleteValueW".} -proc RegEnumKeyW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, cbName: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyW".} -proc RegEnumKeyExW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, - lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPWSTR, - lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".} -proc RegEnumValueW*(key: HKEY, dwIndex: DWORD, lpValueName: LPWSTR, - lpcbValueName: LPDWORD, lpReserved: LPDWORD, - lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumValueW".} -proc RegLoadKeyW*(key: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR): LONG{. - stdcall, dynlib: "advapi32", importc: "RegLoadKeyW".} -proc RegOpenKeyW*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".} -proc RegOpenKeyExW*(key: HKEY, lpSubKey: LPCWSTR, ulOptions: DWORD, - samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall, - dynlib: "advapi32", importc: "RegOpenKeyExW".} -proc RegQueryInfoKeyW*(key: HKEY, lpClass: LPWSTR, lpcbClass: LPDWORD, - lpReserved: LPDWORD, lpcSubKeys: LPDWORD, - lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD, - lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD, - lpcbMaxValueLen: LPDWORD, - lpcbSecurityDescriptor: LPDWORD, - lpftLastWriteTime: PFILETIME): LONG{.stdcall, - dynlib: "advapi32", importc: "RegQueryInfoKeyW".} -proc CompareStringW*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCWSTR, - cchCount1: int32, lpString2: LPCWSTR, cchCount2: int32): int32{. - stdcall, dynlib: "kernel32", importc: "CompareStringW".} -proc LCMapStringW*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCWSTR, - cchSrc: int32, lpDestStr: LPWSTR, cchDest: int32): int32{. - stdcall, dynlib: "kernel32", importc: "LCMapStringW".} -proc GetLocaleInfoW*(Locale: LCID, LCType: LCTYPE, lpLCData: LPWSTR, - cchData: int32): int32{.stdcall, dynlib: "kernel32", - importc: "GetLocaleInfoW".} -proc SetLocaleInfoW*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCWSTR): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetLocaleInfoW".} -proc GetTimeFormatW*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME, - lpFormat: LPCWSTR, lpTimeStr: LPWSTR, cchTime: int32): int32{. - stdcall, dynlib: "kernel32", importc: "GetTimeFormatW".} -proc GetDateFormatW*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME, - lpFormat: LPCWSTR, lpDateStr: LPWSTR, cchDate: int32): int32{. - stdcall, dynlib: "kernel32", importc: "GetDateFormatW".} -proc GetNumberFormatW*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR, - lpFormat: PNUMBERFMT, lpNumberStr: LPWSTR, - cchNumber: int32): int32{.stdcall, dynlib: "kernel32", - importc: "GetNumberFormatW".} -proc GetCurrencyFormatW*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR, - lpFormat: PCURRENCYFMT, lpCurrencyStr: LPWSTR, - cchCurrency: int32): int32{.stdcall, - dynlib: "kernel32", importc: "GetCurrencyFormatW".} -proc EnumCalendarInfoW*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID, - Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "EnumCalendarInfoW".} -proc EnumTimeFormatsW*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID, - dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "EnumTimeFormatsW".} -proc EnumDateFormatsW*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID, - dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "EnumDateFormatsW".} -proc GetStringTypeExW*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCWSTR, - cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetStringTypeExW".} -proc GetStringTypeW*(dwInfoType: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32, - lpCharType: LPWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "GetStringTypeW".} -proc FoldStringW*(dwMapFlags: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32, - lpDestStr: LPWSTR, cchDest: int32): int32{.stdcall, - dynlib: "kernel32", importc: "FoldStringW".} -proc EnumSystemLocalesW*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesW".} -proc EnumSystemCodePagesW*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, dwFlags: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "EnumSystemCodePagesW".} -proc PeekConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "PeekConsoleInputW".} -proc ReadConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".} -proc WriteConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".} -proc ReadConsoleOutputW*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, - dwBufferSize: COORD, dwBufferCoord: COORD, - lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "ReadConsoleOutputW".} -proc WriteConsoleOutputW*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, - dwBufferSize: COORD, dwBufferCoord: COORD, - lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "WriteConsoleOutputW".} -proc ReadConsoleOutputCharacterW*(hConsoleOutput: HANDLE, lpCharacter: LPWSTR, - nLength: DWORD, dwReadCoord: COORD, - lpNumberOfCharsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".} -proc WriteConsoleOutputCharacterW*(hConsoleOutput: HANDLE, lpCharacter: LPCWSTR, - nLength: DWORD, dwWriteCoord: COORD, - lpNumberOfCharsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".} -proc FillConsoleOutputCharacterW*(hConsoleOutput: HANDLE, cCharacter: WCHAR, - nLength: DWORD, dwWriteCoord: COORD, - lpNumberOfCharsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterW".} -proc ScrollConsoleScreenBufferW*(hConsoleOutput: HANDLE, - lpScrollRectangle: PSMALL_RECT, - lpClipRectangle: PSMALL_RECT, - dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".} -proc GetConsoleTitleW*(lpConsoleTitle: LPWSTR, nSize: DWORD): DWORD{.stdcall, - dynlib: "kernel32", importc: "GetConsoleTitleW".} -proc SetConsoleTitleW*(lpConsoleTitle: LPCWSTR): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetConsoleTitleW".} -proc ReadConsoleW*(hConsoleInput: HANDLE, lpBuffer: LPVOID, - nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, - lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "ReadConsoleW".} -proc WriteConsoleW*(hConsoleOutput: HANDLE, lpBuffer: pointer, - nNumberOfCharsToWrite: DWORD, - lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleW".} -proc WNetAddConnectionW*(lpRemoteName: LPCWSTR, lpPassword: LPCWSTR, - lpLocalName: LPCWSTR): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetAddConnectionW".} -proc WNetAddConnection2W*(lpNetResource: LPNETRESOURCE, lpPassword: LPCWSTR, - lpUserName: LPCWSTR, dwFlags: DWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetAddConnection2W".} -proc WNetAddConnection3W*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, - lpPassword: LPCWSTR, lpUserName: LPCWSTR, - dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetAddConnection3W".} -proc WNetCancelConnectionW*(lpName: LPCWSTR, fForce: WINBOOL): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetCancelConnectionW".} -proc WNetCancelConnection2W*(lpName: LPCWSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetCancelConnection2W".} -proc WNetGetConnectionW*(lpLocalName: LPCWSTR, lpRemoteName: LPWSTR, - lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetGetConnectionW".} -proc WNetUseConnectionW*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, - lpUserID: LPCWSTR, lpPassword: LPCWSTR, dwFlags: DWORD, - lpAccessName: LPWSTR, lpBufferSize: LPDWORD, - lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetUseConnectionW".} -proc WNetSetConnectionW*(lpName: LPCWSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetSetConnectionW".} -proc WNetConnectionDialog1W*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1W".} -proc WNetDisconnectDialog1W*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetDisconnectDialog1W".} -proc WNetOpenEnumW*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD, - lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetOpenEnumW".} -proc WNetEnumResourceW*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID, - lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetEnumResourceW".} -proc WNetGetUniversalNameW*(lpLocalPath: LPCWSTR, dwInfoLevel: DWORD, - lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameW".} -proc WNetGetUserW*(lpName: LPCWSTR, lpUserName: LPWSTR, lpnLength: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetUserW".} -proc WNetGetProviderNameW*(dwNetType: DWORD, lpProviderName: LPWSTR, - lpBufferSize: LPDWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetGetProviderNameW".} -proc WNetGetNetworkInformationW*(lpProvider: LPCWSTR, - lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationW".} -proc WNetGetLastErrorW*(lpError: LPDWORD, lpErrorBuf: LPWSTR, - nErrorBufSize: DWORD, lpNameBuf: LPWSTR, - nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetGetLastErrorW".} -proc MultinetGetConnectionPerformanceW*(lpNetResource: LPNETRESOURCE, - lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall, - dynlib: "mpr", importc: "MultinetGetConnectionPerformanceW".} -proc ChangeServiceConfigW*(hService: SC_HANDLE, dwServiceType: DWORD, - dwStartType: DWORD, dwErrorControl: DWORD, - lpBinaryPathName: LPCWSTR, lpLoadOrderGroup: LPCWSTR, - lpdwTagId: LPDWORD, lpDependencies: LPCWSTR, - lpServiceStartName: LPCWSTR, lpPassword: LPCWSTR, - lpDisplayName: LPCWSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "ChangeServiceConfigW".} -proc CreateServiceW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, - lpDisplayName: LPCWSTR, dwDesiredAccess: DWORD, - dwServiceType: DWORD, dwStartType: DWORD, - dwErrorControl: DWORD, lpBinaryPathName: LPCWSTR, - lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD, - lpDependencies: LPCWSTR, lpServiceStartName: LPCWSTR, - lpPassword: LPCWSTR): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "CreateServiceW".} -proc EnumDependentServicesW*(hService: SC_HANDLE, dwServiceState: DWORD, - lpServices: LPENUM_SERVICE_STATUS, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD, - lpServicesReturned: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EnumDependentServicesW".} -proc EnumServicesStatusW*(hSCManager: SC_HANDLE, dwServiceType: DWORD, - dwServiceState: DWORD, - lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD, - pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD, - lpResumeHandle: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EnumServicesStatusW".} -proc GetServiceKeyNameW*(hSCManager: SC_HANDLE, lpDisplayName: LPCWSTR, - lpServiceName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameW".} -proc GetServiceDisplayNameW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, - lpDisplayName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameW".} -proc OpenSCManagerW*(lpMachineName: LPCWSTR, lpDatabaseName: LPCWSTR, - dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "OpenSCManagerW".} -proc OpenServiceW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, - dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "OpenServiceW".} -proc QueryServiceConfigW*(hService: SC_HANDLE, - lpServiceConfig: LPQUERY_SERVICE_CONFIG, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceConfigW".} -proc QueryServiceLockStatusW*(hSCManager: SC_HANDLE, - lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusW".} -proc RegisterServiceCtrlHandlerW*(lpServiceName: LPCWSTR, - lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{. - stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerW".} -proc StartServiceCtrlDispatcherW*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherW".} -proc StartServiceW*(hService: SC_HANDLE, dwNumServiceArgs: DWORD, - lpServiceArgVectors: LPCWSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "StartServiceW".} -proc DragQueryFileW*(para1: HDROP, para2: int, para3: LPCWSTR, para4: int): int{. - stdcall, dynlib: "shell32", importc: "DragQueryFileW".} -proc ExtractAssociatedIconW*(para1: HINST, para2: LPCWSTR, para3: LPWORD): HICON{. - stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconW".} -proc ExtractIconW*(para1: HINST, para2: LPCWSTR, para3: int): HICON{.stdcall, - dynlib: "shell32", importc: "ExtractIconW".} -proc FindExecutableW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR): HINST{. - stdcall, dynlib: "shell32", importc: "FindExecutableW".} -proc ShellAboutW*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: HICON): int32{. - stdcall, dynlib: "shell32", importc: "ShellAboutW".} -proc ShellExecuteW*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: LPCWSTR, - para5: LPCWSTR, para6: int32): HINST{.stdcall, - dynlib: "shell32", importc: "ShellExecuteW".} -proc Shell_NotifyIconW*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{. - stdcall, dynlib: "shell32", importc: "Shell_NotifyIconW".} -proc DdeCreateStringHandleW*(para1: DWORD, para2: LPCWSTR, para3: int32): HSZ{. - stdcall, dynlib: "user32", importc: "DdeCreateStringHandleW".} -proc DdeInitializeW*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD, - para4: DWORD): 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, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "CommConfigDialogW".} - proc GetDefaultCommConfig*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, - lpdwSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetDefaultCommConfigW".} - proc SetDefaultCommConfig*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, - dwSize: DWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetDefaultCommConfigW".} - proc GetComputerName*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetComputerNameW".} - proc SetComputerName*(lpComputerName: LPCWSTR): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetComputerNameW".} - proc GetUserName*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "GetUserNameW".} - proc LoadKeyboardLayout*(pwszKLID: LPCWSTR, Flags: 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, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "EnumDesktopsW".} - proc CreateWindowStation*(lpwinsta: LPWSTR, dwReserved: DWORD, - dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{. - stdcall, dynlib: "user32", importc: "CreateWindowStationW".} - proc OpenWindowStation*(lpszWinSta: LPWSTR, fInherit: WINBOOL, - dwDesiredAccess: DWORD): HWINSTA{.stdcall, - dynlib: "user32", importc: "OpenWindowStationW".} - proc EnumWindowStations*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnumWindowStationsW".} - proc GetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, - nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".} - proc SetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, - nLength: DWORD): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetUserObjectInformationW".} - proc RegisterWindowMessage*(lpString: LPCWSTR): UINT{.stdcall, - dynlib: "user32", importc: "RegisterWindowMessageW".} - proc GetMessage*(lpMsg: LPMSG, wnd: 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, wnd: HWND, wMsgFilterMin: UINT, - wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "PeekMessageW".} - proc SendMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "SendMessageW".} - proc SendMessageTimeout*(wnd: HWND, Msg: UINT, wp: WPARAM, - lp: LPARAM, fuFlags: UINT, uTimeout: UINT, - lpdwResult: LPDWORD): LRESULT{.stdcall, - dynlib: "user32", importc: "SendMessageTimeoutW".} - proc SendNotifyMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "SendNotifyMessageW".} - proc SendMessageCallback*(wnd: HWND, Msg: UINT, wp: WPARAM, - lp: LPARAM, lpResultCallBack: SENDASYNCPROC, - dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32", - importc: "SendMessageCallbackW".} - proc PostMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "PostMessageW".} - proc PostThreadMessage*(idThread: DWORD, Msg: UINT, wp: WPARAM, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "PostThreadMessageW".} - proc DefWindowProc*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefWindowProcW".} - proc CallWindowProc*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: UINT, - wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, - dynlib: "user32", importc: "CallWindowProcW".} - proc RegisterClass*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32", - importc: "RegisterClassW".} - proc UnregisterClass*(lpClassName: LPCWSTR, hInstance: HINST): WINBOOL{. - stdcall, dynlib: "user32", importc: "UnregisterClassW".} - proc GetClassInfo*(hInstance: HINST, lpClassName: LPCWSTR, - lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, - dynlib: "user32", importc: "GetClassInfoW".} - proc RegisterClassEx*(para1: LPWNDCLASSEXW): ATOM{.stdcall, dynlib: "user32", - importc: "RegisterClassExW".} - proc GetClassInfoEx*(para1: HINST, para2: LPCWSTR, para3: LPWNDCLASSEX): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetClassInfoExW".} - proc CreateWindowEx*(dwExStyle: DWORD, lpClassName: LPCWSTR, - lpWindowName: LPCWSTR, dwStyle: DWORD, X: int32, - Y: int32, nWidth: int32, nHeight: int32, - hWndParent: HWND, menu: HMENU, hInstance: HINST, - lpParam: LPVOID): HWND{.stdcall, dynlib: "user32", - importc: "CreateWindowExW".} - proc CreateDialogParam*(hInstance: HINST, lpTemplateName: LPCWSTR, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", - importc: "CreateDialogParamW".} - proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): HWND{.stdcall, - dynlib: "user32", importc: "CreateDialogIndirectParamW".} - proc DialogBoxParam*(hInstance: HINST, lpTemplateName: LPCWSTR, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32", - importc: "DialogBoxParamW".} - proc DialogBoxIndirectParam*(hInstance: HINST, - hDialogTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): int32{.stdcall, - dynlib: "user32", importc: "DialogBoxIndirectParamW".} - proc SetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCWSTR): WINBOOL{. - stdcall, dynlib: "user32", importc: "SetDlgItemTextW".} - proc GetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPWSTR, - nMaxCount: int32): UINT{.stdcall, dynlib: "user32", - importc: "GetDlgItemTextW".} - proc SendDlgItemMessage*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT, - wp: WPARAM, lp: LPARAM): LONG{.stdcall, - dynlib: "user32", importc: "SendDlgItemMessageW".} - proc DefDlgProc*(hDlg: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefDlgProcW".} - proc CallMsgFilter*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall, - dynlib: "user32", importc: "CallMsgFilterW".} - proc RegisterClipboardFormat*(lpszFormat: LPCWSTR): 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{. - stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".} - proc LoadMenu*(hInstance: HINST, lpMenuName: LPCWSTR): HMENU{.stdcall, - dynlib: "user32", importc: "LoadMenuW".} - proc LoadMenuIndirect*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall, - dynlib: "user32", importc: "LoadMenuIndirectW".} - proc ChangeMenu*(menu: HMENU, cmd: UINT, lpszNewItem: LPCWSTR, - cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "ChangeMenuW".} - proc GetMenuString*(menu: HMENU, uIDItem: UINT, lpString: LPWSTR, - nMaxCount: int32, uFlag: UINT): int32{.stdcall, - dynlib: "user32", importc: "GetMenuStringW".} - proc InsertMenu*(menu: HMENU, uPosition: UINT, uFlags: UINT, - uIDNewItem: UINT, lpNewItem: LPCWSTR): WINBOOL{.stdcall, - dynlib: "user32", importc: "InsertMenuW".} - proc AppendMenu*(menu: 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*(wnd: HWND, lpString: LPCWSTR, hData: HANDLE): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetPropW".} - proc GetProp*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall, - dynlib: "user32", importc: "GetPropW".} - proc RemoveProp*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall, - dynlib: "user32", importc: "RemovePropW".} - proc EnumPropsEx*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{. - stdcall, dynlib: "user32", importc: "EnumPropsExW".} - proc EnumProps*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall, - dynlib: "user32", importc: "EnumPropsW".} - proc SetWindowText*(wnd: HWND, lpString: LPCWSTR): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetWindowTextW".} - proc GetWindowText*(wnd: HWND, lpString: LPWSTR, nMaxCount: int32): int32{. - stdcall, dynlib: "user32", importc: "GetWindowTextW".} - proc GetWindowTextLength*(wnd: HWND): int32{.stdcall, dynlib: "user32", - importc: "GetWindowTextLengthW".} - proc MessageBox*(wnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT): int32{. - stdcall, dynlib: "user32", importc: "MessageBoxW".} - proc MessageBoxEx*(wnd: 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*(wnd: HWND, nIndex: int32): LONG{.stdcall, - dynlib: "user32", importc: "GetWindowLongW".} - proc SetWindowLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{. - stdcall, dynlib: "user32", importc: "SetWindowLongW".} - proc GetClassLong*(wnd: HWND, nIndex: int32): DWORD{.stdcall, - dynlib: "user32", importc: "GetClassLongW".} - proc SetClassLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{. - stdcall, dynlib: "user32", importc: "SetClassLongW".} - when defined(cpu64): - proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetWindowLongPtrW".} - proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetWindowLongPtrW".} - proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetClassLongPtrW".} - proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetClassLongPtrW".} - else: - proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetWindowLongW".} - proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetWindowLongW".} - proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetClassLongW".} - proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetClassLongW".} - proc FindWindow*(lpClassName: LPCWSTR, lpWindowName: LPCWSTR): HWND{.stdcall, - dynlib: "user32", importc: "FindWindowW".} - proc FindWindowEx*(para1: HWND, para2: HWND, para3: LPCWSTR, para4: LPCWSTR): HWND{. - stdcall, dynlib: "user32", importc: "FindWindowExW".} - proc GetClassName*(wnd: HWND, lpClassName: LPWSTR, nMaxCount: int32): int32{. - stdcall, dynlib: "user32", importc: "GetClassNameW".} - proc SetWindowsHookEx*(idHook: int32, lpfn: HOOKPROC, hmod: HINST, - dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32", - importc: "SetWindowsHookExW".} - proc LoadBitmap*(hInstance: HINST, lpBitmapName: LPCWSTR): HBITMAP{.stdcall, - dynlib: "user32", importc: "LoadBitmapW".} - proc LoadCursor*(hInstance: HINST, lpCursorName: LPCWSTR): HCURSOR{.stdcall, - dynlib: "user32", importc: "LoadCursorW".} - proc LoadCursorFromFile*(lpFileName: LPCWSTR): HCURSOR{.stdcall, - dynlib: "user32", importc: "LoadCursorFromFileW".} - proc LoadIcon*(hInstance: HINST, lpIconName: LPCWSTR): HICON{.stdcall, - dynlib: "user32", importc: "LoadIconW".} - proc LoadImage*(para1: HINST, para2: LPCWSTR, para3: 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*(wnd: HWND, hWndMDIClient: HWND, uMsg: UINT, - wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, - dynlib: "user32", importc: "DefFrameProcW".} - proc DefMDIChildProc*(wnd: HWND, uMsg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefMDIChildProcW".} - proc CreateMDIWindow*(lpClassName: LPWSTR, lpWindowName: LPWSTR, - dwStyle: DWORD, X: int32, Y: int32, nWidth: int32, - nHeight: int32, hWndParent: HWND, hInstance: HINST, - lp: LPARAM): HWND{.stdcall, dynlib: "user32", - importc: "CreateMDIWindowW".} - proc WinHelp*(hWndMain: HWND, lpszHelp: LPCWSTR, uCommand: 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, menu: HMENU, - hInstance: HINST, lpParam: LPVOID): HWND - proc CreateDialog*(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): HWND - proc CreateDialogIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): HWND - proc DialogBox*(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): int32 - proc DialogBoxIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): int32 - proc CreateDC*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: pDEVMODE): HDC{. - stdcall, dynlib: "gdi32", importc: "CreateDCW".} - proc VerInstallFile*(uFlags: DWORD, szSrcFileName: LPWSTR, - szDestFileName: LPWSTR, szSrcDir: LPWSTR, - szDestDir: LPWSTR, szCurDir: LPWSTR, szTmpFile: LPWSTR, - lpuTmpFileLen: PUINT): DWORD{.stdcall, dynlib: "version", - importc: "VerInstallFileW".} - proc GetFileVersionInfoSize*(lptstrFilename: LPWSTR, lpdwHandle: LPDWORD): DWORD{. - stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeW".} - proc GetFileVersionInfo*(lptstrFilename: LPWSTR, dwHandle: DWORD, - dwLen: DWORD, lpData: LPVOID): WINBOOL{.stdcall, - dynlib: "version", importc: "GetFileVersionInfoW".} - proc VerLanguageName*(wLang: DWORD, szLang: LPWSTR, nSize: DWORD): DWORD{. - stdcall, dynlib: "kernel32", importc: "VerLanguageNameW".} - proc VerQueryValue*(pBlock: LPVOID, lpSubBlock: LPWSTR, lplpBuffer: LPVOID, - puLen: PUINT): WINBOOL{.stdcall, dynlib: "version", - importc: "VerQueryValueW".} - proc VerFindFile*(uFlags: DWORD, szFileName: LPWSTR, szWinDir: LPWSTR, - szAppDir: LPWSTR, szCurDir: LPWSTR, lpuCurDirLen: PUINT, - szDestDir: LPWSTR, lpuDestDirLen: PUINT): DWORD{.stdcall, - dynlib: "version", importc: "VerFindFileW".} - proc RegSetValueEx*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD, - dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegSetValueExW".} - proc RegUnLoadKey*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegUnLoadKeyW".} - proc InitiateSystemShutdown*(lpMachineName: LPWSTR, lpMessage: LPWSTR, - dwTimeout: DWORD, bForceAppsClosed: WINBOOL, - bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "InitiateSystemShutdownW".} - proc AbortSystemShutdown*(lpMachineName: LPWSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "AbortSystemShutdownW".} - proc RegRestoreKey*(key: HKEY, lpFile: LPCWSTR, dwFlags: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegRestoreKeyW".} - proc RegSaveKey*(key: HKEY, lpFile: LPCWSTR, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall, - dynlib: "advapi32", importc: "RegSaveKeyW".} - proc RegSetValue*(key: HKEY, lpSubKey: LPCWSTR, dwType: DWORD, - lpData: LPCWSTR, cbData: DWORD): LONG{.stdcall, - dynlib: "advapi32", importc: "RegSetValueW".} - proc RegQueryValue*(key: HKEY, lpSubKey: LPCWSTR, lpValue: LPWSTR, - lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32", - importc: "RegQueryValueW".} - proc RegQueryMultipleValues*(key: HKEY, val_list: PVALENT, num_vals: DWORD, - lpValueBuf: LPWSTR, ldwTotsize: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".} - proc RegQueryValueEx*(key: HKEY, lpValueName: LPCWSTR, lpReserved: LPDWORD, - lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegQueryValueExW".} - proc RegReplaceKey*(key: HKEY, lpSubKey: LPCWSTR, lpNewFile: LPCWSTR, - lpOldFile: LPCWSTR): LONG{.stdcall, dynlib: "advapi32", - importc: "RegReplaceKeyW".} - proc RegConnectRegistry*(lpMachineName: LPWSTR, key: HKEY, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".} - proc RegCreateKey*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".} - proc RegCreateKeyEx*(key: HKEY, lpSubKey: LPCWSTR, Reserved: DWORD, - lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES, - phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".} - proc RegDeleteKey*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegDeleteKeyW".} - proc RegDeleteValue*(key: HKEY, lpValueName: LPCWSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegDeleteValueW".} - proc RegEnumKey*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, cbName: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyW".} - proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, - lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPWSTR, - lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".} - proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: LPWSTR, - lpcbValueName: LPDWORD, lpReserved: LPDWORD, - lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumValueW".} - proc RegLoadKey*(key: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR): LONG{. - stdcall, dynlib: "advapi32", importc: "RegLoadKeyW".} - proc RegOpenKey*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".} - proc RegOpenKeyEx*(key: HKEY, lpSubKey: LPCWSTR, ulOptions: DWORD, - samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall, - dynlib: "advapi32", importc: "RegOpenKeyExW".} - proc RegQueryInfoKey*(key: HKEY, lpClass: LPWSTR, lpcbClass: LPDWORD, - lpReserved: LPDWORD, lpcSubKeys: LPDWORD, - lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD, - lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD, - lpcbMaxValueLen: LPDWORD, - lpcbSecurityDescriptor: LPDWORD, - lpftLastWriteTime: PFILETIME): LONG{.stdcall, - dynlib: "advapi32", importc: "RegQueryInfoKeyW".} - proc CompareString*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCWSTR, - cchCount1: int32, lpString2: LPCWSTR, cchCount2: int32): int32{. - stdcall, dynlib: "kernel32", importc: "CompareStringW".} - proc LCMapString*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCWSTR, - cchSrc: int32, lpDestStr: LPWSTR, cchDest: int32): int32{. - stdcall, dynlib: "kernel32", importc: "LCMapStringW".} - proc GetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPWSTR, - cchData: int32): int32{.stdcall, dynlib: "kernel32", - importc: "GetLocaleInfoW".} - proc SetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCWSTR): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetLocaleInfoW".} - proc GetTimeFormat*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME, - lpFormat: LPCWSTR, lpTimeStr: LPWSTR, cchTime: int32): int32{. - stdcall, dynlib: "kernel32", importc: "GetTimeFormatW".} - proc GetDateFormat*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME, - lpFormat: LPCWSTR, lpDateStr: LPWSTR, cchDate: int32): int32{. - stdcall, dynlib: "kernel32", importc: "GetDateFormatW".} - proc GetNumberFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR, - lpFormat: PNUMBERFMT, lpNumberStr: LPWSTR, - cchNumber: int32): int32{.stdcall, dynlib: "kernel32", - importc: "GetNumberFormatW".} - proc GetCurrencyFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR, - lpFormat: PCURRENCYFMT, lpCurrencyStr: LPWSTR, - cchCurrency: int32): int32{.stdcall, - dynlib: "kernel32", importc: "GetCurrencyFormatW".} - proc EnumCalendarInfo*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID, - Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "EnumCalendarInfoW".} - proc EnumTimeFormats*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID, - dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "EnumTimeFormatsW".} - proc EnumDateFormats*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID, - dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "EnumDateFormatsW".} - proc GetStringTypeEx*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCWSTR, - cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetStringTypeExW".} - proc GetStringType*(dwInfoType: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32, - lpCharType: LPWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "GetStringTypeW".} - proc FoldString*(dwMapFlags: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32, - lpDestStr: LPWSTR, cchDest: int32): int32{.stdcall, - dynlib: "kernel32", importc: "FoldStringW".} - proc EnumSystemLocales*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesW".} - proc EnumSystemCodePages*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, - dwFlags: DWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "EnumSystemCodePagesW".} - proc PeekConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "PeekConsoleInputW".} - proc ReadConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".} - proc WriteConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".} - proc ReadConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, - dwBufferSize: COORD, dwBufferCoord: COORD, - lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "ReadConsoleOutputW".} - proc WriteConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, - dwBufferSize: COORD, dwBufferCoord: COORD, - lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "WriteConsoleOutputW".} - proc ReadConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPWSTR, - nLength: DWORD, dwReadCoord: COORD, - lpNumberOfCharsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".} - proc WriteConsoleOutputCharacter*(hConsoleOutput: HANDLE, - lpCharacter: LPCWSTR, nLength: DWORD, - dwWriteCoord: COORD, - lpNumberOfCharsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".} - proc FillConsoleOutputCharacter*(hConsoleOutput: HANDLE, cCharacter: WCHAR, - nLength: DWORD, dwWriteCoord: COORD, - lpNumberOfCharsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterW".} - proc ScrollConsoleScreenBuffer*(hConsoleOutput: HANDLE, - lpScrollRectangle: PSMALL_RECT, - lpClipRectangle: PSMALL_RECT, - dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".} - proc GetConsoleTitle*(lpConsoleTitle: LPWSTR, nSize: DWORD): DWORD{.stdcall, - dynlib: "kernel32", importc: "GetConsoleTitleW".} - proc SetConsoleTitle*(lpConsoleTitle: LPCWSTR): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetConsoleTitleW".} - proc ReadConsole*(hConsoleInput: HANDLE, lpBuffer: LPVOID, - nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, - lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "ReadConsoleW".} - proc WriteConsole*(hConsoleOutput: HANDLE, lpBuffer: pointer, - nNumberOfCharsToWrite: DWORD, - lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleW".} - proc WNetAddConnection*(lpRemoteName: LPCWSTR, lpPassword: LPCWSTR, - lpLocalName: LPCWSTR): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetAddConnectionW".} - proc WNetAddConnection2*(lpNetResource: LPNETRESOURCE, lpPassword: LPCWSTR, - lpUserName: LPCWSTR, dwFlags: DWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetAddConnection2W".} - proc WNetAddConnection3*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, - lpPassword: LPCWSTR, lpUserName: LPCWSTR, - dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetAddConnection3W".} - proc WNetCancelConnection*(lpName: LPCWSTR, fForce: WINBOOL): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetCancelConnectionW".} - proc WNetCancelConnection2*(lpName: LPCWSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetCancelConnection2W".} - proc WNetGetConnection*(lpLocalName: LPCWSTR, lpRemoteName: LPWSTR, - lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetGetConnectionW".} - proc WNetUseConnection*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, - lpUserID: LPCWSTR, lpPassword: LPCWSTR, - dwFlags: DWORD, lpAccessName: LPWSTR, - lpBufferSize: LPDWORD, lpResult: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetUseConnectionW".} - proc WNetSetConnection*(lpName: LPCWSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetSetConnectionW".} - proc WNetConnectionDialog1*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1W".} - proc WNetDisconnectDialog1*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetDisconnectDialog1W".} - proc WNetOpenEnum*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD, - lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetOpenEnumW".} - proc WNetEnumResource*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID, - lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetEnumResourceW".} - proc WNetGetUniversalName*(lpLocalPath: LPCWSTR, dwInfoLevel: DWORD, - lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameW".} - proc WNetGetUser*(lpName: LPCWSTR, lpUserName: LPWSTR, lpnLength: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetUserW".} - proc WNetGetProviderName*(dwNetType: DWORD, lpProviderName: LPWSTR, - lpBufferSize: LPDWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetGetProviderNameW".} - proc WNetGetNetworkInformation*(lpProvider: LPCWSTR, - lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationW".} - proc WNetGetLastError*(lpError: LPDWORD, lpErrorBuf: LPWSTR, - nErrorBufSize: DWORD, lpNameBuf: LPWSTR, - nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetGetLastErrorW".} - proc MultinetGetConnectionPerformance*(lpNetResource: LPNETRESOURCE, - lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall, - dynlib: "mpr", importc: "MultinetGetConnectionPerformanceW".} - proc ChangeServiceConfig*(hService: SC_HANDLE, dwServiceType: DWORD, - dwStartType: DWORD, dwErrorControl: DWORD, - lpBinaryPathName: LPCWSTR, - lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD, - lpDependencies: LPCWSTR, - lpServiceStartName: LPCWSTR, lpPassword: LPCWSTR, - lpDisplayName: LPCWSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "ChangeServiceConfigW".} - proc CreateService*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, - lpDisplayName: LPCWSTR, dwDesiredAccess: DWORD, - dwServiceType: DWORD, dwStartType: DWORD, - dwErrorControl: DWORD, lpBinaryPathName: LPCWSTR, - lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD, - lpDependencies: LPCWSTR, lpServiceStartName: LPCWSTR, - lpPassword: LPCWSTR): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "CreateServiceW".} - proc EnumDependentServices*(hService: SC_HANDLE, dwServiceState: DWORD, - lpServices: LPENUM_SERVICE_STATUS, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD, - lpServicesReturned: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EnumDependentServicesW".} - proc EnumServicesStatus*(hSCManager: SC_HANDLE, dwServiceType: DWORD, - dwServiceState: DWORD, - lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD, - pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD, - lpResumeHandle: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EnumServicesStatusW".} - proc GetServiceKeyName*(hSCManager: SC_HANDLE, lpDisplayName: LPCWSTR, - lpServiceName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameW".} - proc GetServiceDisplayName*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, - lpDisplayName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameW".} - proc OpenSCManager*(lpMachineName: LPCWSTR, lpDatabaseName: LPCWSTR, - dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "OpenSCManagerW".} - proc OpenService*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, - dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "OpenServiceW".} - proc QueryServiceConfig*(hService: SC_HANDLE, - lpServiceConfig: LPQUERY_SERVICE_CONFIG, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceConfigW".} - proc QueryServiceLockStatus*(hSCManager: SC_HANDLE, - lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusW".} - proc RegisterServiceCtrlHandler*(lpServiceName: LPCWSTR, - lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{. - stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerW".} - proc StartServiceCtrlDispatcher*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherW".} - proc StartService*(hService: SC_HANDLE, dwNumServiceArgs: DWORD, - lpServiceArgVectors: LPCWSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "StartServiceW".} - proc DragQueryFile*(para1: HDROP, para2: int, para3: LPCWSTR, para4: int): int{. - stdcall, dynlib: "shell32", importc: "DragQueryFileW".} - proc ExtractAssociatedIcon*(para1: HINST, para2: LPCWSTR, para3: LPWORD): HICON{. - stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconW".} - proc ExtractIcon*(para1: HINST, para2: LPCWSTR, para3: int): HICON{.stdcall, - dynlib: "shell32", importc: "ExtractIconW".} - proc FindExecutable*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR): HINST{. - stdcall, dynlib: "shell32", importc: "FindExecutableW".} - proc ShellAbout*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: HICON): int32{. - stdcall, dynlib: "shell32", importc: "ShellAboutW".} - proc ShellExecute*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, - para4: LPCWSTR, para5: LPCWSTR, para6: int32): HINST{. - stdcall, dynlib: "shell32", importc: "ShellExecuteW".} - proc Shell_NotifyIcon*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{. - stdcall, dynlib: "shell32", importc: "Shell_NotifyIconW".} - proc DdeCreateStringHandle*(para1: DWORD, para2: LPCWSTR, para3: int32): HSZ{. - stdcall, dynlib: "user32", importc: "DdeCreateStringHandleW".} - proc DdeInitialize*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD, - para4: DWORD): 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, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".} - proc GetDefaultCommConfig*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, - lpdwSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetDefaultCommConfigA".} - proc SetDefaultCommConfig*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigA".} - proc GetComputerName*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetComputerNameA".} - proc SetComputerName*(lpComputerName: LPCSTR): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetComputerNameA".} - proc GetUserName*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "GetUserNameA".} - proc wvsprintf*(para1: LPSTR, para2: LPCSTR, arglist: va_list): int32{. - stdcall, dynlib: "user32", importc: "wvsprintfA".} - proc LoadKeyboardLayout*(pwszKLID: LPCSTR, Flags: 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, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "EnumDesktopsA".} - proc CreateWindowStation*(lpwinsta: LPSTR, dwReserved: DWORD, - dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{. - stdcall, dynlib: "user32", importc: "CreateWindowStationA".} - proc OpenWindowStation*(lpszWinSta: LPSTR, fInherit: WINBOOL, - dwDesiredAccess: DWORD): HWINSTA{.stdcall, - dynlib: "user32", importc: "OpenWindowStationA".} - proc EnumWindowStations*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnumWindowStationsA".} - proc GetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, - nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".} - proc SetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, - nLength: DWORD): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetUserObjectInformationA".} - proc RegisterWindowMessage*(lpString: LPCSTR): UINT{.stdcall, - dynlib: "user32", importc: "RegisterWindowMessageA".} - proc GetMessage*(lpMsg: LPMSG, wnd: 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, wnd: HWND, wMsgFilterMin: UINT, - wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "PeekMessageA".} - proc SendMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "SendMessageA".} - proc SendMessageTimeout*(wnd: HWND, Msg: UINT, wp: WPARAM, - lp: LPARAM, fuFlags: UINT, uTimeout: UINT, - lpdwResult: LPDWORD): LRESULT{.stdcall, - dynlib: "user32", importc: "SendMessageTimeoutA".} - proc SendNotifyMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "SendNotifyMessageA".} - proc SendMessageCallback*(wnd: HWND, Msg: UINT, wp: WPARAM, - lp: LPARAM, lpResultCallBack: SENDASYNCPROC, - dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32", - importc: "SendMessageCallbackA".} - proc PostMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "PostMessageA".} - proc PostThreadMessage*(idThread: DWORD, Msg: UINT, wp: WPARAM, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "PostThreadMessageA".} - proc DefWindowProc*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefWindowProcA".} - proc CallWindowProc*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: UINT, - wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, - dynlib: "user32", importc: "CallWindowProcA".} - proc RegisterClass*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32", - importc: "RegisterClassA".} - proc UnregisterClass*(lpClassName: LPCSTR, hInstance: HINST): WINBOOL{. - stdcall, dynlib: "user32", importc: "UnregisterClassA".} - proc GetClassInfo*(hInstance: HINST, lpClassName: LPCSTR, - lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, - dynlib: "user32", importc: "GetClassInfoA".} - proc RegisterClassEx*(para1: LPWNDCLASSEX): ATOM{.stdcall, dynlib: "user32", - importc: "RegisterClassExA".} - proc GetClassInfoEx*(para1: HINST, para2: LPCSTR, para3: LPWNDCLASSEX): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetClassInfoExA".} - proc CreateWindowEx*(dwExStyle: DWORD, lpClassName: LPCSTR, - lpWindowName: LPCSTR, dwStyle: DWORD, X: int32, Y: int32, - nWidth: int32, nHeight: int32, hWndParent: HWND, - menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{. - stdcall, dynlib: "user32", importc: "CreateWindowExA".} - proc CreateDialogParam*(hInstance: HINST, lpTemplateName: LPCSTR, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", - importc: "CreateDialogParamA".} - proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): HWND{.stdcall, - dynlib: "user32", importc: "CreateDialogIndirectParamA".} - proc DialogBoxParam*(hInstance: HINST, lpTemplateName: LPCSTR, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32", - importc: "DialogBoxParamA".} - proc DialogBoxIndirectParam*(hInstance: HINST, - hDialogTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC, - dwInitParam: LPARAM): int32{.stdcall, - dynlib: "user32", importc: "DialogBoxIndirectParamA".} - proc SetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCSTR): WINBOOL{. - stdcall, dynlib: "user32", importc: "SetDlgItemTextA".} - proc GetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPSTR, - nMaxCount: int32): UINT{.stdcall, dynlib: "user32", - importc: "GetDlgItemTextA".} - proc SendDlgItemMessage*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT, - wp: WPARAM, lp: LPARAM): LONG{.stdcall, - dynlib: "user32", importc: "SendDlgItemMessageA".} - proc DefDlgProc*(hDlg: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefDlgProcA".} - proc CallMsgFilter*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall, - dynlib: "user32", importc: "CallMsgFilterA".} - proc RegisterClipboardFormat*(lpszFormat: LPCSTR): 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{. - stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".} - proc LoadMenu*(hInstance: HINST, lpMenuName: LPCSTR): HMENU{.stdcall, - dynlib: "user32", importc: "LoadMenuA".} - proc LoadMenuIndirect*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall, - dynlib: "user32", importc: "LoadMenuIndirectA".} - proc ChangeMenu*(menu: HMENU, cmd: UINT, lpszNewItem: LPCSTR, - cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "ChangeMenuA".} - proc GetMenuString*(menu: HMENU, uIDItem: UINT, lpString: LPSTR, - nMaxCount: int32, uFlag: UINT): int32{.stdcall, - dynlib: "user32", importc: "GetMenuStringA".} - proc InsertMenu*(menu: HMENU, uPosition: UINT, uFlags: UINT, - uIDNewItem: UINT, lpNewItem: LPCSTR): WINBOOL{.stdcall, - dynlib: "user32", importc: "InsertMenuA".} - proc AppendMenu*(menu: 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*(dc: HDC, X: int32, Y: int32, lpString: LPCSTR, - nCount: int32, nTabPositions: int32, - lpnTabStopPositions: LPINT, nTabOrigin: int32): LONG{. - stdcall, dynlib: "user32", importc: "TabbedTextOutA".} - proc GetTabbedTextExtent*(hDC: HDC, lpString: LPCSTR, nCount: int32, - nTabPositions: int32, lpnTabStopPositions: LPINT): DWORD{. - stdcall, dynlib: "user32", importc: "GetTabbedTextExtentA".} - proc SetProp*(wnd: HWND, lpString: LPCSTR, hData: HANDLE): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetPropA".} - proc GetProp*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, - dynlib: "user32", importc: "GetPropA".} - proc RemoveProp*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, - dynlib: "user32", importc: "RemovePropA".} - proc EnumPropsEx*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{. - stdcall, dynlib: "user32", importc: "EnumPropsExA".} - proc EnumProps*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall, - dynlib: "user32", importc: "EnumPropsA".} - proc SetWindowText*(wnd: HWND, lpString: LPCSTR): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetWindowTextA".} - proc GetWindowText*(wnd: HWND, lpString: LPSTR, nMaxCount: int32): int32{. - stdcall, dynlib: "user32", importc: "GetWindowTextA".} - proc GetWindowTextLength*(wnd: HWND): int32{.stdcall, dynlib: "user32", - importc: "GetWindowTextLengthA".} - proc MessageBox*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT): int32{. - stdcall, dynlib: "user32", importc: "MessageBoxA".} - proc MessageBoxEx*(wnd: 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*(wnd: HWND, nIndex: int32): LONG{.stdcall, - dynlib: "user32", importc: "GetWindowLongA".} - proc SetWindowLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{. - stdcall, dynlib: "user32", importc: "SetWindowLongA".} - proc GetClassLong*(wnd: HWND, nIndex: int32): DWORD{.stdcall, - dynlib: "user32", importc: "GetClassLongA".} - proc SetClassLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{. - stdcall, dynlib: "user32", importc: "SetClassLongA".} - when defined(cpu64): - proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetWindowLongPtrA".} - proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetWindowLongPtrA".} - proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetClassLongPtrA".} - proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetClassLongPtrA".} - else: - proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetWindowLongA".} - proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetWindowLongA".} - proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, - dynlib: "user32", importc: "GetClassLongA".} - proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. - stdcall, dynlib: "user32", importc: "SetClassLongA".} - proc FindWindow*(lpClassName: LPCSTR, lpWindowName: LPCSTR): HWND{.stdcall, - dynlib: "user32", importc: "FindWindowA".} - proc FindWindowEx*(para1: HWND, para2: HWND, para3: LPCSTR, para4: LPCSTR): HWND{. - stdcall, dynlib: "user32", importc: "FindWindowExA".} - proc GetClassName*(wnd: HWND, lpClassName: LPSTR, nMaxCount: int32): int32{. - stdcall, dynlib: "user32", importc: "GetClassNameA".} - proc SetWindowsHookEx*(idHook: int32, lpfn: HOOKPROC, hmod: HINST, - dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32", - importc: "SetWindowsHookExA".} - proc LoadBitmap*(hInstance: HINST, lpBitmapName: LPCSTR): HBITMAP{.stdcall, - dynlib: "user32", importc: "LoadBitmapA".} - proc LoadCursor*(hInstance: HINST, lpCursorName: LPCSTR): HCURSOR{.stdcall, - dynlib: "user32", importc: "LoadCursorA".} - proc LoadCursorFromFile*(lpFileName: LPCSTR): HCURSOR{.stdcall, - dynlib: "user32", importc: "LoadCursorFromFileA".} - proc LoadIcon*(hInstance: HINST, lpIconName: LPCSTR): HICON{.stdcall, - dynlib: "user32", importc: "LoadIconA".} - proc LoadImage*(para1: HINST, para2: LPCSTR, para3: 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*(wnd: HWND, hWndMDIClient: HWND, uMsg: UINT, - wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, - dynlib: "user32", importc: "DefFrameProcA".} - proc DefMDIChildProc*(wnd: HWND, uMsg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. - stdcall, dynlib: "user32", importc: "DefMDIChildProcA".} - proc CreateMDIWindow*(lpClassName: LPSTR, lpWindowName: LPSTR, dwStyle: DWORD, - X: int32, Y: int32, nWidth: int32, nHeight: int32, - hWndParent: HWND, hInstance: HINST, lp: LPARAM): HWND{. - stdcall, dynlib: "user32", importc: "CreateMDIWindowA".} - proc WinHelp*(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: 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, menu: HMENU, hInstance: HINST, - lpParam: LPVOID): HWND - proc CreateDialog*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): HWND - proc CreateDialogIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): HWND - proc DialogBox*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): int32 - proc DialogBoxIndirect*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): int32 - proc CreateDC*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: pDEVMODE): HDC{. - stdcall, dynlib: "gdi32", importc: "CreateDCA".} - proc VerInstallFile*(uFlags: DWORD, szSrcFileName: LPSTR, - szDestFileName: LPSTR, szSrcDir: LPSTR, szDestDir: LPSTR, - szCurDir: LPSTR, szTmpFile: LPSTR, lpuTmpFileLen: PUINT): DWORD{. - stdcall, dynlib: "version", importc: "VerInstallFileA".} - proc GetFileVersionInfoSize*(lptstrFilename: LPSTR, lpdwHandle: LPDWORD): DWORD{. - stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeA".} - proc GetFileVersionInfo*(lptstrFilename: LPSTR, dwHandle: DWORD, dwLen: DWORD, - lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version", - importc: "GetFileVersionInfoA".} - proc VerLanguageName*(wLang: DWORD, szLang: LPSTR, nSize: DWORD): DWORD{. - stdcall, dynlib: "kernel32", importc: "VerLanguageNameA".} - proc VerQueryValue*(pBlock: LPVOID, lpSubBlock: LPSTR, lplpBuffer: LPVOID, - puLen: PUINT): WINBOOL{.stdcall, dynlib: "version", - importc: "VerQueryValueA".} - proc VerFindFile*(uFlags: DWORD, szFileName: LPSTR, szWinDir: LPSTR, - szAppDir: LPSTR, szCurDir: LPSTR, lpuCurDirLen: PUINT, - szDestDir: LPSTR, lpuDestDirLen: PUINT): DWORD{.stdcall, - dynlib: "version", importc: "VerFindFileA".} - proc RegConnectRegistry*(lpMachineName: LPSTR, key: HKEY, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".} - proc RegCreateKey*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".} - proc RegCreateKeyEx*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD, - lpClass: LPSTR, dwOptions: DWORD, samDesired: REGSAM, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES, - phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".} - proc RegDeleteKey*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegDeleteKeyA".} - proc RegDeleteValue*(key: HKEY, lpValueName: LPCSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegDeleteValueA".} - proc RegEnumKey*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, cbName: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyA".} - proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, - lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPSTR, - lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".} - proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: LPSTR, - lpcbValueName: LPDWORD, lpReserved: LPDWORD, - lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegEnumValueA".} - proc RegLoadKey*(key: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegLoadKeyA".} - proc RegOpenKey*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{. - stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".} - proc RegOpenKeyEx*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD, - samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall, - dynlib: "advapi32", importc: "RegOpenKeyExA".} - proc RegQueryInfoKey*(key: HKEY, lpClass: LPSTR, lpcbClass: LPDWORD, - lpReserved: LPDWORD, lpcSubKeys: LPDWORD, - lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD, - lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD, - lpcbMaxValueLen: LPDWORD, - lpcbSecurityDescriptor: LPDWORD, - lpftLastWriteTime: PFILETIME): LONG{.stdcall, - dynlib: "advapi32", importc: "RegQueryInfoKeyA".} - proc RegQueryValue*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPSTR, - lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32", - importc: "RegQueryValueA".} - proc RegQueryMultipleValues*(key: HKEY, val_list: PVALENT, num_vals: DWORD, - lpValueBuf: LPSTR, ldwTotsize: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".} - proc RegQueryValueEx*(key: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD, - lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegQueryValueExA".} - proc RegReplaceKey*(key: HKEY, lpSubKey: LPCSTR, lpNewFile: LPCSTR, - lpOldFile: LPCSTR): LONG{.stdcall, dynlib: "advapi32", - importc: "RegReplaceKeyA".} - proc RegRestoreKey*(key: HKEY, lpFile: LPCSTR, dwFlags: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegRestoreKeyA".} - proc RegSaveKey*(key: HKEY, lpFile: LPCSTR, - lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall, - dynlib: "advapi32", importc: "RegSaveKeyA".} - proc RegSetValue*(key: HKEY, lpSubKey: LPCSTR, dwType: DWORD, lpData: LPCSTR, - cbData: DWORD): LONG{.stdcall, dynlib: "advapi32", - importc: "RegSetValueA".} - proc RegSetValueEx*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD, - dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegSetValueExA".} - proc RegUnLoadKey*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall, - dynlib: "advapi32", importc: "RegUnLoadKeyA".} - proc InitiateSystemShutdown*(lpMachineName: LPSTR, lpMessage: LPSTR, - dwTimeout: DWORD, bForceAppsClosed: WINBOOL, - bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "InitiateSystemShutdownA".} - proc AbortSystemShutdown*(lpMachineName: LPSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "AbortSystemShutdownA".} - proc CompareString*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCSTR, - cchCount1: int32, lpString2: LPCSTR, cchCount2: int32): int32{. - stdcall, dynlib: "kernel32", importc: "CompareStringA".} - proc LCMapString*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCSTR, - cchSrc: int32, lpDestStr: LPSTR, cchDest: int32): int32{. - stdcall, dynlib: "kernel32", importc: "LCMapStringA".} - proc GetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPSTR, - cchData: int32): int32{.stdcall, dynlib: "kernel32", - importc: "GetLocaleInfoA".} - proc SetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCSTR): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetLocaleInfoA".} - proc GetTimeFormat*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME, - lpFormat: LPCSTR, lpTimeStr: LPSTR, cchTime: int32): int32{. - stdcall, dynlib: "kernel32", importc: "GetTimeFormatA".} - proc GetDateFormat*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME, - lpFormat: LPCSTR, lpDateStr: LPSTR, cchDate: int32): int32{. - stdcall, dynlib: "kernel32", importc: "GetDateFormatA".} - proc GetNumberFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR, - lpFormat: PNUMBERFMT, lpNumberStr: LPSTR, - cchNumber: int32): int32{.stdcall, dynlib: "kernel32", - importc: "GetNumberFormatA".} - proc GetCurrencyFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR, - lpFormat: PCURRENCYFMT, lpCurrencyStr: LPSTR, - cchCurrency: int32): int32{.stdcall, - dynlib: "kernel32", importc: "GetCurrencyFormatA".} - proc EnumCalendarInfo*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID, - Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "EnumCalendarInfoA".} - proc EnumTimeFormats*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID, - dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "EnumTimeFormatsA".} - proc EnumDateFormats*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID, - dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "EnumDateFormatsA".} - proc GetStringTypeEx*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR, - cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetStringTypeExA".} - proc GetStringType*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR, - cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetStringTypeA".} - proc FoldString*(dwMapFlags: DWORD, lpSrcStr: LPCSTR, cchSrc: int32, - lpDestStr: LPSTR, cchDest: int32): int32{.stdcall, - dynlib: "kernel32", importc: "FoldStringA".} - proc EnumSystemLocales*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesA".} - proc EnumSystemCodePages*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, - dwFlags: DWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "EnumSystemCodePagesA".} - proc PeekConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".} - proc ReadConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".} - proc WriteConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, - nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".} - proc ReadConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, - dwBufferSize: COORD, dwBufferCoord: COORD, - lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "ReadConsoleOutputA".} - proc WriteConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, - dwBufferSize: COORD, dwBufferCoord: COORD, - lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "WriteConsoleOutputA".} - proc ReadConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPSTR, - nLength: DWORD, dwReadCoord: COORD, - lpNumberOfCharsRead: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".} - proc WriteConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPCSTR, - nLength: DWORD, dwWriteCoord: COORD, - lpNumberOfCharsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".} - proc FillConsoleOutputCharacter*(hConsoleOutput: HANDLE, cCharacter: CHAR, - nLength: DWORD, dwWriteCoord: COORD, - lpNumberOfCharsWritten: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".} - proc ScrollConsoleScreenBuffer*(hConsoleOutput: HANDLE, - lpScrollRectangle: PSMALL_RECT, - lpClipRectangle: PSMALL_RECT, - dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".} - proc GetConsoleTitle*(lpConsoleTitle: LPSTR, nSize: DWORD): DWORD{.stdcall, - dynlib: "kernel32", importc: "GetConsoleTitleA".} - proc SetConsoleTitle*(lpConsoleTitle: LPCSTR): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetConsoleTitleA".} - proc ReadConsole*(hConsoleInput: HANDLE, lpBuffer: LPVOID, - nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, - lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "ReadConsoleA".} - proc WriteConsole*(hConsoleOutput: HANDLE, lpBuffer: pointer, - nNumberOfCharsToWrite: DWORD, - lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteConsoleA".} - proc WNetAddConnection*(lpRemoteName: LPCSTR, lpPassword: LPCSTR, - lpLocalName: LPCSTR): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetAddConnectionA".} - proc WNetAddConnection2*(lpNetResource: LPNETRESOURCE, lpPassword: LPCSTR, - lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetAddConnection2A".} - proc WNetAddConnection3*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, - lpPassword: LPCSTR, lpUserName: LPCSTR, - dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetAddConnection3A".} - proc WNetCancelConnection*(lpName: LPCSTR, fForce: WINBOOL): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetCancelConnectionA".} - proc WNetCancelConnection2*(lpName: LPCSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetCancelConnection2A".} - proc WNetGetConnection*(lpLocalName: LPCSTR, lpRemoteName: LPSTR, - lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetGetConnectionA".} - proc WNetUseConnection*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, - lpUserID: LPCSTR, lpPassword: LPCSTR, dwFlags: DWORD, - lpAccessName: LPSTR, lpBufferSize: LPDWORD, - lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetUseConnectionA".} - proc WNetSetConnection*(lpName: LPCSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetSetConnectionA".} - proc WNetConnectionDialog1*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".} - proc WNetDisconnectDialog1*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetDisconnectDialog1A".} - proc WNetOpenEnum*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD, - lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetOpenEnumA".} - proc WNetEnumResource*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID, - lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetEnumResourceA".} - proc WNetGetUniversalName*(lpLocalPath: LPCSTR, dwInfoLevel: DWORD, - lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".} - proc WNetGetUser*(lpName: LPCSTR, lpUserName: LPSTR, lpnLength: LPDWORD): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetUserA".} - proc WNetGetProviderName*(dwNetType: DWORD, lpProviderName: LPSTR, - lpBufferSize: LPDWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetGetProviderNameA".} - proc WNetGetNetworkInformation*(lpProvider: LPCSTR, - lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{. - stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".} - proc WNetGetLastError*(lpError: LPDWORD, lpErrorBuf: LPSTR, - nErrorBufSize: DWORD, lpNameBuf: LPSTR, - nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetGetLastErrorA".} - proc MultinetGetConnectionPerformance*(lpNetResource: LPNETRESOURCE, - lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall, - dynlib: "mpr", importc: "MultinetGetConnectionPerformanceA".} - proc ChangeServiceConfig*(hService: SC_HANDLE, dwServiceType: DWORD, - dwStartType: DWORD, dwErrorControl: DWORD, - lpBinaryPathName: LPCSTR, lpLoadOrderGroup: LPCSTR, - lpdwTagId: LPDWORD, lpDependencies: LPCSTR, - lpServiceStartName: LPCSTR, lpPassword: LPCSTR, - lpDisplayName: LPCSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "ChangeServiceConfigA".} - proc CreateService*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, - lpDisplayName: LPCSTR, dwDesiredAccess: DWORD, - dwServiceType: DWORD, dwStartType: DWORD, - dwErrorControl: DWORD, lpBinaryPathName: LPCSTR, - lpLoadOrderGroup: LPCSTR, lpdwTagId: LPDWORD, - lpDependencies: LPCSTR, lpServiceStartName: LPCSTR, - lpPassword: LPCSTR): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "CreateServiceA".} - proc EnumDependentServices*(hService: SC_HANDLE, dwServiceState: DWORD, - lpServices: LPENUM_SERVICE_STATUS, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD, - lpServicesReturned: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EnumDependentServicesA".} - proc EnumServicesStatus*(hSCManager: SC_HANDLE, dwServiceType: DWORD, - dwServiceState: DWORD, - lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD, - pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD, - lpResumeHandle: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EnumServicesStatusA".} - proc GetServiceKeyName*(hSCManager: SC_HANDLE, lpDisplayName: LPCSTR, - lpServiceName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameA".} - proc GetServiceDisplayName*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, - lpDisplayName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameA".} - proc OpenSCManager*(lpMachineName: LPCSTR, lpDatabaseName: LPCSTR, - dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "OpenSCManagerA".} - proc OpenService*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, - dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, - dynlib: "advapi32", importc: "OpenServiceA".} - proc QueryServiceConfig*(hService: SC_HANDLE, - lpServiceConfig: LPQUERY_SERVICE_CONFIG, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceConfigA".} - proc QueryServiceLockStatus*(hSCManager: SC_HANDLE, - lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusA".} - proc RegisterServiceCtrlHandler*(lpServiceName: LPCSTR, - lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{. - stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerA".} - proc StartServiceCtrlDispatcher*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherA".} - proc StartService*(hService: SC_HANDLE, dwNumServiceArgs: DWORD, - lpServiceArgVectors: LPCSTR): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "StartServiceA".} - proc DragQueryFile*(para1: HDROP, para2: int, para3: cstring, para4: int): int{. - stdcall, dynlib: "shell32", importc: "DragQueryFileA".} - proc ExtractAssociatedIcon*(para1: HINST, para2: cstring, para3: LPWORD): HICON{. - stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconA".} - proc ExtractIcon*(para1: HINST, para2: cstring, para3: int): HICON{.stdcall, - dynlib: "shell32", importc: "ExtractIconA".} - proc FindExecutable*(para1: cstring, para2: cstring, para3: cstring): HINST{. - stdcall, dynlib: "shell32", importc: "FindExecutableA".} - proc ShellAbout*(para1: HWND, para2: cstring, para3: cstring, para4: HICON): int32{. - stdcall, dynlib: "shell32", importc: "ShellAboutA".} - proc ShellExecute*(para1: HWND, para2: cstring, para3: cstring, - para4: cstring, para5: cstring, para6: int32): HINST{. - stdcall, dynlib: "shell32", importc: "ShellExecuteA".} - proc Shell_NotifyIcon*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{. - stdcall, dynlib: "shell32", importc: "Shell_NotifyIconA".} - proc DdeCreateStringHandle*(para1: DWORD, para2: cstring, para3: int32): HSZ{. - stdcall, dynlib: "user32", importc: "DdeCreateStringHandleA".} - proc DdeInitialize*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD, - para4: DWORD): 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: INT, dwBytes: DWORD): HGLOBAL{.stdcall, - dynlib: "kernel32", importc: "GlobalAlloc".} -proc GlobalReAlloc*(hMem: HGLOBAL, dwBytes: DWORD, uFlags: INT): 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 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 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*(FileTime: LPFILETIME, - lpLocalFileTime: LPFILETIME): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "FileTimeToLocalFileTime".} -proc LocalFileTimeToFileTime*(lpLocalFileTime: LPFILETIME, - lpFileTime: LPFILETIME): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "LocalFileTimeToFileTime".} -proc FileTimeToSystemTime*(lpFileTime: LPFILETIME, lpSystemTime: LPSYSTEMTIME): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "FileTimeToSystemTime".} -proc CompareFileTime*(lpFileTime1: LPFILETIME, lpFileTime2: LPFILETIME): LONG{. - stdcall, dynlib: "kernel32", importc: "CompareFileTime".} -proc FileTimeToDosDateTime*(lpFileTime: LPFILETIME, lpFatDate: LPWORD, - lpFatTime: LPWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "FileTimeToDosDateTime".} -proc DosDateTimeToFileTime*(wFatDate: int16, wFatTime: int16, - lpFileTime: LPFILETIME): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "DosDateTimeToFileTime".} -proc GetTickCount*(): DWORD{.stdcall, dynlib: "kernel32", - importc: "GetTickCount".} -proc SetSystemTimeAdjustment*(dwTimeAdjustment: DWORD, - bTimeAdjustmentDisabled: WINBOOL): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetSystemTimeAdjustment".} -proc GetSystemTimeAdjustment*(lpTimeAdjustment: PDWORD, lpTimeIncrement: PDWORD, - lpTimeAdjustmentDisabled: PWINBOOL): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "GetSystemTimeAdjustment".} -proc CreatePipe*(hReadPipe: PHANDLE, hWritePipe: PHANDLE, - lpPipeAttributes: LPSECURITY_ATTRIBUTES, nSize: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "CreatePipe".} -proc ConnectNamedPipe*(hNamedPipe: HANDLE, lpOverlapped: LPOVERLAPPED): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ConnectNamedPipe".} -proc DisconnectNamedPipe*(hNamedPipe: HANDLE): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "DisconnectNamedPipe".} -proc SetNamedPipeHandleState*(hNamedPipe: HANDLE, lpMode: LPDWORD, - lpMaxCollectionCount: LPDWORD, - lpCollectDataTimeout: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetNamedPipeHandleState".} -proc GetNamedPipeInfo*(hNamedPipe: HANDLE, lpFlags: LPDWORD, - lpOutBufferSize: LPDWORD, lpInBufferSize: LPDWORD, - lpMaxInstances: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetNamedPipeInfo".} -proc PeekNamedPipe*(hNamedPipe: HANDLE, lpBuffer: LPVOID, nBufferSize: DWORD, - lpBytesRead: LPDWORD, lpTotalBytesAvail: LPDWORD, - lpBytesLeftThisMessage: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "PeekNamedPipe".} -proc TransactNamedPipe*(hNamedPipe: HANDLE, lpInBuffer: LPVOID, - nInBufferSize: DWORD, lpOutBuffer: LPVOID, - nOutBufferSize: DWORD, lpBytesRead: LPDWORD, - lpOverlapped: LPOVERLAPPED): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "TransactNamedPipe".} -proc GetMailslotInfo*(hMailslot: HANDLE, lpMaxMessageSize: LPDWORD, - lpNextSize: LPDWORD, lpMessageCount: LPDWORD, - lpReadTimeout: LPDWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "GetMailslotInfo".} -proc SetMailslotInfo*(hMailslot: HANDLE, lReadTimeout: DWORD): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "SetMailslotInfo".} -proc MapViewOfFile*(hFileMappingObject: HANDLE, dwDesiredAccess: DWORD, - dwFileOffsetHigh: DWORD, dwFileOffsetLow: DWORD, - dwNumberOfBytesToMap: DWORD): LPVOID{.stdcall, - dynlib: "kernel32", importc: "MapViewOfFile".} -proc FlushViewOfFile*(lpBaseAddress: LPCVOID, dwNumberOfBytesToFlush: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "FlushViewOfFile".} -proc UnmapViewOfFile*(lpBaseAddress: LPVOID): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "UnmapViewOfFile".} -proc OpenFile*(lpFileName: LPCSTR, lpReOpenBuff: LPOFSTRUCT, uStyle: 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*(file: HFILE): HFILE{.stdcall, dynlib: "kernel32", - importc: "_lclose".} -proc llseek*(file: HFILE, lOffset: LONG, iOrigin: int32): LONG{.stdcall, - dynlib: "kernel32", importc: "_llseek".} -proc IsTextUnicode*(lpBuffer: LPVOID, cb: int32, lpi: LPINT): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "IsTextUnicode".} -proc TlsAlloc*(): DWORD{.stdcall, dynlib: "kernel32", importc: "TlsAlloc".} -proc TlsGetValue*(dwTlsIndex: DWORD): LPVOID{.stdcall, dynlib: "kernel32", - importc: "TlsGetValue".} -proc TlsSetValue*(dwTlsIndex: DWORD, lpTlsValue: LPVOID): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "TlsSetValue".} -proc TlsFree*(dwTlsIndex: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "TlsFree".} -proc SleepEx*(dwMilliseconds: DWORD, bAlertable: WINBOOL): DWORD{.stdcall, - dynlib: "kernel32", importc: "SleepEx".} -proc WaitForSingleObjectEx*(hHandle: HANDLE, dwMilliseconds: DWORD, - bAlertable: WINBOOL): DWORD{.stdcall, - dynlib: "kernel32", importc: "WaitForSingleObjectEx".} -proc WaitForMultipleObjectsEx*(nCount: DWORD, lpHandles: LPHANDLE, - bWaitAll: WINBOOL, dwMilliseconds: DWORD, - bAlertable: WINBOOL): DWORD{.stdcall, - dynlib: "kernel32", importc: "WaitForMultipleObjectsEx".} -proc ReadFileEx*(hFile: HANDLE, lpBuffer: LPVOID, nNumberOfBytesToRead: DWORD, - lpOverlapped: LPOVERLAPPED, - lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadFileEx".} -proc WriteFileEx*(hFile: HANDLE, lpBuffer: LPCVOID, - nNumberOfBytesToWrite: DWORD, lpOverlapped: LPOVERLAPPED, - lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "WriteFileEx".} -proc BackupRead*(hFile: HANDLE, lpBuffer: LPBYTE, nNumberOfBytesToRead: DWORD, - lpNumberOfBytesRead: LPDWORD, bAbort: WINBOOL, - bProcessSecurity: WINBOOL, lpContext: var LPVOID): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "BackupRead".} -proc BackupSeek*(hFile: HANDLE, dwLowBytesToSeek: DWORD, - dwHighBytesToSeek: DWORD, lpdwLowByteSeeked: LPDWORD, - lpdwHighByteSeeked: LPDWORD, lpContext: var LPVOID): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "BackupSeek".} -proc BackupWrite*(hFile: HANDLE, lpBuffer: LPBYTE, nNumberOfBytesToWrite: DWORD, - lpNumberOfBytesWritten: LPDWORD, bAbort: WINBOOL, - bProcessSecurity: WINBOOL, lpContext: var LPVOID): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "BackupWrite".} -proc SetProcessShutdownParameters*(dwLevel: DWORD, dwFlags: DWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "SetProcessShutdownParameters".} -proc GetProcessShutdownParameters*(lpdwLevel: LPDWORD, lpdwFlags: LPDWORD): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "GetProcessShutdownParameters".} -proc SetFileApisToOEM*(){.stdcall, dynlib: "kernel32", - importc: "SetFileApisToOEM".} -proc SetFileApisToANSI*(){.stdcall, dynlib: "kernel32", - importc: "SetFileApisToANSI".} -proc AreFileApisANSI*(): WINBOOL{.stdcall, dynlib: "kernel32", - importc: "AreFileApisANSI".} -proc CloseEventLog*(hEventLog: HANDLE): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "CloseEventLog".} -proc DeregisterEventSource*(hEventLog: HANDLE): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "DeregisterEventSource".} -proc NotifyChangeEventLog*(hEventLog: HANDLE, hEvent: HANDLE): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "NotifyChangeEventLog".} -proc GetNumberOfEventLogRecords*(hEventLog: HANDLE, NumberOfRecords: PDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetNumberOfEventLogRecords".} -proc GetOldestEventLogRecord*(hEventLog: HANDLE, OldestRecord: PDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetOldestEventLogRecord".} -proc DuplicateToken*(ExistingTokenHandle: HANDLE, - ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, - DuplicateTokenHandle: PHANDLE): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "DuplicateToken".} -proc GetKernelObjectSecurity*(Handle: HANDLE, - RequestedInformation: SECURITY_INFORMATION, - pSecurityDescriptor: PSECURITY_DESCRIPTOR, - nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetKernelObjectSecurity".} -proc ImpersonateNamedPipeClient*(hNamedPipe: HANDLE): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "ImpersonateNamedPipeClient".} -proc ImpersonateLoggedOnUser*(hToken: HANDLE): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "ImpersonateLoggedOnUser".} -proc ImpersonateSelf*(ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "ImpersonateSelf".} -proc RevertToSelf*(): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "RevertToSelf".} -proc SetThreadToken*(Thread: PHANDLE, Token: HANDLE): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "SetThreadToken".} -proc OpenProcessToken*(ProcessHandle: HANDLE, DesiredAccess: DWORD, - TokenHandle: PHANDLE): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "OpenProcessToken".} -proc OpenThreadToken*(ThreadHandle: HANDLE, DesiredAccess: DWORD, - OpenAsSelf: WINBOOL, TokenHandle: PHANDLE): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "OpenThreadToken".} -proc GetTokenInformation*(TokenHandle: HANDLE, - TokenInformationClass: TOKEN_INFORMATION_CLASS, - TokenInformation: LPVOID, - TokenInformationLength: DWORD, ReturnLength: PDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetTokenInformation".} -proc SetTokenInformation*(TokenHandle: HANDLE, - TokenInformationClass: TOKEN_INFORMATION_CLASS, - TokenInformation: LPVOID, - TokenInformationLength: DWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "SetTokenInformation".} -proc AdjustTokenPrivileges*(TokenHandle: HANDLE, DisableAllPrivileges: WINBOOL, - NewState: PTOKEN_PRIVILEGES, BufferLength: DWORD, - PreviousState: PTOKEN_PRIVILEGES, - ReturnLength: PDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "AdjustTokenPrivileges".} -proc AdjustTokenGroups*(TokenHandle: HANDLE, ResetToDefault: WINBOOL, - NewState: PTOKEN_GROUPS, BufferLength: DWORD, - PreviousState: PTOKEN_GROUPS, ReturnLength: PDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "AdjustTokenGroups".} -proc PrivilegeCheck*(ClientToken: HANDLE, RequiredPrivileges: PPRIVILEGE_SET, - pfResult: LPBOOL): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "PrivilegeCheck".} -proc IsValidSid*(pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "IsValidSid".} -proc EqualSid*(pSid1: PSID, pSid2: PSID): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "EqualSid".} -proc EqualPrefixSid*(pSid1: PSID, pSid2: PSID): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "EqualPrefixSid".} -proc GetSidLengthRequired*(nSubAuthorityCount: UCHAR): DWORD{.stdcall, - dynlib: "advapi32", importc: "GetSidLengthRequired".} -proc AllocateAndInitializeSid*(pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY, - nSubAuthorityCount: int8, nSubAuthority0: DWORD, - nSubAuthority1: DWORD, nSubAuthority2: DWORD, - nSubAuthority3: DWORD, nSubAuthority4: DWORD, - nSubAuthority5: DWORD, nSubAuthority6: DWORD, - nSubAuthority7: DWORD, pSid: var PSID): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "AllocateAndInitializeSid".} -proc FreeSid*(pSid: PSID): PVOID{.stdcall, dynlib: "advapi32", - importc: "FreeSid".} -proc InitializeSid*(Sid: PSID, pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY, - nSubAuthorityCount: int8): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "InitializeSid".} -proc GetSidIdentifierAuthority*(pSid: PSID): PSID_IDENTIFIER_AUTHORITY{.stdcall, - dynlib: "advapi32", importc: "GetSidIdentifierAuthority".} -proc GetSidSubAuthority*(pSid: PSID, nSubAuthority: DWORD): PDWORD{.stdcall, - dynlib: "advapi32", importc: "GetSidSubAuthority".} -proc GetSidSubAuthorityCount*(pSid: PSID): PUCHAR{.stdcall, dynlib: "advapi32", - importc: "GetSidSubAuthorityCount".} -proc GetLengthSid*(pSid: PSID): DWORD{.stdcall, dynlib: "advapi32", - importc: "GetLengthSid".} -proc CopySid*(nDestinationSidLength: DWORD, pDestinationSid: PSID, - pSourceSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "CopySid".} -proc AreAllAccessesGranted*(GrantedAccess: DWORD, DesiredAccess: DWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "AreAllAccessesGranted".} -proc AreAnyAccessesGranted*(GrantedAccess: DWORD, DesiredAccess: DWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "AreAnyAccessesGranted".} -proc MapGenericMask*(AccessMask: PDWORD, GenericMapping: PGENERIC_MAPPING){. - stdcall, dynlib: "advapi32", importc: "MapGenericMask".} -proc IsValidAcl*(pAcl: PACL): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "IsValidAcl".} -proc InitializeAcl*(pAcl: PACL, nAclLength: DWORD, dwAclRevision: DWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "InitializeAcl".} -proc GetAclInformation*(pAcl: PACL, pAclInformation: LPVOID, - nAclInformationLength: DWORD, - dwAclInformationClass: ACL_INFORMATION_CLASS): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetAclInformation".} -proc SetAclInformation*(pAcl: PACL, pAclInformation: LPVOID, - nAclInformationLength: DWORD, - dwAclInformationClass: ACL_INFORMATION_CLASS): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "SetAclInformation".} -proc AddAce*(pAcl: PACL, dwAceRevision: DWORD, dwStartingAceIndex: DWORD, - pAceList: LPVOID, nAceListLength: DWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "AddAce".} -proc DeleteAce*(pAcl: PACL, dwAceIndex: DWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "DeleteAce".} -proc GetAce*(pAcl: PACL, dwAceIndex: DWORD, pAce: var LPVOID): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "GetAce".} -proc AddAccessAllowedAce*(pAcl: PACL, dwAceRevision: DWORD, AccessMask: DWORD, - pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "AddAccessAllowedAce".} -proc AddAccessDeniedAce*(pAcl: PACL, dwAceRevision: DWORD, AccessMask: DWORD, - pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "AddAccessDeniedAce".} -proc AddAuditAccessAce*(pAcl: PACL, dwAceRevision: DWORD, dwAccessMask: DWORD, - pSid: PSID, bAuditSuccess: WINBOOL, - bAuditFailure: WINBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "AddAuditAccessAce".} -proc FindFirstFreeAce*(pAcl: PACL, pAce: var LPVOID): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "FindFirstFreeAce".} -proc InitializeSecurityDescriptor*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - dwRevision: DWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "InitializeSecurityDescriptor".} -proc IsValidSecurityDescriptor*(pSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "IsValidSecurityDescriptor".} -proc GetSecurityDescriptorLength*(pSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD{. - stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorLength".} -proc GetSecurityDescriptorControl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - pControl: PSECURITY_DESCRIPTOR_CONTROL, - lpdwRevision: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "GetSecurityDescriptorControl".} -proc SetSecurityDescriptorDacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - bDaclPresent: WINBOOL, pDacl: PACL, - bDaclDefaulted: WINBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "SetSecurityDescriptorDacl".} -proc GetSecurityDescriptorDacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - lpbDaclPresent: LPBOOL, pDacl: var PACL, - lpbDaclDefaulted: LPBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "GetSecurityDescriptorDacl".} -proc SetSecurityDescriptorSacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - bSaclPresent: WINBOOL, pSacl: PACL, - bSaclDefaulted: WINBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "SetSecurityDescriptorSacl".} -proc GetSecurityDescriptorSacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - lpbSaclPresent: LPBOOL, pSacl: var PACL, - lpbSaclDefaulted: LPBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "GetSecurityDescriptorSacl".} -proc SetSecurityDescriptorOwner*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - pOwner: PSID, bOwnerDefaulted: WINBOOL): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "SetSecurityDescriptorOwner".} -proc GetSecurityDescriptorOwner*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - pOwner: var PSID, lpbOwnerDefaulted: LPBOOL): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorOwner".} -proc SetSecurityDescriptorGroup*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - pGroup: PSID, bGroupDefaulted: WINBOOL): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "SetSecurityDescriptorGroup".} -proc GetSecurityDescriptorGroup*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, - pGroup: var PSID, lpbGroupDefaulted: LPBOOL): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorGroup".} -proc CreatePrivateObjectSecurity*(ParentDescriptor: PSECURITY_DESCRIPTOR, - CreatorDescriptor: PSECURITY_DESCRIPTOR, - NewDescriptor: var PSECURITY_DESCRIPTOR, - IsDirectoryObject: WINBOOL, Token: HANDLE, - GenericMapping: PGENERIC_MAPPING): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "CreatePrivateObjectSecurity".} -proc SetPrivateObjectSecurity*(SecurityInformation: SECURITY_INFORMATION, - ModificationDescriptor: PSECURITY_DESCRIPTOR, - ObjectsSecurityDescriptor: var PSECURITY_DESCRIPTOR, - GenericMapping: PGENERIC_MAPPING, Token: HANDLE): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "SetPrivateObjectSecurity".} -proc GetPrivateObjectSecurity*(ObjectDescriptor: PSECURITY_DESCRIPTOR, - SecurityInformation: SECURITY_INFORMATION, - ResultantDescriptor: PSECURITY_DESCRIPTOR, - DescriptorLength: DWORD, ReturnLength: PDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "GetPrivateObjectSecurity".} -proc DestroyPrivateObjectSecurity*(ObjectDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "DestroyPrivateObjectSecurity".} -proc MakeSelfRelativeSD*(pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR, - pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR, - lpdwBufferLength: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "MakeSelfRelativeSD".} -proc MakeAbsoluteSD*(pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR, - pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR, - lpdwAbsoluteSecurityDescriptorSize: LPDWORD, pDacl: PACL, - lpdwDaclSize: LPDWORD, pSacl: PACL, lpdwSaclSize: LPDWORD, - pOwner: PSID, lpdwOwnerSize: LPDWORD, pPrimaryGroup: PSID, - lpdwPrimaryGroupSize: LPDWORD): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "MakeAbsoluteSD".} -proc SetKernelObjectSecurity*(Handle: HANDLE, - SecurityInformation: SECURITY_INFORMATION, - SecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "SetKernelObjectSecurity".} -proc FindNextChangeNotification*(hChangeHandle: HANDLE): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "FindNextChangeNotification".} -proc FindCloseChangeNotification*(hChangeHandle: HANDLE): WINBOOL{.stdcall, - dynlib: "kernel32", importc: "FindCloseChangeNotification".} -proc VirtualLock*(lpAddress: LPVOID, dwSize: 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, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnumDesktopWindows".} -proc SwitchDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32", - importc: "SwitchDesktop".} -proc SetThreadDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32", - importc: "SetThreadDesktop".} -proc CloseDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32", - importc: "CloseDesktop".} -proc GetThreadDesktop*(dwThreadId: DWORD): HDESK{.stdcall, dynlib: "user32", - importc: "GetThreadDesktop".} -proc CloseWindowStation*(hWinSta: HWINSTA): WINBOOL{.stdcall, dynlib: "user32", - importc: "CloseWindowStation".} -proc SetProcessWindowStation*(hWinSta: HWINSTA): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetProcessWindowStation".} -proc GetProcessWindowStation*(): HWINSTA{.stdcall, dynlib: "user32", - importc: "GetProcessWindowStation".} -proc SetUserObjectSecurity*(hObj: HANDLE, pSIRequested: PSECURITY_INFORMATION, - pSID: PSECURITY_DESCRIPTOR): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetUserObjectSecurity".} -proc GetUserObjectSecurity*(hObj: HANDLE, pSIRequested: PSECURITY_INFORMATION, - pSID: PSECURITY_DESCRIPTOR, nLength: DWORD, - lpnLengthNeeded: LPDWORD): WINBOOL{.stdcall, - dynlib: "user32", importc: "GetUserObjectSecurity".} -proc TranslateMessage*(lpMsg: LPMSG): WINBOOL{.stdcall, dynlib: "user32", - importc: "TranslateMessage".} -proc SetMessageQueue*(cMessagesMax: int32): WINBOOL{.stdcall, dynlib: "user32", - importc: "SetMessageQueue".} -proc RegisterHotKey*(wnd: HWND, anID: int32, fsModifiers: UINT, vk: UINT): WINBOOL{. - stdcall, dynlib: "user32", importc: "RegisterHotKey".} -proc UnregisterHotKey*(wnd: 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*(lp: 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*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "IsWindow".} -proc IsMenu*(menu: HMENU): WINBOOL{.stdcall, dynlib: "user32", - importc: "IsMenu".} -proc IsChild*(hWndParent: HWND, wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "IsChild".} -proc DestroyWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "DestroyWindow".} -proc ShowWindow*(wnd: HWND, nCmdShow: int32): WINBOOL{.stdcall, - dynlib: "user32", importc: "ShowWindow".} -proc ShowWindowAsync*(wnd: HWND, nCmdShow: int32): WINBOOL{.stdcall, - dynlib: "user32", importc: "ShowWindowAsync".} -proc FlashWindow*(wnd: HWND, bInvert: WINBOOL): WINBOOL{.stdcall, - dynlib: "user32", importc: "FlashWindow".} -proc ShowOwnedPopups*(wnd: HWND, fShow: WINBOOL): WINBOOL{.stdcall, - dynlib: "user32", importc: "ShowOwnedPopups".} -proc OpenIcon*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "OpenIcon".} -proc CloseWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "CloseWindow".} -proc MoveWindow*(wnd: HWND, X: int32, Y: int32, nWidth: int32, nHeight: int32, - bRepaint: WINBOOL): WINBOOL{.stdcall, dynlib: "user32", - importc: "MoveWindow".} -proc SetWindowPos*(wnd: HWND, hWndInsertAfter: HWND, X: int32, Y: int32, - cx: int32, cy: int32, uFlags: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetWindowPos".} -proc GetWindowPlacement*(wnd: HWND, lpwndpl: var WINDOWPLACEMENT): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetWindowPlacement".} -proc SetWindowPlacement*(wnd: HWND, lpwndpl: var WINDOWPLACEMENT): WINBOOL{. - stdcall, dynlib: "user32", importc: "SetWindowPlacement".} -proc GetWindowPlacement*(wnd: HWND, lpwndpl: PWINDOWPLACEMENT): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetWindowPlacement".} -proc SetWindowPlacement*(wnd: HWND, lpwndpl: PWINDOWPLACEMENT): WINBOOL{. - stdcall, dynlib: "user32", importc: "SetWindowPlacement".} -proc BeginDeferWindowPos*(nNumWindows: int32): HDWP{.stdcall, dynlib: "user32", - importc: "BeginDeferWindowPos".} -proc DeferWindowPos*(hWinPosInfo: HDWP, wnd: HWND, hWndInsertAfter: HWND, - x: int32, y: int32, cx: int32, cy: int32, uFlags: UINT): HDWP{. - stdcall, dynlib: "user32", importc: "DeferWindowPos".} -proc EndDeferWindowPos*(hWinPosInfo: HDWP): WINBOOL{.stdcall, dynlib: "user32", - importc: "EndDeferWindowPos".} -proc IsWindowVisible*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "IsWindowVisible".} -proc IsIconic*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "IsIconic".} -proc AnyPopup*(): WINBOOL{.stdcall, dynlib: "user32", importc: "AnyPopup".} -proc BringWindowToTop*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "BringWindowToTop".} -proc IsZoomed*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "IsZoomed".} -proc EndDialog*(hDlg: HWND, nResult: int32): WINBOOL{.stdcall, dynlib: "user32", - importc: "EndDialog".} -proc GetDlgItem*(hDlg: HWND, nIDDlgItem: int32): HWND{.stdcall, - dynlib: "user32", importc: "GetDlgItem".} -proc SetDlgItemInt*(hDlg: HWND, nIDDlgItem: int32, uValue: 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*(wnd: HWND): int32{.stdcall, dynlib: "user32", - importc: "GetDlgCtrlID".} -proc GetDialogBaseUnits*(): int32{.stdcall, dynlib: "user32", - importc: "GetDialogBaseUnits".} -proc OpenClipboard*(hWndNewOwner: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "OpenClipboard".} -proc CloseClipboard*(): WINBOOL{.stdcall, dynlib: "user32", - importc: "CloseClipboard".} -proc GetClipboardOwner*(): HWND{.stdcall, dynlib: "user32", - importc: "GetClipboardOwner".} -proc SetClipboardViewer*(hWndNewViewer: HWND): HWND{.stdcall, dynlib: "user32", - importc: "SetClipboardViewer".} -proc GetClipboardViewer*(): HWND{.stdcall, dynlib: "user32", - importc: "GetClipboardViewer".} -proc ChangeClipboardChain*(hWndRemove: HWND, hWndNewNext: HWND): WINBOOL{. - stdcall, dynlib: "user32", importc: "ChangeClipboardChain".} -proc SetClipboardData*(uFormat: 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*(wnd: HWND): HWND{.stdcall, dynlib: "user32", importc: "SetFocus".} -proc GetActiveWindow*(): HWND{.stdcall, dynlib: "user32", - importc: "GetActiveWindow".} -proc GetFocus*(): HWND{.stdcall, dynlib: "user32", importc: "GetFocus".} -proc GetKBCodePage*(): 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*(wnd: HWND): HWND{.stdcall, dynlib: "user32", - importc: "SetCapture".} -proc ReleaseCapture*(): WINBOOL{.stdcall, dynlib: "user32", - importc: "ReleaseCapture".} -proc MsgWaitForMultipleObjects*(nCount: DWORD, pHandles: LPHANDLE, - fWaitAll: WINBOOL, dwMilliseconds: DWORD, - dwWakeMask: DWORD): DWORD{.stdcall, - dynlib: "user32", importc: "MsgWaitForMultipleObjects".} -proc SetTimer*(wnd: HWND, nIDEvent: UINT, uElapse: UINT, lpTimerFunc: TIMERPROC): UINT{. - stdcall, dynlib: "user32", importc: "SetTimer".} -proc KillTimer*(wnd: HWND, uIDEvent: UINT): WINBOOL{.stdcall, dynlib: "user32", - importc: "KillTimer".} -proc IsWindowUnicode*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "IsWindowUnicode".} -proc EnableWindow*(wnd: HWND, bEnable: WINBOOL): WINBOOL{.stdcall, - dynlib: "user32", importc: "EnableWindow".} -proc IsWindowEnabled*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "IsWindowEnabled".} -proc DestroyAcceleratorTable*(hAccel: HACCEL): WINBOOL{.stdcall, - dynlib: "user32", importc: "DestroyAcceleratorTable".} -proc GetSystemMetrics*(nIndex: int32): int32{.stdcall, dynlib: "user32", - importc: "GetSystemMetrics".} -proc GetMenu*(wnd: HWND): HMENU{.stdcall, dynlib: "user32", importc: "GetMenu".} -proc SetMenu*(wnd: HWND, menu: HMENU): WINBOOL{.stdcall, dynlib: "user32", - importc: "SetMenu".} -proc HiliteMenuItem*(wnd: HWND, menu: HMENU, uIDHiliteItem: UINT, - uHilite: UINT): WINBOOL{.stdcall, dynlib: "user32", - importc: "HiliteMenuItem".} -proc GetMenuState*(menu: HMENU, uId: UINT, uFlags: UINT): UINT{.stdcall, - dynlib: "user32", importc: "GetMenuState".} -proc DrawMenuBar*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "DrawMenuBar".} -proc GetSystemMenu*(wnd: HWND, bRevert: WINBOOL): HMENU{.stdcall, - dynlib: "user32", importc: "GetSystemMenu".} -proc CreateMenu*(): HMENU{.stdcall, dynlib: "user32", importc: "CreateMenu".} -proc CreatePopupMenu*(): HMENU{.stdcall, dynlib: "user32", - importc: "CreatePopupMenu".} -proc DestroyMenu*(menu: HMENU): WINBOOL{.stdcall, dynlib: "user32", - importc: "DestroyMenu".} -proc CheckMenuItem*(menu: HMENU, uIDCheckItem: UINT, uCheck: UINT): DWORD{. - stdcall, dynlib: "user32", importc: "CheckMenuItem".} -proc EnableMenuItem*(menu: HMENU, uIDEnableItem: UINT, uEnable: UINT): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnableMenuItem".} -proc GetSubMenu*(menu: HMENU, nPos: int32): HMENU{.stdcall, dynlib: "user32", - importc: "GetSubMenu".} -proc GetMenuItemID*(menu: HMENU, nPos: int32): UINT{.stdcall, dynlib: "user32", - importc: "GetMenuItemID".} -proc GetMenuItemCount*(menu: HMENU): int32{.stdcall, dynlib: "user32", - importc: "GetMenuItemCount".} -proc RemoveMenu*(menu: HMENU, uPosition: UINT, uFlags: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "RemoveMenu".} -proc DeleteMenu*(menu: HMENU, uPosition: UINT, uFlags: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "DeleteMenu".} -proc SetMenuItemBitmaps*(menu: 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*(menu: HMENU, uFlags: UINT, x: int32, y: int32, - nReserved: int32, wnd: HWND, prcRect: var RECT): WINBOOL{. - stdcall, dynlib: "user32", importc: "TrackPopupMenu".} -proc GetMenuDefaultItem*(menu: HMENU, fByPos: UINT, gmdiFlags: UINT): UINT{. - stdcall, dynlib: "user32", importc: "GetMenuDefaultItem".} -proc SetMenuDefaultItem*(menu: HMENU, uItem: UINT, fByPos: UINT): WINBOOL{. - stdcall, dynlib: "user32", importc: "SetMenuDefaultItem".} -proc GetMenuItemRect*(wnd: HWND, menu: HMENU, uItem: UINT, lprcItem: LPRECT): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetMenuItemRect".} -proc MenuItemFromPoint*(wnd: HWND, menu: HMENU, ptScreen: POINT): int32{. - stdcall, dynlib: "user32", importc: "MenuItemFromPoint".} -proc DragObject*(para1: HWND, para2: HWND, para3: UINT, para4: DWORD, - para5: HCURSOR): DWORD{.stdcall, dynlib: "user32", - importc: "DragObject".} -proc DragDetect*(wnd: HWND, pt: POINT): WINBOOL{.stdcall, dynlib: "user32", - importc: "DragDetect".} -proc DrawIcon*(hDC: HDC, X: int32, Y: int32, icon: HICON): WINBOOL{.stdcall, - dynlib: "user32", importc: "DrawIcon".} -proc UpdateWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "UpdateWindow".} -proc SetActiveWindow*(wnd: HWND): HWND{.stdcall, dynlib: "user32", - importc: "SetActiveWindow".} -proc GetForegroundWindow*(): HWND{.stdcall, dynlib: "user32", - importc: "GetForegroundWindow".} -proc PaintDesktop*(hdc: HDC): WINBOOL{.stdcall, dynlib: "user32", - importc: "PaintDesktop".} -proc SetForegroundWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "SetForegroundWindow".} -proc WindowFromDC*(hDC: HDC): HWND{.stdcall, dynlib: "user32", - importc: "WindowFromDC".} -proc GetDC*(wnd: HWND): HDC{.stdcall, dynlib: "user32", importc: "GetDC".} -proc GetDCEx*(wnd: HWND, hrgnClip: HRGN, flags: DWORD): HDC{.stdcall, - dynlib: "user32", importc: "GetDCEx".} -proc GetWindowDC*(wnd: HWND): HDC{.stdcall, dynlib: "user32", - importc: "GetWindowDC".} -proc ReleaseDC*(wnd: HWND, hDC: HDC): int32{.stdcall, dynlib: "user32", - importc: "ReleaseDC".} -proc BeginPaint*(wnd: HWND, lpPaint: LPPAINTSTRUCT): HDC{.stdcall, - dynlib: "user32", importc: "BeginPaint".} -proc EndPaint*(wnd: HWND, lpPaint: LPPAINTSTRUCT): WINBOOL{.stdcall, - dynlib: "user32", importc: "EndPaint".} -proc GetUpdateRect*(wnd: HWND, lpRect: LPRECT, bErase: WINBOOL): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetUpdateRect".} -proc GetUpdateRgn*(wnd: HWND, hRgn: HRGN, bErase: WINBOOL): int32{.stdcall, - dynlib: "user32", importc: "GetUpdateRgn".} -proc SetWindowRgn*(wnd: HWND, hRgn: HRGN, bRedraw: WINBOOL): int32{.stdcall, - dynlib: "user32", importc: "SetWindowRgn".} -proc GetWindowRgn*(wnd: HWND, hRgn: HRGN): int32{.stdcall, dynlib: "user32", - importc: "GetWindowRgn".} -proc ExcludeUpdateRgn*(hDC: HDC, wnd: HWND): int32{.stdcall, dynlib: "user32", - importc: "ExcludeUpdateRgn".} -proc InvalidateRect*(wnd: HWND, lpRect: var RECT, bErase: WINBOOL): WINBOOL{. - stdcall, dynlib: "user32", importc: "InvalidateRect".} -proc InvalidateRect*(wnd: HWND, lpRect: LPRECT, bErase: WINBOOL): WINBOOL{. - stdcall, dynlib: "user32", importc: "InvalidateRect".} -proc ValidateRect*(wnd: HWND, lpRect: var RECT): WINBOOL{.stdcall, - dynlib: "user32", importc: "ValidateRect".} -proc ValidateRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall, - dynlib: "user32", importc: "ValidateRect".} -proc InvalidateRgn*(wnd: HWND, hRgn: HRGN, bErase: WINBOOL): WINBOOL{.stdcall, - dynlib: "user32", importc: "InvalidateRgn".} -proc ValidateRgn*(wnd: HWND, hRgn: HRGN): WINBOOL{.stdcall, dynlib: "user32", - importc: "ValidateRgn".} -proc RedrawWindow*(wnd: HWND, lprcUpdate: var RECT, hrgnUpdate: HRGN, - flags: UINT): WINBOOL{.stdcall, dynlib: "user32", - importc: "RedrawWindow".} -proc RedrawWindow*(wnd: 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*(wnd: HWND, XAmount: int32, YAmount: int32, lpRect: var RECT, - lpClipRect: var RECT): WINBOOL{.stdcall, dynlib: "user32", - importc: "ScrollWindow".} -proc ScrollDC*(hDC: HDC, dx: int32, dy: int32, lprcScroll: var RECT, - lprcClip: var RECT, hrgnUpdate: HRGN, lprcUpdate: LPRECT): WINBOOL{. - stdcall, dynlib: "user32", importc: "ScrollDC".} -proc ScrollWindowEx*(wnd: HWND, dx: int32, dy: int32, prcScroll: var RECT, - prcClip: var RECT, hrgnUpdate: HRGN, prcUpdate: LPRECT, - flags: UINT): int32{.stdcall, dynlib: "user32", - importc: "ScrollWindowEx".} -proc SetScrollPos*(wnd: HWND, nBar: int32, nPos: int32, bRedraw: WINBOOL): int32{. - stdcall, dynlib: "user32", importc: "SetScrollPos".} -proc GetScrollPos*(wnd: HWND, nBar: int32): int32{.stdcall, dynlib: "user32", - importc: "GetScrollPos".} -proc SetScrollRange*(wnd: HWND, nBar: int32, nMinPos: int32, nMaxPos: int32, - bRedraw: WINBOOL): WINBOOL{.stdcall, dynlib: "user32", - importc: "SetScrollRange".} -proc GetScrollRange*(wnd: HWND, nBar: int32, lpMinPos: LPINT, lpMaxPos: LPINT): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetScrollRange".} -proc ShowScrollBar*(wnd: HWND, wBar: int32, bShow: WINBOOL): WINBOOL{.stdcall, - dynlib: "user32", importc: "ShowScrollBar".} -proc EnableScrollBar*(wnd: HWND, wSBflags: UINT, wArrows: UINT): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnableScrollBar".} -proc GetClientRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall, - dynlib: "user32", importc: "GetClientRect".} -proc GetWindowRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall, - dynlib: "user32", importc: "GetWindowRect".} -proc AdjustWindowRect*(lpRect: LPRECT, dwStyle: DWORD, bMenu: WINBOOL): WINBOOL{. - stdcall, dynlib: "user32", importc: "AdjustWindowRect".} -proc AdjustWindowRectEx*(lpRect: LPRECT, dwStyle: DWORD, bMenu: WINBOOL, - dwExStyle: DWORD): WINBOOL{.stdcall, dynlib: "user32", - importc: "AdjustWindowRectEx".} -proc SetWindowContextHelpId*(para1: HWND, para2: DWORD): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetWindowContextHelpId".} -proc GetWindowContextHelpId*(para1: HWND): DWORD{.stdcall, dynlib: "user32", - importc: "GetWindowContextHelpId".} -proc SetMenuContextHelpId*(para1: HMENU, para2: DWORD): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetMenuContextHelpId".} -proc GetMenuContextHelpId*(para1: HMENU): DWORD{.stdcall, dynlib: "user32", - importc: "GetMenuContextHelpId".} -proc MessageBeep*(uType: 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*(cursor: HCURSOR): HCURSOR{.stdcall, dynlib: "user32", - importc: "SetCursor".} -proc GetCursorPos*(lpPoint: LPPOINT): WINBOOL{.stdcall, dynlib: "user32", - importc: "GetCursorPos".} -proc ClipCursor*(lpRect: LPRECT): WINBOOL{.stdcall, dynlib: "user32", - importc: "ClipCursor".} -proc GetClipCursor*(lpRect: LPRECT): WINBOOL{.stdcall, dynlib: "user32", - importc: "GetClipCursor".} -proc GetCursor*(): HCURSOR{.stdcall, dynlib: "user32", importc: "GetCursor".} -proc CreateCaret*(wnd: HWND, hBitmap: HBITMAP, nWidth: int32, nHeight: int32): WINBOOL{. - stdcall, dynlib: "user32", importc: "CreateCaret".} -proc GetCaretBlinkTime*(): 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*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "HideCaret".} -proc ShowCaret*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", - importc: "ShowCaret".} -proc SetCaretPos*(X: int32, Y: int32): WINBOOL{.stdcall, dynlib: "user32", - importc: "SetCaretPos".} -proc GetCaretPos*(lpPoint: LPPOINT): WINBOOL{.stdcall, dynlib: "user32", - importc: "GetCaretPos".} -proc ClientToScreen*(wnd: HWND, lpPoint: LPPOINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "ClientToScreen".} -proc ScreenToClient*(wnd: HWND, lpPoint: LPPOINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "ScreenToClient".} -proc MapWindowPoints*(hWndFrom: HWND, hWndTo: HWND, lpPoints: LPPOINT, - cPoints: 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*(wnd: HWND, nIndex: int32): int16{.stdcall, - dynlib: "user32", importc: "GetWindowWord".} -proc SetWindowWord*(wnd: HWND, nIndex: int32, wNewWord: int16): int16{.stdcall, - dynlib: "user32", importc: "SetWindowWord".} -proc GetClassWord*(wnd: HWND, nIndex: int32): int16{.stdcall, dynlib: "user32", - importc: "GetClassWord".} -proc SetClassWord*(wnd: HWND, nIndex: int32, wNewWord: int16): int16{.stdcall, - dynlib: "user32", importc: "SetClassWord".} -proc GetDesktopWindow*(): HWND{.stdcall, dynlib: "user32", - importc: "GetDesktopWindow".} -proc GetParent*(wnd: HWND): HWND{.stdcall, dynlib: "user32", - importc: "GetParent".} -proc SetParent*(hWndChild: HWND, hWndNewParent: HWND): HWND{.stdcall, - dynlib: "user32", importc: "SetParent".} -proc EnumChildWindows*(hWndParent: HWND, lpEnumFunc: ENUMWINDOWSPROC, - lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", - importc: "EnumChildWindows".} -proc EnumWindows*(lpEnumFunc: ENUMWINDOWSPROC, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnumWindows".} -proc EnumThreadWindows*(dwThreadId: DWORD, lpfn: ENUMWINDOWSPROC, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnumThreadWindows".} -proc EnumTaskWindows*(hTask: HWND, lpfn: FARPROC, lp: LPARAM): WINBOOL{. - stdcall, dynlib: "user32", importc: "EnumThreadWindows".} -proc GetTopWindow*(wnd: HWND): HWND{.stdcall, dynlib: "user32", - importc: "GetTopWindow".} -proc GetWindowThreadProcessId*(wnd: HWND, lpdwProcessId: LPDWORD): DWORD{. - stdcall, dynlib: "user32", importc: "GetWindowThreadProcessId".} -proc GetLastActivePopup*(wnd: HWND): HWND{.stdcall, dynlib: "user32", - importc: "GetLastActivePopup".} -proc GetWindow*(wnd: HWND, uCmd: 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, wp: WPARAM, lp: 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*(cursor: HCURSOR): WINBOOL{.stdcall, dynlib: "user32", - importc: "DestroyCursor".} -proc SetSystemCursor*(hcur: HCURSOR, anID: DWORD): WINBOOL{.stdcall, - dynlib: "user32", importc: "SetSystemCursor".} -proc CreateIcon*(hInstance: HINST, nWidth: int32, nHeight: int32, cPlanes: int8, - cBitsPixel: int8, lpbANDbits: var int8, lpbXORbits: var int8): HICON{. - stdcall, dynlib: "user32", importc: "CreateIcon".} -proc DestroyIcon*(icon: HICON): WINBOOL{.stdcall, dynlib: "user32", - importc: "DestroyIcon".} -proc LookupIconIdFromDirectory*(presbits: PBYTE, fIcon: WINBOOL): int32{. - stdcall, dynlib: "user32", importc: "LookupIconIdFromDirectory".} -proc LookupIconIdFromDirectoryEx*(presbits: PBYTE, fIcon: WINBOOL, - cxDesired: int32, cyDesired: int32, - Flags: 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*(icon: HICON): HICON{.stdcall, dynlib: "user32", - importc: "CopyIcon".} -proc GetIconInfo*(icon: HICON, piconinfo: PICONINFO): WINBOOL{.stdcall, - dynlib: "user32", importc: "GetIconInfo".} -proc MapDialogRect*(hDlg: HWND, lpRect: LPRECT): WINBOOL{.stdcall, - dynlib: "user32", importc: "MapDialogRect".} -proc SetScrollInfo*(para1: HWND, para2: int32, para3: LPCSCROLLINFO, - para4: WINBOOL): int32{.stdcall, dynlib: "user32", - importc: "SetScrollInfo".} -proc GetScrollInfo*(para1: HWND, para2: int32, para3: LPSCROLLINFO): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetScrollInfo".} -proc TranslateMDISysAccel*(hWndClient: HWND, lpMsg: LPMSG): WINBOOL{.stdcall, - dynlib: "user32", importc: "TranslateMDISysAccel".} -proc ArrangeIconicWindows*(wnd: HWND): 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*(wnd: 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, icon: 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*(wnd: 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, wp: WPARAM, lp: LPARAM, hMainMenu: HMENU, - hInst: HINST, hwndStatus: HWND, lpwIDs: var UINT){.stdcall, - dynlib: "comctl32", importc: "MenuHelp".} -proc ShowHideMenuCtl*(wnd: HWND, uFlags: UINT, lpInfo: LPINT): WINBOOL{. - stdcall, dynlib: "comctl32", importc: "ShowHideMenuCtl".} -proc GetEffectiveClientRect*(wnd: HWND, lprc: LPRECT, lpInfo: LPINT){.stdcall, - dynlib: "comctl32", importc: "GetEffectiveClientRect".} -proc MakeDragList*(hLB: HWND): WINBOOL{.stdcall, dynlib: "comctl32", - importc: "MakeDragList".} -proc DrawInsert*(handParent: HWND, hLB: HWND, nItem: int32){.stdcall, - dynlib: "comctl32", importc: "DrawInsert".} -proc LBItemFromPt*(hLB: HWND, pt: POINT, bAutoScroll: WINBOOL): int32{.stdcall, - dynlib: "comctl32", importc: "LBItemFromPt".} -proc CreateUpDownControl*(dwStyle: DWORD, x: int32, y: int32, cx: int32, - cy: int32, hParent: HWND, nID: int32, hInst: HINST, - hBuddy: HWND, nUpper: int32, nLower: int32, - nPos: int32): HWND{.stdcall, dynlib: "comctl32", - importc: "CreateUpDownControl".} -proc RegCloseKey*(key: HKEY): LONG{.stdcall, dynlib: "advapi32", - importc: "RegCloseKey".} -proc RegSetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION, - pSecurityDescriptor: PSECURITY_DESCRIPTOR): LONG{. - stdcall, dynlib: "advapi32", importc: "RegSetKeySecurity".} -proc RegFlushKey*(key: HKEY): LONG{.stdcall, dynlib: "advapi32", - importc: "RegFlushKey".} -proc RegGetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION, - pSecurityDescriptor: PSECURITY_DESCRIPTOR, - lpcbSecurityDescriptor: LPDWORD): LONG{.stdcall, - dynlib: "advapi32", importc: "RegGetKeySecurity".} -proc RegNotifyChangeKeyValue*(key: HKEY, bWatchSubtree: WINBOOL, - dwNotifyFilter: DWORD, hEvent: HANDLE, - fAsynchronus: WINBOOL): LONG{.stdcall, - dynlib: "advapi32", importc: "RegNotifyChangeKeyValue".} -proc IsValidCodePage*(CodePage: 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*(wnd: HWND, dwType: DWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetConnectionDialog".} -proc WNetDisconnectDialog*(wnd: HWND, dwType: DWORD): DWORD{.stdcall, - dynlib: "mpr", importc: "WNetDisconnectDialog".} -proc WNetCloseEnum*(hEnum: HANDLE): DWORD{.stdcall, dynlib: "mpr", - importc: "WNetCloseEnum".} -proc CloseServiceHandle*(hSCObject: SC_HANDLE): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "CloseServiceHandle".} -proc ControlService*(hService: SC_HANDLE, dwControl: DWORD, - lpServiceStatus: LPSERVICE_STATUS): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "ControlService".} -proc DeleteService*(hService: SC_HANDLE): WINBOOL{.stdcall, dynlib: "advapi32", - importc: "DeleteService".} -proc LockServiceDatabase*(hSCManager: SC_HANDLE): SC_LOCK{.stdcall, - dynlib: "advapi32", importc: "LockServiceDatabase".} -proc NotifyBootConfigStatus*(BootAcceptable: WINBOOL): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "NotifyBootConfigStatus".} -proc QueryServiceObjectSecurity*(hService: SC_HANDLE, - dwSecurityInformation: SECURITY_INFORMATION, - lpSecurityDescriptor: PSECURITY_DESCRIPTOR, - cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceObjectSecurity".} -proc QueryServiceStatus*(hService: SC_HANDLE, lpServiceStatus: LPSERVICE_STATUS): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "QueryServiceStatus".} -proc SetServiceObjectSecurity*(hService: SC_HANDLE, - dwSecurityInformation: SECURITY_INFORMATION, - lpSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{. - stdcall, dynlib: "advapi32", importc: "SetServiceObjectSecurity".} -proc SetServiceStatus*(hServiceStatus: SERVICE_STATUS_HANDLE, - lpServiceStatus: LPSERVICE_STATUS): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "SetServiceStatus".} -proc UnlockServiceDatabase*(ScLock: SC_LOCK): WINBOOL{.stdcall, - dynlib: "advapi32", importc: "UnlockServiceDatabase".} -proc ChoosePixelFormat*(para1: HDC, para2: PPIXELFORMATDESCRIPTOR): int32{. - stdcall, dynlib: "gdi32", importc: "ChoosePixelFormat".} -proc DescribePixelFormat*(para1: HDC, para2: int32, para3: 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".} -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".} -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*(wnd: HWND, szName: LPTSTR): LRESULT -proc Animate_Play*(wnd: HWND, `from`, `to`: int32, rep: UINT): LRESULT - -proc Animate_Stop*(wnd: HWND): LRESULT -proc Animate_Close*(wnd: HWND): LRESULT -proc Animate_Seek*(wnd: HWND, frame: int32): LRESULT -proc PropSheet_AddPage*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE): LRESULT -proc PropSheet_Apply*(hPropSheetDlg: HWND): LRESULT -proc PropSheet_CancelToClose*(hPropSheetDlg: HWND): LRESULT -proc PropSheet_Changed*(hPropSheetDlg, hwndPage: HWND): LRESULT -proc PropSheet_GetCurrentPageHwnd*(hDlg: HWND): LRESULT -proc PropSheet_GetTabControl*(hPropSheetDlg: HWND): LRESULT -proc PropSheet_IsDialogMessage*(hDlg: HWND, pMsg: int32): LRESULT -proc PropSheet_PressButton*(hPropSheetDlg: HWND, iButton: int32): LRESULT -proc PropSheet_QuerySiblings*(hPropSheetDlg: HWND, param1, param2: int32): LRESULT -proc PropSheet_RebootSystem*(hPropSheetDlg: HWND): LRESULT -proc PropSheet_RemovePage*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE, - index: int32): LRESULT -proc PropSheet_RestartWindows*(hPropSheetDlg: HWND): LRESULT -proc PropSheet_SetCurSel*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE, - index: int32): LRESULT -proc PropSheet_SetCurSelByID*(hPropSheetDlg: HWND, id: int32): LRESULT -proc PropSheet_SetFinishText*(hPropSheetDlg: HWND, lpszText: LPTSTR): LRESULT -proc PropSheet_SetTitle*(hPropSheetDlg: HWND, dwStyle: DWORD, lpszText: LPCTSTR): LRESULT -proc PropSheet_SetWizButtons*(hPropSheetDlg: HWND, dwFlags: DWORD): LRESULT -proc PropSheet_UnChanged*(hPropSheetDlg: HWND, hwndPage: HWND): LRESULT -proc Header_DeleteItem*(hwndHD: HWND, index: int32): WINBOOL -proc Header_GetItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL -proc Header_GetItemCount*(hwndHD: HWND): int32 -proc Header_InsertItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): int32 -proc Header_Layout*(hwndHD: HWND, layout: var HD_LAYOUT): WINBOOL -proc Header_SetItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL -proc ListView_Arrange*(hwndLV: HWND, code: UINT): LRESULT -proc ListView_CreateDragImage*(wnd: HWND, i: int32, lpptUpLeft: LPPOINT): LRESULT -proc ListView_DeleteAllItems*(wnd: HWND): LRESULT -proc ListView_DeleteColumn*(wnd: HWND, iCol: int32): LRESULT -proc ListView_DeleteItem*(wnd: HWND, iItem: int32): LRESULT -proc ListView_EditLabel*(hwndLV: HWND, i: int32): LRESULT -proc ListView_EnsureVisible*(hwndLV: HWND, i, fPartialOK: int32): LRESULT -proc ListView_FindItem*(wnd: HWND, iStart: int32, lvfi: var LV_FINDINFO): int32 -proc ListView_GetBkColor*(wnd: HWND): LRESULT -proc ListView_GetCallbackMask*(wnd: HWND): LRESULT -proc ListView_GetColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT -proc ListView_GetColumnWidth*(wnd: HWND, iCol: int32): LRESULT -proc ListView_GetCountPerPage*(hwndLV: HWND): LRESULT -proc ListView_GetEditControl*(hwndLV: HWND): LRESULT -proc ListView_GetImageList*(wnd: HWND, iImageList: wINT): LRESULT -proc ListView_GetISearchString*(hwndLV: HWND, lpsz: LPTSTR): LRESULT -proc ListView_GetItem*(wnd: HWND, item: var LV_ITEM): LRESULT -proc ListView_GetItemCount*(wnd: HWND): LRESULT -proc ListView_GetItemPosition*(hwndLV: HWND, i: int32, pt: var POINT): int32 -proc ListView_GetItemSpacing*(hwndLV: HWND, fSmall: int32): LRESULT -proc ListView_GetItemState*(hwndLV: HWND, i, mask: int32): LRESULT -proc ListView_GetNextItem*(wnd: HWND, iStart, flags: int32): LRESULT -proc ListView_GetOrigin*(hwndLV: HWND, pt: var POINT): LRESULT -proc ListView_GetSelectedCount*(hwndLV: HWND): LRESULT -proc ListView_GetStringWidth*(hwndLV: HWND, psz: LPCTSTR): LRESULT -proc ListView_GetTextBkColor*(wnd: HWND): LRESULT -proc ListView_GetTextColor*(wnd: HWND): LRESULT -proc ListView_GetTopIndex*(hwndLV: HWND): LRESULT -proc ListView_GetViewRect*(wnd: HWND, rc: var RECT): LRESULT -proc ListView_HitTest*(hwndLV: HWND, info: var LV_HITTESTINFO): LRESULT -proc ListView_InsertColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT -proc ListView_InsertItem*(wnd: HWND, item: var LV_ITEM): LRESULT -proc ListView_RedrawItems*(hwndLV: HWND, iFirst, iLast: int32): LRESULT -proc ListView_Scroll*(hwndLV: HWND, dx, dy: int32): LRESULT -proc ListView_SetBkColor*(wnd: HWND, clrBk: COLORREF): LRESULT -proc ListView_SetCallbackMask*(wnd: HWND, mask: UINT): LRESULT -proc ListView_SetColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT -proc ListView_SetColumnWidth*(wnd: HWND, iCol, cx: int32): LRESULT -proc ListView_SetImageList*(wnd: HWND, himl: int32, iImageList: HIMAGELIST): LRESULT -proc ListView_SetItem*(wnd: HWND, item: var LV_ITEM): LRESULT -proc ListView_SetItemCount*(hwndLV: HWND, cItems: int32): LRESULT -proc ListView_SetItemPosition*(hwndLV: HWND, i, x, y: int32): LRESULT -proc ListView_SetItemPosition32*(hwndLV: HWND, i, x, y: int32): LRESULT -proc ListView_SetItemState*(hwndLV: HWND, i, data, mask: int32): LRESULT -proc ListView_SetItemText*(hwndLV: HWND, i, iSubItem: int32, pszText: LPTSTR): LRESULT -proc ListView_SetTextBkColor*(wnd: HWND, clrTextBk: COLORREF): LRESULT -proc ListView_SetTextColor*(wnd: HWND, clrText: COLORREF): LRESULT -proc ListView_SortItems*(hwndLV: HWND, pfnCompare: PFNLVCOMPARE, lPrm: LPARAM): LRESULT -proc ListView_Update*(hwndLV: HWND, i: int32): LRESULT -proc TreeView_InsertItem*(wnd: HWND, lpis: LPTV_INSERTSTRUCT): LRESULT -proc TreeView_DeleteItem*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_DeleteAllItems*(wnd: HWND): LRESULT -proc TreeView_Expand*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT -proc TreeView_GetCount*(wnd: HWND): LRESULT -proc TreeView_GetIndent*(wnd: HWND): LRESULT -proc TreeView_SetIndent*(wnd: HWND, indent: int32): LRESULT -proc TreeView_GetImageList*(wnd: HWND, iImage: WPARAM): LRESULT -proc TreeView_SetImageList*(wnd: HWND, himl: HIMAGELIST, iImage: WPARAM): LRESULT -proc TreeView_GetNextItem*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT -proc TreeView_GetChild*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_GetNextSibling*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_GetPrevSibling*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_GetParent*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_GetFirstVisible*(wnd: HWND): LRESULT -proc TreeView_GetNextVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_GetPrevVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_GetSelection*(wnd: HWND): LRESULT -proc TreeView_GetDropHilight*(wnd: HWND): LRESULT -proc TreeView_GetRoot*(wnd: HWND): LRESULT -proc TreeView_Select*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT -proc TreeView_SelectItem*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_SelectDropTarget*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_SelectSetFirstVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_GetItem*(wnd: HWND, item: var TV_ITEM): LRESULT -proc TreeView_SetItem*(wnd: HWND, item: var TV_ITEM): LRESULT -proc TreeView_EditLabel*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_GetEditControl*(wnd: HWND): LRESULT -proc TreeView_GetVisibleCount*(wnd: HWND): LRESULT -proc TreeView_HitTest*(wnd: HWND, lpht: LPTV_HITTESTINFO): LRESULT -proc TreeView_CreateDragImage*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_SortChildren*(wnd: HWND, hitem: HTREEITEM, recurse: int32): LRESULT -proc TreeView_EnsureVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT -proc TreeView_SortChildrenCB*(wnd: HWND, psort: LPTV_SORTCB, recurse: int32): LRESULT -proc TreeView_EndEditLabelNow*(wnd: HWND, fCancel: int32): LRESULT -proc TreeView_GetISearchString*(hwndTV: HWND, lpsz: LPTSTR): LRESULT -proc TabCtrl_GetImageList*(wnd: HWND): LRESULT -proc TabCtrl_SetImageList*(wnd: HWND, himl: HIMAGELIST): LRESULT -proc TabCtrl_GetItemCount*(wnd: HWND): LRESULT -proc TabCtrl_GetItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT -proc TabCtrl_SetItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT - -proc TabCtrl_InsertItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT -proc TabCtrl_DeleteItem*(wnd: HWND, i: int32): LRESULT -proc TabCtrl_DeleteAllItems*(wnd: HWND): LRESULT -proc TabCtrl_GetItemRect*(wnd: HWND, i: int32, rc: var RECT): LRESULT -proc TabCtrl_GetCurSel*(wnd: HWND): LRESULT -proc TabCtrl_SetCurSel*(wnd: HWND, i: int32): LRESULT -proc TabCtrl_HitTest*(hwndTC: HWND, info: var TC_HITTESTINFO): LRESULT -proc TabCtrl_SetItemExtra*(hwndTC: HWND, cb: int32): LRESULT -proc TabCtrl_AdjustRect*(wnd: HWND, bLarger: WINBOOL, rc: var RECT): LRESULT -proc TabCtrl_SetItemSize*(wnd: HWND, x, y: int32): LRESULT -proc TabCtrl_RemoveImage*(wnd: HWND, i: WPARAM): LRESULT -proc TabCtrl_SetPadding*(wnd: HWND, cx, cy: int32): LRESULT -proc TabCtrl_GetRowCount*(wnd: HWND): LRESULT -proc TabCtrl_GetToolTips*(wnd: HWND): LRESULT -proc TabCtrl_SetToolTips*(wnd: HWND, hwndTT: int32): LRESULT -proc TabCtrl_GetCurFocus*(wnd: HWND): LRESULT -proc TabCtrl_SetCurFocus*(wnd: HWND, i: int32): LRESULT -proc SNDMSG*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT -proc CommDlg_OpenSave_GetSpecA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT -proc CommDlg_OpenSave_GetSpecW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT -when defined(winUnicode): - proc CommDlg_OpenSave_GetSpec*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT -else: - proc CommDlg_OpenSave_GetSpec*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT -proc CommDlg_OpenSave_GetFilePathA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT -proc CommDlg_OpenSave_GetFilePathW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT -when defined(winUnicode): - proc CommDlg_OpenSave_GetFilePath*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT -else: - proc CommDlg_OpenSave_GetFilePath*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT -proc CommDlg_OpenSave_GetFolderPathA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT -proc CommDlg_OpenSave_GetFolderPathW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT -when defined(winUnicode): - proc CommDlg_OpenSave_GetFolderPath*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT -else: - proc CommDlg_OpenSave_GetFolderPath*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT -proc CommDlg_OpenSave_GetFolderIDList*(hdlg: HWND, pidl: LPVOID, cbmax: int32): LRESULT -proc CommDlg_OpenSave_SetControlText*(hdlg: HWND, id: int32, text: LPSTR): LRESULT -proc CommDlg_OpenSave_HideControl*(hdlg: HWND, id: int32): LRESULT -proc CommDlg_OpenSave_SetDefExt*(hdlg: HWND, pszext: LPSTR): LRESULT -proc GetNextWindow*(wnd: HWND, uCmd: 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* {.final, pure.} = object - Level*: int16 - Sbz*: int16 - ObjectType*: PGUID - - TObjectTypeList* = OBJECT_TYPE_LIST - AUDIT_EVENT_TYPE* = DWORD - PBlendFunction* = ptr TBlendFunction - BLENDFUNCTION* {.final, pure.} = object - BlendOp*: int8 - BlendFlags*: int8 - SourceConstantAlpha*: int8 - AlphaFormat*: int8 - - TBlendFunction* = BLENDFUNCTION - WIN_CERTIFICATE* {.final, pure.} = object - dwLength*: DWord - wRevision*: int16 - wCertificateType*: int16 - bCertificate*: array[0..0, int8] - - TWinCertificate* = WIN_CERTIFICATE - PWinCertificate* = ptr TWinCertificate - TMaxLogPalette* {.final, pure.} = object - palVersion*: int16 - palNumEntries*: int16 - palPalEntry*: array[int8, 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 - - # 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*(wnd: 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*(wnd: 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, wnd: HWND, lpCC: var TCommConfig): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".} -proc CommConfigDialogA*(lpszName: LPCSTR, wnd: HWND, lpCC: var TCommConfig): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".} -proc CommConfigDialogW*(lpszName: LPWSTR, wnd: 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(wnd: 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*(wnd: 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(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: PChar; cchItemText: UINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA'; - #function GetAltTabInfoA(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: LPCSTR; cchItemText: UINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA'; - #function GetAltTabInfoW(wnd: 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*(wnd: 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*(icon: 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(menu: 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*(wnd: HWND, menu: HMENU, uItem: UINT, lprcItem: var TRect): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetMenuItemRect".} -proc GetMessage*(lpMsg: var TMsg, wnd: HWND, wMsgFilterMin, wMsgFilterMax: UINT): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetMessageA".} -proc GetMessageA*(lpMsg: var TMsg, wnd: HWND, - wMsgFilterMin, wMsgFilterMax: UINT): WINBOOL{.stdcall, - dynlib: "user32", importc: "GetMessageA".} -proc GetMessageW*(lpMsg: var TMsg, wnd: 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*(wnd: HWND, BarFlag: int, ScrollInfo: var TScrollInfo): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetScrollInfo".} -proc GetScrollRange*(wnd: HWND, nBar: int, lpMinPos, lpMaxPos: var int): WINBOOL{. - stdcall, dynlib: "user32", importc: "GetScrollRange".} - #function GetSecurityDescriptorControl(pSecurityDescriptor: PSecurityDescriptor; var pControl: SECURITY_DESCRIPTOR_CONTROL; var lpdwRevision: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorControl'; - #function GetSecurityDescriptorDacl(pSecurityDescriptor: PSecurityDescriptor; var lpbDaclPresent: WINBOOL; var pDacl: PACL; var lpbDaclDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorDacl'; - #function GetSecurityDescriptorGroup(pSecurityDescriptor: PSecurityDescriptor; var pGroup: PSID; var lpbGroupDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorGroup'; - #function GetSecurityDescriptorOwner(pSecurityDescriptor: PSecurityDescriptor; var pOwner: PSID; var lpbOwnerDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorOwner'; - #function GetSecurityDescriptorSacl(pSecurityDescriptor: PSecurityDescriptor; var lpbSaclPresent: WINBOOL; var pSacl: PACL; var lpbSaclDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorSacl'; -proc GetStartupInfo*(lpStartupInfo: var 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(wnd: 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*(wnd: 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(wnd: 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*(wnd: 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, wnd: HWND, - wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): WINBOOL{. - stdcall, dynlib: "user32", importc: "PeekMessageA".} -proc PeekMessageA*(lpMsg: var TMsg, wnd: HWND, - wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): WINBOOL{. - stdcall, dynlib: "user32", importc: "PeekMessageA".} -proc PeekMessageW*(lpMsg: var TMsg, wnd: 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, key: HKEY, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".} -proc RegConnectRegistryA*(lpMachineName: LPCSTR, key: HKEY, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".} -proc RegConnectRegistryW*(lpMachineName: LPWSTR, key: HKEY, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".} -proc RegCreateKey*(key: HKEY, lpSubKey: cstring, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".} -proc RegCreateKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".} -proc RegCreateKeyEx*(key: HKEY, lpSubKey: cstring, Reserved: DWORD, - lpClass: cstring, dwOptions: DWORD, samDesired: REGSAM, - lpSecurityAttributes: PSecurityAttributes, - phkResult: var HKEY, lpdwDisposition: PDWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".} -proc RegCreateKeyExA*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD, - lpClass: LPCSTR, dwOptions: DWORD, samDesired: REGSAM, - lpSecurityAttributes: PSecurityAttributes, - phkResult: var HKEY, lpdwDisposition: PDWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".} -proc RegCreateKeyExW*(key: HKEY, lpSubKey: LPWSTR, Reserved: DWORD, - lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM, - lpSecurityAttributes: PSecurityAttributes, - phkResult: var HKEY, lpdwDisposition: PDWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".} -proc RegCreateKeyW*(key: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".} -proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: cstring, - lpcbName: var DWORD, lpReserved: Pointer, lpClass: cstring, - lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".} -proc RegEnumKeyExA*(key: HKEY, dwIndex: DWORD, lpName: LPCSTR, - lpcbName: var DWORD, lpReserved: Pointer, lpClass: LPCSTR, - lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".} -proc RegEnumKeyExW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, - lpcbName: var DWORD, lpReserved: Pointer, lpClass: LPWSTR, - lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{. - stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".} -proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: cstring, - lpcbValueName: var DWORD, lpReserved: Pointer, - lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegEnumValueA".} -proc RegEnumValueA*(key: HKEY, dwIndex: DWORD, lpValueName: cstring, - lpcbValueName: var DWORD, lpReserved: Pointer, - lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegEnumValueA".} -proc RegEnumValueW*(key: HKEY, dwIndex: DWORD, lpValueName: cstring, - lpcbValueName: var DWORD, lpReserved: Pointer, - lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegEnumValueW".} -proc RegGetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION, - pSecurityDescriptor: PSecurityDescriptor, - lpcbSecurityDescriptor: var DWORD): int32{.stdcall, - dynlib: "advapi32", importc: "RegGetKeySecurity".} -proc RegSetValueEx*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD, - dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegSetValueExA".} -proc RegSetValueExA*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD, - dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegSetValueExA".} -proc RegSetValueExW*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD, - dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{. - stdcall, dynlib: "advapi32", importc: "RegSetValueExW".} -proc RegisterClass*(lpWndClass: 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*(key: HKEY, lpSubKey: cstring, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".} -proc RegOpenKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".} -proc RegOpenKeyEx*(key: HKEY, lpSubKey: cstring, ulOptions: DWORD, - samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall, - dynlib: "advapi32", importc: "RegOpenKeyExA".} -proc RegOpenKeyExA*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD, - samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall, - dynlib: "advapi32", importc: "RegOpenKeyExA".} -proc RegOpenKeyExW*(key: HKEY, lpSubKey: LPWSTR, ulOptions: DWORD, - samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall, - dynlib: "advapi32", importc: "RegOpenKeyExW".} -proc RegOpenKeyW*(key: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{. - stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".} -proc RegQueryMultipleValues*(key: HKEY, ValList: pointer, NumVals: DWORD, - lpValueBuf: cstring, ldwTotsize: var DWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".} -proc RegQueryMultipleValuesA*(key: HKEY, ValList: pointer, NumVals: DWORD, - lpValueBuf: LPCSTR, ldwTotsize: var DWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".} -proc RegQueryMultipleValuesW*(key: HKEY, ValList: pointer, NumVals: DWORD, - lpValueBuf: LPWSTR, ldwTotsize: var DWORD): int32{. - stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".} -proc RegQueryValue*(key: HKEY, lpSubKey: cstring, lpValue: cstring, - lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32", - importc: "RegQueryValueA".} -proc RegQueryValueA*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPCSTR, - lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32", - importc: "RegQueryValueA".} -proc RegQueryValueW*(key: HKEY, lpSubKey: LPWSTR, lpValue: LPWSTR, - lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32", - importc: "RegQueryValueW".} -proc ResetDC*(DC: HDC, p2: 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*(wnd: 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*(wnd: HWND, XAmount: int32, YAmount: int32, rect: LPRECT, - lpClipRect: lpRECT): WINBOOL{.stdcall, dynlib: "user32", - importc: "ScrollWindow".} -proc ScrollWindowEx*(wnd: HWND, dx: int32, dy: int32, prcScroll: lpRECT, - prcClip: lpRECT, hrgnUpdate: HRGN, prcUpdate: LPRECT, - flags: 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*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM, - fuFlags, uTimeout: UINT, lpdwResult: var DWORD): LRESULT{. - stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".} -proc SendMessageTimeoutA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM, - fuFlags, uTimeout: UINT, lpdwResult: var DWORD): LRESULT{. - stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".} -proc SendMessageTimeoutW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: 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(menu: 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*(wnd: 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*(menu: HMENU, uFlags: UINT, x: int32, y: int32, - nReserved: int32, wnd: 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{. - stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".} -proc TranslateAcceleratorA*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{. - stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".} -proc TranslateAcceleratorW*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{. - stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".} -proc TranslateCharsetInfo*(lpSrc: var DWORD, lpCs: var 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(wnd: 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 "deprecated" -proc AnsiNext*(lpsz: LPCSTR): LPSTR{.stdcall, dynlib: "user32", - importc: "CharNextA".} -proc AnsiPrev*(lpszStart: LPCSTR, lpszCurrent: LPCSTR): LPSTR{.stdcall, - dynlib: "user32", importc: "CharPrevA".} -proc AnsiToOem*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall, - dynlib: "user32", importc: "CharToOemA".} -proc OemToAnsi*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall, - dynlib: "user32", importc: "OemToCharA".} -proc AnsiToOemBuff*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{. - stdcall, dynlib: "user32", importc: "CharToOemBuffA".} -proc OemToAnsiBuff*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{. - stdcall, dynlib: "user32", importc: "OemToCharBuffA".} -proc AnsiUpper*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32", - importc: "CharUpperA".} -proc AnsiUpperBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall, - dynlib: "user32", importc: "CharUpperBuffA".} -proc AnsiLower*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32", - importc: "CharLowerA".} -proc AnsiLowerBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall, - dynlib: "user32", importc: "CharLowerBuffA".} - -#== Implementation of macros - -# WinBase.h - -proc FreeModule*(h: HINST): WINBOOL = - result = FreeLibrary(h) - -proc MakeProcInstance*(p, i: pointer): pointer = - result = p - -proc FreeProcInstance*(p: pointer): pointer = - result = p - -proc GlobalDiscard*(hglbMem: HGLOBAL): HGLOBAL = - result = GlobalReAlloc(hglbMem, 0, GMEM_MOVEABLE) - -proc LocalDiscard*(hlocMem: HLOCAL): HLOCAL = - result = LocalReAlloc(hlocMem, 0, LMEM_MOVEABLE) - -# WinGDI.h - -proc GetGValue*(rgb: int32): int8 = - result = toU8(rgb shr 8'i32) -proc RGB*(r, g, b: int): COLORREF = - result = toU32(r) or (toU32(g) shl 8) or (toU32(b) shl 16) -proc RGB*(r, g, b: range[0 .. 255]): COLORREF = - result = r or g shl 8 or b shl 16 - -proc PALETTERGB*(r, g, b: range[0..255]): COLORREF = - result = 0x02000000 or RGB(r, g, b) - -proc PALETTEINDEX*(i: DWORD): COLORREF = - result = COLORREF(0x01000000'i32 or i and 0xffff'i32) - - -proc GetRValue*(rgb: COLORREF): int8 = - result = toU8(rgb) - -proc GetGValue*(rgb: COLORREF): int8 = - result = toU8(rgb shr 8) - -proc GetBValue*(rgb: COLORREF): int8 = - result = toU8(rgb shr 16) - -# - -proc HIBYTE*(w: int32): int8 = - result = toU8(w shr 8'i32 and 0x000000FF'i32) - -proc HIWORD*(L: int32): int16 = - result = toU16(L shr 16'i32 and 0x0000FFFF'i32) - -proc LOBYTE*(w: int32): int8 = - result = toU8(w) - -proc LOWORD*(L: int32): int16 = - result = toU16(L) - -proc MAKELONG*(a, b: int32): LONG = - result = a and 0x0000ffff'i32 or b shl 16'i32 - -proc MAKEWORD*(a, b: int32): int16 = - result = toU16(a and 0xff'i32) or toU16(b shl 8'i32) - -proc SEXT_HIWORD*(L: int32): int32 = - # return type might be wrong - result = HIWORD(L) - -proc ZEXT_HIWORD*(L: int32): int32 = - # return type might be wrong - result = HIWORD(L) and 0xffff'i32 - -proc SEXT_LOWORD*(L: int32): int32 = - result = LOWORD(L) - -proc INDEXTOOVERLAYMASK*(i: int32): int32 = - # return type might be wrong - result = i shl 8'i32 - -proc INDEXTOSTATEIMAGEMASK*(i: int32): int32 = - # return type might be wrong - result = i shl 12'i32 - -proc MAKEINTATOM*(i: int32): LPTSTR = - result = cast[LPTSTR](cast[ULONG_PTR](ToU16(i))) - -proc MAKELANGID*(p, s: int32): int32 = - # return type might be wrong - result = toU16(s) shl 10'i16 or toU16(p) - -proc PRIMARYLANGID*(lgid: int32): int16 = - result = toU16(lgid) and 0x000003FF'i16 - -proc SUBLANGID*(lgid: int32): int32 = - # return type might be wrong - result = toU16(lgid) shr 10'i16 - -proc LANGIDFROMLCID*(lcid: int32): int16 = - result = toU16(lcid) - -proc SORTIDFROMLCID*(lcid: int32): int16 = - result = toU16((lcid and 0x000FFFFF'i32) shr 16'i32) - -proc MAKELCID*(lgid, srtid: int32): DWORD = - result = toU32(srtid shl 16'i32 or lgid and 0xffff'i32) - -proc MAKELPARAM*(L, h: int32): LPARAM = - result = LPARAM(MAKELONG(L, h)) - -proc MAKELRESULT*(L, h: int32): LRESULT = - result = LRESULT(MAKELONG(L, h)) - -proc MAKEROP4*(fore, back: int32): DWORD = - result = back shl 8'i32 and 0xFF000000'i32 or fore - -proc MAKEWPARAM*(L, h: int32): WPARAM = - result = WPARAM(MAKELONG(L, h)) - -proc GET_X_LPARAM*(lp: Windows.LParam): int32 = - result = LOWORD(lp.int32) - -proc GET_Y_LPARAM*(lp: Windows.LParam): int32 = - result = HIWORD(lp.int32) - -proc UNICODE_NULL*(): WCHAR = - result = 0'u16 - - - -proc GetFirstChild*(h: HWND): HWND = - result = GetTopWindow(h) - -proc GetNextSibling*(h: HWND): HWND = - result = GetWindow(h, GW_HWNDNEXT) - -proc GetWindowID*(h: HWND): int32 = - result = GetDlgCtrlID(h) - -proc SubclassWindow*(h: HWND, p: LONG): LONG = - result = SetWindowLong(h, GWL_WNDPROC, p) - -proc GET_WM_COMMAND_CMD*(w, L: int32): int32 = - # return type might be wrong - result = HIWORD(w) - -proc GET_WM_COMMAND_ID(w, L: int32): int32 = - # return type might be wrong - result = LOWORD(w) - -proc GET_WM_CTLCOLOR_HDC(w, L, msg: int32): HDC = - result = HDC(w) - -proc GET_WM_CTLCOLOR_HWND(w, L, msg: int32): HWND = - result = HWND(L) - -proc GET_WM_HSCROLL_CODE(w, L: int32): int32 = - # return type might be wrong - result = LOWORD(w) - -proc GET_WM_HSCROLL_HWND(w, L: int32): HWND = - result = HWND(L) - -proc GET_WM_HSCROLL_POS(w, L: int32): int32 = - # return type might be wrong - result = HIWORD(w) - -proc GET_WM_MDIACTIVATE_FACTIVATE(h, a, b: int32): int32 = - # return type might be wrong - result = ord(b == h) - -proc GET_WM_MDIACTIVATE_HWNDACTIVATE(a, b: int32): HWND = - result = HWND(b) - -proc GET_WM_MDIACTIVATE_HWNDDEACT(a, b: int32): HWND = - result = HWND(a) - -proc GET_WM_VSCROLL_CODE(w, L: int32): int32 = - # return type might be wrong - result = LOWORD(w) - -proc GET_WM_VSCROLL_HWND(w, L: int32): HWND = - result = HWND(L) - -proc GET_WM_VSCROLL_POS(w, L: int32): int32 = - # return type might be wrong - result = HIWORD(w) - -proc fBinary(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fBinary) shr bp_DCB_fBinary - -proc set_fBinary(a: var DCB, fBinary: DWORD) = - a.flags = a.flags or ((fBinary shl bp_DCB_fBinary) and bm_DCB_fBinary) - -proc fParity(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fParity) shr bp_DCB_fParity - -proc set_fParity(a: var DCB, fParity: DWORD) = - a.flags = a.flags or ((fParity shl bp_DCB_fParity) and bm_DCB_fParity) - -proc fOutxCtsFlow(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fOutxCtsFlow) shr bp_DCB_fOutxCtsFlow - -proc set_fOutxCtsFlow(a: var DCB, fOutxCtsFlow: DWORD) = - a.flags = a.flags or - ((fOutxCtsFlow shl bp_DCB_fOutxCtsFlow) and bm_DCB_fOutxCtsFlow) - -proc fOutxDsrFlow(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fOutxDsrFlow) shr bp_DCB_fOutxDsrFlow - -proc set_fOutxDsrFlow(a: var DCB, fOutxDsrFlow: DWORD) = - a.flags = a.flags or - ((fOutxDsrFlow shl bp_DCB_fOutxDsrFlow) and bm_DCB_fOutxDsrFlow) - -proc fDtrControl(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fDtrControl) shr bp_DCB_fDtrControl - -proc set_fDtrControl(a: var DCB, fDtrControl: DWORD) = - a.flags = a.flags or - ((fDtrControl shl bp_DCB_fDtrControl) and bm_DCB_fDtrControl) - -proc fDsrSensitivity(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fDsrSensitivity) shr bp_DCB_fDsrSensitivity - -proc set_fDsrSensitivity(a: var DCB, fDsrSensitivity: DWORD) = - a.flags = a.flags or - ((fDsrSensitivity shl bp_DCB_fDsrSensitivity) and - bm_DCB_fDsrSensitivity) - -proc fTXContinueOnXoff(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fTXContinueOnXoff) shr - bp_DCB_fTXContinueOnXoff - -proc set_fTXContinueOnXoff(a: var DCB, fTXContinueOnXoff: DWORD) = - a.flags = a.flags or - ((fTXContinueOnXoff shl bp_DCB_fTXContinueOnXoff) and - bm_DCB_fTXContinueOnXoff) - -proc fOutX(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fOutX) shr bp_DCB_fOutX - -proc set_fOutX(a: var DCB, fOutX: DWORD) = - a.flags = a.flags or ((fOutX shl bp_DCB_fOutX) and bm_DCB_fOutX) - -proc fInX(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fInX) shr bp_DCB_fInX - -proc set_fInX(a: var DCB, fInX: DWORD) = - a.flags = a.flags or ((fInX shl bp_DCB_fInX) and bm_DCB_fInX) - -proc fErrorChar(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fErrorChar) shr bp_DCB_fErrorChar - -proc set_fErrorChar(a: var DCB, fErrorChar: DWORD) = - a.flags = a.flags or - ((fErrorChar shl bp_DCB_fErrorChar) and bm_DCB_fErrorChar) - -proc fNull(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fNull) shr bp_DCB_fNull - -proc set_fNull(a: var DCB, fNull: DWORD) = - a.flags = a.flags or ((fNull shl bp_DCB_fNull) and bm_DCB_fNull) - -proc fRtsControl(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fRtsControl) shr bp_DCB_fRtsControl - -proc set_fRtsControl(a: var DCB, fRtsControl: DWORD) = - a.flags = a.flags or - ((fRtsControl shl bp_DCB_fRtsControl) and bm_DCB_fRtsControl) - -proc fAbortOnError(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fAbortOnError) shr bp_DCB_fAbortOnError - -proc set_fAbortOnError(a: var DCB, fAbortOnError: DWORD) = - a.flags = a.flags or - ((fAbortOnError shl bp_DCB_fAbortOnError) and bm_DCB_fAbortOnError) - -proc fDummy2(a: var DCB): DWORD = - result = (a.flags and bm_DCB_fDummy2) shr bp_DCB_fDummy2 - -proc set_fDummy2(a: var DCB, fDummy2: DWORD) = - a.flags = a.flags or ((fDummy2 shl bp_DCB_fDummy2) and bm_DCB_fDummy2) - -proc fCtsHold(a: var COMSTAT): DWORD = - result = (a.flag0 and bm_COMSTAT_fCtsHold) shr bp_COMSTAT_fCtsHold - -proc set_fCtsHold(a: var COMSTAT, fCtsHold: DWORD) = - a.flag0 = a.flag0 or - ((fCtsHold shl bp_COMSTAT_fCtsHold) and bm_COMSTAT_fCtsHold) - -proc fDsrHold(a: var COMSTAT): DWORD = - result = (a.flag0 and bm_COMSTAT_fDsrHold) shr bp_COMSTAT_fDsrHold - -proc set_fDsrHold(a: var COMSTAT, fDsrHold: DWORD) = - a.flag0 = a.flag0 or - ((fDsrHold shl bp_COMSTAT_fDsrHold) and bm_COMSTAT_fDsrHold) - -proc fRlsdHold(a: var COMSTAT): DWORD = - result = (a.flag0 and bm_COMSTAT_fRlsdHold) shr bp_COMSTAT_fRlsdHold - -proc set_fRlsdHold(a: var COMSTAT, fRlsdHold: DWORD) = - a.flag0 = a.flag0 or - ((fRlsdHold shl bp_COMSTAT_fRlsdHold) and bm_COMSTAT_fRlsdHold) - -proc fXoffHold(a: var COMSTAT): DWORD = - result = (a.flag0 and bm_COMSTAT_fXoffHold) shr bp_COMSTAT_fXoffHold - -proc set_fXoffHold(a: var COMSTAT, fXoffHold: DWORD) = - a.flag0 = a.flag0 or - ((fXoffHold shl bp_COMSTAT_fXoffHold) and bm_COMSTAT_fXoffHold) - -proc fXoffSent(a: var COMSTAT): DWORD = - result = (a.flag0 and bm_COMSTAT_fXoffSent) shr bp_COMSTAT_fXoffSent - -proc set_fXoffSent(a: var COMSTAT, fXoffSent: DWORD) = - a.flag0 = a.flag0 or - ((fXoffSent shl bp_COMSTAT_fXoffSent) and bm_COMSTAT_fXoffSent) - -proc fEof(a: var COMSTAT): DWORD = - result = (a.flag0 and bm_COMSTAT_fEof) shr bp_COMSTAT_fEof - -proc set_fEof(a: var COMSTAT, fEof: DWORD) = - a.flag0 = a.flag0 or ((fEof shl bp_COMSTAT_fEof) and bm_COMSTAT_fEof) - -proc fTxim(a: var COMSTAT): DWORD = - result = (a.flag0 and bm_COMSTAT_fTxim) shr bp_COMSTAT_fTxim - -proc set_fTxim(a: var COMSTAT, fTxim: DWORD) = - a.flag0 = a.flag0 or ((fTxim shl bp_COMSTAT_fTxim) and bm_COMSTAT_fTxim) - -proc fReserved(a: var COMSTAT): DWORD = - result = (a.flag0 and bm_COMSTAT_fReserved) shr bp_COMSTAT_fReserved - -proc set_fReserved(a: var COMSTAT, fReserved: DWORD) = - a.flag0 = a.flag0 or - ((fReserved shl bp_COMSTAT_fReserved) and bm_COMSTAT_fReserved) - -proc bAppReturnCode(a: var DDEACK): int16 = - result = (a.flag0 and bm_DDEACK_bAppReturnCode) shr - bp_DDEACK_bAppReturnCode - -proc set_bAppReturnCode(a: var DDEACK, bAppReturnCode: int16) = - a.flag0 = a.flag0 or - ((bAppReturnCode shl bp_DDEACK_bAppReturnCode) and - bm_DDEACK_bAppReturnCode) - -proc reserved(a: var DDEACK): int16 = - result = (a.flag0 and bm_DDEACK_reserved) shr bp_DDEACK_reserved - -proc set_reserved(a: var DDEACK, reserved: int16) = - a.flag0 = a.flag0 or - ((reserved shl bp_DDEACK_reserved) and bm_DDEACK_reserved) - -proc fBusy(a: var DDEACK): int16 = - result = (a.flag0 and bm_DDEACK_fBusy) shr bp_DDEACK_fBusy - -proc set_fBusy(a: var DDEACK, fBusy: int16) = - a.flag0 = a.flag0 or ((fBusy shl bp_DDEACK_fBusy) and bm_DDEACK_fBusy) - -proc fAck(a: var DDEACK): int16 = - result = (a.flag0 and bm_DDEACK_fAck) shr bp_DDEACK_fAck - -proc set_fAck(a: var DDEACK, fAck: int16) = - a.flag0 = a.flag0 or ((fAck shl bp_DDEACK_fAck) and bm_DDEACK_fAck) - -proc reserved(a: var DDEADVISE): int16 = - result = (a.flag0 and bm_DDEADVISE_reserved) shr bp_DDEADVISE_reserved - -proc set_reserved(a: var DDEADVISE, reserved: int16) = - a.flag0 = a.flag0 or - ((reserved shl bp_DDEADVISE_reserved) and bm_DDEADVISE_reserved) - -proc fDeferUpd(a: var DDEADVISE): int16 = - result = (a.flag0 and bm_DDEADVISE_fDeferUpd) shr bp_DDEADVISE_fDeferUpd - -proc set_fDeferUpd(a: var DDEADVISE, fDeferUpd: int16) = - a.flag0 = a.flag0 or - ((fDeferUpd shl bp_DDEADVISE_fDeferUpd) and bm_DDEADVISE_fDeferUpd) - -proc fAckReq(a: var DDEADVISE): int16 = - result = (a.flag0 and bm_DDEADVISE_fAckReq) shr bp_DDEADVISE_fAckReq - -proc set_fAckReq(a: var DDEADVISE, fAckReq: int16) = - a.flag0 = a.flag0 or - ((fAckReq shl bp_DDEADVISE_fAckReq) and bm_DDEADVISE_fAckReq) - -proc unused(a: var DDEDATA): int16 = - result = (a.flag0 and bm_DDEDATA_unused) shr bp_DDEDATA_unused - -proc set_unused(a: var DDEDATA, unused: int16) = - a.flag0 = a.flag0 or ((unused shl bp_DDEDATA_unused) and bm_DDEDATA_unused) - -proc fResponse(a: var DDEDATA): int16 = - result = (a.flag0 and bm_DDEDATA_fResponse) shr bp_DDEDATA_fResponse - -proc set_fResponse(a: var DDEDATA, fResponse: int16) = - a.flag0 = a.flag0 or - ((fResponse shl bp_DDEDATA_fResponse) and bm_DDEDATA_fResponse) - -proc fRelease(a: var DDEDATA): int16 = - result = (a.flag0 and bm_DDEDATA_fRelease) shr bp_DDEDATA_fRelease - -proc set_fRelease(a: var DDEDATA, fRelease: int16) = - a.flag0 = a.flag0 or - ((fRelease shl bp_DDEDATA_fRelease) and bm_DDEDATA_fRelease) - -proc reserved(a: var DDEDATA): int16 = - result = (a.flag0 and bm_DDEDATA_reserved) shr bp_DDEDATA_reserved - -proc set_reserved(a: var DDEDATA, reserved: int16) = - a.flag0 = a.flag0 or - ((reserved shl bp_DDEDATA_reserved) and bm_DDEDATA_reserved) - -proc fAckReq(a: var DDEDATA): int16 = - result = (a.flag0 and bm_DDEDATA_fAckReq) shr bp_DDEDATA_fAckReq - -proc set_fAckReq(a: var DDEDATA, fAckReq: int16) = - a.flag0 = a.flag0 or - ((fAckReq shl bp_DDEDATA_fAckReq) and bm_DDEDATA_fAckReq) - -proc unused(a: var DDELN): int16 = - result = (a.flag0 and bm_DDELN_unused) shr bp_DDELN_unused - -proc set_unused(a: var DDELN, unused: int16) = - a.flag0 = a.flag0 or ((unused shl bp_DDELN_unused) and bm_DDELN_unused) - -proc fRelease(a: var DDELN): int16 = - result = (a.flag0 and bm_DDELN_fRelease) shr bp_DDELN_fRelease - -proc set_fRelease(a: var DDELN, fRelease: int16) = - a.flag0 = a.flag0 or - ((fRelease shl bp_DDELN_fRelease) and bm_DDELN_fRelease) - -proc fDeferUpd(a: var DDELN): int16 = - result = (a.flag0 and bm_DDELN_fDeferUpd) shr bp_DDELN_fDeferUpd - -proc set_fDeferUpd(a: var DDELN, fDeferUpd: int16) = - a.flag0 = a.flag0 or - ((fDeferUpd shl bp_DDELN_fDeferUpd) and bm_DDELN_fDeferUpd) - -proc fAckReq(a: var DDELN): int16 = - result = (a.flag0 and bm_DDELN_fAckReq) shr bp_DDELN_fAckReq - -proc set_fAckReq(a: var DDELN, fAckReq: int16) = - a.flag0 = a.flag0 or ((fAckReq shl bp_DDELN_fAckReq) and bm_DDELN_fAckReq) - -proc unused(a: var DDEPOKE): int16 = - result = (a.flag0 and bm_DDEPOKE_unused) shr bp_DDEPOKE_unused - -proc set_unused(a: var DDEPOKE, unused: int16) = - a.flag0 = a.flag0 or ((unused shl bp_DDEPOKE_unused) and bm_DDEPOKE_unused) - -proc fRelease(a: var DDEPOKE): int16 = - result = (a.flag0 and bm_DDEPOKE_fRelease) shr bp_DDEPOKE_fRelease - -proc set_fRelease(a: var DDEPOKE, fRelease: int16) = - a.flag0 = a.flag0 or - ((fRelease shl bp_DDEPOKE_fRelease) and bm_DDEPOKE_fRelease) - -proc fReserved(a: var DDEPOKE): int16 = - result = (a.flag0 and bm_DDEPOKE_fReserved) shr bp_DDEPOKE_fReserved - -proc set_fReserved(a: var DDEPOKE, fReserved: int16) = - a.flag0 = a.flag0 or - ((fReserved shl bp_DDEPOKE_fReserved) and bm_DDEPOKE_fReserved) - -proc unused(a: var DDEUP): int16 = - result = (a.flag0 and bm_DDEUP_unused) shr bp_DDEUP_unused - -proc set_unused(a: var DDEUP, unused: int16) = - a.flag0 = a.flag0 or ((unused shl bp_DDEUP_unused) and bm_DDEUP_unused) - -proc fAck(a: var DDEUP): int16 = - result = (a.flag0 and bm_DDEUP_fAck) shr bp_DDEUP_fAck - -proc set_fAck(a: var DDEUP, fAck: int16) = - a.flag0 = a.flag0 or ((fAck shl bp_DDEUP_fAck) and bm_DDEUP_fAck) - -proc fRelease(a: var DDEUP): int16 = - result = (a.flag0 and bm_DDEUP_fRelease) shr bp_DDEUP_fRelease - -proc set_fRelease(a: var DDEUP, fRelease: int16) = - a.flag0 = a.flag0 or - ((fRelease shl bp_DDEUP_fRelease) and bm_DDEUP_fRelease) - -proc fReserved(a: var DDEUP): int16 = - result = (a.flag0 and bm_DDEUP_fReserved) shr bp_DDEUP_fReserved - -proc set_fReserved(a: var DDEUP, fReserved: int16) = - a.flag0 = a.flag0 or - ((fReserved shl bp_DDEUP_fReserved) and bm_DDEUP_fReserved) - -proc fAckReq(a: var DDEUP): int16 = - result = (a.flag0 and bm_DDEUP_fAckReq) shr bp_DDEUP_fAckReq - -proc set_fAckReq(a: var DDEUP, fAckReq: int16) = - a.flag0 = a.flag0 or ((fAckReq shl bp_DDEUP_fAckReq) and bm_DDEUP_fAckReq) - -proc CreateWindowA(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD, - X: int32, Y: int32, nWidth: int32, nHeight: int32, - hWndParent: HWND, menu: HMENU, hInstance: HINST, - lpParam: LPVOID): HWND = - result = CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, - nHeight, hWndParent, menu, hInstance, lpParam) - -proc CreateDialogA(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): HWND = - result = CreateDialogParamA(hInstance, lpTemplateName, hWndParent, - lpDialogFunc, 0) - -proc CreateDialogIndirectA(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): HWND = - result = CreateDialogIndirectParamA(hInstance, lpTemplate, hWndParent, - lpDialogFunc, 0) - -proc DialogBoxA(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): int32 = - result = DialogBoxParamA(hInstance, lpTemplateName, hWndParent, lpDialogFunc, - 0) - -proc DialogBoxIndirectA(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): int32 = - result = DialogBoxIndirectParamA(hInstance, hDialogTemplate, hWndParent, - lpDialogFunc, 0) - -proc CreateWindowW(lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD, - X: int32, Y: int32, nWidth: int32, nHeight: int32, - hWndParent: HWND, menu: HMENU, hInstance: HINST, - lpParam: LPVOID): HWND = - result = CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, - nHeight, hWndParent, menu, hInstance, lpParam) - -proc CreateDialogW(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): HWND = - result = CreateDialogParamW(hInstance, lpName, hWndParent, lpDialogFunc, 0) - -proc CreateDialogIndirectW(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): HWND = - result = CreateDialogIndirectParamW(hInstance, lpTemplate, hWndParent, - lpDialogFunc, 0) - -proc DialogBoxW(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): int32 = - result = DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0) - -proc DialogBoxIndirectW(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): int32 = - result = DialogBoxIndirectParamW(hInstance, lpTemplate, hWndParent, - lpDialogFunc, 0) - -when defined(winUnicode): - proc CreateWindow(lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD, - X: int32, Y: int32, nWidth: int32, nHeight: int32, - hWndParent: HWND, menu: HMENU, hInstance: HINST, - lpParam: LPVOID): HWND = - result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, - nHeight, hWndParent, hMenu, hInstance, lpParam) - - proc CreateDialog(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): HWND = - result = CreateDialogParam(hInstance, lpName, hWndParent, lpDialogFunc, 0) - - proc CreateDialogIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): HWND = - result = CreateDialogIndirectParam(hInstance, lpTemplate, hWndParent, - lpDialogFunc, 0) - - proc DialogBox(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): int32 = - result = DialogBoxParam(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0) - - proc DialogBoxIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): int32 = - result = DialogBoxIndirectParam(hInstance, lpTemplate, hWndParent, - lpDialogFunc, 0) - -else: - proc CreateWindow(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD, - X: int32, Y: int32, nWidth: int32, nHeight: int32, - hWndParent: HWND, menu: HMENU, hInstance: HINST, - lpParam: LPVOID): HWND = - result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, - nHeight, hWndParent, menu, hInstance, lpParam) - - proc CreateDialog(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): HWND = - result = CreateDialogParam(hInstance, lpTemplateName, hWndParent, - lpDialogFunc, 0) - - proc CreateDialogIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): HWND = - result = CreateDialogIndirectParam(hInstance, lpTemplate, hWndParent, - lpDialogFunc, 0) - - proc DialogBox(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, - lpDialogFunc: DLGPROC): int32 = - result = DialogBoxParam(hInstance, lpTemplateName, hWndParent, lpDialogFunc, - 0) - - proc DialogBoxIndirect(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, - hWndParent: HWND, lpDialogFunc: DLGPROC): int32 = - result = DialogBoxIndirectParam(hInstance, hDialogTemplate, hWndParent, - lpDialogFunc, 0) - -proc GlobalAllocPtr(flags, cb: DWord): Pointer = - result = GlobalLock(GlobalAlloc(flags, cb)) - -proc GlobalFreePtr(lp: Pointer): Pointer = - result = cast[Pointer](GlobalFree(cast[HWND](GlobalUnlockPtr(lp)))) - -proc GlobalUnlockPtr(lp: pointer): Pointer = - discard GlobalUnlock(GlobalHandle(lp)) - result = lp - -proc GlobalLockPtr(lp: pointer): Pointer = - result = GlobalLock(GlobalHandle(lp)) - -proc GlobalReAllocPtr(lp: Pointer, cbNew, flags: DWord): Pointer = - result = GlobalLock(GlobalReAlloc(cast[HWND](GlobalUnlockPtr(lp)), cbNew, flags)) - -proc GlobalPtrHandle(lp: pointer): Pointer = - result = cast[Pointer](GlobalHandle(lp)) - -proc ImageList_AddIcon(himl: HIMAGELIST, hicon: HICON): int32 = - result = ImageList_ReplaceIcon(himl, -1, hicon) - -proc Animate_Create(hWndP: HWND, id: HMENU, dwStyle: DWORD, hInstance: HINST): HWND = - result = CreateWindow(cast[LPCSTR](ANIMATE_CLASS), nil, dwStyle, 0, 0, 0, 0, hwndP, - id, hInstance, nil) - -proc Animate_Open(wnd: HWND, szName: LPTSTR): LRESULT = - result = SendMessage(wnd, ACM_OPEN, 0, cast[LPARAM](szName)) - -proc Animate_Play(wnd: HWND, `from`, `to`: int32, rep: UINT): LRESULT = - result = SendMessage(wnd, ACM_PLAY, WPARAM(rep), - LPARAM(MAKELONG(`from`, `to`))) - -proc Animate_Stop(wnd: HWND): LRESULT = - result = SendMessage(wnd, ACM_STOP, 0, 0) - -proc Animate_Close(wnd: HWND): LRESULT = - result = Animate_Open(wnd, nil) - -proc Animate_Seek(wnd: HWND, frame: int32): LRESULT = - result = Animate_Play(wnd, frame, frame, 1) - -proc PropSheet_AddPage(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_ADDPAGE, 0, cast[LPARAM](hpage)) - -proc PropSheet_Apply(hPropSheetDlg: HWND): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_APPLY, 0, 0) - -proc PropSheet_CancelToClose(hPropSheetDlg: HWND): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_CANCELTOCLOSE, 0, 0) - -proc PropSheet_Changed(hPropSheetDlg, hwndPage: HWND): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_CHANGED, WPARAM(hwndPage), 0) - -proc PropSheet_GetCurrentPageHwnd(hDlg: HWND): LRESULT = - result = SendMessage(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0) - -proc PropSheet_GetTabControl(hPropSheetDlg: HWND): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_GETTABCONTROL, 0, 0) - -proc PropSheet_IsDialogMessage(hDlg: HWND, pMsg: int32): LRESULT = - result = SendMessage(hDlg, PSM_ISDIALOGMESSAGE, 0, LPARAM(pMsg)) - -proc PropSheet_PressButton(hPropSheetDlg: HWND, iButton: int32): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_PRESSBUTTON, WPARAM(int32(iButton)), 0) - -proc PropSheet_QuerySiblings(hPropSheetDlg: HWND, param1, param2: int32): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_QUERYSIBLINGS, WPARAM(param1), - LPARAM(param2)) - -proc PropSheet_RebootSystem(hPropSheetDlg: HWND): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_REBOOTSYSTEM, 0, 0) - -proc PropSheet_RemovePage(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE, - index: int32): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_REMOVEPAGE, WPARAM(index), - cast[LPARAM](hpage)) - -proc PropSheet_RestartWindows(hPropSheetDlg: HWND): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_RESTARTWINDOWS, 0, 0) - -proc PropSheet_SetCurSel(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE, - index: int32): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_SETCURSEL, WPARAM(index), - cast[LPARAM](hpage)) - -proc PropSheet_SetCurSelByID(hPropSheetDlg: HWND, id: int32): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_SETCURSELID, 0, LPARAM(id)) - -proc PropSheet_SetFinishText(hPropSheetDlg: HWND, lpszText: LPTSTR): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_SETFINISHTEXT, 0, cast[LPARAM](lpszText)) - -proc PropSheet_SetTitle(hPropSheetDlg: HWND, dwStyle: DWORD, lpszText: LPCTSTR): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_SETTITLE, WPARAM(dwStyle), - cast[LPARAM](lpszText)) - -proc PropSheet_SetWizButtons(hPropSheetDlg: HWND, dwFlags: DWORD): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_SETWIZBUTTONS, 0, LPARAM(dwFlags)) - -proc PropSheet_UnChanged(hPropSheetDlg: HWND, hwndPage: HWND): LRESULT = - result = SendMessage(hPropSheetDlg, PSM_UNCHANGED, WPARAM(hwndPage), 0) - -proc Header_DeleteItem(hwndHD: HWND, index: int32): WINBOOL = - result = WINBOOL(SendMessage(hwndHD, HDM_DELETEITEM, WPARAM(index), 0)) - -proc Header_GetItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL = - result = WINBOOL(SendMessage(hwndHD, HDM_GETITEM, WPARAM(index), - cast[LPARAM](addr(hdi)))) - -proc Header_GetItemCount(hwndHD: HWND): int32 = - result = int32(SendMessage(hwndHD, HDM_GETITEMCOUNT, 0, 0)) - -proc Header_InsertItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): int32 = - result = int32(SendMessage(hwndHD, HDM_INSERTITEM, WPARAM(index), - cast[LPARAM](addr(hdi)))) - -proc Header_Layout(hwndHD: HWND, layout: var HD_LAYOUT): WINBOOL = - result = WINBOOL(SendMessage(hwndHD, HDM_LAYOUT, 0, - cast[LPARAM](addr(layout)))) - -proc Header_SetItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL = - result = WINBOOL(SendMessage(hwndHD, HDM_SETITEM, WPARAM(index), - cast[LPARAM](addr(hdi)))) - -proc ListView_Arrange(hwndLV: HWND, code: UINT): LRESULT = - result = SendMessage(hwndLV, LVM_ARRANGE, WPARAM(code), 0) - -proc ListView_CreateDragImage(wnd: HWND, i: int32, lpptUpLeft: LPPOINT): LRESULT = - result = SendMessage(wnd, LVM_CREATEDRAGIMAGE, WPARAM(i), cast[LPARAM](lpptUpLeft)) - -proc ListView_DeleteAllItems(wnd: HWND): LRESULT = - result = SendMessage(wnd, LVM_DELETEALLITEMS, 0, 0) - -proc ListView_DeleteColumn(wnd: HWND, iCol: int32): LRESULT = - result = SendMessage(wnd, LVM_DELETECOLUMN, WPARAM(iCol), 0) - -proc ListView_DeleteItem(wnd: HWND, iItem: int32): LRESULT = - result = SendMessage(wnd, LVM_DELETEITEM, WPARAM(iItem), 0) - -proc ListView_EditLabel(hwndLV: HWND, i: int32): LRESULT = - result = SendMessage(hwndLV, LVM_EDITLABEL, WPARAM(int32(i)), 0) - -proc ListView_EnsureVisible(hwndLV: HWND, i, fPartialOK: int32): LRESULT = - result = SendMessage(hwndLV, LVM_ENSUREVISIBLE, WPARAM(i), - MAKELPARAM(fPartialOK, 0)) - -proc ListView_FindItem(wnd: HWND, iStart: int32, lvfi: var LV_FINDINFO): int32 = - result = SendMessage(wnd, LVM_FINDITEM, WPARAM(iStart), - cast[LPARAM](addr(lvfi))).int32 - -proc ListView_GetBkColor(wnd: HWND): LRESULT = - result = SendMessage(wnd, LVM_GETBKCOLOR, 0, 0) - -proc ListView_GetCallbackMask(wnd: HWND): LRESULT = - result = SendMessage(wnd, LVM_GETCALLBACKMASK, 0, 0) - -proc ListView_GetColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT = - result = SendMessage(wnd, LVM_GETCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col))) - -proc ListView_GetColumnWidth(wnd: HWND, iCol: int32): LRESULT = - result = SendMessage(wnd, LVM_GETCOLUMNWIDTH, WPARAM(iCol), 0) - -proc ListView_GetCountPerPage(hwndLV: HWND): LRESULT = - result = SendMessage(hwndLV, LVM_GETCOUNTPERPAGE, 0, 0) - -proc ListView_GetEditControl(hwndLV: HWND): LRESULT = - result = SendMessage(hwndLV, LVM_GETEDITCONTROL, 0, 0) - -proc ListView_GetImageList(wnd: HWND, iImageList: wINT): LRESULT = - result = SendMessage(wnd, LVM_GETIMAGELIST, WPARAM(iImageList), 0) - -proc ListView_GetISearchString(hwndLV: HWND, lpsz: LPTSTR): LRESULT = - result = SendMessage(hwndLV, LVM_GETISEARCHSTRING, 0, cast[LPARAM](lpsz)) - -proc ListView_GetItem(wnd: HWND, item: var LV_ITEM): LRESULT = - result = SendMessage(wnd, LVM_GETITEM, 0, cast[LPARAM](addr(item))) - -proc ListView_GetItemCount(wnd: HWND): LRESULT = - result = SendMessage(wnd, LVM_GETITEMCOUNT, 0, 0) - -proc ListView_GetItemPosition(hwndLV: HWND, i: int32, pt: var POINT): int32 = - result = SendMessage(hwndLV, LVM_GETITEMPOSITION, WPARAM(int32(i)), - cast[LPARAM](addr(pt))).int32 - -proc ListView_GetItemSpacing(hwndLV: HWND, fSmall: int32): LRESULT = - result = SendMessage(hwndLV, LVM_GETITEMSPACING, fSmall, 0) - -proc ListView_GetItemState(hwndLV: HWND, i, mask: int32): LRESULT = - result = SendMessage(hwndLV, LVM_GETITEMSTATE, WPARAM(i), LPARAM(mask)) - -proc ListView_GetNextItem(wnd: HWND, iStart, flags: int32): LRESULT = - result = SendMessage(wnd, LVM_GETNEXTITEM, WPARAM(iStart), LPARAM(flags)) - -proc ListView_GetOrigin(hwndLV: HWND, pt: var POINT): LRESULT = - result = SendMessage(hwndLV, LVM_GETORIGIN, WPARAM(0), cast[LPARAM](addr(pt))) - -proc ListView_GetSelectedCount(hwndLV: HWND): LRESULT = - result = SendMessage(hwndLV, LVM_GETSELECTEDCOUNT, 0, 0) - -proc ListView_GetStringWidth(hwndLV: HWND, psz: LPCTSTR): LRESULT = - result = SendMessage(hwndLV, LVM_GETSTRINGWIDTH, 0, cast[LPARAM](psz)) - -proc ListView_GetTextBkColor(wnd: HWND): LRESULT = - result = SendMessage(wnd, LVM_GETTEXTBKCOLOR, 0, 0) - -proc ListView_GetTextColor(wnd: HWND): LRESULT = - result = SendMessage(wnd, LVM_GETTEXTCOLOR, 0, 0) - -proc ListView_GetTopIndex(hwndLV: HWND): LRESULT = - result = SendMessage(hwndLV, LVM_GETTOPINDEX, 0, 0) - -proc ListView_GetViewRect(wnd: HWND, rc: var RECT): LRESULT = - result = SendMessage(wnd, LVM_GETVIEWRECT, 0, cast[LPARAM](addr(rc))) - -proc ListView_HitTest(hwndLV: HWND, info: var LV_HITTESTINFO): LRESULT = - result = SendMessage(hwndLV, LVM_HITTEST, 0, cast[LPARAM](addr(info))) - -proc ListView_InsertColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT = - result = SendMessage(wnd, LVM_INSERTCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col))) - -proc ListView_InsertItem(wnd: HWND, item: var LV_ITEM): LRESULT = - result = SendMessage(wnd, LVM_INSERTITEM, 0, cast[LPARAM](addr(item))) - -proc ListView_RedrawItems(hwndLV: HWND, iFirst, iLast: int32): LRESULT = - result = SendMessage(hwndLV, LVM_REDRAWITEMS, WPARAM(iFirst), LPARAM(iLast)) - -proc ListView_Scroll(hwndLV: HWND, dx, dy: int32): LRESULT = - result = SendMessage(hwndLV, LVM_SCROLL, WPARAM(dx), LPARAM(dy)) - -proc ListView_SetBkColor(wnd: HWND, clrBk: COLORREF): LRESULT = - result = SendMessage(wnd, LVM_SETBKCOLOR, 0, LPARAM(clrBk)) - -proc ListView_SetCallbackMask(wnd: HWND, mask: UINT): LRESULT = - result = SendMessage(wnd, LVM_SETCALLBACKMASK, WPARAM(mask), 0) - -proc ListView_SetColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT = - result = SendMessage(wnd, LVM_SETCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col))) - -proc ListView_SetColumnWidth(wnd: HWND, iCol, cx: int32): LRESULT = - result = SendMessage(wnd, LVM_SETCOLUMNWIDTH, WPARAM(iCol), MAKELPARAM(cx, 0)) - -proc ListView_SetImageList(wnd: HWND, himl: int32, iImageList: HIMAGELIST): LRESULT = - result = SendMessage(wnd, LVM_SETIMAGELIST, WPARAM(iImageList), - LPARAM(UINT(himl))) - -proc ListView_SetItem(wnd: HWND, item: var LV_ITEM): LRESULT = - result = SendMessage(wnd, LVM_SETITEM, 0, cast[LPARAM](addr(item))) - -proc ListView_SetItemCount(hwndLV: HWND, cItems: int32): LRESULT = - result = SendMessage(hwndLV, LVM_SETITEMCOUNT, WPARAM(cItems), 0) - -proc ListView_SetItemPosition(hwndLV: HWND, i, x, y: int32): LRESULT = - result = SendMessage(hwndLV, LVM_SETITEMPOSITION, WPARAM(i), MAKELPARAM(x, y)) - -proc ListView_SetItemPosition32(hwndLV: HWND, i, x, y: int32): LRESULT = - var ptNewPos: POINT - ptNewPos.x = x - ptNewPos.y = y - result = SendMessage(hwndLV, LVM_SETITEMPOSITION32, WPARAM(i), - cast[LPARAM](addr(ptNewPos))) - -proc ListView_SetItemState(hwndLV: HWND, i, data, mask: int32): LRESULT = - var gnu_lvi: LV_ITEM - gnu_lvi.stateMask = uint(mask) - gnu_lvi.state = uint(data) - result = SendMessage(hwndLV, LVM_SETITEMSTATE, WPARAM(i), - cast[LPARAM](addr(gnu_lvi))) - -proc ListView_SetItemText(hwndLV: HWND, i, iSubItem: int32, pszText: LPTSTR): LRESULT = - var gnu_lvi: LV_ITEM - gnu_lvi.iSubItem = iSubItem - gnu_lvi.pszText = pszText - result = SendMessage(hwndLV, LVM_SETITEMTEXT, WPARAM(i), - cast[LPARAM](addr(gnu_lvi))) - -proc ListView_SetTextBkColor(wnd: HWND, clrTextBk: COLORREF): LRESULT = - result = SendMessage(wnd, LVM_SETTEXTBKCOLOR, 0, LPARAM(clrTextBk)) - -proc ListView_SetTextColor(wnd: HWND, clrText: COLORREF): LRESULT = - result = SendMessage(wnd, LVM_SETTEXTCOLOR, 0, LPARAM(clrText)) - -proc ListView_SortItems(hwndLV: HWND, pfnCompare: PFNLVCOMPARE, - lPrm: LPARAM): LRESULT = - result = SendMessage(hwndLV, LVM_SORTITEMS, WPARAM(lPrm), - cast[LPARAM](pfnCompare)) - -proc ListView_Update(hwndLV: HWND, i: int32): LRESULT = - result = SendMessage(hwndLV, LVM_UPDATE, WPARAM(i), 0) - -proc TreeView_InsertItem(wnd: HWND, lpis: LPTV_INSERTSTRUCT): LRESULT = - result = SendMessage(wnd, TVM_INSERTITEM, 0, cast[LPARAM](lpis)) - -proc TreeView_DeleteItem(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = SendMessage(wnd, TVM_DELETEITEM, 0, cast[LPARAM](hitem)) - -proc TreeView_DeleteAllItems(wnd: HWND): LRESULT = - result = SendMessage(wnd, TVM_DELETEITEM, 0, cast[LPARAM](TVI_ROOT)) - -proc TreeView_Expand(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT = - result = SendMessage(wnd, TVM_EXPAND, WPARAM(code), cast[LPARAM](hitem)) - -proc TreeView_GetCount(wnd: HWND): LRESULT = - result = SendMessage(wnd, TVM_GETCOUNT, 0, 0) - -proc TreeView_GetIndent(wnd: HWND): LRESULT = - result = SendMessage(wnd, TVM_GETINDENT, 0, 0) - -proc TreeView_SetIndent(wnd: HWND, indent: int32): LRESULT = - result = SendMessage(wnd, TVM_SETINDENT, WPARAM(indent), 0) - -proc TreeView_GetImageList(wnd: HWND, iImage: WPARAM): LRESULT = - result = SendMessage(wnd, TVM_GETIMAGELIST, iImage, 0) - -proc TreeView_SetImageList(wnd: HWND, himl: HIMAGELIST, iImage: WPARAM): LRESULT = - result = SendMessage(wnd, TVM_SETIMAGELIST, iImage, LPARAM(UINT(himl))) - -proc TreeView_GetNextItem(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT = - result = SendMessage(wnd, TVM_GETNEXTITEM, WPARAM(code), cast[LPARAM](hitem)) - -proc TreeView_GetChild(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_GetNextItem(wnd, hitem, TVGN_CHILD) - -proc TreeView_GetNextSibling(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_GetNextItem(wnd, hitem, TVGN_NEXT) - -proc TreeView_GetPrevSibling(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_GetNextItem(wnd, hitem, TVGN_PREVIOUS) - -proc TreeView_GetParent(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_GetNextItem(wnd, hitem, TVGN_PARENT) - -proc TreeView_GetFirstVisible(wnd: HWND): LRESULT = - result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_FIRSTVISIBLE) - -proc TreeView_GetNextVisible(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_GetNextItem(wnd, hitem, TVGN_NEXTVISIBLE) - -proc TreeView_GetPrevVisible(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_GetNextItem(wnd, hitem, TVGN_PREVIOUSVISIBLE) - -proc TreeView_GetSelection(wnd: HWND): LRESULT = - result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_CARET) - -proc TreeView_GetDropHilight(wnd: HWND): LRESULT = - result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_DROPHILITE) - -proc TreeView_GetRoot(wnd: HWND): LRESULT = - result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_ROOT) - -proc TreeView_Select(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT = - result = SendMessage(wnd, TVM_SELECTITEM, WPARAM(code), cast[LPARAM](hitem)) - -proc TreeView_SelectItem(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_Select(wnd, hitem, TVGN_CARET) - -proc TreeView_SelectDropTarget(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_Select(wnd, hitem, TVGN_DROPHILITE) - -proc TreeView_SelectSetFirstVisible(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = TreeView_Select(wnd, hitem, TVGN_FIRSTVISIBLE) - -proc TreeView_GetItem(wnd: HWND, item: var TV_ITEM): LRESULT = - result = SendMessage(wnd, TVM_GETITEM, 0, cast[LPARAM](addr(item))) - -proc TreeView_SetItem(wnd: HWND, item: var TV_ITEM): LRESULT = - result = SendMessage(wnd, TVM_SETITEM, 0, cast[LPARAM](addr(item))) - -proc TreeView_EditLabel(wnd: HWND, hitem: HTREEITEM): LRESULT = - Result = SendMessage(wnd, TVM_EDITLABEL, 0, cast[LPARAM](hitem)) - -proc TreeView_GetEditControl(wnd: HWND): LRESULT = - result = SendMessage(wnd, TVM_GETEDITCONTROL, 0, 0) - -proc TreeView_GetVisibleCount(wnd: HWND): LRESULT = - result = SendMessage(wnd, TVM_GETVISIBLECOUNT, 0, 0) - -proc TreeView_HitTest(wnd: HWND, lpht: LPTV_HITTESTINFO): LRESULT = - result = SendMessage(wnd, TVM_HITTEST, 0, cast[LPARAM](lpht)) - -proc TreeView_CreateDragImage(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = SendMessage(wnd, TVM_CREATEDRAGIMAGE, 0, cast[LPARAM](hitem)) - -proc TreeView_SortChildren(wnd: HWND, hitem: HTREEITEM, recurse: int32): LRESULT = - result = SendMessage(wnd, TVM_SORTCHILDREN, WPARAM(recurse), cast[LPARAM](hitem)) - -proc TreeView_EnsureVisible(wnd: HWND, hitem: HTREEITEM): LRESULT = - result = SendMessage(wnd, TVM_ENSUREVISIBLE, 0, cast[LPARAM](hitem)) - -proc TreeView_SortChildrenCB(wnd: HWND, psort: LPTV_SORTCB, recurse: int32): LRESULT = - result = SendMessage(wnd, TVM_SORTCHILDRENCB, WPARAM(recurse), cast[LPARAM](psort)) - -proc TreeView_EndEditLabelNow(wnd: HWND, fCancel: int32): LRESULT = - result = SendMessage(wnd, TVM_ENDEDITLABELNOW, WPARAM(fCancel), 0) - -proc TreeView_GetISearchString(hwndTV: HWND, lpsz: LPTSTR): LRESULT = - result = SendMessage(hwndTV, TVM_GETISEARCHSTRING, 0, cast[LPARAM](lpsz)) - -proc TabCtrl_GetImageList(wnd: HWND): LRESULT = - result = SendMessage(wnd, TCM_GETIMAGELIST, 0, 0) - -proc TabCtrl_SetImageList(wnd: HWND, himl: HIMAGELIST): LRESULT = - result = SendMessage(wnd, TCM_SETIMAGELIST, 0, LPARAM(UINT(himl))) - -proc TabCtrl_GetItemCount(wnd: HWND): LRESULT = - result = SendMessage(wnd, TCM_GETITEMCOUNT, 0, 0) - -proc TabCtrl_GetItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT = - result = SendMessage(wnd, TCM_GETITEM, WPARAM(iItem), cast[LPARAM](addr(item))) - -proc TabCtrl_SetItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT = - result = SendMessage(wnd, TCM_SETITEM, WPARAM(iItem), cast[LPARAM](addr(item))) - -proc TabCtrl_InsertItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT = - result = SendMessage(wnd, TCM_INSERTITEM, WPARAM(iItem), cast[LPARAM](addr(item))) - -proc TabCtrl_DeleteItem(wnd: HWND, i: int32): LRESULT = - result = SendMessage(wnd, TCM_DELETEITEM, WPARAM(i), 0) - -proc TabCtrl_DeleteAllItems(wnd: HWND): LRESULT = - result = SendMessage(wnd, TCM_DELETEALLITEMS, 0, 0) - -proc TabCtrl_GetItemRect(wnd: HWND, i: int32, rc: var RECT): LRESULT = - result = SendMessage(wnd, TCM_GETITEMRECT, WPARAM(int32(i)), cast[LPARAM](addr(rc))) - -proc TabCtrl_GetCurSel(wnd: HWND): LRESULT = - result = SendMessage(wnd, TCM_GETCURSEL, 0, 0) - -proc TabCtrl_SetCurSel(wnd: HWND, i: int32): LRESULT = - result = SendMessage(wnd, TCM_SETCURSEL, WPARAM(i), 0) - -proc TabCtrl_HitTest(hwndTC: HWND, info: var TC_HITTESTINFO): LRESULT = - result = SendMessage(hwndTC, TCM_HITTEST, 0, cast[LPARAM](addr(info))) - -proc TabCtrl_SetItemExtra(hwndTC: HWND, cb: int32): LRESULT = - result = SendMessage(hwndTC, TCM_SETITEMEXTRA, WPARAM(cb), 0) - -proc TabCtrl_AdjustRect(wnd: HWND, bLarger: WINBOOL, rc: var RECT): LRESULT = - result = SendMessage(wnd, TCM_ADJUSTRECT, WPARAM(bLarger), cast[LPARAM](addr(rc))) - -proc TabCtrl_SetItemSize(wnd: HWND, x, y: int32): LRESULT = - result = SendMessage(wnd, TCM_SETITEMSIZE, 0, MAKELPARAM(x, y)) - -proc TabCtrl_RemoveImage(wnd: HWND, i: WPARAM): LRESULT = - result = SendMessage(wnd, TCM_REMOVEIMAGE, i, 0) - -proc TabCtrl_SetPadding(wnd: HWND, cx, cy: int32): LRESULT = - result = SendMessage(wnd, TCM_SETPADDING, 0, MAKELPARAM(cx, cy)) - -proc TabCtrl_GetRowCount(wnd: HWND): LRESULT = - result = SendMessage(wnd, TCM_GETROWCOUNT, 0, 0) - -proc TabCtrl_GetToolTips(wnd: HWND): LRESULT = - result = SendMessage(wnd, TCM_GETTOOLTIPS, 0, 0) - -proc TabCtrl_SetToolTips(wnd: HWND, hwndTT: int32): LRESULT = - result = SendMessage(wnd, TCM_SETTOOLTIPS, WPARAM(hwndTT), 0) - -proc TabCtrl_GetCurFocus(wnd: HWND): LRESULT = - result = SendMessage(wnd, TCM_GETCURFOCUS, 0, 0) - -proc TabCtrl_SetCurFocus(wnd: HWND, i: int32): LRESULT = - result = SendMessage(wnd, TCM_SETCURFOCUS, i, 0) - -proc SNDMSG(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT = - result = SendMessage(wnd, Msg, wp, lp) - -proc CommDlg_OpenSave_GetSpecA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz)) - -proc CommDlg_OpenSave_GetSpecW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz)) - -when defined(winUnicode): - proc CommDlg_OpenSave_GetSpec(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz)) -else: - proc CommDlg_OpenSave_GetSpec(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz)) - -proc CommDlg_OpenSave_GetFilePathA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz)) - -proc CommDlg_OpenSave_GetFilePathW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz)) - -when defined(winUnicode): - proc CommDlg_OpenSave_GetFilePath(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz)) -else: - proc CommDlg_OpenSave_GetFilePath(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz)) - -proc CommDlg_OpenSave_GetFolderPathA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz)) - -proc CommDlg_OpenSave_GetFolderPathW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz)) - -when defined(winUnicode): - proc CommDlg_OpenSave_GetFolderPath(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM]((psz))) -else: - proc CommDlg_OpenSave_GetFolderPath(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz)) - -proc CommDlg_OpenSave_GetFolderIDList(hdlg: HWND, pidl: LPVOID, cbmax: int32): LRESULT = - result = SNDMSG(hdlg, CDM_GETFOLDERIDLIST, WPARAM(cbmax), cast[LPARAM](pidl)) - -proc CommDlg_OpenSave_SetControlText(hdlg: HWND, id: int32, text: LPSTR): LRESULT = - result = SNDMSG(hdlg, CDM_SETCONTROLTEXT, WPARAM(id), cast[LPARAM](text)) - -proc CommDlg_OpenSave_HideControl(hdlg: HWND, id: int32): LRESULT = - result = SNDMSG(hdlg, CDM_HIDECONTROL, WPARAM(id), 0) - -proc CommDlg_OpenSave_SetDefExt(hdlg: HWND, pszext: LPSTR): LRESULT = - result = SNDMSG(hdlg, CDM_SETDEFEXT, 0, cast[LPARAM](pszext)) - -proc InternalGetLargestConsoleWindowSize(hConsoleOutput: HANDLE): DWord{. - stdcall, dynlib: "kernel32", importc: "GetLargestConsoleWindowSize".} -proc GetLargestConsoleWindowSize(hConsoleOutput: HANDLE): COORD = - var res: dword - res = InternalGetLargestConsoleWindowSize(hConsoleOutput) - result.y = toU16(res and 0x0000ffff) # XXX: correct? - result.x = toU16(res shr 16) - -proc Succeeded(Status: HRESULT): WINBOOL = - result = (Status and 0x80000000).WinBool - -proc Failed(Status: HRESULT): WINBOOL = - result = (Status and 0x80000000).WinBool - -proc IsError(Status: HRESULT): WINBOOL = - result = ord((int(Status) shr 31) == SEVERITY_ERROR) - -proc HResultCode(hr: HRESULT): int32 = - result = hr and 0x0000FFFF'i32 - -proc HResultFacility(hr: HRESULT): int32 = - result = (hr shr 16'i32) and 0x00001FFF'i32 - -proc HResultSeverity(hr: HRESULT): int32 = - result = (hr shr 31'i32) and 0x00000001'i32 - -proc MakeResult(p1, p2, mask: int32): HRESULT = - result = (p1 shl 31'i32) or (p2 shl 16'i32) or mask - -proc HResultFromWin32(x: int32): HRESULT = - result = x - if result != 0'i32: - result = ((result and 0x0000FFFF'i32) or (int32(FACILITY_WIN32) shl 16'i32) or - 0x80000000'i32) - -proc HResultFromNT(x: int32): HRESULT = - result = x or int32(FACILITY_NT_BIT) - -proc MAKELANGID(PrimaryLang, SubLang: USHORT): int16 = - result = (SubLang shl 10'i16) or PrimaryLang - -proc PRIMARYLANGID(LangId: int16): int16 = - result = LangId and 0x000003FF'i16 - -proc SUBLANGID(LangId: int16): int16 = - result = LangId shr 10'i16 - -proc MAKELCID(LangId, SortId: int16): DWORD = - result = toU32((ze(SortId) shl 16) or ze(LangId)) - -proc MAKESORTLCID(LangId, SortId, SortVersion: int16): DWORD = - result = MAKELCID(LangId, SortId) or (SortVersion shl 20'i32) - -proc LANGIDFROMLCID(LocaleId: LCID): int16 = - result = toU16(LocaleId) - -proc SORTIDFROMLCID(LocaleId: LCID): int16 = - result = toU16((DWORD(LocaleId) shr 16) and 0x0000000F) - -proc SORTVERSIONFROMLCID(LocaleId: LCID): int16 = - result = toU16((DWORD(LocaleId) shr 20) and 0x0000000F) - -proc LANG_SYSTEM_DEFAULT(): int16 = - result = toU16(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_SYS_DEFAULT)) - -proc LANG_USER_DEFAULT(): int16 = - result = toU16(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_DEFAULT)) - -proc LOCALE_NEUTRAL(): DWORD = - result = MAKELCID(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_NEUTRAL), SORT_DEFAULT) - -proc LOCALE_INVARIANT(): DWORD = - result = MAKELCID(MAKELANGID(toU16(LANG_INVARIANT), SUBLANG_NEUTRAL), SORT_DEFAULT) From 32d2327be025f62bd1b51a98322879cc7e8d218f Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 3 Dec 2013 13:30:58 +0100 Subject: [PATCH 064/326] don't use memset for temps unless necessary --- compiler/cgen.nim | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 24d3c2923f..ad9ade63c7 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -370,14 +370,17 @@ proc resetLoc(p: BProc, loc: var TLoc) = # on the bytes following the m_type field? genObjectInit(p, cpsStmts, loc.t, loc, true) -proc constructLoc(p: BProc, loc: TLoc, section = cpsStmts) = +proc constructLoc(p: BProc, loc: TLoc, isTemp = false) = if not isComplexValueType(skipTypes(loc.t, abstractRange)): - linefmt(p, section, "$1 = 0;$n", rdLoc(loc)) + linefmt(p, cpsStmts, "$1 = 0;$n", rdLoc(loc)) else: - useStringh(p.module) - linefmt(p, section, "memset((void*)$1, 0, sizeof($2));$n", - addrLoc(loc), rdLoc(loc)) - genObjectInit(p, section, loc.t, loc, true) + if not isTemp or containsGarbageCollectedRef(loc.t): + # don't use memset for temporary values for performance if we can + # avoid it: + useStringh(p.module) + linefmt(p, cpsStmts, "memset((void*)$1, 0, sizeof($2));$n", + addrLoc(loc), rdLoc(loc)) + genObjectInit(p, cpsStmts, loc.t, loc, true) proc initLocalVar(p: BProc, v: PSym, immediateAsgn: bool) = if sfNoInit notin v.flags: @@ -403,7 +406,7 @@ proc getTemp(p: BProc, t: PType, result: var TLoc) = result.t = getUniqueType(t) result.s = OnStack result.flags = {} - constructLoc(p, result) + constructLoc(p, result, isTemp=true) proc keepAlive(p: BProc, toKeepAlive: TLoc) = when false: From 20661c9c46028b9a937bd79ec5b06c96618ddd39 Mon Sep 17 00:00:00 2001 From: Hitesh Jasani Date: Tue, 3 Dec 2013 20:13:40 -0500 Subject: [PATCH 065/326] Add docs for connecting to postgres with keyword/value connection strings. --- lib/impure/db_postgres.nim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim index 2dd55e05f3..157d58c7cf 100644 --- a/lib/impure/db_postgres.nim +++ b/lib/impure/db_postgres.nim @@ -180,6 +180,21 @@ proc Open*(connection, user, password, database: string): TDbConn {. tags: [FDb].} = ## opens a database connection. Raises `EDb` if the connection could not ## be established. + ## + ## Clients can also use Postgres keyword/value connection strings to + ## connect. + ## + ## Example: + ## + ## .. code-block:: nimrod + ## + ## con = Open("", "", "", "host=localhost port=5432 dbname=mydb") + ## + ## See http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING + ## for more information. + ## + ## Note that the connection parameter is not used but exists to maintain + ## the nimrod db api. result = PQsetdbLogin(nil, nil, nil, nil, database, user, password) if PQStatus(result) != CONNECTION_OK: dbError(result) # result = nil From c0a3d44060c2c16c11be1244340f79742a2732cb Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 5 Dec 2013 10:45:36 +0100 Subject: [PATCH 066/326] bugfix: keywords are sorted --- compiler/lexer.nim | 10 ++++++---- compiler/wordrecg.nim | 10 +++++----- doc/keywords.txt | 3 ++- lib/packages/docutils/highlite.nim | 2 +- tests/patterns/tor.nim | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 82bfa0ad4d..eb9287dfef 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -41,11 +41,12 @@ type tkGeneric, tkIf, tkImport, tkIn, tkInclude, tkInterface, tkIs, tkIsnot, tkIterator, tkLambda, tkLet, - tkMacro, tkMethod, tkMixin, tkUsing, tkMod, tkNil, tkNot, tkNotin, + tkMacro, tkMethod, tkMixin, tkMod, tkNil, tkNot, tkNotin, tkObject, tkOf, tkOr, tkOut, tkProc, tkPtr, tkRaise, tkRef, tkReturn, tkShared, tkShl, tkShr, tkStatic, tkTemplate, - tkTry, tkTuple, tkType, tkVar, tkWhen, tkWhile, tkWith, tkWithout, tkXor, + tkTry, tkTuple, tkType, tkUsing, + tkVar, tkWhen, tkWhile, tkWith, tkWithout, tkXor, tkYield, # end of keywords tkIntLit, tkInt8Lit, tkInt16Lit, tkInt32Lit, tkInt64Lit, tkUIntLit, tkUInt8Lit, tkUInt16Lit, tkUInt32Lit, tkUInt64Lit, @@ -75,12 +76,13 @@ const "finally", "for", "from", "generic", "if", "import", "in", "include", "interface", "is", "isnot", "iterator", "lambda", "let", - "macro", "method", "mixin", "using", "mod", + "macro", "method", "mixin", "mod", "nil", "not", "notin", "object", "of", "or", "out", "proc", "ptr", "raise", "ref", "return", "shared", "shl", "shr", "static", "template", - "try", "tuple", "type", "var", "when", "while", "with", "without", "xor", + "try", "tuple", "type", "using", + "var", "when", "while", "with", "without", "xor", "yield", "tkIntLit", "tkInt8Lit", "tkInt16Lit", "tkInt32Lit", "tkInt64Lit", "tkUIntLit", "tkUInt8Lit", "tkUInt16Lit", "tkUInt32Lit", "tkUInt64Lit", diff --git a/compiler/wordrecg.nim b/compiler/wordrecg.nim index b37a7bb4f9..9e86a260e0 100644 --- a/compiler/wordrecg.nim +++ b/compiler/wordrecg.nim @@ -28,9 +28,9 @@ type wElif, wElse, wEnd, wEnum, wExcept, wExport, wFinally, wFor, wFrom, wGeneric, wIf, wImport, wIn, wInclude, wInterface, wIs, wIsnot, wIterator, wLambda, wLet, - wMacro, wMethod, wMixin, wUsing, wMod, wNil, + wMacro, wMethod, wMixin, wMod, wNil, wNot, wNotin, wObject, wOf, wOr, wOut, wProc, wPtr, wRaise, wRef, wReturn, - wShared, wShl, wShr, wStatic, wTemplate, wTry, wTuple, wType, wVar, + wShared, wShl, wShr, wStatic, wTemplate, wTry, wTuple, wType, wUsing, wVar, wWhen, wWhile, wWith, wWithout, wXor, wYield, wColon, wColonColon, wEquals, wDot, wDotDot, @@ -95,7 +95,7 @@ const cppNimSharedKeywords* = { wAsm, wBreak, wCase, wConst, wContinue, wDo, wElse, wEnum, wExport, - wFor, wIf, wReturn, wStatic, wTemplate, wTry, wWhile, wUsing } + wFor, wIf, wReturn, wStatic, wTemplate, wTry, wWhile, wUsing} specialWords*: array[low(TSpecialWord)..high(TSpecialWord), string] = ["", @@ -107,11 +107,11 @@ const "finally", "for", "from", "generic", "if", "import", "in", "include", "interface", "is", "isnot", "iterator", "lambda", "let", - "macro", "method", "mixin", "using", "mod", "nil", "not", "notin", + "macro", "method", "mixin", "mod", "nil", "not", "notin", "object", "of", "or", "out", "proc", "ptr", "raise", "ref", "return", "shared", "shl", "shr", "static", - "template", "try", "tuple", "type", "var", + "template", "try", "tuple", "type", "using", "var", "when", "while", "with", "without", "xor", "yield", diff --git a/doc/keywords.txt b/doc/keywords.txt index fa3ce47868..2d18d7969e 100644 --- a/doc/keywords.txt +++ b/doc/keywords.txt @@ -7,13 +7,14 @@ finally for from generic if import in include interface is isnot iterator lambda let -macro method mixin using mod +macro method mixin mod nil not notin object of or out proc ptr raise ref return shared shl shr static template try tuple type +using var when while with without xor diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim index 69da2bba84..4bfdf5e58a 100644 --- a/lib/packages/docutils/highlite.nim +++ b/lib/packages/docutils/highlite.nim @@ -53,7 +53,7 @@ const "interface", "is", "isnot", "iterator", "lambda", "let", "macro", "method", "mixin", "mod", "nil", "not", "notin", "object", "of", "or", "out", "proc", "ptr", "raise", "ref", "return", "shared", "shl", "shr", "static", - "template", "try", "tuple", "type", "var", "when", "while", "with", + "template", "try", "tuple", "type", "using", "var", "when", "while", "with", "without", "xor", "yield"] proc getSourceLanguage*(name: string): TSourceLanguage = diff --git a/tests/patterns/tor.nim b/tests/patterns/tor.nim index 7de1a7fa16..833418919e 100644 --- a/tests/patterns/tor.nim +++ b/tests/patterns/tor.nim @@ -1,5 +1,5 @@ discard """ - output: '''110 + output: '''3060 true''' """ From 3560827a287a6a363b810b881133e80464db15c6 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 5 Dec 2013 11:28:45 +0100 Subject: [PATCH 067/326] makes 'reject' tests green --- compiler/vmgen.nim | 20 ++++++++++++++++---- tests/reject/t99bott.nim | 2 +- tests/reject/tbind2.nim | 2 +- tests/reject/tdisallowif.nim | 3 ++- tests/reject/teffects1.nim | 2 +- tests/reject/tenummix.nim | 4 ++-- tests/reject/tnot.nim | 3 ++- tests/reject/twrongconst.nim | 4 ++-- 8 files changed, 27 insertions(+), 13 deletions(-) diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 46edad2cdc..cc395f6c57 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -851,6 +851,8 @@ proc genAsgn(c: PCtx; dest: TDest; ri: PNode; requiresCopy: bool) = gABC(c, ri, whichAsgnOpc(ri), dest, tmp) c.freeTemp(tmp) +template isGlobal(s: PSym): bool = sfGlobal in s.flags and s.kind != skForVar + proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) = case le.kind of nkBracketExpr: @@ -872,7 +874,7 @@ proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) = c.freeTemp(tmp) of nkSym: let s = le.sym - if sfGlobal in s.flags: + if s.isGlobal: withTemp(tmp, le.typ): gen(c, ri, tmp) c.gABx(le, whichAsgnOpc(le, opcWrGlobal), tmp, s.position) @@ -903,9 +905,17 @@ proc importcSym(c: PCtx; info: TLineInfo; s: PSym) = localError(info, errGenerated, "cannot 'importc' variable at compile time") +proc cannotEval(n: PNode) {.noinline.} = + globalError(n.info, errGenerated, "cannot evaluate at compile time: " & + n.renderTree) + proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = let s = n.sym - if sfGlobal in s.flags: + if s.isGlobal: + if sfCompileTime in s.flags or c.mode == emRepl: + discard + else: + cannotEval(n) if dest < 0: dest = c.getTemp(s.typ) if s.position == 0: if sfImportc in s.flags: c.importcSym(n.info, s) @@ -922,7 +932,9 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = # we need to generate an assignment: genAsgn(c, dest, n, c.prc.slots[dest].kind >= slotSomeTemp) else: - InternalError(n.info, s.name.s & " " & $s.position) + # see tests/t99bott for an example that triggers it: + cannotEval(n) + #InternalError(n.info, s.name.s & " " & $s.position) proc genAccess(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode) = let a = c.genx(n.sons[0]) @@ -1022,7 +1034,7 @@ proc genVarSection(c: PCtx; n: PNode) = c.freeTemp(tmp) elif a.sons[0].kind == nkSym: let s = a.sons[0].sym - if sfGlobal in s.flags: + if s.isGlobal: if s.position == 0: if sfImportc in s.flags: c.importcSym(a.info, s) else: diff --git a/tests/reject/t99bott.nim b/tests/reject/t99bott.nim index 7ebfd61e9c..d18cb0d5c7 100644 --- a/tests/reject/t99bott.nim +++ b/tests/reject/t99bott.nim @@ -1,7 +1,7 @@ discard """ file: "t99bott.nim" line: 26 - errormsg: "constant expression expected" + errormsg: "cannot evaluate at compile time: bn" disabled: false """ ## 99 Bottles of Beer diff --git a/tests/reject/tbind2.nim b/tests/reject/tbind2.nim index 72a9844bb2..e8e21ad024 100644 --- a/tests/reject/tbind2.nim +++ b/tests/reject/tbind2.nim @@ -1,6 +1,6 @@ discard """ file: "tbind2.nim" - line: 12 + line: 14 errormsg: "ambiguous call" """ # Test the new ``bind`` keyword for templates diff --git a/tests/reject/tdisallowif.nim b/tests/reject/tdisallowif.nim index 10f54288a8..18dfd1c826 100644 --- a/tests/reject/tdisallowif.nim +++ b/tests/reject/tdisallowif.nim @@ -1,6 +1,7 @@ discard """ line: 24 errormsg: "usage of 'disallowIf' is a user-defined error" + disabled: true """ template optZero{x+x}(x: int): int = x*3 @@ -25,4 +26,4 @@ if s[0] != "hi": echo "do it" echo "more branches" else: - nil + discard diff --git a/tests/reject/teffects1.nim b/tests/reject/teffects1.nim index 1c6c4bed8a..f5eb56dc80 100644 --- a/tests/reject/teffects1.nim +++ b/tests/reject/teffects1.nim @@ -1,5 +1,5 @@ discard """ - line: 1804 + line: 1840 file: "system.nim" errormsg: "can raise an unlisted exception: ref EIO" """ diff --git a/tests/reject/tenummix.nim b/tests/reject/tenummix.nim index f58e7989de..aaf0be2cb4 100644 --- a/tests/reject/tenummix.nim +++ b/tests/reject/tenummix.nim @@ -1,6 +1,6 @@ discard """ - file: "system.nim" - line: 696 + file: "tenummix.nim" + line: 11 errormsg: "type mismatch" """ diff --git a/tests/reject/tnot.nim b/tests/reject/tnot.nim index 1985ef6667..cd0f538e62 100644 --- a/tests/reject/tnot.nim +++ b/tests/reject/tnot.nim @@ -1,5 +1,6 @@ discard """ - file: "system.nim" + file: "tnot.nim" + line: 14 errormsg: "type mismatch" """ # BUG: following compiles, but should not: diff --git a/tests/reject/twrongconst.nim b/tests/reject/twrongconst.nim index 16fe3bff65..e5b8a15bd0 100644 --- a/tests/reject/twrongconst.nim +++ b/tests/reject/twrongconst.nim @@ -1,6 +1,6 @@ discard """ - output: "Error: constant expression expected" - line: 7 + output: "Error: cannot evaluate at compile time: x" + line: 10 """ var x: array[100, char] From 4ffe6a8282bf6f496881a2595d0f61f46a1d716c Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 6 Dec 2013 01:48:02 +0100 Subject: [PATCH 068/326] new VM: passes more tests --- compiler/msgs.nim | 4 +--- compiler/semstmts.nim | 19 ++++++++++++------- compiler/vm.nim | 13 ++++++++----- compiler/vmdef.nim | 3 ++- compiler/vmgen.nim | 28 ++++++++++++++++++---------- tests/compile/tbindtypedesc.nim | 4 ++++ 6 files changed, 45 insertions(+), 26 deletions(-) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 895ba71f30..2a7d54d4eb 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -700,11 +700,9 @@ type proc handleError(msg: TMsgKind, eh: TErrorHandling, s: string) = template maybeTrace = - if defined(debug) or gVerbosity >= 3: + if defined(debug) or gVerbosity >= 3 or msg == errInternal: writeStackTrace() - if msg == errInternal: - writeStackTrace() # we always want a stack trace here if msg >= fatalMin and msg <= fatalMax: maybeTrace() quit(1) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index cd714ef6ec..6f0cc3c8b2 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1168,13 +1168,18 @@ proc semPragmaBlock(c: PContext, n: PNode): PNode = proc semStaticStmt(c: PContext, n: PNode): PNode = let a = semStmt(c, n.sons[0]) - result = evalStaticExpr(c.module, a, c.p.owner) - if result.isNil: - LocalError(n.info, errCannotInterpretNodeX, renderTree(n)) - result = emptyNode - elif result.kind == nkEmpty: - result = newNodeI(nkDiscardStmt, n.info, 1) - result.sons[0] = emptyNode + n.sons[0] = a + evalStaticStmt(c.module, a, c.p.owner) + result = newNodeI(nkDiscardStmt, n.info, 1) + result.sons[0] = emptyNode + when false: + result = evalStaticStmt(c.module, a, c.p.owner) + if result.isNil: + LocalError(n.info, errCannotInterpretNodeX, renderTree(n)) + result = emptyNode + elif result.kind == nkEmpty: + result = newNodeI(nkDiscardStmt, n.info, 1) + result.sons[0] = emptyNode proc usesResult(n: PNode): bool = # nkStmtList(expr) properly propagates the void context, diff --git a/compiler/vm.nim b/compiler/vm.nim index 019397bbcf..a6cdc81b2a 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -515,7 +515,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[rb].sons == regs[rc].sons) of opcEqNimrodNode: decodeBC(nkIntLit) - regs[ra].intVal = ord(regs[rb].uast == regs[rc].uast) + regs[ra].intVal = ord(regs[rb].skipMeta == regs[rc].skipMeta) of opcXor: decodeBC(nkIntLit) regs[ra].intVal = ord(regs[rb].intVal != regs[rc].intVal) @@ -746,7 +746,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = decodeB(nkStrLit) regs[ra].strVal = renderTree(regs[rb].skipMeta, {renderNoComments}) of opcQuit: - if c.mode in {emRepl, emStatic}: + if c.mode in {emRepl, emStaticExpr, emStaticStmt}: Message(c.debug[pc], hintQuitCalled) quit(int(getOrdValue(regs[ra]))) else: @@ -1036,7 +1036,7 @@ proc evalConstExprAux(module, prc: PSym, n: PNode, mode: TEvalMode): PNode = setupGlobalCtx(module) var c = globalCtx c.mode = mode - let start = genExpr(c, n) + let start = genExpr(c, n, requiresValue = mode!=emStaticStmt) assert c.code[start].opcode != opcEof var tos = PStackFrame(prc: prc, comesFrom: 0, next: nil) newSeq(tos.slots, c.prc.maxSlots) @@ -1047,8 +1047,11 @@ proc evalConstExprAux(module, prc: PSym, n: PNode, mode: TEvalMode): PNode = proc evalConstExpr*(module: PSym, e: PNode): PNode = result = evalConstExprAux(module, nil, e, emConst) -proc evalStaticExpr*(module: PSym, e: PNode, prc: PSym): PNode = - result = evalConstExprAux(module, prc, e, emStatic) +proc evalStaticExpr*(module: PSym, e: PNode, prc: PSym): PNode = + result = evalConstExprAux(module, prc, e, emStaticExpr) + +proc evalStaticStmt*(module: PSym, e: PNode, prc: PSym) = + discard evalConstExprAux(module, prc, e, emStaticStmt) proc setupMacroParam(x: PNode): PNode = result = x diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 15ea9767b2..1869b69c45 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -134,8 +134,9 @@ type emConst, ## evaluate for 'const' according to spec emOptimize, ## evaluate for optimization purposes (same as ## emConst?) - emStatic ## evaluate for enforced compile time eval + emStaticExpr, ## evaluate for enforced compile time eval ## ('static' context) + emStaticStmt ## 'static' as an expression TSandboxFlag* = enum ## what the evaluation engine should allow allowCast, ## allow unsafe language feature: 'cast' diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index cc395f6c57..802fa17068 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -314,6 +314,11 @@ proc genLiteral(c: PCtx; n: PNode): int = if sameConstant(c.constants[i], n): return i result = rawGenLiteral(c, n) +proc unused(n: PNode; x: TDest) {.inline.} = + if x >= 0: + #debug(n) + InternalError(n.info, "not unused") + proc genCase(c: PCtx; n: PNode; dest: var TDest) = # if (!expr1) goto L1; # thenPart @@ -325,7 +330,10 @@ proc genCase(c: PCtx; n: PNode; dest: var TDest) = # L2: # elsePart # Lend: - if dest < 0 and not isEmptyType(n.typ): dest = getTemp(c, n.typ) + if not isEmptyType(n.typ): + if dest < 0: dest = getTemp(c, n.typ) + else: + unused(n, dest) var endings: seq[TPosition] = @[] withTemp(tmp, n.sons[0].typ): c.gen(n.sons[0], tmp) @@ -503,11 +511,6 @@ proc genAddSubInt(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode) = else: genBinaryABC(c, n, dest, opc) -proc unused(n: PNode; x: TDest) {.inline.} = - if x >= 0: - #debug(n) - InternalError(n.info, "not unused") - proc genConv(c: PCtx; n, arg: PNode; dest: var TDest; opc=opcConv) = let tmp = c.genx(arg) c.gABx(n, opcSetType, tmp, genType(c, arg.typ)) @@ -1168,7 +1171,10 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = c.gABx(n, opcLdImmInt, dest, n.intVal.int) else: genLit(c, n, dest) - of nkUIntLit..nkNilLit: genLit(c, n, dest) + of nkUIntLit..pred(nkNilLit): genLit(c, n, dest) + of nkNilLit: + if not n.typ.isEmptyType: genLit(c, n, dest) + else: unused(n, dest) of nkAsgn, nkFastAsgn: unused(n, dest) genAsgn(c, n.sons[0], n.sons[1], n.kind == nkAsgn) @@ -1253,14 +1259,16 @@ proc genStmt*(c: PCtx; n: PNode): int = var d: TDest = -1 c.gen(n, d) c.gABC(n, opcEof) - InternalAssert d < 0 + if d >= 0: internalError(n.info, "some destination set") -proc genExpr*(c: PCtx; n: PNode): int = +proc genExpr*(c: PCtx; n: PNode, requiresValue = true): int = c.removeLastEof result = c.code.len var d: TDest = -1 c.gen(n, d) - InternalAssert d >= 0 + if d < 0: + if requiresValue: internalError(n.info, "no destination set") + d = 0 c.gABC(n, opcEof, d) proc genParams(c: PCtx; params: PNode) = diff --git a/tests/compile/tbindtypedesc.nim b/tests/compile/tbindtypedesc.nim index dd4ef854cc..4ebfd12bb3 100644 --- a/tests/compile/tbindtypedesc.nim +++ b/tests/compile/tbindtypedesc.nim @@ -44,6 +44,10 @@ good(genericParamOnce(TFoo, TFoo)) bad(genericParamOnce(string, int)) bad(genericParamOnce(TFoo, float)) +type + type1 = typedesc + type2 = typedesc + proc typePairs(A, B: type1; C, D: type2) = nil good(typePairs(int, int, TFoo, TFOO)) From 430c8d8b526c6f94a789db3362e9d2807d81e61d Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 6 Dec 2013 20:29:37 +0100 Subject: [PATCH 069/326] new VM supports 'getAst' --- compiler/vm.nim | 15 ++++++++++++++- compiler/vmgen.nim | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/compiler/vm.nim b/compiler/vm.nim index a6cdc81b2a..94ff8a4c7d 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -17,6 +17,7 @@ import parser, vmdeps, idents, trees, renderer, options from semfold import leValueConv, ordinalValToString +from evaltempl import evalTemplate when hasFFI: import evalffi @@ -625,7 +626,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra] = newValue else: globalError(c.debug[pc], errGenerated, "VM not built with FFI support") - else: + elif prc.kind != skTemplate: let newPc = compile(c, prc) #echo "new pc ", newPc, " calling: ", prc.name.s var newFrame = PStackFrame(prc: prc, comesFrom: pc, next: tos) @@ -644,6 +645,18 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = move(regs, newFrame.slots) # -1 for the following 'inc pc' pc = newPc-1 + else: + # for 'getAst' support we need to support template expansion here: + let genSymOwner = if tos.next != nil and tos.next.prc != nil: + tos.next.prc + else: + c.module + var macroCall = newNodeI(nkCall, c.debug[pc]) + macroCall.add(newSymNode(prc)) + for i in 1 .. rc-1: macroCall.add(regs[rb+i].skipMeta) + let a = evalTemplate(macroCall, prc, genSymOwner) + ensureKind(nkMetaNode) + setMeta(regs[ra], a) of opcTJmp: # jump Bx if A != 0 let rbx = instr.regBx - wordExcess - 1 # -1 for the following 'inc pc' diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 802fa17068..300ef2d71c 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -711,8 +711,6 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = genUnaryABC(c, n, dest, opcParseExprToAst) of mParseStmtToAst: genUnaryABC(c, n, dest, opcParseStmtToAst) - of mExpandToAst: - InternalError(n.info, "cannot generate code for: " & $m) of mTypeTrait: let tmp = c.genx(n.sons[1]) if dest < 0: dest = c.getTemp(n.typ) @@ -786,6 +784,16 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = of mNGenSym: genBinaryABC(c, n, dest, opcGenSym) of mMinI, mMaxI, mMinI64, mMaxI64, mAbsF64, mMinF64, mMaxF64, mAbsI, mAbsI64: c.genCall(n, dest) + of mExpandToAst: + if n.len != 2: + globalError(n.info, errGenerated, "expandToAst requires 1 argument") + let arg = n.sons[1] + if arg.kind in nkCallKinds: + #if arg[0].kind != nkSym or arg[0].sym.kind notin {skTemplate, skMacro}: + # "ExpandToAst: expanded symbol is no macro or template" + c.genCall(arg, dest) + else: + globalError(n.info, "expandToAst requires a call expression") else: # mGCref, mGCunref, InternalError(n.info, "cannot generate code for: " & $m) @@ -1140,7 +1148,8 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = case s.kind of skVar, skForVar, skTemp, skLet, skParam, skResult: genRdVar(c, n, dest) - of skProc, skConverter, skMacro, skMethod, skIterator: + of skProc, skConverter, skMacro, skTemplate, skMethod, skIterator: + # 'skTemplate' is only allowed for 'getAst' support: if sfImportc in s.flags: c.importcSym(n.info, s) genLit(c, n, dest) of skConst: From 1e26047c3b38349402858ce0a1a5bf747b9f2914 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sat, 7 Dec 2013 20:30:44 +0200 Subject: [PATCH 070/326] adding some provisions for writing lower-level unit tests targeting specific sub-systems of the compiler see sigmatch as an example. tests are compiled only when the compiler is compiled with -d:selftest to execute them, just run the resulting binary without arguments --- compiler/nimrod.cfg | 1 + compiler/nimrod.nim | 6 ++++-- compiler/sigmatch.nim | 17 +++++++++++++++-- compiler/testability.nim | 5 +++++ lib/pure/unittest.nim | 8 ++++++-- 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 compiler/testability.nim diff --git a/compiler/nimrod.cfg b/compiler/nimrod.cfg index ac8f732f1f..9fa1b8cba2 100644 --- a/compiler/nimrod.cfg +++ b/compiler/nimrod.cfg @@ -11,4 +11,5 @@ path:"$projectPath/.." path:"$lib/packages/docutils" define:booting +import:testability diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim index 3fa80cebb8..2f10e32e36 100644 --- a/compiler/nimrod.nim +++ b/compiler/nimrod.nim @@ -76,5 +76,7 @@ when compileOption("gc", "v2") or compileOption("gc", "refc"): # the new correct mark&sweet collector is too slow :-/ GC_disableMarkAndSweep() condsyms.InitDefines() -HandleCmdLine() -quit(int8(msgs.gErrorCounter > 0)) + +when not defined(selftest): + HandleCmdLine() + quit(int8(msgs.gErrorCounter > 0)) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 00f3b2b107..12a5708b67 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1130,7 +1130,7 @@ proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) = var f = 1 while f < sonsLen(m.callee.n): var formal = m.callee.n.sons[f].sym - if not ContainsOrIncl(marker, formal.position): + if not ContainsOrIncl(marker, formal.position): if formal.ast == nil: if formal.typ.kind == tyVarargs: var container = newNodeIT(nkBracket, n.info, arrayConstr(c, n.info)) @@ -1145,7 +1145,7 @@ proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) = setSon(m.call, formal.position + 1, copyTree(formal.ast)) inc(f) -proc argtypeMatches*(c: PContext, f, a: PType): bool = +proc argtypeMatches*(c: PContext, f, a: PType): bool = var m: TCandidate initCandidate(m, f) let res = paramTypesMatch(c, m, f, a, ast.emptyNode, nil) @@ -1155,3 +1155,16 @@ proc argtypeMatches*(c: PContext, f, a: PType): bool = result = res != nil include suggest + + + +tests: + suite "typerel": + test "ordinals": + # var owner = newSym(skModule, getIdent("dummy"), nil, UnknownLineInfo()) + var m: TCandidate + InitCandidate(m, f) + + # let f = newType(tyOrdinal, owner) + # let a = getSysType(tyInt) + # check typerel(m, f, a) == isGeneric diff --git a/compiler/testability.nim b/compiler/testability.nim new file mode 100644 index 0000000000..ceefd0a5e3 --- /dev/null +++ b/compiler/testability.nim @@ -0,0 +1,5 @@ +template tests*(body: stmt) {.immediate.} = + when defined(selftest): + when not defined(unittest): import unittest + body + diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index 71f4d498b3..20f5c610ee 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -98,8 +98,12 @@ template fail* = when not defined(ECMAScript): if AbortOnError: quit(1) - - TestStatusIMPL = FAILED + + when defined(TestStatusIMPL): + TestStatusIMPL = FAILED + else: + program_result += 1 + checkpoints = @[] macro check*(conditions: stmt): stmt {.immediate.} = From 208924b92921ea10afc27dbab059e612113eee48 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sat, 7 Dec 2013 21:23:22 +0200 Subject: [PATCH 071/326] fixes #708 It's unclear to me why for variables were treated as globals. This is likely to cause many problems, but in this particular case it was breaking the unittest/insepectArgs recursive function (the for loop variable has a different value in each stack frame) --- compiler/evals.nim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/evals.nim b/compiler/evals.nim index 7e2c8a41d2..b4ea973e89 100644 --- a/compiler/evals.nim +++ b/compiler/evals.nim @@ -550,9 +550,7 @@ proc evalSym(c: PEvalContext, n: PNode, flags: TEvalFlags): PNode = of skProc, skConverter, skMacro, skType: result = n #result = s.getBody - of skForVar: - result = evalGlobalVar(c, s, flags) - of skVar, skLet, skTemp, skResult: + of skVar, skLet, skForVar, skTemp, skResult: if sfGlobal notin s.flags: result = evalVariable(c.tos, s, flags) else: From e7e8c7706240c4bef17533da63df988d228ba127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Mon, 2 Dec 2013 18:34:32 +0100 Subject: [PATCH 072/326] Make quoteIfContainsWhite quote argument, so it can be safely passed to shell. On Windows put it in double quotes and escape double quotes using backslash. On Posix put it in single quotes and escape single quotes using '"'"'. This commit changes what quoteIfContainsWhite does, but before that change it was used incorrectly all over standard library, which caused security issues. --- lib/pure/strutils.nim | 51 ++++++++++++++++++++++++++++++++++++------- web/news.txt | 2 ++ 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index a4aa815787..0299f5cd2f 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -709,14 +709,6 @@ proc rfind*(s, sub: string, start: int = -1): int {.noSideEffect.} = if result != -1: return return -1 -proc quoteIfContainsWhite*(s: string): string = - ## returns ``'"' & s & '"'`` if `s` contains a space and does not - ## start with a quote, else returns `s` - if find(s, {' ', '\t'}) >= 0 and s[0] != '"': - result = '"' & s & '"' - else: - result = s - proc contains*(s: string, c: char): bool {.noSideEffect.} = ## Same as ``find(s, c) >= 0``. return find(s, c) >= 0 @@ -780,6 +772,49 @@ proc replaceWord*(s, sub: string, by = ""): string {.noSideEffect, # copy the rest: add result, substr(s, i) +proc quoteIfContainsWhite*(s: string): string {.noSideEffect.} = + ## Quote s, so it can be safely passed to shell. + when defined(Windows): + # based on Python's subprocess.list2cmdline + # see http://msdn.microsoft.com/en-us/library/17w5ykft.aspx + let needQuote = {' ', '\t'} in s or s.len == 0 + + result = "" + var backslashBuff = "" + if needQuote: + result.add("\"") + + for c in s: + if c == '\\': + backslashBuff.add(c) + elif c == '\"': + result.add(backslashBuff) + result.add(backslashBuff) + backslashBuff.setLen(0) + result.add("\\\"") + else: + if backslashBuff.len != 0: + result.add(backslashBuff) + backslashBuff.setLen(0) + result.add(c) + + if needQuote: + result.add("\"") + + else: + # based on Python's pipes.quote + const safeUnixChars = {'%', '+', '-', '.', '/', '_', ':', '=', '@', + '0'..'9', 'A'..'Z', 'a'..'z'} + if s.len == 0: + return "''" + + let safe = s.allCharsInSet(safeUnixChars) + + if safe: + return s + else: + return "'" & s.replace("'", "'\"'\"'") & "'" + proc delete*(s: var string, first, last: int) {.noSideEffect, rtl, extern: "nsuDelete".} = ## Deletes in `s` the characters at position `first` .. `last`. This modifies diff --git a/web/news.txt b/web/news.txt index 1b492fa971..f919089a53 100644 --- a/web/news.txt +++ b/web/news.txt @@ -28,6 +28,8 @@ Changes affecting backwards compatibility require an error code to be passed to them. This error code can be retrieved using the new ``OSLastError`` proc. - ``os.parentDir`` now returns "" if there is no parent dir. +- ``quoteIfContainsWhite`` now escapes argument in such way that it can be safely + passed to shell, instead of just adding double quotes. Compiler Additions From 29357ab556a25ea75d0cf837eace079b46d51fc8 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 8 Dec 2013 01:47:07 +0100 Subject: [PATCH 073/326] more tests are green --- compiler/semexprs.nim | 3 ++- compiler/semfold.nim | 46 ++++++++++++++++++++++++++++------ compiler/vmdef.nim | 2 +- compiler/vmdeps.nim | 57 ------------------------------------------ compiler/vmgen.nim | 16 ++++++------ lib/pure/encodings.nim | 10 ++++---- 6 files changed, 54 insertions(+), 80 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 78d828e43a..13bfddab72 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -780,6 +780,7 @@ proc semDirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = #semLazyOpAux(c, n) result = semOverloadedCallAnalyseEffects(c, n, nOrig, flags) if result != nil: result = afterCallActions(c, result, nOrig, flags) + else: result = errorNode(c, n) proc buildStringify(c: PContext, arg: PNode): PNode = if arg.typ != nil and @@ -1839,7 +1840,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = # don't have to check the symbol for semantics here again! result = semSym(c, n, n.sym, flags) of nkEmpty, nkNone, nkCommentStmt: - nil + discard of nkNilLit: result.typ = getSysType(tyNil) of nkIntLit: diff --git a/compiler/semfold.nim b/compiler/semfold.nim index ca06ea1b66..fb1816f9c8 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -229,6 +229,33 @@ discard """ mShrI, mShrI64, mAddF64, mSubF64, mMulF64, mDivF64, mMaxF64, mMinF64 """ +proc evalIs(n, a: PNode): PNode = + internalAssert a.kind == nkSym and a.sym.kind == skType + internalAssert n.sonsLen == 3 and + n[2].kind in {nkStrLit..nkTripleStrLit, nkType} + + let t1 = a.sym.typ + + if n[2].kind in {nkStrLit..nkTripleStrLit}: + case n[2].strVal.normalize + of "closure": + let t = skipTypes(t1, abstractRange) + result = newIntNode(nkIntLit, ord(t.kind == tyProc and + t.callConv == ccClosure and + tfIterator notin t.flags)) + of "iterator": + let t = skipTypes(t1, abstractRange) + result = newIntNode(nkIntLit, ord(t.kind == tyProc and + t.callConv == ccClosure and + tfIterator in t.flags)) + else: + # XXX semexprs.isOpImpl is slightly different and requires a context. yay. + let t2 = n[2].typ + var match = if t2.kind == tyTypeClass: matchTypeClass(t2, t1) + else: sameType(t1, t2) + result = newIntNode(nkIntLit, ord(match)) + result.typ = n.typ + proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = # b and c may be nil result = nil @@ -372,7 +399,7 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = mAppendStrStr, mAppendSeqElem, mSetLengthStr, mSetLengthSeq, mParseExprToAst, mParseStmtToAst, mExpandToAst, mTypeTrait, mNLen..mNError, mEqRef, mSlurp, mStaticExec, mNGenSym: - nil + discard of mRand: result = newIntNodeT(math.random(a.getInt.int), n) else: InternalError(a.info, "evalOp(" & $m & ')') @@ -446,8 +473,6 @@ proc magicCall(m: PSym, n: PNode): PNode = if sonsLen(n) > 3: c = getConstExpr(m, n.sons[3]) if c == nil: return - else: - b = nil result = evalOp(s.magic, n, a, b, c) proc getAppType(n: PNode): PNode = @@ -485,7 +510,7 @@ proc foldConv*(n, a: PNode; check = false): PNode = result = a result.typ = n.typ of tyOpenArray, tyVarargs, tyProc: - nil + discard else: result = a result.typ = n.typ @@ -523,7 +548,7 @@ proc foldArrayAccess(m: PSym, n: PNode): PNode = nil else: LocalError(n.info, errIndexOutOfBounds) - else: nil + else: discard proc foldFieldAccess(m: PSym, n: PNode): PNode = # a real field access; proc calls have already been transformed @@ -592,7 +617,7 @@ proc getConstExpr(m: PSym, n: PNode): PNode = result.typ = s.typ.sons[0] else: result = newSymNodeTypeDesc(s, n.info) - else: nil + else: discard of nkCharLit..nkNilLit: result = copyNode(n) of nkIfExpr: @@ -604,7 +629,8 @@ proc getConstExpr(m: PSym, n: PNode): PNode = try: case s.magic of mNone: - return # XXX: if it has no sideEffect, it should be evaluated + # If it has no sideEffect, it should be evaluated. But not here. + return of mSizeOf: var a = n.sons[1] if computeSize(a.typ) < 0: @@ -644,6 +670,10 @@ proc getConstExpr(m: PSym, n: PNode): PNode = result = newStrNodeT(renderTree(n[1], {renderNoComments}), n) of mConStrStr: result = foldConStrStr(m, n) + of mIs: + let a = getConstExpr(m, n[1]) + if a != nil and a.kind == nkSym and a.sym.kind == skType: + result = evalIs(n, a) else: result = magicCall(m, n) except EOverflow: @@ -727,4 +757,4 @@ proc getConstExpr(m: PSym, n: PNode): PNode = of nkBracketExpr: result = foldArrayAccess(m, n) of nkDotExpr: result = foldFieldAccess(m, n) else: - nil + discard diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 1869b69c45..290dfd38c0 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -60,7 +60,7 @@ type opcEqStr, opcLeStr, opcLtStr, opcEqSet, opcLeSet, opcLtSet, opcMulSet, opcPlusSet, opcMinusSet, opcSymdiffSet, opcConcatStr, opcContainsSet, opcRepr, opcSetLenStr, opcSetLenSeq, - opcSwap, opcIsNil, opcOf, + opcSwap, opcIsNil, opcOf, opcSubStr, opcConv, opcCast, opcQuit, opcReset, opcAddStrCh, diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim index 5b1a028b17..07100897b2 100644 --- a/compiler/vmdeps.nim +++ b/compiler/vmdeps.nim @@ -34,60 +34,3 @@ proc opSlurp*(file: string, info: TLineInfo, module: PSym): string = except EIO: LocalError(info, errCannotOpenFile, file) result = "" - -when false: - proc opExpandToAst*(c: PEvalContext, original: PNode): PNode = - var - n = original.copyTree - macroCall = n.sons[1] - expandedSym = macroCall.sons[0].sym - - for i in countup(1, macroCall.sonsLen - 1): - macroCall.sons[i] = evalAux(c, macroCall.sons[i], {}) - - case expandedSym.kind - of skTemplate: - let genSymOwner = if c.tos != nil and c.tos.prc != nil: - c.tos.prc - else: - c.module - result = evalTemplate(macroCall, expandedSym, genSymOwner) - of skMacro: - # At this point macroCall.sons[0] is nkSym node. - # To be completely compatible with normal macro invocation, - # we want to replace it with nkIdent node featuring - # the original unmangled macro name. - macroCall.sons[0] = newIdentNode(expandedSym.name, expandedSym.info) - result = evalMacroCall(c, macroCall, original, expandedSym) - else: - InternalError(macroCall.info, - "ExpandToAst: expanded symbol is no macro or template") - result = emptyNode - - proc opIs*(n: PNode): PNode = - InternalAssert n.sonsLen == 3 and - n[1].kind == nkSym and n[1].sym.kind == skType and - n[2].kind in {nkStrLit..nkTripleStrLit, nkType} - - let t1 = n[1].sym.typ - - if n[2].kind in {nkStrLit..nkTripleStrLit}: - case n[2].strVal.normalize - of "closure": - let t = skipTypes(t1, abstractRange) - result = newIntNode(nkIntLit, ord(t.kind == tyProc and - t.callConv == ccClosure and - tfIterator notin t.flags)) - of "iterator": - let t = skipTypes(t1, abstractRange) - result = newIntNode(nkIntLit, ord(t.kind == tyProc and - t.callConv == ccClosure and - tfIterator in t.flags)) - else: - let t2 = n[2].typ - var match = if t2.kind == tyTypeClass: matchTypeClass(t2, t1) - else: sameType(t1, t2) - result = newIntNode(nkIntLit, ord(match)) - - result.typ = n.typ - diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 300ef2d71c..62b9e7d1e4 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -16,17 +16,17 @@ import when hasFFI: import evalffi -proc codeListing(c: PCtx, result: var string) = +proc codeListing(c: PCtx, result: var string, start=0) = # first iteration: compute all necessary labels: var jumpTargets = initIntSet() - for i in 0.. < c.code.len: + for i in start.. < c.code.len: let x = c.code[i] if x.opcode in relativeJumps: jumpTargets.incl(i+x.regBx-wordExcess) # for debugging purposes - var i = 0 + var i = start while i < c.code.len: if i in jumpTargets: result.addf("L$1:\n", i) let x = c.code[i] @@ -48,9 +48,9 @@ proc codeListing(c: PCtx, result: var string) = result.add("\n") inc i -proc echoCode*(c: PCtx) {.deprecated.} = +proc echoCode*(c: PCtx, start=0) {.deprecated.} = var buf = "" - codeListing(c, buf) + codeListing(c, buf, start) echo buf proc gABC(ctx: PCtx; n: PNode; opc: TOpcode; a, b, c: TRegister = 0) = @@ -846,7 +846,7 @@ proc whichAsgnOpc(n: PNode): TOpcode = opcAsgnStr of tyFloat..tyFloat128: opcAsgnFloat - of tyRef, tyNil: + of tyRef, tyNil, tyVar: opcAsgnRef else: opcAsgnComplex @@ -1371,8 +1371,8 @@ proc genProc(c: PCtx; s: PSym): int = c.gABC(body, opcEof, eofInstr.regA) c.optimizeJumps(result) s.offset = c.prc.maxSlots - #if s.name.s == "innerProc": - # c.echoCode + #if s.name.s == "treeRepr" or s.name.s == "traverse": + # c.echoCode(result) # echo renderTree(body) c.prc = oldPrc else: diff --git a/lib/pure/encodings.nim b/lib/pure/encodings.nim index ce42384092..bc849bfe86 100644 --- a/lib/pure/encodings.nim +++ b/lib/pure/encodings.nim @@ -14,15 +14,15 @@ import os, parseutils, strutils when not defined(windows): type - TConverter = object {.pure, final.} + TConverter = object PConverter* = ptr TConverter ## can convert between two character sets - + else: type TCodePage = distinct int32 - PConverter* = object {.pure.} + PConverter* = object dest, src: TCodePage - + type EInvalidEncoding* = object of EInvalidValue ## exception that is raised ## for encoding errors @@ -425,7 +425,7 @@ else: dst = cast[cstring](cast[int](cstring(result)) + offset) outLen = len(result) - offset else: - OSError() + OSError(lerr.TOSErrorCode) # iconv has a buffer that needs flushing, specially if the last char is # not '\0' discard iconv(c, nil, nil, dst, outlen) From 53c0012a83a0131daf5c72729ddc3acd433f671d Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 8 Dec 2013 12:49:21 +0100 Subject: [PATCH 074/326] Fixes link to manual in bold section. Nested inline markup is not possible at the moment, see http://stackoverflow.com/a/9645684/172690. Maybe this would be a useful extension to have in nimrod's custom rst engine? --- doc/tut2.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tut2.txt b/doc/tut2.txt index f66a5135d1..fc0c0630ee 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -16,9 +16,9 @@ Introduction This document is a tutorial for the advanced constructs of the *Nimrod* -programming language. **Note that this document is somewhat obsolete as -the `manual `_ contains many more examples of the advanced -language features.** +programming language. **Note that this document is somewhat obsolete as the** +`manual `_ **contains many more examples of the advanced language +features.** Pragmas From 8526d2936517fec9db9608607cea971bcd804428 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 8 Dec 2013 12:52:54 +0100 Subject: [PATCH 075/326] Adds missing ``s`` to sligthly odd sentence. --- doc/tut2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tut2.txt b/doc/tut2.txt index fc0c0630ee..82be57000a 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -948,7 +948,7 @@ Generating AST by hand To generate an AST we would need to intimately know the structures used by the Nimrod compiler exposed in the `macros module `_, which at first -look seems a daunting task. But we can use a helper shortcut the ``dumpTree`` +look seems a daunting task. But we can use as helper shortcut the ``dumpTree`` macro, which is used as a statement macro instead of an expression macro. Since we know that we want to generate a bunch of ``const`` symbols we can create the following source file and compile it to see what the compiler From 410fcf7f52ec34f8ebe18c089f52a1024924c8ce Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 8 Dec 2013 18:33:19 +0100 Subject: [PATCH 076/326] Fixes strutils reference in macro tutorial. --- doc/tut2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tut2.txt b/doc/tut2.txt index 82be57000a..b35f715274 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -852,7 +852,7 @@ to be included along the program containing the license information:: The ``readCfgAtRuntime`` proc will open the given filename and return a ``TTable`` from the `tables module `_. The parsing of the file is done (without much care for handling invalid data or corner cases) using the -``split`` proc from the `strutils module `_. There are many +``splitLines`` proc from the `strutils module `_. There are many things which can fail; mind the purpose is explaining how to make this run at compile time, not how to properly implement a DRM scheme. From 89215ba6d0f9bd130e4d136c7eada07607509cc8 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 8 Dec 2013 20:27:28 +0100 Subject: [PATCH 077/326] Updates configuration for recent lib removals. Refs #698. --- tools/noprefix.nim | 32 -------------------------------- web/nimrod.ini | 5 +---- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/tools/noprefix.nim b/tools/noprefix.nim index e7ec26c560..fe03a9efc4 100644 --- a/tools/noprefix.nim +++ b/tools/noprefix.nim @@ -18,44 +18,12 @@ const ("mysql", "mysql"), ("postgres", ""), ("sqlite3", "sqlite3"), - ("tcl", "tcl"), - ("cairo/cairo", "cairo"), - ("cairo/cairoft", "cairo"), - ("cairo/cairowin32", "cairo"), - ("cairo/cairoxlib", "cairo"), - - ("gtk/atk", "atk"), - ("gtk/gdk2", "gdk"), - ("gtk/gdk2pixbuf", "gdk"), - ("gtk/gdkglext", "gdk"), - ("gtk/glib2", ""), - ("gtk/gtk2", "gtk"), - ("gtk/gtkglext", "gtk"), - ("gtk/gtkhtml", "gtk"), - ("gtk/libglade2", "glade"), - ("gtk/pango", "pango"), - ("gtk/pangoutils", "pango"), - - ("lua/lua", "lua"), - ("lua/lauxlib", "luaL"), - ("lua/lualib", "lua"), - - ("opengl/gl", ""), - ("opengl/glext", ""), - ("opengl/wingl", ""), - ("opengl/glu", ""), - ("opengl/glut", ""), - ("opengl/glx", ""), ("pcre/pcre", "pcre") ] proc createDirs = createDir("lib/newwrap/sdl") - createDir("lib/newwrap/cairo") - createDir("lib/newwrap/gtk") - createDir("lib/newwrap/lua") - createDir("lib/newwrap/opengl") createDir("lib/newwrap/pcre") for filename, prefix in items(filelist): diff --git a/web/nimrod.ini b/web/nimrod.ini index 94f196c643..f10a4b2f21 100644 --- a/web/nimrod.ini +++ b/web/nimrod.ini @@ -66,17 +66,14 @@ srcdoc2: "packages/docutils/rstgen" webdoc: "wrappers/libcurl;pure/md5;wrappers/mysql;wrappers/iup" webdoc: "wrappers/sqlite3;wrappers/postgres;wrappers/tinyc" -webdoc: "wrappers/python;wrappers/tcl;wrappers/expat;wrappers/pcre" +webdoc: "wrappers/expat;wrappers/pcre" webdoc: "wrappers/tre;wrappers/openssl" webdoc: "wrappers/libuv;wrappers/joyent_http_parser" webdoc: "posix/posix;wrappers/odbcsql;impure/dialogs" webdoc: "wrappers/zip/zlib;wrappers/zip/libzip" -webdoc: "wrappers/cairo" -webdoc: "wrappers/gtk" webdoc: "wrappers/libsvm.nim;wrappers/mongo.nim" webdoc: "windows" -webdoc: "wrappers/x11;wrappers/opengl;wrappers/lua" webdoc: "wrappers/readline/readline;wrappers/readline/history" webdoc: "wrappers/readline/rltypedefs" From de3b7cd413e02498c0ee5554f55f9c92d2baa9ab Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Mon, 9 Dec 2013 00:09:03 +0200 Subject: [PATCH 078/326] progress towards adding negative type classes [unittest bugfixes] the block form of check now allows comments errors when inspecting the arguments of var-accepting procs --- compiler/ast.nim | 11 +- compiler/ccgutils.nim | 2 +- compiler/jsgen.nim | 2 +- compiler/semexprs.nim | 2 +- compiler/seminst.nim | 5 +- compiler/semtypes.nim | 9 +- compiler/sigmatch.nim | 251 ++++++++++++++++++++++++++++++++++++++---- compiler/types.nim | 25 +++-- lib/pure/unittest.nim | 6 +- 9 files changed, 267 insertions(+), 46 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 5a5d87d061..1e5276d68d 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -335,12 +335,19 @@ type tyConst, tyMutable, tyVarargs, tyIter, # unused tyProxy # used as errornous type (for idetools) - tyTypeClass, + tyTypeClass + tyAnd + tyOr + tyNot + tyAnything + tyParametricTypeClass # structured similarly to tyGenericInst + # lastSon is the body of the type class const tyPureObject* = tyTuple GcTypeKinds* = {tyRef, tySequence, tyString} tyError* = tyProxy # as an errornous node should match everything + tyTypeClasses* = {tyTypeClass, tyParametricTypeClass, tyAnd, tyOr, tyNot, tyAnything} type TTypeKinds* = set[TTypeKind] @@ -377,6 +384,7 @@ type # used as return types for return type inference) tfAll, # type class requires all constraints to be met (default) tfAny, # type class requires any constraint to be met + tfNot, # type class with a negative check tfCapturesEnv, # whether proc really captures some environment tfByCopy, # pass object/tuple by copy (C backend) tfByRef, # pass object/tuple by reference (C backend) @@ -1416,3 +1424,4 @@ proc isAtom*(n: PNode): bool {.inline.} = proc isEmptyType*(t: PType): bool {.inline.} = ## 'void' and 'stmt' types are often equivalent to 'nil' these days: result = t == nil or t.kind in {tyEmpty, tyStmt} + diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index c377545117..310f7204ae 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -86,7 +86,7 @@ proc GetUniqueType*(key: PType): PType = if result == nil: gCanonicalTypes[k] = key result = key - of tyTypeDesc, tyTypeClass: + of tyTypeDesc, tyTypeClasses: InternalError("value expected, but got a type") of tyGenericParam: InternalError("GetUniqueType") diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 54ee430699..a3c88824d0 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -130,7 +130,7 @@ proc mapType(typ: PType): TJSTypeKind = result = etyObject of tyNil: result = etyNull of tyGenericInst, tyGenericParam, tyGenericBody, tyGenericInvokation, tyNone, - tyForward, tyEmpty, tyExpr, tyStmt, tyTypeDesc, tyTypeClass: + tyForward, tyEmpty, tyExpr, tyStmt, tyTypeDesc, tyTypeClasses: result = etyNone of tyProc: result = etyProc of tyCString: result = etyString diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 337224aef9..5abe8da834 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -322,7 +322,7 @@ proc isOpImpl(c: PContext, n: PNode): PNode = var match: bool let t2 = n[2].typ case t2.kind - of tyTypeClass: + of tyTypeClasses: var m: TCandidate InitCandidate(m, t2) match = matchUserTypeClass(c, m, emptyNode, t2, t1) != nil diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 0cf5086a8d..d7d64fd547 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -20,7 +20,8 @@ proc instantiateGenericParamList(c: PContext, n: PNode, pt: TIdTable, if a.kind != nkSym: InternalError(a.info, "instantiateGenericParamList; no symbol") var q = a.sym - if q.typ.kind notin {tyTypeDesc, tyGenericParam, tyTypeClass, tyExpr}: continue + if q.typ.kind notin {tyTypeDesc, tyGenericParam, tyExpr}+tyTypeClasses: + continue var s = newSym(skType, q.name, getCurrOwner(), q.info) s.flags = s.flags + {sfUsed, sfFromGeneric} var t = PType(IdTableGet(pt, q.typ)) @@ -193,7 +194,7 @@ proc fixupProcType(c: PContext, genericType: PType, if result == nil: return case genericType.kind - of tyGenericParam, tyTypeClass: + of tyGenericParam, tyTypeClasses: result = inst.concreteTypes[genericType.sym.position] of tyTypeDesc: result = inst.concreteTypes[genericType.sym.position] diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 92f47f5854..6c9c476d9b 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -676,8 +676,13 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, if lifted != nil: paramType.sons[i] = lifted result = paramType - - if result != nil: + + if paramType.lastSon.kind == tyTypeClass: + result = paramType + result.kind = tyParametricTypeClass + result = addImplicitGeneric(copyType(result, + getCurrOwner(), false)) + elif result != nil: result.kind = tyGenericInvokation result.sons.setLen(result.sons.len - 1) of tyTypeClass: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 12a5708b67..cacf4782e3 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -203,7 +203,7 @@ proc describeArgs*(c: PContext, n: PNode, startIdx = 1): string = add(result, argTypeToString(arg)) if i != sonsLen(n) - 1: add(result, ", ") -proc typeRel*(c: var TCandidate, f, a: PType): TTypeRelation +proc typeRel*(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation proc concreteType(c: TCandidate, t: PType): PType = case t.kind of tyArrayConstr: @@ -213,7 +213,7 @@ proc concreteType(c: TCandidate, t: PType): PType = addSonSkipIntLit(result, t.sons[1]) # XXX: semantic checking for the type? of tyNil: result = nil # what should it be? - of tyGenericParam: + of tyGenericParam, tyAnything: result = t while true: result = PType(idTableGet(c.bindings, t)) @@ -385,8 +385,23 @@ proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} = else: result = isNone -proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation = - # is a subtype of f? +proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = + # typeRel can be used to establish various relationships between types: + # + # 1) When used with concrete types, it will check for type equivalence + # or a subtype relationship. + # + # 2) When used with a concrete type against a type class (such as generic + # signature of a proc), it will check whether the concrete type is a member + # of the designated type class. + # + # 3) When used with two type classes, it will check whether the types + # matching the first type class are a strict subset of the types matching + # the other. This allows us to compare the signatures of generic procs in + # order to give preferrence to the most specific one: + # + # seq[seq[any]] is a strict subset of seq[any] and hence more specific. + result = isNone assert(f != nil) assert(a != nil) @@ -397,6 +412,50 @@ proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation = return typeRel(c, f, lastSon(a)) if a.kind == tyVar and f.kind != tyVar: return typeRel(c, f, a.sons[0]) + + template bindingRet(res) = + when res == isGeneric: put(c.bindings, f, a) + return res + + case a.kind + of tyOr: + # seq[int|string] vs seq[number] + # both int and string must match against number + for branch in a.sons: + if typeRel(c, f, branch, false) == isNone: + return isNone + + return isGeneric + + of tyAnd: + # seq[Sortable and Iterable] vs seq[Sortable] + # only one match is enough + for branch in a.sons: + if typeRel(c, f, branch, false) != isNone: + return isGeneric + + return isNone + + of tyNot: + case f.kind + of tyNot: + # seq[!int] vs seq[!number] + # seq[float] matches the first, but not the second + # we must turn the problem around: + # is number a subset of int? + return typeRel(c, a.lastSon, f.lastSon) + + else: + # negative type classes are essentially infinite, + # so only the `any` type class is their superset + return if f.kind == tyAnything: isGeneric + else: isNone + + of tyAnything: + return if f.kind == tyAnything: isGeneric + else: isNone + else: nil + case f.kind of tyEnum: if a.kind == f.kind and sameEnumTypes(f, a): result = isEqual @@ -485,9 +544,12 @@ proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation = of tyOrdinal: if isOrdinalType(a): var x = if a.kind == tyOrdinal: a.sons[0] else: a - - result = typeRel(c, f.sons[0], x) - if result < isGeneric: result = isNone + + if f.sonsLen == 0: + result = isGeneric + else: + result = typeRel(c, f.sons[0], x) + if result < isGeneric: result = isNone elif a.kind == tyGenericParam: result = isGeneric of tyForward: InternalError("forward type in typeRel()") @@ -574,13 +636,17 @@ proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation = (a.sons[1].kind == tyChar): result = isConvertible else: nil - of tyEmpty: + + of tyEmpty: if a.kind == tyEmpty: result = isEqual - of tyGenericInst: + + of tyGenericInst: result = typeRel(c, lastSon(f), a) - of tyGenericBody: + + of tyGenericBody: let ff = lastSon(f) if ff != nil: result = typeRel(c, ff, a) + of tyGenericInvokation: var x = a.skipGenericAlias if x.kind == tyGenericInvokation or f.sons[0].kind != tyGenericBody: @@ -604,6 +670,38 @@ proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation = if x == nil or x.kind in {tyGenericInvokation, tyGenericParam}: InternalError("wrong instantiated type!") put(c.bindings, f.sons[i], x) + + of tyAnd: + for branch in f.sons: + if typeRel(c, branch, a) == isNone: + return isNone + + bindingRet isGeneric + + of tyOr: + for branch in f.sons: + if typeRel(c, branch, a) != isNone: + bindingRet isGeneric + + return isNone + + of tyNot: + for branch in f.sons: + if typeRel(c, branch, a) != isNone: + return isNone + + bindingRet isGeneric + + of tyAnything: + var prev = PType(idTableGet(c.bindings, f)) + if prev == nil: + var concrete = concreteType(c, a) + if concrete != nil and doBind: + put(c.bindings, f, concrete) + return isGeneric + else: + return typeRel(c, prev, a) + of tyGenericParam, tyTypeClass: var x = PType(idTableGet(c.bindings, f)) if x == nil: @@ -634,7 +732,7 @@ proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation = if concrete == nil: result = isNone else: - put(c.bindings, f, concrete) + if doBind: put(c.bindings, f, concrete) elif a.kind == tyEmpty: result = isGeneric elif x.kind == tyGenericParam: @@ -809,8 +907,8 @@ proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, InternalAssert a.len > 0 r = typeRel(m, f.lastSon, a.lastSon) else: - let match = matchTypeClass(m, fMaybeExpr, a) - if match != isGeneric: r = isNone + let match = matchTypeClass(m.bindings, fMaybeExpr, a) + if not match: r = isNone else: # XXX: Ideally, this should happen much earlier somewhere near # semOpAux, but to do that, we need to be able to query the @@ -827,7 +925,7 @@ proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, if r == isGeneric: put(m.bindings, f, arg.typ) - of tyTypeClass: + of tyTypeClass, tyParametricTypeClass: if fMaybeExpr.n != nil: let match = matchUserTypeClass(c, m, arg, fMaybeExpr, a) if match != nil: @@ -1156,15 +1254,120 @@ proc argtypeMatches*(c: PContext, f, a: PType): bool = include suggest - - tests: - suite "typerel": - test "ordinals": - # var owner = newSym(skModule, getIdent("dummy"), nil, UnknownLineInfo()) - var m: TCandidate - InitCandidate(m, f) + var dummyOwner = newSym(skModule, getIdent("test_module"), nil, UnknownLineInfo()) + + proc `|` (t1, t2: PType): PType = + result = newType(tyOr, dummyOwner) + result.rawAddSon(t1) + result.rawAddSon(t2) + + proc `&` (t1, t2: PType): PType = + result = newType(tyAnd, dummyOwner) + result.rawAddSon(t1) + result.rawAddSon(t2) + + proc `!` (t: PType): PType = + result = newType(tyNot, dummyOwner) + result.rawAddSon(t) + + proc seq(t: PType): PType = + result = newType(tySequence, dummyOwner) + result.rawAddSon(t) + + proc array(x: int, t: PType): PType = + result = newType(tyArray, dummyOwner) + + var n = newNodeI(nkRange, UnknownLineInfo()) + addSon(n, newIntNode(nkIntLit, 0)) + addSon(n, newIntNode(nkIntLit, x)) + let range = newType(tyRange, dummyOwner) + + result.rawAddSon(range) + result.rawAddSon(t) + + suite "type classes": + let + int = newType(tyInt, dummyOwner) + float = newType(tyFloat, dummyOwner) + string = newType(tyString, dummyOwner) + ordinal = newType(tyOrdinal, dummyOwner) + any = newType(tyAnything, dummyOwner) + number = int | float + + var TFoo = newType(tyObject, dummyOwner) + TFoo.sym = newSym(skType, getIdent"TFoo", dummyOwner, UnknownLineInfo()) + + var T1 = newType(tyGenericParam, dummyOwner) + T1.sym = newSym(skType, getIdent"T1", dummyOwner, UnknownLineInfo()) + T1.sym.position = 0 + + var T2 = newType(tyGenericParam, dummyOwner) + T2.sym = newSym(skType, getIdent"T2", dummyOwner, UnknownLineInfo()) + T2.sym.position = 1 + + setup: + var c: TCandidate + InitCandidate(c, nil) + + template yes(x, y) = + test astToStr(x) & " is " & astToStr(y): + check typeRel(c, y, x) == isGeneric + + template no(x, y) = + test astToStr(x) & " is not " & astToStr(y): + check typeRel(c, y, x) == isNone + + yes seq(any), array(10, int) | seq(any) + # Sure, seq[any] is directly included + + yes seq(int), seq(any) + yes seq(int), seq(number) + # Sure, the int sequence is certainly + # part of the number sequences (and all sequences) + + no seq(any), seq(float) + # Nope, seq[any] includes types that are not seq[float] (e.g. seq[int]) + + yes seq(int|string), seq(any) + # Sure + + yes seq(int&string), seq(any) + # Again + + yes seq(int&string), seq(int) + # A bit more complicated + # seq[int&string] is not a real type, but it's analogous to + # seq[Sortable and Iterable], which is certainly a subset of seq[Sortable] + + no seq(int|string), seq(int|float) + # Nope, seq[string] is not included in not included in + # the seq[int|float] set + + no seq(!(int|string)), seq(string) + # A sequence that is neither seq[int] or seq[string] + # is obviously not seq[string] + + no seq(!int), seq(number) + # Now your head should start to hurt a bit + # A sequence that is not seq[int] is not necessarily a number sequence + # it could well be seq[string] for example + + yes seq(!(int|string)), seq(!string) + # all sequnece types besides seq[int] and seq[string] + # are subset of all sequence types that are not seq[string] + + no seq(!(int|string)), seq(!(string|TFoo)) + # Nope, seq[TFoo] is included in the first set, but not in the second + + no seq(!string), seq(!number) + # Nope, seq[int] in included in the first set, but not in the second + + yes seq(!number), seq(any) + yes seq(!int), seq(any) + no seq(any), seq(!any) + no seq(!int), seq(!any) + + yes int, ordinal + no string, ordinal - # let f = newType(tyOrdinal, owner) - # let a = getSysType(tyInt) - # check typerel(m, f, a) == isGeneric diff --git a/compiler/types.nim b/compiler/types.nim index 4dec9ea2fc..7e07a0667e 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -382,33 +382,34 @@ proc mutateTypeAux(marker: var TIntSet, t: PType, iter: TTypeMutator, if t.n != nil: result.n = mutateNode(marker, t.n, iter, closure) assert(result != nil) -proc mutateType(t: PType, iter: TTypeMutator, closure: PObject): PType = +proc mutateType(t: PType, iter: TTypeMutator, closure: PObject): PType = var marker = InitIntSet() result = mutateTypeAux(marker, t, iter, closure) -proc ValueToString(a: PNode): string = +proc ValueToString(a: PNode): string = case a.kind of nkCharLit..nkUInt64Lit: result = $(a.intVal) of nkFloatLit..nkFloat128Lit: result = $(a.floatVal) of nkStrLit..nkTripleStrLit: result = a.strVal else: result = "" -proc rangeToStr(n: PNode): string = +proc rangeToStr(n: PNode): string = assert(n.kind == nkRange) result = ValueToString(n.sons[0]) & ".." & ValueToString(n.sons[1]) const - typeToStr: array[TTypeKind, string] = ["None", "bool", "Char", "empty", - "Array Constructor [$1]", "nil", "expr", "stmt", "typeDesc", - "GenericInvokation", "GenericBody", "GenericInst", "GenericParam", - "distinct $1", "enum", "ordinal[$1]", "array[$1, $2]", "object", "tuple", - "set[$1]", "range[$1]", "ptr ", "ref ", "var ", "seq[$1]", "proc", + typeToStr: array[TTypeKind, string] = ["None", "bool", "Char", "empty", + "Array Constructor [$1]", "nil", "expr", "stmt", "typeDesc", + "GenericInvokation", "GenericBody", "GenericInst", "GenericParam", + "distinct $1", "enum", "ordinal[$1]", "array[$1, $2]", "object", "tuple", + "set[$1]", "range[$1]", "ptr ", "ref ", "var ", "seq[$1]", "proc", "pointer", "OpenArray[$1]", "string", "CString", "Forward", "int", "int8", "int16", "int32", "int64", "float", "float32", "float64", "float128", "uint", "uint8", "uint16", "uint32", "uint64", "bignum", "const ", - "!", "varargs[$1]", "iter[$1]", "Error Type", "TypeClass"] + "!", "varargs[$1]", "iter[$1]", "Error Type", "TypeClass", + "ParametricTypeClass", "and", "or", "not", "any"] proc consToStr(t: PType): string = if t.len > 0: result = t.typeToString @@ -421,7 +422,7 @@ proc constraintsToStr(t: PType): string = if i > 0: result.add(sep) result.add(t.sons[i].consToStr) -proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = +proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = var t = typ result = "" if t == nil: return @@ -861,7 +862,7 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = of tyGenericParam, tyGenericInvokation, tyGenericBody, tySequence, tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr, tyArray, tyProc, tyConst, tyMutable, tyVarargs, tyIter, - tyOrdinal, tyTypeClass: + tyOrdinal, tyTypeClasses: CycleCheck() result = sameChildrenAux(a, b, c) and sameFlags(a, b) if result and (a.kind == tyProc): @@ -1042,7 +1043,7 @@ proc typeAllowedAux(marker: var TIntSet, typ: PType, kind: TSymKind, # XXX er ... no? these should not be allowed! of tyEmpty: result = taField in flags - of tyTypeClass: + of tyTypeClasses: result = true of tyGenericBody, tyGenericParam, tyForward, tyNone, tyGenericInvokation: result = false diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index 20f5c610ee..f847d24f43 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -115,7 +115,8 @@ macro check*(conditions: stmt): stmt {.immediate.} = counter = 0 template asgn(a, value: expr): stmt = - let a = value + var a = value # XXX: we need "var: var" here in order to + # preserve the semantics of var params template print(name, value: expr): stmt = when compiles(string($value)): @@ -150,7 +151,8 @@ macro check*(conditions: stmt): stmt {.immediate.} = of nnkStmtList: result = newNimNode(nnkStmtList) for i in countup(0, checked.len - 1): - result.add(newCall(!"check", checked[i])) + if checked[i].kind != nnkCommentStmt: + result.add(newCall(!"check", checked[i])) else: template rewrite(Exp, lineInfoLit: expr, expLit: string): stmt = From 642a0d556390ab520fc81d1e54712df20ffd2ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Mon, 9 Dec 2013 18:03:36 +0100 Subject: [PATCH 079/326] Normalize whitespace in os.nim. I can't edit it - trick with asking git to ignore whitespace doesn't work if I need to change indention level. --- lib/pure/os.nim | 127 ++++++++++++++++++++++++------------------------ 1 file changed, 63 insertions(+), 64 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index a39ca7b83e..7d68218484 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -21,7 +21,7 @@ import when defined(windows): import winlean -elif defined(posix): +elif defined(posix): import posix else: {.error: "OS module not ported to your operating system!".} @@ -33,7 +33,7 @@ type ## from an environment variable FWriteEnv* = object of FWriteIO ## effect that denotes a write ## to an environment variable - + FReadDir* = object of FReadIO ## effect that denotes a write operation to ## the directory structure FWriteDir* = object of FWriteIO ## effect that denotes a write operation to @@ -179,7 +179,7 @@ proc OSErrorMsg*(): string {.rtl, extern: "nos$1", deprecated.} = ## Returns "" if no error occured. ## ## **Deprecated since version 0.9.4**: use the other ``OSErrorMsg`` proc. - + result = "" when defined(Windows): var err = GetLastError() @@ -276,7 +276,7 @@ proc OSLastError*(): TOSErrorCode = ## On Windows some OS calls can reset the error code to ``0`` causing this ## procedure to return ``0``. It is therefore advised to call this procedure ## immediately after an OS call fails. On POSIX systems this is not a problem. - + when defined(windows): result = TOSErrorCode(GetLastError()) else: @@ -355,8 +355,8 @@ when defined(windows): result = f.cFilename[0] == '.' template getFilename(f: expr): expr = $f.cFilename - -proc existsFile*(filename: string): bool {.rtl, extern: "nos$1", + +proc existsFile*(filename: string): bool {.rtl, extern: "nos$1", tags: [FReadDir].} = ## Returns true if the file exists, false otherwise. when defined(windows): @@ -410,7 +410,7 @@ proc getLastAccessTime*(file: string): TTime {.rtl, extern: "nos$1".} = result = winTimeToUnixTime(rdFileTime(f.ftLastAccessTime)) findclose(h) -proc getCreationTime*(file: string): TTime {.rtl, extern: "nos$1".} = +proc getCreationTime*(file: string): TTime {.rtl, extern: "nos$1".} = ## Returns the `file`'s creation time. when defined(posix): var res: TStat @@ -524,7 +524,7 @@ proc SplitPath*(path: string): tuple[head, tail: string] {. ## Splits a directory into (head, tail), so that ## ``JoinPath(head, tail) == path``. ## - ## Examples: + ## Examples: ## ## .. code-block:: nimrod ## SplitPath("usr/local/bin") -> ("usr/local", "bin") @@ -567,7 +567,7 @@ proc parentDir*(path: string): string {. proc isRootDir*(path: string): bool {. noSideEffect, rtl, extern: "nos$1".} = - ## Checks whether a given `path` is a root directory + ## Checks whether a given `path` is a root directory result = parentDirPos(path) < 0 iterator parentDirs*(path: string, fromRoot=false, inclusive=true): string = @@ -589,7 +589,7 @@ iterator parentDirs*(path: string, fromRoot=false, inclusive=true): string = else: for i in countup(0, path.len - 2): # ignore the last / # deal with non-normalized paths such as /foo//bar//baz - if path[i] in {dirsep, altsep} and + if path[i] in {dirsep, altsep} and (i == 0 or path[i-1] notin {dirsep, altsep}): yield path.substr(0, i) @@ -642,7 +642,7 @@ proc splitFile*(path: string): tuple[dir, name, ext: string] {. var dotPos = path.len for i in countdown(len(path)-1, 0): if path[i] == ExtSep: - if dotPos == path.len and i > 0 and + if dotPos == path.len and i > 0 and path[i-1] notin {dirsep, altsep}: dotPos = i elif path[i] in {dirsep, altsep}: sepPos = i @@ -653,7 +653,7 @@ proc splitFile*(path: string): tuple[dir, name, ext: string] {. proc extractFilename*(path: string): string {. noSideEffect, rtl, extern: "nos$1".} = - ## Extracts the filename of a given `path`. This is the same as + ## Extracts the filename of a given `path`. This is the same as ## ``name & ext`` from ``splitFile(path)``. if path.len == 0 or path[path.len-1] in {dirSep, altSep}: result = "" @@ -669,7 +669,7 @@ proc expandFilename*(filename: string): string {.rtl, extern: "nos$1", var unused: widecstring var res = newWideCString("", bufsize div 2) var L = GetFullPathNameW(newWideCString(filename), bufsize, res, unused) - if L <= 0'i32 or L >= bufsize: + if L <= 0'i32 or L >= bufsize: OSError(OSLastError()) result = res$L else: @@ -684,7 +684,7 @@ proc expandFilename*(filename: string): string {.rtl, extern: "nos$1", var r = realpath(filename, result) if r.isNil: OSError(OSLastError()) setlen(result, c_strlen(result)) - + proc ChangeFileExt*(filename, ext: string): string {. noSideEffect, rtl, extern: "nos$1".} = ## Changes the file extension to `ext`. @@ -740,12 +740,12 @@ proc isAbsolute*(path: string): bool {.rtl, noSideEffect, extern: "nos$1".} = elif defined(posix): result = path[0] == '/' -proc sameFile*(path1, path2: string): bool {.rtl, extern: "nos$1", +proc sameFile*(path1, path2: string): bool {.rtl, extern: "nos$1", tags: [FReadDir].} = - ## Returns True if both pathname arguments refer to the same physical + ## Returns True if both pathname arguments refer to the same physical ## file or directory. Raises an exception if any of the files does not ## exist or information about it can not be obtained. - ## + ## ## This proc will return true if given two alternative hard-linked or ## sym-linked paths to the same file or directory. when defined(Windows): @@ -761,7 +761,7 @@ proc sameFile*(path1, path2: string): bool {.rtl, extern: "nos$1", var f1 = OpenHandle(p1) var f2 = OpenHandle(p2) - + else: template OpenHandle(path: expr): expr = CreateFileA(path, 0'i32, FILE_SHARE_DELETE or FILE_SHARE_READ or @@ -829,7 +829,7 @@ proc sameFileContent*(path1, path2: string): bool {.rtl, extern: "nos$1", close(a) close(b) -proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", +proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", tags: [FReadIO, FWriteIO].} = ## Copies a file from `source` to `dest`. ## @@ -870,7 +870,7 @@ proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", close(s) close(d) -proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", +proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", tags: [FReadIO, FWriteIO].} = ## Moves a file from `source` to `dest`. If this fails, `EOS` is raised. if crename(source, dest) != 0'i32: @@ -885,7 +885,7 @@ proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = if cremove(file) != 0'i32 and errno != ENOENT: raise newException(EOS, $strerror(errno)) -proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", +proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", tags: [FExecIO].} = ## Executes a `shell command`:idx:. ## @@ -897,7 +897,7 @@ proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", ## module. result = csystem(command) -# Environment handling cannot be put into RTL, because the ``envPairs`` +# Environment handling cannot be put into RTL, because the ``envPairs`` # iterator depends on ``environment``. var @@ -943,11 +943,11 @@ when defined(windows): else: const - useNSGetEnviron = defined(macosx) and + useNSGetEnviron = defined(macosx) and (defined(createNimRtl) or defined(useNimRtl)) when useNSGetEnviron: # From the manual: - # Shared libraries and bundles don't have direct access to environ, + # Shared libraries and bundles don't have direct access to environ, # which is only available to the loader ld(1) when a complete program # is being linked. # The environment routines can still be used, but if direct access to @@ -1025,13 +1025,13 @@ proc putEnv*(key, val: string) {.tags: [FWriteEnv].} = if SetEnvironmentVariableA(key, val) == 0'i32: OSError(OSLastError()) iterator envPairs*(): tuple[key, value: TaintedString] {.tags: [FReadEnv].} = - ## Iterate over all `environments variables`:idx:. In the first component + ## Iterate over all `environments variables`:idx:. 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 = find(environment[i], '=') - yield (TaintedString(substr(environment[i], 0, p-1)), + yield (TaintedString(substr(environment[i], 0, p-1)), TaintedString(substr(environment[i], p+1))) iterator walkFiles*(pattern: string): string {.tags: [FReadDir].} = @@ -1125,7 +1125,7 @@ iterator walkDir*(dir: string): tuple[kind: TPathComponent, path: string] {. iterator walkDirRec*(dir: string, filter={pcFile, pcDir}): string {. tags: [FReadDir].} = - ## walks over the directory `dir` and yields for each file in `dir`. The + ## walks over the directory `dir` and yields for each file in `dir`. The ## full path for each file is returned. ## Walking is recursive. `filter` controls the behaviour of the iterator: ## @@ -1137,7 +1137,7 @@ iterator walkDirRec*(dir: string, filter={pcFile, pcDir}): string {. ## ``pcDir`` follow real directories ## ``pcLinkToDir`` follow symbolic links to directories ## --------------------- --------------------------------------------- - ## + ## var stack = @[dir] while stack.len > 0: for k,p in walkDir(stack.pop()): @@ -1146,14 +1146,14 @@ iterator walkDirRec*(dir: string, filter={pcFile, pcDir}): string {. of pcFile, pcLinkToFile: yield p of pcDir, pcLinkToDir: stack.add(p) -proc rawRemoveDir(dir: string) = +proc rawRemoveDir(dir: string) = when defined(windows): when useWinUnicode: wrapUnary(res, RemoveDirectoryW, dir) else: var res = RemoveDirectoryA(dir) let lastError = OSLastError() - if res == 0'i32 and lastError.int32 != 3'i32 and + if res == 0'i32 and lastError.int32 != 3'i32 and lastError.int32 != 18'i32 and lastError.int32 != 2'i32: OSError(lastError) else: @@ -1166,7 +1166,7 @@ proc removeDir*(dir: string) {.rtl, extern: "nos$1", tags: [ ## ## If this fails, `EOS` is raised. This does not fail if the directory never ## existed in the first place. - for kind, path in walkDir(dir): + for kind, path in walkDir(dir): case kind of pcFile, pcLinkToFile, pcLinkToDir: removeFile(path) of pcDir: removeDir(path) @@ -1192,7 +1192,7 @@ proc createDir*(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = ## ## 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 + ## fail if the path already exists because for most usages this does not ## indicate an error. var omitNext = false when defined(doslike): @@ -1205,7 +1205,7 @@ proc createDir*(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = rawCreateDir(substr(dir, 0, i-1)) rawCreateDir(dir) -proc copyDir*(source, dest: string) {.rtl, extern: "nos$1", +proc copyDir*(source, dest: string) {.rtl, extern: "nos$1", tags: [FWriteIO, FReadIO].} = ## Copies a directory from `source` to `dest`. If this fails, `EOS` is raised. createDir(dest) @@ -1220,7 +1220,7 @@ proc copyDir*(source, dest: string) {.rtl, extern: "nos$1", proc parseCmdLine*(c: string): seq[string] {. noSideEffect, rtl, extern: "nos$1".} = - ## Splits a command line into several components; + ## Splits a command line into several components; ## This proc is only occassionally useful, better use the `parseopt` module. ## ## On Windows, it uses the following parsing rules @@ -1247,7 +1247,7 @@ proc parseCmdLine*(c: string): seq[string] {. ## causing a literal double quotation mark (") to be placed in argv. ## ## On Posix systems, it uses the following parsing rules: - ## Components are separated by whitespace unless the whitespace + ## Components are separated by whitespace unless the whitespace ## occurs within ``"`` or ``'`` quotes. result = @[] var i = 0 @@ -1260,31 +1260,31 @@ proc parseCmdLine*(c: string): seq[string] {. if c[i] == '\0': break var inQuote = false while true: - case c[i] + case c[i] of '\0': break of '\\': var j = i while c[j] == '\\': inc(j) - if c[j] == '"': + if c[j] == '"': for k in 1..(j-i) div 2: a.add('\\') - if (j-i) mod 2 == 0: + if (j-i) mod 2 == 0: i = j - else: + else: a.add('"') i = j+1 - else: + else: a.add(c[i]) inc(i) of '"': inc(i) if not inQuote: inQuote = true - elif c[i] == '"': + elif c[i] == '"': a.add(c[i]) inc(i) else: inQuote = false break - of ' ', '\t': + of ' ', '\t': if not inQuote: break a.add(c[i]) inc(i) @@ -1346,11 +1346,11 @@ proc getFilePermissions*(filename: string): set[TFilePermission] {. var res = GetFileAttributesA(filename) if res == -1'i32: OSError(OSLastError()) if (res and FILE_ATTRIBUTE_READONLY) != 0'i32: - result = {fpUserExec, fpUserRead, fpGroupExec, fpGroupRead, + result = {fpUserExec, fpUserRead, fpGroupExec, fpGroupRead, fpOthersExec, fpOthersRead} else: result = {fpUserExec..fpOthersRead} - + proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. rtl, extern: "nos$1", tags: [FWriteDir].} = ## sets the file permissions for `filename`. `OSError` is raised in case of @@ -1361,15 +1361,15 @@ proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. if fpUserRead in permissions: p = p or S_IRUSR if fpUserWrite in permissions: p = p or S_IWUSR if fpUserExec in permissions: p = p or S_IXUSR - + if fpGroupRead in permissions: p = p or S_IRGRP if fpGroupWrite in permissions: p = p or S_IWGRP if fpGroupExec in permissions: p = p or S_IXGRP - + if fpOthersRead in permissions: p = p or S_IROTH if fpOthersWrite in permissions: p = p or S_IWOTH if fpOthersExec in permissions: p = p or S_IXOTH - + if chmod(filename, p) != 0: OSError(OSLastError()) else: when useWinUnicode: @@ -1377,7 +1377,7 @@ proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. else: var res = GetFileAttributesA(filename) if res == -1'i32: OSError(OSLastError()) - if fpUserWrite in permissions: + if fpUserWrite in permissions: res = res and not FILE_ATTRIBUTE_READONLY else: res = res or FILE_ATTRIBUTE_READONLY @@ -1386,7 +1386,7 @@ proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. else: var res2 = SetFileAttributesA(filename, res) if res2 == - 1'i32: OSError(OSLastError()) - + proc copyFileWithPermissions*(source, dest: string, ignorePermissionErrors = true) = ## Copies a file from `source` to `dest` preserving file permissions. @@ -1407,19 +1407,19 @@ proc copyFileWithPermissions*(source, dest: string, if not ignorePermissionErrors: raise -proc inclFilePermissions*(filename: string, +proc inclFilePermissions*(filename: string, permissions: set[TFilePermission]) {. rtl, extern: "nos$1", tags: [FReadDir, FWriteDir].} = - ## a convenience procedure for: + ## a convenience procedure for: ## ## .. code-block:: nimrod ## setFilePermissions(filename, getFilePermissions(filename)+permissions) setFilePermissions(filename, getFilePermissions(filename)+permissions) -proc exclFilePermissions*(filename: string, +proc exclFilePermissions*(filename: string, permissions: set[TFilePermission]) {. rtl, extern: "nos$1", tags: [FReadDir, FWriteDir].} = - ## a convenience procedure for: + ## a convenience procedure for: ## ## .. code-block:: nimrod ## setFilePermissions(filename, getFilePermissions(filename)-permissions) @@ -1459,7 +1459,7 @@ when defined(windows): if isNil(ownArgv): ownArgv = parseCmdLine($getCommandLine()) result = ownArgv.len-1 - proc paramStr*(i: int): TaintedString {.rtl, extern: "nos$1", + proc paramStr*(i: int): TaintedString {.rtl, extern: "nos$1", tags: [FReadIO].} = ## Returns the `i`-th `command line argument`:idx: given to the ## application. @@ -1494,7 +1494,7 @@ when defined(macosx): type cuint32* {.importc: "unsigned int", nodecl.} = int ## This is the same as the type ``uint32_t`` in *C*. - + # a really hacky solution: since we like to include 2 headers we have to # define two procs which in reality are the same proc getExecPath1(c: cstring, size: var cuint32) {. @@ -1553,13 +1553,13 @@ proc getAppFilename*(): string {.rtl, extern: "nos$1", tags: [FReadIO].} = proc getApplicationFilename*(): string {.rtl, extern: "nos$1", deprecated.} = ## Returns the filename of the application's executable. - ## **Deprecated since version 0.8.12**: use ``getAppFilename`` + ## **Deprecated since version 0.8.12**: use ``getAppFilename`` ## instead. result = getAppFilename() proc getApplicationDir*(): string {.rtl, extern: "nos$1", deprecated.} = ## Returns the directory of the application's executable. - ## **Deprecated since version 0.8.12**: use ``getAppDir`` + ## **Deprecated since version 0.8.12**: use ``getAppDir`` ## instead. result = splitFile(getAppFilename()).dir @@ -1580,7 +1580,7 @@ proc sleep*(milsecs: int) {.rtl, extern: "nos$1", tags: [FTime].} = proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1", tags: [FReadIO].} = - ## returns the file size of `file`. Can raise ``EOS``. + ## returns the file size of `file`. Can raise ``EOS``. when defined(windows): var a: TWin32FindData var resA = findfirstFile(file, a) @@ -1589,20 +1589,20 @@ proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1", findclose(resA) else: var f: TFile - if open(f, file): + if open(f, file): result = getFileSize(f) close(f) else: OSError(OSLastError()) -proc findExe*(exe: string): string {.tags: [FReadDir, FReadEnv].} = +proc findExe*(exe: string): string {.tags: [FReadDir, FReadEnv].} = ## Searches for `exe` in the current working directory and then - ## in directories listed in the ``PATH`` environment variable. - ## Returns "" if the `exe` cannot be found. On DOS-like platforms, `exe` + ## in directories listed in the ``PATH`` environment variable. + ## Returns "" if the `exe` cannot be found. On DOS-like platforms, `exe` ## is added an ``.exe`` file extension if it has no extension. result = addFileExt(exe, os.exeExt) if ExistsFile(result): return var path = string(os.getEnv("PATH")) - for candidate in split(path, pathSep): + for candidate in split(path, pathSep): var x = candidate / result if ExistsFile(x): return x result = "" @@ -1629,4 +1629,3 @@ proc expandTilde*(path: string): string = result = path {.pop.} - From 8468e2af3a841cbb0c6e791cd0cd0bf50a4715df Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Mon, 9 Dec 2013 18:28:11 +0100 Subject: [PATCH 080/326] Revert "removed windows". Refs #698. This reverts commit 5ab3d661440f42f0dc74970ec73a051dd2e2bfb5. --- examples/wingui.nim | 9 + lib/windows/mmsystem.nim | 2655 ++++ lib/windows/nb30.nim | 232 + lib/windows/ole2.nim | 208 + lib/windows/psapi.nim | 202 + lib/windows/shellapi.nim | 863 ++ lib/windows/shfolder.nim | 93 + lib/windows/windows.nim | 23945 +++++++++++++++++++++++++++++++++++++ 8 files changed, 28207 insertions(+) create mode 100644 examples/wingui.nim create mode 100644 lib/windows/mmsystem.nim create mode 100644 lib/windows/nb30.nim create mode 100644 lib/windows/ole2.nim create mode 100644 lib/windows/psapi.nim create mode 100644 lib/windows/shellapi.nim create mode 100644 lib/windows/shfolder.nim create mode 100644 lib/windows/windows.nim diff --git a/examples/wingui.nim b/examples/wingui.nim new file mode 100644 index 0000000000..2c2c387bbe --- /dev/null +++ b/examples/wingui.nim @@ -0,0 +1,9 @@ +# test a Windows GUI application + +import + windows, shellapi, nb30, mmsystem, shfolder + +#proc MessageBox(hWnd: int, lpText, lpCaption: CString, uType: uint): int +# {stdcall, import: "MessageBox", header: ""} + +discard MessageBox(0, "Hello World!", "Nimrod GUI Application", 0) diff --git a/lib/windows/mmsystem.nim b/lib/windows/mmsystem.nim new file mode 100644 index 0000000000..91279a5ef3 --- /dev/null +++ b/lib/windows/mmsystem.nim @@ -0,0 +1,2655 @@ +# +# +# 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 +#******************************* + +{.deadCodeElim: on.} + +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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] + dwFormats*: DWORD + wChannels*: int16 + wReserved1*: int16 + dwSupport*: DWORD + + PWAVEOUTCAPSW* = ptr WAVEOUTCAPSW + NPWAVEOUTCAPSW* = ptr WAVEOUTCAPSW + LPWAVEOUTCAPSW* = ptr WAVEOUTCAPSW + TWAVEOUTCAPSW* = WAVEOUTCAPSW + +when defined(UNICODE): + type + WAVEOUTCAPS* = WAVEOUTCAPSW + PWAVEOUTCAPS* = PWAVEOUTCAPSW + NPWAVEOUTCAPS* = NPWAVEOUTCAPSW + LPWAVEOUTCAPS* = LPWAVEOUTCAPSW +else: + type + WAVEOUTCAPS* = WAVEOUTCAPSA + PWAVEOUTCAPS* = PWAVEOUTCAPSA + NPWAVEOUTCAPS* = NPWAVEOUTCAPSA + LPWAVEOUTCAPS* = LPWAVEOUTCAPSA +type + TWAVEOUTCAPS* = WAVEOUTCAPS + WAVEINCAPSA* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), CHAR] + dwFormats*: DWORD + wChannels*: int16 + wReserved1*: int16 + + PWAVEINCAPSA* = ptr WAVEINCAPSA + NPWAVEINCAPSA* = ptr WAVEINCAPSA + LPWAVEINCAPSA* = ptr WAVEINCAPSA + TWAVEINCAPSA* = WAVEINCAPSA + WAVEINCAPSW* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] + dwFormats*: DWORD + wChannels*: int16 + wReserved1*: int16 + + PWAVEINCAPSW* = ptr WAVEINCAPSW + NPWAVEINCAPSW* = ptr WAVEINCAPSW + LPWAVEINCAPSW* = ptr WAVEINCAPSW + TWAVEINCAPSW* = WAVEINCAPSW + +when defined(UNICODE): + type + WAVEINCAPS* = WAVEINCAPSW + PWAVEINCAPS* = PWAVEINCAPSW + NPWAVEINCAPS* = NPWAVEINCAPSW + LPWAVEINCAPS* = LPWAVEINCAPSW +else: + type + WAVEINCAPS* = WAVEINCAPSA + PWAVEINCAPS* = PWAVEINCAPSA + NPWAVEINCAPS* = NPWAVEINCAPSA + LPWAVEINCAPS* = LPWAVEINCAPSA +type + TWAVEINCAPS* = WAVEINCAPS + waveformat* {.final.} = object + wFormatTag*: int16 + nChannels*: int16 + nSamplesPerSec*: DWORD + nAvgBytesPerSec*: DWORD + nBlockAlign*: int16 + + PWAVEFORMAT* = ptr waveformat + NPWAVEFORMAT* = ptr waveformat + LPWAVEFORMAT* = ptr waveformat + TWAVEFORMAT* = waveformat + +const + WAVE_FORMAT_PCM* = 1 + +type + pcmwaveformat* {.final.} = object + wf*: WAVEFORMAT + wBitsPerSample*: int16 + + PPCMWAVEFORMAT* = ptr pcmwaveformat + NPPCMWAVEFORMAT* = ptr pcmwaveformat + LPPCMWAVEFORMAT* = ptr pcmwaveformat + TPCMWAVEFORMAT* = PCMWAVEFORMAT + WAVEFORMATEX* {.final.} = object + wFormatTag*: int16 + nChannels*: int16 + nSamplesPerSec*: DWORD + nAvgBytesPerSec*: DWORD + nBlockAlign*: int16 + wBitsPerSample*: int16 + cbSize*: int16 + + PWAVEFORMATEX* = ptr WAVEFORMATEX + NPWAVEFORMATEX* = ptr WAVEFORMATEX + LPWAVEFORMATEX* = ptr WAVEFORMATEX + LPCWAVEFORMATEX* = ptr WAVEFORMATEX + TWAVEFORMATEX* = WAVEFORMATEX + HMIDI* = 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* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), CHAR] + wTechnology*: int16 + wVoices*: int16 + wNotes*: int16 + wChannelMask*: int16 + dwSupport*: DWORD + + PMIDIOUTCAPSA* = ptr MIDIOUTCAPSA + NPMIDIOUTCAPSA* = ptr MIDIOUTCAPSA + LPMIDIOUTCAPSA* = ptr MIDIOUTCAPSA + TMIDIOUTCAPSA* = MIDIOUTCAPSA + MIDIOUTCAPSW* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] + wTechnology*: int16 + wVoices*: int16 + wNotes*: int16 + wChannelMask*: int16 + dwSupport*: DWORD + + PMIDIOUTCAPSW* = ptr MIDIOUTCAPSW + NPMIDIOUTCAPSW* = ptr MIDIOUTCAPSW + LPMIDIOUTCAPSW* = ptr MIDIOUTCAPSW + TMIDIOUTCAPSW* = MIDIOUTCAPSW + MIDIINCAPSA* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), CHAR] + dwSupport*: DWORD + + PMIDIINCAPSA* = ptr MIDIINCAPSA + NPMIDIINCAPSA* = ptr MIDIINCAPSA + LPMIDIINCAPSA* = ptr MIDIINCAPSA + TMIDIINCAPSA* = MIDIINCAPSA + MIDIINCAPSW* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] + dwSupport*: DWORD + + PMIDIINCAPSW* = ptr MIDIINCAPSW + NPMIDIINCAPSW* = ptr MIDIINCAPSW + LPMIDIINCAPSW* = ptr MIDIINCAPSW + TMIDIINCAPSW* = MIDIINCAPSW + +when defined(UNICODE): + type + MIDIINCAPS* = MIDIINCAPSW + PMIDIINCAPS* = PMIDIINCAPSW + NPMIDIINCAPS* = NPMIDIINCAPSW + LPMIDIINCAPS* = LPMIDIINCAPSW + MIDIOUTCAPS* = MIDIOUTCAPSW + PMIDIOUTCAPS* = PMIDIOUTCAPSW + NPMIDIOUTCAPS* = NPMIDIOUTCAPSW + LPMIDIOUTCAPS* = LPMIDIOUTCAPSW +else: + type + MIDIOUTCAPS* = MIDIOUTCAPSA + PMIDIOUTCAPS* = PMIDIOUTCAPSA + NPMIDIOUTCAPS* = NPMIDIOUTCAPSA + LPMIDIOUTCAPS* = LPMIDIOUTCAPSA + MIDIINCAPS* = MIDIINCAPSA + PMIDIINCAPS* = PMIDIINCAPSA + NPMIDIINCAPS* = NPMIDIINCAPSA + LPMIDIINCAPS* = LPMIDIINCAPSA +type + TMIDIINCAPS* = MIDIINCAPS + PMIDIHDR* = ptr midihdr + midihdr* {.final.} = object + lpData*: cstring + dwBufferLength*: DWORD + dwBytesRecorded*: DWORD + dwUser*: DWORD + dwFlags*: DWORD + lpNext*: PMIDIHDR + reserved*: DWORD + dwOffset*: DWORD + dwReserved*: array[0..Pred(8), DWORD] + + NPMIDIHDR* = ptr midihdr + LPMIDIHDR* = ptr midihdr + TMIDIHDR* = MIDIHDR + midievent* {.final.} = object + dwDeltaTime*: DWORD + dwStreamID*: DWORD + dwEvent*: DWORD + dwParms*: array[0..Pred(1), DWORD] + + TMIDIEVENT* = MIDIEVENT + midistrmbuffver* {.final.} = object + dwVersion*: DWORD + dwMid*: DWORD + dwOEMVersion*: DWORD + + TMIDISTRMBUFFVER* = MIDISTRMBUFFVER + Tmidiproptimediv* {.final.} = object + cbStruct*: DWORD + dwTimeDiv*: DWORD + + LPMIDIPROPTIMEDIV* = ptr Tmidiproptimediv + Tmidiproptempo* {.final.} = object + cbStruct*: DWORD + dwTempo*: DWORD + + LPMIDIPROPTEMPO* = ptr Tmidiproptempo + AUXCAPSA* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), CHAR] + wTechnology*: int16 + wReserved1*: int16 + dwSupport*: DWORD + + PAUXCAPSA* = ptr AUXCAPSA + NPAUXCAPSA* = ptr AUXCAPSA + LPAUXCAPSA* = ptr AUXCAPSA + TAUXCAPSA* = AUXCAPSA + AUXCAPSW* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] + wTechnology*: int16 + wReserved1*: int16 + dwSupport*: DWORD + + PAUXCAPSW* = ptr AUXCAPSW + NPAUXCAPSW* = ptr AUXCAPSW + LPAUXCAPSW* = ptr AUXCAPSW + TAUXCAPSW* = AUXCAPSW + +when defined(UNICODE): + type + AUXCAPS* = AUXCAPSW + PAUXCAPS* = PAUXCAPSW + NPAUXCAPS* = NPAUXCAPSW + LPAUXCAPS* = LPAUXCAPSW +else: + type + AUXCAPS* = AUXCAPSA + PAUXCAPS* = PAUXCAPSA + NPAUXCAPS* = NPAUXCAPSA + LPAUXCAPS* = LPAUXCAPSA +type + TAUXCAPS* = AUXCAPS + HMIXEROBJ* = THandle + LPHMIXEROBJ* = ptr HMIXEROBJ + HMIXER* = THandle + LPHMIXER* = ptr HMIXER + +proc mixerGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll", + importc: "mixerGetNumDevs".} +type + MIXERCAPSA* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), CHAR] + fdwSupport*: DWORD + cDestinations*: DWORD + + PMIXERCAPSA* = ptr MIXERCAPSA + LPMIXERCAPSA* = ptr MIXERCAPSA + TMIXERCAPSA* = MIXERCAPSA + MIXERCAPSW* {.final.} = object + wMid*: int16 + wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..Pred(MAXPNAMELEN), WCHAR] + fdwSupport*: DWORD + cDestinations*: DWORD + + PMIXERCAPSW* = ptr MIXERCAPSW + LPMIXERCAPSW* = ptr MIXERCAPSW + TMIXERCAPSW* = MIXERCAPSW + +when defined(UNICODE): + type + MIXERCAPS* = MIXERCAPSW + PMIXERCAPS* = PMIXERCAPSW + LPMIXERCAPS* = LPMIXERCAPSW +else: + type + MIXERCAPS* = MIXERCAPSA + PMIXERCAPS* = PMIXERCAPSA + LPMIXERCAPS* = LPMIXERCAPSA +type + TMIXERCAPS* = MIXERCAPS + MIXERLINEA* {.final.} = object + cbStruct*: DWORD + dwDestination*: DWORD + dwSource*: DWORD + dwLineID*: DWORD + fdwLine*: DWORD + dwUser*: DWORD + dwComponentType*: DWORD + cChannels*: DWORD + cConnections*: DWORD + cControls*: DWORD + szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR] + szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR] + dwType*, dwDeviceID*: DWORD + wMid*, wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..pred(MAXPNAMELEN), Char] + + PMIXERLINEA* = ptr MIXERLINEA + LPMIXERLINEA* = ptr MIXERLINEA + TMIXERLINEA* = MIXERLINEA + MIXERLINEW* {.final.} = object + cbStruct*: DWORD + dwDestination*: DWORD + dwSource*: DWORD + dwLineID*: DWORD + fdwLine*: DWORD + dwUser*: DWORD + dwComponentType*: DWORD + cChannels*: DWORD + cConnections*: DWORD + cControls*: DWORD + szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR] + szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR] + dwType*, dwDeviceID*: DWORD + wMid*, wPid*: int16 + vDriverVersion*: MMVERSION + szPname*: array[0..pred(MAXPNAMELEN), WChar] + + TMIXERLINEW* = MIXERLINEW + PMIXERLINEW* = ptr MIXERLINEW + LPMIXERLINEW* = ptr MIXERLINEW + +when defined(UNICODE): + type + MIXERLINE* = MIXERLINEW + PMIXERLINE* = PMIXERLINEW + LPMIXERLINE* = LPMIXERLINEW +else: + type + MIXERLINE* = MIXERLINEA + PMIXERLINE* = PMIXERLINEA + LPMIXERLINE* = LPMIXERLINEA +type + TMIXERLINE* = MIXERLINE + MIXERCONTROLA* {.final.} = object + cbStruct*: DWORD + dwControlID*: DWORD + dwControlType*: DWORD + fdwControl*: DWORD + cMultipleItems*: DWORD + szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR] + szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR] + dwMinimum*, dwMaximum*: DWORD + dwReserved*: array[0..3, DWORD] + cSteps*: DWORD + dwReserved2*: array[0..4, DWORD] + + PMIXERCONTROLA* = ptr MIXERCONTROLA + LPMIXERCONTROLA* = ptr MIXERCONTROLA + TMIXERCONTROLA* = MIXERCONTROLA + MIXERCONTROLW* {.final.} = object + cbStruct*: DWORD + dwControlID*: DWORD + dwControlType*: DWORD + fdwControl*: DWORD + cMultipleItems*: DWORD + szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR] + szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR] + dwMinimum*, dwMaximum*: DWORD + dwReserved*: array[0..3, DWORD] + cSteps*: DWORD + dwReserved2*: array[0..4, DWORD] + + PMIXERCONTROLW* = ptr MIXERCONTROLW + LPMIXERCONTROLW* = ptr MIXERCONTROLW + TMIXERCONTROLW* = MIXERCONTROLW + +when defined(UNICODE): + type + MIXERCONTROL* = MIXERCONTROLW + PMIXERCONTROL* = PMIXERCONTROLW + LPMIXERCONTROL* = LPMIXERCONTROLW +else: + type + MIXERCONTROL* = MIXERCONTROLA + PMIXERCONTROL* = PMIXERCONTROLA + LPMIXERCONTROL* = LPMIXERCONTROLA +type + TMIXERCONTROL* = MIXERCONTROL + MIXERLINECONTROLSA* {.final.} = object + cbStruct*: DWORD + dwLineID*: DWORD + dwControlType*, cControls*, cbmxctrl*: DWORD + pamxctrl*: PMIXERCONTROLA + + PMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA + LPMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA + TMIXERLINECONTROLSA* = MIXERLINECONTROLSA + MIXERLINECONTROLSW* {.final.} = object + cbStruct*: DWORD + dwLineID*: DWORD + dwControlType*, cControls*, cbmxctrl*: DWORD + pamxctrl*: PMIXERCONTROLW + + PMIXERLINECONTROLSW* = ptr MIXERLINECONTROLSW + LPMIXERLINECONTROLSW* = ptr MIXERLINECONTROLSW + TMIXERLINECONTROLSW* = MIXERLINECONTROLSW + +when defined(UNICODE): + type + MIXERLINECONTROLS* = MIXERLINECONTROLSW + PMIXERLINECONTROLS* = PMIXERLINECONTROLSW + LPMIXERLINECONTROLS* = LPMIXERLINECONTROLSW +else: + type + MIXERLINECONTROLS* = MIXERLINECONTROLSA + PMIXERLINECONTROLS* = PMIXERLINECONTROLSA + LPMIXERLINECONTROLS* = LPMIXERLINECONTROLSA +type + TMIXERLINECONTROLS* = MIXERLINECONTROLS + TMIXERCONTROLDETAILS* {.final.} = object + cbStruct*: DWORD + dwControlID*: DWORD + cChannels*: DWORD + cMultipleItems*, cbDetails*: DWORD + paDetails*: Pointer + + MIXERCONTROLDETAILS* = tMIXERCONTROLDETAILS + PMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS + LPMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS + MIXERCONTROLDETAILS_LISTTEXTA* {.final.} = object + dwParam1*: DWORD + dwParam2*: DWORD + szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR] + + PMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA + LPMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA + TMIXERCONTROLDETAILS_LISTTEXTA* = MIXERCONTROLDETAILS_LISTTEXTA + MIXERCONTROLDETAILS_LISTTEXTW* {.final.} = object + dwParam1*: DWORD + dwParam2*: DWORD + szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR] + + PMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW + LPMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW + TMIXERCONTROLDETAILS_LISTTEXTW* = MIXERCONTROLDETAILS_LISTTEXTW + +when defined(UNICODE): + type + MIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXTW + PMIXERCONTROLDETAILS_LISTTEXT* = PMIXERCONTROLDETAILS_LISTTEXTW + LPMIXERCONTROLDETAILS_LISTTEXT* = LPMIXERCONTROLDETAILS_LISTTEXTW +else: + type + MIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXTA + PMIXERCONTROLDETAILS_LISTTEXT* = PMIXERCONTROLDETAILS_LISTTEXTA + LPMIXERCONTROLDETAILS_LISTTEXT* = LPMIXERCONTROLDETAILS_LISTTEXTA +type + TMIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXT + MIXERCONTROLDETAILS_BOOLEAN* {.final.} = object + fValue*: int32 + + PMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN + LPMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN + TMIXERCONTROLDETAILS_BOOLEAN* = MIXERCONTROLDETAILS_BOOLEAN + MIXERCONTROLDETAILS_SIGNED* {.final.} = object + lValue*: int32 + + PMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED + LPMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED + TMIXERCONTROLDETAILS_SIGNED* = MIXERCONTROLDETAILS_SIGNED + MIXERCONTROLDETAILS_UNSIGNED* {.final.} = object + dwValue*: DWORD + + PMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED + LPMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED + TMIXERCONTROLDETAILS_UNSIGNED* = MIXERCONTROLDETAILS_UNSIGNED + LPTIMECALLBACK* = proc (uTimerID, uMsg: UINT, dwUser, dw1, dw2: DWORD){. + stdcall.} + TTIMECALLBACK* = LPTIMECALLBACK + timecaps* {.final.} = object + wPeriodMin*: UINT + wPeriodMax*: UINT + + PTIMECAPS* = ptr timecaps + NPTIMECAPS* = ptr timecaps + LPTIMECAPS* = ptr timecaps + TTIMECAS* = TIMECAPS + JOYCAPSA* {.final.} = object + wMid*: int16 + wPid*: int16 + szPname*: array[0..Pred(MAXPNAMELEN), CHAR] + wXmin*: 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* {.final.} = object + 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* {.final.} = object + wXpos*: UINT + wYpos*: UINT + wZpos*: UINT + wButtons*: UINT + + PJOYINFO* = ptr joyinfo + NPJOYINFO* = ptr joyinfo + LPJOYINFO* = ptr joyinfo + TJOYINFO* = JOYINFO + joyinfoex* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + ckid*: FOURCC + cksize*: DWORD + fccType*: FOURCC + dwDataOffset*: DWORD + dwFlags*: DWORD + + PMMCKINFO* = ptr MMCKINFO + NPMMCKINFO* = ptr MMCKINFO + LPMMCKINFO* = ptr MMCKINFO + LPCMMCKINFO* = ptr MMCKINFO + TMMCKINFO* = MMCKINFO + MCIERROR* = DWORD + MCIDEVICEID* = UINT + YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): UINT{.stdcall.} + TYIELDPROC* = YIELDPROC + MCI_GENERIC_PARMS* {.final.} = object + dwCallback*: DWORD + + PMCI_GENERIC_PARMS* = ptr MCI_GENERIC_PARMS + LPMCI_GENERIC_PARMS* = ptr MCI_GENERIC_PARMS + TMCI_GENERIC_PARMS* = MCI_GENERIC_PARMS + MCI_OPEN_PARMSA* {.final.} = object + dwCallback*: DWORD + wDeviceID*: MCIDEVICEID + lpstrDeviceType*: LPCSTR + lpstrElementName*: LPCSTR + lpstrAlias*: LPCSTR + + PMCI_OPEN_PARMSA* = ptr MCI_OPEN_PARMSA + LPMCI_OPEN_PARMSA* = ptr MCI_OPEN_PARMSA + TMCI_OPEN_PARMSA* = MCI_OPEN_PARMSA + MCI_OPEN_PARMSW* {.final.} = object + dwCallback*: DWORD + wDeviceID*: MCIDEVICEID + lpstrDeviceType*: LPCWSTR + lpstrElementName*: LPCWSTR + lpstrAlias*: LPCWSTR + + PMCI_OPEN_PARMSW* = ptr MCI_OPEN_PARMSW + LPMCI_OPEN_PARMSW* = ptr MCI_OPEN_PARMSW + TMCI_OPEN_PARMSW* = MCI_OPEN_PARMSW + +when defined(UNICODE): + type + MCI_OPEN_PARMS* = MCI_OPEN_PARMSW + PMCI_OPEN_PARMS* = PMCI_OPEN_PARMSW + LPMCI_OPEN_PARMS* = LPMCI_OPEN_PARMSW +else: + type + MCI_OPEN_PARMS* = MCI_OPEN_PARMSA + PMCI_OPEN_PARMS* = PMCI_OPEN_PARMSA + LPMCI_OPEN_PARMS* = LPMCI_OPEN_PARMSA +type + TMCI_OPEN_PARMS* = MCI_OPEN_PARMS + MCI_PLAY_PARMS* {.final.} = object + dwCallback*: DWORD + dwFrom*: DWORD + dwTo*: DWORD + + PMCI_PLAY_PARMS* = ptr MCI_PLAY_PARMS + LPMCI_PLAY_PARMS* = ptr MCI_PLAY_PARMS + TMCI_PLAY_PARMS* = MCI_PLAY_PARMS + MCI_SEEK_PARMS* {.final.} = object + dwCallback*: DWORD + dwTo*: DWORD + + PMCI_SEEK_PARMS* = ptr MCI_SEEK_PARMS + LPMCI_SEEK_PARMS* = ptr MCI_SEEK_PARMS + TMCI_SEEK_PARMS* = MCI_SEEK_PARMS + MCI_STATUS_PARMS* {.final.} = object + dwCallback*: DWORD + dwReturn*: DWORD + dwItem*: DWORD + dwTrack*: DWORD + + PMCI_STATUS_PARMS* = ptr MCI_STATUS_PARMS + LPMCI_STATUS_PARMS* = ptr MCI_STATUS_PARMS + TMCI_STATUS_PARMS* = MCI_STATUS_PARMS + MCI_INFO_PARMSA* {.final.} = object + dwCallback*: DWORD + lpstrReturn*: cstring + dwRetSize*: DWORD + + LPMCI_INFO_PARMSA* = ptr MCI_INFO_PARMSA + TMCI_INFO_PARMSA* = MCI_INFO_PARMSA + MCI_INFO_PARMSW* {.final.} = object + dwCallback*: DWORD + lpstrReturn*: LPWSTR + dwRetSize*: DWORD + + LPMCI_INFO_PARMSW* = ptr MCI_INFO_PARMSW + TMCI_INFO_PARMSW* = MCI_INFO_PARMSW + +when defined(UNICODE): + type + MCI_INFO_PARMS* = MCI_INFO_PARMSW + LPMCI_INFO_PARMS* = LPMCI_INFO_PARMSW +else: + type + MCI_INFO_PARMS* = MCI_INFO_PARMSA + LPMCI_INFO_PARMS* = LPMCI_INFO_PARMSA +type + TMCI_INFO_PARMS* = MCI_INFO_PARMS + MCI_GETDEVCAPS_PARMS* {.final.} = object + dwCallback*: DWORD + dwReturn*: DWORD + dwItem*: DWORD + + PMCI_GETDEVCAPS_PARMS* = ptr MCI_GETDEVCAPS_PARMS + LPMCI_GETDEVCAPS_PARMS* = ptr MCI_GETDEVCAPS_PARMS + TMCI_GETDEVCAPS_PARMS* = MCI_GETDEVCAPS_PARMS + MCI_SYSINFO_PARMSA* {.final.} = object + dwCallback*: DWORD + lpstrReturn*: cstring + dwRetSize*: DWORD + dwNumber*: DWORD + wDeviceType*: UINT + + PMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA + LPMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA + TMCI_SYSINFO_PARMSA* = MCI_SYSINFO_PARMSA + MCI_SYSINFO_PARMSW* {.final.} = object + dwCallback*: DWORD + lpstrReturn*: LPWSTR + dwRetSize*: DWORD + dwNumber*: DWORD + wDeviceType*: 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* {.final.} = object + dwCallback*: DWORD + dwTimeFormat*: DWORD + dwAudio*: DWORD + + PMCI_SET_PARMS* = ptr MCI_SET_PARMS + LPMCI_SET_PARMS* = ptr MCI_SET_PARMS + TMCI_SET_PARMS* = MCI_SET_PARMS + MCI_BREAK_PARMS* {.final.} = object + dwCallback*: DWORD + nVirtKey*: int32 + hwndBreak*: HWND + + PMCI_BREAK_PARMS* = ptr MCI_BREAK_PARMS + LPMCI_BREAK_PARMS* = ptr MCI_BREAK_PARMS + TMCI_BREAK_PARMS* = MCI_BREAK_PARMS + MCI_SAVE_PARMSA* {.final.} = object + dwCallback*: DWORD + lpfilename*: LPCSTR + + PMCI_SAVE_PARMSA* = ptr MCI_SAVE_PARMSA + LPMCI_SAVE_PARMSA* = ptr MCI_SAVE_PARMSA + TMCI_SAVE_PARMSA* = MCI_SAVE_PARMSA + MCI_SAVE_PARMSW* {.final.} = object + dwCallback*: DWORD + lpfilename*: LPCWSTR + + PMCI_SAVE_PARMSW* = ptr MCI_SAVE_PARMSW + LPMCI_SAVE_PARMSW* = ptr MCI_SAVE_PARMSW + TMCI_SAVE_PARMSW* = MCI_SAVE_PARMSW + +when defined(UNICODE): + type + MCI_SAVE_PARMS* = MCI_SAVE_PARMSW + PMCI_SAVE_PARMS* = PMCI_SAVE_PARMSW + LPMCI_SAVE_PARMS* = LPMCI_SAVE_PARMSW +else: + type + MCI_SAVE_PARMS* = MCI_SAVE_PARMSA + PMCI_SAVE_PARMS* = PMCI_SAVE_PARMSA + LPMCI_SAVE_PARMS* = LPMCI_SAVE_PARMSA +type + TMCI_SAVE_PARMS* = MCI_SAVE_PARMS + MCI_LOAD_PARMSA* {.final.} = object + dwCallback*: DWORD + lpfilename*: LPCSTR + + PMCI_LOAD_PARMSA* = ptr MCI_LOAD_PARMSA + LPMCI_LOAD_PARMSA* = ptr MCI_LOAD_PARMSA + TMCI_LOAD_PARMSA* = MCI_LOAD_PARMSA + MCI_LOAD_PARMSW* {.final.} = object + dwCallback*: DWORD + lpfilename*: LPCWSTR + + PMCI_LOAD_PARMSW* = ptr MCI_LOAD_PARMSW + LPMCI_LOAD_PARMSW* = ptr MCI_LOAD_PARMSW + TMCI_LOAD_PARMSW* = MCI_LOAD_PARMSW + +when defined(UNICODE): + type + MCI_LOAD_PARMS* = MCI_LOAD_PARMSW + PMCI_LOAD_PARMS* = PMCI_LOAD_PARMSW + LPMCI_LOAD_PARMS* = LPMCI_LOAD_PARMSW +else: + type + MCI_LOAD_PARMS* = MCI_LOAD_PARMSA + PMCI_LOAD_PARMS* = PMCI_LOAD_PARMSA + LPMCI_LOAD_PARMS* = LPMCI_LOAD_PARMSA +type + TMCI_LOAD_PARMS* = MCI_LOAD_PARMS + MCI_RECORD_PARMS* {.final.} = object + dwCallback*: DWORD + dwFrom*: DWORD + dwTo*: DWORD + + LPMCI_RECORD_PARMS* = ptr MCI_RECORD_PARMS + TMCI_RECORD_PARMS* = MCI_RECORD_PARMS + MCI_VD_PLAY_PARMS* {.final.} = object + dwCallback*: DWORD + dwFrom*: DWORD + dwTo*: DWORD + dwSpeed*: DWORD + + PMCI_VD_PLAY_PARMS* = ptr MCI_VD_PLAY_PARMS + LPMCI_VD_PLAY_PARMS* = ptr MCI_VD_PLAY_PARMS + TMCI_VD_PLAY_PARMS* = MCI_VD_PLAY_PARMS + MCI_VD_STEP_PARMS* {.final.} = object + dwCallback*: DWORD + dwFrames*: DWORD + + PMCI_VD_STEP_PARMS* = ptr MCI_VD_STEP_PARMS + LPMCI_VD_STEP_PARMS* = ptr MCI_VD_STEP_PARMS + MCI_VD_ESCAPE_PARMSA* {.final.} = object + dwCallback*: DWORD + lpstrCommand*: LPCSTR + + PMCI_VD_ESCAPE_PARMSA* = ptr MCI_VD_ESCAPE_PARMSA + LPMCI_VD_ESCAPE_PARMSA* = ptr MCI_VD_ESCAPE_PARMSA + TMCI_VD_ESCAPE_PARMSA* = MCI_VD_ESCAPE_PARMSA + MCI_VD_ESCAPE_PARMSW* {.final.} = object + dwCallback*: DWORD + lpstrCommand*: LPCWSTR + + PMCI_VD_ESCAPE_PARMSW* = ptr MCI_VD_ESCAPE_PARMSW + LPMCI_VD_ESCAPE_PARMSW* = ptr MCI_VD_ESCAPE_PARMSW + TMCI_VD_ESCAPE_PARMSW* = MCI_VD_ESCAPE_PARMSW + +when defined(UNICODE): + type + MCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMSW + PMCI_VD_ESCAPE_PARMS* = PMCI_VD_ESCAPE_PARMSW + LPMCI_VD_ESCAPE_PARMS* = LPMCI_VD_ESCAPE_PARMSW +else: + type + MCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMSA + PMCI_VD_ESCAPE_PARMS* = PMCI_VD_ESCAPE_PARMSA + LPMCI_VD_ESCAPE_PARMS* = LPMCI_VD_ESCAPE_PARMSA +type + TMCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMS + MCI_WAVE_OPEN_PARMSA* {.final.} = object + dwCallback*: DWORD + wDeviceID*: MCIDEVICEID + lpstrDeviceType*: LPCSTR + lpstrElementName*: LPCSTR + lpstrAlias*: LPCSTR + dwBufferSeconds*: DWORD + + PMCI_WAVE_OPEN_PARMSA* = ptr MCI_WAVE_OPEN_PARMSA + LPMCI_WAVE_OPEN_PARMSA* = ptr MCI_WAVE_OPEN_PARMSA + TMCI_WAVE_OPEN_PARMSA* = MCI_WAVE_OPEN_PARMSA + MCI_WAVE_OPEN_PARMSW* {.final.} = object + dwCallback*: DWORD + wDeviceID*: MCIDEVICEID + lpstrDeviceType*: LPCWSTR + lpstrElementName*: LPCWSTR + lpstrAlias*: LPCWSTR + dwBufferSeconds*: DWORD + + PMCI_WAVE_OPEN_PARMSW* = ptr MCI_WAVE_OPEN_PARMSW + LPMCI_WAVE_OPEN_PARMSW* = ptr MCI_WAVE_OPEN_PARMSW + TMCI_WAVE_OPEN_PARMSW* = MCI_WAVE_OPEN_PARMSW + +when defined(UNICODE): + type + MCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMSW + PMCI_WAVE_OPEN_PARMS* = PMCI_WAVE_OPEN_PARMSW + LPMCI_WAVE_OPEN_PARMS* = LPMCI_WAVE_OPEN_PARMSW +else: + type + MCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMSA + PMCI_WAVE_OPEN_PARMS* = PMCI_WAVE_OPEN_PARMSA + LPMCI_WAVE_OPEN_PARMS* = LPMCI_WAVE_OPEN_PARMSA +type + TMCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMS + MCI_WAVE_DELETE_PARMS* {.final.} = object + dwCallback*: DWORD + dwFrom*: DWORD + dwTo*: DWORD + + PMCI_WAVE_DELETE_PARMS* = ptr MCI_WAVE_DELETE_PARMS + LPMCI_WAVE_DELETE_PARMS* = ptr MCI_WAVE_DELETE_PARMS + TMCI_WAVE_DELETE_PARMS* = MCI_WAVE_DELETE_PARMS + MCI_WAVE_SET_PARMS* {.final.} = object + dwCallback*: DWORD + dwTimeFormat*: DWORD + dwAudio*: DWORD + wInput*: 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* {.final.} = object + dwCallback*: DWORD + dwTimeFormat*: DWORD + dwAudio*: DWORD + dwTempo*: DWORD + dwPort*: DWORD + dwSlave*: DWORD + dwMaster*: DWORD + dwOffset*: DWORD + + PMCI_SEQ_SET_PARMS* = ptr MCI_SEQ_SET_PARMS + LPMCI_SEQ_SET_PARMS* = ptr MCI_SEQ_SET_PARMS + TMCI_SEQ_SET_PARMS* = MCI_SEQ_SET_PARMS + MCI_ANIM_OPEN_PARMSA* {.final.} = object + dwCallback*: DWORD + wDeviceID*: MCIDEVICEID + lpstrDeviceType*: LPCSTR + lpstrElementName*: LPCSTR + lpstrAlias*: LPCSTR + dwStyle*: DWORD + hWndParent*: HWND + + PMCI_ANIM_OPEN_PARMSA* = ptr MCI_ANIM_OPEN_PARMSA + LPMCI_ANIM_OPEN_PARMSA* = ptr MCI_ANIM_OPEN_PARMSA + TMCI_ANIM_OPEN_PARMSA* = MCI_ANIM_OPEN_PARMSA + MCI_ANIM_OPEN_PARMSW* {.final.} = object + dwCallback*: DWORD + wDeviceID*: MCIDEVICEID + lpstrDeviceType*: LPCWSTR + lpstrElementName*: LPCWSTR + lpstrAlias*: LPCWSTR + dwStyle*: DWORD + hWndParent*: HWND + + PMCI_ANIM_OPEN_PARMSW* = ptr MCI_ANIM_OPEN_PARMSW + LPMCI_ANIM_OPEN_PARMSW* = ptr MCI_ANIM_OPEN_PARMSW + +when defined(UNICODE): + type + MCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMSW + PMCI_ANIM_OPEN_PARMS* = PMCI_ANIM_OPEN_PARMSW + LPMCI_ANIM_OPEN_PARMS* = LPMCI_ANIM_OPEN_PARMSW +else: + type + MCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMSA + PMCI_ANIM_OPEN_PARMS* = PMCI_ANIM_OPEN_PARMSA + LPMCI_ANIM_OPEN_PARMS* = LPMCI_ANIM_OPEN_PARMSA +type + TMCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMS + MCI_ANIM_WINDOW_PARMSW* {.final.} = object + dwCallback*: DWORD + hWnd*: HWND + nCmdShow*: 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* {.final.} = object + dwCallback*: DWORD + dwFrames*: DWORD + + PMCI_ANIM_STEP_PARMS* = ptr MCI_ANIM_STEP_PARMS + LPMCI_ANIM_STEP_PARMS* = ptr MCI_ANIM_STEP_PARMS + TMCI_ANIM_STEP_PARMS* = MCI_ANIM_STEP_PARMS + MCI_ANIM_WINDOW_PARMSA* {.final.} = object + dwCallback*: DWORD + hWnd*: HWND + nCmdShow*: 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* {.final.} = object + dwCallback*: DWORD + dwFrom*: DWORD + dwTo*: DWORD + dwSpeed*: DWORD + + PMCI_ANIM_PLAY_PARMS* = ptr MCI_ANIM_PLAY_PARMS + LPMCI_ANIM_PLAY_PARMS* = ptr MCI_ANIM_PLAY_PARMS + +when defined(UNICODE): + type + MCI_ANIM_WINDOW_PARMS* = MCI_ANIM_WINDOW_PARMSW + PMCI_ANIM_WINDOW_PARMS* = PMCI_ANIM_WINDOW_PARMSW + LPMCI_ANIM_WINDOW_PARMS* = LPMCI_ANIM_WINDOW_PARMSW +else: + type + MCI_ANIM_WINDOW_PARMS* = MCI_ANIM_WINDOW_PARMSA + PMCI_ANIM_WINDOW_PARMS* = PMCI_ANIM_WINDOW_PARMSA + LPMCI_ANIM_WINDOW_PARMS* = LPMCI_ANIM_WINDOW_PARMSA +type + MCI_ANIM_RECT_PARMS* {.final.} = object + dwCallback*: DWORD + rc*: 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* {.final.} = object + 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* {.final.} = object + dwCallback*: DWORD + wDeviceID*: MCIDEVICEID + lpstrDeviceType*: LPCSTR + lpstrElementName*: LPCSTR + lpstrAlias*: LPCSTR + dwStyle*: DWORD + hWndParent*: HWND + + PMCI_OVLY_OPEN_PARMSA* = ptr MCI_OVLY_OPEN_PARMSA + LPMCI_OVLY_OPEN_PARMSA* = ptr MCI_OVLY_OPEN_PARMSA + TMCI_OVLY_OPEN_PARMSA* = MCI_OVLY_OPEN_PARMSA + MCI_OVLY_OPEN_PARMSW* {.final.} = object + dwCallback*: DWORD + wDeviceID*: MCIDEVICEID + lpstrDeviceType*: LPCWSTR + lpstrElementName*: LPCWSTR + lpstrAlias*: LPCWSTR + dwStyle*: DWORD + hWndParent*: HWND + + PMCI_OVLY_OPEN_PARMSW* = ptr MCI_OVLY_OPEN_PARMSW + LPMCI_OVLY_OPEN_PARMSW* = ptr MCI_OVLY_OPEN_PARMSW + TMCI_OVLY_OPEN_PARMSW* = MCI_OVLY_OPEN_PARMSW + +when defined(UNICODE): + type + MCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMSW + PMCI_OVLY_OPEN_PARMS* = PMCI_OVLY_OPEN_PARMSW + LPMCI_OVLY_OPEN_PARMS* = LPMCI_OVLY_OPEN_PARMSW +else: + type + MCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMSA + PMCI_OVLY_OPEN_PARMS* = PMCI_OVLY_OPEN_PARMSA + LPMCI_OVLY_OPEN_PARMS* = LPMCI_OVLY_OPEN_PARMSA +type + TMCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMS + MCI_OVLY_WINDOW_PARMSA* {.final.} = object + dwCallback*: DWORD + hWnd*: HWND + nCmdShow*: 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + 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 = toU8(x shr 24) + +proc MEVT_EVENTPARM(x: DWORD): DWORD = + result = x And 0x00FFFFFF + +proc MCI_MSF_MINUTE(msf: int32): int8 = + result = toU8(msf and 0xff) + +proc MCI_TMSF_TRACK(tmsf: int32): int8 = + result = toU8(tmsf and 0xff) + +proc MCI_HMS_HOUR(h: int32): int8 = + result = toU8(h and 0xff) + +proc MCI_MSF_SECOND(msf: int32): int8 = + result = toU8(msf shr 8) + +proc MCI_TMSF_MINUTE(tmsf: int32): int8 = + result = toU8(tmsf shr 8) + +proc MCI_HMS_MINUTE(h: int32): int8 = + result = toU8(h shr 8) + +proc MCI_MSF_FRAME(msf: int32): int8 = + result = toU8(msf shr 16) + +proc MCI_TMSF_SECOND(tmsf: int32): int8 = + result = toU8(tmsf shr 16) + +proc MCI_HMS_SECOND(h: int32): int8 = + result = toU8(h shr 16) + +proc MCI_MAKE_MSF(m, s, f: int8): int32 = + result = toU32(ze(m) or ze(s) shl 8 or ze(f) shl 16) + +proc MCI_MAKE_HMS(h, m, s: int8): int32 = + result = toU32(ze(h) or ze(m) shl 8 or ze(s) shl 16) + +proc MCI_TMSF_FRAME(tmsf: int32): int8 = + result = toU8(tmsf shr 24) + +proc mci_Make_TMSF(t, m, s, f: int8): int32 = + result = (ze(t) or ze(m) shl 8 or ze(s) shl 16 or ze(f) shl 24).int32 + +proc DIBINDEX(n: int32): int32 = + result = n Or 0x000010FF'i32 shl 16'i32 diff --git a/lib/windows/nb30.nim b/lib/windows/nb30.nim new file mode 100644 index 0000000000..a7fd526aaf --- /dev/null +++ b/lib/windows/nb30.nim @@ -0,0 +1,232 @@ +# +# +# 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 module contains the definitions for portable NetBIOS 3.0 support. + +{.deadCodeElim: on.} + +import # Data structure templates + Windows + +const + NCBNAMSZ* = 16 # absolute length of a net name + MAX_LANA* = 254 # lana's in range 0 to MAX_LANA inclusive + +type # Network Control Block + PNCB* = ptr TNCB + TNCBPostProc* = proc (P: PNCB) {.stdcall.} + TNCB* {.final.} = object # Structure returned to the NCB command NCBASTAT is ADAPTER_STATUS followed + # by an array of NAME_BUFFER structures. + ncb_command*: Char # command code + ncb_retcode*: Char # return code + ncb_lsn*: Char # local session number + ncb_num*: Char # number of our network name + ncb_buffer*: cstring # address of message buffer + ncb_length*: int16 # size of message buffer + ncb_callname*: array[0..NCBNAMSZ - 1, char] # blank-padded name of remote + ncb_name*: array[0..NCBNAMSZ - 1, char] # our blank-padded netname + ncb_rto*: Char # rcv timeout/retry count + ncb_sto*: Char # send timeout/sys timeout + ncb_post*: 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* {.final.} = object + adapter_address*: array[0..5, Char] + rev_major*: Char + reserved0*: Char + adapter_type*: Char + rev_minor*: Char + duration*: int16 + frmr_recv*: int16 + frmr_xmit*: int16 + iframe_recv_err*: int16 + xmit_aborts*: int16 + xmit_success*: DWORD + recv_success*: DWORD + iframe_xmit_err*: int16 + recv_buff_unavail*: int16 + t1_timeouts*: int16 + ti_timeouts*: int16 + reserved1*: DWORD + free_ncbs*: int16 + max_cfg_ncbs*: int16 + max_ncbs*: int16 + xmit_buf_unavail*: int16 + max_dgram_size*: int16 + pending_sess*: int16 + max_cfg_sess*: int16 + max_sess*: int16 + max_sess_pkt_size*: int16 + name_count*: int16 + + PNameBuffer* = ptr TNameBuffer + TNameBuffer* {.final.} = object + 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* {.final.} = object + sess_name*: Char + num_sess*: Char + rcv_dg_outstanding*: Char + rcv_any_outstanding*: Char + + PSessionBuffer* = ptr TSessionBuffer + TSessionBuffer* {.final.} = object + lsn*: Char + state*: Char + local_name*: array[0..NCBNAMSZ - 1, Char] + remote_name*: array[0..NCBNAMSZ - 1, Char] + rcvs_outstanding*: Char + sends_outstanding*: Char + + +const # Values for state + LISTEN_OUTSTANDING* = 0x00000001 + CALL_PENDING* = 0x00000002 + SESSION_ESTABLISHED* = 0x00000003 + HANGUP_PENDING* = 0x00000004 + HANGUP_COMPLETE* = 0x00000005 + SESSION_ABORTED* = 0x00000006 + +type # Structure returned to the NCB command NCBENUM. + # On a system containing lana's 0, 2 and 3, a structure with + # length =3, lana[0]=0, lana[1]=2 and lana[2]=3 will be returned. + PLanaEnum* = ptr TLanaEnum + TLanaEnum* {.final.} = object # Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed + # by an array of FIND_NAME_BUFFER structures. + len*: Char # Number of valid entries in lana[] + lana*: array[0..MAX_LANA, Char] + + PFindNameHeader* = ptr TFindNameHeader + TFindNameHeader* {.final.} = object + node_count*: int16 + reserved*: Char + unique_group*: Char + + PFindNameBuffer* = ptr TFindNameBuffer + TFindNameBuffer* {.final.} = object # Structure provided with NCBACTION. The purpose of NCBACTION is to provide + # transport specific extensions to netbios. + len*: Char + access_control*: Char + frame_control*: Char + destination_addr*: array[0..5, Char] + source_addr*: array[0..5, Char] + routing_info*: array[0..17, Char] + + PActionHeader* = ptr TActionHeader + TActionHeader* {.final.} = object + 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 100644 index 0000000000..ec0ab8f5da --- /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/psapi.nim b/lib/windows/psapi.nim new file mode 100644 index 0000000000..7d53cf7ca8 --- /dev/null +++ b/lib/windows/psapi.nim @@ -0,0 +1,202 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +# PSAPI interface unit + +# Contains the definitions for the APIs provided by PSAPI.DLL + +import # Data structure templates + Windows + +const + psapiDll = "psapi.dll" + +proc EnumProcesses*(lpidProcess: ptr DWORD, cb: DWORD, + cbNeeded: ptr DWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "EnumProcesses".} +proc EnumProcessModules*(hProcess: HANDLE, lphModule: ptr HMODULE, cb: DWORD, lpcbNeeded: LPDWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "EnumProcessModules".} + +proc GetModuleBaseNameA*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetModuleBaseNameA".} +proc GetModuleBaseNameW*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetModuleBaseNameW".} +when defined(winUnicode): + proc GetModuleBaseName*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetModuleBaseNameW".} +else: + proc GetModuleBaseName*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetModuleBaseNameA".} + +proc GetModuleFileNameExA*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetModuleFileNameExA".} +proc GetModuleFileNameExW*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetModuleFileNameExW".} +when defined(winUnicode): + proc GetModuleFileNameEx*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetModuleFileNameExW".} +else: + proc GetModuleFileNameEx*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetModuleFileNameExA".} + +type + MODULEINFO* {.final.} = object + lpBaseOfDll*: LPVOID + SizeOfImage*: DWORD + EntryPoint*: LPVOID + LPMODULEINFO* = ptr MODULEINFO + +proc GetModuleInformation*(hProcess: HANDLE, hModule: HMODULE, lpmodinfo: LPMODULEINFO, cb: DWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "GetModuleInformation".} +proc EmptyWorkingSet*(hProcess: HANDLE): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "EmptyWorkingSet".} +proc QueryWorkingSet*(hProcess: HANDLE, pv: PVOID, cb: DWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "QueryWorkingSet".} +proc QueryWorkingSetEx*(hProcess: HANDLE, pv: PVOID, cb: DWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "QueryWorkingSetEx".} +proc InitializeProcessForWsWatch*(hProcess: HANDLE): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "InitializeProcessForWsWatch".} + +type + PSAPI_WS_WATCH_INFORMATION* {.final.} = object + FaultingPc*: LPVOID + FaultingVa*: LPVOID + PPSAPI_WS_WATCH_INFORMATION* = ptr PSAPI_WS_WATCH_INFORMATION + +proc GetWsChanges*(hProcess: HANDLE, lpWatchInfo: PPSAPI_WS_WATCH_INFORMATION, cb: DWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "GetWsChanges".} + +proc GetMappedFileNameA*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetMappedFileNameA".} +proc GetMappedFileNameW*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetMappedFileNameW".} +when defined(winUnicode): + proc GetMappedFileName*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetMappedFileNameW".} +else: + proc GetMappedFileName*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetMappedFileNameA".} + +proc EnumDeviceDrivers*(lpImageBase: LPVOID, cb: DWORD, lpcbNeeded: LPDWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "EnumDeviceDrivers".} + +proc GetDeviceDriverBaseNameA*(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetDeviceDriverBaseNameA".} +proc GetDeviceDriverBaseNameW*(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetDeviceDriverBaseNameW".} +when defined(winUnicode): + proc GetDeviceDriverBaseName*(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetDeviceDriverBaseNameW".} +else: + proc GetDeviceDriverBaseName*(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetDeviceDriverBaseNameA".} + +proc GetDeviceDriverFileNameA*(ImageBase: LPVOID, lpFileName: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetDeviceDriverFileNameA".} +proc GetDeviceDriverFileNameW*(ImageBase: LPVOID, lpFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetDeviceDriverFileNameW".} +when defined(winUnicode): + proc GetDeviceDriverFileName*(ImageBase: LPVOID, lpFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetDeviceDriverFileNameW".} +else: + proc GetDeviceDriverFileName*(ImageBase: LPVOID, lpFileName: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetDeviceDriverFileNameA".} + +type + PROCESS_MEMORY_COUNTERS* {.final.} = object + cb*: DWORD + PageFaultCount*: DWORD + PeakWorkingSetSize: SIZE_T + WorkingSetSize: SIZE_T + QuotaPeakPagedPoolUsage: SIZE_T + QuotaPagedPoolUsage: SIZE_T + QuotaPeakNonPagedPoolUsage: SIZE_T + QuotaNonPagedPoolUsage: SIZE_T + PagefileUsage: SIZE_T + PeakPagefileUsage: SIZE_T + PPROCESS_MEMORY_COUNTERS* = ptr PROCESS_MEMORY_COUNTERS + +type + PROCESS_MEMORY_COUNTERS_EX* {.final.} = object + cb*: DWORD + PageFaultCount*: DWORD + PeakWorkingSetSize: SIZE_T + WorkingSetSize: SIZE_T + QuotaPeakPagedPoolUsage: SIZE_T + QuotaPagedPoolUsage: SIZE_T + QuotaPeakNonPagedPoolUsage: SIZE_T + QuotaNonPagedPoolUsage: SIZE_T + PagefileUsage: SIZE_T + PeakPagefileUsage: SIZE_T + PrivateUsage: SIZE_T + PPROCESS_MEMORY_COUNTERS_EX* = ptr PROCESS_MEMORY_COUNTERS_EX + +proc GetProcessMemoryInfo*(hProcess: HANDLE, ppsmemCounters: PPROCESS_MEMORY_COUNTERS, cb: DWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "GetProcessMemoryInfo".} + +type + PERFORMANCE_INFORMATION* {.final.} = object + cb*: DWORD + CommitTotal: SIZE_T + CommitLimit: SIZE_T + CommitPeak: SIZE_T + PhysicalTotal: SIZE_T + PhysicalAvailable: SIZE_T + SystemCache: SIZE_T + KernelTotal: SIZE_T + KernelPaged: SIZE_T + KernelNonpaged: SIZE_T + PageSize: SIZE_T + HandleCount*: DWORD + ProcessCount*: DWORD + ThreadCount*: DWORD + PPERFORMANCE_INFORMATION* = ptr PERFORMANCE_INFORMATION + # Skip definition of PERFORMACE_INFORMATION... + +proc GetPerformanceInfo*(pPerformanceInformation: PPERFORMANCE_INFORMATION, cb: DWORD): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "GetPerformanceInfo".} + +type + ENUM_PAGE_FILE_INFORMATION* {.final.} = object + cb*: DWORD + Reserved*: DWORD + TotalSize: SIZE_T + TotalInUse: SIZE_T + PeakUsage: SIZE_T + PENUM_PAGE_FILE_INFORMATION* = ptr ENUM_PAGE_FILE_INFORMATION + +# Callback procedure +type + PENUM_PAGE_FILE_CALLBACKW* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCWSTR): WINBOOL{.stdcall.} + PENUM_PAGE_FILE_CALLBACKA* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCSTR): WINBOOL{.stdcall.} + +#TODO +proc EnumPageFilesA*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "EnumPageFilesA".} +proc EnumPageFilesW*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "EnumPageFilesW".} +when defined(winUnicode): + proc EnumPageFiles*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "EnumPageFilesW".} + type PENUM_PAGE_FILE_CALLBACK* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCWSTR): WINBOOL{.stdcall.} +else: + proc EnumPageFiles*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID): WINBOOL {.stdcall, + dynlib: psapiDll, importc: "EnumPageFilesA".} + type PENUM_PAGE_FILE_CALLBACK* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCSTR): WINBOOL{.stdcall.} + +proc GetProcessImageFileNameA*(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetProcessImageFileNameA".} +proc GetProcessImageFileNameW*(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetProcessImageFileNameW".} +when defined(winUnicode): + proc GetProcessImageFileName*(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetProcessImageFileNameW".} +else: + proc GetProcessImageFileName*(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD): DWORD {.stdcall, + dynlib: psapiDll, importc: "GetProcessImageFileNameA".} diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim new file mode 100644 index 0000000000..41f2a60d5f --- /dev/null +++ b/lib/windows/shellapi.nim @@ -0,0 +1,863 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2006 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +{.deadCodeElim: on.} + +# leave out unused functions so the unit can be used on win2000 as well + +#+------------------------------------------------------------------------- +# +# Microsoft Windows +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# File: shellapi.h +# +# Header translation by Marco van de Voort for Free Pascal Platform +# SDK dl'ed January 2002 +# +#-------------------------------------------------------------------------- + +# +# shellapi.h - SHELL.DLL functions, types, and definitions +# Copyright (c) Microsoft Corporation. All rights reserved. + +import + Windows + +type + HDROP* = THandle + UINT_PTR* = ptr UINT + DWORD_PTR* = ptr DWORD + pHICON* = ptr HICON + pBool* = ptr BOOL + STARTUPINFOW* {.final.} = object # a guess. Omission should get fixed in Windows. + cb*: DWORD + lpReserved*: LPTSTR + lpDesktop*: LPTSTR + lpTitle*: LPTSTR + dwX*: DWORD + dwY*: DWORD + dwXSize*: DWORD + dwYSize*: DWORD + dwXCountChars*: DWORD + dwYCountChars*: DWORD + dwFillAttribute*: DWORD + dwFlags*: DWORD + wShowWindow*: int16 + cbReserved2*: int16 + lpReserved2*: LPBYTE + hStdInput*: HANDLE + hStdOutput*: HANDLE + hStdError*: HANDLE + + LPSTARTUPINFOW* = ptr STARTUPINFOW + 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*(inst: HINST, icon: HICON): HIcon{.stdcall, + dynlib: "shell32.dll", importc: "DuplicateIcon".} +proc ExtractAssociatedIconA*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{. + stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".} +proc ExtractAssociatedIconW*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{. + stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".} +proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{. + stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".} +proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{. + stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".} +proc ExtractIconA*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: 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* {.final.} = object + uSize*: UINT + pt*: POINT + fNC*: BOOL + lpFileList*: LPSTR + grfKeyState*: DWORD + + TDRAGINFOA* = DRAGINFOA + LPDRAGINFOA* = ptr DRAGINFOA # init with sizeof(DRAGINFO) + DRAGINFOW* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + pszOldPath*: LPSTR + pszNewPath*: LPSTR + cchOldPath*: int32 + cchNewPath*: int32 + + TSHNAMEMAPPINGA* = SHNAMEMAPPINGA + LPSHNAMEMAPPINGA* = ptr SHNAMEMAPPINGA + SHNAMEMAPPINGW* {.final.} = object + 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* {.final.} = object + cbSize*: DWORD + fMask*: ULONG + hwnd*: HWND + lpVerb*: LPCSTR + lpFile*: LPCSTR + lpParameters*: LPCSTR + lpDirectory*: LPCSTR + nShow*: int32 + hInstApp*: HINST + lpIDList*: LPVOID + lpClass*: LPCSTR + hkeyClass*: HKEY + dwHotKey*: DWORD + hMonitor*: HANDLE # also: hIcon + hProcess*: HANDLE + + TSHELLEXECUTEINFOA* = SHELLEXECUTEINFOA + LPSHELLEXECUTEINFOA* = ptr SHELLEXECUTEINFOA + SHELLEXECUTEINFOW* {.final.} = object + cbSize*: DWORD + fMask*: ULONG + hwnd*: HWND + lpVerb*: lpcwstr + lpFile*: lpcwstr + lpParameters*: lpcwstr + lpDirectory*: lpcwstr + nShow*: int32 + hInstApp*: HINST + lpIDList*: LPVOID + lpClass*: LPCWSTR + hkeyClass*: HKEY + dwHotKey*: DWORD + hMonitor*: HANDLE # also: hIcon + hProcess*: HANDLE + + 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* {.final.} = object + cbSize*: DWORD + fMask*: ULONG + hwnd*: HWND + pszFile*: LPCWSTR + pszParameters*: LPCWSTR + pszCurrentDirectory*: LPCWSTR + hUserToken*: HANDLE + lpProcessAttributes*: LPSECURITY_ATTRIBUTES + lpThreadAttributes*: LPSECURITY_ATTRIBUTES + bInheritHandles*: BOOL + dwCreationFlags*: DWORD + lpStartupInfo*: LPSTARTUPINFOW + lpProcessInformation*: LPPROCESS_INFORMATION + + 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + 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* {.final.} = object + hIcon*: HICON # out: icon + iIcon*: int32 # out: icon index + dwAttributes*: DWORD # out: SFGAO_ flags + szDisplayName*: array[0..(MAX_PATH) - 1, CHAR] # out: display name (or path) + szTypeName*: array[0..79, CHAR] # out: type name + + TSHFILEINFOA* = SHFILEINFOA + pSHFILEINFOA* = ptr SHFILEINFOA + SHFILEINFOW* {.final.} = object + hIcon*: HICON # out: icon + iIcon*: int32 # out: icon index + dwAttributes*: DWORD # out: SFGAO_ flags + szDisplayName*: array[0..(MAX_PATH) - 1, WCHAR] # out: display name (or path) + szTypeName*: array[0..79, WCHAR] # out: type name + + 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 = -x diff --git a/lib/windows/shfolder.nim b/lib/windows/shfolder.nim new file mode 100644 index 0000000000..253b1c77ab --- /dev/null +++ b/lib/windows/shfolder.nim @@ -0,0 +1,93 @@ +# +# +# 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. +# --------------------------------------------------------------------- + +{.deadCodeElim: on.} + +import + windows + +const + LibName* = "SHFolder.dll" + +const + CSIDL_PROGRAMS* = 0x00000002 # %SYSTEMDRIVE%\Program Files + CSIDL_PERSONAL* = 0x00000005 # %USERPROFILE%\My Documents + CSIDL_FAVORITES* = 0x00000006 # %USERPROFILE%\Favorites + CSIDL_STARTUP* = 0x00000007 # %USERPROFILE%\Start menu\Programs\Startup + CSIDL_RECENT* = 0x00000008 # %USERPROFILE%\Recent + CSIDL_SENDTO* = 0x00000009 # %USERPROFILE%\Sendto + CSIDL_STARTMENU* = 0x0000000B # %USERPROFILE%\Start menu + CSIDL_MYMUSIC* = 0x0000000D # %USERPROFILE%\Documents\My Music + CSIDL_MYVIDEO* = 0x0000000E # %USERPROFILE%\Documents\My Videos + CSIDL_DESKTOPDIRECTORY* = 0x00000010 # %USERPROFILE%\Desktop + CSIDL_NETHOOD* = 0x00000013 # %USERPROFILE%\NetHood + CSIDL_TEMPLATES* = 0x00000015 # %USERPROFILE%\Templates + CSIDL_COMMON_STARTMENU* = 0x00000016 # %PROFILEPATH%\All users\Start menu + CSIDL_COMMON_PROGRAMS* = 0x00000017 # %PROFILEPATH%\All users\Start menu\Programs + CSIDL_COMMON_STARTUP* = 0x00000018 # %PROFILEPATH%\All users\Start menu\Programs\Startup + CSIDL_COMMON_DESKTOPDIRECTORY* = 0x00000019 # %PROFILEPATH%\All users\Desktop + CSIDL_APPDATA* = 0x0000001A # %USERPROFILE%\Application Data (roaming) + CSIDL_PRINTHOOD* = 0x0000001B # %USERPROFILE%\Printhood + CSIDL_LOCAL_APPDATA* = 0x0000001C # %USERPROFILE%\Local Settings\Application Data (non roaming) + CSIDL_COMMON_FAVORITES* = 0x0000001F # %PROFILEPATH%\All users\Favorites + CSIDL_INTERNET_CACHE* = 0x00000020 # %USERPROFILE%\Local Settings\Temporary Internet Files + CSIDL_COOKIES* = 0x00000021 # %USERPROFILE%\Cookies + CSIDL_HISTORY* = 0x00000022 # %USERPROFILE%\Local settings\History + CSIDL_COMMON_APPDATA* = 0x00000023 # %PROFILESPATH%\All Users\Application Data + CSIDL_WINDOWS* = 0x00000024 # %SYSTEMROOT% + CSIDL_SYSTEM* = 0x00000025 # %SYSTEMROOT%\SYSTEM32 (may be system on 95/98/ME) + CSIDL_PROGRAM_FILES* = 0x00000026 # %SYSTEMDRIVE%\Program Files + CSIDL_MYPICTURES* = 0x00000027 # %USERPROFILE%\My Documents\My Pictures + CSIDL_PROFILE* = 0x00000028 # %USERPROFILE% + CSIDL_PROGRAM_FILES_COMMON* = 0x0000002B # %SYSTEMDRIVE%\Program Files\Common + CSIDL_COMMON_TEMPLATES* = 0x0000002D # %PROFILEPATH%\All Users\Templates + CSIDL_COMMON_DOCUMENTS* = 0x0000002E # %PROFILEPATH%\All Users\Documents + CSIDL_COMMON_ADMINTOOLS* = 0x0000002F # %PROFILEPATH%\All Users\Start Menu\Programs\Administrative Tools + CSIDL_ADMINTOOLS* = 0x00000030 # %USERPROFILE%\Start Menu\Programs\Administrative Tools + CSIDL_COMMON_MUSIC* = 0x00000035 # %PROFILEPATH%\All Users\Documents\my music + CSIDL_COMMON_PICTURES* = 0x00000036 # %PROFILEPATH%\All Users\Documents\my pictures + CSIDL_COMMON_VIDEO* = 0x00000037 # %PROFILEPATH%\All Users\Documents\my videos + CSIDL_CDBURN_AREA* = 0x0000003B # %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning + CSIDL_PROFILES* = 0x0000003E # %PROFILEPATH% + CSIDL_FLAG_CREATE* = 0x00008000 # (force creation of requested folder if it doesn't exist yet) + # Original entry points + +proc SHGetFolderPathA*(Ahwnd: HWND, Csidl: int, Token: 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 100644 index 0000000000..9b55b47b92 --- /dev/null +++ b/lib/windows/windows.nim @@ -0,0 +1,23945 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2010 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## Define ``winUnicode`` before importing this module for the +## Unicode version. + +{.deadCodeElim: on.} + +type + WideChar* = uint16 + PWideChar* = ptr uint16 + +type # WinNT.h -- Defines the 32-Bit Windows types and constants + SHORT* = int16 + LONG* = int32 + # UNICODE (Wide Character) types + PWCHAR* = PWideChar + LPWCH* = PWideChar + PWCH* = PWideChar + LPCWCH* = PWideChar + PCWCH* = PWideChar + NWPSTR* = PWideChar + LPWSTR* = PWideChar + LPCWSTR* = PWideChar + PCWSTR* = PWideChar + # ANSI (Multi-byte Character) types + LPCH* = cstring + PCH* = cstring + LPCCH* = cstring + PCCH* = cstring + LPSTR* = cstring + PSTR* = cstring + LPCSTR* = cstring + PCSTR* = cstring + +type # BaseTsd.h -- Type definitions for the basic sized types + # Give here only the bare minimum, to be expanded as needs arise + LONG32* = int32 + ULONG32* = int32 + DWORD32* = int32 + LONG64* = int64 + ULONG64* = int64 + DWORD64* = int64 + PDWORD64* = ptr DWORD64 + # int32 on Win32, int64 on Win64 + INT_PTR* = TAddress + UINT_PTR* = TAddress + LONG_PTR* = TAddress + ULONG_PTR* = TAddress + SIZE_T* = TAddress + SSIZE_T* = TAddress + DWORD_PTR* = TAddress + # Thread affinity + KAFFINITY* = TAddress + PKAFFINITY* = ptr KAFFINITY + +type # WinDef.h -- Basic Windows Type Definitions + # BaseTypes + UINT = int32 + ULONG* = int + PULONG* = ptr int + USHORT* = int16 + PUSHORT* = ptr int16 + UCHAR* = int8 + PUCHAR* = ptr int8 + PSZ* = cstring + + DWORD* = int32 + WINBOOL* = int32 + WORD* = int16 + # FLOAT* = float + PFLOAT* = ptr FLOAT + PWINBOOL* = ptr WINBOOL + LPWINBOOL* = ptr WINBOOL + PBYTE* = ptr int8 + LPBYTE* = ptr int8 + PINT* = ptr int32 + LPINT* = ptr int32 + PWORD* = ptr int16 + LPWORD* = ptr int16 + LPLONG* = ptr int32 + PDWORD* = ptr DWORD + LPDWORD* = ptr DWORD + LPVOID* = pointer + LPCVOID* = pointer + + # INT* = int # Cannot work and not necessary anyway + PUINT* = ptr int + + WPARAM* = LONG_PTR + LPARAM* = LONG_PTR + LRESULT* = LONG_PTR + + ATOM* = int16 + TAtom* = ATOM + HANDLE* = int + THandle* = HANDLE + PHANDLE* = ptr HANDLE + LPHANDLE* = ptr HANDLE + HWND* = HANDLE + HHOOK* = HANDLE + HEVENT* = HANDLE + HGLOBAL* = HANDLE + HLOCAL* = HANDLE + HGDIOBJ* = HANDLE + HKEY* = HANDLE + PHKEY* = ptr HKEY + HACCEL* = HANDLE + HBITMAP* = HANDLE + HBRUSH* = HANDLE + HCOLORSPACE* = HANDLE + HDC* = HANDLE + HGLRC* = HANDLE + HDESK* = HANDLE + HENHMETAFILE* = HANDLE + HFONT* = HANDLE + HICON* = HANDLE + HMETAFILE* = HANDLE + HINST* = HANDLE # Not HINSTANCE, else it has problems with the var HInstance + HMODULE* = HANDLE + HPALETTE* = HANDLE + HPEN* = HANDLE + HRGN* = HANDLE + HRSRC* = HANDLE + HTASK* = HANDLE + HWINSTA* = HANDLE + HKL* = HANDLE + HMONITOR* = HANDLE + HWINEVENTHOOK* = HANDLE + HUMPD* = HANDLE + + HFILE* = HANDLE + HCURSOR* = HANDLE # = HICON + COLORREF* = int + LPCOLORREF* = ptr COLORREF + + POINT* {.final, pure.} = object + x*: LONG + y*: LONG + PPOINT* = ptr POINT + LPPOINT* = ptr POINT + POINTL* {.final, pure.} = object + x*: LONG + y*: LONG + PPOINTL* = ptr POINTL + + TPOINT* = POINT + TPOINTL* = POINTL + + RECT* {.final, pure.} = object + TopLeft*, BottomRight*: TPoint + PRECT* = ptr RECT + LPRECT* = ptr RECT + + RECTL* {.final, pure.} = object + left*: LONG + top*: LONG + right*: LONG + bottom*: LONG + PRECTL* = ptr RECTL + + SIZE* {.final, pure.} = object + cx*: LONG + cy*: LONG + PSIZE* = ptr SIZE + LPSIZE* = ptr SIZE + SIZEL* = SIZE + PSIZEL* = ptr SIZE + LPSIZEL* = ptr SIZE + + POINTS* {.final, pure.} = object + x*: SHORT + y*: SHORT + PPOINTS* = ptr POINTS + + TRECT* = RECT + TRECTL* = RECTL + TSIZE* = SIZE + TSIZEL* = SIZE + TPOINTS* = POINTS + + FILETIME* {.final, pure.} = object + dwLowDateTime*: DWORD + dwHighDateTime*: DWORD + PFILETIME* = ptr FILETIME + LPFILETIME* = ptr FILETIME + + TFILETIME* = FILETIME + +const + MAX_PATH* = 260 + HFILE_ERROR* = HFILE(-1) + + # mode selections for the device mode function + # DocumentProperties + DM_UPDATE* = 1 + DM_COPY* = 2 + DM_PROMPT* = 4 + DM_MODIFY* = 8 + + DM_IN_BUFFER* = DM_MODIFY + DM_IN_PROMPT* = DM_PROMPT + DM_OUT_BUFFER* = DM_COPY + DM_OUT_DEFAULT* = DM_UPDATE + + # device capabilities indices + DC_FIELDS* = 1 + DC_PAPERS* = 2 + DC_PAPERSIZE* = 3 + DC_MINEXTENT* = 4 + DC_MAXEXTENT* = 5 + DC_BINS* = 6 + DC_DUPLEX* = 7 + DC_SIZE* = 8 + DC_EXTRA* = 9 + DC_VERSION* = 10 + DC_DRIVER* = 11 + DC_BINNAMES* = 12 + DC_ENUMRESOLUTIONS* = 13 + DC_FILEDEPENDENCIES* = 14 + DC_TRUETYPE* = 15 + DC_PAPERNAMES* = 16 + DC_ORIENTATION* = 17 + DC_COPIES* = 18 + + DC_BINADJUST* = 19 + DC_EMF_COMPLIANT* = 20 + DC_DATATYPE_PRODUCED* = 21 + +type + WORDBOOL* = int16 # XXX: not a bool + CALTYPE* = int + CALID* = int + CCHAR* = char + TCOLORREF* = int + WINT* = int32 + PINTEGER* = ptr int32 + PBOOL* = ptr WINBOOL + LONGLONG* = int64 + PLONGLONG* = ptr LONGLONG + LPLONGLONG* = ptr LONGLONG + ULONGLONG* = int64 # used in AMD64 CONTEXT + PULONGLONG* = ptr ULONGLONG # + DWORDLONG* = int64 # was unsigned long + PDWORDLONG* = ptr DWORDLONG + HRESULT* = int + PHRESULT* = ptr HRESULT + HCONV* = HANDLE + HCONVLIST* = HANDLE + HDBC* = HANDLE + HDDEDATA* = HANDLE + HDROP* = HANDLE + HDWP* = HANDLE + HENV* = HANDLE + HIMAGELIST* = HANDLE + HMENU* = HANDLE + HRASCONN* = HANDLE + HSTMT* = HANDLE + HSTR* = HANDLE + HSZ* = HANDLE + LANGID* = int16 + LCID* = DWORD + LCTYPE* = DWORD + LP* = ptr int16 + LPBOOL* = ptr WINBOOL + +when defined(winUnicode): + type + LPCTSTR* = PWideChar +else: + type + LPCTSTR* = cstring +type + LPPCSTR* = ptr LPCSTR + LPPCTSTR* = ptr LPCTSTR + LPPCWSTR* = ptr LPCWSTR + +when defined(winUnicode): + type + LPTCH* = PWideChar + LPTSTR* = PWideChar +else: + type + LPTCH* = cstring + LPTSTR* = cstring +type + PBOOLEAN* = ptr int8 + PLONG* = ptr int32 + PSHORT* = ptr SHORT + +when defined(winUnicode): + type + PTBYTE* = ptr uint16 + PTCH* = PWideChar + PTCHAR* = PWideChar + PTSTR* = PWideChar +else: + type + PTBYTE* = ptr byte + PTCH* = cstring + PTCHAR* = cstring + PTSTR* = cstring +type + PVOID* = pointer + RETCODE* = SHORT + SC_HANDLE* = HANDLE + SC_LOCK* = LPVOID + LPSC_HANDLE* = ptr SC_HANDLE + SERVICE_STATUS_HANDLE* = DWORD + +when defined(winUnicode): + type + TBYTE* = uint16 + TCHAR* = widechar + BCHAR* = int16 +else: + type + TBYTE* = uint8 + TCHAR* = char + BCHAR* = int8 +type + WCHAR* = WideChar + PLPSTR* = ptr LPSTR + PLPWStr* = ptr LPWStr + ACL_INFORMATION_CLASS* = enum + AclRevisionInformation = 1, AclSizeInformation + MEDIA_TYPE* = enum + Unknown, F5_1Pt2_512, F3_1Pt44_512, F3_2Pt88_512, F3_20Pt8_512, F3_720_512, + F5_360_512, F5_320_512, F5_320_1024, F5_180_512, F5_160_512, RemovableMedia, + FixedMedia + +const + RASCS_DONE* = 0x00002000 + RASCS_PAUSED* = 0x00001000 + +type + RASCONNSTATE* = enum + RASCS_OpenPort = 0, RASCS_PortOpened, RASCS_ConnectDevice, + RASCS_DeviceConnected, RASCS_AllDevicesConnected, RASCS_Authenticate, + RASCS_AuthNotify, RASCS_AuthRetry, RASCS_AuthCallback, + RASCS_AuthChangePassword, RASCS_AuthProject, RASCS_AuthLinkSpeed, + RASCS_AuthAck, RASCS_ReAuthenticate, RASCS_Authenticated, + RASCS_PrepareForCallback, RASCS_WaitForModemReset, RASCS_WaitForCallback, + RASCS_Projected, RASCS_StartAuthentication, RASCS_CallbackComplete, + RASCS_LogonNetwork, RASCS_Interactive = RASCS_PAUSED, + RASCS_RetryAuthentication, RASCS_CallbackSetByCaller, RASCS_PasswordExpired, + RASCS_Connected = RASCS_DONE, RASCS_Disconnected + RASPROJECTION* = enum + RASP_PppIp = 0x00008021, RASP_PppIpx = 0x0000802B, RASP_PppNbf = 0x0000803F, + RASP_Amb = 0x00010000 + SECURITY_IMPERSONATION_LEVEL* = enum + + + SecurityAnonymous, SecurityIdentification, SecurityImpersonation, + SecurityDelegation + SID_NAME_USE* = enum + SidTypeUser = 1, SidTypeGroup, SidTypeDomain, SidTypeAlias, + SidTypeWellKnownGroup, SidTypeDeletedAccount, SidTypeInvalid, SidTypeUnknown + PSID_NAME_USE* = ptr SID_NAME_USE + TOKEN_INFORMATION_CLASS* = enum + TokenUser = 1, TokenGroups, TokenPrivileges, TokenOwner, TokenPrimaryGroup, + TokenDefaultDacl, TokenSource, TokenType, TokenImpersonationLevel, + TokenStatistics + TTOKEN_TYPE* = enum + TokenPrimary = 1, TokenImpersonation + MakeIntResourceA* = cstring + MakeIntResourceW* = PWideChar + MakeIntResource* = MakeIntResourceA + +# +# 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.} + +const + SE_CREATE_TOKEN_NAME* = "SeCreateTokenPrivilege" + SE_ASSIGNPRIMARYTOKEN_NAME* = "SeAssignPrimaryTokenPrivilege" + SE_LOCK_MEMORY_NAME* = "SeLockMemoryPrivilege" + SE_INCREASE_QUOTA_NAME* = "SeIncreaseQuotaPrivilege" + SE_UNSOLICITED_INPUT_NAME* = "SeUnsolicitedInputPrivilege" + SE_MACHINE_ACCOUNT_NAME* = "SeMachineAccountPrivilege" + SE_TCB_NAME* = "SeTcbPrivilege" + SE_SECURITY_NAME* = "SeSecurityPrivilege" + SE_TAKE_OWNERSHIP_NAME* = "SeTakeOwnershipPrivilege" + SE_LOAD_DRIVER_NAME* = "SeLoadDriverPrivilege" + SE_SYSTEM_PROFILE_NAME* = "SeSystemProfilePrivilege" + SE_SYSTEMTIME_NAME* = "SeSystemtimePrivilege" + SE_PROF_SINGLE_PROCESS_NAME* = "SeProfileSingleProcessPrivilege" + SE_INC_BASE_PRIORITY_NAME* = "SeIncreaseBasePriorityPrivilege" + SE_CREATE_PAGEFILE_NAME* = "SeCreatePagefilePrivilege" + SE_CREATE_PERMANENT_NAME* = "SeCreatePermanentPrivilege" + SE_BACKUP_NAME* = "SeBackupPrivilege" + SE_RESTORE_NAME* = "SeRestorePrivilege" + SE_SHUTDOWN_NAME* = "SeShutdownPrivilege" + SE_DEBUG_NAME* = "SeDebugPrivilege" + SE_AUDIT_NAME* = "SeAuditPrivilege" + SE_SYSTEM_ENVIRONMENT_NAME* = "SeSystemEnvironmentPrivilege" + SE_CHANGE_NOTIFY_NAME* = "SeChangeNotifyPrivilege" + SE_REMOTE_SHUTDOWN_NAME* = "SeRemoteShutdownPrivilege" + SERVICES_ACTIVE_DATABASEW* = "ServicesActive" + SERVICES_FAILED_DATABASEW* = "ServicesFailed" + SERVICES_ACTIVE_DATABASEA* = "ServicesActive" + SERVICES_FAILED_DATABASEA* = "ServicesFailed" + SC_GROUP_IDENTIFIERW* = "+" + SC_GROUP_IDENTIFIERA* = "+" + +when defined(winUnicode): + const + SERVICES_ACTIVE_DATABASE* = SERVICES_ACTIVE_DATABASEW + SERVICES_FAILED_DATABASE* = SERVICES_FAILED_DATABASEW + SC_GROUP_IDENTIFIER* = SC_GROUP_IDENTIFIERW +else: + const + SERVICES_ACTIVE_DATABASE* = SERVICES_ACTIVE_DATABASEA + SERVICES_FAILED_DATABASE* = SERVICES_FAILED_DATABASEA + SC_GROUP_IDENTIFIER* = SC_GROUP_IDENTIFIERA +type + PFNCALLBACK* = proc (para1, para2: UINT, para3: HCONV, para4, para5: HSZ, + para6: HDDEDATA, para7, para8: DWORD): HDDEData{.stdcall.} + CALLB* = PFNCALLBACK + SECURITY_CONTEXT_TRACKING_MODE* = WINBOOL + # End of stuff from ddeml.h in old Cygnus headers + + WNDENUMPROC* = FARPROC + ENHMFENUMPROC* = FARPROC + CCSTYLE* = DWORD + PCCSTYLE* = ptr CCSTYLE + LPCCSTYLE* = ptr CCSTYLE + CCSTYLEFLAGA* = DWORD + PCCSTYLEFLAGA* = ptr CCSTYLEFLAGA + LPCCSTYLEFLAGA* = ptr CCSTYLEFLAGA + +const + LZERROR_UNKNOWNALG* = -8 + LZERROR_BADVALUE* = -7 + LZERROR_GLOBLOCK* = -6 + LZERROR_GLOBALLOC* = -5 + LZERROR_WRITE* = -4 + LZERROR_READ* = -3 + LZERROR_BADOUTHANDLE* = -2 + LZERROR_BADINHANDLE* = -1 + NO_ERROR* = 0 + ERROR_SUCCESS* = 0 + ERROR_INVALID_FUNCTION* = 1 + ERROR_FILE_NOT_FOUND* = 2 + ERROR_PATH_NOT_FOUND* = 3 + ERROR_TOO_MANY_OPEN_FILES* = 4 + ERROR_ACCESS_DENIED* = 5 + ERROR_INVALID_HANDLE* = 6 + ERROR_ARENA_TRASHED* = 7 + ERROR_NOT_ENOUGH_MEMORY* = 8 + ERROR_INVALID_BLOCK* = 9 + ERROR_BAD_ENVIRONMENT* = 10 + ERROR_BAD_FORMAT* = 11 + ERROR_INVALID_ACCESS* = 12 + ERROR_INVALID_DATA* = 13 + ERROR_OUTOFMEMORY* = 14 + ERROR_INVALID_DRIVE* = 15 + ERROR_CURRENT_DIRECTORY* = 16 + ERROR_NOT_SAME_DEVICE* = 17 + ERROR_NO_MORE_FILES* = 18 + ERROR_WRITE_PROTECT* = 19 + ERROR_BAD_UNIT* = 20 + ERROR_NOT_READY* = 21 + ERROR_BAD_COMMAND* = 22 + ERROR_CRC* = 23 + ERROR_BAD_LENGTH* = 24 + ERROR_SEEK* = 25 + ERROR_NOT_DOS_DISK* = 26 + ERROR_SECTOR_NOT_FOUND* = 27 + ERROR_OUT_OF_PAPER* = 28 + ERROR_WRITE_FAULT* = 29 + ERROR_READ_FAULT* = 30 + ERROR_GEN_FAILURE* = 31 + ERROR_SHARING_VIOLATION* = 32 + ERROR_LOCK_VIOLATION* = 33 + ERROR_WRONG_DISK* = 34 + ERROR_SHARING_BUFFER_EXCEEDED* = 36 + ERROR_HANDLE_EOF* = 38 + ERROR_HANDLE_DISK_FULL* = 39 + ERROR_NOT_SUPPORTED* = 50 + ERROR_REM_NOT_LIST* = 51 + ERROR_DUP_NAME* = 52 + ERROR_BAD_NETPATH* = 53 + ERROR_NETWORK_BUSY* = 54 + ERROR_DEV_NOT_EXIST* = 55 + ERROR_TOO_MANY_CMDS* = 56 + ERROR_ADAP_HDW_ERR* = 57 + ERROR_BAD_NET_RESP* = 58 + ERROR_UNEXP_NET_ERR* = 59 + ERROR_BAD_REM_ADAP* = 60 + ERROR_PRINTQ_FULL* = 61 + ERROR_NO_SPOOL_SPACE* = 62 + ERROR_PRINT_CANCELLED* = 63 + ERROR_NETNAME_DELETED* = 64 + ERROR_NETWORK_ACCESS_DENIED* = 65 + ERROR_BAD_DEV_TYPE* = 66 + ERROR_BAD_NET_NAME* = 67 + ERROR_TOO_MANY_NAMES* = 68 + ERROR_TOO_MANY_SESS* = 69 + ERROR_SHARING_PAUSED* = 70 + ERROR_REQ_NOT_ACCEP* = 71 + ERROR_REDIR_PAUSED* = 72 + ERROR_FILE_EXISTS* = 80 + ERROR_CANNOT_MAKE* = 82 + ERROR_FAIL_I24* = 83 + ERROR_OUT_OF_STRUCTURES* = 84 + ERROR_ALREADY_ASSIGNED* = 85 + ERROR_INVALID_PASSWORD* = 86 + ERROR_INVALID_PARAMETER* = 87 + ERROR_NET_WRITE_FAULT* = 88 + ERROR_NO_PROC_SLOTS* = 89 + ERROR_TOO_MANY_SEMAPHORES* = 100 + ERROR_EXCL_SEM_ALREADY_OWNED* = 101 + ERROR_SEM_IS_SET* = 102 + ERROR_TOO_MANY_SEM_REQUESTS* = 103 + ERROR_INVALID_AT_INTERRUPT_TIME* = 104 + ERROR_SEM_OWNER_DIED* = 105 + ERROR_SEM_USER_LIMIT* = 106 + ERROR_DISK_CHANGE* = 107 + ERROR_DRIVE_LOCKED* = 108 + ERROR_BROKEN_PIPE* = 109 + ERROR_OPEN_FAILED* = 110 + ERROR_BUFFER_OVERFLOW* = 111 + ERROR_DISK_FULL* = 112 + ERROR_NO_MORE_SEARCH_HANDLES* = 113 + ERROR_INVALID_TARGET_HANDLE* = 114 + ERROR_INVALID_CATEGORY* = 117 + ERROR_INVALID_VERIFY_SWITCH* = 118 + ERROR_BAD_DRIVER_LEVEL* = 119 + ERROR_CALL_NOT_IMPLEMENTED* = 120 + ERROR_SEM_TIMEOUT* = 121 + ERROR_INSUFFICIENT_BUFFER* = 122 + ERROR_INVALID_NAME* = 123 + ERROR_INVALID_LEVEL* = 124 + ERROR_NO_VOLUME_LABEL* = 125 + ERROR_MOD_NOT_FOUND* = 126 + ERROR_PROC_NOT_FOUND* = 127 + ERROR_WAIT_NO_CHILDREN* = 128 + ERROR_CHILD_NOT_COMPLETE* = 129 + ERROR_DIRECT_ACCESS_HANDLE* = 130 + ERROR_NEGATIVE_SEEK* = 131 + ERROR_SEEK_ON_DEVICE* = 132 + ERROR_IS_JOIN_TARGET* = 133 + ERROR_IS_JOINED* = 134 + ERROR_IS_SUBSTED* = 135 + ERROR_NOT_JOINED* = 136 + ERROR_NOT_SUBSTED* = 137 + ERROR_JOIN_TO_JOIN* = 138 + ERROR_SUBST_TO_SUBST* = 139 + ERROR_JOIN_TO_SUBST* = 140 + ERROR_SUBST_TO_JOIN* = 141 + ERROR_BUSY_DRIVE* = 142 + ERROR_SAME_DRIVE* = 143 + ERROR_DIR_NOT_ROOT* = 144 + ERROR_DIR_NOT_EMPTY* = 145 + ERROR_IS_SUBST_PATH* = 146 + ERROR_IS_JOIN_PATH* = 147 + ERROR_PATH_BUSY* = 148 + ERROR_IS_SUBST_TARGET* = 149 + ERROR_SYSTEM_TRACE* = 150 + ERROR_INVALID_EVENT_COUNT* = 151 + ERROR_TOO_MANY_MUXWAITERS* = 152 + ERROR_INVALID_LIST_FORMAT* = 153 + ERROR_LABEL_TOO_LONG* = 154 + ERROR_TOO_MANY_TCBS* = 155 + ERROR_SIGNAL_REFUSED* = 156 + ERROR_DISCARDED* = 157 + ERROR_NOT_LOCKED* = 158 + ERROR_BAD_THREADID_ADDR* = 159 + ERROR_BAD_ARGUMENTS* = 160 + ERROR_BAD_PATHNAME* = 161 + ERROR_SIGNAL_PENDING* = 162 + ERROR_MAX_THRDS_REACHED* = 164 + ERROR_LOCK_FAILED* = 167 + ERROR_BUSY* = 170 + ERROR_CANCEL_VIOLATION* = 173 + ERROR_ATOMIC_LOCKS_NOT_SUPPORTED* = 174 + ERROR_INVALID_SEGMENT_NUMBER* = 180 + ERROR_INVALID_ORDINAL* = 182 + ERROR_ALREADY_EXISTS* = 183 + ERROR_INVALID_FLAG_NUMBER* = 186 + ERROR_SEM_NOT_FOUND* = 187 + ERROR_INVALID_STARTING_CODESEG* = 188 + ERROR_INVALID_STACKSEG* = 189 + ERROR_INVALID_MODULETYPE* = 190 + ERROR_INVALID_EXE_SIGNATURE* = 191 + ERROR_EXE_MARKED_INVALID* = 192 + ERROR_BAD_EXE_FORMAT* = 193 + ERROR_ITERATED_DATA_EXCEEDS_64k* = 194 + ERROR_INVALID_MINALLOCSIZE* = 195 + ERROR_DYNLINK_FROM_INVALID_RING* = 196 + ERROR_IOPL_NOT_ENABLED* = 197 + ERROR_INVALID_SEGDPL* = 198 + ERROR_AUTODATASEG_EXCEEDS_64k* = 199 + ERROR_RING2SEG_MUST_BE_MOVABLE* = 200 + ERROR_RELOC_CHAIN_XEEDS_SEGLIM* = 201 + ERROR_INFLOOP_IN_RELOC_CHAIN* = 202 + ERROR_ENVVAR_NOT_FOUND* = 203 + ERROR_NO_SIGNAL_SENT* = 205 + ERROR_FILENAME_EXCED_RANGE* = 206 + ERROR_RING2_STACK_IN_USE* = 207 + ERROR_META_EXPANSION_TOO_LONG* = 208 + ERROR_INVALID_SIGNAL_NUMBER* = 209 + ERROR_THREAD_1_INACTIVE* = 210 + ERROR_LOCKED* = 212 + ERROR_TOO_MANY_MODULES* = 214 + ERROR_NESTING_NOT_ALLOWED* = 215 + ERROR_BAD_PIPE* = 230 + ERROR_PIPE_BUSY* = 231 + ERROR_NO_DATA* = 232 + ERROR_PIPE_NOT_CONNECTED* = 233 + ERROR_MORE_DATA* = 234 + ERROR_VC_DISCONNECTED* = 240 + ERROR_INVALID_EA_NAME* = 254 + ERROR_EA_LIST_INCONSISTENT* = 255 + ERROR_NO_MORE_ITEMS* = 259 + ERROR_CANNOT_COPY* = 266 + ERROR_DIRECTORY* = 267 + ERROR_EAS_DIDNT_FIT* = 275 + ERROR_EA_FILE_CORRUPT* = 276 + ERROR_EA_TABLE_FULL* = 277 + ERROR_INVALID_EA_HANDLE* = 278 + ERROR_EAS_NOT_SUPPORTED* = 282 + ERROR_NOT_OWNER* = 288 + ERROR_TOO_MANY_POSTS* = 298 + ERROR_PARTIAL_COPY* = 299 + ERROR_MR_MID_NOT_FOUND* = 317 + ERROR_INVALID_ADDRESS* = 487 + ERROR_ARITHMETIC_OVERFLOW* = 534 + ERROR_PIPE_CONNECTED* = 535 + ERROR_PIPE_LISTENING* = 536 + ERROR_EA_ACCESS_DENIED* = 994 + ERROR_OPERATION_ABORTED* = 995 + ERROR_IO_INCOMPLETE* = 996 + ERROR_IO_PENDING* = 997 + ERROR_NOACCESS* = 998 + ERROR_SWAPERROR* = 999 + ERROR_STACK_OVERFLOW* = 1001 + ERROR_INVALID_MESSAGE* = 1002 + ERROR_CAN_NOT_COMPLETE* = 1003 + ERROR_INVALID_FLAGS* = 1004 + ERROR_UNRECOGNIZED_VOLUME* = 1005 + ERROR_FILE_INVALID* = 1006 + ERROR_FULLSCREEN_MODE* = 1007 + ERROR_NO_TOKEN* = 1008 + ERROR_BADDB* = 1009 + ERROR_BADKEY* = 1010 + ERROR_CANTOPEN* = 1011 + ERROR_CANTREAD* = 1012 + ERROR_CANTWRITE* = 1013 + ERROR_REGISTRY_RECOVERED* = 1014 + ERROR_REGISTRY_CORRUPT* = 1015 + ERROR_REGISTRY_IO_FAILED* = 1016 + ERROR_NOT_REGISTRY_FILE* = 1017 + ERROR_KEY_DELETED* = 1018 + ERROR_NO_LOG_SPACE* = 1019 + ERROR_KEY_HAS_CHILDREN* = 1020 + ERROR_CHILD_MUST_BE_VOLATILE* = 1021 + ERROR_NOTIFY_ENUM_DIR* = 1022 + ERROR_DEPENDENT_SERVICES_RUNNING* = 1051 + ERROR_INVALID_SERVICE_CONTROL* = 1052 + ERROR_SERVICE_REQUEST_TIMEOUT* = 1053 + ERROR_SERVICE_NO_THREAD* = 1054 + ERROR_SERVICE_DATABASE_LOCKED* = 1055 + ERROR_SERVICE_ALREADY_RUNNING* = 1056 + ERROR_INVALID_SERVICE_ACCOUNT* = 1057 + ERROR_SERVICE_DISABLED* = 1058 + ERROR_CIRCULAR_DEPENDENCY* = 1059 + ERROR_SERVICE_DOES_NOT_EXIST* = 1060 + ERROR_SERVICE_CANNOT_ACCEPT_CTRL* = 1061 + ERROR_SERVICE_NOT_ACTIVE* = 1062 + ERROR_FAILED_SERVICE_CONTROLLER_CONNECT* = 1063 + ERROR_EXCEPTION_IN_SERVICE* = 1064 + ERROR_DATABASE_DOES_NOT_EXIST* = 1065 + ERROR_SERVICE_SPECIFIC_ERROR* = 1066 + ERROR_PROCESS_ABORTED* = 1067 + ERROR_SERVICE_DEPENDENCY_FAIL* = 1068 + ERROR_SERVICE_LOGON_FAILED* = 1069 + ERROR_SERVICE_START_HANG* = 1070 + ERROR_INVALID_SERVICE_LOCK* = 1071 + ERROR_SERVICE_MARKED_FOR_DELETE* = 1072 + ERROR_SERVICE_EXISTS* = 1073 + ERROR_ALREADY_RUNNING_LKG* = 1074 + ERROR_SERVICE_DEPENDENCY_DELETED* = 1075 + ERROR_BOOT_ALREADY_ACCEPTED* = 1076 + ERROR_SERVICE_NEVER_STARTED* = 1077 + ERROR_DUPLICATE_SERVICE_NAME* = 1078 + ERROR_END_OF_MEDIA* = 1100 + ERROR_FILEMARK_DETECTED* = 1101 + ERROR_BEGINNING_OF_MEDIA* = 1102 + ERROR_SETMARK_DETECTED* = 1103 + ERROR_NO_DATA_DETECTED* = 1104 + ERROR_PARTITION_FAILURE* = 1105 + ERROR_INVALID_BLOCK_LENGTH* = 1106 + ERROR_DEVICE_NOT_PARTITIONED* = 1107 + ERROR_UNABLE_TO_LOCK_MEDIA* = 1108 + ERROR_UNABLE_TO_UNLOAD_MEDIA* = 1109 + ERROR_MEDIA_CHANGED* = 1110 + ERROR_BUS_RESET* = 1111 + ERROR_NO_MEDIA_IN_DRIVE* = 1112 + ERROR_NO_UNICODE_TRANSLATION* = 1113 + ERROR_DLL_INIT_FAILED* = 1114 + ERROR_SHUTDOWN_IN_PROGRESS* = 1115 + ERROR_NO_SHUTDOWN_IN_PROGRESS* = 1116 + ERROR_IO_DEVICE* = 1117 + ERROR_SERIAL_NO_DEVICE* = 1118 + ERROR_IRQ_BUSY* = 1119 + ERROR_MORE_WRITES* = 1120 + ERROR_COUNTER_TIMEOUT* = 1121 + ERROR_FLOPPY_ID_MARK_NOT_FOUND* = 1122 + ERROR_FLOPPY_WRONG_CYLINDER* = 1123 + ERROR_FLOPPY_UNKNOWN_ERROR* = 1124 + ERROR_FLOPPY_BAD_REGISTERS* = 1125 + ERROR_DISK_RECALIBRATE_FAILED* = 1126 + ERROR_DISK_OPERATION_FAILED* = 1127 + ERROR_DISK_RESET_FAILED* = 1128 + ERROR_EOM_OVERFLOW* = 1129 + ERROR_NOT_ENOUGH_SERVER_MEMORY* = 1130 + ERROR_POSSIBLE_DEADLOCK* = 1131 + ERROR_MAPPED_ALIGNMENT* = 1132 + ERROR_SET_POWER_STATE_VETOED* = 1140 + ERROR_SET_POWER_STATE_FAILED* = 1141 + ERROR_OLD_WIN_VERSION* = 1150 + ERROR_APP_WRONG_OS* = 1151 + ERROR_SINGLE_INSTANCE_APP* = 1152 + ERROR_RMODE_APP* = 1153 + ERROR_INVALID_DLL* = 1154 + ERROR_NO_ASSOCIATION* = 1155 + ERROR_DDE_FAIL* = 1156 + ERROR_DLL_NOT_FOUND* = 1157 + ERROR_BAD_USERNAME* = 2202 + ERROR_NOT_CONNECTED* = 2250 + ERROR_OPEN_FILES* = 2401 + ERROR_ACTIVE_CONNECTIONS* = 2402 + ERROR_DEVICE_IN_USE* = 2404 + ERROR_BAD_DEVICE* = 1200 + ERROR_CONNECTION_UNAVAIL* = 1201 + ERROR_DEVICE_ALREADY_REMEMBERED* = 1202 + ERROR_NO_NET_OR_BAD_PATH* = 1203 + ERROR_BAD_PROVIDER* = 1204 + ERROR_CANNOT_OPEN_PROFILE* = 1205 + ERROR_BAD_PROFILE* = 1206 + ERROR_NOT_CONTAINER* = 1207 + ERROR_EXTENDED_ERROR* = 1208 + ERROR_INVALID_GROUPNAME* = 1209 + ERROR_INVALID_COMPUTERNAME* = 1210 + ERROR_INVALID_EVENTNAME* = 1211 + ERROR_INVALID_DOMAINNAME* = 1212 + ERROR_INVALID_SERVICENAME* = 1213 + ERROR_INVALID_NETNAME* = 1214 + ERROR_INVALID_SHARENAME* = 1215 + ERROR_INVALID_PASSWORDNAME* = 1216 + ERROR_INVALID_MESSAGENAME* = 1217 + ERROR_INVALID_MESSAGEDEST* = 1218 + ERROR_SESSION_CREDENTIAL_CONFLICT* = 1219 + ERROR_REMOTE_SESSION_LIMIT_EXCEEDED* = 1220 + ERROR_DUP_DOMAINNAME* = 1221 + ERROR_NO_NETWORK* = 1222 + ERROR_CANCELLED* = 1223 + ERROR_USER_MAPPED_FILE* = 1224 + ERROR_CONNECTION_REFUSED* = 1225 + ERROR_GRACEFUL_DISCONNECT* = 1226 + ERROR_ADDRESS_ALREADY_ASSOCIATED* = 1227 + ERROR_ADDRESS_NOT_ASSOCIATED* = 1228 + ERROR_CONNECTION_INVALID* = 1229 + ERROR_CONNECTION_ACTIVE* = 1230 + ERROR_NETWORK_UNREACHABLE* = 1231 + ERROR_HOST_UNREACHABLE* = 1232 + ERROR_PROTOCOL_UNREACHABLE* = 1233 + ERROR_PORT_UNREACHABLE* = 1234 + ERROR_REQUEST_ABORTED* = 1235 + ERROR_CONNECTION_ABORTED* = 1236 + ERROR_RETRY* = 1237 + ERROR_CONNECTION_COUNT_LIMIT* = 1238 + ERROR_LOGIN_TIME_RESTRICTION* = 1239 + ERROR_LOGIN_WKSTA_RESTRICTION* = 1240 + ERROR_INCORRECT_ADDRESS* = 1241 + ERROR_ALREADY_REGISTERED* = 1242 + ERROR_SERVICE_NOT_FOUND* = 1243 + ERROR_NOT_AUTHENTICATED* = 1244 + ERROR_NOT_LOGGED_ON* = 1245 + ERROR_CONTINUE* = 1246 + ERROR_ALREADY_INITIALIZED* = 1247 + ERROR_NO_MORE_DEVICES* = 1248 + ERROR_NOT_ALL_ASSIGNED* = 1300 + ERROR_SOME_NOT_MAPPED* = 1301 + ERROR_NO_QUOTAS_FOR_ACCOUNT* = 1302 + ERROR_LOCAL_USER_SESSION_KEY* = 1303 + ERROR_NULL_LM_PASSWORD* = 1304 + ERROR_UNKNOWN_REVISION* = 1305 + ERROR_REVISION_MISMATCH* = 1306 + ERROR_INVALID_OWNER* = 1307 + ERROR_INVALID_PRIMARY_GROUP* = 1308 + ERROR_NO_IMPERSONATION_TOKEN* = 1309 + ERROR_CANT_DISABLE_MANDATORY* = 1310 + ERROR_NO_LOGON_SERVERS* = 1311 + ERROR_NO_SUCH_LOGON_SESSION* = 1312 + ERROR_NO_SUCH_PRIVILEGE* = 1313 + ERROR_PRIVILEGE_NOT_HELD* = 1314 + ERROR_INVALID_ACCOUNT_NAME* = 1315 + ERROR_USER_EXISTS* = 1316 + ERROR_NO_SUCH_USER* = 1317 + ERROR_GROUP_EXISTS* = 1318 + ERROR_NO_SUCH_GROUP* = 1319 + ERROR_MEMBER_IN_GROUP* = 1320 + ERROR_MEMBER_NOT_IN_GROUP* = 1321 + ERROR_LAST_ADMIN* = 1322 + ERROR_WRONG_PASSWORD* = 1323 + ERROR_ILL_FORMED_PASSWORD* = 1324 + ERROR_PASSWORD_RESTRICTION* = 1325 + ERROR_LOGON_FAILURE* = 1326 + ERROR_ACCOUNT_RESTRICTION* = 1327 + ERROR_INVALID_LOGON_HOURS* = 1328 + ERROR_INVALID_WORKSTATION* = 1329 + ERROR_PASSWORD_EXPIRED* = 1330 + ERROR_ACCOUNT_DISABLED* = 1331 + ERROR_NONE_MAPPED* = 1332 + ERROR_TOO_MANY_LUIDS_REQUESTED* = 1333 + ERROR_LUIDS_EXHAUSTED* = 1334 + ERROR_INVALID_SUB_AUTHORITY* = 1335 + ERROR_INVALID_ACL* = 1336 + ERROR_INVALID_SID* = 1337 + ERROR_INVALID_SECURITY_DESCR* = 1338 + ERROR_BAD_INHERITANCE_ACL* = 1340 + ERROR_SERVER_DISABLED* = 1341 + ERROR_SERVER_NOT_DISABLED* = 1342 + ERROR_INVALID_ID_AUTHORITY* = 1343 + ERROR_ALLOTTED_SPACE_EXCEEDED* = 1344 + ERROR_INVALID_GROUP_ATTRIBUTES* = 1345 + ERROR_BAD_IMPERSONATION_LEVEL* = 1346 + ERROR_CANT_OPEN_ANONYMOUS* = 1347 + ERROR_BAD_VALIDATION_CLASS* = 1348 + ERROR_BAD_TOKEN_TYPE* = 1349 + ERROR_NO_SECURITY_ON_OBJECT* = 1350 + ERROR_CANT_ACCESS_DOMAIN_INFO* = 1351 + ERROR_INVALID_SERVER_STATE* = 1352 + ERROR_INVALID_DOMAIN_STATE* = 1353 + ERROR_INVALID_DOMAIN_ROLE* = 1354 + ERROR_NO_SUCH_DOMAIN* = 1355 + ERROR_DOMAIN_EXISTS* = 1356 + ERROR_DOMAIN_LIMIT_EXCEEDED* = 1357 + ERROR_INTERNAL_DB_CORRUPTION* = 1358 + ERROR_INTERNAL_ERROR* = 1359 + ERROR_GENERIC_NOT_MAPPED* = 1360 + ERROR_BAD_DESCRIPTOR_FORMAT* = 1361 + ERROR_NOT_LOGON_PROCESS* = 1362 + ERROR_LOGON_SESSION_EXISTS* = 1363 + ERROR_NO_SUCH_PACKAGE* = 1364 + ERROR_BAD_LOGON_SESSION_STATE* = 1365 + ERROR_LOGON_SESSION_COLLISION* = 1366 + ERROR_INVALID_LOGON_TYPE* = 1367 + ERROR_CANNOT_IMPERSONATE* = 1368 + ERROR_RXACT_INVALID_STATE* = 1369 + ERROR_RXACT_COMMIT_FAILURE* = 1370 + ERROR_SPECIAL_ACCOUNT* = 1371 + ERROR_SPECIAL_GROUP* = 1372 + ERROR_SPECIAL_USER* = 1373 + ERROR_MEMBERS_PRIMARY_GROUP* = 1374 + ERROR_TOKEN_ALREADY_IN_USE* = 1375 + ERROR_NO_SUCH_ALIAS* = 1376 + ERROR_MEMBER_NOT_IN_ALIAS* = 1377 + ERROR_MEMBER_IN_ALIAS* = 1378 + ERROR_ALIAS_EXISTS* = 1379 + ERROR_LOGON_NOT_GRANTED* = 1380 + ERROR_TOO_MANY_SECRETS* = 1381 + ERROR_SECRET_TOO_LONG* = 1382 + ERROR_INTERNAL_DB_ERROR* = 1383 + ERROR_TOO_MANY_CONTEXT_IDS* = 1384 + ERROR_LOGON_TYPE_NOT_GRANTED* = 1385 + ERROR_NT_CROSS_ENCRYPTION_REQUIRED* = 1386 + ERROR_NO_SUCH_MEMBER* = 1387 + ERROR_INVALID_MEMBER* = 1388 + ERROR_TOO_MANY_SIDS* = 1389 + ERROR_LM_CROSS_ENCRYPTION_REQUIRED* = 1390 + ERROR_NO_INHERITANCE* = 1391 + ERROR_FILE_CORRUPT* = 1392 + ERROR_DISK_CORRUPT* = 1393 + ERROR_NO_USER_SESSION_KEY* = 1394 + ERROR_LICENSE_QUOTA_EXCEEDED* = 1395 + ERROR_INVALID_WINDOW_HANDLE* = 1400 + ERROR_INVALID_MENU_HANDLE* = 1401 + ERROR_INVALID_CURSOR_HANDLE* = 1402 + ERROR_INVALID_ACCEL_HANDLE* = 1403 + ERROR_INVALID_HOOK_HANDLE* = 1404 + ERROR_INVALID_DWP_HANDLE* = 1405 + ERROR_TLW_WITH_WSCHILD* = 1406 + ERROR_CANNOT_FIND_WND_CLASS* = 1407 + ERROR_WINDOW_OF_OTHER_THREAD* = 1408 + ERROR_HOTKEY_ALREADY_REGISTERED* = 1409 + ERROR_CLASS_ALREADY_EXISTS* = 1410 + ERROR_CLASS_DOES_NOT_EXIST* = 1411 + ERROR_CLASS_HAS_WINDOWS* = 1412 + ERROR_INVALID_INDEX* = 1413 + ERROR_INVALID_ICON_HANDLE* = 1414 + ERROR_PRIVATE_DIALOG_INDEX* = 1415 + ERROR_LISTBOX_ID_NOT_FOUND* = 1416 + ERROR_NO_WILDCARD_CHARACTERS* = 1417 + ERROR_CLIPBOARD_NOT_OPEN* = 1418 + ERROR_HOTKEY_NOT_REGISTERED* = 1419 + ERROR_WINDOW_NOT_DIALOG* = 1420 + ERROR_CONTROL_ID_NOT_FOUND* = 1421 + ERROR_INVALID_COMBOBOX_MESSAGE* = 1422 + ERROR_WINDOW_NOT_COMBOBOX* = 1423 + ERROR_INVALID_EDIT_HEIGHT* = 1424 + ERROR_DC_NOT_FOUND* = 1425 + ERROR_INVALID_HOOK_FILTER* = 1426 + ERROR_INVALID_FILTER_PROC* = 1427 + ERROR_HOOK_NEEDS_HMOD* = 1428 + ERROR_GLOBAL_ONLY_HOOK* = 1429 + ERROR_JOURNAL_HOOK_SET* = 1430 + ERROR_HOOK_NOT_INSTALLED* = 1431 + ERROR_INVALID_LB_MESSAGE* = 1432 + ERROR_SETCOUNT_ON_BAD_LB* = 1433 + ERROR_LB_WITHOUT_TABSTOPS* = 1434 + ERROR_DESTROY_OBJECT_OF_OTHER_THREAD* = 1435 + ERROR_CHILD_WINDOW_MENU* = 1436 + ERROR_NO_SYSTEM_MENU* = 1437 + ERROR_INVALID_MSGBOX_STYLE* = 1438 + ERROR_INVALID_SPI_VALUE* = 1439 + ERROR_SCREEN_ALREADY_LOCKED* = 1440 + ERROR_HWNDS_HAVE_DIFF_PARENT* = 1441 + ERROR_NOT_CHILD_WINDOW* = 1442 + ERROR_INVALID_GW_COMMAND* = 1443 + ERROR_INVALID_THREAD_ID* = 1444 + ERROR_NON_MDICHILD_WINDOW* = 1445 + ERROR_POPUP_ALREADY_ACTIVE* = 1446 + ERROR_NO_SCROLLBARS* = 1447 + ERROR_INVALID_SCROLLBAR_RANGE* = 1448 + ERROR_INVALID_SHOWWIN_COMMAND* = 1449 + ERROR_NO_SYSTEM_RESOURCES* = 1450 + ERROR_NONPAGED_SYSTEM_RESOURCES* = 1451 + ERROR_PAGED_SYSTEM_RESOURCES* = 1452 + ERROR_WORKING_SET_QUOTA* = 1453 + ERROR_PAGEFILE_QUOTA* = 1454 + ERROR_COMMITMENT_LIMIT* = 1455 + ERROR_MENU_ITEM_NOT_FOUND* = 1456 + ERROR_INVALID_KEYBOARD_HANDLE* = 1457 + ERROR_HOOK_TYPE_NOT_ALLOWED* = 1458 + ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION* = 1459 + ERROR_TIMEOUT* = 1460 + ERROR_EVENTLOG_FILE_CORRUPT* = 1500 + ERROR_EVENTLOG_CANT_START* = 1501 + ERROR_LOG_FILE_FULL* = 1502 + ERROR_EVENTLOG_FILE_CHANGED* = 1503 + RPC_S_INVALID_STRING_BINDING* = 1700 + RPC_S_WRONG_KIND_OF_BINDING* = 1701 + RPC_S_INVALID_BINDING* = 1702 + RPC_S_PROTSEQ_NOT_SUPPORTED* = 1703 + RPC_S_INVALID_RPC_PROTSEQ* = 1704 + RPC_S_INVALID_STRING_UUID* = 1705 + RPC_S_INVALID_ENDPOINT_FORMAT* = 1706 + RPC_S_INVALID_NET_ADDR* = 1707 + RPC_S_NO_ENDPOINT_FOUND* = 1708 + RPC_S_INVALID_TIMEOUT* = 1709 + RPC_S_OBJECT_NOT_FOUND* = 1710 + RPC_S_ALREADY_REGISTERED* = 1711 + RPC_S_TYPE_ALREADY_REGISTERED* = 1712 + RPC_S_ALREADY_LISTENING* = 1713 + RPC_S_NO_PROTSEQS_REGISTERED* = 1714 + RPC_S_NOT_LISTENING* = 1715 + RPC_S_UNKNOWN_MGR_TYPE* = 1716 + RPC_S_UNKNOWN_IF* = 1717 + RPC_S_NO_BINDINGS* = 1718 + RPC_S_NO_PROTSEQS* = 1719 + RPC_S_CANT_CREATE_ENDPOINT* = 1720 + RPC_S_OUT_OF_RESOURCES* = 1721 + RPC_S_SERVER_UNAVAILABLE* = 1722 + RPC_S_SERVER_TOO_BUSY* = 1723 + RPC_S_INVALID_NETWORK_OPTIONS* = 1724 + RPC_S_NO_CALL_ACTIVE* = 1725 + RPC_S_CALL_FAILED* = 1726 + RPC_S_CALL_FAILED_DNE* = 1727 + RPC_S_PROTOCOL_ERROR* = 1728 + RPC_S_UNSUPPORTED_TRANS_SYN* = 1730 + RPC_S_UNSUPPORTED_TYPE* = 1732 + RPC_S_INVALID_TAG* = 1733 + RPC_S_INVALID_BOUND* = 1734 + RPC_S_NO_ENTRY_NAME* = 1735 + RPC_S_INVALID_NAME_SYNTAX* = 1736 + RPC_S_UNSUPPORTED_NAME_SYNTAX* = 1737 + RPC_S_UUID_NO_ADDRESS* = 1739 + RPC_S_DUPLICATE_ENDPOINT* = 1740 + RPC_S_UNKNOWN_AUTHN_TYPE* = 1741 + RPC_S_MAX_CALLS_TOO_SMALL* = 1742 + RPC_S_STRING_TOO_LONG* = 1743 + RPC_S_PROTSEQ_NOT_FOUND* = 1744 + RPC_S_PROCNUM_OUT_OF_RANGE* = 1745 + RPC_S_BINDING_HAS_NO_AUTH* = 1746 + RPC_S_UNKNOWN_AUTHN_SERVICE* = 1747 + RPC_S_UNKNOWN_AUTHN_LEVEL* = 1748 + RPC_S_INVALID_AUTH_IDENTITY* = 1749 + RPC_S_UNKNOWN_AUTHZ_SERVICE* = 1750 + EPT_S_INVALID_ENTRY* = 1751 + EPT_S_CANT_PERFORM_OP* = 1752 + EPT_S_NOT_REGISTERED* = 1753 + RPC_S_NOTHING_TO_EXPORT* = 1754 + RPC_S_INCOMPLETE_NAME* = 1755 + RPC_S_INVALID_VERS_OPTION* = 1756 + RPC_S_NO_MORE_MEMBERS* = 1757 + RPC_S_NOT_ALL_OBJS_UNEXPORTED* = 1758 + RPC_S_INTERFACE_NOT_FOUND* = 1759 + RPC_S_ENTRY_ALREADY_EXISTS* = 1760 + RPC_S_ENTRY_NOT_FOUND* = 1761 + RPC_S_NAME_SERVICE_UNAVAILABLE* = 1762 + RPC_S_INVALID_NAF_ID* = 1763 + RPC_S_CANNOT_SUPPORT* = 1764 + RPC_S_NO_CONTEXT_AVAILABLE* = 1765 + RPC_S_INTERNAL_ERROR* = 1766 + RPC_S_ZERO_DIVIDE* = 1767 + RPC_S_ADDRESS_ERROR* = 1768 + RPC_S_FP_DIV_ZERO* = 1769 + RPC_S_FP_UNDERFLOW* = 1770 + RPC_S_FP_OVERFLOW* = 1771 + RPC_X_NO_MORE_ENTRIES* = 1772 + RPC_X_SS_CHAR_TRANS_OPEN_FAIL* = 1773 + RPC_X_SS_CHAR_TRANS_SHORT_FILE* = 1774 + RPC_X_SS_IN_NULL_CONTEXT* = 1775 + RPC_X_SS_CONTEXT_DAMAGED* = 1777 + RPC_X_SS_HANDLES_MISMATCH* = 1778 + RPC_X_SS_CANNOT_GET_CALL_HANDLE* = 1779 + RPC_X_NULL_REF_POINTER* = 1780 + RPC_X_ENUM_VALUE_OUT_OF_RANGE* = 1781 + RPC_X_BYTE_COUNT_TOO_SMALL* = 1782 + RPC_X_BAD_STUB_DATA* = 1783 + ERROR_INVALID_USER_BUFFER* = 1784 + ERROR_UNRECOGNIZED_MEDIA* = 1785 + ERROR_NO_TRUST_LSA_SECRET* = 1786 + ERROR_NO_TRUST_SAM_ACCOUNT* = 1787 + ERROR_TRUSTED_DOMAIN_FAILURE* = 1788 + ERROR_TRUSTED_RELATIONSHIP_FAILURE* = 1789 + ERROR_TRUST_FAILURE* = 1790 + RPC_S_CALL_IN_PROGRESS* = 1791 + ERROR_NETLOGON_NOT_STARTED* = 1792 + ERROR_ACCOUNT_EXPIRED* = 1793 + ERROR_REDIRECTOR_HAS_OPEN_HANDLES* = 1794 + ERROR_PRINTER_DRIVER_ALREADY_INSTALLED* = 1795 + ERROR_UNKNOWN_PORT* = 1796 + ERROR_UNKNOWN_PRINTER_DRIVER* = 1797 + ERROR_UNKNOWN_PRINTPROCESSOR* = 1798 + ERROR_INVALID_SEPARATOR_FILE* = 1799 + ERROR_INVALID_PRIORITY* = 1800 + ERROR_INVALID_PRINTER_NAME* = 1801 + ERROR_PRINTER_ALREADY_EXISTS* = 1802 + ERROR_INVALID_PRINTER_COMMAND* = 1803 + ERROR_INVALID_DATATYPE* = 1804 + ERROR_INVALID_ENVIRONMENT* = 1805 + RPC_S_NO_MORE_BINDINGS* = 1806 + ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT* = 1807 + ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT* = 1808 + ERROR_NOLOGON_SERVER_TRUST_ACCOUNT* = 1809 + ERROR_DOMAIN_TRUST_INCONSISTENT* = 1810 + ERROR_SERVER_HAS_OPEN_HANDLES* = 1811 + ERROR_RESOURCE_DATA_NOT_FOUND* = 1812 + ERROR_RESOURCE_TYPE_NOT_FOUND* = 1813 + ERROR_RESOURCE_NAME_NOT_FOUND* = 1814 + ERROR_RESOURCE_LANG_NOT_FOUND* = 1815 + ERROR_NOT_ENOUGH_QUOTA* = 1816 + RPC_S_NO_INTERFACES* = 1817 + RPC_S_CALL_CANCELLED* = 1818 + RPC_S_BINDING_INCOMPLETE* = 1819 + RPC_S_COMM_FAILURE* = 1820 + RPC_S_UNSUPPORTED_AUTHN_LEVEL* = 1821 + RPC_S_NO_PRINC_NAME* = 1822 + RPC_S_NOT_RPC_ERROR* = 1823 + RPC_S_UUID_LOCAL_ONLY* = 1824 + RPC_S_SEC_PKG_ERROR* = 1825 + RPC_S_NOT_CANCELLED* = 1826 + RPC_X_INVALID_ES_ACTION* = 1827 + RPC_X_WRONG_ES_VERSION* = 1828 + RPC_X_WRONG_STUB_VERSION* = 1829 + RPC_X_INVALID_PIPE_OBJECT* = 1830 + RPC_X_INVALID_PIPE_OPERATION* = 1831 + RPC_S_GROUP_MEMBER_NOT_FOUND* = 1898 + EPT_S_CANT_CREATE* = 1899 + RPC_S_INVALID_OBJECT* = 1900 + ERROR_INVALID_TIME* = 1901 + ERROR_INVALID_FORM_NAME* = 1902 + ERROR_INVALID_FORM_SIZE* = 1903 + ERROR_ALREADY_WAITING* = 1904 + ERROR_PRINTER_DELETED* = 1905 + ERROR_INVALID_PRINTER_STATE* = 1906 + ERROR_PASSWORD_MUST_CHANGE* = 1907 + ERROR_DOMAIN_CONTROLLER_NOT_FOUND* = 1908 + ERROR_ACCOUNT_LOCKED_OUT* = 1909 + OR_INVALID_OXID* = 1910 + OR_INVALID_OID* = 1911 + OR_INVALID_SET* = 1912 + RPC_S_SEND_INCOMPLETE* = 1913 + ERROR_NO_BROWSER_SERVERS_FOUND* = 6118 + ERROR_INVALID_PIXEL_FORMAT* = 2000 + ERROR_BAD_DRIVER* = 2001 + ERROR_INVALID_WINDOW_STYLE* = 2002 + ERROR_METAFILE_NOT_SUPPORTED* = 2003 + ERROR_TRANSFORM_NOT_SUPPORTED* = 2004 + ERROR_CLIPPING_NOT_SUPPORTED* = 2005 + ERROR_UNKNOWN_PRINT_MONITOR* = 3000 + ERROR_PRINTER_DRIVER_IN_USE* = 3001 + ERROR_SPOOL_FILE_NOT_FOUND* = 3002 + ERROR_SPL_NO_STARTDOC* = 3003 + ERROR_SPL_NO_ADDJOB* = 3004 + ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED* = 3005 + ERROR_PRINT_MONITOR_ALREADY_INSTALLED* = 3006 + ERROR_INVALID_PRINT_MONITOR* = 3007 + ERROR_PRINT_MONITOR_IN_USE* = 3008 + ERROR_PRINTER_HAS_JOBS_QUEUED* = 3009 + ERROR_SUCCESS_REBOOT_REQUIRED* = 3010 + ERROR_SUCCESS_RESTART_REQUIRED* = 3011 + ERROR_WINS_INTERNAL* = 4000 + ERROR_CAN_NOT_DEL_LOCAL_WINS* = 4001 + ERROR_STATIC_INIT* = 4002 + ERROR_INC_BACKUP* = 4003 + ERROR_FULL_BACKUP* = 4004 + ERROR_REC_NON_EXISTENT* = 4005 + ERROR_RPL_NOT_ALLOWED* = 4006 + E_UNEXPECTED* = HRESULT(0x8000FFFF) + E_NOTIMPL* = HRESULT(0x80004001) + E_OUTOFMEMORY* = HRESULT(0x8007000E) + E_INVALIDARG* = HRESULT(0x80070057) + E_NOINTERFACE* = HRESULT(0x80004002) + E_POINTER* = HRESULT(0x80004003) + E_HANDLE* = HRESULT(0x80070006) + E_ABORT* = HRESULT(0x80004004) + E_FAIL* = HRESULT(0x80004005) + E_ACCESSDENIED* = HRESULT(0x80070005) + E_PENDING* = HRESULT(0x8000000A) + CO_E_INIT_TLS* = HRESULT(0x80004006) + CO_E_INIT_SHARED_ALLOCATOR* = HRESULT(0x80004007) + CO_E_INIT_MEMORY_ALLOCATOR* = HRESULT(0x80004008) + CO_E_INIT_CLASS_CACHE* = HRESULT(0x80004009) + CO_E_INIT_RPC_CHANNEL* = HRESULT(0x8000400A) + CO_E_INIT_TLS_SET_CHANNEL_CONTROL* = HRESULT(0x8000400B) + CO_E_INIT_TLS_CHANNEL_CONTROL* = HRESULT(0x8000400C) + CO_E_INIT_UNACCEPTED_USER_ALLOCATOR* = HRESULT(0x8000400D) + CO_E_INIT_SCM_MUTEX_EXISTS* = HRESULT(0x8000400E) + CO_E_INIT_SCM_FILE_MAPPING_EXISTS* = HRESULT(0x8000400F) + CO_E_INIT_SCM_MAP_VIEW_OF_FILE* = HRESULT(0x80004010) + CO_E_INIT_SCM_EXEC_FAILURE* = HRESULT(0x80004011) + CO_E_INIT_ONLY_SINGLE_THREADED* = HRESULT(0x80004012) + CO_E_CANT_REMOTE* = HRESULT(0x80004013) + CO_E_BAD_SERVER_NAME* = HRESULT(0x80004014) + CO_E_WRONG_SERVER_IDENTITY* = HRESULT(0x80004015) + CO_E_OLE1DDE_DISABLED* = HRESULT(0x80004016) + CO_E_RUNAS_SYNTAX* = HRESULT(0x80004017) + CO_E_CREATEPROCESS_FAILURE* = HRESULT(0x80004018) + CO_E_RUNAS_CREATEPROCESS_FAILURE* = HRESULT(0x80004019) + CO_E_RUNAS_LOGON_FAILURE* = HRESULT(0x8000401A) + CO_E_LAUNCH_PERMSSION_DENIED* = HRESULT(0x8000401B) + CO_E_START_SERVICE_FAILURE* = HRESULT(0x8000401C) + CO_E_REMOTE_COMMUNICATION_FAILURE* = HRESULT(0x8000401D) + CO_E_SERVER_START_TIMEOUT* = HRESULT(0x8000401E) + CO_E_CLSREG_INCONSISTENT* = HRESULT(0x8000401F) + CO_E_IIDREG_INCONSISTENT* = HRESULT(0x80004020) + CO_E_NOT_SUPPORTED* = HRESULT(0x80004021) + CO_E_FIRST* = DWORD(0x800401F0) + CO_E_LAST* = DWORD(0x800401FF) + CO_S_FIRST* = DWORD(0x000401F0) + CO_S_LAST* = DWORD(0x000401FF) + S_OK* = HRESULT(0x00000000) + S_FALSE* = HRESULT(0x00000001) + CO_E_NOTINITIALIZED* = HRESULT(0x800401F0) + CO_E_ALREADYINITIALIZED* = HRESULT(0x800401F1) + CO_E_CANTDETERMINECLASS* = HRESULT(0x800401F2) + CO_E_CLASSSTRING* = HRESULT(0x800401F3) + CO_E_IIDSTRING* = HRESULT(0x800401F4) + CO_E_APPNOTFOUND* = HRESULT(0x800401F5) + CO_E_APPSINGLEUSE* = HRESULT(0x800401F6) + CO_E_ERRORINAPP* = HRESULT(0x800401F7) + CO_E_DLLNOTFOUND* = HRESULT(0x800401F8) + CO_E_ERRORINDLL* = HRESULT(0x800401F9) + CO_E_WRONGOSFORAPP* = HRESULT(0x800401FA) + CO_E_OBJNOTREG* = HRESULT(0x800401FB) + CO_E_OBJISREG* = HRESULT(0x800401FC) + CO_E_OBJNOTCONNECTED* = HRESULT(0x800401FD) + CO_E_APPDIDNTREG* = HRESULT(0x800401FE) + CO_E_RELEASED* = HRESULT(0x800401FF) + OLE_E_FIRST* = HRESULT(0x80040000) + OLE_E_LAST* = HRESULT(0x800400FF) + OLE_S_FIRST* = HRESULT(0x00040000) + OLE_S_LAST* = HRESULT(0x000400FF) + OLE_E_OLEVERB* = HRESULT(0x80040000) + OLE_E_ADVF* = HRESULT(0x80040001) + OLE_E_ENUM_NOMORE* = HRESULT(0x80040002) + OLE_E_ADVISENOTSUPPORTED* = HRESULT(0x80040003) + OLE_E_NOCONNECTION* = HRESULT(0x80040004) + OLE_E_NOTRUNNING* = HRESULT(0x80040005) + OLE_E_NOCACHE* = HRESULT(0x80040006) + OLE_E_BLANK* = HRESULT(0x80040007) + OLE_E_CLASSDIFF* = HRESULT(0x80040008) + OLE_E_CANT_GETMONIKER* = HRESULT(0x80040009) + OLE_E_CANT_BINDTOSOURCE* = HRESULT(0x8004000A) + OLE_E_STATIC* = HRESULT(0x8004000B) + OLE_E_PROMPTSAVECANCELLED* = HRESULT(0x8004000C) + OLE_E_INVALIDRECT* = HRESULT(0x8004000D) + OLE_E_WRONGCOMPOBJ* = HRESULT(0x8004000E) + OLE_E_INVALIDHWND* = HRESULT(0x8004000F) + OLE_E_NOT_INPLACEACTIVE* = HRESULT(0x80040010) + OLE_E_CANTCONVERT* = HRESULT(0x80040011) + OLE_E_NOSTORAGE* = HRESULT(0x80040012) + DV_E_FORMATETC* = HRESULT(0x80040064) + DV_E_DVTARGETDEVICE* = HRESULT(0x80040065) + DV_E_STGMEDIUM* = HRESULT(0x80040066) + DV_E_STATDATA* = HRESULT(0x80040067) + DV_E_LINDEX* = HRESULT(0x80040068) + DV_E_TYMED* = HRESULT(0x80040069) + DV_E_CLIPFORMAT* = HRESULT(0x8004006A) + DV_E_DVASPECT* = HRESULT(0x8004006B) + DV_E_DVTARGETDEVICE_SIZE* = HRESULT(0x8004006C) + DV_E_NOIVIEWOBJECT* = HRESULT(0x8004006D) + DRAGDROP_E_FIRST* = DWORD(0x80040100) + DRAGDROP_E_LAST* = DWORD(0x8004010F) + DRAGDROP_S_FIRST* = DWORD(0x00040100) + DRAGDROP_S_LAST* = DWORD(0x0004010F) + DRAGDROP_E_NOTREGISTERED* = HRESULT(0x80040100) + DRAGDROP_E_ALREADYREGISTERED* = HRESULT(0x80040101) + DRAGDROP_E_INVALIDHWND* = HRESULT(0x80040102) + CLASSFACTORY_E_FIRST* = DWORD(0x80040110) + CLASSFACTORY_E_LAST* = DWORD(0x8004011F) + CLASSFACTORY_S_FIRST* = DWORD(0x00040110) + CLASSFACTORY_S_LAST* = DWORD(0x0004011F) + CLASS_E_NOAGGREGATION* = HRESULT(0x80040110) + CLASS_E_CLASSNOTAVAILABLE* = HRESULT(0x80040111) + MARSHAL_E_FIRST* = DWORD(0x80040120) + MARSHAL_E_LAST* = DWORD(0x8004012F) + MARSHAL_S_FIRST* = DWORD(0x00040120) + MARSHAL_S_LAST* = DWORD(0x0004012F) + DATA_E_FIRST* = DWORD(0x80040130) + DATA_E_LAST* = DWORD(0x8004013F) + DATA_S_FIRST* = DWORD(0x00040130) + DATA_S_LAST* = DWORD(0x0004013F) + VIEW_E_FIRST* = DWORD(0x80040140) + VIEW_E_LAST* = DWORD(0x8004014F) + VIEW_S_FIRST* = DWORD(0x00040140) + VIEW_S_LAST* = DWORD(0x0004014F) + VIEW_E_DRAW* = HRESULT(0x80040140) + REGDB_E_FIRST* = DWORD(0x80040150) + REGDB_E_LAST* = DWORD(0x8004015F) + REGDB_S_FIRST* = DWORD(0x00040150) + REGDB_S_LAST* = DWORD(0x0004015F) + REGDB_E_READREGDB* = HRESULT(0x80040150) + REGDB_E_WRITEREGDB* = HRESULT(0x80040151) + REGDB_E_KEYMISSING* = HRESULT(0x80040152) + REGDB_E_INVALIDVALUE* = HRESULT(0x80040153) + REGDB_E_CLASSNOTREG* = HRESULT(0x80040154) + REGDB_E_IIDNOTREG* = HRESULT(0x80040155) + CACHE_E_FIRST* = DWORD(0x80040170) + CACHE_E_LAST* = DWORD(0x8004017F) + CACHE_S_FIRST* = DWORD(0x00040170) + CACHE_S_LAST* = DWORD(0x0004017F) + CACHE_E_NOCACHE_UPDATED* = HRESULT(0x80040170) + OLEOBJ_E_FIRST* = DWORD(0x80040180) + OLEOBJ_E_LAST* = DWORD(0x8004018F) + OLEOBJ_S_FIRST* = DWORD(0x00040180) + OLEOBJ_S_LAST* = DWORD(0x0004018F) + OLEOBJ_E_NOVERBS* = HRESULT(0x80040180) + OLEOBJ_E_INVALIDVERB* = HRESULT(0x80040181) + CLIENTSITE_E_FIRST* = DWORD(0x80040190) + CLIENTSITE_E_LAST* = DWORD(0x8004019F) + CLIENTSITE_S_FIRST* = DWORD(0x00040190) + CLIENTSITE_S_LAST* = DWORD(0x0004019F) + INPLACE_E_NOTUNDOABLE* = HRESULT(0x800401A0) + INPLACE_E_NOTOOLSPACE* = HRESULT(0x800401A1) + INPLACE_E_FIRST* = DWORD(0x800401A0) + INPLACE_E_LAST* = DWORD(0x800401AF) + INPLACE_S_FIRST* = DWORD(0x000401A0) + INPLACE_S_LAST* = DWORD(0x000401AF) + ENUM_E_FIRST* = DWORD(0x800401B0) + ENUM_E_LAST* = DWORD(0x800401BF) + ENUM_S_FIRST* = DWORD(0x000401B0) + ENUM_S_LAST* = DWORD(0x000401BF) + CONVERT10_E_FIRST* = DWORD(0x800401C0) + CONVERT10_E_LAST* = DWORD(0x800401CF) + CONVERT10_S_FIRST* = DWORD(0x000401C0) + CONVERT10_S_LAST* = DWORD(0x000401CF) + CONVERT10_E_OLESTREAM_GET* = HRESULT(0x800401C0) + CONVERT10_E_OLESTREAM_PUT* = HRESULT(0x800401C1) + CONVERT10_E_OLESTREAM_FMT* = HRESULT(0x800401C2) + CONVERT10_E_OLESTREAM_BITMAP_TO_DIB* = HRESULT(0x800401C3) + CONVERT10_E_STG_FMT* = HRESULT(0x800401C4) + CONVERT10_E_STG_NO_STD_STREAM* = HRESULT(0x800401C5) + CONVERT10_E_STG_DIB_TO_BITMAP* = HRESULT(0x800401C6) + CLIPBRD_E_FIRST* = DWORD(0x800401D0) + CLIPBRD_E_LAST* = DWORD(0x800401DF) + CLIPBRD_S_FIRST* = DWORD(0x000401D0) + CLIPBRD_S_LAST* = DWORD(0x000401DF) + CLIPBRD_E_CANT_OPEN* = HRESULT(0x800401D0) + CLIPBRD_E_CANT_EMPTY* = HRESULT(0x800401D1) + CLIPBRD_E_CANT_SET* = HRESULT(0x800401D2) + CLIPBRD_E_BAD_DATA* = HRESULT(0x800401D3) + CLIPBRD_E_CANT_CLOSE* = HRESULT(0x800401D4) + MK_E_FIRST* = DWORD(0x800401E0) + MK_E_LAST* = DWORD(0x800401EF) + MK_S_FIRST* = DWORD(0x000401E0) + MK_S_LAST* = DWORD(0x000401EF) + MK_E_CONNECTMANUALLY* = HRESULT(0x800401E0) + MK_E_EXCEEDEDDEADLINE* = HRESULT(0x800401E1) + MK_E_NEEDGENERIC* = HRESULT(0x800401E2) + MK_E_UNAVAILABLE* = HRESULT(0x800401E3) + MK_E_SYNTAX* = HRESULT(0x800401E4) + MK_E_NOOBJECT* = HRESULT(0x800401E5) + MK_E_INVALIDEXTENSION* = HRESULT(0x800401E6) + MK_E_INTERMEDIATEINTERFACENOTSUPPORTED* = HRESULT(0x800401E7) + MK_E_NOTBINDABLE* = HRESULT(0x800401E8) + MK_E_NOTBOUND* = HRESULT(0x800401E9) + MK_E_CANTOPENFILE* = HRESULT(0x800401EA) + MK_E_MUSTBOTHERUSER* = HRESULT(0x800401EB) + MK_E_NOINVERSE* = HRESULT(0x800401EC) + MK_E_NOSTORAGE* = HRESULT(0x800401ED) + MK_E_NOPREFIX* = HRESULT(0x800401EE) + MK_E_ENUMERATION_FAILED* = HRESULT(0x800401EF) + OLE_S_USEREG* = HRESULT(0x00040000) + OLE_S_STATIC* = HRESULT(0x00040001) + OLE_S_MAC_CLIPFORMAT* = HRESULT(0x00040002) + DRAGDROP_S_DROP* = HRESULT(0x00040100) + DRAGDROP_S_CANCEL* = HRESULT(0x00040101) + DRAGDROP_S_USEDEFAULTCURSORS* = HRESULT(0x00040102) + DATA_S_SAMEFORMATETC* = HRESULT(0x00040130) + VIEW_S_ALREADY_FROZEN* = HRESULT(0x00040140) + CACHE_S_FORMATETC_NOTSUPPORTED* = HRESULT(0x00040170) + CACHE_S_SAMECACHE* = HRESULT(0x00040171) + CACHE_S_SOMECACHES_NOTUPDATED* = HRESULT(0x00040172) + OLEOBJ_S_INVALIDVERB* = HRESULT(0x00040180) + OLEOBJ_S_CANNOT_DOVERB_NOW* = HRESULT(0x00040181) + OLEOBJ_S_INVALIDHWND* = HRESULT(0x00040182) + INPLACE_S_TRUNCATED* = HRESULT(0x000401A0) + CONVERT10_S_NO_PRESENTATION* = HRESULT(0x000401C0) + MK_S_REDUCED_TO_SELF* = HRESULT(0x000401E2) + MK_S_ME* = HRESULT(0x000401E4) + MK_S_HIM* = HRESULT(0x000401E5) + MK_S_US* = HRESULT(0x000401E6) + MK_S_MONIKERALREADYREGISTERED* = HRESULT(0x000401E7) + CO_E_CLASS_CREATE_FAILED* = HRESULT(0x80080001) + CO_E_SCM_ERROR* = HRESULT(0x80080002) + CO_E_SCM_RPC_FAILURE* = HRESULT(0x80080003) + CO_E_BAD_PATH* = HRESULT(0x80080004) + CO_E_SERVER_EXEC_FAILURE* = HRESULT(0x80080005) + CO_E_OBJSRV_RPC_FAILURE* = HRESULT(0x80080006) + MK_E_NO_NORMALIZED* = HRESULT(0x80080007) + CO_E_SERVER_STOPPING* = HRESULT(0x80080008) + MEM_E_INVALID_ROOT* = HRESULT(0x80080009) + MEM_E_INVALID_LINK* = HRESULT(0x80080010) + MEM_E_INVALID_SIZE* = HRESULT(0x80080011) + CO_S_NOTALLINTERFACES* = HRESULT(0x00080012) + DISP_E_UNKNOWNINTERFACE* = HRESULT(0x80020001) + DISP_E_MEMBERNOTFOUND* = HRESULT(0x80020003) + DISP_E_PARAMNOTFOUND* = HRESULT(0x80020004) + DISP_E_TYPEMISMATCH* = HRESULT(0x80020005) + DISP_E_UNKNOWNNAME* = HRESULT(0x80020006) + DISP_E_NONAMEDARGS* = HRESULT(0x80020007) + DISP_E_BADVARTYPE* = HRESULT(0x80020008) + DISP_E_EXCEPTION* = HRESULT(0x80020009) + DISP_E_OVERFLOW* = HRESULT(0x8002000A) + DISP_E_BADINDEX* = HRESULT(0x8002000B) + DISP_E_UNKNOWNLCID* = HRESULT(0x8002000C) + DISP_E_ARRAYISLOCKED* = HRESULT(0x8002000D) + DISP_E_BADPARAMCOUNT* = HRESULT(0x8002000E) + DISP_E_PARAMNOTOPTIONAL* = HRESULT(0x8002000F) + DISP_E_BADCALLEE* = HRESULT(0x80020010) + DISP_E_NOTACOLLECTION* = HRESULT(0x80020011) + TYPE_E_BUFFERTOOSMALL* = HRESULT(0x80028016) + TYPE_E_INVDATAREAD* = HRESULT(0x80028018) + TYPE_E_UNSUPFORMAT* = HRESULT(0x80028019) + TYPE_E_REGISTRYACCESS* = HRESULT(0x8002801C) + TYPE_E_LIBNOTREGISTERED* = HRESULT(0x8002801D) + TYPE_E_UNDEFINEDTYPE* = HRESULT(0x80028027) + TYPE_E_QUALIFIEDNAMEDISALLOWED* = HRESULT(0x80028028) + TYPE_E_INVALIDSTATE* = HRESULT(0x80028029) + TYPE_E_WRONGTYPEKIND* = HRESULT(0x8002802A) + TYPE_E_ELEMENTNOTFOUND* = HRESULT(0x8002802B) + TYPE_E_AMBIGUOUSNAME* = HRESULT(0x8002802C) + TYPE_E_NAMECONFLICT* = HRESULT(0x8002802D) + TYPE_E_UNKNOWNLCID* = HRESULT(0x8002802E) + TYPE_E_DLLFUNCTIONNOTFOUND* = HRESULT(0x8002802F) + TYPE_E_BADMODULEKIND* = HRESULT(0x800288BD) + TYPE_E_SIZETOOBIG* = HRESULT(0x800288C5) + TYPE_E_DUPLICATEID* = HRESULT(0x800288C6) + TYPE_E_INVALIDID* = HRESULT(0x800288CF) + TYPE_E_TYPEMISMATCH* = HRESULT(0x80028CA0) + TYPE_E_OUTOFBOUNDS* = HRESULT(0x80028CA1) + TYPE_E_IOERROR* = HRESULT(0x80028CA2) + TYPE_E_CANTCREATETMPFILE* = HRESULT(0x80028CA3) + TYPE_E_CANTLOADLIBRARY* = HRESULT(0x80029C4A) + TYPE_E_INCONSISTENTPROPFUNCS* = HRESULT(0x80029C83) + TYPE_E_CIRCULARTYPE* = HRESULT(0x80029C84) + STG_E_INVALIDFUNCTION* = HRESULT(0x80030001) + STG_E_FILENOTFOUND* = HRESULT(0x80030002) + STG_E_PATHNOTFOUND* = HRESULT(0x80030003) + STG_E_TOOMANYOPENFILES* = HRESULT(0x80030004) + STG_E_ACCESSDENIED* = HRESULT(0x80030005) + STG_E_INVALIDHANDLE* = HRESULT(0x80030006) + STG_E_INSUFFICIENTMEMORY* = HRESULT(0x80030008) + STG_E_INVALIDPOINTER* = HRESULT(0x80030009) + STG_E_NOMOREFILES* = HRESULT(0x80030012) + STG_E_DISKISWRITEPROTECTED* = HRESULT(0x80030013) + STG_E_SEEKERROR* = HRESULT(0x80030019) + STG_E_WRITEFAULT* = HRESULT(0x8003001D) + STG_E_READFAULT* = HRESULT(0x8003001E) + STG_E_SHAREVIOLATION* = HRESULT(0x80030020) + STG_E_LOCKVIOLATION* = HRESULT(0x80030021) + STG_E_FILEALREADYEXISTS* = HRESULT(0x80030050) + STG_E_INVALIDPARAMETER* = HRESULT(0x80030057) + STG_E_MEDIUMFULL* = HRESULT(0x80030070) + STG_E_PROPSETMISMATCHED* = HRESULT(0x800300F0) + STG_E_ABNORMALAPIEXIT* = HRESULT(0x800300FA) + STG_E_INVALIDHEADER* = HRESULT(0x800300FB) + STG_E_INVALIDNAME* = HRESULT(0x800300FC) + STG_E_UNKNOWN* = HRESULT(0x800300FD) + STG_E_UNIMPLEMENTEDFUNCTION* = HRESULT(0x800300FE) + STG_E_INVALIDFLAG* = HRESULT(0x800300FF) + STG_E_INUSE* = HRESULT(0x80030100) + STG_E_NOTCURRENT* = HRESULT(0x80030101) + STG_E_REVERTED* = HRESULT(0x80030102) + STG_E_CANTSAVE* = HRESULT(0x80030103) + STG_E_OLDFORMAT* = HRESULT(0x80030104) + STG_E_OLDDLL* = HRESULT(0x80030105) + STG_E_SHAREREQUIRED* = HRESULT(0x80030106) + STG_E_NOTFILEBASEDSTORAGE* = HRESULT(0x80030107) + STG_E_EXTANTMARSHALLINGS* = HRESULT(0x80030108) + STG_E_DOCFILECORRUPT* = HRESULT(0x80030109) + STG_E_BADBASEADDRESS* = HRESULT(0x80030110) + STG_E_INCOMPLETE* = HRESULT(0x80030201) + STG_E_TERMINATED* = HRESULT(0x80030202) + STG_S_CONVERTED* = HRESULT(0x00030200) + STG_S_BLOCK* = HRESULT(0x00030201) + STG_S_RETRYNOW* = HRESULT(0x00030202) + STG_S_MONITORING* = HRESULT(0x00030203) + RPC_E_CALL_REJECTED* = HRESULT(0x80010001) + RPC_E_CALL_CANCELED* = HRESULT(0x80010002) + RPC_E_CANTPOST_INSENDCALL* = HRESULT(0x80010003) + RPC_E_CANTCALLOUT_INASYNCCALL* = HRESULT(0x80010004) + RPC_E_CANTCALLOUT_INEXTERNALCALL* = HRESULT(0x80010005) + RPC_E_CONNECTION_TERMINATED* = HRESULT(0x80010006) + RPC_E_SERVER_DIED* = HRESULT(0x80010007) + RPC_E_CLIENT_DIED* = HRESULT(0x80010008) + RPC_E_INVALID_DATAPACKET* = HRESULT(0x80010009) + RPC_E_CANTTRANSMIT_CALL* = HRESULT(0x8001000A) + RPC_E_CLIENT_CANTMARSHAL_DATA* = HRESULT(0x8001000B) + RPC_E_CLIENT_CANTUNMARSHAL_DATA* = HRESULT(0x8001000C) + RPC_E_SERVER_CANTMARSHAL_DATA* = HRESULT(0x8001000D) + RPC_E_SERVER_CANTUNMARSHAL_DATA* = HRESULT(0x8001000E) + RPC_E_INVALID_DATA* = HRESULT(0x8001000F) + RPC_E_INVALID_PARAMETER* = HRESULT(0x80010010) + RPC_E_CANTCALLOUT_AGAIN* = HRESULT(0x80010011) + RPC_E_SERVER_DIED_DNE* = HRESULT(0x80010012) + RPC_E_SYS_CALL_FAILED* = HRESULT(0x80010100) + RPC_E_OUT_OF_RESOURCES* = HRESULT(0x80010101) + RPC_E_ATTEMPTED_MULTITHREAD* = HRESULT(0x80010102) + RPC_E_NOT_REGISTERED* = HRESULT(0x80010103) + RPC_E_FAULT* = HRESULT(0x80010104) + RPC_E_SERVERFAULT* = HRESULT(0x80010105) + RPC_E_CHANGED_MODE* = HRESULT(0x80010106) + RPC_E_INVALIDMETHOD* = HRESULT(0x80010107) + RPC_E_DISCONNECTED* = HRESULT(0x80010108) + RPC_E_RETRY* = HRESULT(0x80010109) + RPC_E_SERVERCALL_RETRYLATER* = HRESULT(0x8001010A) + RPC_E_SERVERCALL_REJECTED* = HRESULT(0x8001010B) + RPC_E_INVALID_CALLDATA* = HRESULT(0x8001010C) + RPC_E_CANTCALLOUT_ININPUTSYNCCALL* = HRESULT(0x8001010D) + RPC_E_WRONG_THREAD* = HRESULT(0x8001010E) + RPC_E_THREAD_NOT_INIT* = HRESULT(0x8001010F) + RPC_E_VERSION_MISMATCH* = HRESULT(0x80010110) + RPC_E_INVALID_HEADER* = HRESULT(0x80010111) + RPC_E_INVALID_EXTENSION* = HRESULT(0x80010112) + RPC_E_INVALID_IPID* = HRESULT(0x80010113) + RPC_E_INVALID_OBJECT* = HRESULT(0x80010114) + RPC_S_CALLPENDING* = HRESULT(0x80010115) + RPC_S_WAITONTIMER* = HRESULT(0x80010116) + RPC_E_CALL_COMPLETE* = HRESULT(0x80010117) + RPC_E_UNSECURE_CALL* = HRESULT(0x80010118) + RPC_E_TOO_LATE* = HRESULT(0x80010119) + RPC_E_NO_GOOD_SECURITY_PACKAGES* = HRESULT(0x8001011A) + RPC_E_ACCESS_DENIED* = HRESULT(0x8001011B) + RPC_E_REMOTE_DISABLED* = HRESULT(0x8001011C) + RPC_E_INVALID_OBJREF* = HRESULT(0x8001011D) + RPC_E_UNEXPECTED* = HRESULT(0x8001FFFF) + NTE_BAD_UID* = HRESULT(0x80090001) + NTE_BAD_HASH* = HRESULT(0x80090002) + NTE_BAD_KEY* = HRESULT(0x80090003) + NTE_BAD_LEN* = HRESULT(0x80090004) + NTE_BAD_DATA* = HRESULT(0x80090005) + NTE_BAD_SIGNATURE* = HRESULT(0x80090006) + NTE_BAD_VER* = HRESULT(0x80090007) + NTE_BAD_ALGID* = HRESULT(0x80090008) + NTE_BAD_FLAGS* = HRESULT(0x80090009) + NTE_BAD_TYPE* = HRESULT(0x8009000A) + NTE_BAD_KEY_STATE* = HRESULT(0x8009000B) + NTE_BAD_HASH_STATE* = HRESULT(0x8009000C) + NTE_NO_KEY* = HRESULT(0x8009000D) + NTE_NO_MEMORY* = HRESULT(0x8009000E) + NTE_EXISTS* = HRESULT(0x8009000F) + NTE_PERM* = HRESULT(0x80090010) + NTE_NOT_FOUND* = HRESULT(0x80090011) + NTE_DOUBLE_ENCRYPT* = HRESULT(0x80090012) + NTE_BAD_PROVIDER* = HRESULT(0x80090013) + NTE_BAD_PROV_TYPE* = HRESULT(0x80090014) + NTE_BAD_PUBLIC_KEY* = HRESULT(0x80090015) + NTE_BAD_KEYSET* = HRESULT(0x80090016) + NTE_PROV_TYPE_NOT_DEF* = HRESULT(0x80090017) + NTE_PROV_TYPE_ENTRY_BAD* = HRESULT(0x80090018) + NTE_KEYSET_NOT_DEF* = HRESULT(0x80090019) + NTE_KEYSET_ENTRY_BAD* = HRESULT(0x8009001A) + NTE_PROV_TYPE_NO_MATCH* = HRESULT(0x8009001B) + NTE_SIGNATURE_FILE_BAD* = HRESULT(0x8009001C) + NTE_PROVIDER_DLL_FAIL* = HRESULT(0x8009001D) + NTE_PROV_DLL_NOT_FOUND* = HRESULT(0x8009001E) + NTE_BAD_KEYSET_PARAM* = HRESULT(0x8009001F) + NTE_FAIL* = HRESULT(0x80090020) + NTE_SYS_ERR* = HRESULT(0x80090021) + NTE_OP_OK* = HRESULT(0) + TRUST_E_PROVIDER_UNKNOWN* = HRESULT(0x800B0001) + TRUST_E_ACTION_UNKNOWN* = HRESULT(0x800B0002) + TRUST_E_SUBJECT_FORM_UNKNOWN* = HRESULT(0x800B0003) + TRUST_E_SUBJECT_NOT_TRUSTED* = HRESULT(0x800B0004) + DIGSIG_E_ENCODE* = HRESULT(0x800B0005) + DIGSIG_E_DECODE* = HRESULT(0x800B0006) + DIGSIG_E_EXTENSIBILITY* = HRESULT(0x800B0007) + DIGSIG_E_CRYPTO* = HRESULT(0x800B0008) + PERSIST_E_SIZEDEFINITE* = HRESULT(0x800B0009) + PERSIST_E_SIZEINDEFINITE* = HRESULT(0x800B000A) + PERSIST_E_NOTSELFSIZING* = HRESULT(0x800B000B) + TRUST_E_NOSIGNATURE* = HRESULT(0x800B0100) + CERT_E_EXPIRED* = HRESULT(0x800B0101) + CERT_E_VALIDIYPERIODNESTING* = HRESULT(0x800B0102) + CERT_E_ROLE* = HRESULT(0x800B0103) + CERT_E_PATHLENCONST* = HRESULT(0x800B0104) + CERT_E_CRITICAL* = HRESULT(0x800B0105) + CERT_E_PURPOSE* = HRESULT(0x800B0106) + CERT_E_ISSUERCHAINING* = HRESULT(0x800B0107) + CERT_E_MALFORMED* = HRESULT(0x800B0108) + CERT_E_UNTRUSTEDROOT* = HRESULT(0x800B0109) + CERT_E_CHAINING* = HRESULT(0x800B010A) + +proc UNICODE_NULL*(): WCHAR +const + LF_FACESIZE* = 32 + LF_FULLFACESIZE* = 64 + ELF_VENDOR_SIZE* = 4 + SECURITY_STATIC_TRACKING* = 0 + SECURITY_DYNAMIC_TRACKING* = 1 + MAX_DEFAULTCHAR* = 2 + MAX_LEADBYTES* = 12 + EXCEPTION_MAXIMUM_PARAMETERS* = 15 + CCHDEVICENAME* = 32 + CCHFORMNAME* = 32 + MENU_TEXT_LEN* = 40 + MAX_LANA* = 254 + NCBNAMSZ* = 16 + NETBIOS_NAME_LEN* = 16 + OFS_MAXPATHNAME* = 128 + MAX_TAB_STOPS* = 32 + ANYSIZE_ARRAY* = 1 + RAS_MaxCallbackNumber* = 128 + RAS_MaxDeviceName* = 128 + RAS_MaxDeviceType* = 16 + RAS_MaxEntryName* = 256 + RAS_MaxIpAddress* = 15 + RAS_MaxIpxAddress* = 21 + RAS_MaxPhoneNumber* = 128 + UNLEN* = 256 + PWLEN* = 256 + CNLEN* = 15 + DNLEN* = 15 + # Unsigned types max + MAXDWORD* = 0xFFFFFFFF + MAXWORD* = 0x0000FFFF + MAXBYTE* = 0x000000FF + # Signed types max/min + MINCHAR* = 0x00000080 + MAXCHAR* = 0x0000007F + MINSHORT* = 0x00008000 + MAXSHORT* = 0x00007FFF + MINLONG* = 0x80000000 + MAXLONG* = 0x7FFFFFFF + # _llseek + FILE_BEGIN* = 0 + FILE_CURRENT* = 1 + FILE_END* = 2 + # _lopen, LZOpenFile, OpenFile + OF_READ* = 0 + OF_READWRITE* = 2 + OF_WRITE* = 1 + OF_SHARE_COMPAT* = 0 + OF_SHARE_DENY_NONE* = 64 + OF_SHARE_DENY_READ* = 48 + OF_SHARE_DENY_WRITE* = 32 + OF_SHARE_EXCLUSIVE* = 16 + OF_CANCEL* = 2048 + OF_CREATE* = 4096 + OF_DELETE* = 512 + OF_EXIST* = 16384 + OF_PARSE* = 256 + OF_PROMPT* = 8192 + OF_REOPEN* = 32768 + OF_VERIFY* = 1024 + # ActivateKeyboardLayout, LoadKeyboardLayout + HKL_NEXT* = 1 + HKL_PREV* = 0 + KLF_REORDER* = 8 + KLF_UNLOADPREVIOUS* = 4 + KLF_ACTIVATE* = 1 + KLF_NOTELLSHELL* = 128 + KLF_REPLACELANG* = 16 + KLF_SUBSTITUTE_OK* = 2 + # AppendMenu + MF_BITMAP* = 0x00000004 + MF_DISABLED* = 0x00000002 + MF_ENABLED* = 0 + MF_GRAYED* = 0x00000001 + MF_HELP* = 0x00004000 + MF_MENUBARBREAK* = 0x00000020 + MF_MENUBREAK* = 0x00000040 + MF_MOUSESELECT* = 0x00008000 + MF_OWNERDRAW* = 0x00000100 + MF_POPUP* = 0x00000010 + MF_SEPARATOR* = 0x00000800 + MF_STRING* = 0 + MF_SYSMENU* = 0x00002000 + MF_USECHECKBITMAPS* = 0x00000200 + # Ternary Raster Operations - BitBlt + BLACKNESS* = 0x00000042 + NOTSRCERASE* = 0x001100A6 + NOTSRCCOPY* = 0x00330008 + SRCERASE* = 0x00440328 + DSTINVERT* = 0x00550009 + PATINVERT* = 0x005A0049 + SRCINVERT* = 0x00660046 + SRCAND* = 0x008800C6 + MERGEPAINT* = 0x00BB0226 + MERGECOPY* = 0x00C000CA + SRCCOPY* = 0x00CC0020 + SRCPAINT* = 0x00EE0086 + PATCOPY* = 0x00F00021 + PATPAINT* = 0x00FB0A09 + WHITENESS* = 0x00FF0062 + # Binary Raster Operations + R2_BLACK* = 1 + R2_COPYPEN* = 13 + R2_MASKNOTPEN* = 3 + R2_MASKPEN* = 9 + R2_MASKPENNOT* = 5 + R2_MERGENOTPEN* = 12 + R2_MERGEPEN* = 15 + R2_MERGEPENNOT* = 14 + R2_NOP* = 11 + R2_NOT* = 6 + R2_NOTCOPYPEN* = 4 + R2_NOTMASKPEN* = 8 + R2_NOTMERGEPEN* = 2 + R2_NOTXORPEN* = 10 + R2_WHITE* = 16 + R2_XORPEN* = 7 + # BroadcastSystemMessage + BSF_FLUSHDISK* = 4 + BSF_FORCEIFHUNG* = 32 + BSF_IGNORECURRENTTASK* = 2 + BSF_NOHANG* = 8 + BSF_POSTMESSAGE* = 16 + BSF_QUERY* = 1 + BSM_ALLCOMPONENTS* = 0 + BSM_APPLICATIONS* = 8 + BSM_INSTALLABLEDRIVERS* = 4 + BSM_NETDRIVER* = 2 + BSM_VXDS* = 1 + BROADCAST_QUERY_DENY* = 1112363332 + # CallNamedPipe + NMPWAIT_NOWAIT* = 1 + NMPWAIT_WAIT_FOREVER* = -1 + NMPWAIT_USE_DEFAULT_WAIT* = 0 + # CascadeWindows, TileWindows + MDITILE_SKIPDISABLED* = 2 + MDITILE_HORIZONTAL* = 1 + MDITILE_VERTICAL* = 0 + # CBTProc + HCBT_ACTIVATE* = 5 + HCBT_CLICKSKIPPED* = 6 + HCBT_CREATEWND* = 3 + HCBT_DESTROYWND* = 4 + HCBT_KEYSKIPPED* = 7 + HCBT_MINMAX* = 1 + HCBT_MOVESIZE* = 0 + HCBT_QS* = 2 + HCBT_SETFOCUS* = 9 + HCBT_SYSCOMMAND* = 8 + + CDS_UPDATEREGISTRY* = 1 + CDS_TEST* = 2 + CDS_FULLSCREEN* = 4 + CDS_GLOBAL* = 8 + CDS_SET_PRIMARY* = 0x00000010 + CDS_RESET* = 0x40000000 + CDS_SETRECT* = 0x20000000 + CDS_NORESET* = 0x10000000 + DISP_CHANGE_SUCCESSFUL* = 0 + DISP_CHANGE_RESTART* = 1 + DISP_CHANGE_BADFLAGS* = -4 + DISP_CHANGE_FAILED* = -1 + DISP_CHANGE_BADMODE* = -2 + DISP_CHANGE_NOTUPDATED* = -3 + # ChangeServiceConfig + SERVICE_NO_CHANGE* = -1 + SERVICE_WIN32_OWN_PROCESS* = 16 + SERVICE_WIN32_SHARE_PROCESS* = 32 + SERVICE_KERNEL_DRIVER* = 1 + SERVICE_FILE_SYSTEM_DRIVER* = 2 + SERVICE_INTERACTIVE_PROCESS* = 256 + SERVICE_BOOT_START* = 0 + SERVICE_SYSTEM_START* = 1 + SERVICE_AUTO_START* = 2 + SERVICE_DEMAND_START* = 3 + SERVICE_DISABLED* = 4 + SERVICE_STOPPED* = 1 + SERVICE_START_PENDING* = 2 + SERVICE_STOP_PENDING* = 3 + SERVICE_RUNNING* = 4 + SERVICE_CONTINUE_PENDING* = 5 + SERVICE_PAUSE_PENDING* = 6 + SERVICE_PAUSED* = 7 + SERVICE_ACCEPT_STOP* = 1 + SERVICE_ACCEPT_PAUSE_CONTINUE* = 2 + SERVICE_ACCEPT_SHUTDOWN* = 4 + # CheckDlgButton + BST_CHECKED* = 1 + BST_INDETERMINATE* = 2 + BST_UNCHECKED* = 0 + BST_FOCUS* = 8 + BST_PUSHED* = 4 + # CheckMenuItem, HiliteMenuItem + MF_BYCOMMAND* = 0 + MF_BYPOSITION* = 0x00000400 + MF_CHECKED* = 0x00000008 + MF_UNCHECKED* = 0 + MF_HILITE* = 0x00000080 + MF_UNHILITE* = 0 + # ChildWindowFromPointEx + CWP_ALL* = 0 + CWP_SKIPINVISIBLE* = 1 + CWP_SKIPDISABLED* = 2 + CWP_SKIPTRANSPARENT* = 4 + # ClearCommError + CE_BREAK* = 16 + CE_DNS* = 2048 + CE_FRAME* = 8 + CE_IOE* = 1024 + CE_MODE* = 32768 + CE_OOP* = 4096 + CE_OVERRUN* = 2 + CE_PTO* = 512 + CE_RXOVER* = 1 + CE_RXPARITY* = 4 + CE_TXFULL* = 256 + # CombineRgn + RGN_AND* = 1 + RGN_COPY* = 5 + RGN_DIFF* = 4 + RGN_OR* = 2 + RGN_XOR* = 3 + NULLREGION* = 1 + SIMPLEREGION* = 2 + COMPLEXREGION* = 3 + ERROR* = 0 + # CommonDlgExtendedError + CDERR_DIALOGFAILURE* = 0x0000FFFF + CDERR_FINDRESFAILURE* = 6 + CDERR_INITIALIZATION* = 2 + CDERR_LOADRESFAILURE* = 7 + CDERR_LOADSTRFAILURE* = 5 + CDERR_LOCKRESFAILURE* = 8 + CDERR_MEMALLOCFAILURE* = 9 + CDERR_MEMLOCKFAILURE* = 10 + CDERR_NOHINSTANCE* = 4 + CDERR_NOHOOK* = 11 + CDERR_NOTEMPLATE* = 3 + CDERR_REGISTERMSGFAIL* = 12 + CDERR_STRUCTSIZE* = 1 + PDERR_CREATEICFAILURE* = 0x00001000 + 10 + PDERR_DEFAULTDIFFERENT* = 0x00001000 + 12 + PDERR_DNDMMISMATCH* = 0x00001000 + 9 + PDERR_GETDEVMODEFAIL* = 0x00001000 + 5 + PDERR_INITFAILURE* = 0x00001000 + 6 + PDERR_LOADDRVFAILURE* = 0x00001000 + 4 + PDERR_NODEFAULTPRN* = 0x00001000 + 8 + PDERR_NODEVICES* = 0x00001000 + 7 + PDERR_PARSEFAILURE* = 0x00001000 + 2 + PDERR_PRINTERNOTFOUND* = 0x00001000 + 11 + PDERR_RETDEFFAILURE* = 0x00001000 + 3 + PDERR_SETUPFAILURE* = 0x00001000 + 1 + CFERR_MAXLESSTHANMIN* = 0x00002000 + 2 + CFERR_NOFONTS* = 0x00002000 + 1 + FNERR_BUFFERTOOSMALL* = 0x00003000 + 3 + FNERR_INVALIDFILENAME* = 0x00003000 + 2 + FNERR_SUBCLASSFAILURE* = 0x00003000 + 1 + FRERR_BUFFERLENGTHZERO* = 0x00004000 + 1 + # CompareString, LCMapString + LOCALE_SYSTEM_DEFAULT* = 0x00000800 + LOCALE_USER_DEFAULT* = 0x00000400 + NORM_IGNORECASE* = 1 + NORM_IGNOREKANATYPE* = 65536 + NORM_IGNORENONSPACE* = 2 + NORM_IGNORESYMBOLS* = 4 + NORM_IGNOREWIDTH* = 131072 + SORT_STRINGSORT* = 4096 + LCMAP_BYTEREV* = 2048 + LCMAP_FULLWIDTH* = 8388608 + LCMAP_HALFWIDTH* = 4194304 + LCMAP_HIRAGANA* = 1048576 + LCMAP_KATAKANA* = 2097152 + LCMAP_LOWERCASE* = 256 + LCMAP_SORTKEY* = 1024 + LCMAP_UPPERCASE* = 512 + # ContinueDebugEvent + DBG_CONTINUE* = 0x00010002 + DBG_CONTROL_BREAK* = 0x40010008 + DBG_CONTROL_C* = 0x40010005 + DBG_EXCEPTION_NOT_HANDLED* = 0x80010001 + DBG_TERMINATE_THREAD* = 0x40010003 + DBG_TERMINATE_PROCESS* = 0x40010004 + # ControlService + SERVICE_CONTROL_STOP* = 1 + SERVICE_CONTROL_PAUSE* = 2 + SERVICE_CONTROL_CONTINUE* = 3 + SERVICE_CONTROL_INTERROGATE* = 4 + SERVICE_CONTROL_SHUTDOWN* = 5 + # CopyImage, LoadImage + IMAGE_BITMAP* = 0 + IMAGE_CURSOR* = 2 + IMAGE_ENHMETAFILE* = 1 + IMAGE_ICON* = 1 + LR_MONOCHROME* = 1 + LR_COLOR* = 2 + LR_COPYRETURNORG* = 4 + LR_COPYDELETEORG* = 8 + LR_DEFAULTSIZE* = 64 + LR_CREATEDIBSECTION* = 8192 + LR_COPYFROMRESOURCE* = 0x00004000 + LR_SHARED* = 0x00008000 + # CreateDesktop + DF_ALLOWOTHERACCOUNTHOOK* = 0x00000001 + DESKTOP_CREATEMENU* = 0x00000004 + DESKTOP_CREATEWINDOW* = 0x00000002 + DESKTOP_ENUMERATE* = 0x00000040 + DESKTOP_HOOKCONTROL* = 0x00000008 + DESKTOP_JOURNALPLAYBACK* = 0x00000020 + DESKTOP_JOURNALRECORD* = 0x00000010 + DESKTOP_READOBJECTS* = 0x00000001 + DESKTOP_SWITCHDESKTOP* = 0x00000100 + DESKTOP_WRITEOBJECTS* = 0x00000080 + WSF_VISIBLE* = 0x00000001 + # CreateDIBitmap + CBM_INIT* = 0x00000004 + DIB_PAL_COLORS* = 1 + DIB_RGB_COLORS* = 0 + # CreateFile, GetFileAttributes, SetFileAttributes + GENERIC_READ* = 0x80000000 + GENERIC_WRITE* = 0x40000000 + FILE_READ_DATA* = 0x00000001 # file & pipe + FILE_LIST_DIRECTORY* = 0x00000001 # directory + FILE_WRITE_DATA* = 0x00000002 # file & pipe + FILE_ADD_FILE* = 0x00000002 # directory + FILE_APPEND_DATA* = 0x00000004 # file + FILE_ADD_SUBDIRECTORY* = 0x00000004 # directory + FILE_CREATE_PIPE_INSTANCE* = 0x00000004 # named pipe + FILE_READ_EA* = 0x00000008 # file & directory + FILE_READ_PROPERTIES* = FILE_READ_EA + FILE_WRITE_EA* = 0x00000010 # file & directory + FILE_WRITE_PROPERTIES* = FILE_WRITE_EA + FILE_EXECUTE* = 0x00000020 # file + FILE_TRAVERSE* = 0x00000020 # directory + FILE_DELETE_CHILD* = 0x00000040 # directory + FILE_READ_ATTRIBUTES* = 0x00000080 # all + FILE_WRITE_ATTRIBUTES* = 0x00000100 # all + FILE_SHARE_DELETE* = 4 + FILE_SHARE_READ* = 1 + FILE_SHARE_WRITE* = 2 + CONSOLE_TEXTMODE_BUFFER* = 1 + CREATE_NEW* = 1 + CREATE_ALWAYS* = 2 + OPEN_EXISTING* = 3 + OPEN_ALWAYS* = 4 + TRUNCATE_EXISTING* = 5 + FILE_ATTRIBUTE_ARCHIVE* = 32 + FILE_ATTRIBUTE_COMPRESSED* = 2048 + FILE_ATTRIBUTE_NORMAL* = 128 + FILE_ATTRIBUTE_DIRECTORY* = 16 + FILE_ATTRIBUTE_HIDDEN* = 2 + FILE_ATTRIBUTE_READONLY* = 1 + FILE_ATTRIBUTE_SYSTEM* = 4 + FILE_ATTRIBUTE_TEMPORARY* = 256 + FILE_FLAG_WRITE_THROUGH* = 0x80000000 + FILE_FLAG_OVERLAPPED* = 1073741824 + FILE_FLAG_NO_BUFFERING* = 536870912 + FILE_FLAG_RANDOM_ACCESS* = 268435456 + FILE_FLAG_SEQUENTIAL_SCAN* = 134217728 + FILE_FLAG_DELETE_ON_CLOSE* = 67108864 + FILE_FLAG_BACKUP_SEMANTICS* = 33554432 + FILE_FLAG_POSIX_SEMANTICS* = 16777216 + cSECURITY_ANONYMOUS* = 0 + cSECURITY_IDENTIFICATION* = 65536 + cSECURITY_IMPERSONATION* = 131072 + cSECURITY_DELEGATION* = 196608 + cSECURITY_CONTEXT_TRACKING* = 262144 + cSECURITY_EFFECTIVE_ONLY* = 524288 + cSECURITY_SQOS_PRESENT* = 1048576 + # CreateFileMapping, VirtualAlloc, VirtualFree, VirtualProtect + SEC_COMMIT* = 134217728 + SEC_IMAGE* = 16777216 + SEC_NOCACHE* = 268435456 + SEC_RESERVE* = 67108864 + PAGE_READONLY* = 2 + PAGE_READWRITE* = 4 + PAGE_WRITECOPY* = 8 + PAGE_EXECUTE* = 16 + PAGE_EXECUTE_READ* = 32 + PAGE_EXECUTE_READWRITE* = 64 + PAGE_EXECUTE_WRITECOPY* = 128 + PAGE_GUARD* = 256 + PAGE_NOACCESS* = 1 + PAGE_NOCACHE* = 512 + MEM_COMMIT* = 4096 + MEM_FREE* = 65536 + MEM_RESERVE* = 8192 + MEM_IMAGE* = 16777216 + MEM_MAPPED* = 262144 + MEM_PRIVATE* = 131072 + MEM_DECOMMIT* = 16384 + MEM_RELEASE* = 32768 + MEM_TOP_DOWN* = 1048576 + EXCEPTION_GUARD_PAGE* = 0x80000001 + SECTION_EXTEND_SIZE* = 0x00000010 + SECTION_MAP_READ* = 0x00000004 + SECTION_MAP_WRITE* = 0x00000002 + SECTION_QUERY* = 0x00000001 + SECTION_ALL_ACCESS* = 0x000F001F + # CreateFont + FW_DONTCARE* = 0 + FW_THIN* = 100 + FW_EXTRALIGHT* = 200 + FW_LIGHT* = 300 + FW_NORMAL* = 400 + FW_REGULAR* = FW_NORMAL + FW_MEDIUM* = 500 + FW_SEMIBOLD* = 600 + FW_BOLD* = 700 + FW_EXTRABOLD* = 800 + FW_HEAVY* = 900 + ANSI_CHARSET* = 0 + DEFAULT_CHARSET* = 1 + SYMBOL_CHARSET* = 2 + SHIFTJIS_CHARSET* = 128 + HANGEUL_CHARSET* = 129 + GB2312_CHARSET* = 134 + CHINESEBIG5_CHARSET* = 136 + GREEK_CHARSET* = 161 + TURKISH_CHARSET* = 162 + HEBREW_CHARSET* = 177 + ARABIC_CHARSET* = 178 + BALTIC_CHARSET* = 186 + RUSSIAN_CHARSET* = 204 + THAI_CHARSET* = 222 + EASTEUROPE_CHARSET* = 238 + OEM_CHARSET* = 255 + OUT_DEFAULT_PRECIS* = 0 + OUT_STRING_PRECIS* = 1 + OUT_CHARACTER_PRECIS* = 2 + OUT_STROKE_PRECIS* = 3 + OUT_TT_PRECIS* = 4 + OUT_DEVICE_PRECIS* = 5 + OUT_RASTER_PRECIS* = 6 + OUT_TT_ONLY_PRECIS* = 7 + OUT_OUTLINE_PRECIS* = 8 + CLIP_DEFAULT_PRECIS* = 0 + CLIP_CHARACTER_PRECIS* = 1 + CLIP_STROKE_PRECIS* = 2 + CLIP_MASK* = 15 + CLIP_LH_ANGLES* = 16 + CLIP_TT_ALWAYS* = 32 + CLIP_EMBEDDED* = 128 + DEFAULT_QUALITY* = 0 + DRAFT_QUALITY* = 1 + PROOF_QUALITY* = 2 + NONANTIALIASED_QUALITY* = 3 + ANTIALIASED_QUALITY* = 4 + DEFAULT_PITCH* = 0 + FIXED_PITCH* = 1 + VARIABLE_PITCH* = 2 + MONO_FONT* = 8 + FF_DECORATIVE* = 80 + FF_DONTCARE* = 0 + FF_MODERN* = 48 + FF_ROMAN* = 16 + FF_SCRIPT* = 64 + FF_SWISS* = 32 + # CreateHatchBrush + HS_BDIAGONAL* = 3 + HS_CROSS* = 4 + HS_DIAGCROSS* = 5 + HS_FDIAGONAL* = 2 + HS_HORIZONTAL* = 0 + HS_VERTICAL* = 1 + # CreateIconFromResourceEx + LR_DEFAULTCOLOR* = 0 + LR_LOADREALSIZE* = 128 + # CreateMailslot, GetMailslotInfo + MAILSLOT_WAIT_FOREVER* = 0xFFFFFFFF + MAILSLOT_NO_MESSAGE* = 0xFFFFFFFF + # CreateMappedBitmap + CMB_MASKED* = 2 + # CreateNamedPipe + PIPE_ACCESS_DUPLEX* = 3 + PIPE_ACCESS_INBOUND* = 1 + PIPE_ACCESS_OUTBOUND* = 2 + WRITE_DAC* = 0x00040000 + WRITE_OWNER* = 0x00080000 + ACCESS_SYSTEM_SECURITY* = 0x01000000 + PIPE_TYPE_BYTE* = 0 + PIPE_TYPE_MESSAGE* = 4 + PIPE_READMODE_BYTE* = 0 + PIPE_READMODE_MESSAGE* = 2 + PIPE_WAIT* = 0 + PIPE_NOWAIT* = 1 + # CreatePen, ExtCreatePen + PS_GEOMETRIC* = 65536 + PS_COSMETIC* = 0 + PS_ALTERNATE* = 8 + PS_SOLID* = 0 + PS_DASH* = 1 + PS_DOT* = 2 + PS_DASHDOT* = 3 + PS_DASHDOTDOT* = 4 + PS_NULL* = 5 + PS_USERSTYLE* = 7 + PS_INSIDEFRAME* = 6 + PS_ENDCAP_ROUND* = 0 + PS_ENDCAP_SQUARE* = 256 + PS_ENDCAP_FLAT* = 512 + PS_JOIN_BEVEL* = 4096 + PS_JOIN_MITER* = 8192 + PS_JOIN_ROUND* = 0 + PS_STYLE_MASK* = 15 + PS_ENDCAP_MASK* = 3840 + PS_TYPE_MASK* = 983040 + # CreatePolygonRgn + ALTERNATE* = 1 + WINDING* = 2 + # CreateProcess + CREATE_DEFAULT_ERROR_MODE* = 67108864 + CREATE_NEW_CONSOLE* = 16 + CREATE_NEW_PROCESS_GROUP* = 512 + CREATE_SEPARATE_WOW_VDM* = 2048 + CREATE_SUSPENDED* = 4 + CREATE_UNICODE_ENVIRONMENT* = 1024 + DEBUG_PROCESS* = 1 + DEBUG_ONLY_THIS_PROCESS* = 2 + DETACHED_PROCESS* = 8 + HIGH_PRIORITY_CLASS* = 128 + IDLE_PRIORITY_CLASS* = 64 + NORMAL_PRIORITY_CLASS* = 32 + REALTIME_PRIORITY_CLASS* = 256 + # CreateService + SERVICE_ALL_ACCESS* = 0x000F01FF + SERVICE_CHANGE_CONFIG* = 2 + SERVICE_ENUMERATE_DEPENDENTS* = 8 + SERVICE_INTERROGATE* = 128 + SERVICE_PAUSE_CONTINUE* = 64 + SERVICE_QUERY_CONFIG* = 1 + SERVICE_QUERY_STATUS* = 4 + SERVICE_START* = 16 + SERVICE_STOP* = 32 + SERVICE_USER_DEFINED_CONTROL* = 256 + SERVICE_DELETE* = 0x00010000 + SERVICE_READ_CONTROL* = 0x00020000 + SERVICE_GENERIC_EXECUTE* = 0x20000000 + SERVICE_ERROR_IGNORE* = 0 + SERVICE_ERROR_NORMAL* = 1 + SERVICE_ERROR_SEVERE* = 2 + SERVICE_ERROR_CRITICAL* = 3 + # CreateTapePartition, WriteTapemark + TAPE_FIXED_PARTITIONS* = 0 + TAPE_INITIATOR_PARTITIONS* = 0x00000002 + TAPE_SELECT_PARTITIONS* = 0x00000001 + TAPE_FILEMARKS* = 0x00000001 + TAPE_LONG_FILEMARKS* = 0x00000003 + TAPE_SETMARKS* = 0 + TAPE_SHORT_FILEMARKS* = 0x00000002 + # CreateWindow + CW_USEDEFAULT* = int32(0x80000000) + WS_BORDER* = 0x00800000 + WS_CAPTION* = 0x00C00000 + WS_CHILD* = 0x40000000 + WS_CHILDWINDOW* = 0x40000000 + WS_CLIPCHILDREN* = 0x02000000 + WS_CLIPSIBLINGS* = 0x04000000 + WS_DISABLED* = 0x08000000 + WS_DLGFRAME* = 0x00400000 + WS_GROUP* = 0x00020000 + WS_HSCROLL* = 0x00100000 + WS_ICONIC* = 0x20000000 + WS_MAXIMIZE* = 0x01000000 + WS_MAXIMIZEBOX* = 0x00010000 + WS_MINIMIZE* = 0x20000000 + WS_MINIMIZEBOX* = 0x00020000 + WS_OVERLAPPED* = 0 + WS_OVERLAPPEDWINDOW* = 0x00CF0000 + WS_POPUP* = LONG(0x80000000) + WS_POPUPWINDOW* = LONG(0x80880000) + WS_SIZEBOX* = 0x00040000 + WS_SYSMENU* = 0x00080000 + WS_TABSTOP* = 0x00010000 + WS_THICKFRAME* = 0x00040000 + + WS_TILED* = 0 + WS_TILEDWINDOW* = 0x00CF0000 + WS_VISIBLE* = 0x10000000 + WS_VSCROLL* = 0x00200000 + MDIS_ALLCHILDSTYLES* = 0x00000001 + BS_3STATE* = 0x00000005 + BS_AUTO3STATE* = 0x00000006 + BS_AUTOCHECKBOX* = 0x00000003 + BS_AUTORADIOBUTTON* = 0x00000009 + BS_BITMAP* = 0x00000080 + BS_BOTTOM* = 0x00000800 + BS_CENTER* = 0x00000300 + BS_CHECKBOX* = 0x00000002 + BS_DEFPUSHBUTTON* = 0x00000001 + BS_GROUPBOX* = 0x00000007 + BS_ICON* = 0x00000040 + BS_LEFT* = 0x00000100 + BS_LEFTTEXT* = 0x00000020 + BS_MULTILINE* = 0x00002000 + BS_NOTIFY* = 0x00004000 + BS_OWNERDRAW* = 0x0000000B + BS_PUSHBUTTON* = 0 + BS_PUSHLIKE* = 0x00001000 + BS_RADIOBUTTON* = 0x00000004 + BS_RIGHT* = 0x00000200 + BS_RIGHTBUTTON* = 0x00000020 + BS_TEXT* = 0 + BS_TOP* = 0x00000400 + BS_USERBUTTON* = 0x00000008 + BS_VCENTER* = 0x00000C00 + BS_FLAT* = 0x00008000 + CBS_AUTOHSCROLL* = 0x00000040 + CBS_DISABLENOSCROLL* = 0x00000800 + CBS_DROPDOWN* = 0x00000002 + CBS_DROPDOWNLIST* = 0x00000003 + CBS_HASSTRINGS* = 0x00000200 + CBS_LOWERCASE* = 0x00004000 + CBS_NOINTEGRALHEIGHT* = 0x00000400 + CBS_OEMCONVERT* = 0x00000080 + CBS_OWNERDRAWFIXED* = 0x00000010 + CBS_OWNERDRAWVARIABLE* = 0x00000020 + CBS_SIMPLE* = 0x00000001 + CBS_SORT* = 0x00000100 + CBS_UPPERCASE* = 0x00002000 + ES_AUTOHSCROLL* = 0x00000080 + ES_AUTOVSCROLL* = 0x00000040 + ES_CENTER* = 0x00000001 + ES_LEFT* = 0 + ES_LOWERCASE* = 0x00000010 + ES_MULTILINE* = 0x00000004 + ES_NOHIDESEL* = 0x00000100 + ES_NUMBER* = 0x00002000 + ES_OEMCONVERT* = 0x00000400 + ES_PASSWORD* = 0x00000020 + ES_READONLY* = 0x00000800 + ES_RIGHT* = 0x00000002 + ES_UPPERCASE* = 0x00000008 + ES_WANTRETURN* = 0x00001000 + LBS_DISABLENOSCROLL* = 0x00001000 + LBS_EXTENDEDSEL* = 0x00000800 + LBS_HASSTRINGS* = 0x00000040 + LBS_MULTICOLUMN* = 0x00000200 + LBS_MULTIPLESEL* = 0x00000008 + LBS_NODATA* = 0x00002000 + LBS_NOINTEGRALHEIGHT* = 0x00000100 + LBS_NOREDRAW* = 0x00000004 + LBS_NOSEL* = 0x00004000 + LBS_NOTIFY* = 0x00000001 + LBS_OWNERDRAWFIXED* = 0x00000010 + LBS_OWNERDRAWVARIABLE* = 0x00000020 + LBS_SORT* = 0x00000002 + LBS_STANDARD* = 0x00A00003 + LBS_USETABSTOPS* = 0x00000080 + LBS_WANTKEYBOARDINPUT* = 0x00000400 + SBS_BOTTOMALIGN* = 0x00000004 + SBS_HORZ* = 0 + SBS_LEFTALIGN* = 0x00000002 + SBS_RIGHTALIGN* = 0x00000004 + SBS_SIZEBOX* = 0x00000008 + SBS_SIZEBOXBOTTOMRIGHTALIGN* = 0x00000004 + SBS_SIZEBOXTOPLEFTALIGN* = 0x00000002 + SBS_SIZEGRIP* = 0x00000010 + SBS_TOPALIGN* = 0x00000002 + SBS_VERT* = 0x00000001 + SS_BITMAP* = 0x0000000E + SS_BLACKFRAME* = 0x00000007 + SS_BLACKRECT* = 0x00000004 + SS_CENTER* = 0x00000001 + SS_CENTERIMAGE* = 0x00000200 + SS_ENHMETAFILE* = 0x0000000F + SS_ETCHEDFRAME* = 0x00000012 + SS_ETCHEDHORZ* = 0x00000010 + SS_ETCHEDVERT* = 0x00000011 + SS_GRAYFRAME* = 0x00000008 + SS_GRAYRECT* = 0x00000005 + SS_ICON* = 0x00000003 + SS_LEFT* = 0 + SS_LEFTNOWORDWRAP* = 0x0000000C + SS_NOPREFIX* = 0x00000080 + SS_NOTIFY* = 0x00000100 + SS_OWNERDRAW* = 0x0000000D + SS_REALSIZEIMAGE* = 0x00000800 + SS_RIGHT* = 0x00000002 + SS_RIGHTJUST* = 0x00000400 + SS_SIMPLE* = 0x0000000B + SS_SUNKEN* = 0x00001000 + SS_USERITEM* = 0x0000000A + SS_WHITEFRAME* = 0x00000009 + SS_WHITERECT* = 0x00000006 + DS_3DLOOK* = 0x00000004 + DS_ABSALIGN* = 0x00000001 + DS_CENTER* = 0x00000800 + DS_CENTERMOUSE* = 0x00001000 + DS_CONTEXTHELP* = 0x00002000 + DS_CONTROL* = 0x00000400 + DS_FIXEDSYS* = 0x00000008 + DS_LOCALEDIT* = 0x00000020 + DS_MODALFRAME* = 0x00000080 + DS_NOFAILCREATE* = 0x00000010 + DS_NOIDLEMSG* = 0x00000100 + DS_SETFONT* = 0x00000040 + DS_SETFOREGROUND* = 0x00000200 + DS_SYSMODAL* = 0x00000002 + # CreateWindowEx + WS_EX_ACCEPTFILES* = 0x00000010 + WS_EX_APPWINDOW* = 0x00040000 + WS_EX_CLIENTEDGE* = 0x00000200 + WS_EX_CONTEXTHELP* = 0x00000400 + WS_EX_CONTROLPARENT* = 0x00010000 + WS_EX_DLGMODALFRAME* = 0x00000001 + WS_EX_LEFT* = 0 + WS_EX_LEFTSCROLLBAR* = 0x00004000 + WS_EX_LTRREADING* = 0 + WS_EX_MDICHILD* = 0x00000040 + WS_EX_NOPARENTNOTIFY* = 0x00000004 + WS_EX_OVERLAPPEDWINDOW* = 0x00000300 + WS_EX_PALETTEWINDOW* = 0x00000188 + WS_EX_RIGHT* = 0x00001000 + WS_EX_RIGHTSCROLLBAR* = 0 + WS_EX_RTLREADING* = 0x00002000 + WS_EX_STATICEDGE* = 0x00020000 + WS_EX_TOOLWINDOW* = 0x00000080 + WS_EX_TOPMOST* = 0x00000008 + WS_EX_TRANSPARENT* = 0x00000020 + WS_EX_WINDOWEDGE* = 0x00000100 + # CreateWindowStation + WINSTA_ACCESSCLIPBOARD* = 0x00000004 + WINSTA_ACCESSGLOBALATOMS* = 0x00000020 + WINSTA_CREATEDESKTOP* = 0x00000008 + WINSTA_ENUMDESKTOPS* = 0x00000001 + WINSTA_ENUMERATE* = 0x00000100 + WINSTA_EXITWINDOWS* = 0x00000040 + WINSTA_READATTRIBUTES* = 0x00000002 + WINSTA_READSCREEN* = 0x00000200 + WINSTA_WRITEATTRIBUTES* = 0x00000010 + # DdeCallback + # DdeClientTransaction + # DdeEnableCallback + # DdeGetLastError + # DdeInitialize + # DdeNameService + # DebugProc + WH_CALLWNDPROC* = 4 + WH_CALLWNDPROCRET* = 12 + WH_CBT* = 5 + WH_DEBUG* = 9 + WH_GETMESSAGE* = 3 + WH_JOURNALPLAYBACK* = 1 + WH_JOURNALRECORD* = 0 + WH_KEYBOARD* = 2 + WH_MOUSE* = 7 + WH_MSGFILTER* = -1 + WH_SHELL* = 10 + WH_SYSMSGFILTER* = 6 + WH_FOREGROUNDIDLE* = 11 + # DefineDosDevice + DDD_RAW_TARGET_PATH* = 1 + DDD_REMOVE_DEFINITION* = 2 + DDD_EXACT_MATCH_ON_REMOVE* = 4 + # DeviceCapbilities + DCTT_BITMAP* = 0x00000001 + DCTT_DOWNLOAD* = 0x00000002 + DCTT_SUBDEV* = 0x00000004 + # DlgDirList + DDL_ARCHIVE* = 32 + DDL_DIRECTORY* = 16 + DDL_DRIVES* = 16384 + DDL_EXCLUSIVE* = 32768 + DDL_HIDDEN* = 2 + DDL_READONLY* = 1 + DDL_READWRITE* = 0 + DDL_SYSTEM* = 4 + DDL_POSTMSGS* = 8192 + # DllEntryPoint + DLL_PROCESS_ATTACH* = 1 + DLL_THREAD_ATTACH* = 2 + DLL_PROCESS_DETACH* = 0 + DLL_THREAD_DETACH* = 3 + # DrawAnimatedRects + IDANI_OPEN* = 1 + IDANI_CLOSE* = 2 + # DrawCaption + DC_ACTIVE* = 1 + DC_SMALLCAP* = 2 + # DrawEdge + BDR_RAISEDINNER* = 4 + BDR_SUNKENINNER* = 8 + BDR_RAISEDOUTER* = 1 + BDR_SUNKENOUTER* = 2 + BDR_OUTER* = BDR_RAISEDOUTER or BDR_SUNKENOUTER + BDR_INNER* = BDR_RAISEDINNER or BDR_SUNKENINNER + BDR_RAISED* = BDR_RAISEDOUTER or BDR_RAISEDINNER + BDR_SUNKEN* = BDR_SUNKENOUTER or BDR_SUNKENINNER + EDGE_BUMP* = 9 + EDGE_ETCHED* = 6 + EDGE_RAISED* = 5 + EDGE_SUNKEN* = 10 + BF_ADJUST* = 8192 + BF_BOTTOM* = 8 + BF_BOTTOMLEFT* = 9 + BF_BOTTOMRIGHT* = 12 + BF_DIAGONAL* = 16 + BF_DIAGONAL_ENDBOTTOMLEFT* = 25 + BF_DIAGONAL_ENDBOTTOMRIGHT* = 28 + BF_DIAGONAL_ENDTOPLEFT* = 19 + BF_DIAGONAL_ENDTOPRIGHT* = 22 + BF_FLAT* = 16384 + BF_LEFT* = 1 + BF_MIDDLE* = 2048 + BF_MONO* = 32768 + BF_RECT* = 15 + BF_RIGHT* = 4 + BF_SOFT* = 4096 + BF_TOP* = 2 + BF_TOPLEFT* = 3 + BF_TOPRIGHT* = 6 + # DrawFrameControl + DFC_BUTTON* = 4 + DFC_CAPTION* = 1 + DFC_MENU* = 2 + DFC_SCROLL* = 3 + DFCS_BUTTON3STATE* = 8 + DFCS_BUTTONCHECK* = 0 + DFCS_BUTTONPUSH* = 16 + DFCS_BUTTONRADIO* = 4 + DFCS_BUTTONRADIOIMAGE* = 1 + DFCS_BUTTONRADIOMASK* = 2 + DFCS_CAPTIONCLOSE* = 0 + DFCS_CAPTIONHELP* = 4 + DFCS_CAPTIONMAX* = 2 + DFCS_CAPTIONMIN* = 1 + DFCS_CAPTIONRESTORE* = 3 + DFCS_MENUARROW* = 0 + DFCS_MENUBULLET* = 2 + DFCS_MENUCHECK* = 1 + DFCS_SCROLLCOMBOBOX* = 5 + DFCS_SCROLLDOWN* = 1 + DFCS_SCROLLLEFT* = 2 + DFCS_SCROLLRIGHT* = 3 + DFCS_SCROLLSIZEGRIP* = 8 + DFCS_SCROLLUP* = 0 + DFCS_ADJUSTRECT* = 8192 + DFCS_CHECKED* = 1024 + DFCS_FLAT* = 16384 + DFCS_INACTIVE* = 256 + DFCS_MONO* = 32768 + DFCS_PUSHED* = 512 + # DrawIconEx + DI_COMPAT* = 4 + DI_DEFAULTSIZE* = 8 + DI_IMAGE* = 2 + DI_MASK* = 1 + DI_NORMAL* = 3 + # DrawState + DST_BITMAP* = 4 + DST_COMPLEX* = 0 + DST_ICON* = 3 + DST_PREFIXTEXT* = 2 + DST_TEXT* = 1 + DSS_NORMAL* = 0 + DSS_UNION* = 16 + DSS_DISABLED* = 32 + DSS_MONO* = 128 + # DrawStatusText + SBT_NOBORDERS* = 256 + SBT_OWNERDRAW* = 4096 + SBT_POPOUT* = 512 + SBT_RTLREADING* = 1024 + # DrawText, DrawTextEx + DT_BOTTOM* = 8 + DT_CALCRECT* = 1024 + DT_CENTER* = 1 + DT_EDITCONTROL* = 8192 + DT_END_ELLIPSIS* = 32768 + DT_PATH_ELLIPSIS* = 16384 + DT_EXPANDTABS* = 64 + DT_EXTERNALLEADING* = 512 + DT_LEFT* = 0 + DT_MODIFYSTRING* = 65536 + DT_NOCLIP* = 256 + DT_NOPREFIX* = 2048 + DT_RIGHT* = 2 + DT_RTLREADING* = 131072 + DT_SINGLELINE* = 32 + DT_TABSTOP* = 128 + DT_TOP* = 0 + DT_VCENTER* = 4 + DT_WORDBREAK* = 16 + DT_INTERNAL* = 4096 + DT_WORD_ELLIPSIS* = 0x00040000 + DT_HIDEPREFIX* = 0x00100000 + DT_PREFIXONLY* = 0x00200000 + # DuplicateHandle, MapViewOfFile + DUPLICATE_CLOSE_SOURCE* = 1 + DUPLICATE_SAME_ACCESS* = 2 + FILE_MAP_ALL_ACCESS* = 0x000F001F + FILE_MAP_READ* = 4 + FILE_MAP_WRITE* = 2 + FILE_MAP_COPY* = 1 + MUTEX_ALL_ACCESS* = 0x001F0001 + MUTEX_MODIFY_STATE* = 1 + SYNCHRONIZE* = 0x00100000 + SEMAPHORE_ALL_ACCESS* = 0x001F0003 + SEMAPHORE_MODIFY_STATE* = 2 + EVENT_ALL_ACCESS* = 0x001F0003 + EVENT_MODIFY_STATE* = 2 + KEY_ALL_ACCESS* = 0x000F003F + KEY_CREATE_LINK* = 32 + KEY_CREATE_SUB_KEY* = 4 + KEY_ENUMERATE_SUB_KEYS* = 8 + KEY_EXECUTE* = 0x00020019 + KEY_NOTIFY* = 16 + KEY_QUERY_VALUE* = 1 + KEY_READ* = 0x00020019 + KEY_SET_VALUE* = 2 + KEY_WRITE* = 0x00020006 + PROCESS_ALL_ACCESS* = 0x001F0FFF + PROCESS_CREATE_PROCESS* = 128 + PROCESS_CREATE_THREAD* = 2 + PROCESS_DUP_HANDLE* = 64 + PROCESS_QUERY_INFORMATION* = 1024 + PROCESS_SET_INFORMATION* = 512 + PROCESS_TERMINATE* = 1 + PROCESS_VM_OPERATION* = 8 + PROCESS_VM_READ* = 16 + PROCESS_VM_WRITE* = 32 + THREAD_ALL_ACCESS* = 0x001F03FF + THREAD_DIRECT_IMPERSONATION* = 512 + THREAD_GET_CONTEXT* = 8 + THREAD_IMPERSONATE* = 256 + THREAD_QUERY_INFORMATION* = 64 + THREAD_SET_CONTEXT* = 16 + THREAD_SET_INFORMATION* = 32 + THREAD_SET_THREAD_TOKEN* = 128 + THREAD_SUSPEND_RESUME* = 2 + THREAD_TERMINATE* = 1 + # EditWordBreakProc + WB_ISDELIMITER* = 2 + WB_LEFT* = 0 + WB_RIGHT* = 1 + # EnableScrollBar + SB_BOTH* = 3 + SB_CTL* = 2 + SB_HORZ* = 0 + SB_VERT* = 1 + ESB_DISABLE_BOTH* = 3 + ESB_DISABLE_DOWN* = 2 + ESB_DISABLE_LEFT* = 1 + ESB_DISABLE_LTUP* = 1 + ESB_DISABLE_RIGHT* = 2 + ESB_DISABLE_RTDN* = 2 + ESB_DISABLE_UP* = 1 + ESB_ENABLE_BOTH* = 0 + # Scroll Bar notifications + SB_LINEUP* = 0 + SB_LINEDOWN* = 1 + SB_LINELEFT* = 0 + SB_LINERIGHT* = 1 + SB_PAGEUP* = 2 + SB_PAGEDOWN* = 3 + SB_PAGELEFT* = 2 + SB_PAGERIGHT* = 3 + SB_THUMBPOSITION* = 4 + SB_THUMBTRACK* = 5 + SB_ENDSCROLL* = 8 + SB_LEFT* = 6 + SB_RIGHT* = 7 + SB_BOTTOM* = 7 + SB_TOP* = 6 + # EnumCalendarInfo + ENUM_ALL_CALENDARS* = -1 + # EnumDateFormats + # GetDateFormat + DATE_SHORTDATE* = 1 + DATE_LONGDATE* = 2 + DATE_USE_ALT_CALENDAR* = 4 + # EnumDependentServices + SERVICE_ACTIVE* = 1 + SERVICE_INACTIVE* = 2 + # EnumFontFamExProc + DEVICE_FONTTYPE* = 2 + RASTER_FONTTYPE* = 1 + TRUETYPE_FONTTYPE* = 4 + # EnumObjects, GetCurrentObject, GetObjectType + OBJ_BRUSH* = 2 + OBJ_PEN* = 1 + OBJ_PAL* = 5 + OBJ_FONT* = 6 + OBJ_BITMAP* = 7 + OBJ_EXTPEN* = 11 + OBJ_REGION* = 8 + OBJ_DC* = 3 + OBJ_MEMDC* = 10 + OBJ_METAFILE* = 9 + OBJ_METADC* = 4 + OBJ_ENHMETAFILE* = 13 + OBJ_ENHMETADC* = 12 + + # + # Predefined Resource Types + # +const + RT_CURSOR* = cast[MAKEINTRESOURCE](1) + RT_BITMAP* = cast[MAKEINTRESOURCE](2) + RT_ICON* = cast[MAKEINTRESOURCE](3) + RT_MENU* = cast[MAKEINTRESOURCE](4) + RT_DIALOG* = cast[MAKEINTRESOURCE](5) + RT_STRING* = cast[MAKEINTRESOURCE](6) + RT_FONTDIR* = cast[MAKEINTRESOURCE](7) + RT_FONT* = cast[MAKEINTRESOURCE](8) + RT_ACCELERATOR* = cast[MAKEINTRESOURCE](9) + RT_RCDATA* = cast[MAKEINTRESOURCE](10) + RT_MESSAGETABLE* = cast[MAKEINTRESOURCE](11) + DIFFERENCE* = 11 + RT_GROUP_CURSOR* = cast[MAKEINTRESOURCE](12) + RT_GROUP_ICON* = cast[MAKEINTRESOURCE](14) + RT_VERSION* = cast[MAKEINTRESOURCE](16) + RT_DLGINCLUDE* = cast[MAKEINTRESOURCE](17) + RT_PLUGPLAY* = cast[MAKEINTRESOURCE](19) + RT_VXD* = cast[MAKEINTRESOURCE](20) + RT_ANICURSOR* = cast[MAKEINTRESOURCE](21) + RT_ANIICON* = cast[MAKEINTRESOURCE](22) + RT_HTML* = cast[MAKEINTRESOURCE](23) + RT_MANIFEST* = cast[MAKEINTRESOURCE](24) + +const + # EnumServicesStatus + SERVICE_WIN32* = 48 + SERVICE_DRIVER* = 11 + # EnumSystemCodePages + CP_INSTALLED* = 1 + CP_SUPPORTED* = 2 + # EnumSystemLocales + LCID_INSTALLED* = 1 + LCID_SUPPORTED* = 2 + # EraseTape + TAPE_ERASE_LONG* = 0x00000001 + TAPE_ERASE_SHORT* = 0 + # Escape + SP_ERROR* = -1 + SP_OUTOFDISK* = -4 + SP_OUTOFMEMORY* = -5 + SP_USERABORT* = -3 + PHYSICALWIDTH* = 110 + PHYSICALHEIGHT* = 111 + PHYSICALOFFSETX* = 112 + PHYSICALOFFSETY* = 113 + SCALINGFACTORX* = 114 + SCALINGFACTORY* = 115 + QUERYESCSUPPORT* = 8 + #ABORTDOC = 2; conflicts with AbortDoc function + cABORTDOC* = 2 + #ENDDOC = 11; conflicts with AbortDoc function + cENDDOC* = 11 + GETPHYSPAGESIZE* = 12 + GETPRINTINGOFFSET* = 13 + GETSCALINGFACTOR* = 14 + NEWFRAME* = 1 + NEXTBAND* = 3 + PASSTHROUGH* = 19 + #SETABORTPROC = 9; conflicts with AbortDoc function + cSETABORTPROC* = 9 + #STARTDOC = 10; conflicts with AbortDoc function + cSTARTDOC* = 10 + # EscapeCommFunction + CLRDTR* = 6 + CLRRTS* = 4 + SETDTR* = 5 + SETRTS* = 3 + SETXOFF* = 1 + SETXON* = 2 + SETBREAK* = 8 + CLRBREAK* = 9 + # ExitWindowsEx + EWX_FORCE* = 4 + EWX_LOGOFF* = 0 + EWX_POWEROFF* = 8 + EWX_REBOOT* = 2 + EWX_SHUTDOWN* = 1 + # ExtFloodFill + FLOODFILLBORDER* = 0 + FLOODFILLSURFACE* = 1 + # ExtTextOut + ETO_CLIPPED* = 4 + ETO_GLYPH_INDEX* = 16 + ETO_OPAQUE* = 2 + ETO_RTLREADING* = 128 + # FillConsoleOutputAttribute + FOREGROUND_BLUE* = 1 + FOREGROUND_GREEN* = 2 + FOREGROUND_RED* = 4 + FOREGROUND_INTENSITY* = 8 + BACKGROUND_BLUE* = 16 + BACKGROUND_GREEN* = 32 + BACKGROUND_RED* = 64 + BACKGROUND_INTENSITY* = 128 + # FindFirstChangeNotification + FILE_NOTIFY_CHANGE_FILE_NAME* = 1 + FILE_NOTIFY_CHANGE_DIR_NAME* = 2 + FILE_NOTIFY_CHANGE_ATTRIBUTES* = 4 + FILE_NOTIFY_CHANGE_SIZE* = 8 + FILE_NOTIFY_CHANGE_LAST_WRITE* = 16 + FILE_NOTIFY_CHANGE_SECURITY* = 256 + # FindFirstPrinterChangeNotification + # FindNextPrinterNotification + # FMExtensionProc + # FoldString + MAP_FOLDCZONE* = 16 + MAP_FOLDDIGITS* = 128 + MAP_PRECOMPOSED* = 32 + MAP_COMPOSITE* = 64 + # ForegroundIdleProc + HC_ACTION* = 0 + # FormatMessage + FORMAT_MESSAGE_ALLOCATE_BUFFER* = 256 + FORMAT_MESSAGE_IGNORE_INSERTS* = 512 + FORMAT_MESSAGE_FROM_STRING* = 1024 + FORMAT_MESSAGE_FROM_HMODULE* = 2048 + FORMAT_MESSAGE_FROM_SYSTEM* = 4096 + FORMAT_MESSAGE_ARGUMENT_ARRAY* = 8192 + FORMAT_MESSAGE_MAX_WIDTH_MASK* = 255 + # GdiComment + GDICOMMENT_WINDOWS_METAFILE* = -2147483647 + GDICOMMENT_BEGINGROUP* = 2 + GDICOMMENT_ENDGROUP* = 3 + GDICOMMENT_MULTIFORMATS* = 1073741828 + GDICOMMENT_IDENTIFIER* = 1128875079 + # GenerateConsoleCtrlEvent, HandlerRoutine + CTRL_C_EVENT* = 0 + CTRL_BREAK_EVENT* = 1 + CTRL_CLOSE_EVENT* = 2 + CTRL_LOGOFF_EVENT* = 5 + CTRL_SHUTDOWN_EVENT* = 6 + # GetAddressByName + # GetArcDirection + AD_COUNTERCLOCKWISE* = 1 + AD_CLOCKWISE* = 2 + # GetBinaryTypes + SCS_32BIT_BINARY* = 0 + SCS_DOS_BINARY* = 1 + SCS_OS216_BINARY* = 5 + SCS_PIF_BINARY* = 3 + SCS_POSIX_BINARY* = 4 + SCS_WOW_BINARY* = 2 + # GetBoundsRect, SetBoundsRect + DCB_DISABLE* = 8 + DCB_ENABLE* = 4 + DCB_RESET* = 1 + DCB_SET* = 3 + DCB_ACCUMULATE* = 2 + # GetCharacterPlacement, GetFontLanguageInfo + GCP_DBCS* = 1 + GCP_ERROR* = 0x00008000 + GCP_CLASSIN* = 0x00080000 + GCP_DIACRITIC* = 256 + GCP_DISPLAYZWG* = 0x00400000 + GCP_GLYPHSHAPE* = 16 + GCP_JUSTIFY* = 0x00010000 + GCP_JUSTIFYIN* = 0x00200000 + GCP_KASHIDA* = 1024 + GCP_LIGATE* = 32 + GCP_MAXEXTENT* = 0x00100000 + GCP_NEUTRALOVERRIDE* = 0x02000000 + GCP_NUMERICOVERRIDE* = 0x01000000 + GCP_NUMERICSLATIN* = 0x04000000 + GCP_NUMERICSLOCAL* = 0x08000000 + GCP_REORDER* = 2 + GCP_SYMSWAPOFF* = 0x00800000 + GCP_USEKERNING* = 8 + FLI_GLYPHS* = 0x00040000 + FLI_MASK* = 0x0000103B + # GetClassLong, GetClassWord + GCW_ATOM* = -32 + GCL_CBCLSEXTRA* = -20 + GCL_CBWNDEXTRA* = -18 + GCL_HBRBACKGROUND* = -10 + GCL_HCURSOR* = -12 + GCL_HICON* = -14 + GCL_HICONSM* = -34 + GCL_HMODULE* = -16 + GCL_MENUNAME* = -8 + GCL_STYLE* = -26 + GCL_WNDPROC* = -24 + # GetClipboardFormat, SetClipboardData + CF_BITMAP* = 2 + CF_DIB* = 8 + CF_PALETTE* = 9 + CF_ENHMETAFILE* = 14 + CF_METAFILEPICT* = 3 + CF_OEMTEXT* = 7 + CF_TEXT* = 1 + CF_UNICODETEXT* = 13 + CF_DIF* = 5 + CF_DSPBITMAP* = 130 + CF_DSPENHMETAFILE* = 142 + CF_DSPMETAFILEPICT* = 131 + CF_DSPTEXT* = 129 + CF_GDIOBJFIRST* = 768 + CF_GDIOBJLAST* = 1023 + CF_HDROP* = 15 + CF_LOCALE* = 16 + CF_OWNERDISPLAY* = 128 + CF_PENDATA* = 10 + CF_PRIVATEFIRST* = 512 + CF_PRIVATELAST* = 767 + CF_RIFF* = 11 + CF_SYLK* = 4 + CF_WAVE* = 12 + CF_TIFF* = 6 + # GetCommMask + EV_BREAK* = 64 + EV_CTS* = 8 + EV_DSR* = 16 + EV_ERR* = 128 + EV_EVENT1* = 2048 + EV_EVENT2* = 4096 + EV_PERR* = 512 + EV_RING* = 256 + EV_RLSD* = 32 + EV_RX80FULL* = 1024 + EV_RXCHAR* = 1 + EV_RXFLAG* = 2 + EV_TXEMPTY* = 4 + # GetCommModemStatus + MS_CTS_ON* = 0x00000010 + MS_DSR_ON* = 0x00000020 + MS_RING_ON* = 0x00000040 + MS_RLSD_ON* = 0x00000080 + # GetComputerName + MAX_COMPUTERNAME_LENGTH* = 15 + # GetConsoleMode + ENABLE_LINE_INPUT* = 2 + ENABLE_ECHO_INPUT* = 4 + ENABLE_PROCESSED_INPUT* = 1 + ENABLE_WINDOW_INPUT* = 8 + ENABLE_MOUSE_INPUT* = 16 + ENABLE_PROCESSED_OUTPUT* = 1 + ENABLE_WRAP_AT_EOL_OUTPUT* = 2 + # GetCPInfo + CP_ACP* = 0 + CP_MACCP* = 2 + CP_OEMCP* = 1 + # GetDCEx + DCX_WINDOW* = 0x00000001 + DCX_CACHE* = 0x00000002 + DCX_PARENTCLIP* = 0x00000020 + DCX_CLIPSIBLINGS* = 0x00000010 + DCX_CLIPCHILDREN* = 0x00000008 + DCX_NORESETATTRS* = 0x00000004 + DCX_LOCKWINDOWUPDATE* = 0x00000400 + DCX_EXCLUDERGN* = 0x00000040 + DCX_INTERSECTRGN* = 0x00000080 + DCX_VALIDATE* = 0x00200000 + # GetDeviceCaps + DRIVERVERSION* = 0 + TECHNOLOGY* = 2 + DT_PLOTTER* = 0 + DT_RASDISPLAY* = 1 + DT_RASPRINTER* = 2 + DT_RASCAMERA* = 3 + DT_CHARSTREAM* = 4 + DT_METAFILE* = 5 + DT_DISPFILE* = 6 + HORZSIZE* = 4 + VERTSIZE* = 6 + HORZRES* = 8 + VERTRES* = 10 + LOGPIXELSX* = 88 + LOGPIXELSY* = 90 + BITSPIXEL* = 12 + PLANES* = 14 + NUMBRUSHES* = 16 + NUMPENS* = 18 + NUMFONTS* = 22 + NUMCOLORS* = 24 + ASPECTX* = 40 + ASPECTY* = 42 + ASPECTXY* = 44 + PDEVICESIZE* = 26 + CLIPCAPS* = 36 + SIZEPALETTE* = 104 + NUMRESERVED* = 106 + COLORRES* = 108 + VREFRESH* = 116 + DESKTOPHORZRES* = 118 + DESKTOPVERTRES* = 117 + BLTALIGNMENT* = 119 + RASTERCAPS* = 38 + RC_BANDING* = 2 + RC_BITBLT* = 1 + RC_BITMAP64* = 8 + RC_DI_BITMAP* = 128 + RC_DIBTODEV* = 512 + RC_FLOODFILL* = 4096 + RC_GDI20_OUTPUT* = 16 + RC_PALETTE* = 256 + RC_SCALING* = 4 + RC_STRETCHBLT* = 2048 + RC_STRETCHDIB* = 8192 + CURVECAPS* = 28 + CC_NONE* = 0 + CC_CIRCLES* = 1 + CC_PIE* = 2 + CC_CHORD* = 4 + CC_ELLIPSES* = 8 + CC_WIDE* = 16 + CC_STYLED* = 32 + CC_WIDESTYLED* = 64 + CC_INTERIORS* = 128 + CC_ROUNDRECT* = 256 + LINECAPS* = 30 + LC_NONE* = 0 + LC_POLYLINE* = 2 + LC_MARKER* = 4 + LC_POLYMARKER* = 8 + LC_WIDE* = 16 + LC_STYLED* = 32 + LC_WIDESTYLED* = 64 + LC_INTERIORS* = 128 + POLYGONALCAPS* = 32 + PC_NONE* = 0 + PC_POLYGON* = 1 + PC_RECTANGLE* = 2 + PC_WINDPOLYGON* = 4 + PC_SCANLINE* = 8 + PC_WIDE* = 16 + PC_STYLED* = 32 + PC_WIDESTYLED* = 64 + PC_INTERIORS* = 128 + TEXTCAPS* = 34 + TC_OP_CHARACTER* = 1 + TC_OP_STROKE* = 2 + TC_CP_STROKE* = 4 + TC_CR_90* = 8 + TC_CR_ANY* = 16 + TC_SF_X_YINDEP* = 32 + TC_SA_DOUBLE* = 64 + TC_SA_INTEGER* = 128 + TC_SA_CONTIN* = 256 + TC_EA_DOUBLE* = 512 + TC_IA_ABLE* = 1024 + TC_UA_ABLE* = 2048 + TC_SO_ABLE* = 4096 + TC_RA_ABLE* = 8192 + TC_VA_ABLE* = 16384 + TC_RESERVED* = 32768 + TC_SCROLLBLT* = 65536 + PC_PATHS* = 512 + # GetDriveType + DRIVE_REMOVABLE* = 2 + DRIVE_FIXED* = 3 + DRIVE_REMOTE* = 4 + DRIVE_CDROM* = 5 + DRIVE_RAMDISK* = 6 + DRIVE_UNKNOWN* = 0 + DRIVE_NO_ROOT_DIR* = 1 + # GetExceptionCode + EXCEPTION_ACCESS_VIOLATION* = 0xC0000005 + EXCEPTION_BREAKPOINT* = 0x80000003 + EXCEPTION_DATATYPE_MISALIGNMENT* = 0x80000002 + EXCEPTION_SINGLE_STEP* = 0x80000004 + EXCEPTION_ARRAY_BOUNDS_EXCEEDED* = 0xC000008C + EXCEPTION_FLT_DENORMAL_OPERAND* = 0xC000008D + EXCEPTION_FLT_DIVIDE_BY_ZERO* = 0xC000008E + EXCEPTION_FLT_INEXACT_RESULT* = 0xC000008F + EXCEPTION_FLT_INVALID_OPERATION* = 0xC0000090 + EXCEPTION_FLT_OVERFLOW* = 0xC0000091 + EXCEPTION_FLT_STACK_CHECK* = 0xC0000092 + EXCEPTION_FLT_UNDERFLOW* = 0xC0000093 + EXCEPTION_INT_DIVIDE_BY_ZERO* = 0xC0000094 + EXCEPTION_INT_OVERFLOW* = 0xC0000095 + EXCEPTION_INVALID_HANDLE* = 0xC0000008 + EXCEPTION_PRIV_INSTRUCTION* = 0xC0000096 + EXCEPTION_NONCONTINUABLE_EXCEPTION* = 0xC0000025 + EXCEPTION_NONCONTINUABLE* = 0x00000001 + EXCEPTION_STACK_OVERFLOW* = 0xC00000FD + EXCEPTION_INVALID_DISPOSITION* = 0xC0000026 + EXCEPTION_IN_PAGE_ERROR* = 0xC0000006 + EXCEPTION_ILLEGAL_INSTRUCTION* = 0xC000001D + EXCEPTION_POSSIBLE_DEADLOCK* = 0xC0000194 + # GetFileType + FILE_TYPE_UNKNOWN* = 0 + FILE_TYPE_DISK* = 1 + FILE_TYPE_CHAR* = 2 + FILE_TYPE_PIPE* = 3 + # GetGlyphOutline + GGO_BITMAP* = 1 + GGO_NATIVE* = 2 + GGO_METRICS* = 0 + GGO_GRAY2_BITMAP* = 4 + GGO_GRAY4_BITMAP* = 5 + GGO_GRAY8_BITMAP* = 6 + GDI_ERROR* = 0xFFFFFFFF + # GetGraphicsMode + GM_COMPATIBLE* = 1 + GM_ADVANCED* = 2 + # GetHandleInformation + HANDLE_FLAG_INHERIT* = 1 + HANDLE_FLAG_PROTECT_FROM_CLOSE* = 2 + # GetIconInfo + IDC_ARROW* = cast[MAKEINTRESOURCE](32512) + IDC_IBEAM* = cast[MAKEINTRESOURCE](32513) + IDC_WAIT* = cast[MAKEINTRESOURCE](32514) + IDC_CROSS* = cast[MAKEINTRESOURCE](32515) + IDC_UPARROW* = cast[MAKEINTRESOURCE](32516) + IDC_SIZE* = cast[MAKEINTRESOURCE](32640) # OBSOLETE: use IDC_SIZEALL + IDC_ICON* = cast[MAKEINTRESOURCE](32641) # OBSOLETE: use IDC_ARROW + IDC_SIZENWSE* = cast[MAKEINTRESOURCE](32642) + IDC_SIZENESW* = cast[MAKEINTRESOURCE](32643) + IDC_SIZEWE* = cast[MAKEINTRESOURCE](32644) + IDC_SIZENS* = cast[MAKEINTRESOURCE](32645) + IDC_SIZEALL* = cast[MAKEINTRESOURCE](32646) + IDC_NO* = cast[MAKEINTRESOURCE](32648) + IDC_HAND* = cast[MAKEINTRESOURCE](32649) + IDC_APPSTARTING* = cast[MAKEINTRESOURCE](32650) + IDC_HELP* = cast[MAKEINTRESOURCE](32651) + + IDI_APPLICATION* = cast[MAKEINTRESOURCE](32512) + IDI_HAND* = cast[MAKEINTRESOURCE](32513) + IDI_QUESTION* = cast[MAKEINTRESOURCE](32514) + IDI_EXCLAMATION* = cast[MAKEINTRESOURCE](32515) + IDI_ASTERISK* = cast[MAKEINTRESOURCE](32516) + IDI_WINLOGO* = cast[MAKEINTRESOURCE](32517) + IDI_WARNING* = IDI_EXCLAMATION + IDI_ERROR* = IDI_HAND + IDI_INFORMATION* = IDI_ASTERISK + +const + # GetMapMode + MM_ANISOTROPIC* = 8 + MM_HIENGLISH* = 5 + MM_HIMETRIC* = 3 + MM_ISOTROPIC* = 7 + MM_LOENGLISH* = 4 + MM_LOMETRIC* = 2 + MM_TEXT* = 1 + MM_TWIPS* = 6 + # GetMenuDefaultItem + GMDI_GOINTOPOPUPS* = 0x00000002 + GMDI_USEDISABLED* = 0x00000001 + # PeekMessage + PM_NOREMOVE* = 0 + PM_REMOVE* = 1 + PM_NOYIELD* = 2 + # GetNamedPipeHandleState + # PIPE_NOWAIT = 1; already above + # PIPE_READMODE_MESSAGE = 2;already above + # GetNamedPipeInfo + PIPE_CLIENT_END* = 0 + PIPE_SERVER_END* = 1 + # PIPE_TYPE_MESSAGE = 4;already above + # GetNextWindow, GetWindow + GW_HWNDNEXT* = 2 + GW_HWNDPREV* = 3 + GW_CHILD* = 5 + GW_HWNDFIRST* = 0 + GW_HWNDLAST* = 1 + GW_OWNER* = 4 + # GetPath + PT_MOVETO* = 6 + PT_LINETO* = 2 + PT_BEZIERTO* = 4 + PT_CLOSEFIGURE* = 1 + # GetProcessShutdownParameters + SHUTDOWN_NORETRY* = 1 + # GetQueueStatus + QS_ALLEVENTS* = 191 + QS_ALLINPUT* = 255 + QS_HOTKEY* = 128 + QS_INPUT* = 7 + QS_KEY* = 1 + QS_MOUSE* = 6 + QS_MOUSEBUTTON* = 4 + QS_MOUSEMOVE* = 2 + QS_PAINT* = 32 + QS_POSTMESSAGE* = 8 + QS_SENDMESSAGE* = 64 + QS_TIMER* = 16 + # GetScrollInfo, SetScrollInfo + SIF_ALL* = 23 + SIF_PAGE* = 2 + SIF_POS* = 4 + SIF_RANGE* = 1 + SIF_DISABLENOSCROLL* = 8 + + # GetStdHandle + STD_INPUT_HANDLE* = DWORD(-10) + STD_OUTPUT_HANDLE* = DWORD(-11) + STD_ERROR_HANDLE* = DWORD(-12) + + INVALID_HANDLE_VALUE* = HANDLE(-1) + INVALID_SET_FILE_POINTER* = ULONG(-1) + INVALID_FILE_SIZE* = ULONG(-1) + INVALID_FILE_ATTRIBUTES* = ULONG(-1) + +const + # GetStockObject + BLACK_BRUSH* = 4 + DKGRAY_BRUSH* = 3 + GRAY_BRUSH* = 2 + HOLLOW_BRUSH* = 5 + LTGRAY_BRUSH* = 1 + NULL_BRUSH* = 5 + WHITE_BRUSH* = 0 + BLACK_PEN* = 7 + NULL_PEN* = 8 + WHITE_PEN* = 6 + ANSI_FIXED_FONT* = 11 + ANSI_VAR_FONT* = 12 + DEVICE_DEFAULT_FONT* = 14 + DEFAULT_GUI_FONT* = 17 + OEM_FIXED_FONT* = 10 + SYSTEM_FONT* = 13 + SYSTEM_FIXED_FONT* = 16 + DEFAULT_PALETTE* = 15 + # GetStringTypeA + CT_CTYPE1* = 1 + CT_CTYPE2* = 2 + CT_CTYPE3* = 4 + C1_UPPER* = 1 + C1_LOWER* = 2 + C1_DIGIT* = 4 + C1_SPACE* = 8 + C1_PUNCT* = 16 + C1_CNTRL* = 32 + C1_BLANK* = 64 + C1_XDIGIT* = 128 + C1_ALPHA* = 256 + C2_LEFTTORIGHT* = 1 + C2_RIGHTTOLEFT* = 2 + C2_EUROPENUMBER* = 3 + C2_EUROPESEPARATOR* = 4 + C2_EUROPETERMINATOR* = 5 + C2_ARABICNUMBER* = 6 + C2_COMMONSEPARATOR* = 7 + C2_BLOCKSEPARATOR* = 8 + C2_SEGMENTSEPARATOR* = 9 + C2_WHITESPACE* = 10 + C2_OTHERNEUTRAL* = 11 + C2_NOTAPPLICABLE* = 0 + C3_NONSPACING* = 1 + C3_DIACRITIC* = 2 + C3_VOWELMARK* = 4 + C3_SYMBOL* = 8 + C3_KATAKANA* = 16 + C3_HIRAGANA* = 32 + C3_HALFWIDTH* = 64 + C3_FULLWIDTH* = 128 + C3_IDEOGRAPH* = 256 + C3_KASHIDA* = 512 + C3_ALPHA* = 32768 + C3_NOTAPPLICABLE* = 0 + # GetSysColor + COLOR_3DDKSHADOW* = 21 + COLOR_3DFACE* = 15 + COLOR_3DHILIGHT* = 20 + COLOR_3DLIGHT* = 22 + COLOR_BTNHILIGHT* = 20 + COLOR_3DSHADOW* = 16 + COLOR_ACTIVEBORDER* = 10 + COLOR_ACTIVECAPTION* = 2 + COLOR_APPWORKSPACE* = 12 + COLOR_BACKGROUND* = 1 + COLOR_DESKTOP* = 1 + COLOR_BTNFACE* = 15 + COLOR_BTNHIGHLIGHT* = 20 + COLOR_BTNSHADOW* = 16 + COLOR_BTNTEXT* = 18 + COLOR_CAPTIONTEXT* = 9 + COLOR_GRAYTEXT* = 17 + COLOR_HIGHLIGHT* = 13 + COLOR_HIGHLIGHTTEXT* = 14 + COLOR_INACTIVEBORDER* = 11 + COLOR_INACTIVECAPTION* = 3 + COLOR_INACTIVECAPTIONTEXT* = 19 + COLOR_INFOBK* = 24 + COLOR_INFOTEXT* = 23 + COLOR_MENU* = 4 + COLOR_MENUTEXT* = 7 + COLOR_SCROLLBAR* = 0 + COLOR_WINDOW* = 5 + COLOR_WINDOWFRAME* = 6 + COLOR_WINDOWTEXT* = 8 + # GetSystemMetrics + SM_CYMIN* = 29 + SM_CXMIN* = 28 + SM_ARRANGE* = 56 + SM_CLEANBOOT* = 67 + # The right value for SM_CEMETRICS for NT 3.5 is 75. For Windows 95 + # and NT 4.0, it is 76. The meaning is undocumented, anyhow. + SM_CMETRICS* = 76 + SM_CMOUSEBUTTONS* = 43 + SM_CXBORDER* = 5 + SM_CYBORDER* = 6 + SM_CXCURSOR* = 13 + SM_CYCURSOR* = 14 + SM_CXDLGFRAME* = 7 + SM_CYDLGFRAME* = 8 + SM_CXDOUBLECLK* = 36 + SM_CYDOUBLECLK* = 37 + SM_CXDRAG* = 68 + SM_CYDRAG* = 69 + SM_CXEDGE* = 45 + SM_CYEDGE* = 46 + SM_CXFIXEDFRAME* = 7 + SM_CYFIXEDFRAME* = 8 + SM_CXFRAME* = 32 + SM_CYFRAME* = 33 + SM_CXFULLSCREEN* = 16 + SM_CYFULLSCREEN* = 17 + SM_CXHSCROLL* = 21 + SM_CYHSCROLL* = 3 + SM_CXHTHUMB* = 10 + SM_CXICON* = 11 + SM_CYICON* = 12 + SM_CXICONSPACING* = 38 + SM_CYICONSPACING* = 39 + SM_CXMAXIMIZED* = 61 + SM_CYMAXIMIZED* = 62 + SM_CXMAXTRACK* = 59 + SM_CYMAXTRACK* = 60 + SM_CXMENUCHECK* = 71 + SM_CYMENUCHECK* = 72 + SM_CXMENUSIZE* = 54 + SM_CYMENUSIZE* = 55 + SM_CXMINIMIZED* = 57 + SM_CYMINIMIZED* = 58 + SM_CXMINSPACING* = 47 + SM_CYMINSPACING* = 48 + SM_CXMINTRACK* = 34 + SM_CYMINTRACK* = 35 + SM_CXSCREEN* = 0 + SM_CYSCREEN* = 1 + SM_CXSIZE* = 30 + SM_CYSIZE* = 31 + SM_CXSIZEFRAME* = 32 + SM_CYSIZEFRAME* = 33 + SM_CXSMICON* = 49 + SM_CYSMICON* = 50 + SM_CXSMSIZE* = 52 + SM_CYSMSIZE* = 53 + SM_CXVSCROLL* = 2 + #SM_CYHSCROLL = 3;already above + #SM_CXHSCROLL = 21;already above + SM_CYVSCROLL* = 20 + SM_CYVTHUMB* = 9 + SM_CYCAPTION* = 4 + SM_CYKANJIWINDOW* = 18 + SM_CYMENU* = 15 + SM_CYSMCAPTION* = 51 + SM_DBCSENABLED* = 42 + SM_DEBUG* = 22 + SM_MENUDROPALIGNMENT* = 40 + SM_MIDEASTENABLED* = 74 + SM_MOUSEPRESENT* = 19 + SM_MOUSEWHEELPRESENT* = 75 + SM_NETWORK* = 63 + SM_PENWINDOWS* = 41 + SM_SECURE* = 44 + SM_SHOWSOUNDS* = 70 + SM_SLOWMACHINE* = 73 + SM_SWAPBUTTON* = 23 + ARW_BOTTOMLEFT* = 0 + ARW_BOTTOMRIGHT* = 0x00000001 + ARW_HIDE* = 0x00000008 + ARW_TOPLEFT* = 0x00000002 + ARW_TOPRIGHT* = 0x00000003 + ARW_DOWN* = 0x00000004 + ARW_LEFT* = 0 + ARW_RIGHT* = 0 + ARW_UP* = 0x00000004 + # GetSystemPaletteUse + SYSPAL_NOSTATIC* = 2 + SYSPAL_STATIC* = 1 + SYSPAL_ERROR* = 0 + # GetTapeParameters, SetTapeParameters + GET_TAPE_MEDIA_INFORMATION* = 0 + GET_TAPE_DRIVE_INFORMATION* = 1 + SET_TAPE_MEDIA_INFORMATION* = 0 + SET_TAPE_DRIVE_INFORMATION* = 1 + # GetTapePosition + TAPE_ABSOLUTE_POSITION* = 0 + TAPE_LOGICAL_POSITION* = 0x00000001 + # GetTextAlign + TA_BASELINE* = 24 + TA_BOTTOM* = 8 + TA_TOP* = 0 + TA_CENTER* = 6 + TA_LEFT* = 0 + TA_RIGHT* = 2 + TA_RTLREADING* = 256 + TA_NOUPDATECP* = 0 + TA_UPDATECP* = 1 + VTA_BASELINE* = 24 + VTA_CENTER* = 6 + # GetThreadPriority + THREAD_PRIORITY_ABOVE_NORMAL* = 1 + THREAD_PRIORITY_BELOW_NORMAL* = -1 + THREAD_PRIORITY_HIGHEST* = 2 + THREAD_PRIORITY_IDLE* = -15 + THREAD_PRIORITY_LOWEST* = -2 + THREAD_PRIORITY_NORMAL* = 0 + THREAD_PRIORITY_TIME_CRITICAL* = 15 + THREAD_PRIORITY_ERROR_RETURN* = 2147483647 + TLS_MINIMUM_AVAILABLE* = 64 + # GetTimeFormat + TIME_NOMINUTESORSECONDS* = 1 + TIME_NOSECONDS* = 2 + TIME_NOTIMEMARKER* = 4 + TIME_FORCE24HOURFORMAT* = 8 + +const + # GetTimeZoneInformation + TIME_ZONE_ID_INVALID* = DWORD(- 1) + TIME_ZONE_ID_UNKNOWN* = 0 + TIME_ZONE_ID_STANDARD* = 1 + TIME_ZONE_ID_DAYLIGHT* = 2 + # GetUserObjectInformation + UOI_FLAGS* = 1 + UOI_NAME* = 2 + UOI_TYPE* = 3 + # GetVolumeInformation + FS_CASE_IS_PRESERVED* = 2 + FS_CASE_SENSITIVE* = 1 + FS_UNICODE_STORED_ON_DISK* = 4 + FS_PERSISTENT_ACLS* = 8 + FS_FILE_COMPRESSION* = 16 + FS_VOL_IS_COMPRESSED* = 32768 + # GetWindowLong + GWL_EXSTYLE* = -20 + GWL_STYLE* = -16 + GWL_WNDPROC* = -4 + GWL_HINSTANCE* = -6 + GWL_HWNDPARENT* = -8 + GWL_ID* = -12 + GWL_USERDATA* = -21 + DWL_DLGPROC* = 4 + DWL_MSGRESULT* = 0 + DWL_USER* = 8 + # GlobalAlloc, GlobalFlags + GMEM_FIXED* = 0 + GMEM_MOVEABLE* = 2 + GPTR* = 64 + GHND* = 66 + GMEM_DDESHARE* = 8192 + GMEM_DISCARDABLE* = 256 + GMEM_LOWER* = 4096 + GMEM_NOCOMPACT* = 16 + GMEM_NODISCARD* = 32 + GMEM_NOT_BANKED* = 4096 + GMEM_NOTIFY* = 16384 + GMEM_SHARE* = 8192 + GMEM_ZEROINIT* = 64 + GMEM_DISCARDED* = 16384 + GMEM_INVALID_HANDLE* = 32768 + GMEM_LOCKCOUNT* = 255 + # HeapAlloc, HeapReAlloc + HEAP_GENERATE_EXCEPTIONS* = 4 + HEAP_NO_SERIALIZE* = 1 + HEAP_ZERO_MEMORY* = 8 + STATUS_NO_MEMORY* = 0xC0000017 + STATUS_ACCESS_VIOLATION* = 0xC0000005 + HEAP_REALLOC_IN_PLACE_ONLY* = 16 + # ImageList_Create + ILC_COLOR* = 0 + ILC_COLOR4* = 4 + ILC_COLOR8* = 8 + ILC_COLOR16* = 16 + ILC_COLOR24* = 24 + ILC_COLOR32* = 32 + ILC_COLORDDB* = 254 + ILC_MASK* = 1 + ILC_PALETTE* = 2048 + # ImageList_Draw, ImageList_DrawEx + ILD_BLEND25* = 2 + ILD_BLEND50* = 4 + ILD_SELECTED* = 4 + ILD_BLEND* = 4 + ILD_FOCUS* = 2 + ILD_MASK* = 16 + ILD_NORMAL* = 0 + ILD_TRANSPARENT* = 1 + CLR_NONE* = 0xFFFFFFFF + CLR_DEFAULT* = 0xFF000000 + CLR_INVALID* = 0xFFFFFFFF + # ImageList_LoadImage + #LR_DEFAULTCOLOR = 0;already above + LR_LOADFROMFILE* = 16 + LR_LOADMAP3DCOLORS* = 4096 + LR_LOADTRANSPARENT* = 32 + # ImmConfigureIME + IME_CONFIG_GENERAL* = 1 + IME_CONFIG_REGISTERWORD* = 2 + IME_CONFIG_SELECTDICTIONARY* = 3 + # ImmGetConversionList + GCL_CONVERSION* = 1 + GCL_REVERSECONVERSION* = 2 + GCL_REVERSE_LENGTH* = 3 + # ImmGetGuideLine + GGL_LEVEL* = 1 + GGL_INDEX* = 2 + GGL_STRING* = 3 + GGL_PRIVATE* = 4 + GL_LEVEL_ERROR* = 2 + GL_LEVEL_FATAL* = 1 + GL_LEVEL_INFORMATION* = 4 + GL_LEVEL_NOGUIDELINE* = 0 + GL_LEVEL_WARNING* = 3 + GL_ID_CANNOTSAVE* = 17 + GL_ID_NOCONVERT* = 32 + GL_ID_NODICTIONARY* = 16 + GL_ID_NOMODULE* = 1 + GL_ID_READINGCONFLICT* = 35 + GL_ID_TOOMANYSTROKE* = 34 + GL_ID_TYPINGERROR* = 33 + GL_ID_UNKNOWN* = 0 + GL_ID_INPUTREADING* = 36 + GL_ID_INPUTRADICAL* = 37 + GL_ID_INPUTCODE* = 38 + GL_ID_CHOOSECANDIDATE* = 40 + GL_ID_REVERSECONVERSION* = 41 + # ImmGetProperty + IGP_PROPERTY* = 4 + IGP_CONVERSION* = 8 + IGP_SENTENCE* = 12 + IGP_UI* = 16 + IGP_SETCOMPSTR* = 20 + IGP_SELECT* = 24 + IME_PROP_AT_CARET* = 65536 + IME_PROP_SPECIAL_UI* = 131072 + IME_PROP_CANDLIST_START_FROM_1* = 262144 + IME_PROP_UNICODE* = 524288 + UI_CAP_2700* = 1 + UI_CAP_ROT90* = 2 + UI_CAP_ROTANY* = 4 + SCS_CAP_COMPSTR* = 1 + SCS_CAP_MAKEREAD* = 2 + SELECT_CAP_CONVERSION* = 1 + SELECT_CAP_SENTENCE* = 2 + # ImmNotifyIME + NI_CHANGECANDIDATELIST* = 19 + NI_CLOSECANDIDATE* = 17 + NI_COMPOSITIONSTR* = 21 + NI_OPENCANDIDATE* = 16 + NI_SELECTCANDIDATESTR* = 18 + NI_SETCANDIDATE_PAGESIZE* = 23 + NI_SETCANDIDATE_PAGESTART* = 22 + CPS_CANCEL* = 4 + CPS_COMPLETE* = 1 + CPS_CONVERT* = 2 + CPS_REVERT* = 3 + # ImmSetCompositionString + SCS_SETSTR* = 9 + SCS_CHANGEATTR* = 18 + SCS_CHANGECLAUSE* = 36 + # ImmUnregisterWord + IME_REGWORD_STYLE_EUDC* = 1 + IME_REGWORD_STYLE_USER_FIRST* = 0x80000000 + IME_REGWORD_STYLE_USER_LAST* = -1 + # InitializeSecurityDescriptor + SECURITY_DESCRIPTOR_REVISION* = 1 + # IsTextUnicode + IS_TEXT_UNICODE_ASCII16* = 1 + IS_TEXT_UNICODE_REVERSE_ASCII16* = 16 + IS_TEXT_UNICODE_STATISTICS* = 2 + IS_TEXT_UNICODE_REVERSE_STATISTICS* = 32 + IS_TEXT_UNICODE_CONTROLS* = 4 + IS_TEXT_UNICODE_REVERSE_CONTROLS* = 64 + IS_TEXT_UNICODE_SIGNATURE* = 8 + IS_TEXT_UNICODE_REVERSE_SIGNATURE* = 128 + IS_TEXT_UNICODE_ILLEGAL_CHARS* = 256 + IS_TEXT_UNICODE_ODD_LENGTH* = 512 + IS_TEXT_UNICODE_NULL_BYTES* = 4096 + IS_TEXT_UNICODE_UNICODE_MASK* = 15 + IS_TEXT_UNICODE_REVERSE_MASK* = 240 + IS_TEXT_UNICODE_NOT_UNICODE_MASK* = 3840 + IS_TEXT_UNICODE_NOT_ASCII_MASK* = 61440 + # JournalPlaybackProc, KeyboardProc + HC_GETNEXT* = 1 + HC_SKIP* = 2 + HC_SYSMODALOFF* = 5 + HC_SYSMODALON* = 4 + HC_NOREMOVE* = 3 + # keybd_event + KEYEVENTF_EXTENDEDKEY* = 1 + KEYEVENTF_KEYUP* = 2 + # LoadBitmap + OBM_BTNCORNERS* = 32758 + OBM_BTSIZE* = 32761 + OBM_CHECK* = 32760 + OBM_CHECKBOXES* = 32759 + OBM_CLOSE* = 32754 + OBM_COMBO* = 32738 + OBM_DNARROW* = 32752 + OBM_DNARROWD* = 32742 + OBM_DNARROWI* = 32736 + OBM_LFARROW* = 32750 + OBM_LFARROWI* = 32734 + OBM_LFARROWD* = 32740 + OBM_MNARROW* = 32739 + OBM_OLD_CLOSE* = 32767 + OBM_OLD_DNARROW* = 32764 + OBM_OLD_LFARROW* = 32762 + OBM_OLD_REDUCE* = 32757 + OBM_OLD_RESTORE* = 32755 + OBM_OLD_RGARROW* = 32763 + OBM_OLD_UPARROW* = 32765 + OBM_OLD_ZOOM* = 32756 + OBM_REDUCE* = 32749 + OBM_REDUCED* = 32746 + OBM_RESTORE* = 32747 + OBM_RESTORED* = 32744 + OBM_RGARROW* = 32751 + OBM_RGARROWD* = 32741 + OBM_RGARROWI* = 32735 + OBM_SIZE* = 32766 + OBM_UPARROW* = 32753 + OBM_UPARROWD* = 32743 + OBM_UPARROWI* = 32737 + OBM_ZOOM* = 32748 + OBM_ZOOMD* = 32745 + # LoadLibraryEx + DONT_RESOLVE_DLL_REFERENCES* = 1 + LOAD_LIBRARY_AS_DATAFILE* = 2 + LOAD_WITH_ALTERED_SEARCH_PATH* = 8 + # LocalAlloc, LocalFlags + LPTR* = 64 + LHND* = 66 + NONZEROLHND* = 2 + NONZEROLPTR* = 0 + LMEM_NONZEROLHND* = 2 + LMEM_NONZEROLPTR* = 0 + LMEM_FIXED* = 0 + LMEM_MOVEABLE* = 2 + LMEM_NOCOMPACT* = 16 + LMEM_NODISCARD* = 32 + LMEM_ZEROINIT* = 64 + LMEM_MODIFY* = 128 + LMEM_LOCKCOUNT* = 255 + LMEM_DISCARDABLE* = 3840 + LMEM_DISCARDED* = 16384 + LMEM_INVALID_HANDLE* = 32768 + # LockFileEx + LOCKFILE_FAIL_IMMEDIATELY* = 1 + LOCKFILE_EXCLUSIVE_LOCK* = 2 + # LogonUser + # LZCopy, LZInit, LZRead + # MessageBeep, MessageBox + MB_USERICON* = 0x00000080 + MB_ICONASTERISK* = 0x00000040 + MB_ICONEXCLAMATION* = 0x00000030 + MB_ICONWARNING* = 0x00000030 + MB_ICONERROR* = 0x00000010 + MB_ICONHAND* = 0x00000010 + MB_ICONQUESTION* = 0x00000020 + MB_OK* = 0 + MB_ABORTRETRYIGNORE* = 0x00000002 + MB_APPLMODAL* = 0 + MB_DEFAULT_DESKTOP_ONLY* = 0x00020000 + MB_HELP* = 0x00004000 + MB_RIGHT* = 0x00080000 + MB_RTLREADING* = 0x00100000 + MB_TOPMOST* = 0x00040000 + MB_DEFBUTTON1* = 0 + MB_DEFBUTTON2* = 0x00000100 + MB_DEFBUTTON3* = 0x00000200 + MB_DEFBUTTON4* = 0x00000300 + MB_ICONINFORMATION* = 0x00000040 + MB_ICONSTOP* = 0x00000010 + MB_OKCANCEL* = 0x00000001 + MB_RETRYCANCEL* = 0x00000005 + MB_SERVICE_NOTIFICATION* = 0x00040000 + MB_SETFOREGROUND* = 0x00010000 + MB_SYSTEMMODAL* = 0x00001000 + MB_TASKMODAL* = 0x00002000 + MB_YESNO* = 0x00000004 + MB_YESNOCANCEL* = 0x00000003 + IDABORT* = 3 + IDCANCEL* = 2 + IDCLOSE* = 8 + IDHELP* = 9 + IDIGNORE* = 5 + IDNO* = 7 + IDOK* = 1 + IDRETRY* = 4 + IDYES* = 6 + # MessageProc + MSGF_DIALOGBOX* = 0 + MSGF_MENU* = 2 + MSGF_NEXTWINDOW* = 6 + MSGF_SCROLLBAR* = 5 + MSGF_MAINLOOP* = 8 + MSGF_USER* = 4096 + # ModifyWorldTransform + MWT_IDENTITY* = 1 + MWT_LEFTMULTIPLY* = 2 + MWT_RIGHTMULTIPLY* = 3 + # mouse_event + MOUSEEVENTF_ABSOLUTE* = 32768 + MOUSEEVENTF_MOVE* = 1 + MOUSEEVENTF_LEFTDOWN* = 2 + MOUSEEVENTF_LEFTUP* = 4 + MOUSEEVENTF_RIGHTDOWN* = 8 + MOUSEEVENTF_RIGHTUP* = 16 + MOUSEEVENTF_MIDDLEDOWN* = 32 + MOUSEEVENTF_MIDDLEUP* = 64 + # MoveFileEx + MOVEFILE_REPLACE_EXISTING* = 1 + MOVEFILE_COPY_ALLOWED* = 2 + MOVEFILE_DELAY_UNTIL_REBOOT* = 4 + # MsgWaitForMultipleObjects, WaitForMultipleObjectsEx + WAIT_OBJECT_0* = 0 + WAIT_ABANDONED_0* = 0x00000080 + WAIT_TIMEOUT* = 0x00000102 + WAIT_IO_COMPLETION* = 0x000000C0 + WAIT_ABANDONED* = 0x00000080 + WAIT_FAILED* = 0xFFFFFFFF + MAXIMUM_WAIT_OBJECTS* = 0x00000040 + MAXIMUM_SUSPEND_COUNT* = 0x0000007F + # MultiByteToWideChar + MB_PRECOMPOSED* = 1 + MB_COMPOSITE* = 2 + MB_ERR_INVALID_CHARS* = 8 + MB_USEGLYPHCHARS* = 4 + # NDdeSetTrustedShare + # NetAccessCheck + # NetServerEnum + # NetServiceControl + # NetUserEnum + # OpenProcessToken + TOKEN_ADJUST_DEFAULT* = 128 + TOKEN_ADJUST_GROUPS* = 64 + TOKEN_ADJUST_PRIVILEGES* = 32 + TOKEN_ALL_ACCESS* = 0x000F00FF + TOKEN_ASSIGN_PRIMARY* = 1 + TOKEN_DUPLICATE* = 2 + TOKEN_EXECUTE* = 0x00020000 + TOKEN_IMPERSONATE* = 4 + TOKEN_QUERY* = 8 + TOKEN_QUERY_SOURCE* = 16 + TOKEN_READ* = 0x00020008 + TOKEN_WRITE* = 0x000200E0 + # OpenSCManager + SC_MANAGER_ALL_ACCESS* = 0x000F003F + SC_MANAGER_CONNECT* = 1 + SC_MANAGER_CREATE_SERVICE* = 2 + SC_MANAGER_ENUMERATE_SERVICE* = 4 + SC_MANAGER_LOCK* = 8 + SC_MANAGER_QUERY_LOCK_STATUS* = 16 + SC_MANAGER_MODIFY_BOOT_CONFIG* = 32 + # PostMessage + HWND_BROADCAST* = HWND(0xffff) + +const + # PrepareTape + TAPE_FORMAT* = 0x00000005 + TAPE_LOAD* = 0 + TAPE_LOCK* = 0x00000003 + TAPE_TENSION* = 0x00000002 + TAPE_UNLOAD* = 0x00000001 + TAPE_UNLOCK* = 0x00000004 + # PropertySheet + IS_PSREBOOTSYSTEM* = 3 + IS_PSRESTARTWINDOWS* = 2 + # PropSheetPageProc + PSPCB_CREATE* = 2 + PSPCB_RELEASE* = 1 + # PurgeComm + PURGE_TXABORT* = 1 + PURGE_RXABORT* = 2 + PURGE_TXCLEAR* = 4 + PURGE_RXCLEAR* = 8 + # QueryServiceObjectSecurity + OWNER_SECURITY_INFORMATION* = 0x00000001 + GROUP_SECURITY_INFORMATION* = 0x00000002 + DACL_SECURITY_INFORMATION* = 0x00000004 + SACL_SECURITY_INFORMATION* = 0x00000008 + # ReadEventLog, ReportEvent + EVENTLOG_FORWARDS_READ* = 4 + EVENTLOG_BACKWARDS_READ* = 8 + EVENTLOG_SEEK_READ* = 2 + EVENTLOG_SEQUENTIAL_READ* = 1 + EVENTLOG_ERROR_TYPE* = 1 + EVENTLOG_WARNING_TYPE* = 2 + EVENTLOG_INFORMATION_TYPE* = 4 + EVENTLOG_AUDIT_SUCCESS* = 8 + + EVENTLOG_AUDIT_FAILURE* = 16 + # RedrawWindow + RDW_ERASE* = 4 + RDW_FRAME* = 1024 + RDW_INTERNALPAINT* = 2 + RDW_INVALIDATE* = 1 + RDW_NOERASE* = 32 + RDW_NOFRAME* = 2048 + RDW_NOINTERNALPAINT* = 16 + RDW_VALIDATE* = 8 + RDW_ERASENOW* = 512 + RDW_UPDATENOW* = 256 + RDW_ALLCHILDREN* = 128 + RDW_NOCHILDREN* = 64 + + # RegCreateKey + HKEY_CLASSES_ROOT* = HKEY(0x80000000) + HKEY_CURRENT_USER* = HKEY(0x80000001) + HKEY_LOCAL_MACHINE* = HKEY(0x80000002) + HKEY_USERS* = HKEY(0x80000003) + HKEY_PERFORMANCE_DATA* = HKEY(0x80000004) + HKEY_CURRENT_CONFIG* = HKEY(0x80000005) + HKEY_DYN_DATA* = HKEY(0x80000006) + +const + # RegCreateKeyEx + REG_OPTION_VOLATILE* = 0x00000001 + REG_OPTION_NON_VOLATILE* = 0 + REG_CREATED_NEW_KEY* = 0x00000001 + REG_OPENED_EXISTING_KEY* = 0x00000002 + # RegEnumValue + REG_BINARY* = 3 + REG_DWORD* = 4 + REG_DWORD_LITTLE_ENDIAN* = 4 + REG_DWORD_BIG_ENDIAN* = 5 + REG_EXPAND_SZ* = 2 + REG_FULL_RESOURCE_DESCRIPTOR* = 9 + REG_LINK* = 6 + REG_MULTI_SZ* = 7 + REG_NONE* = 0 + REG_RESOURCE_LIST* = 8 + REG_RESOURCE_REQUIREMENTS_LIST* = 10 + REG_SZ* = 1 + # RegisterHotKey + MOD_ALT* = 1 + MOD_CONTROL* = 2 + MOD_SHIFT* = 4 + MOD_WIN* = 8 + IDHOT_SNAPDESKTOP* = -2 + IDHOT_SNAPWINDOW* = -1 + # RegNotifyChangeKeyValue + REG_NOTIFY_CHANGE_NAME* = 0x00000001 + REG_NOTIFY_CHANGE_ATTRIBUTES* = 0x00000002 + REG_NOTIFY_CHANGE_LAST_SET* = 0x00000004 + REG_NOTIFY_CHANGE_SECURITY* = 0x00000008 + # ScrollWindowEx + SW_ERASE* = 4 + SW_INVALIDATE* = 2 + SW_SCROLLCHILDREN* = 1 + # SendMessageTimeout + SMTO_ABORTIFHUNG* = 2 + SMTO_BLOCK* = 1 + SMTO_NORMAL* = 0 + # SetBkMode + OPAQUE* = 2 + + TRANSPARENT* = 1 + # SetDebugErrorLevel + SLE_ERROR* = 1 + SLE_MINORERROR* = 2 + SLE_WARNING* = 3 + # SetErrorMode + SEM_FAILCRITICALERRORS* = 1 + SEM_NOALIGNMENTFAULTEXCEPT* = 4 + SEM_NOGPFAULTERRORBOX* = 2 + SEM_NOOPENFILEERRORBOX* = 32768 + # SetICMMode + ICM_ON* = 2 + ICM_OFF* = 1 + ICM_QUERY* = 3 + # SetJob + # Locale Information + LOCALE_ILANGUAGE* = 1 + LOCALE_SLANGUAGE* = 2 + LOCALE_SENGLANGUAGE* = 4097 + LOCALE_SABBREVLANGNAME* = 3 + LOCALE_SNATIVELANGNAME* = 4 + LOCALE_ICOUNTRY* = 5 + LOCALE_SCOUNTRY* = 6 + LOCALE_SENGCOUNTRY* = 4098 + LOCALE_SABBREVCTRYNAME* = 7 + LOCALE_SNATIVECTRYNAME* = 8 + LOCALE_IDEFAULTLANGUAGE* = 9 + LOCALE_IDEFAULTCOUNTRY* = 10 + LOCALE_IDEFAULTANSICODEPAGE* = 4100 + LOCALE_IDEFAULTCODEPAGE* = 11 + LOCALE_SLIST* = 12 + LOCALE_IMEASURE* = 13 + LOCALE_SDECIMAL* = 14 + LOCALE_STHOUSAND* = 15 + LOCALE_SGROUPING* = 16 + LOCALE_IDIGITS* = 17 + LOCALE_ILZERO* = 18 + LOCALE_INEGNUMBER* = 4112 + LOCALE_SCURRENCY* = 20 + LOCALE_SMONDECIMALSEP* = 22 + LOCALE_SMONTHOUSANDSEP* = 23 + LOCALE_SMONGROUPING* = 24 + LOCALE_ICURRDIGITS* = 25 + LOCALE_ICURRENCY* = 27 + LOCALE_INEGCURR* = 28 + LOCALE_SDATE* = 29 + LOCALE_STIME* = 30 + LOCALE_STIMEFORMAT* = 4099 + LOCALE_SSHORTDATE* = 31 + LOCALE_SLONGDATE* = 32 + LOCALE_IDATE* = 33 + LOCALE_ILDATE* = 34 + LOCALE_ITIME* = 35 + LOCALE_ITLZERO* = 37 + LOCALE_IDAYLZERO* = 38 + LOCALE_IMONLZERO* = 39 + LOCALE_S1159* = 40 + LOCALE_S2359* = 41 + LOCALE_ICALENDARTYPE* = 4105 + LOCALE_IOPTIONALCALENDAR* = 4107 + LOCALE_IFIRSTDAYOFWEEK* = 4108 + LOCALE_IFIRSTWEEKOFYEAR* = 4109 + LOCALE_SDAYNAME1* = 42 + LOCALE_SDAYNAME2* = 43 + LOCALE_SDAYNAME3* = 44 + LOCALE_SDAYNAME4* = 45 + LOCALE_SDAYNAME5* = 46 + LOCALE_SDAYNAME6* = 47 + LOCALE_SDAYNAME7* = 48 + LOCALE_SABBREVDAYNAME1* = 49 + LOCALE_SABBREVDAYNAME2* = 50 + LOCALE_SABBREVDAYNAME3* = 51 + LOCALE_SABBREVDAYNAME4* = 52 + LOCALE_SABBREVDAYNAME5* = 53 + LOCALE_SABBREVDAYNAME6* = 54 + LOCALE_SABBREVDAYNAME7* = 55 + LOCALE_SMONTHNAME1* = 56 + LOCALE_SMONTHNAME2* = 57 + LOCALE_SMONTHNAME3* = 58 + LOCALE_SMONTHNAME4* = 59 + LOCALE_SMONTHNAME5* = 60 + LOCALE_SMONTHNAME6* = 61 + LOCALE_SMONTHNAME7* = 62 + LOCALE_SMONTHNAME8* = 63 + LOCALE_SMONTHNAME9* = 64 + LOCALE_SMONTHNAME10* = 65 + LOCALE_SMONTHNAME11* = 66 + LOCALE_SMONTHNAME12* = 67 + LOCALE_SMONTHNAME13* = 4110 + LOCALE_SABBREVMONTHNAME1* = 68 + LOCALE_SABBREVMONTHNAME2* = 69 + LOCALE_SABBREVMONTHNAME3* = 70 + LOCALE_SABBREVMONTHNAME4* = 71 + LOCALE_SABBREVMONTHNAME5* = 72 + LOCALE_SABBREVMONTHNAME6* = 73 + LOCALE_SABBREVMONTHNAME7* = 74 + LOCALE_SABBREVMONTHNAME8* = 75 + LOCALE_SABBREVMONTHNAME9* = 76 + LOCALE_SABBREVMONTHNAME10* = 77 + LOCALE_SABBREVMONTHNAME11* = 78 + LOCALE_SABBREVMONTHNAME12* = 79 + LOCALE_SABBREVMONTHNAME13* = 4111 + LOCALE_SPOSITIVESIGN* = 80 + LOCALE_SNEGATIVESIGN* = 81 + LOCALE_IPOSSIGNPOSN* = 82 + LOCALE_INEGSIGNPOSN* = 83 + LOCALE_IPOSSYMPRECEDES* = 84 + LOCALE_IPOSSEPBYSPACE* = 85 + LOCALE_INEGSYMPRECEDES* = 86 + LOCALE_INEGSEPBYSPACE* = 87 + LOCALE_NOUSEROVERRIDE* = 0x80000000 + LOCALE_USE_CP_ACP* = 0x40000000 # use the system ACP + LOCALE_RETURN_NUMBER* = 0x20000000 # return number instead + LOCALE_SISO639LANGNAME* = 0x00000059 + LOCALE_SISO3166CTRYNAME* = 0x0000005A + # Calendar Type Information + CAL_ICALINTVALUE* = 1 + CAL_IYEAROFFSETRANGE* = 3 + CAL_SABBREVDAYNAME1* = 14 + CAL_SABBREVDAYNAME2* = 15 + CAL_SABBREVDAYNAME3* = 16 + CAL_SABBREVDAYNAME4* = 17 + CAL_SABBREVDAYNAME5* = 18 + CAL_SABBREVDAYNAME6* = 19 + CAL_SABBREVDAYNAME7* = 20 + CAL_SABBREVMONTHNAME1* = 34 + CAL_SABBREVMONTHNAME2* = 35 + CAL_SABBREVMONTHNAME3* = 36 + CAL_SABBREVMONTHNAME4* = 37 + CAL_SABBREVMONTHNAME5* = 38 + CAL_SABBREVMONTHNAME6* = 39 + CAL_SABBREVMONTHNAME7* = 40 + CAL_SABBREVMONTHNAME8* = 41 + CAL_SABBREVMONTHNAME9* = 42 + CAL_SABBREVMONTHNAME10* = 43 + CAL_SABBREVMONTHNAME11* = 44 + CAL_SABBREVMONTHNAME12* = 45 + CAL_SABBREVMONTHNAME13* = 46 + CAL_SCALNAME* = 2 + CAL_SDAYNAME1* = 7 + CAL_SDAYNAME2* = 8 + CAL_SDAYNAME3* = 9 + CAL_SDAYNAME4* = 10 + CAL_SDAYNAME5* = 11 + CAL_SDAYNAME6* = 12 + CAL_SDAYNAME7* = 13 + CAL_SERASTRING* = 4 + CAL_SLONGDATE* = 6 + CAL_SMONTHNAME1* = 21 + CAL_SMONTHNAME2* = 22 + CAL_SMONTHNAME3* = 23 + CAL_SMONTHNAME4* = 24 + CAL_SMONTHNAME5* = 25 + CAL_SMONTHNAME6* = 26 + CAL_SMONTHNAME7* = 27 + CAL_SMONTHNAME8* = 28 + CAL_SMONTHNAME9* = 29 + CAL_SMONTHNAME10* = 30 + CAL_SMONTHNAME11* = 31 + CAL_SMONTHNAME12* = 32 + CAL_SMONTHNAME13* = 33 + CAL_SSHORTDATE* = 5 + # SetProcessWorkingSetSize + PROCESS_SET_QUOTA* = 256 + # SetPrinter + # SetService + # SetStretchBltMode + BLACKONWHITE* = 1 + COLORONCOLOR* = 3 + HALFTONE* = 4 + STRETCH_ANDSCANS* = 1 + STRETCH_DELETESCANS* = 3 + STRETCH_HALFTONE* = 4 + STRETCH_ORSCANS* = 2 + WHITEONBLACK* = 2 + # SetSystemCursor + OCR_NORMAL* = 32512 + OCR_IBEAM* = 32513 + OCR_WAIT* = 32514 + OCR_CROSS* = 32515 + OCR_UP* = 32516 + OCR_SIZE* = 32640 + OCR_ICON* = 32641 + OCR_SIZENWSE* = 32642 + OCR_SIZENESW* = 32643 + OCR_SIZEWE* = 32644 + OCR_SIZENS* = 32645 + OCR_SIZEALL* = 32646 + OCR_NO* = 32648 + OCR_APPSTARTING* = 32650 + # SetTapePosition + TAPE_ABSOLUTE_BLOCK* = 0x00000001 + TAPE_LOGICAL_BLOCK* = 0x00000002 + TAPE_REWIND* = 0 + TAPE_SPACE_END_OF_DATA* = 0x00000004 + TAPE_SPACE_FILEMARKS* = 0x00000006 + TAPE_SPACE_RELATIVE_BLOCKS* = 0x00000005 + TAPE_SPACE_SEQUENTIAL_FMKS* = 0x00000007 + TAPE_SPACE_SEQUENTIAL_SMKS* = 0x00000009 + TAPE_SPACE_SETMARKS* = 0x00000008 + # SetUnhandledExceptionFilter + EXCEPTION_EXECUTE_HANDLER* = 1 + EXCEPTION_CONTINUE_EXECUTION* = -1 + EXCEPTION_CONTINUE_SEARCH* = 0 + + # SetWindowPos, DeferWindowPos + HWND_BOTTOM* = HWND(1) + HWND_NOTOPMOST* = HWND(-2) + HWND_TOP* = HWND(0) + HWND_TOPMOST* = HWND(-1) + +const + SWP_DRAWFRAME* = 32 + SWP_FRAMECHANGED* = 32 + SWP_HIDEWINDOW* = 128 + SWP_NOACTIVATE* = 16 + SWP_NOCOPYBITS* = 256 + SWP_NOMOVE* = 2 + SWP_NOSIZE* = 1 + SWP_NOREDRAW* = 8 + SWP_NOZORDER* = 4 + SWP_SHOWWINDOW* = 64 + SWP_NOOWNERZORDER* = 512 + SWP_NOREPOSITION* = 512 + SWP_NOSENDCHANGING* = 1024 + # SHAddToRecentDocs + # SHAppBarMessage + # SHChangeNotify + # ShellProc + HSHELL_ACTIVATESHELLWINDOW* = 3 + HSHELL_GETMINRECT* = 5 + HSHELL_LANGUAGE* = 8 + HSHELL_REDRAW* = 6 + HSHELL_TASKMAN* = 7 + HSHELL_WINDOWACTIVATED* = 4 + HSHELL_WINDOWCREATED* = 1 + HSHELL_WINDOWDESTROYED* = 2 + # SHGetFileInfo + # SHGetSpecialFolderLocation + # ShowWindow + SW_HIDE* = 0 + SW_MAXIMIZE* = 3 + SW_MINIMIZE* = 6 + SW_NORMAL* = 1 + SW_RESTORE* = 9 + SW_SHOW* = 5 + SW_SHOWDEFAULT* = 10 + SW_SHOWMAXIMIZED* = 3 + SW_SHOWMINIMIZED* = 2 + SW_SHOWMINNOACTIVE* = 7 + SW_SHOWNA* = 8 + SW_SHOWNOACTIVATE* = 4 + SW_SHOWNORMAL* = 1 + WPF_RESTORETOMAXIMIZED* = 2 + WPF_SETMINPOSITION* = 1 + # Sleep + INFINITE* = -1'i32 + # SystemParametersInfo + SPI_GETBEEP* = 1 + SPI_SETBEEP* = 2 + SPI_GETMOUSE* = 3 + SPI_SETMOUSE* = 4 + SPI_GETBORDER* = 5 + SPI_SETBORDER* = 6 + SPI_GETKEYBOARDSPEED* = 10 + SPI_SETKEYBOARDSPEED* = 11 + SPI_LANGDRIVER* = 12 + SPI_ICONHORIZONTALSPACING* = 13 + SPI_GETSCREENSAVETIMEOUT* = 14 + SPI_SETSCREENSAVETIMEOUT* = 15 + SPI_GETSCREENSAVEACTIVE* = 16 + SPI_SETSCREENSAVEACTIVE* = 17 + SPI_GETGRIDGRANULARITY* = 18 + SPI_SETGRIDGRANULARITY* = 19 + SPI_SETDESKWALLPAPER* = 20 + SPI_SETDESKPATTERN* = 21 + SPI_GETKEYBOARDDELAY* = 22 + SPI_SETKEYBOARDDELAY* = 23 + SPI_ICONVERTICALSPACING* = 24 + SPI_GETICONTITLEWRAP* = 25 + SPI_SETICONTITLEWRAP* = 26 + SPI_GETMENUDROPALIGNMENT* = 27 + SPI_SETMENUDROPALIGNMENT* = 28 + SPI_SETDOUBLECLKWIDTH* = 29 + SPI_SETDOUBLECLKHEIGHT* = 30 + SPI_GETICONTITLELOGFONT* = 31 + SPI_SETDOUBLECLICKTIME* = 32 + SPI_SETMOUSEBUTTONSWAP* = 33 + SPI_SETICONTITLELOGFONT* = 34 + SPI_GETFASTTASKSWITCH* = 35 + SPI_SETFASTTASKSWITCH* = 36 + SPI_SETDRAGFULLWINDOWS* = 37 + SPI_GETDRAGFULLWINDOWS* = 38 + SPI_GETNONCLIENTMETRICS* = 41 + SPI_SETNONCLIENTMETRICS* = 42 + + SPI_GETMINIMIZEDMETRICS* = 43 + SPI_SETMINIMIZEDMETRICS* = 44 + SPI_GETICONMETRICS* = 45 + SPI_SETICONMETRICS* = 46 + SPI_SETWORKAREA* = 47 + SPI_GETWORKAREA* = 48 + SPI_SETPENWINDOWS* = 49 + SPI_GETFILTERKEYS* = 50 + SPI_SETFILTERKEYS* = 51 + SPI_GETTOGGLEKEYS* = 52 + SPI_SETTOGGLEKEYS* = 53 + SPI_GETMOUSEKEYS* = 54 + SPI_SETMOUSEKEYS* = 55 + SPI_GETSHOWSOUNDS* = 56 + SPI_SETSHOWSOUNDS* = 57 + SPI_GETSTICKYKEYS* = 58 + SPI_SETSTICKYKEYS* = 59 + SPI_GETACCESSTIMEOUT* = 60 + SPI_SETACCESSTIMEOUT* = 61 + SPI_GETSERIALKEYS* = 62 + SPI_SETSERIALKEYS* = 63 + SPI_GETSOUNDSENTRY* = 64 + SPI_SETSOUNDSENTRY* = 65 + SPI_GETHIGHCONTRAST* = 66 + SPI_SETHIGHCONTRAST* = 67 + SPI_GETKEYBOARDPREF* = 68 + SPI_SETKEYBOARDPREF* = 69 + SPI_GETSCREENREADER* = 70 + SPI_SETSCREENREADER* = 71 + SPI_GETANIMATION* = 72 + SPI_SETANIMATION* = 73 + SPI_GETFONTSMOOTHING* = 74 + SPI_SETFONTSMOOTHING* = 75 + SPI_SETDRAGWIDTH* = 76 + SPI_SETDRAGHEIGHT* = 77 + SPI_SETHANDHELD* = 78 + SPI_GETLOWPOWERTIMEOUT* = 79 + SPI_GETPOWEROFFTIMEOUT* = 80 + SPI_SETLOWPOWERTIMEOUT* = 81 + SPI_SETPOWEROFFTIMEOUT* = 82 + SPI_GETLOWPOWERACTIVE* = 83 + SPI_GETPOWEROFFACTIVE* = 84 + SPI_SETLOWPOWERACTIVE* = 85 + SPI_SETPOWEROFFACTIVE* = 86 + SPI_SETCURSORS* = 87 + SPI_SETICONS* = 88 + SPI_GETDEFAULTINPUTLANG* = 89 + SPI_SETDEFAULTINPUTLANG* = 90 + SPI_SETLANGTOGGLE* = 91 + SPI_GETWINDOWSEXTENSION* = 92 + SPI_SETMOUSETRAILS* = 93 + SPI_GETMOUSETRAILS* = 94 + SPI_GETSNAPTODEFBUTTON* = 95 + SPI_SETSNAPTODEFBUTTON* = 96 + SPI_SCREENSAVERRUNNING* = 97 + SPI_SETSCREENSAVERRUNNING* = 97 + SPI_GETMOUSEHOVERWIDTH* = 98 + SPI_SETMOUSEHOVERWIDTH* = 99 + SPI_GETMOUSEHOVERHEIGHT* = 100 + SPI_SETMOUSEHOVERHEIGHT* = 101 + SPI_GETMOUSEHOVERTIME* = 102 + SPI_SETMOUSEHOVERTIME* = 103 + SPI_GETWHEELSCROLLLINES* = 104 + SPI_SETWHEELSCROLLLINES* = 105 + SPI_GETMENUSHOWDELAY* = 106 + SPI_SETMENUSHOWDELAY* = 107 + SPI_GETSHOWIMEUI* = 110 + SPI_SETSHOWIMEUI* = 111 + # Windows Me/2000 and higher + SPI_GETMOUSESPEED* = 112 + SPI_SETMOUSESPEED* = 113 + SPI_GETSCREENSAVERRUNNING* = 114 + SPI_GETDESKWALLPAPER* = 115 + SPI_GETACTIVEWINDOWTRACKING* = 4096 + SPI_SETACTIVEWINDOWTRACKING* = 4097 + SPI_GETMENUANIMATION* = 4098 + SPI_SETMENUANIMATION* = 4099 + SPI_GETCOMBOBOXANIMATION* = 4100 + SPI_SETCOMBOBOXANIMATION* = 4101 + SPI_GETLISTBOXSMOOTHSCROLLING* = 4102 + SPI_SETLISTBOXSMOOTHSCROLLING* = 4103 + SPI_GETGRADIENTCAPTIONS* = 4104 + SPI_SETGRADIENTCAPTIONS* = 4105 + SPI_GETKEYBOARDCUES* = 4106 + SPI_SETKEYBOARDCUES* = 4107 + SPI_GETMENUUNDERLINES* = 4106 + SPI_SETMENUUNDERLINES* = 4107 + SPI_GETACTIVEWNDTRKZORDER* = 4108 + SPI_SETACTIVEWNDTRKZORDER* = 4109 + SPI_GETHOTTRACKING* = 4110 + SPI_SETHOTTRACKING* = 4111 + SPI_GETMENUFADE* = 4114 + SPI_SETMENUFADE* = 4115 + SPI_GETSELECTIONFADE* = 4116 + SPI_SETSELECTIONFADE* = 4117 + SPI_GETTOOLTIPANIMATION* = 4118 + SPI_SETTOOLTIPANIMATION* = 4119 + SPI_GETTOOLTIPFADE* = 4120 + SPI_SETTOOLTIPFADE* = 4121 + SPI_GETCURSORSHADOW* = 4122 + SPI_SETCURSORSHADOW* = 4123 + SPI_GETUIEFFECTS* = 4158 + SPI_SETUIEFFECTS* = 4159 + SPI_GETFOREGROUNDLOCKTIMEOUT* = 8192 + SPI_SETFOREGROUNDLOCKTIMEOUT* = 8193 + SPI_GETACTIVEWNDTRKTIMEOUT* = 8194 + SPI_SETACTIVEWNDTRKTIMEOUT* = 8195 + SPI_GETFOREGROUNDFLASHCOUNT* = 8196 + SPI_SETFOREGROUNDFLASHCOUNT* = 8197 + SPI_GETCARETWIDTH* = 8198 + SPI_SETCARETWIDTH* = 8199 + # Windows XP and higher + SPI_GETMOUSESONAR* = 4124 + SPI_SETMOUSESONAR* = 4125 + SPI_GETMOUSECLICKLOCK* = 4126 + SPI_SETMOUSECLICKLOCK* = 4127 + SPI_GETMOUSEVANISH* = 4128 + SPI_SETMOUSEVANISH* = 4129 + SPI_GETFLATMENU* = 4130 + SPI_SETFLATMENU* = 4131 + SPI_GETDROPSHADOW* = 4132 + SPI_SETDROPSHADOW* = 4133 + SPI_GETBLOCKSENDINPUTRESETS* = 4134 + SPI_SETBLOCKSENDINPUTRESETS* = 4135 + SPI_GETMOUSECLICKLOCKTIME* = 8200 + SPI_SETMOUSECLICKLOCKTIME* = 8201 + SPI_GETFONTSMOOTHINGTYPE* = 8202 + SPI_SETFONTSMOOTHINGTYPE* = 8203 + SPI_GETFONTSMOOTHINGCONTRAST* = 8204 + SPI_SETFONTSMOOTHINGCONTRAST* = 8205 + SPI_GETFOCUSBORDERWIDTH* = 8206 + SPI_SETFOCUSBORDERWIDTH* = 8207 + SPI_GETFOCUSBORDERHEIGHT* = 8208 + SPI_SETFOCUSBORDERHEIGHT* = 8209 + SPI_GETFONTSMOOTHINGORIENTATION* = 8210 + SPI_SETFONTSMOOTHINGORIENTATION* = 8211 + # constants for SPI_GETFONTSMOOTHINGTYPE and SPI_SETFONTSMOOTHINGTYPE: + FE_FONTSMOOTHINGSTANDARD* = 1 + FE_FONTSMOOTHINGCLEARTYPE* = 2 + FE_FONTSMOOTHINGDOCKING* = 32768 + # constants for SPI_GETFONTSMOOTHINGORIENTATION and SPI_SETFONTSMOOTHINGORIENTATION: + FE_FONTSMOOTHINGORIENTATIONBGR* = 0 + FE_FONTSMOOTHINGORIENTATIONRGB* = 1 + # Flags + SPIF_UPDATEINIFILE* = 1 + SPIF_SENDWININICHANGE* = 2 + SPIF_SENDCHANGE* = 2 + # TrackPopupMenu, TrackPopMenuEx + TPM_CENTERALIGN* = 0x00000004 + TPM_LEFTALIGN* = 0 + TPM_RIGHTALIGN* = 0x00000008 + TPM_LEFTBUTTON* = 0 + TPM_RIGHTBUTTON* = 0x00000002 + TPM_HORIZONTAL* = 0 + TPM_VERTICAL* = 0x00000040 + # TranslateCharsetInfo + TCI_SRCCHARSET* = 1 + TCI_SRCCODEPAGE* = 2 + TCI_SRCFONTSIG* = 3 + # VerFindFile + VFFF_ISSHAREDFILE* = 1 + VFF_CURNEDEST* = 1 + VFF_FILEINUSE* = 2 + VFF_BUFFTOOSMALL* = 4 + # VerInstallFile + VIFF_FORCEINSTALL* = 1 + VIFF_DONTDELETEOLD* = 2 + VIF_TEMPFILE* = 0x00000001 + VIF_MISMATCH* = 0x00000002 + VIF_SRCOLD* = 0x00000004 + VIF_DIFFLANG* = 0x00000008 + VIF_DIFFCODEPG* = 0x00000010 + VIF_DIFFTYPE* = 0x00000020 + VIF_WRITEPROT* = 0x00000040 + VIF_FILEINUSE* = 0x00000080 + VIF_OUTOFSPACE* = 0x00000100 + VIF_ACCESSVIOLATION* = 0x00000200 + VIF_SHARINGVIOLATION* = 0x00000400 + VIF_CANNOTCREATE* = 0x00000800 + VIF_CANNOTDELETE* = 0x00001000 + VIF_CANNOTDELETECUR* = 0x00004000 + VIF_CANNOTRENAME* = 0x00002000 + VIF_OUTOFMEMORY* = 0x00008000 + VIF_CANNOTREADSRC* = 0x00010000 + VIF_CANNOTREADDST* = 0x00020000 + VIF_BUFFTOOSMALL* = 0x00040000 + # WideCharToMultiByte + WC_COMPOSITECHECK* = 512 + WC_DISCARDNS* = 16 + WC_SEPCHARS* = 32 + WC_DEFAULTCHAR* = 64 + # WinHelp + HELP_COMMAND* = 0x00000102 + HELP_CONTENTS* = 0x00000003 + HELP_CONTEXT* = 0x00000001 + HELP_CONTEXTPOPUP* = 0x00000008 + HELP_FORCEFILE* = 0x00000009 + HELP_HELPONHELP* = 0x00000004 + HELP_INDEX* = 0x00000003 + HELP_KEY* = 0x00000101 + HELP_MULTIKEY* = 0x00000201 + HELP_PARTIALKEY* = 0x00000105 + HELP_QUIT* = 0x00000002 + HELP_SETCONTENTS* = 0x00000005 + HELP_SETINDEX* = 0x00000005 + HELP_CONTEXTMENU* = 0x0000000A + HELP_FINDER* = 0x0000000B + HELP_WM_HELP* = 0x0000000C + HELP_TCARD* = 0x00008000 + HELP_TCARD_DATA* = 0x00000010 + HELP_TCARD_OTHER_CALLER* = 0x00000011 + # WNetAddConnectino2 + CONNECT_UPDATE_PROFILE* = 1 + # WNetConnectionDialog, WNetDisconnectDialog, WNetOpenEnum + RESOURCETYPE_DISK* = 1 + RESOURCETYPE_PRINT* = 2 + RESOURCETYPE_ANY* = 0 + RESOURCE_CONNECTED* = 1 + RESOURCE_GLOBALNET* = 2 + RESOURCE_REMEMBERED* = 3 + RESOURCEUSAGE_CONNECTABLE* = 1 + RESOURCEUSAGE_CONTAINER* = 2 + # WNetGetResourceInformation, WNetGetResourceParent + WN_BAD_NETNAME* = 0x00000043 + WN_EXTENDED_ERROR* = 0x000004B8 + WN_MORE_DATA* = 0x000000EA + WN_NO_NETWORK* = 0x000004C6 + WN_SUCCESS* = 0 + WN_ACCESS_DENIED* = 0x00000005 + WN_BAD_PROVIDER* = 0x000004B4 + WN_NOT_AUTHENTICATED* = 0x000004DC + # WNetGetUniversalName + UNIVERSAL_NAME_INFO_LEVEL* = 1 + REMOTE_NAME_INFO_LEVEL* = 2 + # GetExitCodeThread + STILL_ACTIVE* = 0x00000103 + # COMMPROP structure + SP_SERIALCOMM* = 0x00000001 + BAUD_075* = 0x00000001 + BAUD_110* = 0x00000002 + BAUD_134_5* = 0x00000004 + BAUD_150* = 0x00000008 + BAUD_300* = 0x00000010 + BAUD_600* = 0x00000020 + BAUD_1200* = 0x00000040 + BAUD_1800* = 0x00000080 + BAUD_2400* = 0x00000100 + BAUD_4800* = 0x00000200 + BAUD_7200* = 0x00000400 + BAUD_9600* = 0x00000800 + BAUD_14400* = 0x00001000 + BAUD_19200* = 0x00002000 + BAUD_38400* = 0x00004000 + BAUD_56K* = 0x00008000 + BAUD_57600* = 0x00040000 + BAUD_115200* = 0x00020000 + BAUD_128K* = 0x00010000 + BAUD_USER* = 0x10000000 + PST_FAX* = 0x00000021 + PST_LAT* = 0x00000101 + PST_MODEM* = 0x00000006 + PST_NETWORK_BRIDGE* = 0x00000100 + PST_PARALLELPORT* = 0x00000002 + PST_RS232* = 0x00000001 + PST_RS422* = 0x00000003 + PST_RS423* = 0x00000004 + PST_RS449* = 0x00000005 + PST_SCANNER* = 0x00000022 + PST_TCPIP_TELNET* = 0x00000102 + PST_UNSPECIFIED* = 0 + PST_X25* = 0x00000103 + PCF_16BITMODE* = 0x00000200 + PCF_DTRDSR* = 0x00000001 + PCF_INTTIMEOUTS* = 0x00000080 + PCF_PARITY_CHECK* = 0x00000008 + PCF_RLSD* = 0x00000004 + PCF_RTSCTS* = 0x00000002 + PCF_SETXCHAR* = 0x00000020 + PCF_SPECIALCHARS* = 0x00000100 + PCF_TOTALTIMEOUTS* = 0x00000040 + PCF_XONXOFF* = 0x00000010 + SP_BAUD* = 0x00000002 + SP_DATABITS* = 0x00000004 + SP_HANDSHAKING* = 0x00000010 + SP_PARITY* = 0x00000001 + SP_PARITY_CHECK* = 0x00000020 + SP_RLSD* = 0x00000040 + SP_STOPBITS* = 0x00000008 + DATABITS_5* = 1 + DATABITS_6* = 2 + DATABITS_7* = 4 + DATABITS_8* = 8 + DATABITS_16* = 16 + DATABITS_16X* = 32 + STOPBITS_10* = 1 + STOPBITS_15* = 2 + STOPBITS_20* = 4 + PARITY_NONE* = 256 + PARITY_ODD* = 512 + PARITY_EVEN* = 1024 + PARITY_MARK* = 2048 + PARITY_SPACE* = 4096 + COMMPROP_INITIALIZED* = 0xE73CF52E + # DCB structure + CBR_110* = 110 + CBR_300* = 300 + CBR_600* = 600 + CBR_1200* = 1200 + CBR_2400* = 2400 + CBR_4800* = 4800 + CBR_9600* = 9600 + CBR_14400* = 14400 + CBR_19200* = 19200 + CBR_38400* = 38400 + CBR_56000* = 56000 + CBR_57600* = 57600 + CBR_115200* = 115200 + CBR_128000* = 128000 + CBR_256000* = 256000 + DTR_CONTROL_DISABLE* = 0 + DTR_CONTROL_ENABLE* = 1 + DTR_CONTROL_HANDSHAKE* = 2 + RTS_CONTROL_DISABLE* = 0 + RTS_CONTROL_ENABLE* = 1 + RTS_CONTROL_HANDSHAKE* = 2 + RTS_CONTROL_TOGGLE* = 3 + EVENPARITY* = 2 + MARKPARITY* = 3 + NOPARITY* = 0 + ODDPARITY* = 1 + SPACEPARITY* = 4 + ONESTOPBIT* = 0 + ONE5STOPBITS* = 1 + TWOSTOPBITS* = 2 + # Debugging events + CREATE_PROCESS_DEBUG_EVENT* = 3 + CREATE_THREAD_DEBUG_EVENT* = 2 + EXCEPTION_DEBUG_EVENT* = 1 + EXIT_PROCESS_DEBUG_EVENT* = 5 + EXIT_THREAD_DEBUG_EVENT* = 4 + LOAD_DLL_DEBUG_EVENT* = 6 + OUTPUT_DEBUG_STRING_EVENT* = 8 + UNLOAD_DLL_DEBUG_EVENT* = 7 + RIP_EVENT* = 9 + # PROCESS_HEAP_ENTRY structure + PROCESS_HEAP_REGION* = 1 + PROCESS_HEAP_UNCOMMITTED_RANGE* = 2 + PROCESS_HEAP_ENTRY_BUSY* = 4 + PROCESS_HEAP_ENTRY_MOVEABLE* = 16 + PROCESS_HEAP_ENTRY_DDESHARE* = 32 + # Win32s + HINSTANCE_ERROR* = 32 + # WIN32_STREAM_ID structure + BACKUP_DATA* = 1 + BACKUP_EA_DATA* = 2 + BACKUP_SECURITY_DATA* = 3 + BACKUP_ALTERNATE_DATA* = 4 + BACKUP_LINK* = 5 + STREAM_MODIFIED_WHEN_READ* = 1 + STREAM_CONTAINS_SECURITY* = 2 + # STARTUPINFO structure + STARTF_USESHOWWINDOW* = 1 + STARTF_USEPOSITION* = 4 + STARTF_USESIZE* = 2 + STARTF_USECOUNTCHARS* = 8 + STARTF_USEFILLATTRIBUTE* = 16 + STARTF_RUNFULLSCREEN* = 32 + STARTF_FORCEONFEEDBACK* = 64 + STARTF_FORCEOFFFEEDBACK* = 128 + STARTF_USESTDHANDLES* = 256 + STARTF_USEHOTKEY* = 512 + # OSVERSIONINFO structure + VER_PLATFORM_WIN32s* = 0 + VER_PLATFORM_WIN32_WINDOWS* = 1 + VER_PLATFORM_WIN32_NT* = 2 + # More versions + VER_SERVER_NT* = 0x80000000 + VER_WORKSTATION_NT* = 0x40000000 + VER_SUITE_SMALLBUSINESS* = 0x00000001 + VER_SUITE_ENTERPRISE* = 0x00000002 + VER_SUITE_BACKOFFICE* = 0x00000004 + VER_SUITE_COMMUNICATIONS* = 0x00000008 + VER_SUITE_TERMINAL* = 0x00000010 + VER_SUITE_SMALLBUSINESS_RESTRICTED* = 0x00000020 + VER_SUITE_EMBEDDEDNT* = 0x00000040 + VER_SUITE_DATACENTER* = 0x00000080 + VER_SUITE_SINGLEUSERTS* = 0x00000100 + VER_SUITE_PERSONAL* = 0x00000200 + VER_SUITE_BLADE* = 0x00000400 + VER_SUITE_EMBEDDED_RESTRICTED* = 0x00000800 + # PROPSHEETPAGE structure + MAXPROPPAGES* = 100 + PSP_DEFAULT* = 0 + PSP_DLGINDIRECT* = 1 + PSP_HASHELP* = 32 + PSP_USECALLBACK* = 128 + PSP_USEHICON* = 2 + PSP_USEICONID* = 4 + PSP_USEREFPARENT* = 64 + PSP_USETITLE* = 8 + PSP_RTLREADING* = 16 + # PROPSHEETHEADER structure + PSH_DEFAULT* = 0 + PSH_HASHELP* = 512 + PSH_MODELESS* = 1024 + PSH_NOAPPLYNOW* = 128 + PSH_PROPSHEETPAGE* = 8 + PSH_PROPTITLE* = 1 + PSH_USECALLBACK* = 256 + PSH_USEHICON* = 2 + PSH_USEICONID* = 4 + PSH_USEPSTARTPAGE* = 64 + PSH_WIZARD* = 32 + PSH_RTLREADING* = 2048 + PSCB_INITIALIZED* = 1 + PSCB_PRECREATE* = 2 + # PSN_APPLY message + PSNRET_NOERROR* = 0 + PSNRET_INVALID_NOCHANGEPAGE* = 2 + # Property Sheet + PSBTN_APPLYNOW* = 4 + PSBTN_BACK* = 0 + PSBTN_CANCEL* = 5 + PSBTN_FINISH* = 2 + PSBTN_HELP* = 6 + PSBTN_NEXT* = 1 + PSBTN_OK* = 3 + PSWIZB_BACK* = 1 + PSWIZB_NEXT* = 2 + PSWIZB_FINISH* = 4 + PSWIZB_DISABLEDFINISH* = 8 + ID_PSREBOOTSYSTEM* = 3 + ID_PSRESTARTWINDOWS* = 2 + WIZ_BODYCX* = 184 + WIZ_BODYX* = 92 + WIZ_CXBMP* = 80 + WIZ_CXDLG* = 276 + WIZ_CYDLG* = 140 + + # VX_FIXEDFILEINFO structure + VS_FILE_INFO* = cast[MAKEINTRESOURCE](16) + +const + VS_VERSION_INFO* = 1 + VS_FF_DEBUG* = 0x00000001 + VS_FF_INFOINFERRED* = 0x00000010 + VS_FF_PATCHED* = 0x00000004 + VS_FF_PRERELEASE* = 0x00000002 + VS_FF_PRIVATEBUILD* = 0x00000008 + VS_FF_SPECIALBUILD* = 0x00000020 + VOS_UNKNOWN* = 0 + VOS_DOS* = 0x00010000 + VOS_OS216* = 0x00020000 + VOS_OS232* = 0x00030000 + VOS_NT* = 0x00040000 + VOS_DOS_WINDOWS16* = 0x00010001 + VOS_DOS_WINDOWS32* = 0x00010004 + VOS_OS216_PM16* = 0x00020002 + VOS_OS232_PM32* = 0x00030003 + VOS_NT_WINDOWS32* = 0x00040004 + VFT_UNKNOWN* = 0 + VFT_APP* = 0x00000001 + VFT_DLL* = 0x00000002 + VFT_DRV* = 0x00000003 + VFT_FONT* = 0x00000004 + VFT_VXD* = 0x00000005 + VFT_STATIC_LIB* = 0x00000007 + VFT2_UNKNOWN* = 0 + VFT2_DRV_PRINTER* = 0x00000001 + VFT2_DRV_KEYBOARD* = 0x00000002 + VFT2_DRV_LANGUAGE* = 0x00000003 + VFT2_DRV_DISPLAY* = 0x00000004 + VFT2_DRV_MOUSE* = 0x00000005 + VFT2_DRV_NETWORK* = 0x00000006 + VFT2_DRV_SYSTEM* = 0x00000007 + VFT2_DRV_INSTALLABLE* = 0x00000008 + VFT2_DRV_SOUND* = 0x00000009 + VFT2_FONT_RASTER* = 0x00000001 + VFT2_FONT_VECTOR* = 0x00000002 + VFT2_FONT_TRUETYPE* = 0x00000003 + # PANOSE structure + PAN_ANY* = 0 + PAN_NO_FIT* = 1 + PAN_FAMILY_TEXT_DISPLAY* = 2 + PAN_FAMILY_SCRIPT* = 3 + PAN_FAMILY_DECORATIVE* = 4 + PAN_FAMILY_PICTORIAL* = 5 + PAN_SERIF_COVE* = 2 + PAN_SERIF_OBTUSE_COVE* = 3 + PAN_SERIF_SQUARE_COVE* = 4 + PAN_SERIF_OBTUSE_SQUARE_COVE* = 5 + PAN_SERIF_SQUARE* = 6 + PAN_SERIF_THIN* = 7 + PAN_SERIF_BONE* = 8 + PAN_SERIF_EXAGGERATED* = 9 + PAN_SERIF_TRIANGLE* = 10 + PAN_SERIF_NORMAL_SANS* = 11 + PAN_SERIF_OBTUSE_SANS* = 12 + PAN_SERIF_PERP_SANS* = 13 + PAN_SERIF_FLARED* = 14 + PAN_SERIF_ROUNDED* = 15 + PAN_WEIGHT_VERY_LIGHT* = 2 + PAN_WEIGHT_LIGHT* = 3 + PAN_WEIGHT_THIN* = 4 + PAN_WEIGHT_BOOK* = 5 + PAN_WEIGHT_MEDIUM* = 6 + PAN_WEIGHT_DEMI* = 7 + PAN_WEIGHT_BOLD* = 8 + PAN_WEIGHT_HEAVY* = 9 + PAN_WEIGHT_BLACK* = 10 + PAN_WEIGHT_NORD* = 11 + PAN_PROP_OLD_STYLE* = 2 + PAN_PROP_MODERN* = 3 + PAN_PROP_EVEN_WIDTH* = 4 + PAN_PROP_EXPANDED* = 5 + PAN_PROP_CONDENSED* = 6 + PAN_PROP_VERY_EXPANDED* = 7 + PAN_PROP_VERY_CONDENSED* = 8 + PAN_PROP_MONOSPACED* = 9 + PAN_CONTRAST_NONE* = 2 + PAN_CONTRAST_VERY_LOW* = 3 + PAN_CONTRAST_LOW* = 4 + PAN_CONTRAST_MEDIUM_LOW* = 5 + PAN_CONTRAST_MEDIUM* = 6 + PAN_CONTRAST_MEDIUM_HIGH* = 7 + PAN_CONTRAST_HIGH* = 8 + PAN_CONTRAST_VERY_HIGH* = 9 + PAN_STROKE_GRADUAL_DIAG* = 2 + PAN_STROKE_GRADUAL_TRAN* = 3 + PAN_STROKE_GRADUAL_VERT* = 4 + PAN_STROKE_GRADUAL_HORZ* = 5 + PAN_STROKE_RAPID_VERT* = 6 + PAN_STROKE_RAPID_HORZ* = 7 + PAN_STROKE_INSTANT_VERT* = 8 + PAN_STRAIGHT_ARMS_HORZ* = 2 + PAN_STRAIGHT_ARMS_WEDGE* = 3 + PAN_STRAIGHT_ARMS_VERT* = 4 + PAN_STRAIGHT_ARMS_SINGLE_SERIF* = 5 + PAN_STRAIGHT_ARMS_DOUBLE_SERIF* = 6 + PAN_BENT_ARMS_HORZ* = 7 + PAN_BENT_ARMS_VERT* = 9 + PAN_BENT_ARMS_WEDGE* = 8 + PAN_BENT_ARMS_SINGLE_SERIF* = 10 + PAN_BENT_ARMS_DOUBLE_SERIF* = 11 + PAN_LETT_NORMAL_CONTACT* = 2 + PAN_LETT_NORMAL_WEIGHTED* = 3 + PAN_LETT_NORMAL_BOXED* = 4 + PAN_LETT_NORMAL_FLATTENED* = 5 + PAN_LETT_NORMAL_ROUNDED* = 6 + PAN_LETT_NORMAL_OFF_CENTER* = 7 + PAN_LETT_NORMAL_SQUARE* = 8 + PAN_LETT_OBLIQUE_CONTACT* = 9 + PAN_LETT_OBLIQUE_WEIGHTED* = 10 + PAN_LETT_OBLIQUE_BOXED* = 11 + PAN_LETT_OBLIQUE_FLATTENED* = 12 + PAN_LETT_OBLIQUE_ROUNDED* = 13 + PAN_LETT_OBLIQUE_OFF_CENTER* = 14 + PAN_LETT_OBLIQUE_SQUARE* = 15 + PAN_MIDLINE_STANDARD_TRIMMED* = 2 + PAN_MIDLINE_STANDARD_POINTED* = 3 + PAN_MIDLINE_STANDARD_SERIFED* = 4 + PAN_MIDLINE_HIGH_TRIMMED* = 5 + PAN_MIDLINE_HIGH_POINTED* = 6 + PAN_MIDLINE_HIGH_SERIFED* = 7 + PAN_MIDLINE_CONSTANT_TRIMMED* = 8 + PAN_MIDLINE_CONSTANT_POINTED* = 9 + PAN_MIDLINE_CONSTANT_SERIFED* = 10 + PAN_MIDLINE_LOW_TRIMMED* = 11 + PAN_MIDLINE_LOW_POINTED* = 12 + PAN_MIDLINE_LOW_SERIFED* = 13 + PAN_XHEIGHT_CONSTANT_SMALL* = 2 + PAN_XHEIGHT_CONSTANT_STD* = 3 + PAN_XHEIGHT_CONSTANT_LARGE* = 4 + PAN_XHEIGHT_DUCKING_SMALL* = 5 + PAN_XHEIGHT_DUCKING_STD* = 6 + PAN_XHEIGHT_DUCKING_LARGE* = 7 + # PALETTENTRY structure + PC_EXPLICIT* = 2 + PC_NOCOLLAPSE* = 4 + PC_RESERVED* = 1 + # LOGBRUSH structure + BS_DIBPATTERN* = 5 + BS_DIBPATTERN8X8* = 8 + BS_DIBPATTERNPT* = 6 + BS_HATCHED* = 2 + BS_HOLLOW* = 1 + BS_NULL* = 1 + BS_PATTERN* = 3 + BS_PATTERN8X8* = 7 + BS_SOLID* = 0 + # DEVMODE structure, field selection bits + DM_ORIENTATION* = 0x00000001 + DM_PAPERSIZE* = 0x00000002 + DM_PAPERLENGTH* = 0x00000004 + DM_PAPERWIDTH* = 0x00000008 + DM_SCALE* = 0x00000010 + DM_POSITION* = 0x00000020 + DM_NUP* = 0x00000040 + DM_DISPLAYORIENTATION* = 0x00000080 + DM_COPIES* = 0x00000100 + DM_DEFAULTSOURCE* = 0x00000200 + DM_PRINTQUALITY* = 0x00000400 + DM_COLOR* = 0x00000800 + DM_DUPLEX* = 0x00001000 + DM_YRESOLUTION* = 0x00002000 + DM_TTOPTION* = 0x00004000 + DM_COLLATE* = 0x00008000 + DM_FORMNAME* = 0x00010000 + DM_LOGPIXELS* = 0x00020000 + DM_BITSPERPEL* = 0x00040000 + DM_PELSWIDTH* = 0x00080000 + DM_PELSHEIGHT* = 0x00100000 + DM_DISPLAYFLAGS* = 0x00200000 + DM_DISPLAYFREQUENCY* = 0x00400000 + DM_ICMMETHOD* = 0x00800000 + DM_ICMINTENT* = 0x01000000 + DM_MEDIATYPE* = 0x02000000 + DM_DITHERTYPE* = 0x04000000 + DM_PANNINGWIDTH* = 0x08000000 + DM_PANNINGHEIGHT* = 0x10000000 + DM_DISPLAYFIXEDOUTPUT* = 0x20000000 + # orientation selections + DMORIENT_LANDSCAPE* = 2 + DMORIENT_PORTRAIT* = 1 + # paper selections + DMPAPER_LETTER* = 1 + DMPAPER_LEGAL* = 5 + DMPAPER_A4* = 9 + DMPAPER_CSHEET* = 24 + DMPAPER_DSHEET* = 25 + DMPAPER_ESHEET* = 26 + DMPAPER_LETTERSMALL* = 2 + DMPAPER_TABLOID* = 3 + DMPAPER_LEDGER* = 4 + DMPAPER_STATEMENT* = 6 + DMPAPER_EXECUTIVE* = 7 + DMPAPER_A3* = 8 + DMPAPER_A4SMALL* = 10 + DMPAPER_A5* = 11 + DMPAPER_B4* = 12 + DMPAPER_B5* = 13 + DMPAPER_FOLIO* = 14 + DMPAPER_QUARTO* = 15 + DMPAPER_10X14* = 16 + DMPAPER_11X17* = 17 + DMPAPER_NOTE* = 18 + DMPAPER_ENV_9* = 19 + DMPAPER_ENV_10* = 20 + DMPAPER_ENV_11* = 21 + DMPAPER_ENV_12* = 22 + DMPAPER_ENV_14* = 23 + DMPAPER_ENV_DL* = 27 + DMPAPER_ENV_C5* = 28 + DMPAPER_ENV_C3* = 29 + DMPAPER_ENV_C4* = 30 + DMPAPER_ENV_C6* = 31 + DMPAPER_ENV_C65* = 32 + DMPAPER_ENV_B4* = 33 + DMPAPER_ENV_B5* = 34 + DMPAPER_ENV_B6* = 35 + DMPAPER_ENV_ITALY* = 36 + DMPAPER_ENV_MONARCH* = 37 + DMPAPER_ENV_PERSONAL* = 38 + DMPAPER_FANFOLD_US* = 39 + DMPAPER_FANFOLD_STD_GERMAN* = 40 + DMPAPER_FANFOLD_LGL_GERMAN* = 41 + DMPAPER_ISO_B4* = 42 + DMPAPER_JAPANESE_POSTCARD* = 43 + DMPAPER_9X11* = 44 + DMPAPER_10X11* = 45 + DMPAPER_15X11* = 46 + DMPAPER_ENV_INVITE* = 47 + DMPAPER_RESERVED_48* = 48 + DMPAPER_RESERVED_49* = 49 + DMPAPER_LETTER_EXTRA* = 50 + DMPAPER_LEGAL_EXTRA* = 51 + DMPAPER_TABLOID_EXTRA* = 52 + DMPAPER_A4_EXTRA* = 53 + DMPAPER_LETTER_TRANSVERSE* = 54 + DMPAPER_A4_TRANSVERSE* = 55 + DMPAPER_LETTER_EXTRA_TRANSVERSE* = 56 + DMPAPER_A_PLUS* = 57 + DMPAPER_B_PLUS* = 58 + DMPAPER_LETTER_PLUS* = 59 + DMPAPER_A4_PLUS* = 60 + DMPAPER_A5_TRANSVERSE* = 61 + DMPAPER_B5_TRANSVERSE* = 62 + DMPAPER_A3_EXTRA* = 63 + DMPAPER_A5_EXTRA* = 64 + DMPAPER_B5_EXTRA* = 65 + DMPAPER_A2* = 66 + DMPAPER_A3_TRANSVERSE* = 67 + DMPAPER_A3_EXTRA_TRANSVERSE* = 68 + DMPAPER_DBL_JAPANESE_POSTCARD* = 69 + DMPAPER_A6* = 70 + DMPAPER_JENV_KAKU2* = 71 + DMPAPER_JENV_KAKU3* = 72 + DMPAPER_JENV_CHOU3* = 73 + DMPAPER_JENV_CHOU4* = 74 + DMPAPER_LETTER_ROTATED* = 75 + DMPAPER_A3_ROTATED* = 76 + DMPAPER_A4_ROTATED* = 77 + DMPAPER_A5_ROTATED* = 78 + DMPAPER_B4_JIS_ROTATED* = 79 + DMPAPER_B5_JIS_ROTATED* = 80 + DMPAPER_JAPANESE_POSTCARD_ROTATED* = 81 + DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED* = 82 + DMPAPER_A6_ROTATED* = 83 + DMPAPER_JENV_KAKU2_ROTATED* = 84 + DMPAPER_JENV_KAKU3_ROTATED* = 85 + DMPAPER_JENV_CHOU3_ROTATED* = 86 + DMPAPER_JENV_CHOU4_ROTATED* = 87 + DMPAPER_B6_JIS* = 88 + DMPAPER_B6_JIS_ROTATED* = 89 + DMPAPER_12X11* = 90 + DMPAPER_JENV_YOU4* = 91 + DMPAPER_JENV_YOU4_ROTATED* = 92 + DMPAPER_P16K* = 93 + DMPAPER_P32K* = 94 + DMPAPER_P32KBIG* = 95 + DMPAPER_PENV_1* = 96 + DMPAPER_PENV_2* = 97 + DMPAPER_PENV_3* = 98 + DMPAPER_PENV_4* = 99 + DMPAPER_PENV_5* = 100 + DMPAPER_PENV_6* = 101 + DMPAPER_PENV_7* = 102 + DMPAPER_PENV_8* = 103 + DMPAPER_PENV_9* = 104 + DMPAPER_PENV_10* = 105 + DMPAPER_P16K_ROTATED* = 106 + DMPAPER_P32K_ROTATED* = 107 + DMPAPER_P32KBIG_ROTATED* = 108 + DMPAPER_PENV_1_ROTATED* = 109 + DMPAPER_PENV_2_ROTATED* = 110 + DMPAPER_PENV_3_ROTATED* = 111 + DMPAPER_PENV_4_ROTATED* = 112 + DMPAPER_PENV_5_ROTATED* = 113 + DMPAPER_PENV_6_ROTATED* = 114 + DMPAPER_PENV_7_ROTATED* = 115 + DMPAPER_PENV_8_ROTATED* = 116 + DMPAPER_PENV_9_ROTATED* = 117 + DMPAPER_PENV_10_ROTATED* = 118 + DMPAPER_USER* = 256 + # bin selections + DMBIN_UPPER* = 1 + DMBIN_ONLYONE* = 1 + DMBIN_LOWER* = 2 + DMBIN_MIDDLE* = 3 + DMBIN_MANUAL* = 4 + DMBIN_ENVELOPE* = 5 + DMBIN_ENVMANUAL* = 6 + DMBIN_AUTO* = 7 + DMBIN_TRACTOR* = 8 + DMBIN_SMALLFMT* = 9 + DMBIN_LARGEFMT* = 10 + DMBIN_LARGECAPACITY* = 11 + DMBIN_CASSETTE* = 14 + DMBIN_FORMSOURCE* = 15 + DMBIN_USER* = 256 + # print qualities + DMRES_DRAFT* = -1 + DMRES_LOW* = -2 + DMRES_MEDIUM* = -3 + DMRES_HIGH* = -4 + # color enable/disable for color printers + DMCOLOR_MONOCHROME* = 1 + DMCOLOR_COLOR* = 2 + # duplex enable + DMDUP_SIMPLEX* = 1 + DMDUP_VERTICAL* = 2 + DMDUP_HORIZONTAL* = 3 + # TrueType options + DMTT_BITMAP* = 1 + DMTT_DOWNLOAD* = 2 + DMTT_SUBDEV* = 3 + # Collation selections + DMCOLLATE_TRUE* = 1 + DMCOLLATE_FALSE* = 0 + # DEVMODE dmDisplayOrientation specifiations + DMDO_DEFAULT* = 0 + DMDO_90* = 1 + DMDO_180* = 2 + DMDO_270* = 3 + # DEVMODE dmDisplayFixedOutput specifiations + DMDFO_DEFAULT* = 0 + DMDFO_STRETCH* = 1 + DMDFO_CENTER* = 2 + # Deprecated + #DM_GRAYSCALE* = 1 + #DM_INTERLACED* = 2 + DMDISPLAYFLAGS_TEXTMODE* = 0x00000004 + # dmNup , multiple logical page per physical page options + DMNUP_SYSTEM* = 1 + DMNUP_ONEUP* = 2 + # ICM methods + DMICMMETHOD_NONE* = 1 + DMICMMETHOD_SYSTEM* = 2 + DMICMMETHOD_DRIVER* = 3 + DMICMMETHOD_DEVICE* = 4 + DMICMMETHOD_USER* = 256 + # ICM Intents + DMICM_SATURATE* = 1 + DMICM_CONTRAST* = 2 + DMICM_COLORMETRIC* = 3 + DMICM_USER* = 256 + # Media types + DMMEDIA_STANDARD* = 1 + DMMEDIA_TRANSPARENCY* = 2 + DMMEDIA_GLOSSY* = 3 + DMMEDIA_USER* = 256 + # Dither types + DMDITHER_NONE* = 1 + DMDITHER_COARSE* = 2 + DMDITHER_FINE* = 3 + DMDITHER_LINEART* = 4 + DMDITHER_GRAYSCALE* = 10 + DMDITHER_USER* = 256 + # RGNDATAHEADER structure + RDH_RECTANGLES* = 1 + # TTPOLYGONHEADER structure + TT_POLYGON_TYPE* = 24 + # TTPOLYCURVE structure + TT_PRIM_LINE* = 1 + TT_PRIM_QSPLINE* = 2 + # GCP_RESULTS structure + GCPCLASS_ARABIC* = 2 + GCPCLASS_HEBREW* = 2 + GCPCLASS_LATIN* = 1 + GCPCLASS_LATINNUMBER* = 5 + GCPCLASS_LOCALNUMBER* = 4 + GCPCLASS_LATINNUMERICSEPARATOR* = 7 + GCPCLASS_LATINNUMERICTERMINATOR* = 6 + GCPCLASS_NEUTRAL* = 3 + GCPCLASS_NUMERICSEPARATOR* = 8 + GCPCLASS_PREBOUNDLTR* = 128 + GCPCLASS_PREBOUNDRTL* = 64 + GCPCLASS_POSTBOUNDLTR* = 32 + GCPCLASS_POSTBOUNDRTL* = 16 + GCPGLYPH_LINKBEFORE* = 32768 + GCPGLYPH_LINKAFTER* = 16384 + # RASTERIZER_STATUS structure + TT_AVAILABLE* = 1 + TT_ENABLED* = 2 + # COLORADJUSTMENT structure + CA_NEGATIVE* = 1 + CA_LOG_FILTER* = 2 + ILLUMINANT_DEVICE_DEFAULT* = 0 + ILLUMINANT_A* = 1 + ILLUMINANT_B* = 2 + ILLUMINANT_C* = 3 + ILLUMINANT_D50* = 4 + ILLUMINANT_D55* = 5 + ILLUMINANT_D65* = 6 + ILLUMINANT_D75* = 7 + ILLUMINANT_F2* = 8 + ILLUMINANT_TUNGSTEN* = 1 + ILLUMINANT_DAYLIGHT* = 3 + ILLUMINANT_FLUORESCENT* = 8 + ILLUMINANT_NTSC* = 3 + # DOCINFO structure + DI_APPBANDING* = 1 + # EMRMETAHEADER structure + EMR_HEADER* = 1 + ENHMETA_SIGNATURE* = 1179469088 + # RTF event masks + ENM_CHANGE* = 1 + ENM_CORRECTTEXT* = 4194304 + ENM_DROPFILES* = 1048576 + ENM_KEYEVENTS* = 65536 + ENM_MOUSEEVENTS* = 131072 + ENM_PROTECTED* = 2097152 + ENM_REQUESTRESIZE* = 262144 + ENM_SCROLL* = 4 + ENM_SELCHANGE* = 524288 + ENM_UPDATE* = 2 + ENM_NONE* = 0 + # RTF styles + ES_DISABLENOSCROLL* = 8192 + ES_EX_NOCALLOLEINIT* = 16777216 + ES_NOIME* = 524288 + ES_SAVESEL* = 32768 + ES_SELFIME* = 262144 + ES_SUNKEN* = 16384 + ES_VERTICAL* = 4194304 + ES_SELECTIONBAR* = 16777216 + # EM_SETOPTIONS message + ECOOP_SET* = 1 + ECOOP_OR* = 2 + ECOOP_AND* = 3 + ECOOP_XOR* = 4 + ECO_AUTOWORDSELECTION* = 1 + ECO_AUTOVSCROLL* = 64 + ECO_AUTOHSCROLL* = 128 + ECO_NOHIDESEL* = 256 + ECO_READONLY* = 2048 + ECO_WANTRETURN* = 4096 + ECO_SAVESEL* = 32768 + ECO_SELECTIONBAR* = 16777216 + ECO_VERTICAL* = 4194304 + # EM_SETCHARFORMAT message + SCF_WORD* = 2 + SCF_SELECTION* = 1 + # EM_STREAMOUT message + SF_TEXT* = 1 + SF_RTF* = 2 + SF_RTFNOOBJS* = 3 + SF_TEXTIZED* = 4 + SFF_SELECTION* = 32768 + SFF_PLAINRTF* = 16384 + # EM_FINDWORDBREAK message + WB_CLASSIFY* = 3 + #WB_ISDELIMITER = 2; + # WB_LEFT = 0; already above + WB_LEFTBREAK* = 6 + WB_PREVBREAK* = 6 + WB_MOVEWORDLEFT* = 4 + WB_MOVEWORDPREV* = 4 + WB_MOVEWORDRIGHT* = 5 + WB_MOVEWORDNEXT* = 5 + #WB_RIGHT = 1;already above + WB_RIGHTBREAK* = 7 + WB_NEXTBREAK* = 7 + # EM_GETPUNCTUATION message + PC_LEADING* = 2 + PC_FOLLOWING* = 1 + PC_DELIMITER* = 4 + PC_OVERFLOW* = 3 + # EM_SETWORDWRAPMODE message + WBF_WORDWRAP* = 16 + WBF_WORDBREAK* = 32 + WBF_OVERFLOW* = 64 + WBF_LEVEL1* = 128 + WBF_LEVEL2* = 256 + WBF_CUSTOM* = 512 + WBF_BREAKAFTER* = 64 + WBF_BREAKLINE* = 32 + WBF_ISWHITE* = 16 + # CHARFORMAT structure + CFM_BOLD* = 1 + CFM_COLOR* = 1073741824 + CFM_FACE* = 536870912 + CFM_ITALIC* = 2 + CFM_OFFSET* = 268435456 + CFM_PROTECTED* = 16 + CFM_SIZE* = 0x80000000 + CFM_STRIKEOUT* = 8 + CFM_UNDERLINE* = 4 + CFE_AUTOCOLOR* = 1073741824 + CFE_BOLD* = 1 + CFE_ITALIC* = 2 + CFE_STRIKEOUT* = 8 + CFE_UNDERLINE* = 4 + CFE_PROTECTED* = 16 + # PARAFORMAT structure + PFM_ALIGNMENT* = 8 + PFM_NUMBERING* = 32 + PFM_OFFSET* = 4 + PFM_OFFSETINDENT* = 0x80000000 + PFM_RIGHTINDENT* = 2 + PFM_STARTINDENT* = 1 + PFM_TABSTOPS* = 16 + PFN_BULLET* = 1 + PFA_LEFT* = 1 + PFA_RIGHT* = 2 + PFA_CENTER* = 3 + # SELCHANGE structure + SEL_EMPTY* = 0 + SEL_TEXT* = 1 + SEL_OBJECT* = 2 + SEL_MULTICHAR* = 4 + SEL_MULTIOBJECT* = 8 + # RTF clipboard formats + CF_RTF* = "Rich Text Format" + CF_RETEXTOBJ* = "RichEdit Text and Objects" + # DRAWITEMSTRUCT structure + ODT_BUTTON* = 4 + ODT_COMBOBOX* = 3 + ODT_LISTBOX* = 2 + ODT_LISTVIEW* = 102 + ODT_MENU* = 1 + ODT_STATIC* = 5 + ODT_TAB* = 101 + ODT_HEADER* = 100 + ODA_DRAWENTIRE* = 1 + ODA_FOCUS* = 4 + ODA_SELECT* = 2 + ODS_SELECTED* = 1 + ODS_GRAYED* = 2 + ODS_DISABLED* = 4 + ODS_CHECKED* = 8 + ODS_FOCUS* = 16 + ODS_DEFAULT* = 32 + ODS_HOTLIGHT* = 0x00000040 + ODS_INACTIVE* = 0x00000080 + ODS_NOACCEL* = 0x00000100 + ODS_NOFOCUSRECT* = 0x00000200 + ODS_COMBOBOXEDIT* = 0x00001000 + # Common control styles + CCS_ADJUSTABLE* = 0x00000020 + CCS_BOTTOM* = 0x00000003 + CCS_NODIVIDER* = 0x00000040 + CCS_NOMOVEY* = 0x00000002 + CCS_NOPARENTALIGN* = 0x00000008 + CCS_NORESIZE* = 0x00000004 + CCS_TOP* = 0x00000001 + + # Common control window classes + ANIMATE_CLASSW* = "SysAnimate32" + HOTKEY_CLASSW* = "msctls_hotkey32" + PROGRESS_CLASSW* = "msctls_progress32" + STATUSCLASSNAMEW* = "msctls_statusbar32" + TOOLBARCLASSNAMEW* = "ToolbarWindow32" + TOOLTIPS_CLASSW* = "tooltips_class32" + TRACKBAR_CLASSW* = "msctls_trackbar32" + UPDOWN_CLASSW* = "msctls_updown32" + WC_HEADERW* = "SysHeader32" + WC_LISTVIEWW* = "SysListView32" + WC_TABCONTROLW* = "SysTabControl32" + WC_TREEVIEWW* = "SysTreeView32" + + ANIMATE_CLASSA* = "SysAnimate32" + HOTKEY_CLASSA* = "msctls_hotkey32" + PROGRESS_CLASSA* = "msctls_progress32" + STATUSCLASSNAMEA* = "msctls_statusbar32" + TOOLBARCLASSNAMEA* = "ToolbarWindow32" + TOOLTIPS_CLASSA* = "tooltips_class32" + TRACKBAR_CLASSA* = "msctls_trackbar32" + UPDOWN_CLASSA* = "msctls_updown32" + WC_HEADERA* = "SysHeader32" + WC_LISTVIEWA* = "SysListView32" + WC_TABCONTROLA* = "SysTabControl32" + WC_TREEVIEWA* = "SysTreeView32" + +when defined(winUnicode): + const + ANIMATE_CLASS* = ANIMATE_CLASSW + HOTKEY_CLASS* = HOTKEY_CLASSW + PROGRESS_CLASS* = PROGRESS_CLASSW + STATUSCLASSNAME* = STATUSCLASSNAMEW + TOOLBARCLASSNAME* = TOOLBARCLASSNAMEW + TOOLTIPS_CLASS* = TOOLTIPS_CLASSW + TRACKBAR_CLASS* = TRACKBAR_CLASSW + UPDOWN_CLASS* = UPDOWN_CLASSW + WC_HEADER* = WC_HEADERW + WC_LISTVIEW* = WC_LISTVIEWW + WC_TABCONTROL* = WC_TABCONTROLW + WC_TREEVIEW* = WC_TREEVIEWW +else: + const + ANIMATE_CLASS* = ANIMATE_CLASSA + HOTKEY_CLASS* = HOTKEY_CLASSA + PROGRESS_CLASS* = PROGRESS_CLASSA + STATUSCLASSNAME* = STATUSCLASSNAMEA + TOOLBARCLASSNAME* = TOOLBARCLASSNAMEA + TOOLTIPS_CLASS* = TOOLTIPS_CLASSA + TRACKBAR_CLASS* = TRACKBAR_CLASSA + UPDOWN_CLASS* = UPDOWN_CLASSA + WC_HEADER* = WC_HEADERA + WC_LISTVIEW* = WC_LISTVIEWA + WC_TABCONTROL* = WC_TABCONTROLA + WC_TREEVIEW* = WC_TREEVIEWA +# UNICODE + +const + # Header control styles + HDS_BUTTONS* = 2 + HDS_HIDDEN* = 8 + HDS_HORZ* = 0 + # HD_ITEM structure + HDI_BITMAP* = 16 + HDI_FORMAT* = 4 + HDI_HEIGHT* = 1 + HDI_LPARAM* = 8 + HDI_TEXT* = 2 + HDI_WIDTH* = 1 + HDF_CENTER* = 2 + HDF_LEFT* = 0 + HDF_RIGHT* = 1 + HDF_RTLREADING* = 4 + HDF_BITMAP* = 8192 + HDF_OWNERDRAW* = 32768 + HDF_STRING* = 16384 + HDF_JUSTIFYMASK* = 3 + # HD_HITTESTINFO structure + HHT_NOWHERE* = 1 + HHT_ONDIVIDER* = 4 + HHT_ONDIVOPEN* = 8 + HHT_ONHEADER* = 2 + HHT_TOLEFT* = 2048 + HHT_TORIGHT* = 1024 + # TBADDBITMAP structure + HINST_COMMCTRL* = HINST(-1) + +const + IDB_STD_LARGE_COLOR* = 1 + IDB_STD_SMALL_COLOR* = 0 + IDB_VIEW_LARGE_COLOR* = 5 + IDB_VIEW_SMALL_COLOR* = 4 + STD_COPY* = 1 + STD_CUT* = 0 + STD_DELETE* = 5 + STD_FILENEW* = 6 + STD_FILEOPEN* = 7 + STD_FILESAVE* = 8 + STD_FIND* = 12 + STD_HELP* = 11 + STD_PASTE* = 2 + STD_PRINT* = 14 + STD_PRINTPRE* = 9 + STD_PROPERTIES* = 10 + STD_REDOW* = 4 + STD_REPLACE* = 13 + STD_UNDO* = 3 + VIEW_LARGEICONS* = 0 + VIEW_SMALLICONS* = 1 + VIEW_LIST* = 2 + VIEW_DETAILS* = 3 + VIEW_SORTNAME* = 4 + VIEW_SORTSIZE* = 5 + VIEW_SORTDATE* = 6 + VIEW_SORTTYPE* = 7 + # Toolbar styles + TBSTYLE_ALTDRAG* = 1024 + TBSTYLE_TOOLTIPS* = 256 + TBSTYLE_WRAPABLE* = 512 + TBSTYLE_BUTTON* = 0 + TBSTYLE_CHECK* = 2 + TBSTYLE_CHECKGROUP* = 6 + TBSTYLE_GROUP* = 4 + TBSTYLE_SEP* = 1 + # Toolbar states + TBSTATE_CHECKED* = 1 + TBSTATE_ENABLED* = 4 + TBSTATE_HIDDEN* = 8 + TBSTATE_INDETERMINATE* = 16 + TBSTATE_PRESSED* = 2 + TBSTATE_WRAP* = 32 + # Tooltip styles + TTS_ALWAYSTIP* = 1 + TTS_NOPREFIX* = 2 + # TOOLINFO structure + TTF_IDISHWND* = 1 + TTF_CENTERTIP* = 2 + TTF_RTLREADING* = 4 + TTF_SUBCLASS* = 16 + # TTM_SETDELAYTIME message + TTDT_AUTOMATIC* = 0 + TTDT_AUTOPOP* = 2 + TTDT_INITIAL* = 3 + TTDT_RESHOW* = 1 + # Status window + SBARS_SIZEGRIP* = 256 + #SBARS_SIZEGRIP = 256;already above + # DL_DRAGGING message + DL_MOVECURSOR* = 3 + DL_COPYCURSOR* = 2 + DL_STOPCURSOR* = 1 + # Up-down control styles + UDS_ALIGNLEFT* = 8 + UDS_ALIGNRIGHT* = 4 + UDS_ARROWKEYS* = 32 + UDS_AUTOBUDDY* = 16 + UDS_HORZ* = 64 + UDS_NOTHOUSANDS* = 128 + UDS_SETBUDDYINT* = 2 + UDS_WRAP* = 1 + # UDM_SETRANGE message + UD_MAXVAL* = 32767 + UD_MINVAL* = -32767 + # HKM_GETHOTKEY message + HOTKEYF_ALT* = 4 + HOTKEYF_CONTROL* = 2 + HOTKEYF_EXT* = 8 + HOTKEYF_SHIFT* = 1 + # HKM_SETRULES message + HKCOMB_A* = 8 + HKCOMB_C* = 4 + HKCOMB_CA* = 64 + HKCOMB_NONE* = 1 + HKCOMB_S* = 2 + HKCOMB_SA* = 32 + HKCOMB_SC* = 16 + HKCOMB_SCA* = 128 + # Trackbar styles + TBS_HORZ* = 0 + TBS_VERT* = 2 + TBS_AUTOTICKS* = 1 + TBS_NOTICKS* = 16 + TBS_TOP* = 4 + TBS_BOTTOM* = 0 + TBS_LEFT* = 4 + TBS_RIGHT* = 0 + TBS_BOTH* = 8 + TBS_ENABLESELRANGE* = 32 + TBS_FIXEDLENGTH* = 64 + TBS_NOTHUMB* = 128 + TB_BOTTOM* = 7 + TB_ENDTRACK* = 8 + TB_LINEDOWN* = 1 + TB_LINEUP* = 0 + TB_PAGEDOWN* = 3 + TB_PAGEUP* = 2 + TB_THUMBPOSITION* = 4 + TB_THUMBTRACK* = 5 + TB_TOP* = 6 + # List view styles + LVS_ALIGNLEFT* = 2048 + LVS_ALIGNTOP* = 0 + LVS_AUTOARRANGE* = 256 + LVS_EDITLABELS* = 512 + LVS_ICON* = 0 + LVS_LIST* = 3 + LVS_NOCOLUMNHEADER* = 16384 + LVS_NOLABELWRAP* = 128 + LVS_NOSCROLL* = 8192 + LVS_NOSORTHEADER* = 32768 + LVS_OWNERDRAWFIXED* = 1024 + LVS_REPORT* = 1 + LVS_SHAREIMAGELISTS* = 64 + LVS_SHOWSELALWAYS* = 8 + LVS_SINGLESEL* = 4 + LVS_SMALLICON* = 2 + LVS_SORTASCENDING* = 16 + LVS_SORTDESCENDING* = 32 + LVS_TYPESTYLEMASK* = 64512 + LVSIL_NORMAL* = 0 + LVSIL_SMALL* = 1 + LVSIL_STATE* = 2 + LVIS_CUT* = 4 + LVIS_DROPHILITED* = 8 + LVIS_FOCUSED* = 1 + LVIS_SELECTED* = 2 + LVIS_OVERLAYMASK* = 3840 + LVIS_STATEIMAGEMASK* = 61440 + + LPSTR_TEXTCALLBACKW* = cast[LPWSTR](-1) + LPSTR_TEXTCALLBACKA* = cast[LPSTR](-1) +when defined(winUnicode): + const LPSTR_TEXTCALLBACK* = cast[LPWSTR](-1) +else: + const LPSTR_TEXTCALLBACK* = cast[LPSTR](-1) + +const + LVIF_TEXT* = 1 + LVIF_IMAGE* = 2 + LVIF_PARAM* = 4 + LVIF_STATE* = 8 + LVIF_DI_SETITEM* = 4096 + # LVM_GETNEXTITEM structure + LVNI_ABOVE* = 256 + LVNI_ALL* = 0 + LVNI_BELOW* = 512 + LVNI_TOLEFT* = 1024 + LVNI_TORIGHT* = 2048 + LVNI_CUT* = 4 + LVNI_DROPHILITED* = 8 + LVNI_FOCUSED* = 1 + LVNI_SELECTED* = 2 + # LV_FINDINFO structure + LVFI_PARAM* = 1 + LVFI_PARTIAL* = 8 + LVFI_STRING* = 2 + LVFI_WRAP* = 32 + LVFI_NEARESTXY* = 64 + # LV_HITTESTINFO structure + LVHT_ABOVE* = 8 + LVHT_BELOW* = 16 + LVHT_NOWHERE* = 1 + LVHT_ONITEMICON* = 2 + LVHT_ONITEMLABEL* = 4 + LVHT_ONITEMSTATEICON* = 8 + LVHT_TOLEFT* = 64 + LVHT_TORIGHT* = 32 + # LV_COLUMN structure + LVCF_FMT* = 1 + LVCF_SUBITEM* = 8 + LVCF_TEXT* = 4 + LVCF_WIDTH* = 2 + LVCFMT_CENTER* = 2 + LVCFMT_LEFT* = 0 + LVCFMT_RIGHT* = 1 + # ListView_GetItemRect + LVIR_BOUNDS* = 0 + LVIR_ICON* = 1 + LVIR_LABEL* = 2 + LVIR_SELECTBOUNDS* = 3 + # LVM_ARRANGE message + LVA_ALIGNLEFT* = 1 + LVA_ALIGNTOP* = 2 + LVA_DEFAULT* = 0 + LVA_SNAPTOGRID* = 5 + # LVM_SETCOLUMNWIDTH message + LVSCW_AUTOSIZE* = -1 + LVSCW_AUTOSIZE_USEHEADER* = -2 + # Tree View styles + TVS_DISABLEDRAGDROP* = 16 + TVS_EDITLABELS* = 8 + TVS_HASBUTTONS* = 1 + TVS_HASLINES* = 2 + TVS_LINESATROOT* = 4 + TVS_SHOWSELALWAYS* = 32 + # Tree View states + TVIS_BOLD* = 16 + TVIS_CUT* = 4 + TVIS_DROPHILITED* = 8 + TVIS_EXPANDED* = 32 + TVIS_EXPANDEDONCE* = 64 + TVIS_FOCUSED* = 1 + TVIS_OVERLAYMASK* = 3840 + TVIS_SELECTED* = 2 + TVIS_STATEIMAGEMASK* = 61440 + TVIS_USERMASK* = 61440 + # TV_ITEM structure + TVIF_CHILDREN* = 64 + TVIF_HANDLE* = 16 + TVIF_IMAGE* = 2 + TVIF_PARAM* = 4 + TVIF_SELECTEDIMAGE* = 32 + TVIF_STATE* = 8 + TVIF_TEXT* = 1 + I_CHILDRENCALLBACK* = -1 + I_IMAGECALLBACK* = -1 + # TV_INSERTSTRUCT structure + +type + TTREEITEM* {.final, pure.} = object + HTREEITEM* = ptr TTREEITEM + PTREEITEM* = ptr TTREEITEM + +const + TVI_ROOT* = cast[HTREEITEM](0xFFFF0000) + TVI_FIRST* = cast[HTREEITEM](0xFFFF0001) + TVI_LAST* = cast[HTREEITEM](0xFFFF0002) + TVI_SORT* = cast[HTREEITEM](0xFFFF0003) + +const + # TV_HITTESTINFO structure + TVHT_ABOVE* = 256 + TVHT_BELOW* = 512 + TVHT_NOWHERE* = 1 + TVHT_ONITEM* = 70 + TVHT_ONITEMBUTTON* = 16 + TVHT_ONITEMICON* = 2 + TVHT_ONITEMINDENT* = 8 + TVHT_ONITEMLABEL* = 4 + TVHT_ONITEMRIGHT* = 32 + TVHT_ONITEMSTATEICON* = 64 + TVHT_TOLEFT* = 2048 + TVHT_TORIGHT* = 1024 + # TVM_EXPAND message + TVE_COLLAPSE* = 1 + TVE_COLLAPSERESET* = 32768 + TVE_EXPAND* = 2 + TVE_TOGGLE* = 3 + # TVM_GETIMAGELIST message + TVSIL_NORMAL* = 0 + TVSIL_STATE* = 2 + # TVM_GETNEXTITEM message + TVGN_CARET* = 9 + TVGN_CHILD* = 4 + TVGN_DROPHILITE* = 8 + TVGN_FIRSTVISIBLE* = 5 + TVGN_NEXT* = 1 + TVGN_NEXTVISIBLE* = 6 + TVGN_PARENT* = 3 + TVGN_PREVIOUS* = 2 + TVGN_PREVIOUSVISIBLE* = 7 + TVGN_ROOT* = 0 + # TVN_SELCHANGED message + TVC_BYKEYBOARD* = 2 + TVC_BYMOUSE* = 1 + TVC_UNKNOWN* = 0 + # Tab control styles + TCS_BUTTONS* = 256 + TCS_FIXEDWIDTH* = 1024 + TCS_FOCUSNEVER* = 32768 + TCS_FOCUSONBUTTONDOWN* = 4096 + TCS_FORCEICONLEFT* = 16 + TCS_FORCELABELLEFT* = 32 + TCS_MULTILINE* = 512 + TCS_OWNERDRAWFIXED* = 8192 + TCS_RAGGEDRIGHT* = 2048 + TCS_RIGHTJUSTIFY* = 0 + TCS_SINGLELINE* = 0 + TCS_TABS* = 0 + TCS_TOOLTIPS* = 16384 + # TC_ITEM structure + TCIF_TEXT* = 1 + TCIF_IMAGE* = 2 + TCIF_PARAM* = 8 + TCIF_RTLREADING* = 4 + # TC_HITTESTINFO structure + TCHT_NOWHERE* = 1 + TCHT_ONITEM* = 6 + TCHT_ONITEMICON* = 2 + TCHT_ONITEMLABEL* = 4 + # Animation control styles + ACS_AUTOPLAY* = 4 + ACS_CENTER* = 1 + ACS_TRANSPARENT* = 2 + # MODEMDEVCAPS structure + DIALOPTION_BILLING* = 64 + DIALOPTION_QUIET* = 128 + DIALOPTION_DIALTONE* = 256 + MDMVOLFLAG_LOW* = 1 + MDMVOLFLAG_MEDIUM* = 2 + MDMVOLFLAG_HIGH* = 4 + MDMVOL_LOW* = 0 + MDMVOL_MEDIUM* = 1 + MDMVOL_HIGH* = 2 + MDMSPKRFLAG_OFF* = 1 + MDMSPKRFLAG_DIAL* = 2 + MDMSPKRFLAG_ON* = 4 + MDMSPKRFLAG_CALLSETUP* = 8 + MDMSPKR_OFF* = 0 + MDMSPKR_DIAL* = 1 + MDMSPKR_ON* = 2 + MDMSPKR_CALLSETUP* = 3 + MDM_BLIND_DIAL* = 512 + MDM_CCITT_OVERRIDE* = 64 + MDM_CELLULAR* = 8 + MDM_COMPRESSION* = 1 + MDM_ERROR_CONTROL* = 2 + MDM_FLOWCONTROL_HARD* = 16 + MDM_FLOWCONTROL_SOFT* = 32 + MDM_FORCED_EC* = 4 + MDM_SPEED_ADJUST* = 128 + MDM_TONE_DIAL* = 256 + MDM_V23_OVERRIDE* = 1024 + + # Languages + # + # Language IDs. + # + # The following two combinations of primary language ID and + # sublanguage ID have special semantics: + # + # Primary Language ID Sublanguage ID Result + # ------------------- --------------- ------------------------ + # LANG_NEUTRAL SUBLANG_NEUTRAL Language neutral + # LANG_NEUTRAL SUBLANG_DEFAULT User default language + # LANG_NEUTRAL SUBLANG_SYS_DEFAULT System default language + # LANG_INVARIANT SUBLANG_NEUTRAL Invariant locale + # + # + # Primary language IDs. + # + LANG_NEUTRAL* = 0x00000000 + LANG_INVARIANT* = 0x0000007F + LANG_AFRIKAANS* = 0x00000036 + LANG_ALBANIAN* = 0x0000001C + LANG_ARABIC* = 0x00000001 + LANG_ARMENIAN* = 0x0000002B + LANG_ASSAMESE* = 0x0000004D + LANG_AZERI* = 0x0000002C + LANG_BASQUE* = 0x0000002D + LANG_BELARUSIAN* = 0x00000023 + LANG_BENGALI* = 0x00000045 + LANG_BULGARIAN* = 0x00000002 + LANG_CATALAN* = 0x00000003 + LANG_CHINESE* = 0x00000004 + LANG_CROATIAN* = 0x0000001A + LANG_CZECH* = 0x00000005 + LANG_DANISH* = 0x00000006 + LANG_DIVEHI* = 0x00000065 + LANG_DUTCH* = 0x00000013 + LANG_ENGLISH* = 0x00000009 + LANG_ESTONIAN* = 0x00000025 + LANG_FAEROESE* = 0x00000038 + LANG_FARSI* = 0x00000029 + LANG_FINNISH* = 0x0000000B + LANG_FRENCH* = 0x0000000C + LANG_GALICIAN* = 0x00000056 + LANG_GEORGIAN* = 0x00000037 + LANG_GERMAN* = 0x00000007 + LANG_GREEK* = 0x00000008 + LANG_GUJARATI* = 0x00000047 + LANG_HEBREW* = 0x0000000D + LANG_HINDI* = 0x00000039 + LANG_HUNGARIAN* = 0x0000000E + LANG_ICELANDIC* = 0x0000000F + LANG_INDONESIAN* = 0x00000021 + LANG_ITALIAN* = 0x00000010 + LANG_JAPANESE* = 0x00000011 + LANG_KANNADA* = 0x0000004B + LANG_KASHMIRI* = 0x00000060 + LANG_KAZAK* = 0x0000003F + LANG_KONKANI* = 0x00000057 + LANG_KOREAN* = 0x00000012 + LANG_KYRGYZ* = 0x00000040 + LANG_LATVIAN* = 0x00000026 + LANG_LITHUANIAN* = 0x00000027 + LANG_MACEDONIAN* = 0x0000002F # the Former Yugoslav Republic of Macedonia + LANG_MALAY* = 0x0000003E + LANG_MALAYALAM* = 0x0000004C + LANG_MANIPURI* = 0x00000058 + LANG_MARATHI* = 0x0000004E + LANG_MONGOLIAN* = 0x00000050 + LANG_NEPALI* = 0x00000061 + LANG_NORWEGIAN* = 0x00000014 + LANG_ORIYA* = 0x00000048 + LANG_POLISH* = 0x00000015 + LANG_PORTUGUESE* = 0x00000016 + LANG_PUNJABI* = 0x00000046 + LANG_ROMANIAN* = 0x00000018 + LANG_RUSSIAN* = 0x00000019 + LANG_SANSKRIT* = 0x0000004F + LANG_SERBIAN* = 0x0000001A + LANG_SINDHI* = 0x00000059 + LANG_SLOVAK* = 0x0000001B + LANG_SLOVENIAN* = 0x00000024 + LANG_SPANISH* = 0x0000000A + LANG_SWAHILI* = 0x00000041 + LANG_SWEDISH* = 0x0000001D + LANG_SYRIAC* = 0x0000005A + LANG_TAMIL* = 0x00000049 + LANG_TATAR* = 0x00000044 + LANG_TELUGU* = 0x0000004A + LANG_THAI* = 0x0000001E + LANG_TURKISH* = 0x0000001F + LANG_UKRAINIAN* = 0x00000022 + LANG_URDU* = 0x00000020 + LANG_UZBEK* = 0x00000043 + LANG_VIETNAMESE* = 0x0000002A + # + # Sublanguage IDs. + # + # The name immediately following SUBLANG_ dictates which primary + # language ID that sublanguage ID can be combined with to form a + # valid language ID. + # + SUBLANG_NEUTRAL* = 0x00000000 # language neutral + SUBLANG_DEFAULT* = 0x00000001 # user default + SUBLANG_SYS_DEFAULT* = 0x00000002 # system default + SUBLANG_ARABIC_SAUDI_ARABIA* = 0x00000001 # Arabic (Saudi Arabia) + SUBLANG_ARABIC_IRAQ* = 0x00000002 # Arabic (Iraq) + SUBLANG_ARABIC_EGYPT* = 0x00000003 # Arabic (Egypt) + SUBLANG_ARABIC_LIBYA* = 0x00000004 # Arabic (Libya) + SUBLANG_ARABIC_ALGERIA* = 0x00000005 # Arabic (Algeria) + SUBLANG_ARABIC_MOROCCO* = 0x00000006 # Arabic (Morocco) + SUBLANG_ARABIC_TUNISIA* = 0x00000007 # Arabic (Tunisia) + SUBLANG_ARABIC_OMAN* = 0x00000008 # Arabic (Oman) + SUBLANG_ARABIC_YEMEN* = 0x00000009 # Arabic (Yemen) + SUBLANG_ARABIC_SYRIA* = 0x0000000A # Arabic (Syria) + SUBLANG_ARABIC_JORDAN* = 0x0000000B # Arabic (Jordan) + SUBLANG_ARABIC_LEBANON* = 0x0000000C # Arabic (Lebanon) + SUBLANG_ARABIC_KUWAIT* = 0x0000000D # Arabic (Kuwait) + SUBLANG_ARABIC_UAE* = 0x0000000E # Arabic (U.A.E) + SUBLANG_ARABIC_BAHRAIN* = 0x0000000F # Arabic (Bahrain) + SUBLANG_ARABIC_QATAR* = 0x00000010 # Arabic (Qatar) + SUBLANG_AZERI_LATIN* = 0x00000001 # Azeri (Latin) + SUBLANG_AZERI_CYRILLIC* = 0x00000002 # Azeri (Cyrillic) + SUBLANG_CHINESE_TRADITIONAL* = 0x00000001 # Chinese (Taiwan) + SUBLANG_CHINESE_SIMPLIFIED* = 0x00000002 # Chinese (PR China) + SUBLANG_CHINESE_HONGKONG* = 0x00000003 # Chinese (Hong Kong S.A.R., P.R.C.) + SUBLANG_CHINESE_SINGAPORE* = 0x00000004 # Chinese (Singapore) + SUBLANG_CHINESE_MACAU* = 0x00000005 # Chinese (Macau S.A.R.) + SUBLANG_DUTCH* = 0x00000001 # Dutch + SUBLANG_DUTCH_BELGIAN* = 0x00000002 # Dutch (Belgian) + SUBLANG_ENGLISH_US* = 0x00000001 # English (USA) + SUBLANG_ENGLISH_UK* = 0x00000002 # English (UK) + SUBLANG_ENGLISH_AUS* = 0x00000003 # English (Australian) + SUBLANG_ENGLISH_CAN* = 0x00000004 # English (Canadian) + SUBLANG_ENGLISH_NZ* = 0x00000005 # English (New Zealand) + SUBLANG_ENGLISH_EIRE* = 0x00000006 # English (Irish) + SUBLANG_ENGLISH_SOUTH_AFRICA* = 0x00000007 # English (South Africa) + SUBLANG_ENGLISH_JAMAICA* = 0x00000008 # English (Jamaica) + SUBLANG_ENGLISH_CARIBBEAN* = 0x00000009 # English (Caribbean) + SUBLANG_ENGLISH_BELIZE* = 0x0000000A # English (Belize) + SUBLANG_ENGLISH_TRINIDAD* = 0x0000000B # English (Trinidad) + SUBLANG_ENGLISH_ZIMBABWE* = 0x0000000C # English (Zimbabwe) + SUBLANG_ENGLISH_PHILIPPINES* = 0x0000000D # English (Philippines) + SUBLANG_FRENCH* = 0x00000001 # French + SUBLANG_FRENCH_BELGIAN* = 0x00000002 # French (Belgian) + SUBLANG_FRENCH_CANADIAN* = 0x00000003 # French (Canadian) + SUBLANG_FRENCH_SWISS* = 0x00000004 # French (Swiss) + SUBLANG_FRENCH_LUXEMBOURG* = 0x00000005 # French (Luxembourg) + SUBLANG_FRENCH_MONACO* = 0x00000006 # French (Monaco) + SUBLANG_GERMAN* = 0x00000001 # German + SUBLANG_GERMAN_SWISS* = 0x00000002 # German (Swiss) + SUBLANG_GERMAN_AUSTRIAN* = 0x00000003 # German (Austrian) + SUBLANG_GERMAN_LUXEMBOURG* = 0x00000004 # German (Luxembourg) + SUBLANG_GERMAN_LIECHTENSTEIN* = 0x00000005 # German (Liechtenstein) + SUBLANG_ITALIAN* = 0x00000001 # Italian + SUBLANG_ITALIAN_SWISS* = 0x00000002 # Italian (Swiss) + SUBLANG_KASHMIRI_SASIA* = 0x00000002 # Kashmiri (South Asia) + SUBLANG_KASHMIRI_INDIA* = 0x00000002 # For app compatibility only + SUBLANG_KOREAN* = 0x00000001 # Korean (Extended Wansung) + SUBLANG_LITHUANIAN* = 0x00000001 # Lithuanian + SUBLANG_MALAY_MALAYSIA* = 0x00000001 # Malay (Malaysia) + SUBLANG_MALAY_BRUNEI_DARUSSALAM* = 0x00000002 # Malay (Brunei Darussalam) + SUBLANG_NEPALI_INDIA* = 0x00000002 # Nepali (India) + SUBLANG_NORWEGIAN_BOKMAL* = 0x00000001 # Norwegian (Bokmal) + SUBLANG_NORWEGIAN_NYNORSK* = 0x00000002 # Norwegian (Nynorsk) + SUBLANG_PORTUGUESE* = 0x00000002 # Portuguese + SUBLANG_PORTUGUESE_BRAZILIAN* = 0x00000001 # Portuguese (Brazilian) + SUBLANG_SERBIAN_LATIN* = 0x00000002 # Serbian (Latin) + SUBLANG_SERBIAN_CYRILLIC* = 0x00000003 # Serbian (Cyrillic) + SUBLANG_SPANISH* = 0x00000001 # Spanish (Castilian) + SUBLANG_SPANISH_MEXICAN* = 0x00000002 # Spanish (Mexican) + SUBLANG_SPANISH_MODERN* = 0x00000003 # Spanish (Spain) + SUBLANG_SPANISH_GUATEMALA* = 0x00000004 # Spanish (Guatemala) + SUBLANG_SPANISH_COSTA_RICA* = 0x00000005 # Spanish (Costa Rica) + SUBLANG_SPANISH_PANAMA* = 0x00000006 # Spanish (Panama) + SUBLANG_SPANISH_DOMINICAN_REPUBLIC* = 0x00000007 # Spanish (Dominican Republic) + SUBLANG_SPANISH_VENEZUELA* = 0x00000008 # Spanish (Venezuela) + SUBLANG_SPANISH_COLOMBIA* = 0x00000009 # Spanish (Colombia) + SUBLANG_SPANISH_PERU* = 0x0000000A # Spanish (Peru) + SUBLANG_SPANISH_ARGENTINA* = 0x0000000B # Spanish (Argentina) + SUBLANG_SPANISH_ECUADOR* = 0x0000000C # Spanish (Ecuador) + SUBLANG_SPANISH_CHILE* = 0x0000000D # Spanish (Chile) + SUBLANG_SPANISH_URUGUAY* = 0x0000000E # Spanish (Uruguay) + SUBLANG_SPANISH_PARAGUAY* = 0x0000000F # Spanish (Paraguay) + SUBLANG_SPANISH_BOLIVIA* = 0x00000010 # Spanish (Bolivia) + SUBLANG_SPANISH_EL_SALVADOR* = 0x00000011 # Spanish (El Salvador) + SUBLANG_SPANISH_HONDURAS* = 0x00000012 # Spanish (Honduras) + SUBLANG_SPANISH_NICARAGUA* = 0x00000013 # Spanish (Nicaragua) + SUBLANG_SPANISH_PUERTO_RICO* = 0x00000014 # Spanish (Puerto Rico) + SUBLANG_SWEDISH* = 0x00000001 # Swedish + SUBLANG_SWEDISH_FINLAND* = 0x00000002 # Swedish (Finland) + SUBLANG_URDU_PAKISTAN* = 0x00000001 # Urdu (Pakistan) + SUBLANG_URDU_INDIA* = 0x00000002 # Urdu (India) + SUBLANG_UZBEK_LATIN* = 0x00000001 # Uzbek (Latin) + SUBLANG_UZBEK_CYRILLIC* = 0x00000002 # Uzbek (Cyrillic) + # + # Sorting IDs. + # + SORT_DEFAULT* = 0x00000000 # sorting default + SORT_JAPANESE_XJIS* = 0x00000000 # Japanese XJIS order + SORT_JAPANESE_UNICODE* = 0x00000001 # Japanese Unicode order + SORT_CHINESE_BIG5* = 0x00000000 # Chinese BIG5 order + SORT_CHINESE_PRCP* = 0x00000000 # PRC Chinese Phonetic order + SORT_CHINESE_UNICODE* = 0x00000001 # Chinese Unicode order + SORT_CHINESE_PRC* = 0x00000002 # PRC Chinese Stroke Count order + SORT_CHINESE_BOPOMOFO* = 0x00000003 # Traditional Chinese Bopomofo order + SORT_KOREAN_KSC* = 0x00000000 # Korean KSC order + SORT_KOREAN_UNICODE* = 0x00000001 # Korean Unicode order + SORT_GERMAN_PHONE_BOOK* = 0x00000001 # German Phone Book order + SORT_HUNGARIAN_DEFAULT* = 0x00000000 # Hungarian Default order + SORT_HUNGARIAN_TECHNICAL* = 0x00000001 # Hungarian Technical order + SORT_GEORGIAN_TRADITIONAL* = 0x00000000 # Georgian Traditional order + SORT_GEORGIAN_MODERN* = 0x00000001 # Georgian Modern order + # SYSTEM_INFO structure + PROCESSOR_INTEL_386* = 386 + PROCESSOR_INTEL_486* = 486 + PROCESSOR_INTEL_PENTIUM* = 586 + PROCESSOR_MIPS_R4000* = 4000 + PROCESSOR_ALPHA_21064* = 21064 + # FSCTL_SET_COMPRESSION + COMPRESSION_FORMAT_NONE* = 0 + COMPRESSION_FORMAT_DEFAULT* = 1 + COMPRESSION_FORMAT_LZNT1* = 2 + # TAPE_GET_DRIVE_PARAMETERS structure + TAPE_DRIVE_COMPRESSION* = 131072 + TAPE_DRIVE_ECC* = 65536 + TAPE_DRIVE_ERASE_BOP_ONLY* = 64 + TAPE_DRIVE_ERASE_LONG* = 32 + TAPE_DRIVE_ERASE_IMMEDIATE* = 128 + TAPE_DRIVE_ERASE_SHORT* = 16 + TAPE_DRIVE_FIXED* = 1 + TAPE_DRIVE_FIXED_BLOCK* = 1024 + TAPE_DRIVE_INITIATOR* = 4 + TAPE_DRIVE_PADDING* = 262144 + TAPE_DRIVE_GET_ABSOLUTE_BLK* = 1048576 + TAPE_DRIVE_GET_LOGICAL_BLK* = 2097152 + TAPE_DRIVE_REPORT_SMKS* = 524288 + TAPE_DRIVE_SELECT* = 2 + TAPE_DRIVE_SET_EOT_WZ_SIZE* = 4194304 + TAPE_DRIVE_TAPE_CAPACITY* = 256 + TAPE_DRIVE_TAPE_REMAINING* = 512 + TAPE_DRIVE_VARIABLE_BLOCK* = 2048 + TAPE_DRIVE_WRITE_PROTECT* = 4096 + TAPE_DRIVE_ABS_BLK_IMMED* = -2147475456 + TAPE_DRIVE_ABSOLUTE_BLK* = -2147479552 + TAPE_DRIVE_END_OF_DATA* = -2147418112 + TAPE_DRIVE_FILEMARKS* = -2147221504 + TAPE_DRIVE_LOAD_UNLOAD* = -2147483647 + TAPE_DRIVE_LOAD_UNLD_IMMED* = -2147483616 + TAPE_DRIVE_LOCK_UNLOCK* = -2147483644 + TAPE_DRIVE_LOCK_UNLK_IMMED* = -2147483520 + TAPE_DRIVE_LOG_BLK_IMMED* = -2147450880 + TAPE_DRIVE_LOGICAL_BLK* = -2147467264 + TAPE_DRIVE_RELATIVE_BLKS* = -2147352576 + TAPE_DRIVE_REVERSE_POSITION* = -2143289344 + TAPE_DRIVE_REWIND_IMMEDIATE* = -2147483640 + TAPE_DRIVE_SEQUENTIAL_FMKS* = -2146959360 + TAPE_DRIVE_SEQUENTIAL_SMKS* = -2145386496 + TAPE_DRIVE_SET_BLOCK_SIZE* = -2147483632 + TAPE_DRIVE_SET_COMPRESSION* = -2147483136 + TAPE_DRIVE_SET_ECC* = -2147483392 + TAPE_DRIVE_SET_PADDING* = -2147482624 + TAPE_DRIVE_SET_REPORT_SMKS* = -2147481600 + TAPE_DRIVE_SETMARKS* = -2146435072 + TAPE_DRIVE_SPACE_IMMEDIATE* = -2139095040 + TAPE_DRIVE_TENSION* = -2147483646 + TAPE_DRIVE_TENSION_IMMED* = -2147483584 + TAPE_DRIVE_WRITE_FILEMARKS* = -2113929216 + TAPE_DRIVE_WRITE_LONG_FMKS* = -2013265920 + TAPE_DRIVE_WRITE_MARK_IMMED* = -1879048192 + TAPE_DRIVE_WRITE_SETMARKS* = -2130706432 + TAPE_DRIVE_WRITE_SHORT_FMKS* = -2080374784 + # Standard rights + STANDARD_RIGHTS_REQUIRED* = 0x000F0000 + STANDARD_RIGHTS_WRITE* = 0x00020000 + STANDARD_RIGHTS_READ* = 0x00020000 + STANDARD_RIGHTS_EXECUTE* = 0x00020000 + STANDARD_RIGHTS_ALL* = 0x001F0000 + SPECIFIC_RIGHTS_ALL* = 0x0000FFFF + + FILE_GENERIC_READ* = STANDARD_RIGHTS_READ or + FILE_READ_DATA or + FILE_READ_ATTRIBUTES or + FILE_READ_EA or + SYNCHRONIZE + FILE_GENERIC_WRITE* = STANDARD_RIGHTS_WRITE or + FILE_WRITE_DATA or + FILE_WRITE_ATTRIBUTES or + FILE_WRITE_EA or + FILE_APPEND_DATA or + SYNCHRONIZE + FILE_GENERIC_EXECUTE* = STANDARD_RIGHTS_EXECUTE or + FILE_READ_ATTRIBUTES or + FILE_EXECUTE or + SYNCHRONIZE + FILE_ALL_ACCESS* = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or 0x1FF + + # ACCESS_MASK + MAXIMUM_ALLOWED* = 0x02000000 + GENERIC_ALL* = 0x10000000 + # SID + SECURITY_NULL_RID* = 0 + SECURITY_WORLD_RID* = 0 + SECURITY_LOCAL_RID* = 0 + SECURITY_CREATOR_OWNER_RID* = 0 + SECURITY_CREATOR_GROUP_RID* = 0x00000001 + SECURITY_DIALUP_RID* = 0x00000001 + SECURITY_NETWORK_RID* = 0x00000002 + SECURITY_BATCH_RID* = 0x00000003 + SECURITY_INTERACTIVE_RID* = 0x00000004 + SECURITY_LOGON_IDS_RID* = 0x00000005 + SECURITY_LOGON_IDS_RID_COUNT* = 0x00000003 + SECURITY_SERVICE_RID* = 0x00000006 + SECURITY_LOCAL_SYSTEM_RID* = 0x00000012 + SECURITY_BUILTIN_DOMAIN_RID* = 0x00000020 + DOMAIN_USER_RID_ADMIN* = 0x000001F4 + DOMAIN_USER_RID_GUEST* = 0x000001F5 + DOMAIN_GROUP_RID_ADMINS* = 0x00000200 + DOMAIN_GROUP_RID_USERS* = 0x00000201 + DOMAIN_ALIAS_RID_ADMINS* = 0x00000220 + DOMAIN_ALIAS_RID_USERS* = 0x00000221 + DOMAIN_ALIAS_RID_GUESTS* = 0x00000222 + DOMAIN_ALIAS_RID_POWER_USERS* = 0x00000223 + DOMAIN_ALIAS_RID_ACCOUNT_OPS* = 0x00000224 + DOMAIN_ALIAS_RID_SYSTEM_OPS* = 0x00000225 + DOMAIN_ALIAS_RID_PRINT_OPS* = 0x00000226 + DOMAIN_ALIAS_RID_BACKUP_OPS* = 0x00000227 + DOMAIN_ALIAS_RID_REPLICATOR* = 0x00000228 + # TOKEN_GROUPS structure + SE_GROUP_MANDATORY* = 0x00000001 + SE_GROUP_ENABLED_BY_DEFAULT* = 0x00000002 + SE_GROUP_ENABLED* = 0x00000004 + SE_GROUP_OWNER* = 0x00000008 + SE_GROUP_LOGON_ID* = 0xC0000000 + # ACL Defines + ACL_REVISION* = 2 + # ACE_HEADER structure + ACCESS_ALLOWED_ACE_TYPE* = 0x00000000 + ACCESS_DENIED_ACE_TYPE* = 0x00000001 + SYSTEM_AUDIT_ACE_TYPE* = 0x00000002 + SYSTEM_ALARM_ACE_TYPE* = 0x00000003 + # ACE flags in the ACE_HEADER structure + OBJECT_INHERIT_ACE* = 0x00000001 + CONTAINER_INHERIT_ACE* = 0x00000002 + NO_PROPAGATE_INHERIT_ACE* = 0x00000004 + INHERIT_ONLY_ACE* = 0x00000008 + SUCCESSFUL_ACCESS_ACE_FLAG* = 0x00000040 + FAILED_ACCESS_ACE_FLAG* = 0x00000080 + # SECURITY_DESCRIPTOR_CONTROL + #SECURITY_DESCRIPTOR_REVISION = 1;already defined above + SECURITY_DESCRIPTOR_MIN_LENGTH* = 20 + SE_OWNER_DEFAULTED* = 1 + SE_GROUP_DEFAULTED* = 2 + SE_DACL_PRESENT* = 4 + SE_DACL_DEFAULTED* = 8 + SE_SACL_PRESENT* = 16 + SE_SACL_DEFAULTED* = 32 + SE_SELF_RELATIVE* = 32768 + # PRIVILEGE_SET + SE_PRIVILEGE_ENABLED_BY_DEFAULT* = 0x00000001 + SE_PRIVILEGE_ENABLED* = 0x00000002 + SE_PRIVILEGE_USED_FOR_ACCESS* = 0x80000000 + PRIVILEGE_SET_ALL_NECESSARY* = 0x00000001 + # OPENFILENAME structure + OFN_ALLOWMULTISELECT* = 0x00000200 + OFN_CREATEPROMPT* = 0x00002000 + OFN_ENABLEHOOK* = 0x00000020 + OFN_ENABLETEMPLATE* = 0x00000040 + OFN_ENABLETEMPLATEHANDLE* = 0x00000080 + OFN_EXPLORER* = 0x00080000 + OFN_EXTENSIONDIFFERENT* = 0x00000400 + OFN_FILEMUSTEXIST* = 0x00001000 + OFN_HIDEREADONLY* = 0x00000004 + OFN_LONGNAMES* = 0x00200000 + OFN_NOCHANGEDIR* = 0x00000008 + OFN_NODEREFERENCELINKS* = 0x00100000 + OFN_NOLONGNAMES* = 0x00040000 + OFN_NONETWORKBUTTON* = 0x00020000 + OFN_NOREADONLYRETURN* = 0x00008000 + OFN_NOTESTFILECREATE* = 0x00010000 + OFN_NOVALIDATE* = 0x00000100 + OFN_OVERWRITEPROMPT* = 0x00000002 + OFN_PATHMUSTEXIST* = 0x00000800 + OFN_READONLY* = 0x00000001 + OFN_SHAREAWARE* = 0x00004000 + OFN_SHOWHELP* = 0x00000010 + # SHAREVISTRING message + OFN_SHAREFALLTHROUGH* = 0x00000002 + OFN_SHARENOWARN* = 0x00000001 + OFN_SHAREWARN* = 0 + # Open/Save notifications + CDN_INITDONE* = 0xFFFFFDA7 + CDN_SELCHANGE* = 0xFFFFFDA6 + CDN_FOLDERCHANGE* = 0xFFFFFDA5 + CDN_SHAREVIOLATION* = 0xFFFFFDA4 + CDN_HELP* = 0xFFFFFDA3 + CDN_FILEOK* = 0xFFFFFDA2 + CDN_TYPECHANGE* = 0xFFFFFDA1 + # Open/Save messages + CDM_GETFILEPATH* = 0x00000465 + CDM_GETFOLDERIDLIST* = 0x00000467 + CDM_GETFOLDERPATH* = 0x00000466 + CDM_GETSPEC* = 0x00000464 + CDM_HIDECONTROL* = 0x00000469 + CDM_SETCONTROLTEXT* = 0x00000468 + CDM_SETDEFEXT* = 0x0000046A + # CHOOSECOLOR structure + CC_ENABLEHOOK* = 0x00000010 + CC_ENABLETEMPLATE* = 0x00000020 + CC_ENABLETEMPLATEHANDLE* = 0x00000040 + CC_FULLOPEN* = 0x00000002 + CC_PREVENTFULLOPEN* = 0x00000004 + CC_RGBINIT* = 0x00000001 + CC_SHOWHELP* = 0x00000008 + CC_SOLIDCOLOR* = 0x00000080 + # FINDREPLACE structure + FR_DIALOGTERM* = 0x00000040 + FR_DOWN* = 0x00000001 + FR_ENABLEHOOK* = 0x00000100 + FR_ENABLETEMPLATE* = 0x00000200 + FR_ENABLETEMPLATEHANDLE* = 0x00002000 + FR_FINDNEXT* = 0x00000008 + FR_HIDEUPDOWN* = 0x00004000 + FR_HIDEMATCHCASE* = 0x00008000 + FR_HIDEWHOLEWORD* = 0x00010000 + FR_MATCHCASE* = 0x00000004 + FR_NOMATCHCASE* = 0x00000800 + FR_NOUPDOWN* = 0x00000400 + FR_NOWHOLEWORD* = 0x00001000 + FR_REPLACE* = 0x00000010 + FR_REPLACEALL* = 0x00000020 + FR_SHOWHELP* = 0x00000080 + FR_WHOLEWORD* = 0x00000002 + # CHOOSEFONT structure + CF_APPLY* = 0x00000200 + CF_ANSIONLY* = 0x00000400 + CF_BOTH* = 0x00000003 + CF_TTONLY* = 0x00040000 + CF_EFFECTS* = 0x00000100 + CF_ENABLEHOOK* = 0x00000008 + CF_ENABLETEMPLATE* = 0x00000010 + CF_ENABLETEMPLATEHANDLE* = 0x00000020 + CF_FIXEDPITCHONLY* = 0x00004000 + CF_FORCEFONTEXIST* = 0x00010000 + CF_INITTOLOGFONTSTRUCT* = 0x00000040 + CF_LIMITSIZE* = 0x00002000 + CF_NOOEMFONTS* = 0x00000800 + CF_NOFACESEL* = 0x00080000 + CF_NOSCRIPTSEL* = 0x00800000 + CF_NOSTYLESEL* = 0x00100000 + CF_NOSIZESEL* = 0x00200000 + CF_NOSIMULATIONS* = 0x00001000 + CF_NOVECTORFONTS* = 0x00000800 + CF_NOVERTFONTS* = 0x01000000 + CF_PRINTERFONTS* = 0x00000002 + CF_SCALABLEONLY* = 0x00020000 + CF_SCREENFONTS* = 0x00000001 + CF_SCRIPTSONLY* = 0x00000400 + CF_SELECTSCRIPT* = 0x00400000 + CF_SHOWHELP* = 0x00000004 + CF_USESTYLE* = 0x00000080 + CF_WYSIWYG* = 0x00008000 + BOLD_FONTTYPE* = 0x00000100 + ITALIC_FONTTYPE* = 0x00000200 + PRINTER_FONTTYPE* = 0x00004000 + REGULAR_FONTTYPE* = 0x00000400 + SCREEN_FONTTYPE* = 0x00002000 + SIMULATED_FONTTYPE* = 0x00008000 + # Common dialog messages + COLOROKSTRINGW* = "commdlg_ColorOK" + FILEOKSTRINGW* = "commdlg_FileNameOK" + FINDMSGSTRINGW* = "commdlg_FindReplace" + HELPMSGSTRINGW* = "commdlg_help" + LBSELCHSTRINGW* = "commdlg_LBSelChangedNotify" + SETRGBSTRINGW* = "commdlg_SetRGBColor" + SHAREVISTRINGW* = "commdlg_ShareViolation" + COLOROKSTRINGA* = "commdlg_ColorOK" + FILEOKSTRINGA* = "commdlg_FileNameOK" + FINDMSGSTRINGA* = "commdlg_FindReplace" + HELPMSGSTRINGA* = "commdlg_help" + LBSELCHSTRINGA* = "commdlg_LBSelChangedNotify" + SETRGBSTRINGA* = "commdlg_SetRGBColor" + SHAREVISTRINGA* = "commdlg_ShareViolation" + +when defined(winUnicode): + const + COLOROKSTRING* = COLOROKSTRINGW + FILEOKSTRING* = FILEOKSTRINGW + FINDMSGSTRING* = FINDMSGSTRINGW + HELPMSGSTRING* = HELPMSGSTRINGW + LBSELCHSTRING* = LBSELCHSTRINGW + SETRGBSTRING* = SETRGBSTRINGW + SHAREVISTRING* = SHAREVISTRINGW +else: + const + COLOROKSTRING* = COLOROKSTRINGA + FILEOKSTRING* = FILEOKSTRINGA + FINDMSGSTRING* = FINDMSGSTRINGA + HELPMSGSTRING* = HELPMSGSTRINGA + LBSELCHSTRING* = LBSELCHSTRINGA + SETRGBSTRING* = SETRGBSTRINGA + SHAREVISTRING* = SHAREVISTRINGA + +const + # LBSELCHSTRING message + CD_LBSELCHANGE* = 0 + CD_LBSELADD* = 2 + CD_LBSELSUB* = 1 + CD_LBSELNOITEMS* = -1 + # DEVNAMES structure + DN_DEFAULTPRN* = 1 + # PRINTDLG structure + PD_ALLPAGES* = 0 + PD_COLLATE* = 16 + PD_DISABLEPRINTTOFILE* = 524288 + PD_ENABLEPRINTHOOK* = 4096 + PD_ENABLEPRINTTEMPLATE* = 16384 + PD_ENABLEPRINTTEMPLATEHANDLE* = 65536 + PD_ENABLESETUPHOOK* = 8192 + PD_ENABLESETUPTEMPLATE* = 32768 + PD_ENABLESETUPTEMPLATEHANDLE* = 131072 + PD_HIDEPRINTTOFILE* = 1048576 + PD_NOPAGENUMS* = 8 + PD_NOSELECTION* = 4 + PD_NOWARNING* = 128 + PD_PAGENUMS* = 2 + PD_PRINTSETUP* = 64 + PD_PRINTTOFILE* = 32 + PD_RETURNDC* = 256 + PD_RETURNDEFAULT* = 1024 + PD_RETURNIC* = 512 + PD_SELECTION* = 1 + PD_SHOWHELP* = 2048 + PD_USEDEVMODECOPIES* = 262144 + PD_USEDEVMODECOPIESANDCOLLATE* = 262144 + # PAGESETUPDLG structure + PSD_DEFAULTMINMARGINS* = 0 + PSD_DISABLEMARGINS* = 16 + PSD_DISABLEORIENTATION* = 256 + PSD_DISABLEPAGEPAINTING* = 524288 + PSD_DISABLEPAPER* = 512 + PSD_DISABLEPRINTER* = 32 + PSD_ENABLEPAGEPAINTHOOK* = 262144 + PSD_ENABLEPAGESETUPHOOK* = 8192 + PSD_ENABLEPAGESETUPTEMPLATE* = 32768 + PSD_ENABLEPAGESETUPTEMPLATEHANDLE* = 131072 + PSD_INHUNDREDTHSOFMILLIMETERS* = 8 + PSD_INTHOUSANDTHSOFINCHES* = 4 + PSD_INWININIINTLMEASURE* = 0 + PSD_MARGINS* = 2 + PSD_MINMARGINS* = 1 + PSD_NOWARNING* = 128 + PSD_RETURNDEFAULT* = 1024 + PSD_SHOWHELP* = 2048 + # WM_SHOWWINDOW message + SW_OTHERUNZOOM* = 4 + SW_OTHERZOOM* = 2 + SW_PARENTCLOSING* = 1 + SW_PARENTOPENING* = 3 + # Virtual Key codes + VK_LBUTTON* = 1 + VK_RBUTTON* = 2 + VK_CANCEL* = 3 + VK_MBUTTON* = 4 + VK_BACK* = 8 + VK_TAB* = 9 + VK_CLEAR* = 12 + VK_RETURN* = 13 + VK_SHIFT* = 16 + VK_CONTROL* = 17 + VK_MENU* = 18 + VK_PAUSE* = 19 + VK_CAPITAL* = 20 + VK_ESCAPE* = 27 + VK_SPACE* = 32 + VK_PRIOR* = 33 + VK_NEXT* = 34 + VK_END* = 35 + VK_HOME* = 36 + VK_LEFT* = 37 + VK_UP* = 38 + VK_RIGHT* = 39 + VK_DOWN* = 40 + VK_SELECT* = 41 + VK_PRINT* = 42 + VK_EXECUTE* = 43 + VK_SNAPSHOT* = 44 + VK_INSERT* = 45 + VK_DELETE* = 46 + VK_HELP* = 47 + VK_0* = 48 + VK_1* = 49 + VK_2* = 50 + VK_3* = 51 + VK_4* = 52 + VK_5* = 53 + VK_6* = 54 + VK_7* = 55 + VK_8* = 56 + VK_9* = 57 + VK_A* = 65 + VK_B* = 66 + VK_C* = 67 + VK_D* = 68 + VK_E* = 69 + VK_F* = 70 + VK_G* = 71 + VK_H* = 72 + VK_I* = 73 + VK_J* = 74 + VK_K* = 75 + VK_L* = 76 + VK_M* = 77 + VK_N* = 78 + VK_O* = 79 + VK_P* = 80 + VK_Q* = 81 + VK_R* = 82 + VK_S* = 83 + VK_T* = 84 + VK_U* = 85 + VK_V* = 86 + VK_W* = 87 + VK_X* = 88 + VK_Y* = 89 + VK_Z* = 90 + VK_LWIN* = 91 + VK_RWIN* = 92 + VK_APPS* = 93 + VK_NUMPAD0* = 96 + VK_NUMPAD1* = 97 + VK_NUMPAD2* = 98 + VK_NUMPAD3* = 99 + VK_NUMPAD4* = 100 + VK_NUMPAD5* = 101 + VK_NUMPAD6* = 102 + VK_NUMPAD7* = 103 + VK_NUMPAD8* = 104 + VK_NUMPAD9* = 105 + VK_MULTIPLY* = 106 + VK_ADD* = 107 + VK_SEPARATOR* = 108 + VK_SUBTRACT* = 109 + VK_DECIMAL* = 110 + VK_DIVIDE* = 111 + VK_F1* = 112 + VK_F2* = 113 + VK_F3* = 114 + VK_F4* = 115 + VK_F5* = 116 + VK_F6* = 117 + VK_F7* = 118 + VK_F8* = 119 + VK_F9* = 120 + VK_F10* = 121 + VK_F11* = 122 + VK_F12* = 123 + VK_F13* = 124 + VK_F14* = 125 + VK_F15* = 126 + VK_F16* = 127 + VK_F17* = 128 + VK_F18* = 129 + VK_F19* = 130 + VK_F20* = 131 + VK_F21* = 132 + VK_F22* = 133 + VK_F23* = 134 + VK_F24* = 135 + # GetAsyncKeyState + VK_NUMLOCK* = 144 + VK_SCROLL* = 145 + VK_LSHIFT* = 160 + VK_LCONTROL* = 162 + VK_LMENU* = 164 + VK_RSHIFT* = 161 + VK_RCONTROL* = 163 + VK_RMENU* = 165 + # ImmGetVirtualKey + VK_PROCESSKEY* = 229 + # Keystroke Message Flags + KF_ALTDOWN* = 8192 + KF_DLGMODE* = 2048 + KF_EXTENDED* = 256 + KF_MENUMODE* = 4096 + KF_REPEAT* = 16384 + KF_UP* = 32768 + # GetKeyboardLayoutName + KL_NAMELENGTH* = 9 + # WM_ACTIVATE message + WA_ACTIVE* = 1 + WA_CLICKACTIVE* = 2 + WA_INACTIVE* = 0 + # WM_ACTIVATE message + PWR_CRITICALRESUME* = 3 + PWR_SUSPENDREQUEST* = 1 + PWR_SUSPENDRESUME* = 2 + PWR_FAIL* = -1 + PWR_OK* = 1 + # WM_NOTIFYFORMAT message + NF_QUERY* = 3 + NF_REQUERY* = 4 + NFR_ANSI* = 1 + NFR_UNICODE* = 2 + # WM_SIZING message + WMSZ_BOTTOM* = 6 + WMSZ_BOTTOMLEFT* = 7 + WMSZ_BOTTOMRIGHT* = 8 + WMSZ_LEFT* = 1 + WMSZ_RIGHT* = 2 + WMSZ_TOP* = 3 + WMSZ_TOPLEFT* = 4 + WMSZ_TOPRIGHT* = 5 + # WM_MOUSEACTIVATE message + MA_ACTIVATE* = 1 + MA_ACTIVATEANDEAT* = 2 + MA_NOACTIVATE* = 3 + MA_NOACTIVATEANDEAT* = 4 + # WM_SIZE message + SIZE_MAXHIDE* = 4 + SIZE_MAXIMIZED* = 2 + SIZE_MAXSHOW* = 3 + SIZE_MINIMIZED* = 1 + SIZE_RESTORED* = 0 + # WM_NCCALCSIZE message + WVR_ALIGNTOP* = 16 + WVR_ALIGNLEFT* = 32 + WVR_ALIGNBOTTOM* = 64 + WVR_ALIGNRIGHT* = 128 + WVR_HREDRAW* = 256 + WVR_VREDRAW* = 512 + WVR_REDRAW* = 768 + WVR_VALIDRECTS* = 1024 + # WM_NCHITTEST message + HTBOTTOM* = 15 + HTBOTTOMLEFT* = 16 + HTBOTTOMRIGHT* = 17 + HTCAPTION* = 2 + HTCLIENT* = 1 + HTERROR* = -2 + HTGROWBOX* = 4 + HTHSCROLL* = 6 + HTLEFT* = 10 + HTMENU* = 5 + HTNOWHERE* = 0 + HTREDUCE* = 8 + + HTRIGHT* = 11 + HTSIZE* = 4 + HTSYSMENU* = 3 + HTTOP* = 12 + HTTOPLEFT* = 13 + HTTOPRIGHT* = 14 + HTTRANSPARENT* = -1 + HTVSCROLL* = 7 + HTZOOM* = 9 + # Mouse messages + MK_CONTROL* = 8 + MK_LBUTTON* = 1 + MK_MBUTTON* = 16 + MK_RBUTTON* = 2 + MK_SHIFT* = 4 + # WNDCLASS structure + CS_BYTEALIGNCLIENT* = 4096 + CS_BYTEALIGNWINDOW* = 8192 + CS_CLASSDC* = 64 + CS_DBLCLKS* = 8 + CS_GLOBALCLASS* = 16384 + CS_HREDRAW* = 2 + CS_KEYCVTWINDOW* = 4 + CS_NOCLOSE* = 512 + CS_NOKEYCVT* = 256 + CS_OWNDC* = 32 + CS_PARENTDC* = 128 + CS_SAVEBITS* = 2048 + CS_VREDRAW* = 1 + DLGWINDOWEXTRA* = 30 + # ACCEL structure + FALT* = 16 + FCONTROL* = 8 + FNOINVERT* = 2 + FSHIFT* = 4 + FVIRTKEY* = 1 + # WM_MENUCHAR return constants + MNC_IGNORE* = 0 + MNC_CLOSE* = 1 + MNC_EXECUTE* = 2 + MNC_SELECT* = 3 + # MENUINFO structure + MIM_MAXHEIGHT* = 1 + MIM_BACKGROUND* = 2 + MIM_HELPID* = 4 + MIM_MENUDATA* = 8 + MIM_STYLE* = 16 + MIM_APPLYTOSUBMENUS* = 0x80000000 + MNS_CHECKORBMP* = 0x04000000 + MNS_NOTIFYBYPOS* = 0x08000000 + MNS_AUTODISMISS* = 0x10000000 + MNS_DRAGDROP* = 0x20000000 + MNS_MODELESS* = 0x40000000 + MNS_NOCHECK* = 0x80000000 + # MENUITEMINFO structure + MIIM_CHECKMARKS* = 8 + MIIM_DATA* = 32 + MIIM_ID* = 2 + MIIM_STATE* = 1 + MIIM_SUBMENU* = 4 + MIIM_TYPE* = 16 + MIIM_STRING* = 64 + MIIM_BITMAP* = 128 + MIIM_FTYPE* = 256 + MFT_BITMAP* = 0x00000004 + MFT_MENUBARBREAK* = 0x00000020 + MFT_MENUBREAK* = 0x00000040 + MFT_OWNERDRAW* = 0x00000100 + MFT_RADIOCHECK* = 0x00000200 + MFT_RIGHTJUSTIFY* = 0x00004000 + MFT_SEPARATOR* = 0x00000800 + MFT_RIGHTORDER* = 0x00002000 + MFT_STRING* = 0 + MFS_CHECKED* = 0x00000008 + MFS_DEFAULT* = 0x00001000 + MFS_DISABLED* = 0x00000003 + MFS_ENABLED* = 0 + MFS_GRAYED* = 0x00000003 + MFS_HILITE* = 0x00000080 + MFS_UNCHECKED* = 0 + MFS_UNHILITE* = 0 + HBMMENU_CALLBACK* = - 1 + HBMMENU_SYSTEM* = 1 + HBMMENU_MBAR_RESTORE* = 2 + HBMMENU_MBAR_MINIMIZE* = 3 + HBMMENU_MBAR_CLOSE* = 5 + HBMMENU_MBAR_CLOSE_D* = 6 + HBMMENU_MBAR_MINIMIZE_D* = 7 + HBMMENU_POPUP_CLOSE* = 8 + HBMMENU_POPUP_RESTORE* = 9 + HBMMENU_POPUP_MAXIMIZE* = 10 + HBMMENU_POPUP_MINIMIZE* = 11 + # SERIALKEYS structure + SERKF_AVAILABLE* = 2 + SERKF_INDICATOR* = 4 + SERKF_SERIALKEYSON* = 1 + # FILTERKEYS structure + FKF_AVAILABLE* = 2 + FKF_CLICKON* = 64 + FKF_FILTERKEYSON* = 1 + FKF_HOTKEYACTIVE* = 4 + FKF_HOTKEYSOUND* = 16 + FKF_CONFIRMHOTKEY* = 8 + FKF_INDICATOR* = 32 + # HELPINFO structure + HELPINFO_MENUITEM* = 2 + HELPINFO_WINDOW* = 1 + # WM_PRINT message + PRF_CHECKVISIBLE* = 0x00000001 + PRF_CHILDREN* = 0x00000010 + PRF_CLIENT* = 0x00000004 + PRF_ERASEBKGND* = 0x00000008 + PRF_NONCLIENT* = 0x00000002 + PRF_OWNED* = 0x00000020 + + # MapWindowPoints + HWND_DESKTOP* = HWND(0) + +const + # WM_SYSCOMMAND message + SC_CLOSE* = 61536 + SC_CONTEXTHELP* = 61824 + SC_DEFAULT* = 61792 + SC_HOTKEY* = 61776 + SC_HSCROLL* = 61568 + SC_KEYMENU* = 61696 + SC_MAXIMIZE* = 61488 + SC_ZOOM* = 61488 + SC_MINIMIZE* = 61472 + SC_ICON* = 61472 + SC_MONITORPOWER* = 61808 + SC_MOUSEMENU* = 61584 + SC_MOVE* = 61456 + SC_NEXTWINDOW* = 61504 + SC_PREVWINDOW* = 61520 + SC_RESTORE* = 61728 + SC_SCREENSAVE* = 61760 + SC_SIZE* = 61440 + SC_TASKLIST* = 61744 + SC_VSCROLL* = 61552 + # DM_GETDEFID message + DC_HASDEFID* = 21323 + # WM_GETDLGCODE message + DLGC_BUTTON* = 8192 + DLGC_DEFPUSHBUTTON* = 16 + DLGC_HASSETSEL* = 8 + DLGC_RADIOBUTTON* = 64 + DLGC_STATIC* = 256 + DLGC_UNDEFPUSHBUTTON* = 32 + DLGC_WANTALLKEYS* = 4 + DLGC_WANTARROWS* = 1 + DLGC_WANTCHARS* = 128 + DLGC_WANTMESSAGE* = 4 + DLGC_WANTTAB* = 2 + # EM_SETMARGINS message + EC_LEFTMARGIN* = 1 + EC_RIGHTMARGIN* = 2 + EC_USEFONTINFO* = 65535 + # LB_SETCOUNT message + LB_ERR* = -1 + LB_ERRSPACE* = -2 + LB_OKAY* = 0 + # CB_DIR message + CB_ERR* = -1 + CB_ERRSPACE* = -2 + # WM_IME_CONTROL message + IMC_GETCANDIDATEPOS* = 7 + IMC_GETCOMPOSITIONFONT* = 9 + IMC_GETCOMPOSITIONWINDOW* = 11 + IMC_GETSTATUSWINDOWPOS* = 15 + IMC_CLOSESTATUSWINDOW* = 33 + IMC_OPENSTATUSWINDOW* = 34 + IMC_SETCANDIDATEPOS* = 8 + IMC_SETCOMPOSITIONFONT* = 10 + IMC_SETCOMPOSITIONWINDOW* = 12 + IMC_SETSTATUSWINDOWPOS* = 16 + # WM_IME_CONTROL message + IMN_CHANGECANDIDATE* = 3 + IMN_CLOSECANDIDATE* = 4 + IMN_CLOSESTATUSWINDOW* = 1 + IMN_GUIDELINE* = 13 + IMN_OPENCANDIDATE* = 5 + IMN_OPENSTATUSWINDOW* = 2 + IMN_SETCANDIDATEPOS* = 9 + IMN_SETCOMPOSITIONFONT* = 10 + IMN_SETCOMPOSITIONWINDOW* = 11 + IMN_SETCONVERSIONMODE* = 6 + IMN_SETOPENSTATUS* = 8 + IMN_SETSENTENCEMODE* = 7 + IMN_SETSTATUSWINDOWPOS* = 12 + IMN_PRIVATE* = 14 + # STICKYKEYS structure + SKF_AUDIBLEFEEDBACK* = 64 + SKF_AVAILABLE* = 2 + SKF_CONFIRMHOTKEY* = 8 + SKF_HOTKEYACTIVE* = 4 + SKF_HOTKEYSOUND* = 16 + SKF_INDICATOR* = 32 + SKF_STICKYKEYSON* = 1 + SKF_TRISTATE* = 128 + SKF_TWOKEYSOFF* = 256 + # MOUSEKEYS structure + MKF_AVAILABLE* = 2 + MKF_CONFIRMHOTKEY* = 8 + MKF_HOTKEYACTIVE* = 4 + MKF_HOTKEYSOUND* = 16 + MKF_INDICATOR* = 32 + MKF_MOUSEKEYSON* = 1 + MKF_MODIFIERS* = 64 + MKF_REPLACENUMBERS* = 128 + # SOUNDSENTRY structure + SSF_AVAILABLE* = 2 + SSF_SOUNDSENTRYON* = 1 + SSTF_BORDER* = 2 + SSTF_CHARS* = 1 + SSTF_DISPLAY* = 3 + SSTF_NONE* = 0 + SSGF_DISPLAY* = 3 + SSGF_NONE* = 0 + SSWF_CUSTOM* = 4 + SSWF_DISPLAY* = 3 + SSWF_NONE* = 0 + SSWF_TITLE* = 1 + SSWF_WINDOW* = 2 + # ACCESSTIMEOUT structure + ATF_ONOFFFEEDBACK* = 2 + ATF_TIMEOUTON* = 1 + # HIGHCONTRAST structure + HCF_AVAILABLE* = 2 + HCF_CONFIRMHOTKEY* = 8 + HCF_HIGHCONTRASTON* = 1 + HCF_HOTKEYACTIVE* = 4 + HCF_HOTKEYAVAILABLE* = 64 + HCF_HOTKEYSOUND* = 16 + HCF_INDICATOR* = 32 + # TOGGLEKEYS structure + TKF_AVAILABLE* = 2 + TKF_CONFIRMHOTKEY* = 8 + TKF_HOTKEYACTIVE* = 4 + TKF_HOTKEYSOUND* = 16 + TKF_TOGGLEKEYSON* = 1 + # Installable Policy + PP_DISPLAYERRORS* = 1 + # SERVICE_INFO structure + RESOURCEDISPLAYTYPE_DOMAIN* = 1 + RESOURCEDISPLAYTYPE_FILE* = 4 + RESOURCEDISPLAYTYPE_GENERIC* = 0 + RESOURCEDISPLAYTYPE_GROUP* = 5 + RESOURCEDISPLAYTYPE_SERVER* = 2 + RESOURCEDISPLAYTYPE_SHARE* = 3 + # KEY_EVENT_RECORD structure + CAPSLOCK_ON* = 128 + ENHANCED_KEY* = 256 + LEFT_ALT_PRESSED* = 2 + LEFT_CTRL_PRESSED* = 8 + NUMLOCK_ON* = 32 + RIGHT_ALT_PRESSED* = 1 + RIGHT_CTRL_PRESSED* = 4 + SCROLLLOCK_ON* = 64 + SHIFT_PRESSED* = 16 + # MOUSE_EVENT_RECORD structure + FROM_LEFT_1ST_BUTTON_PRESSED* = 1 + RIGHTMOST_BUTTON_PRESSED* = 2 + FROM_LEFT_2ND_BUTTON_PRESSED* = 4 + FROM_LEFT_3RD_BUTTON_PRESSED* = 8 + FROM_LEFT_4TH_BUTTON_PRESSED* = 16 + DOUBLE_CLICK* = 2 + MOUSE_MOVED* = 1 + # INPUT_RECORD structure + KEY_EVENT* = 1 + cMOUSE_EVENT* = 2 + WINDOW_BUFFER_SIZE_EVENT* = 4 + MENU_EVENT* = 8 + FOCUS_EVENT* = 16 + # BITMAPINFOHEADER structure + BI_RGB* = 0 + BI_RLE8* = 1 + BI_RLE4* = 2 + BI_BITFIELDS* = 3 + # Extensions to OpenGL + # ChoosePixelFormat + PFD_DOUBLEBUFFER* = 0x00000001 + PFD_STEREO* = 0x00000002 + PFD_DRAW_TO_WINDOW* = 0x00000004 + PFD_DRAW_TO_BITMAP* = 0x00000008 + PFD_SUPPORT_GDI* = 0x00000010 + PFD_SUPPORT_OPENGL* = 0x00000020 + PFD_DEPTH_DONTCARE* = 0x20000000 + PFD_DOUBLEBUFFER_DONTCARE* = 0x40000000 + PFD_STEREO_DONTCARE* = 0x80000000 + PFD_TYPE_RGBA* = 0 + PFD_TYPE_COLORINDEX* = 1 + PFD_MAIN_PLANE* = 0 + PFD_OVERLAY_PLANE* = 1 + PFD_UNDERLAY_PLANE* = -1 + # wglUseFontOutlines + WGL_FONT_LINES* = 0 + WGL_FONT_POLYGONS* = 1 + PFD_GENERIC_FORMAT* = 0x00000040 + PFD_NEED_PALETTE* = 0x00000080 + PFD_NEED_SYSTEM_PALETTE* = 0x00000100 + PFD_SWAP_EXCHANGE* = 0x00000200 + PFD_SWAP_COPY* = 0x00000400 + PFD_SWAP_LAYER_BUFFERS* = 0x00000800 + PFD_GENERIC_ACCELERATED* = 0x00001000 + PFD_SUPPORT_DIRECTDRAW* = 0x00002000 + TMPF_FIXED_PITCH* = 0x00000001 + TMPF_VECTOR* = 0x00000002 + TMPF_TRUETYPE* = 0x00000004 + TMPF_DEVICE* = 0x00000008 + WM_CTLCOLOR* = 25 + LWA_COLORKEY* = 0x00000001 + LWA_ALPHA* = 0x00000002 + ULW_COLORKEY* = 0x00000001 + ULW_ALPHA* = 0x00000002 + ULW_OPAQUE* = 0x00000004 + WS_EX_LAYERED* = 0x00080000 + WS_EX_NOINHERITLAYOUT* = 0x00100000 + WS_EX_LAYOUTRTL* = 0x00400000 + WS_EX_COMPOSITED* = 0x02000000 + WS_EX_NOACTIVATE* = 0x08000000 + C3_LEXICAL* = 1024 + +# --------------------- old stuff, need to organize! --------------- +# BEGINNING of windowsx.h stuff from old headers: + +# was #define dname(params) def_expr +proc GetFirstChild*(h: HWND): HWND + # was #define dname(params) def_expr +proc GetNextSibling*(h: HWND): HWND + # was #define dname(params) def_expr +proc GetWindowID*(h: HWND): int32 + # was #define dname(params) def_expr +proc SubclassWindow*(h: HWND, p: LONG): LONG + # was #define dname(params) def_expr + # argument types are unknown + # return type might be wrong +proc GET_WM_COMMAND_CMD*(w, L: int32): int32 + # return type might be wrong + # was #define dname(params) def_expr + # argument types are unknown + # return type might be wrong +proc GET_WM_COMMAND_ID*(w, L: int32): int32 + # return type might be wrong + # was #define dname(params) def_expr + # argument types are unknown +proc GET_WM_CTLCOLOR_HDC*(w, L, msg: int32): HDC + # was #define dname(params) def_expr + # argument types are unknown +proc GET_WM_CTLCOLOR_HWND*(w, L, msg: int32): HWND + # was #define dname(params) def_expr + # argument types are unknown + # return type might be wrong +proc GET_WM_HSCROLL_CODE*(w, L: int32): int32 + # return type might be wrong + # was #define dname(params) def_expr + # argument types are unknown +proc GET_WM_HSCROLL_HWND*(w, L: int32): HWND + # was #define dname(params) def_expr + # argument types are unknown + # return type might be wrong +proc GET_WM_HSCROLL_POS*(w, L: int32): int32 + # return type might be wrong + # was #define dname(params) def_expr + # argument types are unknown + # return type might be wrong +proc GET_WM_MDIACTIVATE_FACTIVATE*(h, a, b: int32): int32 + # return type might be wrong + # was #define dname(params) def_expr + # argument types are unknown +proc GET_WM_MDIACTIVATE_HWNDACTIVATE*(a, b: int32): HWND + # was #define dname(params) def_expr + # argument types are unknown +proc GET_WM_MDIACTIVATE_HWNDDEACT*(a, b: int32): HWND + # was #define dname(params) def_expr + # argument types are unknown + # return type might be wrong +proc GET_WM_VSCROLL_CODE*(w, L: int32): int32 + # return type might be wrong + # was #define dname(params) def_expr + # argument types are unknown +proc GET_WM_VSCROLL_HWND*(w, L: int32): HWND + # was #define dname(params) def_expr + # argument types are unknown + # return type might be wrong +proc GET_WM_VSCROLL_POS*(w, L: int32): int32 + # return type might be wrong + # Not convertable by H2PAS + # END OF windowsx.h stuff from old headers + # ------------------------------------------------------------------ + +const + # BEGINNING of shellapi.h stuff from old headers + SE_ERR_SHARE* = 26 + SE_ERR_ASSOCINCOMPLETE* = 27 + SE_ERR_DDETIMEOUT* = 28 + SE_ERR_DDEFAIL* = 29 + SE_ERR_DDEBUSY* = 30 + SE_ERR_NOASSOC* = 31 + # END OF shellapi.h stuff from old headers + # + # ------------------------------------------------------------------ + # From ddeml.h in old Cygnus headers + XCLASS_BOOL* = 0x00001000 + XCLASS_DATA* = 0x00002000 + XCLASS_FLAGS* = 0x00004000 + XCLASS_MASK* = 0x0000FC00 + XCLASS_NOTIFICATION* = 0x00008000 + XTYPF_NOBLOCK* = 0x00000002 + XTYP_ADVDATA* = 0x00004010 + XTYP_ADVREQ* = 0x00002022 + XTYP_ADVSTART* = 0x00001030 + XTYP_ADVSTOP* = 0x00008040 + XTYP_CONNECT* = 0x00001062 + XTYP_CONNECT_CONFIRM* = 0x00008072 + XTYP_DISCONNECT* = 0x000080C2 + XTYP_EXECUTE* = 0x00004050 + XTYP_POKE* = 0x00004090 + XTYP_REQUEST* = 0x000020B0 + XTYP_WILDCONNECT* = 0x000020E2 + XTYP_REGISTER* = 0x000080A2 + XTYP_ERROR* = 0x00008002 + XTYP_XACT_COMPLETE* = 0x00008080 + XTYP_UNREGISTER* = 0x000080D2 + DMLERR_DLL_USAGE* = 0x00004004 + DMLERR_INVALIDPARAMETER* = 0x00004006 + DMLERR_NOTPROCESSED* = 0x00004009 + DMLERR_POSTMSG_FAILED* = 0x0000400C + DMLERR_SERVER_DIED* = 0x0000400E + DMLERR_SYS_ERROR* = 0x0000400F + DMLERR_BUSY* = 0x00004001 + DMLERR_DATAACKTIMEOUT* = 0x00004002 + DMLERR_ADVACKTIMEOUT* = 0x00004000 + DMLERR_DLL_NOT_INITIALIZED* = 0x00004003 + DMLERR_LOW_MEMORY* = 0x00004007 + DMLERR_MEMORY_ERROR* = 0x00004008 + DMLERR_POKEACKTIMEOUT* = 0x0000400B + DMLERR_NO_CONV_ESTABLISHED* = 0x0000400A + DMLERR_REENTRANCY* = 0x0000400D + DMLERR_UNFOUND_QUEUE_ID* = 0x00004011 + DMLERR_UNADVACKTIMEOUT* = 0x00004010 + DMLERR_EXECACKTIMEOUT* = 0x00004005 + DDE_FACK* = 0x00008000 + DDE_FNOTPROCESSED* = 0x00000000 + DNS_REGISTER* = 0x00000001 + DNS_UNREGISTER* = 0x00000002 + CP_WINANSI* = 1004 + CP_WINUNICODE* = 1200 + # Not convertable by H2PAS + # #define EXPENTRY CALLBACK + APPCLASS_STANDARD* = 0x00000000 + # End of stuff from ddeml.h in old Cygnus headers + + BKMODE_LAST* = 2 + CTLCOLOR_MSGBOX* = 0 + CTLCOLOR_EDIT* = 1 + CTLCOLOR_LISTBOX* = 2 + CTLCOLOR_BTN* = 3 + CTLCOLOR_DLG* = 4 + CTLCOLOR_SCROLLBAR* = 5 + CTLCOLOR_STATIC* = 6 + CTLCOLOR_MAX* = 7 + META_SETMAPMODE* = 0x00000103 + META_SETWINDOWORG* = 0x0000020B + META_SETWINDOWEXT* = 0x0000020C + POLYFILL_LAST* = 2 + STATUS_WAIT_0* = 0x00000000 + STATUS_ABANDONED_WAIT_0* = 0x00000080 + STATUS_USER_APC* = 0x000000C0 + STATUS_TIMEOUT* = 0x00000102 + STATUS_PENDING* = 0x00000103 + STATUS_GUARD_PAGE_VIOLATION* = 0x80000001 + STATUS_DATATYPE_MISALIGNMENT* = 0x80000002 + STATUS_BREAKPOINT* = 0x80000003 + STATUS_SINGLE_STEP* = 0x80000004 + STATUS_IN_PAGE_ERROR* = 0xC0000006 + STATUS_INVALID_HANDLE* = 0xC0000008 + STATUS_ILLEGAL_INSTRUCTION* = 0xC000001D + STATUS_NONCONTINUABLE_EXCEPTION* = 0xC0000025 + STATUS_INVALID_DISPOSITION* = 0xC0000026 + STATUS_ARRAY_BOUNDS_EXCEEDED* = 0xC000008C + STATUS_FLOAT_DENORMAL_OPERAND* = 0xC000008D + STATUS_FLOAT_DIVIDE_BY_ZERO* = 0xC000008E + STATUS_FLOAT_INEXACT_RESULT* = 0xC000008F + STATUS_FLOAT_INVALID_OPERATION* = 0xC0000090 + STATUS_FLOAT_OVERFLOW* = 0xC0000091 + STATUS_FLOAT_STACK_CHECK* = 0xC0000092 + STATUS_FLOAT_UNDERFLOW* = 0xC0000093 + STATUS_INTEGER_DIVIDE_BY_ZERO* = 0xC0000094 + STATUS_INTEGER_OVERFLOW* = 0xC0000095 + STATUS_PRIVILEGED_INSTRUCTION* = 0xC0000096 + STATUS_STACK_OVERFLOW* = 0xC00000FD + STATUS_CONTROL_C_EXIT* = 0xC000013A + PROCESSOR_ARCHITECTURE_INTEL* = 0 + PROCESSOR_ARCHITECTURE_MIPS* = 1 + PROCESSOR_ARCHITECTURE_ALPHA* = 2 + PROCESSOR_ARCHITECTURE_PPC* = 3 + +const + SIZEFULLSCREEN* = SIZE_MAXIMIZED + SIZENORMAL* = SIZE_RESTORED + SIZEICONIC* = SIZE_MINIMIZED + +const + EXCEPTION_READ_FAULT* = 0 # Access violation was caused by a read + EXCEPTION_WRITE_FAULT* = 1 # Access violation was caused by a write + +when 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 + +const + # Define the facility codes + FACILITY_WINDOWS* = 8 + FACILITY_STORAGE* = 3 + FACILITY_RPC* = 1 + FACILITY_SSPI* = 9 + FACILITY_WIN32* = 7 + FACILITY_CONTROL* = 10 + FACILITY_NULL* = 0 + FACILITY_INTERNET* = 12 + FACILITY_ITF* = 4 + FACILITY_DISPATCH* = 2 + FACILITY_CERT* = 11 # Manually added, bug 2672 + ICON_SMALL* = 0 + ICON_BIG* = 1 + # For the TrackMouseEvent + TME_HOVER* = 0x00000001 + TME_LEAVE* = 0x00000002 + TME_QUERY* = 0x40000000 + TME_CANCEL* = DWORD(0x80000000) + HOVER_DEFAULT* = DWORD(0xFFFFFFFF) # Manually added, bug 3270 + COLOR_HOTLIGHT* = 26 + COLOR_GRADIENTACTIVECAPTION* = 27 + COLOR_GRADIENTINACTIVECAPTION* = 28 + COLOR_MENUHILIGHT* = 29 + COLOR_MENUBAR* = 30 + WM_APP* = 0x00008000 + SYSRGN* = 4 + UIS_SET* = 1 + UIS_CLEAR* = 2 + UIS_INITIALIZE* = 3 + UISF_HIDEFOCUS* = 0x00000001 + UISF_HIDEACCEL* = 0x00000002 + UISF_ACTIVE* = 0x00000004 + +type + # WARNING + # the variable argument list + # is not implemented for FPC + # va_list is just a dummy record + # MvdV: Nevertheless it should be a pointer type, not a record + va_list* = cstring + TABC* {.final, pure.} = object + abcA*: int32 + abcB*: UINT + abcC*: int32 + + LPABC* = ptr TABC + PABC* = ptr TABC + TABCFLOAT* {.final, pure.} = object + abcfA*: float32 + abcfB*: float32 + abcfC*: float32 + LPABCFLOAT* = ptr TABCFLOAT + PABCFLOAT* = ptr TABCFLOAT + + TACCEL* {.final, pure.} = object + fVirt*: int8 + key*: int16 + cmd*: int16 + LPACCEL* = ptr TACCEL + PACCEL* = ptr TACCEL + ACE_HEADER* {.final, pure.} = object + AceType*: int8 + AceFlags*: int8 + AceSize*: int16 + + TACE_HEADER* = ACE_HEADER + PACE_HEADER* = ptr ACE_HEADER + ACCESS_MASK* = DWORD + REGSAM* = ACCESS_MASK + ACCESS_ALLOWED_ACE* {.final, pure.} = object + Header*: ACE_HEADER + Mask*: ACCESS_MASK + SidStart*: DWORD + + TACCESS_ALLOWED_ACE* = ACCESS_ALLOWED_ACE + PACCESS_ALLOWED_ACE* = ptr ACCESS_ALLOWED_ACE + ACCESS_DENIED_ACE* {.final, pure.} = object + Header*: ACE_HEADER + Mask*: ACCESS_MASK + SidStart*: DWORD + + TACCESS_DENIED_ACE* = ACCESS_DENIED_ACE + ACCESSTIMEOUT* {.final, pure.} = object + cbSize*: UINT + dwFlags*: DWORD + iTimeOutMSec*: DWORD + + TACCESSTIMEOUT* = ACCESSTIMEOUT + PACCESSTIMEOUT* = ptr ACCESSTIMEOUT + ACL* {.final, pure.} = object + AclRevision*: int8 + Sbz1*: int8 + AclSize*: int16 + AceCount*: int16 + Sbz2*: int16 + + PACL* = ptr ACL + TACL* = ACL + TACL_REVISION_INFORMATION* {.final, pure.} = object + AclRevision*: DWORD + PACLREVISIONINFORMATION* = ptr TACL_REVISION_INFORMATION + + TACL_SIZE_INFORMATION* {.final, pure.} = object + AceCount*: DWORD + AclBytesInUse*: DWORD + AclBytesFree*: DWORD + PACLSIZEINFORMATION* = ptr TACL_SIZE_INFORMATION + ACTION_HEADER* {.final, pure.} = object + transport_id*: ULONG + action_code*: USHORT + reserved*: USHORT + + TACTIONHEADER* = ACTION_HEADER + PACTIONHEADER* = ptr ACTION_HEADER + ADAPTER_STATUS* {.final, pure.} = object + adapter_address*: array[0..5, UCHAR] + rev_major*: UCHAR + reserved0*: UCHAR + adapter_type*: UCHAR + rev_minor*: UCHAR + duration*: int16 + frmr_recv*: int16 + frmr_xmit*: int16 + iframe_recv_err*: int16 + xmit_aborts*: int16 + xmit_success*: DWORD + recv_success*: DWORD + iframe_xmit_err*: int16 + recv_buff_unavail*: int16 + t1_timeouts*: int16 + ti_timeouts*: int16 + reserved1*: DWORD + free_ncbs*: int16 + max_cfg_ncbs*: int16 + max_ncbs*: int16 + xmit_buf_unavail*: int16 + max_dgram_size*: int16 + pending_sess*: int16 + max_cfg_sess*: int16 + max_sess*: int16 + max_sess_pkt_size*: int16 + name_count*: int16 + + TADAPTERSTATUS* = ADAPTER_STATUS + PADAPTERSTATUS* = ptr ADAPTER_STATUS + ADDJOB_INFO_1* {.final, pure.} = object + Path*: LPTSTR + JobId*: DWORD + + TADDJOB_INFO_1* = ADDJOB_INFO_1 + PADDJOB_INFO_1* = ptr ADDJOB_INFO_1 + ANIMATIONINFO* {.final, pure.} = object + cbSize*: UINT + iMinAnimate*: int32 + + LPANIMATIONINFO* = ptr ANIMATIONINFO + TANIMATIONINFO* = ANIMATIONINFO + PANIMATIONINFO* = ptr ANIMATIONINFO + + APPBARDATA* {.final, pure.} = object + cbSize*: DWORD + hWnd*: HWND + uCallbackMessage*: UINT + uEdge*: UINT + rc*: RECT + lParam*: LPARAM + + TAppBarData* = APPBARDATA + PAppBarData* = ptr APPBARDATA + BITMAP* {.final, pure.} = object + bmType*: LONG + bmWidth*: LONG + bmHeight*: LONG + bmWidthBytes*: LONG + bmPlanes*: int16 + bmBitsPixel*: int16 + bmBits*: LPVOID + + PBITMAP* = ptr BITMAP + NPBITMAP* = ptr BITMAP + LPBITMAP* = ptr BITMAP + TBITMAP* = BITMAP + BITMAPCOREHEADER* {.final, pure.} = object + bcSize*: DWORD + bcWidth*: int16 + bcHeight*: int16 + bcPlanes*: int16 + bcBitCount*: int16 + + TBITMAPCOREHEADER* = BITMAPCOREHEADER + PBITMAPCOREHEADER* = ptr BITMAPCOREHEADER + RGBTRIPLE* {.final, pure.} = object + rgbtBlue*: int8 + rgbtGreen*: int8 + rgbtRed*: int8 + + TRGBTRIPLE* = RGBTRIPLE + PRGBTRIPLE* = ptr RGBTRIPLE + BITMAPCOREINFO* {.final, pure.} = object + bmciHeader*: BITMAPCOREHEADER + bmciColors*: array[0..0, RGBTRIPLE] + + PBITMAPCOREINFO* = ptr BITMAPCOREINFO + LPBITMAPCOREINFO* = ptr BITMAPCOREINFO + TBITMAPCOREINFO* = BITMAPCOREINFO # error + # WORD bfReserved1; + # WORD bfReserved2; + # in declarator_list + BITMAPINFOHEADER* {.final, pure.} = object + biSize*: DWORD + biWidth*: LONG + biHeight*: LONG + biPlanes*: int16 + biBitCount*: int16 + biCompression*: DWORD + biSizeImage*: DWORD + biXPelsPerMeter*: LONG + biYPelsPerMeter*: LONG + biClrUsed*: DWORD + biClrImportant*: DWORD + + LPBITMAPINFOHEADER* = ptr BITMAPINFOHEADER + TBITMAPINFOHEADER* = BITMAPINFOHEADER + PBITMAPINFOHEADER* = ptr BITMAPINFOHEADER + RGBQUAD* {.final, pure.} = object + rgbBlue*: int8 + rgbGreen*: int8 + rgbRed*: int8 + rgbReserved*: int8 + + TRGBQUAD* = RGBQUAD + PRGBQUAD* = ptr RGBQUAD + BITMAPINFO* {.final, pure.} = object + 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* {.final, pure.} = object + ciexyzX*: FXPT2DOT30 + ciexyzY*: FXPT2DOT30 + ciexyzZ*: FXPT2DOT30 + + LPCIEXYZ* = ptr CIEXYZ + TPCIEXYZ* = CIEXYZ + PCIEXYZ* = ptr CIEXYZ + CIEXYZTRIPLE* {.final, pure.} = object + ciexyzRed*: CIEXYZ + ciexyzGreen*: CIEXYZ + ciexyzBlue*: CIEXYZ + + LPCIEXYZTRIPLE* = ptr CIEXYZTRIPLE + TCIEXYZTRIPLE* = CIEXYZTRIPLE + PCIEXYZTRIPLE* = ptr CIEXYZTRIPLE + BITMAPV4HEADER* {.final, pure.} = object + bV4Size*: DWORD + bV4Width*: LONG + bV4Height*: LONG + bV4Planes*: int16 + bV4BitCount*: int16 + bV4V4Compression*: DWORD + bV4SizeImage*: DWORD + bV4XPelsPerMeter*: LONG + bV4YPelsPerMeter*: LONG + bV4ClrUsed*: DWORD + bV4ClrImportant*: DWORD + bV4RedMask*: DWORD + bV4GreenMask*: DWORD + bV4BlueMask*: DWORD + bV4AlphaMask*: DWORD + bV4CSType*: DWORD + bV4Endpoints*: CIEXYZTRIPLE + bV4GammaRed*: DWORD + bV4GammaGreen*: DWORD + bV4GammaBlue*: DWORD + + LPBITMAPV4HEADER* = ptr BITMAPV4HEADER + TBITMAPV4HEADER* = BITMAPV4HEADER + PBITMAPV4HEADER* = ptr BITMAPV4HEADER + BITMAPFILEHEADER* {.final, pure.} = object + bfType*: int16 + bfSize*: DWord + bfReserved1*: int16 + bfReserved2*: int16 + bfOffBits*: DWord + + BLOB* {.final, pure.} = object + cbSize*: ULONG + pBlobData*: ptr int8 + + TBLOB* = BLOB + PBLOB* = ptr BLOB + SHITEMID* {.final, pure.} = object + cb*: USHORT + abID*: array[0..0, int8] + + LPSHITEMID* = ptr SHITEMID + LPCSHITEMID* = ptr SHITEMID + TSHITEMID* = SHITEMID + PSHITEMID* = ptr SHITEMID + ITEMIDLIST* {.final, pure.} = object + mkid*: SHITEMID + + LPITEMIDLIST* = ptr ITEMIDLIST + LPCITEMIDLIST* = ptr ITEMIDLIST + TITEMIDLIST* = ITEMIDLIST + PITEMIDLIST* = ptr ITEMIDLIST + BROWSEINFO* {.final, pure.} = object + hwndOwner*: HWND + pidlRoot*: LPCITEMIDLIST + pszDisplayName*: LPSTR + lpszTitle*: LPCSTR + ulFlags*: UINT + lpfn*: BFFCALLBACK + lParam*: LPARAM + iImage*: int32 + + LPBROWSEINFO* = ptr BROWSEINFO + Tbrowseinfo* = BROWSEINFO + PBROWSEINFO* = ptr BROWSEINFO + + BY_HANDLE_FILE_INFORMATION* {.final, pure.} = object + dwFileAttributes*: DWORD + ftCreationTime*: FILETIME + ftLastAccessTime*: FILETIME + ftLastWriteTime*: FILETIME + dwVolumeSerialNumber*: DWORD + nFileSizeHigh*: DWORD + nFileSizeLow*: DWORD + nNumberOfLinks*: DWORD + nFileIndexHigh*: DWORD + nFileIndexLow*: DWORD + + LPBY_HANDLE_FILE_INFORMATION* = ptr BY_HANDLE_FILE_INFORMATION + TBYHANDLEFILEINFORMATION* = BY_HANDLE_FILE_INFORMATION + PBYHANDLEFILEINFORMATION* = ptr BY_HANDLE_FILE_INFORMATION + FIXED* {.final, pure.} = object + fract*: int16 + value*: SHORT + + TFIXED* = FIXED + PFIXED* = ptr FIXED + POINTFX* {.final, pure.} = object + x*: FIXED + y*: FIXED + + TPOINTFX* = POINTFX + PPOINTFX* = ptr POINTFX + + TSmallPoint* {.final, pure.} = object + X*, Y*: SHORT + + CANDIDATEFORM* {.final, pure.} = object + dwIndex*: DWORD + dwStyle*: DWORD + ptCurrentPos*: POINT + rcArea*: RECT + + LPCANDIDATEFORM* = ptr CANDIDATEFORM + TCANDIDATEFORM* = CANDIDATEFORM + PCANDIDATEFORM* = ptr CANDIDATEFORM + CANDIDATELIST* {.final, pure.} = object + dwSize*: DWORD + dwStyle*: DWORD + dwCount*: DWORD + dwSelection*: DWORD + dwPageStart*: DWORD + dwPageSize*: DWORD + dwOffset*: array[0..0, DWORD] + + LPCANDIDATELIST* = ptr CANDIDATELIST + TCANDIDATELIST* = CANDIDATELIST + PCANDIDATELIST* = ptr CANDIDATELIST + CREATESTRUCT* {.final, pure.} = object + lpCreateParams*: LPVOID + hInstance*: HINST + hMenu*: HMENU + hwndParent*: HWND + cy*: int32 + cx*: int32 + y*: int32 + x*: int32 + style*: LONG + lpszName*: LPCTSTR + lpszClass*: LPCTSTR + dwExStyle*: DWORD + + LPCREATESTRUCT* = ptr CREATESTRUCT + TCREATESTRUCT* = CREATESTRUCT + PCREATESTRUCT* = ptr CREATESTRUCT + CBT_CREATEWND* {.final, pure.} = object + lpcs*: LPCREATESTRUCT + hwndInsertAfter*: HWND + + TCBT_CREATEWND* = CBT_CREATEWND + PCBT_CREATEWND* = ptr CBT_CREATEWND + CBTACTIVATESTRUCT* {.final, pure.} = object + fMouse*: WINBOOL + hWndActive*: HWND + + TCBTACTIVATESTRUCT* = CBTACTIVATESTRUCT + PCBTACTIVATESTRUCT* = ptr CBTACTIVATESTRUCT + CHAR_INFO* {.final, pure.} = object + UnicodeChar*: WCHAR + Attributes*: int16 # other union part: AsciiChar : CHAR + + TCHAR_INFO* = CHAR_INFO + PCHAR_INFO* = ptr CHAR_INFO + CHARFORMAT* {.final, pure.} = object + 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* {.final, pure.} = object + cpMin*: LONG + cpMax*: LONG + + Tcharrange* = CHARRANGE + Pcharrange* = ptr CHARRANGE + CHARSET* {.final, pure.} = object + aflBlock*: array[0..2, DWORD] + flLang*: DWORD + + TCHARSET* = CHARSET + PCHARSET* = ptr CHARSET + FONTSIGNATURE* {.final, pure.} = object + fsUsb*: array[0..3, DWORD] + fsCsb*: array[0..1, DWORD] + + LPFONTSIGNATURE* = ptr FONTSIGNATURE + TFONTSIGNATURE* = FONTSIGNATURE + PFONTSIGNATURE* = ptr FONTSIGNATURE + CHARSETINFO* {.final, pure.} = object + ciCharset*: UINT + ciACP*: UINT + fs*: FONTSIGNATURE + + LPCHARSETINFO* = ptr CHARSETINFO + TCHARSETINFO* = CHARSETINFO + PCHARSETINFO* = ptr CHARSETINFO + #CHOOSECOLOR = record confilcts with function ChooseColor + TCHOOSECOLOR* {.final, pure.} = object + lStructSize*: DWORD + hwndOwner*: HWND + hInstance*: HWND + rgbResult*: COLORREF + lpCustColors*: ptr COLORREF + Flags*: DWORD + lCustData*: LPARAM + lpfnHook*: LPCCHOOKPROC + lpTemplateName*: LPCTSTR + + LPCHOOSECOLOR* = ptr TCHOOSECOLOR + PCHOOSECOLOR* = ptr TCHOOSECOLOR + LOGFONT* {.final, pure.} = object + lfHeight*: LONG + lfWidth*: LONG + lfEscapement*: LONG + lfOrientation*: LONG + lfWeight*: LONG + lfItalic*: int8 + lfUnderline*: int8 + lfStrikeOut*: int8 + lfCharSet*: int8 + lfOutPrecision*: int8 + lfClipPrecision*: int8 + lfQuality*: int8 + lfPitchAndFamily*: int8 + lfFaceName*: array[0..(LF_FACESIZE) - 1, TCHAR] + + LPLOGFONT* = ptr LOGFONT + TLOGFONT* = LOGFONT + TLOGFONTA* = LOGFONT + PLOGFONT* = ptr LOGFONT + PLOGFONTA* = PLOGFONT + LOGFONTW* {.final, pure.} = object + lfHeight*: LONG + lfWidth*: LONG + lfEscapement*: LONG + lfOrientation*: LONG + lfWeight*: LONG + lfItalic*: int8 + lfUnderline*: int8 + lfStrikeOut*: int8 + lfCharSet*: int8 + lfOutPrecision*: int8 + lfClipPrecision*: int8 + lfQuality*: int8 + lfPitchAndFamily*: int8 + lfFaceName*: array[0..LF_FACESIZE - 1, WCHAR] + + LPLOGFONTW* = ptr LOGFONTW + NPLOGFONTW* = ptr LOGFONTW + TLogFontW* = LOGFONTW + PLogFontW* = ptr TLogFontW + TCHOOSEFONT* {.final, pure.} = object + lStructSize*: DWORD + hwndOwner*: HWND + hDC*: HDC + lpLogFont*: LPLOGFONT + iPointSize*: WINT + Flags*: DWORD + rgbColors*: DWORD + lCustData*: LPARAM + lpfnHook*: LPCFHOOKPROC + lpTemplateName*: LPCTSTR + hInstance*: HINST + lpszStyle*: LPTSTR + nFontType*: int16 + MISSING_ALIGNMENT*: int16 + nSizeMin*: WINT + nSizeMax*: WINT + + LPCHOOSEFONT* = ptr TCHOOSEFONT + PCHOOSEFONT* = ptr TCHOOSEFONT + CIDA* {.final, pure.} = object + cidl*: UINT + aoffset*: array[0..0, UINT] + + LPIDA* = ptr CIDA + TIDA* = CIDA + PIDA* = ptr CIDA + CLIENTCREATESTRUCT* {.final, pure.} = object + hWindowMenu*: HANDLE + idFirstChild*: UINT + + LPCLIENTCREATESTRUCT* = ptr CLIENTCREATESTRUCT + TCLIENTCREATESTRUCT* = CLIENTCREATESTRUCT + PCLIENTCREATESTRUCT* = ptr CLIENTCREATESTRUCT + CMINVOKECOMMANDINFO* {.final, pure.} = object + cbSize*: DWORD + fMask*: DWORD + hwnd*: HWND + lpVerb*: LPCSTR + lpParameters*: LPCSTR + lpDirectory*: LPCSTR + nShow*: int32 + dwHotKey*: DWORD + hIcon*: HANDLE + + LPCMINVOKECOMMANDINFO* = ptr CMINVOKECOMMANDINFO + TCMInvokeCommandInfo* = CMINVOKECOMMANDINFO + PCMInvokeCommandInfo* = ptr CMINVOKECOMMANDINFO + COLORADJUSTMENT* {.final, pure.} = object + caSize*: int16 + caFlags*: int16 + caIlluminantIndex*: int16 + caRedGamma*: int16 + caGreenGamma*: int16 + caBlueGamma*: int16 + caReferenceBlack*: int16 + caReferenceWhite*: int16 + caContrast*: SHORT + caBrightness*: SHORT + caColorfulness*: SHORT + caRedGreenTint*: SHORT + + LPCOLORADJUSTMENT* = ptr COLORADJUSTMENT + TCOLORADJUSTMENT* = COLORADJUSTMENT + PCOLORADJUSTMENT* = ptr COLORADJUSTMENT + COLORMAP* {.final, pure.} = object + `from`*: COLORREF + `to`*: COLORREF # XXX! + + LPCOLORMAP* = ptr COLORMAP + TCOLORMAP* = COLORMAP + PCOLORMAP* = ptr COLORMAP + DCB* {.final, pure.} = object + DCBlength*: DWORD + BaudRate*: DWORD + flags*: DWORD + wReserved*: int16 + XonLim*: int16 + XoffLim*: int16 + ByteSize*: int8 + Parity*: int8 + StopBits*: int8 + XonChar*: char + XoffChar*: char + ErrorChar*: char + EofChar*: char + EvtChar*: char + wReserved1*: int16 + + LPDCB* = ptr DCB + TDCB* = DCB + PDCB* = ptr DCB + +const + bm_DCB_fBinary* = 1 + bp_DCB_fBinary* = 0'i32 + bm_DCB_fParity* = 0x00000002 + bp_DCB_fParity* = 1'i32 + bm_DCB_fOutxCtsFlow* = 0x00000004 + bp_DCB_fOutxCtsFlow* = 2'i32 + bm_DCB_fOutxDsrFlow* = 0x00000008 + bp_DCB_fOutxDsrFlow* = 3'i32 + bm_DCB_fDtrControl* = 0x00000030 + bp_DCB_fDtrControl* = 4'i32 + bm_DCB_fDsrSensitivity* = 0x00000040 + bp_DCB_fDsrSensitivity* = 6'i32 + bm_DCB_fTXContinueOnXoff* = 0x00000080 + bp_DCB_fTXContinueOnXoff* = 7'i32 + bm_DCB_fOutX* = 0x00000100 + bp_DCB_fOutX* = 8'i32 + bm_DCB_fInX* = 0x00000200 + bp_DCB_fInX* = 9'i32 + bm_DCB_fErrorChar* = 0x00000400 + bp_DCB_fErrorChar* = 10'i32 + bm_DCB_fNull* = 0x00000800 + bp_DCB_fNull* = 11'i32 + bm_DCB_fRtsControl* = 0x00003000 + bp_DCB_fRtsControl* = 12'i32 + bm_DCB_fAbortOnError* = 0x00004000 + bp_DCB_fAbortOnError* = 14'i32 + bm_DCB_fDummy2* = 0xFFFF8000'i32 + bp_DCB_fDummy2* = 15'i32 + +proc fBinary*(a: var DCB): DWORD +proc set_fBinary*(a: var DCB, fBinary: DWORD) +proc fParity*(a: var DCB): DWORD +proc set_fParity*(a: var DCB, fParity: DWORD) +proc fOutxCtsFlow*(a: var DCB): DWORD +proc set_fOutxCtsFlow*(a: var DCB, fOutxCtsFlow: DWORD) +proc fOutxDsrFlow*(a: var DCB): DWORD +proc set_fOutxDsrFlow*(a: var DCB, fOutxDsrFlow: DWORD) +proc fDtrControl*(a: var DCB): DWORD +proc set_fDtrControl*(a: var DCB, fDtrControl: DWORD) +proc fDsrSensitivity*(a: var DCB): DWORD +proc set_fDsrSensitivity*(a: var DCB, fDsrSensitivity: DWORD) +proc fTXContinueOnXoff*(a: var DCB): DWORD +proc set_fTXContinueOnXoff*(a: var DCB, fTXContinueOnXoff: DWORD) +proc fOutX*(a: var DCB): DWORD +proc set_fOutX*(a: var DCB, fOutX: DWORD) +proc fInX*(a: var DCB): DWORD +proc set_fInX*(a: var DCB, fInX: DWORD) +proc fErrorChar*(a: var DCB): DWORD +proc set_fErrorChar*(a: var DCB, fErrorChar: DWORD) +proc fNull*(a: var DCB): DWORD +proc set_fNull*(a: var DCB, fNull: DWORD) +proc fRtsControl*(a: var DCB): DWORD +proc set_fRtsControl*(a: var DCB, fRtsControl: DWORD) +proc fAbortOnError*(a: var DCB): DWORD +proc set_fAbortOnError*(a: var DCB, fAbortOnError: DWORD) +proc fDummy2*(a: var DCB): DWORD +proc set_fDummy2*(a: var DCB, fDummy2: DWORD) +type + COMMCONFIG* {.final, pure.} = object + dwSize*: DWORD + wVersion*: int16 + wReserved*: int16 + dcb*: DCB + dwProviderSubType*: DWORD + dwProviderOffset*: DWORD + dwProviderSize*: DWORD + wcProviderData*: array[0..0, WCHAR] + + LPCOMMCONFIG* = ptr COMMCONFIG + TCOMMCONFIG* = COMMCONFIG + PCOMMCONFIG* = ptr COMMCONFIG + COMMPROP* {.final, pure.} = object + wPacketLength*: int16 + wPacketVersion*: int16 + dwServiceMask*: DWORD + dwReserved1*: DWORD + dwMaxTxQueue*: DWORD + dwMaxRxQueue*: DWORD + dwMaxBaud*: DWORD + dwProvSubType*: DWORD + dwProvCapabilities*: DWORD + dwSettableParams*: DWORD + dwSettableBaud*: DWORD + wSettableData*: int16 + wSettableStopParity*: int16 + dwCurrentTxQueue*: DWORD + dwCurrentRxQueue*: DWORD + dwProvSpec1*: DWORD + dwProvSpec2*: DWORD + wcProvChar*: array[0..0, WCHAR] + + LPCOMMPROP* = ptr COMMPROP + TCOMMPROP* = COMMPROP + PCOMMPROP* = ptr COMMPROP + COMMTIMEOUTS* {.final, pure.} = object + ReadIntervalTimeout*: DWORD + ReadTotalTimeoutMultiplier*: DWORD + ReadTotalTimeoutConstant*: DWORD + WriteTotalTimeoutMultiplier*: DWORD + WriteTotalTimeoutConstant*: DWORD + + LPCOMMTIMEOUTS* = ptr COMMTIMEOUTS + TCOMMTIMEOUTS* = COMMTIMEOUTS + PCOMMTIMEOUTS* = ptr COMMTIMEOUTS + COMPAREITEMSTRUCT* {.final, pure.} = object + CtlType*: UINT + CtlID*: UINT + hwndItem*: HWND + itemID1*: UINT + itemData1*: ULONG_PTR + itemID2*: UINT + itemData2*: ULONG_PTR + + TCOMPAREITEMSTRUCT* = COMPAREITEMSTRUCT + PCOMPAREITEMSTRUCT* = ptr COMPAREITEMSTRUCT + COMPCOLOR* {.final, pure.} = object + crText*: COLORREF + crBackground*: COLORREF + dwEffects*: DWORD + + TCOMPCOLOR* = COMPCOLOR + PCOMPCOLOR* = ptr COMPCOLOR + COMPOSITIONFORM* {.final, pure.} = object + 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* {.final, pure.} = object + 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'i32 + bm_COMSTAT_fDsrHold* = 0x00000002 + bp_COMSTAT_fDsrHold* = 1'i32 + bm_COMSTAT_fRlsdHold* = 0x00000004 + bp_COMSTAT_fRlsdHold* = 2'i32 + bm_COMSTAT_fXoffHold* = 0x00000008 + bp_COMSTAT_fXoffHold* = 3'i32 + bm_COMSTAT_fXoffSent* = 0x00000010 + bp_COMSTAT_fXoffSent* = 4'i32 + bm_COMSTAT_fEof* = 0x00000020 + bp_COMSTAT_fEof* = 5'i32 + bm_COMSTAT_fTxim* = 0x00000040 + bp_COMSTAT_fTxim* = 6'i32 + bm_COMSTAT_fReserved* = 0xFFFFFF80'i32 + bp_COMSTAT_fReserved* = 7'i32 + +proc fCtsHold*(a: var COMSTAT): DWORD + # should be renamed to get_? +proc set_fCtsHold*(a: var COMSTAT, fCtsHold: DWORD) +proc fDsrHold*(a: var COMSTAT): DWORD +proc set_fDsrHold*(a: var COMSTAT, fDsrHold: DWORD) +proc fRlsdHold*(a: var COMSTAT): DWORD +proc set_fRlsdHold*(a: var COMSTAT, fRlsdHold: DWORD) +proc fXoffHold*(a: var COMSTAT): DWORD +proc set_fXoffHold*(a: var COMSTAT, fXoffHold: DWORD) +proc fXoffSent*(a: var COMSTAT): DWORD +proc set_fXoffSent*(a: var COMSTAT, fXoffSent: DWORD) +proc fEof*(a: var COMSTAT): DWORD +proc set_fEof*(a: var COMSTAT, fEof: DWORD) +proc fTxim*(a: var COMSTAT): DWORD +proc set_fTxim*(a: var COMSTAT, fTxim: DWORD) +proc fReserved*(a: var COMSTAT): DWORD +proc set_fReserved*(a: var COMSTAT, fReserved: DWORD) +type + CONSOLE_CURSOR_INFO* {.final, pure.} = object + dwSize*: DWORD + bVisible*: WINBOOL + + PCONSOLE_CURSOR_INFO* = ptr CONSOLE_CURSOR_INFO + TCONSOLECURSORINFO* = CONSOLE_CURSOR_INFO + TCURSORINFO* = CONSOLE_CURSOR_INFO + COORD* {.final, pure.} = object + X*: SHORT + Y*: SHORT + + TCOORD* = COORD + PCOORD* = ptr COORD + SMALL_RECT* {.final, pure.} = object + Left*: SHORT + Top*: SHORT + Right*: SHORT + Bottom*: SHORT + + TSMALL_RECT* = SMALL_RECT + PSMALL_RECT* = ptr SMALL_RECT + CONSOLE_SCREEN_BUFFER_INFO* {.final, pure.} = object + dwSize*: COORD + dwCursorPosition*: COORD + wAttributes*: int16 + srWindow*: SMALL_RECT + dwMaximumWindowSize*: COORD + + PCONSOLE_SCREEN_BUFFER_INFO* = ptr CONSOLE_SCREEN_BUFFER_INFO + TCONSOLESCREENBUFFERINFO* = CONSOLE_SCREEN_BUFFER_INFO + +when defined(i386): + type + FLOATING_SAVE_AREA* {.final, pure.} = object + ControlWord*: DWORD + StatusWord*: DWORD + TagWord*: DWORD + ErrorOffset*: DWORD + ErrorSelector*: DWORD + DataOffset*: DWORD + DataSelector*: DWORD + RegisterArea*: array[0..79, int8] + Cr0NpxState*: DWORD + + TFLOATINGSAVEAREA* = FLOATING_SAVE_AREA + PFLOATINGSAVEAREA* = ptr FLOATING_SAVE_AREA + CONTEXT* {.final, pure.} = object + ContextFlags*: DWORD + Dr0*: DWORD + Dr1*: DWORD + Dr2*: DWORD + Dr3*: DWORD + Dr6*: DWORD + Dr7*: DWORD + FloatSave*: FLOATING_SAVE_AREA + SegGs*: DWORD + SegFs*: DWORD + SegEs*: DWORD + SegDs*: DWORD + Edi*: DWORD + Esi*: DWORD + Ebx*: DWORD + Edx*: DWORD + Ecx*: DWORD + Eax*: DWORD + Ebp*: DWORD + Eip*: DWORD + SegCs*: DWORD + EFlags*: DWORD + Esp*: DWORD + SegSs*: DWORD + +elif defined(x86_64): + # + # Define 128-bit 16-byte aligned xmm register type. + # + type + M128A* {.final, pure.} = object + Low*: ULONGLONG + High*: LONGLONG + + TM128A* = M128A + PM128A* = TM128A #typedef struct _XMM_SAVE_AREA32 { + XMM_SAVE_AREA32* {.final, pure.} = object + ControlWord*: int16 + StatusWord*: int16 + TagWord*: int8 + Reserved1*: int8 + ErrorOpcode*: int16 + ErrorOffset*: DWORD + ErrorSelector*: int16 + Reserved2*: int16 + DataOffset*: DWORD + DataSelector*: int16 + Reserved3*: int16 + MxCsr*: DWORD + MxCsr_Mask*: DWORD + FloatRegisters*: array[0..7, M128A] + XmmRegisters*: array[0..16, M128A] + Reserved4*: array[0..95, int8] + + TXmmSaveArea* = XMM_SAVE_AREA32 + PXmmSaveArea* = ptr TXmmSaveArea + type + CONTEXT* {.final, pure.} = object + P1Home*: DWORD64 + P2Home*: DWORD64 + P3Home*: DWORD64 + P4Home*: DWORD64 + P5Home*: DWORD64 + P6Home*: DWORD64 # + # Control flags. + # + ContextFlags*: DWORD + MxCsr*: DWORD # + # Segment Registers and processor flags. + # + SegCs*: int16 + SegDs*: int16 + SegEs*: int16 + SegFs*: int16 + SegGs*: int16 + SegSs*: int16 + EFlags*: DWORD # + # Debug registers + # + Dr0*: DWORD64 + Dr1*: DWORD64 + Dr2*: DWORD64 + Dr3*: DWORD64 + Dr6*: DWORD64 + Dr7*: DWORD64 # + # Integer registers. + # + Rax*: DWORD64 + Rcx*: DWORD64 + Rdx*: DWORD64 + Rbx*: DWORD64 + Rsp*: DWORD64 + Rbp*: DWORD64 + Rsi*: DWORD64 + Rdi*: DWORD64 + R8*: DWORD64 + R9*: DWORD64 + R10*: DWORD64 + R11*: DWORD64 + R12*: DWORD64 + R13*: DWORD64 + R14*: DWORD64 + R15*: DWORD64 # + # Program counter. + # + Rip*: DWORD64 # + # Floating point state. + # + FltSave*: XMM_SAVE_AREA32 # MWE: only translated the FltSave part of the union + # + # Vector registers. + # + VectorRegister*: array[0..25, M128A] + VectorControl*: DWORD64 # + # Special debug control registers. + # + DebugControl*: DWORD64 + LastBranchToRip*: DWORD64 + LastBranchFromRip*: DWORD64 + LastExceptionToRip*: DWORD64 + LastExceptionFromRip*: DWORD64 + +elif 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* {.final, pure.} = object + Fpr0*: float64 + Fpr1*: float64 + Fpr2*: float64 + Fpr3*: float64 + Fpr4*: float64 + Fpr5*: float64 + Fpr6*: float64 + Fpr7*: float64 + Fpr8*: float64 + Fpr9*: float64 + Fpr10*: float64 + Fpr11*: float64 + Fpr12*: float64 + Fpr13*: float64 + Fpr14*: float64 + Fpr15*: float64 + Fpr16*: float64 + Fpr17*: float64 + Fpr18*: float64 + Fpr19*: float64 + Fpr20*: float64 + Fpr21*: float64 + Fpr22*: float64 + Fpr23*: float64 + Fpr24*: float64 + Fpr25*: float64 + Fpr26*: float64 + Fpr27*: float64 + Fpr28*: float64 + Fpr29*: float64 + Fpr30*: float64 + Fpr31*: float64 + Fpscr*: float64 + Gpr0*: DWORD + Gpr1*: DWORD + Gpr2*: DWORD + Gpr3*: DWORD + Gpr4*: DWORD + Gpr5*: DWORD + Gpr6*: DWORD + Gpr7*: DWORD + Gpr8*: DWORD + Gpr9*: DWORD + Gpr10*: DWORD + Gpr11*: DWORD + Gpr12*: DWORD + Gpr13*: DWORD + Gpr14*: DWORD + Gpr15*: DWORD + Gpr16*: DWORD + Gpr17*: DWORD + Gpr18*: DWORD + Gpr19*: DWORD + Gpr20*: DWORD + Gpr21*: DWORD + Gpr22*: DWORD + Gpr23*: DWORD + Gpr24*: DWORD + Gpr25*: DWORD + Gpr26*: DWORD + Gpr27*: DWORD + Gpr28*: DWORD + Gpr29*: DWORD + Gpr30*: DWORD + Gpr31*: DWORD + Cr*: DWORD + Xer*: DWORD + Msr*: DWORD + Iar*: DWORD + Lr*: DWORD + Ctr*: DWORD + ContextFlags*: DWORD + Fill*: array[0..2, DWORD] + Dr0*: DWORD + Dr1*: DWORD + Dr2*: DWORD + Dr3*: DWORD + Dr4*: DWORD + Dr5*: DWORD + Dr6*: DWORD + Dr7*: DWORD + +else: + # dummy CONTEXT so that it compiles: + type + CONTEXT* {.final, pure.} = object + data: array [0..255, float64] + +type + LPCONTEXT* = ptr CONTEXT + TCONTEXT* = CONTEXT + PCONTEXT* = ptr CONTEXT + +type + LIST_ENTRY* {.final, pure.} = object + Flink*: ptr LIST_ENTRY + Blink*: ptr LIST_ENTRY + + TLISTENTRY* = LIST_ENTRY + PLISTENTRY* = ptr LIST_ENTRY + CRITICAL_SECTION_DEBUG* {.final, pure.} = object + `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* {.final, pure.} = object + DebugInfo*: ptr CRITICAL_SECTION_DEBUG + LockCount*: int32 + RecursionCount*: int32 + OwningThread*: Handle + LockSemaphore*: Handle + Reserved*: DWORD + + PRTLCriticalSection* = ptr TRTLCriticalSection + + LPCRITICAL_SECTION_DEBUG* = ptr CRITICAL_SECTION_DEBUG + PCRITICAL_SECTION_DEBUG* = ptr CRITICAL_SECTION_DEBUG + TCRITICALSECTIONDEBUG* = CRITICAL_SECTION_DEBUG + TCRITICAL_SECTION* = TRTLCriticalSection + PCRITICAL_SECTION* = PRTLCriticalSection + LPCRITICAL_SECTION* = PRTLCriticalSection + SECURITY_QUALITY_OF_SERVICE* {.final, pure.} = object + len*: DWORD + ImpersonationLevel*: SECURITY_IMPERSONATION_LEVEL + ContextTrackingMode*: WINBOOL + EffectiveOnly*: bool + + PSECURITY_QUALITY_OF_SERVICE* = ptr SECURITY_QUALITY_OF_SERVICE + TSECURITYQUALITYOFSERVICE* = SECURITY_QUALITY_OF_SERVICE + CONVCONTEXT* {.final, pure.} = object + cb*: UINT + wFlags*: UINT + wCountryID*: UINT + iCodePage*: int32 + dwLangID*: DWORD + dwSecurity*: DWORD + qos*: SECURITY_QUALITY_OF_SERVICE + + TCONVCONTEXT* = CONVCONTEXT + PCONVCONTEXT* = ptr CONVCONTEXT + CONVINFO* {.final, pure.} = object + 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 + + TCONVINFO* = CONVINFO + PCONVINFO* = ptr CONVINFO + COPYDATASTRUCT* {.final, pure.} = object + dwData*: DWORD + cbData*: DWORD + lpData*: PVOID + + TCOPYDATASTRUCT* = COPYDATASTRUCT + PCOPYDATASTRUCT* = ptr COPYDATASTRUCT + CPINFO* {.final, pure.} = object + 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* {.final, pure.} = object + idIcon*: int32 + idName*: int32 + idInfo*: int32 + lData*: LONG + + TCPLINFO* = CPLINFO + PCPLINFO* = ptr CPLINFO + CREATE_PROCESS_DEBUG_INFO* {.final, pure.} = object + hFile*: HANDLE + hProcess*: HANDLE + hThread*: HANDLE + lpBaseOfImage*: LPVOID + dwDebugInfoFileOffset*: DWORD + nDebugInfoSize*: DWORD + lpThreadLocalBase*: LPVOID + lpStartAddress*: LPTHREAD_START_ROUTINE + lpImageName*: LPVOID + fUnicode*: int16 + + TCREATEPROCESSDEBUGINFO* = CREATE_PROCESS_DEBUG_INFO + PCREATEPROCESSDEBUGINFO* = ptr CREATE_PROCESS_DEBUG_INFO + CREATE_THREAD_DEBUG_INFO* {.final, pure.} = object + hThread*: HANDLE + lpThreadLocalBase*: LPVOID + lpStartAddress*: LPTHREAD_START_ROUTINE + + TCREATETHREADDEBUGINFO* = CREATE_THREAD_DEBUG_INFO + PCREATETHREADDEBUGINFO* = ptr CREATE_THREAD_DEBUG_INFO + + CURRENCYFMT* {.final, pure.} = object + NumDigits*: UINT + LeadingZero*: UINT + Grouping*: UINT + lpDecimalSep*: LPTSTR + lpThousandSep*: LPTSTR + NegativeOrder*: UINT + PositiveOrder*: UINT + lpCurrencySymbol*: LPTSTR + + Tcurrencyfmt* = CURRENCYFMT + Pcurrencyfmt* = ptr CURRENCYFMT + CURSORSHAPE* {.final, pure.} = object + xHotSpot*: int32 + yHotSpot*: int32 + cx*: int32 + cy*: int32 + cbWidth*: int32 + Planes*: int8 + BitsPixel*: int8 + + LPCURSORSHAPE* = ptr CURSORSHAPE + TCURSORSHAPE* = CURSORSHAPE + PCURSORSHAPE* = ptr CURSORSHAPE + CWPRETSTRUCT* {.final, pure.} = object + lResult*: LRESULT + lParam*: LPARAM + wParam*: WPARAM + message*: DWORD + hwnd*: HWND + + TCWPRETSTRUCT* = CWPRETSTRUCT + PCWPRETSTRUCT* = ptr CWPRETSTRUCT + CWPSTRUCT* {.final, pure.} = object + lParam*: LPARAM + wParam*: WPARAM + message*: UINT + hwnd*: HWND + + TCWPSTRUCT* = CWPSTRUCT + PCWPSTRUCT* = ptr CWPSTRUCT + DATATYPES_INFO_1* {.final, pure.} = object + pName*: LPTSTR + + TDATATYPESINFO1* = DATATYPES_INFO_1 + PDATATYPESINFO1* = ptr DATATYPES_INFO_1 + DDEACK* {.final, pure.} = object + flag0*: int16 + + TDDEACK* = DDEACK + PDDEACK* = ptr DDEACK + +const + bm_DDEACK_bAppReturnCode* = 0x000000FF'i16 + bp_DDEACK_bAppReturnCode* = 0'i16 + bm_DDEACK_reserved* = 0x00003F00'i16 + bp_DDEACK_reserved* = 8'i16 + bm_DDEACK_fBusy* = 0x00004000'i16 + bp_DDEACK_fBusy* = 14'i16 + bm_DDEACK_fAck* = 0x00008000'i16 + bp_DDEACK_fAck* = 15'i16 + +proc bAppReturnCode*(a: var DDEACK): int16 +proc set_bAppReturnCode*(a: var DDEACK, bAppReturnCode: int16) +proc reserved*(a: var DDEACK): int16 +proc set_reserved*(a: var DDEACK, reserved: int16) +proc fBusy*(a: var DDEACK): int16 +proc set_fBusy*(a: var DDEACK, fBusy: int16) +proc fAck*(a: var DDEACK): int16 +proc set_fAck*(a: var DDEACK, fAck: int16) +type + DDEADVISE* {.final, pure.} = object + flag0*: int16 + cfFormat*: SHORT + + TDDEADVISE* = DDEADVISE + PDDEADVISE* = ptr DDEADVISE + +const + bm_DDEADVISE_reserved* = 0x00003FFF'i16 + bp_DDEADVISE_reserved* = 0'i16 + bm_DDEADVISE_fDeferUpd* = 0x00004000'i16 + bp_DDEADVISE_fDeferUpd* = 14'i16 + bm_DDEADVISE_fAckReq* = 0x00008000'i16 + bp_DDEADVISE_fAckReq* = 15'i16 + +proc reserved*(a: var DDEADVISE): int16 +proc set_reserved*(a: var DDEADVISE, reserved: int16) +proc fDeferUpd*(a: var DDEADVISE): int16 +proc set_fDeferUpd*(a: var DDEADVISE, fDeferUpd: int16) +proc fAckReq*(a: var DDEADVISE): int16 +proc set_fAckReq*(a: var DDEADVISE, fAckReq: int16) +type + DDEDATA* {.final, pure.} = object + flag0*: int16 + cfFormat*: SHORT + Value*: array[0..0, int8] + + PDDEDATA* = ptr DDEDATA + +const + bm_DDEDATA_unused* = 0x00000FFF'i16 + bp_DDEDATA_unused* = 0'i16 + bm_DDEDATA_fResponse* = 0x00001000'i16 + bp_DDEDATA_fResponse* = 12'i16 + bm_DDEDATA_fRelease* = 0x00002000'i16 + bp_DDEDATA_fRelease* = 13'i16 + bm_DDEDATA_reserved* = 0x00004000'i16 + bp_DDEDATA_reserved* = 14'i16 + bm_DDEDATA_fAckReq* = 0x00008000'i16 + bp_DDEDATA_fAckReq* = 15'i16 + +proc unused*(a: var DDEDATA): int16 +proc set_unused*(a: var DDEDATA, unused: int16) +proc fResponse*(a: var DDEDATA): int16 +proc set_fResponse*(a: var DDEDATA, fResponse: int16) +proc fRelease*(a: var DDEDATA): int16 +proc set_fRelease*(a: var DDEDATA, fRelease: int16) +proc reserved*(a: var DDEDATA): int16 +proc set_reserved*(a: var DDEDATA, reserved: int16) +proc fAckReq*(a: var DDEDATA): int16 +proc set_fAckReq*(a: var DDEDATA, fAckReq: int16) +type + DDELN* {.final, pure.} = object + flag0*: int16 + cfFormat*: SHORT + + TDDELN* = DDELN + PDDELN* = ptr DDELN + +const + bm_DDELN_unused* = 0x00001FFF'i16 + bp_DDELN_unused* = 0'i16 + bm_DDELN_fRelease* = 0x00002000'i16 + bp_DDELN_fRelease* = 13'i16 + bm_DDELN_fDeferUpd* = 0x00004000'i16 + bp_DDELN_fDeferUpd* = 14'i16 + bm_DDELN_fAckReq* = 0x00008000'i16 + bp_DDELN_fAckReq* = 15'i16 + +proc unused*(a: var DDELN): int16 +proc set_unused*(a: var DDELN, unused: int16) +proc fRelease*(a: var DDELN): int16 +proc set_fRelease*(a: var DDELN, fRelease: int16) +proc fDeferUpd*(a: var DDELN): int16 +proc set_fDeferUpd*(a: var DDELN, fDeferUpd: int16) +proc fAckReq*(a: var DDELN): int16 +proc set_fAckReq*(a: var DDELN, fAckReq: int16) +type + DDEML_MSG_HOOK_DATA* {.final, pure.} = object + uiLo*: UINT + uiHi*: UINT + cbData*: DWORD + Data*: array[0..7, DWORD] + + TDDEMLMSGHOOKDATA* = DDEML_MSG_HOOK_DATA + PDDEMLMSGHOOKDATA* = ptr DDEML_MSG_HOOK_DATA + DDEPOKE* {.final, pure.} = object + flag0*: int16 + cfFormat*: SHORT + Value*: array[0..0, int8] + + TDDEPOKE* = DDEPOKE + PDDEPOKE* = ptr DDEPOKE + +const + bm_DDEPOKE_unused* = 0x00001FFF'i16 + bp_DDEPOKE_unused* = 0'i16 + bm_DDEPOKE_fRelease* = 0x00002000'i16 + bp_DDEPOKE_fRelease* = 13'i16 + bm_DDEPOKE_fReserved* = 0x0000C000'i16 + bp_DDEPOKE_fReserved* = 14'i16 + +proc unused*(a: var DDEPOKE): int16 +proc set_unused*(a: var DDEPOKE, unused: int16) +proc fRelease*(a: var DDEPOKE): int16 +proc set_fRelease*(a: var DDEPOKE, fRelease: int16) +proc fReserved*(a: var DDEPOKE): int16 +proc set_fReserved*(a: var DDEPOKE, fReserved: int16) +type + DDEUP* {.final, pure.} = object + flag0*: int16 + cfFormat*: SHORT + rgb*: array[0..0, int8] + + TDDEUP* = DDEUP + PDDEUP* = ptr DDEUP + +const + bm_DDEUP_unused* = 0x00000FFF'i16 + bp_DDEUP_unused* = 0'i16 + bm_DDEUP_fAck* = 0x00001000'i16 + bp_DDEUP_fAck* = 12'i16 + bm_DDEUP_fRelease* = 0x00002000'i16 + bp_DDEUP_fRelease* = 13'i16 + bm_DDEUP_fReserved* = 0x00004000'i16 + bp_DDEUP_fReserved* = 14'i16 + bm_DDEUP_fAckReq* = 0x00008000'i16 + bp_DDEUP_fAckReq* = 15'i16 + +proc unused*(a: var DDEUP): int16 +proc set_unused*(a: var DDEUP, unused: int16) +proc fAck*(a: var DDEUP): int16 +proc set_fAck*(a: var DDEUP, fAck: int16) +proc fRelease*(a: var DDEUP): int16 +proc set_fRelease*(a: var DDEUP, fRelease: int16) +proc fReserved*(a: var DDEUP): int16 +proc set_fReserved*(a: var DDEUP, fReserved: int16) +proc fAckReq*(a: var DDEUP): int16 +proc set_fAckReq*(a: var DDEUP, fAckReq: int16) +type + EXCEPTION_RECORD* {.final, pure.} = object + ExceptionCode*: DWORD + ExceptionFlags*: DWORD + ExceptionRecord*: ptr EXCEPTION_RECORD + ExceptionAddress*: PVOID + NumberParameters*: DWORD + ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, + ULONG_PTR] + + PEXCEPTION_RECORD* = ptr EXCEPTION_RECORD + TEXCEPTIONRECORD* = EXCEPTION_RECORD + EXCEPTION_DEBUG_INFO* {.final, pure.} = object + ExceptionRecord*: EXCEPTION_RECORD + dwFirstChance*: DWORD + + PEXCEPTION_DEBUG_INFO* = ptr EXCEPTION_DEBUG_INFO + TEXCEPTIONDEBUGINFO* = EXCEPTION_DEBUG_INFO + EXCEPTION_RECORD32* {.final, pure.} = object + ExceptionCode*: DWORD + ExceptionFlags*: DWORD + ExceptionRecord*: DWORD + ExceptionAddress*: DWORD + NumberParameters*: DWORD + ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, DWORD] + + PEXCEPTION_RECORD32* = ptr EXCEPTION_RECORD32 + TExceptionRecord32* = EXCEPTION_RECORD32 + EXCEPTION_DEBUG_INFO32* {.final, pure.} = object + ExceptionRecord*: EXCEPTION_RECORD32 + dwFirstChance*: DWORD + + PEXCEPTION_DEBUG_INFO32* = ptr EXCEPTION_DEBUG_INFO32 + TExceptionDebugInfo32* = EXCEPTION_DEBUG_INFO32 + EXCEPTION_RECORD64* {.final, pure.} = object + ExceptionCode*: DWORD + ExceptionFlags*: DWORD + ExceptionRecord*: DWORD64 + ExceptionAddress*: DWORD64 + NumberParameters*: DWORD + unusedAlignment*: DWORD + ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, DWORD64] + + PEXCEPTION_RECORD64* = ptr EXCEPTION_RECORD64 + TExceptionRecord64* = EXCEPTION_RECORD64 + EXCEPTION_DEBUG_INFO64* {.final, pure.} = object + ExceptionRecord*: EXCEPTION_RECORD64 + dwFirstChance*: DWORD + + PEXCEPTION_DEBUG_INFO64* = ptr EXCEPTION_DEBUG_INFO64 + TExceptionDebugInfo64* = EXCEPTION_DEBUG_INFO64 + EXIT_PROCESS_DEBUG_INFO* {.final, pure.} = object + dwExitCode*: DWORD + + TEXITPROCESSDEBUGINFO* = EXIT_PROCESS_DEBUG_INFO + PEXITPROCESSDEBUGINFO* = ptr EXIT_PROCESS_DEBUG_INFO + EXIT_THREAD_DEBUG_INFO* {.final, pure.} = object + dwExitCode*: DWORD + + TEXITTHREADDEBUGINFO* = EXIT_THREAD_DEBUG_INFO + PEXITTHREADDEBUGINFO* = ptr EXIT_THREAD_DEBUG_INFO + LOAD_DLL_DEBUG_INFO* {.final, pure.} = object + hFile*: HANDLE + lpBaseOfDll*: LPVOID + dwDebugInfoFileOffset*: DWORD + nDebugInfoSize*: DWORD + lpImageName*: LPVOID + fUnicode*: int16 + + TLOADDLLDEBUGINFO* = LOAD_DLL_DEBUG_INFO + PLOADDLLDEBUGINFO* = ptr LOAD_DLL_DEBUG_INFO + UNLOAD_DLL_DEBUG_INFO* {.final, pure.} = object + lpBaseOfDll*: LPVOID + + TUNLOADDLLDEBUGINFO* = UNLOAD_DLL_DEBUG_INFO + PUNLOADDLLDEBUGINFO* = ptr UNLOAD_DLL_DEBUG_INFO + OUTPUT_DEBUG_STRING_INFO* {.final, pure.} = object + lpDebugStringData*: LPSTR + fUnicode*: int16 + nDebugStringLength*: int16 + + TOUTPUTDEBUGSTRINGINFO* = OUTPUT_DEBUG_STRING_INFO + POUTPUTDEBUGSTRINGINFO* = ptr OUTPUT_DEBUG_STRING_INFO + RIP_INFO* {.final, pure.} = object + dwError*: DWORD + dwType*: DWORD + + TRIPINFO* = RIP_INFO + PRIPINFO* = ptr RIP_INFO + DEBUG_EVENT* {.final, pure.} = object + dwDebugEventCode*: DWORD + dwProcessId*: DWORD + dwThreadId*: DWORD + data*: array[0..15, DWORD] + + LPDEBUG_EVENT* = ptr DEBUG_EVENT + TDEBUGEVENT* = DEBUG_EVENT + PDEBUGEVENT* = ptr DEBUG_EVENT + DEBUGHOOKINFO* {.final, pure.} = object + idThread*: DWORD + idThreadInstaller*: DWORD + lParam*: LPARAM + wParam*: WPARAM + code*: int32 + + TDEBUGHOOKINFO* = DEBUGHOOKINFO + PDEBUGHOOKINFO* = ptr DEBUGHOOKINFO + DELETEITEMSTRUCT* {.final, pure.} = object + CtlType*: UINT + CtlID*: UINT + itemID*: UINT + hwndItem*: HWND + itemData*: ULONG_PTR + + TDELETEITEMSTRUCT* = DELETEITEMSTRUCT + PDELETEITEMSTRUCT* = ptr DELETEITEMSTRUCT + DEV_BROADCAST_HDR* {.final, pure.} = object + dbch_size*: ULONG + dbch_devicetype*: ULONG + dbch_reserved*: ULONG + + PDEV_BROADCAST_HDR* = ptr DEV_BROADCAST_HDR + TDEVBROADCASTHDR* = DEV_BROADCAST_HDR + DEV_BROADCAST_OEM* {.final, pure.} = object + dbco_size*: ULONG + dbco_devicetype*: ULONG + dbco_reserved*: ULONG + dbco_identifier*: ULONG + dbco_suppfunc*: ULONG + + PDEV_BROADCAST_OEM* = ptr DEV_BROADCAST_OEM + TDEVBROADCASTOEM* = DEV_BROADCAST_OEM + DEV_BROADCAST_PORT* {.final, pure.} = object + dbcp_size*: ULONG + dbcp_devicetype*: ULONG + dbcp_reserved*: ULONG + dbcp_name*: array[0..0, char] + + PDEV_BROADCAST_PORT* = ptr DEV_BROADCAST_PORT + TDEVBROADCASTPORT* = DEV_BROADCAST_PORT + DEV_BROADCAST_USERDEFINED* {.final, pure.} = object + dbud_dbh*: DEV_BROADCAST_HDR + dbud_szName*: array[0..0, char] + dbud_rgbUserDefined*: array[0..0, int8] + + TDEVBROADCASTUSERDEFINED* = DEV_BROADCAST_USERDEFINED + PDEVBROADCASTUSERDEFINED* = ptr DEV_BROADCAST_USERDEFINED + DEV_BROADCAST_VOLUME* {.final, pure.} = object + dbcv_size*: ULONG + dbcv_devicetype*: ULONG + dbcv_reserved*: ULONG + dbcv_unitmask*: ULONG + dbcv_flags*: USHORT + + PDEV_BROADCAST_VOLUME* = ptr DEV_BROADCAST_VOLUME + TDEVBROADCASTVOLUME* = DEV_BROADCAST_VOLUME + DEVMODE* {.final, pure.} = object + dmDeviceName*: array[0..(CCHDEVICENAME) - 1, BCHAR] + dmSpecVersion*: int16 + dmDriverVersion*: int16 + dmSize*: int16 + dmDriverExtra*: int16 + dmFields*: DWORD + dmOrientation*: int16 + dmPaperSize*: int16 + dmPaperLength*: int16 + dmPaperWidth*: int16 + dmScale*: int16 + dmCopies*: int16 + dmDefaultSource*: int16 + dmPrintQuality*: int16 + dmColor*: int16 + dmDuplex*: int16 + dmYResolution*: int16 + dmTTOption*: int16 + dmCollate*: int16 + dmFormName*: array[0..(CCHFORMNAME) - 1, BCHAR] + dmLogPixels*: int16 + dmBitsPerPel*: DWORD + dmPelsWidth*: DWORD + dmPelsHeight*: DWORD + dmDisplayFlags*: DWORD + dmDisplayFrequency*: DWORD + dmICMMethod*: DWORD + dmICMIntent*: DWORD + dmMediaType*: DWORD + dmDitherType*: DWORD + dmICCManufacturer*: DWORD + dmICCModel*: DWORD # other union part: + # dmPosition: POINTL; + # dmDisplayOrientation: DWORD; + # dmDisplayFixedOutput: DWORD; + + LPDEVMODE* = ptr DEVMODE + devicemode* = DEVMODE + tdevicemode* = DEVMODE + tdevicemodeA* = DEVMODE + PDeviceModeA* = LPDEVMODE + PDeviceMode* = LPDEVMODE + TDEVMODE* = DEVMODE + PDEVMODE* = LPDEVMODE + devmodeW* {.final, pure.} = object + dmDeviceName*: array[0..CCHDEVICENAME - 1, WCHAR] + dmSpecVersion*: int16 + dmDriverVersion*: int16 + dmSize*: int16 + dmDriverExtra*: int16 + dmFields*: DWORD + dmOrientation*: short + dmPaperSize*: short + dmPaperLength*: short + dmPaperWidth*: short + dmScale*: short + dmCopies*: short + dmDefaultSource*: short + dmPrintQuality*: short + dmColor*: short + dmDuplex*: short + dmYResolution*: short + dmTTOption*: short + dmCollate*: short + dmFormName*: array[0..CCHFORMNAME - 1, wchar] + dmLogPixels*: int16 + dmBitsPerPel*: DWORD + dmPelsWidth*: DWORD + dmPelsHeight*: DWORD + dmDisplayFlags*: DWORD + dmDisplayFrequency*: DWORD + dmICMMethod*: DWORD + dmICMIntent*: DWORD + dmMediaType*: DWORD + dmDitherType*: DWORD + dmReserved1*: DWORD + dmReserved2*: DWORD + dmPanningWidth*: DWORD + dmPanningHeight*: DWORD + + LPDEVMODEW* = ptr DEVMODEW + devicemodeW* = DEVMODEW + TDeviceModeW* = DEVMODEW + PDeviceModeW* = LPDEVMODEW + TDEVMODEW* = DEVMODEW + PDEVMODEW* = LPDEVMODEW + DEVNAMES* {.final, pure.} = object + wDriverOffset*: int16 + wDeviceOffset*: int16 + wOutputOffset*: int16 + wDefault*: int16 + + LPDEVNAMES* = ptr DEVNAMES + TDEVNAMES* = DEVNAMES + PDEVNAMES* = ptr DEVNAMES + DIBSECTION* {.final, pure.} = object + dsBm*: BITMAP + dsBmih*: BITMAPINFOHEADER + dsBitfields*: array[0..2, DWORD] + dshSection*: HANDLE + dsOffset*: DWORD + + 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* {.final, pure.} = object + Cylinders*: LARGE_INTEGER + MediaType*: MEDIA_TYPE + TracksPerCylinder*: DWORD + SectorsPerTrack*: DWORD + BytesPerSector*: DWORD + + TDISKGEOMETRY* = DISK_GEOMETRY + PDISKGEOMETRY* = ptr DISK_GEOMETRY + DISK_PERFORMANCE* {.final, pure.} = object + BytesRead*: LARGE_INTEGER + BytesWritten*: LARGE_INTEGER + ReadTime*: LARGE_INTEGER + WriteTime*: LARGE_INTEGER + ReadCount*: DWORD + WriteCount*: DWORD + QueueDepth*: DWORD + + TDISKPERFORMANCE* = DISK_PERFORMANCE + PDISKPERFORMANCE* = ptr DISK_PERFORMANCE + DLGITEMTEMPLATE* {.final, pure.} = object + style*: DWORD + dwExtendedStyle*: DWORD + x*: int16 + y*: int16 + cx*: int16 + cy*: int16 + id*: int16 + + LPDLGITEMTEMPLATE* = ptr DLGITEMTEMPLATE + TDLGITEMTEMPLATE* = DLGITEMTEMPLATE + PDLGITEMTEMPLATE* = ptr DLGITEMTEMPLATE + DLGTEMPLATE* {.final, pure.} = object + style*: DWORD + dwExtendedStyle*: DWORD + cdit*: int16 + x*: int16 + y*: int16 + cx*: int16 + cy*: int16 + + LPDLGTEMPLATE* = ptr DLGTEMPLATE + LPCDLGTEMPLATE* = ptr DLGTEMPLATE + TDLGTEMPLATE* = DLGTEMPLATE + PDLGTEMPLATE* = ptr DLGTEMPLATE + DOC_INFO_1* {.final, pure.} = object + pDocName*: LPTSTR + pOutputFile*: LPTSTR + pDatatype*: LPTSTR + + TDOCINFO1* = DOC_INFO_1 + PDOCINFO1* = ptr DOC_INFO_1 + DOC_INFO_2* {.final, pure.} = object + pDocName*: LPTSTR + pOutputFile*: LPTSTR + pDatatype*: LPTSTR + dwMode*: DWORD + JobId*: DWORD + + TDOCINFO2* = DOC_INFO_2 + PDOCINFO2* = ptr DOC_INFO_2 + DOCINFO* {.final, pure.} = object + cbSize*: int32 + lpszDocName*: LPCTSTR + lpszOutput*: LPCTSTR + lpszDatatype*: LPCTSTR + fwType*: DWORD + + TDOCINFO* = DOCINFO + TDOCINFOA* = DOCINFO + PDOCINFO* = ptr DOCINFO + DRAGLISTINFO* {.final, pure.} = object + uNotification*: UINT + hWnd*: HWND + ptCursor*: POINT + + LPDRAGLISTINFO* = ptr DRAGLISTINFO + TDRAGLISTINFO* = DRAGLISTINFO + PDRAGLISTINFO* = ptr DRAGLISTINFO + DRAWITEMSTRUCT* {.final, pure.} = object + CtlType*: UINT + CtlID*: UINT + itemID*: UINT + itemAction*: UINT + itemState*: UINT + hwndItem*: HWND + hDC*: HDC + rcItem*: RECT + itemData*: ULONG_PTR + + LPDRAWITEMSTRUCT* = ptr DRAWITEMSTRUCT + TDRAWITEMSTRUCT* = DRAWITEMSTRUCT + PDRAWITEMSTRUCT* = ptr DRAWITEMSTRUCT + DRAWTEXTPARAMS* {.final, pure.} = object + cbSize*: UINT + iTabLength*: int32 + iLeftMargin*: int32 + iRightMargin*: int32 + uiLengthDrawn*: UINT + + LPDRAWTEXTPARAMS* = ptr DRAWTEXTPARAMS + TDRAWTEXTPARAMS* = DRAWTEXTPARAMS + PDRAWTEXTPARAMS* = ptr DRAWTEXTPARAMS + PARTITION_INFORMATION* {.final, pure.} = object + PartitionType*: int8 + BootIndicator*: bool + RecognizedPartition*: bool + RewritePartition*: bool + StartingOffset*: LARGE_INTEGER + PartitionLength*: LARGE_INTEGER + HiddenSectors*: LARGE_INTEGER + + TPARTITIONINFORMATION* = PARTITION_INFORMATION + PPARTITIONINFORMATION* = ptr PARTITION_INFORMATION + DRIVE_LAYOUT_INFORMATION* {.final, pure.} = object + PartitionCount*: DWORD + Signature*: DWORD + PartitionEntry*: array[0..0, PARTITION_INFORMATION] + + TDRIVELAYOUTINFORMATION* = DRIVE_LAYOUT_INFORMATION + PDRIVELAYOUTINFORMATION* = ptr DRIVE_LAYOUT_INFORMATION + DRIVER_INFO_1* {.final, pure.} = object + pName*: LPTSTR + + TDRIVERINFO1* = DRIVER_INFO_1 + PDRIVERINFO1* = ptr DRIVER_INFO_1 + DRIVER_INFO_2* {.final, pure.} = object + cVersion*: DWORD + pName*: LPTSTR + pEnvironment*: LPTSTR + pDriverPath*: LPTSTR + pDataFile*: LPTSTR + pConfigFile*: LPTSTR + + TDRIVERINFO2* = DRIVER_INFO_2 + PDRIVERINFO2* = ptr DRIVER_INFO_2 + DRIVER_INFO_3* {.final, pure.} = object + cVersion*: DWORD + pName*: LPTSTR + pEnvironment*: LPTSTR + pDriverPath*: LPTSTR + pDataFile*: LPTSTR + pConfigFile*: LPTSTR + pHelpFile*: LPTSTR + pDependentFiles*: LPTSTR + pMonitorName*: LPTSTR + pDefaultDataType*: LPTSTR + + TDRIVERINFO3* = DRIVER_INFO_3 + PDRIVERINFO3* = ptr DRIVER_INFO_3 + EDITSTREAM* {.final, pure.} = object + dwCookie*: DWORD + dwError*: DWORD + pfnCallback*: EDITSTREAMCALLBACK + + Teditstream* = EDITSTREAM + Peditstream* = ptr EDITSTREAM + EMR* {.final, pure.} = object + iType*: DWORD + nSize*: DWORD + + TEMR* = EMR + PEMR* = ptr EMR + EMRANGLEARC* {.final, pure.} = object + emr*: EMR + ptlCenter*: POINTL + nRadius*: DWORD + eStartAngle*: float32 + eSweepAngle*: float32 + + TEMRANGLEARC* = EMRANGLEARC + PEMRANGLEARC* = ptr EMRANGLEARC + EMRARC* {.final, pure.} = object + emr*: EMR + rclBox*: RECTL + ptlStart*: POINTL + ptlEnd*: POINTL + + 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* {.final, pure.} = object + eM11*: float32 + eM12*: float32 + eM21*: float32 + eM22*: float32 + eDx*: float32 + eDy*: float32 + + LPXFORM* = ptr XFORM + TXFORM* = XFORM + PXFORM* = ptr XFORM + EMRBITBLT* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + xDest*: LONG + yDest*: LONG + cxDest*: LONG + cyDest*: LONG + dwRop*: DWORD + xSrc*: LONG + ySrc*: LONG + xformSrc*: XFORM + crBkColorSrc*: COLORREF + iUsageSrc*: DWORD + offBmiSrc*: DWORD + offBitsSrc*: DWORD + cbBitsSrc*: DWORD + + TEMRBITBLT* = EMRBITBLT + PEMRBITBLT* = ptr EMRBITBLT + LOGBRUSH* {.final, pure.} = object + lbStyle*: UINT + lbColor*: COLORREF + lbHatch*: LONG + + TLOGBRUSH* = LOGBRUSH + PLOGBRUSH* = ptr LOGBRUSH + EMRCREATEBRUSHINDIRECT* {.final, pure.} = object + emr*: EMR + ihBrush*: DWORD + lb*: LOGBRUSH + + TEMRCREATEBRUSHINDIRECT* = EMRCREATEBRUSHINDIRECT + PEMRCREATEBRUSHINDIRECT* = ptr EMRCREATEBRUSHINDIRECT + LCSCSTYPE* = LONG + LCSGAMUTMATCH* = LONG + LOGCOLORSPACE* {.final, pure.} = object + lcsSignature*: DWORD + lcsVersion*: DWORD + lcsSize*: DWORD + lcsCSType*: LCSCSTYPE + lcsIntent*: LCSGAMUTMATCH + lcsEndpoints*: CIEXYZTRIPLE + lcsGammaRed*: DWORD + lcsGammaGreen*: DWORD + lcsGammaBlue*: DWORD + lcsFilename*: array[0..(MAX_PATH) - 1, TCHAR] + + LPLOGCOLORSPACE* = ptr LOGCOLORSPACE + TLOGCOLORSPACE* = LOGCOLORSPACE + TLOGCOLORSPACEA* = LOGCOLORSPACE + PLOGCOLORSPACE* = ptr LOGCOLORSPACE + EMRCREATECOLORSPACE* {.final, pure.} = object + emr*: EMR + ihCS*: DWORD + lcs*: LOGCOLORSPACE + + TEMRCREATECOLORSPACE* = EMRCREATECOLORSPACE + PEMRCREATECOLORSPACE* = ptr EMRCREATECOLORSPACE + EMRCREATEDIBPATTERNBRUSHPT* {.final, pure.} = object + emr*: EMR + ihBrush*: DWORD + iUsage*: DWORD + offBmi*: DWORD + cbBmi*: DWORD + offBits*: DWORD + cbBits*: DWORD + + TEMRCREATEDIBPATTERNBRUSHPT* = EMRCREATEDIBPATTERNBRUSHPT + PEMRCREATEDIBPATTERNBRUSHPT* = EMRCREATEDIBPATTERNBRUSHPT + EMRCREATEMONOBRUSH* {.final, pure.} = object + emr*: EMR + ihBrush*: DWORD + iUsage*: DWORD + offBmi*: DWORD + cbBmi*: DWORD + offBits*: DWORD + cbBits*: DWORD + + TEMRCREATEMONOBRUSH* = EMRCREATEMONOBRUSH + PEMRCREATEMONOBRUSH* = ptr EMRCREATEMONOBRUSH + PALETTEENTRY* {.final, pure.} = object + peRed*: int8 + peGreen*: int8 + peBlue*: int8 + peFlags*: int8 + + LPPALETTEENTRY* = ptr PALETTEENTRY + TPALETTEENTRY* = PALETTEENTRY + PPALETTEENTRY* = ptr PALETTEENTRY + LOGPALETTE* {.final, pure.} = object + palVersion*: int16 + palNumEntries*: int16 + palPalEntry*: array[0..0, PALETTEENTRY] + + LPLOGPALETTE* = ptr LOGPALETTE + NPLOGPALETTE* = ptr LOGPALETTE + TLOGPALETTE* = LOGPALETTE + PLOGPALETTE* = ptr LOGPALETTE + EMRCREATEPALETTE* {.final, pure.} = object + emr*: EMR + ihPal*: DWORD + lgpl*: LOGPALETTE + + TEMRCREATEPALETTE* = EMRCREATEPALETTE + PEMRCREATEPALETTE* = ptr EMRCREATEPALETTE + LOGPEN* {.final, pure.} = object + lopnStyle*: UINT + lopnWidth*: POINT + lopnColor*: COLORREF + + TLOGPEN* = LOGPEN + PLOGPEN* = ptr LOGPEN + EMRCREATEPEN* {.final, pure.} = object + emr*: EMR + ihPen*: DWORD + lopn*: LOGPEN + + TEMRCREATEPEN* = EMRCREATEPEN + PEMRCREATEPEN* = ptr EMRCREATEPEN + EMRELLIPSE* {.final, pure.} = object + emr*: EMR + rclBox*: RECTL + + TEMRELLIPSE* = EMRELLIPSE + PEMRELLIPSE* = ptr EMRELLIPSE + EMRRECTANGLE* = EMRELLIPSE + TEMRRECTANGLE* = EMRELLIPSE + PEMRRECTANGLE* = ptr EMRELLIPSE + EMREOF* {.final, pure.} = object + emr*: EMR + nPalEntries*: DWORD + offPalEntries*: DWORD + nSizeLast*: DWORD + + TEMREOF* = EMREOF + PEMREOF* = ptr EMREOF + EMREXCLUDECLIPRECT* {.final, pure.} = object + emr*: EMR + rclClip*: RECTL + + TEMREXCLUDECLIPRECT* = EMREXCLUDECLIPRECT + PEMREXCLUDECLIPRECT* = ptr EMREXCLUDECLIPRECT + EMRINTERSECTCLIPRECT* = EMREXCLUDECLIPRECT + TEMRINTERSECTCLIPRECT* = EMREXCLUDECLIPRECT + PEMRINTERSECTCLIPRECT* = ptr EMREXCLUDECLIPRECT + PANOSE* {.final, pure.} = object + bFamilyType*: int8 + bSerifStyle*: int8 + bWeight*: int8 + bProportion*: int8 + bContrast*: int8 + bStrokeVariation*: int8 + bArmStyle*: int8 + bLetterform*: int8 + bMidline*: int8 + bXHeight*: int8 + + TPANOSE* = PANOSE + PPANOSE* = ptr PANOSE + EXTLOGFONT* {.final, pure.} = object + elfLogFont*: LOGFONT + elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR] + elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR] + elfVersion*: DWORD + elfStyleSize*: DWORD + elfMatch*: DWORD + elfReserved*: DWORD + elfVendorId*: array[0..(ELF_VENDOR_SIZE) - 1, int8] + elfCulture*: DWORD + elfPanose*: PANOSE + + TEXTLOGFONT* = EXTLOGFONT + PEXTLOGFONT* = ptr EXTLOGFONT + EMREXTCREATEFONTINDIRECTW* {.final, pure.} = object + emr*: EMR + ihFont*: DWORD + elfw*: EXTLOGFONT + + TEMREXTCREATEFONTINDIRECTW* = EMREXTCREATEFONTINDIRECTW + PEMREXTCREATEFONTINDIRECTW* = ptr EMREXTCREATEFONTINDIRECTW + EXTLOGPEN* {.final, pure.} = object + elpPenStyle*: UINT + elpWidth*: UINT + elpBrushStyle*: UINT + elpColor*: COLORREF + elpHatch*: LONG + elpNumEntries*: DWORD + elpStyleEntry*: array[0..0, DWORD] + + TEXTLOGPEN* = EXTLOGPEN + PEXTLOGPEN* = ptr EXTLOGPEN + EMREXTCREATEPEN* {.final, pure.} = object + emr*: EMR + ihPen*: DWORD + offBmi*: DWORD + cbBmi*: DWORD + offBits*: DWORD + cbBits*: DWORD + elp*: EXTLOGPEN + + TEMREXTCREATEPEN* = EMREXTCREATEPEN + PEMREXTCREATEPEN* = ptr EMREXTCREATEPEN + EMREXTFLOODFILL* {.final, pure.} = object + emr*: EMR + ptlStart*: POINTL + crColor*: COLORREF + iMode*: DWORD + + TEMREXTFLOODFILL* = EMREXTFLOODFILL + PEMREXTFLOODFILL* = ptr EMREXTFLOODFILL + EMREXTSELECTCLIPRGN* {.final, pure.} = object + emr*: EMR + cbRgnData*: DWORD + iMode*: DWORD + RgnData*: array[0..0, int8] + + TEMREXTSELECTCLIPRGN* = EMREXTSELECTCLIPRGN + PEMREXTSELECTCLIPRGN* = ptr EMREXTSELECTCLIPRGN + EMRTEXT* {.final, pure.} = object + ptlReference*: POINTL + nChars*: DWORD + offString*: DWORD + fOptions*: DWORD + rcl*: RECTL + offDx*: DWORD + + TEMRTEXT* = EMRTEXT + PEMRTEXT* = ptr EMRTEXT + EMREXTTEXTOUTA* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + iGraphicsMode*: DWORD + exScale*: float32 + eyScale*: float32 + emrtext*: EMRTEXT + + TEMREXTTEXTOUTA* = EMREXTTEXTOUTA + PEMREXTTEXTOUTA* = ptr EMREXTTEXTOUTA + EMREXTTEXTOUTW* = EMREXTTEXTOUTA + TEMREXTTEXTOUTW* = EMREXTTEXTOUTA + PEMREXTTEXTOUTW* = ptr EMREXTTEXTOUTA + EMRFILLPATH* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + + TEMRFILLPATH* = EMRFILLPATH + PEMRFILLPATH* = ptr EMRFILLPATH + EMRSTROKEANDFILLPATH* = EMRFILLPATH + TEMRSTROKEANDFILLPATH* = EMRFILLPATH + PEMRSTROKEANDFILLPATH* = ptr EMRFILLPATH + EMRSTROKEPATH* = EMRFILLPATH + TEMRSTROKEPATH* = EMRFILLPATH + PEMRSTROKEPATH* = ptr EMRFILLPATH + EMRFILLRGN* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + cbRgnData*: DWORD + ihBrush*: DWORD + RgnData*: array[0..0, int8] + + TEMRFILLRGN* = EMRFILLRGN + PEMRFILLRGN* = ptr EMRFILLRGN + EMRFORMAT* {.final, pure.} = object + dSignature*: DWORD + nVersion*: DWORD + cbData*: DWORD + offData*: DWORD + + TEMRFORMAT* = EMRFORMAT + PEMRFORMAT* = ptr EMRFORMAT + + EMRFRAMERGN* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + cbRgnData*: DWORD + ihBrush*: DWORD + szlStroke*: SIZEL + RgnData*: array[0..0, int8] + + TEMRFRAMERGN* = EMRFRAMERGN + PEMRFRAMERGN* = ptr EMRFRAMERGN + EMRGDICOMMENT* {.final, pure.} = object + emr*: EMR + cbData*: DWORD + Data*: array[0..0, int8] + + TEMRGDICOMMENT* = EMRGDICOMMENT + PEMRGDICOMMENT* = ptr EMRGDICOMMENT + EMRINVERTRGN* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + cbRgnData*: DWORD + RgnData*: array[0..0, int8] + + TEMRINVERTRGN* = EMRINVERTRGN + PEMRINVERTRGN* = ptr EMRINVERTRGN + EMRPAINTRGN* = EMRINVERTRGN + TEMRPAINTRGN* = EMRINVERTRGN + PEMRPAINTRGN* = ptr EMRINVERTRGN + EMRLINETO* {.final, pure.} = object + emr*: EMR + ptl*: POINTL + + TEMRLINETO* = EMRLINETO + PEMRLINETO* = ptr EMRLINETO + EMRMOVETOEX* = EMRLINETO + TEMRMOVETOEX* = EMRLINETO + PEMRMOVETOEX* = ptr EMRLINETO + EMRMASKBLT* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + xDest*: LONG + yDest*: LONG + cxDest*: LONG + cyDest*: LONG + dwRop*: DWORD + xSrc*: LONG + ySrc*: LONG + xformSrc*: XFORM + crBkColorSrc*: COLORREF + iUsageSrc*: DWORD + offBmiSrc*: DWORD + cbBmiSrc*: DWORD + offBitsSrc*: DWORD + cbBitsSrc*: DWORD + xMask*: LONG + yMask*: LONG + iUsageMask*: DWORD + offBmiMask*: DWORD + cbBmiMask*: DWORD + offBitsMask*: DWORD + cbBitsMask*: DWORD + + TEMRMASKBLT* = EMRMASKBLT + PEMRMASKBLT* = ptr EMRMASKBLT + EMRMODIFYWORLDTRANSFORM* {.final, pure.} = object + emr*: EMR + xform*: XFORM + iMode*: DWORD + + TEMRMODIFYWORLDTRANSFORM* = EMRMODIFYWORLDTRANSFORM + PEMRMODIFYWORLDTRANSFORM* = EMRMODIFYWORLDTRANSFORM + EMROFFSETCLIPRGN* {.final, pure.} = object + emr*: EMR + ptlOffset*: POINTL + + TEMROFFSETCLIPRGN* = EMROFFSETCLIPRGN + PEMROFFSETCLIPRGN* = ptr EMROFFSETCLIPRGN + EMRPLGBLT* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + aptlDest*: array[0..2, POINTL] + xSrc*: LONG + ySrc*: LONG + cxSrc*: LONG + cySrc*: LONG + xformSrc*: XFORM + crBkColorSrc*: COLORREF + iUsageSrc*: DWORD + offBmiSrc*: DWORD + cbBmiSrc*: DWORD + offBitsSrc*: DWORD + cbBitsSrc*: DWORD + xMask*: LONG + yMask*: LONG + iUsageMask*: DWORD + offBmiMask*: DWORD + cbBmiMask*: DWORD + offBitsMask*: DWORD + cbBitsMask*: DWORD + + TEMRPLGBLT* = EMRPLGBLT + PEMRPLGBLT* = ptr EMRPLGBLT + EMRPOLYDRAW* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + cptl*: DWORD + aptl*: array[0..0, POINTL] + abTypes*: array[0..0, int8] + + TEMRPOLYDRAW* = EMRPOLYDRAW + PEMRPOLYDRAW* = ptr EMRPOLYDRAW + EMRPOLYDRAW16* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + cpts*: DWORD + apts*: array[0..0, POINTS] + abTypes*: array[0..0, int8] + + TEMRPOLYDRAW16* = EMRPOLYDRAW16 + PEMRPOLYDRAW16* = ptr EMRPOLYDRAW16 + EMRPOLYLINE* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + cptl*: DWORD + aptl*: array[0..0, POINTL] + + 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* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + cpts*: DWORD + apts*: array[0..0, POINTL] + + 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* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + nPolys*: DWORD + cptl*: DWORD + aPolyCounts*: array[0..0, DWORD] + aptl*: array[0..0, POINTL] + + TEMRPOLYPOLYLINE* = EMRPOLYPOLYLINE + PEMRPOLYPOLYLINE* = ptr EMRPOLYPOLYLINE + EMRPOLYPOLYGON* = EMRPOLYPOLYLINE + TEMRPOLYPOLYGON* = EMRPOLYPOLYLINE + PEMRPOLYPOLYGON* = ptr EMRPOLYPOLYLINE + EMRPOLYPOLYLINE16* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + nPolys*: DWORD + cpts*: DWORD + aPolyCounts*: array[0..0, DWORD] + apts*: array[0..0, POINTS] + + TEMRPOLYPOLYLINE16* = EMRPOLYPOLYLINE16 + PEMRPOLYPOLYLINE16* = ptr EMRPOLYPOLYLINE16 + EMRPOLYPOLYGON16* = EMRPOLYPOLYLINE16 + TEMRPOLYPOLYGON16* = EMRPOLYPOLYLINE16 + PEMRPOLYPOLYGON16* = ptr EMRPOLYPOLYLINE16 + EMRPOLYTEXTOUTA* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + iGraphicsMode*: DWORD + exScale*: float32 + eyScale*: float32 + cStrings*: LONG + aemrtext*: array[0..0, EMRTEXT] + + TEMRPOLYTEXTOUTA* = EMRPOLYTEXTOUTA + PEMRPOLYTEXTOUTA* = ptr EMRPOLYTEXTOUTA + EMRPOLYTEXTOUTW* = EMRPOLYTEXTOUTA + TEMRPOLYTEXTOUTW* = EMRPOLYTEXTOUTA + PEMRPOLYTEXTOUTW* = ptr EMRPOLYTEXTOUTA + EMRRESIZEPALETTE* {.final, pure.} = object + emr*: EMR + ihPal*: DWORD + cEntries*: DWORD + + TEMRRESIZEPALETTE* = EMRRESIZEPALETTE + PEMRRESIZEPALETTE* = ptr EMRRESIZEPALETTE + EMRRESTOREDC* {.final, pure.} = object + emr*: EMR + iRelative*: LONG + + TEMRRESTOREDC* = EMRRESTOREDC + PEMRRESTOREDC* = ptr EMRRESTOREDC + EMRROUNDRECT* {.final, pure.} = object + emr*: EMR + rclBox*: RECTL + szlCorner*: SIZEL + + TEMRROUNDRECT* = EMRROUNDRECT + PEMRROUNDRECT* = ptr EMRROUNDRECT + EMRSCALEVIEWPORTEXTEX* {.final, pure.} = object + emr*: EMR + xNum*: LONG + xDenom*: LONG + yNum*: LONG + yDenom*: LONG + + TEMRSCALEVIEWPORTEXTEX* = EMRSCALEVIEWPORTEXTEX + PEMRSCALEVIEWPORTEXTEX* = ptr EMRSCALEVIEWPORTEXTEX + EMRSCALEWINDOWEXTEX* = EMRSCALEVIEWPORTEXTEX + TEMRSCALEWINDOWEXTEX* = EMRSCALEVIEWPORTEXTEX + PEMRSCALEWINDOWEXTEX* = ptr EMRSCALEVIEWPORTEXTEX + EMRSELECTCOLORSPACE* {.final, pure.} = object + emr*: EMR + + ihCS*: DWORD + + TEMRSELECTCOLORSPACE* = EMRSELECTCOLORSPACE + PEMRSELECTCOLORSPACE* = ptr EMRSELECTCOLORSPACE + EMRDELETECOLORSPACE* = EMRSELECTCOLORSPACE + TEMRDELETECOLORSPACE* = EMRSELECTCOLORSPACE + PEMRDELETECOLORSPACE* = ptr EMRSELECTCOLORSPACE + EMRSELECTOBJECT* {.final, pure.} = object + emr*: EMR + ihObject*: DWORD + + TEMRSELECTOBJECT* = EMRSELECTOBJECT + PEMRSELECTOBJECT* = ptr EMRSELECTOBJECT + EMRDELETEOBJECT* = EMRSELECTOBJECT + TEMRDELETEOBJECT* = EMRSELECTOBJECT + PEMRDELETEOBJECT* = ptr EMRSELECTOBJECT + EMRSELECTPALETTE* {.final, pure.} = object + emr*: EMR + ihPal*: DWORD + + TEMRSELECTPALETTE* = EMRSELECTPALETTE + PEMRSELECTPALETTE* = ptr EMRSELECTPALETTE + EMRSETARCDIRECTION* {.final, pure.} = object + emr*: EMR + iArcDirection*: DWORD + + TEMRSETARCDIRECTION* = EMRSETARCDIRECTION + PEMRSETARCDIRECTION* = ptr EMRSETARCDIRECTION + EMRSETBKCOLOR* {.final, pure.} = object + emr*: EMR + crColor*: COLORREF + + TEMRSETBKCOLOR* = EMRSETBKCOLOR + PEMRSETBKCOLOR* = ptr EMRSETBKCOLOR + EMRSETTEXTCOLOR* = EMRSETBKCOLOR + TEMRSETTEXTCOLOR* = EMRSETBKCOLOR + PEMRSETTEXTCOLOR* = ptr EMRSETBKCOLOR + EMRSETCOLORADJUSTMENT* {.final, pure.} = object + emr*: EMR + ColorAdjustment*: COLORADJUSTMENT + + TEMRSETCOLORADJUSTMENT* = EMRSETCOLORADJUSTMENT + PEMRSETCOLORADJUSTMENT* = ptr EMRSETCOLORADJUSTMENT + EMRSETDIBITSTODEVICE* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + xDest*: LONG + yDest*: LONG + xSrc*: LONG + ySrc*: LONG + cxSrc*: LONG + cySrc*: LONG + offBmiSrc*: DWORD + cbBmiSrc*: DWORD + offBitsSrc*: DWORD + cbBitsSrc*: DWORD + iUsageSrc*: DWORD + iStartScan*: DWORD + cScans*: DWORD + + TEMRSETDIBITSTODEVICE* = EMRSETDIBITSTODEVICE + PEMRSETDIBITSTODEVICE* = ptr EMRSETDIBITSTODEVICE + EMRSETMAPPERFLAGS* {.final, pure.} = object + emr*: EMR + dwFlags*: DWORD + + TEMRSETMAPPERFLAGS* = EMRSETMAPPERFLAGS + PEMRSETMAPPERFLAGS* = ptr EMRSETMAPPERFLAGS + EMRSETMITERLIMIT* {.final, pure.} = object + emr*: EMR + eMiterLimit*: float32 + + TEMRSETMITERLIMIT* = EMRSETMITERLIMIT + PEMRSETMITERLIMIT* = ptr EMRSETMITERLIMIT + EMRSETPALETTEENTRIES* {.final, pure.} = object + emr*: EMR + ihPal*: DWORD + iStart*: DWORD + cEntries*: DWORD + aPalEntries*: array[0..0, PALETTEENTRY] + + TEMRSETPALETTEENTRIES* = EMRSETPALETTEENTRIES + PEMRSETPALETTEENTRIES* = ptr EMRSETPALETTEENTRIES + EMRSETPIXELV* {.final, pure.} = object + emr*: EMR + ptlPixel*: POINTL + crColor*: COLORREF + + TEMRSETPIXELV* = EMRSETPIXELV + PEMRSETPIXELV* = ptr EMRSETPIXELV + EMRSETVIEWPORTEXTEX* {.final, pure.} = object + emr*: EMR + szlExtent*: SIZEL + + TEMRSETVIEWPORTEXTEX* = EMRSETVIEWPORTEXTEX + PEMRSETVIEWPORTEXTEX* = ptr EMRSETVIEWPORTEXTEX + EMRSETWINDOWEXTEX* = EMRSETVIEWPORTEXTEX + TEMRSETWINDOWEXTEX* = EMRSETVIEWPORTEXTEX + PEMRSETWINDOWEXTEX* = ptr EMRSETVIEWPORTEXTEX + EMRSETVIEWPORTORGEX* {.final, pure.} = object + emr*: EMR + ptlOrigin*: POINTL + + TEMRSETVIEWPORTORGEX* = EMRSETVIEWPORTORGEX + PEMRSETVIEWPORTORGEX* = ptr EMRSETVIEWPORTORGEX + EMRSETWINDOWORGEX* = EMRSETVIEWPORTORGEX + TEMRSETWINDOWORGEX* = EMRSETVIEWPORTORGEX + PEMRSETWINDOWORGEX* = ptr EMRSETVIEWPORTORGEX + EMRSETBRUSHORGEX* = EMRSETVIEWPORTORGEX + TEMRSETBRUSHORGEX* = EMRSETVIEWPORTORGEX + PEMRSETBRUSHORGEX* = ptr EMRSETVIEWPORTORGEX + EMRSETWORLDTRANSFORM* {.final, pure.} = object + emr*: EMR + xform*: XFORM + + TEMRSETWORLDTRANSFORM* = EMRSETWORLDTRANSFORM + PEMRSETWORLDTRANSFORM* = ptr EMRSETWORLDTRANSFORM + EMRSTRETCHBLT* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + xDest*: LONG + yDest*: LONG + cxDest*: LONG + cyDest*: LONG + dwRop*: DWORD + xSrc*: LONG + ySrc*: LONG + xformSrc*: XFORM + crBkColorSrc*: COLORREF + iUsageSrc*: DWORD + offBmiSrc*: DWORD + cbBmiSrc*: DWORD + offBitsSrc*: DWORD + cbBitsSrc*: DWORD + cxSrc*: LONG + cySrc*: LONG + + TEMRSTRETCHBLT* = EMRSTRETCHBLT + PEMRSTRETCHBLT* = ptr EMRSTRETCHBLT + EMRSTRETCHDIBITS* {.final, pure.} = object + emr*: EMR + rclBounds*: RECTL + xDest*: LONG + yDest*: LONG + xSrc*: LONG + ySrc*: LONG + cxSrc*: LONG + cySrc*: LONG + offBmiSrc*: DWORD + cbBmiSrc*: DWORD + offBitsSrc*: DWORD + cbBitsSrc*: DWORD + iUsageSrc*: DWORD + dwRop*: DWORD + cxDest*: LONG + cyDest*: LONG + + TEMRSTRETCHDIBITS* = EMRSTRETCHDIBITS + PEMRSTRETCHDIBITS* = ptr EMRSTRETCHDIBITS + EMRABORTPATH* {.final, pure.} = object + emr*: EMR + + TEMRABORTPATH* = EMRABORTPATH + PEMRABORTPATH* = ptr 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* {.final, pure.} = object + emr*: EMR + iMode*: DWORD + + 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* {.final, pure.} = object + hwndFrom*: HWND + idFrom*: UINT + code*: UINT + + TNMHDR* = NMHDR + PNMHDR* = ptr NMHDR + TENCORRECTTEXT* {.final, pure.} = object + nmhdr*: NMHDR + chrg*: CHARRANGE + seltyp*: int16 + + Pencorrecttext* = ptr TENCORRECTTEXT + TENDROPFILES* {.final, pure.} = object + nmhdr*: NMHDR + hDrop*: HANDLE + cp*: LONG + fProtected*: WINBOOL + + Pendropfiles* = ptr TENDROPFILES + TENSAVECLIPBOARD* {.final, pure.} = object + nmhdr*: NMHDR + cObjectCount*: LONG + cch*: LONG + + PENSAVECLIPBOARD* = ptr TENSAVECLIPBOARD + TENOLEOPFAILED* {.final, pure.} = object + nmhdr*: NMHDR + iob*: LONG + lOper*: LONG + hr*: HRESULT + + PENOLEOPFAILED* = ptr TENOLEOPFAILED + TENHMETAHEADER* {.final, pure.} = object + iType*: DWORD + nSize*: DWORD + rclBounds*: RECTL + rclFrame*: RECTL + dSignature*: DWORD + nVersion*: DWORD + nBytes*: DWORD + nRecords*: DWORD + nHandles*: int16 + sReserved*: int16 + nDescription*: DWORD + offDescription*: DWORD + nPalEntries*: DWORD + szlDevice*: SIZEL + szlMillimeters*: SIZEL + + LPENHMETAHEADER* = ptr TENHMETAHEADER + PENHMETAHEADER* = ptr TENHMETAHEADER + TENHMETARECORD* {.final, pure.} = object + iType*: DWORD + nSize*: DWORD + dParm*: array[0..0, DWORD] + + LPENHMETARECORD* = ptr TENHMETARECORD + PENHMETARECORD* = ptr TENHMETARECORD + TENPROTECTED* {.final, pure.} = object + nmhdr*: NMHDR + msg*: UINT + wParam*: WPARAM + lParam*: LPARAM + chrg*: CHARRANGE + + Penprotected* = ptr TENPROTECTED + SERVICE_STATUS* {.final, pure.} = object + dwServiceType*: DWORD + dwCurrentState*: DWORD + dwControlsAccepted*: DWORD + dwWin32ExitCode*: DWORD + dwServiceSpecificExitCode*: DWORD + dwCheckPoint*: DWORD + dwWaitHint*: DWORD + + LPSERVICE_STATUS* = ptr SERVICE_STATUS + TSERVICESTATUS* = SERVICE_STATUS + PSERVICESTATUS* = ptr SERVICE_STATUS + ENUM_SERVICE_STATUS* {.final, pure.} = object + lpServiceName*: LPTSTR + lpDisplayName*: LPTSTR + ServiceStatus*: SERVICE_STATUS + + LPENUM_SERVICE_STATUS* = ptr ENUM_SERVICE_STATUS + TENUMSERVICESTATUS* = ENUM_SERVICE_STATUS + PENUMSERVICESTATUS* = ptr ENUM_SERVICE_STATUS + ENUMLOGFONT* {.final, pure.} = object + elfLogFont*: LOGFONT + elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR] + elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR] + + TENUMLOGFONT* = ENUMLOGFONT + PENUMLOGFONT* = ptr ENUMLOGFONT + ENUMLOGFONTEX* {.final, pure.} = object + elfLogFont*: LOGFONT + elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR] + elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR] + elfScript*: array[0..(LF_FACESIZE) - 1, BCHAR] + + TENUMLOGFONTEX* = ENUMLOGFONTEX + PENUMLOGFONTEX* = ptr ENUMLOGFONTEX + + EVENTLOGRECORD* {.final, pure.} = object + Length*: DWORD + Reserved*: DWORD + RecordNumber*: DWORD + TimeGenerated*: DWORD + TimeWritten*: DWORD + EventID*: DWORD + EventType*: int16 + NumStrings*: int16 + EventCategory*: int16 + ReservedFlags*: int16 + ClosingRecordNumber*: DWORD + StringOffset*: DWORD + UserSidLength*: DWORD + UserSidOffset*: DWORD + DataLength*: DWORD + DataOffset*: DWORD + + TEVENTLOGRECORD* = EVENTLOGRECORD + PEVENTLOGRECORD* = ptr EVENTLOGRECORD + EVENTMSG* {.final, pure.} = object + message*: UINT + paramL*: UINT + paramH*: UINT + time*: DWORD + hwnd*: HWND + + TEVENTMSG* = EVENTMSG + PEVENTMSG* = ptr EVENTMSG + EXCEPTION_POINTERS* {.final, pure.} = object + ExceptionRecord*: PEXCEPTION_RECORD + ContextRecord*: PCONTEXT + + LPEXCEPTION_POINTERS* = ptr EXCEPTION_POINTERS + PEXCEPTION_POINTERS* = ptr EXCEPTION_POINTERS + TEXCEPTIONPOINTERS* = EXCEPTION_POINTERS + EXT_BUTTON* {.final, pure.} = object + idCommand*: int16 + idsHelp*: int16 + fsStyle*: int16 + + LPEXT_BUTTON* = ptr EXT_BUTTON + TEXTBUTTON* = EXT_BUTTON + PEXTBUTTON* = ptr EXT_BUTTON + FILTERKEYS* {.final, pure.} = object + cbSize*: UINT + dwFlags*: DWORD + iWaitMSec*: DWORD + iDelayMSec*: DWORD + iRepeatMSec*: DWORD + iBounceMSec*: DWORD + + TFILTERKEYS* = FILTERKEYS + PFILTERKEYS* = ptr FILTERKEYS + FIND_NAME_BUFFER* {.final, pure.} = object + len*: UCHAR + access_control*: UCHAR + frame_control*: UCHAR + destination_addr*: array[0..5, UCHAR] + source_addr*: array[0..5, UCHAR] + routing_info*: array[0..17, UCHAR] + + TFINDNAMEBUFFER* = FIND_NAME_BUFFER + PFINDNAMEBUFFER* = ptr FIND_NAME_BUFFER + FIND_NAME_HEADER* {.final, pure.} = object + node_count*: int16 + reserved*: UCHAR + unique_group*: UCHAR + + TFINDNAMEHEADER* = FIND_NAME_HEADER + PFINDNAMEHEADER* = ptr FIND_NAME_HEADER + FINDREPLACE* {.final, pure.} = object + lStructSize*: DWORD + hwndOwner*: HWND + hInstance*: HINST + Flags*: DWORD + lpstrFindWhat*: LPTSTR + lpstrReplaceWith*: LPTSTR + wFindWhatLen*: int16 + wReplaceWithLen*: int16 + lCustData*: LPARAM + lpfnHook*: LPFRHOOKPROC + lpTemplateName*: LPCTSTR + + LPFINDREPLACE* = ptr FINDREPLACE + TFINDREPLACE* = FINDREPLACE + PFINDREPLACE* = ptr FINDREPLACE + #FINDTEXT = record conflicts with FindText function + TFINDTEXT* {.final, pure.} = object + chrg*: CHARRANGE + lpstrText*: LPSTR + + Pfindtext* = ptr TFINDTEXT + FINDTEXTEX* {.final, pure.} = object + chrg*: CHARRANGE + lpstrText*: LPSTR + chrgText*: CHARRANGE + + Tfindtextex* = FINDTEXTEX + Pfindtextex* = ptr FINDTEXTEX + FMS_GETDRIVEINFO* {.final, pure.} = object + 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* {.final, pure.} = object + ftTime*: FILETIME + dwSize*: DWORD + bAttr*: int8 + szName*: array[0..259, TCHAR] + + TFMSGETFILESEL* = FMS_GETFILESEL + PFMSGETFILESEL* = ptr FMS_GETFILESEL + FMS_LOAD* {.final, pure.} = object + dwSize*: DWORD + szMenuName*: array[0..(MENU_TEXT_LEN) - 1, TCHAR] + hMenu*: HMENU + wMenuDelta*: UINT + + TFMSLOAD* = FMS_LOAD + PFMSLOAD* = ptr FMS_LOAD + FMS_TOOLBARLOAD* {.final, pure.} = object + dwSize*: DWORD + lpButtons*: LPEXT_BUTTON + cButtons*: int16 + cBitmaps*: int16 + idBitmap*: int16 + hBitmap*: HBITMAP + + TFMSTOOLBARLOAD* = FMS_TOOLBARLOAD + PFMSTOOLBARLOAD* = ptr FMS_TOOLBARLOAD + FOCUS_EVENT_RECORD* {.final, pure.} = object + bSetFocus*: WINBOOL + + TFOCUSEVENTRECORD* = FOCUS_EVENT_RECORD + PFOCUSEVENTRECORD* = ptr FOCUS_EVENT_RECORD + FORM_INFO_1* {.final, pure.} = object + Flags*: DWORD + pName*: LPTSTR + Size*: SIZEL + ImageableArea*: RECTL + + TFORMINFO1* = FORM_INFO_1 + PFORMINFO1* = ptr FORM_INFO_1 + FORMAT_PARAMETERS* {.final, pure.} = object + MediaType*: MEDIA_TYPE + StartCylinderNumber*: DWORD + EndCylinderNumber*: DWORD + StartHeadNumber*: DWORD + EndHeadNumber*: DWORD + + TFORMATPARAMETERS* = FORMAT_PARAMETERS + PFORMATPARAMETERS* = ptr FORMAT_PARAMETERS + FORMATRANGE* {.final, pure.} = object + hdc*: HDC + hdcTarget*: HDC + rc*: RECT + rcPage*: RECT + chrg*: CHARRANGE + + Tformatrange* = FORMATRANGE + Pformatrange* = ptr FORMATRANGE + GCP_RESULTS* {.final, pure.} = object + 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 + TGCPRESULTS* = GCP_RESULTS + PGCPRESULTS* = ptr GCP_RESULTS + GENERIC_MAPPING* {.final, pure.} = object + GenericRead*: ACCESS_MASK + GenericWrite*: ACCESS_MASK + GenericExecute*: ACCESS_MASK + GenericAll*: ACCESS_MASK + + PGENERIC_MAPPING* = ptr GENERIC_MAPPING + TGENERICMAPPING* = GENERIC_MAPPING + GLYPHMETRICS* {.final, pure.} = object + gmBlackBoxX*: UINT + gmBlackBoxY*: UINT + gmptGlyphOrigin*: POINT + gmCellIncX*: SHORT + gmCellIncY*: SHORT + + LPGLYPHMETRICS* = ptr GLYPHMETRICS + TGLYPHMETRICS* = GLYPHMETRICS + PGLYPHMETRICS* = ptr GLYPHMETRICS + HANDLETABLE* {.final, pure.} = object + objectHandle*: array[0..0, HGDIOBJ] + + THANDLETABLE* = HANDLETABLE + LPHANDLETABLE* = ptr HANDLETABLE + HD_HITTESTINFO* {.final, pure.} = object + pt*: POINT + flags*: UINT + iItem*: int32 + + THDHITTESTINFO* = HD_HITTESTINFO + PHDHITTESTINFO* = ptr HD_HITTESTINFO + HD_ITEM* {.final, pure.} = object + mask*: UINT + cxy*: int32 + pszText*: LPTSTR + hbm*: HBITMAP + cchTextMax*: int32 + fmt*: int32 + lParam*: LPARAM + + THDITEM* = HD_ITEM + PHDITEM* = ptr HD_ITEM + WINDOWPOS* {.final, pure.} = object + hwnd*: HWND + hwndInsertAfter*: HWND + x*: int32 + y*: int32 + cx*: int32 + cy*: int32 + flags*: UINT + + LPWINDOWPOS* = ptr WINDOWPOS + TWINDOWPOS* = WINDOWPOS + PWINDOWPOS* = ptr WINDOWPOS + HD_LAYOUT* {.final, pure.} = object + prc*: ptr RECT + pwpos*: ptr WINDOWPOS + + THDLAYOUT* = HD_LAYOUT + PHDLAYOUT* = ptr HD_LAYOUT + HD_NOTIFY* {.final, pure.} = object + hdr*: NMHDR + iItem*: int32 + iButton*: int32 + pitem*: ptr HD_ITEM + + THDNOTIFY* = HD_NOTIFY + PHDNOTIFY* = ptr HD_NOTIFY + HELPINFO* {.final, pure.} = object + cbSize*: UINT + iContextType*: int32 + iCtrlId*: int32 + hItemHandle*: HANDLE + dwContextId*: DWORD + MousePos*: POINT + + LPHELPINFO* = ptr HELPINFO + THELPINFO* = HELPINFO + PHELPINFO* = ptr HELPINFO + HELPWININFO* {.final, pure.} = object + wStructSize*: int32 + x*: int32 + y*: int32 + dx*: int32 + dy*: int32 + wMax*: int32 + rgchMember*: array[0..1, TCHAR] + + THELPWININFO* = HELPWININFO + PHELPWININFO* = ptr HELPWININFO + HIGHCONTRAST* {.final, pure.} = object + cbSize*: UINT + dwFlags*: DWORD + lpszDefaultScheme*: LPTSTR + + LPHIGHCONTRAST* = ptr HIGHCONTRAST + THIGHCONTRAST* = HIGHCONTRAST + PHIGHCONTRAST* = ptr HIGHCONTRAST + HSZPAIR* {.final, pure.} = object + hszSvc*: HSZ + hszTopic*: HSZ + + THSZPAIR* = HSZPAIR + PHSZPAIR* = ptr HSZPAIR + ICONINFO* {.final, pure.} = object + fIcon*: WINBOOL + xHotspot*: DWORD + yHotspot*: DWORD + hbmMask*: HBITMAP + hbmColor*: HBITMAP + + TICONINFO* = ICONINFO + PICONINFO* = ptr ICONINFO + ICONMETRICS* {.final, pure.} = object + cbSize*: UINT + iHorzSpacing*: int32 + iVertSpacing*: int32 + iTitleWrap*: int32 + lfFont*: LOGFONT + + LPICONMETRICS* = ptr ICONMETRICS + TICONMETRICS* = ICONMETRICS + PICONMETRICS* = ptr ICONMETRICS + IMAGEINFO* {.final, pure.} = object + hbmImage*: HBITMAP + hbmMask*: HBITMAP + Unused1*: int32 + Unused2*: int32 + rcImage*: RECT + + TIMAGEINFO* = IMAGEINFO + PIMAGEINFO* = ptr IMAGEINFO + KEY_EVENT_RECORD* {.final, pure.} = object + bKeyDown*: WINBOOL + wRepeatCount*: int16 + wVirtualKeyCode*: int16 + wVirtualScanCode*: int16 + UnicodeChar*: WCHAR + dwControlKeyState*: DWORD # other union part: AsciiChar: CHAR + + TKEYEVENTRECORD* = KEY_EVENT_RECORD + PKEYEVENTRECORD* = ptr KEY_EVENT_RECORD + MOUSE_EVENT_RECORD* {.final, pure.} = object + dwMousePosition*: COORD + dwButtonState*: DWORD + dwControlKeyState*: DWORD + dwEventFlags*: DWORD + + TMOUSEEVENTRECORD* = MOUSE_EVENT_RECORD + PMOUSEEVENTRECORD* = ptr MOUSE_EVENT_RECORD + WINDOW_BUFFER_SIZE_RECORD* {.final, pure.} = object + dwSize*: COORD + + TWINDOWBUFFERSIZERECORD* = WINDOW_BUFFER_SIZE_RECORD + PWINDOWBUFFERSIZERECORD* = ptr WINDOW_BUFFER_SIZE_RECORD + MENU_EVENT_RECORD* {.final, pure.} = object + dwCommandId*: UINT + + PMENU_EVENT_RECORD* = ptr MENU_EVENT_RECORD + TMENUEVENTRECORD* = MENU_EVENT_RECORD + INPUT_RECORD* {.final, pure.} = object + EventType*: int16 + Reserved*: int16 + event*: array[0..5, DWORD] + + PINPUT_RECORD* = ptr INPUT_RECORD + TINPUTRECORD* = INPUT_RECORD + SYSTEMTIME* {.final, pure.} = object + wYear*: int16 + wMonth*: int16 + wDayOfWeek*: int16 + wDay*: int16 + wHour*: int16 + wMinute*: int16 + wSecond*: int16 + wMilliseconds*: int16 + + LPSYSTEMTIME* = ptr SYSTEMTIME + TSYSTEMTIME* = SYSTEMTIME + PSYSTEMTIME* = ptr SYSTEMTIME + JOB_INFO_1* {.final, pure.} = object + JobId*: DWORD + pPrinterName*: LPTSTR + pMachineName*: LPTSTR + pUserName*: LPTSTR + pDocument*: LPTSTR + pDatatype*: LPTSTR + pStatus*: LPTSTR + Status*: DWORD + Priority*: DWORD + Position*: DWORD + TotalPages*: DWORD + PagesPrinted*: DWORD + Submitted*: SYSTEMTIME + + TJOBINFO1* = JOB_INFO_1 + PJOBINFO1* = ptr JOB_INFO_1 + SID_IDENTIFIER_AUTHORITY* {.final, pure.} = object + Value*: array[0..5, int8] + + LPSID_IDENTIFIER_AUTHORITY* = ptr SID_IDENTIFIER_AUTHORITY + PSID_IDENTIFIER_AUTHORITY* = ptr SID_IDENTIFIER_AUTHORITY + TSIDIDENTIFIERAUTHORITY* = SID_IDENTIFIER_AUTHORITY + SID* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + JobId*: DWORD + pPrinterName*: LPTSTR + pMachineName*: LPTSTR + pUserName*: LPTSTR + pDocument*: LPTSTR + pNotifyName*: LPTSTR + pDatatype*: LPTSTR + pPrintProcessor*: LPTSTR + pParameters*: LPTSTR + pDriverName*: LPTSTR + pDevMode*: LPDEVMODE + pStatus*: LPTSTR + pSecurityDescriptor*: PSECURITY_DESCRIPTOR + Status*: DWORD + Priority*: DWORD + Position*: DWORD + StartTime*: DWORD + UntilTime*: DWORD + TotalPages*: DWORD + Size*: DWORD + Submitted*: SYSTEMTIME + Time*: DWORD + PagesPrinted*: DWORD + + TJOBINFO2* = JOB_INFO_2 + PJOBINFO2* = ptr JOB_INFO_2 + KERNINGPAIR* {.final, pure.} = object + wFirst*: int16 + wSecond*: int16 + iKernAmount*: int32 + + LPKERNINGPAIR* = ptr KERNINGPAIR + TKERNINGPAIR* = KERNINGPAIR + PKERNINGPAIR* = ptr KERNINGPAIR + LANA_ENUM* {.final, pure.} = object + len*: UCHAR + lana*: array[0..(MAX_LANA) - 1, UCHAR] + + TLANAENUM* = LANA_ENUM + PLANAENUM* = ptr LANA_ENUM + LDT_ENTRY* {.final, pure.} = object + LimitLow*: int16 + BaseLow*: int16 + BaseMid*: int8 + Flags1*: int8 + Flags2*: int8 + BaseHi*: int8 + + LPLDT_ENTRY* = ptr LDT_ENTRY + PLDT_ENTRY* = ptr LDT_ENTRY + TLDTENTRY* = LDT_ENTRY + +const + bm_LDT_ENTRY_BaseMid* = 0x000000FF + bp_LDT_ENTRY_BaseMid* = 0'i32 + bm_LDT_ENTRY_Type* = 0x00001F00 + bp_LDT_ENTRY_Type* = 8'i32 + bm_LDT_ENTRY_Dpl* = 0x00006000 + bp_LDT_ENTRY_Dpl* = 13'i32 + bm_LDT_ENTRY_Pres* = 0x00008000 + bp_LDT_ENTRY_Pres* = 15'i32 + bm_LDT_ENTRY_LimitHi* = 0x000F0000 + bp_LDT_ENTRY_LimitHi* = 16'i32 + bm_LDT_ENTRY_Sys* = 0x00100000 + bp_LDT_ENTRY_Sys* = 20'i32 + bm_LDT_ENTRY_Reserved_0* = 0x00200000 + bp_LDT_ENTRY_Reserved_0* = 21'i32 + bm_LDT_ENTRY_Default_Big* = 0x00400000 + bp_LDT_ENTRY_Default_Big* = 22'i32 + bm_LDT_ENTRY_Granularity* = 0x00800000 + bp_LDT_ENTRY_Granularity* = 23'i32 + bm_LDT_ENTRY_BaseHi* = 0xFF000000 + bp_LDT_ENTRY_BaseHi* = 24'i32 + +type + LOCALESIGNATURE* {.final, pure.} = object + lsUsb*: array[0..3, DWORD] + lsCsbDefault*: array[0..1, DWORD] + lsCsbSupported*: array[0..1, DWORD] + + TLOCALESIGNATURE* = LOCALESIGNATURE + PLOCALESIGNATURE* = ptr LOCALESIGNATURE + LOCALGROUP_MEMBERS_INFO_0* {.final, pure.} = object + lgrmi0_sid*: PSID + + TLOCALGROUPMEMBERSINFO0* = LOCALGROUP_MEMBERS_INFO_0 + PLOCALGROUPMEMBERSINFO0* = ptr LOCALGROUP_MEMBERS_INFO_0 + LOCALGROUP_MEMBERS_INFO_3* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + mask*: UINT + fmt*: int32 + cx*: int32 + pszText*: LPTSTR + cchTextMax*: int32 + iSubItem*: int32 + + TLVCOLUMN* = LV_COLUMN + PLVCOLUMN* = ptr LV_COLUMN + LV_ITEM* {.final, pure.} = object + 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* {.final, pure.} = object + hdr*: NMHDR + item*: LV_ITEM + + TLVDISPINFO* = LV_DISPINFO + PLVDISPINFO* = ptr LV_DISPINFO + LV_FINDINFO* {.final, pure.} = object + flags*: UINT + psz*: LPCTSTR + lParam*: LPARAM + pt*: POINT + vkDirection*: UINT + + TLVFINDINFO* = LV_FINDINFO + PLVFINDINFO* = ptr LV_FINDINFO + LV_HITTESTINFO* {.final, pure.} = object + pt*: POINT + flags*: UINT + iItem*: int32 + + TLVHITTESTINFO* = LV_HITTESTINFO + PLVHITTESTINFO* = ptr LV_HITTESTINFO + LV_KEYDOWN* {.final, pure.} = object + hdr*: NMHDR + wVKey*: int16 + flags*: UINT + + TLVKEYDOWN* = LV_KEYDOWN + PLVKEYDOWN* = ptr LV_KEYDOWN + MAT2* {.final, pure.} = object + eM11*: FIXED + eM12*: FIXED + eM21*: FIXED + eM22*: FIXED + + TMAT2* = MAT2 + PMAT2* = ptr MAT2 + MDICREATESTRUCT* {.final, pure.} = object + szClass*: LPCTSTR + szTitle*: LPCTSTR + hOwner*: HANDLE + x*: int32 + y*: int32 + cx*: int32 + cy*: int32 + style*: DWORD + lParam*: LPARAM + + LPMDICREATESTRUCT* = ptr MDICREATESTRUCT + TMDICREATESTRUCT* = MDICREATESTRUCT + PMDICREATESTRUCT* = ptr MDICREATESTRUCT + MEASUREITEMSTRUCT* {.final, pure.} = object + CtlType*: UINT + CtlID*: UINT + itemID*: UINT + itemWidth*: UINT + itemHeight*: UINT + itemData*: ULONG_PTR + + LPMEASUREITEMSTRUCT* = ptr MEASUREITEMSTRUCT + TMEASUREITEMSTRUCT* = MEASUREITEMSTRUCT + PMEASUREITEMSTRUCT* = ptr MEASUREITEMSTRUCT + MEMORY_BASIC_INFORMATION* {.final, pure.} = object + BaseAddress*: PVOID + AllocationBase*: PVOID + AllocationProtect*: DWORD + RegionSize*: DWORD + State*: DWORD + Protect*: DWORD + `type`*: DWORD + + PMEMORY_BASIC_INFORMATION* = ptr MEMORY_BASIC_INFORMATION + TMEMORYBASICINFORMATION* = MEMORY_BASIC_INFORMATION + MEMORYSTATUS* {.final, pure.} = object + dwLength*: DWORD + dwMemoryLoad*: DWORD + dwTotalPhys*: int + dwAvailPhys*: int + dwTotalPageFile*: int + dwAvailPageFile*: int + dwTotalVirtual*: int + dwAvailVirtual*: int + + TGUID* {.final, pure.} = object + D1*: int32 + D2*: int16 + D3*: int16 + D4*: array [0..7, int8] + + LPMEMORYSTATUS* = ptr MEMORYSTATUS + TMEMORYSTATUS* = MEMORYSTATUS + PMEMORYSTATUS* = ptr MEMORYSTATUS + MENUEX_TEMPLATE_HEADER* {.final, pure.} = object + wVersion*: int16 + wOffset*: int16 + dwHelpId*: DWORD + + TMENUXTEMPLATEHEADER* = MENUEX_TEMPLATE_HEADER + PMENUXTEMPLATEHEADER* = ptr MENUEX_TEMPLATE_HEADER + MENUEX_TEMPLATE_ITEM* {.final, pure.} = object + 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* {.final, pure.} = object + cbSize*: DWORD + fMask*: DWORD + dwStyle*: DWORD + cyMax*: UINT + hbrBack*: HBRUSH + dwContextHelpID*: DWORD + dwMenuData*: ULONG_PTR + + LPMENUINFO* = ptr MENUINFO + LPCMENUINFO* = ptr MENUINFO + TMENUINFO* = MENUINFO + PMENUINFO* = ptr MENUINFO + MENUITEMINFO* {.final, pure.} = object + 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 + TMENUITEMINFO* = MENUITEMINFO + TMENUITEMINFOA* = MENUITEMINFO + PMENUITEMINFO* = ptr MENUITEMINFO + MENUITEMTEMPLATE* {.final, pure.} = object + mtOption*: int16 + mtID*: int16 + mtString*: array[0..0, WCHAR] + + TMENUITEMTEMPLATE* = MENUITEMTEMPLATE + PMENUITEMTEMPLATE* = ptr MENUITEMTEMPLATE + MENUITEMTEMPLATEHEADER* {.final, pure.} = object + versionNumber*: int16 + offset*: int16 + + TMENUITEMTEMPLATEHEADER* = MENUITEMTEMPLATEHEADER + PMENUITEMTEMPLATEHEADER* = ptr MENUITEMTEMPLATEHEADER + MENUTEMPLATE* {.final, pure.} = object + LPMENUTEMPLATE* = ptr MENUTEMPLATE + TMENUTEMPLATE* = MENUTEMPLATE + PMENUTEMPLATE* = ptr MENUTEMPLATE + METAFILEPICT* {.final, pure.} = object + mm*: LONG + xExt*: LONG + yExt*: LONG + hMF*: HMETAFILE + + LPMETAFILEPICT* = ptr METAFILEPICT + TMETAFILEPICT* = METAFILEPICT + PMETAFILEPICT* = ptr METAFILEPICT + METAHEADER* {.final, pure.} = object + mtType*: int16 + mtHeaderSize*: int16 + mtVersion*: int16 + mtSize*: DWORD + mtNoObjects*: int16 + mtMaxRecord*: DWORD + mtNoParameters*: int16 + + TMETAHEADER* = METAHEADER + PMETAHEADER* = ptr METAHEADER + METARECORD* {.final, pure.} = object + rdSize*: DWORD + rdFunction*: int16 + rdParm*: array[0..0, int16] + + LPMETARECORD* = ptr METARECORD + TMETARECORD* = METARECORD + PMETARECORD* = ptr METARECORD + MINIMIZEDMETRICS* {.final, pure.} = object + cbSize*: UINT + iWidth*: int32 + iHorzGap*: int32 + iVertGap*: int32 + iArrange*: int32 + + LPMINIMIZEDMETRICS* = ptr MINIMIZEDMETRICS + TMINIMIZEDMETRICS* = MINIMIZEDMETRICS + PMINIMIZEDMETRICS* = ptr MINIMIZEDMETRICS + MINMAXINFO* {.final, pure.} = object + ptReserved*: POINT + ptMaxSize*: POINT + ptMaxPosition*: POINT + ptMinTrackSize*: POINT + ptMaxTrackSize*: POINT + + TMINMAXINFO* = MINMAXINFO + PMINMAXINFO* = ptr MINMAXINFO + MODEMDEVCAPS* {.final, pure.} = object + dwActualSize*: DWORD + dwRequiredSize*: DWORD + dwDevSpecificOffset*: DWORD + dwDevSpecificSize*: DWORD + dwModemProviderVersion*: DWORD + dwModemManufacturerOffset*: DWORD + dwModemManufacturerSize*: DWORD + dwModemModelOffset*: DWORD + dwModemModelSize*: DWORD + dwModemVersionOffset*: DWORD + dwModemVersionSize*: DWORD + dwDialOptions*: DWORD + dwCallSetupFailTimer*: DWORD + dwInactivityTimeout*: DWORD + dwSpeakerVolume*: DWORD + dwSpeakerMode*: DWORD + dwModemOptions*: DWORD + dwMaxDTERate*: DWORD + dwMaxDCERate*: DWORD + abVariablePortion*: array[0..0, int8] + + LPMODEMDEVCAPS* = ptr MODEMDEVCAPS + TMODEMDEVCAPS* = MODEMDEVCAPS + PMODEMDEVCAPS* = ptr MODEMDEVCAPS + MODEMSETTINGS* {.final, pure.} = object + dwActualSize*: DWORD + dwRequiredSize*: DWORD + dwDevSpecificOffset*: DWORD + dwDevSpecificSize*: DWORD + dwCallSetupFailTimer*: DWORD + dwInactivityTimeout*: DWORD + dwSpeakerVolume*: DWORD + dwSpeakerMode*: DWORD + dwPreferredModemOptions*: DWORD + dwNegotiatedModemOptions*: DWORD + dwNegotiatedDCERate*: DWORD + abVariablePortion*: array[0..0, int8] + + LPMODEMSETTINGS* = ptr MODEMSETTINGS + TMODEMSETTINGS* = MODEMSETTINGS + PMODEMSETTINGS* = ptr MODEMSETTINGS + MONCBSTRUCT* {.final, pure.} = object + 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] + + TMONCBSTRUCT* = MONCBSTRUCT + PMONCBSTRUCT* = ptr MONCBSTRUCT + MONCONVSTRUCT* {.final, pure.} = object + cb*: UINT + fConnect*: WINBOOL + dwTime*: DWORD + hTask*: HANDLE + hszSvc*: HSZ + hszTopic*: HSZ + hConvClient*: HCONV + hConvServer*: HCONV + + TMONCONVSTRUCT* = MONCONVSTRUCT + PMONCONVSTRUCT* = ptr MONCONVSTRUCT + MONERRSTRUCT* {.final, pure.} = object + cb*: UINT + wLastError*: UINT + dwTime*: DWORD + hTask*: HANDLE + + TMONERRSTRUCT* = MONERRSTRUCT + PMONERRSTRUCT* = ptr MONERRSTRUCT + MONHSZSTRUCT* {.final, pure.} = object + cb*: UINT + fsAction*: WINBOOL + dwTime*: DWORD + hsz*: HSZ + hTask*: HANDLE + str*: array[0..0, TCHAR] + + TMONHSZSTRUCT* = MONHSZSTRUCT + PMONHSZSTRUCT* = ptr MONHSZSTRUCT + MONITOR_INFO_1* {.final, pure.} = object + pName*: LPTSTR + + TMONITORINFO1* = MONITOR_INFO_1 + PMONITORINFO1* = ptr MONITOR_INFO_1 + MONITOR_INFO_2* {.final, pure.} = object + pName*: LPTSTR + pEnvironment*: LPTSTR + pDLLName*: LPTSTR + + TMONITORINFO2* = MONITOR_INFO_2 + PMONITORINFO2* = ptr MONITOR_INFO_2 + MONLINKSTRUCT* {.final, pure.} = object + cb*: UINT + dwTime*: DWORD + hTask*: HANDLE + fEstablished*: WINBOOL + fNoData*: WINBOOL + hszSvc*: HSZ + hszTopic*: HSZ + hszItem*: HSZ + wFmt*: UINT + fServer*: WINBOOL + hConvServer*: HCONV + hConvClient*: HCONV + + TMONLINKSTRUCT* = MONLINKSTRUCT + PMONLINKSTRUCT* = ptr MONLINKSTRUCT + MONMSGSTRUCT* {.final, pure.} = object + cb*: UINT + hwndTo*: HWND + dwTime*: DWORD + hTask*: HANDLE + wMsg*: UINT + wParam*: WPARAM + lParam*: LPARAM + dmhd*: DDEML_MSG_HOOK_DATA + + TMONMSGSTRUCT* = MONMSGSTRUCT + PMONMSGSTRUCT* = ptr MONMSGSTRUCT + MOUSEHOOKSTRUCT* {.final, pure.} = object + pt*: POINT + hwnd*: HWND + wHitTestCode*: UINT + dwExtraInfo*: DWORD + + LPMOUSEHOOKSTRUCT* = ptr MOUSEHOOKSTRUCT + TMOUSEHOOKSTRUCT* = MOUSEHOOKSTRUCT + PMOUSEHOOKSTRUCT* = ptr MOUSEHOOKSTRUCT + MOUSEKEYS* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + nmhdr*: NMHDR + msg*: UINT + wParam*: WPARAM + lParam*: LPARAM + + Tmsgfilter* = MSGFILTER + Pmsgfilter* = ptr MSGFILTER + MULTIKEYHELP* {.final, pure.} = object + mkSize*: DWORD + mkKeylist*: TCHAR + szKeyphrase*: array[0..0, TCHAR] + + TMULTIKEYHELP* = MULTIKEYHELP + PMULTIKEYHELP* = ptr MULTIKEYHELP + NAME_BUFFER* {.final, pure.} = object + name*: array[0..(NCBNAMSZ) - 1, UCHAR] + name_num*: UCHAR + name_flags*: UCHAR + + TNAMEBUFFER* = NAME_BUFFER + PNAMEBUFFER* = ptr NAME_BUFFER + p_NCB* = ptr NCB + NCB* {.final, pure.} = object + ncb_command*: UCHAR + ncb_retcode*: UCHAR + ncb_lsn*: UCHAR + ncb_num*: UCHAR + ncb_buffer*: PUCHAR + ncb_length*: int16 + ncb_callname*: array[0..(NCBNAMSZ) - 1, UCHAR] + ncb_name*: array[0..(NCBNAMSZ) - 1, UCHAR] + ncb_rto*: UCHAR + ncb_sto*: UCHAR + ncb_post*: proc (para1: p_NCB){.CDECL.} + ncb_lana_num*: UCHAR + ncb_cmd_cplt*: UCHAR + ncb_reserve*: array[0..9, UCHAR] + ncb_event*: HANDLE + + TNCB* = NCB + NCCALCSIZE_PARAMS* {.final, pure.} = object + rgrc*: array[0..2, RECT] + lppos*: PWINDOWPOS + + TNCCALCSIZEPARAMS* = NCCALCSIZE_PARAMS + PNCCALCSIZEPARAMS* = ptr NCCALCSIZE_PARAMS + NDDESHAREINFO* {.final, pure.} = object + lRevision*: LONG + lpszShareName*: LPTSTR + lShareType*: LONG + lpszAppTopicList*: LPTSTR + fSharedFlag*: LONG + fService*: LONG + fStartAppFlag*: LONG + nCmdShow*: LONG + qModifyId*: array[0..1, LONG] + cNumItems*: LONG + lpszItemList*: LPTSTR + + TNDDESHAREINFO* = NDDESHAREINFO + PNDDESHAREINFO* = ptr NDDESHAREINFO + NETRESOURCE* {.final, pure.} = object + dwScope*: DWORD + dwType*: DWORD + dwDisplayType*: DWORD + dwUsage*: DWORD + lpLocalName*: LPTSTR + lpRemoteName*: LPTSTR + lpComment*: LPTSTR + lpProvider*: LPTSTR + + LPNETRESOURCE* = ptr NETRESOURCE + TNETRESOURCE* = NETRESOURCE + TNETRESOURCEA* = NETRESOURCE + PNETRESOURCE* = ptr NETRESOURCE + PNETRESOURCEA* = ptr NETRESOURCE + NEWCPLINFO* {.final, pure.} = object + dwSize*: DWORD + dwFlags*: DWORD + dwHelpContext*: DWORD + lData*: LONG + hIcon*: HICON + szName*: array[0..31, TCHAR] + szInfo*: array[0..63, TCHAR] + szHelpFile*: array[0..127, TCHAR] + + TNEWCPLINFO* = NEWCPLINFO + PNEWCPLINFO* = ptr NEWCPLINFO + NEWTEXTMETRIC* {.final, pure.} = object + tmHeight*: LONG + tmAscent*: LONG + tmDescent*: LONG + tmInternalLeading*: LONG + tmExternalLeading*: LONG + tmAveCharWidth*: LONG + tmMaxCharWidth*: LONG + tmWeight*: LONG + tmOverhang*: LONG + tmDigitizedAspectX*: LONG + tmDigitizedAspectY*: LONG + tmFirstChar*: BCHAR + tmLastChar*: BCHAR + tmDefaultChar*: BCHAR + tmBreakChar*: BCHAR + tmItalic*: int8 + tmUnderlined*: int8 + tmStruckOut*: int8 + tmPitchAndFamily*: int8 + tmCharSet*: int8 + ntmFlags*: DWORD + ntmSizeEM*: UINT + ntmCellHeight*: UINT + ntmAvgWidth*: UINT + + TNEWTEXTMETRIC* = NEWTEXTMETRIC + PNEWTEXTMETRIC* = ptr NEWTEXTMETRIC + NEWTEXTMETRICEX* {.final, pure.} = object + ntmentm*: NEWTEXTMETRIC + ntmeFontSignature*: FONTSIGNATURE + + TNEWTEXTMETRICEX* = NEWTEXTMETRICEX + PNEWTEXTMETRICEX* = ptr NEWTEXTMETRICEX + NM_LISTVIEW* {.final, pure.} = object + hdr*: NMHDR + iItem*: int32 + iSubItem*: int32 + uNewState*: UINT + uOldState*: UINT + uChanged*: UINT + ptAction*: POINT + lParam*: LPARAM + + TNMLISTVIEW* = NM_LISTVIEW + PNMLISTVIEW* = ptr NM_LISTVIEW + TV_ITEM* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + hdr*: NMHDR + iPos*: int32 + iDelta*: int32 + + TNMUPDOWN* = NM_UPDOWNW + PNMUPDOWN* = ptr NM_UPDOWNW + NONCLIENTMETRICS* {.final, pure.} = object + 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 + TNONCLIENTMETRICS* = NONCLIENTMETRICS + PNONCLIENTMETRICS* = ptr NONCLIENTMETRICS + SERVICE_ADDRESS* {.final, pure.} = object + dwAddressType*: DWORD + dwAddressFlags*: DWORD + dwAddressLength*: DWORD + dwPrincipalLength*: DWORD + lpAddress*: ptr int8 + lpPrincipal*: ptr int8 + + TSERVICEADDRESS* = SERVICE_ADDRESS + PSERVICEADDRESS* = ptr SERVICE_ADDRESS + SERVICE_ADDRESSES* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + dwNameSpace*: DWORD + ServiceInfo*: SERVICE_INFO + + TNSSERVICEINFO* = NS_SERVICE_INFO + PNSSERVICEINFO* = ptr NS_SERVICE_INFO + NUMBERFMT* {.final, pure.} = object + NumDigits*: UINT + LeadingZero*: UINT + Grouping*: UINT + lpDecimalSep*: LPTSTR + lpThousandSep*: LPTSTR + NegativeOrder*: UINT + + Tnumberfmt* = NUMBERFMT + Pnumberfmt* = ptr NUMBERFMT + OFSTRUCT* {.final, pure.} = object + cBytes*: int8 + fFixedDisk*: int8 + nErrCode*: int16 + Reserved1*: int16 + Reserved2*: int16 + szPathName*: array[0..(OFS_MAXPATHNAME) - 1, CHAR] + + LPOFSTRUCT* = ptr OFSTRUCT + TOFSTRUCT* = OFSTRUCT + POFSTRUCT* = ptr OFSTRUCT + OPENFILENAME_NT4* {.final, pure.} = object + lStructSize*: DWORD + hwndOwner*: HWND + hInstance*: HINST + lpstrFilter*: LPCTSTR + lpstrCustomFilter*: LPTSTR + nMaxCustFilter*: DWORD + nFilterIndex*: DWORD + lpstrFile*: LPTSTR + nMaxFile*: DWORD + lpstrFileTitle*: LPTSTR + nMaxFileTitle*: DWORD + lpstrInitialDir*: LPCTSTR + lpstrTitle*: LPCTSTR + Flags*: DWORD + nFileOffset*: int16 + nFileExtension*: int16 + lpstrDefExt*: LPCTSTR + lCustData*: LPARAM + lpfnHook*: LPOFNHOOKPROC + lpTemplateName*: LPCTSTR + + LPOPENFILENAME_NT4* = ptr OPENFILENAME_NT4 + TOPENFILENAME_NT4* = OPENFILENAME_NT4 + POPENFILENAME_NT4* = ptr OPENFILENAME_NT4 + TOPENFILENAME* {.final, pure.} = object + lStructSize*: DWORD + hwndOwner*: HWND + hInstance*: HINST + lpstrFilter*: LPCTSTR + lpstrCustomFilter*: LPTSTR + nMaxCustFilter*: DWORD + nFilterIndex*: DWORD + lpstrFile*: LPTSTR + nMaxFile*: DWORD + lpstrFileTitle*: LPTSTR + nMaxFileTitle*: DWORD + lpstrInitialDir*: LPCTSTR + lpstrTitle*: LPCTSTR + Flags*: DWORD + nFileOffset*: int16 + nFileExtension*: int16 + lpstrDefExt*: LPCTSTR + lCustData*: LPARAM + lpfnHook*: LPOFNHOOKPROC + lpTemplateName*: LPCTSTR + pvReserved*: pointer + dwreserved*: dword + FlagsEx*: dword + + LPOPENFILENAME* = ptr TOPENFILENAME + POPENFILENAME* = ptr TOPENFILENAME + OFN* = TOPENFILENAME + POFN* = ptr TOPENFILENAME + OFNOTIFY* {.final, pure.} = object + hdr*: NMHDR + lpOFN*: LPOPENFILENAME + pszFile*: LPTSTR + + LPOFNOTIFY* = ptr OFNOTIFY + TOFNOTIFY* = OFNOTIFY + POFNOTIFY* = ptr OFNOTIFY + OSVERSIONINFO* {.final, pure.} = object + dwOSVersionInfoSize*: DWORD + dwMajorVersion*: DWORD + dwMinorVersion*: DWORD + dwBuildNumber*: DWORD + dwPlatformId*: DWORD + szCSDVersion*: array[0..127, TCHAR] + + LPOSVERSIONINFO* = ptr OSVERSIONINFO + TOSVERSIONINFO* = OSVERSIONINFO + POSVERSIONINFO* = ptr OSVERSIONINFO + OSVERSIONINFOW* {.final, pure.} = object + dwOSVersionInfoSize*: DWORD + dwMajorVersion*: DWORD + dwMinorVersion*: DWORD + dwBuildNumber*: DWORD + dwPlatformId*: DWORD + szCSDVersion*: array[0..127, WCHAR] + + LPOSVERSIONINFOW* = ptr OSVERSIONINFOW + TOSVERSIONINFOW* = OSVERSIONINFOW + POSVERSIONINFOW* = ptr OSVERSIONINFOW + TEXTMETRIC* {.final, pure.} = object + tmHeight*: LONG + tmAscent*: LONG + tmDescent*: LONG + tmInternalLeading*: LONG + tmExternalLeading*: LONG + tmAveCharWidth*: LONG + tmMaxCharWidth*: LONG + tmWeight*: LONG + tmOverhang*: LONG + tmDigitizedAspectX*: LONG + tmDigitizedAspectY*: LONG + tmFirstChar*: BCHAR + tmLastChar*: BCHAR + tmDefaultChar*: BCHAR + tmBreakChar*: BCHAR + tmItalic*: int8 + tmUnderlined*: int8 + tmStruckOut*: int8 + tmPitchAndFamily*: int8 + tmCharSet*: int8 + + LPTEXTMETRIC* = ptr TEXTMETRIC + TTEXTMETRIC* = TEXTMETRIC + PTEXTMETRIC* = ptr TEXTMETRIC + TEXTMETRICW* {.final, pure.} = object + tmHeight*: LONG + tmAscent*: LONG + tmDescent*: LONG + tmInternalLeading*: LONG + tmExternalLeading*: LONG + tmAveCharWidth*: LONG + tmMaxCharWidth*: LONG + tmWeight*: LONG + tmOverhang*: LONG + tmDigitizedAspectX*: LONG + tmDigitizedAspectY*: LONG + tmFirstChar*: WCHAR + tmLastChar*: WCHAR + tmDefaultChar*: WCHAR + tmBreakChar*: WCHAR + tmItalic*: int8 + tmUnderlined*: int8 + tmStruckOut*: int8 + tmPitchAndFamily*: int8 + tmCharSet*: int8 + + LPTEXTMETRICW* = ptr TEXTMETRICW + TTEXTMETRICW* = TEXTMETRICW + PTEXTMETRICW* = ptr TEXTMETRICW + OUTLINETEXTMETRIC* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + lStructSize*: DWORD + hwndOwner*: HWND + hDevMode*: HGLOBAL + hDevNames*: HGLOBAL + Flags*: DWORD + ptPaperSize*: POINT + rtMinMargin*: RECT + rtMargin*: RECT + hInstance*: HINST + lCustData*: LPARAM + lpfnPageSetupHook*: LPPAGESETUPHOOK + lpfnPagePaintHook*: LPPAGEPAINTHOOK + lpPageSetupTemplateName*: LPCTSTR + hPageSetupTemplate*: HGLOBAL + + LPPAGESETUPDLG* = ptr TPAGESETUPDLG + PPAGESETUPDLG* = ptr TPAGESETUPDLG + TPSD* = TPAGESETUPDLG + PPSD* = ptr TPAGESETUPDLG + PAINTSTRUCT* {.final, pure.} = object + hdc*: HDC + fErase*: WINBOOL + rcPaint*: RECT + fRestore*: WINBOOL + fIncUpdate*: WINBOOL + rgbReserved*: array[0..31, int8] + + LPPAINTSTRUCT* = ptr PAINTSTRUCT + TPAINTSTRUCT* = PAINTSTRUCT + PPAINTSTRUCT* = ptr PAINTSTRUCT + PARAFORMAT* {.final, pure.} = object + 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* {.final, pure.} = object + ByteLength*: DWORD + + TPERFCOUNTERBLOCK* = PERF_COUNTER_BLOCK + PPERFCOUNTERBLOCK* = ptr PERF_COUNTER_BLOCK + PERF_COUNTER_DEFINITION* {.final, pure.} = object + ByteLength*: DWORD + CounterNameTitleIndex*: DWORD + CounterNameTitle*: LPWSTR + CounterHelpTitleIndex*: DWORD + CounterHelpTitle*: LPWSTR + DefaultScale*: DWORD + DetailLevel*: DWORD + CounterType*: DWORD + CounterSize*: DWORD + CounterOffset*: DWORD + + TPERFCOUNTERDEFINITION* = PERF_COUNTER_DEFINITION + PPERFCOUNTERDEFINITION* = ptr PERF_COUNTER_DEFINITION + PERF_DATA_BLOCK* {.final, pure.} = object + Signature*: array[0..3, WCHAR] + LittleEndian*: DWORD + Version*: DWORD + Revision*: DWORD + TotalByteLength*: DWORD + HeaderLength*: DWORD + NumObjectTypes*: DWORD + DefaultObject*: DWORD + SystemTime*: SYSTEMTIME + PerfTime*: LARGE_INTEGER + PerfFreq*: LARGE_INTEGER + PerfTime100nSec*: LARGE_INTEGER + SystemNameLength*: DWORD + SystemNameOffset*: DWORD + + TPERFDATABLOCK* = PERF_DATA_BLOCK + PPERFDATABLOCK* = ptr PERF_DATA_BLOCK + PERF_INSTANCE_DEFINITION* {.final, pure.} = object + ByteLength*: DWORD + ParentObjectTitleIndex*: DWORD + ParentObjectInstance*: DWORD + UniqueID*: DWORD + NameOffset*: DWORD + NameLength*: DWORD + + TPERFINSTANCEDEFINITION* = PERF_INSTANCE_DEFINITION + PPERFINSTANCEDEFINITION* = PERF_INSTANCE_DEFINITION + PERF_OBJECT_TYPE* {.final, pure.} = object + TotalByteLength*: DWORD + DefinitionLength*: DWORD + HeaderLength*: DWORD + ObjectNameTitleIndex*: DWORD + ObjectNameTitle*: LPWSTR + ObjectHelpTitleIndex*: DWORD + ObjectHelpTitle*: LPWSTR + DetailLevel*: DWORD + NumCounters*: DWORD + DefaultCounter*: DWORD + NumInstances*: DWORD + CodePage*: DWORD + PerfTime*: LARGE_INTEGER + PerfFreq*: LARGE_INTEGER + + TPERFOBJECTTYPE* = PERF_OBJECT_TYPE + PPERFOBJECTTYPE* = ptr PERF_OBJECT_TYPE + POLYTEXT* {.final, pure.} = object + x*: int32 + y*: int32 + n*: UINT + lpstr*: LPCTSTR + uiFlags*: UINT + rcl*: RECT + pdx*: ptr int32 + + TPOLYTEXT* = POLYTEXT + PPOLYTEXT* = ptr POLYTEXT + PORT_INFO_1* {.final, pure.} = object + pName*: LPTSTR + + TPORTINFO1* = PORT_INFO_1 + PPORTINFO1* = ptr PORT_INFO_1 + PORT_INFO_2* {.final, pure.} = object + pPortName*: LPSTR + pMonitorName*: LPSTR + pDescription*: LPSTR + fPortType*: DWORD + Reserved*: DWORD + + TPORTINFO2* = PORT_INFO_2 + PPORTINFO2* = ptr PORT_INFO_2 + PREVENT_MEDIA_REMOVAL* {.final, pure.} = object + PreventMediaRemoval*: bool + + TPREVENTMEDIAREMOVAL* = PREVENT_MEDIA_REMOVAL + PPREVENTMEDIAREMOVAL* = ptr PREVENT_MEDIA_REMOVAL + #PRINTDLG = record conflicts with PrintDlg function + TPRINTDLG* {.final, pure.} = object + lStructSize*: DWORD + hwndOwner*: HWND + hDevMode*: HANDLE + hDevNames*: HANDLE + hDC*: HDC + Flags*: DWORD + nFromPage*: int16 + nToPage*: int16 + nMinPage*: int16 + nMaxPage*: int16 + nCopies*: int16 + hInstance*: HINST + lCustData*: DWORD + lpfnPrintHook*: LPPRINTHOOKPROC + lpfnSetupHook*: LPSETUPHOOKPROC + lpPrintTemplateName*: LPCTSTR + lpSetupTemplateName*: LPCTSTR + hPrintTemplate*: HANDLE + hSetupTemplate*: HANDLE + + LPPRINTDLG* = ptr TPRINTDLG + PPRINTDLG* = ptr TPRINTDLG + TPD* = TPRINTDLG + PPD* = ptr TPRINTDLG + PRINTER_DEFAULTS* {.final, pure.} = object + pDatatype*: LPTSTR + pDevMode*: LPDEVMODE + DesiredAccess*: ACCESS_MASK + + TPRINTERDEFAULTS* = PRINTER_DEFAULTS + PPRINTERDEFAULTS* = ptr PRINTER_DEFAULTS + PRINTER_INFO_1* {.final, pure.} = object + Flags*: DWORD + pDescription*: LPTSTR + pName*: LPTSTR + pComment*: LPTSTR + + LPPRINTER_INFO_1* = ptr PRINTER_INFO_1 + PPRINTER_INFO_1* = ptr PRINTER_INFO_1 + TPRINTERINFO1* = PRINTER_INFO_1 + PRINTER_INFO_2* {.final, pure.} = object + pServerName*: LPTSTR + pPrinterName*: LPTSTR + pShareName*: LPTSTR + pPortName*: LPTSTR + pDriverName*: LPTSTR + pComment*: LPTSTR + pLocation*: LPTSTR + pDevMode*: LPDEVMODE + pSepFile*: LPTSTR + pPrintProcessor*: LPTSTR + pDatatype*: LPTSTR + pParameters*: LPTSTR + pSecurityDescriptor*: PSECURITY_DESCRIPTOR + Attributes*: DWORD + Priority*: DWORD + DefaultPriority*: DWORD + StartTime*: DWORD + UntilTime*: DWORD + Status*: DWORD + cJobs*: DWORD + AveragePPM*: DWORD + + TPRINTERINFO2* = PRINTER_INFO_2 + PPRINTERINFO2* = ptr PRINTER_INFO_2 + PRINTER_INFO_3* {.final, pure.} = object + pSecurityDescriptor*: PSECURITY_DESCRIPTOR + + TPRINTERINFO3* = PRINTER_INFO_3 + PPRINTERINFO3* = ptr PRINTER_INFO_3 + PRINTER_INFO_4* {.final, pure.} = object + pPrinterName*: LPTSTR + pServerName*: LPTSTR + Attributes*: DWORD + + TPRINTERINFO4* = PRINTER_INFO_4 + PPRINTERINFO4* = ptr PRINTER_INFO_4 + PRINTER_INFO_5* {.final, pure.} = object + pPrinterName*: LPTSTR + pPortName*: LPTSTR + Attributes*: DWORD + DeviceNotSelectedTimeout*: DWORD + TransmissionRetryTimeout*: DWORD + + TPRINTERINFO5* = PRINTER_INFO_5 + PPRINTERINFO5* = ptr PRINTER_INFO_5 + PRINTER_NOTIFY_INFO_DATA* {.final, pure.} = object + `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* {.final, pure.} = object + 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* {.final, pure.} = object + `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* {.final, pure.} = object + Version*: DWORD + Flags*: DWORD + Count*: DWORD + pTypes*: PPRINTER_NOTIFY_OPTIONS_TYPE + + TPRINTERNOTIFYOPTIONS* = PRINTER_NOTIFY_OPTIONS + PPRINTERNOTIFYOPTIONS* = ptr PRINTER_NOTIFY_OPTIONS + PRINTPROCESSOR_INFO_1* {.final, pure.} = object + pName*: LPTSTR + + TPRINTPROCESSORINFO1* = PRINTPROCESSOR_INFO_1 + PPRINTPROCESSORINFO1* = ptr PRINTPROCESSOR_INFO_1 + PRIVILEGE_SET* {.final, pure.} = object + PrivilegeCount*: DWORD + Control*: DWORD + Privilege*: array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES] + + LPPRIVILEGE_SET* = ptr PRIVILEGE_SET + PPRIVILEGE_SET* = ptr PRIVILEGE_SET + TPRIVILEGESET* = PRIVILEGE_SET + PROCESS_HEAPENTRY* {.final, pure.} = object + lpData*: PVOID + cbData*: DWORD + cbOverhead*: int8 + iRegionIndex*: int8 + wFlags*: int16 + dwCommittedSize*: DWORD + dwUnCommittedSize*: DWORD + lpFirstBlock*: LPVOID + lpLastBlock*: LPVOID + hMem*: HANDLE + + LPPROCESS_HEAP_ENTRY* = ptr PROCESS_HEAPENTRY + TPROCESSHEAPENTRY* = PROCESS_HEAPENTRY + PPROCESSHEAPENTRY* = ptr PROCESS_HEAPENTRY + PROCESS_INFORMATION* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + lpemptyrecord* = ptr emptyrecord + HPROPSHEETPAGE* = ptr emptyrecord + PROPSHEETHEADER* {.final, pure.} = object + dwSize*: DWORD + dwFlags*: DWORD + hwndParent*: HWND + hInstance*: HINST + pszIcon*: LPCTSTR + pszCaption*: LPCTSTR + nPages*: 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* {.final, pure.} = object + 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* {.final, pure.} = object + pName*: LPTSTR + pEnvironment*: LPTSTR + pDLLName*: LPTSTR + + TPROVIDORINFO1* = PROVIDOR_INFO_1 + PPROVIDORINFO1* = ptr PROVIDOR_INFO_1 + PSHNOTIFY* {.final, pure.} = object + hdr*: NMHDR + lParam*: LPARAM + + LPPSHNOTIFY* = ptr PSHNOTIFY + TPSHNOTIFY* = PSHNOTIFY + PPSHNOTIFY* = ptr PSHNOTIFY + PUNCTUATION* {.final, pure.} = object + iSize*: UINT + szPunctuation*: LPSTR + + Tpunctuation* = PUNCTUATION + Ppunctuation* = ptr PUNCTUATION + TQUERY_SERVICE_CONFIG* {.final, pure.} = object + dwServiceType*: DWORD + dwStartType*: DWORD + dwErrorControl*: DWORD + lpBinaryPathName*: LPTSTR + lpLoadOrderGroup*: LPTSTR + dwTagId*: DWORD + lpDependencies*: LPTSTR + lpServiceStartName*: LPTSTR + lpDisplayName*: LPTSTR + + LPQUERY_SERVICE_CONFIG* = ptr TQUERY_SERVICE_CONFIG + PQUERYSERVICECONFIG* = ptr TQUERY_SERVICE_CONFIG + TQUERY_SERVICE_LOCK_STATUS* {.final, pure.} = object + fIsLocked*: DWORD + lpLockOwner*: LPTSTR + dwLockDuration*: DWORD + + LPQUERY_SERVICE_LOCK_STATUS* = ptr TQUERY_SERVICE_LOCK_STATUS + PQUERYSERVICELOCKSTATUS* = ptr TQUERY_SERVICE_LOCK_STATUS + RASAMB* {.final, pure.} = object + dwSize*: DWORD + dwError*: DWORD + szNetBiosError*: array[0..(NETBIOS_NAME_LEN + 1) - 1, TCHAR] + bLana*: int8 + + TRASAMB* = RASAMB + PRASAMB* = ptr RASAMB + RASCONN* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + dwSize*: DWORD + dwfOptions*: DWORD + hwndParent*: HWND + reserved*: DWORD + + TRASDIALEXTENSIONS* = RASDIALEXTENSIONS + PRASDIALEXTENSIONS* = ptr RASDIALEXTENSIONS + RASDIALPARAMS* {.final, pure.} = object + 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* {.final, pure.} = object + dwSize*: DWORD + szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, TCHAR] + + TRASENTRYNAME* = RASENTRYNAME + PRASENTRYNAME* = ptr RASENTRYNAME + RASPPPIP* {.final, pure.} = object + dwSize*: DWORD + dwError*: DWORD + szIpAddress*: array[0..(RAS_MaxIpAddress + 1) - 1, TCHAR] + + TRASPPPIP* = RASPPPIP + PRASPPPIP* = ptr RASPPPIP + RASPPPIPX* {.final, pure.} = object + dwSize*: DWORD + dwError*: DWORD + szIpxAddress*: array[0..(RAS_MaxIpxAddress + 1) - 1, TCHAR] + + TRASPPPIPX* = RASPPPIPX + PRASPPPIPX* = ptr RASPPPIPX + RASPPPNBF* {.final, pure.} = object + 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* {.final, pure.} = object + nSize*: short + wFlags*: short + nLanguageID*: short + + LPRASTERIZER_STATUS* = ptr RASTERIZER_STATUS + TRASTERIZERSTATUS* = RASTERIZER_STATUS + PRASTERIZERSTATUS* = ptr RASTERIZER_STATUS + REASSIGN_BLOCKS* {.final, pure.} = object + Reserved*: int16 + Count*: int16 + BlockNumber*: array[0..0, DWORD] + + TREASSIGNBLOCKS* = REASSIGN_BLOCKS + PREASSIGNBLOCKS* = ptr REASSIGN_BLOCKS + REMOTE_NAME_INFO* {.final, pure.} = object + lpUniversalName*: LPTSTR + lpConnectionName*: LPTSTR + lpRemainingPath*: LPTSTR + + TREMOTENAMEINFO* = REMOTE_NAME_INFO + PREMOTENAMEINFO* = ptr REMOTE_NAME_INFO + + REPASTESPECIAL* {.final, pure.} = object + dwAspect*: DWORD + dwParam*: DWORD + + Trepastespecial* = REPASTESPECIAL + Prepastespecial* = ptr REPASTESPECIAL + REQRESIZE* {.final, pure.} = object + nmhdr*: NMHDR + rc*: RECT + + Treqresize* = REQRESIZE + Preqresize* = ptr REQRESIZE + RGNDATAHEADER* {.final, pure.} = object + dwSize*: DWORD + iType*: DWORD + nCount*: DWORD + nRgnSize*: DWORD + rcBound*: RECT + + TRGNDATAHEADER* = RGNDATAHEADER + PRGNDATAHEADER* = ptr RGNDATAHEADER + RGNDATA* {.final, pure.} = object + rdh*: RGNDATAHEADER + Buffer*: array[0..0, char] + + LPRGNDATA* = ptr RGNDATA + TRGNDATA* = RGNDATA + PRGNDATA* = ptr RGNDATA + SCROLLINFO* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + nmhdr*: NMHDR + chrg*: CHARRANGE + seltyp*: int16 + + Tselchange* = SELCHANGE + Pselchange* = ptr SELCHANGE + SERIALKEYS* {.final, pure.} = object + cbSize*: DWORD + dwFlags*: DWORD + lpszActivePort*: LPSTR + lpszPort*: LPSTR + iBaudRate*: DWORD + iPortState*: DWORD + + LPSERIALKEYS* = ptr SERIALKEYS + TSERIALKEYS* = SERIALKEYS + PSERIALKEYS* = ptr SERIALKEYS + SERVICE_TABLE_ENTRY* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + lsn*: UCHAR + state*: UCHAR + local_name*: array[0..(NCBNAMSZ) - 1, UCHAR] + remote_name*: array[0..(NCBNAMSZ) - 1, UCHAR] + rcvs_outstanding*: UCHAR + sends_outstanding*: UCHAR + + TSESSIONBUFFER* = SESSION_BUFFER + PSESSIONBUFFER* = ptr SESSION_BUFFER + SESSION_HEADER* {.final, pure.} = object + sess_name*: UCHAR + num_sess*: UCHAR + rcv_dg_outstanding*: UCHAR + rcv_any_outstanding*: UCHAR + + TSESSIONHEADER* = SESSION_HEADER + PSESSIONHEADER* = ptr SESSION_HEADER + SET_PARTITION_INFORMATION* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + 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 + TSHGDN* = SHGNO + SHNAMEMAPPING* {.final, pure.} = object + pszOldPath*: LPSTR + pszNewPath*: LPSTR + cchOldPath*: int32 + cchNewPath*: int32 + + LPSHNAMEMAPPING* = ptr SHNAMEMAPPING + TSHNAMEMAPPING* = SHNAMEMAPPING + PSHNAMEMAPPING* = ptr SHNAMEMAPPING + SID_AND_ATTRIBUTES* {.final, pure.} = object + 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* {.final, pure.} = object + Next*: ptr SINGLE_LIST_ENTRY + + TSINGLELISTENTRY* = SINGLE_LIST_ENTRY + PSINGLELISTENTRY* = ptr SINGLE_LIST_ENTRY + SOUNDSENTRY* {.final, pure.} = object + 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 + TSOUNDSENTRY* = SOUNDSENTRY + PSOUNDSENTRY* = ptr SOUNDSENTRY + STARTUPINFO* {.final, pure.} = object + cb*: DWORD + lpReserved*: LPTSTR + lpDesktop*: LPTSTR + lpTitle*: LPTSTR + dwX*: DWORD + dwY*: DWORD + dwXSize*: DWORD + dwYSize*: DWORD + dwXCountChars*: DWORD + dwYCountChars*: DWORD + dwFillAttribute*: DWORD + dwFlags*: DWORD + wShowWindow*: int16 + cbReserved2*: int16 + lpReserved2*: LPBYTE + hStdInput*: HANDLE + hStdOutput*: HANDLE + hStdError*: HANDLE + + LPSTARTUPINFO* = ptr STARTUPINFO + TSTARTUPINFO* = STARTUPINFO + PSTARTUPINFO* = ptr STARTUPINFO + STICKYKEYS* {.final, pure.} = object + cbSize*: DWORD + dwFlags*: DWORD + + LPSTICKYKEYS* = ptr STICKYKEYS + TSTICKYKEYS* = STICKYKEYS + PSTICKYKEYS* = ptr STICKYKEYS + STRRET* {.final, pure.} = object + uType*: UINT + cStr*: array[0..(MAX_PATH) - 1, char] + + LPSTRRET* = ptr STRRET + TSTRRET* = STRRET + PSTRRET* = ptr STRRET + STYLEBUF* {.final, pure.} = object + dwStyle*: DWORD + szDescription*: array[0..31, CHAR] + + LPSTYLEBUF* = ptr STYLEBUF + TSTYLEBUF* = STYLEBUF + PSTYLEBUF* = ptr STYLEBUF + STYLESTRUCT* {.final, pure.} = object + styleOld*: DWORD + styleNew*: DWORD + + LPSTYLESTRUCT* = ptr STYLESTRUCT + TSTYLESTRUCT* = STYLESTRUCT + PSTYLESTRUCT* = ptr STYLESTRUCT + SYSTEM_AUDIT_ACE* {.final, pure.} = object + Header*: ACE_HEADER + Mask*: ACCESS_MASK + SidStart*: DWORD + + TSYSTEMAUDITACE* = SYSTEM_AUDIT_ACE + PSYSTEMAUDITACE* = ptr SYSTEM_AUDIT_ACE + SYSTEM_INFO* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + `type`*: ULONG + + TTAPEERASE* = TAPE_ERASE + PTAPEERASE* = ptr TAPE_ERASE + TAPE_GET_DRIVE_PARAMETERS* {.final, pure.} = object + ECC*: bool + Compression*: bool + DataPadding*: bool + ReportSetmarks*: bool + DefaultBlockSize*: ULONG + MaximumBlockSize*: ULONG + MinimumBlockSize*: ULONG + MaximumPartitionCount*: ULONG + FeaturesLow*: ULONG + FeaturesHigh*: ULONG + EOTWarningZoneSize*: ULONG + + TTAPEGETDRIVEPARAMETERS* = TAPE_GET_DRIVE_PARAMETERS + PTAPEGETDRIVEPARAMETERS* = ptr TAPE_GET_DRIVE_PARAMETERS + TAPE_GET_MEDIA_PARAMETERS* {.final, pure.} = object + Capacity*: LARGE_INTEGER + Remaining*: LARGE_INTEGER + BlockSize*: DWORD + PartitionCount*: DWORD + WriteProtected*: bool + + TTAPEGETMEDIAPARAMETERS* = TAPE_GET_MEDIA_PARAMETERS + PTAPEGETMEDIAPARAMETERS* = ptr TAPE_GET_MEDIA_PARAMETERS + TAPE_GET_POSITION* {.final, pure.} = object + `type`*: ULONG + Partition*: ULONG + OffsetLow*: ULONG + OffsetHigh*: ULONG + + TTAPEGETPOSITION* = TAPE_GET_POSITION + PTAPEGETPOSITION* = ptr TAPE_GET_POSITION + TAPE_PREPARE* {.final, pure.} = object + Operation*: ULONG + + TTAPEPREPARE* = TAPE_PREPARE + PTAPEPREPARE* = ptr TAPE_PREPARE + TAPE_SET_DRIVE_PARAMETERS* {.final, pure.} = object + 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* {.final, pure.} = object + BlockSize*: ULONG + + TTAPESETMEDIAPARAMETERS* = TAPE_SET_MEDIA_PARAMETERS + PTAPESETMEDIAPARAMETERS* = ptr TAPE_SET_MEDIA_PARAMETERS + TAPE_SET_POSITION* {.final, pure.} = object + `Method`*: ULONG + Partition*: ULONG + OffsetLow*: ULONG + OffsetHigh*: ULONG + + TTAPESETPOSITION* = TAPE_SET_POSITION + PTAPESETPOSITION* = ptr TAPE_SET_POSITION + TAPE_WRITE_MARKS* {.final, pure.} = object + `type`*: ULONG + Count*: ULONG + + TTAPEWRITEMARKS* = TAPE_WRITE_MARKS + PTAPEWRITEMARKS* = ptr TAPE_WRITE_MARKS + TTBADDBITMAP* {.final, pure.} = object + hInst*: HINST + nID*: UINT + + LPTBADDBITMAP* = ptr TTBADDBITMAP + PTBADDBITMAP* = ptr TTBADDBITMAP + TBBUTTON* {.final, pure.} = object + iBitmap*: int32 + idCommand*: int32 + fsState*: int8 + fsStyle*: int8 + dwData*: DWORD + iString*: int32 + + LPTBBUTTON* = ptr TBBUTTON + LPCTBBUTTON* = ptr TBBUTTON + TTBBUTTON* = TBBUTTON + PTBBUTTON* = ptr TBBUTTON + TBNOTIFY* {.final, pure.} = object + hdr*: NMHDR + iItem*: int32 + tbButton*: TBBUTTON + cchText*: int32 + pszText*: LPTSTR + + LPTBNOTIFY* = ptr TBNOTIFY + TTBNOTIFY* = TBNOTIFY + PTBNOTIFY* = ptr TBNOTIFY + TBSAVEPARAMS* {.final, pure.} = object + hkr*: HKEY + pszSubKey*: LPCTSTR + pszValueName*: LPCTSTR + + TTBSAVEPARAMS* = TBSAVEPARAMS + PTBSAVEPARAMS* = ptr TBSAVEPARAMS + TC_HITTESTINFO* {.final, pure.} = object + pt*: POINT + flags*: UINT + + TTCHITTESTINFO* = TC_HITTESTINFO + PTCHITTESTINFO* = ptr TC_HITTESTINFO + TC_ITEM* {.final, pure.} = object + mask*: UINT + lpReserved1*: UINT + lpReserved2*: UINT + pszText*: LPTSTR + cchTextMax*: int32 + iImage*: int32 + lParam*: LPARAM + + TTCITEM* = TC_ITEM + PTCITEM* = ptr TC_ITEM + TC_ITEMHEADER* {.final, pure.} = object + mask*: UINT + lpReserved1*: UINT + lpReserved2*: UINT + pszText*: LPTSTR + cchTextMax*: int32 + iImage*: int32 + + TTCITEMHEADER* = TC_ITEMHEADER + PTCITEMHEADER* = ptr TC_ITEMHEADER + TC_KEYDOWN* {.final, pure.} = object + hdr*: NMHDR + wVKey*: int16 + flags*: UINT + + TTCKEYDOWN* = TC_KEYDOWN + PTCKEYDOWN* = ptr TC_KEYDOWN + TEXTRANGE* {.final, pure.} = object + chrg*: CHARRANGE + lpstrText*: LPSTR + + Ttextrange* = TEXTRANGE + Ptextrange* = ptr TEXTRANGE + TIME_ZONE_INFORMATION* {.final, pure.} = object + Bias*: LONG + StandardName*: array[0..31, WCHAR] + StandardDate*: SYSTEMTIME + StandardBias*: LONG + DaylightName*: array[0..31, WCHAR] + DaylightDate*: SYSTEMTIME + DaylightBias*: LONG + + LPTIME_ZONE_INFORMATION* = ptr TIME_ZONE_INFORMATION + TTIMEZONEINFORMATION* = TIME_ZONE_INFORMATION + PTIMEZONEINFORMATION* = ptr TIME_ZONE_INFORMATION + TOGGLEKEYS* {.final, pure.} = object + cbSize*: DWORD + dwFlags*: DWORD + + TTOGGLEKEYS* = TOGGLEKEYS + PTOGGLEKEYS* = ptr TOGGLEKEYS + TTOKEN_SOURCE* {.final, pure.} = object + SourceName*: array[0..7, CHAR] + SourceIdentifier*: LUID + + PTOKENSOURCE* = ptr TTOKEN_SOURCE + TOKEN_CONTROL* {.final, pure.} = object + TokenId*: LUID + AuthenticationId*: LUID + ModifiedId*: LUID + TokenSource*: TTOKEN_SOURCE + + TTOKENCONTROL* = TOKEN_CONTROL + PTOKENCONTROL* = ptr TOKEN_CONTROL + TTOKEN_DEFAULT_DACL* {.final, pure.} = object + DefaultDacl*: PACL + + PTOKENDEFAULTDACL* = ptr TTOKEN_DEFAULT_DACL + TTOKEN_GROUPS* {.final, pure.} = object + GroupCount*: DWORD + Groups*: array[0..(ANYSIZE_ARRAY) - 1, SID_AND_ATTRIBUTES] + + LPTOKEN_GROUPS* = ptr TTOKEN_GROUPS + PTOKENGROUPS* = ptr TTOKEN_GROUPS + TTOKEN_OWNER* {.final, pure.} = object + Owner*: PSID + + PTOKENOWNER* = ptr TTOKEN_OWNER + TTOKEN_PRIMARY_GROUP* {.final, pure.} = object + PrimaryGroup*: PSID + + PTOKENPRIMARYGROUP* = ptr TTOKEN_PRIMARY_GROUP + TTOKEN_PRIVILEGES* {.final, pure.} = object + PrivilegeCount*: DWORD + Privileges*: array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES] + + PTOKEN_PRIVILEGES* = ptr TTOKEN_PRIVILEGES + LPTOKEN_PRIVILEGES* = ptr TTOKEN_PRIVILEGES + TTOKEN_STATISTICS* {.final, pure.} = object + TokenId*: LUID + AuthenticationId*: LUID + ExpirationTime*: LARGE_INTEGER + TokenType*: TTOKEN_TYPE + ImpersonationLevel*: SECURITY_IMPERSONATION_LEVEL + DynamicCharged*: DWORD + DynamicAvailable*: DWORD + GroupCount*: DWORD + PrivilegeCount*: DWORD + ModifiedId*: LUID + + PTOKENSTATISTICS* = ptr TTOKEN_STATISTICS + TTOKEN_USER* {.final, pure.} = object + User*: SID_AND_ATTRIBUTES + + PTOKENUSER* = ptr TTOKEN_USER + TOOLINFO* {.final, pure.} = object + cbSize*: UINT + uFlags*: UINT + hwnd*: HWND + uId*: UINT + rect*: RECT + hinst*: HINST + lpszText*: LPTSTR + + LPTOOLINFO* = ptr TOOLINFO + TTOOLINFO* = TOOLINFO + PTOOLINFO* = ptr TOOLINFO + TOOLTIPTEXT* {.final, pure.} = object + hdr*: NMHDR + lpszText*: LPTSTR + szText*: array[0..79, char] + hinst*: HINST + uFlags*: UINT + + LPTOOLTIPTEXT* = ptr TOOLTIPTEXT + TTOOLTIPTEXT* = TOOLTIPTEXT + PTOOLTIPTEXT* = ptr TOOLTIPTEXT + TPMPARAMS* {.final, pure.} = object + cbSize*: UINT + rcExclude*: RECT + + LPTPMPARAMS* = ptr TPMPARAMS + TTPMPARAMS* = TPMPARAMS + PTPMPARAMS* = ptr TPMPARAMS + TRANSMIT_FILE_BUFFERS* {.final, pure.} = object + Head*: PVOID + HeadLength*: DWORD + Tail*: PVOID + TailLength*: DWORD + + TTRANSMITFILEBUFFERS* = TRANSMIT_FILE_BUFFERS + PTRANSMITFILEBUFFERS* = ptr TRANSMIT_FILE_BUFFERS + TTHITTESTINFO* {.final, pure.} = object + hwnd*: HWND + pt*: POINT + ti*: TOOLINFO + + LPHITTESTINFO* = ptr TTHITTESTINFO + TTTHITTESTINFO* = TTHITTESTINFO + PTTHITTESTINFO* = ptr TTHITTESTINFO + TTPOLYCURVE* {.final, pure.} = object + wType*: int16 + cpfx*: int16 + apfx*: array[0..0, POINTFX] + + LPTTPOLYCURVE* = ptr TTPOLYCURVE + TTTPOLYCURVE* = TTPOLYCURVE + PTTPOLYCURVE* = ptr TTPOLYCURVE + TTPOLYGONHEADER* {.final, pure.} = object + cb*: DWORD + dwType*: DWORD + pfxStart*: POINTFX + + LPTTPOLYGONHEADER* = ptr TTPOLYGONHEADER + TTTPOLYGONHEADER* = TTPOLYGONHEADER + PTTPOLYGONHEADER* = ptr TTPOLYGONHEADER + TV_DISPINFO* {.final, pure.} = object + hdr*: NMHDR + item*: TV_ITEM + + TTVDISPINFO* = TV_DISPINFO + PTVDISPINFO* = ptr TV_DISPINFO + TV_HITTESTINFO* {.final, pure.} = object + pt*: POINT + flags*: UINT + hItem*: HTREEITEM + + LPTV_HITTESTINFO* = ptr TV_HITTESTINFO + TTVHITTESTINFO* = TV_HITTESTINFO + PTVHITTESTINFO* = ptr TV_HITTESTINFO + TV_INSERTSTRUCT* {.final, pure.} = object + hParent*: HTREEITEM + hInsertAfter*: HTREEITEM + item*: TV_ITEM + + LPTV_INSERTSTRUCT* = ptr TV_INSERTSTRUCT + TTVINSERTSTRUCT* = TV_INSERTSTRUCT + PTVINSERTSTRUCT* = ptr TV_INSERTSTRUCT + TV_KEYDOWN* {.final, pure.} = object + hdr*: NMHDR + wVKey*: int16 + flags*: UINT + + TTVKEYDOWN* = TV_KEYDOWN + PTVKEYDOWN* = ptr TV_KEYDOWN + TV_SORTCB* {.final, pure.} = object + hParent*: HTREEITEM + lpfnCompare*: PFNTVCOMPARE + lParam*: LPARAM + + LPTV_SORTCB* = ptr TV_SORTCB + TTVSORTCB* = TV_SORTCB + PTVSORTCB* = ptr TV_SORTCB + UDACCEL* {.final, pure.} = object + nSec*: UINT + nInc*: UINT + + TUDACCEL* = UDACCEL + PUDACCEL* = ptr UDACCEL + UNIVERSAL_NAME_INFO* {.final, pure.} = object + lpUniversalName*: LPTSTR + + TUNIVERSALNAMEINFO* = UNIVERSAL_NAME_INFO + PUNIVERSALNAMEINFO* = ptr UNIVERSAL_NAME_INFO + USEROBJECTFLAGS* {.final, pure.} = object + fInherit*: WINBOOL + fReserved*: WINBOOL + dwFlags*: DWORD + + TUSEROBJECTFLAGS* = USEROBJECTFLAGS + PUSEROBJECTFLAGS* = ptr USEROBJECTFLAGS + VALENT* {.final, pure.} = object + 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* {.final, pure.} = object + StartingOffset*: LARGE_INTEGER + len*: DWORD + + TVERIFYINFORMATION* = VERIFY_INFORMATION + PVERIFYINFORMATION* = ptr VERIFY_INFORMATION + VS_FIXEDFILEINFO* {.final, pure.} = object + dwSignature*: DWORD + dwStrucVersion*: DWORD + dwFileVersionMS*: DWORD + dwFileVersionLS*: DWORD + dwProductVersionMS*: DWORD + dwProductVersionLS*: DWORD + dwFileFlagsMask*: DWORD + dwFileFlags*: DWORD + dwFileOS*: DWORD + dwFileType*: DWORD + dwFileSubtype*: DWORD + dwFileDateMS*: DWORD + dwFileDateLS*: DWORD + + TVSFIXEDFILEINFO* = VS_FIXEDFILEINFO + PVSFIXEDFILEINFO* = ptr VS_FIXEDFILEINFO + WIN32_FIND_DATA* {.final, pure.} = object + dwFileAttributes*: DWORD + ftCreationTime*: FILETIME + ftLastAccessTime*: FILETIME + ftLastWriteTime*: FILETIME + nFileSizeHigh*: DWORD + nFileSizeLow*: DWORD + dwReserved0*: DWORD + dwReserved1*: DWORD + cFileName*: array[0..(MAX_PATH) - 1, 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* {.final, pure.} = object + dwFileAttributes*: DWORD + ftCreationTime*: FILETIME + ftLastAccessTime*: FILETIME + ftLastWriteTime*: FILETIME + nFileSizeHigh*: DWORD + nFileSizeLow*: DWORD + dwReserved0*: DWORD + dwReserved1*: DWORD + cFileName*: array[0..(MAX_PATH) - 1, WCHAR] + cAlternateFileName*: array[0..13, WCHAR] + + LPWIN32_FIND_DATAW* = ptr WIN32_FIND_DATAW + PWIN32_FIND_DATAW* = ptr WIN32_FIND_DATAW + TWIN32FINDDATAW* = WIN32_FIND_DATAW + WIN32_STREAM_ID* {.final, pure.} = object + dwStreamId*: DWORD + dwStreamAttributes*: DWORD + Size*: LARGE_INTEGER + dwStreamNameSize*: DWORD + cStreamName*: ptr WCHAR + + TWIN32STREAMID* = WIN32_STREAM_ID + PWIN32STREAMID* = ptr WIN32_STREAM_ID + WINDOWPLACEMENT* {.final, pure.} = object + len*: UINT + flags*: UINT + showCmd*: UINT + ptMinPosition*: POINT + ptMaxPosition*: POINT + rcNormalPosition*: RECT + + TWINDOWPLACEMENT* = WINDOWPLACEMENT + PWINDOWPLACEMENT* = ptr WINDOWPLACEMENT + WNDCLASS* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + cbStructure*: DWORD + hwndOwner*: HWND + lpConnRes*: LPNETRESOURCE + dwFlags*: DWORD + dwDevNum*: DWORD + + LPCONNECTDLGSTRUCT* = ptr CONNECTDLGSTRUCT + TCONNECTDLGSTRUCT* = CONNECTDLGSTRUCT + PCONNECTDLGSTRUCT* = ptr CONNECTDLGSTRUCT + DISCDLGSTRUCT* {.final, pure.} = object + cbStructure*: DWORD + hwndOwner*: HWND + lpLocalName*: LPTSTR + lpRemoteName*: LPTSTR + dwFlags*: DWORD + + LPDISCDLGSTRUCT* = ptr DISCDLGSTRUCT + TDISCDLGSTRUCT* = DISCDLGSTRUCT + TDISCDLGSTRUCTA* = DISCDLGSTRUCT + PDISCDLGSTRUCT* = ptr DISCDLGSTRUCT + NETINFOSTRUCT* {.final, pure.} = object + cbStructure*: DWORD + dwProviderVersion*: DWORD + dwStatus*: DWORD + dwCharacteristics*: DWORD + dwHandle*: DWORD + wNetType*: int16 + dwPrinters*: DWORD + dwDrives*: DWORD + + LPNETINFOSTRUCT* = ptr NETINFOSTRUCT + TNETINFOSTRUCT* = NETINFOSTRUCT + PNETINFOSTRUCT* = ptr NETINFOSTRUCT + NETCONNECTINFOSTRUCT* {.final, pure.} = object + 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* {.final, pure.} = object + x*: float32 + y*: float32 + + TPOINTFLOAT* = POINTFLOAT + PPOINTFLOAT* = ptr POINTFLOAT + GLYPHMETRICSFLOAT* {.final, pure.} = object + gmfBlackBoxX*: float32 + gmfBlackBoxY*: float32 + gmfptGlyphOrigin*: POINTFLOAT + gmfCellIncX*: float32 + gmfCellIncY*: float32 + + LPGLYPHMETRICSFLOAT* = ptr GLYPHMETRICSFLOAT + TGLYPHMETRICSFLOAT* = GLYPHMETRICSFLOAT + PGLYPHMETRICSFLOAT* = ptr GLYPHMETRICSFLOAT + LAYERPLANEDESCRIPTOR* {.final, pure.} = object + nSize*: int16 + nVersion*: int16 + dwFlags*: DWORD + iPixelType*: int8 + cColorBits*: int8 + cRedBits*: int8 + cRedShift*: int8 + cGreenBits*: int8 + cGreenShift*: int8 + cBlueBits*: int8 + cBlueShift*: int8 + cAlphaBits*: int8 + cAlphaShift*: int8 + cAccumBits*: int8 + cAccumRedBits*: int8 + cAccumGreenBits*: int8 + cAccumBlueBits*: int8 + cAccumAlphaBits*: int8 + cDepthBits*: int8 + cStencilBits*: int8 + cAuxBuffers*: int8 + iLayerPlane*: int8 + bReserved*: int8 + crTransparent*: COLORREF + + LPLAYERPLANEDESCRIPTOR* = ptr LAYERPLANEDESCRIPTOR + TLAYERPLANEDESCRIPTOR* = LAYERPLANEDESCRIPTOR + PLAYERPLANEDESCRIPTOR* = ptr LAYERPLANEDESCRIPTOR + PIXELFORMATDESCRIPTOR* {.final, pure.} = object + nSize*: int16 + nVersion*: int16 + dwFlags*: DWORD + iPixelType*: int8 + cColorBits*: int8 + cRedBits*: int8 + cRedShift*: int8 + cGreenBits*: int8 + cGreenShift*: int8 + cBlueBits*: int8 + cBlueShift*: int8 + cAlphaBits*: int8 + cAlphaShift*: int8 + cAccumBits*: int8 + cAccumRedBits*: int8 + cAccumGreenBits*: int8 + cAccumBlueBits*: int8 + cAccumAlphaBits*: int8 + cDepthBits*: int8 + cStencilBits*: int8 + cAuxBuffers*: int8 + iLayerType*: int8 + bReserved*: int8 + dwLayerMask*: DWORD + dwVisibleMask*: DWORD + dwDamageMask*: DWORD + + LPPIXELFORMATDESCRIPTOR* = ptr PIXELFORMATDESCRIPTOR + TPIXELFORMATDESCRIPTOR* = PIXELFORMATDESCRIPTOR + PPIXELFORMATDESCRIPTOR* = ptr PIXELFORMATDESCRIPTOR + USER_INFO_2* {.final, pure.} = object + usri2_name*: LPWSTR + usri2_password*: LPWSTR + usri2_password_age*: DWORD + usri2_priv*: DWORD + usri2_home_dir*: LPWSTR + usri2_comment*: LPWSTR + usri2_flags*: DWORD + usri2_script_path*: LPWSTR + usri2_auth_flags*: DWORD + usri2_full_name*: LPWSTR + usri2_usr_comment*: LPWSTR + usri2_parms*: LPWSTR + usri2_workstations*: LPWSTR + usri2_last_logon*: DWORD + usri2_last_logoff*: DWORD + usri2_acct_expires*: DWORD + usri2_max_storage*: DWORD + usri2_units_per_week*: DWORD + usri2_logon_hours*: PBYTE + usri2_bad_pw_count*: DWORD + usri2_num_logons*: DWORD + usri2_logon_server*: LPWSTR + usri2_country_code*: DWORD + usri2_code_page*: DWORD + + PUSER_INFO_2* = ptr USER_INFO_2 + LPUSER_INFO_2* = ptr USER_INFO_2 + TUSERINFO2* = USER_INFO_2 + USER_INFO_0* {.final, pure.} = object + usri0_name*: LPWSTR + + PUSER_INFO_0* = ptr USER_INFO_0 + LPUSER_INFO_0* = ptr USER_INFO_0 + TUSERINFO0* = USER_INFO_0 + USER_INFO_3* {.final, pure.} = object + usri3_name*: LPWSTR + usri3_password*: LPWSTR + usri3_password_age*: DWORD + usri3_priv*: DWORD + usri3_home_dir*: LPWSTR + usri3_comment*: LPWSTR + usri3_flags*: DWORD + usri3_script_path*: LPWSTR + usri3_auth_flags*: DWORD + usri3_full_name*: LPWSTR + usri3_usr_comment*: LPWSTR + usri3_parms*: LPWSTR + usri3_workstations*: LPWSTR + usri3_last_logon*: DWORD + usri3_last_logoff*: DWORD + usri3_acct_expires*: DWORD + usri3_max_storage*: DWORD + usri3_units_per_week*: DWORD + usri3_logon_hours*: PBYTE + usri3_bad_pw_count*: DWORD + usri3_num_logons*: DWORD + usri3_logon_server*: LPWSTR + usri3_country_code*: DWORD + usri3_code_page*: DWORD + usri3_user_id*: DWORD + usri3_primary_group_id*: DWORD + usri3_profile*: LPWSTR + usri3_home_dir_drive*: LPWSTR + usri3_password_expired*: DWORD + + PUSER_INFO_3* = ptr USER_INFO_3 + LPUSER_INFO_3* = ptr USER_INFO_3 + TUSERINFO3* = USER_INFO_3 + GROUP_INFO_2* {.final, pure.} = object + grpi2_name*: LPWSTR + grpi2_comment*: LPWSTR + grpi2_group_id*: DWORD + grpi2_attributes*: DWORD + + PGROUP_INFO_2* = ptr GROUP_INFO_2 + TGROUPINFO2* = GROUP_INFO_2 + LOCALGROUP_INFO_0* {.final, pure.} = object + lgrpi0_name*: LPWSTR + + PLOCALGROUP_INFO_0* = ptr LOCALGROUP_INFO_0 + LPLOCALGROUP_INFO_0* = ptr LOCALGROUP_INFO_0 + TLOCALGROUPINFO0* = LOCALGROUP_INFO_0 + IMAGE_DOS_HEADER* {.final, pure.} = object + e_magic*: int16 + e_cblp*: int16 + e_cp*: int16 + e_crlc*: int16 + e_cparhdr*: int16 + e_minalloc*: int16 + e_maxalloc*: int16 + e_ss*: int16 + e_sp*: int16 + e_csum*: int16 + e_ip*: int16 + e_cs*: int16 + e_lfarlc*: int16 + e_ovno*: int16 + e_res*: array[0..3, int16] + e_oemid*: int16 + e_oeminfo*: int16 + e_res2*: array[0..9, int16] + e_lfanew*: LONG + + PIMAGE_DOS_HEADER* = ptr IMAGE_DOS_HEADER + TIMAGEDOSHEADER* = IMAGE_DOS_HEADER + NOTIFYICONDATAA* {.final, pure.} = object + cbSize*: DWORD + Wnd*: HWND + uID*: UINT + uFlags*: UINT + uCallbackMessage*: UINT + hIcon*: HICON + szTip*: array[0..63, Char] + + NOTIFYICONDATA* = NOTIFYICONDATAA + NOTIFYICONDATAW* {.final, pure.} = object + 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* {.final, pure.} = object + wFormatTag*: int16 # format type + nChannels*: int16 # number of channels (i.e. mono, stereo, etc.) + nSamplesPerSec*: DWORD # sample rate + nAvgBytesPerSec*: DWORD # for buffer estimation + nBlockAlign*: int16 # block size of data + wBitsPerSample*: int16 # number of bits per sample of mono data + cbSize*: int16 # the count in bytes of the size of + + WIN32_FILE_ATTRIBUTE_DATA* {.final, pure.} = object + dwFileAttributes*: DWORD + ftCreationTime*: FILETIME + ftLastAccessTime*: FILETIME + ftLastWriteTime*: FILETIME + nFileSizeHigh*: DWORD + nFileSizeLow*: DWORD + + LPWIN32_FILE_ATTRIBUTE_DATA* = ptr WIN32_FILE_ATTRIBUTE_DATA + TWIN32FILEATTRIBUTEDATA* = WIN32_FILE_ATTRIBUTE_DATA + PWIN32FILEATTRIBUTEDATA* = ptr WIN32_FILE_ATTRIBUTE_DATA + # TrackMouseEvent. NT or higher only. + TTrackMouseEvent* {.final, pure.} = object + cbSize*: DWORD + dwFlags*: DWORD + hwndTrack*: HWND + dwHoverTime*: DWORD + + PTrackMouseEvent* = ptr TTrackMouseEvent + +const + ACM_OPENW* = 1127 + ACM_OPENA* = 1124 + +when defined(winUnicode): + const + ACM_OPEN* = ACM_OPENW +else: + const + ACM_OPEN* = ACM_OPENA +# UNICODE + +const + ACM_PLAY* = 1125 + ACM_STOP* = 1126 + ACN_START* = 1 + ACN_STOP* = 2 + # Buttons + BM_CLICK* = 245 + BM_GETCHECK* = 240 + BM_GETIMAGE* = 246 + BM_GETSTATE* = 242 + BM_SETCHECK* = 241 + BM_SETIMAGE* = 247 + BM_SETSTATE* = 243 + BM_SETSTYLE* = 244 + BN_CLICKED* = 0 + BN_DBLCLK* = 5 + BN_DISABLE* = 4 + BN_DOUBLECLICKED* = 5 + BN_HILITE* = 2 + BN_KILLFOCUS* = 7 + BN_PAINT* = 1 + BN_PUSHED* = 2 + BN_SETFOCUS* = 6 + BN_UNHILITE* = 3 + BN_UNPUSHED* = 3 + # Combo Box + CB_ADDSTRING* = 323 + CB_DELETESTRING* = 324 + CB_DIR* = 325 + CB_FINDSTRING* = 332 + CB_FINDSTRINGEXACT* = 344 + CB_GETCOUNT* = 326 + CB_GETCURSEL* = 327 + CB_GETDROPPEDCONTROLRECT* = 338 + CB_GETDROPPEDSTATE* = 343 + CB_GETDROPPEDWIDTH* = 351 + CB_GETEDITSEL* = 320 + CB_GETEXTENDEDUI* = 342 + CB_GETHORIZONTALEXTENT* = 349 + CB_GETITEMDATA* = 336 + CB_GETITEMHEIGHT* = 340 + CB_GETLBTEXT* = 328 + CB_GETLBTEXTLEN* = 329 + CB_GETLOCALE* = 346 + CB_GETTOPINDEX* = 347 + CB_INITSTORAGE* = 353 + CB_INSERTSTRING* = 330 + CB_LIMITTEXT* = 321 + CB_RESETCONTENT* = 331 + CB_SELECTSTRING* = 333 + CB_SETCURSEL* = 334 + CB_SETDROPPEDWIDTH* = 352 + CB_SETEDITSEL* = 322 + CB_SETEXTENDEDUI* = 341 + CB_SETHORIZONTALEXTENT* = 350 + CB_SETITEMDATA* = 337 + CB_SETITEMHEIGHT* = 339 + CB_SETLOCALE* = 345 + CB_SETTOPINDEX* = 348 + CB_SHOWDROPDOWN* = 335 + # Combo Box notifications + CBN_CLOSEUP* = 8 + CBN_DBLCLK* = 2 + CBN_DROPDOWN* = 7 + CBN_EDITCHANGE* = 5 + CBN_EDITUPDATE* = 6 + CBN_ERRSPACE* = -1 + CBN_KILLFOCUS* = 4 + CBN_SELCHANGE* = 1 + CBN_SELENDCANCEL* = 10 + CBN_SELENDOK* = 9 + CBN_SETFOCUS* = 3 + # Control Panel + # Device messages + # Drag list box + DL_BEGINDRAG* = 1157 + DL_CANCELDRAG* = 1160 + DL_DRAGGING* = 1158 + DL_DROPPED* = 1159 + # Default push button + DM_GETDEFID* = 1024 + DM_REPOSITION* = 1026 + DM_SETDEFID* = 1025 + # RTF control + EM_CANPASTE* = 1074 + EM_CANUNDO* = 198 + EM_CHARFROMPOS* = 215 + EM_DISPLAYBAND* = 1075 + EM_EMPTYUNDOBUFFER* = 205 + EM_EXGETSEL* = 1076 + EM_EXLIMITTEXT* = 1077 + EM_EXLINEFROMCHAR* = 1078 + EM_EXSETSEL* = 1079 + EM_FINDTEXT* = 1080 + EM_FINDTEXTEX* = 1103 + EM_FINDWORDBREAK* = 1100 + EM_FMTLINES* = 200 + EM_FORMATRANGE* = 1081 + EM_GETCHARFORMAT* = 1082 + EM_GETEVENTMASK* = 1083 + EM_GETFIRSTVISIBLELINE* = 206 + EM_GETHANDLE* = 189 + EM_GETLIMITTEXT* = 213 + EM_GETLINE* = 196 + EM_GETLINECOUNT* = 186 + EM_GETMARGINS* = 212 + EM_GETMODIFY* = 184 + EM_GETIMECOLOR* = 1129 + EM_GETIMEOPTIONS* = 1131 + EM_GETOPTIONS* = 1102 + EM_GETOLEINTERFACE* = 1084 + EM_GETPARAFORMAT* = 1085 + EM_GETPASSWORDCHAR* = 210 + EM_GETPUNCTUATION* = 1125 + EM_GETRECT* = 178 + EM_GETSEL* = 176 + EM_GETSELTEXT* = 1086 + EM_GETTEXTRANGE* = 1099 + EM_GETTHUMB* = 190 + EM_GETWORDBREAKPROC* = 209 + EM_GETWORDBREAKPROCEX* = 1104 + EM_GETWORDWRAPMODE* = 1127 + EM_HIDESELECTION* = 1087 + EM_LIMITTEXT* = 197 + EM_LINEFROMCHAR* = 201 + EM_LINEINDEX* = 187 + EM_LINELENGTH* = 193 + EM_LINESCROLL* = 182 + EM_PASTESPECIAL* = 1088 + EM_POSFROMCHAR* = 214 + EM_REPLACESEL* = 194 + EM_REQUESTRESIZE* = 1089 + EM_SCROLL* = 181 + EM_SCROLLCARET* = 183 + EM_SELECTIONTYPE* = 1090 + EM_SETBKGNDCOLOR* = 1091 + EM_SETCHARFORMAT* = 1092 + EM_SETEVENTMASK* = 1093 + EM_SETHANDLE* = 188 + EM_SETIMECOLOR* = 1128 + EM_SETIMEOPTIONS* = 1130 + EM_SETLIMITTEXT* = 197 + EM_SETMARGINS* = 211 + EM_SETMODIFY* = 185 + EM_SETOLECALLBACK* = 1094 + EM_SETOPTIONS* = 1101 + EM_SETPARAFORMAT* = 1095 + EM_SETPASSWORDCHAR* = 204 + EM_SETPUNCTUATION* = 1124 + EM_SETREADONLY* = 207 + EM_SETRECT* = 179 + EM_SETRECTNP* = 180 + EM_SETSEL* = 177 + EM_SETTABSTOPS* = 203 + EM_SETTARGETDEVICE* = 1096 + EM_SETWORDBREAKPROC* = 208 + EM_SETWORDBREAKPROCEX* = 1105 + EM_SETWORDWRAPMODE* = 1126 + EM_STREAMIN* = 1097 + EM_STREAMOUT* = 1098 + EM_UNDO* = 199 + # Edit control + EN_CHANGE* = 768 + EN_CORRECTTEXT* = 1797 + EN_DROPFILES* = 1795 + EN_ERRSPACE* = 1280 + EN_HSCROLL* = 1537 + EN_IMECHANGE* = 1799 + EN_KILLFOCUS* = 512 + EN_MAXTEXT* = 1281 + EN_MSGFILTER* = 1792 + EN_OLEOPFAILED* = 1801 + EN_PROTECTED* = 1796 + EN_REQUESTRESIZE* = 1793 + EN_SAVECLIPBOARD* = 1800 + EN_SELCHANGE* = 1794 + EN_SETFOCUS* = 256 + EN_STOPNOUNDO* = 1798 + EN_UPDATE* = 1024 + EN_VSCROLL* = 1538 + # File Manager extensions + # File Manager extensions DLL events + # Header control + HDM_DELETEITEM* = 4610 + HDM_GETITEMW* = 4619 + HDM_INSERTITEMW* = 4618 + HDM_SETITEMW* = 4620 + HDM_GETITEMA* = 4611 + HDM_INSERTITEMA* = 4609 + HDM_SETITEMA* = 4612 + +when defined(winUnicode): + const + HDM_GETITEM* = HDM_GETITEMW + HDM_INSERTITEM* = HDM_INSERTITEMW + HDM_SETITEM* = HDM_SETITEMW +else: + const + HDM_GETITEM* = HDM_GETITEMA + HDM_INSERTITEM* = HDM_INSERTITEMA + HDM_SETITEM* = HDM_SETITEMA +# UNICODE + +const + HDM_GETITEMCOUNT* = 4608 + HDM_HITTEST* = 4614 + HDM_LAYOUT* = 4613 + # Header control notifications + HDN_BEGINTRACKW* = -326 + HDN_DIVIDERDBLCLICKW* = -325 + HDN_ENDTRACKW* = -327 + HDN_ITEMCHANGEDW* = -321 + HDN_ITEMCHANGINGW* = -320 + HDN_ITEMCLICKW* = -322 + HDN_ITEMDBLCLICKW* = -323 + HDN_TRACKW* = -328 + HDN_BEGINTRACKA* = -306 + HDN_DIVIDERDBLCLICKA* = -305 + HDN_ENDTRACKA* = -307 + HDN_ITEMCHANGEDA* = -301 + HDN_ITEMCHANGINGA* = -300 + HDN_ITEMCLICKA* = -302 + HDN_ITEMDBLCLICKA* = -303 + HDN_TRACKA* = -308 + +when defined(winUnicode): + const + HDN_BEGINTRACK* = HDN_BEGINTRACKW + HDN_DIVIDERDBLCLICK* = HDN_DIVIDERDBLCLICKW + HDN_ENDTRACK* = HDN_ENDTRACKW + HDN_ITEMCHANGED* = HDN_ITEMCHANGEDW + HDN_ITEMCHANGING* = HDN_ITEMCHANGINGW + HDN_ITEMCLICK* = HDN_ITEMCLICKW + HDN_ITEMDBLCLICK* = HDN_ITEMDBLCLICKW + HDN_TRACK* = HDN_TRACKW +else: + const + HDN_BEGINTRACK* = HDN_BEGINTRACKA + HDN_DIVIDERDBLCLICK* = HDN_DIVIDERDBLCLICKA + HDN_ENDTRACK* = HDN_ENDTRACKA + HDN_ITEMCHANGED* = HDN_ITEMCHANGEDA + HDN_ITEMCHANGING* = HDN_ITEMCHANGINGA + HDN_ITEMCLICK* = HDN_ITEMCLICKA + HDN_ITEMDBLCLICK* = HDN_ITEMDBLCLICKA + HDN_TRACK* = HDN_TRACKA +# UNICODE + +const + # Hot key control + HKM_GETHOTKEY* = 1026 + HKM_SETHOTKEY* = 1025 + HKM_SETRULES* = 1027 + # List box + LB_ADDFILE* = 406 + LB_ADDSTRING* = 384 + LB_DELETESTRING* = 386 + LB_DIR* = 397 + LB_FINDSTRING* = 399 + LB_FINDSTRINGEXACT* = 418 + LB_GETANCHORINDEX* = 413 + LB_GETCARETINDEX* = 415 + LB_GETCOUNT* = 395 + LB_GETCURSEL* = 392 + LB_GETHORIZONTALEXTENT* = 403 + LB_GETITEMDATA* = 409 + LB_GETITEMHEIGHT* = 417 + LB_GETITEMRECT* = 408 + LB_GETLOCALE* = 422 + LB_GETSEL* = 391 + LB_GETSELCOUNT* = 400 + LB_GETSELITEMS* = 401 + LB_GETTEXT* = 393 + LB_GETTEXTLEN* = 394 + LB_GETTOPINDEX* = 398 + LB_INITSTORAGE* = 424 + LB_INSERTSTRING* = 385 + LB_ITEMFROMPOINT* = 425 + LB_RESETCONTENT* = 388 + LB_SELECTSTRING* = 396 + LB_SELITEMRANGE* = 411 + LB_SELITEMRANGEEX* = 387 + LB_SETANCHORINDEX* = 412 + LB_SETCARETINDEX* = 414 + LB_SETCOLUMNWIDTH* = 405 + LB_SETCOUNT* = 423 + LB_SETCURSEL* = 390 + LB_SETHORIZONTALEXTENT* = 404 + LB_SETITEMDATA* = 410 + LB_SETITEMHEIGHT* = 416 + LB_SETLOCALE* = 421 + LB_SETSEL* = 389 + LB_SETTABSTOPS* = 402 + LB_SETTOPINDEX* = 407 + # List box notifications + LBN_DBLCLK* = 2 + LBN_ERRSPACE* = -2 + LBN_KILLFOCUS* = 5 + LBN_SELCANCEL* = 3 + LBN_SELCHANGE* = 1 + LBN_SETFOCUS* = 4 + # List view control + LVM_ARRANGE* = 4118 + LVM_CREATEDRAGIMAGE* = 4129 + LVM_DELETEALLITEMS* = 4105 + LVM_DELETECOLUMN* = 4124 + LVM_DELETEITEM* = 4104 + LVM_ENSUREVISIBLE* = 4115 + LVM_GETBKCOLOR* = 4096 + LVM_GETCALLBACKMASK* = 4106 + LVM_GETCOLUMNWIDTH* = 4125 + LVM_GETCOUNTPERPAGE* = 4136 + LVM_GETEDITCONTROL* = 4120 + LVM_GETIMAGELIST* = 4098 + LVM_EDITLABELW* = 4214 + LVM_FINDITEMW* = 4179 + LVM_GETCOLUMNW* = 4191 + LVM_GETISEARCHSTRINGW* = 4213 + LVM_GETITEMW* = 4171 + LVM_GETITEMTEXTW* = 4211 + LVM_GETSTRINGWIDTHW* = 4183 + LVM_INSERTCOLUMNW* = 4193 + LVM_INSERTITEMW* = 4173 + LVM_SETCOLUMNW* = 4192 + LVM_SETITEMW* = 4172 + LVM_SETITEMTEXTW* = 4212 + LVM_EDITLABELA* = 4119 + LVM_FINDITEMA* = 4109 + LVM_GETCOLUMNA* = 4121 + LVM_GETISEARCHSTRINGA* = 4148 + LVM_GETITEMA* = 4101 + LVM_GETITEMTEXTA* = 4141 + LVM_GETSTRINGWIDTHA* = 4113 + LVM_INSERTCOLUMNA* = 4123 + LVM_INSERTITEMA* = 4103 + LVM_SETCOLUMNA* = 4122 + LVM_SETITEMA* = 4102 + LVM_SETITEMTEXTA* = 4142 + +when defined(winUnicode): + const + LVM_EDITLABEL* = LVM_EDITLABELW + LVM_FINDITEM* = LVM_FINDITEMW + LVM_GETCOLUMN* = LVM_GETCOLUMNW + LVM_GETISEARCHSTRING* = LVM_GETISEARCHSTRINGW + LVM_GETITEM* = LVM_GETITEMW + LVM_GETITEMTEXT* = LVM_GETITEMTEXTW + LVM_GETSTRINGWIDTH* = LVM_GETSTRINGWIDTHW + LVM_INSERTCOLUMN* = LVM_INSERTCOLUMNW + LVM_INSERTITEM* = LVM_INSERTITEMW + LVM_SETCOLUMN* = LVM_SETCOLUMNW + LVM_SETITEM* = LVM_SETITEMW + LVM_SETITEMTEXT* = LVM_SETITEMTEXTW +else: + const + LVM_EDITLABEL* = LVM_EDITLABELA + LVM_FINDITEM* = LVM_FINDITEMA + LVM_GETCOLUMN* = LVM_GETCOLUMNA + LVM_GETISEARCHSTRING* = LVM_GETISEARCHSTRINGA + LVM_GETITEM* = LVM_GETITEMA + LVM_GETITEMTEXT* = LVM_GETITEMTEXTA + LVM_GETSTRINGWIDTH* = LVM_GETSTRINGWIDTHA + LVM_INSERTCOLUMN* = LVM_INSERTCOLUMNA + LVM_INSERTITEM* = LVM_INSERTITEMA + LVM_SETCOLUMN* = LVM_SETCOLUMNA + LVM_SETITEM* = LVM_SETITEMA + LVM_SETITEMTEXT* = LVM_SETITEMTEXTA +# UNICODE + +const + LVM_GETITEMCOUNT* = 4100 + LVM_GETITEMPOSITION* = 4112 + LVM_GETITEMRECT* = 4110 + LVM_GETITEMSPACING* = 4147 + LVM_GETITEMSTATE* = 4140 + LVM_GETNEXTITEM* = 4108 + LVM_GETORIGIN* = 4137 + LVM_GETSELECTEDCOUNT* = 4146 + LVM_GETTEXTBKCOLOR* = 4133 + LVM_GETTEXTCOLOR* = 4131 + LVM_GETTOPINDEX* = 4135 + LVM_GETVIEWRECT* = 4130 + LVM_HITTEST* = 4114 + LVM_REDRAWITEMS* = 4117 + LVM_SCROLL* = 4116 + LVM_SETBKCOLOR* = 4097 + LVM_SETCALLBACKMASK* = 4107 + LVM_SETCOLUMNWIDTH* = 4126 + LVM_SETIMAGELIST* = 4099 + LVM_SETITEMCOUNT* = 4143 + LVM_SETITEMPOSITION* = 4111 + LVM_SETITEMPOSITION32* = 4145 + LVM_SETITEMSTATE* = 4139 + LVM_SETTEXTBKCOLOR* = 4134 + LVM_SETTEXTCOLOR* = 4132 + LVM_SORTITEMS* = 4144 + LVM_UPDATE* = 4138 + # List view control notifications + LVN_BEGINDRAG* = -109 + LVN_BEGINRDRAG* = -111 + LVN_COLUMNCLICK* = -108 + LVN_DELETEALLITEMS* = -104 + LVN_DELETEITEM* = -103 + LVN_BEGINLABELEDITW* = -175 + LVN_ENDLABELEDITW* = -176 + LVN_GETDISPINFOW* = -177 + LVN_SETDISPINFOW* = -178 + LVN_BEGINLABELEDITA* = -105 + LVN_ENDLABELEDITA* = -106 + LVN_GETDISPINFOA* = -150 + LVN_SETDISPINFOA* = -151 + +when defined(winUnicode): + const + LVN_BEGINLABELEDIT* = LVN_BEGINLABELEDITW + LVN_ENDLABELEDIT* = LVN_ENDLABELEDITW + LVN_GETDISPINFO* = LVN_GETDISPINFOW + LVN_SETDISPINFO* = LVN_SETDISPINFOW +else: + const + LVN_BEGINLABELEDIT* = LVN_BEGINLABELEDITA + LVN_ENDLABELEDIT* = LVN_ENDLABELEDITA + LVN_GETDISPINFO* = LVN_GETDISPINFOA + LVN_SETDISPINFO* = LVN_SETDISPINFOA +# UNICODE + +const + LVN_INSERTITEM* = -102 + LVN_ITEMCHANGED* = -101 + LVN_ITEMCHANGING* = -100 + LVN_KEYDOWN* = -155 + # Control notification + NM_CLICK* = -2 + NM_DBLCLK* = -3 + NM_KILLFOCUS* = -8 + NM_OUTOFMEMORY* = -1 + NM_RCLICK* = -5 + NM_RDBLCLK* = -6 + NM_RETURN* = -4 + NM_SETFOCUS* = -7 + # Power status + # Progress bar control + PBM_DELTAPOS* = 1027 + PBM_SETPOS* = 1026 + PBM_SETRANGE* = 1025 + PBM_SETRANGE32* = 1030 + PBM_SETSTEP* = 1028 + PBM_STEPIT* = 1029 + # Property sheets + PSM_ADDPAGE* = 1127 + PSM_APPLY* = 1134 + PSM_CANCELTOCLOSE* = 1131 + PSM_CHANGED* = 1128 + PSM_GETTABCONTROL* = 1140 + PSM_GETCURRENTPAGEHWND* = 1142 + PSM_ISDIALOGMESSAGE* = 1141 + PSM_PRESSBUTTON* = 1137 + PSM_QUERYSIBLINGS* = 1132 + PSM_REBOOTSYSTEM* = 1130 + PSM_REMOVEPAGE* = 1126 + PSM_RESTARTWINDOWS* = 1129 + PSM_SETCURSEL* = 1125 + PSM_SETCURSELID* = 1138 + PSM_SETFINISHTEXTW* = 1145 + PSM_SETTITLEW* = 1144 + PSM_SETFINISHTEXTA* = 1139 + PSM_SETTITLEA* = 1135 + +when defined(winUnicode): + const + PSM_SETFINISHTEXT* = PSM_SETFINISHTEXTW + PSM_SETTITLE* = PSM_SETTITLEW +else: + const + PSM_SETFINISHTEXT* = PSM_SETFINISHTEXTA + PSM_SETTITLE* = PSM_SETTITLEA +# UNICODE + +const + PSM_SETWIZBUTTONS* = 1136 + PSM_UNCHANGED* = 1133 + # Property sheet notifications + PSN_APPLY* = -202 + PSN_HELP* = -205 + PSN_KILLACTIVE* = -201 + PSN_QUERYCANCEL* = -209 + PSN_RESET* = -203 + PSN_SETACTIVE* = -200 + PSN_WIZBACK* = -206 + PSN_WIZFINISH* = -208 + PSN_WIZNEXT* = -207 + # Status window + SB_GETBORDERS* = 1031 + SB_GETPARTS* = 1030 + SB_GETRECT* = 1034 + SB_GETTEXTW* = 1037 + SB_GETTEXTLENGTHW* = 1036 + SB_SETTEXTW* = 1035 + SB_GETTEXTA* = 1026 + SB_GETTEXTLENGTHA* = 1027 + SB_SETTEXTA* = 1025 + +when defined(winUnicode): + const + SB_GETTEXT* = SB_GETTEXTW + SB_GETTEXTLENGTH* = SB_GETTEXTLENGTHW + SB_SETTEXT* = SB_SETTEXTW +else: + const + SB_GETTEXT* = SB_GETTEXTA + SB_GETTEXTLENGTH* = SB_GETTEXTLENGTHA + SB_SETTEXT* = SB_SETTEXTA +# UNICODE + +const + SB_SETMINHEIGHT* = 1032 + SB_SETPARTS* = 1028 + SB_SIMPLE* = 1033 + # Scroll bar control + SBM_ENABLE_ARROWS* = 228 + SBM_GETPOS* = 225 + SBM_GETRANGE* = 227 + SBM_GETSCROLLINFO* = 234 + SBM_SETPOS* = 224 + SBM_SETRANGE* = 226 + SBM_SETRANGEREDRAW* = 230 + SBM_SETSCROLLINFO* = 233 + # Static control + STM_GETICON* = 369 + STM_GETIMAGE* = 371 + STM_SETICON* = 368 + STM_SETIMAGE* = 370 + # Static control notifications + STN_CLICKED* = 0 + STN_DBLCLK* = 1 + STN_DISABLE* = 3 + STN_ENABLE* = 2 + # Toolbar control + TB_ADDBITMAP* = 1043 + TB_ADDBUTTONS* = 1044 + TB_AUTOSIZE* = 1057 + TB_BUTTONCOUNT* = 1048 + TB_BUTTONSTRUCTSIZE* = 1054 + TB_CHANGEBITMAP* = 1067 + TB_CHECKBUTTON* = 1026 + TB_COMMANDTOINDEX* = 1049 + TB_CUSTOMIZE* = 1051 + TB_DELETEBUTTON* = 1046 + TB_ENABLEBUTTON* = 1025 + TB_GETBITMAP* = 1068 + TB_GETBITMAPFLAGS* = 1065 + TB_GETBUTTON* = 1047 + TB_ADDSTRINGW* = 1101 + TB_GETBUTTONTEXTW* = 1099 + TB_SAVERESTOREW* = 1100 + TB_ADDSTRINGA* = 1052 + TB_GETBUTTONTEXTA* = 1069 + TB_SAVERESTOREA* = 1050 + +when defined(winUnicode): + const + TB_ADDSTRING* = TB_ADDSTRINGW + TB_GETBUTTONTEXT* = TB_GETBUTTONTEXTW + TB_SAVERESTORE* = TB_SAVERESTOREW +else: + const + TB_ADDSTRING* = TB_ADDSTRINGA + TB_GETBUTTONTEXT* = TB_GETBUTTONTEXTA + TB_SAVERESTORE* = TB_SAVERESTOREA +# UNICODE + +const + TB_GETITEMRECT* = 1053 + TB_GETROWS* = 1064 + TB_GETSTATE* = 1042 + TB_GETTOOLTIPS* = 1059 + TB_HIDEBUTTON* = 1028 + TB_INDETERMINATE* = 1029 + TB_INSERTBUTTON* = 1045 + TB_ISBUTTONCHECKED* = 1034 + TB_ISBUTTONENABLED* = 1033 + TB_ISBUTTONHIDDEN* = 1036 + TB_ISBUTTONINDETERMINATE* = 1037 + TB_ISBUTTONPRESSED* = 1035 + TB_PRESSBUTTON* = 1027 + TB_SETBITMAPSIZE* = 1056 + TB_SETBUTTONSIZE* = 1055 + TB_SETCMDID* = 1066 + TB_SETPARENT* = 1061 + TB_SETROWS* = 1063 + TB_SETSTATE* = 1041 + TB_SETTOOLTIPS* = 1060 + # Track bar control + TBM_CLEARSEL* = 1043 + TBM_CLEARTICS* = 1033 + TBM_GETCHANNELRECT* = 1050 + TBM_GETLINESIZE* = 1048 + TBM_GETNUMTICS* = 1040 + TBM_GETPAGESIZE* = 1046 + TBM_GETPOS* = 1024 + TBM_GETPTICS* = 1038 + TBM_GETRANGEMAX* = 1026 + TBM_GETRANGEMIN* = 1025 + TBM_GETSELEND* = 1042 + TBM_GETSELSTART* = 1041 + TBM_GETTHUMBLENGTH* = 1052 + TBM_GETTHUMBRECT* = 1049 + TBM_GETTIC* = 1027 + TBM_GETTICPOS* = 1039 + TBM_SETLINESIZE* = 1047 + TBM_SETPAGESIZE* = 1045 + TBM_SETPOS* = 1029 + TBM_SETRANGE* = 1030 + TBM_SETRANGEMAX* = 1032 + TBM_SETRANGEMIN* = 1031 + TBM_SETSEL* = 1034 + TBM_SETSELEND* = 1036 + TBM_SETSELSTART* = 1035 + TBM_SETTHUMBLENGTH* = 1051 + TBM_SETTIC* = 1028 + TBM_SETTICFREQ* = 1044 + # Tool bar control notifications + TBN_BEGINADJUST* = -703 + TBN_BEGINDRAG* = -701 + TBN_CUSTHELP* = -709 + TBN_ENDADJUST* = -704 + TBN_ENDDRAG* = -702 + TBN_GETBUTTONINFOW* = -720 + TBN_GETBUTTONINFOA* = -700 + +when defined(winUnicode): + const + TBN_GETBUTTONINFO* = TBN_GETBUTTONINFOW +else: + const + TBN_GETBUTTONINFO* = TBN_GETBUTTONINFOA +# UNICODE + +const + TBN_QUERYDELETE* = -707 + TBN_QUERYINSERT* = -706 + TBN_RESET* = -705 + TBN_TOOLBARCHANGE* = -708 + # Tab control + TCM_ADJUSTRECT* = 4904 + TCM_DELETEALLITEMS* = 4873 + TCM_DELETEITEM* = 4872 + TCM_GETCURFOCUS* = 4911 + TCM_GETCURSEL* = 4875 + TCM_GETIMAGELIST* = 4866 + TCM_GETITEMW* = 4924 + TCM_INSERTITEMW* = 4926 + TCM_SETITEMW* = 4925 + TCM_GETITEMA* = 4869 + TCM_INSERTITEMA* = 4871 + TCM_SETITEMA* = 4870 + +when defined(winUnicode): + const + TCM_GETITEM* = TCM_GETITEM + TCM_INSERTITEM* = TCM_INSERTITEMW + TCM_SETITEM* = TCM_SETITEMW +else: + const + TCM_GETITEM* = TCM_GETITEMA + TCM_INSERTITEM* = TCM_INSERTITEMA + TCM_SETITEM* = TCM_SETITEMA +# UNICODE + +const + TCM_GETITEMCOUNT* = 4868 + TCM_GETITEMRECT* = 4874 + TCM_GETROWCOUNT* = 4908 + TCM_GETTOOLTIPS* = 4909 + TCM_HITTEST* = 4877 + TCM_REMOVEIMAGE* = 4906 + TCM_SETCURFOCUS* = 4912 + TCM_SETCURSEL* = 4876 + TCM_SETIMAGELIST* = 4867 + TCM_SETITEMEXTRA* = 4878 + TCM_SETITEMSIZE* = 4905 + TCM_SETPADDING* = 4907 + TCM_SETTOOLTIPS* = 4910 + # Tab control notifications + TCN_KEYDOWN* = -550 + TCN_SELCHANGE* = -551 + TCN_SELCHANGING* = -552 + # Tool tip control + TTM_ACTIVATE* = 1025 + TTM_ADDTOOLW* = 1074 + TTM_DELTOOLW* = 1075 + TTM_ENUMTOOLSW* = 1082 + TTM_GETCURRENTTOOLW* = 1083 + TTM_GETTEXTW* = 1080 + TTM_GETTOOLINFOW* = 1077 + TTM_HITTESTW* = 1079 + TTM_NEWTOOLRECTW* = 1076 + TTM_SETTOOLINFOW* = 1078 + TTM_UPDATETIPTEXTW* = 1081 + TTM_ADDTOOLA* = 1028 + TTM_DELTOOLA* = 1029 + TTM_ENUMTOOLSA* = 1038 + TTM_GETCURRENTTOOLA* = 1039 + TTM_GETTEXTA* = 1035 + TTM_GETTOOLINFOA* = 1032 + TTM_HITTESTA* = 1034 + TTM_NEWTOOLRECTA* = 1030 + TTM_SETTOOLINFOA* = 1033 + TTM_UPDATETIPTEXTA* = 1036 + +when defined(winUnicode): + const + TTM_ADDTOOL* = TTM_ADDTOOLW + TTM_DELTOOL* = TTM_DELTOOLW + TTM_ENUMTOOLS* = TTM_ENUMTOOLSW + TTM_GETCURRENTTOOL* = TTM_GETCURRENTTOOLW + TTM_GETTEXT* = TTM_GETTEXTW + TTM_GETTOOLINFO* = TTM_GETTOOLINFOW + TTM_HITTEST* = TTM_HITTESTW + TTM_NEWTOOLRECT* = TTM_NEWTOOLRECTW + TTM_SETTOOLINFO* = TTM_SETTOOLINFOW + TTM_UPDATETIPTEXT* = TTM_UPDATETIPTEXTW +else: + const + TTM_ADDTOOL* = TTM_ADDTOOLA + TTM_DELTOOL* = TTM_DELTOOLA + TTM_ENUMTOOLS* = TTM_ENUMTOOLSA + TTM_GETCURRENTTOOL* = TTM_GETCURRENTTOOLA + TTM_GETTEXT* = TTM_GETTEXTA + TTM_GETTOOLINFO* = TTM_GETTOOLINFOA + TTM_HITTEST* = TTM_HITTESTA + TTM_NEWTOOLRECT* = TTM_NEWTOOLRECTA + TTM_SETTOOLINFO* = TTM_SETTOOLINFOA + TTM_UPDATETIPTEXT* = TTM_UPDATETIPTEXTA +# UNICODE + +const + TTM_GETTOOLCOUNT* = 1037 + TTM_RELAYEVENT* = 1031 + TTM_SETDELAYTIME* = 1027 + TTM_WINDOWFROMPOINT* = 1040 + # Tool tip control notification + TTN_NEEDTEXTW* = -530 + TTN_NEEDTEXTA* = -520 + +when defined(winUnicode): + const + TTN_NEEDTEXT* = TTN_NEEDTEXTW +else: + const + TTN_NEEDTEXT* = TTN_NEEDTEXTA +# UNICODE + +const + TTN_POP* = -522 + TTN_SHOW* = -521 + # Tree view control + TVM_CREATEDRAGIMAGE* = 4370 + TVM_DELETEITEM* = 4353 + TVM_ENDEDITLABELNOW* = 4374 + TVM_ENSUREVISIBLE* = 4372 + TVM_EXPAND* = 4354 + TVM_GETCOUNT* = 4357 + TVM_GETEDITCONTROL* = 4367 + TVM_GETIMAGELIST* = 4360 + TVM_GETINDENT* = 4358 + TVM_GETITEMRECT* = 4356 + TVM_GETNEXTITEM* = 4362 + TVM_GETVISIBLECOUNT* = 4368 + TVM_HITTEST* = 4369 + TVM_EDITLABELW* = 4417 + TVM_GETISEARCHSTRINGW* = 4416 + TVM_GETITEMW* = 4414 + TVM_INSERTITEMW* = 4402 + TVM_SETITEMW* = 4415 + TVM_EDITLABELA* = 4366 + TVM_GETISEARCHSTRINGA* = 4375 + TVM_GETITEMA* = 4364 + TVM_INSERTITEMA* = 4352 + TVM_SETITEMA* = 4365 + +when defined(winUnicode): + const + TVM_EDITLABEL* = TVM_EDITLABELW + TVM_GETISEARCHSTRING* = TVM_GETISEARCHSTRINGW + TVM_GETITEM* = TVM_GETITEMW + TVM_INSERTITEM* = TVM_INSERTITEMW + TVM_SETITEM* = TVM_SETITEMW +else: + const + TVM_EDITLABEL* = TVM_EDITLABELA + TVM_GETISEARCHSTRING* = TVM_GETISEARCHSTRINGA + TVM_GETITEM* = TVM_GETITEMA + TVM_INSERTITEM* = TVM_INSERTITEMA + TVM_SETITEM* = TVM_SETITEMA +# UNICODE + +const + TVM_SELECTITEM* = 4363 + TVM_SETIMAGELIST* = 4361 + TVM_SETINDENT* = 4359 + TVM_SORTCHILDREN* = 4371 + TVM_SORTCHILDRENCB* = 4373 + # Tree view control notification + TVN_KEYDOWN* = -412 + TVN_BEGINDRAGW* = -456 + TVN_BEGINLABELEDITW* = -459 + TVN_BEGINRDRAGW* = -457 + TVN_DELETEITEMW* = -458 + TVN_ENDLABELEDITW* = -460 + TVN_GETDISPINFOW* = -452 + TVN_ITEMEXPANDEDW* = -455 + TVN_ITEMEXPANDINGW* = -454 + TVN_SELCHANGEDW* = -451 + TVN_SELCHANGINGW* = -450 + TVN_SETDISPINFOW* = -453 + TVN_BEGINDRAGA* = -407 + TVN_BEGINLABELEDITA* = -410 + TVN_BEGINRDRAGA* = -408 + TVN_DELETEITEMA* = -409 + TVN_ENDLABELEDITA* = -411 + TVN_GETDISPINFOA* = -403 + TVN_ITEMEXPANDEDA* = -406 + TVN_ITEMEXPANDINGA* = -405 + TVN_SELCHANGEDA* = -402 + TVN_SELCHANGINGA* = -401 + TVN_SETDISPINFOA* = -404 + +when defined(winUnicode): + const + TVN_BEGINDRAG* = TVN_BEGINDRAGW + TVN_BEGINLABELEDIT* = TVN_BEGINLABELEDITW + TVN_BEGINRDRAG* = TVN_BEGINRDRAGW + TVN_DELETEITEM* = TVN_DELETEITEMW + TVN_ENDLABELEDIT* = TVN_ENDLABELEDITW + TVN_GETDISPINFO* = TVN_GETDISPINFOW + TVN_ITEMEXPANDED* = TVN_ITEMEXPANDEDW + TVN_ITEMEXPANDING* = TVN_ITEMEXPANDINGW + TVN_SELCHANGED* = TVN_SELCHANGEDW + TVN_SELCHANGING* = TVN_SELCHANGINGW + TVN_SETDISPINFO* = TVN_SETDISPINFOW +else: + const + TVN_BEGINDRAG* = TVN_BEGINDRAGA + TVN_BEGINLABELEDIT* = TVN_BEGINLABELEDITA + TVN_BEGINRDRAG* = TVN_BEGINRDRAGA + TVN_DELETEITEM* = TVN_DELETEITEMA + TVN_ENDLABELEDIT* = TVN_ENDLABELEDITA + TVN_GETDISPINFO* = TVN_GETDISPINFOA + TVN_ITEMEXPANDED* = TVN_ITEMEXPANDEDA + TVN_ITEMEXPANDING* = TVN_ITEMEXPANDINGA + TVN_SELCHANGED* = TVN_SELCHANGEDA + TVN_SELCHANGING* = TVN_SELCHANGINGA + TVN_SETDISPINFO* = TVN_SETDISPINFOA +# UNICODE + +const + # Up/down control + UDM_GETACCEL* = 1132 + UDM_GETBASE* = 1134 + UDM_GETBUDDY* = 1130 + UDM_GETPOS* = 1128 + UDM_GETPOS32* = 1138 + UDM_GETRANGE* = 1126 + UDM_GETRANGE32* = 1136 + UDM_SETACCEL* = 1131 + UDM_SETBASE* = 1133 + UDM_SETBUDDY* = 1129 + UDM_SETPOS* = 1127 + UDM_SETPOS32* = 1137 + UDM_SETRANGE* = 1125 + UDM_SETRANGE32* = 1135 + # Up/down control notification + UDN_DELTAPOS* = -722 + # Window messages + WM_ACTIVATE* = 6 + WM_ACTIVATEAPP* = 28 + WM_ASKCBFORMATNAME* = 780 + WM_CANCELJOURNAL* = 75 + WM_CANCELMODE* = 31 + WM_CAPTURECHANGED* = 533 + WM_CHANGECBCHAIN* = 781 + WM_CHAR* = 258 + WM_CHARTOITEM* = 47 + WM_CHILDACTIVATE* = 34 + WM_CHOOSEFONT_GETLOGFONT* = 1025 + WM_CHOOSEFONT_SETLOGFONT* = 1125 + WM_CHOOSEFONT_SETFLAGS* = 1126 + WM_CLEAR* = 771 + WM_CLOSE* = 16 + WM_COMMAND* = 273 + WM_COMPACTING* = 65 + WM_COMPAREITEM* = 57 + WM_CONTEXTMENU* = 123 + WM_COPY* = 769 + WM_COPYDATA* = 74 + WM_CREATE* = 1 + WM_CTLCOLORBTN* = 309 + WM_CTLCOLORDLG* = 310 + WM_CTLCOLOREDIT* = 307 + WM_CTLCOLORLISTBOX* = 308 + WM_CTLCOLORMSGBOX* = 306 + WM_CTLCOLORSCROLLBAR* = 311 + WM_CTLCOLORSTATIC* = 312 + WM_CUT* = 768 + WM_DEADCHAR* = 259 + WM_DELETEITEM* = 45 + WM_DESTROY* = 2 + WM_DESTROYCLIPBOARD* = 775 + WM_DEVICECHANGE* = 537 + WM_DEVMODECHANGE* = 27 + WM_DISPLAYCHANGE* = 126 + WM_DRAWCLIPBOARD* = 776 + WM_DRAWITEM* = 43 + WM_DROPFILES* = 563 + WM_ENABLE* = 10 + WM_ENDSESSION* = 22 + WM_ENTERIDLE* = 289 + WM_ENTERMENULOOP* = 529 + WM_ENTERSIZEMOVE* = 561 + WM_ERASEBKGND* = 20 + WM_EXITMENULOOP* = 530 + WM_EXITSIZEMOVE* = 562 + WM_FONTCHANGE* = 29 + WM_GETDLGCODE* = 135 + WM_GETFONT* = 49 + WM_GETHOTKEY* = 51 + WM_GETICON* = 127 + WM_GETMINMAXINFO* = 36 + WM_GETTEXT* = 13 + WM_GETTEXTLENGTH* = 14 + WM_HELP* = 83 + WM_HOTKEY* = 786 + WM_HSCROLL* = 276 + WM_HSCROLLCLIPBOARD* = 782 + WM_ICONERASEBKGND* = 39 + WM_IME_CHAR* = 646 + WM_IME_COMPOSITION* = 271 + WM_IME_COMPOSITIONFULL* = 644 + WM_IME_CONTROL* = 643 + WM_IME_ENDCOMPOSITION* = 270 + WM_IME_KEYDOWN* = 656 + WM_IME_KEYUP* = 657 + WM_IME_NOTIFY* = 642 + WM_IME_SELECT* = 645 + WM_IME_SETCONTEXT* = 641 + WM_IME_STARTCOMPOSITION* = 269 + WM_INITDIALOG* = 272 + WM_INITMENU* = 278 + WM_INITMENUPOPUP* = 279 + WM_INPUTLANGCHANGE* = 81 + WM_INPUTLANGCHANGEREQUEST* = 80 + WM_KEYDOWN* = 256 + WM_KEYUP* = 257 + WM_KILLFOCUS* = 8 + WM_LBUTTONDBLCLK* = 515 + WM_LBUTTONDOWN* = 513 + WM_LBUTTONUP* = 514 + WM_MBUTTONDBLCLK* = 521 + WM_MBUTTONDOWN* = 519 + WM_MBUTTONUP* = 520 + WM_MDIACTIVATE* = 546 + WM_MDICASCADE* = 551 + WM_MDICREATE* = 544 + WM_MDIDESTROY* = 545 + WM_MDIGETACTIVE* = 553 + WM_MDIICONARRANGE* = 552 + WM_MDIMAXIMIZE* = 549 + WM_MDINEXT* = 548 + WM_MDIREFRESHMENU* = 564 + WM_MDIRESTORE* = 547 + WM_MDISETMENU* = 560 + WM_MDITILE* = 550 + WM_MEASUREITEM* = 44 + WM_MENUCHAR* = 288 + WM_MENUSELECT* = 287 + WM_MOUSEACTIVATE* = 33 + WM_MOUSEMOVE* = 512 + WM_MOUSEWHEEL* = 522 + WM_MOUSEHOVER* = 673 + WM_MOUSELEAVE* = 675 + WM_MOVE* = 3 + WM_MOVING* = 534 + WM_NCACTIVATE* = 134 + WM_NCCALCSIZE* = 131 + WM_NCCREATE* = 129 + WM_NCDESTROY* = 130 + WM_NCHITTEST* = 132 + WM_NCLBUTTONDBLCLK* = 163 + WM_NCLBUTTONDOWN* = 161 + WM_NCLBUTTONUP* = 162 + WM_NCMBUTTONDBLCLK* = 169 + WM_NCMBUTTONDOWN* = 167 + WM_NCMBUTTONUP* = 168 + WM_NCMOUSEMOVE* = 160 + WM_NCPAINT* = 133 + WM_NCRBUTTONDBLCLK* = 166 + WM_NCRBUTTONDOWN* = 164 + WM_NCRBUTTONUP* = 165 + WM_NEXTDLGCTL* = 40 + WM_NOTIFY* = 78 + WM_NOTIFYFORMAT* = 85 + WM_NULL* = 0 + WM_PAINT* = 15 + WM_PAINTCLIPBOARD* = 777 + WM_PAINTICON* = 38 + WM_PALETTECHANGED* = 785 + WM_PALETTEISCHANGING* = 784 + WM_PARENTNOTIFY* = 528 + WM_PASTE* = 770 + WM_PENWINFIRST* = 896 + WM_PENWINLAST* = 911 + WM_POWER* = 72 + WM_POWERBROADCAST* = 536 + WM_PRINT* = 791 + WM_PRINTCLIENT* = 792 + WM_PSD_ENVSTAMPRECT* = 1029 + WM_PSD_FULLPAGERECT* = 1025 + WM_PSD_GREEKTEXTRECT* = 1028 + WM_PSD_MARGINRECT* = 1027 + WM_PSD_MINMARGINRECT* = 1026 + WM_PSD_PAGESETUPDLG* = 1024 + WM_PSD_YAFULLPAGERECT* = 1030 + WM_QUERYDRAGICON* = 55 + WM_QUERYENDSESSION* = 17 + WM_QUERYNEWPALETTE* = 783 + WM_QUERYOPEN* = 19 + WM_QUEUESYNC* = 35 + WM_QUIT* = 18 + WM_RBUTTONDBLCLK* = 518 + WM_RBUTTONDOWN* = 516 + WM_RBUTTONUP* = 517 + WM_RENDERALLFORMATS* = 774 + WM_RENDERFORMAT* = 773 + WM_SETCURSOR* = 32 + WM_SETFOCUS* = 7 + WM_SETFONT* = 48 + WM_SETHOTKEY* = 50 + WM_SETICON* = 128 + WM_SETREDRAW* = 11 + WM_SETTEXT* = 12 + WM_SETTINGCHANGE* = 26 + WM_SHOWWINDOW* = 24 + WM_SIZE* = 5 + WM_SIZECLIPBOARD* = 779 + WM_SIZING* = 532 + WM_SPOOLERSTATUS* = 42 + WM_STYLECHANGED* = 125 + WM_STYLECHANGING* = 124 + WM_SYSCHAR* = 262 + WM_SYSCOLORCHANGE* = 21 + WM_SYSCOMMAND* = 274 + WM_SYSDEADCHAR* = 263 + WM_SYSKEYDOWN* = 260 + WM_SYSKEYUP* = 261 + WM_TCARD* = 82 + WM_TIMECHANGE* = 30 + WM_TIMER* = 275 + WM_UNDO* = 772 + WM_USER* = 1024 + WM_USERCHANGED* = 84 + WM_VKEYTOITEM* = 46 + WM_VSCROLL* = 277 + WM_VSCROLLCLIPBOARD* = 778 + WM_WINDOWPOSCHANGED* = 71 + WM_WINDOWPOSCHANGING* = 70 + WM_WININICHANGE* = 26 + # Window message ranges + WM_KEYFIRST* = 256 + WM_KEYLAST* = 264 + WM_MOUSEFIRST* = 512 + WM_MOUSELAST* = 525 + WM_XBUTTONDOWN* = 523 + WM_XBUTTONUP* = 524 + WM_XBUTTONDBLCLK* = 525 + +when defined(cpu64): + type + HALFLRESULT* = DWORD + HALFPARAM* = DWORD + HALFPARAMBOOL* = WINBOOL +else: + type + HALFLRESULT* = int16 + HALFPARAM* = int16 + HALFPARAMBOOL* = WORDBOOL +type + MSG* {.final, pure.} = object + hwnd*: HWND + message*: UINT + wParam*: WPARAM + lParam*: LPARAM + time*: DWORD + pt*: POINT + + LPMSG* = ptr MSG + TMSG* = MSG + PMSG* = ptr MSG + PMessage* = ptr TMessage + TMessage* {.final, pure.} = object #fields according to ICS + msg*: UINT + wParam*: WPARAM + lParam*: LPARAM + Result*: LRESULT + + TWMSize* {.final, pure.} = object + Msg*: UINT + SizeType*: WPARAM + Width*: HALFPARAM + Height*: HALFPARAM + Result*: LRESULT + + TWMNoParams* {.final, pure.} = object + Msg*: UINT + Unused*: array[0..3, HALFPARAM] + Result*: LRESULT + + TWMCancelMode* = TWMNoParams + TWMNCDestroy* = TWMNoParams + TWMDestroy* = TWMNoParams + TWMClose* = TWMNoParams + TWMQueryUIState* = TWMNoParams + TWMUIState* {.final, pure.} = object + Msg*: UINT + Action*: int16 + Flags*: int16 + Unused*: HRESULT + + TWMChangeUIState* = TWMUIState + TWMUpdateUIState* = TWMUIState + TWMKey* {.final, pure.} = object + Msg*: UINT + CharCode*: int16 + Unused*: int16 + KeyData*: int32 + Result*: LRESULT + + TWMKeyDown* = TWMKey + TWMKeyUp* = TWMKey + TWMChar* = TWMKey + TWMSysChar* = TWMKey + TWMSysKeyDown* = TWMKey + TWMSysKeyUp* = TWMKey + TWMMenuChar* {.final, pure.} = object + Msg*: UINT + User*: Char + MenuFlag*: int16 + Menu*: HMENU + Result*: LRESULT + + TWMGetDlgCode* = TWMNoParams + TWMFontChange* = TWMNoParams + TWMGetFont* = TWMNoParams + TWMSysColorChange* = TWMNoParams + TWMQueryDragIcon* = TWMNoParams + TWMScroll* {.final, pure.} = object + Msg*: UINT + ScrollCode*: HALFPARAM + Pos*: HALFPARAM + ScrollBar*: HWND + Result*: LRESULT + + TWMHScroll* = TWMScroll + TWMVScroll* = TWMScroll + TWMGetText* {.final, pure.} = object + Msg*: UINT + TextMax*: LPARAM + Text*: cstring + Result*: LRESULT + + TWMGetTextLength* = TWMNoParams + TWMKillFocus* {.final, pure.} = object + Msg*: UINT + FocusedWnd*: HWND + UnUsed*: WPARAM + Result*: LRESULT + + TWMSetCursor* {.final, pure.} = object + Msg*: UINT + CursorWnd*: HWND + HitTest*: HALFPARAM + MouseMsg*: HALFPARAM + Result*: LRESULT + + TWMSetFocus* {.final, pure.} = object + Msg*: UINT + FocusedWnd*: HWND + Unused*: WPARAM + Result*: LRESULT + + TWMSetFont* {.final, pure.} = object + Msg*: UINT + Font*: HFONT + Redraw*: HALFPARAMBOOL + Unused*: HALFPARAM + Result*: LRESULT + + TWMShowWindow* {.final, pure.} = object + Msg*: UINT + Show*: HALFPARAMBOOL + Unused*: HALFPARAM + Status*: WPARAM + Result*: LRESULT + + TWMEraseBkgnd* {.final, pure.} = object + Msg*: UINT + DC*: HDC + Unused*: LPARAM + Result*: LRESULT + + TWMNCHitTest* {.final, pure.} = object + Msg*: UINT + Unused*: int32 + Pos*: TSmallPoint + Result*: LRESULT + + TWMMouse* {.final, pure.} = object + Msg*: UINT + Keys*: int32 + Pos*: TSmallPoint + Result*: LRESULT + + TWMLButtonDblClk* = TWMMouse + TWMLButtonDown* = TWMMouse + TWMLButtonUp* = TWMMouse + TWMMButtonDblClk* = TWMMouse + TWMMButtonDown* = TWMMouse + TWMMButtonUp* = TWMMouse + TWMMouseWheel* {.final, pure.} = object + Msg*: UINT + Keys*: int16 + WheelDelta*: int16 + Pos*: TSmallPoint + Result*: LRESULT + + TWMNCHitMessage* {.final, pure.} = object + 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* {.final, pure.} = object + Msg*: UINT + DC*: HDC + Unused*: int32 + Result*: LRESULT + + TWMCommand* {.final, pure.} = object + Msg*: UINT + ItemID*: int16 + NotifyCode*: int16 + Ctl*: HWND + Result*: LRESULT + + TWMNotify* {.final, pure.} = object + Msg*: UINT + IDCtrl*: int32 + NMHdr*: PNMHdr + Result*: LRESULT + + TWMPrint* {.final, pure.} = object + Msg*: UINT + DC*: HDC + Flags*: int + Result*: LRESULT + + TWMPrintClient* = TWMPrint + TWMWinIniChange* {.final, pure.} = object + Msg*: UINT + Unused*: int + Section*: cstring + Result*: LRESULT + + TWMContextMenu* {.final, pure.} = object + Msg*: UINT + hWnd*: HWND + Pos*: TSmallPoint + Result*: LRESULT + + TWMNCCalcSize* {.final, pure.} = object + Msg*: UINT + CalcValidRects*: WINBOOL + CalcSize_Params*: PNCCalcSizeParams + Result*: LRESULT + + TWMCharToItem* {.final, pure.} = object + Msg*: UINT + Key*: int16 + CaretPos*: int16 + ListBox*: HWND + Result*: LRESULT + + TWMVKeyToItem* = TWMCharToItem + TMyEventRange = range[0'i16..16000'i16] + TWMParentNotify* {.final, pure.} = object + 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* {.final, pure.} = object + 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* {.final, pure.} = object + Msg*: UINT + Unused*: int + Pos*: TSmallPoint + Result*: LRESULT + + TWMWindowPosMsg* {.final, pure.} = object + Msg*: UINT + Unused*: int + WindowPos*: PWindowPos + Result*: LRESULT + + TWMWindowPosChanged* = TWMWindowPosMsg + TWMWindowPosChanging* = TWMWindowPosMsg + TWMCompareItem* {.final, pure.} = object + Msg*: UINT + Ctl*: HWnd + CompareItemStruct*: PCompareItemStruct + Result*: LRESULT + + TWMDeleteItem* {.final, pure.} = object + Msg*: UINT + Ctl*: HWND + DeleteItemStruct*: PDeleteItemStruct + Result*: LRESULT + + TWMDrawItem* {.final, pure.} = object + Msg*: UINT + Ctl*: HWND + DrawItemStruct*: PDrawItemStruct + Result*: LRESULT + + TWMMeasureItem* {.final, pure.} = object + Msg*: UINT + IDCtl*: HWnd + MeasureItemStruct*: PMeasureItemStruct + Result*: LRESULT + + TWMNCCreate* {.final, pure.} = object + Msg*: UINT + Unused*: int + CreateStruct*: PCreateStruct + Result*: LRESULT + + TWMInitMenuPopup* {.final, pure.} = object + Msg*: UINT + MenuPopup*: HMENU + Pos*: int16 + SystemMenu*: WordBool + Result*: LRESULT + + TWMMenuSelect* {.final, pure.} = object + Msg*: UINT + IDItem*: int16 + MenuFlag*: int16 + Menu*: HMENU + Result*: LRESULT + + TWMActivate* {.final, pure.} = object + Msg*: UINT + Active*: int16 + Minimized*: WordBool + ActiveWindow*: HWND + Result*: LRESULT + + TWMQueryEndSession* {.final, pure.} = object + Msg*: UINT + Source*: int32 + Unused*: int32 + Result*: LRESULT + + TWMMDIActivate* {.final, pure.} = object + Msg*: UINT + DeactiveWnd*: HWND + ActiveWnd*: HWND + Result*: LRESULT + + TWMNextDlgCtl* {.final, pure.} = object + Msg*: UINT + CtlFocus*: int32 + Handle*: WordBool + Unused*: int16 + Result*: LRESULT + + TWMHelp* {.final, pure.} = object + Msg*: UINT + Unused*: int + HelpInfo*: PHelpInfo + Result*: LRESULT + + TWMGetMinMaxInfo* {.final, pure.} = object + Msg*: UINT + Unused*: int + MinMaxInfo*: PMinMaxInfo + Result*: LRESULT + + TWMSettingChange* {.final, pure.} = object + Msg*: UINT + Flag*: int + Section*: cstring + Result*: LRESULT + + TWMCreate* {.final, pure.} = object + Msg*: UINT + Unused*: int + CreateStruct*: PCreateStruct + Result*: LRESULT + + TWMCtlColor* {.final, pure.} = object + Msg*: UINT + ChildDC*: HDC + ChildWnd*: HWND + Result*: LRESULT + + TWMCtlColorScrollbar* = TWMCtlColor + TWMCtlColorStatic* = TWMCtlColor + TWMCtlColorBtn* = TWMCtlColor + TWMCtlColorListbox* = TWMCtlColor + TWMCtlColorMsgbox* = TWMCtlColor + TWMCtlColorDlg* = TWMCtlColor + TWMCtlColorEdit* = TWMCtlColor + TWMInitDialog* {.final, pure.} = object + Msg*: UINT + Focus*: HWND + InitParam*: int32 + Result*: LRESULT + + TWMNCPaint* {.final, pure.} = object + Msg*: UINT + RGN*: HRGN + Unused*: int32 + Result*: LRESULT + + TWMSetText* {.final, pure.} = object + Msg*: UINT + Unused*: int32 + Text*: cstring + Result*: LRESULT + + TWMSizeClipboard* {.final, pure.} = object + Msg*: UINT + Viewer*: HWND + RC*: THandle + Result*: LRESULT + + TWMSpoolerStatus* {.final, pure.} = object + Msg*: UINT + JobStatus*: LPARAM + JobsLeft*: WPARAM + Unused*: WPARAM + Result*: LRESULT + + TWMStyleChange* {.final, pure.} = object + Msg*: UINT + StyleType*: LPARAM + StyleStruct*: PStyleStruct + Result*: LRESULT + + TWMStyleChanged* = TWMStyleChange + TWMStyleChanging* = TWMStyleChange + TWMSysDeadChar* {.final, pure.} = object + Msg*: UINT + CharCode*: WPARAM + Unused*: WPARAM + KeyData*: LPARAM + Result*: LRESULT + + TWMSystemError* {.final, pure.} = object + Msg*: UINT + ErrSpec*: WPARAM + Unused*: LPARAM + Result*: LRESULT + + TWMTimeChange* = TWMNoParams + TWMTimer* {.final, pure.} = object + Msg*: UINT + TimerID*: LPARAM + TimerProc*: TFarProc + Result*: LRESULT + + TWMUndo* = TWMNoParams + TWMVScrollClipboard* {.final, pure.} = object + Msg*: UINT + Viewer*: HWND + ScollCode*: WPARAM + ThumbPos*: WPARAM + Result*: LRESULT + + TWMDisplayChange* {.final, pure.} = object + Msg*: UINT + BitsPerPixel*: int + Width*: WPARAM + Height*: WPARAM + Result*: LRESULT + + TWMDropFiles* {.final, pure.} = object + Msg*: UINT + Drop*: THANDLE + Unused*: LPARAM + Result*: LRESULT + + TWMEnable* {.final, pure.} = object + Msg*: int + Enabled*: WINBOOL + Unused*: int32 + Result*: int32 + + TWMMouseActivate* {.final, pure.} = object + Msg*: int + TopLevel*: HWND + HitTestCode*: int16 + MouseMsg*: int16 + Result*: int32 + + +proc GetBinaryTypeA*(lpApplicationName: LPCSTR, lpBinaryType: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "GetBinaryTypeA".} + +proc GetShortPathNameA*(lpszLongPath: LPCSTR, lpszShortPath: LPSTR, + cchBuffer: DWORD): DWORD{.stdcall, + dynlib: "kernel32", importc.} +proc GetEnvironmentStringsA*(): LPSTR{.stdcall, dynlib: "kernel32", importc.} +proc FreeEnvironmentStringsA*(para1: LPSTR): WINBOOL{.stdcall, dynlib: "kernel32", importc.} +proc FormatMessageA*(dwFlags: DWORD, lpSource: LPCVOID, dwMessageId: DWORD, + dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD, + Arguments: va_list): DWORD{.stdcall,dynlib: "kernel32", importc.} +proc CreateMailslotA*(lpName: LPCSTR, nMaxMessageSize: DWORD, + lReadTimeout: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{. + stdcall, dynlib: "kernel32", importc.} +proc lstrcmpA*(lpString1: LPCSTR, lpString2: LPCSTR): int32{.stdcall, + dynlib: "kernel32", importc.} +proc lstrcmpiA*(lpString1: LPCSTR, lpString2: LPCSTR): int32{.stdcall, dynlib: "kernel32", importc.} +proc lstrcpynA*(lpString1: LPSTR, lpString2: LPCSTR, iMaxLength: int32): LPSTR{. + stdcall, dynlib: "kernel32", importc.} +proc CreateMutexA*(lpMutexAttributes: LPSECURITY_ATTRIBUTES, + bInitialOwner: WINBOOL, lpName: LPCSTR): HANDLE{.stdcall, + dynlib: "kernel32", importc.} +proc OpenMutexA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCSTR): HANDLE{. + stdcall, dynlib: "kernel32", importc.} +proc CreateEventA*(lpEventAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: WINBOOL, bInitialState: WINBOOL, lpName: LPCSTR): HANDLE{. + stdcall, dynlib: "kernel32", importc.} +proc OpenEventA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCSTR): HANDLE{. + stdcall, dynlib: "kernel32", importc.} +proc CreateSemaphoreA*(lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES, + lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCSTR): HANDLE{. + stdcall, dynlib: "kernel32", importc.} +proc OpenSemaphoreA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, + lpName: LPCSTR): HANDLE{.stdcall, + dynlib: "kernel32", importc.} +proc CreateFileMappingA*(hFile: HANDLE, + lpFileMappingAttributes: LPSECURITY_ATTRIBUTES, + flProtect: DWORD, dwMaximumSizeHigh: DWORD, + dwMaximumSizeLow: DWORD, lpName: LPCSTR): HANDLE{. + stdcall, dynlib: "kernel32", importc.} +proc OpenFileMappingA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, + lpName: LPCSTR): HANDLE{.stdcall, + dynlib: "kernel32", importc.} +proc GetLogicalDriveStringsA*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{. + stdcall, dynlib: "kernel32", importc.} +proc LoadLibraryA*(lpLibFileName: LPCSTR): HINST{.stdcall, + dynlib: "kernel32", importc.} +proc LoadLibraryExA*(lpLibFileName: LPCSTR, hFile: HANDLE, dwFlags: DWORD): HINST{. + stdcall, dynlib: "kernel32", importc.} +proc GetModuleFileNameA*(hModule: HINST, lpFilename: LPSTR, nSize: DWORD): DWORD{. + stdcall, dynlib: "kernel32", importc.} +proc GetModuleHandleA*(lpModuleName: LPCSTR): HMODULE{.stdcall, + dynlib: "kernel32", importc.} +proc FatalAppExitA*(uAction: 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, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".} +proc GetDefaultCommConfigA*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetDefaultCommConfigA".} +proc SetDefaultCommConfigA*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigA".} +proc GetComputerNameA*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetComputerNameA".} +proc SetComputerNameA*(lpComputerName: LPCSTR): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetComputerNameA".} +proc GetUserNameA*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "GetUserNameA".} +proc LoadKeyboardLayoutA*(pwszKLID: LPCSTR, Flags: 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, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "EnumDesktopsA".} +proc CreateWindowStationA*(lpwinsta: LPSTR, dwReserved: DWORD, + dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{. + stdcall, dynlib: "user32", importc: "CreateWindowStationA".} +proc OpenWindowStationA*(lpszWinSta: LPSTR, fInherit: WINBOOL, + dwDesiredAccess: DWORD): HWINSTA{.stdcall, + dynlib: "user32", importc: "OpenWindowStationA".} +proc EnumWindowStationsA*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnumWindowStationsA".} +proc GetUserObjectInformationA*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, + nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".} +proc SetUserObjectInformationA*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, + nLength: DWORD): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetUserObjectInformationA".} +proc RegisterWindowMessageA*(lpString: LPCSTR): UINT{.stdcall, dynlib: "user32", + importc: "RegisterWindowMessageA".} +proc GetMessageA*(lpMsg: LPMSG, wnd: 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, wnd: HWND, wMsgFilterMin: UINT, + wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "PeekMessageA".} +proc SendMessageA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "SendMessageA".} +proc SendMessageTimeoutA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM, + fuFlags: UINT, uTimeout: UINT, lpdwResult: LPDWORD): LRESULT{. + stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".} +proc SendNotifyMessageA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "SendNotifyMessageA".} +proc SendMessageCallbackA*(wnd: HWND, Msg: UINT, wp: WPARAM, + lp: LPARAM, lpResultCallBack: SENDASYNCPROC, + dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32", + importc: "SendMessageCallbackA".} +proc PostMessageA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "PostMessageA".} +proc PostThreadMessageA*(idThread: DWORD, Msg: UINT, wp: WPARAM, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "PostThreadMessageA".} +proc DefWindowProcA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefWindowProcA".} +proc CallWindowProcA*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: UINT, + wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, + dynlib: "user32", importc: "CallWindowProcA".} +proc RegisterClassA*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32", + importc: "RegisterClassA".} +proc UnregisterClassA*(lpClassName: LPCSTR, hInstance: HINST): WINBOOL{.stdcall, + dynlib: "user32", importc: "UnregisterClassA".} +proc GetClassInfoA*(hInstance: HINST, lpClassName: LPCSTR, + lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, dynlib: "user32", + importc: "GetClassInfoA".} +proc RegisterClassExA*(para1: LPWNDCLASSEX): ATOM{.stdcall, dynlib: "user32", + importc: "RegisterClassExA".} +proc GetClassInfoExA*(para1: HINST, para2: LPCSTR, para3: LPWNDCLASSEX): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetClassInfoExA".} +proc CreateWindowExA*(dwExStyle: DWORD, lpClassName: LPCSTR, + lpWindowName: LPCSTR, dwStyle: DWORD, X: int32, Y: int32, + nWidth: int32, nHeight: int32, hWndParent: HWND, + menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{. + stdcall, dynlib: "user32", importc: "CreateWindowExA".} +proc CreateDialogParamA*(hInstance: HINST, lpTemplateName: LPCSTR, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", + importc: "CreateDialogParamA".} +proc CreateDialogIndirectParamA*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): HWND{.stdcall, + dynlib: "user32", importc: "CreateDialogIndirectParamA".} +proc DialogBoxParamA*(hInstance: HINST, lpTemplateName: LPCSTR, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32", + importc: "DialogBoxParamA".} +proc DialogBoxIndirectParamA*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): int32{.stdcall, + dynlib: "user32", importc: "DialogBoxIndirectParamA".} +proc SetDlgItemTextA*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCSTR): WINBOOL{. + stdcall, dynlib: "user32", importc: "SetDlgItemTextA".} +proc GetDlgItemTextA*(hDlg: HWND, nIDDlgItem: int32, lpString: LPSTR, + nMaxCount: int32): UINT{.stdcall, dynlib: "user32", + importc: "GetDlgItemTextA".} +proc SendDlgItemMessageA*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT, + wp: WPARAM, lp: LPARAM): LONG{.stdcall, + dynlib: "user32", importc: "SendDlgItemMessageA".} +proc DefDlgProcA*(hDlg: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefDlgProcA".} +proc CallMsgFilterA*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall, + dynlib: "user32", importc: "CallMsgFilterA".} +proc RegisterClipboardFormatA*(lpszFormat: LPCSTR): 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{. + stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".} +proc LoadMenuA*(hInstance: HINST, lpMenuName: LPCSTR): HMENU{.stdcall, + dynlib: "user32", importc: "LoadMenuA".} +proc LoadMenuIndirectA*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall, + dynlib: "user32", importc: "LoadMenuIndirectA".} +proc ChangeMenuA*(menu: HMENU, cmd: UINT, lpszNewItem: LPCSTR, cmdInsert: UINT, + flags: UINT): WINBOOL{.stdcall, dynlib: "user32", + importc: "ChangeMenuA".} +proc GetMenuStringA*(menu: HMENU, uIDItem: UINT, lpString: LPSTR, + nMaxCount: int32, uFlag: UINT): int32{.stdcall, + dynlib: "user32", importc: "GetMenuStringA".} +proc InsertMenuA*(menu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT, + lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32", + importc: "InsertMenuA".} +proc AppendMenuA*(menu: 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*(wnd: HWND, lpString: LPCSTR, hData: HANDLE): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetPropA".} +proc GetPropA*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, dynlib: "user32", + importc: "GetPropA".} +proc RemovePropA*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, + dynlib: "user32", importc: "RemovePropA".} +proc EnumPropsExA*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{. + stdcall, dynlib: "user32", importc: "EnumPropsExA".} +proc EnumPropsA*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall, + dynlib: "user32", importc: "EnumPropsA".} +proc SetWindowTextA*(wnd: HWND, lpString: LPCSTR): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetWindowTextA".} +proc GetWindowTextA*(wnd: HWND, lpString: LPSTR, nMaxCount: int32): int32{. + stdcall, dynlib: "user32", importc: "GetWindowTextA".} +proc GetWindowTextLengthA*(wnd: HWND): int32{.stdcall, dynlib: "user32", + importc: "GetWindowTextLengthA".} +proc MessageBoxA*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: int): int32{. + stdcall, dynlib: "user32", importc: "MessageBoxA".} +proc MessageBoxExA*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT, + wLanguageId: int16): int32{.stdcall, dynlib: "user32", + importc: "MessageBoxExA".} +proc MessageBoxIndirectA*(para1: LPMSGBOXPARAMS): int32{.stdcall, + dynlib: "user32", importc: "MessageBoxIndirectA".} +proc GetWindowLongA*(wnd: HWND, nIndex: int32): LONG{.stdcall, + dynlib: "user32", importc: "GetWindowLongA".} +proc SetWindowLongA*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.stdcall, + dynlib: "user32", importc: "SetWindowLongA".} +proc GetClassLongA*(wnd: HWND, nIndex: int32): DWORD{.stdcall, + dynlib: "user32", importc: "GetClassLongA".} +proc SetClassLongA*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.stdcall, + dynlib: "user32", importc: "SetClassLongA".} +when defined(cpu64): + proc GetWindowLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetWindowLongPtrA".} + proc SetWindowLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetWindowLongPtrA".} + proc GetClassLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetClassLongPtrA".} + proc SetClassLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetClassLongPtrA".} +else: + proc GetWindowLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetWindowLongA".} + proc SetWindowLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetWindowLongA".} + proc GetClassLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetClassLongA".} + proc SetClassLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetClassLongA".} +proc FindWindowA*(lpClassName: LPCSTR, lpWindowName: LPCSTR): HWND{.stdcall, + dynlib: "user32", importc: "FindWindowA".} +proc FindWindowExA*(para1: HWND, para2: HWND, para3: LPCSTR, para4: LPCSTR): HWND{. + stdcall, dynlib: "user32", importc: "FindWindowExA".} +proc GetClassNameA*(wnd: HWND, lpClassName: LPSTR, nMaxCount: int32): int32{. + stdcall, dynlib: "user32", importc: "GetClassNameA".} +proc SetWindowsHookExA*(idHook: int32, lpfn: HOOKPROC, hmod: HINST, + dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32", + importc: "SetWindowsHookExA".} +proc LoadBitmapA*(hInstance: HINST, lpBitmapName: LPCSTR): HBITMAP{.stdcall, + dynlib: "user32", importc: "LoadBitmapA".} +proc LoadCursorA*(hInstance: HINST, lpCursorName: LPCSTR): HCURSOR{.stdcall, + dynlib: "user32", importc: "LoadCursorA".} +proc LoadCursorFromFileA*(lpFileName: LPCSTR): HCURSOR{.stdcall, + dynlib: "user32", importc: "LoadCursorFromFileA".} +proc LoadIconA*(hInstance: HINST, lpIconName: LPCSTR): HICON{.stdcall, + dynlib: "user32", importc: "LoadIconA".} +proc LoadImageA*(para1: HINST, para2: LPCSTR, para3: 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*(wnd: HWND, hWndMDIClient: HWND, uMsg: UINT, wp: WPARAM, + lp: LPARAM): LRESULT{.stdcall, dynlib: "user32", + importc: "DefFrameProcA".} +proc DefMDIChildProcA*(wnd: HWND, uMsg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefMDIChildProcA".} +proc CreateMDIWindowA*(lpClassName: LPSTR, lpWindowName: LPSTR, dwStyle: DWORD, + X: int32, Y: int32, nWidth: int32, nHeight: int32, + hWndParent: HWND, hInstance: HINST, lp: LPARAM): HWND{. + stdcall, dynlib: "user32", importc: "CreateMDIWindowA".} +proc WinHelpA*(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: 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, menu: HMENU, hInstance: HINST, + lpParam: LPVOID): HWND +proc CreateDialogA*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): HWND +proc CreateDialogIndirectA*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): HWND +proc DialogBoxA*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): int32 +proc DialogBoxIndirectA*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): int32 +proc CreateDCA*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: pDEVMODE): HDC{. + stdcall, dynlib: "gdi32", importc: "CreateDCA".} +proc VerInstallFileA*(uFlags: DWORD, szSrcFileName: LPSTR, + szDestFileName: LPSTR, szSrcDir: LPSTR, szDestDir: LPSTR, + szCurDir: LPSTR, szTmpFile: LPSTR, lpuTmpFileLen: PUINT): DWORD{. + stdcall, dynlib: "version", importc: "VerInstallFileA".} +proc GetFileVersionInfoSizeA*(lptstrFilename: LPSTR, lpdwHandle: LPDWORD): DWORD{. + stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeA".} +proc GetFileVersionInfoA*(lptstrFilename: LPSTR, dwHandle: DWORD, dwLen: DWORD, + lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version", + importc: "GetFileVersionInfoA".} +proc VerLanguageNameA*(wLang: DWORD, szLang: LPSTR, nSize: DWORD): DWORD{. + stdcall, dynlib: "kernel32", importc: "VerLanguageNameA".} +proc VerQueryValueA*(pBlock: LPVOID, lpSubBlock: LPSTR, lplpBuffer: LPVOID, + puLen: PUINT): WINBOOL{.stdcall, dynlib: "version", + importc: "VerQueryValueA".} +proc VerFindFileA*(uFlags: DWORD, szFileName: LPSTR, szWinDir: LPSTR, + szAppDir: LPSTR, szCurDir: LPSTR, lpuCurDirLen: PUINT, + szDestDir: LPSTR, lpuDestDirLen: PUINT): DWORD{.stdcall, + dynlib: "version", importc: "VerFindFileA".} +proc RegConnectRegistryA*(lpMachineName: LPSTR, key: HKEY, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".} +proc RegCreateKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".} +proc RegCreateKeyExA*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD, + lpClass: LPSTR, dwOptions: DWORD, samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".} +proc RegDeleteKeyA*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegDeleteKeyA".} +proc RegDeleteValueA*(key: HKEY, lpValueName: LPCSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegDeleteValueA".} +proc RegEnumKeyA*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, cbName: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyA".} +proc RegEnumKeyExA*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, + lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPSTR, + lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".} +proc RegEnumValueA*(key: HKEY, dwIndex: DWORD, lpValueName: LPSTR, + lpcbValueName: LPDWORD, lpReserved: LPDWORD, + lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumValueA".} +proc RegLoadKeyA*(key: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegLoadKeyA".} +proc RegOpenKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".} +proc RegOpenKeyExA*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD, + samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall, + dynlib: "advapi32", importc: "RegOpenKeyExA".} +proc RegQueryInfoKeyA*(key: HKEY, lpClass: LPSTR, lpcbClass: LPDWORD, + lpReserved: LPDWORD, lpcSubKeys: LPDWORD, + lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD, + lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD, + lpcbMaxValueLen: LPDWORD, + lpcbSecurityDescriptor: LPDWORD, + lpftLastWriteTime: PFILETIME): LONG{.stdcall, + dynlib: "advapi32", importc: "RegQueryInfoKeyA".} +proc RegQueryValueA*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPSTR, + lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32", + importc: "RegQueryValueA".} +proc RegQueryMultipleValuesA*(key: HKEY, val_list: PVALENT, num_vals: DWORD, + lpValueBuf: LPSTR, ldwTotsize: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".} +proc RegQueryValueExA*(key: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD, + lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegQueryValueExA".} +proc RegReplaceKeyA*(key: HKEY, lpSubKey: LPCSTR, lpNewFile: LPCSTR, + lpOldFile: LPCSTR): LONG{.stdcall, dynlib: "advapi32", + importc: "RegReplaceKeyA".} +proc RegRestoreKeyA*(key: HKEY, lpFile: LPCSTR, dwFlags: DWORD): LONG{.stdcall, + dynlib: "advapi32", importc: "RegRestoreKeyA".} +proc RegSaveKeyA*(key: HKEY, lpFile: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall, + dynlib: "advapi32", importc: "RegSaveKeyA".} +proc RegSetValueA*(key: HKEY, lpSubKey: LPCSTR, dwType: DWORD, lpData: LPCSTR, + cbData: DWORD): LONG{.stdcall, dynlib: "advapi32", + importc: "RegSetValueA".} +proc RegSetValueExA*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD, + dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegSetValueExA".} +proc RegUnLoadKeyA*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegUnLoadKeyA".} +proc InitiateSystemShutdownA*(lpMachineName: LPSTR, lpMessage: LPSTR, + dwTimeout: DWORD, bForceAppsClosed: WINBOOL, + bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "InitiateSystemShutdownA".} +proc AbortSystemShutdownA*(lpMachineName: LPSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "AbortSystemShutdownA".} +proc CompareStringA*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCSTR, + cchCount1: int32, lpString2: LPCSTR, cchCount2: int32): int32{. + stdcall, dynlib: "kernel32", importc: "CompareStringA".} +proc LCMapStringA*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCSTR, + cchSrc: int32, lpDestStr: LPSTR, cchDest: int32): int32{. + stdcall, dynlib: "kernel32", importc: "LCMapStringA".} +proc GetLocaleInfoA*(Locale: LCID, LCType: LCTYPE, lpLCData: LPSTR, + cchData: int32): int32{.stdcall, dynlib: "kernel32", + importc: "GetLocaleInfoA".} +proc SetLocaleInfoA*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCSTR): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetLocaleInfoA".} +proc GetTimeFormatA*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME, + lpFormat: LPCSTR, lpTimeStr: LPSTR, cchTime: int32): int32{. + stdcall, dynlib: "kernel32", importc: "GetTimeFormatA".} +proc GetDateFormatA*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME, + lpFormat: LPCSTR, lpDateStr: LPSTR, cchDate: int32): int32{. + stdcall, dynlib: "kernel32", importc: "GetDateFormatA".} +proc GetNumberFormatA*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR, + lpFormat: PNUMBERFMT, lpNumberStr: LPSTR, + cchNumber: int32): int32{.stdcall, dynlib: "kernel32", + importc: "GetNumberFormatA".} +proc GetCurrencyFormatA*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR, + lpFormat: PCURRENCYFMT, lpCurrencyStr: LPSTR, + cchCurrency: int32): int32{.stdcall, + dynlib: "kernel32", importc: "GetCurrencyFormatA".} +proc EnumCalendarInfoA*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID, + Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "EnumCalendarInfoA".} +proc EnumTimeFormatsA*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID, + dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "EnumTimeFormatsA".} +proc EnumDateFormatsA*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID, + dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "EnumDateFormatsA".} +proc GetStringTypeExA*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR, + cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetStringTypeExA".} +proc GetStringTypeA*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR, + cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetStringTypeA".} +proc FoldStringA*(dwMapFlags: DWORD, lpSrcStr: LPCSTR, cchSrc: int32, + lpDestStr: LPSTR, cchDest: int32): int32{.stdcall, + dynlib: "kernel32", importc: "FoldStringA".} +proc EnumSystemLocalesA*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesA".} +proc EnumSystemCodePagesA*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, dwFlags: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "EnumSystemCodePagesA".} +proc PeekConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".} +proc ReadConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".} +proc WriteConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".} +proc ReadConsoleOutputA*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, dwBufferCoord: COORD, + lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "ReadConsoleOutputA".} +proc WriteConsoleOutputA*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, dwBufferCoord: COORD, + lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "WriteConsoleOutputA".} +proc ReadConsoleOutputCharacterA*(hConsoleOutput: HANDLE, lpCharacter: LPSTR, + nLength: DWORD, dwReadCoord: COORD, + lpNumberOfCharsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".} +proc WriteConsoleOutputCharacterA*(hConsoleOutput: HANDLE, lpCharacter: LPCSTR, + nLength: DWORD, dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".} +proc FillConsoleOutputCharacterA*(hConsoleOutput: HANDLE, cCharacter: CHAR, + nLength: DWORD, dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".} +proc ScrollConsoleScreenBufferA*(hConsoleOutput: HANDLE, + lpScrollRectangle: PSMALL_RECT, + lpClipRectangle: PSMALL_RECT, + dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".} +proc GetConsoleTitleA*(lpConsoleTitle: LPSTR, nSize: DWORD): DWORD{.stdcall, + dynlib: "kernel32", importc: "GetConsoleTitleA".} +proc SetConsoleTitleA*(lpConsoleTitle: LPCSTR): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetConsoleTitleA".} +proc ReadConsoleA*(hConsoleInput: HANDLE, lpBuffer: LPVOID, + nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, + lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "ReadConsoleA".} +proc WriteConsoleA*(hConsoleOutput: HANDLE, lpBuffer: pointer, + nNumberOfCharsToWrite: DWORD, + lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleA".} +proc WNetAddConnectionA*(lpRemoteName: LPCSTR, lpPassword: LPCSTR, + lpLocalName: LPCSTR): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetAddConnectionA".} +proc WNetAddConnection2A*(lpNetResource: LPNETRESOURCE, lpPassword: LPCSTR, + lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetAddConnection2A".} +proc WNetAddConnection3A*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, + lpPassword: LPCSTR, lpUserName: LPCSTR, dwFlags: DWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetAddConnection3A".} +proc WNetCancelConnectionA*(lpName: LPCSTR, fForce: WINBOOL): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetCancelConnectionA".} +proc WNetCancelConnection2A*(lpName: LPCSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetCancelConnection2A".} +proc WNetGetConnectionA*(lpLocalName: LPCSTR, lpRemoteName: LPSTR, + lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetGetConnectionA".} +proc WNetUseConnectionA*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, + lpUserID: LPCSTR, lpPassword: LPCSTR, dwFlags: DWORD, + lpAccessName: LPSTR, lpBufferSize: LPDWORD, + lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetUseConnectionA".} +proc WNetSetConnectionA*(lpName: LPCSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetSetConnectionA".} +proc WNetConnectionDialog1A*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".} +proc WNetDisconnectDialog1A*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetDisconnectDialog1A".} +proc WNetOpenEnumA*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD, + lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetOpenEnumA".} +proc WNetEnumResourceA*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID, + lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetEnumResourceA".} +proc WNetGetUniversalNameA*(lpLocalPath: LPCSTR, dwInfoLevel: DWORD, + lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".} +proc WNetGetUserA*(lpName: LPCSTR, lpUserName: LPSTR, lpnLength: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetUserA".} +proc WNetGetProviderNameA*(dwNetType: DWORD, lpProviderName: LPSTR, + lpBufferSize: LPDWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetGetProviderNameA".} +proc WNetGetNetworkInformationA*(lpProvider: LPCSTR, + lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".} +proc WNetGetLastErrorA*(lpError: LPDWORD, lpErrorBuf: LPSTR, + nErrorBufSize: DWORD, lpNameBuf: LPSTR, + nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetGetLastErrorA".} +proc MultinetGetConnectionPerformanceA*(lpNetResource: LPNETRESOURCE, + lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall, + dynlib: "mpr", importc: "MultinetGetConnectionPerformanceA".} +proc ChangeServiceConfigA*(hService: SC_HANDLE, dwServiceType: DWORD, + dwStartType: DWORD, dwErrorControl: DWORD, + lpBinaryPathName: LPCSTR, lpLoadOrderGroup: LPCSTR, + lpdwTagId: LPDWORD, lpDependencies: LPCSTR, + lpServiceStartName: LPCSTR, lpPassword: LPCSTR, + lpDisplayName: LPCSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "ChangeServiceConfigA".} +proc CreateServiceA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, + lpDisplayName: LPCSTR, dwDesiredAccess: DWORD, + dwServiceType: DWORD, dwStartType: DWORD, + dwErrorControl: DWORD, lpBinaryPathName: LPCSTR, + lpLoadOrderGroup: LPCSTR, lpdwTagId: LPDWORD, + lpDependencies: LPCSTR, lpServiceStartName: LPCSTR, + lpPassword: LPCSTR): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "CreateServiceA".} +proc EnumDependentServicesA*(hService: SC_HANDLE, dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUS, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EnumDependentServicesA".} +proc EnumServicesStatusA*(hSCManager: SC_HANDLE, dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EnumServicesStatusA".} +proc GetServiceKeyNameA*(hSCManager: SC_HANDLE, lpDisplayName: LPCSTR, + lpServiceName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameA".} +proc GetServiceDisplayNameA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, + lpDisplayName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameA".} +proc OpenSCManagerA*(lpMachineName: LPCSTR, lpDatabaseName: LPCSTR, + dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "OpenSCManagerA".} +proc OpenServiceA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, + dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "OpenServiceA".} +proc QueryServiceConfigA*(hService: SC_HANDLE, + lpServiceConfig: LPQUERY_SERVICE_CONFIG, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceConfigA".} +proc QueryServiceLockStatusA*(hSCManager: SC_HANDLE, + lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusA".} +proc RegisterServiceCtrlHandlerA*(lpServiceName: LPCSTR, + lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{. + stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerA".} +proc StartServiceCtrlDispatcherA*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherA".} +proc StartServiceA*(hService: SC_HANDLE, dwNumServiceArgs: DWORD, + lpServiceArgVectors: LPCSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "StartServiceA".} +proc DragQueryFileA*(para1: HDROP, para2: int, para3: cstring, para4: int): int{. + stdcall, dynlib: "shell32", importc: "DragQueryFileA".} +proc ExtractAssociatedIconA*(para1: HINST, para2: cstring, para3: LPWORD): HICON{. + stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconA".} +proc ExtractIconA*(para1: HINST, para2: cstring, para3: int): HICON{.stdcall, + dynlib: "shell32", importc: "ExtractIconA".} +proc FindExecutableA*(para1: cstring, para2: cstring, para3: cstring): HINST{. + stdcall, dynlib: "shell32", importc: "FindExecutableA".} +proc ShellAboutA*(para1: HWND, para2: cstring, para3: cstring, para4: HICON): int32{. + stdcall, dynlib: "shell32", importc: "ShellAboutA".} +proc ShellExecuteA*(para1: HWND, para2: cstring, para3: cstring, para4: cstring, + para5: cstring, para6: int32): HINST{.stdcall, + dynlib: "shell32", importc: "ShellExecuteA".} +proc Shell_NotifyIconA*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{. + stdcall, dynlib: "shell32", importc: "Shell_NotifyIconA".} +proc DdeCreateStringHandleA*(para1: DWORD, para2: cstring, para3: int32): HSZ{. + stdcall, dynlib: "user32", importc: "DdeCreateStringHandleA".} +proc DdeInitializeA*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD, + para4: DWORD): 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, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "CommConfigDialogW".} +proc GetDefaultCommConfigW*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetDefaultCommConfigW".} +proc SetDefaultCommConfigW*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigW".} +proc GetComputerNameW*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetComputerNameW".} +proc SetComputerNameW*(lpComputerName: LPCWSTR): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetComputerNameW".} +proc GetUserNameW*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "GetUserNameW".} +proc LoadKeyboardLayoutW*(pwszKLID: LPCWSTR, Flags: 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, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "EnumDesktopsW".} +proc CreateWindowStationW*(lpwinsta: LPWSTR, dwReserved: DWORD, + dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{. + stdcall, dynlib: "user32", importc: "CreateWindowStationW".} +proc OpenWindowStationW*(lpszWinSta: LPWSTR, fInherit: WINBOOL, + dwDesiredAccess: DWORD): HWINSTA{.stdcall, + dynlib: "user32", importc: "OpenWindowStationW".} +proc EnumWindowStationsW*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnumWindowStationsW".} +proc GetUserObjectInformationW*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, + nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".} +proc SetUserObjectInformationW*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, + nLength: DWORD): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetUserObjectInformationW".} +proc RegisterWindowMessageW*(lpString: LPCWSTR): UINT{.stdcall, + dynlib: "user32", importc: "RegisterWindowMessageW".} +proc GetMessageW*(lpMsg: LPMSG, wnd: 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, wnd: HWND, wMsgFilterMin: UINT, + wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "PeekMessageW".} +proc SendMessageW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "SendMessageW".} +proc SendMessageTimeoutW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM, + fuFlags: UINT, uTimeout: UINT, lpdwResult: LPDWORD): LRESULT{. + stdcall, dynlib: "user32", importc: "SendMessageTimeoutW".} +proc SendNotifyMessageW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "SendNotifyMessageW".} +proc SendMessageCallbackW*(wnd: HWND, Msg: UINT, wp: WPARAM, + lp: LPARAM, lpResultCallBack: SENDASYNCPROC, + dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32", + importc: "SendMessageCallbackW".} +proc PostMessageW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "PostMessageW".} +proc PostThreadMessageW*(idThread: DWORD, Msg: UINT, wp: WPARAM, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "PostThreadMessageW".} +proc DefWindowProcW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefWindowProcW".} +proc CallWindowProcW*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: UINT, + wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, + dynlib: "user32", importc: "CallWindowProcW".} +proc RegisterClassW*(lpWndClass: LPWNDCLASSW): ATOM{.stdcall, dynlib: "user32", + importc: "RegisterClassW".} +proc UnregisterClassW*(lpClassName: LPCWSTR, hInstance: HINST): WINBOOL{. + stdcall, dynlib: "user32", importc: "UnregisterClassW".} +proc GetClassInfoW*(hInstance: HINST, lpClassName: LPCWSTR, + lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, dynlib: "user32", + importc: "GetClassInfoW".} +proc RegisterClassExW*(para1: LPWNDCLASSEXW): ATOM{.stdcall, dynlib: "user32", + importc: "RegisterClassExW".} +proc GetClassInfoExW*(para1: HINST, para2: LPCWSTR, para3: LPWNDCLASSEX): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetClassInfoExW".} +proc CreateWindowExW*(dwExStyle: DWORD, lpClassName: LPCWSTR, + lpWindowName: LPCWSTR, dwStyle: DWORD, X: int32, Y: int32, + nWidth: int32, nHeight: int32, hWndParent: HWND, + menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{. + stdcall, dynlib: "user32", importc: "CreateWindowExW".} +proc CreateDialogParamW*(hInstance: HINST, lpTemplateName: LPCWSTR, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", + importc: "CreateDialogParamW".} +proc CreateDialogIndirectParamW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): HWND{.stdcall, + dynlib: "user32", importc: "CreateDialogIndirectParamW".} +proc DialogBoxParamW*(hInstance: HINST, lpTemplateName: LPCWSTR, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32", + importc: "DialogBoxParamW".} +proc DialogBoxIndirectParamW*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): int32{.stdcall, + dynlib: "user32", importc: "DialogBoxIndirectParamW".} +proc SetDlgItemTextW*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCWSTR): WINBOOL{. + stdcall, dynlib: "user32", importc: "SetDlgItemTextW".} +proc GetDlgItemTextW*(hDlg: HWND, nIDDlgItem: int32, lpString: LPWSTR, + nMaxCount: int32): UINT{.stdcall, dynlib: "user32", + importc: "GetDlgItemTextW".} +proc SendDlgItemMessageW*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT, + wp: WPARAM, lp: LPARAM): LONG{.stdcall, + dynlib: "user32", importc: "SendDlgItemMessageW".} +proc DefDlgProcW*(hDlg: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefDlgProcW".} +proc CallMsgFilterW*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall, + dynlib: "user32", importc: "CallMsgFilterW".} +proc RegisterClipboardFormatW*(lpszFormat: LPCWSTR): 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{. + stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".} +proc LoadMenuW*(hInstance: HINST, lpMenuName: LPCWSTR): HMENU{.stdcall, + dynlib: "user32", importc: "LoadMenuW".} +proc LoadMenuIndirectW*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall, + dynlib: "user32", importc: "LoadMenuIndirectW".} +proc ChangeMenuW*(menu: HMENU, cmd: UINT, lpszNewItem: LPCWSTR, + cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "ChangeMenuW".} +proc GetMenuStringW*(menu: HMENU, uIDItem: UINT, lpString: LPWSTR, + nMaxCount: int32, uFlag: UINT): int32{.stdcall, + dynlib: "user32", importc: "GetMenuStringW".} +proc InsertMenuW*(menu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT, + lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32", + importc: "InsertMenuW".} +proc AppendMenuW*(menu: 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*(wnd: HWND, lpString: LPCWSTR, hData: HANDLE): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetPropW".} +proc GetPropW*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall, + dynlib: "user32", importc: "GetPropW".} +proc RemovePropW*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall, + dynlib: "user32", importc: "RemovePropW".} +proc EnumPropsExW*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{. + stdcall, dynlib: "user32", importc: "EnumPropsExW".} +proc EnumPropsW*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall, + dynlib: "user32", importc: "EnumPropsW".} +proc SetWindowTextW*(wnd: HWND, lpString: LPCWSTR): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetWindowTextW".} +proc GetWindowTextW*(wnd: HWND, lpString: LPWSTR, nMaxCount: int32): int32{. + stdcall, dynlib: "user32", importc: "GetWindowTextW".} +proc GetWindowTextLengthW*(wnd: HWND): int32{.stdcall, dynlib: "user32", + importc: "GetWindowTextLengthW".} +proc MessageBoxW*(wnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT): int32{. + stdcall, dynlib: "user32", importc: "MessageBoxW".} +proc MessageBoxExW*(wnd: 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*(wnd: HWND, nIndex: int32): LONG{.stdcall, + dynlib: "user32", importc: "GetWindowLongW".} +proc SetWindowLongW*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.stdcall, + dynlib: "user32", importc: "SetWindowLongW".} +proc GetClassLongW*(wnd: HWND, nIndex: int32): DWORD{.stdcall, + dynlib: "user32", importc: "GetClassLongW".} +proc SetClassLongW*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.stdcall, + dynlib: "user32", importc: "SetClassLongW".} +when defined(cpu64): + proc GetWindowLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetWindowLongPtrW".} + proc SetWindowLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetWindowLongPtrW".} + proc GetClassLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetClassLongPtrW".} + proc SetClassLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetClassLongPtrW".} +else: + proc GetWindowLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetWindowLongW".} + proc SetWindowLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetWindowLongW".} + proc GetClassLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetClassLongW".} + proc SetClassLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetClassLongW".} +proc FindWindowW*(lpClassName: LPCWSTR, lpWindowName: LPCWSTR): HWND{.stdcall, + dynlib: "user32", importc: "FindWindowW".} +proc FindWindowExW*(para1: HWND, para2: HWND, para3: LPCWSTR, para4: LPCWSTR): HWND{. + stdcall, dynlib: "user32", importc: "FindWindowExW".} +proc GetClassNameW*(wnd: HWND, lpClassName: LPWSTR, nMaxCount: int32): int32{. + stdcall, dynlib: "user32", importc: "GetClassNameW".} +proc SetWindowsHookExW*(idHook: int32, lpfn: HOOKPROC, hmod: HINST, + dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32", + importc: "SetWindowsHookExW".} +proc LoadBitmapW*(hInstance: HINST, lpBitmapName: LPCWSTR): HBITMAP{.stdcall, + dynlib: "user32", importc: "LoadBitmapW".} +proc LoadCursorW*(hInstance: HINST, lpCursorName: LPCWSTR): HCURSOR{.stdcall, + dynlib: "user32", importc: "LoadCursorW".} +proc LoadCursorFromFileW*(lpFileName: LPCWSTR): HCURSOR{.stdcall, + dynlib: "user32", importc: "LoadCursorFromFileW".} +proc LoadIconW*(hInstance: HINST, lpIconName: LPCWSTR): HICON{.stdcall, + dynlib: "user32", importc: "LoadIconW".} +proc LoadImageW*(para1: HINST, para2: LPCWSTR, para3: 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*(wnd: HWND, hWndMDIClient: HWND, uMsg: UINT, w: WPARAM, + lp: LPARAM): LRESULT{.stdcall, dynlib: "user32", + importc: "DefFrameProcW".} +proc DefMDIChildProcW*(wnd: HWND, uMsg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefMDIChildProcW".} +proc CreateMDIWindowW*(lpClassName: LPWSTR, lpWindowName: LPWSTR, + dwStyle: DWORD, X: int32, Y: int32, nWidth: int32, + nHeight: int32, hWndParent: HWND, hInstance: HINST, + lp: LPARAM): HWND{.stdcall, dynlib: "user32", + importc: "CreateMDIWindowW".} +proc WinHelpW*(hWndMain: HWND, lpszHelp: LPCWSTR, uCommand: 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, menu: HMENU, hInstance: HINST, + lpParam: LPVOID): HWND +proc CreateDialogW*(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): HWND +proc CreateDialogIndirectW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): HWND +proc DialogBoxW*(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): int32 +proc DialogBoxIndirectW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): int32 +proc CreateDCW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: pDEVMODEW): HDC{. + stdcall, dynlib: "gdi32", importc: "CreateDCW".} +proc VerInstallFileW*(uFlags: DWORD, szSrcFileName: LPWSTR, + szDestFileName: LPWSTR, szSrcDir: LPWSTR, + szDestDir: LPWSTR, szCurDir: LPWSTR, szTmpFile: LPWSTR, + lpuTmpFileLen: PUINT): DWORD{.stdcall, dynlib: "version", + importc: "VerInstallFileW".} +proc GetFileVersionInfoSizeW*(lptstrFilename: LPWSTR, lpdwHandle: LPDWORD): DWORD{. + stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeW".} +proc GetFileVersionInfoW*(lptstrFilename: LPWSTR, dwHandle: DWORD, dwLen: DWORD, + lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version", + importc: "GetFileVersionInfoW".} +proc VerLanguageNameW*(wLang: DWORD, szLang: LPWSTR, nSize: DWORD): DWORD{. + stdcall, dynlib: "kernel32", importc: "VerLanguageNameW".} +proc VerQueryValueW*(pBlock: LPVOID, lpSubBlock: LPWSTR, lplpBuffer: LPVOID, + puLen: PUINT): WINBOOL{.stdcall, dynlib: "version", + importc: "VerQueryValueW".} +proc VerFindFileW*(uFlags: DWORD, szFileName: LPWSTR, szWinDir: LPWSTR, + szAppDir: LPWSTR, szCurDir: LPWSTR, lpuCurDirLen: PUINT, + szDestDir: LPWSTR, lpuDestDirLen: PUINT): DWORD{.stdcall, + dynlib: "version", importc: "VerFindFileW".} +proc RegSetValueExW*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD, + dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegSetValueExW".} +proc RegUnLoadKeyW*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegUnLoadKeyW".} +proc InitiateSystemShutdownW*(lpMachineName: LPWSTR, lpMessage: LPWSTR, + dwTimeout: DWORD, bForceAppsClosed: WINBOOL, + bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "InitiateSystemShutdownW".} +proc AbortSystemShutdownW*(lpMachineName: LPWSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "AbortSystemShutdownW".} +proc RegRestoreKeyW*(key: HKEY, lpFile: LPCWSTR, dwFlags: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegRestoreKeyW".} +proc RegSaveKeyW*(key: HKEY, lpFile: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall, + dynlib: "advapi32", importc: "RegSaveKeyW".} +proc RegSetValueW*(key: HKEY, lpSubKey: LPCWSTR, dwType: DWORD, + lpData: LPCWSTR, cbData: DWORD): LONG{.stdcall, + dynlib: "advapi32", importc: "RegSetValueW".} +proc RegQueryValueW*(key: HKEY, lpSubKey: LPCWSTR, lpValue: LPWSTR, + lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32", + importc: "RegQueryValueW".} +proc RegQueryMultipleValuesW*(key: HKEY, val_list: PVALENT, num_vals: DWORD, + lpValueBuf: LPWSTR, ldwTotsize: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".} +proc RegQueryValueExW*(key: HKEY, lpValueName: LPCWSTR, lpReserved: LPDWORD, + lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegQueryValueExW".} +proc RegReplaceKeyW*(key: HKEY, lpSubKey: LPCWSTR, lpNewFile: LPCWSTR, + lpOldFile: LPCWSTR): LONG{.stdcall, dynlib: "advapi32", + importc: "RegReplaceKeyW".} +proc RegConnectRegistryW*(lpMachineName: LPWSTR, key: HKEY, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".} +proc RegCreateKeyW*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".} +proc RegCreateKeyExW*(key: HKEY, lpSubKey: LPCWSTR, Reserved: DWORD, + lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".} +proc RegDeleteKeyW*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegDeleteKeyW".} +proc RegDeleteValueW*(key: HKEY, lpValueName: LPCWSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegDeleteValueW".} +proc RegEnumKeyW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, cbName: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyW".} +proc RegEnumKeyExW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, + lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPWSTR, + lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".} +proc RegEnumValueW*(key: HKEY, dwIndex: DWORD, lpValueName: LPWSTR, + lpcbValueName: LPDWORD, lpReserved: LPDWORD, + lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumValueW".} +proc RegLoadKeyW*(key: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR): LONG{. + stdcall, dynlib: "advapi32", importc: "RegLoadKeyW".} +proc RegOpenKeyW*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".} +proc RegOpenKeyExW*(key: HKEY, lpSubKey: LPCWSTR, ulOptions: DWORD, + samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall, + dynlib: "advapi32", importc: "RegOpenKeyExW".} +proc RegQueryInfoKeyW*(key: HKEY, lpClass: LPWSTR, lpcbClass: LPDWORD, + lpReserved: LPDWORD, lpcSubKeys: LPDWORD, + lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD, + lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD, + lpcbMaxValueLen: LPDWORD, + lpcbSecurityDescriptor: LPDWORD, + lpftLastWriteTime: PFILETIME): LONG{.stdcall, + dynlib: "advapi32", importc: "RegQueryInfoKeyW".} +proc CompareStringW*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCWSTR, + cchCount1: int32, lpString2: LPCWSTR, cchCount2: int32): int32{. + stdcall, dynlib: "kernel32", importc: "CompareStringW".} +proc LCMapStringW*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCWSTR, + cchSrc: int32, lpDestStr: LPWSTR, cchDest: int32): int32{. + stdcall, dynlib: "kernel32", importc: "LCMapStringW".} +proc GetLocaleInfoW*(Locale: LCID, LCType: LCTYPE, lpLCData: LPWSTR, + cchData: int32): int32{.stdcall, dynlib: "kernel32", + importc: "GetLocaleInfoW".} +proc SetLocaleInfoW*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCWSTR): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetLocaleInfoW".} +proc GetTimeFormatW*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME, + lpFormat: LPCWSTR, lpTimeStr: LPWSTR, cchTime: int32): int32{. + stdcall, dynlib: "kernel32", importc: "GetTimeFormatW".} +proc GetDateFormatW*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME, + lpFormat: LPCWSTR, lpDateStr: LPWSTR, cchDate: int32): int32{. + stdcall, dynlib: "kernel32", importc: "GetDateFormatW".} +proc GetNumberFormatW*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR, + lpFormat: PNUMBERFMT, lpNumberStr: LPWSTR, + cchNumber: int32): int32{.stdcall, dynlib: "kernel32", + importc: "GetNumberFormatW".} +proc GetCurrencyFormatW*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR, + lpFormat: PCURRENCYFMT, lpCurrencyStr: LPWSTR, + cchCurrency: int32): int32{.stdcall, + dynlib: "kernel32", importc: "GetCurrencyFormatW".} +proc EnumCalendarInfoW*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID, + Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "EnumCalendarInfoW".} +proc EnumTimeFormatsW*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID, + dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "EnumTimeFormatsW".} +proc EnumDateFormatsW*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID, + dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "EnumDateFormatsW".} +proc GetStringTypeExW*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCWSTR, + cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetStringTypeExW".} +proc GetStringTypeW*(dwInfoType: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32, + lpCharType: LPWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "GetStringTypeW".} +proc FoldStringW*(dwMapFlags: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32, + lpDestStr: LPWSTR, cchDest: int32): int32{.stdcall, + dynlib: "kernel32", importc: "FoldStringW".} +proc EnumSystemLocalesW*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesW".} +proc EnumSystemCodePagesW*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, dwFlags: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "EnumSystemCodePagesW".} +proc PeekConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "PeekConsoleInputW".} +proc ReadConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".} +proc WriteConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".} +proc ReadConsoleOutputW*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, dwBufferCoord: COORD, + lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "ReadConsoleOutputW".} +proc WriteConsoleOutputW*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, dwBufferCoord: COORD, + lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "WriteConsoleOutputW".} +proc ReadConsoleOutputCharacterW*(hConsoleOutput: HANDLE, lpCharacter: LPWSTR, + nLength: DWORD, dwReadCoord: COORD, + lpNumberOfCharsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".} +proc WriteConsoleOutputCharacterW*(hConsoleOutput: HANDLE, lpCharacter: LPCWSTR, + nLength: DWORD, dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".} +proc FillConsoleOutputCharacterW*(hConsoleOutput: HANDLE, cCharacter: WCHAR, + nLength: DWORD, dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterW".} +proc ScrollConsoleScreenBufferW*(hConsoleOutput: HANDLE, + lpScrollRectangle: PSMALL_RECT, + lpClipRectangle: PSMALL_RECT, + dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".} +proc GetConsoleTitleW*(lpConsoleTitle: LPWSTR, nSize: DWORD): DWORD{.stdcall, + dynlib: "kernel32", importc: "GetConsoleTitleW".} +proc SetConsoleTitleW*(lpConsoleTitle: LPCWSTR): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetConsoleTitleW".} +proc ReadConsoleW*(hConsoleInput: HANDLE, lpBuffer: LPVOID, + nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, + lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "ReadConsoleW".} +proc WriteConsoleW*(hConsoleOutput: HANDLE, lpBuffer: pointer, + nNumberOfCharsToWrite: DWORD, + lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleW".} +proc WNetAddConnectionW*(lpRemoteName: LPCWSTR, lpPassword: LPCWSTR, + lpLocalName: LPCWSTR): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetAddConnectionW".} +proc WNetAddConnection2W*(lpNetResource: LPNETRESOURCE, lpPassword: LPCWSTR, + lpUserName: LPCWSTR, dwFlags: DWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetAddConnection2W".} +proc WNetAddConnection3W*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, + lpPassword: LPCWSTR, lpUserName: LPCWSTR, + dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetAddConnection3W".} +proc WNetCancelConnectionW*(lpName: LPCWSTR, fForce: WINBOOL): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetCancelConnectionW".} +proc WNetCancelConnection2W*(lpName: LPCWSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetCancelConnection2W".} +proc WNetGetConnectionW*(lpLocalName: LPCWSTR, lpRemoteName: LPWSTR, + lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetGetConnectionW".} +proc WNetUseConnectionW*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, + lpUserID: LPCWSTR, lpPassword: LPCWSTR, dwFlags: DWORD, + lpAccessName: LPWSTR, lpBufferSize: LPDWORD, + lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetUseConnectionW".} +proc WNetSetConnectionW*(lpName: LPCWSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetSetConnectionW".} +proc WNetConnectionDialog1W*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1W".} +proc WNetDisconnectDialog1W*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetDisconnectDialog1W".} +proc WNetOpenEnumW*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD, + lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetOpenEnumW".} +proc WNetEnumResourceW*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID, + lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetEnumResourceW".} +proc WNetGetUniversalNameW*(lpLocalPath: LPCWSTR, dwInfoLevel: DWORD, + lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameW".} +proc WNetGetUserW*(lpName: LPCWSTR, lpUserName: LPWSTR, lpnLength: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetUserW".} +proc WNetGetProviderNameW*(dwNetType: DWORD, lpProviderName: LPWSTR, + lpBufferSize: LPDWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetGetProviderNameW".} +proc WNetGetNetworkInformationW*(lpProvider: LPCWSTR, + lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationW".} +proc WNetGetLastErrorW*(lpError: LPDWORD, lpErrorBuf: LPWSTR, + nErrorBufSize: DWORD, lpNameBuf: LPWSTR, + nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetGetLastErrorW".} +proc MultinetGetConnectionPerformanceW*(lpNetResource: LPNETRESOURCE, + lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall, + dynlib: "mpr", importc: "MultinetGetConnectionPerformanceW".} +proc ChangeServiceConfigW*(hService: SC_HANDLE, dwServiceType: DWORD, + dwStartType: DWORD, dwErrorControl: DWORD, + lpBinaryPathName: LPCWSTR, lpLoadOrderGroup: LPCWSTR, + lpdwTagId: LPDWORD, lpDependencies: LPCWSTR, + lpServiceStartName: LPCWSTR, lpPassword: LPCWSTR, + lpDisplayName: LPCWSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "ChangeServiceConfigW".} +proc CreateServiceW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, + lpDisplayName: LPCWSTR, dwDesiredAccess: DWORD, + dwServiceType: DWORD, dwStartType: DWORD, + dwErrorControl: DWORD, lpBinaryPathName: LPCWSTR, + lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD, + lpDependencies: LPCWSTR, lpServiceStartName: LPCWSTR, + lpPassword: LPCWSTR): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "CreateServiceW".} +proc EnumDependentServicesW*(hService: SC_HANDLE, dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUS, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EnumDependentServicesW".} +proc EnumServicesStatusW*(hSCManager: SC_HANDLE, dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EnumServicesStatusW".} +proc GetServiceKeyNameW*(hSCManager: SC_HANDLE, lpDisplayName: LPCWSTR, + lpServiceName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameW".} +proc GetServiceDisplayNameW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, + lpDisplayName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameW".} +proc OpenSCManagerW*(lpMachineName: LPCWSTR, lpDatabaseName: LPCWSTR, + dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "OpenSCManagerW".} +proc OpenServiceW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, + dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "OpenServiceW".} +proc QueryServiceConfigW*(hService: SC_HANDLE, + lpServiceConfig: LPQUERY_SERVICE_CONFIG, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceConfigW".} +proc QueryServiceLockStatusW*(hSCManager: SC_HANDLE, + lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusW".} +proc RegisterServiceCtrlHandlerW*(lpServiceName: LPCWSTR, + lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{. + stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerW".} +proc StartServiceCtrlDispatcherW*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherW".} +proc StartServiceW*(hService: SC_HANDLE, dwNumServiceArgs: DWORD, + lpServiceArgVectors: LPCWSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "StartServiceW".} +proc DragQueryFileW*(para1: HDROP, para2: int, para3: LPCWSTR, para4: int): int{. + stdcall, dynlib: "shell32", importc: "DragQueryFileW".} +proc ExtractAssociatedIconW*(para1: HINST, para2: LPCWSTR, para3: LPWORD): HICON{. + stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconW".} +proc ExtractIconW*(para1: HINST, para2: LPCWSTR, para3: int): HICON{.stdcall, + dynlib: "shell32", importc: "ExtractIconW".} +proc FindExecutableW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR): HINST{. + stdcall, dynlib: "shell32", importc: "FindExecutableW".} +proc ShellAboutW*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: HICON): int32{. + stdcall, dynlib: "shell32", importc: "ShellAboutW".} +proc ShellExecuteW*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: LPCWSTR, + para5: LPCWSTR, para6: int32): HINST{.stdcall, + dynlib: "shell32", importc: "ShellExecuteW".} +proc Shell_NotifyIconW*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{. + stdcall, dynlib: "shell32", importc: "Shell_NotifyIconW".} +proc DdeCreateStringHandleW*(para1: DWORD, para2: LPCWSTR, para3: int32): HSZ{. + stdcall, dynlib: "user32", importc: "DdeCreateStringHandleW".} +proc DdeInitializeW*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD, + para4: DWORD): 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, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "CommConfigDialogW".} + proc GetDefaultCommConfig*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetDefaultCommConfigW".} + proc SetDefaultCommConfig*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, + dwSize: DWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetDefaultCommConfigW".} + proc GetComputerName*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetComputerNameW".} + proc SetComputerName*(lpComputerName: LPCWSTR): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetComputerNameW".} + proc GetUserName*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "GetUserNameW".} + proc LoadKeyboardLayout*(pwszKLID: LPCWSTR, Flags: 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, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "EnumDesktopsW".} + proc CreateWindowStation*(lpwinsta: LPWSTR, dwReserved: DWORD, + dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{. + stdcall, dynlib: "user32", importc: "CreateWindowStationW".} + proc OpenWindowStation*(lpszWinSta: LPWSTR, fInherit: WINBOOL, + dwDesiredAccess: DWORD): HWINSTA{.stdcall, + dynlib: "user32", importc: "OpenWindowStationW".} + proc EnumWindowStations*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnumWindowStationsW".} + proc GetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, + nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".} + proc SetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, + nLength: DWORD): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetUserObjectInformationW".} + proc RegisterWindowMessage*(lpString: LPCWSTR): UINT{.stdcall, + dynlib: "user32", importc: "RegisterWindowMessageW".} + proc GetMessage*(lpMsg: LPMSG, wnd: 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, wnd: HWND, wMsgFilterMin: UINT, + wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "PeekMessageW".} + proc SendMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "SendMessageW".} + proc SendMessageTimeout*(wnd: HWND, Msg: UINT, wp: WPARAM, + lp: LPARAM, fuFlags: UINT, uTimeout: UINT, + lpdwResult: LPDWORD): LRESULT{.stdcall, + dynlib: "user32", importc: "SendMessageTimeoutW".} + proc SendNotifyMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "SendNotifyMessageW".} + proc SendMessageCallback*(wnd: HWND, Msg: UINT, wp: WPARAM, + lp: LPARAM, lpResultCallBack: SENDASYNCPROC, + dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32", + importc: "SendMessageCallbackW".} + proc PostMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "PostMessageW".} + proc PostThreadMessage*(idThread: DWORD, Msg: UINT, wp: WPARAM, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "PostThreadMessageW".} + proc DefWindowProc*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefWindowProcW".} + proc CallWindowProc*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: UINT, + wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, + dynlib: "user32", importc: "CallWindowProcW".} + proc RegisterClass*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32", + importc: "RegisterClassW".} + proc UnregisterClass*(lpClassName: LPCWSTR, hInstance: HINST): WINBOOL{. + stdcall, dynlib: "user32", importc: "UnregisterClassW".} + proc GetClassInfo*(hInstance: HINST, lpClassName: LPCWSTR, + lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, + dynlib: "user32", importc: "GetClassInfoW".} + proc RegisterClassEx*(para1: LPWNDCLASSEXW): ATOM{.stdcall, dynlib: "user32", + importc: "RegisterClassExW".} + proc GetClassInfoEx*(para1: HINST, para2: LPCWSTR, para3: LPWNDCLASSEX): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetClassInfoExW".} + proc CreateWindowEx*(dwExStyle: DWORD, lpClassName: LPCWSTR, + lpWindowName: LPCWSTR, dwStyle: DWORD, X: int32, + Y: int32, nWidth: int32, nHeight: int32, + hWndParent: HWND, menu: HMENU, hInstance: HINST, + lpParam: LPVOID): HWND{.stdcall, dynlib: "user32", + importc: "CreateWindowExW".} + proc CreateDialogParam*(hInstance: HINST, lpTemplateName: LPCWSTR, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", + importc: "CreateDialogParamW".} + proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): HWND{.stdcall, + dynlib: "user32", importc: "CreateDialogIndirectParamW".} + proc DialogBoxParam*(hInstance: HINST, lpTemplateName: LPCWSTR, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32", + importc: "DialogBoxParamW".} + proc DialogBoxIndirectParam*(hInstance: HINST, + hDialogTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): int32{.stdcall, + dynlib: "user32", importc: "DialogBoxIndirectParamW".} + proc SetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCWSTR): WINBOOL{. + stdcall, dynlib: "user32", importc: "SetDlgItemTextW".} + proc GetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPWSTR, + nMaxCount: int32): UINT{.stdcall, dynlib: "user32", + importc: "GetDlgItemTextW".} + proc SendDlgItemMessage*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT, + wp: WPARAM, lp: LPARAM): LONG{.stdcall, + dynlib: "user32", importc: "SendDlgItemMessageW".} + proc DefDlgProc*(hDlg: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefDlgProcW".} + proc CallMsgFilter*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall, + dynlib: "user32", importc: "CallMsgFilterW".} + proc RegisterClipboardFormat*(lpszFormat: LPCWSTR): 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{. + stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".} + proc LoadMenu*(hInstance: HINST, lpMenuName: LPCWSTR): HMENU{.stdcall, + dynlib: "user32", importc: "LoadMenuW".} + proc LoadMenuIndirect*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall, + dynlib: "user32", importc: "LoadMenuIndirectW".} + proc ChangeMenu*(menu: HMENU, cmd: UINT, lpszNewItem: LPCWSTR, + cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "ChangeMenuW".} + proc GetMenuString*(menu: HMENU, uIDItem: UINT, lpString: LPWSTR, + nMaxCount: int32, uFlag: UINT): int32{.stdcall, + dynlib: "user32", importc: "GetMenuStringW".} + proc InsertMenu*(menu: HMENU, uPosition: UINT, uFlags: UINT, + uIDNewItem: UINT, lpNewItem: LPCWSTR): WINBOOL{.stdcall, + dynlib: "user32", importc: "InsertMenuW".} + proc AppendMenu*(menu: 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*(wnd: HWND, lpString: LPCWSTR, hData: HANDLE): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetPropW".} + proc GetProp*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall, + dynlib: "user32", importc: "GetPropW".} + proc RemoveProp*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall, + dynlib: "user32", importc: "RemovePropW".} + proc EnumPropsEx*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{. + stdcall, dynlib: "user32", importc: "EnumPropsExW".} + proc EnumProps*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall, + dynlib: "user32", importc: "EnumPropsW".} + proc SetWindowText*(wnd: HWND, lpString: LPCWSTR): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetWindowTextW".} + proc GetWindowText*(wnd: HWND, lpString: LPWSTR, nMaxCount: int32): int32{. + stdcall, dynlib: "user32", importc: "GetWindowTextW".} + proc GetWindowTextLength*(wnd: HWND): int32{.stdcall, dynlib: "user32", + importc: "GetWindowTextLengthW".} + proc MessageBox*(wnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT): int32{. + stdcall, dynlib: "user32", importc: "MessageBoxW".} + proc MessageBoxEx*(wnd: 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*(wnd: HWND, nIndex: int32): LONG{.stdcall, + dynlib: "user32", importc: "GetWindowLongW".} + proc SetWindowLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{. + stdcall, dynlib: "user32", importc: "SetWindowLongW".} + proc GetClassLong*(wnd: HWND, nIndex: int32): DWORD{.stdcall, + dynlib: "user32", importc: "GetClassLongW".} + proc SetClassLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{. + stdcall, dynlib: "user32", importc: "SetClassLongW".} + when defined(cpu64): + proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetWindowLongPtrW".} + proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetWindowLongPtrW".} + proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetClassLongPtrW".} + proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetClassLongPtrW".} + else: + proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetWindowLongW".} + proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetWindowLongW".} + proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetClassLongW".} + proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetClassLongW".} + proc FindWindow*(lpClassName: LPCWSTR, lpWindowName: LPCWSTR): HWND{.stdcall, + dynlib: "user32", importc: "FindWindowW".} + proc FindWindowEx*(para1: HWND, para2: HWND, para3: LPCWSTR, para4: LPCWSTR): HWND{. + stdcall, dynlib: "user32", importc: "FindWindowExW".} + proc GetClassName*(wnd: HWND, lpClassName: LPWSTR, nMaxCount: int32): int32{. + stdcall, dynlib: "user32", importc: "GetClassNameW".} + proc SetWindowsHookEx*(idHook: int32, lpfn: HOOKPROC, hmod: HINST, + dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32", + importc: "SetWindowsHookExW".} + proc LoadBitmap*(hInstance: HINST, lpBitmapName: LPCWSTR): HBITMAP{.stdcall, + dynlib: "user32", importc: "LoadBitmapW".} + proc LoadCursor*(hInstance: HINST, lpCursorName: LPCWSTR): HCURSOR{.stdcall, + dynlib: "user32", importc: "LoadCursorW".} + proc LoadCursorFromFile*(lpFileName: LPCWSTR): HCURSOR{.stdcall, + dynlib: "user32", importc: "LoadCursorFromFileW".} + proc LoadIcon*(hInstance: HINST, lpIconName: LPCWSTR): HICON{.stdcall, + dynlib: "user32", importc: "LoadIconW".} + proc LoadImage*(para1: HINST, para2: LPCWSTR, para3: 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*(wnd: HWND, hWndMDIClient: HWND, uMsg: UINT, + wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, + dynlib: "user32", importc: "DefFrameProcW".} + proc DefMDIChildProc*(wnd: HWND, uMsg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefMDIChildProcW".} + proc CreateMDIWindow*(lpClassName: LPWSTR, lpWindowName: LPWSTR, + dwStyle: DWORD, X: int32, Y: int32, nWidth: int32, + nHeight: int32, hWndParent: HWND, hInstance: HINST, + lp: LPARAM): HWND{.stdcall, dynlib: "user32", + importc: "CreateMDIWindowW".} + proc WinHelp*(hWndMain: HWND, lpszHelp: LPCWSTR, uCommand: 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, menu: HMENU, + hInstance: HINST, lpParam: LPVOID): HWND + proc CreateDialog*(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): HWND + proc CreateDialogIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): HWND + proc DialogBox*(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): int32 + proc DialogBoxIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): int32 + proc CreateDC*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: pDEVMODE): HDC{. + stdcall, dynlib: "gdi32", importc: "CreateDCW".} + proc VerInstallFile*(uFlags: DWORD, szSrcFileName: LPWSTR, + szDestFileName: LPWSTR, szSrcDir: LPWSTR, + szDestDir: LPWSTR, szCurDir: LPWSTR, szTmpFile: LPWSTR, + lpuTmpFileLen: PUINT): DWORD{.stdcall, dynlib: "version", + importc: "VerInstallFileW".} + proc GetFileVersionInfoSize*(lptstrFilename: LPWSTR, lpdwHandle: LPDWORD): DWORD{. + stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeW".} + proc GetFileVersionInfo*(lptstrFilename: LPWSTR, dwHandle: DWORD, + dwLen: DWORD, lpData: LPVOID): WINBOOL{.stdcall, + dynlib: "version", importc: "GetFileVersionInfoW".} + proc VerLanguageName*(wLang: DWORD, szLang: LPWSTR, nSize: DWORD): DWORD{. + stdcall, dynlib: "kernel32", importc: "VerLanguageNameW".} + proc VerQueryValue*(pBlock: LPVOID, lpSubBlock: LPWSTR, lplpBuffer: LPVOID, + puLen: PUINT): WINBOOL{.stdcall, dynlib: "version", + importc: "VerQueryValueW".} + proc VerFindFile*(uFlags: DWORD, szFileName: LPWSTR, szWinDir: LPWSTR, + szAppDir: LPWSTR, szCurDir: LPWSTR, lpuCurDirLen: PUINT, + szDestDir: LPWSTR, lpuDestDirLen: PUINT): DWORD{.stdcall, + dynlib: "version", importc: "VerFindFileW".} + proc RegSetValueEx*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD, + dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegSetValueExW".} + proc RegUnLoadKey*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegUnLoadKeyW".} + proc InitiateSystemShutdown*(lpMachineName: LPWSTR, lpMessage: LPWSTR, + dwTimeout: DWORD, bForceAppsClosed: WINBOOL, + bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "InitiateSystemShutdownW".} + proc AbortSystemShutdown*(lpMachineName: LPWSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "AbortSystemShutdownW".} + proc RegRestoreKey*(key: HKEY, lpFile: LPCWSTR, dwFlags: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegRestoreKeyW".} + proc RegSaveKey*(key: HKEY, lpFile: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall, + dynlib: "advapi32", importc: "RegSaveKeyW".} + proc RegSetValue*(key: HKEY, lpSubKey: LPCWSTR, dwType: DWORD, + lpData: LPCWSTR, cbData: DWORD): LONG{.stdcall, + dynlib: "advapi32", importc: "RegSetValueW".} + proc RegQueryValue*(key: HKEY, lpSubKey: LPCWSTR, lpValue: LPWSTR, + lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32", + importc: "RegQueryValueW".} + proc RegQueryMultipleValues*(key: HKEY, val_list: PVALENT, num_vals: DWORD, + lpValueBuf: LPWSTR, ldwTotsize: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".} + proc RegQueryValueEx*(key: HKEY, lpValueName: LPCWSTR, lpReserved: LPDWORD, + lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegQueryValueExW".} + proc RegReplaceKey*(key: HKEY, lpSubKey: LPCWSTR, lpNewFile: LPCWSTR, + lpOldFile: LPCWSTR): LONG{.stdcall, dynlib: "advapi32", + importc: "RegReplaceKeyW".} + proc RegConnectRegistry*(lpMachineName: LPWSTR, key: HKEY, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".} + proc RegCreateKey*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".} + proc RegCreateKeyEx*(key: HKEY, lpSubKey: LPCWSTR, Reserved: DWORD, + lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".} + proc RegDeleteKey*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegDeleteKeyW".} + proc RegDeleteValue*(key: HKEY, lpValueName: LPCWSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegDeleteValueW".} + proc RegEnumKey*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, cbName: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyW".} + proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, + lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPWSTR, + lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".} + proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: LPWSTR, + lpcbValueName: LPDWORD, lpReserved: LPDWORD, + lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumValueW".} + proc RegLoadKey*(key: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR): LONG{. + stdcall, dynlib: "advapi32", importc: "RegLoadKeyW".} + proc RegOpenKey*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".} + proc RegOpenKeyEx*(key: HKEY, lpSubKey: LPCWSTR, ulOptions: DWORD, + samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall, + dynlib: "advapi32", importc: "RegOpenKeyExW".} + proc RegQueryInfoKey*(key: HKEY, lpClass: LPWSTR, lpcbClass: LPDWORD, + lpReserved: LPDWORD, lpcSubKeys: LPDWORD, + lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD, + lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD, + lpcbMaxValueLen: LPDWORD, + lpcbSecurityDescriptor: LPDWORD, + lpftLastWriteTime: PFILETIME): LONG{.stdcall, + dynlib: "advapi32", importc: "RegQueryInfoKeyW".} + proc CompareString*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCWSTR, + cchCount1: int32, lpString2: LPCWSTR, cchCount2: int32): int32{. + stdcall, dynlib: "kernel32", importc: "CompareStringW".} + proc LCMapString*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCWSTR, + cchSrc: int32, lpDestStr: LPWSTR, cchDest: int32): int32{. + stdcall, dynlib: "kernel32", importc: "LCMapStringW".} + proc GetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPWSTR, + cchData: int32): int32{.stdcall, dynlib: "kernel32", + importc: "GetLocaleInfoW".} + proc SetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCWSTR): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetLocaleInfoW".} + proc GetTimeFormat*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME, + lpFormat: LPCWSTR, lpTimeStr: LPWSTR, cchTime: int32): int32{. + stdcall, dynlib: "kernel32", importc: "GetTimeFormatW".} + proc GetDateFormat*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME, + lpFormat: LPCWSTR, lpDateStr: LPWSTR, cchDate: int32): int32{. + stdcall, dynlib: "kernel32", importc: "GetDateFormatW".} + proc GetNumberFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR, + lpFormat: PNUMBERFMT, lpNumberStr: LPWSTR, + cchNumber: int32): int32{.stdcall, dynlib: "kernel32", + importc: "GetNumberFormatW".} + proc GetCurrencyFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR, + lpFormat: PCURRENCYFMT, lpCurrencyStr: LPWSTR, + cchCurrency: int32): int32{.stdcall, + dynlib: "kernel32", importc: "GetCurrencyFormatW".} + proc EnumCalendarInfo*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID, + Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "EnumCalendarInfoW".} + proc EnumTimeFormats*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID, + dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "EnumTimeFormatsW".} + proc EnumDateFormats*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID, + dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "EnumDateFormatsW".} + proc GetStringTypeEx*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCWSTR, + cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetStringTypeExW".} + proc GetStringType*(dwInfoType: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32, + lpCharType: LPWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "GetStringTypeW".} + proc FoldString*(dwMapFlags: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32, + lpDestStr: LPWSTR, cchDest: int32): int32{.stdcall, + dynlib: "kernel32", importc: "FoldStringW".} + proc EnumSystemLocales*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesW".} + proc EnumSystemCodePages*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, + dwFlags: DWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "EnumSystemCodePagesW".} + proc PeekConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "PeekConsoleInputW".} + proc ReadConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".} + proc WriteConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".} + proc ReadConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, dwBufferCoord: COORD, + lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "ReadConsoleOutputW".} + proc WriteConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, dwBufferCoord: COORD, + lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "WriteConsoleOutputW".} + proc ReadConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPWSTR, + nLength: DWORD, dwReadCoord: COORD, + lpNumberOfCharsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".} + proc WriteConsoleOutputCharacter*(hConsoleOutput: HANDLE, + lpCharacter: LPCWSTR, nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".} + proc FillConsoleOutputCharacter*(hConsoleOutput: HANDLE, cCharacter: WCHAR, + nLength: DWORD, dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterW".} + proc ScrollConsoleScreenBuffer*(hConsoleOutput: HANDLE, + lpScrollRectangle: PSMALL_RECT, + lpClipRectangle: PSMALL_RECT, + dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".} + proc GetConsoleTitle*(lpConsoleTitle: LPWSTR, nSize: DWORD): DWORD{.stdcall, + dynlib: "kernel32", importc: "GetConsoleTitleW".} + proc SetConsoleTitle*(lpConsoleTitle: LPCWSTR): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetConsoleTitleW".} + proc ReadConsole*(hConsoleInput: HANDLE, lpBuffer: LPVOID, + nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, + lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "ReadConsoleW".} + proc WriteConsole*(hConsoleOutput: HANDLE, lpBuffer: pointer, + nNumberOfCharsToWrite: DWORD, + lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleW".} + proc WNetAddConnection*(lpRemoteName: LPCWSTR, lpPassword: LPCWSTR, + lpLocalName: LPCWSTR): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetAddConnectionW".} + proc WNetAddConnection2*(lpNetResource: LPNETRESOURCE, lpPassword: LPCWSTR, + lpUserName: LPCWSTR, dwFlags: DWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetAddConnection2W".} + proc WNetAddConnection3*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, + lpPassword: LPCWSTR, lpUserName: LPCWSTR, + dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetAddConnection3W".} + proc WNetCancelConnection*(lpName: LPCWSTR, fForce: WINBOOL): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetCancelConnectionW".} + proc WNetCancelConnection2*(lpName: LPCWSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetCancelConnection2W".} + proc WNetGetConnection*(lpLocalName: LPCWSTR, lpRemoteName: LPWSTR, + lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetGetConnectionW".} + proc WNetUseConnection*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, + lpUserID: LPCWSTR, lpPassword: LPCWSTR, + dwFlags: DWORD, lpAccessName: LPWSTR, + lpBufferSize: LPDWORD, lpResult: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetUseConnectionW".} + proc WNetSetConnection*(lpName: LPCWSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetSetConnectionW".} + proc WNetConnectionDialog1*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1W".} + proc WNetDisconnectDialog1*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetDisconnectDialog1W".} + proc WNetOpenEnum*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD, + lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetOpenEnumW".} + proc WNetEnumResource*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID, + lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetEnumResourceW".} + proc WNetGetUniversalName*(lpLocalPath: LPCWSTR, dwInfoLevel: DWORD, + lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameW".} + proc WNetGetUser*(lpName: LPCWSTR, lpUserName: LPWSTR, lpnLength: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetUserW".} + proc WNetGetProviderName*(dwNetType: DWORD, lpProviderName: LPWSTR, + lpBufferSize: LPDWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetGetProviderNameW".} + proc WNetGetNetworkInformation*(lpProvider: LPCWSTR, + lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationW".} + proc WNetGetLastError*(lpError: LPDWORD, lpErrorBuf: LPWSTR, + nErrorBufSize: DWORD, lpNameBuf: LPWSTR, + nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetGetLastErrorW".} + proc MultinetGetConnectionPerformance*(lpNetResource: LPNETRESOURCE, + lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall, + dynlib: "mpr", importc: "MultinetGetConnectionPerformanceW".} + proc ChangeServiceConfig*(hService: SC_HANDLE, dwServiceType: DWORD, + dwStartType: DWORD, dwErrorControl: DWORD, + lpBinaryPathName: LPCWSTR, + lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD, + lpDependencies: LPCWSTR, + lpServiceStartName: LPCWSTR, lpPassword: LPCWSTR, + lpDisplayName: LPCWSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "ChangeServiceConfigW".} + proc CreateService*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, + lpDisplayName: LPCWSTR, dwDesiredAccess: DWORD, + dwServiceType: DWORD, dwStartType: DWORD, + dwErrorControl: DWORD, lpBinaryPathName: LPCWSTR, + lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD, + lpDependencies: LPCWSTR, lpServiceStartName: LPCWSTR, + lpPassword: LPCWSTR): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "CreateServiceW".} + proc EnumDependentServices*(hService: SC_HANDLE, dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUS, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EnumDependentServicesW".} + proc EnumServicesStatus*(hSCManager: SC_HANDLE, dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EnumServicesStatusW".} + proc GetServiceKeyName*(hSCManager: SC_HANDLE, lpDisplayName: LPCWSTR, + lpServiceName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameW".} + proc GetServiceDisplayName*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, + lpDisplayName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameW".} + proc OpenSCManager*(lpMachineName: LPCWSTR, lpDatabaseName: LPCWSTR, + dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "OpenSCManagerW".} + proc OpenService*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR, + dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "OpenServiceW".} + proc QueryServiceConfig*(hService: SC_HANDLE, + lpServiceConfig: LPQUERY_SERVICE_CONFIG, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceConfigW".} + proc QueryServiceLockStatus*(hSCManager: SC_HANDLE, + lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusW".} + proc RegisterServiceCtrlHandler*(lpServiceName: LPCWSTR, + lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{. + stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerW".} + proc StartServiceCtrlDispatcher*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherW".} + proc StartService*(hService: SC_HANDLE, dwNumServiceArgs: DWORD, + lpServiceArgVectors: LPCWSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "StartServiceW".} + proc DragQueryFile*(para1: HDROP, para2: int, para3: LPCWSTR, para4: int): int{. + stdcall, dynlib: "shell32", importc: "DragQueryFileW".} + proc ExtractAssociatedIcon*(para1: HINST, para2: LPCWSTR, para3: LPWORD): HICON{. + stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconW".} + proc ExtractIcon*(para1: HINST, para2: LPCWSTR, para3: int): HICON{.stdcall, + dynlib: "shell32", importc: "ExtractIconW".} + proc FindExecutable*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR): HINST{. + stdcall, dynlib: "shell32", importc: "FindExecutableW".} + proc ShellAbout*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: HICON): int32{. + stdcall, dynlib: "shell32", importc: "ShellAboutW".} + proc ShellExecute*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, + para4: LPCWSTR, para5: LPCWSTR, para6: int32): HINST{. + stdcall, dynlib: "shell32", importc: "ShellExecuteW".} + proc Shell_NotifyIcon*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{. + stdcall, dynlib: "shell32", importc: "Shell_NotifyIconW".} + proc DdeCreateStringHandle*(para1: DWORD, para2: LPCWSTR, para3: int32): HSZ{. + stdcall, dynlib: "user32", importc: "DdeCreateStringHandleW".} + proc DdeInitialize*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD, + para4: DWORD): 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, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".} + proc GetDefaultCommConfig*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetDefaultCommConfigA".} + proc SetDefaultCommConfig*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigA".} + proc GetComputerName*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetComputerNameA".} + proc SetComputerName*(lpComputerName: LPCSTR): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetComputerNameA".} + proc GetUserName*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "GetUserNameA".} + proc wvsprintf*(para1: LPSTR, para2: LPCSTR, arglist: va_list): int32{. + stdcall, dynlib: "user32", importc: "wvsprintfA".} + proc LoadKeyboardLayout*(pwszKLID: LPCSTR, Flags: 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, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "EnumDesktopsA".} + proc CreateWindowStation*(lpwinsta: LPSTR, dwReserved: DWORD, + dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{. + stdcall, dynlib: "user32", importc: "CreateWindowStationA".} + proc OpenWindowStation*(lpszWinSta: LPSTR, fInherit: WINBOOL, + dwDesiredAccess: DWORD): HWINSTA{.stdcall, + dynlib: "user32", importc: "OpenWindowStationA".} + proc EnumWindowStations*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnumWindowStationsA".} + proc GetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, + nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".} + proc SetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID, + nLength: DWORD): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetUserObjectInformationA".} + proc RegisterWindowMessage*(lpString: LPCSTR): UINT{.stdcall, + dynlib: "user32", importc: "RegisterWindowMessageA".} + proc GetMessage*(lpMsg: LPMSG, wnd: 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, wnd: HWND, wMsgFilterMin: UINT, + wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "PeekMessageA".} + proc SendMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "SendMessageA".} + proc SendMessageTimeout*(wnd: HWND, Msg: UINT, wp: WPARAM, + lp: LPARAM, fuFlags: UINT, uTimeout: UINT, + lpdwResult: LPDWORD): LRESULT{.stdcall, + dynlib: "user32", importc: "SendMessageTimeoutA".} + proc SendNotifyMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "SendNotifyMessageA".} + proc SendMessageCallback*(wnd: HWND, Msg: UINT, wp: WPARAM, + lp: LPARAM, lpResultCallBack: SENDASYNCPROC, + dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32", + importc: "SendMessageCallbackA".} + proc PostMessage*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "PostMessageA".} + proc PostThreadMessage*(idThread: DWORD, Msg: UINT, wp: WPARAM, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "PostThreadMessageA".} + proc DefWindowProc*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefWindowProcA".} + proc CallWindowProc*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: UINT, + wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, + dynlib: "user32", importc: "CallWindowProcA".} + proc RegisterClass*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32", + importc: "RegisterClassA".} + proc UnregisterClass*(lpClassName: LPCSTR, hInstance: HINST): WINBOOL{. + stdcall, dynlib: "user32", importc: "UnregisterClassA".} + proc GetClassInfo*(hInstance: HINST, lpClassName: LPCSTR, + lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, + dynlib: "user32", importc: "GetClassInfoA".} + proc RegisterClassEx*(para1: LPWNDCLASSEX): ATOM{.stdcall, dynlib: "user32", + importc: "RegisterClassExA".} + proc GetClassInfoEx*(para1: HINST, para2: LPCSTR, para3: LPWNDCLASSEX): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetClassInfoExA".} + proc CreateWindowEx*(dwExStyle: DWORD, lpClassName: LPCSTR, + lpWindowName: LPCSTR, dwStyle: DWORD, X: int32, Y: int32, + nWidth: int32, nHeight: int32, hWndParent: HWND, + menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{. + stdcall, dynlib: "user32", importc: "CreateWindowExA".} + proc CreateDialogParam*(hInstance: HINST, lpTemplateName: LPCSTR, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", + importc: "CreateDialogParamA".} + proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): HWND{.stdcall, + dynlib: "user32", importc: "CreateDialogIndirectParamA".} + proc DialogBoxParam*(hInstance: HINST, lpTemplateName: LPCSTR, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32", + importc: "DialogBoxParamA".} + proc DialogBoxIndirectParam*(hInstance: HINST, + hDialogTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC, + dwInitParam: LPARAM): int32{.stdcall, + dynlib: "user32", importc: "DialogBoxIndirectParamA".} + proc SetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCSTR): WINBOOL{. + stdcall, dynlib: "user32", importc: "SetDlgItemTextA".} + proc GetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPSTR, + nMaxCount: int32): UINT{.stdcall, dynlib: "user32", + importc: "GetDlgItemTextA".} + proc SendDlgItemMessage*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT, + wp: WPARAM, lp: LPARAM): LONG{.stdcall, + dynlib: "user32", importc: "SendDlgItemMessageA".} + proc DefDlgProc*(hDlg: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefDlgProcA".} + proc CallMsgFilter*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall, + dynlib: "user32", importc: "CallMsgFilterA".} + proc RegisterClipboardFormat*(lpszFormat: LPCSTR): 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{. + stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".} + proc LoadMenu*(hInstance: HINST, lpMenuName: LPCSTR): HMENU{.stdcall, + dynlib: "user32", importc: "LoadMenuA".} + proc LoadMenuIndirect*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall, + dynlib: "user32", importc: "LoadMenuIndirectA".} + proc ChangeMenu*(menu: HMENU, cmd: UINT, lpszNewItem: LPCSTR, + cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "ChangeMenuA".} + proc GetMenuString*(menu: HMENU, uIDItem: UINT, lpString: LPSTR, + nMaxCount: int32, uFlag: UINT): int32{.stdcall, + dynlib: "user32", importc: "GetMenuStringA".} + proc InsertMenu*(menu: HMENU, uPosition: UINT, uFlags: UINT, + uIDNewItem: UINT, lpNewItem: LPCSTR): WINBOOL{.stdcall, + dynlib: "user32", importc: "InsertMenuA".} + proc AppendMenu*(menu: 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*(dc: HDC, X: int32, Y: int32, lpString: LPCSTR, + nCount: int32, nTabPositions: int32, + lpnTabStopPositions: LPINT, nTabOrigin: int32): LONG{. + stdcall, dynlib: "user32", importc: "TabbedTextOutA".} + proc GetTabbedTextExtent*(hDC: HDC, lpString: LPCSTR, nCount: int32, + nTabPositions: int32, lpnTabStopPositions: LPINT): DWORD{. + stdcall, dynlib: "user32", importc: "GetTabbedTextExtentA".} + proc SetProp*(wnd: HWND, lpString: LPCSTR, hData: HANDLE): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetPropA".} + proc GetProp*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, + dynlib: "user32", importc: "GetPropA".} + proc RemoveProp*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, + dynlib: "user32", importc: "RemovePropA".} + proc EnumPropsEx*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{. + stdcall, dynlib: "user32", importc: "EnumPropsExA".} + proc EnumProps*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall, + dynlib: "user32", importc: "EnumPropsA".} + proc SetWindowText*(wnd: HWND, lpString: LPCSTR): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetWindowTextA".} + proc GetWindowText*(wnd: HWND, lpString: LPSTR, nMaxCount: int32): int32{. + stdcall, dynlib: "user32", importc: "GetWindowTextA".} + proc GetWindowTextLength*(wnd: HWND): int32{.stdcall, dynlib: "user32", + importc: "GetWindowTextLengthA".} + proc MessageBox*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT): int32{. + stdcall, dynlib: "user32", importc: "MessageBoxA".} + proc MessageBoxEx*(wnd: 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*(wnd: HWND, nIndex: int32): LONG{.stdcall, + dynlib: "user32", importc: "GetWindowLongA".} + proc SetWindowLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{. + stdcall, dynlib: "user32", importc: "SetWindowLongA".} + proc GetClassLong*(wnd: HWND, nIndex: int32): DWORD{.stdcall, + dynlib: "user32", importc: "GetClassLongA".} + proc SetClassLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{. + stdcall, dynlib: "user32", importc: "SetClassLongA".} + when defined(cpu64): + proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetWindowLongPtrA".} + proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetWindowLongPtrA".} + proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetClassLongPtrA".} + proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetClassLongPtrA".} + else: + proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetWindowLongA".} + proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetWindowLongA".} + proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall, + dynlib: "user32", importc: "GetClassLongA".} + proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{. + stdcall, dynlib: "user32", importc: "SetClassLongA".} + proc FindWindow*(lpClassName: LPCSTR, lpWindowName: LPCSTR): HWND{.stdcall, + dynlib: "user32", importc: "FindWindowA".} + proc FindWindowEx*(para1: HWND, para2: HWND, para3: LPCSTR, para4: LPCSTR): HWND{. + stdcall, dynlib: "user32", importc: "FindWindowExA".} + proc GetClassName*(wnd: HWND, lpClassName: LPSTR, nMaxCount: int32): int32{. + stdcall, dynlib: "user32", importc: "GetClassNameA".} + proc SetWindowsHookEx*(idHook: int32, lpfn: HOOKPROC, hmod: HINST, + dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32", + importc: "SetWindowsHookExA".} + proc LoadBitmap*(hInstance: HINST, lpBitmapName: LPCSTR): HBITMAP{.stdcall, + dynlib: "user32", importc: "LoadBitmapA".} + proc LoadCursor*(hInstance: HINST, lpCursorName: LPCSTR): HCURSOR{.stdcall, + dynlib: "user32", importc: "LoadCursorA".} + proc LoadCursorFromFile*(lpFileName: LPCSTR): HCURSOR{.stdcall, + dynlib: "user32", importc: "LoadCursorFromFileA".} + proc LoadIcon*(hInstance: HINST, lpIconName: LPCSTR): HICON{.stdcall, + dynlib: "user32", importc: "LoadIconA".} + proc LoadImage*(para1: HINST, para2: LPCSTR, para3: 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*(wnd: HWND, hWndMDIClient: HWND, uMsg: UINT, + wp: WPARAM, lp: LPARAM): LRESULT{.stdcall, + dynlib: "user32", importc: "DefFrameProcA".} + proc DefMDIChildProc*(wnd: HWND, uMsg: UINT, wp: WPARAM, lp: LPARAM): LRESULT{. + stdcall, dynlib: "user32", importc: "DefMDIChildProcA".} + proc CreateMDIWindow*(lpClassName: LPSTR, lpWindowName: LPSTR, dwStyle: DWORD, + X: int32, Y: int32, nWidth: int32, nHeight: int32, + hWndParent: HWND, hInstance: HINST, lp: LPARAM): HWND{. + stdcall, dynlib: "user32", importc: "CreateMDIWindowA".} + proc WinHelp*(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: 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, menu: HMENU, hInstance: HINST, + lpParam: LPVOID): HWND + proc CreateDialog*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): HWND + proc CreateDialogIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): HWND + proc DialogBox*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): int32 + proc DialogBoxIndirect*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): int32 + proc CreateDC*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: pDEVMODE): HDC{. + stdcall, dynlib: "gdi32", importc: "CreateDCA".} + proc VerInstallFile*(uFlags: DWORD, szSrcFileName: LPSTR, + szDestFileName: LPSTR, szSrcDir: LPSTR, szDestDir: LPSTR, + szCurDir: LPSTR, szTmpFile: LPSTR, lpuTmpFileLen: PUINT): DWORD{. + stdcall, dynlib: "version", importc: "VerInstallFileA".} + proc GetFileVersionInfoSize*(lptstrFilename: LPSTR, lpdwHandle: LPDWORD): DWORD{. + stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeA".} + proc GetFileVersionInfo*(lptstrFilename: LPSTR, dwHandle: DWORD, dwLen: DWORD, + lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version", + importc: "GetFileVersionInfoA".} + proc VerLanguageName*(wLang: DWORD, szLang: LPSTR, nSize: DWORD): DWORD{. + stdcall, dynlib: "kernel32", importc: "VerLanguageNameA".} + proc VerQueryValue*(pBlock: LPVOID, lpSubBlock: LPSTR, lplpBuffer: LPVOID, + puLen: PUINT): WINBOOL{.stdcall, dynlib: "version", + importc: "VerQueryValueA".} + proc VerFindFile*(uFlags: DWORD, szFileName: LPSTR, szWinDir: LPSTR, + szAppDir: LPSTR, szCurDir: LPSTR, lpuCurDirLen: PUINT, + szDestDir: LPSTR, lpuDestDirLen: PUINT): DWORD{.stdcall, + dynlib: "version", importc: "VerFindFileA".} + proc RegConnectRegistry*(lpMachineName: LPSTR, key: HKEY, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".} + proc RegCreateKey*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".} + proc RegCreateKeyEx*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD, + lpClass: LPSTR, dwOptions: DWORD, samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".} + proc RegDeleteKey*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegDeleteKeyA".} + proc RegDeleteValue*(key: HKEY, lpValueName: LPCSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegDeleteValueA".} + proc RegEnumKey*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, cbName: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyA".} + proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, + lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPSTR, + lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".} + proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: LPSTR, + lpcbValueName: LPDWORD, lpReserved: LPDWORD, + lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegEnumValueA".} + proc RegLoadKey*(key: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegLoadKeyA".} + proc RegOpenKey*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{. + stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".} + proc RegOpenKeyEx*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD, + samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall, + dynlib: "advapi32", importc: "RegOpenKeyExA".} + proc RegQueryInfoKey*(key: HKEY, lpClass: LPSTR, lpcbClass: LPDWORD, + lpReserved: LPDWORD, lpcSubKeys: LPDWORD, + lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD, + lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD, + lpcbMaxValueLen: LPDWORD, + lpcbSecurityDescriptor: LPDWORD, + lpftLastWriteTime: PFILETIME): LONG{.stdcall, + dynlib: "advapi32", importc: "RegQueryInfoKeyA".} + proc RegQueryValue*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPSTR, + lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32", + importc: "RegQueryValueA".} + proc RegQueryMultipleValues*(key: HKEY, val_list: PVALENT, num_vals: DWORD, + lpValueBuf: LPSTR, ldwTotsize: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".} + proc RegQueryValueEx*(key: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD, + lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegQueryValueExA".} + proc RegReplaceKey*(key: HKEY, lpSubKey: LPCSTR, lpNewFile: LPCSTR, + lpOldFile: LPCSTR): LONG{.stdcall, dynlib: "advapi32", + importc: "RegReplaceKeyA".} + proc RegRestoreKey*(key: HKEY, lpFile: LPCSTR, dwFlags: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegRestoreKeyA".} + proc RegSaveKey*(key: HKEY, lpFile: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall, + dynlib: "advapi32", importc: "RegSaveKeyA".} + proc RegSetValue*(key: HKEY, lpSubKey: LPCSTR, dwType: DWORD, lpData: LPCSTR, + cbData: DWORD): LONG{.stdcall, dynlib: "advapi32", + importc: "RegSetValueA".} + proc RegSetValueEx*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD, + dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegSetValueExA".} + proc RegUnLoadKey*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall, + dynlib: "advapi32", importc: "RegUnLoadKeyA".} + proc InitiateSystemShutdown*(lpMachineName: LPSTR, lpMessage: LPSTR, + dwTimeout: DWORD, bForceAppsClosed: WINBOOL, + bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "InitiateSystemShutdownA".} + proc AbortSystemShutdown*(lpMachineName: LPSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "AbortSystemShutdownA".} + proc CompareString*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCSTR, + cchCount1: int32, lpString2: LPCSTR, cchCount2: int32): int32{. + stdcall, dynlib: "kernel32", importc: "CompareStringA".} + proc LCMapString*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCSTR, + cchSrc: int32, lpDestStr: LPSTR, cchDest: int32): int32{. + stdcall, dynlib: "kernel32", importc: "LCMapStringA".} + proc GetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPSTR, + cchData: int32): int32{.stdcall, dynlib: "kernel32", + importc: "GetLocaleInfoA".} + proc SetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCSTR): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetLocaleInfoA".} + proc GetTimeFormat*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME, + lpFormat: LPCSTR, lpTimeStr: LPSTR, cchTime: int32): int32{. + stdcall, dynlib: "kernel32", importc: "GetTimeFormatA".} + proc GetDateFormat*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME, + lpFormat: LPCSTR, lpDateStr: LPSTR, cchDate: int32): int32{. + stdcall, dynlib: "kernel32", importc: "GetDateFormatA".} + proc GetNumberFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR, + lpFormat: PNUMBERFMT, lpNumberStr: LPSTR, + cchNumber: int32): int32{.stdcall, dynlib: "kernel32", + importc: "GetNumberFormatA".} + proc GetCurrencyFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR, + lpFormat: PCURRENCYFMT, lpCurrencyStr: LPSTR, + cchCurrency: int32): int32{.stdcall, + dynlib: "kernel32", importc: "GetCurrencyFormatA".} + proc EnumCalendarInfo*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID, + Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "EnumCalendarInfoA".} + proc EnumTimeFormats*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID, + dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "EnumTimeFormatsA".} + proc EnumDateFormats*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID, + dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "EnumDateFormatsA".} + proc GetStringTypeEx*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR, + cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetStringTypeExA".} + proc GetStringType*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR, + cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetStringTypeA".} + proc FoldString*(dwMapFlags: DWORD, lpSrcStr: LPCSTR, cchSrc: int32, + lpDestStr: LPSTR, cchDest: int32): int32{.stdcall, + dynlib: "kernel32", importc: "FoldStringA".} + proc EnumSystemLocales*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesA".} + proc EnumSystemCodePages*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, + dwFlags: DWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "EnumSystemCodePagesA".} + proc PeekConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".} + proc ReadConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".} + proc WriteConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD, + nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".} + proc ReadConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, dwBufferCoord: COORD, + lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "ReadConsoleOutputA".} + proc WriteConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, dwBufferCoord: COORD, + lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "WriteConsoleOutputA".} + proc ReadConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPSTR, + nLength: DWORD, dwReadCoord: COORD, + lpNumberOfCharsRead: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".} + proc WriteConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPCSTR, + nLength: DWORD, dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".} + proc FillConsoleOutputCharacter*(hConsoleOutput: HANDLE, cCharacter: CHAR, + nLength: DWORD, dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".} + proc ScrollConsoleScreenBuffer*(hConsoleOutput: HANDLE, + lpScrollRectangle: PSMALL_RECT, + lpClipRectangle: PSMALL_RECT, + dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".} + proc GetConsoleTitle*(lpConsoleTitle: LPSTR, nSize: DWORD): DWORD{.stdcall, + dynlib: "kernel32", importc: "GetConsoleTitleA".} + proc SetConsoleTitle*(lpConsoleTitle: LPCSTR): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetConsoleTitleA".} + proc ReadConsole*(hConsoleInput: HANDLE, lpBuffer: LPVOID, + nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, + lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "ReadConsoleA".} + proc WriteConsole*(hConsoleOutput: HANDLE, lpBuffer: pointer, + nNumberOfCharsToWrite: DWORD, + lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteConsoleA".} + proc WNetAddConnection*(lpRemoteName: LPCSTR, lpPassword: LPCSTR, + lpLocalName: LPCSTR): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetAddConnectionA".} + proc WNetAddConnection2*(lpNetResource: LPNETRESOURCE, lpPassword: LPCSTR, + lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetAddConnection2A".} + proc WNetAddConnection3*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, + lpPassword: LPCSTR, lpUserName: LPCSTR, + dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetAddConnection3A".} + proc WNetCancelConnection*(lpName: LPCSTR, fForce: WINBOOL): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetCancelConnectionA".} + proc WNetCancelConnection2*(lpName: LPCSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetCancelConnection2A".} + proc WNetGetConnection*(lpLocalName: LPCSTR, lpRemoteName: LPSTR, + lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetGetConnectionA".} + proc WNetUseConnection*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE, + lpUserID: LPCSTR, lpPassword: LPCSTR, dwFlags: DWORD, + lpAccessName: LPSTR, lpBufferSize: LPDWORD, + lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetUseConnectionA".} + proc WNetSetConnection*(lpName: LPCSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetSetConnectionA".} + proc WNetConnectionDialog1*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".} + proc WNetDisconnectDialog1*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetDisconnectDialog1A".} + proc WNetOpenEnum*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD, + lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetOpenEnumA".} + proc WNetEnumResource*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID, + lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetEnumResourceA".} + proc WNetGetUniversalName*(lpLocalPath: LPCSTR, dwInfoLevel: DWORD, + lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".} + proc WNetGetUser*(lpName: LPCSTR, lpUserName: LPSTR, lpnLength: LPDWORD): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetUserA".} + proc WNetGetProviderName*(dwNetType: DWORD, lpProviderName: LPSTR, + lpBufferSize: LPDWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetGetProviderNameA".} + proc WNetGetNetworkInformation*(lpProvider: LPCSTR, + lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{. + stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".} + proc WNetGetLastError*(lpError: LPDWORD, lpErrorBuf: LPSTR, + nErrorBufSize: DWORD, lpNameBuf: LPSTR, + nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetGetLastErrorA".} + proc MultinetGetConnectionPerformance*(lpNetResource: LPNETRESOURCE, + lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall, + dynlib: "mpr", importc: "MultinetGetConnectionPerformanceA".} + proc ChangeServiceConfig*(hService: SC_HANDLE, dwServiceType: DWORD, + dwStartType: DWORD, dwErrorControl: DWORD, + lpBinaryPathName: LPCSTR, lpLoadOrderGroup: LPCSTR, + lpdwTagId: LPDWORD, lpDependencies: LPCSTR, + lpServiceStartName: LPCSTR, lpPassword: LPCSTR, + lpDisplayName: LPCSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "ChangeServiceConfigA".} + proc CreateService*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, + lpDisplayName: LPCSTR, dwDesiredAccess: DWORD, + dwServiceType: DWORD, dwStartType: DWORD, + dwErrorControl: DWORD, lpBinaryPathName: LPCSTR, + lpLoadOrderGroup: LPCSTR, lpdwTagId: LPDWORD, + lpDependencies: LPCSTR, lpServiceStartName: LPCSTR, + lpPassword: LPCSTR): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "CreateServiceA".} + proc EnumDependentServices*(hService: SC_HANDLE, dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUS, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EnumDependentServicesA".} + proc EnumServicesStatus*(hSCManager: SC_HANDLE, dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EnumServicesStatusA".} + proc GetServiceKeyName*(hSCManager: SC_HANDLE, lpDisplayName: LPCSTR, + lpServiceName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameA".} + proc GetServiceDisplayName*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, + lpDisplayName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameA".} + proc OpenSCManager*(lpMachineName: LPCSTR, lpDatabaseName: LPCSTR, + dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "OpenSCManagerA".} + proc OpenService*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR, + dwDesiredAccess: DWORD): SC_HANDLE{.stdcall, + dynlib: "advapi32", importc: "OpenServiceA".} + proc QueryServiceConfig*(hService: SC_HANDLE, + lpServiceConfig: LPQUERY_SERVICE_CONFIG, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceConfigA".} + proc QueryServiceLockStatus*(hSCManager: SC_HANDLE, + lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusA".} + proc RegisterServiceCtrlHandler*(lpServiceName: LPCSTR, + lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{. + stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerA".} + proc StartServiceCtrlDispatcher*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherA".} + proc StartService*(hService: SC_HANDLE, dwNumServiceArgs: DWORD, + lpServiceArgVectors: LPCSTR): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "StartServiceA".} + proc DragQueryFile*(para1: HDROP, para2: int, para3: cstring, para4: int): int{. + stdcall, dynlib: "shell32", importc: "DragQueryFileA".} + proc ExtractAssociatedIcon*(para1: HINST, para2: cstring, para3: LPWORD): HICON{. + stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconA".} + proc ExtractIcon*(para1: HINST, para2: cstring, para3: int): HICON{.stdcall, + dynlib: "shell32", importc: "ExtractIconA".} + proc FindExecutable*(para1: cstring, para2: cstring, para3: cstring): HINST{. + stdcall, dynlib: "shell32", importc: "FindExecutableA".} + proc ShellAbout*(para1: HWND, para2: cstring, para3: cstring, para4: HICON): int32{. + stdcall, dynlib: "shell32", importc: "ShellAboutA".} + proc ShellExecute*(para1: HWND, para2: cstring, para3: cstring, + para4: cstring, para5: cstring, para6: int32): HINST{. + stdcall, dynlib: "shell32", importc: "ShellExecuteA".} + proc Shell_NotifyIcon*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{. + stdcall, dynlib: "shell32", importc: "Shell_NotifyIconA".} + proc DdeCreateStringHandle*(para1: DWORD, para2: cstring, para3: int32): HSZ{. + stdcall, dynlib: "user32", importc: "DdeCreateStringHandleA".} + proc DdeInitialize*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD, + para4: DWORD): 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: INT, dwBytes: DWORD): HGLOBAL{.stdcall, + dynlib: "kernel32", importc: "GlobalAlloc".} +proc GlobalReAlloc*(hMem: HGLOBAL, dwBytes: DWORD, uFlags: INT): 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 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 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*(FileTime: LPFILETIME, + lpLocalFileTime: LPFILETIME): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "FileTimeToLocalFileTime".} +proc LocalFileTimeToFileTime*(lpLocalFileTime: LPFILETIME, + lpFileTime: LPFILETIME): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "LocalFileTimeToFileTime".} +proc FileTimeToSystemTime*(lpFileTime: LPFILETIME, lpSystemTime: LPSYSTEMTIME): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "FileTimeToSystemTime".} +proc CompareFileTime*(lpFileTime1: LPFILETIME, lpFileTime2: LPFILETIME): LONG{. + stdcall, dynlib: "kernel32", importc: "CompareFileTime".} +proc FileTimeToDosDateTime*(lpFileTime: LPFILETIME, lpFatDate: LPWORD, + lpFatTime: LPWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "FileTimeToDosDateTime".} +proc DosDateTimeToFileTime*(wFatDate: int16, wFatTime: int16, + lpFileTime: LPFILETIME): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "DosDateTimeToFileTime".} +proc GetTickCount*(): DWORD{.stdcall, dynlib: "kernel32", + importc: "GetTickCount".} +proc SetSystemTimeAdjustment*(dwTimeAdjustment: DWORD, + bTimeAdjustmentDisabled: WINBOOL): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetSystemTimeAdjustment".} +proc GetSystemTimeAdjustment*(lpTimeAdjustment: PDWORD, lpTimeIncrement: PDWORD, + lpTimeAdjustmentDisabled: PWINBOOL): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "GetSystemTimeAdjustment".} +proc CreatePipe*(hReadPipe: PHANDLE, hWritePipe: PHANDLE, + lpPipeAttributes: LPSECURITY_ATTRIBUTES, nSize: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "CreatePipe".} +proc ConnectNamedPipe*(hNamedPipe: HANDLE, lpOverlapped: LPOVERLAPPED): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ConnectNamedPipe".} +proc DisconnectNamedPipe*(hNamedPipe: HANDLE): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "DisconnectNamedPipe".} +proc SetNamedPipeHandleState*(hNamedPipe: HANDLE, lpMode: LPDWORD, + lpMaxCollectionCount: LPDWORD, + lpCollectDataTimeout: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetNamedPipeHandleState".} +proc GetNamedPipeInfo*(hNamedPipe: HANDLE, lpFlags: LPDWORD, + lpOutBufferSize: LPDWORD, lpInBufferSize: LPDWORD, + lpMaxInstances: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetNamedPipeInfo".} +proc PeekNamedPipe*(hNamedPipe: HANDLE, lpBuffer: LPVOID, nBufferSize: DWORD, + lpBytesRead: LPDWORD, lpTotalBytesAvail: LPDWORD, + lpBytesLeftThisMessage: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "PeekNamedPipe".} +proc TransactNamedPipe*(hNamedPipe: HANDLE, lpInBuffer: LPVOID, + nInBufferSize: DWORD, lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, lpBytesRead: LPDWORD, + lpOverlapped: LPOVERLAPPED): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "TransactNamedPipe".} +proc GetMailslotInfo*(hMailslot: HANDLE, lpMaxMessageSize: LPDWORD, + lpNextSize: LPDWORD, lpMessageCount: LPDWORD, + lpReadTimeout: LPDWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "GetMailslotInfo".} +proc SetMailslotInfo*(hMailslot: HANDLE, lReadTimeout: DWORD): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "SetMailslotInfo".} +proc MapViewOfFile*(hFileMappingObject: HANDLE, dwDesiredAccess: DWORD, + dwFileOffsetHigh: DWORD, dwFileOffsetLow: DWORD, + dwNumberOfBytesToMap: DWORD): LPVOID{.stdcall, + dynlib: "kernel32", importc: "MapViewOfFile".} +proc FlushViewOfFile*(lpBaseAddress: LPCVOID, dwNumberOfBytesToFlush: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "FlushViewOfFile".} +proc UnmapViewOfFile*(lpBaseAddress: LPVOID): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "UnmapViewOfFile".} +proc OpenFile*(lpFileName: LPCSTR, lpReOpenBuff: LPOFSTRUCT, uStyle: 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*(file: HFILE): HFILE{.stdcall, dynlib: "kernel32", + importc: "_lclose".} +proc llseek*(file: HFILE, lOffset: LONG, iOrigin: int32): LONG{.stdcall, + dynlib: "kernel32", importc: "_llseek".} +proc IsTextUnicode*(lpBuffer: LPVOID, cb: int32, lpi: LPINT): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "IsTextUnicode".} +proc TlsAlloc*(): DWORD{.stdcall, dynlib: "kernel32", importc: "TlsAlloc".} +proc TlsGetValue*(dwTlsIndex: DWORD): LPVOID{.stdcall, dynlib: "kernel32", + importc: "TlsGetValue".} +proc TlsSetValue*(dwTlsIndex: DWORD, lpTlsValue: LPVOID): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "TlsSetValue".} +proc TlsFree*(dwTlsIndex: DWORD): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "TlsFree".} +proc SleepEx*(dwMilliseconds: DWORD, bAlertable: WINBOOL): DWORD{.stdcall, + dynlib: "kernel32", importc: "SleepEx".} +proc WaitForSingleObjectEx*(hHandle: HANDLE, dwMilliseconds: DWORD, + bAlertable: WINBOOL): DWORD{.stdcall, + dynlib: "kernel32", importc: "WaitForSingleObjectEx".} +proc WaitForMultipleObjectsEx*(nCount: DWORD, lpHandles: LPHANDLE, + bWaitAll: WINBOOL, dwMilliseconds: DWORD, + bAlertable: WINBOOL): DWORD{.stdcall, + dynlib: "kernel32", importc: "WaitForMultipleObjectsEx".} +proc ReadFileEx*(hFile: HANDLE, lpBuffer: LPVOID, nNumberOfBytesToRead: DWORD, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "ReadFileEx".} +proc WriteFileEx*(hFile: HANDLE, lpBuffer: LPCVOID, + nNumberOfBytesToWrite: DWORD, lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "WriteFileEx".} +proc BackupRead*(hFile: HANDLE, lpBuffer: LPBYTE, nNumberOfBytesToRead: DWORD, + lpNumberOfBytesRead: LPDWORD, bAbort: WINBOOL, + bProcessSecurity: WINBOOL, lpContext: var LPVOID): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "BackupRead".} +proc BackupSeek*(hFile: HANDLE, dwLowBytesToSeek: DWORD, + dwHighBytesToSeek: DWORD, lpdwLowByteSeeked: LPDWORD, + lpdwHighByteSeeked: LPDWORD, lpContext: var LPVOID): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "BackupSeek".} +proc BackupWrite*(hFile: HANDLE, lpBuffer: LPBYTE, nNumberOfBytesToWrite: DWORD, + lpNumberOfBytesWritten: LPDWORD, bAbort: WINBOOL, + bProcessSecurity: WINBOOL, lpContext: var LPVOID): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "BackupWrite".} +proc SetProcessShutdownParameters*(dwLevel: DWORD, dwFlags: DWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "SetProcessShutdownParameters".} +proc GetProcessShutdownParameters*(lpdwLevel: LPDWORD, lpdwFlags: LPDWORD): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "GetProcessShutdownParameters".} +proc SetFileApisToOEM*(){.stdcall, dynlib: "kernel32", + importc: "SetFileApisToOEM".} +proc SetFileApisToANSI*(){.stdcall, dynlib: "kernel32", + importc: "SetFileApisToANSI".} +proc AreFileApisANSI*(): WINBOOL{.stdcall, dynlib: "kernel32", + importc: "AreFileApisANSI".} +proc CloseEventLog*(hEventLog: HANDLE): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "CloseEventLog".} +proc DeregisterEventSource*(hEventLog: HANDLE): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "DeregisterEventSource".} +proc NotifyChangeEventLog*(hEventLog: HANDLE, hEvent: HANDLE): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "NotifyChangeEventLog".} +proc GetNumberOfEventLogRecords*(hEventLog: HANDLE, NumberOfRecords: PDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetNumberOfEventLogRecords".} +proc GetOldestEventLogRecord*(hEventLog: HANDLE, OldestRecord: PDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetOldestEventLogRecord".} +proc DuplicateToken*(ExistingTokenHandle: HANDLE, + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + DuplicateTokenHandle: PHANDLE): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "DuplicateToken".} +proc GetKernelObjectSecurity*(Handle: HANDLE, + RequestedInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetKernelObjectSecurity".} +proc ImpersonateNamedPipeClient*(hNamedPipe: HANDLE): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "ImpersonateNamedPipeClient".} +proc ImpersonateLoggedOnUser*(hToken: HANDLE): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "ImpersonateLoggedOnUser".} +proc ImpersonateSelf*(ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "ImpersonateSelf".} +proc RevertToSelf*(): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "RevertToSelf".} +proc SetThreadToken*(Thread: PHANDLE, Token: HANDLE): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "SetThreadToken".} +proc OpenProcessToken*(ProcessHandle: HANDLE, DesiredAccess: DWORD, + TokenHandle: PHANDLE): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "OpenProcessToken".} +proc OpenThreadToken*(ThreadHandle: HANDLE, DesiredAccess: DWORD, + OpenAsSelf: WINBOOL, TokenHandle: PHANDLE): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "OpenThreadToken".} +proc GetTokenInformation*(TokenHandle: HANDLE, + TokenInformationClass: TOKEN_INFORMATION_CLASS, + TokenInformation: LPVOID, + TokenInformationLength: DWORD, ReturnLength: PDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetTokenInformation".} +proc SetTokenInformation*(TokenHandle: HANDLE, + TokenInformationClass: TOKEN_INFORMATION_CLASS, + TokenInformation: LPVOID, + TokenInformationLength: DWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "SetTokenInformation".} +proc AdjustTokenPrivileges*(TokenHandle: HANDLE, DisableAllPrivileges: WINBOOL, + NewState: PTOKEN_PRIVILEGES, BufferLength: DWORD, + PreviousState: PTOKEN_PRIVILEGES, + ReturnLength: PDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "AdjustTokenPrivileges".} +proc AdjustTokenGroups*(TokenHandle: HANDLE, ResetToDefault: WINBOOL, + NewState: PTOKEN_GROUPS, BufferLength: DWORD, + PreviousState: PTOKEN_GROUPS, ReturnLength: PDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "AdjustTokenGroups".} +proc PrivilegeCheck*(ClientToken: HANDLE, RequiredPrivileges: PPRIVILEGE_SET, + pfResult: LPBOOL): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "PrivilegeCheck".} +proc IsValidSid*(pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "IsValidSid".} +proc EqualSid*(pSid1: PSID, pSid2: PSID): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "EqualSid".} +proc EqualPrefixSid*(pSid1: PSID, pSid2: PSID): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "EqualPrefixSid".} +proc GetSidLengthRequired*(nSubAuthorityCount: UCHAR): DWORD{.stdcall, + dynlib: "advapi32", importc: "GetSidLengthRequired".} +proc AllocateAndInitializeSid*(pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY, + nSubAuthorityCount: int8, nSubAuthority0: DWORD, + nSubAuthority1: DWORD, nSubAuthority2: DWORD, + nSubAuthority3: DWORD, nSubAuthority4: DWORD, + nSubAuthority5: DWORD, nSubAuthority6: DWORD, + nSubAuthority7: DWORD, pSid: var PSID): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "AllocateAndInitializeSid".} +proc FreeSid*(pSid: PSID): PVOID{.stdcall, dynlib: "advapi32", + importc: "FreeSid".} +proc InitializeSid*(Sid: PSID, pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY, + nSubAuthorityCount: int8): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "InitializeSid".} +proc GetSidIdentifierAuthority*(pSid: PSID): PSID_IDENTIFIER_AUTHORITY{.stdcall, + dynlib: "advapi32", importc: "GetSidIdentifierAuthority".} +proc GetSidSubAuthority*(pSid: PSID, nSubAuthority: DWORD): PDWORD{.stdcall, + dynlib: "advapi32", importc: "GetSidSubAuthority".} +proc GetSidSubAuthorityCount*(pSid: PSID): PUCHAR{.stdcall, dynlib: "advapi32", + importc: "GetSidSubAuthorityCount".} +proc GetLengthSid*(pSid: PSID): DWORD{.stdcall, dynlib: "advapi32", + importc: "GetLengthSid".} +proc CopySid*(nDestinationSidLength: DWORD, pDestinationSid: PSID, + pSourceSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "CopySid".} +proc AreAllAccessesGranted*(GrantedAccess: DWORD, DesiredAccess: DWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "AreAllAccessesGranted".} +proc AreAnyAccessesGranted*(GrantedAccess: DWORD, DesiredAccess: DWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "AreAnyAccessesGranted".} +proc MapGenericMask*(AccessMask: PDWORD, GenericMapping: PGENERIC_MAPPING){. + stdcall, dynlib: "advapi32", importc: "MapGenericMask".} +proc IsValidAcl*(pAcl: PACL): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "IsValidAcl".} +proc InitializeAcl*(pAcl: PACL, nAclLength: DWORD, dwAclRevision: DWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "InitializeAcl".} +proc GetAclInformation*(pAcl: PACL, pAclInformation: LPVOID, + nAclInformationLength: DWORD, + dwAclInformationClass: ACL_INFORMATION_CLASS): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetAclInformation".} +proc SetAclInformation*(pAcl: PACL, pAclInformation: LPVOID, + nAclInformationLength: DWORD, + dwAclInformationClass: ACL_INFORMATION_CLASS): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "SetAclInformation".} +proc AddAce*(pAcl: PACL, dwAceRevision: DWORD, dwStartingAceIndex: DWORD, + pAceList: LPVOID, nAceListLength: DWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "AddAce".} +proc DeleteAce*(pAcl: PACL, dwAceIndex: DWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "DeleteAce".} +proc GetAce*(pAcl: PACL, dwAceIndex: DWORD, pAce: var LPVOID): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "GetAce".} +proc AddAccessAllowedAce*(pAcl: PACL, dwAceRevision: DWORD, AccessMask: DWORD, + pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "AddAccessAllowedAce".} +proc AddAccessDeniedAce*(pAcl: PACL, dwAceRevision: DWORD, AccessMask: DWORD, + pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "AddAccessDeniedAce".} +proc AddAuditAccessAce*(pAcl: PACL, dwAceRevision: DWORD, dwAccessMask: DWORD, + pSid: PSID, bAuditSuccess: WINBOOL, + bAuditFailure: WINBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "AddAuditAccessAce".} +proc FindFirstFreeAce*(pAcl: PACL, pAce: var LPVOID): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "FindFirstFreeAce".} +proc InitializeSecurityDescriptor*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + dwRevision: DWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "InitializeSecurityDescriptor".} +proc IsValidSecurityDescriptor*(pSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "IsValidSecurityDescriptor".} +proc GetSecurityDescriptorLength*(pSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD{. + stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorLength".} +proc GetSecurityDescriptorControl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pControl: PSECURITY_DESCRIPTOR_CONTROL, + lpdwRevision: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "GetSecurityDescriptorControl".} +proc SetSecurityDescriptorDacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + bDaclPresent: WINBOOL, pDacl: PACL, + bDaclDefaulted: WINBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "SetSecurityDescriptorDacl".} +proc GetSecurityDescriptorDacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpbDaclPresent: LPBOOL, pDacl: var PACL, + lpbDaclDefaulted: LPBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "GetSecurityDescriptorDacl".} +proc SetSecurityDescriptorSacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + bSaclPresent: WINBOOL, pSacl: PACL, + bSaclDefaulted: WINBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "SetSecurityDescriptorSacl".} +proc GetSecurityDescriptorSacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpbSaclPresent: LPBOOL, pSacl: var PACL, + lpbSaclDefaulted: LPBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "GetSecurityDescriptorSacl".} +proc SetSecurityDescriptorOwner*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pOwner: PSID, bOwnerDefaulted: WINBOOL): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "SetSecurityDescriptorOwner".} +proc GetSecurityDescriptorOwner*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pOwner: var PSID, lpbOwnerDefaulted: LPBOOL): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorOwner".} +proc SetSecurityDescriptorGroup*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pGroup: PSID, bGroupDefaulted: WINBOOL): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "SetSecurityDescriptorGroup".} +proc GetSecurityDescriptorGroup*(pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pGroup: var PSID, lpbGroupDefaulted: LPBOOL): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorGroup".} +proc CreatePrivateObjectSecurity*(ParentDescriptor: PSECURITY_DESCRIPTOR, + CreatorDescriptor: PSECURITY_DESCRIPTOR, + NewDescriptor: var PSECURITY_DESCRIPTOR, + IsDirectoryObject: WINBOOL, Token: HANDLE, + GenericMapping: PGENERIC_MAPPING): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "CreatePrivateObjectSecurity".} +proc SetPrivateObjectSecurity*(SecurityInformation: SECURITY_INFORMATION, + ModificationDescriptor: PSECURITY_DESCRIPTOR, + ObjectsSecurityDescriptor: var PSECURITY_DESCRIPTOR, + GenericMapping: PGENERIC_MAPPING, Token: HANDLE): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "SetPrivateObjectSecurity".} +proc GetPrivateObjectSecurity*(ObjectDescriptor: PSECURITY_DESCRIPTOR, + SecurityInformation: SECURITY_INFORMATION, + ResultantDescriptor: PSECURITY_DESCRIPTOR, + DescriptorLength: DWORD, ReturnLength: PDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "GetPrivateObjectSecurity".} +proc DestroyPrivateObjectSecurity*(ObjectDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "DestroyPrivateObjectSecurity".} +proc MakeSelfRelativeSD*(pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR, + pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpdwBufferLength: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "MakeSelfRelativeSD".} +proc MakeAbsoluteSD*(pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR, + pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpdwAbsoluteSecurityDescriptorSize: LPDWORD, pDacl: PACL, + lpdwDaclSize: LPDWORD, pSacl: PACL, lpdwSaclSize: LPDWORD, + pOwner: PSID, lpdwOwnerSize: LPDWORD, pPrimaryGroup: PSID, + lpdwPrimaryGroupSize: LPDWORD): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "MakeAbsoluteSD".} +proc SetKernelObjectSecurity*(Handle: HANDLE, + SecurityInformation: SECURITY_INFORMATION, + SecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "SetKernelObjectSecurity".} +proc FindNextChangeNotification*(hChangeHandle: HANDLE): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "FindNextChangeNotification".} +proc FindCloseChangeNotification*(hChangeHandle: HANDLE): WINBOOL{.stdcall, + dynlib: "kernel32", importc: "FindCloseChangeNotification".} +proc VirtualLock*(lpAddress: LPVOID, dwSize: 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, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnumDesktopWindows".} +proc SwitchDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32", + importc: "SwitchDesktop".} +proc SetThreadDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32", + importc: "SetThreadDesktop".} +proc CloseDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32", + importc: "CloseDesktop".} +proc GetThreadDesktop*(dwThreadId: DWORD): HDESK{.stdcall, dynlib: "user32", + importc: "GetThreadDesktop".} +proc CloseWindowStation*(hWinSta: HWINSTA): WINBOOL{.stdcall, dynlib: "user32", + importc: "CloseWindowStation".} +proc SetProcessWindowStation*(hWinSta: HWINSTA): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetProcessWindowStation".} +proc GetProcessWindowStation*(): HWINSTA{.stdcall, dynlib: "user32", + importc: "GetProcessWindowStation".} +proc SetUserObjectSecurity*(hObj: HANDLE, pSIRequested: PSECURITY_INFORMATION, + pSID: PSECURITY_DESCRIPTOR): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetUserObjectSecurity".} +proc GetUserObjectSecurity*(hObj: HANDLE, pSIRequested: PSECURITY_INFORMATION, + pSID: PSECURITY_DESCRIPTOR, nLength: DWORD, + lpnLengthNeeded: LPDWORD): WINBOOL{.stdcall, + dynlib: "user32", importc: "GetUserObjectSecurity".} +proc TranslateMessage*(lpMsg: LPMSG): WINBOOL{.stdcall, dynlib: "user32", + importc: "TranslateMessage".} +proc SetMessageQueue*(cMessagesMax: int32): WINBOOL{.stdcall, dynlib: "user32", + importc: "SetMessageQueue".} +proc RegisterHotKey*(wnd: HWND, anID: int32, fsModifiers: UINT, vk: UINT): WINBOOL{. + stdcall, dynlib: "user32", importc: "RegisterHotKey".} +proc UnregisterHotKey*(wnd: 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*(lp: 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*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "IsWindow".} +proc IsMenu*(menu: HMENU): WINBOOL{.stdcall, dynlib: "user32", + importc: "IsMenu".} +proc IsChild*(hWndParent: HWND, wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "IsChild".} +proc DestroyWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "DestroyWindow".} +proc ShowWindow*(wnd: HWND, nCmdShow: int32): WINBOOL{.stdcall, + dynlib: "user32", importc: "ShowWindow".} +proc ShowWindowAsync*(wnd: HWND, nCmdShow: int32): WINBOOL{.stdcall, + dynlib: "user32", importc: "ShowWindowAsync".} +proc FlashWindow*(wnd: HWND, bInvert: WINBOOL): WINBOOL{.stdcall, + dynlib: "user32", importc: "FlashWindow".} +proc ShowOwnedPopups*(wnd: HWND, fShow: WINBOOL): WINBOOL{.stdcall, + dynlib: "user32", importc: "ShowOwnedPopups".} +proc OpenIcon*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "OpenIcon".} +proc CloseWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "CloseWindow".} +proc MoveWindow*(wnd: HWND, X: int32, Y: int32, nWidth: int32, nHeight: int32, + bRepaint: WINBOOL): WINBOOL{.stdcall, dynlib: "user32", + importc: "MoveWindow".} +proc SetWindowPos*(wnd: HWND, hWndInsertAfter: HWND, X: int32, Y: int32, + cx: int32, cy: int32, uFlags: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetWindowPos".} +proc GetWindowPlacement*(wnd: HWND, lpwndpl: var WINDOWPLACEMENT): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetWindowPlacement".} +proc SetWindowPlacement*(wnd: HWND, lpwndpl: var WINDOWPLACEMENT): WINBOOL{. + stdcall, dynlib: "user32", importc: "SetWindowPlacement".} +proc GetWindowPlacement*(wnd: HWND, lpwndpl: PWINDOWPLACEMENT): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetWindowPlacement".} +proc SetWindowPlacement*(wnd: HWND, lpwndpl: PWINDOWPLACEMENT): WINBOOL{. + stdcall, dynlib: "user32", importc: "SetWindowPlacement".} +proc BeginDeferWindowPos*(nNumWindows: int32): HDWP{.stdcall, dynlib: "user32", + importc: "BeginDeferWindowPos".} +proc DeferWindowPos*(hWinPosInfo: HDWP, wnd: HWND, hWndInsertAfter: HWND, + x: int32, y: int32, cx: int32, cy: int32, uFlags: UINT): HDWP{. + stdcall, dynlib: "user32", importc: "DeferWindowPos".} +proc EndDeferWindowPos*(hWinPosInfo: HDWP): WINBOOL{.stdcall, dynlib: "user32", + importc: "EndDeferWindowPos".} +proc IsWindowVisible*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "IsWindowVisible".} +proc IsIconic*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "IsIconic".} +proc AnyPopup*(): WINBOOL{.stdcall, dynlib: "user32", importc: "AnyPopup".} +proc BringWindowToTop*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "BringWindowToTop".} +proc IsZoomed*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "IsZoomed".} +proc EndDialog*(hDlg: HWND, nResult: int32): WINBOOL{.stdcall, dynlib: "user32", + importc: "EndDialog".} +proc GetDlgItem*(hDlg: HWND, nIDDlgItem: int32): HWND{.stdcall, + dynlib: "user32", importc: "GetDlgItem".} +proc SetDlgItemInt*(hDlg: HWND, nIDDlgItem: int32, uValue: 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*(wnd: HWND): int32{.stdcall, dynlib: "user32", + importc: "GetDlgCtrlID".} +proc GetDialogBaseUnits*(): int32{.stdcall, dynlib: "user32", + importc: "GetDialogBaseUnits".} +proc OpenClipboard*(hWndNewOwner: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "OpenClipboard".} +proc CloseClipboard*(): WINBOOL{.stdcall, dynlib: "user32", + importc: "CloseClipboard".} +proc GetClipboardOwner*(): HWND{.stdcall, dynlib: "user32", + importc: "GetClipboardOwner".} +proc SetClipboardViewer*(hWndNewViewer: HWND): HWND{.stdcall, dynlib: "user32", + importc: "SetClipboardViewer".} +proc GetClipboardViewer*(): HWND{.stdcall, dynlib: "user32", + importc: "GetClipboardViewer".} +proc ChangeClipboardChain*(hWndRemove: HWND, hWndNewNext: HWND): WINBOOL{. + stdcall, dynlib: "user32", importc: "ChangeClipboardChain".} +proc SetClipboardData*(uFormat: 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*(wnd: HWND): HWND{.stdcall, dynlib: "user32", importc: "SetFocus".} +proc GetActiveWindow*(): HWND{.stdcall, dynlib: "user32", + importc: "GetActiveWindow".} +proc GetFocus*(): HWND{.stdcall, dynlib: "user32", importc: "GetFocus".} +proc GetKBCodePage*(): 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*(wnd: HWND): HWND{.stdcall, dynlib: "user32", + importc: "SetCapture".} +proc ReleaseCapture*(): WINBOOL{.stdcall, dynlib: "user32", + importc: "ReleaseCapture".} +proc MsgWaitForMultipleObjects*(nCount: DWORD, pHandles: LPHANDLE, + fWaitAll: WINBOOL, dwMilliseconds: DWORD, + dwWakeMask: DWORD): DWORD{.stdcall, + dynlib: "user32", importc: "MsgWaitForMultipleObjects".} +proc SetTimer*(wnd: HWND, nIDEvent: UINT, uElapse: UINT, lpTimerFunc: TIMERPROC): UINT{. + stdcall, dynlib: "user32", importc: "SetTimer".} +proc KillTimer*(wnd: HWND, uIDEvent: UINT): WINBOOL{.stdcall, dynlib: "user32", + importc: "KillTimer".} +proc IsWindowUnicode*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "IsWindowUnicode".} +proc EnableWindow*(wnd: HWND, bEnable: WINBOOL): WINBOOL{.stdcall, + dynlib: "user32", importc: "EnableWindow".} +proc IsWindowEnabled*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "IsWindowEnabled".} +proc DestroyAcceleratorTable*(hAccel: HACCEL): WINBOOL{.stdcall, + dynlib: "user32", importc: "DestroyAcceleratorTable".} +proc GetSystemMetrics*(nIndex: int32): int32{.stdcall, dynlib: "user32", + importc: "GetSystemMetrics".} +proc GetMenu*(wnd: HWND): HMENU{.stdcall, dynlib: "user32", importc: "GetMenu".} +proc SetMenu*(wnd: HWND, menu: HMENU): WINBOOL{.stdcall, dynlib: "user32", + importc: "SetMenu".} +proc HiliteMenuItem*(wnd: HWND, menu: HMENU, uIDHiliteItem: UINT, + uHilite: UINT): WINBOOL{.stdcall, dynlib: "user32", + importc: "HiliteMenuItem".} +proc GetMenuState*(menu: HMENU, uId: UINT, uFlags: UINT): UINT{.stdcall, + dynlib: "user32", importc: "GetMenuState".} +proc DrawMenuBar*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "DrawMenuBar".} +proc GetSystemMenu*(wnd: HWND, bRevert: WINBOOL): HMENU{.stdcall, + dynlib: "user32", importc: "GetSystemMenu".} +proc CreateMenu*(): HMENU{.stdcall, dynlib: "user32", importc: "CreateMenu".} +proc CreatePopupMenu*(): HMENU{.stdcall, dynlib: "user32", + importc: "CreatePopupMenu".} +proc DestroyMenu*(menu: HMENU): WINBOOL{.stdcall, dynlib: "user32", + importc: "DestroyMenu".} +proc CheckMenuItem*(menu: HMENU, uIDCheckItem: UINT, uCheck: UINT): DWORD{. + stdcall, dynlib: "user32", importc: "CheckMenuItem".} +proc EnableMenuItem*(menu: HMENU, uIDEnableItem: UINT, uEnable: UINT): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnableMenuItem".} +proc GetSubMenu*(menu: HMENU, nPos: int32): HMENU{.stdcall, dynlib: "user32", + importc: "GetSubMenu".} +proc GetMenuItemID*(menu: HMENU, nPos: int32): UINT{.stdcall, dynlib: "user32", + importc: "GetMenuItemID".} +proc GetMenuItemCount*(menu: HMENU): int32{.stdcall, dynlib: "user32", + importc: "GetMenuItemCount".} +proc RemoveMenu*(menu: HMENU, uPosition: UINT, uFlags: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "RemoveMenu".} +proc DeleteMenu*(menu: HMENU, uPosition: UINT, uFlags: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "DeleteMenu".} +proc SetMenuItemBitmaps*(menu: 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*(menu: HMENU, uFlags: UINT, x: int32, y: int32, + nReserved: int32, wnd: HWND, prcRect: var RECT): WINBOOL{. + stdcall, dynlib: "user32", importc: "TrackPopupMenu".} +proc GetMenuDefaultItem*(menu: HMENU, fByPos: UINT, gmdiFlags: UINT): UINT{. + stdcall, dynlib: "user32", importc: "GetMenuDefaultItem".} +proc SetMenuDefaultItem*(menu: HMENU, uItem: UINT, fByPos: UINT): WINBOOL{. + stdcall, dynlib: "user32", importc: "SetMenuDefaultItem".} +proc GetMenuItemRect*(wnd: HWND, menu: HMENU, uItem: UINT, lprcItem: LPRECT): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetMenuItemRect".} +proc MenuItemFromPoint*(wnd: HWND, menu: HMENU, ptScreen: POINT): int32{. + stdcall, dynlib: "user32", importc: "MenuItemFromPoint".} +proc DragObject*(para1: HWND, para2: HWND, para3: UINT, para4: DWORD, + para5: HCURSOR): DWORD{.stdcall, dynlib: "user32", + importc: "DragObject".} +proc DragDetect*(wnd: HWND, pt: POINT): WINBOOL{.stdcall, dynlib: "user32", + importc: "DragDetect".} +proc DrawIcon*(hDC: HDC, X: int32, Y: int32, icon: HICON): WINBOOL{.stdcall, + dynlib: "user32", importc: "DrawIcon".} +proc UpdateWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "UpdateWindow".} +proc SetActiveWindow*(wnd: HWND): HWND{.stdcall, dynlib: "user32", + importc: "SetActiveWindow".} +proc GetForegroundWindow*(): HWND{.stdcall, dynlib: "user32", + importc: "GetForegroundWindow".} +proc PaintDesktop*(hdc: HDC): WINBOOL{.stdcall, dynlib: "user32", + importc: "PaintDesktop".} +proc SetForegroundWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "SetForegroundWindow".} +proc WindowFromDC*(hDC: HDC): HWND{.stdcall, dynlib: "user32", + importc: "WindowFromDC".} +proc GetDC*(wnd: HWND): HDC{.stdcall, dynlib: "user32", importc: "GetDC".} +proc GetDCEx*(wnd: HWND, hrgnClip: HRGN, flags: DWORD): HDC{.stdcall, + dynlib: "user32", importc: "GetDCEx".} +proc GetWindowDC*(wnd: HWND): HDC{.stdcall, dynlib: "user32", + importc: "GetWindowDC".} +proc ReleaseDC*(wnd: HWND, hDC: HDC): int32{.stdcall, dynlib: "user32", + importc: "ReleaseDC".} +proc BeginPaint*(wnd: HWND, lpPaint: LPPAINTSTRUCT): HDC{.stdcall, + dynlib: "user32", importc: "BeginPaint".} +proc EndPaint*(wnd: HWND, lpPaint: LPPAINTSTRUCT): WINBOOL{.stdcall, + dynlib: "user32", importc: "EndPaint".} +proc GetUpdateRect*(wnd: HWND, lpRect: LPRECT, bErase: WINBOOL): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetUpdateRect".} +proc GetUpdateRgn*(wnd: HWND, hRgn: HRGN, bErase: WINBOOL): int32{.stdcall, + dynlib: "user32", importc: "GetUpdateRgn".} +proc SetWindowRgn*(wnd: HWND, hRgn: HRGN, bRedraw: WINBOOL): int32{.stdcall, + dynlib: "user32", importc: "SetWindowRgn".} +proc GetWindowRgn*(wnd: HWND, hRgn: HRGN): int32{.stdcall, dynlib: "user32", + importc: "GetWindowRgn".} +proc ExcludeUpdateRgn*(hDC: HDC, wnd: HWND): int32{.stdcall, dynlib: "user32", + importc: "ExcludeUpdateRgn".} +proc InvalidateRect*(wnd: HWND, lpRect: var RECT, bErase: WINBOOL): WINBOOL{. + stdcall, dynlib: "user32", importc: "InvalidateRect".} +proc InvalidateRect*(wnd: HWND, lpRect: LPRECT, bErase: WINBOOL): WINBOOL{. + stdcall, dynlib: "user32", importc: "InvalidateRect".} +proc ValidateRect*(wnd: HWND, lpRect: var RECT): WINBOOL{.stdcall, + dynlib: "user32", importc: "ValidateRect".} +proc ValidateRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall, + dynlib: "user32", importc: "ValidateRect".} +proc InvalidateRgn*(wnd: HWND, hRgn: HRGN, bErase: WINBOOL): WINBOOL{.stdcall, + dynlib: "user32", importc: "InvalidateRgn".} +proc ValidateRgn*(wnd: HWND, hRgn: HRGN): WINBOOL{.stdcall, dynlib: "user32", + importc: "ValidateRgn".} +proc RedrawWindow*(wnd: HWND, lprcUpdate: var RECT, hrgnUpdate: HRGN, + flags: UINT): WINBOOL{.stdcall, dynlib: "user32", + importc: "RedrawWindow".} +proc RedrawWindow*(wnd: 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*(wnd: HWND, XAmount: int32, YAmount: int32, lpRect: var RECT, + lpClipRect: var RECT): WINBOOL{.stdcall, dynlib: "user32", + importc: "ScrollWindow".} +proc ScrollDC*(hDC: HDC, dx: int32, dy: int32, lprcScroll: var RECT, + lprcClip: var RECT, hrgnUpdate: HRGN, lprcUpdate: LPRECT): WINBOOL{. + stdcall, dynlib: "user32", importc: "ScrollDC".} +proc ScrollWindowEx*(wnd: HWND, dx: int32, dy: int32, prcScroll: var RECT, + prcClip: var RECT, hrgnUpdate: HRGN, prcUpdate: LPRECT, + flags: UINT): int32{.stdcall, dynlib: "user32", + importc: "ScrollWindowEx".} +proc SetScrollPos*(wnd: HWND, nBar: int32, nPos: int32, bRedraw: WINBOOL): int32{. + stdcall, dynlib: "user32", importc: "SetScrollPos".} +proc GetScrollPos*(wnd: HWND, nBar: int32): int32{.stdcall, dynlib: "user32", + importc: "GetScrollPos".} +proc SetScrollRange*(wnd: HWND, nBar: int32, nMinPos: int32, nMaxPos: int32, + bRedraw: WINBOOL): WINBOOL{.stdcall, dynlib: "user32", + importc: "SetScrollRange".} +proc GetScrollRange*(wnd: HWND, nBar: int32, lpMinPos: LPINT, lpMaxPos: LPINT): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetScrollRange".} +proc ShowScrollBar*(wnd: HWND, wBar: int32, bShow: WINBOOL): WINBOOL{.stdcall, + dynlib: "user32", importc: "ShowScrollBar".} +proc EnableScrollBar*(wnd: HWND, wSBflags: UINT, wArrows: UINT): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnableScrollBar".} +proc GetClientRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall, + dynlib: "user32", importc: "GetClientRect".} +proc GetWindowRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall, + dynlib: "user32", importc: "GetWindowRect".} +proc AdjustWindowRect*(lpRect: LPRECT, dwStyle: DWORD, bMenu: WINBOOL): WINBOOL{. + stdcall, dynlib: "user32", importc: "AdjustWindowRect".} +proc AdjustWindowRectEx*(lpRect: LPRECT, dwStyle: DWORD, bMenu: WINBOOL, + dwExStyle: DWORD): WINBOOL{.stdcall, dynlib: "user32", + importc: "AdjustWindowRectEx".} +proc SetWindowContextHelpId*(para1: HWND, para2: DWORD): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetWindowContextHelpId".} +proc GetWindowContextHelpId*(para1: HWND): DWORD{.stdcall, dynlib: "user32", + importc: "GetWindowContextHelpId".} +proc SetMenuContextHelpId*(para1: HMENU, para2: DWORD): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetMenuContextHelpId".} +proc GetMenuContextHelpId*(para1: HMENU): DWORD{.stdcall, dynlib: "user32", + importc: "GetMenuContextHelpId".} +proc MessageBeep*(uType: 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*(cursor: HCURSOR): HCURSOR{.stdcall, dynlib: "user32", + importc: "SetCursor".} +proc GetCursorPos*(lpPoint: LPPOINT): WINBOOL{.stdcall, dynlib: "user32", + importc: "GetCursorPos".} +proc ClipCursor*(lpRect: LPRECT): WINBOOL{.stdcall, dynlib: "user32", + importc: "ClipCursor".} +proc GetClipCursor*(lpRect: LPRECT): WINBOOL{.stdcall, dynlib: "user32", + importc: "GetClipCursor".} +proc GetCursor*(): HCURSOR{.stdcall, dynlib: "user32", importc: "GetCursor".} +proc CreateCaret*(wnd: HWND, hBitmap: HBITMAP, nWidth: int32, nHeight: int32): WINBOOL{. + stdcall, dynlib: "user32", importc: "CreateCaret".} +proc GetCaretBlinkTime*(): 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*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "HideCaret".} +proc ShowCaret*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32", + importc: "ShowCaret".} +proc SetCaretPos*(X: int32, Y: int32): WINBOOL{.stdcall, dynlib: "user32", + importc: "SetCaretPos".} +proc GetCaretPos*(lpPoint: LPPOINT): WINBOOL{.stdcall, dynlib: "user32", + importc: "GetCaretPos".} +proc ClientToScreen*(wnd: HWND, lpPoint: LPPOINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "ClientToScreen".} +proc ScreenToClient*(wnd: HWND, lpPoint: LPPOINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "ScreenToClient".} +proc MapWindowPoints*(hWndFrom: HWND, hWndTo: HWND, lpPoints: LPPOINT, + cPoints: 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*(wnd: HWND, nIndex: int32): int16{.stdcall, + dynlib: "user32", importc: "GetWindowWord".} +proc SetWindowWord*(wnd: HWND, nIndex: int32, wNewWord: int16): int16{.stdcall, + dynlib: "user32", importc: "SetWindowWord".} +proc GetClassWord*(wnd: HWND, nIndex: int32): int16{.stdcall, dynlib: "user32", + importc: "GetClassWord".} +proc SetClassWord*(wnd: HWND, nIndex: int32, wNewWord: int16): int16{.stdcall, + dynlib: "user32", importc: "SetClassWord".} +proc GetDesktopWindow*(): HWND{.stdcall, dynlib: "user32", + importc: "GetDesktopWindow".} +proc GetParent*(wnd: HWND): HWND{.stdcall, dynlib: "user32", + importc: "GetParent".} +proc SetParent*(hWndChild: HWND, hWndNewParent: HWND): HWND{.stdcall, + dynlib: "user32", importc: "SetParent".} +proc EnumChildWindows*(hWndParent: HWND, lpEnumFunc: ENUMWINDOWSPROC, + lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32", + importc: "EnumChildWindows".} +proc EnumWindows*(lpEnumFunc: ENUMWINDOWSPROC, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnumWindows".} +proc EnumThreadWindows*(dwThreadId: DWORD, lpfn: ENUMWINDOWSPROC, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnumThreadWindows".} +proc EnumTaskWindows*(hTask: HWND, lpfn: FARPROC, lp: LPARAM): WINBOOL{. + stdcall, dynlib: "user32", importc: "EnumThreadWindows".} +proc GetTopWindow*(wnd: HWND): HWND{.stdcall, dynlib: "user32", + importc: "GetTopWindow".} +proc GetWindowThreadProcessId*(wnd: HWND, lpdwProcessId: LPDWORD): DWORD{. + stdcall, dynlib: "user32", importc: "GetWindowThreadProcessId".} +proc GetLastActivePopup*(wnd: HWND): HWND{.stdcall, dynlib: "user32", + importc: "GetLastActivePopup".} +proc GetWindow*(wnd: HWND, uCmd: 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, wp: WPARAM, lp: 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*(cursor: HCURSOR): WINBOOL{.stdcall, dynlib: "user32", + importc: "DestroyCursor".} +proc SetSystemCursor*(hcur: HCURSOR, anID: DWORD): WINBOOL{.stdcall, + dynlib: "user32", importc: "SetSystemCursor".} +proc CreateIcon*(hInstance: HINST, nWidth: int32, nHeight: int32, cPlanes: int8, + cBitsPixel: int8, lpbANDbits: var int8, lpbXORbits: var int8): HICON{. + stdcall, dynlib: "user32", importc: "CreateIcon".} +proc DestroyIcon*(icon: HICON): WINBOOL{.stdcall, dynlib: "user32", + importc: "DestroyIcon".} +proc LookupIconIdFromDirectory*(presbits: PBYTE, fIcon: WINBOOL): int32{. + stdcall, dynlib: "user32", importc: "LookupIconIdFromDirectory".} +proc LookupIconIdFromDirectoryEx*(presbits: PBYTE, fIcon: WINBOOL, + cxDesired: int32, cyDesired: int32, + Flags: 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*(icon: HICON): HICON{.stdcall, dynlib: "user32", + importc: "CopyIcon".} +proc GetIconInfo*(icon: HICON, piconinfo: PICONINFO): WINBOOL{.stdcall, + dynlib: "user32", importc: "GetIconInfo".} +proc MapDialogRect*(hDlg: HWND, lpRect: LPRECT): WINBOOL{.stdcall, + dynlib: "user32", importc: "MapDialogRect".} +proc SetScrollInfo*(para1: HWND, para2: int32, para3: LPCSCROLLINFO, + para4: WINBOOL): int32{.stdcall, dynlib: "user32", + importc: "SetScrollInfo".} +proc GetScrollInfo*(para1: HWND, para2: int32, para3: LPSCROLLINFO): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetScrollInfo".} +proc TranslateMDISysAccel*(hWndClient: HWND, lpMsg: LPMSG): WINBOOL{.stdcall, + dynlib: "user32", importc: "TranslateMDISysAccel".} +proc ArrangeIconicWindows*(wnd: HWND): 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*(wnd: 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, icon: 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*(wnd: 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, wp: WPARAM, lp: LPARAM, hMainMenu: HMENU, + hInst: HINST, hwndStatus: HWND, lpwIDs: var UINT){.stdcall, + dynlib: "comctl32", importc: "MenuHelp".} +proc ShowHideMenuCtl*(wnd: HWND, uFlags: UINT, lpInfo: LPINT): WINBOOL{. + stdcall, dynlib: "comctl32", importc: "ShowHideMenuCtl".} +proc GetEffectiveClientRect*(wnd: HWND, lprc: LPRECT, lpInfo: LPINT){.stdcall, + dynlib: "comctl32", importc: "GetEffectiveClientRect".} +proc MakeDragList*(hLB: HWND): WINBOOL{.stdcall, dynlib: "comctl32", + importc: "MakeDragList".} +proc DrawInsert*(handParent: HWND, hLB: HWND, nItem: int32){.stdcall, + dynlib: "comctl32", importc: "DrawInsert".} +proc LBItemFromPt*(hLB: HWND, pt: POINT, bAutoScroll: WINBOOL): int32{.stdcall, + dynlib: "comctl32", importc: "LBItemFromPt".} +proc CreateUpDownControl*(dwStyle: DWORD, x: int32, y: int32, cx: int32, + cy: int32, hParent: HWND, nID: int32, hInst: HINST, + hBuddy: HWND, nUpper: int32, nLower: int32, + nPos: int32): HWND{.stdcall, dynlib: "comctl32", + importc: "CreateUpDownControl".} +proc RegCloseKey*(key: HKEY): LONG{.stdcall, dynlib: "advapi32", + importc: "RegCloseKey".} +proc RegSetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR): LONG{. + stdcall, dynlib: "advapi32", importc: "RegSetKeySecurity".} +proc RegFlushKey*(key: HKEY): LONG{.stdcall, dynlib: "advapi32", + importc: "RegFlushKey".} +proc RegGetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpcbSecurityDescriptor: LPDWORD): LONG{.stdcall, + dynlib: "advapi32", importc: "RegGetKeySecurity".} +proc RegNotifyChangeKeyValue*(key: HKEY, bWatchSubtree: WINBOOL, + dwNotifyFilter: DWORD, hEvent: HANDLE, + fAsynchronus: WINBOOL): LONG{.stdcall, + dynlib: "advapi32", importc: "RegNotifyChangeKeyValue".} +proc IsValidCodePage*(CodePage: 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*(wnd: HWND, dwType: DWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetConnectionDialog".} +proc WNetDisconnectDialog*(wnd: HWND, dwType: DWORD): DWORD{.stdcall, + dynlib: "mpr", importc: "WNetDisconnectDialog".} +proc WNetCloseEnum*(hEnum: HANDLE): DWORD{.stdcall, dynlib: "mpr", + importc: "WNetCloseEnum".} +proc CloseServiceHandle*(hSCObject: SC_HANDLE): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "CloseServiceHandle".} +proc ControlService*(hService: SC_HANDLE, dwControl: DWORD, + lpServiceStatus: LPSERVICE_STATUS): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "ControlService".} +proc DeleteService*(hService: SC_HANDLE): WINBOOL{.stdcall, dynlib: "advapi32", + importc: "DeleteService".} +proc LockServiceDatabase*(hSCManager: SC_HANDLE): SC_LOCK{.stdcall, + dynlib: "advapi32", importc: "LockServiceDatabase".} +proc NotifyBootConfigStatus*(BootAcceptable: WINBOOL): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "NotifyBootConfigStatus".} +proc QueryServiceObjectSecurity*(hService: SC_HANDLE, + dwSecurityInformation: SECURITY_INFORMATION, + lpSecurityDescriptor: PSECURITY_DESCRIPTOR, + cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceObjectSecurity".} +proc QueryServiceStatus*(hService: SC_HANDLE, lpServiceStatus: LPSERVICE_STATUS): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "QueryServiceStatus".} +proc SetServiceObjectSecurity*(hService: SC_HANDLE, + dwSecurityInformation: SECURITY_INFORMATION, + lpSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{. + stdcall, dynlib: "advapi32", importc: "SetServiceObjectSecurity".} +proc SetServiceStatus*(hServiceStatus: SERVICE_STATUS_HANDLE, + lpServiceStatus: LPSERVICE_STATUS): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "SetServiceStatus".} +proc UnlockServiceDatabase*(ScLock: SC_LOCK): WINBOOL{.stdcall, + dynlib: "advapi32", importc: "UnlockServiceDatabase".} +proc ChoosePixelFormat*(para1: HDC, para2: PPIXELFORMATDESCRIPTOR): int32{. + stdcall, dynlib: "gdi32", importc: "ChoosePixelFormat".} +proc DescribePixelFormat*(para1: HDC, para2: int32, para3: 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".} +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".} +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*(wnd: HWND, szName: LPTSTR): LRESULT +proc Animate_Play*(wnd: HWND, `from`, `to`: int32, rep: UINT): LRESULT + +proc Animate_Stop*(wnd: HWND): LRESULT +proc Animate_Close*(wnd: HWND): LRESULT +proc Animate_Seek*(wnd: HWND, frame: int32): LRESULT +proc PropSheet_AddPage*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE): LRESULT +proc PropSheet_Apply*(hPropSheetDlg: HWND): LRESULT +proc PropSheet_CancelToClose*(hPropSheetDlg: HWND): LRESULT +proc PropSheet_Changed*(hPropSheetDlg, hwndPage: HWND): LRESULT +proc PropSheet_GetCurrentPageHwnd*(hDlg: HWND): LRESULT +proc PropSheet_GetTabControl*(hPropSheetDlg: HWND): LRESULT +proc PropSheet_IsDialogMessage*(hDlg: HWND, pMsg: int32): LRESULT +proc PropSheet_PressButton*(hPropSheetDlg: HWND, iButton: int32): LRESULT +proc PropSheet_QuerySiblings*(hPropSheetDlg: HWND, param1, param2: int32): LRESULT +proc PropSheet_RebootSystem*(hPropSheetDlg: HWND): LRESULT +proc PropSheet_RemovePage*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE, + index: int32): LRESULT +proc PropSheet_RestartWindows*(hPropSheetDlg: HWND): LRESULT +proc PropSheet_SetCurSel*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE, + index: int32): LRESULT +proc PropSheet_SetCurSelByID*(hPropSheetDlg: HWND, id: int32): LRESULT +proc PropSheet_SetFinishText*(hPropSheetDlg: HWND, lpszText: LPTSTR): LRESULT +proc PropSheet_SetTitle*(hPropSheetDlg: HWND, dwStyle: DWORD, lpszText: LPCTSTR): LRESULT +proc PropSheet_SetWizButtons*(hPropSheetDlg: HWND, dwFlags: DWORD): LRESULT +proc PropSheet_UnChanged*(hPropSheetDlg: HWND, hwndPage: HWND): LRESULT +proc Header_DeleteItem*(hwndHD: HWND, index: int32): WINBOOL +proc Header_GetItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL +proc Header_GetItemCount*(hwndHD: HWND): int32 +proc Header_InsertItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): int32 +proc Header_Layout*(hwndHD: HWND, layout: var HD_LAYOUT): WINBOOL +proc Header_SetItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL +proc ListView_Arrange*(hwndLV: HWND, code: UINT): LRESULT +proc ListView_CreateDragImage*(wnd: HWND, i: int32, lpptUpLeft: LPPOINT): LRESULT +proc ListView_DeleteAllItems*(wnd: HWND): LRESULT +proc ListView_DeleteColumn*(wnd: HWND, iCol: int32): LRESULT +proc ListView_DeleteItem*(wnd: HWND, iItem: int32): LRESULT +proc ListView_EditLabel*(hwndLV: HWND, i: int32): LRESULT +proc ListView_EnsureVisible*(hwndLV: HWND, i, fPartialOK: int32): LRESULT +proc ListView_FindItem*(wnd: HWND, iStart: int32, lvfi: var LV_FINDINFO): int32 +proc ListView_GetBkColor*(wnd: HWND): LRESULT +proc ListView_GetCallbackMask*(wnd: HWND): LRESULT +proc ListView_GetColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT +proc ListView_GetColumnWidth*(wnd: HWND, iCol: int32): LRESULT +proc ListView_GetCountPerPage*(hwndLV: HWND): LRESULT +proc ListView_GetEditControl*(hwndLV: HWND): LRESULT +proc ListView_GetImageList*(wnd: HWND, iImageList: wINT): LRESULT +proc ListView_GetISearchString*(hwndLV: HWND, lpsz: LPTSTR): LRESULT +proc ListView_GetItem*(wnd: HWND, item: var LV_ITEM): LRESULT +proc ListView_GetItemCount*(wnd: HWND): LRESULT +proc ListView_GetItemPosition*(hwndLV: HWND, i: int32, pt: var POINT): int32 +proc ListView_GetItemSpacing*(hwndLV: HWND, fSmall: int32): LRESULT +proc ListView_GetItemState*(hwndLV: HWND, i, mask: int32): LRESULT +proc ListView_GetNextItem*(wnd: HWND, iStart, flags: int32): LRESULT +proc ListView_GetOrigin*(hwndLV: HWND, pt: var POINT): LRESULT +proc ListView_GetSelectedCount*(hwndLV: HWND): LRESULT +proc ListView_GetStringWidth*(hwndLV: HWND, psz: LPCTSTR): LRESULT +proc ListView_GetTextBkColor*(wnd: HWND): LRESULT +proc ListView_GetTextColor*(wnd: HWND): LRESULT +proc ListView_GetTopIndex*(hwndLV: HWND): LRESULT +proc ListView_GetViewRect*(wnd: HWND, rc: var RECT): LRESULT +proc ListView_HitTest*(hwndLV: HWND, info: var LV_HITTESTINFO): LRESULT +proc ListView_InsertColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT +proc ListView_InsertItem*(wnd: HWND, item: var LV_ITEM): LRESULT +proc ListView_RedrawItems*(hwndLV: HWND, iFirst, iLast: int32): LRESULT +proc ListView_Scroll*(hwndLV: HWND, dx, dy: int32): LRESULT +proc ListView_SetBkColor*(wnd: HWND, clrBk: COLORREF): LRESULT +proc ListView_SetCallbackMask*(wnd: HWND, mask: UINT): LRESULT +proc ListView_SetColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT +proc ListView_SetColumnWidth*(wnd: HWND, iCol, cx: int32): LRESULT +proc ListView_SetImageList*(wnd: HWND, himl: int32, iImageList: HIMAGELIST): LRESULT +proc ListView_SetItem*(wnd: HWND, item: var LV_ITEM): LRESULT +proc ListView_SetItemCount*(hwndLV: HWND, cItems: int32): LRESULT +proc ListView_SetItemPosition*(hwndLV: HWND, i, x, y: int32): LRESULT +proc ListView_SetItemPosition32*(hwndLV: HWND, i, x, y: int32): LRESULT +proc ListView_SetItemState*(hwndLV: HWND, i, data, mask: int32): LRESULT +proc ListView_SetItemText*(hwndLV: HWND, i, iSubItem: int32, pszText: LPTSTR): LRESULT +proc ListView_SetTextBkColor*(wnd: HWND, clrTextBk: COLORREF): LRESULT +proc ListView_SetTextColor*(wnd: HWND, clrText: COLORREF): LRESULT +proc ListView_SortItems*(hwndLV: HWND, pfnCompare: PFNLVCOMPARE, lPrm: LPARAM): LRESULT +proc ListView_Update*(hwndLV: HWND, i: int32): LRESULT +proc TreeView_InsertItem*(wnd: HWND, lpis: LPTV_INSERTSTRUCT): LRESULT +proc TreeView_DeleteItem*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_DeleteAllItems*(wnd: HWND): LRESULT +proc TreeView_Expand*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT +proc TreeView_GetCount*(wnd: HWND): LRESULT +proc TreeView_GetIndent*(wnd: HWND): LRESULT +proc TreeView_SetIndent*(wnd: HWND, indent: int32): LRESULT +proc TreeView_GetImageList*(wnd: HWND, iImage: WPARAM): LRESULT +proc TreeView_SetImageList*(wnd: HWND, himl: HIMAGELIST, iImage: WPARAM): LRESULT +proc TreeView_GetNextItem*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT +proc TreeView_GetChild*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_GetNextSibling*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_GetPrevSibling*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_GetParent*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_GetFirstVisible*(wnd: HWND): LRESULT +proc TreeView_GetNextVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_GetPrevVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_GetSelection*(wnd: HWND): LRESULT +proc TreeView_GetDropHilight*(wnd: HWND): LRESULT +proc TreeView_GetRoot*(wnd: HWND): LRESULT +proc TreeView_Select*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT +proc TreeView_SelectItem*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_SelectDropTarget*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_SelectSetFirstVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_GetItem*(wnd: HWND, item: var TV_ITEM): LRESULT +proc TreeView_SetItem*(wnd: HWND, item: var TV_ITEM): LRESULT +proc TreeView_EditLabel*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_GetEditControl*(wnd: HWND): LRESULT +proc TreeView_GetVisibleCount*(wnd: HWND): LRESULT +proc TreeView_HitTest*(wnd: HWND, lpht: LPTV_HITTESTINFO): LRESULT +proc TreeView_CreateDragImage*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_SortChildren*(wnd: HWND, hitem: HTREEITEM, recurse: int32): LRESULT +proc TreeView_EnsureVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT +proc TreeView_SortChildrenCB*(wnd: HWND, psort: LPTV_SORTCB, recurse: int32): LRESULT +proc TreeView_EndEditLabelNow*(wnd: HWND, fCancel: int32): LRESULT +proc TreeView_GetISearchString*(hwndTV: HWND, lpsz: LPTSTR): LRESULT +proc TabCtrl_GetImageList*(wnd: HWND): LRESULT +proc TabCtrl_SetImageList*(wnd: HWND, himl: HIMAGELIST): LRESULT +proc TabCtrl_GetItemCount*(wnd: HWND): LRESULT +proc TabCtrl_GetItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT +proc TabCtrl_SetItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT + +proc TabCtrl_InsertItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT +proc TabCtrl_DeleteItem*(wnd: HWND, i: int32): LRESULT +proc TabCtrl_DeleteAllItems*(wnd: HWND): LRESULT +proc TabCtrl_GetItemRect*(wnd: HWND, i: int32, rc: var RECT): LRESULT +proc TabCtrl_GetCurSel*(wnd: HWND): LRESULT +proc TabCtrl_SetCurSel*(wnd: HWND, i: int32): LRESULT +proc TabCtrl_HitTest*(hwndTC: HWND, info: var TC_HITTESTINFO): LRESULT +proc TabCtrl_SetItemExtra*(hwndTC: HWND, cb: int32): LRESULT +proc TabCtrl_AdjustRect*(wnd: HWND, bLarger: WINBOOL, rc: var RECT): LRESULT +proc TabCtrl_SetItemSize*(wnd: HWND, x, y: int32): LRESULT +proc TabCtrl_RemoveImage*(wnd: HWND, i: WPARAM): LRESULT +proc TabCtrl_SetPadding*(wnd: HWND, cx, cy: int32): LRESULT +proc TabCtrl_GetRowCount*(wnd: HWND): LRESULT +proc TabCtrl_GetToolTips*(wnd: HWND): LRESULT +proc TabCtrl_SetToolTips*(wnd: HWND, hwndTT: int32): LRESULT +proc TabCtrl_GetCurFocus*(wnd: HWND): LRESULT +proc TabCtrl_SetCurFocus*(wnd: HWND, i: int32): LRESULT +proc SNDMSG*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT +proc CommDlg_OpenSave_GetSpecA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT +proc CommDlg_OpenSave_GetSpecW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT +when defined(winUnicode): + proc CommDlg_OpenSave_GetSpec*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT +else: + proc CommDlg_OpenSave_GetSpec*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT +proc CommDlg_OpenSave_GetFilePathA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT +proc CommDlg_OpenSave_GetFilePathW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT +when defined(winUnicode): + proc CommDlg_OpenSave_GetFilePath*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT +else: + proc CommDlg_OpenSave_GetFilePath*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT +proc CommDlg_OpenSave_GetFolderPathA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT +proc CommDlg_OpenSave_GetFolderPathW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT +when defined(winUnicode): + proc CommDlg_OpenSave_GetFolderPath*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT +else: + proc CommDlg_OpenSave_GetFolderPath*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT +proc CommDlg_OpenSave_GetFolderIDList*(hdlg: HWND, pidl: LPVOID, cbmax: int32): LRESULT +proc CommDlg_OpenSave_SetControlText*(hdlg: HWND, id: int32, text: LPSTR): LRESULT +proc CommDlg_OpenSave_HideControl*(hdlg: HWND, id: int32): LRESULT +proc CommDlg_OpenSave_SetDefExt*(hdlg: HWND, pszext: LPSTR): LRESULT +proc GetNextWindow*(wnd: HWND, uCmd: 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* {.final, pure.} = object + Level*: int16 + Sbz*: int16 + ObjectType*: PGUID + + TObjectTypeList* = OBJECT_TYPE_LIST + AUDIT_EVENT_TYPE* = DWORD + PBlendFunction* = ptr TBlendFunction + BLENDFUNCTION* {.final, pure.} = object + BlendOp*: int8 + BlendFlags*: int8 + SourceConstantAlpha*: int8 + AlphaFormat*: int8 + + TBlendFunction* = BLENDFUNCTION + WIN_CERTIFICATE* {.final, pure.} = object + dwLength*: DWord + wRevision*: int16 + wCertificateType*: int16 + bCertificate*: array[0..0, int8] + + TWinCertificate* = WIN_CERTIFICATE + PWinCertificate* = ptr TWinCertificate + TMaxLogPalette* {.final, pure.} = object + palVersion*: int16 + palNumEntries*: int16 + palPalEntry*: array[int8, 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 + + # 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*(wnd: 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*(wnd: 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, wnd: HWND, lpCC: var TCommConfig): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".} +proc CommConfigDialogA*(lpszName: LPCSTR, wnd: HWND, lpCC: var TCommConfig): WINBOOL{. + stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".} +proc CommConfigDialogW*(lpszName: LPWSTR, wnd: 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(wnd: 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*(wnd: 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(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: PChar; cchItemText: UINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA'; + #function GetAltTabInfoA(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: LPCSTR; cchItemText: UINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA'; + #function GetAltTabInfoW(wnd: 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*(wnd: 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*(icon: 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(menu: 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*(wnd: HWND, menu: HMENU, uItem: UINT, lprcItem: var TRect): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetMenuItemRect".} +proc GetMessage*(lpMsg: var TMsg, wnd: HWND, wMsgFilterMin, wMsgFilterMax: UINT): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetMessageA".} +proc GetMessageA*(lpMsg: var TMsg, wnd: HWND, + wMsgFilterMin, wMsgFilterMax: UINT): WINBOOL{.stdcall, + dynlib: "user32", importc: "GetMessageA".} +proc GetMessageW*(lpMsg: var TMsg, wnd: 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*(wnd: HWND, BarFlag: int, ScrollInfo: var TScrollInfo): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetScrollInfo".} +proc GetScrollRange*(wnd: HWND, nBar: int, lpMinPos, lpMaxPos: var int): WINBOOL{. + stdcall, dynlib: "user32", importc: "GetScrollRange".} + #function GetSecurityDescriptorControl(pSecurityDescriptor: PSecurityDescriptor; var pControl: SECURITY_DESCRIPTOR_CONTROL; var lpdwRevision: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorControl'; + #function GetSecurityDescriptorDacl(pSecurityDescriptor: PSecurityDescriptor; var lpbDaclPresent: WINBOOL; var pDacl: PACL; var lpbDaclDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorDacl'; + #function GetSecurityDescriptorGroup(pSecurityDescriptor: PSecurityDescriptor; var pGroup: PSID; var lpbGroupDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorGroup'; + #function GetSecurityDescriptorOwner(pSecurityDescriptor: PSecurityDescriptor; var pOwner: PSID; var lpbOwnerDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorOwner'; + #function GetSecurityDescriptorSacl(pSecurityDescriptor: PSecurityDescriptor; var lpbSaclPresent: WINBOOL; var pSacl: PACL; var lpbSaclDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorSacl'; +proc GetStartupInfo*(lpStartupInfo: var 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(wnd: 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*(wnd: 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(wnd: 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*(wnd: 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, wnd: HWND, + wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): WINBOOL{. + stdcall, dynlib: "user32", importc: "PeekMessageA".} +proc PeekMessageA*(lpMsg: var TMsg, wnd: HWND, + wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): WINBOOL{. + stdcall, dynlib: "user32", importc: "PeekMessageA".} +proc PeekMessageW*(lpMsg: var TMsg, wnd: 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, key: HKEY, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".} +proc RegConnectRegistryA*(lpMachineName: LPCSTR, key: HKEY, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".} +proc RegConnectRegistryW*(lpMachineName: LPWSTR, key: HKEY, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".} +proc RegCreateKey*(key: HKEY, lpSubKey: cstring, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".} +proc RegCreateKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".} +proc RegCreateKeyEx*(key: HKEY, lpSubKey: cstring, Reserved: DWORD, + lpClass: cstring, dwOptions: DWORD, samDesired: REGSAM, + lpSecurityAttributes: PSecurityAttributes, + phkResult: var HKEY, lpdwDisposition: PDWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".} +proc RegCreateKeyExA*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD, + lpClass: LPCSTR, dwOptions: DWORD, samDesired: REGSAM, + lpSecurityAttributes: PSecurityAttributes, + phkResult: var HKEY, lpdwDisposition: PDWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".} +proc RegCreateKeyExW*(key: HKEY, lpSubKey: LPWSTR, Reserved: DWORD, + lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM, + lpSecurityAttributes: PSecurityAttributes, + phkResult: var HKEY, lpdwDisposition: PDWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".} +proc RegCreateKeyW*(key: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".} +proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: cstring, + lpcbName: var DWORD, lpReserved: Pointer, lpClass: cstring, + lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".} +proc RegEnumKeyExA*(key: HKEY, dwIndex: DWORD, lpName: LPCSTR, + lpcbName: var DWORD, lpReserved: Pointer, lpClass: LPCSTR, + lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".} +proc RegEnumKeyExW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, + lpcbName: var DWORD, lpReserved: Pointer, lpClass: LPWSTR, + lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{. + stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".} +proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: cstring, + lpcbValueName: var DWORD, lpReserved: Pointer, + lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegEnumValueA".} +proc RegEnumValueA*(key: HKEY, dwIndex: DWORD, lpValueName: cstring, + lpcbValueName: var DWORD, lpReserved: Pointer, + lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegEnumValueA".} +proc RegEnumValueW*(key: HKEY, dwIndex: DWORD, lpValueName: cstring, + lpcbValueName: var DWORD, lpReserved: Pointer, + lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegEnumValueW".} +proc RegGetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSecurityDescriptor, + lpcbSecurityDescriptor: var DWORD): int32{.stdcall, + dynlib: "advapi32", importc: "RegGetKeySecurity".} +proc RegSetValueEx*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD, + dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegSetValueExA".} +proc RegSetValueExA*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD, + dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegSetValueExA".} +proc RegSetValueExW*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD, + dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{. + stdcall, dynlib: "advapi32", importc: "RegSetValueExW".} +proc RegisterClass*(lpWndClass: 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*(key: HKEY, lpSubKey: cstring, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".} +proc RegOpenKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".} +proc RegOpenKeyEx*(key: HKEY, lpSubKey: cstring, ulOptions: DWORD, + samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall, + dynlib: "advapi32", importc: "RegOpenKeyExA".} +proc RegOpenKeyExA*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD, + samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall, + dynlib: "advapi32", importc: "RegOpenKeyExA".} +proc RegOpenKeyExW*(key: HKEY, lpSubKey: LPWSTR, ulOptions: DWORD, + samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall, + dynlib: "advapi32", importc: "RegOpenKeyExW".} +proc RegOpenKeyW*(key: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{. + stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".} +proc RegQueryMultipleValues*(key: HKEY, ValList: pointer, NumVals: DWORD, + lpValueBuf: cstring, ldwTotsize: var DWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".} +proc RegQueryMultipleValuesA*(key: HKEY, ValList: pointer, NumVals: DWORD, + lpValueBuf: LPCSTR, ldwTotsize: var DWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".} +proc RegQueryMultipleValuesW*(key: HKEY, ValList: pointer, NumVals: DWORD, + lpValueBuf: LPWSTR, ldwTotsize: var DWORD): int32{. + stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".} +proc RegQueryValue*(key: HKEY, lpSubKey: cstring, lpValue: cstring, + lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32", + importc: "RegQueryValueA".} +proc RegQueryValueA*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPCSTR, + lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32", + importc: "RegQueryValueA".} +proc RegQueryValueW*(key: HKEY, lpSubKey: LPWSTR, lpValue: LPWSTR, + lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32", + importc: "RegQueryValueW".} +proc ResetDC*(DC: HDC, p2: 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*(wnd: 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*(wnd: HWND, XAmount: int32, YAmount: int32, rect: LPRECT, + lpClipRect: lpRECT): WINBOOL{.stdcall, dynlib: "user32", + importc: "ScrollWindow".} +proc ScrollWindowEx*(wnd: HWND, dx: int32, dy: int32, prcScroll: lpRECT, + prcClip: lpRECT, hrgnUpdate: HRGN, prcUpdate: LPRECT, + flags: 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*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM, + fuFlags, uTimeout: UINT, lpdwResult: var DWORD): LRESULT{. + stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".} +proc SendMessageTimeoutA*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM, + fuFlags, uTimeout: UINT, lpdwResult: var DWORD): LRESULT{. + stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".} +proc SendMessageTimeoutW*(wnd: HWND, Msg: UINT, wp: WPARAM, lp: 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(menu: 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*(wnd: 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*(menu: HMENU, uFlags: UINT, x: int32, y: int32, + nReserved: int32, wnd: 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*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{. + stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".} +proc TranslateAcceleratorA*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{. + stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".} +proc TranslateAcceleratorW*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{. + stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".} +proc TranslateCharsetInfo*(lpSrc: var DWORD, lpCs: var 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(wnd: 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 "deprecated" +proc AnsiNext*(lpsz: LPCSTR): LPSTR{.stdcall, dynlib: "user32", + importc: "CharNextA".} +proc AnsiPrev*(lpszStart: LPCSTR, lpszCurrent: LPCSTR): LPSTR{.stdcall, + dynlib: "user32", importc: "CharPrevA".} +proc AnsiToOem*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall, + dynlib: "user32", importc: "CharToOemA".} +proc OemToAnsi*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall, + dynlib: "user32", importc: "OemToCharA".} +proc AnsiToOemBuff*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{. + stdcall, dynlib: "user32", importc: "CharToOemBuffA".} +proc OemToAnsiBuff*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{. + stdcall, dynlib: "user32", importc: "OemToCharBuffA".} +proc AnsiUpper*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32", + importc: "CharUpperA".} +proc AnsiUpperBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall, + dynlib: "user32", importc: "CharUpperBuffA".} +proc AnsiLower*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32", + importc: "CharLowerA".} +proc AnsiLowerBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall, + dynlib: "user32", importc: "CharLowerBuffA".} + +#== Implementation of macros + +# WinBase.h + +proc FreeModule*(h: HINST): WINBOOL = + result = FreeLibrary(h) + +proc MakeProcInstance*(p, i: pointer): pointer = + result = p + +proc FreeProcInstance*(p: pointer): pointer = + result = p + +proc GlobalDiscard*(hglbMem: HGLOBAL): HGLOBAL = + result = GlobalReAlloc(hglbMem, 0, GMEM_MOVEABLE) + +proc LocalDiscard*(hlocMem: HLOCAL): HLOCAL = + result = LocalReAlloc(hlocMem, 0, LMEM_MOVEABLE) + +# WinGDI.h + +proc GetGValue*(rgb: int32): int8 = + result = toU8(rgb shr 8'i32) +proc RGB*(r, g, b: int): COLORREF = + result = toU32(r) or (toU32(g) shl 8) or (toU32(b) shl 16) +proc RGB*(r, g, b: range[0 .. 255]): COLORREF = + result = r or g shl 8 or b shl 16 + +proc PALETTERGB*(r, g, b: range[0..255]): COLORREF = + result = 0x02000000 or RGB(r, g, b) + +proc PALETTEINDEX*(i: DWORD): COLORREF = + result = COLORREF(0x01000000'i32 or i and 0xffff'i32) + + +proc GetRValue*(rgb: COLORREF): int8 = + result = toU8(rgb) + +proc GetGValue*(rgb: COLORREF): int8 = + result = toU8(rgb shr 8) + +proc GetBValue*(rgb: COLORREF): int8 = + result = toU8(rgb shr 16) + +# + +proc HIBYTE*(w: int32): int8 = + result = toU8(w shr 8'i32 and 0x000000FF'i32) + +proc HIWORD*(L: int32): int16 = + result = toU16(L shr 16'i32 and 0x0000FFFF'i32) + +proc LOBYTE*(w: int32): int8 = + result = toU8(w) + +proc LOWORD*(L: int32): int16 = + result = toU16(L) + +proc MAKELONG*(a, b: int32): LONG = + result = a and 0x0000ffff'i32 or b shl 16'i32 + +proc MAKEWORD*(a, b: int32): int16 = + result = toU16(a and 0xff'i32) or toU16(b shl 8'i32) + +proc SEXT_HIWORD*(L: int32): int32 = + # return type might be wrong + result = HIWORD(L) + +proc ZEXT_HIWORD*(L: int32): int32 = + # return type might be wrong + result = HIWORD(L) and 0xffff'i32 + +proc SEXT_LOWORD*(L: int32): int32 = + result = LOWORD(L) + +proc INDEXTOOVERLAYMASK*(i: int32): int32 = + # return type might be wrong + result = i shl 8'i32 + +proc INDEXTOSTATEIMAGEMASK*(i: int32): int32 = + # return type might be wrong + result = i shl 12'i32 + +proc MAKEINTATOM*(i: int32): LPTSTR = + result = cast[LPTSTR](cast[ULONG_PTR](ToU16(i))) + +proc MAKELANGID*(p, s: int32): int32 = + # return type might be wrong + result = toU16(s) shl 10'i16 or toU16(p) + +proc PRIMARYLANGID*(lgid: int32): int16 = + result = toU16(lgid) and 0x000003FF'i16 + +proc SUBLANGID*(lgid: int32): int32 = + # return type might be wrong + result = toU16(lgid) shr 10'i16 + +proc LANGIDFROMLCID*(lcid: int32): int16 = + result = toU16(lcid) + +proc SORTIDFROMLCID*(lcid: int32): int16 = + result = toU16((lcid and 0x000FFFFF'i32) shr 16'i32) + +proc MAKELCID*(lgid, srtid: int32): DWORD = + result = toU32(srtid shl 16'i32 or lgid and 0xffff'i32) + +proc MAKELPARAM*(L, h: int32): LPARAM = + result = LPARAM(MAKELONG(L, h)) + +proc MAKELRESULT*(L, h: int32): LRESULT = + result = LRESULT(MAKELONG(L, h)) + +proc MAKEROP4*(fore, back: int32): DWORD = + result = back shl 8'i32 and 0xFF000000'i32 or fore + +proc MAKEWPARAM*(L, h: int32): WPARAM = + result = WPARAM(MAKELONG(L, h)) + +proc GET_X_LPARAM*(lp: Windows.LParam): int32 = + result = LOWORD(lp.int32) + +proc GET_Y_LPARAM*(lp: Windows.LParam): int32 = + result = HIWORD(lp.int32) + +proc UNICODE_NULL*(): WCHAR = + result = 0'u16 + + + +proc GetFirstChild*(h: HWND): HWND = + result = GetTopWindow(h) + +proc GetNextSibling*(h: HWND): HWND = + result = GetWindow(h, GW_HWNDNEXT) + +proc GetWindowID*(h: HWND): int32 = + result = GetDlgCtrlID(h) + +proc SubclassWindow*(h: HWND, p: LONG): LONG = + result = SetWindowLong(h, GWL_WNDPROC, p) + +proc GET_WM_COMMAND_CMD*(w, L: int32): int32 = + # return type might be wrong + result = HIWORD(w) + +proc GET_WM_COMMAND_ID(w, L: int32): int32 = + # return type might be wrong + result = LOWORD(w) + +proc GET_WM_CTLCOLOR_HDC(w, L, msg: int32): HDC = + result = HDC(w) + +proc GET_WM_CTLCOLOR_HWND(w, L, msg: int32): HWND = + result = HWND(L) + +proc GET_WM_HSCROLL_CODE(w, L: int32): int32 = + # return type might be wrong + result = LOWORD(w) + +proc GET_WM_HSCROLL_HWND(w, L: int32): HWND = + result = HWND(L) + +proc GET_WM_HSCROLL_POS(w, L: int32): int32 = + # return type might be wrong + result = HIWORD(w) + +proc GET_WM_MDIACTIVATE_FACTIVATE(h, a, b: int32): int32 = + # return type might be wrong + result = ord(b == h) + +proc GET_WM_MDIACTIVATE_HWNDACTIVATE(a, b: int32): HWND = + result = HWND(b) + +proc GET_WM_MDIACTIVATE_HWNDDEACT(a, b: int32): HWND = + result = HWND(a) + +proc GET_WM_VSCROLL_CODE(w, L: int32): int32 = + # return type might be wrong + result = LOWORD(w) + +proc GET_WM_VSCROLL_HWND(w, L: int32): HWND = + result = HWND(L) + +proc GET_WM_VSCROLL_POS(w, L: int32): int32 = + # return type might be wrong + result = HIWORD(w) + +proc fBinary(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fBinary) shr bp_DCB_fBinary + +proc set_fBinary(a: var DCB, fBinary: DWORD) = + a.flags = a.flags or ((fBinary shl bp_DCB_fBinary) and bm_DCB_fBinary) + +proc fParity(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fParity) shr bp_DCB_fParity + +proc set_fParity(a: var DCB, fParity: DWORD) = + a.flags = a.flags or ((fParity shl bp_DCB_fParity) and bm_DCB_fParity) + +proc fOutxCtsFlow(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fOutxCtsFlow) shr bp_DCB_fOutxCtsFlow + +proc set_fOutxCtsFlow(a: var DCB, fOutxCtsFlow: DWORD) = + a.flags = a.flags or + ((fOutxCtsFlow shl bp_DCB_fOutxCtsFlow) and bm_DCB_fOutxCtsFlow) + +proc fOutxDsrFlow(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fOutxDsrFlow) shr bp_DCB_fOutxDsrFlow + +proc set_fOutxDsrFlow(a: var DCB, fOutxDsrFlow: DWORD) = + a.flags = a.flags or + ((fOutxDsrFlow shl bp_DCB_fOutxDsrFlow) and bm_DCB_fOutxDsrFlow) + +proc fDtrControl(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fDtrControl) shr bp_DCB_fDtrControl + +proc set_fDtrControl(a: var DCB, fDtrControl: DWORD) = + a.flags = a.flags or + ((fDtrControl shl bp_DCB_fDtrControl) and bm_DCB_fDtrControl) + +proc fDsrSensitivity(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fDsrSensitivity) shr bp_DCB_fDsrSensitivity + +proc set_fDsrSensitivity(a: var DCB, fDsrSensitivity: DWORD) = + a.flags = a.flags or + ((fDsrSensitivity shl bp_DCB_fDsrSensitivity) and + bm_DCB_fDsrSensitivity) + +proc fTXContinueOnXoff(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fTXContinueOnXoff) shr + bp_DCB_fTXContinueOnXoff + +proc set_fTXContinueOnXoff(a: var DCB, fTXContinueOnXoff: DWORD) = + a.flags = a.flags or + ((fTXContinueOnXoff shl bp_DCB_fTXContinueOnXoff) and + bm_DCB_fTXContinueOnXoff) + +proc fOutX(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fOutX) shr bp_DCB_fOutX + +proc set_fOutX(a: var DCB, fOutX: DWORD) = + a.flags = a.flags or ((fOutX shl bp_DCB_fOutX) and bm_DCB_fOutX) + +proc fInX(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fInX) shr bp_DCB_fInX + +proc set_fInX(a: var DCB, fInX: DWORD) = + a.flags = a.flags or ((fInX shl bp_DCB_fInX) and bm_DCB_fInX) + +proc fErrorChar(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fErrorChar) shr bp_DCB_fErrorChar + +proc set_fErrorChar(a: var DCB, fErrorChar: DWORD) = + a.flags = a.flags or + ((fErrorChar shl bp_DCB_fErrorChar) and bm_DCB_fErrorChar) + +proc fNull(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fNull) shr bp_DCB_fNull + +proc set_fNull(a: var DCB, fNull: DWORD) = + a.flags = a.flags or ((fNull shl bp_DCB_fNull) and bm_DCB_fNull) + +proc fRtsControl(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fRtsControl) shr bp_DCB_fRtsControl + +proc set_fRtsControl(a: var DCB, fRtsControl: DWORD) = + a.flags = a.flags or + ((fRtsControl shl bp_DCB_fRtsControl) and bm_DCB_fRtsControl) + +proc fAbortOnError(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fAbortOnError) shr bp_DCB_fAbortOnError + +proc set_fAbortOnError(a: var DCB, fAbortOnError: DWORD) = + a.flags = a.flags or + ((fAbortOnError shl bp_DCB_fAbortOnError) and bm_DCB_fAbortOnError) + +proc fDummy2(a: var DCB): DWORD = + result = (a.flags and bm_DCB_fDummy2) shr bp_DCB_fDummy2 + +proc set_fDummy2(a: var DCB, fDummy2: DWORD) = + a.flags = a.flags or ((fDummy2 shl bp_DCB_fDummy2) and bm_DCB_fDummy2) + +proc fCtsHold(a: var COMSTAT): DWORD = + result = (a.flag0 and bm_COMSTAT_fCtsHold) shr bp_COMSTAT_fCtsHold + +proc set_fCtsHold(a: var COMSTAT, fCtsHold: DWORD) = + a.flag0 = a.flag0 or + ((fCtsHold shl bp_COMSTAT_fCtsHold) and bm_COMSTAT_fCtsHold) + +proc fDsrHold(a: var COMSTAT): DWORD = + result = (a.flag0 and bm_COMSTAT_fDsrHold) shr bp_COMSTAT_fDsrHold + +proc set_fDsrHold(a: var COMSTAT, fDsrHold: DWORD) = + a.flag0 = a.flag0 or + ((fDsrHold shl bp_COMSTAT_fDsrHold) and bm_COMSTAT_fDsrHold) + +proc fRlsdHold(a: var COMSTAT): DWORD = + result = (a.flag0 and bm_COMSTAT_fRlsdHold) shr bp_COMSTAT_fRlsdHold + +proc set_fRlsdHold(a: var COMSTAT, fRlsdHold: DWORD) = + a.flag0 = a.flag0 or + ((fRlsdHold shl bp_COMSTAT_fRlsdHold) and bm_COMSTAT_fRlsdHold) + +proc fXoffHold(a: var COMSTAT): DWORD = + result = (a.flag0 and bm_COMSTAT_fXoffHold) shr bp_COMSTAT_fXoffHold + +proc set_fXoffHold(a: var COMSTAT, fXoffHold: DWORD) = + a.flag0 = a.flag0 or + ((fXoffHold shl bp_COMSTAT_fXoffHold) and bm_COMSTAT_fXoffHold) + +proc fXoffSent(a: var COMSTAT): DWORD = + result = (a.flag0 and bm_COMSTAT_fXoffSent) shr bp_COMSTAT_fXoffSent + +proc set_fXoffSent(a: var COMSTAT, fXoffSent: DWORD) = + a.flag0 = a.flag0 or + ((fXoffSent shl bp_COMSTAT_fXoffSent) and bm_COMSTAT_fXoffSent) + +proc fEof(a: var COMSTAT): DWORD = + result = (a.flag0 and bm_COMSTAT_fEof) shr bp_COMSTAT_fEof + +proc set_fEof(a: var COMSTAT, fEof: DWORD) = + a.flag0 = a.flag0 or ((fEof shl bp_COMSTAT_fEof) and bm_COMSTAT_fEof) + +proc fTxim(a: var COMSTAT): DWORD = + result = (a.flag0 and bm_COMSTAT_fTxim) shr bp_COMSTAT_fTxim + +proc set_fTxim(a: var COMSTAT, fTxim: DWORD) = + a.flag0 = a.flag0 or ((fTxim shl bp_COMSTAT_fTxim) and bm_COMSTAT_fTxim) + +proc fReserved(a: var COMSTAT): DWORD = + result = (a.flag0 and bm_COMSTAT_fReserved) shr bp_COMSTAT_fReserved + +proc set_fReserved(a: var COMSTAT, fReserved: DWORD) = + a.flag0 = a.flag0 or + ((fReserved shl bp_COMSTAT_fReserved) and bm_COMSTAT_fReserved) + +proc bAppReturnCode(a: var DDEACK): int16 = + result = (a.flag0 and bm_DDEACK_bAppReturnCode) shr + bp_DDEACK_bAppReturnCode + +proc set_bAppReturnCode(a: var DDEACK, bAppReturnCode: int16) = + a.flag0 = a.flag0 or + ((bAppReturnCode shl bp_DDEACK_bAppReturnCode) and + bm_DDEACK_bAppReturnCode) + +proc reserved(a: var DDEACK): int16 = + result = (a.flag0 and bm_DDEACK_reserved) shr bp_DDEACK_reserved + +proc set_reserved(a: var DDEACK, reserved: int16) = + a.flag0 = a.flag0 or + ((reserved shl bp_DDEACK_reserved) and bm_DDEACK_reserved) + +proc fBusy(a: var DDEACK): int16 = + result = (a.flag0 and bm_DDEACK_fBusy) shr bp_DDEACK_fBusy + +proc set_fBusy(a: var DDEACK, fBusy: int16) = + a.flag0 = a.flag0 or ((fBusy shl bp_DDEACK_fBusy) and bm_DDEACK_fBusy) + +proc fAck(a: var DDEACK): int16 = + result = (a.flag0 and bm_DDEACK_fAck) shr bp_DDEACK_fAck + +proc set_fAck(a: var DDEACK, fAck: int16) = + a.flag0 = a.flag0 or ((fAck shl bp_DDEACK_fAck) and bm_DDEACK_fAck) + +proc reserved(a: var DDEADVISE): int16 = + result = (a.flag0 and bm_DDEADVISE_reserved) shr bp_DDEADVISE_reserved + +proc set_reserved(a: var DDEADVISE, reserved: int16) = + a.flag0 = a.flag0 or + ((reserved shl bp_DDEADVISE_reserved) and bm_DDEADVISE_reserved) + +proc fDeferUpd(a: var DDEADVISE): int16 = + result = (a.flag0 and bm_DDEADVISE_fDeferUpd) shr bp_DDEADVISE_fDeferUpd + +proc set_fDeferUpd(a: var DDEADVISE, fDeferUpd: int16) = + a.flag0 = a.flag0 or + ((fDeferUpd shl bp_DDEADVISE_fDeferUpd) and bm_DDEADVISE_fDeferUpd) + +proc fAckReq(a: var DDEADVISE): int16 = + result = (a.flag0 and bm_DDEADVISE_fAckReq) shr bp_DDEADVISE_fAckReq + +proc set_fAckReq(a: var DDEADVISE, fAckReq: int16) = + a.flag0 = a.flag0 or + ((fAckReq shl bp_DDEADVISE_fAckReq) and bm_DDEADVISE_fAckReq) + +proc unused(a: var DDEDATA): int16 = + result = (a.flag0 and bm_DDEDATA_unused) shr bp_DDEDATA_unused + +proc set_unused(a: var DDEDATA, unused: int16) = + a.flag0 = a.flag0 or ((unused shl bp_DDEDATA_unused) and bm_DDEDATA_unused) + +proc fResponse(a: var DDEDATA): int16 = + result = (a.flag0 and bm_DDEDATA_fResponse) shr bp_DDEDATA_fResponse + +proc set_fResponse(a: var DDEDATA, fResponse: int16) = + a.flag0 = a.flag0 or + ((fResponse shl bp_DDEDATA_fResponse) and bm_DDEDATA_fResponse) + +proc fRelease(a: var DDEDATA): int16 = + result = (a.flag0 and bm_DDEDATA_fRelease) shr bp_DDEDATA_fRelease + +proc set_fRelease(a: var DDEDATA, fRelease: int16) = + a.flag0 = a.flag0 or + ((fRelease shl bp_DDEDATA_fRelease) and bm_DDEDATA_fRelease) + +proc reserved(a: var DDEDATA): int16 = + result = (a.flag0 and bm_DDEDATA_reserved) shr bp_DDEDATA_reserved + +proc set_reserved(a: var DDEDATA, reserved: int16) = + a.flag0 = a.flag0 or + ((reserved shl bp_DDEDATA_reserved) and bm_DDEDATA_reserved) + +proc fAckReq(a: var DDEDATA): int16 = + result = (a.flag0 and bm_DDEDATA_fAckReq) shr bp_DDEDATA_fAckReq + +proc set_fAckReq(a: var DDEDATA, fAckReq: int16) = + a.flag0 = a.flag0 or + ((fAckReq shl bp_DDEDATA_fAckReq) and bm_DDEDATA_fAckReq) + +proc unused(a: var DDELN): int16 = + result = (a.flag0 and bm_DDELN_unused) shr bp_DDELN_unused + +proc set_unused(a: var DDELN, unused: int16) = + a.flag0 = a.flag0 or ((unused shl bp_DDELN_unused) and bm_DDELN_unused) + +proc fRelease(a: var DDELN): int16 = + result = (a.flag0 and bm_DDELN_fRelease) shr bp_DDELN_fRelease + +proc set_fRelease(a: var DDELN, fRelease: int16) = + a.flag0 = a.flag0 or + ((fRelease shl bp_DDELN_fRelease) and bm_DDELN_fRelease) + +proc fDeferUpd(a: var DDELN): int16 = + result = (a.flag0 and bm_DDELN_fDeferUpd) shr bp_DDELN_fDeferUpd + +proc set_fDeferUpd(a: var DDELN, fDeferUpd: int16) = + a.flag0 = a.flag0 or + ((fDeferUpd shl bp_DDELN_fDeferUpd) and bm_DDELN_fDeferUpd) + +proc fAckReq(a: var DDELN): int16 = + result = (a.flag0 and bm_DDELN_fAckReq) shr bp_DDELN_fAckReq + +proc set_fAckReq(a: var DDELN, fAckReq: int16) = + a.flag0 = a.flag0 or ((fAckReq shl bp_DDELN_fAckReq) and bm_DDELN_fAckReq) + +proc unused(a: var DDEPOKE): int16 = + result = (a.flag0 and bm_DDEPOKE_unused) shr bp_DDEPOKE_unused + +proc set_unused(a: var DDEPOKE, unused: int16) = + a.flag0 = a.flag0 or ((unused shl bp_DDEPOKE_unused) and bm_DDEPOKE_unused) + +proc fRelease(a: var DDEPOKE): int16 = + result = (a.flag0 and bm_DDEPOKE_fRelease) shr bp_DDEPOKE_fRelease + +proc set_fRelease(a: var DDEPOKE, fRelease: int16) = + a.flag0 = a.flag0 or + ((fRelease shl bp_DDEPOKE_fRelease) and bm_DDEPOKE_fRelease) + +proc fReserved(a: var DDEPOKE): int16 = + result = (a.flag0 and bm_DDEPOKE_fReserved) shr bp_DDEPOKE_fReserved + +proc set_fReserved(a: var DDEPOKE, fReserved: int16) = + a.flag0 = a.flag0 or + ((fReserved shl bp_DDEPOKE_fReserved) and bm_DDEPOKE_fReserved) + +proc unused(a: var DDEUP): int16 = + result = (a.flag0 and bm_DDEUP_unused) shr bp_DDEUP_unused + +proc set_unused(a: var DDEUP, unused: int16) = + a.flag0 = a.flag0 or ((unused shl bp_DDEUP_unused) and bm_DDEUP_unused) + +proc fAck(a: var DDEUP): int16 = + result = (a.flag0 and bm_DDEUP_fAck) shr bp_DDEUP_fAck + +proc set_fAck(a: var DDEUP, fAck: int16) = + a.flag0 = a.flag0 or ((fAck shl bp_DDEUP_fAck) and bm_DDEUP_fAck) + +proc fRelease(a: var DDEUP): int16 = + result = (a.flag0 and bm_DDEUP_fRelease) shr bp_DDEUP_fRelease + +proc set_fRelease(a: var DDEUP, fRelease: int16) = + a.flag0 = a.flag0 or + ((fRelease shl bp_DDEUP_fRelease) and bm_DDEUP_fRelease) + +proc fReserved(a: var DDEUP): int16 = + result = (a.flag0 and bm_DDEUP_fReserved) shr bp_DDEUP_fReserved + +proc set_fReserved(a: var DDEUP, fReserved: int16) = + a.flag0 = a.flag0 or + ((fReserved shl bp_DDEUP_fReserved) and bm_DDEUP_fReserved) + +proc fAckReq(a: var DDEUP): int16 = + result = (a.flag0 and bm_DDEUP_fAckReq) shr bp_DDEUP_fAckReq + +proc set_fAckReq(a: var DDEUP, fAckReq: int16) = + a.flag0 = a.flag0 or ((fAckReq shl bp_DDEUP_fAckReq) and bm_DDEUP_fAckReq) + +proc CreateWindowA(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD, + X: int32, Y: int32, nWidth: int32, nHeight: int32, + hWndParent: HWND, menu: HMENU, hInstance: HINST, + lpParam: LPVOID): HWND = + result = CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, + nHeight, hWndParent, menu, hInstance, lpParam) + +proc CreateDialogA(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): HWND = + result = CreateDialogParamA(hInstance, lpTemplateName, hWndParent, + lpDialogFunc, 0) + +proc CreateDialogIndirectA(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): HWND = + result = CreateDialogIndirectParamA(hInstance, lpTemplate, hWndParent, + lpDialogFunc, 0) + +proc DialogBoxA(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): int32 = + result = DialogBoxParamA(hInstance, lpTemplateName, hWndParent, lpDialogFunc, + 0) + +proc DialogBoxIndirectA(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): int32 = + result = DialogBoxIndirectParamA(hInstance, hDialogTemplate, hWndParent, + lpDialogFunc, 0) + +proc CreateWindowW(lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD, + X: int32, Y: int32, nWidth: int32, nHeight: int32, + hWndParent: HWND, menu: HMENU, hInstance: HINST, + lpParam: LPVOID): HWND = + result = CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, + nHeight, hWndParent, menu, hInstance, lpParam) + +proc CreateDialogW(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): HWND = + result = CreateDialogParamW(hInstance, lpName, hWndParent, lpDialogFunc, 0) + +proc CreateDialogIndirectW(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): HWND = + result = CreateDialogIndirectParamW(hInstance, lpTemplate, hWndParent, + lpDialogFunc, 0) + +proc DialogBoxW(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): int32 = + result = DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0) + +proc DialogBoxIndirectW(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): int32 = + result = DialogBoxIndirectParamW(hInstance, lpTemplate, hWndParent, + lpDialogFunc, 0) + +when defined(winUnicode): + proc CreateWindow(lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD, + X: int32, Y: int32, nWidth: int32, nHeight: int32, + hWndParent: HWND, menu: HMENU, hInstance: HINST, + lpParam: LPVOID): HWND = + result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, + nHeight, hWndParent, hMenu, hInstance, lpParam) + + proc CreateDialog(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): HWND = + result = CreateDialogParam(hInstance, lpName, hWndParent, lpDialogFunc, 0) + + proc CreateDialogIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): HWND = + result = CreateDialogIndirectParam(hInstance, lpTemplate, hWndParent, + lpDialogFunc, 0) + + proc DialogBox(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): int32 = + result = DialogBoxParam(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0) + + proc DialogBoxIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): int32 = + result = DialogBoxIndirectParam(hInstance, lpTemplate, hWndParent, + lpDialogFunc, 0) + +else: + proc CreateWindow(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD, + X: int32, Y: int32, nWidth: int32, nHeight: int32, + hWndParent: HWND, menu: HMENU, hInstance: HINST, + lpParam: LPVOID): HWND = + result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth, + nHeight, hWndParent, menu, hInstance, lpParam) + + proc CreateDialog(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): HWND = + result = CreateDialogParam(hInstance, lpTemplateName, hWndParent, + lpDialogFunc, 0) + + proc CreateDialogIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): HWND = + result = CreateDialogIndirectParam(hInstance, lpTemplate, hWndParent, + lpDialogFunc, 0) + + proc DialogBox(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND, + lpDialogFunc: DLGPROC): int32 = + result = DialogBoxParam(hInstance, lpTemplateName, hWndParent, lpDialogFunc, + 0) + + proc DialogBoxIndirect(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE, + hWndParent: HWND, lpDialogFunc: DLGPROC): int32 = + result = DialogBoxIndirectParam(hInstance, hDialogTemplate, hWndParent, + lpDialogFunc, 0) + +proc GlobalAllocPtr(flags, cb: DWord): Pointer = + result = GlobalLock(GlobalAlloc(flags, cb)) + +proc GlobalFreePtr(lp: Pointer): Pointer = + result = cast[Pointer](GlobalFree(cast[HWND](GlobalUnlockPtr(lp)))) + +proc GlobalUnlockPtr(lp: pointer): Pointer = + discard GlobalUnlock(GlobalHandle(lp)) + result = lp + +proc GlobalLockPtr(lp: pointer): Pointer = + result = GlobalLock(GlobalHandle(lp)) + +proc GlobalReAllocPtr(lp: Pointer, cbNew, flags: DWord): Pointer = + result = GlobalLock(GlobalReAlloc(cast[HWND](GlobalUnlockPtr(lp)), cbNew, flags)) + +proc GlobalPtrHandle(lp: pointer): Pointer = + result = cast[Pointer](GlobalHandle(lp)) + +proc ImageList_AddIcon(himl: HIMAGELIST, hicon: HICON): int32 = + result = ImageList_ReplaceIcon(himl, -1, hicon) + +proc Animate_Create(hWndP: HWND, id: HMENU, dwStyle: DWORD, hInstance: HINST): HWND = + result = CreateWindow(cast[LPCSTR](ANIMATE_CLASS), nil, dwStyle, 0, 0, 0, 0, hwndP, + id, hInstance, nil) + +proc Animate_Open(wnd: HWND, szName: LPTSTR): LRESULT = + result = SendMessage(wnd, ACM_OPEN, 0, cast[LPARAM](szName)) + +proc Animate_Play(wnd: HWND, `from`, `to`: int32, rep: UINT): LRESULT = + result = SendMessage(wnd, ACM_PLAY, WPARAM(rep), + LPARAM(MAKELONG(`from`, `to`))) + +proc Animate_Stop(wnd: HWND): LRESULT = + result = SendMessage(wnd, ACM_STOP, 0, 0) + +proc Animate_Close(wnd: HWND): LRESULT = + result = Animate_Open(wnd, nil) + +proc Animate_Seek(wnd: HWND, frame: int32): LRESULT = + result = Animate_Play(wnd, frame, frame, 1) + +proc PropSheet_AddPage(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_ADDPAGE, 0, cast[LPARAM](hpage)) + +proc PropSheet_Apply(hPropSheetDlg: HWND): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_APPLY, 0, 0) + +proc PropSheet_CancelToClose(hPropSheetDlg: HWND): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_CANCELTOCLOSE, 0, 0) + +proc PropSheet_Changed(hPropSheetDlg, hwndPage: HWND): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_CHANGED, WPARAM(hwndPage), 0) + +proc PropSheet_GetCurrentPageHwnd(hDlg: HWND): LRESULT = + result = SendMessage(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0) + +proc PropSheet_GetTabControl(hPropSheetDlg: HWND): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_GETTABCONTROL, 0, 0) + +proc PropSheet_IsDialogMessage(hDlg: HWND, pMsg: int32): LRESULT = + result = SendMessage(hDlg, PSM_ISDIALOGMESSAGE, 0, LPARAM(pMsg)) + +proc PropSheet_PressButton(hPropSheetDlg: HWND, iButton: int32): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_PRESSBUTTON, WPARAM(int32(iButton)), 0) + +proc PropSheet_QuerySiblings(hPropSheetDlg: HWND, param1, param2: int32): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_QUERYSIBLINGS, WPARAM(param1), + LPARAM(param2)) + +proc PropSheet_RebootSystem(hPropSheetDlg: HWND): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_REBOOTSYSTEM, 0, 0) + +proc PropSheet_RemovePage(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE, + index: int32): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_REMOVEPAGE, WPARAM(index), + cast[LPARAM](hpage)) + +proc PropSheet_RestartWindows(hPropSheetDlg: HWND): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_RESTARTWINDOWS, 0, 0) + +proc PropSheet_SetCurSel(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE, + index: int32): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_SETCURSEL, WPARAM(index), + cast[LPARAM](hpage)) + +proc PropSheet_SetCurSelByID(hPropSheetDlg: HWND, id: int32): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_SETCURSELID, 0, LPARAM(id)) + +proc PropSheet_SetFinishText(hPropSheetDlg: HWND, lpszText: LPTSTR): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_SETFINISHTEXT, 0, cast[LPARAM](lpszText)) + +proc PropSheet_SetTitle(hPropSheetDlg: HWND, dwStyle: DWORD, lpszText: LPCTSTR): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_SETTITLE, WPARAM(dwStyle), + cast[LPARAM](lpszText)) + +proc PropSheet_SetWizButtons(hPropSheetDlg: HWND, dwFlags: DWORD): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_SETWIZBUTTONS, 0, LPARAM(dwFlags)) + +proc PropSheet_UnChanged(hPropSheetDlg: HWND, hwndPage: HWND): LRESULT = + result = SendMessage(hPropSheetDlg, PSM_UNCHANGED, WPARAM(hwndPage), 0) + +proc Header_DeleteItem(hwndHD: HWND, index: int32): WINBOOL = + result = WINBOOL(SendMessage(hwndHD, HDM_DELETEITEM, WPARAM(index), 0)) + +proc Header_GetItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL = + result = WINBOOL(SendMessage(hwndHD, HDM_GETITEM, WPARAM(index), + cast[LPARAM](addr(hdi)))) + +proc Header_GetItemCount(hwndHD: HWND): int32 = + result = int32(SendMessage(hwndHD, HDM_GETITEMCOUNT, 0, 0)) + +proc Header_InsertItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): int32 = + result = int32(SendMessage(hwndHD, HDM_INSERTITEM, WPARAM(index), + cast[LPARAM](addr(hdi)))) + +proc Header_Layout(hwndHD: HWND, layout: var HD_LAYOUT): WINBOOL = + result = WINBOOL(SendMessage(hwndHD, HDM_LAYOUT, 0, + cast[LPARAM](addr(layout)))) + +proc Header_SetItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL = + result = WINBOOL(SendMessage(hwndHD, HDM_SETITEM, WPARAM(index), + cast[LPARAM](addr(hdi)))) + +proc ListView_Arrange(hwndLV: HWND, code: UINT): LRESULT = + result = SendMessage(hwndLV, LVM_ARRANGE, WPARAM(code), 0) + +proc ListView_CreateDragImage(wnd: HWND, i: int32, lpptUpLeft: LPPOINT): LRESULT = + result = SendMessage(wnd, LVM_CREATEDRAGIMAGE, WPARAM(i), cast[LPARAM](lpptUpLeft)) + +proc ListView_DeleteAllItems(wnd: HWND): LRESULT = + result = SendMessage(wnd, LVM_DELETEALLITEMS, 0, 0) + +proc ListView_DeleteColumn(wnd: HWND, iCol: int32): LRESULT = + result = SendMessage(wnd, LVM_DELETECOLUMN, WPARAM(iCol), 0) + +proc ListView_DeleteItem(wnd: HWND, iItem: int32): LRESULT = + result = SendMessage(wnd, LVM_DELETEITEM, WPARAM(iItem), 0) + +proc ListView_EditLabel(hwndLV: HWND, i: int32): LRESULT = + result = SendMessage(hwndLV, LVM_EDITLABEL, WPARAM(int32(i)), 0) + +proc ListView_EnsureVisible(hwndLV: HWND, i, fPartialOK: int32): LRESULT = + result = SendMessage(hwndLV, LVM_ENSUREVISIBLE, WPARAM(i), + MAKELPARAM(fPartialOK, 0)) + +proc ListView_FindItem(wnd: HWND, iStart: int32, lvfi: var LV_FINDINFO): int32 = + result = SendMessage(wnd, LVM_FINDITEM, WPARAM(iStart), + cast[LPARAM](addr(lvfi))).int32 + +proc ListView_GetBkColor(wnd: HWND): LRESULT = + result = SendMessage(wnd, LVM_GETBKCOLOR, 0, 0) + +proc ListView_GetCallbackMask(wnd: HWND): LRESULT = + result = SendMessage(wnd, LVM_GETCALLBACKMASK, 0, 0) + +proc ListView_GetColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT = + result = SendMessage(wnd, LVM_GETCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col))) + +proc ListView_GetColumnWidth(wnd: HWND, iCol: int32): LRESULT = + result = SendMessage(wnd, LVM_GETCOLUMNWIDTH, WPARAM(iCol), 0) + +proc ListView_GetCountPerPage(hwndLV: HWND): LRESULT = + result = SendMessage(hwndLV, LVM_GETCOUNTPERPAGE, 0, 0) + +proc ListView_GetEditControl(hwndLV: HWND): LRESULT = + result = SendMessage(hwndLV, LVM_GETEDITCONTROL, 0, 0) + +proc ListView_GetImageList(wnd: HWND, iImageList: wINT): LRESULT = + result = SendMessage(wnd, LVM_GETIMAGELIST, WPARAM(iImageList), 0) + +proc ListView_GetISearchString(hwndLV: HWND, lpsz: LPTSTR): LRESULT = + result = SendMessage(hwndLV, LVM_GETISEARCHSTRING, 0, cast[LPARAM](lpsz)) + +proc ListView_GetItem(wnd: HWND, item: var LV_ITEM): LRESULT = + result = SendMessage(wnd, LVM_GETITEM, 0, cast[LPARAM](addr(item))) + +proc ListView_GetItemCount(wnd: HWND): LRESULT = + result = SendMessage(wnd, LVM_GETITEMCOUNT, 0, 0) + +proc ListView_GetItemPosition(hwndLV: HWND, i: int32, pt: var POINT): int32 = + result = SendMessage(hwndLV, LVM_GETITEMPOSITION, WPARAM(int32(i)), + cast[LPARAM](addr(pt))).int32 + +proc ListView_GetItemSpacing(hwndLV: HWND, fSmall: int32): LRESULT = + result = SendMessage(hwndLV, LVM_GETITEMSPACING, fSmall, 0) + +proc ListView_GetItemState(hwndLV: HWND, i, mask: int32): LRESULT = + result = SendMessage(hwndLV, LVM_GETITEMSTATE, WPARAM(i), LPARAM(mask)) + +proc ListView_GetNextItem(wnd: HWND, iStart, flags: int32): LRESULT = + result = SendMessage(wnd, LVM_GETNEXTITEM, WPARAM(iStart), LPARAM(flags)) + +proc ListView_GetOrigin(hwndLV: HWND, pt: var POINT): LRESULT = + result = SendMessage(hwndLV, LVM_GETORIGIN, WPARAM(0), cast[LPARAM](addr(pt))) + +proc ListView_GetSelectedCount(hwndLV: HWND): LRESULT = + result = SendMessage(hwndLV, LVM_GETSELECTEDCOUNT, 0, 0) + +proc ListView_GetStringWidth(hwndLV: HWND, psz: LPCTSTR): LRESULT = + result = SendMessage(hwndLV, LVM_GETSTRINGWIDTH, 0, cast[LPARAM](psz)) + +proc ListView_GetTextBkColor(wnd: HWND): LRESULT = + result = SendMessage(wnd, LVM_GETTEXTBKCOLOR, 0, 0) + +proc ListView_GetTextColor(wnd: HWND): LRESULT = + result = SendMessage(wnd, LVM_GETTEXTCOLOR, 0, 0) + +proc ListView_GetTopIndex(hwndLV: HWND): LRESULT = + result = SendMessage(hwndLV, LVM_GETTOPINDEX, 0, 0) + +proc ListView_GetViewRect(wnd: HWND, rc: var RECT): LRESULT = + result = SendMessage(wnd, LVM_GETVIEWRECT, 0, cast[LPARAM](addr(rc))) + +proc ListView_HitTest(hwndLV: HWND, info: var LV_HITTESTINFO): LRESULT = + result = SendMessage(hwndLV, LVM_HITTEST, 0, cast[LPARAM](addr(info))) + +proc ListView_InsertColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT = + result = SendMessage(wnd, LVM_INSERTCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col))) + +proc ListView_InsertItem(wnd: HWND, item: var LV_ITEM): LRESULT = + result = SendMessage(wnd, LVM_INSERTITEM, 0, cast[LPARAM](addr(item))) + +proc ListView_RedrawItems(hwndLV: HWND, iFirst, iLast: int32): LRESULT = + result = SendMessage(hwndLV, LVM_REDRAWITEMS, WPARAM(iFirst), LPARAM(iLast)) + +proc ListView_Scroll(hwndLV: HWND, dx, dy: int32): LRESULT = + result = SendMessage(hwndLV, LVM_SCROLL, WPARAM(dx), LPARAM(dy)) + +proc ListView_SetBkColor(wnd: HWND, clrBk: COLORREF): LRESULT = + result = SendMessage(wnd, LVM_SETBKCOLOR, 0, LPARAM(clrBk)) + +proc ListView_SetCallbackMask(wnd: HWND, mask: UINT): LRESULT = + result = SendMessage(wnd, LVM_SETCALLBACKMASK, WPARAM(mask), 0) + +proc ListView_SetColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT = + result = SendMessage(wnd, LVM_SETCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col))) + +proc ListView_SetColumnWidth(wnd: HWND, iCol, cx: int32): LRESULT = + result = SendMessage(wnd, LVM_SETCOLUMNWIDTH, WPARAM(iCol), MAKELPARAM(cx, 0)) + +proc ListView_SetImageList(wnd: HWND, himl: int32, iImageList: HIMAGELIST): LRESULT = + result = SendMessage(wnd, LVM_SETIMAGELIST, WPARAM(iImageList), + LPARAM(UINT(himl))) + +proc ListView_SetItem(wnd: HWND, item: var LV_ITEM): LRESULT = + result = SendMessage(wnd, LVM_SETITEM, 0, cast[LPARAM](addr(item))) + +proc ListView_SetItemCount(hwndLV: HWND, cItems: int32): LRESULT = + result = SendMessage(hwndLV, LVM_SETITEMCOUNT, WPARAM(cItems), 0) + +proc ListView_SetItemPosition(hwndLV: HWND, i, x, y: int32): LRESULT = + result = SendMessage(hwndLV, LVM_SETITEMPOSITION, WPARAM(i), MAKELPARAM(x, y)) + +proc ListView_SetItemPosition32(hwndLV: HWND, i, x, y: int32): LRESULT = + var ptNewPos: POINT + ptNewPos.x = x + ptNewPos.y = y + result = SendMessage(hwndLV, LVM_SETITEMPOSITION32, WPARAM(i), + cast[LPARAM](addr(ptNewPos))) + +proc ListView_SetItemState(hwndLV: HWND, i, data, mask: int32): LRESULT = + var gnu_lvi: LV_ITEM + gnu_lvi.stateMask = uint(mask) + gnu_lvi.state = uint(data) + result = SendMessage(hwndLV, LVM_SETITEMSTATE, WPARAM(i), + cast[LPARAM](addr(gnu_lvi))) + +proc ListView_SetItemText(hwndLV: HWND, i, iSubItem: int32, pszText: LPTSTR): LRESULT = + var gnu_lvi: LV_ITEM + gnu_lvi.iSubItem = iSubItem + gnu_lvi.pszText = pszText + result = SendMessage(hwndLV, LVM_SETITEMTEXT, WPARAM(i), + cast[LPARAM](addr(gnu_lvi))) + +proc ListView_SetTextBkColor(wnd: HWND, clrTextBk: COLORREF): LRESULT = + result = SendMessage(wnd, LVM_SETTEXTBKCOLOR, 0, LPARAM(clrTextBk)) + +proc ListView_SetTextColor(wnd: HWND, clrText: COLORREF): LRESULT = + result = SendMessage(wnd, LVM_SETTEXTCOLOR, 0, LPARAM(clrText)) + +proc ListView_SortItems(hwndLV: HWND, pfnCompare: PFNLVCOMPARE, + lPrm: LPARAM): LRESULT = + result = SendMessage(hwndLV, LVM_SORTITEMS, WPARAM(lPrm), + cast[LPARAM](pfnCompare)) + +proc ListView_Update(hwndLV: HWND, i: int32): LRESULT = + result = SendMessage(hwndLV, LVM_UPDATE, WPARAM(i), 0) + +proc TreeView_InsertItem(wnd: HWND, lpis: LPTV_INSERTSTRUCT): LRESULT = + result = SendMessage(wnd, TVM_INSERTITEM, 0, cast[LPARAM](lpis)) + +proc TreeView_DeleteItem(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = SendMessage(wnd, TVM_DELETEITEM, 0, cast[LPARAM](hitem)) + +proc TreeView_DeleteAllItems(wnd: HWND): LRESULT = + result = SendMessage(wnd, TVM_DELETEITEM, 0, cast[LPARAM](TVI_ROOT)) + +proc TreeView_Expand(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT = + result = SendMessage(wnd, TVM_EXPAND, WPARAM(code), cast[LPARAM](hitem)) + +proc TreeView_GetCount(wnd: HWND): LRESULT = + result = SendMessage(wnd, TVM_GETCOUNT, 0, 0) + +proc TreeView_GetIndent(wnd: HWND): LRESULT = + result = SendMessage(wnd, TVM_GETINDENT, 0, 0) + +proc TreeView_SetIndent(wnd: HWND, indent: int32): LRESULT = + result = SendMessage(wnd, TVM_SETINDENT, WPARAM(indent), 0) + +proc TreeView_GetImageList(wnd: HWND, iImage: WPARAM): LRESULT = + result = SendMessage(wnd, TVM_GETIMAGELIST, iImage, 0) + +proc TreeView_SetImageList(wnd: HWND, himl: HIMAGELIST, iImage: WPARAM): LRESULT = + result = SendMessage(wnd, TVM_SETIMAGELIST, iImage, LPARAM(UINT(himl))) + +proc TreeView_GetNextItem(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT = + result = SendMessage(wnd, TVM_GETNEXTITEM, WPARAM(code), cast[LPARAM](hitem)) + +proc TreeView_GetChild(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_GetNextItem(wnd, hitem, TVGN_CHILD) + +proc TreeView_GetNextSibling(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_GetNextItem(wnd, hitem, TVGN_NEXT) + +proc TreeView_GetPrevSibling(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_GetNextItem(wnd, hitem, TVGN_PREVIOUS) + +proc TreeView_GetParent(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_GetNextItem(wnd, hitem, TVGN_PARENT) + +proc TreeView_GetFirstVisible(wnd: HWND): LRESULT = + result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_FIRSTVISIBLE) + +proc TreeView_GetNextVisible(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_GetNextItem(wnd, hitem, TVGN_NEXTVISIBLE) + +proc TreeView_GetPrevVisible(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_GetNextItem(wnd, hitem, TVGN_PREVIOUSVISIBLE) + +proc TreeView_GetSelection(wnd: HWND): LRESULT = + result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_CARET) + +proc TreeView_GetDropHilight(wnd: HWND): LRESULT = + result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_DROPHILITE) + +proc TreeView_GetRoot(wnd: HWND): LRESULT = + result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_ROOT) + +proc TreeView_Select(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT = + result = SendMessage(wnd, TVM_SELECTITEM, WPARAM(code), cast[LPARAM](hitem)) + +proc TreeView_SelectItem(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_Select(wnd, hitem, TVGN_CARET) + +proc TreeView_SelectDropTarget(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_Select(wnd, hitem, TVGN_DROPHILITE) + +proc TreeView_SelectSetFirstVisible(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = TreeView_Select(wnd, hitem, TVGN_FIRSTVISIBLE) + +proc TreeView_GetItem(wnd: HWND, item: var TV_ITEM): LRESULT = + result = SendMessage(wnd, TVM_GETITEM, 0, cast[LPARAM](addr(item))) + +proc TreeView_SetItem(wnd: HWND, item: var TV_ITEM): LRESULT = + result = SendMessage(wnd, TVM_SETITEM, 0, cast[LPARAM](addr(item))) + +proc TreeView_EditLabel(wnd: HWND, hitem: HTREEITEM): LRESULT = + Result = SendMessage(wnd, TVM_EDITLABEL, 0, cast[LPARAM](hitem)) + +proc TreeView_GetEditControl(wnd: HWND): LRESULT = + result = SendMessage(wnd, TVM_GETEDITCONTROL, 0, 0) + +proc TreeView_GetVisibleCount(wnd: HWND): LRESULT = + result = SendMessage(wnd, TVM_GETVISIBLECOUNT, 0, 0) + +proc TreeView_HitTest(wnd: HWND, lpht: LPTV_HITTESTINFO): LRESULT = + result = SendMessage(wnd, TVM_HITTEST, 0, cast[LPARAM](lpht)) + +proc TreeView_CreateDragImage(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = SendMessage(wnd, TVM_CREATEDRAGIMAGE, 0, cast[LPARAM](hitem)) + +proc TreeView_SortChildren(wnd: HWND, hitem: HTREEITEM, recurse: int32): LRESULT = + result = SendMessage(wnd, TVM_SORTCHILDREN, WPARAM(recurse), cast[LPARAM](hitem)) + +proc TreeView_EnsureVisible(wnd: HWND, hitem: HTREEITEM): LRESULT = + result = SendMessage(wnd, TVM_ENSUREVISIBLE, 0, cast[LPARAM](hitem)) + +proc TreeView_SortChildrenCB(wnd: HWND, psort: LPTV_SORTCB, recurse: int32): LRESULT = + result = SendMessage(wnd, TVM_SORTCHILDRENCB, WPARAM(recurse), cast[LPARAM](psort)) + +proc TreeView_EndEditLabelNow(wnd: HWND, fCancel: int32): LRESULT = + result = SendMessage(wnd, TVM_ENDEDITLABELNOW, WPARAM(fCancel), 0) + +proc TreeView_GetISearchString(hwndTV: HWND, lpsz: LPTSTR): LRESULT = + result = SendMessage(hwndTV, TVM_GETISEARCHSTRING, 0, cast[LPARAM](lpsz)) + +proc TabCtrl_GetImageList(wnd: HWND): LRESULT = + result = SendMessage(wnd, TCM_GETIMAGELIST, 0, 0) + +proc TabCtrl_SetImageList(wnd: HWND, himl: HIMAGELIST): LRESULT = + result = SendMessage(wnd, TCM_SETIMAGELIST, 0, LPARAM(UINT(himl))) + +proc TabCtrl_GetItemCount(wnd: HWND): LRESULT = + result = SendMessage(wnd, TCM_GETITEMCOUNT, 0, 0) + +proc TabCtrl_GetItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT = + result = SendMessage(wnd, TCM_GETITEM, WPARAM(iItem), cast[LPARAM](addr(item))) + +proc TabCtrl_SetItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT = + result = SendMessage(wnd, TCM_SETITEM, WPARAM(iItem), cast[LPARAM](addr(item))) + +proc TabCtrl_InsertItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT = + result = SendMessage(wnd, TCM_INSERTITEM, WPARAM(iItem), cast[LPARAM](addr(item))) + +proc TabCtrl_DeleteItem(wnd: HWND, i: int32): LRESULT = + result = SendMessage(wnd, TCM_DELETEITEM, WPARAM(i), 0) + +proc TabCtrl_DeleteAllItems(wnd: HWND): LRESULT = + result = SendMessage(wnd, TCM_DELETEALLITEMS, 0, 0) + +proc TabCtrl_GetItemRect(wnd: HWND, i: int32, rc: var RECT): LRESULT = + result = SendMessage(wnd, TCM_GETITEMRECT, WPARAM(int32(i)), cast[LPARAM](addr(rc))) + +proc TabCtrl_GetCurSel(wnd: HWND): LRESULT = + result = SendMessage(wnd, TCM_GETCURSEL, 0, 0) + +proc TabCtrl_SetCurSel(wnd: HWND, i: int32): LRESULT = + result = SendMessage(wnd, TCM_SETCURSEL, WPARAM(i), 0) + +proc TabCtrl_HitTest(hwndTC: HWND, info: var TC_HITTESTINFO): LRESULT = + result = SendMessage(hwndTC, TCM_HITTEST, 0, cast[LPARAM](addr(info))) + +proc TabCtrl_SetItemExtra(hwndTC: HWND, cb: int32): LRESULT = + result = SendMessage(hwndTC, TCM_SETITEMEXTRA, WPARAM(cb), 0) + +proc TabCtrl_AdjustRect(wnd: HWND, bLarger: WINBOOL, rc: var RECT): LRESULT = + result = SendMessage(wnd, TCM_ADJUSTRECT, WPARAM(bLarger), cast[LPARAM](addr(rc))) + +proc TabCtrl_SetItemSize(wnd: HWND, x, y: int32): LRESULT = + result = SendMessage(wnd, TCM_SETITEMSIZE, 0, MAKELPARAM(x, y)) + +proc TabCtrl_RemoveImage(wnd: HWND, i: WPARAM): LRESULT = + result = SendMessage(wnd, TCM_REMOVEIMAGE, i, 0) + +proc TabCtrl_SetPadding(wnd: HWND, cx, cy: int32): LRESULT = + result = SendMessage(wnd, TCM_SETPADDING, 0, MAKELPARAM(cx, cy)) + +proc TabCtrl_GetRowCount(wnd: HWND): LRESULT = + result = SendMessage(wnd, TCM_GETROWCOUNT, 0, 0) + +proc TabCtrl_GetToolTips(wnd: HWND): LRESULT = + result = SendMessage(wnd, TCM_GETTOOLTIPS, 0, 0) + +proc TabCtrl_SetToolTips(wnd: HWND, hwndTT: int32): LRESULT = + result = SendMessage(wnd, TCM_SETTOOLTIPS, WPARAM(hwndTT), 0) + +proc TabCtrl_GetCurFocus(wnd: HWND): LRESULT = + result = SendMessage(wnd, TCM_GETCURFOCUS, 0, 0) + +proc TabCtrl_SetCurFocus(wnd: HWND, i: int32): LRESULT = + result = SendMessage(wnd, TCM_SETCURFOCUS, i, 0) + +proc SNDMSG(wnd: HWND, Msg: UINT, wp: WPARAM, lp: LPARAM): LRESULT = + result = SendMessage(wnd, Msg, wp, lp) + +proc CommDlg_OpenSave_GetSpecA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz)) + +proc CommDlg_OpenSave_GetSpecW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz)) + +when defined(winUnicode): + proc CommDlg_OpenSave_GetSpec(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz)) +else: + proc CommDlg_OpenSave_GetSpec(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz)) + +proc CommDlg_OpenSave_GetFilePathA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz)) + +proc CommDlg_OpenSave_GetFilePathW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz)) + +when defined(winUnicode): + proc CommDlg_OpenSave_GetFilePath(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz)) +else: + proc CommDlg_OpenSave_GetFilePath(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz)) + +proc CommDlg_OpenSave_GetFolderPathA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz)) + +proc CommDlg_OpenSave_GetFolderPathW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz)) + +when defined(winUnicode): + proc CommDlg_OpenSave_GetFolderPath(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM]((psz))) +else: + proc CommDlg_OpenSave_GetFolderPath(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz)) + +proc CommDlg_OpenSave_GetFolderIDList(hdlg: HWND, pidl: LPVOID, cbmax: int32): LRESULT = + result = SNDMSG(hdlg, CDM_GETFOLDERIDLIST, WPARAM(cbmax), cast[LPARAM](pidl)) + +proc CommDlg_OpenSave_SetControlText(hdlg: HWND, id: int32, text: LPSTR): LRESULT = + result = SNDMSG(hdlg, CDM_SETCONTROLTEXT, WPARAM(id), cast[LPARAM](text)) + +proc CommDlg_OpenSave_HideControl(hdlg: HWND, id: int32): LRESULT = + result = SNDMSG(hdlg, CDM_HIDECONTROL, WPARAM(id), 0) + +proc CommDlg_OpenSave_SetDefExt(hdlg: HWND, pszext: LPSTR): LRESULT = + result = SNDMSG(hdlg, CDM_SETDEFEXT, 0, cast[LPARAM](pszext)) + +proc InternalGetLargestConsoleWindowSize(hConsoleOutput: HANDLE): DWord{. + stdcall, dynlib: "kernel32", importc: "GetLargestConsoleWindowSize".} +proc GetLargestConsoleWindowSize(hConsoleOutput: HANDLE): COORD = + var res: dword + res = InternalGetLargestConsoleWindowSize(hConsoleOutput) + result.y = toU16(res and 0x0000ffff) # XXX: correct? + result.x = toU16(res shr 16) + +proc Succeeded(Status: HRESULT): WINBOOL = + result = (Status and 0x80000000).WinBool + +proc Failed(Status: HRESULT): WINBOOL = + result = (Status and 0x80000000).WinBool + +proc IsError(Status: HRESULT): WINBOOL = + result = ord((int(Status) shr 31) == SEVERITY_ERROR) + +proc HResultCode(hr: HRESULT): int32 = + result = hr and 0x0000FFFF'i32 + +proc HResultFacility(hr: HRESULT): int32 = + result = (hr shr 16'i32) and 0x00001FFF'i32 + +proc HResultSeverity(hr: HRESULT): int32 = + result = (hr shr 31'i32) and 0x00000001'i32 + +proc MakeResult(p1, p2, mask: int32): HRESULT = + result = (p1 shl 31'i32) or (p2 shl 16'i32) or mask + +proc HResultFromWin32(x: int32): HRESULT = + result = x + if result != 0'i32: + result = ((result and 0x0000FFFF'i32) or (int32(FACILITY_WIN32) shl 16'i32) or + 0x80000000'i32) + +proc HResultFromNT(x: int32): HRESULT = + result = x or int32(FACILITY_NT_BIT) + +proc MAKELANGID(PrimaryLang, SubLang: USHORT): int16 = + result = (SubLang shl 10'i16) or PrimaryLang + +proc PRIMARYLANGID(LangId: int16): int16 = + result = LangId and 0x000003FF'i16 + +proc SUBLANGID(LangId: int16): int16 = + result = LangId shr 10'i16 + +proc MAKELCID(LangId, SortId: int16): DWORD = + result = toU32((ze(SortId) shl 16) or ze(LangId)) + +proc MAKESORTLCID(LangId, SortId, SortVersion: int16): DWORD = + result = MAKELCID(LangId, SortId) or (SortVersion shl 20'i32) + +proc LANGIDFROMLCID(LocaleId: LCID): int16 = + result = toU16(LocaleId) + +proc SORTIDFROMLCID(LocaleId: LCID): int16 = + result = toU16((DWORD(LocaleId) shr 16) and 0x0000000F) + +proc SORTVERSIONFROMLCID(LocaleId: LCID): int16 = + result = toU16((DWORD(LocaleId) shr 20) and 0x0000000F) + +proc LANG_SYSTEM_DEFAULT(): int16 = + result = toU16(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_SYS_DEFAULT)) + +proc LANG_USER_DEFAULT(): int16 = + result = toU16(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_DEFAULT)) + +proc LOCALE_NEUTRAL(): DWORD = + result = MAKELCID(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_NEUTRAL), SORT_DEFAULT) + +proc LOCALE_INVARIANT(): DWORD = + result = MAKELCID(MAKELANGID(toU16(LANG_INVARIANT), SUBLANG_NEUTRAL), SORT_DEFAULT) From 8dae66415966e2cba50fd5295c514a97ff187fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Mon, 9 Dec 2013 21:45:42 +0100 Subject: [PATCH 081/326] Add commandLineParams to os.nim. commandLineParams returns seq of arguments given to program on command line. --- lib/pure/os.nim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 7d68218484..117e062992 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1481,6 +1481,12 @@ elif not defined(createNimRtl): proc paramCount*(): int {.tags: [FReadIO].} = return cmdCount-1 +when defined(paramCount): + proc commandLineParams*(): seq[TaintedString] = + result = @[] + for i in 1..paramCount(): + result.add(paramStr(i)) + when defined(linux) or defined(solaris) or defined(bsd) or defined(aix): proc getApplAux(procPath: string): string = result = newString(256) From 14dd3113a255eb59a76b6e1b3346fd9d5122038d Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Mon, 9 Dec 2013 23:05:44 +0200 Subject: [PATCH 082/326] fix computed dynlib names; fixes #718 --- compiler/cgen.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index ad9ade63c7..b0c90de766 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -944,9 +944,9 @@ proc genMainProc(m: BModule) = const CommonMainBody = "\tsystemDatInit();$n" & + "\tsystemInit();$n" & "$1" & "$2" & - "\tsystemInit();$n" & "$3" & "$4" PosixNimMain = From d1f3512aba83814146583538c46b7f0c84175423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Mon, 9 Dec 2013 22:22:06 +0100 Subject: [PATCH 083/326] Reimplement parseopt which parses arguments given as a sequence of strings, not single string. --- .gitignore | 1 + lib/pure/parseopt.nim | 176 +++++++++++++++++++--------------------- tests/system/params.nim | 17 ++++ 3 files changed, 103 insertions(+), 91 deletions(-) create mode 100644 tests/system/params.nim diff --git a/.gitignore b/.gitignore index 536ec9d24e..d67d9f2cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -180,3 +180,4 @@ examples/cross_calculator/android/tags /tests/caas/main /tests/caasdriver /tools/nimgrep +/tests/system/params diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index 6d9d16bc96..81a1fd1f01 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -10,123 +10,117 @@ ## This module provides the standard Nimrod command line parser. ## It supports one convenience iterator over all command line options and some ## lower-level features. +## +## Supported syntax: +## +## 1. short options - ``-abcd``, where a, b, c, d are names +## 2. long option - ``--foo:bar``, ``--foo=bar`` or ``--foo`` +## 3. argument - everything else {.push debugger: off.} include "system/inclrtl" -import +import os, strutils -type +type TCmdLineKind* = enum ## the detected command line token cmdEnd, ## end of command line reached cmdArgument, ## argument detected - cmdLongoption, ## a long option ``--option`` detected + cmdLongOption, ## a long option ``--option`` detected cmdShortOption ## a short option ``-c`` detected - TOptParser* = - object of TObject ## this object implements the command line parser - cmd: string + TOptParser* = + object of TObject ## this object implements the command line parser + cmd: seq[string] pos: int - inShortState: bool + remainingShortOptions: string kind*: TCmdLineKind ## the dected command line token key*, val*: TaintedString ## key and value pair; ``key`` is the option ## or the argument, ``value`` is not "" if ## the option was given a value -when defined(os.ParamCount): - # we cannot provide this for NimRtl creation on Posix, because we can't - # access the command line arguments then! +proc initOptParser*(cmdline: seq[string]): TOptParser {.rtl.} = + ## Initalizes option parses with cmdline. cmdline should not contain + ## argument 0 - program name. + ## If cmdline == nil default to current command line arguments. + result.remainingShortOptions = "" + when not defined(createNimRtl): + if cmdline == nil: + result.cmd = commandLineParams() + return + else: + assert cmdline != nil, "Cannot determine command line arguments." - proc initOptParser*(cmdline = ""): TOptParser = - ## inits the option parser. If ``cmdline == ""``, the real command line - ## (as provided by the ``OS`` module) is taken. - result.pos = 0 - result.inShortState = false - if cmdline != "": - result.cmd = cmdline - else: - result.cmd = "" - for i in countup(1, ParamCount()): - result.cmd = result.cmd & quoteIfContainsWhite(paramStr(i).string) & ' ' - result.kind = cmdEnd - result.key = TaintedString"" - result.val = TaintedString"" + result.cmd = @cmdline -proc parseWord(s: string, i: int, w: var string, - delim: TCharSet = {'\x09', ' ', '\0'}): int = - result = i - if s[result] == '\"': - inc(result) - while not (s[result] in {'\0', '\"'}): - add(w, s[result]) - inc(result) - if s[result] == '\"': inc(result) - else: - while not (s[result] in delim): - add(w, s[result]) - inc(result) +proc initOptParser*(cmdline: string): TOptParser {.rtl, deprecated.} = + ## Initalizes option parses with cmdline. Splits cmdline in on spaces + ## and calls initOptParser(openarray[string]) + ## Do not use. + if cmdline == "": # backward compatibilty + return initOptParser(seq[string](nil)) + else: + return initOptParser(cmdline.split) -proc handleShortOption(p: var TOptParser) = - var i = p.pos - p.kind = cmdShortOption - add(p.key.string, p.cmd[i]) - inc(i) - p.inShortState = true - while p.cmd[i] in {'\x09', ' '}: - inc(i) - p.inShortState = false - if p.cmd[i] in {':', '='}: - inc(i) - p.inShortState = false - while p.cmd[i] in {'\x09', ' '}: inc(i) - i = parseWord(p.cmd, i, p.val.string) - if p.cmd[i] == '\0': p.inShortState = false - p.pos = i +when not defined(createNimRtl): + proc initOptParser*(): TOptParser = + ## Initializes option parser from current command line arguments. + return initOptParser(commandLineParams()) -proc next*(p: var TOptParser) {. - rtl, extern: "npo$1".} = - ## parses the first or next option; ``p.kind`` describes what token has been - ## parsed. ``p.key`` and ``p.val`` are set accordingly. - var i = p.pos - while p.cmd[i] in {'\x09', ' '}: inc(i) - p.pos = i - setlen(p.key.string, 0) - setlen(p.val.string, 0) - if p.inShortState: - handleShortOption(p) - return - case p.cmd[i] - of '\0': +proc next*(p: var TOptParser) {.rtl, extern: "npo$1".} + +proc nextOption(p: var TOptParser, token: string, allowEmpty: bool) = + for splitchar in ['=', ':']: + if splitchar in token: + let pos = token.find(splitchar) + p.key = token[0..pos-1] + p.val = token[pos+1..token.len-1] + return + + p.key = token + if allowEmpty: + p.val = "" + else: + p.remainingShortOptions = token[0..token.len-1] + p.next() + +proc next(p: var TOptParser) = + if p.remainingShortOptions.len != 0: + p.kind = cmdShortOption + p.key = TaintedString(p.remainingShortOptions[0..0]) + p.val = "" + p.remainingShortOptions = p.remainingShortOptions[1..p.remainingShortOptions.len-1] + return + + if p.pos >= p.cmd.len: p.kind = cmdEnd - of '-': - inc(i) - if p.cmd[i] == '-': - p.kind = cmdLongOption - inc(i) - i = parseWord(p.cmd, i, p.key.string, {'\0', ' ', '\x09', ':', '='}) - while p.cmd[i] in {'\x09', ' '}: inc(i) - if p.cmd[i] in {':', '='}: - inc(i) - while p.cmd[i] in {'\x09', ' '}: inc(i) - p.pos = parseWord(p.cmd, i, p.val.string) - else: - p.pos = i - else: - p.pos = i - handleShortOption(p) + return + + let token = p.cmd[p.pos] + p.pos += 1 + + if token.startswith("--"): + p.kind = cmdLongOption + nextOption(p, token[2..token.len-1], allowEmpty=true) + elif token.startswith("-"): + p.kind = cmdShortOption + nextOption(p, token[1..token.len-1], allowEmpty=true) else: p.kind = cmdArgument - p.pos = parseWord(p.cmd, i, p.key.string) + p.key = token + p.val = "" -proc cmdLineRest*(p: TOptParser): TaintedString {. - rtl, extern: "npo$1".} = - ## retrieves the rest of the command line that has not been parsed yet. - result = strip(substr(p.cmd, p.pos, len(p.cmd) - 1)).TaintedString +proc cmdLineRest*(p: TOptParser): TaintedString {.rtl, extern: "npo$1", deprecated.} = + ## Returns part of command line string that has not been parsed yet. + ## Do not use - does not correctly handle whitespace. + return p.cmd[p.pos..p.cmd.len-1].join(" ") -when defined(initOptParser): +type + TGetoptResult* = tuple[kind: TCmdLineKind, key, val: TaintedString] - iterator getopt*(): tuple[kind: TCmdLineKind, key, val: TaintedString] = +when defined(paramCount): + iterator getopt*(): TGetoptResult = ## This is an convenience iterator for iterating over the command line. ## This uses the TOptParser object. Example: ## @@ -135,7 +129,7 @@ when defined(initOptParser): ## filename = "" ## for kind, key, val in getopt(): ## case kind - ## of cmdArgument: + ## of cmdArgument: ## filename = key ## of cmdLongOption, cmdShortOption: ## case key diff --git a/tests/system/params.nim b/tests/system/params.nim new file mode 100644 index 0000000000..1e8385dc89 --- /dev/null +++ b/tests/system/params.nim @@ -0,0 +1,17 @@ +import os +import osproc +import parseopt +import sequtils + +let argv = commandLineParams() + +if argv == @[]: + # this won't work with spaces + assert execShellCmd(getAppFilename() & " \"foo bar\" --aa:bar --ab -c --a[baz]:doo") == 0 +else: + let f = toSeq(getopt()) + echo f.repr + assert f[0].kind == cmdArgument and f[0].key == "foo bar" and f[0].val == "" + assert f[1].kind == cmdLongOption and f[1].key == "aa" and f[1].val == "bar" + assert f[2].kind == cmdLongOption and f[2].key == "ab" and f[2].val == "" + assert f[3].kind == cmdShortOption and f[3].key == "c" and f[3].val == "" From 7120491d055c04d838d9539fdf0c42003637ec2d Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 10 Dec 2013 01:49:30 +0200 Subject: [PATCH 084/326] in successful compilations with verbosity:0, all output is suppressed (useful for combing with --run) --- compiler/main.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/main.nim b/compiler/main.nim index 7cfc6d4068..6a4ca496b9 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -432,7 +432,9 @@ proc MainCommand* = else: rawMessage(errInvalidCommandX, command) - if msgs.gErrorCounter == 0 and gCmd notin {cmdInterpret, cmdRun, cmdDump}: + if (msgs.gErrorCounter == 0 and + gCmd notin {cmdInterpret, cmdRun, cmdDump} and + gVerbosity > 0): rawMessage(hintSuccessX, [$gLinesCompiled, formatFloat(epochTime() - gLastCmdTime, ffDecimal, 3), formatSize(getTotalMem())]) From da05cf51def9eb619c406fd521c3662b03da6f20 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Tue, 10 Dec 2013 17:41:34 +0100 Subject: [PATCH 085/326] =?UTF-8?q?Reverts=20"Make=20quoteIfContainsWhite?= =?UTF-8?q?=20quote=E2=80=A6".=20Refs=20#702.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e7e8c7706240c4bef17533da63df988d228ba127 to avoid tool breakage. A different approach is being worked on #730. --- lib/pure/strutils.nim | 51 +++++++------------------------------------ web/news.txt | 2 -- 2 files changed, 8 insertions(+), 45 deletions(-) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 0299f5cd2f..a4aa815787 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -709,6 +709,14 @@ proc rfind*(s, sub: string, start: int = -1): int {.noSideEffect.} = if result != -1: return return -1 +proc quoteIfContainsWhite*(s: string): string = + ## returns ``'"' & s & '"'`` if `s` contains a space and does not + ## start with a quote, else returns `s` + if find(s, {' ', '\t'}) >= 0 and s[0] != '"': + result = '"' & s & '"' + else: + result = s + proc contains*(s: string, c: char): bool {.noSideEffect.} = ## Same as ``find(s, c) >= 0``. return find(s, c) >= 0 @@ -772,49 +780,6 @@ proc replaceWord*(s, sub: string, by = ""): string {.noSideEffect, # copy the rest: add result, substr(s, i) -proc quoteIfContainsWhite*(s: string): string {.noSideEffect.} = - ## Quote s, so it can be safely passed to shell. - when defined(Windows): - # based on Python's subprocess.list2cmdline - # see http://msdn.microsoft.com/en-us/library/17w5ykft.aspx - let needQuote = {' ', '\t'} in s or s.len == 0 - - result = "" - var backslashBuff = "" - if needQuote: - result.add("\"") - - for c in s: - if c == '\\': - backslashBuff.add(c) - elif c == '\"': - result.add(backslashBuff) - result.add(backslashBuff) - backslashBuff.setLen(0) - result.add("\\\"") - else: - if backslashBuff.len != 0: - result.add(backslashBuff) - backslashBuff.setLen(0) - result.add(c) - - if needQuote: - result.add("\"") - - else: - # based on Python's pipes.quote - const safeUnixChars = {'%', '+', '-', '.', '/', '_', ':', '=', '@', - '0'..'9', 'A'..'Z', 'a'..'z'} - if s.len == 0: - return "''" - - let safe = s.allCharsInSet(safeUnixChars) - - if safe: - return s - else: - return "'" & s.replace("'", "'\"'\"'") & "'" - proc delete*(s: var string, first, last: int) {.noSideEffect, rtl, extern: "nsuDelete".} = ## Deletes in `s` the characters at position `first` .. `last`. This modifies diff --git a/web/news.txt b/web/news.txt index f919089a53..1b492fa971 100644 --- a/web/news.txt +++ b/web/news.txt @@ -28,8 +28,6 @@ Changes affecting backwards compatibility require an error code to be passed to them. This error code can be retrieved using the new ``OSLastError`` proc. - ``os.parentDir`` now returns "" if there is no parent dir. -- ``quoteIfContainsWhite`` now escapes argument in such way that it can be safely - passed to shell, instead of just adding double quotes. Compiler Additions From 896766ae2c395a1fac7de75a61f09f3db5822985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 10 Dec 2013 19:10:06 +0100 Subject: [PATCH 086/326] Fix : and = precedence in parseopt. --- lib/pure/parseopt.nim | 2 +- tests/system/params.nim | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index 81a1fd1f01..5e79d8a180 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -71,7 +71,7 @@ when not defined(createNimRtl): proc next*(p: var TOptParser) {.rtl, extern: "npo$1".} proc nextOption(p: var TOptParser, token: string, allowEmpty: bool) = - for splitchar in ['=', ':']: + for splitchar in [':', '=']: if splitchar in token: let pos = token.find(splitchar) p.key = token[0..pos-1] diff --git a/tests/system/params.nim b/tests/system/params.nim index 1e8385dc89..0ea099daaf 100644 --- a/tests/system/params.nim +++ b/tests/system/params.nim @@ -7,11 +7,12 @@ let argv = commandLineParams() if argv == @[]: # this won't work with spaces - assert execShellCmd(getAppFilename() & " \"foo bar\" --aa:bar --ab -c --a[baz]:doo") == 0 + assert execShellCmd(getAppFilename() & " \"foo bar\" --aa:bar=a --a=c:d --ab -c --a[baz]:doo") == 0 else: let f = toSeq(getopt()) echo f.repr assert f[0].kind == cmdArgument and f[0].key == "foo bar" and f[0].val == "" - assert f[1].kind == cmdLongOption and f[1].key == "aa" and f[1].val == "bar" - assert f[2].kind == cmdLongOption and f[2].key == "ab" and f[2].val == "" - assert f[3].kind == cmdShortOption and f[3].key == "c" and f[3].val == "" + assert f[1].kind == cmdLongOption and f[1].key == "aa" and f[1].val == "bar=a" + assert f[2].kind == cmdLongOption and f[2].key == "a=c" and f[2].val == "d" + assert f[3].kind == cmdLongOption and f[3].key == "ab" and f[3].val == "" + assert f[4].kind == cmdShortOption and f[4].key == "c" and f[4].val == "" From 088d4726624a4b644ce63ce3cd8898b7c79c63fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 10 Dec 2013 20:33:51 +0100 Subject: [PATCH 087/326] rename new parseopt to parseopt2 --- lib/pure/{parseopt.nim => parseopt2.nim} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/pure/{parseopt.nim => parseopt2.nim} (100%) diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt2.nim similarity index 100% rename from lib/pure/parseopt.nim rename to lib/pure/parseopt2.nim From 2e0da6a5c6f0440b63a0c1138f3e631cfdfc6ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 10 Dec 2013 20:41:52 +0100 Subject: [PATCH 088/326] Make old parseopt as deprecated. --- lib/pure/parseopt.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index 6d9d16bc96..fa704bbcee 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -10,7 +10,10 @@ ## This module provides the standard Nimrod command line parser. ## It supports one convenience iterator over all command line options and some ## lower-level features. - +## +## DEPRECATED. Use parseopt2 instead as this version has issues with spaces +## in arguments. +{.deprecated.} {.push debugger: off.} include "system/inclrtl" From 8561ef5bc8e79c36f27d359b4b495803af00d1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 10 Dec 2013 20:48:18 +0100 Subject: [PATCH 089/326] use parseopt2 in parseopt2 test --- tests/system/params.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/params.nim b/tests/system/params.nim index 0ea099daaf..1358212f2f 100644 --- a/tests/system/params.nim +++ b/tests/system/params.nim @@ -1,6 +1,6 @@ import os import osproc -import parseopt +import parseopt2 import sequtils let argv = commandLineParams() From b8072bd22ec6e3ccf1a6be1b19fae9de3a0fdcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 10 Dec 2013 22:56:29 +0100 Subject: [PATCH 090/326] add quoteShell to osproc.nim --- lib/pure/osproc.nim | 65 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 754e34b850..7772585a97 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -41,6 +41,58 @@ type poStdErrToStdOut, ## merge stdout and stderr to the stdout stream poParentStreams ## use the parent's streams +proc quoteShellWindows*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} = + ## Quote s, so it can be safely passed to Windows API. + ## Based on Python's subprocess.list2cmdline + ## See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx + let needQuote = {' ', '\t'} in s or s.len == 0 + + result = "" + var backslashBuff = "" + if needQuote: + result.add("\"") + + for c in s: + if c == '\\': + backslashBuff.add(c) + elif c == '\"': + result.add(backslashBuff) + result.add(backslashBuff) + backslashBuff.setLen(0) + result.add("\\\"") + else: + if backslashBuff.len != 0: + result.add(backslashBuff) + backslashBuff.setLen(0) + result.add(c) + + if needQuote: + result.add("\"") + +proc quoteShellPosix*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} = + ## Quote s, so it can be safely passed to POSIX shell. + ## Based on Python's pipes.quote + const safeUnixChars = {'%', '+', '-', '.', '/', '_', ':', '=', '@', + '0'..'9', 'A'..'Z', 'a'..'z'} + if s.len == 0: + return "''" + + let safe = s.allCharsInSet(safeUnixChars) + + if safe: + return s + else: + return "'" & s.replace("'", "'\"'\"'") & "'" + +proc quoteShell*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} = + ## Quote s, so it can be safely passed to shell. + when defined(Windows): + return quoteShellWindows(s) + elif defined(posix): + return quoteShellPosix(s) + else: + {.error:"quoteShell is not supported on your system".} + proc execProcess*(command: string, options: set[TProcessOption] = {poStdErrToStdOut, poUseShell}): TaintedString {. @@ -792,5 +844,14 @@ proc execCmdEx*(command: string, options: set[TProcessOption] = { close(p) when isMainModule: - var x = execProcess("gcc -v") - echo "ECHO ", x + assert quoteShellWindows("aaa") == "aaa" + assert quoteShellWindows("aaa\"") == "aaa\\\"" + assert quoteShellWindows("") == "\"\"" + + assert quoteShellPosix("aaa") == "aaa" + assert quoteShellPosix("aaa a") == "'aaa a'" + assert quoteShellPosix("") == "''" + assert quoteShellPosix("a'a") == "'a'\"'\"'a'" + + when defined(posix): + assert quoteShell("") == "''" From c36319727558f92a47f7aa5fed1d696d63b48d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 10 Dec 2013 23:00:01 +0100 Subject: [PATCH 091/326] Deprecate quoteIfContainsWhite in favor of osproc.quoteShell. --- lib/pure/strutils.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index a4aa815787..fe71cb77b3 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -709,9 +709,11 @@ proc rfind*(s, sub: string, start: int = -1): int {.noSideEffect.} = if result != -1: return return -1 -proc quoteIfContainsWhite*(s: string): string = +proc quoteIfContainsWhite*(s: string): string {.deprecated.} = ## returns ``'"' & s & '"'`` if `s` contains a space and does not ## start with a quote, else returns `s` + ## DEPRECATED as it was confused for shell quoting function. + ## For this application use osproc.quoteShell. if find(s, {' ', '\t'}) >= 0 and s[0] != '"': result = '"' & s & '"' else: From 33ffe6086456384a06efba7fbb30a2c4850367d4 Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Wed, 11 Dec 2013 16:16:14 -0500 Subject: [PATCH 092/326] Fixed skipFile proc to not skip files that merely start with '.' Modified removeFile to reset the read only attribute on files before trying to delete. --- lib/pure/os.nim | 183 ++++++++++++++++++++++++++---------------------- 1 file changed, 100 insertions(+), 83 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 117e062992..71639d821c 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -342,7 +342,14 @@ when defined(windows): template getCommandLine(): expr = getCommandLineW() proc skipFindData(f: TWIN32_FIND_DATA): bool {.inline.} = - result = f.cFilename[0].int == ord('.') + let + nul = 0 + dot = ord('.') + result = (f.cFilename[0].int == dot) + if result: + result = (f.cFilename[1].int in {dot, nul}) + if result: + result = (f.cFilename[2].int == nul) template getFilename(f: expr): expr = $cast[WideCString](addr(f.cFilename[0])) @@ -352,7 +359,14 @@ when defined(windows): template getCommandLine(): expr = getCommandLineA() proc skipFindData(f: TWIN32_FIND_DATA): bool {.inline.} = - result = f.cFilename[0] == '.' + let + nul = '\0' + dot = '.' + result = (f.cFilename[0] == dot) + if result: + result = (f.cFilename[1] in {dot, nul}) + if result: + result = (f.cFilename[2] == nul) template getFilename(f: expr): expr = $f.cFilename @@ -829,6 +843,86 @@ proc sameFileContent*(path1, path2: string): bool {.rtl, extern: "nos$1", close(a) close(b) +type + TFilePermission* = enum ## file access permission; modelled after UNIX + fpUserExec, ## execute access for the file owner + fpUserWrite, ## write access for the file owner + fpUserRead, ## read access for the file owner + fpGroupExec, ## execute access for the group + fpGroupWrite, ## write access for the group + fpGroupRead, ## read access for the group + fpOthersExec, ## execute access for others + fpOthersWrite, ## write access for others + fpOthersRead ## read access for others + +proc getFilePermissions*(filename: string): set[TFilePermission] {. + rtl, extern: "nos$1", tags: [FReadDir].} = + ## retrieves file permissions for `filename`. `OSError` is raised in case of + ## an error. On Windows, only the ``readonly`` flag is checked, every other + ## permission is available in any case. + when defined(posix): + var a: TStat + if stat(filename, a) < 0'i32: OSError(OSLastError()) + result = {} + if (a.st_mode and S_IRUSR) != 0'i32: result.incl(fpUserRead) + if (a.st_mode and S_IWUSR) != 0'i32: result.incl(fpUserWrite) + if (a.st_mode and S_IXUSR) != 0'i32: result.incl(fpUserExec) + + if (a.st_mode and S_IRGRP) != 0'i32: result.incl(fpGroupRead) + if (a.st_mode and S_IWGRP) != 0'i32: result.incl(fpGroupWrite) + if (a.st_mode and S_IXGRP) != 0'i32: result.incl(fpGroupExec) + + if (a.st_mode and S_IROTH) != 0'i32: result.incl(fpOthersRead) + if (a.st_mode and S_IWOTH) != 0'i32: result.incl(fpOthersWrite) + if (a.st_mode and S_IXOTH) != 0'i32: result.incl(fpOthersExec) + else: + when useWinUnicode: + wrapUnary(res, GetFileAttributesW, filename) + else: + var res = GetFileAttributesA(filename) + if res == -1'i32: OSError(OSLastError()) + if (res and FILE_ATTRIBUTE_READONLY) != 0'i32: + result = {fpUserExec, fpUserRead, fpGroupExec, fpGroupRead, + fpOthersExec, fpOthersRead} + else: + result = {fpUserExec..fpOthersRead} + +proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. + rtl, extern: "nos$1", tags: [FWriteDir].} = + ## sets the file permissions for `filename`. `OSError` is raised in case of + ## an error. On Windows, only the ``readonly`` flag is changed, depending on + ## ``fpUserWrite``. + when defined(posix): + var p = 0'i32 + if fpUserRead in permissions: p = p or S_IRUSR + if fpUserWrite in permissions: p = p or S_IWUSR + if fpUserExec in permissions: p = p or S_IXUSR + + if fpGroupRead in permissions: p = p or S_IRGRP + if fpGroupWrite in permissions: p = p or S_IWGRP + if fpGroupExec in permissions: p = p or S_IXGRP + + if fpOthersRead in permissions: p = p or S_IROTH + if fpOthersWrite in permissions: p = p or S_IWOTH + if fpOthersExec in permissions: p = p or S_IXOTH + + if chmod(filename, p) != 0: OSError(OSLastError()) + else: + when useWinUnicode: + wrapUnary(res, GetFileAttributesW, filename) + else: + var res = GetFileAttributesA(filename) + if res == -1'i32: OSError(OSLastError()) + if fpUserWrite in permissions: + res = res and not FILE_ATTRIBUTE_READONLY + else: + res = res or FILE_ATTRIBUTE_READONLY + when useWinUnicode: + wrapBinary(res2, SetFileAttributesW, filename, res) + else: + var res2 = SetFileAttributesA(filename, res) + if res2 == - 1'i32: OSError(OSLastError()) + proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", tags: [FReadIO, FWriteIO].} = ## Copies a file from `source` to `dest`. @@ -882,6 +976,9 @@ when not defined(ENOENT): proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = ## Removes the `file`. If this fails, `EOS` is raised. This does not fail ## if the file never existed in the first place. + ## On Windows, ignores the read-only attribute. + when defined(Windows): + setFilePermissions(file, {fpUserWrite}) if cremove(file) != 0'i32 and errno != ENOENT: raise newException(EOS, $strerror(errno)) @@ -1306,87 +1403,7 @@ proc parseCmdLine*(c: string): seq[string] {. add(a, c[i]) inc(i) add(result, a) - -type - TFilePermission* = enum ## file access permission; modelled after UNIX - fpUserExec, ## execute access for the file owner - fpUserWrite, ## write access for the file owner - fpUserRead, ## read access for the file owner - fpGroupExec, ## execute access for the group - fpGroupWrite, ## write access for the group - fpGroupRead, ## read access for the group - fpOthersExec, ## execute access for others - fpOthersWrite, ## write access for others - fpOthersRead ## read access for others - -proc getFilePermissions*(filename: string): set[TFilePermission] {. - rtl, extern: "nos$1", tags: [FReadDir].} = - ## retrieves file permissions for `filename`. `OSError` is raised in case of - ## an error. On Windows, only the ``readonly`` flag is checked, every other - ## permission is available in any case. - when defined(posix): - var a: TStat - if stat(filename, a) < 0'i32: OSError(OSLastError()) - result = {} - if (a.st_mode and S_IRUSR) != 0'i32: result.incl(fpUserRead) - if (a.st_mode and S_IWUSR) != 0'i32: result.incl(fpUserWrite) - if (a.st_mode and S_IXUSR) != 0'i32: result.incl(fpUserExec) - - if (a.st_mode and S_IRGRP) != 0'i32: result.incl(fpGroupRead) - if (a.st_mode and S_IWGRP) != 0'i32: result.incl(fpGroupWrite) - if (a.st_mode and S_IXGRP) != 0'i32: result.incl(fpGroupExec) - - if (a.st_mode and S_IROTH) != 0'i32: result.incl(fpOthersRead) - if (a.st_mode and S_IWOTH) != 0'i32: result.incl(fpOthersWrite) - if (a.st_mode and S_IXOTH) != 0'i32: result.incl(fpOthersExec) - else: - when useWinUnicode: - wrapUnary(res, GetFileAttributesW, filename) - else: - var res = GetFileAttributesA(filename) - if res == -1'i32: OSError(OSLastError()) - if (res and FILE_ATTRIBUTE_READONLY) != 0'i32: - result = {fpUserExec, fpUserRead, fpGroupExec, fpGroupRead, - fpOthersExec, fpOthersRead} - else: - result = {fpUserExec..fpOthersRead} - -proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. - rtl, extern: "nos$1", tags: [FWriteDir].} = - ## sets the file permissions for `filename`. `OSError` is raised in case of - ## an error. On Windows, only the ``readonly`` flag is changed, depending on - ## ``fpUserWrite``. - when defined(posix): - var p = 0'i32 - if fpUserRead in permissions: p = p or S_IRUSR - if fpUserWrite in permissions: p = p or S_IWUSR - if fpUserExec in permissions: p = p or S_IXUSR - - if fpGroupRead in permissions: p = p or S_IRGRP - if fpGroupWrite in permissions: p = p or S_IWGRP - if fpGroupExec in permissions: p = p or S_IXGRP - - if fpOthersRead in permissions: p = p or S_IROTH - if fpOthersWrite in permissions: p = p or S_IWOTH - if fpOthersExec in permissions: p = p or S_IXOTH - - if chmod(filename, p) != 0: OSError(OSLastError()) - else: - when useWinUnicode: - wrapUnary(res, GetFileAttributesW, filename) - else: - var res = GetFileAttributesA(filename) - if res == -1'i32: OSError(OSLastError()) - if fpUserWrite in permissions: - res = res and not FILE_ATTRIBUTE_READONLY - else: - res = res or FILE_ATTRIBUTE_READONLY - when useWinUnicode: - wrapBinary(res2, SetFileAttributesW, filename, res) - else: - var res2 = SetFileAttributesA(filename, res) - if res2 == - 1'i32: OSError(OSLastError()) - + proc copyFileWithPermissions*(source, dest: string, ignorePermissionErrors = true) = ## Copies a file from `source` to `dest` preserving file permissions. From 39cabcdd2702098825eba32fcbc6737b9aa45e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Wed, 11 Dec 2013 22:27:39 +0100 Subject: [PATCH 093/326] Use quoteShell in stdlib, where appropriate. --- compiler/extccomp.nim | 32 ++++++++++++++++---------------- compiler/nimrod.nim | 12 ++++++------ lib/pure/browsers.nim | 4 ++-- lib/pure/osproc.nim | 8 ++++---- tools/niminst/niminst.nim | 5 ++--- 5 files changed, 30 insertions(+), 31 deletions(-) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index 13eb972f6c..fe1bea3fff 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -463,9 +463,9 @@ proc getCompileOptions: string = proc getLinkOptions: string = result = linkOptions for linkedLib in items(cLinkedLibs): - result.add(cc[ccompiler].linkLibCmd % linkedLib.quoteIfContainsWhite) + result.add(cc[ccompiler].linkLibCmd % linkedLib.quoteShell) for libDir in items(cLibs): - result.add([cc[ccompiler].linkDirCmd, libDir.quoteIfContainsWhite]) + result.add([cc[ccompiler].linkDirCmd, libDir.quoteShell]) proc needsExeExt(): bool {.inline.} = result = (optGenScript in gGlobalOptions and targetOS == osWindows) or @@ -485,10 +485,10 @@ proc getCompileCFileCmd*(cfilename: string, isExternal = false): string = var includeCmd, compilePattern: string if not noAbsolutePaths(): # compute include paths: - includeCmd = cc[c].includeCmd & quoteIfContainsWhite(libpath) + includeCmd = cc[c].includeCmd & quoteShell(libpath) for includeDir in items(cIncludes): - includeCmd.add([cc[c].includeCmd, includeDir.quoteIfContainsWhite]) + includeCmd.add([cc[c].includeCmd, includeDir.quoteShell]) compilePattern = JoinPath(ccompilerpath, exe) else: @@ -501,17 +501,17 @@ proc getCompileCFileCmd*(cfilename: string, isExternal = false): string = toObjFile(cfile) else: completeCFilePath(toObjFile(cfile)) - cfile = quoteIfContainsWhite(AddFileExt(cfile, cExt)) - objfile = quoteIfContainsWhite(objfile) - result = quoteIfContainsWhite(compilePattern % [ + cfile = quoteShell(AddFileExt(cfile, cExt)) + objfile = quoteShell(objfile) + result = quoteShell(compilePattern % [ "file", cfile, "objfile", objfile, "options", options, "include", includeCmd, "nimrod", getPrefixDir(), "lib", libpath]) add(result, ' ') addf(result, cc[c].compileTmpl, [ "file", cfile, "objfile", objfile, "options", options, "include", includeCmd, - "nimrod", quoteIfContainsWhite(getPrefixDir()), - "lib", quoteIfContainsWhite(libpath)]) + "nimrod", quoteShell(getPrefixDir()), + "lib", quoteShell(libpath)]) proc footprint(filename: string): TCrc32 = result = crcFromFile(filename) >< @@ -590,7 +590,7 @@ proc CallCCompiler*(projectfile: string) = while it != nil: let objFile = if noAbsolutePaths(): it.data.extractFilename else: it.data add(objfiles, ' ') - add(objfiles, quoteIfContainsWhite( + add(objfiles, quoteShell( addFileExt(objFile, cc[ccompiler].objExt))) it = PStrEntry(it.next) @@ -602,8 +602,8 @@ proc CallCCompiler*(projectfile: string) = var linkerExe = getConfigVar(c, ".linkerexe") if len(linkerExe) == 0: linkerExe = cc[c].linkerExe if needsExeExt(): linkerExe = addFileExt(linkerExe, "exe") - if noAbsolutePaths(): linkCmd = quoteIfContainsWhite(linkerExe) - else: linkCmd = quoteIfContainsWhite(JoinPath(ccompilerpath, linkerExe)) + if noAbsolutePaths(): linkCmd = quoteShell(linkerExe) + else: linkCmd = quoteShell(JoinPath(ccompilerpath, linkerExe)) if optGenGuiApp in gGlobalOptions: buildGui = cc[c].buildGui else: buildGui = "" var exefile: string @@ -617,17 +617,17 @@ proc CallCCompiler*(projectfile: string) = exefile = options.outFile if not noAbsolutePaths(): exefile = joinPath(splitFile(projectFile).dir, exefile) - exefile = quoteIfContainsWhite(exefile) + exefile = quoteShell(exefile) let linkOptions = getLinkOptions() - linkCmd = quoteIfContainsWhite(linkCmd % ["builddll", builddll, + linkCmd = quoteShell(linkCmd % ["builddll", builddll, "buildgui", buildgui, "options", linkOptions, "objfiles", objfiles, "exefile", exefile, "nimrod", getPrefixDir(), "lib", libpath]) linkCmd.add ' ' addf(linkCmd, cc[c].linkTmpl, ["builddll", builddll, "buildgui", buildgui, "options", linkOptions, "objfiles", objfiles, "exefile", exefile, - "nimrod", quoteIfContainsWhite(getPrefixDir()), - "lib", quoteIfContainsWhite(libpath)]) + "nimrod", quoteShell(getPrefixDir()), + "lib", quoteShell(libpath)]) if optCompileOnly notin gGlobalOptions: execExternalProgram(linkCmd) else: linkCmd = "" diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim index 2f10e32e36..8e3c0e61ee 100644 --- a/compiler/nimrod.nim +++ b/compiler/nimrod.nim @@ -13,9 +13,9 @@ when defined(gcc) and defined(windows): else: {.link: "icons/nimrod_icon.o".} -import - commands, lexer, condsyms, options, msgs, nversion, nimconf, ropes, - extccomp, strutils, os, platform, main, parseopt, service +import + commands, lexer, condsyms, options, msgs, nversion, nimconf, ropes, + extccomp, strutils, os, osproc, platform, main, parseopt, service when hasTinyCBackend: import tccgen @@ -23,7 +23,7 @@ when hasTinyCBackend: when defined(profiler) or defined(memProfiler): {.hint: "Profiling support is turned on!".} import nimprof - + proc prependCurDir(f: string): string = when defined(unix): if os.isAbsolute(f): result = f @@ -61,11 +61,11 @@ proc HandleCmdLine() = tccgen.run() if optRun in gGlobalOptions: if gCmd == cmdCompileToJS: - var ex = quoteIfContainsWhite( + var ex = quoteShell( completeCFilePath(changeFileExt(gProjectFull, "js").prependCurDir)) execExternalProgram("node " & ex & ' ' & service.arguments) else: - var ex = quoteIfContainsWhite( + var ex = quoteShell( changeFileExt(gProjectFull, exeExt).prependCurDir) execExternalProgram(ex & ' ' & service.arguments) diff --git a/lib/pure/browsers.nim b/lib/pure/browsers.nim index 6f5bf7ddba..b44f406c5e 100644 --- a/lib/pure/browsers.nim +++ b/lib/pure/browsers.nim @@ -33,10 +33,10 @@ proc openDefaultBrowser*(url: string) = else: discard ShellExecuteA(0'i32, "open", url, nil, nil, SW_SHOWNORMAL) elif defined(macosx): - discard execShellCmd("open " & quoteIfContainsWhite(url)) + discard execShellCmd("open " & quoteShell(url)) else: const attempts = ["gnome-open ", "kde-open ", "xdg-open "] - var u = quoteIfContainsWhite(url) + var u = quoteShell(url) for a in items(attempts): if execShellCmd(a & u) == 0: return for b in getEnv("BROWSER").string.split(PathSep): diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 7772585a97..61b940ce83 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -359,10 +359,10 @@ when defined(Windows) and not defined(useNimRtl): result.writeDataImpl = hsWriteData proc buildCommandLine(a: string, args: openarray[string]): cstring = - var res = quoteIfContainsWhite(a) + var res = quoteShell(a) for i in 0..high(args): res.add(' ') - res.add(quoteIfContainsWhite(args[i])) + res.add(quoteShell(args[i])) result = cast[cstring](alloc0(res.len+1)) copyMem(result, cstring(res), res.len) @@ -562,10 +562,10 @@ elif not defined(useNimRtl): writeIdx = 1 proc addCmdArgs(command: string, args: openarray[string]): string = - result = quoteIfContainsWhite(command) + result = quoteShell(command) for i in 0 .. high(args): add(result, " ") - add(result, quoteIfContainsWhite(args[i])) + add(result, quoteShell(args[i])) proc toCStringArray(b, a: openarray[string]): cstringArray = result = cast[cstringArray](alloc0((a.len + b.len + 1) * sizeof(cstring))) diff --git a/tools/niminst/niminst.nim b/tools/niminst/niminst.nim index 25ec0d283e..0c9717e12e 100644 --- a/tools/niminst/niminst.nim +++ b/tools/niminst/niminst.nim @@ -14,7 +14,7 @@ when haveZipLib: import zipfiles import - os, strutils, parseopt, parsecfg, strtabs, streams, debcreation + os, osproc, strutils, parseopt, parsecfg, strtabs, streams, debcreation const maxOS = 20 # max number of OSes @@ -486,7 +486,7 @@ proc setupDist(c: var TConfigData) = if c.innoSetup.path.len == 0: c.innoSetup.path = "iscc.exe" var outcmd = if c.outdir.len == 0: "build" else: c.outdir - var cmd = "$# $# /O$# $#" % [quoteIfContainsWhite(c.innoSetup.path), + var cmd = "$# $# /O$# $#" % [quoteShell(c.innoSetup.path), c.innoSetup.flags, outcmd, n] echo(cmd) if execShellCmd(cmd) == 0: @@ -587,4 +587,3 @@ if actionZip in c.actions: quit("libzip is not installed") if actionDeb in c.actions: debDist(c) - From c6c836692585b6a94f7c453bf1dff82be0107b2f Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Thu, 12 Dec 2013 00:57:31 +0100 Subject: [PATCH 094/326] Mentions static alternatives to quit(). --- lib/system.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/system.nim b/lib/system.nim index dc5a406d14..d7a9b08ab1 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -923,6 +923,10 @@ proc quit*(errorcode: int = QuitSuccess) {. ## The proc ``quit(QuitSuccess)`` is called implicitly when your nimrod ## program finishes without incident. A raised unhandled exception is ## equivalent to calling ``quit(QuitFailure)``. + ## + ## Note that this is a *runtime* call and using ``quit`` inside a macro won't + ## have any compile time effect. If you need to stop the compiler inside a + ## macro, use the ``error`` or ``fatal`` pragmas. template sysAssert(cond: bool, msg: string) = when defined(useSysAssert): From b4d6a6aafe400556d3557cb7ccf0a12a40e1b4e7 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Thu, 12 Dec 2013 01:00:23 +0100 Subject: [PATCH 095/326] Adds example to fatal pragma. --- doc/manual.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/manual.txt b/doc/manual.txt index dabff3d69d..ee283da0c0 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -4708,7 +4708,11 @@ fatal pragma ------------ The `fatal`:idx: pragma is used to make the compiler output an error message with the given content. In contrast to the ``error`` pragma, compilation -is guaranteed to be aborted by this pragma. +is guaranteed to be aborted by this pragma. Example: + +.. code-block:: nimrod + when not defined(objc): + {.fatal: "Compile this program with the objc command!".} warning pragma -------------- From 6db20a4be8556621b3a33f87854b4b857c4dcf9e Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 12 Dec 2013 01:34:01 +0100 Subject: [PATCH 096/326] new VM: improvements --- compiler/semexprs.nim | 6 +-- compiler/semmagic.nim | 17 +++------ compiler/vm.nim | 78 ++++++++++++++++++++++++++++++--------- compiler/vmdef.nim | 3 +- compiler/vmgen.nim | 60 ++++++++++++++++++++---------- tests/compile/tircbot.nim | 6 +-- todo.txt | 1 - 7 files changed, 114 insertions(+), 57 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 13bfddab72..4b263b3a31 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -300,11 +300,11 @@ proc semOf(c: PContext, n: PNode): PNode = result = n proc isOpImpl(c: PContext, n: PNode): PNode = - InternalAssert n.sonsLen == 3 and - n[1].kind == nkSym and n[1].sym.kind == skType and + internalAssert n.sonsLen == 3 and + n[1].typ != nil and n[2].kind in {nkStrLit..nkTripleStrLit, nkType} - let t1 = n[1].sym.typ.skipTypes({tyTypeDesc}) + let t1 = n[1].typ.skipTypes({tyTypeDesc}) if n[2].kind in {nkStrLit..nkTripleStrLit}: case n[2].strVal.normalize diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 44e1066789..a5f763519c 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -33,10 +33,8 @@ proc semInstantiationInfo(c: PContext, n: PNode): PNode = result.add(line) -proc evalTypeTrait(trait, operand: PNode, context: PSym): PNode = - InternalAssert operand.kind == nkSym - - let typ = operand.sym.typ.skipTypes({tyTypeDesc}) +proc evalTypeTrait(trait: PNode, operand: PType, context: PSym): PNode = + let typ = operand.skipTypes({tyTypeDesc}) case trait.sym.name.s.normalize of "name": result = newStrNode(nkStrLit, typ.typeToString(preferName)) @@ -51,13 +49,10 @@ proc evalTypeTrait(trait, operand: PNode, context: PSym): PNode = proc semTypeTraits(c: PContext, n: PNode): PNode = checkMinSonsLen(n, 2) - internalAssert n.sons[1].kind == nkSym - let typArg = n.sons[1].sym - if typArg.kind == skType or - (typArg.kind == skParam and typArg.typ.sonsLen > 0): - # This is either a type known to sem or a typedesc - # param to a regular proc (again, known at instantiation) - result = evalTypeTrait(n[0], n[1], GetCurrOwner()) + let t = n.sons[1].typ + internalAssert t != nil + if not containsGenericType(t): + result = evalTypeTrait(n[0], t, GetCurrOwner()) else: # a typedesc variable, pass unmodified to evals result = n diff --git a/compiler/vm.nim b/compiler/vm.nim index 94ff8a4c7d..984cc4bb81 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -52,9 +52,9 @@ proc stackTraceAux(c: PCtx; x: PStackFrame; pc: int) = proc stackTrace(c: PCtx, tos: PStackFrame, pc: int, msg: TMsgKind, arg = "") = - MsgWriteln("stack trace: (most recent call last)") + msgWriteln("stack trace: (most recent call last)") stackTraceAux(c, tos, pc) - LocalError(c.debug[pc], msg, arg) + localError(c.debug[pc], msg, arg) proc bailOut(c: PCtx; tos: PStackFrame) = stackTrace(c, tos, c.exceptionInstr, errUnhandledExceptionX, @@ -63,9 +63,6 @@ proc bailOut(c: PCtx; tos: PStackFrame) = when not defined(nimComputedGoto): {.pragma: computedGoto.} -template inc(pc: ptr TInstr, diff = 1) = - inc cast[TAddress](pc), TInstr.sizeof * diff - proc myreset(n: PNode) = when defined(system.reset): var oldInfo = n.info @@ -299,6 +296,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = let instr = c.code[pc] let ra = instr.regA #echo "PC ", pc, " ", c.code[pc].opcode, " ra ", ra + #message(c.debug[pc], warnUser, "gah") case instr.opcode of opcEof: return regs[ra] of opcRet: @@ -338,25 +336,38 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # a = b[c] let rb = instr.regB let rc = instr.regC - let idx = regs[rc].intVal + let idx = regs[rc].intVal.int # XXX what if the array is not 0-based? -> codegen should insert a sub assert regs[rb].kind != nkMetaNode - asgnComplex(regs[ra], regs[rb].sons[idx.int]) + let src = regs[rb] + if src.kind notin {nkEmpty..nkNilLit} and idx <% src.len: + asgnComplex(regs[ra], src.sons[idx]) + else: + stackTrace(c, tos, pc, errIndexOutOfBounds) of opcLdStrIdx: decodeBC(nkIntLit) - let idx = regs[rc].intVal - regs[ra].intVal = regs[rb].strVal[idx.int].ord + let idx = regs[rc].intVal.int + if idx <=% regs[rb].strVal.len: + regs[ra].intVal = regs[rb].strVal[idx].ord + else: + stackTrace(c, tos, pc, errIndexOutOfBounds) of opcWrArr: # a[b] = c let rb = instr.regB let rc = instr.regC - let idx = regs[rb].intVal - asgnComplex(regs[ra].sons[idx.int], regs[rc]) + let idx = regs[rb].intVal.int + if idx <% regs[ra].len: + asgnComplex(regs[ra].sons[idx], regs[rc]) + else: + stackTrace(c, tos, pc, errIndexOutOfBounds) of opcWrArrRef: let rb = instr.regB let rc = instr.regC - let idx = regs[rb].intVal - asgnRef(regs[ra].sons[idx.int], regs[rc]) + let idx = regs[rb].intVal.int + if idx <% regs[ra].len: + asgnRef(regs[ra].sons[idx], regs[rc]) + else: + stackTrace(c, tos, pc, errIndexOutOfBounds) of opcLdObj: # a = b.c let rb = instr.regB @@ -381,7 +392,10 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcWrStrIdx: decodeBC(nkStrLit) let idx = regs[rb].intVal.int - regs[ra].strVal[idx] = chr(regs[rc].intVal) + if idx <% regs[ra].strVal.len: + regs[ra].strVal[idx] = chr(regs[rc].intVal) + else: + stackTrace(c, tos, pc, errIndexOutOfBounds) of opcAddr: decodeB(nkRefTy) if regs[ra].len == 0: regs[ra].add regs[rb] @@ -631,7 +645,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = #echo "new pc ", newPc, " calling: ", prc.name.s var newFrame = PStackFrame(prc: prc, comesFrom: pc, next: tos) newSeq(newFrame.slots, prc.offset) - if not isEmptyType(prc.typ.sons[0]): + if not isEmptyType(prc.typ.sons[0]) or prc.kind == skMacro: newFrame.slots[0] = getNullValue(prc.typ.sons[0], prc.info) # pass every parameter by var (the language definition allows this): for i in 1 .. rc-1: @@ -769,7 +783,15 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra].strVal.setLen(regs[rb].getOrdValue.int) of opcOf: decodeBC(nkIntLit) - regs[ra].intVal = ord(inheritanceDiff(regs[rb].typ, regs[rc].typ) >= 0) + let typ = c.types[regs[rc].intVal.int] + regs[ra].intVal = ord(inheritanceDiff(regs[rb].typ, typ) >= 0) + of opcIs: + decodeBC(nkIntLit) + let t1 = regs[rb].typ.skipTypes({tyTypeDesc}) + let t2 = c.types[regs[rc].intVal.int] + let match = if t2.kind == tyTypeClass: matchTypeClass(t2, t1) + else: sameType(t1, t2) + regs[ra].intVal = ord(match) of opcSetLenSeq: decodeB(nkBracket) let newLen = regs[rb].getOrdValue.int @@ -787,10 +809,20 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = decodeBC(nkMetaNode) if regs[rb].kind != nkMetaNode: internalError(c.debug[pc], "no MetaNode") - setMeta(regs[ra], regs[rb].uast.sons[regs[rc].intVal.int]) + let idx = regs[rc].intVal.int + let src = regs[rb].uast + if src.kind notin {nkEmpty..nkNilLit} and idx <% src.len: + setMeta(regs[ra], src.sons[idx]) + else: + stackTrace(c, tos, pc, errIndexOutOfBounds) of opcNSetChild: decodeBC(nkMetaNode) - regs[ra].uast.sons[regs[rb].intVal.int] = regs[rc].uast + let idx = regs[rb].intVal.int + var dest = regs[ra].uast + if dest.kind notin {nkEmpty..nkNilLit} and idx <% dest.len: + dest.sons[idx] = regs[rc].uast + else: + stackTrace(c, tos, pc, errIndexOutOfBounds) of opcNAdd: decodeBC(nkMetaNode) var u = regs[rb].uast @@ -986,6 +1018,15 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = decodeB(nkStrLit) let typ = regs[rb].sym.typ.skipTypes({tyTypeDesc}) regs[ra].strVal = typ.typeToString(preferExported) + of opcGlobalOnce: + let rb = instr.regBx + if c.globals.sons[rb - wordExcess - 1].kind != nkEmpty: + # skip initialization instructions: + while true: + inc pc + if c.code[pc].opcode in {opcWrGlobal, opcWrGlobalRef} and + c.code[pc].regBx == rb: + break inc pc proc fixType(result, n: PNode) {.inline.} = @@ -1073,6 +1114,7 @@ proc setupMacroParam(x: PNode): PNode = y.flags.incl nfIsRef result = newNode(nkMetaNode) result.add y + result.typ = x.typ var evalMacroCounter: int diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 290dfd38c0..e31dc9de68 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -60,7 +60,7 @@ type opcEqStr, opcLeStr, opcLtStr, opcEqSet, opcLeSet, opcLtSet, opcMulSet, opcPlusSet, opcMinusSet, opcSymdiffSet, opcConcatStr, opcContainsSet, opcRepr, opcSetLenStr, opcSetLenSeq, - opcSwap, opcIsNil, opcOf, + opcSwap, opcIsNil, opcOf, opcIs, opcSubStr, opcConv, opcCast, opcQuit, opcReset, opcAddStrCh, @@ -122,6 +122,7 @@ type opcLdImmInt, # dest = immediate value opcWrGlobal, opcWrGlobalRef, + opcGlobalOnce, # used to introduce an assignment to a global once opcSetType, # dest.typ = types[Bx] opcTypeTrait diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 62b9e7d1e4..6f07a2dfef 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -301,7 +301,8 @@ proc sameConstant*(a, b: PNode): bool = of nkCharLit..nkInt64Lit: result = a.intVal == b.intVal of nkFloatLit..nkFloat64Lit: result = a.floatVal == b.floatVal of nkStrLit..nkTripleStrLit: result = a.strVal == b.strVal - of nkEmpty, nkNilLit, nkType: result = true + of nkType: result = a.typ == b.typ + of nkEmpty, nkNilLit: result = true else: if sonsLen(a) == sonsLen(b): for i in countup(0, sonsLen(a) - 1): @@ -674,12 +675,16 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = unused(n, dest) var d = c.genx(n.sons[1]) c.gABC(n, opcReset, d) - of mOf: + of mOf, mIs: if dest < 0: dest = c.getTemp(n.typ) var tmp = c.genx(n.sons[1]) - c.gABC(n, opcOf, dest, tmp) - c.gABx(n, opcOf, 0, c.genType(n.sons[2].typ.skipTypes(abstractPtrs))) + var idx = c.getTemp(getSysType(tyInt)) + var typ = n.sons[2].typ + if m == mOf: typ = typ.skipTypes(abstractPtrs) + c.gABx(n, opcLdImmInt, idx, c.genType(typ)) + c.gABC(n, if m == mOf: opcOf else: opcIs, dest, tmp, idx) c.freeTemp(tmp) + c.freeTemp(idx) of mSizeOf: GlobalError(n.info, errCannotInterpretNodeX, renderTree(n)) of mHigh: @@ -717,8 +722,6 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = c.gABx(n, opcSetType, tmp, c.genType(n.sons[1].typ)) c.gABC(n, opcTypeTrait, dest, tmp) c.freeTemp(tmp) - of mIs: - InternalError(n.info, "cannot generate code for: " & $m) of mSlurp: genUnaryABC(c, n, dest, opcSlurp) of mStaticExec: genBinaryABC(c, n, dest, opcGorge) of mNLen: genUnaryABI(c, n, dest, opcLenSeq) @@ -905,6 +908,11 @@ proc genLit(c: PCtx; n: PNode; dest: var TDest) = let lit = genLiteral(c, n) c.gABx(n, opc, dest, lit) +proc genTypeLit(c: PCtx; t: PType; dest: var TDest) = + var n = newNode(nkType) + n.typ = t + genLit(c, n, dest) + proc importcSym(c: PCtx; info: TLineInfo; s: PSym) = when hasFFI: if allowFFI in c.features: @@ -920,6 +928,17 @@ proc cannotEval(n: PNode) {.noinline.} = globalError(n.info, errGenerated, "cannot evaluate at compile time: " & n.renderTree) +proc genGlobalInit(c: PCtx; n: PNode; s: PSym) = + c.globals.add(emptyNode) + s.position = c.globals.len + # This is rather hard to support, due to the laziness of the VM code + # generator. See tests/compile/tmacro2 for why this is necesary: + # var decls{.compileTime.}: seq[PNimrodNode] = @[] + c.gABx(n, opcGlobalOnce, 0, s.position) + let tmp = c.genx(s.ast) + c.gABx(n, whichAsgnOpc(n, opcWrGlobal), tmp, s.position) + c.freeTemp(tmp) + proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = let s = n.sym if s.isGlobal: @@ -930,10 +949,7 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = if dest < 0: dest = c.getTemp(s.typ) if s.position == 0: if sfImportc in s.flags: c.importcSym(n.info, s) - else: - c.globals.add(s.ast) - s.position = c.globals.len - # XXX var g = codeHere() ? + else: genGlobalInit(c, n, s) c.gABx(n, opcLdGlobal, dest, s.position) else: if s.position > 0 or (s.position == 0 and s.kind in {skParam, skResult}): @@ -1052,6 +1068,7 @@ proc genVarSection(c: PCtx; n: PNode) = let sa = if s.ast.isNil: getNullValue(s.typ, a.info) else: s.ast c.globals.add(sa) s.position = c.globals.len + # "Once support" is unnecessary here if a.sons[2].kind == nkEmpty: when false: withTemp(tmp, s.typ): @@ -1079,15 +1096,16 @@ proc genVarSection(c: PCtx; n: PNode) = proc genArrayConstr(c: PCtx, n: PNode, dest: var TDest) = if dest < 0: dest = c.getTemp(n.typ) c.gABx(n, opcLdNull, dest, c.genType(n.typ)) - let intType = getSysType(tyInt) - var tmp = getTemp(c, intType) - c.gABx(n, opcLdNull, tmp, c.genType(intType)) - for x in n: - let a = c.genx(x) - c.gABC(n, whichAsgnOpc(x, opcWrArr), dest, tmp, a) - c.gABI(n, opcAddImmInt, tmp, tmp, 1) - c.freeTemp(a) - c.freeTemp(tmp) + if n.len > 0: + let intType = getSysType(tyInt) + var tmp = getTemp(c, intType) + c.gABx(n, opcLdNull, tmp, c.genType(intType)) + for x in n: + let a = c.genx(x) + c.gABC(n, whichAsgnOpc(x, opcWrArr), dest, tmp, a) + c.gABI(n, opcAddImmInt, tmp, tmp, 1) + c.freeTemp(a) + c.freeTemp(tmp) proc genSetConstr(c: PCtx, n: PNode, dest: var TDest) = if dest < 0: dest = c.getTemp(n.typ) @@ -1167,6 +1185,8 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = InternalError(n.info, "too large offset! cannot generate code for: " & s.name.s) dest = s.position + of skType: + genTypeLit(c, s.typ, dest) else: InternalError(n.info, "cannot generate code for: " & s.name.s) of nkCallKinds: @@ -1371,7 +1391,7 @@ proc genProc(c: PCtx; s: PSym): int = c.gABC(body, opcEof, eofInstr.regA) c.optimizeJumps(result) s.offset = c.prc.maxSlots - #if s.name.s == "treeRepr" or s.name.s == "traverse": + #if s.name.s == "importImpl_forward" or s.name.s == "importImpl": # c.echoCode(result) # echo renderTree(body) c.prc = oldPrc diff --git a/tests/compile/tircbot.nim b/tests/compile/tircbot.nim index d16c99b692..6008838ff4 100644 --- a/tests/compile/tircbot.nim +++ b/tests/compile/tircbot.nim @@ -257,7 +257,7 @@ proc limitCommitMsg(m: string): string = proc handleWebMessage(state: PState, line: string) = echo("Got message from hub: " & line) var json = parseJson(line) - if json.existsKey("payload"): + if json.hasKey("payload"): for i in 0..min(4, json["payload"]["commits"].len-1): var commit = json["payload"]["commits"][i] # Create the message @@ -273,8 +273,8 @@ proc handleWebMessage(state: PState, line: string) = # Send message to #nimrod. state.ircClient.privmsg(joinChans[0], message) - elif json.existsKey("redisinfo"): - assert json["redisinfo"].existsKey("port") + elif json.hasKey("redisinfo"): + assert json["redisinfo"].hasKey("port") #let redisPort = json["redisinfo"]["port"].num state.dbConnected = true diff --git a/todo.txt b/todo.txt index 91df38a146..4c999226f2 100644 --- a/todo.txt +++ b/todo.txt @@ -20,7 +20,6 @@ Bugs - bug: 'type T = ref T' not recognized as illegal recursion - bug: type conversions concerning proc types are weird - compilation of niminst takes way too long. looks like a regression -- simple closure iterator doesn't work - docgen: sometimes effects are listed twice - 'result' is not properly cleaned for NRVO --> use uninit checking instead - sneaking with qualifiedLookup() is really broken! From aaf49947e9e259b4cd2bda6b218f9bd6abc4ca71 Mon Sep 17 00:00:00 2001 From: Erik O'Leary Date: Thu, 12 Dec 2013 10:59:30 -0600 Subject: [PATCH 097/326] Added jsondoc compiler switch Outputs top-level exported information in JSON --- compiler/docgen.nim | 284 +++++++++++++++++++++++++++---------------- compiler/main.nim | 58 +++++---- compiler/options.nim | 1 + 3 files changed, 211 insertions(+), 132 deletions(-) diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 9929b4bd94..d44018a2ba 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -11,10 +11,10 @@ # semantic checking is done for the code. Cross-references are generated # by knowing how the anchors are going to be named. -import - ast, strutils, strtabs, options, msgs, os, ropes, idents, - wordrecg, syntaxes, renderer, lexer, rstast, rst, rstgen, times, highlite, - importer, sempass2 +import + ast, strutils, strtabs, options, msgs, os, ropes, idents, + wordrecg, syntaxes, renderer, lexer, rstast, rst, rstgen, times, highlite, + importer, sempass2, json type TSections = array[TSymKind, PRope] @@ -25,7 +25,7 @@ type indexValFilename: string PDoc* = ref TDocumentor - + proc compilerMsgHandler(filename: string, line, col: int, msgKind: rst.TMsgKind, arg: string) {.procvar.} = # translate msg kind: @@ -41,69 +41,69 @@ proc compilerMsgHandler(filename: string, line, col: int, of mwUnknownSubstitution: k = warnUnknownSubstitutionX of mwUnsupportedLanguage: k = warnLanguageXNotSupported GlobalError(newLineInfo(filename, line, col), k, arg) - + proc parseRst(text, filename: string, line, column: int, hasToc: var bool, rstOptions: TRstParseOptions): PRstNode = result = rstParse(text, filename, line, column, hasToc, rstOptions, options.FindFile, compilerMsgHandler) -proc newDocumentor*(filename: string, config: PStringTable): PDoc = +proc newDocumentor*(filename: string, config: PStringTable): PDoc = new(result) initRstGenerator(result[], (if gCmd != cmdRst2Tex: outHtml else: outLatex), options.gConfigVars, filename, {roSupportRawDirective}, options.FindFile, compilerMsgHandler) result.id = 100 -proc dispA(dest: var PRope, xml, tex: string, args: openarray[PRope]) = +proc dispA(dest: var PRope, xml, tex: string, args: openarray[PRope]) = if gCmd != cmdRst2Tex: appf(dest, xml, args) else: appf(dest, tex, args) - -proc getVarIdx(varnames: openarray[string], id: string): int = - for i in countup(0, high(varnames)): - if cmpIgnoreStyle(varnames[i], id) == 0: + +proc getVarIdx(varnames: openarray[string], id: string): int = + for i in countup(0, high(varnames)): + if cmpIgnoreStyle(varnames[i], id) == 0: return i result = -1 -proc ropeFormatNamedVars(frmt: TFormatStr, varnames: openarray[string], - varvalues: openarray[PRope]): PRope = +proc ropeFormatNamedVars(frmt: TFormatStr, varnames: openarray[string], + varvalues: openarray[PRope]): PRope = var i = 0 var L = len(frmt) result = nil var num = 0 - while i < L: - if frmt[i] == '$': + while i < L: + if frmt[i] == '$': inc(i) # skip '$' case frmt[i] - of '#': + of '#': app(result, varvalues[num]) inc(num) inc(i) - of '$': + of '$': app(result, "$") inc(i) - of '0'..'9': + of '0'..'9': var j = 0 - while true: + while true: j = (j * 10) + Ord(frmt[i]) - ord('0') inc(i) - if (i > L + 0 - 1) or not (frmt[i] in {'0'..'9'}): break + if (i > L + 0 - 1) or not (frmt[i] in {'0'..'9'}): break if j > high(varvalues) + 1: internalError("ropeFormatNamedVars") num = j app(result, varvalues[j - 1]) - of 'A'..'Z', 'a'..'z', '\x80'..'\xFF': + of 'A'..'Z', 'a'..'z', '\x80'..'\xFF': var id = "" - while true: + while true: add(id, frmt[i]) inc(i) - if not (frmt[i] in {'A'..'Z', '_', 'a'..'z', '\x80'..'\xFF'}): break + if not (frmt[i] in {'A'..'Z', '_', 'a'..'z', '\x80'..'\xFF'}): break var idx = getVarIdx(varnames, id) if idx >= 0: app(result, varvalues[idx]) else: rawMessage(errUnkownSubstitionVar, id) - of '{': + of '{': var id = "" inc(i) - while frmt[i] != '}': + while frmt[i] != '}': if frmt[i] == '\0': rawMessage(errTokenExpected, "}") add(id, frmt[i]) inc(i) @@ -124,17 +124,17 @@ proc genComment(d: PDoc, n: PNode): string = var dummyHasToc: bool if n.comment != nil and startsWith(n.comment, "##"): renderRstToOut(d[], parseRst(n.comment, toFilename(n.info), - toLineNumber(n.info), toColumn(n.info), + toLineNumber(n.info), toColumn(n.info), dummyHasToc, d.options + {roSkipPounds}), result) -proc genRecComment(d: PDoc, n: PNode): PRope = +proc genRecComment(d: PDoc, n: PNode): PRope = if n == nil: return nil result = genComment(d, n).toRope - if result == nil: + if result == nil: if n.kind notin {nkEmpty..nkNilLit}: for i in countup(0, len(n)-1): result = genRecComment(d, n.sons[i]) - if result != nil: return + if result != nil: return else: n.comment = nil @@ -158,10 +158,10 @@ proc extractDocComment*(s: PSym, d: PDoc = nil): string = else: result = n.comment.substr(2).replace("\n##", "\n").strip -proc isVisible(n: PNode): bool = +proc isVisible(n: PNode): bool = result = false - if n.kind == nkPostfix: - if n.len == 2 and n.sons[0].kind == nkIdent: + if n.kind == nkPostfix: + if n.len == 2 and n.sons[0].kind == nkIdent: var v = n.sons[0].ident result = v.id == ord(wStar) or v.id == ord(wMinus) elif n.kind == nkSym: @@ -171,36 +171,36 @@ proc isVisible(n: PNode): bool = result = {sfExported, sfFromGeneric, sfForward}*n.sym.flags == {sfExported} elif n.kind == nkPragmaExpr: result = isVisible(n.sons[0]) - -proc getName(d: PDoc, n: PNode, splitAfter = -1): string = + +proc getName(d: PDoc, n: PNode, splitAfter = -1): string = case n.kind of nkPostfix: result = getName(d, n.sons[1], splitAfter) of nkPragmaExpr: result = getName(d, n.sons[0], splitAfter) of nkSym: result = esc(d.target, n.sym.renderDefinitionName, splitAfter) of nkIdent: result = esc(d.target, n.ident.s, splitAfter) - of nkAccQuoted: - result = esc(d.target, "`") + of nkAccQuoted: + result = esc(d.target, "`") for i in 0.. $1", "\\spanComment{$1}", + of tkEof: + break + of tkComment: + dispA(result, "$1", "\\spanComment{$1}", [toRope(esc(d.target, literal))]) - of tokKeywordLow..tokKeywordHigh: - dispA(result, "$1", "\\spanKeyword{$1}", + of tokKeywordLow..tokKeywordHigh: + dispA(result, "$1", "\\spanKeyword{$1}", [toRope(literal)]) - of tkOpr: - dispA(result, "$1", "\\spanOperator{$1}", + of tkOpr: + dispA(result, "$1", "\\spanOperator{$1}", [toRope(esc(d.target, literal))]) - of tkStrLit..tkTripleStrLit: - dispA(result, "$1", + of tkStrLit..tkTripleStrLit: + dispA(result, "$1", "\\spanStringLit{$1}", [toRope(esc(d.target, literal))]) - of tkCharLit: - dispA(result, "$1", "\\spanCharLit{$1}", + of tkCharLit: + dispA(result, "$1", "\\spanCharLit{$1}", [toRope(esc(d.target, literal))]) - of tkIntLit..tkUInt64Lit: - dispA(result, "$1", + of tkIntLit..tkUInt64Lit: + dispA(result, "$1", "\\spanDecNumber{$1}", [toRope(esc(d.target, literal))]) - of tkFloatLit..tkFloat128Lit: - dispA(result, "$1", + of tkFloatLit..tkFloat128Lit: + dispA(result, "$1", "\\spanFloatNumber{$1}", [toRope(esc(d.target, literal))]) - of tkSymbol: - dispA(result, "$1", + of tkSymbol: + dispA(result, "$1", "\\spanIdentifier{$1}", [toRope(esc(d.target, literal))]) - of tkSpaces, tkInvalid: + of tkSpaces, tkInvalid: app(result, literal) - of tkParLe, tkParRi, tkBracketLe, tkBracketRi, tkCurlyLe, tkCurlyRi, - tkBracketDotLe, tkBracketDotRi, tkCurlyDotLe, tkCurlyDotRi, tkParDotLe, - tkParDotRi, tkComma, tkSemiColon, tkColon, tkEquals, tkDot, tkDotDot, - tkAccent, tkColonColon, - tkGStrLit, tkGTripleStrLit, tkInfixOpr, tkPrefixOpr, tkPostfixOpr: - dispA(result, "$1", "\\spanOther{$1}", + of tkParLe, tkParRi, tkBracketLe, tkBracketRi, tkCurlyLe, tkCurlyRi, + tkBracketDotLe, tkBracketDotRi, tkCurlyDotLe, tkCurlyDotRi, tkParDotLe, + tkParDotRi, tkComma, tkSemiColon, tkColon, tkEquals, tkDot, tkDotDot, + tkAccent, tkColonColon, + tkGStrLit, tkGTripleStrLit, tkInfixOpr, tkPrefixOpr, tkPostfixOpr: + dispA(result, "$1", "\\spanOther{$1}", [toRope(esc(d.target, literal))]) inc(d.id) - app(d.section[k], ropeFormatNamedVars(getConfigVar("doc.item"), - ["name", "header", "desc", "itemID"], + app(d.section[k], ropeFormatNamedVars(getConfigVar("doc.item"), + ["name", "header", "desc", "itemID"], [name, result, comm, toRope(d.id)])) - app(d.toc[k], ropeFormatNamedVars(getConfigVar("doc.item.toc"), + app(d.toc[k], ropeFormatNamedVars(getConfigVar("doc.item.toc"), ["name", "header", "desc", "itemID"], [ toRope(getName(d, nameNode, d.splitAfter)), result, comm, toRope(d.id)])) setIndexTerm(d[], $d.id, getName(d, nameNode)) -proc checkForFalse(n: PNode): bool = +proc genJSONItem(d: PDoc, n, nameNode: PNode, k: TSymKind): PJsonNode = + if not isVisible(nameNode): return + var + name = getName(d, nameNode) + comm = genRecComment(d, n).ropeToStr() + r: TSrcGen + + initTokRender(r, n, {renderNoBody, renderNoComments, renderDocComments}) + + result = %{ "name": %name, "type": %($k) } + + if comm != nil and comm != "": + result["description"] = %comm + if r.buf != nil: + result["code"] = %r.buf + +proc checkForFalse(n: PNode): bool = result = n.kind == nkIdent and IdentEq(n.ident, "false") - -proc traceDeps(d: PDoc, n: PNode) = + +proc traceDeps(d: PDoc, n: PNode) = const k = skModule if d.section[k] != nil: app(d.section[k], ", ") - dispA(d.section[k], - "$1", + dispA(d.section[k], + "$1", "$1", [toRope(getModuleName(n))]) -proc generateDoc*(d: PDoc, n: PNode) = +proc generateDoc*(d: PDoc, n: PNode) = case n.kind of nkCommentStmt: app(d.modDesc, genComment(d, n)) - of nkProcDef: + of nkProcDef: when useEffectSystem: documentRaises(n) genItem(d, n, n.sons[namePos], skProc) of nkMethodDef: when useEffectSystem: documentRaises(n) genItem(d, n, n.sons[namePos], skMethod) - of nkIteratorDef: + of nkIteratorDef: when useEffectSystem: documentRaises(n) genItem(d, n, n.sons[namePos], skIterator) of nkMacroDef: genItem(d, n, n.sons[namePos], skMacro) @@ -284,27 +300,69 @@ proc generateDoc*(d: PDoc, n: PNode) = genItem(d, n, n.sons[namePos], skConverter) of nkTypeSection, nkVarSection, nkLetSection, nkConstSection: for i in countup(0, sonsLen(n) - 1): - if n.sons[i].kind != nkCommentStmt: + if n.sons[i].kind != nkCommentStmt: # order is always 'type var let const': - genItem(d, n.sons[i], n.sons[i].sons[0], + genItem(d, n.sons[i], n.sons[i].sons[0], succ(skType, ord(n.kind)-ord(nkTypeSection))) - of nkStmtList: + of nkStmtList: for i in countup(0, sonsLen(n) - 1): generateDoc(d, n.sons[i]) - of nkWhenStmt: + of nkWhenStmt: # generate documentation for the first branch only: if not checkForFalse(n.sons[0].sons[0]): generateDoc(d, lastSon(n.sons[0])) of nkImportStmt: - for i in 0 .. sonsLen(n)-1: traceDeps(d, n.sons[i]) + for i in 0 .. sonsLen(n)-1: traceDeps(d, n.sons[i]) of nkFromStmt, nkImportExceptStmt: traceDeps(d, n.sons[0]) else: nil -proc genSection(d: PDoc, kind: TSymKind) = +proc generateJson(d: PDoc, n: PNode, jArray: PJsonNode = nil): PJsonNode = + case n.kind + of nkCommentStmt: + if n.comment != nil and startsWith(n.comment, "##"): + let stripped = n.comment.substr(2).strip + result = %{ "comment": %stripped } + of nkProcDef: + when useEffectSystem: documentRaises(n) + result = genJSONItem(d, n, n.sons[namePos], skProc) + of nkMethodDef: + when useEffectSystem: documentRaises(n) + result = genJSONItem(d, n, n.sons[namePos], skMethod) + of nkIteratorDef: + when useEffectSystem: documentRaises(n) + result = genJSONItem(d, n, n.sons[namePos], skIterator) + of nkMacroDef: + result = genJSONItem(d, n, n.sons[namePos], skMacro) + of nkTemplateDef: + result = genJSONItem(d, n, n.sons[namePos], skTemplate) + of nkConverterDef: + when useEffectSystem: documentRaises(n) + result = genJSONItem(d, n, n.sons[namePos], skConverter) + of nkTypeSection, nkVarSection, nkLetSection, nkConstSection: + for i in countup(0, sonsLen(n) - 1): + if n.sons[i].kind != nkCommentStmt: + # order is always 'type var let const': + result = genJSONItem(d, n.sons[i], n.sons[i].sons[0], + succ(skType, ord(n.kind)-ord(nkTypeSection))) + of nkStmtList: + var elem = jArray + if elem == nil: elem = newJArray() + for i in countup(0, sonsLen(n) - 1): + var r = generateJson(d, n.sons[i], elem) + if r != nil: + elem.add(r) + if result == nil: result = elem + of nkWhenStmt: + # generate documentation for the first branch only: + if not checkForFalse(n.sons[0].sons[0]) and jArray != nil: + discard generateJson(d, lastSon(n.sons[0]), jArray) + else: nil + +proc genSection(d: PDoc, kind: TSymKind) = const sectionNames: array[skModule..skTemplate, string] = [ - "Imports", "Types", "Vars", "Lets", "Consts", "Vars", "Procs", "Methods", + "Imports", "Types", "Vars", "Lets", "Consts", "Vars", "Procs", "Methods", "Iterators", "Converters", "Macros", "Templates" ] - if d.section[kind] == nil: return + if d.section[kind] == nil: return var title = sectionNames[kind].toRope d.section[kind] = ropeFormatNamedVars(getConfigVar("doc.section"), [ "sectionid", "sectionTitle", "sectionTitleID", "content"], [ @@ -313,7 +371,7 @@ proc genSection(d: PDoc, kind: TSymKind) = "sectionid", "sectionTitle", "sectionTitleID", "content"], [ ord(kind).toRope, title, toRope(ord(kind) + 50), d.toc[kind]]) -proc genOutFile(d: PDoc): PRope = +proc genOutFile(d: PDoc): PRope = var code, content: PRope title = "" @@ -321,7 +379,7 @@ proc genOutFile(d: PDoc): PRope = var tmp = "" renderTocEntries(d[], j, 1, tmp) var toc = tmp.toRope - for i in countup(low(TSymKind), high(TSymKind)): + for i in countup(low(TSymKind), high(TSymKind)): genSection(d, i) app(toc, d.toc[i]) if toc != nil: @@ -329,30 +387,30 @@ proc genOutFile(d: PDoc): PRope = for i in countup(low(TSymKind), high(TSymKind)): app(code, d.section[i]) if d.meta[metaTitle].len != 0: title = d.meta[metaTitle] else: title = "Module " & extractFilename(changeFileExt(d.filename, "")) - + let bodyname = if d.hasToc: "doc.body_toc" else: "doc.body_no_toc" - content = ropeFormatNamedVars(getConfigVar(bodyname), ["title", + content = ropeFormatNamedVars(getConfigVar(bodyname), ["title", "tableofcontents", "moduledesc", "date", "time", "content"], - [title.toRope, toc, d.modDesc, toRope(getDateStr()), + [title.toRope, toc, d.modDesc, toRope(getDateStr()), toRope(getClockStr()), code]) - if optCompileOnly notin gGlobalOptions: + if optCompileOnly notin gGlobalOptions: # XXX what is this hack doing here? 'optCompileOnly' means raw output!? - code = ropeFormatNamedVars(getConfigVar("doc.file"), ["title", - "tableofcontents", "moduledesc", "date", "time", - "content", "author", "version"], - [title.toRope, toc, d.modDesc, toRope(getDateStr()), - toRope(getClockStr()), content, d.meta[metaAuthor].toRope, + code = ropeFormatNamedVars(getConfigVar("doc.file"), ["title", + "tableofcontents", "moduledesc", "date", "time", + "content", "author", "version"], + [title.toRope, toc, d.modDesc, toRope(getDateStr()), + toRope(getClockStr()), content, d.meta[metaAuthor].toRope, d.meta[metaVersion].toRope]) - else: + else: code = content result = code proc generateIndex*(d: PDoc) = if optGenIndex in gGlobalOptions: - writeIndexFile(d[], splitFile(options.outFile).dir / + writeIndexFile(d[], splitFile(options.outFile).dir / splitFile(d.filename).name & indexExt) -proc writeOutput*(d: PDoc, filename, outExt: string, useWarning = false) = +proc writeOutput*(d: PDoc, filename, outExt: string, useWarning = false) = var content = genOutFile(d) if optStdout in gGlobalOptions: writeRope(stdout, content) @@ -361,7 +419,7 @@ proc writeOutput*(d: PDoc, filename, outExt: string, useWarning = false) = proc CommandDoc*() = var ast = parseFile(gProjectMainIdx) - if ast == nil: return + if ast == nil: return var d = newDocumentor(gProjectFull, options.gConfigVars) d.hasToc = true generateDoc(d, ast) @@ -388,12 +446,26 @@ proc CommandRst2TeX*() = splitter = "\\-" CommandRstAux(gProjectFull, TexExt) +proc CommandJSON*() = + var ast = parseFile(gProjectMainIdx) + if ast == nil: return + var d = newDocumentor(gProjectFull, options.gConfigVars) + d.hasToc = true + var json = generateJson(d, ast) + var content = newRope(pretty(json)) + + if optStdout in gGlobalOptions: + writeRope(stdout, content) + else: + echo getOutFile(gProjectFull, JsonExt) + writeRope(content, getOutFile(gProjectFull, JsonExt), useWarning = false) + proc CommandBuildIndex*() = var content = mergeIndexes(gProjectFull).toRope - - let code = ropeFormatNamedVars(getConfigVar("doc.file"), ["title", - "tableofcontents", "moduledesc", "date", "time", - "content", "author", "version"], - ["Index".toRope, nil, nil, toRope(getDateStr()), + + let code = ropeFormatNamedVars(getConfigVar("doc.file"), ["title", + "tableofcontents", "moduledesc", "date", "time", + "content", "author", "version"], + ["Index".toRope, nil, nil, toRope(getDateStr()), toRope(getClockStr()), content, nil, nil]) writeRope(code, getOutFile("theindex", HtmlExt)) diff --git a/compiler/main.nim b/compiler/main.nim index 6a4ca496b9..9ffe994542 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -9,8 +9,8 @@ # implements the command dispatcher and several commands -import - llstream, strutils, ast, astalgo, lexer, syntaxes, renderer, options, msgs, +import + llstream, strutils, ast, astalgo, lexer, syntaxes, renderer, options, msgs, os, condsyms, rodread, rodwrite, times, wordrecg, sem, semdata, idents, passes, docgen, extccomp, cgen, jsgen, json, nversion, @@ -98,7 +98,7 @@ proc CommandCompileToC = # rodread.rodcompilerProcs # rodread.gTypeTable # rodread.gMods - + # !! ropes.cache # semthreads.computed? # @@ -166,7 +166,7 @@ proc commandEval(exp: string) = proc CommandPrettyOld = var projectFile = addFileExt(mainCommandArg(), NimExt) var module = parseFile(projectFile.fileInfoIdx) - if module != nil: + if module != nil: renderModule(module, getOutFile(mainCommandArg(), "pretty." & NimExt)) proc CommandPretty = @@ -175,24 +175,24 @@ proc CommandPretty = registerPass(prettyPass) compileProject() pretty.overwriteFiles() - + proc CommandScan = var f = addFileExt(mainCommandArg(), nimExt) var stream = LLStreamOpen(f, fmRead) - if stream != nil: - var + if stream != nil: + var L: TLexer tok: TToken initToken(tok) openLexer(L, f, stream) - while true: + while true: rawGetTok(L, tok) PrintTok(tok) - if tok.tokType == tkEof: break + if tok.tokType == tkEof: break CloseLexer(L) - else: + else: rawMessage(errCannotOpenFile, f) - + proc CommandSuggest = if isServing: # XXX: hacky work-around ahead @@ -246,7 +246,7 @@ proc resetMemory = for i in low(buckets)..high(buckets): buckets[i] = nil idAnon = nil - + # XXX: clean these global vars # ccgstmts.gBreakpoints # ccgthreadvars.nimtv @@ -262,7 +262,7 @@ proc resetMemory = # rodread.rodcompilerProcs # rodread.gTypeTable # rodread.gMods - + # !! ropes.cache # semthreads.computed? # @@ -289,7 +289,7 @@ const proc MainCommand* = when SimiluateCaasMemReset: gGlobalOptions.incl(optCaasEnabled) - + # In "nimrod serve" scenario, each command must reset the registered passes clearPasses() gLastCmdTime = epochTime() @@ -301,7 +301,7 @@ proc MainCommand* = passes.gIncludeFile = includeModule passes.gImportModule = importModule case command.normalize - of "c", "cc", "compile", "compiletoc": + of "c", "cc", "compile", "compiletoc": # compile means compileToC currently gCmd = cmdCompileToC wantMainModule() @@ -325,13 +325,13 @@ proc MainCommand* = when hasTinyCBackend: extccomp.setCC("tcc") CommandCompileToC() - else: + else: rawMessage(errInvalidCommandX, command) - of "js", "compiletojs": + of "js", "compiletojs": gCmd = cmdCompileToJS wantMainModule() CommandCompileToJS() - of "compiletollvm": + of "compiletollvm": gCmd = cmdCompileToLLVM wantMainModule() when has_LLVM_Backend: @@ -353,21 +353,27 @@ proc MainCommand* = wantMainModule() DefineSymbol("nimdoc") CommandDoc2() - of "rst2html": + of "rst2html": gCmd = cmdRst2html LoadConfigs(DocConfig) wantMainModule() CommandRst2Html() - of "rst2tex": + of "rst2tex": gCmd = cmdRst2tex LoadConfigs(DocTexConfig) wantMainModule() CommandRst2TeX() + of "jsondoc": + gCmd = cmdDoc + LoadConfigs(DocConfig) + wantMainModule() + DefineSymbol("nimdoc") + CommandJSON() of "buildindex": gCmd = cmdDoc LoadConfigs(DocConfig) CommandBuildIndex() - of "gendepend": + of "gendepend": gCmd = cmdGenDepend wantMainModule() CommandGenDepend() @@ -400,16 +406,16 @@ proc MainCommand* = gCmd = cmdCheck wantMainModule() CommandCheck() - of "parse": + of "parse": gCmd = cmdParse wantMainModule() discard parseFile(gProjectMainIdx) - of "scan": + of "scan": gCmd = cmdScan wantMainModule() CommandScan() MsgWriteln("Beware: Indentation tokens depend on the parser\'s state!") - of "i": + of "i": gCmd = cmdInteractive CommandInteractive() of "e": @@ -427,11 +433,11 @@ proc MainCommand* = of "serve": isServing = true gGlobalOptions.incl(optCaasEnabled) - msgs.gErrorMax = high(int) # do not stop after first error + msgs.gErrorMax = high(int) # do not stop after first error serve(MainCommand) else: rawMessage(errInvalidCommandX, command) - + if (msgs.gErrorCounter == 0 and gCmd notin {cmdInterpret, cmdRun, cmdDump} and gVerbosity > 0): diff --git a/compiler/options.nim b/compiler/options.nim index ea6b913218..d4122c7b22 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -132,6 +132,7 @@ const NimExt* = "nim" RodExt* = "rod" HtmlExt* = "html" + JsonExt* = "json" TexExt* = "tex" IniExt* = "ini" DefaultConfig* = "nimrod.cfg" From 5b3bc2872137e4627d98c448e0d5821ee580d8db Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Thu, 12 Dec 2013 15:04:28 -0500 Subject: [PATCH 098/326] Commented out CAAS testing code. --- tests/tester.nim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/tester.nim b/tests/tester.nim index fe21fc9ee4..0e125b1bbb 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -11,7 +11,7 @@ import parseutils, strutils, pegs, os, osproc, streams, parsecfg, browsers, json, - marshal, cgi, parseopt, caasdriver + marshal, cgi, parseopt #, caas const cmdTemplate = r"nimrod cc --hints:on $# $#" @@ -364,10 +364,10 @@ proc outputJSON(reject, compile, run: TResults) = var s = pretty(doc) writeFile(jsonFile, s) -proc runCaasTests(r: var TResults) = - for test, output, status, mode in caasTestsRunner(): - r.addResult(test, "", output & "-> " & $mode, - if status: reSuccess else: reOutputsDiffer) +# proc runCaasTests(r: var TResults) = +# for test, output, status, mode in caasTestsRunner(): +# r.addResult(test, "", output & "-> " & $mode, +# if status: reSuccess else: reOutputsDiffer) proc main() = os.putenv "NIMTEST_NO_COLOR", "1" @@ -411,7 +411,7 @@ proc main() = writeResults(runJson, r) of "special": runSpecialTests(r, p.cmdLineRest.string) - runCaasTests(r) + # runCaasTests(r) writeResults(runJson, r) of "rodfiles": runRodFiles(r, p.cmdLineRest.string) From 328f1932925889d5bb7f91c68fb1504b9b26ba8c Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 13 Dec 2013 01:21:23 +0100 Subject: [PATCH 099/326] new VM: globals kinda work --- compiler/renderer.nim | 10 +++++++--- compiler/semmagic.nim | 4 +++- compiler/vm.nim | 10 ++++++++-- compiler/vmdef.nim | 5 ++++- compiler/vmgen.nim | 24 +++++++++++++++++++++--- tests/compile/tmacro2.nim | 2 +- tests/reject/twrongiter.nim | 2 +- 7 files changed, 45 insertions(+), 12 deletions(-) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index f6fb0f8c0b..c8fe70e028 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -557,7 +557,7 @@ proc longMode(n: PNode, start: int = 0, theEnd: int = - 1): bool = proc gstmts(g: var TSrcGen, n: PNode, c: TContext) = if n.kind == nkEmpty: return - if (n.kind == nkStmtList) or (n.kind == nkStmtListExpr): + if n.kind in {nkStmtList, nkStmtListExpr, nkStmtListType}: indentNL(g) for i in countup(0, sonsLen(n) - 1): optNL(g) @@ -1069,7 +1069,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkSpaces, Space) putWithSpace(g, tkEquals, "=") gsub(g, n.sons[1]) - of nkStmtList, nkStmtListExpr: gstmts(g, n, emptyContext) + of nkStmtList, nkStmtListExpr, nkStmtListType: gstmts(g, n, emptyContext) of nkIfStmt: putWithSpace(g, tkIf, "if") gif(g, n) @@ -1246,8 +1246,12 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkBracketLe, "[") gcomma(g, n) put(g, tkBracketRi, "]") + of nkMetaNode: + put(g, tkParLe, "(META|") + gsub(g, n.sons[0]) + put(g, tkParRi, ")") else: - #nkNone, nkMetaNode, nkExplicitTypeListCall: + #nkNone, nkExplicitTypeListCall: InternalError(n.info, "rnimsyn.gsub(" & $n.kind & ')') proc renderTree(n: PNode, renderFlags: TRenderFlags = {}): string = diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index a5f763519c..aab4c82f53 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -51,7 +51,9 @@ proc semTypeTraits(c: PContext, n: PNode): PNode = checkMinSonsLen(n, 2) let t = n.sons[1].typ internalAssert t != nil - if not containsGenericType(t): + if t.kind == tyTypeDesc and t.len == 0: + result = n + elif not containsGenericType(t): result = evalTypeTrait(n[0], t, GetCurrOwner()) else: # a typedesc variable, pass unmodified to evals diff --git a/compiler/vm.nim b/compiler/vm.nim index 984cc4bb81..ef83860f75 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1027,6 +1027,9 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = if c.code[pc].opcode in {opcWrGlobal, opcWrGlobalRef} and c.code[pc].regBx == rb: break + of opcGlobalAlias: + let rb = instr.regBx - wordExcess - 1 + regs[ra] = c.globals.sons[rb] inc pc proc fixType(result, n: PNode) {.inline.} = @@ -1135,11 +1138,14 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = # setup arguments: var L = n.safeLen if L == 0: L = 1 - InternalAssert tos.slots.len >= L + # This is wrong for tests/reject/tind1.nim where the passed 'else' part + # doesn't end up in the parameter: + #InternalAssert tos.slots.len >= L # return value: tos.slots[0] = newNodeIT(nkNilLit, n.info, sym.typ.sons[0]) # setup parameters: - for i in 1 .. < L: tos.slots[i] = setupMacroParam(n.sons[i]) + for i in 1 .. < min(tos.slots.len, L): + tos.slots[i] = setupMacroParam(n.sons[i]) # temporary storage: for i in L .. = slotSomeTemp: c.slots[r].inUse = false @@ -929,7 +944,7 @@ proc cannotEval(n: PNode) {.noinline.} = n.renderTree) proc genGlobalInit(c: PCtx; n: PNode; s: PSym) = - c.globals.add(emptyNode) + c.globals.add(emptyNode.copyNode) s.position = c.globals.len # This is rather hard to support, due to the laziness of the VM code # generator. See tests/compile/tmacro2 for why this is necesary: @@ -946,11 +961,14 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = discard else: cannotEval(n) - if dest < 0: dest = c.getTemp(s.typ) if s.position == 0: if sfImportc in s.flags: c.importcSym(n.info, s) else: genGlobalInit(c, n, s) - c.gABx(n, opcLdGlobal, dest, s.position) + if dest < 0: + dest = c.getGlobalSlot(n, s) + #c.gABx(n, opcAliasGlobal, dest, s.position) + else: + c.gABx(n, opcLdGlobal, dest, s.position) else: if s.position > 0 or (s.position == 0 and s.kind in {skParam, skResult}): if dest < 0: diff --git a/tests/compile/tmacro2.nim b/tests/compile/tmacro2.nim index e7bc648dbe..39324e497d 100644 --- a/tests/compile/tmacro2.nim +++ b/tests/compile/tmacro2.nim @@ -26,7 +26,7 @@ macro importImpl_forward(name, returns): stmt {.immediate.} = p2.add newIdentNode("errors") p2.add newNimNode(nnkVarTy) p2.add newNimNode(nnkEmpty) - p2[1].add newNimNOde(nnkBracketExpr) + p2[1].add newNimNode(nnkBracketExpr) p2[1][0].add newIdentNode("seq") p2[1][0].add newIdentNode("string") res[3].add p2 diff --git a/tests/reject/twrongiter.nim b/tests/reject/twrongiter.nim index 2d2502a6a9..33394219ba 100644 --- a/tests/reject/twrongiter.nim +++ b/tests/reject/twrongiter.nim @@ -1,5 +1,5 @@ discard """ -line: 14 +line: 12 errormsg: "type mismatch" """ From f095e51275a2780ac3e69509c3bb0b75c1c324fb Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 13 Dec 2013 21:29:35 +0100 Subject: [PATCH 100/326] more tests work --- compiler/vm.nim | 5 ++--- compiler/vmdef.nim | 2 +- compiler/vmgen.nim | 8 +++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/compiler/vm.nim b/compiler/vm.nim index ef83860f75..80b8abb8b0 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -802,9 +802,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = decodeB(nkIntLit) regs[ra].intVal = ord(regs[rb].skipMeta.kind == nkNilLit) of opcNBindSym: - # trivial implementation: - decodeB(nkMetaNode) - setMeta(regs[ra], regs[rb].skipMeta.sons[1]) + decodeBx(nkMetaNode) + setMeta(regs[ra], copyTree(c.constants.sons[rbx])) of opcNChild: decodeBC(nkMetaNode) if regs[rb].kind != nkMetaNode: diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index b2b900f66c..b4b7877987 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -101,7 +101,6 @@ type opcRaise, opcNChild, opcNSetChild, - opcNBindSym, # opcodes for the AST manipulation following opcCallSite, opcNewStr, @@ -120,6 +119,7 @@ type opcAsgnConst, # dest = copy(constants[Bx]) opcLdGlobal, # dest = globals[Bx] opcLdImmInt, # dest = immediate value + opcNBindSym, opcWrGlobal, opcWrGlobalRef, opcGlobalAlias, # load an alias to a global into a register diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 654738ce49..c53d39985b 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -781,7 +781,13 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = of mNNewNimNode: genBinaryABC(c, n, dest, opcNNewNimNode) of mNCopyNimNode: genUnaryABC(c, n, dest, opcNCopyNimNode) of mNCopyNimTree: genUnaryABC(c, n, dest, opcNCopyNimTree) - of mNBindSym: genUnaryABC(c, n, dest, opcNBindSym) + of mNBindSym: + if n[1].kind in {nkClosedSymChoice, nkOpenSymChoice, nkSym}: + let idx = c.genLiteral(n[1]) + if dest < 0: dest = c.getTemp(n.typ) + c.gABx(n, opcNBindSym, dest, idx) + else: + internalError(n.info, "invalid bindSym usage") of mStrToIdent: genUnaryABC(c, n, dest, opcStrToIdent) of mIdentToStr: genUnaryABC(c, n, dest, opcIdentToStr) of mEqIdent: genBinaryABC(c, n, dest, opcEqIdent) From 2434324a0c43bd557fbb60716f3549077847f0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Sun, 15 Dec 2013 15:52:01 +0100 Subject: [PATCH 101/326] Expand gitignore to include all binaries built by ./koch test. --- .gitignore | 395 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 392 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d67d9f2cf6..2fc6db6678 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,7 @@ examples/cross_calculator/android/tags /examples/cairoex /examples/cgiex /examples/curlex +/examples/debugging /examples/docstrings /examples/filterex /examples/fizzbuzz @@ -89,6 +90,12 @@ examples/cross_calculator/android/tags /examples/pythonex /examples/sdlex /examples/statcsv +/examples/talk/dsl +/examples/talk/formatoptimizer +/examples/talk/hoisting +/examples/talk/lazyeval +/examples/talk/quasiquote +/examples/talk/tags /examples/tclex /examples/transff /examples/tunit @@ -96,10 +103,13 @@ examples/cross_calculator/android/tags /examples/x11ex /lib/libnimrtl.dylib /lib/libserver.dylib +/lib/packages/docutils/highlite /lib/pure/actors /lib/pure/algorithm /lib/pure/asyncio /lib/pure/base64 +/lib/pure/basic2d +/lib/pure/basic3d /lib/pure/browsers /lib/pure/cgi /lib/pure/collections/sequtils @@ -111,6 +121,7 @@ examples/cross_calculator/android/tags /lib/pure/encodings /lib/pure/endians /lib/pure/events +/lib/pure/fsmonitor /lib/pure/ftpclient /lib/pure/gentabs /lib/pure/hashes @@ -127,19 +138,23 @@ examples/cross_calculator/android/tags /lib/pure/math /lib/pure/md5 /lib/pure/memfiles +/lib/pure/mersenne /lib/pure/mimetypes /lib/pure/nimprof +/lib/pure/numeric /lib/pure/oids /lib/pure/os /lib/pure/osproc /lib/pure/parsecfg /lib/pure/parsecsv /lib/pure/parseopt +/lib/pure/parseopt2 /lib/pure/parsesql /lib/pure/parseurl /lib/pure/parseutils /lib/pure/parsexml /lib/pure/pegs +/lib/pure/poly /lib/pure/redis /lib/pure/romans /lib/pure/ropes @@ -167,9 +182,9 @@ examples/cross_calculator/android/tags /run.json /testresults.html /testresults.json -/tests/caas/SymbolProcRun.*/ /tests/caas/absurd_nesting /tests/caas/completion_dot_syntax_main +/tests/caasdriver /tests/caas/forward_declarations /tests/caas/idetools_api /tests/caas/imported @@ -178,6 +193,380 @@ examples/cross_calculator/android/tags /tests/caas/issue_477_dynamic_dispatch /tests/caas/its_full_of_procs /tests/caas/main -/tests/caasdriver -/tools/nimgrep +/tests/caas/SymbolProcRun.*/ +/tests/ccg/tmissingbracket +/tests/compile/talias +/tests/compile/tambsym2 +/tests/compile/tarrindx +/tests/compile/tassign +/tests/compile/tbindoverload +/tests/compile/tcan_alias_generic +/tests/compile/tcan_alias_specialised_generic +/tests/compile/tcan_inherit_generic +/tests/compile/tcan_specialise_generic +/tests/compile/tccgen1 +/tests/compile/tclosure4 +/tests/compile/tclosurebug2 +/tests/compile/tcmdline +/tests/compile/tcodegenbug1 +/tests/compile/tcolonisproc +/tests/compile/tcolors +/tests/compile/tcommontype +/tests/compile/tcompiles +/tests/compile/tcomputedgoto +/tests/compile/tconsteval +/tests/compile/tconstraints +/tests/compile/tconvcolors +/tests/compile/tcputime +/tests/compile/tdefaultprocparam +/tests/compile/tdictdestruct +/tests/compile/tdiscardable +/tests/compile/tdllvar +/tests/compile/tdumpast +/tests/compile/tdumpast2 +/tests/compile/techo +/tests/compile/teffects1 +/tests/compile/temptyecho +/tests/compile/tendian +/tests/compile/tenum +/tests/compile/tenum2 +/tests/compile/tenum3 +/tests/compile/teval1 +/tests/compile/texport +/tests/compile/tfib +/tests/compile/tforwardgeneric +/tests/compile/tforwty +/tests/compile/tforwty2 +/tests/compile/tgeneric +/tests/compile/tgeneric2 +/tests/compile/tgeneric3 +/tests/compile/tgeneric4 +/tests/compile/tgenericmatcher +/tests/compile/tgenericmatcher2 +/tests/compile/tgenericprocvar +/tests/compile/tgenericprop +/tests/compile/tgenericrefs +/tests/compile/tgenerictmpl +/tests/compile/tgenericvariant +/tests/compile/tgensymgeneric +/tests/compile/tgetstartmilsecs +/tests/compile/tglobalforvar +/tests/compile/thallo +/tests/compile/theaproots +/tests/compile/thexrange +/tests/compile/thygienictempl +/tests/compile/tident +/tests/compile/timplicititems +/tests/compile/timplictderef +/tests/compile/tinheritref +/tests/compile/tio +/tests/compile/tircbot +/tests/compile/titer +/tests/compile/titer2 +/tests/compile/titer_no_tuple_unpack +/tests/compile/titerovl +/tests/compile/tlastmod +/tests/compile/tlinearscanend +/tests/compile/tloops +/tests/compile/tmacro1 +/tests/compile/tmacro2 +/tests/compile/tmacroaspragma +/tests/compile/tmacrostmt +/tests/compile/tmandelbrot +/tests/compile/tmarshal +/tests/compile/tmath +/tests/compile/tmatrix1 +/tests/compile/tmatrix2 +/tests/compile/tmongo +/tests/compile/tnamedparamanonproc +/tests/compile/tnamedparams +/tests/compile/tnestedproc +/tests/compile/tnew +/tests/compile/tnewsets +/tests/compile/tnewuns +/tests/compile/tnoargopenarray +/tests/compile/tnoforward +/tests/compile/tobjconstr2 +/tests/compile/tobjcov +/tests/compile/tobject2 +/tests/compile/tobject3 +/tests/compile/tobjects +/tests/compile/toop +/tests/compile/toptions +/tests/compile/tos +/tests/compile/toverprc +/tests/compile/tparedef +/tests/compile/tparscfg +/tests/compile/tparsefloat +/tests/compile/tparsopt +/tests/compile/tposix +/tests/compile/tprep +/tests/compile/tprocvars +/tests/compile/tpush +/tests/compile/tquicksort +/tests/compile/tquit +/tests/compile/tradix +/tests/compile/treadln +/tests/compile/treadx +/tests/compile/trecmod +/tests/compile/trecmod2 +/tests/compile/trectuple +/tests/compile/trectuples +/tests/compile/tredef +/tests/compile/trepr +/tests/compile/tsecondarrayproperty +/tests/compile/tseq2 +/tests/compile/tseqcon2 +/tests/compile/tshadow_magic_type +/tests/compile/tsizeof +/tests/compile/tslurp +/tests/compile/tsockets +/tests/compile/tsortcall +/tests/compile/tspecialised_is_equivalent +/tests/compile/tstrace +/tests/compile/tstrdesc +/tests/compile/tstrdist +/tests/compile/tstreams +/tests/compile/tstrset +/tests/compile/tstrtabs +/tests/compile/ttableconstr +/tests/compile/ttempl +/tests/compile/ttempl3 +/tests/compile/ttempl4 +/tests/compile/ttempl5 +/tests/compile/ttemplreturntype +/tests/compile/tthread_generic +/tests/compile/ttime +/tests/compile/ttuple1 +/tests/compile/ttypeclasses +/tests/compile/ttypeconverter1 +/tests/compile/tuserpragma +/tests/compile/tvoid +/tests/compile/twalker +/tests/compile/typalias +/tests/dll/client +/tests/gc/closureleak +/tests/gc/cycleleak +/tests/gc/gcbench +/tests/gc/gcleak +/tests/gc/gcleak2 +/tests/gc/gcleak3 +/tests/gc/gctest +/tests/gc/weakrefs +/tests/manyloc/argument_parser/ex_wget +/tests/manyloc/nake/nakefile +/tests/manyloc/packages/noconflicts +/tests/manyloc/standalone/barebone +/tests/patterns/targlist +/tests/patterns/tcse +/tests/patterns/thoist +/tests/patterns/tmatrix +/tests/patterns/tnoalias +/tests/patterns/tnoendlessrec +/tests/patterns/tor +/tests/patterns/tpartial +/tests/patterns/tstar +/tests/patterns/tstmtlist +/tests/reject/t99bott +/tests/reject/tcheckedfield1 +/tests/reject/tdeprecated +/tests/reject/tdisallowif +/tests/reject/tuninit1 +/tests/rodfiles/aconv +/tests/rodfiles/bconv +/tests/rodfiles/bmethods +/tests/rodfiles/bmethods2 +/tests/rodfiles/deada +/tests/rodfiles/deada2 +/tests/rodfiles/hallo +/tests/rodfiles/hallo2 +/tests/rodfiles/tgeneric1 +/tests/rodfiles/tgeneric2 +/tests/run/tack +/tests/run/tactiontable +/tests/run/tambsym2 +/tests/run/tambsys +/tests/run/tanontuples +/tests/run/tarray +/tests/run/tarray2 +/tests/run/tarray3 +/tests/run/tarraycons +/tests/run/tassert +/tests/run/tastoverload1 +/tests/run/tasynciossl +/tests/run/tasyncudp +/tests/run/tbind1 +/tests/run/tbind3 +/tests/run/tbintre2 +/tests/run/tbintree +/tests/run/tborrow +/tests/run/tbug499771 +/tests/run/tbug511622 +/tests/run/tcase_setconstr +/tests/run/tcasestm +/tests/run/tcgbug +/tests/run/tclosure2 +/tests/run/tclosure3 +/tests/run/tcnstseq +/tests/run/tcnstseq2 +/tests/run/tcnstseq3 +/tests/run/tconcat +/tests/run/tconstr2 +/tests/run/tcontinue +/tests/run/tcontinuexc +/tests/run/tcopy +/tests/run/tcountup +/tests/run/tcritbits +/tests/run/tcurrncy +/tests/run/tdestructor +/tests/run/tdrdobbs_examples +/tests/run/temit +/tests/run/tenumhole +/tests/run/tenumitems +/tests/run/teventemitter +/tests/run/tevents +/tests/run/texceptions +/tests/run/texcpt1 +/tests/run/texcsub +/tests/run/texplicitgeneric1 +/tests/run/tfieldindex +/tests/run/tfielditerator +/tests/run/tfielditerator2 +/tests/run/tfilter +/tests/run/tfinally +/tests/run/tfinally2 +/tests/run/tfinally3 +/tests/run/tfinalobj +/tests/run/tfloat1 +/tests/run/tfloat2 +/tests/run/tfloat3 +/tests/run/tformat +/tests/run/tfriends +/tests/run/tgenericassign +/tests/run/tgenericassigntuples +/tests/run/tgenericconverter +/tests/run/tgenericprocvar +/tests/run/tgenerics1 +/tests/run/tgensym +/tests/run/tglobal +/tests/run/thashes +/tests/run/thexlit +/tests/run/thintoff +/tests/run/tidgen +/tests/run/tindent1 +/tests/run/tinit +/tests/run/tinterf +/tests/run/tints +/tests/run/tisopr +/tests/run/titer3 +/tests/run/titer5 +/tests/run/titer6 +/tests/run/titer7 +/tests/run/titer8 +/tests/run/titer9 +/tests/run/titerslice +/tests/run/titervaropenarray +/tests/run/tkoeniglookup +/tests/run/tlet +/tests/run/tlists +/tests/run/tlocals +/tests/run/tlowhigh +/tests/run/tmacro2 +/tests/run/tmacro3 +/tests/run/tmacro4 +/tests/run/tmacros1 +/tests/run/tmath +/tests/run/tmatrix +/tests/run/tmemoization +/tests/run/tmethods1 +/tests/run/tmixin +/tests/run/tmoditer +/tests/run/tmultim1 +/tests/run/tmultim2 +/tests/run/tmultim3 +/tests/run/tmultim4 +/tests/run/tmultim6 +/tests/run/tnamedenumfields +/tests/run/tnestif +/tests/run/tnestprc +/tests/run/tnewderef +/tests/run/tnodeadlocks +/tests/run/tobjasgn +/tests/run/tobjconstr +/tests/run/tobject +/tests/run/tofopr +/tests/run/tonraise +/tests/run/toop1 +/tests/run/topenarrayrepr +/tests/run/topenlen +/tests/run/toprprec +/tests/run/toverflw +/tests/run/toverflw2 +/tests/run/toverl2 +/tests/run/toverl3 +/tests/run/toverwr +/tests/run/tovfint +/tests/run/tpatterns +/tests/run/tpegs +/tests/run/tpos +/tests/run/tprecedence +/tests/run/tprintf +/tests/run/tprocvar +/tests/run/tquotewords +/tests/run/tregex +/tests/run/treguse +/tests/run/trepr +/tests/run/treraise +/tests/run/tromans +/tests/run/tseqcon +/tests/run/tseqtuple +/tests/run/tsequtils +/tests/run/tsets +/tests/run/tsets2 +/tests/run/tsidee2 +/tests/run/tsidee3 +/tests/run/tsimmeth +/tests/run/tsimplesort +/tests/run/tslices +/tests/run/tsortdev +/tests/run/tsplit +/tests/run/tstempl +/tests/run/tstmtexprs +/tests/run/tstrange +/tests/run/tstringinterp +/tests/run/tstrlits +/tests/run/tstrutil +/tests/run/tsubrange +/tests/run/tsubrange2 +/tests/run/ttables +/tests/run/ttables2 +/tests/run/ttoseq +/tests/run/ttypedesc1 +/tests/run/tunhandledexc +/tests/run/tunidecode +/tests/run/tunittests +/tests/run/tuserassert +/tests/run/tvarargs_vs_generic +/tests/run/tvardecl +/tests/run/tvariantasgn +/tests/run/tvariantstack +/tests/run/tvarious1 +/tests/run/tvarnums +/tests/run/tvarres1 +/tests/run/tvarres2 +/tests/run/tvartup +/tests/run/tvtable +/tests/run/twrongexc +/tests/run/txmlgen +/tests/run/txmltree +/tests/run/tzeroarray +/tests/system/helpers/readall_echo +/tests/system/io /tests/system/params +/tests/tester +/tests/threads/tactors +/tests/threads/tactors2 +/tests/threads/tthreadanalysis2 +/tests/threads/tthreadanalysis3 +/tests/threads/tthreadheapviolation1 +/tools/nimgrep From 78a48b942a6333d2844c35ec89fb108cb2931845 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 15 Dec 2013 22:57:29 +0100 Subject: [PATCH 102/326] Adds fitting quote to idetools doc. --- doc/idetools.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/idetools.txt b/doc/idetools.txt index fdc4ebde67..7e51669f27 100644 --- a/doc/idetools.txt +++ b/doc/idetools.txt @@ -8,6 +8,11 @@ .. contents:: +.. raw:: html +

+ "yes, I'm the creator" -- Araq, 2013-07-26 19:28:32. +

+ Nimrod differs from many other compilers in that it is really fast, and being so fast makes it suited to provide external queries for text editors about the source code being written. Through the From 132b6b3efee8d1be7f94545ed5fefaf64de741dc Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 16 Dec 2013 22:26:17 +0100 Subject: [PATCH 103/326] implemented 'injectStmt'; more debug support --- compiler/ccgcalls.nim | 2 ++ compiler/ccgstmts.nim | 7 ++++++- compiler/cgen.nim | 3 +++ compiler/cgendata.nim | 1 + compiler/pragmas.nim | 8 +++++++- compiler/semthreads.nim | 3 ++- compiler/wordrecg.nim | 5 +++-- doc/manual.txt | 12 ++++++++++++ doc/nimrodc.txt | 13 +++++++++++++ lib/system/alloc.nim | 2 +- lib/system/gc.nim | 13 ++++++++----- lib/system/mmdisp.nim | 3 ++- 12 files changed, 60 insertions(+), 12 deletions(-) diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index 1d6df3c15a..07fba95a3d 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -290,6 +290,7 @@ proc genCall(p: BProc, e: PNode, d: var TLoc) = genNamedParamCall(p, e, d) else: genPrefixCall(p, nil, e, d) + postStmtActions(p) when false: if d.s == onStack and containsGarbageCollectedRef(d.t): keepAlive(p, d) @@ -303,6 +304,7 @@ proc genAsgnCall(p: BProc, le, ri: PNode, d: var TLoc) = genNamedParamCall(p, ri, d) else: genPrefixCall(p, le, ri, d) + postStmtActions(p) when false: if d.s == onStack and containsGarbageCollectedRef(d.t): keepAlive(p, d) diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 75cabf4143..ac4bbb79fc 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -906,7 +906,12 @@ proc genPragma(p: BProc, n: PNode) = of wEmit: genEmit(p, it) of wBreakpoint: genBreakPoint(p, it) of wWatchpoint: genWatchpoint(p, it) - else: nil + of wInjectStmt: + var p = newProc(nil, p.module) + p.options = p.options - {optLineTrace, optStackTrace} + genStmts(p, it.sons[1]) + p.module.injectStmt = p.s(cpsStmts) + else: discard proc FieldDiscriminantCheckNeeded(p: BProc, asgn: PNode): bool = if optFieldCheck in p.options: diff --git a/compiler/cgen.nim b/compiler/cgen.nim index b0c90de766..c143a5d6a5 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -289,6 +289,9 @@ proc genLineDir(p: BProc, t: PNode) = linefmt(p, cpsStmts, "nimln($1, $2);$n", line.toRope, t.info.quotedFilename) +proc postStmtActions(p: BProc) {.inline.} = + app(p.s(cpsStmts), p.module.injectStmt) + proc accessThreadLocalVar(p: BProc, s: PSym) proc emulatedThreadVars(): bool {.inline.} diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index c156c40fe5..a803c0ba1e 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -111,6 +111,7 @@ type labels*: natural # for generating unique module-scope names extensionLoaders*: array['0'..'9', PRope] # special procs for the # OpenGL wrapper + injectStmt*: PRope var mainModProcs*, mainModInit*, mainDatInit*: PRope # parts of the main module diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 8c2425de3c..6f1e7af25e 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -43,7 +43,8 @@ const wFatal, wDefine, wUndef, wCompile, wLink, wLinkSys, wPure, wPush, wPop, wBreakpoint, wWatchpoint, wPassL, wPassC, wDeadCodeElim, wDeprecated, wFloatChecks, wInfChecks, wNanChecks, wPragma, wEmit, wUnroll, - wLinearScanEnd, wPatterns, wEffects, wNoForward, wComputedGoto} + wLinearScanEnd, wPatterns, wEffects, wNoForward, wComputedGoto, + wInjectStmt} lambdaPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl, wNosideEffect, wSideEffect, wNoreturn, wDynLib, wHeader, wDeprecated, wExtern, wThread, wImportcpp, wImportobjc, wNoStackFrame, @@ -722,6 +723,11 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wOperator: if sym == nil: invalidPragma(it) else: sym.position = expectIntLit(c, it) + of wInjectStmt: + if it.kind != nkExprColonExpr: + localError(it.info, errExprExpected) + else: + it.sons[1] = c.semExpr(c, it.sons[1]) else: invalidPragma(it) else: invalidPragma(it) else: processNote(c, it) diff --git a/compiler/semthreads.nim b/compiler/semthreads.nim index 595ab0454d..eded993254 100644 --- a/compiler/semthreads.nim +++ b/compiler/semthreads.nim @@ -380,7 +380,8 @@ proc analyseThreadProc*(prc: PSym) = var formals = skipTypes(prc.typ, abstractInst).n for i in 1 .. formals.len-1: var formal = formals.sons[i].sym - c.mapping[formal.id] = toTheirs # thread receives foreign data! + # the input is copied and belongs to the thread: + c.mapping[formal.id] = toMine discard analyse(c, prc.getBody) proc needsGlobalAnalysis*: bool = diff --git a/compiler/wordrecg.nim b/compiler/wordrecg.nim index b37a7bb4f9..39b19646e8 100644 --- a/compiler/wordrecg.nim +++ b/compiler/wordrecg.nim @@ -60,7 +60,7 @@ type wPassc, wPassl, wBorrow, wDiscardable, wFieldChecks, wWatchPoint, wSubsChar, - wAcyclic, wShallow, wUnroll, wLinearScanEnd, wComputedGoto, + wAcyclic, wShallow, wUnroll, wLinearScanEnd, wComputedGoto, wInjectStmt, wWrite, wGensym, wInject, wDirty, wInheritable, wThreadVar, wEmit, wNoStackFrame, wImplicitStatic, wGlobal, wCodegenDecl, @@ -142,7 +142,8 @@ const "compiletime", "noinit", "passc", "passl", "borrow", "discardable", "fieldchecks", "watchpoint", - "subschar", "acyclic", "shallow", "unroll", "linearscanend", "computedgoto", + "subschar", "acyclic", "shallow", "unroll", "linearscanend", + "computedgoto", "injectstmt", "write", "gensym", "inject", "dirty", "inheritable", "threadvar", "emit", "nostackframe", "implicitstatic", "global", "codegendecl", diff --git a/doc/manual.txt b/doc/manual.txt index dabff3d69d..371f2b9bfc 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -5053,6 +5053,18 @@ Note that this pragma is somewhat of a misnomer: Other backends will provide the same feature under the same name. +Extern pragma +------------- +Like ``exportc`` or ``importc`` the `extern`:idx: pragma affects name +mangling. The string literal passed to ``extern`` can be a format string: + +.. code-block:: Nimrod + proc p(s: string) {.extern: "prefix$1".} = + echo s + +In the example the external name of ``p`` is set to ``prefixp``. + + Bycopy pragma ------------- diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt index d494a0922f..f5fbf3ebbe 100644 --- a/doc/nimrodc.txt +++ b/doc/nimrodc.txt @@ -468,6 +468,19 @@ proc is declared in the generated code: proc myinterrupt() {.codegenDecl: "__interrupt $# $#$#".} = echo "realistic interrupt handler" + + +InjectStmt pragma +----------------- + +The `injectStmt`:idx: pragma can be used to inject a statement before every +other statement in the current module. It is only supposed to be used for +debugging: + +.. code-block:: nimrod + {.injectStmt: gcInvariants().} + + # ... complex code here that produces crashes ... LineDir option diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 2bab792126..17258cf68a 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -760,7 +760,7 @@ proc getOccupiedMem(a: TMemRegion): int {.inline.} = # ---------------------- thread memory region ------------------------------- template InstantiateForRegion(allocator: expr) = - when false: + when defined(fulldebug): proc interiorAllocatedPtr*(p: pointer): pointer = result = interiorAllocatedPtr(allocator, p) diff --git a/lib/system/gc.nim b/lib/system/gc.nim index d2b065d6bd..68e8b423db 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -345,8 +345,9 @@ proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) = proc forAllChildren(cell: PCell, op: TWalkOp) = gcAssert(cell != nil, "forAllChildren: 1") - gcAssert(cell.typ != nil, "forAllChildren: 2") - gcAssert cell.typ.kind in {tyRef, tySequence, tyString}, "forAllChildren: 3" + gcAssert(isAllocatedPtr(gch.region, cell), "forAllChildren: 2") + gcAssert(cell.typ != nil, "forAllChildren: 3") + gcAssert cell.typ.kind in {tyRef, tySequence, tyString}, "forAllChildren: 4" let marker = cell.typ.marker if marker != nil: marker(cellToUsr(cell), op.int) @@ -361,7 +362,7 @@ proc forAllChildren(cell: PCell, op: TWalkOp) = for i in 0..s.len-1: forAllChildrenAux(cast[pointer](d +% i *% cell.typ.base.size +% GenericSeqSize), cell.typ.base, op) - else: nil + else: discard proc addNewObjToZCT(res: PCell, gch: var TGcHeap) {.inline.} = # we check the last 8 entries (cache line) for a slot that could be reused. @@ -408,8 +409,10 @@ proc addNewObjToZCT(res: PCell, gch: var TGcHeap) {.inline.} = add(gch.zct, res) {.push stackTrace: off, profiler:off.} -proc gcInvariant*(msg: string) = - sysAssert(allocInv(gch.region), msg) +proc gcInvariant*() = + sysAssert(allocInv(gch.region), "injected") + when defined(markForDebug): + markForDebug(gch) {.pop.} proc rawNewObj(typ: PNimType, size: int, gch: var TGcHeap): pointer = diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index 118272ee31..942b6778ed 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -18,7 +18,8 @@ const logGC = false traceGC = false # extensive debugging alwaysCycleGC = false - alwaysGC = false # collect after every memory allocation (for debugging) + alwaysGC = defined(fulldebug) # collect after every memory + # allocation (for debugging) leakDetector = false overwriteFree = false trackAllocationSource = leakDetector From db73f3af2027a68e7f9d311a8096c677b6ef4523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 17 Dec 2013 20:36:53 +0100 Subject: [PATCH 104/326] Add stdmsg (an alias to either stdout or stderr). --- lib/system.nim | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index dc5a406d14..3fccb4e8bb 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1947,15 +1947,13 @@ when not defined(JS): #and not defined(NimrodVM): ## The standard output stream. stderr* {.importc: "stderr", header: "".}: 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 separate *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``. + + when defined(useStdoutAsStdmsg): + template stdmsg*: TFile = stdout + else: + template stdmsg*: TFile = stderr + ## Template which expands to either stdout or stderr depending on + ## `useStdoutAsStdmsg` compile-time switch. proc Open*(f: var TFile, filename: string, mode: TFileMode = fmRead, bufSize: int = -1): Bool {.tags: [].} From 646458d328f7b4cdda518a1b2595962bea775309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Tue, 17 Dec 2013 20:42:02 +0100 Subject: [PATCH 105/326] write exception tracebacks to stdmsg, instead of stdout --- lib/system/excpt.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 7937d9738e..45ad42a606 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -18,7 +18,7 @@ template stackTraceNL: expr = (if IsNil(stackTraceNewLine): "\n" else: stackTraceNewLine) when not defined(windows) or not defined(guiapp): - proc writeToStdErr(msg: CString) = write(stdout, msg) + proc writeToStdErr(msg: CString) = write(stdmsg, msg) else: proc MessageBoxA(hWnd: cint, lpText, lpCaption: cstring, uType: int): int32 {. From ab2eb884a0d440796b0c712346a17bbe1ff54e94 Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Tue, 17 Dec 2013 18:03:08 -0500 Subject: [PATCH 106/326] Modified os.removeFile to act correctly when deleting a file that doesn't exist. --- lib/pure/os.nim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 71639d821c..ecab692cf0 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -972,15 +972,21 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", when not defined(ENOENT): var ENOENT {.importc, header: "".}: cint +when not defined(EACCES): + var EACCES {.importc, header: "".}: cint proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = ## Removes the `file`. If this fails, `EOS` is raised. This does not fail ## if the file never existed in the first place. ## On Windows, ignores the read-only attribute. - when defined(Windows): - setFilePermissions(file, {fpUserWrite}) if cremove(file) != 0'i32 and errno != ENOENT: - raise newException(EOS, $strerror(errno)) + when defined(Windows): + if errno == EACCES: # Turn this into a case stmt? + setFilePermissions(file, {fpUserWrite}) # Use lower level code? + if cremove(file) != 0'i32 and errno != ENOENT: + raise newException(EOS, $strerror(errno)) + else: + raise newException(EOS, $strerror(errno)) proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", tags: [FExecIO].} = From 3d869d4decb336c1396a0bfe4db24ea9dcda043e Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 18 Dec 2013 07:28:25 +0100 Subject: [PATCH 107/326] case expression with discardable result works --- compiler/vmgen.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index c53d39985b..134b2d15a9 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -206,6 +206,9 @@ proc genx(c: PCtx; n: PNode): TRegister = gen(c, n, tmp) result = TRegister(tmp) +proc clearDest(n: PNode; dest: var TDest) {.inline.} = + if isEmptyType(n.typ): dest = -1 + proc isNotOpr(n: PNode): bool = n.kind in nkCallKinds and n.sons[0].kind == nkSym and n.sons[0].sym.magic == mNot @@ -244,6 +247,7 @@ proc genWhile(c: PCtx; n: PNode) = proc genBlock(c: PCtx; n: PNode; dest: var TDest) = withBlock(n.sons[0].sym): c.gen(n.sons[1], dest) + clearDest(n, dest) proc genBreak(c: PCtx; n: PNode) = let L1 = c.xjmp(n, opcJmp) @@ -288,6 +292,7 @@ proc genIf(c: PCtx, n: PNode; dest: var TDest) = else: c.gen(it.sons[0], dest) for endPos in endings: c.patch(endPos) + clearDest(n, dest) proc genAndOr(c: PCtx; n: PNode; opc: TOpcode; dest: var TDest) = # asgn dest, a @@ -369,6 +374,7 @@ proc genCase(c: PCtx; n: PNode; dest: var TDest) = endings.add(c.xjmp(it.lastSon, opcJmp, 0)) c.patch(elsePos) for endPos in endings: c.patch(endPos) + clearDest(n, dest) proc genType(c: PCtx; typ: PType): int = for i, t in c.types: @@ -408,6 +414,7 @@ proc genTry(c: PCtx; n: PNode; dest: var TDest) = if fin.kind == nkFinally: c.gen(fin.sons[0], dest) c.gABx(fin, opcFinallyEnd, 0, 0) + clearDest(n, dest) proc genRaise(c: PCtx; n: PNode) = let dest = genx(c, n.sons[0]) @@ -435,6 +442,7 @@ proc genCall(c: PCtx; n: PNode; dest: var TDest) = else: c.gABC(n, opcIndCallAsgn, dest, x, n.len) c.freeTempRange(x, n.len) + clearDest(n, dest) proc genNew(c: PCtx; n: PNode) = let dest = c.genx(n.sons[1]) From 74a63c004fe188bc710d6867e451f894c70381be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Wed, 18 Dec 2013 18:15:39 +0100 Subject: [PATCH 108/326] Rework CGI error reporting. - remove 'undocumented' stackTraceNL - add 'undocumented' errorMessageWriter - make printing errors for browser optional (for security) --- lib/pure/cgi.nim | 36 +++++++++++++++++++++++++++--------- lib/system/excpt.nim | 42 ++++++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/lib/pure/cgi.nim b/lib/pure/cgi.nim index c499abdc09..29c686fd7f 100644 --- a/lib/pure/cgi.nim +++ b/lib/pure/cgi.nim @@ -342,16 +342,35 @@ proc writeContentType*() = ## ## .. code-block:: Nimrod ## write(stdout, "Content-type: text/html\n\n") - ## - ## It also modifies the debug stack traces so that they contain - ## ``
`` and are easily readable in a browser. write(stdout, "Content-type: text/html\n\n") - system.stackTraceNewLine = "
\n" -proc setStackTraceNewLine*() = - ## Modifies the debug stack traces so that they contain - ## ``
`` and are easily readable in a browser. - system.stackTraceNewLine = "
\n" +proc resetForStacktrace() = + stdout.write """ + --> --> + + +""" + +proc writeErrorMessage*(data: string) = + ## Tries to reset browser state and writes `data` to stdout in + ## tag. + resetForStacktrace() + # We use <plaintext> here, instead of escaping, so stacktrace can + # be understood by human looking at source. + stdout.write("<plaintext>\n") + stdout.write(data) + +proc setStackTraceStdout*() = + ## Makes Nimrod output stacktraces to stdout, instead of server log. + errorMessageWriter = writeErrorMessage + +proc setStackTraceNewLine*() {.deprecated.} = + ## Makes Nimrod output stacktraces to stdout, instead of server log. + ## Depracated alias for setStackTraceStdout. + setStackTraceStdout() proc setCookie*(name, value: string) = ## Sets a cookie. @@ -374,4 +393,3 @@ when isMainModule: const test1 = "abc\L+def xyz" assert UrlEncode(test1) == "abc%0A%2Bdef+xyz" assert UrlDecode(UrlEncode(test1)) == test1 - diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 45ad42a606..9b6a64fb05 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -11,11 +11,10 @@ # use the heap (and nor exceptions) do not include the GC or memory allocator. var - stackTraceNewLine*: string ## undocumented feature; it is replaced by ``<br>`` - ## for CGI applications - -template stackTraceNL: expr = - (if IsNil(stackTraceNewLine): "\n" else: stackTraceNewLine) + errorMessageWriter*: (proc(msg: string): void {.tags: [FWriteIO].}) + ## Function that will be called + ## instead of stdmsg.write when printing stacktrace. + ## Unstable API. when not defined(windows) or not defined(guiapp): proc writeToStdErr(msg: CString) = write(stdmsg, msg) @@ -27,6 +26,12 @@ else: proc writeToStdErr(msg: CString) = discard MessageBoxA(0, msg, nil, 0) +proc showErrorMessage(data: cstring) = + if errorMessageWriter != nil: + errorMessageWriter($data) + else: + writeToStdErr(data) + 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.} @@ -111,7 +116,7 @@ when defined(nativeStacktrace) and nativeStackTraceSupported: add(s, tempDlInfo.dli_sname) else: add(s, '?') - add(s, stackTraceNL) + add(s, "\n") else: if dlresult != 0 and tempDlInfo.dli_sname != nil and c_strcmp(tempDlInfo.dli_sname, "signalHandler") == 0'i32: @@ -172,21 +177,18 @@ proc auxWriteStackTrace(f: PFrame, s: var string) = add(s, ')') for k in 1..max(1, 25-(s.len-oldLen)): add(s, ' ') add(s, tempFrames[j].procname) - add(s, stackTraceNL) + add(s, "\n") when hasSomeStackTrace: proc rawWriteStackTrace(s: var string) = when nimrodStackTrace: if framePtr == nil: - add(s, "No stack traceback available") - add(s, stackTraceNL) + add(s, "No stack traceback available\n") else: - add(s, "Traceback (most recent call last)") - add(s, stackTraceNL) + add(s, "Traceback (most recent call last)\n") auxWriteStackTrace(framePtr, s) elif defined(nativeStackTrace) and nativeStackTraceSupported: - add(s, "Traceback from system (most recent call last)") - add(s, stackTraceNL) + add(s, "Traceback from system (most recent call last)\n") auxWriteStackTraceWithBacktrace(s) else: add(s, "No stack traceback available\n") @@ -207,7 +209,7 @@ proc raiseExceptionAux(e: ref E_Base) = pushCurrentException(e) c_longjmp(excHandler.context, 1) elif e[] of EOutOfMemory: - writeToStdErr(e.name) + showErrorMessage(e.name) quitOrDebug() else: when hasSomeStackTrace: @@ -219,7 +221,7 @@ proc raiseExceptionAux(e: ref E_Base) = add(buf, " [") add(buf, $e.name) add(buf, "]\n") - writeToStdErr(buf) + showErrorMessage(buf) else: # ugly, but avoids heap allocations :-) template xadd(buf, s, slen: expr) = @@ -235,7 +237,7 @@ proc raiseExceptionAux(e: ref E_Base) = add(buf, " [") xadd(buf, e.name, c_strlen(e.name)) add(buf, "]\n") - writeToStdErr(buf) + showErrorMessage(buf) quitOrDebug() proc raiseException(e: ref E_Base, ename: CString) {.compilerRtl.} = @@ -255,9 +257,9 @@ proc WriteStackTrace() = when hasSomeStackTrace: var s = "" rawWriteStackTrace(s) - writeToStdErr(s) + showErrorMessage(s) else: - writeToStdErr("No stack traceback available\n") + showErrorMessage("No stack traceback available\n") proc getStackTrace(): string = when hasSomeStackTrace: @@ -298,13 +300,13 @@ when not defined(noSignalHandler): var buf = newStringOfCap(2000) rawWriteStackTrace(buf) processSignal(sig, buf.add) # nice hu? currying a la nimrod :-) - writeToStdErr(buf) + showErrorMessage(buf) GC_enable() else: var msg: cstring template asgn(y: expr) = msg = y processSignal(sig, asgn) - writeToStdErr(msg) + showErrorMessage(msg) when defined(endb): dbgAborting = True quit(1) # always quit when SIGABRT From 101d8bc9c333546b970e670be116e45788a069d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= <michal@zielinscy.org.pl> Date: Wed, 18 Dec 2013 18:19:32 +0100 Subject: [PATCH 109/326] Add two CGI example and basic Python CGI server. --- .gitignore | 2 ++ examples/cgi/cgi_server.py | 11 +++++++++++ examples/cgi/cgi_stacktrace.nim | 5 +++++ examples/cgi/example.nim | 7 +++++++ 4 files changed, 25 insertions(+) create mode 100644 examples/cgi/cgi_server.py create mode 100644 examples/cgi/cgi_stacktrace.nim create mode 100644 examples/cgi/example.nim diff --git a/.gitignore b/.gitignore index d67d9f2cf6..f576baf17e 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,8 @@ examples/cross_calculator/android/tags /examples/allany /examples/cairoex /examples/cgiex +/examples/cgi/cgi_stacktrace +/examples/cgi/example /examples/curlex /examples/docstrings /examples/filterex diff --git a/examples/cgi/cgi_server.py b/examples/cgi/cgi_server.py new file mode 100644 index 0000000000..1907515e80 --- /dev/null +++ b/examples/cgi/cgi_server.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +import BaseHTTPServer +import CGIHTTPServer + +server = BaseHTTPServer.HTTPServer +handler = CGIHTTPServer.CGIHTTPRequestHandler +server_address = ('localhost', 8008) +handler.cgi_directories = ['/'] + +httpd = server(server_address, handler) +httpd.serve_forever() diff --git a/examples/cgi/cgi_stacktrace.nim b/examples/cgi/cgi_stacktrace.nim new file mode 100644 index 0000000000..e9f2f567c2 --- /dev/null +++ b/examples/cgi/cgi_stacktrace.nim @@ -0,0 +1,5 @@ +import cgi +cgi.setStackTraceStdout() + +var a: string = nil +a.add "foobar" diff --git a/examples/cgi/example.nim b/examples/cgi/example.nim new file mode 100644 index 0000000000..17629982ab --- /dev/null +++ b/examples/cgi/example.nim @@ -0,0 +1,7 @@ +import cgi + +write(stdout, "Content-type: text/html\n\n") +write(stdout, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n") +write(stdout, "<html><head><title>Test</title></head><body>\n") +write(stdout, "Hello!") +writeln(stdout, "</body></html>") From 7d5fa3f52d23c4f238c1664fc568eb7f3c6a34b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= <michal@zielinscy.org.pl> Date: Wed, 18 Dec 2013 18:21:55 +0100 Subject: [PATCH 110/326] add info about CGI error reporing changes to web/news.txt --- web/news.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/news.txt b/web/news.txt index 1b492fa971..3d1546fb75 100644 --- a/web/news.txt +++ b/web/news.txt @@ -29,7 +29,6 @@ Changes affecting backwards compatibility using the new ``OSLastError`` proc. - ``os.parentDir`` now returns "" if there is no parent dir. - Compiler Additions ------------------ @@ -41,7 +40,8 @@ Compiler Additions over the generated code. - The compiler now supports a ``computedGoto`` pragma to support very fast dispatching for interpreters and the like. - +- In CGI scripts stacktraces are shown user only if cgi.setStackTraceStdout + is used. Language Additions ------------------ From 543d6b3209b4f106e3ead63d5d88fda87db64de6 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Tue, 17 Dec 2013 12:23:02 +0100 Subject: [PATCH 111/326] Replaces PDoc with var TRstGenerator for documentation. The PDoc type is a convenience internal alias. Where procs are exported only documented types should be used to avoid confusing users. --- lib/packages/docutils/rstgen.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index 364f847ccf..b9637baa02 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -40,7 +40,7 @@ type filename*: string meta*: array[TMetaEnum, string] - PDoc = var TRstGenerator + PDoc = var TRstGenerator ## Alias to type less. proc initRstGenerator*(g: var TRstGenerator, target: TOutputTarget, config: PStringTable, filename: string, @@ -147,7 +147,7 @@ proc dispA(target: TOutputTarget, dest: var string, if target != outLatex: addf(dest, xml, args) else: addf(dest, tex, args) -proc renderRstToOut*(d: PDoc, n: PRstNode, result: var string) +proc renderRstToOut*(d: var TRstGenerator, n: PRstNode, result: var string) proc renderAux(d: PDoc, n: PRstNode, result: var string) = for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], result) @@ -162,7 +162,7 @@ proc renderAux(d: PDoc, n: PRstNode, frmtA, frmtB: string, result: var string) = # ---------------- index handling -------------------------------------------- -proc setIndexTerm*(d: PDoc, id, term: string) = +proc setIndexTerm*(d: var TRstGenerator, id, term: string) = d.theIndex.add(term) d.theIndex.add('\t') let htmlFile = changeFileExt(extractFilename(d.filename), HtmlExt) @@ -295,7 +295,7 @@ proc renderTocEntry(d: PDoc, e: TTocEntry, result: var string) = "<li><a class=\"reference\" id=\"$1_toc\" href=\"#$1\">$2</a></li>\n", "\\item\\label{$1_toc} $2\\ref{$1}\n", [e.refname, e.header]) -proc renderTocEntries*(d: PDoc, j: var int, lvl: int, result: var string) = +proc renderTocEntries*(d: var TRstGenerator, j: var int, lvl: int, result: var string) = var tmp = "" while j <= high(d.tocPart): var a = abs(d.tocPart[j].n.level) From f46336ae8bdddb7f3a6da4904aae18f99bc34f6f Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Wed, 18 Dec 2013 02:20:35 +0100 Subject: [PATCH 112/326] Adds missing ``code-block`` to macros' docstrings. --- lib/core/macros.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core/macros.nim b/lib/core/macros.nim index d01d4ebee4..5f0d60e5c5 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -268,6 +268,8 @@ proc quote*(bl: stmt, op = "``"): PNimrodNode {.magic: "QuoteAst".} ## ## Example: ## + ## .. code-block:: nimrod + ## ## macro check(ex: expr): stmt = ## # this is a simplified version of the check macro from the ## # unittest module. @@ -290,6 +292,8 @@ template emit*(e: expr[string]): stmt = ## that should be inserted verbatim in the program ## Example: ## + ## .. code-block:: nimrod + ## ## emit("echo " & '"' & "hello world".toUpper & '"') ## eval: result = e.parseStmt From e0d6a1cec18698652f1b6a4a55a749fbeb9689d1 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Wed, 18 Dec 2013 21:21:16 +0100 Subject: [PATCH 113/326] Adds some docstrings to rstgen. --- lib/packages/docutils/rstgen.nim | 91 ++++++++++++++++++++++++++++++-- 1 file changed, 87 insertions(+), 4 deletions(-) diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index b9637baa02..09c6ba8b8c 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -7,7 +7,18 @@ # distribution, for details about the copyright. # -## This module implements a generator of HTML/Latex from `reStructuredText`:idx:. +## This module implements a generator of HTML/Latex from +## `reStructuredText`:idx: (see http://docutils.sourceforge.net/rst.html for +## information on this markup syntax). You can generate HTML output through the +## convenience proc ``rstToHtml``, which provided an input string with rst +## markup returns a string with the generated HTML. The final output is meant +## to be embedded inside a full document you provide yourself, so it won't +## contain the usual ``<header>`` or ``<body>`` parts. +## +## You can also create a ``TRstGenerator`` structure and populate it with the +## other lower level methods to finally build complete documents. This requires +## many options and tweaking, but you are not limited to snippets and can +## generate `LaTeX documents <https://en.wikipedia.org/wiki/LaTeX>`_ too. import strutils, os, hashes, strtabs, rstast, rst, highlite @@ -47,6 +58,44 @@ proc initRstGenerator*(g: var TRstGenerator, target: TOutputTarget, options: TRstParseOptions, findFile: TFindFileHandler, msgHandler: TMsgHandler) = + ## Initializes a ``TRstGenerator``. + ## + ## You need to call this before using a ``TRstGenerator`` with any other + ## procs in this module. Pass a non ``nil`` ``PStringTable`` value as + ## ``config`` with parameters used by the HTML output generator. If you + ## don't know what to use, pass the results of the ``defaultConfig()`` proc. + ## The ``filename`` is symbolic and used only for error reporting, you can + ## pass any non ``nil`` string here. + ## + ## The ``TRstParseOptions``, ``TFindFileHandler`` and ``TMsgHandler`` types + ## are defined in the the `packages/docutils/rst module <rst.html>`_. + ## ``options`` selects the behaviour of the rst parser. + ## + ## ``findFile`` is a proc used by the rst ``include`` directive among others. + ## The purpose of this proc is to mangle or filter paths. It receives paths + ## specified in the rst document and has to return a valid path to existing + ## files or the empty string otherwise. If you pass ``nil``, a default proc + ## will be used which given a path returns the input path only if the file + ## exists. One use for this proc is to transform relative paths found in the + ## document to absolute path, useful if the rst file and the resources it + ## references are not in the same directory as the current working directory. + ## + ## The ``msgHandler`` is a proc used for user error reporting. It will be + ## called with the filename, line, col, and type of any error found during + ## parsing. If you pass ``nil``, a default message handler will be used which + ## writes the messages to the standard output. + ## + ## Example: + ## + ## .. code-block:: nimrod + ## + ## import packages/docutils/rstgen + ## + ## var gen: TRstGenerator + ## + ## gen.initRstGenerator(outHtml, defaultConfig(), + ## "filename", {}, nil, nil) + g.config = config g.target = target g.tocPart = @[] @@ -148,6 +197,18 @@ proc dispA(target: TOutputTarget, dest: var string, else: addf(dest, tex, args) proc renderRstToOut*(d: var TRstGenerator, n: PRstNode, result: var string) + ## Writes into ``result`` the rst ast ``n`` using the ``d`` configuration. + ## + ## Before using this proc you need to initialise a ``TRstGenerator`` with + ## ``initRstGenerator`` and parse a rst file with ``rstParse`` from the + ## `packages/docutils/rst module <rst.html>`_. Example: + ## + ## .. code-block:: nimrod + ## + ## # ...configure gen and rst vars... + ## var generatedHTML = "" + ## renderRstToOut(gen, rst, generatedHTML) + ## echo generatedHTML proc renderAux(d: PDoc, n: PRstNode, result: var string) = for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], result) @@ -678,8 +739,26 @@ $content proc rstToHtml*(s: string, options: TRstParseOptions, config: PStringTable): string = - ## exported for *nimforum*. - + ## Converts an input rst string into embeddable HTML. + ## + ## This convenience proc parses any input string using rst markup (it doesn't + ## have to be a full document!) and returns an embeddable piece of HTML. The + ## proc is meant to be used in *online* environments without access to a + ## meaningful filesystem, and therefore rst ``include`` like directives won't + ## work. For an explanation of the ``config`` parameter see the + ## ``initRstGenerator`` proc. Example: + ## + ## .. code-block:: nimrod + ## import packages/docutils/rstgen, strtabs + ## + ## echo rstToHtml("*Hello* **world**!", {}, + ## newStringTable(modeStyleInsensitive)) + ## # --> <em>Hello</em> <strong>world</strong>! + ## + ## If you need to allow the rst ``include`` directive or tweak the generated + ## output you have to create your own ``TRstGenerator`` with + ## ``initRstGenerator`` and related procs. + proc myFindFile(filename: string): string = # we don't find any files in online mode: result = "" @@ -692,4 +771,8 @@ proc rstToHtml*(s: string, options: TRstParseOptions, var rst = rstParse(s, filen, 0, 1, dummyHasToc, options) result = "" renderRstToOut(d, rst, result) - + + +when isMainModule: + echo rstToHtml("*Hello* **world**!", {}, + newStringTable(modeStyleInsensitive)) From 9f8db3ae542ab3dc8d18e5859b06bfa95b4e12ce Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Wed, 18 Dec 2013 21:25:49 +0100 Subject: [PATCH 114/326] Updates idetools docs after changes by #743. --- doc/idetools.txt | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/doc/idetools.txt b/doc/idetools.txt index fdc4ebde67..f2e690b0f8 100644 --- a/doc/idetools.txt +++ b/doc/idetools.txt @@ -522,21 +522,6 @@ At the moment idetools support is still in development so the test suite is not integrated with the main test suite and you have to run it manually. First you have to compile the tester:: - $ cd my/nimrod/checkout - $ nimrod c tests/tester.nim - -Running the tester without parameters will display some options. -To run the caas test suite (and other special tests) you need to -use the `special` command. You need to run this command from the -root of the checkout or it won't be able to open the required files:: - - $ ./tests/tester special - -However this is a roundabout way of running the test suite. You can -also compile and run ``tests/caasdriver.nim`` manually. In fact, -running it manually will allow you to specify special parameters -too. Example:: - $ cd my/nimrod/checkout/tests $ nimrod c caasdriver.nim From c26e787e5dab153b35470ea88f71dbf373de51f7 Mon Sep 17 00:00:00 2001 From: Clay Sweetser <clay.sweetser@gmail.com> Date: Wed, 18 Dec 2013 15:32:26 -0500 Subject: [PATCH 115/326] os.nim - Modify removeFile to use native Windows API calls --- lib/pure/os.nim | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index ecab692cf0..a366a7965a 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -972,8 +972,16 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", when not defined(ENOENT): var ENOENT {.importc, header: "<errno.h>".}: cint -when not defined(EACCES): - var EACCES {.importc, header: "<errno.h>".}: cint + +when defined(Windows): + when useWinUnicode: + template DeleteFile(file: expr): expr {.immediate.} = DeleteFileW(file) + template SetFileAttributes(file, attrs: expr): expr {.immediate.} = + SetFileAttributesW(file, attrs) + else: + template DeleteFile(file: expr): expr {.immediate.} = DeleteFileA(file) + template SetFileAttributes(file, attrs: expr): expr {.immediate.} = + SetFileAttributesA(file, attrs) proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = ## Removes the `file`. If this fails, `EOS` is raised. This does not fail @@ -981,11 +989,18 @@ proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = ## On Windows, ignores the read-only attribute. if cremove(file) != 0'i32 and errno != ENOENT: when defined(Windows): - if errno == EACCES: # Turn this into a case stmt? - setFilePermissions(file, {fpUserWrite}) # Use lower level code? - if cremove(file) != 0'i32 and errno != ENOENT: - raise newException(EOS, $strerror(errno)) + when useWinUnicode: + let f = newWideCString(file) else: + let f = file + if DeleteFile(f) == 0: + if GetLastError() == ERROR_ACCESS_DENIED: + if SetFileAttributes(f, FILE_ATTRIBUTE_NORMAL) == 0: + OSError(OSLastError()) + if DeleteFile(f) == 0: + OSError(OSLastError()) + else: + if cremove(file) != 0'i32 and errno != ENOENT: raise newException(EOS, $strerror(errno)) proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", From 9de92522a6418b3460cea786dc363177288e02e1 Mon Sep 17 00:00:00 2001 From: Clay Sweetser <clay.sweetser@gmail.com> Date: Wed, 18 Dec 2013 16:04:43 -0500 Subject: [PATCH 116/326] Further fixes (stupid kdiff automerge) --- lib/pure/os.nim | 5 ++--- lib/windows/winlean.nim | 30 +++++++++++++++++++----------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index a366a7965a..d74cb1fb94 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -970,7 +970,7 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", if crename(source, dest) != 0'i32: raise newException(EOS, $strerror(errno)) -when not defined(ENOENT): +when not defined(ENOENT) and not defined(Windows): var ENOENT {.importc, header: "<errno.h>".}: cint when defined(Windows): @@ -987,8 +987,7 @@ proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = ## Removes the `file`. If this fails, `EOS` is raised. This does not fail ## if the file never existed in the first place. ## On Windows, ignores the read-only attribute. - if cremove(file) != 0'i32 and errno != ENOENT: - when defined(Windows): + when defined(Windows): when useWinUnicode: let f = newWideCString(file) else: diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 56d279db6b..264285d095 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -416,17 +416,17 @@ var SOMAXCONN* {.importc, header: "Winsock2.h".}: cint INVALID_SOCKET* {.importc, header: "Winsock2.h".}: TSocketHandle SOL_SOCKET* {.importc, header: "Winsock2.h".}: cint - SO_DEBUG* {.importc, header: "Winsock2.h".}: cint ## turn on debugging info recording - SO_ACCEPTCONN* {.importc, header: "Winsock2.h".}: cint # socket has had listen() - SO_REUSEADDR* {.importc, header: "Winsock2.h".}: cint # allow local address reuse - SO_KEEPALIVE* {.importc, header: "Winsock2.h".}: cint # keep connections alive - SO_DONTROUTE* {.importc, header: "Winsock2.h".}: cint # just use interface addresses - SO_BROADCAST* {.importc, header: "Winsock2.h".}: cint # permit sending of broadcast msgs - SO_USELOOPBACK* {.importc, header: "Winsock2.h".}: cint # bypass hardware when possible - SO_LINGER* {.importc, header: "Winsock2.h".}: cint # linger on close if data present - SO_OOBINLINE* {.importc, header: "Winsock2.h".}: cint # leave received OOB data in line - - SO_DONTLINGER* {.importc, header: "Winsock2.h".}: cint + SO_DEBUG* {.importc, header: "Winsock2.h".}: cint ## turn on debugging info recording + SO_ACCEPTCONN* {.importc, header: "Winsock2.h".}: cint # socket has had listen() + SO_REUSEADDR* {.importc, header: "Winsock2.h".}: cint # allow local address reuse + SO_KEEPALIVE* {.importc, header: "Winsock2.h".}: cint # keep connections alive + SO_DONTROUTE* {.importc, header: "Winsock2.h".}: cint # just use interface addresses + SO_BROADCAST* {.importc, header: "Winsock2.h".}: cint # permit sending of broadcast msgs + SO_USELOOPBACK* {.importc, header: "Winsock2.h".}: cint # bypass hardware when possible + SO_LINGER* {.importc, header: "Winsock2.h".}: cint # linger on close if data present + SO_OOBINLINE* {.importc, header: "Winsock2.h".}: cint # leave received OOB data in line + + SO_DONTLINGER* {.importc, header: "Winsock2.h".}: cint SO_EXCLUSIVEADDRUSE* {.importc, header: "Winsock2.h".}: cint # disallow local address reuse proc `==`*(x, y: TSocketHandle): bool {.borrow.} @@ -553,18 +553,26 @@ const FILE_FLAG_BACKUP_SEMANTICS* = 33554432'i32 +# Error Constants +const + ERROR_ACCESS_DENIED* = 5 + when useWinUnicode: proc CreateFileW*(lpFileName: widecstring, dwDesiredAccess, dwShareMode: DWORD, lpSecurityAttributes: pointer, dwCreationDisposition, dwFlagsAndAttributes: DWORD, hTemplateFile: THANDLE): THANDLE {. stdcall, dynlib: "kernel32", importc: "CreateFileW".} + proc DeleteFileW*(pathName: widecstring): int32 {. + importc: "DeleteFileW", dynlib: "kernel32", stdcall.} else: proc CreateFileA*(lpFileName: cstring, dwDesiredAccess, dwShareMode: DWORD, lpSecurityAttributes: pointer, dwCreationDisposition, dwFlagsAndAttributes: DWORD, hTemplateFile: THANDLE): THANDLE {. stdcall, dynlib: "kernel32", importc: "CreateFileA".} + proc DeleteFileA*(pathName: cstring): int32 {. + importc: "DeleteFileA", dynlib: "kernel32", stdcall.} proc SetEndOfFile*(hFile: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", importc: "SetEndOfFile".} From 027f30610e44633b661befcca1b5dd39e9eaa283 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Thu, 19 Dec 2013 01:06:38 +0200 Subject: [PATCH 117/326] static params: expr[T] is now static[T] This introduces tyStatic and successfully bootstraps and handles few simple test cases. Static params within macros are no longer treated as PNimrodNodes - they are now equivalent to constants of the designated type. --- compiler/ast.nim | 8 +++-- compiler/ccgutils.nim | 2 +- compiler/cgen.nim | 4 +-- compiler/evalffi.nim | 2 +- compiler/evals.nim | 7 +++-- compiler/jsgen.nim | 2 +- compiler/parser.nim | 26 ++++++++++------ compiler/ropes.nim | 17 ++++++----- compiler/semexprs.nim | 9 +++--- compiler/semfold.nim | 2 +- compiler/seminst.nim | 8 ++--- compiler/semmagic.nim | 2 +- compiler/semtypes.nim | 38 ++++++++++++----------- compiler/semtypinst.nim | 4 +-- compiler/sigmatch.nim | 60 ++++++++++++++++++++----------------- compiler/types.nim | 13 ++++---- compiler/vmgen.nim | 6 ++-- lib/core/macros.nim | 20 +++++++------ lib/system.nim | 2 +- tests/run/tmemoization.nim | 2 +- tests/run/tstaticparams.nim | 10 +++---- todo.txt | 1 - 22 files changed, 135 insertions(+), 110 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 1e5276d68d..462bad24f0 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -192,6 +192,7 @@ type nkObjectTy, # object body nkTupleTy, # tuple body nkTypeClassTy, # user-defined type class + nkStaticTy, # ``static[T]`` nkRecList, # list of object parts nkRecCase, # case section of object nkRecWhen, # when section of object @@ -336,12 +337,13 @@ type tyIter, # unused tyProxy # used as errornous type (for idetools) tyTypeClass + tyParametricTypeClass # structured similarly to tyGenericInst + # lastSon is the body of the type class tyAnd tyOr tyNot tyAnything - tyParametricTypeClass # structured similarly to tyGenericInst - # lastSon is the body of the type class + tyStatic const tyPureObject* = tyTuple @@ -1232,7 +1234,7 @@ proc propagateToOwner*(owner, elem: PType) = if tfShared in elem.flags: owner.flags.incl tfHasShared - if elem.kind in {tyExpr, tyTypeDesc}: + if elem.kind in {tyExpr, tyStatic, tyTypeDesc}: owner.flags.incl tfHasMeta elif elem.kind in {tyString, tyRef, tySequence} or elem.kind == tyProc and elem.callConv == ccClosure: diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index 310f7204ae..01928b22c9 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -88,7 +88,7 @@ proc GetUniqueType*(key: PType): PType = result = key of tyTypeDesc, tyTypeClasses: InternalError("value expected, but got a type") - of tyGenericParam: + of tyGenericParam, tyStatic: InternalError("GetUniqueType") of tyGenericInst, tyDistinct, tyOrdinal, tyMutable, tyConst, tyIter: result = GetUniqueType(lastSon(key)) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index b0c90de766..c2bba76b96 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -194,7 +194,7 @@ when compileTimeRopeFmt: if i - 1 >= start: yield (kind: ffLit, value: substr(s, start, i-1), intValue: 0) - macro rfmt(m: BModule, fmt: expr[string], args: varargs[PRope]): expr = + macro rfmt(m: BModule, fmt: static[string], args: varargs[PRope]): expr = ## Experimental optimized rope-formatting operator ## The run-time code it produces will be very fast, but will it speed up ## the compilation of nimrod itself or will the macro execution time @@ -209,7 +209,7 @@ when compileTimeRopeFmt: of ffParam: result.add(args[frag.intValue]) else: - template rfmt(m: BModule, fmt: expr[string], args: varargs[PRope]): expr = + template rfmt(m: BModule, fmt: string, args: varargs[PRope]): expr = ropecg(m, fmt, args) proc appcg(m: BModule, c: var PRope, frmt: TFormatStr, diff --git a/compiler/evalffi.nim b/compiler/evalffi.nim index 21a131996a..848f706f2b 100644 --- a/compiler/evalffi.nim +++ b/compiler/evalffi.nim @@ -78,7 +78,7 @@ proc mapType(t: ast.PType): ptr libffi.TType = of tyFloat, tyFloat64: result = addr libffi.type_double of tyFloat32: result = addr libffi.type_float of tyVar, tyPointer, tyPtr, tyRef, tyCString, tySequence, tyString, tyExpr, - tyStmt, tyTypeDesc, tyProc, tyArray, tyArrayConstr, tyNil: + tyStmt, tyTypeDesc, tyProc, tyArray, tyArrayConstr, tyStatic, tyNil: result = addr libffi.type_pointer of tyDistinct: result = mapType(t.sons[0]) diff --git a/compiler/evals.nim b/compiler/evals.nim index b4ea973e89..4a2586d5f8 100644 --- a/compiler/evals.nim +++ b/compiler/evals.nim @@ -91,6 +91,7 @@ proc evalMacroCall*(c: PEvalContext, n, nOrig: PNode, sym: PSym): PNode proc evalAux(c: PEvalContext, n: PNode, flags: TEvalFlags): PNode proc raiseCannotEval(c: PEvalContext, info: TLineInfo): PNode = + if defined(debug): writeStackTrace() result = newNodeI(nkExceptBranch, info) # creating a nkExceptBranch without sons # means that it could not be evaluated @@ -263,8 +264,8 @@ proc getNullValue(typ: PType, info: TLineInfo): PNode = result = newNodeIT(nkUIntLit, info, t) of tyFloat..tyFloat128: result = newNodeIt(nkFloatLit, info, t) - of tyVar, tyPointer, tyPtr, tyRef, tyCString, tySequence, tyString, tyExpr, - tyStmt, tyTypeDesc, tyProc: + of tyVar, tyPointer, tyPtr, tyRef, tyCString, tySequence, tyString, tyExpr, + tyStmt, tyTypeDesc, tyStatic, tyProc: result = newNodeIT(nkNilLit, info, t) of tyObject: result = newNodeIT(nkPar, info, t) @@ -358,7 +359,7 @@ proc evalVar(c: PEvalContext, n: PNode): PNode = proc aliasNeeded(n: PNode, flags: TEvalFlags): bool = result = efLValue in flags or n.typ == nil or - n.typ.kind in {tyExpr, tyStmt, tyTypeDesc} + n.typ.kind in {tyExpr, tyStatic, tyStmt, tyTypeDesc} proc evalVariable(c: PStackFrame, sym: PSym, flags: TEvalFlags): PNode = # We need to return a node to the actual value, diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index a3c88824d0..9912115ee1 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -130,7 +130,7 @@ proc mapType(typ: PType): TJSTypeKind = result = etyObject of tyNil: result = etyNull of tyGenericInst, tyGenericParam, tyGenericBody, tyGenericInvokation, tyNone, - tyForward, tyEmpty, tyExpr, tyStmt, tyTypeDesc, tyTypeClasses: + tyForward, tyEmpty, tyExpr, tyStmt, tyStatic, tyTypeDesc, tyTypeClasses: result = etyNone of tyProc: result = etyProc of tyCString: result = etyString diff --git a/compiler/parser.nim b/compiler/parser.nim index fd51b04ecd..c8c14780d5 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -965,14 +965,18 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode = of tkTuple: result = parseTuple(p, mode == pmTypeDef) of tkProc: result = parseProcExpr(p, mode notin {pmTypeDesc, pmTypeDef}) of tkIterator: - if mode in {pmTypeDesc, pmTypeDef}: - result = parseProcExpr(p, false) - result.kind = nkIteratorTy + when true: + if mode in {pmTypeDesc, pmTypeDef}: + result = parseProcExpr(p, false) + result.kind = nkIteratorTy + else: + # no anon iterators for now: + parMessage(p, errExprExpected, p.tok) + getTok(p) # we must consume a token here to prevend endless loops! + result = ast.emptyNode else: - # no anon iterators for now: - parMessage(p, errExprExpected, p.tok) - getTok(p) # we must consume a token here to prevend endless loops! - result = ast.emptyNode + result = parseProcExpr(p, mode notin {pmTypeDesc, pmTypeDef}) + result.kind = nkIteratorTy of tkEnum: if mode == pmTypeDef: result = parseEnum(p) @@ -995,9 +999,13 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode = getTokNoInd(p) addSon(result, primary(p, pmNormal)) of tkStatic: - result = newNodeP(nkStaticExpr, p) + let info = parLineInfo(p) getTokNoInd(p) - addSon(result, primary(p, pmNormal)) + let next = primary(p, pmNormal) + if next.kind == nkBracket and next.sonsLen == 1: + result = newNode(nkStaticTy, info, @[next.sons[0]]) + else: + result = newNode(nkStaticExpr, info, @[next]) of tkBind: result = newNodeP(nkBind, p) getTok(p) diff --git a/compiler/ropes.nim b/compiler/ropes.nim index 707c291232..9a3647c0aa 100644 --- a/compiler/ropes.nim +++ b/compiler/ropes.nim @@ -282,13 +282,16 @@ proc ropef(frmt: TFormatStr, args: varargs[PRope]): PRope = app(result, substr(frmt, start, i - 1)) assert(RopeInvariant(result)) -{.push stack_trace: off, line_trace: off.} -proc `~`*(r: expr[string]): PRope = - # this is the new optimized "to rope" operator - # the mnemonic is that `~` looks a bit like a rope :) - var r {.global.} = r.ropef - return r -{.pop.} +when true: + template `~`*(r: string): PRope = r.ropef +else: + {.push stack_trace: off, line_trace: off.} + proc `~`*(r: static[string]): PRope = + # this is the new optimized "to rope" operator + # the mnemonic is that `~` looks a bit like a rope :) + var r {.global.} = r.ropef + return r + {.pop.} proc appf(c: var PRope, frmt: TFormatStr, args: varargs[PRope]) = app(c, ropef(frmt, args)) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index ccbb1e3673..a7fd1eaa08 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -102,7 +102,7 @@ proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = # if a proc accesses a global variable, it is not side effect free: if sfGlobal in s.flags: incl(c.p.owner.flags, sfSideEffect) - elif s.kind == skParam and s.typ.kind == tyExpr and s.typ.n != nil: + elif s.kind == skParam and s.typ.kind == tyStatic and s.typ.n != nil: # XXX see the hack in sigmatch.nim ... return s.typ.n result = newSymNode(s, n.info) @@ -111,7 +111,7 @@ proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = # var len = 0 # but won't be called # genericThatUsesLen(x) # marked as taking a closure? of skGenericParam: - if s.typ.kind == tyExpr: + if s.typ.kind == tyStatic: result = newSymNode(s, n.info) result.typ = s.typ elif s.ast != nil: @@ -668,6 +668,7 @@ proc semOverloadedCallAnalyseEffects(c: PContext, n: PNode, nOrig: PNode, else: result = semOverloadedCall(c, n, nOrig, {skProc, skMethod, skConverter, skMacro, skTemplate}) + if result != nil: if result.sons[0].kind != nkSym: InternalError("semOverloadedCallAnalyseEffects") @@ -937,7 +938,7 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = let tParam = tbody.sons[s] if tParam.sym.name == i: let rawTyp = ty.sons[s + 1] - if rawTyp.kind == tyExpr: + if rawTyp.kind == tyStatic: return rawTyp.n else: let foundTyp = makeTypeDesc(c, rawTyp) @@ -1882,7 +1883,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of nkBind: Message(n.info, warnDeprecated, "bind") result = semExpr(c, n.sons[0], flags) - of nkTypeOfExpr, nkTupleTy, nkRefTy..nkEnumTy: + of nkTypeOfExpr, nkTupleTy, nkRefTy..nkEnumTy, nkStaticTy: var typ = semTypeNode(c, n, nil).skipTypes({tyTypeDesc}) result.typ = makeTypeDesc(c, typ) #result = symNodeFromType(c, typ, n.info) diff --git a/compiler/semfold.nim b/compiler/semfold.nim index ca06ea1b66..ddbe3053c7 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -587,7 +587,7 @@ proc getConstExpr(m: PSym, n: PNode): PNode = of skType: result = newSymNodeTypeDesc(s, n.info) of skGenericParam: - if s.typ.kind == tyExpr: + if s.typ.kind == tyStatic: result = s.typ.n result.typ = s.typ.sons[0] else: diff --git a/compiler/seminst.nim b/compiler/seminst.nim index d7d64fd547..a76c673dad 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -20,7 +20,7 @@ proc instantiateGenericParamList(c: PContext, n: PNode, pt: TIdTable, if a.kind != nkSym: InternalError(a.info, "instantiateGenericParamList; no symbol") var q = a.sym - if q.typ.kind notin {tyTypeDesc, tyGenericParam, tyExpr}+tyTypeClasses: + if q.typ.kind notin {tyTypeDesc, tyGenericParam, tyStatic}+tyTypeClasses: continue var s = newSym(skType, q.name, getCurrOwner(), q.info) s.flags = s.flags + {sfUsed, sfFromGeneric} @@ -145,11 +145,11 @@ proc lateInstantiateGeneric(c: PContext, invocation: PType, info: TLineInfo): PT pushInfoContext(info) for i in 0 .. <s.typ.n.sons.len: let genericParam = s.typ.n[i].sym - let symKind = if genericParam.typ.kind == tyExpr: skConst + let symKind = if genericParam.typ.kind == tyStatic: skConst else: skType var boundSym = newSym(symKind, s.typ.n[i].sym.name, s, info) - boundSym.typ = invocation.sons[i+1].skipTypes({tyExpr}) + boundSym.typ = invocation.sons[i+1].skipTypes({tyStatic}) boundSym.ast = invocation.sons[i+1].n addDecl(c, boundSym) # XXX: copyTree would have been unnecessary here if semTypeNode @@ -200,7 +200,7 @@ proc fixupProcType(c: PContext, genericType: PType, result = inst.concreteTypes[genericType.sym.position] if tfUnresolved in genericType.flags: result = result.sons[0] - of tyExpr: + of tyStatic: result = inst.concreteTypes[genericType.sym.position] of tyOpenArray, tyArray, tySet, tySequence, tyTuple, tyProc, tyPtr, tyVar, tyRef, tyOrdinal, tyRange, tyVarargs: diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 88567b10a7..4c667e27e9 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -88,7 +88,7 @@ proc semLocals(c: PContext, n: PNode): PNode = #if it.owner != c.p.owner: return result if it.kind in skLocalVars and it.typ.skipTypes({tyGenericInst, tyVar}).kind notin - {tyVarargs, tyOpenArray, tyTypeDesc, tyExpr, tyStmt, tyEmpty}: + {tyVarargs, tyOpenArray, tyTypeDesc, tyStatic, tyExpr, tyStmt, tyEmpty}: var field = newSym(skField, it.name, getCurrOwner(), n.info) field.typ = it.typ.skipTypes({tyGenericInst, tyVar}) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 6c9c476d9b..d4d9537571 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -196,7 +196,7 @@ proc semArray(c: PContext, n: PNode, prev: PType): PType = let e = semExprWithType(c, n.sons[1], {efDetermineType}) if e.kind in {nkIntLit..nkUInt64Lit}: indx = makeRangeType(c, 0, e.intVal-1, n.info, e.typ) - elif e.kind == nkSym and e.typ.kind == tyExpr: + elif e.kind == nkSym and e.typ.kind == tyStatic: if e.sym.ast != nil: return semArray(c, e.sym.ast, nil) InternalAssert c.InGenericContext > 0 if not isOrdinalType(e.typ.lastSon): @@ -206,7 +206,7 @@ proc semArray(c: PContext, n: PNode, prev: PType): PType = indx = e.typ.skipTypes({tyTypeDesc}) addSonSkipIntLit(result, indx) if indx.kind == tyGenericInst: indx = lastSon(indx) - if indx.kind notin {tyGenericParam, tyExpr}: + if indx.kind notin {tyGenericParam, tyStatic}: if not isOrdinalType(indx): LocalError(n.sons[1].info, errOrdinalTypeExpected) elif enumHasHoles(indx): @@ -577,9 +577,9 @@ proc semObjectNode(c: PContext, n: PNode, prev: PType): PType = pragma(c, s, n.sons[0], typePragmas) if base == nil and tfInheritable notin result.flags: incl(result.flags, tfFinal) - + proc addParamOrResult(c: PContext, param: PSym, kind: TSymKind) = - if kind == skMacro and param.typ.kind != tyTypeDesc: + if kind == skMacro and param.typ.kind notin {tyTypeDesc, tyStatic}: # within a macro, every param has the type PNimrodNode! # and param.typ.kind in {tyTypeDesc, tyExpr, tyStmt}: let nn = getSysSym"PNimrodNode" @@ -629,15 +629,12 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, addImplicitGenericImpl(e, paramTypId) case paramType.kind: - of tyExpr: - if paramType.sonsLen == 0: - # proc(a, b: expr) - # no constraints, treat like generic param - result = addImplicitGeneric(newTypeS(tyGenericParam, c)) - else: - # proc(a: expr{string}, b: expr{nkLambda}) - # overload on compile time values and AST trees - result = addImplicitGeneric(c.newTypeWithSons(tyExpr, paramType.sons)) + of tyAnything: + result = addImplicitGeneric(newTypeS(tyGenericParam, c)) + of tyStatic: + # proc(a: expr{string}, b: expr{nkLambda}) + # overload on compile time values and AST trees + result = addImplicitGeneric(c.newTypeWithSons(tyStatic, paramType.sons)) of tyTypeDesc: if tfUnresolved notin paramType.flags: # naked typedescs are not bindOnce types @@ -743,8 +740,9 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode, if not containsGenericType(typ): def = fitNode(c, typ, def) if not (hasType or hasDefault): - typ = newTypeS(tyExpr, c) - + let tdef = if kind in {skTemplate, skMacro}: tyExpr else: tyAnything + typ = newTypeS(tdef, c) + if skipTypes(typ, {tyGenericInst}).kind == tyEmpty: continue for j in countup(0, length-3): var arg = newSymG(skParam, a.sons[j], c) @@ -1000,6 +998,10 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = of nkPtrTy: result = semAnyRef(c, n, tyPtr, prev) of nkVarTy: result = semVarType(c, n, prev) of nkDistinctTy: result = semDistinct(c, n, prev) + of nkStaticTy: + result = newOrPrevType(tyStatic, prev, c) + var base = semTypeNode(c, n.sons[0], nil) + result.rawAddSon(base) of nkProcTy, nkIteratorTy: if n.sonsLen == 0: result = newConstraint(c, tyProc) @@ -1105,7 +1107,7 @@ proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode = if constraint.kind != nkEmpty: typ = semTypeNode(c, constraint, nil) - if typ.kind != tyExpr or typ.len == 0: + if typ.kind != tyStatic or typ.len == 0: if typ.kind == tyTypeDesc: if typ.len == 0: typ = newTypeS(tyTypeDesc, c) @@ -1116,7 +1118,7 @@ proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode = def = semConstExpr(c, def) if typ == nil: if def.typ.kind != tyTypeDesc: - typ = newTypeWithSons(c, tyExpr, @[def.typ]) + typ = newTypeWithSons(c, tyStatic, @[def.typ]) else: if not containsGenericType(def.typ): def = fitNode(c, typ, def) @@ -1132,7 +1134,7 @@ proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode = # of the parameter will be stored in the # attached symbol. var s = case finalType.kind - of tyExpr: + of tyStatic: newSymG(skGenericParam, a.sons[j], c).linkTo(finalType) else: newSymG(skType, a.sons[j], c).linkTo(finalType) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 61c31a4fe4..d05d063aab 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -201,7 +201,7 @@ proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = result = lookupTypeVar(cl, t) if result.kind == tyGenericInvokation: result = handleGenericInvokation(cl, result) - of tyExpr: + of tyStatic: if t.sym != nil and t.sym.kind == skGenericParam: result = lookupTypeVar(cl, t) of tyGenericInvokation: @@ -215,7 +215,7 @@ proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = else: if t.kind == tyArray: let idxt = t.sons[0] - if idxt.kind == tyExpr and + if idxt.kind == tyStatic and idxt.sym != nil and idxt.sym.kind == skGenericParam: let value = lookupTypeVar(cl, idxt).n t.sons[0] = makeRangeType(cl.c, 0, value.intVal - 1, value.info) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index cacf4782e3..87f1decf48 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -124,7 +124,7 @@ proc sumGeneric(t: PType): int = result = ord(t.kind == tyGenericInvokation) for i in 0 .. <t.len: result += t.sons[i].sumGeneric break - of tyGenericParam, tyExpr, tyStmt, tyTypeDesc, tyTypeClass: break + of tyGenericParam, tyExpr, tyStatic, tyStmt, tyTypeDesc, tyTypeClass: break else: return 0 proc complexDisambiguation(a, b: PType): int = @@ -894,40 +894,39 @@ proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, arg = argSemantized let - a = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) - else: argType - fMaybeExpr = f.skipTypes({tyDistinct}) + a0 = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) + else: argType + a = if a0 != nil: a0.skipTypes({tyStatic}) else: a0 + fMaybeStatic = f.skipTypes({tyDistinct}) - case fMaybeExpr.kind - of tyExpr: - if fMaybeExpr.sonsLen == 0: - r = isGeneric + case fMaybeStatic.kind + of tyStatic: + if a.kind == tyStatic: + InternalAssert a.len > 0 + r = typeRel(m, f.lastSon, a.lastSon) else: - if a.kind == tyExpr: - InternalAssert a.len > 0 - r = typeRel(m, f.lastSon, a.lastSon) + let match = matchTypeClass(m.bindings, fMaybeStatic, a) + if not match: r = isNone else: - let match = matchTypeClass(m.bindings, fMaybeExpr, a) - if not match: r = isNone - else: - # XXX: Ideally, this should happen much earlier somewhere near - # semOpAux, but to do that, we need to be able to query the - # overload set to determine whether compile-time value is expected - # for the param before entering the full-blown sigmatch algorithm. - # This is related to the immediate pragma since querying the - # overload set could help there too. - var evaluated = c.semConstExpr(c, arg) - if evaluated != nil: - r = isGeneric - arg.typ = newTypeS(tyExpr, c) - arg.typ.sons = @[evaluated.typ] - arg.typ.n = evaluated + # XXX: Ideally, this should happen much earlier somewhere near + # semOpAux, but to do that, we need to be able to query the + # overload set to determine whether compile-time value is expected + # for the param before entering the full-blown sigmatch algorithm. + # This is related to the immediate pragma since querying the + # overload set could help there too. + var evaluated = c.semConstExpr(c, arg) + if evaluated != nil: + r = isGeneric + arg.typ = newTypeS(tyStatic, c) + arg.typ.sons = @[evaluated.typ] + arg.typ.n = evaluated if r == isGeneric: put(m.bindings, f, arg.typ) + of tyTypeClass, tyParametricTypeClass: - if fMaybeExpr.n != nil: - let match = matchUserTypeClass(c, m, arg, fMaybeExpr, a) + if fMaybeStatic.n != nil: + let match = matchUserTypeClass(c, m, arg, fMaybeStatic, a) if match != nil: r = isGeneric arg = match @@ -935,6 +934,9 @@ proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, r = isNone else: r = typeRel(m, f, a) + of tyExpr: + r = isGeneric + put(m.bindings, f, arg.typ) else: r = typeRel(m, f, a) @@ -961,6 +963,8 @@ proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, result = argOrig[bodyPos] elif f.kind == tyTypeDesc: result = arg + elif f.kind == tyStatic: + result = arg.typ.n else: result = argOrig else: diff --git a/compiler/types.nim b/compiler/types.nim index 7e07a0667e..5fe128bbb9 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -409,7 +409,7 @@ const "uint", "uint8", "uint16", "uint32", "uint64", "bignum", "const ", "!", "varargs[$1]", "iter[$1]", "Error Type", "TypeClass", - "ParametricTypeClass", "and", "or", "not", "any"] + "ParametricTypeClass", "and", "or", "not", "any", "static"] proc consToStr(t: PType): string = if t.len > 0: result = t.typeToString @@ -445,6 +445,9 @@ proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = of tyTypeDesc: if t.len == 0: result = "typedesc" else: result = "typedesc[" & constraintsToStr(t) & "]" + of tyStatic: + InternalAssert t.len > 0 + result = "static[" & constraintsToStr(t) & "]" of tyTypeClass: if t.n != nil: return t.sym.owner.name.s case t.len @@ -828,9 +831,9 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = if a.kind != b.kind: return false case a.Kind of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCString, - tyInt..tyBigNum, tyStmt: + tyInt..tyBigNum, tyStmt, tyExpr: result = sameFlags(a, b) - of tyExpr: + of tyStatic: result = ExprStructuralEquivalent(a.n, b.n) and sameFlags(a, b) of tyObject: IfFastObjectTypeCheckFailed(a, b): @@ -1038,7 +1041,7 @@ proc typeAllowedAux(marker: var TIntSet, typ: PType, kind: TSymKind, if not result: break if result and t.sons[0] != nil: result = typeAllowedAux(marker, t.sons[0], skResult, flags) - of tyExpr, tyStmt, tyTypeDesc: + of tyExpr, tyStmt, tyTypeDesc, tyStatic: result = true # XXX er ... no? these should not be allowed! of tyEmpty: @@ -1314,7 +1317,7 @@ proc compatibleEffects*(formal, actual: PType): bool = result = true proc isCompileTimeOnly*(t: PType): bool {.inline.} = - result = t.kind in {tyTypedesc, tyExpr} + result = t.kind in {tyTypedesc, tyStatic} proc containsCompileTimeOnly*(t: PType): bool = if isCompileTimeOnly(t): return true diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 84d82e117c..f5ea24aa2c 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -777,7 +777,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = const atomicTypes = {tyBool, tyChar, - tyExpr, tyStmt, tyTypeDesc, + tyExpr, tyStmt, tyTypeDesc, tyStatic, tyEnum, tyOrdinal, tyRange, @@ -937,8 +937,8 @@ proc getNullValue(typ: PType, info: TLineInfo): PNode = result = newNodeIT(nkUIntLit, info, t) of tyFloat..tyFloat128: result = newNodeIt(nkFloatLit, info, t) - of tyVar, tyPointer, tyPtr, tyCString, tySequence, tyString, tyExpr, - tyStmt, tyTypeDesc, tyProc, tyRef: + of tyVar, tyPointer, tyPtr, tyCString, tySequence, tyString, tyExpr, + tyStmt, tyTypeDesc, tyStatic, tyProc, tyRef: result = newNodeIT(nkNilLit, info, t) of tyObject: result = newNodeIT(nkPar, info, t) diff --git a/lib/core/macros.nim b/lib/core/macros.nim index d01d4ebee4..44a3a34c3b 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -59,7 +59,8 @@ type nnkBindStmt, nnkMixinStmt, nnkUsingStmt, nnkCommentStmt, nnkStmtListExpr, nnkBlockExpr, nnkStmtListType, nnkBlockType, nnkTypeOfExpr, nnkObjectTy, - nnkTupleTy, nnkTypeClassTy, nnkRecList, nnkRecCase, nnkRecWhen, + nnkTupleTy, nnkTypeClassTy, nnkStaticTy, + nnkRecList, nnkRecCase, nnkRecWhen, nnkRefTy, nnkPtrTy, nnkVarTy, nnkConstTy, nnkMutableTy, nnkDistinctTy, @@ -285,14 +286,15 @@ proc quote*(bl: stmt, op = "``"): PNimrodNode {.magic: "QuoteAst".} ## if not `ex`: ## echo `info` & ": Check failed: " & `expString` -template emit*(e: expr[string]): stmt = - ## accepts a single string argument and treats it as nimrod code - ## that should be inserted verbatim in the program - ## Example: - ## - ## emit("echo " & '"' & "hello world".toUpper & '"') - ## - eval: result = e.parseStmt +when not defined(booting): + template emit*(e: static[string]): stmt = + ## accepts a single string argument and treats it as nimrod code + ## that should be inserted verbatim in the program + ## Example: + ## + ## emit("echo " & '"' & "hello world".toUpper & '"') + ## + eval: result = e.parseStmt proc expectKind*(n: PNimrodNode, k: TNimrodNodeKind) {.compileTime.} = ## checks that `n` is of kind `k`. If this is not the case, diff --git a/lib/system.nim b/lib/system.nim index dc5a406d14..e58378c05b 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2641,7 +2641,7 @@ when hostOS != "standalone": x[j+i] = item[j] inc(j) -proc compiles*(x: expr): bool {.magic: "Compiles", noSideEffect.} = +proc compiles*(x): bool {.magic: "Compiles", noSideEffect.} = ## Special compile-time procedure that checks whether `x` can be compiled ## without any semantic error. ## This can be used to check whether a type supports some operation: diff --git a/tests/run/tmemoization.nim b/tests/run/tmemoization.nim index 78f0515f32..b59ff44ea2 100644 --- a/tests/run/tmemoization.nim +++ b/tests/run/tmemoization.nim @@ -5,7 +5,7 @@ discard """ import strutils -proc foo(s: expr[string]): string = +proc foo(s: static[string]): string = static: echo s const R = s.toUpper diff --git a/tests/run/tstaticparams.nim b/tests/run/tstaticparams.nim index f2d6e1dd65..23d644bce3 100644 --- a/tests/run/tstaticparams.nim +++ b/tests/run/tstaticparams.nim @@ -4,15 +4,15 @@ discard """ """ type - TFoo[T; Val: expr[string]] = object + TFoo[T; Val: static[string]] = object data: array[4, T] - TBar[T; I: expr[int]] = object + TBar[T; I: static[int]] = object data: array[I, T] - TA1[T; I: expr[int]] = array[I, T] - TA2[T; I: expr[int]] = array[0..I, T] - TA3[T; I: expr[int]] = array[I-1, T] + #TA1[T; I: static[int]] = array[I, T] + #TA2[T; I: static[int]] = array[0..I, T] + TA3[T; I: static[int]] = array[I-1, T] proc takeFoo(x: TFoo) = echo "abracadabra" diff --git a/todo.txt b/todo.txt index da7585500d..a0a8ce2b5a 100644 --- a/todo.txt +++ b/todo.txt @@ -38,7 +38,6 @@ version 0.9.x - macros as type pragmas - implicit deref for parameter matching - lazy overloading resolution: - * get rid of ``expr[typ]``, use perhaps ``static[typ]`` instead * special case ``tyStmt`` - FFI: * test libffi on windows From e2a4d591e5f34685071985cb4070e96b7e053a1a Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 19 Dec 2013 01:00:51 +0100 Subject: [PATCH 118/326] added libffi for win support --- lib/wrappers/libffi/common/ffi.h | 331 ++++++++ lib/wrappers/libffi/common/ffi_common.h | 77 ++ lib/wrappers/libffi/common/fficonfig.h | 96 +++ lib/wrappers/libffi/common/ffitarget.h | 150 ++++ lib/wrappers/libffi/common/malloc_closure.c | 110 +++ lib/wrappers/libffi/common/raw_api.c | 254 ++++++ lib/wrappers/libffi/gcc/closures.c | 627 +++++++++++++++ lib/wrappers/libffi/gcc/ffi.c | 841 ++++++++++++++++++++ lib/wrappers/libffi/gcc/ffi64.c | 673 ++++++++++++++++ lib/wrappers/libffi/gcc/prep_cif.c | 237 ++++++ lib/wrappers/libffi/gcc/types.c | 77 ++ lib/wrappers/libffi/gcc/win32_asm.asm | 759 ++++++++++++++++++ lib/wrappers/libffi/gcc/win32_asm.s | 736 +++++++++++++++++ lib/wrappers/libffi/gcc/win64_asm.asm | 467 +++++++++++ lib/wrappers/libffi/gcc/win64_asm.s | 227 ++++++ lib/wrappers/libffi/libffi.nim | 16 +- lib/wrappers/libffi/msvc/ffi.c | 457 +++++++++++ lib/wrappers/libffi/msvc/prep_cif.c | 175 ++++ lib/wrappers/libffi/msvc/types.c | 104 +++ lib/wrappers/libffi/msvc/win32.c | 162 ++++ lib/wrappers/libffi/msvc/win32_asm.asm | 470 +++++++++++ lib/wrappers/libffi/msvc/win64_asm.asm | 156 ++++ 22 files changed, 7192 insertions(+), 10 deletions(-) create mode 100644 lib/wrappers/libffi/common/ffi.h create mode 100644 lib/wrappers/libffi/common/ffi_common.h create mode 100644 lib/wrappers/libffi/common/fficonfig.h create mode 100644 lib/wrappers/libffi/common/ffitarget.h create mode 100644 lib/wrappers/libffi/common/malloc_closure.c create mode 100644 lib/wrappers/libffi/common/raw_api.c create mode 100644 lib/wrappers/libffi/gcc/closures.c create mode 100644 lib/wrappers/libffi/gcc/ffi.c create mode 100644 lib/wrappers/libffi/gcc/ffi64.c create mode 100644 lib/wrappers/libffi/gcc/prep_cif.c create mode 100644 lib/wrappers/libffi/gcc/types.c create mode 100644 lib/wrappers/libffi/gcc/win32_asm.asm create mode 100644 lib/wrappers/libffi/gcc/win32_asm.s create mode 100644 lib/wrappers/libffi/gcc/win64_asm.asm create mode 100644 lib/wrappers/libffi/gcc/win64_asm.s create mode 100644 lib/wrappers/libffi/msvc/ffi.c create mode 100644 lib/wrappers/libffi/msvc/prep_cif.c create mode 100644 lib/wrappers/libffi/msvc/types.c create mode 100644 lib/wrappers/libffi/msvc/win32.c create mode 100644 lib/wrappers/libffi/msvc/win32_asm.asm create mode 100644 lib/wrappers/libffi/msvc/win64_asm.asm diff --git a/lib/wrappers/libffi/common/ffi.h b/lib/wrappers/libffi/common/ffi.h new file mode 100644 index 0000000000..07d650eac9 --- /dev/null +++ b/lib/wrappers/libffi/common/ffi.h @@ -0,0 +1,331 @@ +/* -----------------------------------------------------------------*-C-*- + libffi 2.00-beta - Copyright (c) 1996-2003 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +/* ------------------------------------------------------------------- + The basic API is described in the README file. + + The raw API is designed to bypass some of the argument packing + and unpacking on architectures for which it can be avoided. + + The closure API allows interpreted functions to be packaged up + inside a C function pointer, so that they can be called as C functions, + with no understanding on the client side that they are interpreted. + It can also be used in other cases in which it is necessary to package + up a user specified parameter and a function pointer as a single + function pointer. + + The closure API must be implemented in order to get its functionality, + e.g. for use by gij. Routines are provided to emulate the raw API + if the underlying platform doesn't allow faster implementation. + + More details on the raw and cloure API can be found in: + + http://gcc.gnu.org/ml/java/1999-q3/msg00138.html + + and + + http://gcc.gnu.org/ml/java/1999-q3/msg00174.html + -------------------------------------------------------------------- */ + +#ifndef LIBFFI_H +#define LIBFFI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Specify which architecture libffi is configured for. */ +//XXX #define X86 + +/* ---- System configuration information --------------------------------- */ + +#include <ffitarget.h> + +#ifndef LIBFFI_ASM + +#include <stddef.h> +#include <limits.h> + +/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). + But we can find it either under the correct ANSI name, or under GNU + C's internal name. */ +#ifdef LONG_LONG_MAX +# define FFI_LONG_LONG_MAX LONG_LONG_MAX +#else +# ifdef LLONG_MAX +# define FFI_LONG_LONG_MAX LLONG_MAX +# else +# ifdef __GNUC__ +# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ +# endif +# ifdef _MSC_VER +# define FFI_LONG_LONG_MAX _I64_MAX +# endif +# endif +#endif + +#if SCHAR_MAX == 127 +# define ffi_type_uchar ffi_type_uint8 +# define ffi_type_schar ffi_type_sint8 +#else + #error "char size not supported" +#endif + +#if SHRT_MAX == 32767 +# define ffi_type_ushort ffi_type_uint16 +# define ffi_type_sshort ffi_type_sint16 +#elif SHRT_MAX == 2147483647 +# define ffi_type_ushort ffi_type_uint32 +# define ffi_type_sshort ffi_type_sint32 +#else + #error "short size not supported" +#endif + +#if INT_MAX == 32767 +# define ffi_type_uint ffi_type_uint16 +# define ffi_type_sint ffi_type_sint16 +#elif INT_MAX == 2147483647 +# define ffi_type_uint ffi_type_uint32 +# define ffi_type_sint ffi_type_sint32 +#elif INT_MAX == 9223372036854775807 +# define ffi_type_uint ffi_type_uint64 +# define ffi_type_sint ffi_type_sint64 +#else + #error "int size not supported" +#endif + +#define ffi_type_ulong ffi_type_uint64 +#define ffi_type_slong ffi_type_sint64 +#if LONG_MAX == 2147483647 +# if FFI_LONG_LONG_MAX != 9223372036854775807 + #error "no 64-bit data type supported" +# endif +#elif LONG_MAX != 9223372036854775807 + #error "long size not supported" +#endif + +/* The closure code assumes that this works on pointers, i.e. a size_t */ +/* can hold a pointer. */ + +typedef struct _ffi_type +{ + size_t size; + unsigned short alignment; + unsigned short type; + /*@null@*/ struct _ffi_type **elements; +} ffi_type; + +/* These are defined in types.c */ +extern const ffi_type ffi_type_void; +extern const ffi_type ffi_type_uint8; +extern const ffi_type ffi_type_sint8; +extern const ffi_type ffi_type_uint16; +extern const ffi_type ffi_type_sint16; +extern const ffi_type ffi_type_uint32; +extern const ffi_type ffi_type_sint32; +extern const ffi_type ffi_type_uint64; +extern const ffi_type ffi_type_sint64; +extern const ffi_type ffi_type_float; +extern const ffi_type ffi_type_double; +extern const ffi_type ffi_type_longdouble; +extern const ffi_type ffi_type_pointer; + + +typedef enum { + FFI_OK = 0, + FFI_BAD_TYPEDEF, + FFI_BAD_ABI +} ffi_status; + +typedef unsigned FFI_TYPE; + +typedef struct { + ffi_abi abi; + unsigned nargs; + /*@dependent@*/ ffi_type **arg_types; + /*@dependent@*/ ffi_type *rtype; + unsigned bytes; + unsigned flags; +#ifdef FFI_EXTRA_CIF_FIELDS + FFI_EXTRA_CIF_FIELDS; +#endif +} ffi_cif; + +/* ---- Definitions for the raw API -------------------------------------- */ + +#ifdef _WIN64 +#define FFI_SIZEOF_ARG 8 +#else +#define FFI_SIZEOF_ARG 4 +#endif + +typedef union { + ffi_sarg sint; + ffi_arg uint; + float flt; + char data[FFI_SIZEOF_ARG]; + void* ptr; +} ffi_raw; + +void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, + /*@dependent@*/ ffi_raw *avalue); + +void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); +void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); +size_t ffi_raw_size (ffi_cif *cif); + +/* This is analogous to the raw API, except it uses Java parameter */ +/* packing, even on 64-bit machines. I.e. on 64-bit machines */ +/* longs and doubles are followed by an empty 64-bit word. */ + +void ffi_java_raw_call (/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, + /*@dependent@*/ ffi_raw *avalue); + +void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); +void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); +size_t ffi_java_raw_size (ffi_cif *cif); + +/* ---- Definitions for closures ----------------------------------------- */ + +#if FFI_CLOSURES + +typedef struct { + char tramp[FFI_TRAMPOLINE_SIZE]; + ffi_cif *cif; + void (*fun)(ffi_cif*,void*,void**,void*); + void *user_data; +} ffi_closure; + +void ffi_closure_free(void *); +void *ffi_closure_alloc (size_t size, void **code); + +ffi_status +ffi_prep_closure_loc (ffi_closure*, + ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc); + +typedef struct { + char tramp[FFI_TRAMPOLINE_SIZE]; + + ffi_cif *cif; + +#if !FFI_NATIVE_RAW_API + + /* if this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the transaltion, void** -> ffi_raw*. */ + + void (*translate_args)(ffi_cif*,void*,void**,void*); + void *this_closure; + +#endif + + void (*fun)(ffi_cif*,void*,ffi_raw*,void*); + void *user_data; + +} ffi_raw_closure; + +ffi_status +ffi_prep_raw_closure (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data); + +ffi_status +ffi_prep_java_raw_closure (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data); + +#endif /* FFI_CLOSURES */ + +/* ---- Public interface definition -------------------------------------- */ + +ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, + ffi_abi abi, + unsigned int nargs, + /*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type *rtype, + /*@dependent@*/ ffi_type **atypes); + +void +ffi_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, + /*@dependent@*/ void **avalue); + +/* Useful for eliminating compiler warnings */ +#define FFI_FN(f) ((void (*)())f) + +/* ---- Definitions shared with assembly code ---------------------------- */ + +#endif + +/* If these change, update src/mips/ffitarget.h. */ +#define FFI_TYPE_VOID 0 +#define FFI_TYPE_INT 1 +#define FFI_TYPE_FLOAT 2 +#define FFI_TYPE_DOUBLE 3 +#if 1 +#define FFI_TYPE_LONGDOUBLE 4 +#else +#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE +#endif +#define FFI_TYPE_UINT8 5 +#define FFI_TYPE_SINT8 6 +#define FFI_TYPE_UINT16 7 +#define FFI_TYPE_SINT16 8 +#define FFI_TYPE_UINT32 9 +#define FFI_TYPE_SINT32 10 +#define FFI_TYPE_UINT64 11 +#define FFI_TYPE_SINT64 12 +#define FFI_TYPE_STRUCT 13 +#define FFI_TYPE_POINTER 14 + +/* This should always refer to the last type code (for sanity checks) */ +#define FFI_TYPE_LAST FFI_TYPE_POINTER + +#define FFI_HIDDEN /* no idea what the origial definition looks like ... */ + +#ifdef __GNUC__ +# define LIKELY(x) __builtin_expect(x, 1) +# define UNLIKELY(x) __builtin_expect(x, 0) +#else +# define LIKELY(x) (x) +# define UNLIKELY(x) (x) +#endif + +#define MAYBE_UNUSED + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/lib/wrappers/libffi/common/ffi_common.h b/lib/wrappers/libffi/common/ffi_common.h new file mode 100644 index 0000000000..43fb83b481 --- /dev/null +++ b/lib/wrappers/libffi/common/ffi_common.h @@ -0,0 +1,77 @@ +/* ----------------------------------------------------------------------- + ffi_common.h - Copyright (c) 1996 Red Hat, Inc. + + Common internal definitions and macros. Only necessary for building + libffi. + ----------------------------------------------------------------------- */ + +#ifndef FFI_COMMON_H +#define FFI_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <fficonfig.h> +#include <malloc.h> + +/* Check for the existence of memcpy. */ +#if STDC_HEADERS +# include <string.h> +#else +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#if defined(FFI_DEBUG) +#include <stdio.h> +#endif + +#ifdef FFI_DEBUG +/*@exits@*/ void ffi_assert(/*@temp@*/ char *expr, /*@temp@*/ char *file, int line); +void ffi_stop_here(void); +void ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a, /*@temp@*/ char *file, int line); + +#define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__)) +#define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l))) +#define FFI_ASSERT_VALID_TYPE(x) ffi_type_test (x, __FILE__, __LINE__) +#else +#define FFI_ASSERT(x) +#define FFI_ASSERT_AT(x, f, l) +#define FFI_ASSERT_VALID_TYPE(x) +#endif + +#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif); + +/* Extended cif, used in callback from assembly routine */ +typedef struct +{ + /*@dependent@*/ ffi_cif *cif; + /*@dependent@*/ void *rvalue; + /*@dependent@*/ void **avalue; +} extended_cif; + +/* Terse sized type definitions. */ +typedef unsigned int UINT8 __attribute__((__mode__(__QI__))); +typedef signed int SINT8 __attribute__((__mode__(__QI__))); +typedef unsigned int UINT16 __attribute__((__mode__(__HI__))); +typedef signed int SINT16 __attribute__((__mode__(__HI__))); +typedef unsigned int UINT32 __attribute__((__mode__(__SI__))); +typedef signed int SINT32 __attribute__((__mode__(__SI__))); +typedef unsigned int UINT64 __attribute__((__mode__(__DI__))); +typedef signed int SINT64 __attribute__((__mode__(__DI__))); + +typedef float FLOAT32; + + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/lib/wrappers/libffi/common/fficonfig.h b/lib/wrappers/libffi/common/fficonfig.h new file mode 100644 index 0000000000..c14f653ec8 --- /dev/null +++ b/lib/wrappers/libffi/common/fficonfig.h @@ -0,0 +1,96 @@ +/* fficonfig.h. Originally created by configure, now hand_maintained for MSVC. */ + +/* fficonfig.h. Generated automatically by configure. */ +/* fficonfig.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define this for MSVC, but not for mingw32! */ +#ifdef _MSC_VER +#define __attribute__(x) /* */ +#endif +#define alloca _alloca + +/*----------------------------------------------------------------*/ + +/* Define if using alloca.c. */ +/* #undef C_ALLOCA */ + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +/* #undef CRAY_STACKSEG_END */ + +/* Define if you have alloca, as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ +/* #define HAVE_ALLOCA_H 1 */ + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +/* #undef STACK_DIRECTION */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if read-only mmap of a plain file works. */ +//#define HAVE_MMAP_FILE 1 + +/* Define if mmap of /dev/zero works. */ +//#define HAVE_MMAP_DEV_ZERO 1 + +/* Define if mmap with MAP_ANON(YMOUS) works. */ +//#define HAVE_MMAP_ANON 1 + +/* The number of bytes in type double */ +#define SIZEOF_DOUBLE 8 + +/* The number of bytes in type long double */ +#define SIZEOF_LONG_DOUBLE 12 + +/* Define if you have the long double type and it is bigger than a double */ +#define HAVE_LONG_DOUBLE 1 + +/* whether byteorder is bigendian */ +/* #undef WORDS_BIGENDIAN */ + +/* Define if the host machine stores words of multi-word integers in + big-endian order. */ +/* #undef HOST_WORDS_BIG_ENDIAN */ + +/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ +#define BYTEORDER 1234 + +/* Define if your assembler and linker support unaligned PC relative relocs. */ +/* #undef HAVE_AS_SPARC_UA_PCREL */ + +/* Define if your assembler supports .register. */ +/* #undef HAVE_AS_REGISTER_PSEUDO_OP */ + +/* Define if .eh_frame sections should be read-only. */ +/* #undef HAVE_RO_EH_FRAME */ + +/* Define to the flags needed for the .section .eh_frame directive. */ +/* #define EH_FRAME_FLAGS "aw" */ + +/* Define to the flags needed for the .section .eh_frame directive. */ +/* #define EH_FRAME_FLAGS "aw" */ + +/* Define this if you want extra debugging. */ +/* #undef FFI_DEBUG */ + +/* Define this is you do not want support for aggregate types. */ +/* #undef FFI_NO_STRUCTS */ + +/* Define this is you do not want support for the raw API. */ +/* #undef FFI_NO_RAW_API */ + +/* Define this if you are using Purify and want to suppress spurious messages. */ +/* #undef USING_PURIFY */ + diff --git a/lib/wrappers/libffi/common/ffitarget.h b/lib/wrappers/libffi/common/ffitarget.h new file mode 100644 index 0000000000..d8d60f2e72 --- /dev/null +++ b/lib/wrappers/libffi/common/ffitarget.h @@ -0,0 +1,150 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003, 2010 Red Hat, Inc. + Copyright (C) 2008 Free Software Foundation, Inc. + + Target configuration macros for x86 and x86-64. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +/* For code common to all platforms on x86 and x86_64. */ +#define X86_ANY + +#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) +# if defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) +# define X86_64 +# define X86_WIN64 +# else +# define X86_32 +# define X86_WIN32 +# endif +#endif + +#if defined (X86_64) && defined (__i386__) +#undef X86_64 +#define X86 +#endif + +#ifdef X86_WIN64 +#define FFI_SIZEOF_ARG 8 +#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */ +#endif + +/* ---- Generic type definitions ----------------------------------------- */ + +#ifndef LIBFFI_ASM +#ifdef X86_WIN64 +#ifdef _MSC_VER +typedef unsigned __int64 ffi_arg; +typedef __int64 ffi_sarg; +#else +typedef unsigned long long ffi_arg; +typedef long long ffi_sarg; +#endif +#else +#if defined __x86_64__ && defined __ILP32__ +#define FFI_SIZEOF_ARG 8 +#define FFI_SIZEOF_JAVA_RAW 4 +typedef unsigned long long ffi_arg; +typedef long long ffi_sarg; +#else +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; +#endif +#endif + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + + /* ---- Intel x86 Win32 ---------- */ +#ifdef X86_WIN32 + FFI_SYSV, + FFI_STDCALL, + FFI_THISCALL, + FFI_FASTCALL, + FFI_MS_CDECL, + FFI_LAST_ABI, +#ifdef _MSC_VER + FFI_DEFAULT_ABI = FFI_MS_CDECL +#else + FFI_DEFAULT_ABI = FFI_SYSV +#endif + +#elif defined(X86_WIN64) + FFI_WIN64, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_WIN64 + +#else + /* ---- Intel x86 and AMD x86-64 - */ + FFI_SYSV, + FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ + FFI_LAST_ABI, +#if defined(__i386__) || defined(__i386) + FFI_DEFAULT_ABI = FFI_SYSV +#else + FFI_DEFAULT_ABI = FFI_UNIX64 +#endif +#endif +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1) +#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2) +#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3) +#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4) + +#if defined (X86_64) || (defined (__x86_64__) && defined (X86_DARWIN)) +#define FFI_TRAMPOLINE_SIZE 24 +#define FFI_NATIVE_RAW_API 0 +#else +#ifdef X86_WIN32 +#define FFI_TRAMPOLINE_SIZE 52 +#else +#ifdef X86_WIN64 +#define FFI_TRAMPOLINE_SIZE 29 +#define FFI_NATIVE_RAW_API 0 +#define FFI_NO_RAW_API 1 +#else +#define FFI_TRAMPOLINE_SIZE 10 +#endif +#endif +#ifndef X86_WIN64 +#define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */ +#endif +#endif + +#endif + diff --git a/lib/wrappers/libffi/common/malloc_closure.c b/lib/wrappers/libffi/common/malloc_closure.c new file mode 100644 index 0000000000..5b33aa4ca3 --- /dev/null +++ b/lib/wrappers/libffi/common/malloc_closure.c @@ -0,0 +1,110 @@ +#include <ffi.h> +#ifdef MS_WIN32 +#include <windows.h> +#else +#include <sys/mman.h> +#include <unistd.h> +# if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) +# define MAP_ANONYMOUS MAP_ANON +# endif +#endif +#include "ctypes.h" + +/* BLOCKSIZE can be adjusted. Larger blocksize will take a larger memory + overhead, but allocate less blocks from the system. It may be that some + systems have a limit of how many mmap'd blocks can be open. +*/ + +#define BLOCKSIZE _pagesize + +/* #define MALLOC_CLOSURE_DEBUG */ /* enable for some debugging output */ + +/******************************************************************/ + +typedef union _tagITEM { + ffi_closure closure; + union _tagITEM *next; +} ITEM; + +static ITEM *free_list; +static int _pagesize; + +static void more_core(void) +{ + ITEM *item; + int count, i; + +/* determine the pagesize */ +#ifdef MS_WIN32 + if (!_pagesize) { + SYSTEM_INFO systeminfo; + GetSystemInfo(&systeminfo); + _pagesize = systeminfo.dwPageSize; + } +#else + if (!_pagesize) { +#ifdef _SC_PAGESIZE + _pagesize = sysconf(_SC_PAGESIZE); +#else + _pagesize = getpagesize(); +#endif + } +#endif + + /* calculate the number of nodes to allocate */ + count = BLOCKSIZE / sizeof(ITEM); + + /* allocate a memory block */ +#ifdef MS_WIN32 + item = (ITEM *)VirtualAlloc(NULL, + count * sizeof(ITEM), + MEM_COMMIT, + PAGE_EXECUTE_READWRITE); + if (item == NULL) + return; +#else + item = (ITEM *)mmap(NULL, + count * sizeof(ITEM), + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_PRIVATE | MAP_ANONYMOUS, + -1, + 0); + if (item == (void *)MAP_FAILED) + return; +#endif + +#ifdef MALLOC_CLOSURE_DEBUG + printf("block at %p allocated (%d bytes), %d ITEMs\n", + item, count * sizeof(ITEM), count); +#endif + /* put them into the free list */ + for (i = 0; i < count; ++i) { + item->next = free_list; + free_list = item; + ++item; + } +} + +/******************************************************************/ + +/* put the item back into the free list */ +void ffi_closure_free(void *p) +{ + ITEM *item = (ITEM *)p; + item->next = free_list; + free_list = item; +} + +/* return one item from the free list, allocating more if needed */ +void *ffi_closure_alloc(size_t ignored, void** codeloc) +{ + ITEM *item; + if (!free_list) + more_core(); + if (!free_list) + return NULL; + item = free_list; + free_list = item->next; + *codeloc = (void *)item; + return (void *)item; +} diff --git a/lib/wrappers/libffi/common/raw_api.c b/lib/wrappers/libffi/common/raw_api.c new file mode 100644 index 0000000000..ce21372e29 --- /dev/null +++ b/lib/wrappers/libffi/common/raw_api.c @@ -0,0 +1,254 @@ +/* ----------------------------------------------------------------------- + raw_api.c - Copyright (c) 1999, 2008 Red Hat, Inc. + + Author: Kresten Krab Thorup <krab@gnu.org> + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +/* This file defines generic functions for use with the raw api. */ + +#include <ffi.h> +#include <ffi_common.h> + +#if !FFI_NO_RAW_API + +size_t +ffi_raw_size (ffi_cif *cif) +{ + size_t result = 0; + int i; + + ffi_type **at = cif->arg_types; + + for (i = cif->nargs-1; i >= 0; i--, at++) + { +#if !FFI_NO_STRUCTS + if ((*at)->type == FFI_TYPE_STRUCT) + result += ALIGN (sizeof (void*), FFI_SIZEOF_ARG); + else +#endif + result += ALIGN ((*at)->size, FFI_SIZEOF_ARG); + } + + return result; +} + + +void +ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) +{ + unsigned i; + ffi_type **tp = cif->arg_types; + +#if WORDS_BIGENDIAN + + for (i = 0; i < cif->nargs; i++, tp++, args++) + { + switch ((*tp)->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1); + break; + + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2); + break; + +#if FFI_SIZEOF_ARG >= 4 + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4); + break; +#endif + +#if !FFI_NO_STRUCTS + case FFI_TYPE_STRUCT: + *args = (raw++)->ptr; + break; +#endif + + case FFI_TYPE_POINTER: + *args = (void*) &(raw++)->ptr; + break; + + default: + *args = raw; + raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; + } + } + +#else /* WORDS_BIGENDIAN */ + +#if !PDP + + /* then assume little endian */ + for (i = 0; i < cif->nargs; i++, tp++, args++) + { +#if !FFI_NO_STRUCTS + if ((*tp)->type == FFI_TYPE_STRUCT) + { + *args = (raw++)->ptr; + } + else +#endif + { + *args = (void*) raw; + raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*); + } + } + +#else +#error "pdp endian not supported" +#endif /* ! PDP */ + +#endif /* WORDS_BIGENDIAN */ +} + +void +ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) +{ + unsigned i; + ffi_type **tp = cif->arg_types; + + for (i = 0; i < cif->nargs; i++, tp++, args++) + { + switch ((*tp)->type) + { + case FFI_TYPE_UINT8: + (raw++)->uint = *(UINT8*) (*args); + break; + + case FFI_TYPE_SINT8: + (raw++)->sint = *(SINT8*) (*args); + break; + + case FFI_TYPE_UINT16: + (raw++)->uint = *(UINT16*) (*args); + break; + + case FFI_TYPE_SINT16: + (raw++)->sint = *(SINT16*) (*args); + break; + +#if FFI_SIZEOF_ARG >= 4 + case FFI_TYPE_UINT32: + (raw++)->uint = *(UINT32*) (*args); + break; + + case FFI_TYPE_SINT32: + (raw++)->sint = *(SINT32*) (*args); + break; +#endif + +#if !FFI_NO_STRUCTS + case FFI_TYPE_STRUCT: + (raw++)->ptr = *args; + break; +#endif + + case FFI_TYPE_POINTER: + (raw++)->ptr = **(void***) args; + break; + + default: + memcpy ((void*) raw->data, (void*)*args, (*tp)->size); + raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; + } + } +} + +#if !FFI_NATIVE_RAW_API + + +/* This is a generic definition of ffi_raw_call, to be used if the + * native system does not provide a machine-specific implementation. + * Having this, allows code to be written for the raw API, without + * the need for system-specific code to handle input in that format; + * these following couple of functions will handle the translation forth + * and back automatically. */ + +void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *raw) +{ + void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); + ffi_raw_to_ptrarray (cif, raw, avalue); + ffi_call (cif, fn, rvalue, avalue); +} + +#if FFI_CLOSURES /* base system provides closures */ + +static void +ffi_translate_args (ffi_cif *cif, void *rvalue, + void **avalue, void *user_data) +{ + ffi_raw *raw = (ffi_raw*)alloca (ffi_raw_size (cif)); + ffi_raw_closure *cl = (ffi_raw_closure*)user_data; + + ffi_ptrarray_to_raw (cif, avalue, raw); + (*cl->fun) (cif, rvalue, raw, cl->user_data); +} + +ffi_status +ffi_prep_raw_closure_loc (ffi_raw_closure* cl, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data, + void *codeloc) +{ + ffi_status status; + + status = ffi_prep_closure_loc ((ffi_closure*) cl, + cif, + &ffi_translate_args, + codeloc, + codeloc); + if (status == FFI_OK) + { + cl->fun = fun; + cl->user_data = user_data; + } + + return status; +} + +#endif /* FFI_CLOSURES */ +#endif /* !FFI_NATIVE_RAW_API */ + +#if FFI_CLOSURES + +/* Again, here is the generic version of ffi_prep_raw_closure, which + * will install an intermediate "hub" for translation of arguments from + * the pointer-array format, to the raw format */ + +ffi_status +ffi_prep_raw_closure (ffi_raw_closure* cl, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data) +{ + return ffi_prep_raw_closure_loc (cl, cif, fun, user_data, cl); +} + +#endif /* FFI_CLOSURES */ + +#endif /* !FFI_NO_RAW_API */ diff --git a/lib/wrappers/libffi/gcc/closures.c b/lib/wrappers/libffi/gcc/closures.c new file mode 100644 index 0000000000..c0ee068910 --- /dev/null +++ b/lib/wrappers/libffi/gcc/closures.c @@ -0,0 +1,627 @@ +/* ----------------------------------------------------------------------- + closures.c - Copyright (c) 2007, 2009, 2010 Red Hat, Inc. + Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc + Copyright (c) 2011 Plausible Labs Cooperative, Inc. + + Code to allocate and deallocate memory for closures. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#if defined __linux__ && !defined _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif + +#include <ffi.h> +#include <ffi_common.h> + +#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE +# if __gnu_linux__ +/* This macro indicates it may be forbidden to map anonymous memory + with both write and execute permission. Code compiled when this + option is defined will attempt to map such pages once, but if it + fails, it falls back to creating a temporary file in a writable and + executable filesystem and mapping pages from it into separate + locations in the virtual memory space, one location writable and + another executable. */ +# define FFI_MMAP_EXEC_WRIT 1 +# define HAVE_MNTENT 1 +# endif +# if defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__) +/* Windows systems may have Data Execution Protection (DEP) enabled, + which requires the use of VirtualMalloc/VirtualFree to alloc/free + executable memory. */ +# define FFI_MMAP_EXEC_WRIT 1 +# endif +#endif + +#if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX +# ifdef __linux__ +/* When defined to 1 check for SELinux and if SELinux is active, + don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that + might cause audit messages. */ +# define FFI_MMAP_EXEC_SELINUX 1 +# endif +#endif + +#if FFI_CLOSURES + +# if FFI_EXEC_TRAMPOLINE_TABLE + +// Per-target implementation; It's unclear what can reasonable be shared +// between two OS/architecture implementations. + +# elif FFI_MMAP_EXEC_WRIT /* !FFI_EXEC_TRAMPOLINE_TABLE */ + +#define USE_LOCKS 1 +#define USE_DL_PREFIX 1 +#ifdef __GNUC__ +#ifndef USE_BUILTIN_FFS +#define USE_BUILTIN_FFS 1 +#endif +#endif + +/* We need to use mmap, not sbrk. */ +#define HAVE_MORECORE 0 + +/* We could, in theory, support mremap, but it wouldn't buy us anything. */ +#define HAVE_MREMAP 0 + +/* We have no use for this, so save some code and data. */ +#define NO_MALLINFO 1 + +/* We need all allocations to be in regular segments, otherwise we + lose track of the corresponding code address. */ +#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T + +/* Don't allocate more than a page unless needed. */ +#define DEFAULT_GRANULARITY ((size_t)malloc_getpagesize) + +#if FFI_CLOSURE_TEST +/* Don't release single pages, to avoid a worst-case scenario of + continuously allocating and releasing single pages, but release + pairs of pages, which should do just as well given that allocations + are likely to be small. */ +#define DEFAULT_TRIM_THRESHOLD ((size_t)malloc_getpagesize) +#endif + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <errno.h> +#ifndef _MSC_VER +#include <unistd.h> +#endif +#include <string.h> +#include <stdio.h> +#if !defined(X86_WIN32) && !defined(X86_WIN64) +#ifdef HAVE_MNTENT +#include <mntent.h> +#endif /* HAVE_MNTENT */ +#include <sys/param.h> +#include <pthread.h> + +/* We don't want sys/mman.h to be included after we redefine mmap and + dlmunmap. */ +#include <sys/mman.h> +#define LACKS_SYS_MMAN_H 1 + +#if FFI_MMAP_EXEC_SELINUX +#include <sys/statfs.h> +#include <stdlib.h> + +static int selinux_enabled = -1; + +static int +selinux_enabled_check (void) +{ + struct statfs sfs; + FILE *f; + char *buf = NULL; + size_t len = 0; + + if (statfs ("/selinux", &sfs) >= 0 + && (unsigned int) sfs.f_type == 0xf97cff8cU) + return 1; + f = fopen ("/proc/mounts", "r"); + if (f == NULL) + return 0; + while (getline (&buf, &len, f) >= 0) + { + char *p = strchr (buf, ' '); + if (p == NULL) + break; + p = strchr (p + 1, ' '); + if (p == NULL) + break; + if (strncmp (p + 1, "selinuxfs ", 10) == 0) + { + free (buf); + fclose (f); + return 1; + } + } + free (buf); + fclose (f); + return 0; +} + +#define is_selinux_enabled() (selinux_enabled >= 0 ? selinux_enabled \ + : (selinux_enabled = selinux_enabled_check ())) + +#else + +#define is_selinux_enabled() 0 + +#endif /* !FFI_MMAP_EXEC_SELINUX */ + +/* On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. */ +#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX +#include <stdlib.h> + +static int emutramp_enabled = -1; + +static int +emutramp_enabled_check (void) +{ + if (getenv ("FFI_DISABLE_EMUTRAMP") == NULL) + return 1; + else + return 0; +} + +#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \ + : (emutramp_enabled = emutramp_enabled_check ())) +#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */ + +#elif defined (__CYGWIN__) || defined(__INTERIX) + +#include <sys/mman.h> + +/* Cygwin is Linux-like, but not quite that Linux-like. */ +#define is_selinux_enabled() 0 + +#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */ + +#ifndef FFI_MMAP_EXEC_EMUTRAMP_PAX +#define is_emutramp_enabled() 0 +#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */ + +#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) +/* Use these for mmap and munmap within dlmalloc.c. */ +static void *dlmmap(void *, size_t, int, int, int, off_t); +static int dlmunmap(void *, size_t); +#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ + +#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) + +/* A mutex used to synchronize access to *exec* variables in this file. */ +static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER; + +/* A file descriptor of a temporary file from which we'll map + executable pages. */ +static int execfd = -1; + +/* The amount of space already allocated from the temporary file. */ +static size_t execsize = 0; + +/* Open a temporary file name, and immediately unlink it. */ +static int +open_temp_exec_file_name (char *name) +{ + int fd = mkstemp (name); + + if (fd != -1) + unlink (name); + + return fd; +} + +/* Open a temporary file in the named directory. */ +static int +open_temp_exec_file_dir (const char *dir) +{ + static const char suffix[] = "/ffiXXXXXX"; + int lendir = strlen (dir); + char *tempname = __builtin_alloca (lendir + sizeof (suffix)); + + if (!tempname) + return -1; + + memcpy (tempname, dir, lendir); + memcpy (tempname + lendir, suffix, sizeof (suffix)); + + return open_temp_exec_file_name (tempname); +} + +/* Open a temporary file in the directory in the named environment + variable. */ +static int +open_temp_exec_file_env (const char *envvar) +{ + const char *value = getenv (envvar); + + if (!value) + return -1; + + return open_temp_exec_file_dir (value); +} + +#ifdef HAVE_MNTENT +/* Open a temporary file in an executable and writable mount point + listed in the mounts file. Subsequent calls with the same mounts + keep searching for mount points in the same file. Providing NULL + as the mounts file closes the file. */ +static int +open_temp_exec_file_mnt (const char *mounts) +{ + static const char *last_mounts; + static FILE *last_mntent; + + if (mounts != last_mounts) + { + if (last_mntent) + endmntent (last_mntent); + + last_mounts = mounts; + + if (mounts) + last_mntent = setmntent (mounts, "r"); + else + last_mntent = NULL; + } + + if (!last_mntent) + return -1; + + for (;;) + { + int fd; + struct mntent mnt; + char buf[MAXPATHLEN * 3]; + + if (getmntent_r (last_mntent, &mnt, buf, sizeof (buf)) == NULL) + return -1; + + if (hasmntopt (&mnt, "ro") + || hasmntopt (&mnt, "noexec") + || access (mnt.mnt_dir, W_OK)) + continue; + + fd = open_temp_exec_file_dir (mnt.mnt_dir); + + if (fd != -1) + return fd; + } +} +#endif /* HAVE_MNTENT */ + +/* Instructions to look for a location to hold a temporary file that + can be mapped in for execution. */ +static struct +{ + int (*func)(const char *); + const char *arg; + int repeat; +} open_temp_exec_file_opts[] = { + { open_temp_exec_file_env, "TMPDIR", 0 }, + { open_temp_exec_file_dir, "/tmp", 0 }, + { open_temp_exec_file_dir, "/var/tmp", 0 }, + { open_temp_exec_file_dir, "/dev/shm", 0 }, + { open_temp_exec_file_env, "HOME", 0 }, +#ifdef HAVE_MNTENT + { open_temp_exec_file_mnt, "/etc/mtab", 1 }, + { open_temp_exec_file_mnt, "/proc/mounts", 1 }, +#endif /* HAVE_MNTENT */ +}; + +/* Current index into open_temp_exec_file_opts. */ +static int open_temp_exec_file_opts_idx = 0; + +/* Reset a current multi-call func, then advances to the next entry. + If we're at the last, go back to the first and return nonzero, + otherwise return zero. */ +static int +open_temp_exec_file_opts_next (void) +{ + if (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat) + open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func (NULL); + + open_temp_exec_file_opts_idx++; + if (open_temp_exec_file_opts_idx + == (sizeof (open_temp_exec_file_opts) + / sizeof (*open_temp_exec_file_opts))) + { + open_temp_exec_file_opts_idx = 0; + return 1; + } + + return 0; +} + +/* Return a file descriptor of a temporary zero-sized file in a + writable and exexutable filesystem. */ +static int +open_temp_exec_file (void) +{ + int fd; + + do + { + fd = open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func + (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].arg); + + if (!open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat + || fd == -1) + { + if (open_temp_exec_file_opts_next ()) + break; + } + } + while (fd == -1); + + return fd; +} + +/* Map in a chunk of memory from the temporary exec file into separate + locations in the virtual memory address space, one writable and one + executable. Returns the address of the writable portion, after + storing an offset to the corresponding executable portion at the + last word of the requested chunk. */ +static void * +dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset) +{ + void *ptr; + + if (execfd == -1) + { + open_temp_exec_file_opts_idx = 0; + retry_open: + execfd = open_temp_exec_file (); + if (execfd == -1) + return MFAIL; + } + + offset = execsize; + + if (ftruncate (execfd, offset + length)) + return MFAIL; + + flags &= ~(MAP_PRIVATE | MAP_ANONYMOUS); + flags |= MAP_SHARED; + + ptr = mmap (NULL, length, (prot & ~PROT_WRITE) | PROT_EXEC, + flags, execfd, offset); + if (ptr == MFAIL) + { + if (!offset) + { + close (execfd); + goto retry_open; + } + ftruncate (execfd, offset); + return MFAIL; + } + else if (!offset + && open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat) + open_temp_exec_file_opts_next (); + + start = mmap (start, length, prot, flags, execfd, offset); + + if (start == MFAIL) + { + munmap (ptr, length); + ftruncate (execfd, offset); + return start; + } + + mmap_exec_offset ((char *)start, length) = (char*)ptr - (char*)start; + + execsize += length; + + return start; +} + +/* Map in a writable and executable chunk of memory if possible. + Failing that, fall back to dlmmap_locked. */ +static void * +dlmmap (void *start, size_t length, int prot, + int flags, int fd, off_t offset) +{ + void *ptr; + + assert (start == NULL && length % malloc_getpagesize == 0 + && prot == (PROT_READ | PROT_WRITE) + && flags == (MAP_PRIVATE | MAP_ANONYMOUS) + && fd == -1 && offset == 0); + +#if FFI_CLOSURE_TEST + printf ("mapping in %zi\n", length); +#endif + + if (execfd == -1 && is_emutramp_enabled ()) + { + ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset); + return ptr; + } + + if (execfd == -1 && !is_selinux_enabled ()) + { + ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset); + + if (ptr != MFAIL || (errno != EPERM && errno != EACCES)) + /* Cool, no need to mess with separate segments. */ + return ptr; + + /* If MREMAP_DUP is ever introduced and implemented, try mmap + with ((prot & ~PROT_WRITE) | PROT_EXEC) and mremap with + MREMAP_DUP and prot at this point. */ + } + + if (execsize == 0 || execfd == -1) + { + pthread_mutex_lock (&open_temp_exec_file_mutex); + ptr = dlmmap_locked (start, length, prot, flags, offset); + pthread_mutex_unlock (&open_temp_exec_file_mutex); + + return ptr; + } + + return dlmmap_locked (start, length, prot, flags, offset); +} + +/* Release memory at the given address, as well as the corresponding + executable page if it's separate. */ +static int +dlmunmap (void *start, size_t length) +{ + /* We don't bother decreasing execsize or truncating the file, since + we can't quite tell whether we're unmapping the end of the file. + We don't expect frequent deallocation anyway. If we did, we + could locate pages in the file by writing to the pages being + deallocated and checking that the file contents change. + Yuck. */ + msegmentptr seg = segment_holding (gm, start); + void *code; + +#if FFI_CLOSURE_TEST + printf ("unmapping %zi\n", length); +#endif + + if (seg && (code = add_segment_exec_offset (start, seg)) != start) + { + int ret = munmap (code, length); + if (ret) + return ret; + } + + return munmap (start, length); +} + +#if FFI_CLOSURE_FREE_CODE +/* Return segment holding given code address. */ +static msegmentptr +segment_holding_code (mstate m, char* addr) +{ + msegmentptr sp = &m->seg; + for (;;) { + if (addr >= add_segment_exec_offset (sp->base, sp) + && addr < add_segment_exec_offset (sp->base, sp) + sp->size) + return sp; + if ((sp = sp->next) == 0) + return 0; + } +} +#endif + +#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ + +/* Allocate a chunk of memory with the given size. Returns a pointer + to the writable address, and sets *CODE to the executable + corresponding virtual address. */ +void * +ffi_closure_alloc (size_t size, void **code) +{ + *code = malloc(size); + return *code; +#if 0 + void *ptr; + + if (!code) + return NULL; + + ptr = dlmalloc (size); + + if (ptr) + { + msegmentptr seg = segment_holding (gm, ptr); + + *code = add_segment_exec_offset (ptr, seg); + } + + return ptr; +#endif +} + +/* Release a chunk of memory allocated with ffi_closure_alloc. If + FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the + writable or the executable address given. Otherwise, only the + writable address can be provided here. */ +void +ffi_closure_free (void *ptr) +{ +#if 0 +#if FFI_CLOSURE_FREE_CODE + msegmentptr seg = segment_holding_code(gm, ptr); + + if (seg) + ptr = sub_segment_exec_offset(ptr, seg); +#endif + + dlfree(ptr); +#endif + free(ptr); +} + + +#if FFI_CLOSURE_TEST +/* Do some internal sanity testing to make sure allocation and + deallocation of pages are working as intended. */ +int main () +{ + void *p[3]; +#define GET(idx, len) do { p[idx] = dlmalloc (len); printf ("allocated %zi for p[%i]\n", (len), (idx)); } while (0) +#define PUT(idx) do { printf ("freeing p[%i]\n", (idx)); dlfree (p[idx]); } while (0) + GET (0, malloc_getpagesize / 2); + GET (1, 2 * malloc_getpagesize - 64 * sizeof (void*)); + PUT (1); + GET (1, 2 * malloc_getpagesize); + GET (2, malloc_getpagesize / 2); + PUT (1); + PUT (0); + PUT (2); + return 0; +} +#endif /* FFI_CLOSURE_TEST */ +# else /* ! FFI_MMAP_EXEC_WRIT */ + +/* On many systems, memory returned by malloc is writable and + executable, so just use it. */ + +#include <stdlib.h> + +void * +ffi_closure_alloc (size_t size, void **code) +{ + if (!code) + return NULL; + + return *code = malloc (size); +} + +void +ffi_closure_free (void *ptr) +{ + free (ptr); +} + +# endif /* ! FFI_MMAP_EXEC_WRIT */ +#endif /* FFI_CLOSURES */ diff --git a/lib/wrappers/libffi/gcc/ffi.c b/lib/wrappers/libffi/gcc/ffi.c new file mode 100644 index 0000000000..0600414d45 --- /dev/null +++ b/lib/wrappers/libffi/gcc/ffi.c @@ -0,0 +1,841 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc. + Copyright (c) 2002 Ranjit Mathew + Copyright (c) 2002 Bo Thorsen + Copyright (c) 2002 Roger Sayle + Copyright (C) 2008, 2010 Free Software Foundation, Inc. + + x86 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#if !defined(__x86_64__) || defined(_WIN64) + +#ifdef _WIN64 +#include <windows.h> +#endif + +#include <ffi.h> +#include <ffi_common.h> + +#include <stdlib.h> + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +void ffi_prep_args(char *stack, extended_cif *ecif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; +#ifdef X86_WIN32 + size_t p_stack_args[2]; + void *p_stack_data[2]; + char *argp2 = stack; + int stack_args_count = 0; + int cabi = ecif->cif->abi; +#endif + + argp = stack; + + if ((ecif->cif->flags == FFI_TYPE_STRUCT + || ecif->cif->flags == FFI_TYPE_MS_STRUCT) +#ifdef X86_WIN64 + && (ecif->cif->rtype->size != 1 && ecif->cif->rtype->size != 2 + && ecif->cif->rtype->size != 4 && ecif->cif->rtype->size != 8) +#endif + ) + { + *(void **) argp = ecif->rvalue; +#ifdef X86_WIN32 + /* For fastcall/thiscall this is first register-passed + argument. */ + if (cabi == FFI_THISCALL || cabi == FFI_FASTCALL) + { + p_stack_args[stack_args_count] = sizeof (void*); + p_stack_data[stack_args_count] = argp; + ++stack_args_count; + } +#endif + argp += sizeof(void*); + } + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + i != 0; + i--, p_arg++) + { + size_t z; + + /* Align if necessary */ + if ((sizeof(void*) - 1) & (size_t) argp) + argp = (char *) ALIGN(argp, sizeof(void*)); + + z = (*p_arg)->size; +#ifdef X86_WIN64 + if (z > sizeof(ffi_arg) + || ((*p_arg)->type == FFI_TYPE_STRUCT + && (z != 1 && z != 2 && z != 4 && z != 8)) +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + || ((*p_arg)->type == FFI_TYPE_LONGDOUBLE) +#endif + ) + { + z = sizeof(ffi_arg); + *(void **)argp = *p_argv; + } + else if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + memcpy(argp, *p_argv, z); + } + else +#endif + if (z < sizeof(ffi_arg)) + { + z = sizeof(ffi_arg); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(ffi_sarg *) argp = (ffi_sarg)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(ffi_arg *) argp = (ffi_arg)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(ffi_sarg *) argp = (ffi_sarg)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(ffi_arg *) argp = (ffi_arg)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_SINT32: + *(ffi_sarg *) argp = (ffi_sarg)*(SINT32 *)(* p_argv); + break; + + case FFI_TYPE_UINT32: + *(ffi_arg *) argp = (ffi_arg)*(UINT32 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: + *(ffi_arg *) argp = *(ffi_arg *)(* p_argv); + break; + + default: + FFI_ASSERT(0); + } + } + else + { + memcpy(argp, *p_argv, z); + } + +#ifdef X86_WIN32 + /* For thiscall/fastcall convention register-passed arguments + are the first two none-floating-point arguments with a size + smaller or equal to sizeof (void*). */ + if ((cabi == FFI_THISCALL && stack_args_count < 1) + || (cabi == FFI_FASTCALL && stack_args_count < 2)) + { + if (z <= 4 + && ((*p_arg)->type != FFI_TYPE_FLOAT + && (*p_arg)->type != FFI_TYPE_STRUCT)) + { + p_stack_args[stack_args_count] = z; + p_stack_data[stack_args_count] = argp; + ++stack_args_count; + } + } +#endif + p_argv++; +#ifdef X86_WIN64 + argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1); +#else + argp += z; +#endif + } + +#ifdef X86_WIN32 + /* We need to move the register-passed arguments for thiscall/fastcall + on top of stack, so that those can be moved to registers ecx/edx by + call-handler. */ + if (stack_args_count > 0) + { + size_t zz = (p_stack_args[0] + 3) & ~3; + char *h; + + /* Move first argument to top-stack position. */ + if (p_stack_data[0] != argp2) + { + h = alloca (zz + 1); + memcpy (h, p_stack_data[0], zz); + memmove (argp2 + zz, argp2, + (size_t) ((char *) p_stack_data[0] - (char*)argp2)); + memcpy (argp2, h, zz); + } + + argp2 += zz; + --stack_args_count; + if (zz > 4) + stack_args_count = 0; + + /* If we have a second argument, then move it on top + after the first one. */ + if (stack_args_count > 0 && p_stack_data[1] != argp2) + { + zz = p_stack_args[1]; + zz = (zz + 3) & ~3; + h = alloca (zz + 1); + h = alloca (zz + 1); + memcpy (h, p_stack_data[1], zz); + memmove (argp2 + zz, argp2, (size_t) ((char*) p_stack_data[1] - (char*)argp2)); + memcpy (argp2, h, zz); + } + } +#endif + return; +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + unsigned int i; + ffi_type **ptr; + + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + case FFI_TYPE_UINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT8: + case FFI_TYPE_SINT16: +#ifdef X86_WIN64 + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: +#endif + case FFI_TYPE_SINT64: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: +#ifndef X86_WIN64 +#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: +#endif +#endif + cif->flags = (unsigned) cif->rtype->type; + break; + + case FFI_TYPE_UINT64: +#ifdef X86_WIN64 + case FFI_TYPE_POINTER: +#endif + cif->flags = FFI_TYPE_SINT64; + break; + + case FFI_TYPE_STRUCT: +#ifndef X86 + if (cif->rtype->size == 1) + { + cif->flags = FFI_TYPE_SMALL_STRUCT_1B; /* same as char size */ + } + else if (cif->rtype->size == 2) + { + cif->flags = FFI_TYPE_SMALL_STRUCT_2B; /* same as short size */ + } + else if (cif->rtype->size == 4) + { +#ifdef X86_WIN64 + cif->flags = FFI_TYPE_SMALL_STRUCT_4B; +#else + cif->flags = FFI_TYPE_INT; /* same as int type */ +#endif + } + else if (cif->rtype->size == 8) + { + cif->flags = FFI_TYPE_SINT64; /* same as int64 type */ + } + else +#endif + { +#ifdef X86_WIN32 + if (cif->abi == FFI_MS_CDECL) + cif->flags = FFI_TYPE_MS_STRUCT; + else +#endif + cif->flags = FFI_TYPE_STRUCT; + /* allocate space for return value pointer */ + cif->bytes += ALIGN(sizeof(void*), FFI_SIZEOF_ARG); + } + break; + + default: +#ifdef X86_WIN64 + cif->flags = FFI_TYPE_SINT64; + break; + case FFI_TYPE_INT: + cif->flags = FFI_TYPE_SINT32; +#else + cif->flags = FFI_TYPE_INT; +#endif + break; + } + + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) + { + if (((*ptr)->alignment - 1) & cif->bytes) + cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment); + cif->bytes += ALIGN((*ptr)->size, FFI_SIZEOF_ARG); + } + +#ifdef X86_WIN64 + /* ensure space for storing four registers */ + cif->bytes += 4 * sizeof(ffi_arg); +#endif + + cif->bytes = (cif->bytes + 15) & ~0xF; + + return FFI_OK; +} + +#ifdef X86_WIN64 +extern int +ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *, + unsigned, unsigned, unsigned *, void (*fn)(void)); +#elif defined(X86_WIN32) +extern void +ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *, + unsigned, unsigned, unsigned, unsigned *, void (*fn)(void)); +#else +extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, + unsigned, unsigned, unsigned *, void (*fn)(void)); +#endif + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + +#ifdef X86_WIN64 + if (rvalue == NULL + && cif->flags == FFI_TYPE_STRUCT + && cif->rtype->size != 1 && cif->rtype->size != 2 + && cif->rtype->size != 4 && cif->rtype->size != 8) + { + ecif.rvalue = alloca((cif->rtype->size + 0xF) & ~0xF); + } +#else + if (rvalue == NULL + && (cif->flags == FFI_TYPE_STRUCT + || cif->flags == FFI_TYPE_MS_STRUCT)) + { + ecif.rvalue = alloca(cif->rtype->size); + } +#endif + else + ecif.rvalue = rvalue; + + + switch (cif->abi) + { +#ifdef X86_WIN64 + case FFI_WIN64: + ffi_call_win64(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; +#elif defined(X86_WIN32) + case FFI_SYSV: + case FFI_STDCALL: + case FFI_MS_CDECL: + ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + break; + case FFI_THISCALL: + case FFI_FASTCALL: + { + unsigned int abi = cif->abi; + unsigned int i, passed_regs = 0; + + if (cif->flags == FFI_TYPE_STRUCT) + ++passed_regs; + + for (i=0; i < cif->nargs && passed_regs < 2;i++) + { + size_t sz; + + if (cif->arg_types[i]->type == FFI_TYPE_FLOAT + || cif->arg_types[i]->type == FFI_TYPE_STRUCT) + continue; + sz = (cif->arg_types[i]->size + 3) & ~3; + if (sz == 0 || sz > 4) + continue; + ++passed_regs; + } + if (passed_regs < 2 && abi == FFI_FASTCALL) + abi = FFI_THISCALL; + if (passed_regs < 1 && abi == FFI_THISCALL) + abi = FFI_STDCALL; + ffi_call_win32(ffi_prep_args, &ecif, abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + } + break; +#else + case FFI_SYSV: + ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, + fn); + break; +#endif + default: + FFI_ASSERT(0); + break; + } +} + + +/** private members **/ + +/* The following __attribute__((regparm(1))) decorations will have no effect + on MSVC or SUNPRO_C -- standard conventions apply. */ +static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, + void** args, ffi_cif* cif); +void FFI_HIDDEN ffi_closure_SYSV (ffi_closure *) + __attribute__ ((regparm(1))); +unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *, void **, void *) + __attribute__ ((regparm(1))); +void FFI_HIDDEN ffi_closure_raw_SYSV (ffi_raw_closure *) + __attribute__ ((regparm(1))); +#ifdef X86_WIN32 +void FFI_HIDDEN ffi_closure_raw_THISCALL (ffi_raw_closure *) + __attribute__ ((regparm(1))); +void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *) + __attribute__ ((regparm(1))); +void FFI_HIDDEN ffi_closure_THISCALL (ffi_closure *) + __attribute__ ((regparm(1))); +#endif +#ifdef X86_WIN64 +void FFI_HIDDEN ffi_closure_win64 (ffi_closure *); +#endif + +/* This function is jumped to by the trampoline */ + +#ifdef X86_WIN64 +void * FFI_HIDDEN +ffi_closure_win64_inner (ffi_closure *closure, void *args) { + ffi_cif *cif; + void **arg_area; + void *result; + void *resp = &result; + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void*)); + + /* this call will initialize ARG_AREA, such that each + * element in that array points to the corresponding + * value on the stack; and if the function returns + * a structure, it will change RESP to point to the + * structure return address. */ + + ffi_prep_incoming_args_SYSV(args, &resp, arg_area, cif); + + (closure->fun) (cif, resp, arg_area, closure->user_data); + + /* The result is returned in rax. This does the right thing for + result types except for floats; we have to 'mov xmm0, rax' in the + caller to correct this. + TODO: structure sizes of 3 5 6 7 are returned by reference, too!!! + */ + return cif->rtype->size > sizeof(void *) ? resp : *(void **)resp; +} + +#else +unsigned int FFI_HIDDEN __attribute__ ((regparm(1))) +ffi_closure_SYSV_inner (ffi_closure *closure, void **respp, void *args) +{ + /* our various things... */ + ffi_cif *cif; + void **arg_area; + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void*)); + + /* this call will initialize ARG_AREA, such that each + * element in that array points to the corresponding + * value on the stack; and if the function returns + * a structure, it will change RESP to point to the + * structure return address. */ + + ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif); + + (closure->fun) (cif, *respp, arg_area, closure->user_data); + + return cif->flags; +} +#endif /* !X86_WIN64 */ + +static void +ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue, + ffi_cif *cif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + +#ifdef X86_WIN64 + if (cif->rtype->size > sizeof(ffi_arg) + || (cif->flags == FFI_TYPE_STRUCT + && (cif->rtype->size != 1 && cif->rtype->size != 2 + && cif->rtype->size != 4 && cif->rtype->size != 8))) { + *rvalue = *(void **) argp; + argp += sizeof(void *); + } +#else + if ( cif->flags == FFI_TYPE_STRUCT + || cif->flags == FFI_TYPE_MS_STRUCT ) { + *rvalue = *(void **) argp; + argp += sizeof(void *); + } +#endif + + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) + { + size_t z; + + /* Align if necessary */ + if ((sizeof(void*) - 1) & (size_t) argp) { + argp = (char *) ALIGN(argp, sizeof(void*)); + } + +#ifdef X86_WIN64 + if ((*p_arg)->size > sizeof(ffi_arg) + || ((*p_arg)->type == FFI_TYPE_STRUCT + && ((*p_arg)->size != 1 && (*p_arg)->size != 2 + && (*p_arg)->size != 4 && (*p_arg)->size != 8))) + { + z = sizeof(void *); + *p_argv = *(void **)argp; + } + else +#endif + { + z = (*p_arg)->size; + + /* because we're little endian, this is what it turns into. */ + + *p_argv = (void*) argp; + } + + p_argv++; +#ifdef X86_WIN64 + argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1); +#else + argp += z; +#endif + } + + return; +} + +#define FFI_INIT_TRAMPOLINE_WIN64(TRAMP,FUN,CTX,MASK) \ +{ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + void* __fun = (void*)(FUN); \ + void* __ctx = (void*)(CTX); \ + *(unsigned char*) &__tramp[0] = 0x41; \ + *(unsigned char*) &__tramp[1] = 0xbb; \ + *(unsigned int*) &__tramp[2] = MASK; /* mov $mask, %r11 */ \ + *(unsigned char*) &__tramp[6] = 0x48; \ + *(unsigned char*) &__tramp[7] = 0xb8; \ + *(void**) &__tramp[8] = __ctx; /* mov __ctx, %rax */ \ + *(unsigned char *) &__tramp[16] = 0x49; \ + *(unsigned char *) &__tramp[17] = 0xba; \ + *(void**) &__tramp[18] = __fun; /* mov __fun, %r10 */ \ + *(unsigned char *) &__tramp[26] = 0x41; \ + *(unsigned char *) &__tramp[27] = 0xff; \ + *(unsigned char *) &__tramp[28] = 0xe2; /* jmp %r10 */ \ + } + +/* How to make a trampoline. Derived from gcc/config/i386/i386.c. */ + +#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ +{ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned int __dis = __fun - (__ctx + 10); \ + *(unsigned char*) &__tramp[0] = 0xb8; \ + *(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \ + *(unsigned char *) &__tramp[5] = 0xe9; \ + *(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \ + } + +#define FFI_INIT_TRAMPOLINE_THISCALL(TRAMP,FUN,CTX,SIZE) \ +{ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned int __dis = __fun - (__ctx + 49); \ + unsigned short __size = (unsigned short)(SIZE); \ + *(unsigned int *) &__tramp[0] = 0x8324048b; /* mov (%esp), %eax */ \ + *(unsigned int *) &__tramp[4] = 0x4c890cec; /* sub $12, %esp */ \ + *(unsigned int *) &__tramp[8] = 0x04890424; /* mov %ecx, 4(%esp) */ \ + *(unsigned char*) &__tramp[12] = 0x24; /* mov %eax, (%esp) */ \ + *(unsigned char*) &__tramp[13] = 0xb8; \ + *(unsigned int *) &__tramp[14] = __size; /* mov __size, %eax */ \ + *(unsigned int *) &__tramp[18] = 0x08244c8d; /* lea 8(%esp), %ecx */ \ + *(unsigned int *) &__tramp[22] = 0x4802e8c1; /* shr $2, %eax ; dec %eax */ \ + *(unsigned short*) &__tramp[26] = 0x0b74; /* jz 1f */ \ + *(unsigned int *) &__tramp[28] = 0x8908518b; /* 2b: mov 8(%ecx), %edx */ \ + *(unsigned int *) &__tramp[32] = 0x04c18311; /* mov %edx, (%ecx) ; add $4, %ecx */ \ + *(unsigned char*) &__tramp[36] = 0x48; /* dec %eax */ \ + *(unsigned short*) &__tramp[37] = 0xf575; /* jnz 2b ; 1f: */ \ + *(unsigned char*) &__tramp[39] = 0xb8; \ + *(unsigned int*) &__tramp[40] = __ctx; /* movl __ctx, %eax */ \ + *(unsigned char *) &__tramp[44] = 0xe8; \ + *(unsigned int*) &__tramp[45] = __dis; /* call __fun */ \ + *(unsigned char*) &__tramp[49] = 0xc2; /* ret */ \ + *(unsigned short*) &__tramp[50] = (__size + 8); /* ret (__size + 8) */ \ + } + +#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX,SIZE) \ +{ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned int __dis = __fun - (__ctx + 10); \ + unsigned short __size = (unsigned short)(SIZE); \ + *(unsigned char*) &__tramp[0] = 0xb8; \ + *(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \ + *(unsigned char *) &__tramp[5] = 0xe8; \ + *(unsigned int*) &__tramp[6] = __dis; /* call __fun */ \ + *(unsigned char *) &__tramp[10] = 0xc2; \ + *(unsigned short*) &__tramp[11] = __size; /* ret __size */ \ + } + +/* the cif must already be prep'ed */ + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ +#ifdef X86_WIN64 +#define ISFLOAT(IDX) (cif->arg_types[IDX]->type == FFI_TYPE_FLOAT || cif->arg_types[IDX]->type == FFI_TYPE_DOUBLE) +#define FLAG(IDX) (cif->nargs>(IDX)&&ISFLOAT(IDX)?(1<<(IDX)):0) + if (cif->abi == FFI_WIN64) + { + int mask = FLAG(0)|FLAG(1)|FLAG(2)|FLAG(3); + FFI_INIT_TRAMPOLINE_WIN64 (&closure->tramp[0], + &ffi_closure_win64, + codeloc, mask); + /* make sure we can execute here */ + } +#else + if (cif->abi == FFI_SYSV) + { + FFI_INIT_TRAMPOLINE (&closure->tramp[0], + &ffi_closure_SYSV, + (void*)codeloc); + } +#ifdef X86_WIN32 + else if (cif->abi == FFI_THISCALL) + { + FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], + &ffi_closure_THISCALL, + (void*)codeloc, + cif->bytes); + } + else if (cif->abi == FFI_STDCALL) + { + FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0], + &ffi_closure_STDCALL, + (void*)codeloc, cif->bytes); + } + else if (cif->abi == FFI_MS_CDECL) + { + FFI_INIT_TRAMPOLINE (&closure->tramp[0], + &ffi_closure_SYSV, + (void*)codeloc); + } +#endif /* X86_WIN32 */ +#endif /* !X86_WIN64 */ + else + { + return FFI_BAD_ABI; + } + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + +/* ------- Native raw API support -------------------------------- */ + +#if !FFI_NO_RAW_API + +ffi_status +ffi_prep_raw_closure_loc (ffi_raw_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data, + void *codeloc) +{ + int i; + + if (cif->abi != FFI_SYSV) { +#ifdef X86_WIN32 + if (cif->abi != FFI_THISCALL) +#endif + return FFI_BAD_ABI; + } + + /* we currently don't support certain kinds of arguments for raw + closures. This should be implemented by a separate assembly + language routine, since it would require argument processing, + something we don't do now for performance. */ + + for (i = cif->nargs-1; i >= 0; i--) + { + FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_STRUCT); + FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE); + } + +#ifdef X86_WIN32 + if (cif->abi == FFI_SYSV) + { +#endif + FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV, + codeloc); +#ifdef X86_WIN32 + } + else if (cif->abi == FFI_THISCALL) + { + FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL, + codeloc, cif->bytes); + } +#endif + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + +static void +ffi_prep_args_raw(char *stack, extended_cif *ecif) +{ + memcpy (stack, ecif->avalue, ecif->cif->bytes); +} + +/* we borrow this routine from libffi (it must be changed, though, to + * actually call the function passed in the first argument. as of + * libffi-1.20, this is not the case.) + */ + +void +ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue) +{ + extended_cif ecif; + void **avalue = (void **)fake_avalue; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if (rvalue == NULL + && (cif->flags == FFI_TYPE_STRUCT + || cif->flags == FFI_TYPE_MS_STRUCT)) + { + ecif.rvalue = alloca(cif->rtype->size); + } + else + ecif.rvalue = rvalue; + + + switch (cif->abi) + { +#ifdef X86_WIN32 + case FFI_SYSV: + case FFI_STDCALL: + case FFI_MS_CDECL: + ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + break; + case FFI_THISCALL: + case FFI_FASTCALL: + { + unsigned int abi = cif->abi; + unsigned int i, passed_regs = 0; + + if (cif->flags == FFI_TYPE_STRUCT) + ++passed_regs; + + for (i=0; i < cif->nargs && passed_regs < 2;i++) + { + size_t sz; + + if (cif->arg_types[i]->type == FFI_TYPE_FLOAT + || cif->arg_types[i]->type == FFI_TYPE_STRUCT) + continue; + sz = (cif->arg_types[i]->size + 3) & ~3; + if (sz == 0 || sz > 4) + continue; + ++passed_regs; + } + if (passed_regs < 2 && abi == FFI_FASTCALL) + cif->abi = abi = FFI_THISCALL; + if (passed_regs < 1 && abi == FFI_THISCALL) + cif->abi = abi = FFI_STDCALL; + ffi_call_win32(ffi_prep_args_raw, &ecif, abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + } + break; +#else + case FFI_SYSV: + ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, + ecif.rvalue, fn); + break; +#endif + default: + FFI_ASSERT(0); + break; + } +} + +#endif + +#endif /* !__x86_64__ || X86_WIN64 */ + diff --git a/lib/wrappers/libffi/gcc/ffi64.c b/lib/wrappers/libffi/gcc/ffi64.c new file mode 100644 index 0000000000..2014af24c6 --- /dev/null +++ b/lib/wrappers/libffi/gcc/ffi64.c @@ -0,0 +1,673 @@ +/* ----------------------------------------------------------------------- + ffi64.c - Copyright (c) 2013 The Written Word, Inc. + Copyright (c) 2011 Anthony Green + Copyright (c) 2008, 2010 Red Hat, Inc. + Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de> + + x86-64 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include <ffi.h> +#include <ffi_common.h> + +#include <stdlib.h> +#include <stdarg.h> + +#ifdef __x86_64__ + +#define MAX_GPR_REGS 6 +#define MAX_SSE_REGS 8 + +#if defined(__INTEL_COMPILER) +#define UINT128 __m128 +#else +#if defined(__SUNPRO_C) +#include <sunmedia_types.h> +#define UINT128 __m128i +#else +#define UINT128 __int128_t +#endif +#endif + +union big_int_union +{ + UINT32 i32; + UINT64 i64; + UINT128 i128; +}; + +struct register_args +{ + /* Registers for argument passing. */ + UINT64 gpr[MAX_GPR_REGS]; + union big_int_union sse[MAX_SSE_REGS]; +}; + +extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, + void *raddr, void (*fnaddr)(void), unsigned ssecount); + +/* All reference to register classes here is identical to the code in + gcc/config/i386/i386.c. Do *not* change one without the other. */ + +/* Register class used for passing given 64bit part of the argument. + These represent classes as documented by the PS ABI, with the + exception of SSESF, SSEDF classes, that are basically SSE class, + just gcc will use SF or DFmode move instead of DImode to avoid + reformatting penalties. + + Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves + whenever possible (upper half does contain padding). */ +enum x86_64_reg_class + { + X86_64_NO_CLASS, + X86_64_INTEGER_CLASS, + X86_64_INTEGERSI_CLASS, + X86_64_SSE_CLASS, + X86_64_SSESF_CLASS, + X86_64_SSEDF_CLASS, + X86_64_SSEUP_CLASS, + X86_64_X87_CLASS, + X86_64_X87UP_CLASS, + X86_64_COMPLEX_X87_CLASS, + X86_64_MEMORY_CLASS + }; + +#define MAX_CLASSES 4 + +#define SSE_CLASS_P(X) ((X) >= X86_64_SSE_CLASS && X <= X86_64_SSEUP_CLASS) + +/* x86-64 register passing implementation. See x86-64 ABI for details. Goal + of this code is to classify each 8bytes of incoming argument by the register + class and assign registers accordingly. */ + +/* Return the union class of CLASS1 and CLASS2. + See the x86-64 PS ABI for details. */ + +static enum x86_64_reg_class +merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) +{ + /* Rule #1: If both classes are equal, this is the resulting class. */ + if (class1 == class2) + return class1; + + /* Rule #2: If one of the classes is NO_CLASS, the resulting class is + the other class. */ + if (class1 == X86_64_NO_CLASS) + return class2; + if (class2 == X86_64_NO_CLASS) + return class1; + + /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ + if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) + return X86_64_MEMORY_CLASS; + + /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ + if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) + || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) + return X86_64_INTEGERSI_CLASS; + if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS + || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) + return X86_64_INTEGER_CLASS; + + /* Rule #5: If one of the classes is X87, X87UP, or COMPLEX_X87 class, + MEMORY is used. */ + if (class1 == X86_64_X87_CLASS + || class1 == X86_64_X87UP_CLASS + || class1 == X86_64_COMPLEX_X87_CLASS + || class2 == X86_64_X87_CLASS + || class2 == X86_64_X87UP_CLASS + || class2 == X86_64_COMPLEX_X87_CLASS) + return X86_64_MEMORY_CLASS; + + /* Rule #6: Otherwise class SSE is used. */ + return X86_64_SSE_CLASS; +} + +/* Classify the argument of type TYPE and mode MODE. + CLASSES will be filled by the register class used to pass each word + of the operand. The number of words is returned. In case the parameter + should be passed in memory, 0 is returned. As a special case for zero + sized containers, classes[0] will be NO_CLASS and 1 is returned. + + See the x86-64 PS ABI for details. +*/ +static int +classify_argument (ffi_type *type, enum x86_64_reg_class classes[], + size_t byte_offset) +{ + switch (type->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + { + int size = byte_offset + type->size; + + if (size <= 4) + { + classes[0] = X86_64_INTEGERSI_CLASS; + return 1; + } + else if (size <= 8) + { + classes[0] = X86_64_INTEGER_CLASS; + return 1; + } + else if (size <= 12) + { + classes[0] = X86_64_INTEGER_CLASS; + classes[1] = X86_64_INTEGERSI_CLASS; + return 2; + } + else if (size <= 16) + { + classes[0] = classes[1] = X86_64_INTEGERSI_CLASS; + return 2; + } + else + FFI_ASSERT (0); + } + case FFI_TYPE_FLOAT: + if (!(byte_offset % 8)) + classes[0] = X86_64_SSESF_CLASS; + else + classes[0] = X86_64_SSE_CLASS; + return 1; + case FFI_TYPE_DOUBLE: + classes[0] = X86_64_SSEDF_CLASS; + return 1; + case FFI_TYPE_LONGDOUBLE: + classes[0] = X86_64_X87_CLASS; + classes[1] = X86_64_X87UP_CLASS; + return 2; + case FFI_TYPE_STRUCT: + { + const int UNITS_PER_WORD = 8; + int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + ffi_type **ptr; + int i; + enum x86_64_reg_class subclasses[MAX_CLASSES]; + + /* If the struct is larger than 32 bytes, pass it on the stack. */ + if (type->size > 32) + return 0; + + for (i = 0; i < words; i++) + classes[i] = X86_64_NO_CLASS; + + /* Zero sized arrays or structures are NO_CLASS. We return 0 to + signalize memory class, so handle it as special case. */ + if (!words) + { + classes[0] = X86_64_NO_CLASS; + return 1; + } + + /* Merge the fields of structure. */ + for (ptr = type->elements; *ptr != NULL; ptr++) + { + int num; + + byte_offset = ALIGN (byte_offset, (*ptr)->alignment); + + num = classify_argument (*ptr, subclasses, byte_offset % 8); + if (num == 0) + return 0; + for (i = 0; i < num; i++) + { + int pos = byte_offset / 8; + classes[i + pos] = + merge_classes (subclasses[i], classes[i + pos]); + } + + byte_offset += (*ptr)->size; + } + + if (words > 2) + { + /* When size > 16 bytes, if the first one isn't + X86_64_SSE_CLASS or any other ones aren't + X86_64_SSEUP_CLASS, everything should be passed in + memory. */ + if (classes[0] != X86_64_SSE_CLASS) + return 0; + + for (i = 1; i < words; i++) + if (classes[i] != X86_64_SSEUP_CLASS) + return 0; + } + + /* Final merger cleanup. */ + for (i = 0; i < words; i++) + { + /* If one class is MEMORY, everything should be passed in + memory. */ + if (classes[i] == X86_64_MEMORY_CLASS) + return 0; + + /* The X86_64_SSEUP_CLASS should be always preceded by + X86_64_SSE_CLASS or X86_64_SSEUP_CLASS. */ + if (classes[i] == X86_64_SSEUP_CLASS + && classes[i - 1] != X86_64_SSE_CLASS + && classes[i - 1] != X86_64_SSEUP_CLASS) + { + /* The first one should never be X86_64_SSEUP_CLASS. */ + FFI_ASSERT (i != 0); + classes[i] = X86_64_SSE_CLASS; + } + + /* If X86_64_X87UP_CLASS isn't preceded by X86_64_X87_CLASS, + everything should be passed in memory. */ + if (classes[i] == X86_64_X87UP_CLASS + && (classes[i - 1] != X86_64_X87_CLASS)) + { + /* The first one should never be X86_64_X87UP_CLASS. */ + FFI_ASSERT (i != 0); + return 0; + } + } + return words; + } + + default: + FFI_ASSERT(0); + } + return 0; /* Never reached. */ +} + +/* Examine the argument and return set number of register required in each + class. Return zero iff parameter should be passed in memory, otherwise + the number of registers. */ + +static int +examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES], + _Bool in_return, int *pngpr, int *pnsse) +{ + int i, n, ngpr, nsse; + + n = classify_argument (type, classes, 0); + if (n == 0) + return 0; + + ngpr = nsse = 0; + for (i = 0; i < n; ++i) + switch (classes[i]) + { + case X86_64_INTEGER_CLASS: + case X86_64_INTEGERSI_CLASS: + ngpr++; + break; + case X86_64_SSE_CLASS: + case X86_64_SSESF_CLASS: + case X86_64_SSEDF_CLASS: + nsse++; + break; + case X86_64_NO_CLASS: + case X86_64_SSEUP_CLASS: + break; + case X86_64_X87_CLASS: + case X86_64_X87UP_CLASS: + case X86_64_COMPLEX_X87_CLASS: + return in_return != 0; + default: + abort (); + } + + *pngpr = ngpr; + *pnsse = nsse; + + return n; +} + +/* Perform machine dependent cif processing. */ + +ffi_status +ffi_prep_cif_machdep (ffi_cif *cif) +{ + int gprcount, ssecount, i, avn, n, ngpr, nsse, flags; + enum x86_64_reg_class classes[MAX_CLASSES]; + size_t bytes; + + gprcount = ssecount = 0; + + flags = cif->rtype->type; + if (flags != FFI_TYPE_VOID) + { + n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse); + if (n == 0) + { + /* The return value is passed in memory. A pointer to that + memory is the first argument. Allocate a register for it. */ + gprcount++; + /* We don't have to do anything in asm for the return. */ + flags = FFI_TYPE_VOID; + } + else if (flags == FFI_TYPE_STRUCT) + { + /* Mark which registers the result appears in. */ + _Bool sse0 = SSE_CLASS_P (classes[0]); + _Bool sse1 = n == 2 && SSE_CLASS_P (classes[1]); + if (sse0 && !sse1) + flags |= 1 << 8; + else if (!sse0 && sse1) + flags |= 1 << 9; + else if (sse0 && sse1) + flags |= 1 << 10; + /* Mark the true size of the structure. */ + flags |= cif->rtype->size << 12; + } + } + + /* Go over all arguments and determine the way they should be passed. + If it's in a register and there is space for it, let that be so. If + not, add it's size to the stack byte count. */ + for (bytes = 0, i = 0, avn = cif->nargs; i < avn; i++) + { + if (examine_argument (cif->arg_types[i], classes, 0, &ngpr, &nsse) == 0 + || gprcount + ngpr > MAX_GPR_REGS + || ssecount + nsse > MAX_SSE_REGS) + { + long align = cif->arg_types[i]->alignment; + + if (align < 8) + align = 8; + + bytes = ALIGN (bytes, align); + bytes += cif->arg_types[i]->size; + } + else + { + gprcount += ngpr; + ssecount += nsse; + } + } + if (ssecount) + flags |= 1 << 11; + cif->flags = flags; + cif->bytes = ALIGN (bytes, 8); + + return FFI_OK; +} + +void +ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + enum x86_64_reg_class classes[MAX_CLASSES]; + char *stack, *argp; + ffi_type **arg_types; + int gprcount, ssecount, ngpr, nsse, i, avn; + _Bool ret_in_memory; + struct register_args *reg_args; + + /* Can't call 32-bit mode from 64-bit mode. */ + FFI_ASSERT (cif->abi == FFI_UNIX64); + + /* If the return value is a struct and we don't have a return value + address then we need to make one. Note the setting of flags to + VOID above in ffi_prep_cif_machdep. */ + ret_in_memory = (cif->rtype->type == FFI_TYPE_STRUCT + && (cif->flags & 0xff) == FFI_TYPE_VOID); + if (rvalue == NULL && ret_in_memory) + rvalue = alloca (cif->rtype->size); + + /* Allocate the space for the arguments, plus 4 words of temp space. */ + stack = alloca (sizeof (struct register_args) + cif->bytes + 4*8); + reg_args = (struct register_args *) stack; + argp = stack + sizeof (struct register_args); + + gprcount = ssecount = 0; + + /* If the return value is passed in memory, add the pointer as the + first integer argument. */ + if (ret_in_memory) + reg_args->gpr[gprcount++] = (unsigned long) rvalue; + + avn = cif->nargs; + arg_types = cif->arg_types; + + for (i = 0; i < avn; ++i) + { + size_t size = arg_types[i]->size; + int n; + + n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); + if (n == 0 + || gprcount + ngpr > MAX_GPR_REGS + || ssecount + nsse > MAX_SSE_REGS) + { + long align = arg_types[i]->alignment; + + /* Stack arguments are *always* at least 8 byte aligned. */ + if (align < 8) + align = 8; + + /* Pass this argument in memory. */ + argp = (void *) ALIGN (argp, align); + memcpy (argp, avalue[i], size); + argp += size; + } + else + { + /* The argument is passed entirely in registers. */ + char *a = (char *) avalue[i]; + int j; + + for (j = 0; j < n; j++, a += 8, size -= 8) + { + switch (classes[j]) + { + case X86_64_INTEGER_CLASS: + case X86_64_INTEGERSI_CLASS: + /* Sign-extend integer arguments passed in general + purpose registers, to cope with the fact that + LLVM incorrectly assumes that this will be done + (the x86-64 PS ABI does not specify this). */ + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT8 *) a); + break; + case FFI_TYPE_SINT16: + *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT16 *) a); + break; + case FFI_TYPE_SINT32: + *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT32 *) a); + break; + default: + reg_args->gpr[gprcount] = 0; + memcpy (&reg_args->gpr[gprcount], a, size < 8 ? size : 8); + } + gprcount++; + break; + case X86_64_SSE_CLASS: + case X86_64_SSEDF_CLASS: + reg_args->sse[ssecount++].i64 = *(UINT64 *) a; + break; + case X86_64_SSESF_CLASS: + reg_args->sse[ssecount++].i32 = *(UINT32 *) a; + break; + default: + abort(); + } + } + } + } + + ffi_call_unix64 (stack, cif->bytes + sizeof (struct register_args), + cif->flags, rvalue, fn, ssecount); +} + + +extern void ffi_closure_unix64(void); + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data, + void *codeloc) +{ + volatile unsigned short *tramp; + + /* Sanity check on the cif ABI. */ + { + int abi = cif->abi; + if (UNLIKELY (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI))) + return FFI_BAD_ABI; + } + + tramp = (volatile unsigned short *) &closure->tramp[0]; + + tramp[0] = 0xbb49; /* mov <code>, %r11 */ + *((unsigned long long * volatile) &tramp[1]) + = (unsigned long) ffi_closure_unix64; + tramp[5] = 0xba49; /* mov <data>, %r10 */ + *((unsigned long long * volatile) &tramp[6]) + = (unsigned long) codeloc; + + /* Set the carry bit iff the function uses any sse registers. + This is clc or stc, together with the first byte of the jmp. */ + tramp[10] = cif->flags & (1 << 11) ? 0x49f9 : 0x49f8; + + tramp[11] = 0xe3ff; /* jmp *%r11 */ + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +int +ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue, + struct register_args *reg_args, char *argp) +{ + ffi_cif *cif; + void **avalue; + ffi_type **arg_types; + long i, avn; + int gprcount, ssecount, ngpr, nsse; + int ret; + + cif = closure->cif; + avalue = alloca(cif->nargs * sizeof(void *)); + gprcount = ssecount = 0; + + ret = cif->rtype->type; + if (ret != FFI_TYPE_VOID) + { + enum x86_64_reg_class classes[MAX_CLASSES]; + int n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse); + if (n == 0) + { + /* The return value goes in memory. Arrange for the closure + return value to go directly back to the original caller. */ + rvalue = (void *) (unsigned long) reg_args->gpr[gprcount++]; + /* We don't have to do anything in asm for the return. */ + ret = FFI_TYPE_VOID; + } + else if (ret == FFI_TYPE_STRUCT && n == 2) + { + /* Mark which register the second word of the structure goes in. */ + _Bool sse0 = SSE_CLASS_P (classes[0]); + _Bool sse1 = SSE_CLASS_P (classes[1]); + if (!sse0 && sse1) + ret |= 1 << 8; + else if (sse0 && !sse1) + ret |= 1 << 9; + } + } + + avn = cif->nargs; + arg_types = cif->arg_types; + + for (i = 0; i < avn; ++i) + { + enum x86_64_reg_class classes[MAX_CLASSES]; + int n; + + n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); + if (n == 0 + || gprcount + ngpr > MAX_GPR_REGS + || ssecount + nsse > MAX_SSE_REGS) + { + long align = arg_types[i]->alignment; + + /* Stack arguments are *always* at least 8 byte aligned. */ + if (align < 8) + align = 8; + + /* Pass this argument in memory. */ + argp = (void *) ALIGN (argp, align); + avalue[i] = argp; + argp += arg_types[i]->size; + } + /* If the argument is in a single register, or two consecutive + integer registers, then we can use that address directly. */ + else if (n == 1 + || (n == 2 && !(SSE_CLASS_P (classes[0]) + || SSE_CLASS_P (classes[1])))) + { + /* The argument is in a single register. */ + if (SSE_CLASS_P (classes[0])) + { + avalue[i] = &reg_args->sse[ssecount]; + ssecount += n; + } + else + { + avalue[i] = &reg_args->gpr[gprcount]; + gprcount += n; + } + } + /* Otherwise, allocate space to make them consecutive. */ + else + { + char *a = alloca (16); + int j; + + avalue[i] = a; + for (j = 0; j < n; j++, a += 8) + { + if (SSE_CLASS_P (classes[j])) + memcpy (a, &reg_args->sse[ssecount++], 8); + else + memcpy (a, &reg_args->gpr[gprcount++], 8); + } + } + } + + /* Invoke the closure. */ + closure->fun (cif, rvalue, avalue, closure->user_data); + + /* Tell assembly how to perform return type promotions. */ + return ret; +} + +#endif /* __x86_64__ */ diff --git a/lib/wrappers/libffi/gcc/prep_cif.c b/lib/wrappers/libffi/gcc/prep_cif.c new file mode 100644 index 0000000000..e8ec5cf1e6 --- /dev/null +++ b/lib/wrappers/libffi/gcc/prep_cif.c @@ -0,0 +1,237 @@ +/* ----------------------------------------------------------------------- + prep_cif.c - Copyright (c) 2011, 2012 Anthony Green + Copyright (c) 1996, 1998, 2007 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include <ffi.h> +#include <ffi_common.h> +#include <stdlib.h> + +/* Round up to FFI_SIZEOF_ARG. */ + +#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG) + +/* Perform machine independent initialization of aggregate type + specifications. */ + +static ffi_status initialize_aggregate(ffi_type *arg) +{ + ffi_type **ptr; + + if (UNLIKELY(arg == NULL || arg->elements == NULL)) + return FFI_BAD_TYPEDEF; + + arg->size = 0; + arg->alignment = 0; + + ptr = &(arg->elements[0]); + + if (UNLIKELY(ptr == 0)) + return FFI_BAD_TYPEDEF; + + while ((*ptr) != NULL) + { + if (UNLIKELY(((*ptr)->size == 0) + && (initialize_aggregate((*ptr)) != FFI_OK))) + return FFI_BAD_TYPEDEF; + + /* Perform a sanity check on the argument type */ + FFI_ASSERT_VALID_TYPE(*ptr); + + arg->size = ALIGN(arg->size, (*ptr)->alignment); + arg->size += (*ptr)->size; + + arg->alignment = (arg->alignment > (*ptr)->alignment) ? + arg->alignment : (*ptr)->alignment; + + ptr++; + } + + /* Structure size includes tail padding. This is important for + structures that fit in one register on ABIs like the PowerPC64 + Linux ABI that right justify small structs in a register. + It's also needed for nested structure layout, for example + struct A { long a; char b; }; struct B { struct A x; char y; }; + should find y at an offset of 2*sizeof(long) and result in a + total size of 3*sizeof(long). */ + arg->size = ALIGN (arg->size, arg->alignment); + + if (arg->size == 0) + return FFI_BAD_TYPEDEF; + else + return FFI_OK; +} + +#ifndef __CRIS__ +/* The CRIS ABI specifies structure elements to have byte + alignment only, so it completely overrides this functions, + which assumes "natural" alignment and padding. */ + +/* Perform machine independent ffi_cif preparation, then call + machine dependent routine. */ + +/* For non variadic functions isvariadic should be 0 and + nfixedargs==ntotalargs. + + For variadic calls, isvariadic should be 1 and nfixedargs + and ntotalargs set as appropriate. nfixedargs must always be >=1 */ + + +ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi, + unsigned int isvariadic, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, ffi_type **atypes) +{ + unsigned bytes = 0; + unsigned int i; + ffi_type **ptr; + + FFI_ASSERT(cif != NULL); + FFI_ASSERT((!isvariadic) || (nfixedargs >= 1)); + FFI_ASSERT(nfixedargs <= ntotalargs); + +#ifndef X86_WIN32 + if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)) + return FFI_BAD_ABI; +#else + if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI || abi == FFI_THISCALL)) + return FFI_BAD_ABI; +#endif + + cif->abi = abi; + cif->arg_types = atypes; + cif->nargs = ntotalargs; + cif->rtype = rtype; + + cif->flags = 0; + + /* Initialize the return type if necessary */ + if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK)) + return FFI_BAD_TYPEDEF; + + /* Perform a sanity check on the return type */ + FFI_ASSERT_VALID_TYPE(cif->rtype); + + /* x86, x86-64 and s390 stack space allocation is handled in prep_machdep. */ +#if !defined M68K && !defined X86_ANY && !defined S390 && !defined PA + /* Make space for the return structure pointer */ + if (cif->rtype->type == FFI_TYPE_STRUCT +#ifdef SPARC + && (cif->abi != FFI_V9 || cif->rtype->size > 32) +#endif +#ifdef TILE + && (cif->rtype->size > 10 * FFI_SIZEOF_ARG) +#endif +#ifdef XTENSA + && (cif->rtype->size > 16) +#endif + + ) + bytes = STACK_ARG_SIZE(sizeof(void*)); +#endif + + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) + { + + /* Initialize any uninitialized aggregate type definitions */ + if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) + return FFI_BAD_TYPEDEF; + + /* Perform a sanity check on the argument type, do this + check after the initialization. */ + FFI_ASSERT_VALID_TYPE(*ptr); + +#if !defined X86_ANY && !defined S390 && !defined PA +#ifdef SPARC + if (((*ptr)->type == FFI_TYPE_STRUCT + && ((*ptr)->size > 16 || cif->abi != FFI_V9)) + || ((*ptr)->type == FFI_TYPE_LONGDOUBLE + && cif->abi != FFI_V9)) + bytes += sizeof(void*); + else +#endif + { + /* Add any padding if necessary */ + if (((*ptr)->alignment - 1) & bytes) + bytes = ALIGN(bytes, (*ptr)->alignment); + +#ifdef TILE + if (bytes < 10 * FFI_SIZEOF_ARG && + bytes + STACK_ARG_SIZE((*ptr)->size) > 10 * FFI_SIZEOF_ARG) + { + /* An argument is never split between the 10 parameter + registers and the stack. */ + bytes = 10 * FFI_SIZEOF_ARG; + } +#endif +#ifdef XTENSA + if (bytes <= 6*4 && bytes + STACK_ARG_SIZE((*ptr)->size) > 6*4) + bytes = 6*4; +#endif + + bytes += STACK_ARG_SIZE((*ptr)->size); + } +#endif + } + + cif->bytes = bytes; + + /* Perform machine dependent cif processing */ +#ifdef FFI_TARGET_SPECIFIC_VARIADIC + if (isvariadic) + return ffi_prep_cif_machdep_var(cif, nfixedargs, ntotalargs); +#endif + + return ffi_prep_cif_machdep(cif); +} +#endif /* not __CRIS__ */ + +ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, + ffi_type *rtype, ffi_type **atypes) +{ + return ffi_prep_cif_core(cif, abi, 0, nargs, nargs, rtype, atypes); +} + +ffi_status ffi_prep_cif_var(ffi_cif *cif, + ffi_abi abi, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, + ffi_type **atypes) +{ + return ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes); +} + +#if FFI_CLOSURES + +ffi_status +ffi_prep_closure (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data) +{ + return ffi_prep_closure_loc (closure, cif, fun, user_data, closure); +} + +#endif diff --git a/lib/wrappers/libffi/gcc/types.c b/lib/wrappers/libffi/gcc/types.c new file mode 100644 index 0000000000..0a11eb0fb4 --- /dev/null +++ b/lib/wrappers/libffi/gcc/types.c @@ -0,0 +1,77 @@ +/* ----------------------------------------------------------------------- + types.c - Copyright (c) 1996, 1998 Red Hat, Inc. + + Predefined ffi_types needed by libffi. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +/* Hide the basic type definitions from the header file, so that we + can redefine them here as "const". */ +#define LIBFFI_HIDE_BASIC_TYPES + +#include <ffi.h> +#include <ffi_common.h> + +/* Type definitions */ + +#define FFI_TYPEDEF(name, type, id) \ +struct struct_align_##name { \ + char c; \ + type x; \ +}; \ +const ffi_type ffi_type_##name = { \ + sizeof(type), \ + offsetof(struct struct_align_##name, x), \ + id, NULL \ +} + +/* Size and alignment are fake here. They must not be 0. */ +const ffi_type ffi_type_void = { + 1, 1, FFI_TYPE_VOID, NULL +}; + +FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8); +FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8); +FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16); +FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16); +FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32); +FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32); +FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64); +FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64); + +FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER); + +FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT); +FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE); + +#ifdef __alpha__ +/* Even if we're not configured to default to 128-bit long double, + maintain binary compatibility, as -mlong-double-128 can be used + at any time. */ +/* Validate the hard-coded number below. */ +# if defined(__LONG_DOUBLE_128__) && FFI_TYPE_LONGDOUBLE != 4 +# error FFI_TYPE_LONGDOUBLE out of date +# endif +const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL }; +#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE); +#endif diff --git a/lib/wrappers/libffi/gcc/win32_asm.asm b/lib/wrappers/libffi/gcc/win32_asm.asm new file mode 100644 index 0000000000..ce3c4f3f38 --- /dev/null +++ b/lib/wrappers/libffi/gcc/win32_asm.asm @@ -0,0 +1,759 @@ +/* ----------------------------------------------------------------------- + win32.S - Copyright (c) 1996, 1998, 2001, 2002, 2009 Red Hat, Inc. + Copyright (c) 2001 John Beniton + Copyright (c) 2002 Ranjit Mathew + Copyright (c) 2009 Daniel Witte + + + X86 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- + */ + +#define LIBFFI_ASM +#include <fficonfig.h> +#include <ffi.h> +#include <ffitarget.h> + + .text + + // This assumes we are using gas. + .balign 16 + .globl _ffi_call_win32 +#ifndef __OS2__ + .def _ffi_call_win32; .scl 2; .type 32; .endef +#endif +_ffi_call_win32: +.LFB1: + pushl %ebp +.LCFI0: + movl %esp,%ebp +.LCFI1: + // Make room for all of the new args. + movl 20(%ebp),%ecx + subl %ecx,%esp + + movl %esp,%eax + + // Place all of the ffi_prep_args in position + pushl 12(%ebp) + pushl %eax + call *8(%ebp) + + // Return stack to previous state and call the function + addl $8,%esp + + // Handle fastcall and thiscall + cmpl $3, 16(%ebp) // FFI_THISCALL + jz .do_thiscall + cmpl $4, 16(%ebp) // FFI_FASTCALL + jnz .do_fncall + movl (%esp), %ecx + movl 4(%esp), %edx + addl $8, %esp + jmp .do_fncall +.do_thiscall: + movl (%esp), %ecx + addl $4, %esp + +.do_fncall: + + // FIXME: Align the stack to a 128-bit boundary to avoid + // potential performance hits. + + call *32(%ebp) + + // stdcall functions pop arguments off the stack themselves + + // Load %ecx with the return type code + movl 24(%ebp),%ecx + + // If the return value pointer is NULL, assume no return value. + cmpl $0,28(%ebp) + jne 0f + + // Even if there is no space for the return value, we are + // obliged to handle floating-point values. + cmpl $FFI_TYPE_FLOAT,%ecx + jne .Lnoretval + fstp %st(0) + + jmp .Lepilogue + +0: + call 1f + // Do not insert anything here between the call and the jump table. +.Lstore_table: + .long .Lnoretval /* FFI_TYPE_VOID */ + .long .Lretint /* FFI_TYPE_INT */ + .long .Lretfloat /* FFI_TYPE_FLOAT */ + .long .Lretdouble /* FFI_TYPE_DOUBLE */ + .long .Lretlongdouble /* FFI_TYPE_LONGDOUBLE */ + .long .Lretuint8 /* FFI_TYPE_UINT8 */ + .long .Lretsint8 /* FFI_TYPE_SINT8 */ + .long .Lretuint16 /* FFI_TYPE_UINT16 */ + .long .Lretsint16 /* FFI_TYPE_SINT16 */ + .long .Lretint /* FFI_TYPE_UINT32 */ + .long .Lretint /* FFI_TYPE_SINT32 */ + .long .Lretint64 /* FFI_TYPE_UINT64 */ + .long .Lretint64 /* FFI_TYPE_SINT64 */ + .long .Lretstruct /* FFI_TYPE_STRUCT */ + .long .Lretint /* FFI_TYPE_POINTER */ + .long .Lretstruct1b /* FFI_TYPE_SMALL_STRUCT_1B */ + .long .Lretstruct2b /* FFI_TYPE_SMALL_STRUCT_2B */ + .long .Lretstruct4b /* FFI_TYPE_SMALL_STRUCT_4B */ + .long .Lretstruct /* FFI_TYPE_MS_STRUCT */ +1: + add %ecx, %ecx + add %ecx, %ecx + add (%esp),%ecx + add $4, %esp + jmp *(%ecx) + + /* Sign/zero extend as appropriate. */ +.Lretsint8: + movsbl %al, %eax + jmp .Lretint + +.Lretsint16: + movswl %ax, %eax + jmp .Lretint + +.Lretuint8: + movzbl %al, %eax + jmp .Lretint + +.Lretuint16: + movzwl %ax, %eax + jmp .Lretint + +.Lretint: + // Load %ecx with the pointer to storage for the return value + movl 28(%ebp),%ecx + movl %eax,0(%ecx) + jmp .Lepilogue + +.Lretfloat: + // Load %ecx with the pointer to storage for the return value + movl 28(%ebp),%ecx + fstps (%ecx) + jmp .Lepilogue + +.Lretdouble: + // Load %ecx with the pointer to storage for the return value + movl 28(%ebp),%ecx + fstpl (%ecx) + jmp .Lepilogue + +.Lretlongdouble: + // Load %ecx with the pointer to storage for the return value + movl 28(%ebp),%ecx + fstpt (%ecx) + jmp .Lepilogue + +.Lretint64: + // Load %ecx with the pointer to storage for the return value + movl 28(%ebp),%ecx + movl %eax,0(%ecx) + movl %edx,4(%ecx) + jmp .Lepilogue + +.Lretstruct1b: + // Load %ecx with the pointer to storage for the return value + movl 28(%ebp),%ecx + movb %al,0(%ecx) + jmp .Lepilogue + +.Lretstruct2b: + // Load %ecx with the pointer to storage for the return value + movl 28(%ebp),%ecx + movw %ax,0(%ecx) + jmp .Lepilogue + +.Lretstruct4b: + // Load %ecx with the pointer to storage for the return value + movl 28(%ebp),%ecx + movl %eax,0(%ecx) + jmp .Lepilogue + +.Lretstruct: + // Nothing to do! + +.Lnoretval: +.Lepilogue: + movl %ebp,%esp + popl %ebp + ret +.ffi_call_win32_end: + .balign 16 + .globl _ffi_closure_THISCALL +#ifndef __OS2__ + .def _ffi_closure_THISCALL; .scl 2; .type 32; .endef +#endif +_ffi_closure_THISCALL: + pushl %ebp + movl %esp, %ebp + subl $40, %esp + leal -24(%ebp), %edx + movl %edx, -12(%ebp) /* resp */ + leal 12(%ebp), %edx /* account for stub return address on stack */ + jmp .stub +.LFE1: + + // This assumes we are using gas. + .balign 16 + .globl _ffi_closure_SYSV +#ifndef __OS2__ + .def _ffi_closure_SYSV; .scl 2; .type 32; .endef +#endif +_ffi_closure_SYSV: +.LFB3: + pushl %ebp +.LCFI4: + movl %esp, %ebp +.LCFI5: + subl $40, %esp + leal -24(%ebp), %edx + movl %edx, -12(%ebp) /* resp */ + leal 8(%ebp), %edx +.stub: + movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */ + leal -12(%ebp), %edx + movl %edx, (%esp) /* &resp */ + call _ffi_closure_SYSV_inner + movl -12(%ebp), %ecx + +0: + call 1f + // Do not insert anything here between the call and the jump table. +.Lcls_store_table: + .long .Lcls_noretval /* FFI_TYPE_VOID */ + .long .Lcls_retint /* FFI_TYPE_INT */ + .long .Lcls_retfloat /* FFI_TYPE_FLOAT */ + .long .Lcls_retdouble /* FFI_TYPE_DOUBLE */ + .long .Lcls_retldouble /* FFI_TYPE_LONGDOUBLE */ + .long .Lcls_retuint8 /* FFI_TYPE_UINT8 */ + .long .Lcls_retsint8 /* FFI_TYPE_SINT8 */ + .long .Lcls_retuint16 /* FFI_TYPE_UINT16 */ + .long .Lcls_retsint16 /* FFI_TYPE_SINT16 */ + .long .Lcls_retint /* FFI_TYPE_UINT32 */ + .long .Lcls_retint /* FFI_TYPE_SINT32 */ + .long .Lcls_retllong /* FFI_TYPE_UINT64 */ + .long .Lcls_retllong /* FFI_TYPE_SINT64 */ + .long .Lcls_retstruct /* FFI_TYPE_STRUCT */ + .long .Lcls_retint /* FFI_TYPE_POINTER */ + .long .Lcls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */ + .long .Lcls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */ + .long .Lcls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */ + .long .Lcls_retmsstruct /* FFI_TYPE_MS_STRUCT */ + +1: + add %eax, %eax + add %eax, %eax + add (%esp),%eax + add $4, %esp + jmp *(%eax) + + /* Sign/zero extend as appropriate. */ +.Lcls_retsint8: + movsbl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retsint16: + movswl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retuint8: + movzbl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retuint16: + movzwl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retint: + movl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retfloat: + flds (%ecx) + jmp .Lcls_epilogue + +.Lcls_retdouble: + fldl (%ecx) + jmp .Lcls_epilogue + +.Lcls_retldouble: + fldt (%ecx) + jmp .Lcls_epilogue + +.Lcls_retllong: + movl (%ecx), %eax + movl 4(%ecx), %edx + jmp .Lcls_epilogue + +.Lcls_retstruct1: + movsbl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retstruct2: + movswl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retstruct4: + movl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retstruct: + // Caller expects us to pop struct return value pointer hidden arg. + movl %ebp, %esp + popl %ebp + ret $0x4 + +.Lcls_retmsstruct: + // Caller expects us to return a pointer to the real return value. + mov %ecx, %eax + // Caller doesn't expects us to pop struct return value pointer hidden arg. + jmp .Lcls_epilogue + +.Lcls_noretval: +.Lcls_epilogue: + movl %ebp, %esp + popl %ebp + ret +.ffi_closure_SYSV_end: +.LFE3: + +#if !FFI_NO_RAW_API + +#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3) +#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4) +#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4) +#define CIF_FLAGS_OFFSET 20 + .balign 16 + .globl _ffi_closure_raw_THISCALL +#ifndef __OS2__ + .def _ffi_closure_raw_THISCALL; .scl 2; .type 32; .endef +#endif +_ffi_closure_raw_THISCALL: + pushl %ebp + movl %esp, %ebp + pushl %esi + subl $36, %esp + movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */ + movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */ + movl %edx, 12(%esp) /* user_data */ + leal 12(%ebp), %edx /* __builtin_dwarf_cfa () */ + jmp .stubraw + // This assumes we are using gas. + .balign 16 + .globl _ffi_closure_raw_SYSV +#ifndef __OS2__ + .def _ffi_closure_raw_SYSV; .scl 2; .type 32; .endef +#endif +_ffi_closure_raw_SYSV: +.LFB4: + pushl %ebp +.LCFI6: + movl %esp, %ebp +.LCFI7: + pushl %esi +.LCFI8: + subl $36, %esp + movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */ + movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */ + movl %edx, 12(%esp) /* user_data */ + leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */ +.stubraw: + movl %edx, 8(%esp) /* raw_args */ + leal -24(%ebp), %edx + movl %edx, 4(%esp) /* &res */ + movl %esi, (%esp) /* cif */ + call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */ + movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */ +0: + call 1f + // Do not insert anything here between the call and the jump table. +.Lrcls_store_table: + .long .Lrcls_noretval /* FFI_TYPE_VOID */ + .long .Lrcls_retint /* FFI_TYPE_INT */ + .long .Lrcls_retfloat /* FFI_TYPE_FLOAT */ + .long .Lrcls_retdouble /* FFI_TYPE_DOUBLE */ + .long .Lrcls_retldouble /* FFI_TYPE_LONGDOUBLE */ + .long .Lrcls_retuint8 /* FFI_TYPE_UINT8 */ + .long .Lrcls_retsint8 /* FFI_TYPE_SINT8 */ + .long .Lrcls_retuint16 /* FFI_TYPE_UINT16 */ + .long .Lrcls_retsint16 /* FFI_TYPE_SINT16 */ + .long .Lrcls_retint /* FFI_TYPE_UINT32 */ + .long .Lrcls_retint /* FFI_TYPE_SINT32 */ + .long .Lrcls_retllong /* FFI_TYPE_UINT64 */ + .long .Lrcls_retllong /* FFI_TYPE_SINT64 */ + .long .Lrcls_retstruct /* FFI_TYPE_STRUCT */ + .long .Lrcls_retint /* FFI_TYPE_POINTER */ + .long .Lrcls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */ + .long .Lrcls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */ + .long .Lrcls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */ + .long .Lrcls_retstruct /* FFI_TYPE_MS_STRUCT */ +1: + add %eax, %eax + add %eax, %eax + add (%esp),%eax + add $4, %esp + jmp *(%eax) + + /* Sign/zero extend as appropriate. */ +.Lrcls_retsint8: + movsbl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retsint16: + movswl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retuint8: + movzbl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retuint16: + movzwl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retint: + movl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retfloat: + flds -24(%ebp) + jmp .Lrcls_epilogue + +.Lrcls_retdouble: + fldl -24(%ebp) + jmp .Lrcls_epilogue + +.Lrcls_retldouble: + fldt -24(%ebp) + jmp .Lrcls_epilogue + +.Lrcls_retllong: + movl -24(%ebp), %eax + movl -20(%ebp), %edx + jmp .Lrcls_epilogue + +.Lrcls_retstruct1: + movsbl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retstruct2: + movswl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retstruct4: + movl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retstruct: + // Nothing to do! + +.Lrcls_noretval: +.Lrcls_epilogue: + addl $36, %esp + popl %esi + popl %ebp + ret +.ffi_closure_raw_SYSV_end: +.LFE4: + +#endif /* !FFI_NO_RAW_API */ + + // This assumes we are using gas. + .balign 16 + .globl _ffi_closure_STDCALL +#ifndef __OS2__ + .def _ffi_closure_STDCALL; .scl 2; .type 32; .endef +#endif +_ffi_closure_STDCALL: +.LFB5: + pushl %ebp +.LCFI9: + movl %esp, %ebp +.LCFI10: + subl $40, %esp + leal -24(%ebp), %edx + movl %edx, -12(%ebp) /* resp */ + leal 12(%ebp), %edx /* account for stub return address on stack */ + movl %edx, 4(%esp) /* args */ + leal -12(%ebp), %edx + movl %edx, (%esp) /* &resp */ + call _ffi_closure_SYSV_inner + movl -12(%ebp), %ecx +0: + call 1f + // Do not insert anything here between the call and the jump table. +.Lscls_store_table: + .long .Lscls_noretval /* FFI_TYPE_VOID */ + .long .Lscls_retint /* FFI_TYPE_INT */ + .long .Lscls_retfloat /* FFI_TYPE_FLOAT */ + .long .Lscls_retdouble /* FFI_TYPE_DOUBLE */ + .long .Lscls_retldouble /* FFI_TYPE_LONGDOUBLE */ + .long .Lscls_retuint8 /* FFI_TYPE_UINT8 */ + .long .Lscls_retsint8 /* FFI_TYPE_SINT8 */ + .long .Lscls_retuint16 /* FFI_TYPE_UINT16 */ + .long .Lscls_retsint16 /* FFI_TYPE_SINT16 */ + .long .Lscls_retint /* FFI_TYPE_UINT32 */ + .long .Lscls_retint /* FFI_TYPE_SINT32 */ + .long .Lscls_retllong /* FFI_TYPE_UINT64 */ + .long .Lscls_retllong /* FFI_TYPE_SINT64 */ + .long .Lscls_retstruct /* FFI_TYPE_STRUCT */ + .long .Lscls_retint /* FFI_TYPE_POINTER */ + .long .Lscls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */ + .long .Lscls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */ + .long .Lscls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */ +1: + add %eax, %eax + add %eax, %eax + add (%esp),%eax + add $4, %esp + jmp *(%eax) + + /* Sign/zero extend as appropriate. */ +.Lscls_retsint8: + movsbl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retsint16: + movswl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retuint8: + movzbl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retuint16: + movzwl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retint: + movl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retfloat: + flds (%ecx) + jmp .Lscls_epilogue + +.Lscls_retdouble: + fldl (%ecx) + jmp .Lscls_epilogue + +.Lscls_retldouble: + fldt (%ecx) + jmp .Lscls_epilogue + +.Lscls_retllong: + movl (%ecx), %eax + movl 4(%ecx), %edx + jmp .Lscls_epilogue + +.Lscls_retstruct1: + movsbl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retstruct2: + movswl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retstruct4: + movl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retstruct: + // Nothing to do! + +.Lscls_noretval: +.Lscls_epilogue: + movl %ebp, %esp + popl %ebp + ret +.ffi_closure_STDCALL_end: +.LFE5: + +#ifndef __OS2__ + .section .eh_frame,"w" +#endif +.Lframe1: +.LSCIE1: + .long .LECIE1-.LASCIE1 /* Length of Common Information Entry */ +.LASCIE1: + .long 0x0 /* CIE Identifier Tag */ + .byte 0x1 /* CIE Version */ +#ifdef __PIC__ + .ascii "zR\0" /* CIE Augmentation */ +#else + .ascii "\0" /* CIE Augmentation */ +#endif + .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */ + .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */ + .byte 0x8 /* CIE RA Column */ +#ifdef __PIC__ + .byte 0x1 /* .uleb128 0x1; Augmentation size */ + .byte 0x1b /* FDE Encoding (pcrel sdata4) */ +#endif + .byte 0xc /* DW_CFA_def_cfa CFA = r4 + 4 = 4(%esp) */ + .byte 0x4 /* .uleb128 0x4 */ + .byte 0x4 /* .uleb128 0x4 */ + .byte 0x88 /* DW_CFA_offset, column 0x8 %eip at CFA + 1 * -4 */ + .byte 0x1 /* .uleb128 0x1 */ + .align 4 +.LECIE1: + +.LSFDE1: + .long .LEFDE1-.LASFDE1 /* FDE Length */ +.LASFDE1: + .long .LASFDE1-.Lframe1 /* FDE CIE offset */ +#if defined __PIC__ && defined HAVE_AS_X86_PCREL + .long .LFB1-. /* FDE initial location */ +#else + .long .LFB1 +#endif + .long .LFE1-.LFB1 /* FDE address range */ +#ifdef __PIC__ + .byte 0x0 /* .uleb128 0x0; Augmentation size */ +#endif + /* DW_CFA_xxx CFI instructions go here. */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI0-.LFB1 + .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */ + .byte 0x8 /* .uleb128 0x8 */ + .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */ + .byte 0x2 /* .uleb128 0x2 */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI1-.LCFI0 + .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */ + .byte 0x5 /* .uleb128 0x5 */ + + /* End of DW_CFA_xxx CFI instructions. */ + .align 4 +.LEFDE1: + + +.LSFDE3: + .long .LEFDE3-.LASFDE3 /* FDE Length */ +.LASFDE3: + .long .LASFDE3-.Lframe1 /* FDE CIE offset */ +#if defined __PIC__ && defined HAVE_AS_X86_PCREL + .long .LFB3-. /* FDE initial location */ +#else + .long .LFB3 +#endif + .long .LFE3-.LFB3 /* FDE address range */ +#ifdef __PIC__ + .byte 0x0 /* .uleb128 0x0; Augmentation size */ +#endif + /* DW_CFA_xxx CFI instructions go here. */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI4-.LFB3 + .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */ + .byte 0x8 /* .uleb128 0x8 */ + .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */ + .byte 0x2 /* .uleb128 0x2 */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI5-.LCFI4 + .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */ + .byte 0x5 /* .uleb128 0x5 */ + + /* End of DW_CFA_xxx CFI instructions. */ + .align 4 +.LEFDE3: + +#if !FFI_NO_RAW_API + +.LSFDE4: + .long .LEFDE4-.LASFDE4 /* FDE Length */ +.LASFDE4: + .long .LASFDE4-.Lframe1 /* FDE CIE offset */ +#if defined __PIC__ && defined HAVE_AS_X86_PCREL + .long .LFB4-. /* FDE initial location */ +#else + .long .LFB4 +#endif + .long .LFE4-.LFB4 /* FDE address range */ +#ifdef __PIC__ + .byte 0x0 /* .uleb128 0x0; Augmentation size */ +#endif + /* DW_CFA_xxx CFI instructions go here. */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI6-.LFB4 + .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */ + .byte 0x8 /* .uleb128 0x8 */ + .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */ + .byte 0x2 /* .uleb128 0x2 */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI7-.LCFI6 + .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */ + .byte 0x5 /* .uleb128 0x5 */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI8-.LCFI7 + .byte 0x86 /* DW_CFA_offset, column 0x6 %esi at CFA + 3 * -4 */ + .byte 0x3 /* .uleb128 0x3 */ + + /* End of DW_CFA_xxx CFI instructions. */ + .align 4 +.LEFDE4: + +#endif /* !FFI_NO_RAW_API */ + +.LSFDE5: + .long .LEFDE5-.LASFDE5 /* FDE Length */ +.LASFDE5: + .long .LASFDE5-.Lframe1 /* FDE CIE offset */ +#if defined __PIC__ && defined HAVE_AS_X86_PCREL + .long .LFB5-. /* FDE initial location */ +#else + .long .LFB5 +#endif + .long .LFE5-.LFB5 /* FDE address range */ +#ifdef __PIC__ + .byte 0x0 /* .uleb128 0x0; Augmentation size */ +#endif + /* DW_CFA_xxx CFI instructions go here. */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI9-.LFB5 + .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */ + .byte 0x8 /* .uleb128 0x8 */ + .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */ + .byte 0x2 /* .uleb128 0x2 */ + + .byte 0x4 /* DW_CFA_advance_loc4 */ + .long .LCFI10-.LCFI9 + .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */ + .byte 0x5 /* .uleb128 0x5 */ + + /* End of DW_CFA_xxx CFI instructions. */ + .align 4 +.LEFDE5: diff --git a/lib/wrappers/libffi/gcc/win32_asm.s b/lib/wrappers/libffi/gcc/win32_asm.s new file mode 100644 index 0000000000..7a3e7f16ca --- /dev/null +++ b/lib/wrappers/libffi/gcc/win32_asm.s @@ -0,0 +1,736 @@ +# 1 "gcc\\win32_asm.asm" +# 1 "<command-line>" +# 1 "gcc\\win32_asm.asm" +# 33 "gcc\\win32_asm.asm" +# 1 "common/fficonfig.h" 1 +# 34 "gcc\\win32_asm.asm" 2 +# 1 "common/ffi.h" 1 +# 63 "common/ffi.h" +# 1 "common/ffitarget.h" 1 +# 64 "common/ffi.h" 2 +# 35 "gcc\\win32_asm.asm" 2 + + + .text + + + .balign 16 + .globl _ffi_call_win32 + + .def _ffi_call_win32; .scl 2; .type 32; .endef + +_ffi_call_win32: +.LFB1: + pushl %ebp +.LCFI0: + movl %esp,%ebp +.LCFI1: + + movl 20(%ebp),%ecx + subl %ecx,%esp + + movl %esp,%eax + + + pushl 12(%ebp) + pushl %eax + call *8(%ebp) + + + addl $8,%esp + + + cmpl $3, 16(%ebp) + jz .do_thiscall + cmpl $4, 16(%ebp) + jnz .do_fncall + movl (%esp), %ecx + movl 4(%esp), %edx + addl $8, %esp + jmp .do_fncall +.do_thiscall: + movl (%esp), %ecx + addl $4, %esp + +.do_fncall: + + + + + call *32(%ebp) + + + + + movl 24(%ebp),%ecx + + + cmpl $0,28(%ebp) + jne 0f + + + + cmpl $2,%ecx + jne .Lnoretval + fstp %st(0) + + jmp .Lepilogue + +0: + call 1f + +.Lstore_table: + .long .Lnoretval + .long .Lretint + .long .Lretfloat + .long .Lretdouble + .long .Lretlongdouble + .long .Lretuint8 + .long .Lretsint8 + .long .Lretuint16 + .long .Lretsint16 + .long .Lretint + .long .Lretint + .long .Lretint64 + .long .Lretint64 + .long .Lretstruct + .long .Lretint + .long .Lretstruct1b + .long .Lretstruct2b + .long .Lretstruct4b + .long .Lretstruct +1: + add %ecx, %ecx + add %ecx, %ecx + add (%esp),%ecx + add $4, %esp + jmp *(%ecx) + + +.Lretsint8: + movsbl %al, %eax + jmp .Lretint + +.Lretsint16: + movswl %ax, %eax + jmp .Lretint + +.Lretuint8: + movzbl %al, %eax + jmp .Lretint + +.Lretuint16: + movzwl %ax, %eax + jmp .Lretint + +.Lretint: + + movl 28(%ebp),%ecx + movl %eax,0(%ecx) + jmp .Lepilogue + +.Lretfloat: + + movl 28(%ebp),%ecx + fstps (%ecx) + jmp .Lepilogue + +.Lretdouble: + + movl 28(%ebp),%ecx + fstpl (%ecx) + jmp .Lepilogue + +.Lretlongdouble: + + movl 28(%ebp),%ecx + fstpt (%ecx) + jmp .Lepilogue + +.Lretint64: + + movl 28(%ebp),%ecx + movl %eax,0(%ecx) + movl %edx,4(%ecx) + jmp .Lepilogue + +.Lretstruct1b: + + movl 28(%ebp),%ecx + movb %al,0(%ecx) + jmp .Lepilogue + +.Lretstruct2b: + + movl 28(%ebp),%ecx + movw %ax,0(%ecx) + jmp .Lepilogue + +.Lretstruct4b: + + movl 28(%ebp),%ecx + movl %eax,0(%ecx) + jmp .Lepilogue + +.Lretstruct: + + +.Lnoretval: +.Lepilogue: + movl %ebp,%esp + popl %ebp + ret +.ffi_call_win32_end: + .balign 16 + .globl _ffi_closure_THISCALL + + .def _ffi_closure_THISCALL; .scl 2; .type 32; .endef + +_ffi_closure_THISCALL: + pushl %ebp + movl %esp, %ebp + subl $40, %esp + leal -24(%ebp), %edx + movl %edx, -12(%ebp) + leal 12(%ebp), %edx + jmp .stub +.LFE1: + + + .balign 16 + .globl _ffi_closure_SYSV + + .def _ffi_closure_SYSV; .scl 2; .type 32; .endef + +_ffi_closure_SYSV: +.LFB3: + pushl %ebp +.LCFI4: + movl %esp, %ebp +.LCFI5: + subl $40, %esp + leal -24(%ebp), %edx + movl %edx, -12(%ebp) + leal 8(%ebp), %edx +.stub: + movl %edx, 4(%esp) + leal -12(%ebp), %edx + movl %edx, (%esp) + call _ffi_closure_SYSV_inner + movl -12(%ebp), %ecx + +0: + call 1f + +.Lcls_store_table: + .long .Lcls_noretval + .long .Lcls_retint + .long .Lcls_retfloat + .long .Lcls_retdouble + .long .Lcls_retldouble + .long .Lcls_retuint8 + .long .Lcls_retsint8 + .long .Lcls_retuint16 + .long .Lcls_retsint16 + .long .Lcls_retint + .long .Lcls_retint + .long .Lcls_retllong + .long .Lcls_retllong + .long .Lcls_retstruct + .long .Lcls_retint + .long .Lcls_retstruct1 + .long .Lcls_retstruct2 + .long .Lcls_retstruct4 + .long .Lcls_retmsstruct + +1: + add %eax, %eax + add %eax, %eax + add (%esp),%eax + add $4, %esp + jmp *(%eax) + + +.Lcls_retsint8: + movsbl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retsint16: + movswl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retuint8: + movzbl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retuint16: + movzwl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retint: + movl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retfloat: + flds (%ecx) + jmp .Lcls_epilogue + +.Lcls_retdouble: + fldl (%ecx) + jmp .Lcls_epilogue + +.Lcls_retldouble: + fldt (%ecx) + jmp .Lcls_epilogue + +.Lcls_retllong: + movl (%ecx), %eax + movl 4(%ecx), %edx + jmp .Lcls_epilogue + +.Lcls_retstruct1: + movsbl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retstruct2: + movswl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retstruct4: + movl (%ecx), %eax + jmp .Lcls_epilogue + +.Lcls_retstruct: + + movl %ebp, %esp + popl %ebp + ret $0x4 + +.Lcls_retmsstruct: + + mov %ecx, %eax + + jmp .Lcls_epilogue + +.Lcls_noretval: +.Lcls_epilogue: + movl %ebp, %esp + popl %ebp + ret +.ffi_closure_SYSV_end: +.LFE3: + + + + + + + + .balign 16 + .globl _ffi_closure_raw_THISCALL + + .def _ffi_closure_raw_THISCALL; .scl 2; .type 32; .endef + +_ffi_closure_raw_THISCALL: + pushl %ebp + movl %esp, %ebp + pushl %esi + subl $36, %esp + movl ((52 + 3) & ~3)(%eax), %esi + movl ((((52 + 3) & ~3) + 4) + 4)(%eax), %edx + movl %edx, 12(%esp) + leal 12(%ebp), %edx + jmp .stubraw + + .balign 16 + .globl _ffi_closure_raw_SYSV + + .def _ffi_closure_raw_SYSV; .scl 2; .type 32; .endef + +_ffi_closure_raw_SYSV: +.LFB4: + pushl %ebp +.LCFI6: + movl %esp, %ebp +.LCFI7: + pushl %esi +.LCFI8: + subl $36, %esp + movl ((52 + 3) & ~3)(%eax), %esi + movl ((((52 + 3) & ~3) + 4) + 4)(%eax), %edx + movl %edx, 12(%esp) + leal 8(%ebp), %edx +.stubraw: + movl %edx, 8(%esp) + leal -24(%ebp), %edx + movl %edx, 4(%esp) + movl %esi, (%esp) + call *(((52 + 3) & ~3) + 4)(%eax) + movl 20(%esi), %eax +0: + call 1f + +.Lrcls_store_table: + .long .Lrcls_noretval + .long .Lrcls_retint + .long .Lrcls_retfloat + .long .Lrcls_retdouble + .long .Lrcls_retldouble + .long .Lrcls_retuint8 + .long .Lrcls_retsint8 + .long .Lrcls_retuint16 + .long .Lrcls_retsint16 + .long .Lrcls_retint + .long .Lrcls_retint + .long .Lrcls_retllong + .long .Lrcls_retllong + .long .Lrcls_retstruct + .long .Lrcls_retint + .long .Lrcls_retstruct1 + .long .Lrcls_retstruct2 + .long .Lrcls_retstruct4 + .long .Lrcls_retstruct +1: + add %eax, %eax + add %eax, %eax + add (%esp),%eax + add $4, %esp + jmp *(%eax) + + +.Lrcls_retsint8: + movsbl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retsint16: + movswl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retuint8: + movzbl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retuint16: + movzwl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retint: + movl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retfloat: + flds -24(%ebp) + jmp .Lrcls_epilogue + +.Lrcls_retdouble: + fldl -24(%ebp) + jmp .Lrcls_epilogue + +.Lrcls_retldouble: + fldt -24(%ebp) + jmp .Lrcls_epilogue + +.Lrcls_retllong: + movl -24(%ebp), %eax + movl -20(%ebp), %edx + jmp .Lrcls_epilogue + +.Lrcls_retstruct1: + movsbl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retstruct2: + movswl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retstruct4: + movl -24(%ebp), %eax + jmp .Lrcls_epilogue + +.Lrcls_retstruct: + + +.Lrcls_noretval: +.Lrcls_epilogue: + addl $36, %esp + popl %esi + popl %ebp + ret +.ffi_closure_raw_SYSV_end: +.LFE4: + + + + + .balign 16 + .globl _ffi_closure_STDCALL + + .def _ffi_closure_STDCALL; .scl 2; .type 32; .endef + +_ffi_closure_STDCALL: +.LFB5: + pushl %ebp +.LCFI9: + movl %esp, %ebp +.LCFI10: + subl $40, %esp + leal -24(%ebp), %edx + movl %edx, -12(%ebp) + leal 12(%ebp), %edx + movl %edx, 4(%esp) + leal -12(%ebp), %edx + movl %edx, (%esp) + call _ffi_closure_SYSV_inner + movl -12(%ebp), %ecx +0: + call 1f + +.Lscls_store_table: + .long .Lscls_noretval + .long .Lscls_retint + .long .Lscls_retfloat + .long .Lscls_retdouble + .long .Lscls_retldouble + .long .Lscls_retuint8 + .long .Lscls_retsint8 + .long .Lscls_retuint16 + .long .Lscls_retsint16 + .long .Lscls_retint + .long .Lscls_retint + .long .Lscls_retllong + .long .Lscls_retllong + .long .Lscls_retstruct + .long .Lscls_retint + .long .Lscls_retstruct1 + .long .Lscls_retstruct2 + .long .Lscls_retstruct4 +1: + add %eax, %eax + add %eax, %eax + add (%esp),%eax + add $4, %esp + jmp *(%eax) + + +.Lscls_retsint8: + movsbl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retsint16: + movswl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retuint8: + movzbl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retuint16: + movzwl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retint: + movl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retfloat: + flds (%ecx) + jmp .Lscls_epilogue + +.Lscls_retdouble: + fldl (%ecx) + jmp .Lscls_epilogue + +.Lscls_retldouble: + fldt (%ecx) + jmp .Lscls_epilogue + +.Lscls_retllong: + movl (%ecx), %eax + movl 4(%ecx), %edx + jmp .Lscls_epilogue + +.Lscls_retstruct1: + movsbl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retstruct2: + movswl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retstruct4: + movl (%ecx), %eax + jmp .Lscls_epilogue + +.Lscls_retstruct: + + +.Lscls_noretval: +.Lscls_epilogue: + movl %ebp, %esp + popl %ebp + ret +.ffi_closure_STDCALL_end: +.LFE5: + + + .section .eh_frame,"w" + +.Lframe1: +.LSCIE1: + .long .LECIE1-.LASCIE1 +.LASCIE1: + .long 0x0 + .byte 0x1 + + + + .ascii "\0" + + .byte 0x1 + .byte 0x7c + .byte 0x8 + + + + + .byte 0xc + .byte 0x4 + .byte 0x4 + .byte 0x88 + .byte 0x1 + .align 4 +.LECIE1: + +.LSFDE1: + .long .LEFDE1-.LASFDE1 +.LASFDE1: + .long .LASFDE1-.Lframe1 + + + + .long .LFB1 + + .long .LFE1-.LFB1 + + + + + + .byte 0x4 + .long .LCFI0-.LFB1 + .byte 0xe + .byte 0x8 + .byte 0x85 + .byte 0x2 + + .byte 0x4 + .long .LCFI1-.LCFI0 + .byte 0xd + .byte 0x5 + + + .align 4 +.LEFDE1: + + +.LSFDE3: + .long .LEFDE3-.LASFDE3 +.LASFDE3: + .long .LASFDE3-.Lframe1 + + + + .long .LFB3 + + .long .LFE3-.LFB3 + + + + + + .byte 0x4 + .long .LCFI4-.LFB3 + .byte 0xe + .byte 0x8 + .byte 0x85 + .byte 0x2 + + .byte 0x4 + .long .LCFI5-.LCFI4 + .byte 0xd + .byte 0x5 + + + .align 4 +.LEFDE3: + + + +.LSFDE4: + .long .LEFDE4-.LASFDE4 +.LASFDE4: + .long .LASFDE4-.Lframe1 + + + + .long .LFB4 + + .long .LFE4-.LFB4 + + + + + + .byte 0x4 + .long .LCFI6-.LFB4 + .byte 0xe + .byte 0x8 + .byte 0x85 + .byte 0x2 + + .byte 0x4 + .long .LCFI7-.LCFI6 + .byte 0xd + .byte 0x5 + + .byte 0x4 + .long .LCFI8-.LCFI7 + .byte 0x86 + .byte 0x3 + + + .align 4 +.LEFDE4: + + + +.LSFDE5: + .long .LEFDE5-.LASFDE5 +.LASFDE5: + .long .LASFDE5-.Lframe1 + + + + .long .LFB5 + + .long .LFE5-.LFB5 + + + + + + .byte 0x4 + .long .LCFI9-.LFB5 + .byte 0xe + .byte 0x8 + .byte 0x85 + .byte 0x2 + + .byte 0x4 + .long .LCFI10-.LCFI9 + .byte 0xd + .byte 0x5 + + + .align 4 +.LEFDE5: diff --git a/lib/wrappers/libffi/gcc/win64_asm.asm b/lib/wrappers/libffi/gcc/win64_asm.asm new file mode 100644 index 0000000000..1dc98f99af --- /dev/null +++ b/lib/wrappers/libffi/gcc/win64_asm.asm @@ -0,0 +1,467 @@ +#define LIBFFI_ASM +#include <fficonfig.h> +#include <ffi.h> + +/* Constants for ffi_call_win64 */ +#define STACK 0 +#define PREP_ARGS_FN 32 +#define ECIF 40 +#define CIF_BYTES 48 +#define CIF_FLAGS 56 +#define RVALUE 64 +#define FN 72 + +/* ffi_call_win64 (void (*prep_args_fn)(char *, extended_cif *), + extended_cif *ecif, unsigned bytes, unsigned flags, + unsigned *rvalue, void (*fn)()); + */ + +#ifdef _MSC_VER +PUBLIC ffi_call_win64 + +EXTRN __chkstk:NEAR +EXTRN ffi_closure_win64_inner:NEAR + +_TEXT SEGMENT + +;;; ffi_closure_win64 will be called with these registers set: +;;; rax points to 'closure' +;;; r11 contains a bit mask that specifies which of the +;;; first four parameters are float or double +;;; +;;; It must move the parameters passed in registers to their stack location, +;;; call ffi_closure_win64_inner for the actual work, then return the result. +;;; +ffi_closure_win64 PROC FRAME + ;; copy register arguments onto stack + test r11, 1 + jne first_is_float + mov QWORD PTR [rsp+8], rcx + jmp second +first_is_float: + movlpd QWORD PTR [rsp+8], xmm0 + +second: + test r11, 2 + jne second_is_float + mov QWORD PTR [rsp+16], rdx + jmp third +second_is_float: + movlpd QWORD PTR [rsp+16], xmm1 + +third: + test r11, 4 + jne third_is_float + mov QWORD PTR [rsp+24], r8 + jmp fourth +third_is_float: + movlpd QWORD PTR [rsp+24], xmm2 + +fourth: + test r11, 8 + jne fourth_is_float + mov QWORD PTR [rsp+32], r9 + jmp done +fourth_is_float: + movlpd QWORD PTR [rsp+32], xmm3 + +done: + .ALLOCSTACK 40 + sub rsp, 40 + .ENDPROLOG + mov rcx, rax ; context is first parameter + mov rdx, rsp ; stack is second parameter + add rdx, 48 ; point to start of arguments + mov rax, ffi_closure_win64_inner + call rax ; call the real closure function + add rsp, 40 + movd xmm0, rax ; If the closure returned a float, + ; ffi_closure_win64_inner wrote it to rax + ret 0 +ffi_closure_win64 ENDP + +ffi_call_win64 PROC FRAME + ;; copy registers onto stack + mov QWORD PTR [rsp+32], r9 + mov QWORD PTR [rsp+24], r8 + mov QWORD PTR [rsp+16], rdx + mov QWORD PTR [rsp+8], rcx + .PUSHREG rbp + push rbp + .ALLOCSTACK 48 + sub rsp, 48 ; 00000030H + .SETFRAME rbp, 32 + lea rbp, QWORD PTR [rsp+32] + .ENDPROLOG + + mov eax, DWORD PTR CIF_BYTES[rbp] + add rax, 15 + and rax, -16 + call __chkstk + sub rsp, rax + lea rax, QWORD PTR [rsp+32] + mov QWORD PTR STACK[rbp], rax + + mov rdx, QWORD PTR ECIF[rbp] + mov rcx, QWORD PTR STACK[rbp] + call QWORD PTR PREP_ARGS_FN[rbp] + + mov rsp, QWORD PTR STACK[rbp] + + movlpd xmm3, QWORD PTR [rsp+24] + movd r9, xmm3 + + movlpd xmm2, QWORD PTR [rsp+16] + movd r8, xmm2 + + movlpd xmm1, QWORD PTR [rsp+8] + movd rdx, xmm1 + + movlpd xmm0, QWORD PTR [rsp] + movd rcx, xmm0 + + call QWORD PTR FN[rbp] +ret_struct4b$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_4B + jne ret_struct2b$ + + mov rcx, QWORD PTR RVALUE[rbp] + mov DWORD PTR [rcx], eax + jmp ret_void$ + +ret_struct2b$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_2B + jne ret_struct1b$ + + mov rcx, QWORD PTR RVALUE[rbp] + mov WORD PTR [rcx], ax + jmp ret_void$ + +ret_struct1b$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_1B + jne ret_uint8$ + + mov rcx, QWORD PTR RVALUE[rbp] + mov BYTE PTR [rcx], al + jmp ret_void$ + +ret_uint8$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT8 + jne ret_sint8$ + + mov rcx, QWORD PTR RVALUE[rbp] + movzx rax, al + mov QWORD PTR [rcx], rax + jmp ret_void$ + +ret_sint8$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT8 + jne ret_uint16$ + + mov rcx, QWORD PTR RVALUE[rbp] + movsx rax, al + mov QWORD PTR [rcx], rax + jmp ret_void$ + +ret_uint16$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT16 + jne ret_sint16$ + + mov rcx, QWORD PTR RVALUE[rbp] + movzx rax, ax + mov QWORD PTR [rcx], rax + jmp SHORT ret_void$ + +ret_sint16$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT16 + jne ret_uint32$ + + mov rcx, QWORD PTR RVALUE[rbp] + movsx rax, ax + mov QWORD PTR [rcx], rax + jmp SHORT ret_void$ + +ret_uint32$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT32 + jne ret_sint32$ + + mov rcx, QWORD PTR RVALUE[rbp] + mov eax, eax + mov QWORD PTR [rcx], rax + jmp SHORT ret_void$ + +ret_sint32$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT32 + jne ret_float$ + + mov rcx, QWORD PTR RVALUE[rbp] + cdqe + mov QWORD PTR [rcx], rax + jmp SHORT ret_void$ + +ret_float$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_FLOAT + jne SHORT ret_double$ + + mov rax, QWORD PTR RVALUE[rbp] + movss DWORD PTR [rax], xmm0 + jmp SHORT ret_void$ + +ret_double$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_DOUBLE + jne SHORT ret_sint64$ + + mov rax, QWORD PTR RVALUE[rbp] + movlpd QWORD PTR [rax], xmm0 + jmp SHORT ret_void$ + +ret_sint64$: + cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT64 + jne ret_void$ + + mov rcx, QWORD PTR RVALUE[rbp] + mov QWORD PTR [rcx], rax + jmp SHORT ret_void$ + +ret_void$: + xor rax, rax + + lea rsp, QWORD PTR [rbp+16] + pop rbp + ret 0 +ffi_call_win64 ENDP +_TEXT ENDS +END + +#else + +#ifdef SYMBOL_UNDERSCORE +#define SYMBOL_NAME(name) _##name +#else +#define SYMBOL_NAME(name) name +#endif + +.text + +.extern SYMBOL_NAME(ffi_closure_win64_inner) + +// ffi_closure_win64 will be called with these registers set: +// rax points to 'closure' +// r11 contains a bit mask that specifies which of the +// first four parameters are float or double +// // It must move the parameters passed in registers to their stack location, +// call ffi_closure_win64_inner for the actual work, then return the result. +// + .balign 16 + .globl SYMBOL_NAME(ffi_closure_win64) +SYMBOL_NAME(ffi_closure_win64): + // copy register arguments onto stack + test $1,%r11 + jne .Lfirst_is_float + mov %rcx, 8(%rsp) + jmp .Lsecond +.Lfirst_is_float: + movlpd %xmm0, 8(%rsp) + +.Lsecond: + test $2, %r11 + jne .Lsecond_is_float + mov %rdx, 16(%rsp) + jmp .Lthird +.Lsecond_is_float: + movlpd %xmm1, 16(%rsp) + +.Lthird: + test $4, %r11 + jne .Lthird_is_float + mov %r8,24(%rsp) + jmp .Lfourth +.Lthird_is_float: + movlpd %xmm2, 24(%rsp) + +.Lfourth: + test $8, %r11 + jne .Lfourth_is_float + mov %r9, 32(%rsp) + jmp .Ldone +.Lfourth_is_float: + movlpd %xmm3, 32(%rsp) + +.Ldone: +// ALLOCSTACK 40 + sub $40, %rsp +// ENDPROLOG + mov %rax, %rcx // context is first parameter + mov %rsp, %rdx // stack is second parameter + add $48, %rdx // point to start of arguments + mov $SYMBOL_NAME(ffi_closure_win64_inner), %rax + callq *%rax // call the real closure function + add $40, %rsp + movq %rax, %xmm0 // If the closure returned a float, + // ffi_closure_win64_inner wrote it to rax + retq +.ffi_closure_win64_end: + + .balign 16 + .globl SYMBOL_NAME(ffi_call_win64) +SYMBOL_NAME(ffi_call_win64): + // copy registers onto stack + mov %r9,32(%rsp) + mov %r8,24(%rsp) + mov %rdx,16(%rsp) + mov %rcx,8(%rsp) + // PUSHREG rbp + push %rbp + // ALLOCSTACK 48 + sub $48,%rsp + // SETFRAME rbp, 32 + lea 32(%rsp),%rbp + // ENDPROLOG + + mov CIF_BYTES(%rbp),%eax + add $15, %rax + and $-16, %rax + cmpq $0x1000, %rax + jb Lch_done +Lch_probe: + subq $0x1000,%rsp + orl $0x0, (%rsp) + subq $0x1000,%rax + cmpq $0x1000,%rax + ja Lch_probe +Lch_done: + subq %rax, %rsp + orl $0x0, (%rsp) + lea 32(%rsp), %rax + mov %rax, STACK(%rbp) + + mov ECIF(%rbp), %rdx + mov STACK(%rbp), %rcx + callq *PREP_ARGS_FN(%rbp) + + mov STACK(%rbp), %rsp + + movlpd 24(%rsp), %xmm3 + movd %xmm3, %r9 + + movlpd 16(%rsp), %xmm2 + movd %xmm2, %r8 + + movlpd 8(%rsp), %xmm1 + movd %xmm1, %rdx + + movlpd (%rsp), %xmm0 + movd %xmm0, %rcx + + callq *FN(%rbp) +.Lret_struct4b: + cmpl $FFI_TYPE_SMALL_STRUCT_4B, CIF_FLAGS(%rbp) + jne .Lret_struct2b + + mov RVALUE(%rbp), %rcx + mov %eax, (%rcx) + jmp .Lret_void + +.Lret_struct2b: + cmpl $FFI_TYPE_SMALL_STRUCT_2B, CIF_FLAGS(%rbp) + jne .Lret_struct1b + + mov RVALUE(%rbp), %rcx + mov %ax, (%rcx) + jmp .Lret_void + +.Lret_struct1b: + cmpl $FFI_TYPE_SMALL_STRUCT_1B, CIF_FLAGS(%rbp) + jne .Lret_uint8 + + mov RVALUE(%rbp), %rcx + mov %al, (%rcx) + jmp .Lret_void + +.Lret_uint8: + cmpl $FFI_TYPE_UINT8, CIF_FLAGS(%rbp) + jne .Lret_sint8 + + mov RVALUE(%rbp), %rcx + movzbq %al, %rax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_sint8: + cmpl $FFI_TYPE_SINT8, CIF_FLAGS(%rbp) + jne .Lret_uint16 + + mov RVALUE(%rbp), %rcx + movsbq %al, %rax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_uint16: + cmpl $FFI_TYPE_UINT16, CIF_FLAGS(%rbp) + jne .Lret_sint16 + + mov RVALUE(%rbp), %rcx + movzwq %ax, %rax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_sint16: + cmpl $FFI_TYPE_SINT16, CIF_FLAGS(%rbp) + jne .Lret_uint32 + + mov RVALUE(%rbp), %rcx + movswq %ax, %rax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_uint32: + cmpl $FFI_TYPE_UINT32, CIF_FLAGS(%rbp) + jne .Lret_sint32 + + mov RVALUE(%rbp), %rcx + movl %eax, %eax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_sint32: + cmpl $FFI_TYPE_SINT32, CIF_FLAGS(%rbp) + jne .Lret_float + + mov RVALUE(%rbp), %rcx + cltq + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_float: + cmpl $FFI_TYPE_FLOAT, CIF_FLAGS(%rbp) + jne .Lret_double + + mov RVALUE(%rbp), %rax + movss %xmm0, (%rax) + jmp .Lret_void + +.Lret_double: + cmpl $FFI_TYPE_DOUBLE, CIF_FLAGS(%rbp) + jne .Lret_sint64 + + mov RVALUE(%rbp), %rax + movlpd %xmm0, (%rax) + jmp .Lret_void + +.Lret_sint64: + cmpl $FFI_TYPE_SINT64, CIF_FLAGS(%rbp) + jne .Lret_void + + mov RVALUE(%rbp), %rcx + mov %rax, (%rcx) + jmp .Lret_void + +.Lret_void: + xor %rax, %rax + + lea 16(%rbp), %rsp + pop %rbp + retq +.ffi_call_win64_end: +#endif /* !_MSC_VER */ + diff --git a/lib/wrappers/libffi/gcc/win64_asm.s b/lib/wrappers/libffi/gcc/win64_asm.s new file mode 100644 index 0000000000..f2c2df10d6 --- /dev/null +++ b/lib/wrappers/libffi/gcc/win64_asm.s @@ -0,0 +1,227 @@ +# 1 "gcc\\win64_asm.asm" +# 1 "<command-line>" +# 1 "gcc\\win64_asm.asm" + +# 1 "common/fficonfig.h" 1 +# 3 "gcc\\win64_asm.asm" 2 +# 1 "common/ffi.h" 1 +# 63 "common/ffi.h" +# 1 "common/ffitarget.h" 1 +# 64 "common/ffi.h" 2 +# 4 "gcc\\win64_asm.asm" 2 +# 244 "gcc\\win64_asm.asm" +.text + +.extern ffi_closure_win64_inner +# 255 "gcc\\win64_asm.asm" + .balign 16 + .globl ffi_closure_win64 +ffi_closure_win64: + + test $1,%r11 + jne .Lfirst_is_float + mov %rcx, 8(%rsp) + jmp .Lsecond +.Lfirst_is_float: + movlpd %xmm0, 8(%rsp) + +.Lsecond: + test $2, %r11 + jne .Lsecond_is_float + mov %rdx, 16(%rsp) + jmp .Lthird +.Lsecond_is_float: + movlpd %xmm1, 16(%rsp) + +.Lthird: + test $4, %r11 + jne .Lthird_is_float + mov %r8,24(%rsp) + jmp .Lfourth +.Lthird_is_float: + movlpd %xmm2, 24(%rsp) + +.Lfourth: + test $8, %r11 + jne .Lfourth_is_float + mov %r9, 32(%rsp) + jmp .Ldone +.Lfourth_is_float: + movlpd %xmm3, 32(%rsp) + +.Ldone: + + sub $40, %rsp + + mov %rax, %rcx + mov %rsp, %rdx + add $48, %rdx + mov $SYMBOL_NAME(ffi_closure_win64_inner), %rax + callq *%rax + add $40, %rsp + movq %rax, %xmm0 + + retq +.ffi_closure_win64_end: + + .balign 16 + .globl ffi_call_win64 +ffi_call_win64: + + mov %r9,32(%rsp) + mov %r8,24(%rsp) + mov %rdx,16(%rsp) + mov %rcx,8(%rsp) + + push %rbp + + sub $48,%rsp + + lea 32(%rsp),%rbp + + + mov 48(%rbp),%eax + add $15, %rax + and $-16, %rax + cmpq $0x1000, %rax + jb Lch_done +Lch_probe: + subq $0x1000,%rsp + orl $0x0, (%rsp) + subq $0x1000,%rax + cmpq $0x1000,%rax + ja Lch_probe +Lch_done: + subq %rax, %rsp + orl $0x0, (%rsp) + lea 32(%rsp), %rax + mov %rax, 0(%rbp) + + mov 40(%rbp), %rdx + mov 0(%rbp), %rcx + callq *32(%rbp) + + mov 0(%rbp), %rsp + + movlpd 24(%rsp), %xmm3 + movd %xmm3, %r9 + + movlpd 16(%rsp), %xmm2 + movd %xmm2, %r8 + + movlpd 8(%rsp), %xmm1 + movd %xmm1, %rdx + + movlpd (%rsp), %xmm0 + movd %xmm0, %rcx + + callq *72(%rbp) +.Lret_struct4b: + cmpl $FFI_TYPE_SMALL_STRUCT_4B, 56(%rbp) + jne .Lret_struct2b + + mov 64(%rbp), %rcx + mov %eax, (%rcx) + jmp .Lret_void + +.Lret_struct2b: + cmpl $FFI_TYPE_SMALL_STRUCT_2B, 56(%rbp) + jne .Lret_struct1b + + mov 64(%rbp), %rcx + mov %ax, (%rcx) + jmp .Lret_void + +.Lret_struct1b: + cmpl $FFI_TYPE_SMALL_STRUCT_1B, 56(%rbp) + jne .Lret_uint8 + + mov 64(%rbp), %rcx + mov %al, (%rcx) + jmp .Lret_void + +.Lret_uint8: + cmpl $FFI_TYPE_UINT8, 56(%rbp) + jne .Lret_sint8 + + mov 64(%rbp), %rcx + movzbq %al, %rax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_sint8: + cmpl $FFI_TYPE_SINT8, 56(%rbp) + jne .Lret_uint16 + + mov 64(%rbp), %rcx + movsbq %al, %rax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_uint16: + cmpl $FFI_TYPE_UINT16, 56(%rbp) + jne .Lret_sint16 + + mov 64(%rbp), %rcx + movzwq %ax, %rax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_sint16: + cmpl $FFI_TYPE_SINT16, 56(%rbp) + jne .Lret_uint32 + + mov 64(%rbp), %rcx + movswq %ax, %rax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_uint32: + cmpl $9, 56(%rbp) + jne .Lret_sint32 + + mov 64(%rbp), %rcx + movl %eax, %eax + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_sint32: + cmpl $10, 56(%rbp) + jne .Lret_float + + mov 64(%rbp), %rcx + cltq + movq %rax, (%rcx) + jmp .Lret_void + +.Lret_float: + cmpl $2, 56(%rbp) + jne .Lret_double + + mov 64(%rbp), %rax + movss %xmm0, (%rax) + jmp .Lret_void + +.Lret_double: + cmpl $3, 56(%rbp) + jne .Lret_sint64 + + mov 64(%rbp), %rax + movlpd %xmm0, (%rax) + jmp .Lret_void + +.Lret_sint64: + cmpl $12, 56(%rbp) + jne .Lret_void + + mov 64(%rbp), %rcx + mov %rax, (%rcx) + jmp .Lret_void + +.Lret_void: + xor %rax, %rax + + lea 16(%rbp), %rsp + pop %rbp + retq +.ffi_call_win64_end: diff --git a/lib/wrappers/libffi/libffi.nim b/lib/wrappers/libffi/libffi.nim index 5ce9cc2e20..1b61301032 100644 --- a/lib/wrappers/libffi/libffi.nim +++ b/lib/wrappers/libffi/libffi.nim @@ -30,31 +30,27 @@ when defined(windows): # on Windows we don't use a DLL but instead embed libffi directly: {.pragma: mylib, header: r"ffi.h".} - {.compile: r"common\callproc.c".} - {.compile: r"common\malloc_closure.c".} + #{.compile: r"common\malloc_closure.c".} {.compile: r"common\raw_api.c".} when defined(vcc): - #{.compile: "libffi_msvc\ffi.h".} - #<ClInclude: "..\Modules\_ctypes\libffi_msvc\ffi_common.h".} - #<ClInclude: "..\Modules\_ctypes\libffi_msvc\fficonfig.h".} - #<ClInclude: "..\Modules\_ctypes\libffi_msvc\ffitarget.h".} {.compile: r"msvc\ffi.c".} {.compile: r"msvc\prep_cif.c".} {.compile: r"msvc\win32.c".} {.compile: r"msvc\types.c".} when defined(cpu64): - {.compile: r"msvc\win64.asm".} + {.compile: r"msvc\win64_asm.asm".} + else: + {.compile: r"msvc\win32_asm.asm".} else: {.compile: r"gcc\ffi.c".} {.compile: r"gcc\prep_cif.c".} - {.compile: r"gcc\win32.c".} {.compile: r"gcc\types.c".} {.compile: r"gcc\closures.c".} when defined(cpu64): {.compile: r"gcc\ffi64.c".} - {.compile: r"gcc\win64.S".} + {.compile: r"gcc\win64_asm.S".} else: - {.compile: r"gcc\win32.S".} + {.compile: r"gcc\win32_asm.S".} elif defined(macosx): {.pragma: mylib, dynlib: "libffi.dylib".} diff --git a/lib/wrappers/libffi/msvc/ffi.c b/lib/wrappers/libffi/msvc/ffi.c new file mode 100644 index 0000000000..6e595e9fe7 --- /dev/null +++ b/lib/wrappers/libffi/msvc/ffi.c @@ -0,0 +1,457 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. + Copyright (c) 2002 Ranjit Mathew + Copyright (c) 2002 Bo Thorsen + Copyright (c) 2002 Roger Sayle + + x86 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include <ffi.h> +#include <ffi_common.h> + +#include <stdlib.h> + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +extern void Py_FatalError(const char *msg); + +/*@-exportheader@*/ +void ffi_prep_args(char *stack, extended_cif *ecif) +/*@=exportheader@*/ +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) + { + *(void **) argp = ecif->rvalue; + argp += sizeof(void *); + } + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + i != 0; + i--, p_arg++) + { + size_t z; + + /* Align if necessary */ + if ((sizeof(void *) - 1) & (size_t) argp) + argp = (char *) ALIGN(argp, sizeof(void *)); + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_SINT32: + *(signed int *) argp = (signed int)*(SINT32 *)(* p_argv); + break; + + case FFI_TYPE_UINT32: + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + break; + + default: + FFI_ASSERT(0); + } + } + else + { + memcpy(argp, *p_argv, z); + } + p_argv++; + argp += z; + } + + if (argp >= stack && (unsigned)(argp - stack) > ecif->cif->bytes) + { + Py_FatalError("FFI BUG: not enough stack space for arguments"); + } + return; +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + case FFI_TYPE_SINT64: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + cif->flags = (unsigned) cif->rtype->type; + break; + + case FFI_TYPE_UINT64: +#ifdef _WIN64 + case FFI_TYPE_POINTER: +#endif + cif->flags = FFI_TYPE_SINT64; + break; + + default: + cif->flags = FFI_TYPE_INT; + break; + } + + return FFI_OK; +} + +#ifdef _WIN32 +extern int +ffi_call_x86(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); +#endif + +#ifdef _WIN64 +extern int +ffi_call_AMD64(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); +#endif + +int +ffi_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, + /*@dependent@*/ void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + /*@-sysunrecog@*/ + ecif.rvalue = alloca(cif->rtype->size); + /*@=sysunrecog@*/ + } + else + ecif.rvalue = rvalue; + + + switch (cif->abi) + { +#if !defined(_WIN64) + case FFI_SYSV: + case FFI_STDCALL: + return ffi_call_x86(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; +#else + case FFI_SYSV: + /*@-usedef@*/ + /* Function call needs at least 40 bytes stack size, on win64 AMD64 */ + return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes ? cif->bytes : 40, + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; +#endif + + default: + FFI_ASSERT(0); + break; + } + return -1; /* theller: Hrm. */ +} + + +/** private members **/ + +static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, + void** args, ffi_cif* cif); +/* This function is jumped to by the trampoline */ + +#ifdef _WIN64 +void * +#else +static void __fastcall +#endif +ffi_closure_SYSV (ffi_closure *closure, int *argp) +{ + // this is our return value storage + long double res; + + // our various things... + ffi_cif *cif; + void **arg_area; + unsigned short rtype; + void *resp = (void*)&res; + void *args = &argp[1]; + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void*)); + + /* this call will initialize ARG_AREA, such that each + * element in that array points to the corresponding + * value on the stack; and if the function returns + * a structure, it will re-set RESP to point to the + * structure return address. */ + + ffi_prep_incoming_args_SYSV(args, (void**)&resp, arg_area, cif); + + (closure->fun) (cif, resp, arg_area, closure->user_data); + + rtype = cif->flags; + +#if defined(_WIN32) && !defined(_WIN64) +#ifdef _MSC_VER + /* now, do a generic return based on the value of rtype */ + if (rtype == FFI_TYPE_INT) + { + _asm mov eax, resp ; + _asm mov eax, [eax] ; + } + else if (rtype == FFI_TYPE_FLOAT) + { + _asm mov eax, resp ; + _asm fld DWORD PTR [eax] ; +// asm ("flds (%0)" : : "r" (resp) : "st" ); + } + else if (rtype == FFI_TYPE_DOUBLE) + { + _asm mov eax, resp ; + _asm fld QWORD PTR [eax] ; +// asm ("fldl (%0)" : : "r" (resp) : "st", "st(1)" ); + } + else if (rtype == FFI_TYPE_LONGDOUBLE) + { +// asm ("fldt (%0)" : : "r" (resp) : "st", "st(1)" ); + } + else if (rtype == FFI_TYPE_SINT64) + { + _asm mov edx, resp ; + _asm mov eax, [edx] ; + _asm mov edx, [edx + 4] ; +// asm ("movl 0(%0),%%eax;" +// "movl 4(%0),%%edx" +// : : "r"(resp) +// : "eax", "edx"); + } +#else + /* now, do a generic return based on the value of rtype */ + if (rtype == FFI_TYPE_INT) + { + asm ("movl (%0),%%eax" : : "r" (resp) : "eax"); + } + else if (rtype == FFI_TYPE_FLOAT) + { + asm ("flds (%0)" : : "r" (resp) : "st" ); + } + else if (rtype == FFI_TYPE_DOUBLE) + { + asm ("fldl (%0)" : : "r" (resp) : "st", "st(1)" ); + } + else if (rtype == FFI_TYPE_LONGDOUBLE) + { + asm ("fldt (%0)" : : "r" (resp) : "st", "st(1)" ); + } + else if (rtype == FFI_TYPE_SINT64) + { + asm ("movl 0(%0),%%eax;" + "movl 4(%0),%%edx" + : : "r"(resp) + : "eax", "edx"); + } +#endif +#endif + +#ifdef _WIN64 + /* The result is returned in rax. This does the right thing for + result types except for floats; we have to 'mov xmm0, rax' in the + caller to correct this. + */ + return *(void **)resp; +#endif +} + +/*@-exportheader@*/ +static void +ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, + void **avalue, ffi_cif *cif) +/*@=exportheader@*/ +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + + if ( cif->rtype->type == FFI_TYPE_STRUCT ) { + *rvalue = *(void **) argp; + argp += 4; + } + + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) + { + size_t z; + + /* Align if necessary */ + if ((sizeof(char *) - 1) & (size_t) argp) { + argp = (char *) ALIGN(argp, sizeof(char*)); + } + + z = (*p_arg)->size; + + /* because we're little endian, this is what it turns into. */ + + *p_argv = (void*) argp; + + p_argv++; + argp += z; + } + + return; +} + +/* the cif must already be prep'ed */ +extern void ffi_closure_OUTER(); + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + short bytes; + char *tramp; +#ifdef _WIN64 + int mask = 0; +#endif + FFI_ASSERT (cif->abi == FFI_SYSV); + + if (cif->abi == FFI_SYSV) + bytes = 0; +#if !defined(_WIN64) + else if (cif->abi == FFI_STDCALL) + bytes = cif->bytes; +#endif + else + return FFI_BAD_ABI; + + tramp = &closure->tramp[0]; + +#define BYTES(text) memcpy(tramp, text, sizeof(text)), tramp += sizeof(text)-1 +#define POINTER(x) *(void**)tramp = (void*)(x), tramp += sizeof(void*) +#define SHORT(x) *(short*)tramp = x, tramp += sizeof(short) +#define INT(x) *(int*)tramp = x, tramp += sizeof(int) + +#ifdef _WIN64 + if (cif->nargs >= 1 && + (cif->arg_types[0]->type == FFI_TYPE_FLOAT + || cif->arg_types[0]->type == FFI_TYPE_DOUBLE)) + mask |= 1; + if (cif->nargs >= 2 && + (cif->arg_types[1]->type == FFI_TYPE_FLOAT + || cif->arg_types[1]->type == FFI_TYPE_DOUBLE)) + mask |= 2; + if (cif->nargs >= 3 && + (cif->arg_types[2]->type == FFI_TYPE_FLOAT + || cif->arg_types[2]->type == FFI_TYPE_DOUBLE)) + mask |= 4; + if (cif->nargs >= 4 && + (cif->arg_types[3]->type == FFI_TYPE_FLOAT + || cif->arg_types[3]->type == FFI_TYPE_DOUBLE)) + mask |= 8; + + /* 41 BB ---- mov r11d,mask */ + BYTES("\x41\xBB"); INT(mask); + + /* 48 B8 -------- mov rax, closure */ + BYTES("\x48\xB8"); POINTER(closure); + + /* 49 BA -------- mov r10, ffi_closure_OUTER */ + BYTES("\x49\xBA"); POINTER(ffi_closure_OUTER); + + /* 41 FF E2 jmp r10 */ + BYTES("\x41\xFF\xE2"); + +#else + + /* mov ecx, closure */ + BYTES("\xb9"); POINTER(closure); + + /* mov edx, esp */ + BYTES("\x8b\xd4"); + + /* call ffi_closure_SYSV */ + BYTES("\xe8"); POINTER((char*)&ffi_closure_SYSV - (tramp + 4)); + + /* ret bytes */ + BYTES("\xc2"); + SHORT(bytes); + +#endif + + if (tramp - &closure->tramp[0] > FFI_TRAMPOLINE_SIZE) + Py_FatalError("FFI_TRAMPOLINE_SIZE too small in " __FILE__); + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + return FFI_OK; +} diff --git a/lib/wrappers/libffi/msvc/prep_cif.c b/lib/wrappers/libffi/msvc/prep_cif.c new file mode 100644 index 0000000000..2650fa0525 --- /dev/null +++ b/lib/wrappers/libffi/msvc/prep_cif.c @@ -0,0 +1,175 @@ +/* ----------------------------------------------------------------------- + prep_cif.c - Copyright (c) 1996, 1998 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include <ffi.h> +#include <ffi_common.h> +#include <stdlib.h> + + +/* Round up to FFI_SIZEOF_ARG. */ + +#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG) + +/* Perform machine independent initialization of aggregate type + specifications. */ + +static ffi_status initialize_aggregate(/*@out@*/ ffi_type *arg) +{ + ffi_type **ptr; + + FFI_ASSERT(arg != NULL); + + /*@-usedef@*/ + + FFI_ASSERT(arg->elements != NULL); + FFI_ASSERT(arg->size == 0); + FFI_ASSERT(arg->alignment == 0); + + ptr = &(arg->elements[0]); + + while ((*ptr) != NULL) + { + if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) + return FFI_BAD_TYPEDEF; + + /* Perform a sanity check on the argument type */ + FFI_ASSERT_VALID_TYPE(*ptr); + + arg->size = ALIGN(arg->size, (*ptr)->alignment); + arg->size += (*ptr)->size; + + arg->alignment = (arg->alignment > (*ptr)->alignment) ? + arg->alignment : (*ptr)->alignment; + + ptr++; + } + + /* Structure size includes tail padding. This is important for + structures that fit in one register on ABIs like the PowerPC64 + Linux ABI that right justify small structs in a register. + It's also needed for nested structure layout, for example + struct A { long a; char b; }; struct B { struct A x; char y; }; + should find y at an offset of 2*sizeof(long) and result in a + total size of 3*sizeof(long). */ + arg->size = ALIGN (arg->size, arg->alignment); + + if (arg->size == 0) + return FFI_BAD_TYPEDEF; + else + return FFI_OK; + + /*@=usedef@*/ +} + +/* Perform machine independent ffi_cif preparation, then call + machine dependent routine. */ + +ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, + ffi_abi abi, unsigned int nargs, + /*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type *rtype, + /*@dependent@*/ ffi_type **atypes) +{ + unsigned bytes = 0; + unsigned int i; + ffi_type **ptr; + + FFI_ASSERT(cif != NULL); + FFI_ASSERT((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI)); + + cif->abi = abi; + cif->arg_types = atypes; + cif->nargs = nargs; + cif->rtype = rtype; + + cif->flags = 0; + + /* Initialize the return type if necessary */ + /*@-usedef@*/ + if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK)) + return FFI_BAD_TYPEDEF; + /*@=usedef@*/ + + /* Perform a sanity check on the return type */ + FFI_ASSERT_VALID_TYPE(cif->rtype); + + /* x86-64 and s390 stack space allocation is handled in prep_machdep. */ +#if !defined M68K && !defined __x86_64__ && !defined S390 + /* Make space for the return structure pointer */ + if (cif->rtype->type == FFI_TYPE_STRUCT + /* MSVC returns small structures in registers. But we have a different + workaround: pretend int32 or int64 return type, and converting to + structure afterwards. */ +#ifdef SPARC + && (cif->abi != FFI_V9 || cif->rtype->size > 32) +#endif + ) + bytes = STACK_ARG_SIZE(sizeof(void*)); +#endif + + for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) + { + + /* Initialize any uninitialized aggregate type definitions */ + if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) + return FFI_BAD_TYPEDEF; + + /* Perform a sanity check on the argument type, do this + check after the initialization. */ + FFI_ASSERT_VALID_TYPE(*ptr); + +#if !defined __x86_64__ && !defined S390 +#ifdef SPARC + if (((*ptr)->type == FFI_TYPE_STRUCT + && ((*ptr)->size > 16 || cif->abi != FFI_V9)) + || ((*ptr)->type == FFI_TYPE_LONGDOUBLE + && cif->abi != FFI_V9)) + bytes += sizeof(void*); + else +#endif + { +#if !defined(_MSC_VER) && !defined(__MINGW32__) + /* Don't know if this is a libffi bug or not. At least on + Windows with MSVC, function call parameters are *not* + aligned in the same way as structure fields are, they are + only aligned in integer boundaries. + + This doesn't do any harm for cdecl functions and closures, + since the caller cleans up the stack, but it is wrong for + stdcall functions where the callee cleans. + */ + + /* Add any padding if necessary */ + if (((*ptr)->alignment - 1) & bytes) + bytes = ALIGN(bytes, (*ptr)->alignment); + +#endif + bytes += STACK_ARG_SIZE((*ptr)->size); + } +#endif + } + + cif->bytes = bytes; + + /* Perform machine dependent cif processing */ + return ffi_prep_cif_machdep(cif); +} diff --git a/lib/wrappers/libffi/msvc/types.c b/lib/wrappers/libffi/msvc/types.c new file mode 100644 index 0000000000..df32190d11 --- /dev/null +++ b/lib/wrappers/libffi/msvc/types.c @@ -0,0 +1,104 @@ +/* ----------------------------------------------------------------------- + types.c - Copyright (c) 1996, 1998 Red Hat, Inc. + + Predefined ffi_types needed by libffi. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include <ffi.h> +#include <ffi_common.h> + +/* Type definitions */ + +#define FFI_INTEGRAL_TYPEDEF(n, s, a, t) ffi_type ffi_type_##n = { s, a, t, NULL } +#define FFI_AGGREGATE_TYPEDEF(n, e) ffi_type ffi_type_##n = { 0, 0, FFI_TYPE_STRUCT, e } + +/* Size and alignment are fake here. They must not be 0. */ +FFI_INTEGRAL_TYPEDEF(void, 1, 1, FFI_TYPE_VOID); + +FFI_INTEGRAL_TYPEDEF(uint8, 1, 1, FFI_TYPE_UINT8); +FFI_INTEGRAL_TYPEDEF(sint8, 1, 1, FFI_TYPE_SINT8); +FFI_INTEGRAL_TYPEDEF(uint16, 2, 2, FFI_TYPE_UINT16); +FFI_INTEGRAL_TYPEDEF(sint16, 2, 2, FFI_TYPE_SINT16); +FFI_INTEGRAL_TYPEDEF(uint32, 4, 4, FFI_TYPE_UINT32); +FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); +FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); + +#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \ + || defined IA64 + +FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); + +#else + +FFI_INTEGRAL_TYPEDEF(pointer, 4, 4, FFI_TYPE_POINTER); + +#endif + +#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K + +FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); +FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); + +#elif defined SH + +FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); +FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); + +#else + +FFI_INTEGRAL_TYPEDEF(uint64, 8, 8, FFI_TYPE_UINT64); +FFI_INTEGRAL_TYPEDEF(sint64, 8, 8, FFI_TYPE_SINT64); + +#endif + + +#if defined X86 || defined X86_WIN32 || defined M68K + +FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); +FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); + +#elif defined ARM || defined SH || defined POWERPC_AIX || defined POWERPC_DARWIN + +FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); +FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); + +#elif defined SPARC + +FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); +#ifdef SPARC64 +FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); +#else +FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE); +#endif + +#elif defined X86_64 + +FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); +FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); + +#else + +FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); +FFI_INTEGRAL_TYPEDEF(longdouble, 8, 8, FFI_TYPE_LONGDOUBLE); + +#endif + diff --git a/lib/wrappers/libffi/msvc/win32.c b/lib/wrappers/libffi/msvc/win32.c new file mode 100644 index 0000000000..d1149a85eb --- /dev/null +++ b/lib/wrappers/libffi/msvc/win32.c @@ -0,0 +1,162 @@ +/* ----------------------------------------------------------------------- + win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. + Copyright (c) 2001 John Beniton + Copyright (c) 2002 Ranjit Mathew + + + X86 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +/* theller: almost verbatim translation from gas syntax to MSVC inline + assembler code. */ + +/* theller: ffi_call_x86 now returns an integer - the difference of the stack + pointer before and after the function call. If everything is ok, zero is + returned. If stdcall functions are passed the wrong number of arguments, + the difference will be nonzero. */ + +#include <ffi.h> +#include <ffi_common.h> + +__declspec(naked) int +ffi_call_x86(void (* prepfunc)(char *, extended_cif *), /* 8 */ + extended_cif *ecif, /* 12 */ + unsigned bytes, /* 16 */ + unsigned flags, /* 20 */ + unsigned *rvalue, /* 24 */ + void (*fn)()) /* 28 */ +{ + _asm { + push ebp + mov ebp, esp + + push esi // NEW: this register must be preserved across function calls +// XXX SAVE ESP NOW! + mov esi, esp // save stack pointer before the call + +// Make room for all of the new args. + mov ecx, [ebp+16] + sub esp, ecx // sub esp, bytes + + mov eax, esp + +// Place all of the ffi_prep_args in position + push [ebp + 12] // ecif + push eax + call [ebp + 8] // prepfunc + +// Return stack to previous state and call the function + add esp, 8 +// FIXME: Align the stack to a 128-bit boundary to avoid +// potential performance hits. + call [ebp + 28] + +// Load ecif->cif->abi + mov ecx, [ebp + 12] + mov ecx, [ecx]ecif.cif + mov ecx, [ecx]ecif.cif.abi + + cmp ecx, FFI_STDCALL + je noclean +// STDCALL: Remove the space we pushed for the args + mov ecx, [ebp + 16] + add esp, ecx +// CDECL: Caller has already cleaned the stack +noclean: +// Check that esp has the same value as before! + sub esi, esp + +// Load %ecx with the return type code + mov ecx, [ebp + 20] + +// If the return value pointer is NULL, assume no return value. +/* + Intel asm is weird. We have to explicitely specify 'DWORD PTR' in the nexr instruction, + otherwise only one BYTE will be compared (instead of a DWORD)! + */ + cmp DWORD PTR [ebp + 24], 0 + jne sc_retint + +// Even if there is no space for the return value, we are +// obliged to handle floating-point values. + cmp ecx, FFI_TYPE_FLOAT + jne sc_noretval +// fstp %st(0) + fstp st(0) + + jmp sc_epilogue + +sc_retint: + cmp ecx, FFI_TYPE_INT + jne sc_retfloat +// # Load %ecx with the pointer to storage for the return value + mov ecx, [ebp + 24] + mov [ecx + 0], eax + jmp sc_epilogue + +sc_retfloat: + cmp ecx, FFI_TYPE_FLOAT + jne sc_retdouble +// Load %ecx with the pointer to storage for the return value + mov ecx, [ebp+24] +// fstps (%ecx) + fstp DWORD PTR [ecx] + jmp sc_epilogue + +sc_retdouble: + cmp ecx, FFI_TYPE_DOUBLE + jne sc_retlongdouble +// movl 24(%ebp),%ecx + mov ecx, [ebp+24] + fstp QWORD PTR [ecx] + jmp sc_epilogue + + jmp sc_retlongdouble // avoid warning about unused label +sc_retlongdouble: + cmp ecx, FFI_TYPE_LONGDOUBLE + jne sc_retint64 +// Load %ecx with the pointer to storage for the return value + mov ecx, [ebp+24] +// fstpt (%ecx) + fstp QWORD PTR [ecx] /* XXX ??? */ + jmp sc_epilogue + +sc_retint64: + cmp ecx, FFI_TYPE_SINT64 + jne sc_retstruct +// Load %ecx with the pointer to storage for the return value + mov ecx, [ebp+24] + mov [ecx+0], eax + mov [ecx+4], edx + +sc_retstruct: +// Nothing to do! + +sc_noretval: +sc_epilogue: + mov eax, esi + pop esi // NEW restore: must be preserved across function calls + mov esp, ebp + pop ebp + ret + } +} diff --git a/lib/wrappers/libffi/msvc/win32_asm.asm b/lib/wrappers/libffi/msvc/win32_asm.asm new file mode 100644 index 0000000000..407185e6a7 --- /dev/null +++ b/lib/wrappers/libffi/msvc/win32_asm.asm @@ -0,0 +1,470 @@ +/* ----------------------------------------------------------------------- + win32.S - Copyright (c) 1996, 1998, 2001, 2002, 2009 Red Hat, Inc. + Copyright (c) 2001 John Beniton + Copyright (c) 2002 Ranjit Mathew + Copyright (c) 2009 Daniel Witte + + + X86 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- + */ + +#define LIBFFI_ASM +#include <fficonfig.h> +#include <ffi.h> + +.386 +.MODEL FLAT, C + +EXTRN ffi_closure_SYSV_inner:NEAR + +_TEXT SEGMENT + +ffi_call_win32 PROC NEAR, + ffi_prep_args : NEAR PTR DWORD, + ecif : NEAR PTR DWORD, + cif_abi : DWORD, + cif_bytes : DWORD, + cif_flags : DWORD, + rvalue : NEAR PTR DWORD, + fn : NEAR PTR DWORD + + ;; Make room for all of the new args. + mov ecx, cif_bytes + sub esp, ecx + + mov eax, esp + + ;; Place all of the ffi_prep_args in position + push ecif + push eax + call ffi_prep_args + + ;; Return stack to previous state and call the function + add esp, 8 + + ;; Handle thiscall and fastcall + cmp cif_abi, 3 ;; FFI_THISCALL + jz do_thiscall + cmp cif_abi, 4 ;; FFI_FASTCALL + jnz do_stdcall + mov ecx, DWORD PTR [esp] + mov edx, DWORD PTR [esp+4] + add esp, 8 + jmp do_stdcall +do_thiscall: + mov ecx, DWORD PTR [esp] + add esp, 4 +do_stdcall: + call fn + + ;; cdecl: we restore esp in the epilogue, so there's no need to + ;; remove the space we pushed for the args. + ;; stdcall: the callee has already cleaned the stack. + + ;; Load ecx with the return type code + mov ecx, cif_flags + + ;; If the return value pointer is NULL, assume no return value. + cmp rvalue, 0 + jne ca_jumptable + + ;; Even if there is no space for the return value, we are + ;; obliged to handle floating-point values. + cmp ecx, FFI_TYPE_FLOAT + jne ca_epilogue + fstp st(0) + + jmp ca_epilogue + +ca_jumptable: + jmp [ca_jumpdata + 4 * ecx] +ca_jumpdata: + ;; Do not insert anything here between label and jump table. + dd offset ca_epilogue ;; FFI_TYPE_VOID + dd offset ca_retint ;; FFI_TYPE_INT + dd offset ca_retfloat ;; FFI_TYPE_FLOAT + dd offset ca_retdouble ;; FFI_TYPE_DOUBLE + dd offset ca_retlongdouble ;; FFI_TYPE_LONGDOUBLE + dd offset ca_retuint8 ;; FFI_TYPE_UINT8 + dd offset ca_retsint8 ;; FFI_TYPE_SINT8 + dd offset ca_retuint16 ;; FFI_TYPE_UINT16 + dd offset ca_retsint16 ;; FFI_TYPE_SINT16 + dd offset ca_retint ;; FFI_TYPE_UINT32 + dd offset ca_retint ;; FFI_TYPE_SINT32 + dd offset ca_retint64 ;; FFI_TYPE_UINT64 + dd offset ca_retint64 ;; FFI_TYPE_SINT64 + dd offset ca_epilogue ;; FFI_TYPE_STRUCT + dd offset ca_retint ;; FFI_TYPE_POINTER + dd offset ca_retstruct1b ;; FFI_TYPE_SMALL_STRUCT_1B + dd offset ca_retstruct2b ;; FFI_TYPE_SMALL_STRUCT_2B + dd offset ca_retint ;; FFI_TYPE_SMALL_STRUCT_4B + dd offset ca_epilogue ;; FFI_TYPE_MS_STRUCT + + /* Sign/zero extend as appropriate. */ +ca_retuint8: + movzx eax, al + jmp ca_retint + +ca_retsint8: + movsx eax, al + jmp ca_retint + +ca_retuint16: + movzx eax, ax + jmp ca_retint + +ca_retsint16: + movsx eax, ax + jmp ca_retint + +ca_retint: + ;; Load %ecx with the pointer to storage for the return value + mov ecx, rvalue + mov [ecx + 0], eax + jmp ca_epilogue + +ca_retint64: + ;; Load %ecx with the pointer to storage for the return value + mov ecx, rvalue + mov [ecx + 0], eax + mov [ecx + 4], edx + jmp ca_epilogue + +ca_retfloat: + ;; Load %ecx with the pointer to storage for the return value + mov ecx, rvalue + fstp DWORD PTR [ecx] + jmp ca_epilogue + +ca_retdouble: + ;; Load %ecx with the pointer to storage for the return value + mov ecx, rvalue + fstp QWORD PTR [ecx] + jmp ca_epilogue + +ca_retlongdouble: + ;; Load %ecx with the pointer to storage for the return value + mov ecx, rvalue + fstp TBYTE PTR [ecx] + jmp ca_epilogue + +ca_retstruct1b: + ;; Load %ecx with the pointer to storage for the return value + mov ecx, rvalue + mov [ecx + 0], al + jmp ca_epilogue + +ca_retstruct2b: + ;; Load %ecx with the pointer to storage for the return value + mov ecx, rvalue + mov [ecx + 0], ax + jmp ca_epilogue + +ca_epilogue: + ;; Epilogue code is autogenerated. + ret +ffi_call_win32 ENDP + +ffi_closure_THISCALL PROC NEAR FORCEFRAME + sub esp, 40 + lea edx, [ebp -24] + mov [ebp - 12], edx /* resp */ + lea edx, [ebp + 12] /* account for stub return address on stack */ + jmp stub +ffi_closure_THISCALL ENDP + +ffi_closure_SYSV PROC NEAR FORCEFRAME + ;; the ffi_closure ctx is passed in eax by the trampoline. + + sub esp, 40 + lea edx, [ebp - 24] + mov [ebp - 12], edx ;; resp + lea edx, [ebp + 8] +stub:: + mov [esp + 8], edx ;; args + lea edx, [ebp - 12] + mov [esp + 4], edx ;; &resp + mov [esp], eax ;; closure + call ffi_closure_SYSV_inner + mov ecx, [ebp - 12] + +cs_jumptable: + jmp [cs_jumpdata + 4 * eax] +cs_jumpdata: + ;; Do not insert anything here between the label and jump table. + dd offset cs_epilogue ;; FFI_TYPE_VOID + dd offset cs_retint ;; FFI_TYPE_INT + dd offset cs_retfloat ;; FFI_TYPE_FLOAT + dd offset cs_retdouble ;; FFI_TYPE_DOUBLE + dd offset cs_retlongdouble ;; FFI_TYPE_LONGDOUBLE + dd offset cs_retuint8 ;; FFI_TYPE_UINT8 + dd offset cs_retsint8 ;; FFI_TYPE_SINT8 + dd offset cs_retuint16 ;; FFI_TYPE_UINT16 + dd offset cs_retsint16 ;; FFI_TYPE_SINT16 + dd offset cs_retint ;; FFI_TYPE_UINT32 + dd offset cs_retint ;; FFI_TYPE_SINT32 + dd offset cs_retint64 ;; FFI_TYPE_UINT64 + dd offset cs_retint64 ;; FFI_TYPE_SINT64 + dd offset cs_retstruct ;; FFI_TYPE_STRUCT + dd offset cs_retint ;; FFI_TYPE_POINTER + dd offset cs_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B + dd offset cs_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B + dd offset cs_retint ;; FFI_TYPE_SMALL_STRUCT_4B + dd offset cs_retmsstruct ;; FFI_TYPE_MS_STRUCT + +cs_retuint8: + movzx eax, BYTE PTR [ecx] + jmp cs_epilogue + +cs_retsint8: + movsx eax, BYTE PTR [ecx] + jmp cs_epilogue + +cs_retuint16: + movzx eax, WORD PTR [ecx] + jmp cs_epilogue + +cs_retsint16: + movsx eax, WORD PTR [ecx] + jmp cs_epilogue + +cs_retint: + mov eax, [ecx] + jmp cs_epilogue + +cs_retint64: + mov eax, [ecx + 0] + mov edx, [ecx + 4] + jmp cs_epilogue + +cs_retfloat: + fld DWORD PTR [ecx] + jmp cs_epilogue + +cs_retdouble: + fld QWORD PTR [ecx] + jmp cs_epilogue + +cs_retlongdouble: + fld TBYTE PTR [ecx] + jmp cs_epilogue + +cs_retstruct: + ;; Caller expects us to pop struct return value pointer hidden arg. + ;; Epilogue code is autogenerated. + ret 4 + +cs_retmsstruct: + ;; Caller expects us to return a pointer to the real return value. + mov eax, ecx + ;; Caller doesn't expects us to pop struct return value pointer hidden arg. + jmp cs_epilogue + +cs_epilogue: + ;; Epilogue code is autogenerated. + ret +ffi_closure_SYSV ENDP + +#if !FFI_NO_RAW_API + +#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3) +#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4) +#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4) +#define CIF_FLAGS_OFFSET 20 + +ffi_closure_raw_THISCALL PROC NEAR USES esi FORCEFRAME + sub esp, 36 + mov esi, [eax + RAW_CLOSURE_CIF_OFFSET] ;; closure->cif + mov edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET] ;; closure->user_data + mov [esp + 12], edx + lea edx, [ebp + 12] + jmp stubraw +ffi_closure_raw_THISCALL ENDP + +ffi_closure_raw_SYSV PROC NEAR USES esi FORCEFRAME + ;; the ffi_closure ctx is passed in eax by the trampoline. + + sub esp, 40 + mov esi, [eax + RAW_CLOSURE_CIF_OFFSET] ;; closure->cif + mov edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET] ;; closure->user_data + mov [esp + 12], edx ;; user_data + lea edx, [ebp + 8] +stubraw:: + mov [esp + 8], edx ;; raw_args + lea edx, [ebp - 24] + mov [esp + 4], edx ;; &res + mov [esp], esi ;; cif + call DWORD PTR [eax + RAW_CLOSURE_FUN_OFFSET] ;; closure->fun + mov eax, [esi + CIF_FLAGS_OFFSET] ;; cif->flags + lea ecx, [ebp - 24] + +cr_jumptable: + jmp [cr_jumpdata + 4 * eax] +cr_jumpdata: + ;; Do not insert anything here between the label and jump table. + dd offset cr_epilogue ;; FFI_TYPE_VOID + dd offset cr_retint ;; FFI_TYPE_INT + dd offset cr_retfloat ;; FFI_TYPE_FLOAT + dd offset cr_retdouble ;; FFI_TYPE_DOUBLE + dd offset cr_retlongdouble ;; FFI_TYPE_LONGDOUBLE + dd offset cr_retuint8 ;; FFI_TYPE_UINT8 + dd offset cr_retsint8 ;; FFI_TYPE_SINT8 + dd offset cr_retuint16 ;; FFI_TYPE_UINT16 + dd offset cr_retsint16 ;; FFI_TYPE_SINT16 + dd offset cr_retint ;; FFI_TYPE_UINT32 + dd offset cr_retint ;; FFI_TYPE_SINT32 + dd offset cr_retint64 ;; FFI_TYPE_UINT64 + dd offset cr_retint64 ;; FFI_TYPE_SINT64 + dd offset cr_epilogue ;; FFI_TYPE_STRUCT + dd offset cr_retint ;; FFI_TYPE_POINTER + dd offset cr_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B + dd offset cr_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B + dd offset cr_retint ;; FFI_TYPE_SMALL_STRUCT_4B + dd offset cr_epilogue ;; FFI_TYPE_MS_STRUCT + +cr_retuint8: + movzx eax, BYTE PTR [ecx] + jmp cr_epilogue + +cr_retsint8: + movsx eax, BYTE PTR [ecx] + jmp cr_epilogue + +cr_retuint16: + movzx eax, WORD PTR [ecx] + jmp cr_epilogue + +cr_retsint16: + movsx eax, WORD PTR [ecx] + jmp cr_epilogue + +cr_retint: + mov eax, [ecx] + jmp cr_epilogue + +cr_retint64: + mov eax, [ecx + 0] + mov edx, [ecx + 4] + jmp cr_epilogue + +cr_retfloat: + fld DWORD PTR [ecx] + jmp cr_epilogue + +cr_retdouble: + fld QWORD PTR [ecx] + jmp cr_epilogue + +cr_retlongdouble: + fld TBYTE PTR [ecx] + jmp cr_epilogue + +cr_epilogue: + ;; Epilogue code is autogenerated. + ret +ffi_closure_raw_SYSV ENDP + +#endif /* !FFI_NO_RAW_API */ + +ffi_closure_STDCALL PROC NEAR FORCEFRAME + ;; the ffi_closure ctx is passed in eax by the trampoline. + + sub esp, 40 + lea edx, [ebp - 24] + mov [ebp - 12], edx ;; resp + lea edx, [ebp + 12] ;; account for stub return address on stack + mov [esp + 8], edx ;; args + lea edx, [ebp - 12] + mov [esp + 4], edx ;; &resp + mov [esp], eax ;; closure + call ffi_closure_SYSV_inner + mov ecx, [ebp - 12] + +cd_jumptable: + jmp [cd_jumpdata + 4 * eax] +cd_jumpdata: + ;; Do not insert anything here between the label and jump table. + dd offset cd_epilogue ;; FFI_TYPE_VOID + dd offset cd_retint ;; FFI_TYPE_INT + dd offset cd_retfloat ;; FFI_TYPE_FLOAT + dd offset cd_retdouble ;; FFI_TYPE_DOUBLE + dd offset cd_retlongdouble ;; FFI_TYPE_LONGDOUBLE + dd offset cd_retuint8 ;; FFI_TYPE_UINT8 + dd offset cd_retsint8 ;; FFI_TYPE_SINT8 + dd offset cd_retuint16 ;; FFI_TYPE_UINT16 + dd offset cd_retsint16 ;; FFI_TYPE_SINT16 + dd offset cd_retint ;; FFI_TYPE_UINT32 + dd offset cd_retint ;; FFI_TYPE_SINT32 + dd offset cd_retint64 ;; FFI_TYPE_UINT64 + dd offset cd_retint64 ;; FFI_TYPE_SINT64 + dd offset cd_epilogue ;; FFI_TYPE_STRUCT + dd offset cd_retint ;; FFI_TYPE_POINTER + dd offset cd_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B + dd offset cd_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B + dd offset cd_retint ;; FFI_TYPE_SMALL_STRUCT_4B + +cd_retuint8: + movzx eax, BYTE PTR [ecx] + jmp cd_epilogue + +cd_retsint8: + movsx eax, BYTE PTR [ecx] + jmp cd_epilogue + +cd_retuint16: + movzx eax, WORD PTR [ecx] + jmp cd_epilogue + +cd_retsint16: + movsx eax, WORD PTR [ecx] + jmp cd_epilogue + +cd_retint: + mov eax, [ecx] + jmp cd_epilogue + +cd_retint64: + mov eax, [ecx + 0] + mov edx, [ecx + 4] + jmp cd_epilogue + +cd_retfloat: + fld DWORD PTR [ecx] + jmp cd_epilogue + +cd_retdouble: + fld QWORD PTR [ecx] + jmp cd_epilogue + +cd_retlongdouble: + fld TBYTE PTR [ecx] + jmp cd_epilogue + +cd_epilogue: + ;; Epilogue code is autogenerated. + ret +ffi_closure_STDCALL ENDP + +_TEXT ENDS +END diff --git a/lib/wrappers/libffi/msvc/win64_asm.asm b/lib/wrappers/libffi/msvc/win64_asm.asm new file mode 100644 index 0000000000..301188bc9c --- /dev/null +++ b/lib/wrappers/libffi/msvc/win64_asm.asm @@ -0,0 +1,156 @@ +PUBLIC ffi_call_AMD64 + +EXTRN __chkstk:NEAR +EXTRN ffi_closure_SYSV:NEAR + +_TEXT SEGMENT + +;;; ffi_closure_OUTER will be called with these registers set: +;;; rax points to 'closure' +;;; r11 contains a bit mask that specifies which of the +;;; first four parameters are float or double +;;; +;;; It must move the parameters passed in registers to their stack location, +;;; call ffi_closure_SYSV for the actual work, then return the result. +;;; +ffi_closure_OUTER PROC FRAME + ;; save actual arguments to their stack space. + test r11, 1 + jne first_is_float + mov QWORD PTR [rsp+8], rcx + jmp second +first_is_float: + movlpd QWORD PTR [rsp+8], xmm0 + +second: + test r11, 2 + jne second_is_float + mov QWORD PTR [rsp+16], rdx + jmp third +second_is_float: + movlpd QWORD PTR [rsp+16], xmm1 + +third: + test r11, 4 + jne third_is_float + mov QWORD PTR [rsp+24], r8 + jmp forth +third_is_float: + movlpd QWORD PTR [rsp+24], xmm2 + +forth: + test r11, 8 + jne forth_is_float + mov QWORD PTR [rsp+32], r9 + jmp done +forth_is_float: + movlpd QWORD PTR [rsp+32], xmm3 + +done: +.ALLOCSTACK 40 + sub rsp, 40 +.ENDPROLOG + mov rcx, rax ; context is first parameter + mov rdx, rsp ; stack is second parameter + add rdx, 40 ; correct our own area + mov rax, ffi_closure_SYSV + call rax ; call the real closure function + ;; Here, code is missing that handles float return values + add rsp, 40 + movd xmm0, rax ; In case the closure returned a float. + ret 0 +ffi_closure_OUTER ENDP + + +;;; ffi_call_AMD64 + +stack$ = 0 +prepfunc$ = 32 +ecif$ = 40 +bytes$ = 48 +flags$ = 56 +rvalue$ = 64 +fn$ = 72 + +ffi_call_AMD64 PROC FRAME + + mov QWORD PTR [rsp+32], r9 + mov QWORD PTR [rsp+24], r8 + mov QWORD PTR [rsp+16], rdx + mov QWORD PTR [rsp+8], rcx +.PUSHREG rbp + push rbp +.ALLOCSTACK 48 + sub rsp, 48 ; 00000030H +.SETFRAME rbp, 32 + lea rbp, QWORD PTR [rsp+32] +.ENDPROLOG + + mov eax, DWORD PTR bytes$[rbp] + add rax, 15 + and rax, -16 + call __chkstk + sub rsp, rax + lea rax, QWORD PTR [rsp+32] + mov QWORD PTR stack$[rbp], rax + + mov rdx, QWORD PTR ecif$[rbp] + mov rcx, QWORD PTR stack$[rbp] + call QWORD PTR prepfunc$[rbp] + + mov rsp, QWORD PTR stack$[rbp] + + movlpd xmm3, QWORD PTR [rsp+24] + movd r9, xmm3 + + movlpd xmm2, QWORD PTR [rsp+16] + movd r8, xmm2 + + movlpd xmm1, QWORD PTR [rsp+8] + movd rdx, xmm1 + + movlpd xmm0, QWORD PTR [rsp] + movd rcx, xmm0 + + call QWORD PTR fn$[rbp] +ret_int$: + cmp DWORD PTR flags$[rbp], 1 ; FFI_TYPE_INT + jne ret_float$ + + mov rcx, QWORD PTR rvalue$[rbp] + mov DWORD PTR [rcx], eax + jmp SHORT ret_nothing$ + +ret_float$: + cmp DWORD PTR flags$[rbp], 2 ; FFI_TYPE_FLOAT + jne SHORT ret_double$ + + mov rax, QWORD PTR rvalue$[rbp] + movlpd QWORD PTR [rax], xmm0 + jmp SHORT ret_nothing$ + +ret_double$: + cmp DWORD PTR flags$[rbp], 3 ; FFI_TYPE_DOUBLE + jne SHORT ret_int64$ + + mov rax, QWORD PTR rvalue$[rbp] + movlpd QWORD PTR [rax], xmm0 + jmp SHORT ret_nothing$ + +ret_int64$: + cmp DWORD PTR flags$[rbp], 12 ; FFI_TYPE_SINT64 + jne ret_nothing$ + + mov rcx, QWORD PTR rvalue$[rbp] + mov QWORD PTR [rcx], rax + jmp SHORT ret_nothing$ + +ret_nothing$: + xor eax, eax + + lea rsp, QWORD PTR [rbp+16] + pop rbp + ret 0 +ffi_call_AMD64 ENDP +_TEXT ENDS +END From 4b0e391bb83ade40a049288d33bfff7aba2b0124 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 20 Dec 2013 00:02:04 +0100 Subject: [PATCH 119/326] no stack tracing for the system module; fixes stack bottom detection --- compiler/cgen.nim | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index c143a5d6a5..6ccef5fde4 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -1122,6 +1122,9 @@ proc newPostInitProc(m: BModule): BProc = # little hack so that unique temporaries are generated: result.labels = 200_000 +proc initProcOptions(m: BModule): TOptions = + if sfSystemModule in m.module.flags: gOptions-{optStackTrace} else: gOptions + proc rawNewModule(module: PSym, filename: string): BModule = new(result) InitLinkedList(result.headerFiles) @@ -1134,7 +1137,7 @@ proc rawNewModule(module: PSym, filename: string): BModule = result.module = module result.typeInfoMarker = initIntSet() result.initProc = newProc(nil, result) - result.initProc.options = gOptions + result.initProc.options = initProcOptions(result) result.preInitProc = newPreInitProc(result) result.postInitProc = newPostInitProc(result) initNodeTable(result.dataCache) @@ -1142,7 +1145,12 @@ proc rawNewModule(module: PSym, filename: string): BModule = result.forwardedProcs = @[] result.typeNodesName = getTempName() result.nimTypesName = getTempName() - result.PreventStackTrace = sfSystemModule in module.flags + # no line tracing for the init sections of the system module so that we + # don't generate a TFrame which can confuse the stack botton initialization: + if sfSystemModule in module.flags: + result.PreventStackTrace = true + excl(result.preInitProc.options, optStackTrace) + excl(result.postInitProc.options, optStackTrace) proc nullify[T](arr: var T) = for i in low(arr)..high(arr): @@ -1155,7 +1163,7 @@ proc resetModule*(m: var BModule) = m.declaredProtos = initIntSet() initIdTable(m.forwTypeCache) m.initProc = newProc(nil, m) - m.initProc.options = gOptions + m.initProc.options = initProcOptions(m) m.preInitProc = newPreInitProc(m) m.postInitProc = newPostInitProc(m) initNodeTable(m.dataCache) @@ -1245,7 +1253,7 @@ proc myProcess(b: PPassContext, n: PNode): PNode = result = n if b == nil or passes.skipCodegen(n): return var m = BModule(b) - m.initProc.options = gOptions + m.initProc.options = initProcOptions(m) genStmts(m.initProc, n) proc finishModule(m: BModule) = @@ -1332,7 +1340,7 @@ proc myClose(b: PPassContext, n: PNode): PNode = if b == nil or passes.skipCodegen(n): return var m = BModule(b) if n != nil: - m.initProc.options = gOptions + m.initProc.options = initProcOptions(m) genStmts(m.initProc, n) # cached modules need to registered too: registerModuleToMain(m.module) From 3b38ceac2e12c2b1bbe3876eb634000ddb2a9b68 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Fri, 20 Dec 2013 13:13:09 +0100 Subject: [PATCH 120/326] Runs user specified outFile if available. Refs #738. --- compiler/nimrod.nim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim index 8e3c0e61ee..2bc94e3f87 100644 --- a/compiler/nimrod.nim +++ b/compiler/nimrod.nim @@ -65,8 +65,14 @@ proc HandleCmdLine() = completeCFilePath(changeFileExt(gProjectFull, "js").prependCurDir)) execExternalProgram("node " & ex & ' ' & service.arguments) else: - var ex = quoteShell( - changeFileExt(gProjectFull, exeExt).prependCurDir) + var binPath: string + if options.outFile.len > 0: + # If the user specified an outFile path, use that directly. + binPath = options.outFile.prependCurDir + else: + # Figure out ourselves a valid binary name. + binPath = changeFileExt(gProjectFull, exeExt).prependCurDir + var ex = quoteShell(binPath) execExternalProgram(ex & ' ' & service.arguments) when defined(GC_setMaxPause): From c0e2cb29195c9d84781609689697a26892ea943c Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Fri, 20 Dec 2013 13:33:43 +0100 Subject: [PATCH 121/326] Allows passing absolute paths for output. Refs #738. Previous to this the project base dir was added always, preventing user specified absolute paths to work. --- compiler/extccomp.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index fe1bea3fff..d3b3cee757 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -616,7 +616,8 @@ proc CallCCompiler*(projectfile: string) = if options.outFile.len > 0: exefile = options.outFile if not noAbsolutePaths(): - exefile = joinPath(splitFile(projectFile).dir, exefile) + if not exeFile.isAbsolute(): + exefile = joinPath(splitFile(projectFile).dir, exefile) exefile = quoteShell(exefile) let linkOptions = getLinkOptions() linkCmd = quoteShell(linkCmd % ["builddll", builddll, From f06c9a77b50ab4abfe57d9d9e679817acbea128b Mon Sep 17 00:00:00 2001 From: Billingsly Wetherfordshire <phowl.mouth@gmail.com> Date: Fri, 20 Dec 2013 14:23:13 -0600 Subject: [PATCH 122/326] Update macros.nim --- lib/core/macros.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/macros.nim b/lib/core/macros.nim index d01d4ebee4..d288260717 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -497,11 +497,11 @@ from strutils import cmpIgnoreStyle, format proc expectKind*(n: PNimrodNode; k: set[TNimrodNodeKind]) {.compileTime.} = assert n.kind in k, "Expected one of $1, got $2".format(k, n.kind) -proc newProc*(name = newEmptyNode(); params: openarray[PNimrodNode] = []; +proc newProc*(name = newEmptyNode(); params: openarray[PNimrodNode] = [newEmptyNode()]; body: PNimrodNode = newStmtList(), procType = nnkProcDef): PNimrodNode {.compileTime.} = ## shortcut for creating a new proc ## - ## The ``params`` array should start with the return type of the proc, + ## The ``params`` array must start with the return type of the proc, ## followed by a list of IdentDefs which specify the params. assert procType in RoutineNodes result = newNimNode(procType).add( From 7177e0f69877d9cde61a14e4df6a2478d35503e4 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Wed, 18 Dec 2013 23:32:39 +0100 Subject: [PATCH 123/326] Adds docstring to macros.newIdentDefs. --- lib/core/macros.nim | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 5f0d60e5c5..7caf4c5537 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -478,6 +478,34 @@ proc newDotExpr*(a, b: PNimrodNode): PNimrodNode {.compileTime.} = proc newIdentDefs*(name, kind: PNimrodNode; default = newEmptyNode()): PNimrodNode {.compileTime.} = + ## Creates a new ``nnkIdentDefs`` node of a specific kind and value. + ## + ## ``nnkIdentDefs`` need to have at least three children, but they can have + ## more: first comes a list of identifiers followed by a type and value + ## nodes. This helper proc creates a three node subtree, the first subnode + ## being a single identifier name. Both the ``kind`` node and ``default`` + ## (value) nodes may be empty depending on where the ``nnkIdentDefs`` + ## appears: tuple or object definitions will have an empty ``default`` node, + ## ``let`` or ``var`` blocks may have an empty ``kind`` node if the + ## identifier is being assigned a value. Example: + ## + ## .. code-block:: nimrod + ## + ## var varSection = newNimNode(nnkVarSection).add( + ## newIdentDefs(ident("a"), ident("string")), + ## newIdentDefs(ident("b"), newEmptyNode(), newLit(3))) + ## # --> var + ## # a: string + ## # b = 3 + ## + ## If you need to create multiple identifiers you need to use the lower level + ## ``newNimNode``: + ## + ## .. code-block:: nimrod + ## + ## result = newNimNode(nnkIdentDefs).add( + ## ident("a"), ident("b"), ident("c"), ident("string"), + ## newStrLitNode("Hello")) newNimNode(nnkIdentDefs).add(name, kind, default) proc newNilLit*(): PNimrodNode {.compileTime.} = From 7a05b108d52d7d4ea2c57daf57b82b9a5cb9c37b Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Sat, 21 Dec 2013 11:44:17 +0100 Subject: [PATCH 124/326] Renames configuration file to new pattern. Refs #720. --- lib/pure/{actors.cfg => actors.nimrod.cfg} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/pure/{actors.cfg => actors.nimrod.cfg} (100%) diff --git a/lib/pure/actors.cfg b/lib/pure/actors.nimrod.cfg similarity index 100% rename from lib/pure/actors.cfg rename to lib/pure/actors.nimrod.cfg From 3503f1ca3395dfe64ad302717914218db72b402f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= <michal@zielinscy.org.pl> Date: Sat, 21 Dec 2013 18:05:19 +0100 Subject: [PATCH 125/326] Normalize whitespace in osproc.nim. --- lib/pure/osproc.nim | 58 ++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 61b940ce83..065d940408 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -109,8 +109,8 @@ proc execCmd*(command: string): int {.rtl, extern: "nosp$1", tags: [FExecIO].} proc startProcess*(command: string, workingDir: string = "", args: openarray[string] = [], - env: PStringTable = nil, - options: set[TProcessOption] = {poStdErrToStdOut}): + env: PStringTable = nil, + options: set[TProcessOption] = {poStdErrToStdOut}): PProcess {.rtl, extern: "nosp$1", tags: [FExecIO, FReadEnv].} ## Starts a process. `Command` is the executable file, `workingDir` is the ## process's working directory. If ``workingDir == ""`` the current directory @@ -157,7 +157,7 @@ proc processID*(p: PProcess): int {.rtl, extern: "nosp$1".} = ## returns `p`'s process ID. return p.id -proc waitForExit*(p: PProcess, timeout: int = -1): int {.rtl, +proc waitForExit*(p: PProcess, timeout: int = -1): int {.rtl, extern: "nosp$1", tags: [].} ## waits for the process to finish and returns `p`'s error code. @@ -167,19 +167,19 @@ proc peekExitCode*(p: PProcess): int {.tags: [].} proc inputStream*(p: PProcess): PStream {.rtl, extern: "nosp$1", tags: [].} ## returns ``p``'s input stream for writing to. ## - ## **Warning**: The returned `PStream` should not be closed manually as it + ## **Warning**: The returned `PStream` should not be closed manually as it ## is closed when closing the PProcess ``p``. proc outputStream*(p: PProcess): PStream {.rtl, extern: "nosp$1", tags: [].} ## returns ``p``'s output stream for reading from. ## - ## **Warning**: The returned `PStream` should not be closed manually as it + ## **Warning**: The returned `PStream` should not be closed manually as it ## is closed when closing the PProcess ``p``. proc errorStream*(p: PProcess): PStream {.rtl, extern: "nosp$1", tags: [].} ## returns ``p``'s error stream for reading from. ## - ## **Warning**: The returned `PStream` should not be closed manually as it + ## **Warning**: The returned `PStream` should not be closed manually as it ## is closed when closing the PProcess ``p``. proc inputHandle*(p: PProcess): TFileHandle {.rtl, extern: "nosp$1", @@ -245,7 +245,7 @@ proc countProcessors*(): int {.rtl, extern: "nosp$1".} = proc execProcesses*(cmds: openArray[string], options = {poStdErrToStdOut, poParentStreams}, - n = countProcessors()): int {.rtl, extern: "nosp$1", + n = countProcessors()): int {.rtl, extern: "nosp$1", tags: [FExecIO, FTime, FReadEnv].} = ## executes the commands `cmds` in parallel. Creates `n` processes ## that execute in parallel. The highest return value of all processes @@ -253,7 +253,7 @@ proc execProcesses*(cmds: openArray[string], when defined(posix): # poParentStreams causes problems on Posix, so we simply disable it: var options = options - {poParentStreams} - + assert n > 0 if n > 1: var q: seq[PProcess] @@ -441,7 +441,7 @@ when defined(Windows) and not defined(useNimRtl): var ee = newWideCString(e) var wwd = newWideCString(wd) success = winlean.CreateProcessW(nil, - tmp, nil, nil, 1, NORMAL_PRIORITY_CLASS or CREATE_UNICODE_ENVIRONMENT, + tmp, nil, nil, 1, NORMAL_PRIORITY_CLASS or CREATE_UNICODE_ENVIRONMENT, ee, wwd, SI, ProcInfo) else: success = winlean.CreateProcessA(nil, @@ -495,7 +495,7 @@ when defined(Windows) and not defined(useNimRtl): proc peekExitCode(p: PProcess): int = var b = waitForSingleObject(p.FProcessHandle, 50) == WAIT_TIMEOUT if b: result = -1 - else: + else: var res: int32 discard GetExitCodeProcess(p.FProcessHandle, res) return res @@ -538,13 +538,13 @@ when defined(Windows) and not defined(useNimRtl): result = -1 discard CloseHandle(Process) - proc select(readfds: var seq[PProcess], timeout = 500): int = + proc select(readfds: var seq[PProcess], timeout = 500): int = assert readfds.len <= MAXIMUM_WAIT_OBJECTS var rfds: TWOHandleArray for i in 0..readfds.len()-1: rfds[i] = readfds[i].FProcessHandle - - var ret = waitForMultipleObjects(readfds.len.int32, + + var ret = waitForMultipleObjects(readfds.len.int32, addr(rfds), 0'i32, timeout.int32) case ret of WAIT_TIMEOUT: @@ -595,7 +595,7 @@ elif not defined(useNimRtl): result[i] = cast[cstring](alloc(x.len+1)) copyMem(result[i], addr(x[0]), x.len+1) inc(i) - + proc startProcess(command: string, workingDir: string = "", args: openarray[string] = [], @@ -609,23 +609,23 @@ elif not defined(useNimRtl): if pipe(p_stdin) != 0'i32 or pipe(p_stdout) != 0'i32 or pipe(p_stderr) != 0'i32: OSError(OSLastError()) - + var pid: TPid when defined(posix_spawn) and not defined(useFork): var attr: Tposix_spawnattr var fops: Tposix_spawn_file_actions - template chck(e: expr) = + template chck(e: expr) = if e != 0'i32: OSError(OSLastError()) chck posix_spawn_file_actions_init(fops) chck posix_spawnattr_init(attr) - + var mask: Tsigset chck sigemptyset(mask) chck posix_spawnattr_setsigmask(attr, mask) chck posix_spawnattr_setpgroup(attr, 0'i32) - + chck posix_spawnattr_setflags(attr, POSIX_SPAWN_USEVFORK or POSIX_SPAWN_SETSIGMASK or POSIX_SPAWN_SETPGROUP) @@ -640,7 +640,7 @@ elif not defined(useNimRtl): chck posix_spawn_file_actions_adddup2(fops, p_stdout[writeIdx], 2) else: chck posix_spawn_file_actions_adddup2(fops, p_stderr[writeIdx], 2) - + var e = if env == nil: EnvToCStringArray() else: ToCStringArray(env) var a: cstringArray var res: cint @@ -659,7 +659,7 @@ elif not defined(useNimRtl): chck res else: - + Pid = fork() if Pid < 0: OSError(OSLastError()) if pid == 0: @@ -790,13 +790,13 @@ elif not defined(useNimRtl): proc execCmd(command: string): int = result = csystem(command) - proc createFdSet(fd: var TFdSet, s: seq[PProcess], m: var int) = + proc createFdSet(fd: var TFdSet, s: seq[PProcess], m: var int) = FD_ZERO(fd) - for i in items(s): + for i in items(s): m = max(m, int(i.outHandle)) FD_SET(cint(i.outHandle), fd) - - proc pruneProcessSet(s: var seq[PProcess], fd: var TFdSet) = + + proc pruneProcessSet(s: var seq[PProcess], fd: var TFdSet) = var i = 0 var L = s.len while i < L: @@ -807,26 +807,26 @@ elif not defined(useNimRtl): inc(i) setLen(s, L) - proc select(readfds: var seq[PProcess], timeout = 500): int = + proc select(readfds: var seq[PProcess], timeout = 500): int = var tv: TTimeVal tv.tv_sec = 0 tv.tv_usec = timeout * 1000 - + var rd: TFdSet var m = 0 createFdSet((rd), readfds, m) - + if timeout != -1: result = int(select(cint(m+1), addr(rd), nil, nil, addr(tv))) else: result = int(select(cint(m+1), addr(rd), nil, nil, nil)) - + pruneProcessSet(readfds, (rd)) proc execCmdEx*(command: string, options: set[TProcessOption] = { poStdErrToStdOut, poUseShell}): tuple[ - output: TaintedString, + output: TaintedString, exitCode: int] {.tags: [FExecIO, FReadIO].} = ## a convenience proc that runs the `command`, grabs all its output and ## exit code and returns both. From bdb5c4ad35812d1b065f8cfb3cabf1bf6ab6f4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= <michal@zielinscy.org.pl> Date: Sat, 21 Dec 2013 18:15:11 +0100 Subject: [PATCH 126/326] Introduce poEvalCommand, poUsePath, fix remaining quoting issues. - poUsePath is now an alias for poUseShell. - poEvalCommand should be used when shell evaluation is really needed. It passes `command` directly to shell/winapi. Requires `args` parameter to be empty. --- lib/posix/posix.nim | 3 +- lib/pure/osproc.nim | 120 +++++++++++++++++++++++--------------------- 2 files changed, 63 insertions(+), 60 deletions(-) diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index 806c255ee9..b0324b780b 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -2085,6 +2085,7 @@ 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 execvpe*(a1: cstring, a2: cstringArray, a3: 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>".} @@ -2565,5 +2566,3 @@ proc poll*(a1: ptr Tpollfd, a2: Tnfds, a3: int): cint {. proc realpath*(name, resolved: CString): CString {. importc: "realpath", header: "<stdlib.h>".} - - diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 065d940408..0e6ff04cf9 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -13,7 +13,7 @@ include "system/inclrtl" import - strutils, os, strtabs, streams + strutils, os, strtabs, streams, sequtils when defined(windows): import winlean @@ -36,11 +36,17 @@ type TProcessOption* = enum ## options that can be passed `startProcess` poEchoCmd, ## echo the command before execution - poUseShell, ## use the shell to execute the command; NOTE: This - ## often creates a security hole! + poUsePath, ## Asks system to search for executable using PATH environment + ## variable. + ## On Windows, this is the default. + poEvalCommand, ## Pass `command` directly to the shell, without quoting. + ## Use it only if `command` comes from trused source. poStdErrToStdOut, ## merge stdout and stderr to the stdout stream poParentStreams ## use the parent's streams +template poUseShell*: TProcessOption {.deprecated.} = poUsePath + ## Deprecated alias for poUsePath. + proc quoteShellWindows*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} = ## Quote s, so it can be safely passed to Windows API. ## Based on Python's subprocess.list2cmdline @@ -94,12 +100,17 @@ proc quoteShell*(s: string): string {.noSideEffect, rtl, extern: "nosp$1".} = {.error:"quoteShell is not supported on your system".} proc execProcess*(command: string, + args: openarray[string] = [], + env: PStringTable = nil, options: set[TProcessOption] = {poStdErrToStdOut, - poUseShell}): TaintedString {. + poUsePath, + poEvalCommand}): TaintedString {. rtl, extern: "nosp$1", tags: [FExecIO, FReadIO].} ## A convenience procedure that executes ``command`` with ``startProcess`` ## and returns its output as a string. + ## WARNING: this function uses poEvalCommand by default for backward compatibility. + ## Make sure to pass options explicitly. proc execCmd*(command: string): int {.rtl, extern: "nosp$1", tags: [FExecIO].} ## Executes ``command`` and returns its error code. Standard input, output, @@ -127,16 +138,10 @@ proc startProcess*(command: string, ## but ``EOS`` is raised in case of an error. proc startCmd*(command: string, options: set[TProcessOption] = { - poStdErrToStdOut, poUseShell}): PProcess {. - tags: [FExecIO, FReadEnv].} = - ## a simpler version of `startProcess` that parses the command line into - ## program and arguments and then calls `startProcess` with the empty string - ## for `workingDir` and the nil string table for `env`. - var c = parseCmdLine(command) - var a: seq[string] - newSeq(a, c.len-1) # avoid slicing for now (still unstable) - for i in 1 .. c.len-1: a[i-1] = c[i] - result = startProcess(command=c[0], args=a, options=options) + poStdErrToStdOut, poUsePath}): PProcess {. + tags: [FExecIO, FReadEnv], deprecated.} = + ## Deprecated - use `startProcess` directly. + result = startProcess(command=command, options=options + {poEvalCommand}) proc close*(p: PProcess) {.rtl, extern: "nosp$1", tags: [].} ## When the process has finished executing, cleanup related handles @@ -246,7 +251,7 @@ proc countProcessors*(): int {.rtl, extern: "nosp$1".} = proc execProcesses*(cmds: openArray[string], options = {poStdErrToStdOut, poParentStreams}, n = countProcessors()): int {.rtl, extern: "nosp$1", - tags: [FExecIO, FTime, FReadEnv].} = + tags: [FExecIO, FTime, FReadEnv]} = ## executes the commands `cmds` in parallel. Creates `n` processes ## that execute in parallel. The highest return value of all processes ## is returned. @@ -307,13 +312,17 @@ proc select*(readfds: var seq[PProcess], timeout = 500): int when not defined(useNimRtl): proc execProcess(command: string, + args: openarray[string] = [], + env: PStringTable = nil, options: set[TProcessOption] = {poStdErrToStdOut, - poUseShell}): TaintedString = - var p = startCmd(command, options=options) + poUsePath, + poEvalCommand}): TaintedString = + var p = startProcess(command, args=args, env=env, options=options) var outp = outputStream(p) result = TaintedString"" var line = newStringOfCap(120).TaintedString while true: + # FIXME: converts CR-LF to LF. if outp.readLine(line): result.string.add(line.string) result.string.add("\n") @@ -427,8 +436,9 @@ when defined(Windows) and not defined(useNimRtl): result.errHandle = TFileHandle(si.hStdError) var cmdl: cstring - when false: # poUseShell in options: - cmdl = buildCommandLine(getEnv("COMSPEC"), @["/c", command] & args) + if poEvalCommand in options: + cmdl = command + assert args.len == 0 else: cmdl = buildCommandLine(command, args) var wd: cstring = nil @@ -455,7 +465,6 @@ when defined(Windows) and not defined(useNimRtl): FileClose(si.hStdError) if e != nil: dealloc(e) - dealloc(cmdl) if success == 0: OSError(lastError) # Close the handle now so anyone waiting is woken: discard closeHandle(procInfo.hThread) @@ -561,22 +570,7 @@ elif not defined(useNimRtl): readIdx = 0 writeIdx = 1 - proc addCmdArgs(command: string, args: openarray[string]): string = - result = quoteShell(command) - for i in 0 .. high(args): - add(result, " ") - add(result, quoteShell(args[i])) - - proc toCStringArray(b, a: openarray[string]): cstringArray = - result = cast[cstringArray](alloc0((a.len + b.len + 1) * sizeof(cstring))) - for i in 0..high(b): - result[i] = cast[cstring](alloc(b[i].len+1)) - copyMem(result[i], cstring(b[i]), b[i].len+1) - for i in 0..high(a): - result[i+b.len] = cast[cstring](alloc(a[i].len+1)) - copyMem(result[i+b.len], cstring(a[i]), a[i].len+1) - - proc ToCStringArray(t: PStringTable): cstringArray = + proc envToCStringArray(t: PStringTable): cstringArray = result = cast[cstringArray](alloc0((t.len + 1) * sizeof(cstring))) var i = 0 for key, val in pairs(t): @@ -585,7 +579,7 @@ elif not defined(useNimRtl): copyMem(result[i], addr(x[0]), x.len+1) inc(i) - proc EnvToCStringArray(): cstringArray = + proc envToCStringArray(): cstringArray = var counter = 0 for key, val in envPairs(): inc counter result = cast[cstringArray](alloc0((counter + 1) * sizeof(cstring))) @@ -610,6 +604,21 @@ elif not defined(useNimRtl): pipe(p_stderr) != 0'i32: OSError(OSLastError()) + var sys_command: string + var sys_args_raw: seq[string] + if poEvalCommand in options: + sys_command = "/bin/sh" + sys_args_raw = @[sys_command, "-c", command] + assert args.len == 0 + else: + sys_command = command + sys_args_raw = @[command] + for arg in args.items: + sys_args_raw.add arg + + var sys_args = allocCStringArray(sys_args_raw) + finally: deallocCStringArray(sys_args) + var pid: TPid when defined(posix_spawn) and not defined(useFork): var attr: Tposix_spawnattr @@ -641,19 +650,15 @@ elif not defined(useNimRtl): else: chck posix_spawn_file_actions_adddup2(fops, p_stderr[writeIdx], 2) - var e = if env == nil: EnvToCStringArray() else: ToCStringArray(env) - var a: cstringArray + var sys_env = if env == nil: EnvToCStringArray() else: EnvToCStringArray(env) var res: cint + # This is incorrect! if workingDir.len > 0: os.setCurrentDir(workingDir) - if poUseShell notin options: - a = toCStringArray([extractFilename(command)], args) - res = posix_spawn(pid, command, fops, attr, a, e) + if poUsePath in options: + res = posix_spawnp(pid, sys_command, fops, attr, sys_args, sys_env) else: - var x = addCmdArgs(command, args) - a = toCStringArray(["sh", "-c"], [x]) - res = posix_spawn(pid, "/bin/sh", fops, attr, a, e) - deallocCStringArray(a) - deallocCStringArray(e) + res = posix_spawn(pid, sys_command, fops, attr, sys_args, sys_env) + deallocCStringArray(sys_env) discard posix_spawn_file_actions_destroy(fops) discard posix_spawnattr_destroy(attr) chck res @@ -680,19 +685,18 @@ elif not defined(useNimRtl): if setpgid(0, 0) == -1: quit("setpgid call failed: " & $strerror(errno)) if workingDir.len > 0: os.setCurrentDir(workingDir) - if poUseShell notin options: - var a = toCStringArray([extractFilename(command)], args) - if env == nil: - discard execv(command, a) + + if env == nil: + if poUsePath in options: + discard execvp(sys_command, sys_args) else: - discard execve(command, a, ToCStringArray(env)) + discard execv(sys_command, sys_args) else: - var x = addCmdArgs(command, args) - var a = toCStringArray(["sh", "-c"], [x]) - if env == nil: - discard execv("/bin/sh", a) + var c_env = envToCStringArray(env) + if poUsePath in options: + discard execvpe(sys_command, sys_args, c_env) else: - discard execve("/bin/sh", a, ToCStringArray(env)) + discard execve(sys_command, sys_args, c_env) # too risky to raise an exception here: quit("execve call failed: " & $strerror(errno)) # Parent process. Copy process information. @@ -825,7 +829,7 @@ elif not defined(useNimRtl): proc execCmdEx*(command: string, options: set[TProcessOption] = { - poStdErrToStdOut, poUseShell}): tuple[ + poStdErrToStdOut, poUsePath}): tuple[ output: TaintedString, exitCode: int] {.tags: [FExecIO, FReadIO].} = ## a convenience proc that runs the `command`, grabs all its output and From 9145bcfbb680d653f167a1a12f7830025aa951a5 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 23 Dec 2013 01:17:48 +0100 Subject: [PATCH 127/326] new VM: some progress for the FFI support --- compiler/evalffi.nim | 34 ++++++++++++++++------------ compiler/vm.nim | 17 ++++++++++++-- compiler/vmgen.nim | 10 ++++++++- lib/pure/os.nim | 50 +++++++++++++++-------------------------- lib/system/sysio.nim | 4 ++-- lib/system/widestrs.nim | 3 ++- todo.txt | 1 - tools/detect/detect.nim | 21 +++++++++++------ 8 files changed, 80 insertions(+), 60 deletions(-) diff --git a/compiler/evalffi.nim b/compiler/evalffi.nim index 92b79f9b65..f2337f7ce3 100644 --- a/compiler/evalffi.nim +++ b/compiler/evalffi.nim @@ -9,7 +9,7 @@ ## This file implements the FFI part of the evaluator for Nimrod code. -import ast, astalgo, ropes, types, options, tables, dynlib, libffi, msgs +import ast, astalgo, ropes, types, options, tables, dynlib, libffi, msgs, os when defined(windows): const libcDll = "msvcrt.dll" @@ -20,7 +20,11 @@ type TDllCache = tables.TTable[string, TLibHandle] var gDllCache = initTable[string, TLibHandle]() - gExeHandle = LoadLib() + +when defined(windows): + var gExeHandle = loadLib(os.getAppFilename()) +else: + var gExeHandle = loadLib() proc getDll(cache: var TDllCache; dll: string; info: TLineInfo): pointer = result = cache[dll] @@ -28,10 +32,10 @@ proc getDll(cache: var TDllCache; dll: string; info: TLineInfo): pointer = var libs: seq[string] = @[] libCandidates(dll, libs) for c in libs: - result = LoadLib(c) + result = loadLib(c) if not result.isNil: break if result.isNil: - GlobalError(info, "cannot load: " & dll) + globalError(info, "cannot load: " & dll) cache[dll] = result const @@ -50,7 +54,7 @@ proc importcSymbol*(sym: PSym): PNode = else: let lib = sym.annex if lib != nil and lib.path.kind notin {nkStrLit..nkTripleStrLit}: - GlobalError(sym.info, "dynlib needs to be a string lit for the REPL") + globalError(sym.info, "dynlib needs to be a string lit for the REPL") var theAddr: pointer if lib.isNil and not gExehandle.isNil: # first try this exe itself: @@ -58,10 +62,12 @@ proc importcSymbol*(sym: PSym): PNode = # then try libc: if theAddr.isNil: let dllhandle = gDllCache.getDll(libcDll, sym.info) - theAddr = dllhandle.checkedSymAddr(name) - else: - let dllhandle = gDllCache.getDll(lib.path.strVal, sym.info) - theAddr = dllhandle.checkedSymAddr(name) + theAddr = dllhandle.symAddr(name) + elif not lib.isNil: + let dllhandle = gDllCache.getDll(if lib.kind == libHeader: libcDll + else: lib.path.strVal, sym.info) + theAddr = dllhandle.symAddr(name) + if theAddr.isNil: globalError(sym.info, "cannot import: " & sym.name.s) result.intVal = cast[TAddress](theAddr) proc mapType(t: ast.PType): ptr libffi.TType = @@ -139,7 +145,7 @@ proc getField(n: PNode; position: int): PSym = else: internalError(n.info, "getField(record case branch)") of nkSym: if n.sym.position == position: result = n.sym - else: nil + else: discard proc packObject(x: PNode, typ: PType, res: pointer) = InternalAssert x.kind in {nkObjConstr, nkPar} @@ -192,7 +198,7 @@ proc pack(v: PNode, typ: PType, res: pointer) = of tyPointer, tyProc, tyCString, tyString: if v.kind == nkNilLit: # nothing to do since the memory is 0 initialized anyway - nil + discard elif v.kind == nkPtrLit: awr(pointer, cast[pointer](v.intVal)) elif v.kind in {nkStrLit..nkTripleStrLit}: @@ -202,7 +208,7 @@ proc pack(v: PNode, typ: PType, res: pointer) = of tyPtr, tyRef, tyVar: if v.kind == nkNilLit: # nothing to do since the memory is 0 initialized anyway - nil + discard elif v.kind == nkPtrLit: awr(pointer, cast[pointer](v.intVal)) else: @@ -220,7 +226,7 @@ proc pack(v: PNode, typ: PType, res: pointer) = of tyObject, tyTuple: packObject(v, typ, res) of tyNil: - nil + discard of tyDistinct, tyGenericInst: pack(v, typ.sons[0], res) else: @@ -241,7 +247,7 @@ proc unpackObjectAdd(x: pointer, n, result: PNode) = pair.sons[1] = unpack(x +! n.sym.offset, n.sym.typ, nil) #echo "offset: ", n.sym.name.s, " ", n.sym.offset result.add pair - else: nil + else: discard proc unpackObject(x: pointer, typ: PType, n: PNode): PNode = # compute the field's offsets: diff --git a/compiler/vm.nim b/compiler/vm.nim index 80b8abb8b0..854b491fbc 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -632,12 +632,14 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # we pass 'tos.slots' instead of 'regs' so that the compiler can keep # 'regs' in a register: when hasFFI: + if c.globals.sons[prc.position-1].kind == nkEmpty: + globalError(c.debug[pc], errGenerated, "canot run " & prc.name.s) let newValue = callForeignFunction(c.globals.sons[prc.position-1], prc.typ, tos.slots, rb+1, rc-1, c.debug[pc]) if newValue.kind != nkEmpty: assert instr.opcode == opcIndCallAsgn - regs[ra] = newValue + asgnRef(regs[ra], newValue) else: globalError(c.debug[pc], errGenerated, "VM not built with FFI support") elif prc.kind != skTemplate: @@ -796,7 +798,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = decodeB(nkBracket) let newLen = regs[rb].getOrdValue.int setLen(regs[ra].sons, newLen) - of opcSwap, opcCast, opcReset: + of opcSwap, opcReset: internalError(c.debug[pc], "too implement") of opcIsNil: decodeB(nkIntLit) @@ -938,6 +940,15 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = stackTrace(c, tos, pc, errGenerated, msgKindToString(errIllegalConvFromXtoY) % [ "unknown type" , "unknown type"]) + of opcCast: + let rb = instr.regB + inc pc + let typ = c.types[c.code[pc].regBx - wordExcess] + when hasFFI: + let dest = fficast(regs[rb], typ) + asgnRef(regs[ra], dest) + else: + globalError(c.debug[pc], "cannot evaluate cast") of opcNSetIntVal: decodeB(nkMetaNode) var dest = regs[ra].uast @@ -1074,6 +1085,8 @@ proc myOpen(module: PSym): PPassContext = # XXX produce a new 'globals' environment here: setupGlobalCtx(module) result = globalCtx + when hasFFI: + globalCtx.features = {allowFFI, allowCast} var oldErrorCount: int diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 134b2d15a9..486d24e6c1 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -945,7 +945,10 @@ proc genTypeLit(c: PCtx; t: PType; dest: var TDest) = proc importcSym(c: PCtx; info: TLineInfo; s: PSym) = when hasFFI: if allowFFI in c.features: - c.globals.add(importcSymbol(s)) + if s.kind == skVar and lfNoDecl in s.loc.flags: + c.globals.add(copyNode(emptyNode)) + else: + c.globals.add(importcSymbol(s)) s.position = c.globals.len else: localError(info, errGenerated, "VM is not allowed to 'importc'") @@ -1303,6 +1306,11 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = of nkCurly: genSetConstr(c, n, dest) of nkObjConstr: genObjConstr(c, n, dest) of nkPar, nkClosure: genTupleConstr(c, n, dest) + of nkCast: + if allowCast in c.features: + genConv(c, n, n.sons[1], dest, opcCast) + else: + localError(n.info, errGenerated, "VM is not allowed to 'cast'") else: InternalError n.info, "too implement " & $n.kind diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 71639d821c..d5c4acaecc 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -341,16 +341,6 @@ when defined(windows): template FindNextFile(a, b: expr): expr = FindNextFileW(a, b) template getCommandLine(): expr = getCommandLineW() - proc skipFindData(f: TWIN32_FIND_DATA): bool {.inline.} = - let - nul = 0 - dot = ord('.') - result = (f.cFilename[0].int == dot) - if result: - result = (f.cFilename[1].int in {dot, nul}) - if result: - result = (f.cFilename[2].int == nul) - template getFilename(f: expr): expr = $cast[WideCString](addr(f.cFilename[0])) else: @@ -358,18 +348,13 @@ when defined(windows): template FindNextFile(a, b: expr): expr = FindNextFileA(a, b) template getCommandLine(): expr = getCommandLineA() - proc skipFindData(f: TWIN32_FIND_DATA): bool {.inline.} = - let - nul = '\0' - dot = '.' - result = (f.cFilename[0] == dot) - if result: - result = (f.cFilename[1] in {dot, nul}) - if result: - result = (f.cFilename[2] == nul) - template getFilename(f: expr): expr = $f.cFilename + proc skipFindData(f: TWIN32_FIND_DATA): bool {.inline.} = + const dot = ord('.') + result = f.cFilename[0].int == dot and(f.cFilename[1].int == 0 or + f.cFilename[1].int == dot and f.cFilename[2].int == 0) + proc existsFile*(filename: string): bool {.rtl, extern: "nos$1", tags: [FReadDir].} = ## Returns true if the file exists, false otherwise. @@ -468,20 +453,21 @@ proc setCurrentDir*(newDir: string) {.inline, tags: [].} = ## `newDir` cannot been set. when defined(Windows): when useWinUnicode: - if SetCurrentDirectoryW(newWideCString(newDir)) == 0'i32: OSError(OSLastError()) + if SetCurrentDirectoryW(newWideCString(newDir)) == 0'i32: + OSError(OSLastError()) else: if SetCurrentDirectoryA(newDir) == 0'i32: OSError(OSLastError()) else: if chdir(newDir) != 0'i32: OSError(OSLastError()) -proc JoinPath*(head, tail: string): string {. +proc joinPath*(head, tail: string): string {. noSideEffect, rtl, extern: "nos$1".} = ## Joins two directory names to one. ## ## For example on Unix: ## ## .. code-block:: nimrod - ## JoinPath("usr", "lib") + ## joinPath("usr", "lib") ## ## results in: ## @@ -495,10 +481,10 @@ proc JoinPath*(head, tail: string): string {. ## examples on Unix: ## ## .. code-block:: nimrod - ## assert JoinPath("usr", "") == "usr/" - ## assert JoinPath("", "lib") == "lib" - ## assert JoinPath("", "/lib") == "/lib" - ## assert JoinPath("usr/", "/lib") == "usr/lib" + ## assert joinPath("usr", "") == "usr/" + ## assert joinPath("", "lib") == "lib" + ## assert joinPath("", "/lib") == "/lib" + ## assert joinPath("usr/", "/lib") == "usr/lib" if len(head) == 0: result = tail elif head[len(head)-1] in {DirSep, AltSep}: @@ -512,14 +498,14 @@ proc JoinPath*(head, tail: string): string {. else: result = head & DirSep & tail -proc JoinPath*(parts: varargs[string]): string {.noSideEffect, +proc joinPath*(parts: varargs[string]): string {.noSideEffect, rtl, extern: "nos$1OpenArray".} = - ## The same as `JoinPath(head, tail)`, but works with any number of directory + ## The same as `joinPath(head, tail)`, but works with any number of directory ## parts. You need to pass at least one element or the proc will assert in ## debug builds and crash on release builds. result = parts[0] for i in 1..high(parts): - result = JoinPath(result, parts[i]) + result = joinPath(result, parts[i]) proc `/` * (head, tail: string): string {.noSideEffect.} = ## The same as ``JoinPath(head, tail)`` @@ -533,7 +519,7 @@ proc `/` * (head, tail: string): string {.noSideEffect.} = ## assert "usr/" / "/lib" == "usr/lib" return JoinPath(head, tail) -proc SplitPath*(path: string): tuple[head, tail: string] {. +proc splitPath*(path: string): tuple[head, tail: string] {. noSideEffect, rtl, extern: "nos$1".} = ## Splits a directory into (head, tail), so that ## ``JoinPath(head, tail) == path``. @@ -699,7 +685,7 @@ proc expandFilename*(filename: string): string {.rtl, extern: "nos$1", if r.isNil: OSError(OSLastError()) setlen(result, c_strlen(result)) -proc ChangeFileExt*(filename, ext: string): string {. +proc changeFileExt*(filename, ext: string): string {. noSideEffect, rtl, extern: "nos$1".} = ## Changes the file extension to `ext`. ## diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index a877f8b28e..5af1c96d4d 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -194,9 +194,9 @@ const # should not be translated. -proc Open(f: var TFile, filename: string, +proc open(f: var TFile, filename: string, mode: TFileMode = fmRead, - bufSize: int = -1): Bool = + bufSize: int = -1): bool = var p: pointer = fopen(filename, FormatOpen[mode]) result = (p != nil) f = cast[TFile](p) diff --git a/lib/system/widestrs.nim b/lib/system/widestrs.nim index cf1f0910c5..6a699274cb 100644 --- a/lib/system/widestrs.nim +++ b/lib/system/widestrs.nim @@ -101,7 +101,8 @@ proc newWideCString*(s: cstring): WideCString = if s.isNil: return nil when not defined(c_strlen): - proc c_strlen(a: CString): int {.nodecl, noSideEffect, importc: "strlen".} + proc c_strlen(a: cstring): int {. + header: "<string.h>", noSideEffect, importc: "strlen".} let L = cstrlen(s) result = newWideCString(s, L) diff --git a/todo.txt b/todo.txt index 4c999226f2..a6301ce0b5 100644 --- a/todo.txt +++ b/todo.txt @@ -3,7 +3,6 @@ version 0.9.4 - new VM: - implement overflow checking - - implement the FFI - make 'bind' default for templates and introduce 'mixin' - special rule for ``[]=`` diff --git a/tools/detect/detect.nim b/tools/detect/detect.nim index cf61c28236..b2beba828a 100644 --- a/tools/detect/detect.nim +++ b/tools/detect/detect.nim @@ -10,7 +10,7 @@ import os, strutils const - cc = "gcc -o $1 $1.c" + cc = "gcc -o $# $#.c" cfile = """ /* Generated by detect.nim */ @@ -37,6 +37,7 @@ var tl = "" proc myExec(cmd: string): bool = + echo "CMD ", cmd return execShellCmd(cmd) == 0 proc header(s: string): bool = @@ -46,7 +47,7 @@ proc header(s: string): bool = f.write("#include $1\n" % s) f.write("int main() { return 0; }\n") close(f) - result = myExec(cc % testh) + result = myExec(cc % [testh.addFileExt(ExeExt), testh]) removeFile(addFileExt(testh, "c")) if result: addf(hd, "#include $1\n", s) @@ -60,13 +61,16 @@ proc main = if open(f, addFileExt(gen, "c"), fmWrite): f.write(cfile % [hd, tl, system.hostOS, system.hostCPU]) close(f) - if not myExec(cc % gen): quit(1) - if not myExec("./" & gen): quit(1) + if not myExec(cc % [gen.addFileExt(ExeExt), gen]): quit(1) + when defined(windows): + if not myExec(gen.addFileExt(ExeExt)): quit(1) + else: + if not myExec("./" & gen): quit(1) removeFile(addFileExt(gen, "c")) echo("Success") proc v(name: string, typ: TTypeKind=cint) = - var n = if name[0] == '_': copy(name, 1) else: name + var n = if name[0] == '_': substr(name, 1) else: name var t = $typ case typ of pointer: @@ -369,7 +373,7 @@ if header("<pthread.h>"): #v("PTHREAD_MUTEX_INITIALIZER") v("PTHREAD_MUTEX_NORMAL") v("PTHREAD_MUTEX_RECURSIVE") #{.importc, header: "<pthread.h>".}: cint - v("PTHREAD_ONCE_INIT") #{.importc, header: "<pthread.h>".}: cint + #v("PTHREAD_ONCE_INIT") #{.importc, header: "<pthread.h>".}: cint v("PTHREAD_PRIO_INHERIT") #{.importc, header: "<pthread.h>".}: cint v("PTHREAD_PRIO_NONE") #{.importc, header: "<pthread.h>".}: cint v("PTHREAD_PRIO_PROTECT") #{.importc, header: "<pthread.h>".}: cint @@ -820,5 +824,8 @@ if header("<spawn.h>"): v("POSIX_SPAWN_SETSIGDEF") v("POSIX_SPAWN_SETSIGMASK") -main() +if header("<stdio.h>"): + v "_IOFBF" + v "_IONBF" +main() From 033938a53a62399d45c5fd6fe9c4e798431c964f Mon Sep 17 00:00:00 2001 From: Satish BD <bdsatish@gmail.com> Date: Mon, 23 Dec 2013 04:29:50 +0200 Subject: [PATCH 128/326] Correct the spelling of the word 'implicitly' --- compiler/ast.nim | 4 ++-- compiler/semexprs.nim | 2 +- doc/intern.txt | 2 +- doc/tut2.txt | 2 +- lib/system/threads.nim | 2 +- tests/compile/ttempl3.nim | 2 +- tinyc/tccgen.c | 2 +- web/news.txt | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 1e5276d68d..0790df0c47 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -238,7 +238,7 @@ type sfMainModule, # module is the main module sfSystemModule, # module is the system module sfNoReturn, # proc never returns (an exit proc) - sfAddrTaken, # the variable's address is taken (ex- or implicitely); + sfAddrTaken, # the variable's address is taken (ex- or implicitly); # *OR*: a proc is indirectly called (used as first class) sfCompilerProc, # proc is a compiler proc, that is a C proc that is # needed for the code generator @@ -257,7 +257,7 @@ type # for interfacing with C++, JS sfNamedParamCall, # symbol needs named parameter call syntax in target # language; for interfacing with Objective C - sfDiscardable, # returned value may be discarded implicitely + sfDiscardable, # returned value may be discarded implicitly sfDestructor, # proc is destructor sfGenSym # symbol is 'gensym'ed; do not add to symbol table diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index ccbb1e3673..310aabc328 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -508,7 +508,7 @@ proc fixAbstractType(c: PContext, n: PNode) = changeType(it.sons[1], s, check=true) n.sons[i] = it.sons[1] of nkBracket: - # an implicitely constructed array (passed to an open array): + # an implicitly constructed array (passed to an open array): n.sons[i] = semArrayConstr(c, it, {}) else: nil diff --git a/doc/intern.txt b/doc/intern.txt index 9d9eb66cc4..c602e49337 100644 --- a/doc/intern.txt +++ b/doc/intern.txt @@ -215,7 +215,7 @@ Backend issues - Init procs must not be "forgotten" to be called. - Files must not be "forgotten" to be linked. - Anything that is contained in ``nim__dat.c`` is shared between modules - implicitely. + implicitly. - Method dispatchers are global. - DLL loading via ``dlsym`` is global. - Emulated thread vars are global. diff --git a/doc/tut2.txt b/doc/tut2.txt index b35f715274..f8fa4aef38 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -77,7 +77,7 @@ section. Inheritance is done with the ``object of`` syntax. Multiple inheritance is currently not supported. If an object type has no suitable ancestor, ``TObject`` can be used as its ancestor, but this is only a convention. Objects that have -no ancestor are implicitely ``final``. You can use the ``inheritable`` pragma +no ancestor are implicitly ``final``. You can use the ``inheritable`` pragma to introduce new object roots apart from ``system.TObject``. (This is used in the GTK wrapper for instance.) diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 104ca63c16..80420d7917 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -295,7 +295,7 @@ template ThreadProcWrapperBody(closure: expr) {.immediate.} = when defined(windows): proc threadProcWrapper[TArg](closure: pointer): int32 {.stdcall.} = ThreadProcWrapperBody(closure) - # implicitely return 0 + # implicitly return 0 else: proc threadProcWrapper[TArg](closure: pointer) {.noconv.} = ThreadProcWrapperBody(closure) diff --git a/tests/compile/ttempl3.nim b/tests/compile/ttempl3.nim index 361d11f6e1..59be246248 100644 --- a/tests/compile/ttempl3.nim +++ b/tests/compile/ttempl3.nim @@ -2,7 +2,7 @@ template withOpenFile(f: expr, filename: string, mode: TFileMode, actions: stmt): stmt {.immediate.} = block: - # test that 'f' is implicitely 'injecting': + # test that 'f' is implicitly 'injecting': var f: TFile if open(f, filename, mode): try: diff --git a/tinyc/tccgen.c b/tinyc/tccgen.c index 942c503c1a..3135e7b37f 100644 --- a/tinyc/tccgen.c +++ b/tinyc/tccgen.c @@ -1931,7 +1931,7 @@ static void gen_assign_cast(CType *dt) goto type_ok; } type1 = pointed_type(dt); - /* a function is implicitely a function pointer */ + /* a function is implicitly a function pointer */ if (sbt == VT_FUNC) { if ((type1->t & VT_BTYPE) != VT_VOID && !is_compatible_types(pointed_type(dt), st)) diff --git a/web/news.txt b/web/news.txt index 3d1546fb75..4f40d6484b 100644 --- a/web/news.txt +++ b/web/news.txt @@ -309,7 +309,7 @@ Changes affecting backwards compatibility - The Nimrod type system now distinguishes ``openarray`` from ``varargs``. - Templates are now ``hygienic``. Use the ``dirty`` pragma to get the old behaviour. -- Objects that have no ancestor are now implicitely ``final``. Use +- Objects that have no ancestor are now implicitly ``final``. Use the ``inheritable`` pragma to introduce new object roots apart from ``TObject``. - Macros now receive parameters like templates do; use the ``callsite`` builtin @@ -439,7 +439,7 @@ Language Additions - The error pragma can now be used to mark symbols whose *usage* should trigger a compile-time error. - There is a new ``discardable`` pragma that can be used to mark a routine - so that its result can be discarded implicitely. + so that its result can be discarded implicitly. - Added a new ``noinit`` pragma to prevent automatic initialization to zero of variables. - Constants can now have the type ``seq``. From 4447c1b7e323443a26189140410814195eee18a9 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 23 Dec 2013 08:28:32 +0100 Subject: [PATCH 129/326] tcnstseq works again --- compiler/sem.nim | 14 +++++++++++--- compiler/vm.nim | 6 +++--- lib/system/widestrs.nim | 3 +++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/compiler/sem.nim b/compiler/sem.nim index f639b831a2..ed3c0e045b 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -43,7 +43,7 @@ proc activate(c: PContext, n: PNode) proc semQuoteAst(c: PContext, n: PNode): PNode proc finishMethod(c: PContext, s: PSym) -proc IndexTypesMatch(c: PContext, f, a: PType, arg: PNode): PNode +proc indexTypesMatch(c: PContext, f, a: PType, arg: PNode): PNode proc typeMismatch(n: PNode, formal, actual: PType) = if formal.kind != tyError and actual.kind != tyError: @@ -63,7 +63,7 @@ proc fitNode(c: PContext, formal: PType, arg: PNode): PNode = if result == nil: typeMismatch(arg, formal, arg.typ) # error correction: - result = copyNode(arg) + result = copyTree(arg) result.typ = formal var CommonTypeBegin = PType(kind: tyExpr) @@ -211,7 +211,15 @@ proc semConstExpr(c: PContext, n: PNode): PNode = # recompute the types as 'eval' isn't guaranteed to construct types nor # that the types are sound: result = semExprWithType(c, result) - result = fitNode(c, e.typ, result) + #result = fitNode(c, e.typ, result) inlined with special case: + let arg = result + result = indexTypesMatch(c, e.typ, arg.typ, arg) + if result == nil: + result = arg + # for 'tcnstseq' we support [] to become 'seq' + if e.typ.skipTypes(abstractInst).kind == tySequence and + arg.typ.skipTypes(abstractInst).kind == tyArrayConstr: + arg.typ = e.typ include hlo, seminst, semcall diff --git a/compiler/vm.nim b/compiler/vm.nim index 854b491fbc..709baf7b2a 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -632,10 +632,10 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # we pass 'tos.slots' instead of 'regs' so that the compiler can keep # 'regs' in a register: when hasFFI: - if c.globals.sons[prc.position-1].kind == nkEmpty: + let prcValue = c.globals.sons[prc.position-1] + if prcValue.kind == nkEmpty: globalError(c.debug[pc], errGenerated, "canot run " & prc.name.s) - let newValue = callForeignFunction(c.globals.sons[prc.position-1], - prc.typ, tos.slots, + let newValue = callForeignFunction(prcValue, prc.typ, tos.slots, rb+1, rc-1, c.debug[pc]) if newValue.kind != nkEmpty: assert instr.opcode == opcIndCallAsgn diff --git a/lib/system/widestrs.nim b/lib/system/widestrs.nim index 6a699274cb..d856cc830a 100644 --- a/lib/system/widestrs.nim +++ b/lib/system/widestrs.nim @@ -9,6 +9,9 @@ ## Nimrod support for C/C++'s `wide strings`:idx:. This is part of the system ## module! Do not import it directly! + +when not defined(NimString): + {.error: "You must not import this module explicitly".} type TUtf16Char* = distinct int16 From b3057be2c9a2b354ad1244814a2cac3968cc4d65 Mon Sep 17 00:00:00 2001 From: Billingsly Wetherfordshire <phowl.mouth@gmail.com> Date: Mon, 23 Dec 2013 11:52:11 -0600 Subject: [PATCH 130/326] Update endians.nim adds swapEndian16 function --- lib/pure/endians.nim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/pure/endians.nim b/lib/pure/endians.nim index 34270b320a..73017464d4 100644 --- a/lib/pure/endians.nim +++ b/lib/pure/endians.nim @@ -34,14 +34,26 @@ proc swapEndian32*(outp, inp: pointer) = o[2] = i[1] o[3] = i[0] +proc swapEndian16*(outp, inp: pointer) = + ## copies `inp` to `outp` swapping bytes. Both buffers are supposed to + ## contain at least 2 bytes. + var + i = cast[cstring](inp) + o = cast[cstring](outp) + o[0] = i[1] + o[1] = i[0] + when system.cpuEndian == bigEndian: proc littleEndian64*(outp, inp: pointer) {.inline.} = swapEndian64(outp, inp) proc littleEndian32*(outp, inp: pointer) {.inline.} = swapEndian32(outp, inp) + proc littleEndian16*(outp, inp: pointer) {.inline.} = swapEndian16(outp, inp) proc bigEndian64*(outp, inp: pointer) {.inline.} = copyMem(outp, inp, 8) proc bigEndian32*(outp, inp: pointer) {.inline.} = copyMem(outp, inp, 4) + proc bigEndian16*(outp, inp: pointer) {.inline.} = copyMem(outp, inp, 2) else: proc littleEndian64*(outp, inp: pointer) {.inline.} = copyMem(outp, inp, 8) proc littleEndian32*(outp, inp: pointer) {.inline.} = copyMem(outp, inp, 4) + proc littleEndian16*(outp, inp: pointer){.inline.} = copyMem(outp, inp, 2) proc bigEndian64*(outp, inp: pointer) {.inline.} = swapEndian64(outp, inp) proc bigEndian32*(outp, inp: pointer) {.inline.} = swapEndian32(outp, inp) - + proc bigEndian16*(outp, inp: pointer) {.inline.} = swapEndian16(outp, inp) From 1fe8b013effba1df6166d9596ae246bca2e05105 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Sun, 22 Dec 2013 00:02:01 +0100 Subject: [PATCH 131/326] Adds example to locals() docstring. --- lib/system.nim | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/system.nim b/lib/system.nim index 106eb04a3d..26109bb973 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2675,5 +2675,21 @@ proc locals*(): TObject {.magic: "Locals", noSideEffect.} = ## in the current scope. This is quite fast as it does not rely ## on any debug or runtime information. Note that in constrast to what ## the official signature says, the return type is not ``TObject`` but a - ## tuple of a structure that depends on the current scope. + ## tuple of a structure that depends on the current scope. Example: + ## + ## .. code-block:: nimrod + ## proc testLocals() = + ## var + ## a = "something" + ## b = 4 + ## c = locals() + ## d = "super!" + ## + ## b = 1 + ## for name, value in fieldPairs(c): + ## echo "name ", name, " with value ", value + ## echo "B is ", b + ## # -> name a with value something + ## # -> name b with value 4 + ## # -> B is 1 nil From f33f15afe804887be3ac24f48969fb724497730b Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 23 Dec 2013 00:44:30 +0100 Subject: [PATCH 132/326] Adds docstring to rstgen.defaultConfig. --- lib/packages/docutils/rstgen.nim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index 09c6ba8b8c..bc4f3d351b 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -688,7 +688,18 @@ proc formatNamedVars*(frmt: string, varnames: openarray[string], proc defaultConfig*(): PStringTable = - ## creates a default configuration for HTML generation. + ## Returns a default configuration for embedded HTML generation. + ## + ## The returned ``PStringTable`` contains the paramters used by the HTML + ## engine to build the final output. For information on what these parameters + ## are and their purpose, please look up the file ``config/nimdoc.cfg`` + ## bundled with the compiler. + ## + ## The only difference between the contents of that file and the values + ## provided by this proc is the ``doc.file`` variable. The ``doc.file`` + ## variable of the configuration file contains HTML to build standalone + ## pages, while this proc returns just the content for procs like + ## ``rstToHtml`` to generate the bare minimum HTML. result = newStringTable(modeStyleInsensitive) template setConfigVar(key, val: expr) = From e1fa19fa7a69bf5c0d182f0183820d37f8d5955b Mon Sep 17 00:00:00 2001 From: Billingsly Wetherfordshire <phowl.mouth@gmail.com> Date: Mon, 23 Dec 2013 12:58:22 -0600 Subject: [PATCH 133/326] Update os.nim added file/dirExists synonyms for existsFile/dir --- lib/pure/os.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index d74cb1fb94..7a8722ab45 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -398,6 +398,14 @@ proc existsDir*(dir: string): bool {.rtl, extern: "nos$1", tags: [FReadDir].} = var res: TStat return stat(dir, res) >= 0'i32 and S_ISDIR(res.st_mode) +proc fileExists*(filename: string): bool {.inline.} = + ## Synonym for existsFile + existsFile(filename) + +proc dirExists*(dir: string): bool {.inline.} = + ## Synonym for existsDir + existsDir(dir) + proc getLastModificationTime*(file: string): TTime {.rtl, extern: "nos$1".} = ## Returns the `file`'s last modification time. when defined(posix): From 32ef1f8f323044c0d92f1beef396ce3223a96231 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 23 Dec 2013 20:12:13 +0100 Subject: [PATCH 134/326] vm: FFI improvements --- compiler/evalffi.nim | 3 +++ compiler/vmgen.nim | 5 +---- lib/system.nim | 8 +++++-- lib/system/ansi_c.nim | 46 +++++++++++++++++++++++++++-------------- lib/system/sysio.nim | 20 ++++++++++++------ tools/detect/detect.nim | 2 +- 6 files changed, 56 insertions(+), 28 deletions(-) diff --git a/compiler/evalffi.nim b/compiler/evalffi.nim index f2337f7ce3..3b8ce05059 100644 --- a/compiler/evalffi.nim +++ b/compiler/evalffi.nim @@ -41,6 +41,8 @@ proc getDll(cache: var TDllCache; dll: string; info: TLineInfo): pointer = const nkPtrLit = nkIntLit # hopefully we can get rid of this hack soon +var myerrno {.importc: "errno", header: "<errno.h>".}: cint ## error variable + proc importcSymbol*(sym: PSym): PNode = let name = ropeToStr(sym.loc.r) @@ -51,6 +53,7 @@ proc importcSymbol*(sym: PSym): PNode = of "stdin": result.intVal = cast[TAddress](system.stdin) of "stdout": result.intVal = cast[TAddress](system.stdout) of "stderr": result.intVal = cast[TAddress](system.stderr) + of "vmErrnoWrapper": result.intVal = cast[TAddress](myerrno) else: let lib = sym.annex if lib != nil and lib.path.kind notin {nkStrLit..nkTripleStrLit}: diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 486d24e6c1..ab120f008d 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -945,10 +945,7 @@ proc genTypeLit(c: PCtx; t: PType; dest: var TDest) = proc importcSym(c: PCtx; info: TLineInfo; s: PSym) = when hasFFI: if allowFFI in c.features: - if s.kind == skVar and lfNoDecl in s.loc.flags: - c.globals.add(copyNode(emptyNode)) - else: - c.globals.add(importcSymbol(s)) + c.globals.add(importcSymbol(s)) s.position = c.globals.len else: localError(info, errGenerated, "VM is not allowed to 'importc'") diff --git a/lib/system.nim b/lib/system.nim index 106eb04a3d..14be9cc21a 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -186,7 +186,10 @@ proc `..`*[T](b: T): TSlice[T] {.noSideEffect, inline.} = when not defined(niminheritable): {.pragma: inheritable.} -when not defined(JS) and not defined(NimrodVM): +const NoFakeVars* = defined(NimrodVM) ## true if the backend doesn't support \ + ## "fake variables" like 'var EBADF {.importc.}: cint'. + +when not defined(JS): type TGenericSeq {.compilerproc, pure, inheritable.} = object len, reserved: int @@ -195,7 +198,8 @@ when not defined(JS) and not defined(NimrodVM): NimStringDesc {.compilerproc, final.} = object of TGenericSeq data: array[0..100_000_000, char] NimString = ptr NimStringDesc - + +when not defined(JS) and not defined(NimrodVM): template space(s: PGenericSeq): int {.dirty.} = s.reserved and not seqShallowFlag diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim index 13e8496d26..25b6d9c480 100644 --- a/lib/system/ansi_c.nim +++ b/lib/system/ansi_c.nim @@ -40,21 +40,31 @@ var # constants faked as variables: when not defined(SIGINT): - var - 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 NoFakeVars: + when defined(windows): + const + SIGABRT = cint(22) + SIGFPE = cint(8) + SIGILL = cint(4) + SIGINT = cint(2) + SIGSEGV = cint(11) + SIGTERM = cint(15) + else: + {.error: "SIGABRT not ported to your platform".} + else: + var + 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 + template SIGBUS: expr = SIGSEGV proc c_longjmp(jmpb: C_JmpBuf, retval: cint) {. header: "<setjmp.h>", importc: "longjmp".} @@ -111,16 +121,22 @@ proc c_realloc(p: pointer, newsize: int): pointer {. when hostOS != "standalone": when not defined(errno): - var errno {.importc, header: "<errno.h>".}: cint ## error variable + when defined(NimrodVM): + var vmErrnoWrapper {.importc.}: ptr cint + template errno: expr = + bind vmErrnoWrapper + vmErrnoWrapper[] + else: + var errno {.importc, header: "<errno.h>".}: cint ## error variable proc strerror(errnum: cint): cstring {.importc, header: "<string.h>".} -proc c_remove(filename: CString): cint {. +proc c_remove(filename: cstring): cint {. importc: "remove", header: "<stdio.h>".} -proc c_rename(oldname, newname: CString): cint {. +proc c_rename(oldname, newname: cstring): cint {. importc: "rename", header: "<stdio.h>".} -proc c_system(cmd: CString): cint {.importc: "system", header: "<stdlib.h>".} -proc c_getenv(env: CString): CString {.importc: "getenv", header: "<stdlib.h>".} -proc c_putenv(env: CString): cint {.importc: "putenv", header: "<stdlib.h>".} +proc c_system(cmd: cstring): cint {.importc: "system", header: "<stdlib.h>".} +proc c_getenv(env: cstring): cstring {.importc: "getenv", header: "<stdlib.h>".} +proc c_putenv(env: cstring): cint {.importc: "putenv", header: "<stdlib.h>".} {.pop} diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 5af1c96d4d..23f4e874cc 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -45,9 +45,17 @@ proc setvbuf(stream: TFile, buf: pointer, typ, size: cint): cint {. proc write(f: TFile, c: cstring) = fputs(c, f) {.pop.} -var - IOFBF {.importc: "_IOFBF", nodecl.}: cint - IONBF {.importc: "_IONBF", nodecl.}: cint +when NoFakeVars: + when defined(windows): + const + IOFBF = cint(0) + IONBF = cint(4) + else: + {.error: "IOFBF not ported to your platform".} +else: + var + IOFBF {.importc: "_IOFBF", nodecl.}: cint + IONBF {.importc: "_IONBF", nodecl.}: cint const buf_size = 4000 @@ -149,7 +157,7 @@ proc writeFile(filename, content: string) = finally: close(f) -proc EndOfFile(f: TFile): bool = +proc endOfFile(f: TFile): bool = # do not blame me; blame the ANSI C standard this is so brain-damaged var c = fgetc(f) ungetc(c, f) @@ -223,10 +231,10 @@ proc fwrite(buf: Pointer, size, n: int, f: TFile): int {. proc readBuffer(f: TFile, buffer: pointer, len: int): int = result = fread(buffer, 1, len, f) -proc ReadBytes(f: TFile, a: var openarray[int8], start, len: int): int = +proc readBytes(f: TFile, a: var openarray[int8], start, len: int): int = result = readBuffer(f, addr(a[start]), len) -proc ReadChars(f: TFile, a: var openarray[char], start, len: int): int = +proc readChars(f: TFile, a: var openarray[char], start, len: int): int = result = readBuffer(f, addr(a[start]), len) {.push stackTrace:off, profiler:off.} diff --git a/tools/detect/detect.nim b/tools/detect/detect.nim index b2beba828a..87b682ad56 100644 --- a/tools/detect/detect.nim +++ b/tools/detect/detect.nim @@ -66,7 +66,7 @@ proc main = if not myExec(gen.addFileExt(ExeExt)): quit(1) else: if not myExec("./" & gen): quit(1) - removeFile(addFileExt(gen, "c")) + #removeFile(addFileExt(gen, "c")) echo("Success") proc v(name: string, typ: TTypeKind=cint) = From feb9af48f1600ce814bc3b62765894ba503ec108 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Tue, 24 Dec 2013 00:21:22 +0100 Subject: [PATCH 135/326] NoFakeVars progress --- lib/pure/os.nim | 29 +- lib/pure/sockets.nim | 2 +- lib/system/ansi_c.nim | 15 +- lib/system/sysio.nim | 4 + tools/detect/macosx_consts.nim | 629 ++++++++++++++++++++++++++ tools/detect/windows_amd64_consts.nim | 152 +++++++ tools/detect/windows_i386_consts.nim | 96 ++++ 7 files changed, 912 insertions(+), 15 deletions(-) create mode 100644 tools/detect/macosx_consts.nim create mode 100644 tools/detect/windows_amd64_consts.nim create mode 100644 tools/detect/windows_i386_consts.nim diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 91893d1693..2e15587f49 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -165,8 +165,12 @@ else: # UNIX-like operating system DynlibFormat* = when defined(macosx): "lib$1.dylib" else: "lib$1.so" when defined(posix): - var - pathMax {.importc: "PATH_MAX", header: "<stdlib.h>".}: cint + when NoFakeVars: + const pathMax = 5000 # doesn't matter really. The concept of PATH_MAX + # doesn't work anymore on modern OSes. + else: + var + pathMax {.importc: "PATH_MAX", header: "<stdlib.h>".}: cint const ExtSep* = '.' @@ -517,7 +521,7 @@ proc `/` * (head, tail: string): string {.noSideEffect.} = ## assert "" / "lib" == "lib" ## assert "" / "/lib" == "/lib" ## assert "usr/" / "/lib" == "usr/lib" - return JoinPath(head, tail) + return joinPath(head, tail) proc splitPath*(path: string): tuple[head, tail: string] {. noSideEffect, rtl, extern: "nos$1".} = @@ -527,11 +531,11 @@ proc splitPath*(path: string): tuple[head, tail: string] {. ## Examples: ## ## .. code-block:: nimrod - ## SplitPath("usr/local/bin") -> ("usr/local", "bin") - ## SplitPath("usr/local/bin/") -> ("usr/local/bin", "") - ## SplitPath("bin") -> ("", "bin") - ## SplitPath("/bin") -> ("", "bin") - ## SplitPath("") -> ("", "") + ## splitPath("usr/local/bin") -> ("usr/local", "bin") + ## splitPath("usr/local/bin/") -> ("usr/local/bin", "") + ## splitPath("bin") -> ("", "bin") + ## splitPath("/bin") -> ("", "bin") + ## splitPath("") -> ("", "") var sepPos = -1 for i in countdown(len(path)-1, 0): if path[i] in {dirsep, altsep}: @@ -957,7 +961,10 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", raise newException(EOS, $strerror(errno)) when not defined(ENOENT) and not defined(Windows): - var ENOENT {.importc, header: "<errno.h>".}: cint + when NoFakeVars: + const ENOENT = cint(2) # 2 on most systems including Solaris + else: + var ENOENT {.importc, header: "<errno.h>".}: cint when defined(Windows): when useWinUnicode: @@ -1014,7 +1021,7 @@ when defined(windows): proc strEnd(cstr: wideCString, c = 0'i32): wideCString {. importc: "wcschr", header: "<string.h>".} else: - proc strEnd(cstr: CString, c = 0'i32): CString {. + proc strEnd(cstr: cstring, c = 0'i32): cstring {. importc: "strchr", header: "<string.h>".} proc getEnvVarsC() = @@ -1319,7 +1326,7 @@ proc copyDir*(source, dest: string) {.rtl, extern: "nos$1", copyFile(path, dest / noSource) of pcDir: copyDir(path, dest / noSource) - else: nil + else: discard proc parseCmdLine*(c: string): seq[string] {. noSideEffect, rtl, extern: "nos$1".} = diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index 66bb1e6a9e..684def9786 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -131,7 +131,7 @@ type ETimeout* = object of ESynch -let +const InvalidSocket*: TSocket = nil ## invalid socket when defined(windows): diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim index 25b6d9c480..398656d0a3 100644 --- a/lib/system/ansi_c.nim +++ b/lib/system/ansi_c.nim @@ -49,6 +49,14 @@ when not defined(SIGINT): SIGINT = cint(2) SIGSEGV = cint(11) SIGTERM = cint(15) + elif defined(macosx): + const + SIGABRT = cint(6) + SIGFPE = cint(8) + SIGILL = cint(4) + SIGINT = cint(2) + SIGSEGV = cint(11) + SIGTERM = cint(15) else: {.error: "SIGABRT not ported to your platform".} else: @@ -60,9 +68,10 @@ when not defined(SIGINT): SIGILL {.importc: "SIGILL", nodecl.}: cint when defined(macosx): - var - SIGBUS {.importc: "SIGBUS", nodecl.}: cint - # hopefully this does not lead to new bugs + when NoFakeVars: + const SIGBUS = cint(10) + else: + var SIGBUS {.importc: "SIGBUS", nodecl.}: cint else: template SIGBUS: expr = SIGSEGV diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 23f4e874cc..8d9400a7de 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -50,6 +50,10 @@ when NoFakeVars: const IOFBF = cint(0) IONBF = cint(4) + elif defined(macosx): + const + IOFBF = cint(0) + IONBF = cint(2) else: {.error: "IOFBF not ported to your platform".} else: diff --git a/tools/detect/macosx_consts.nim b/tools/detect/macosx_consts.nim new file mode 100644 index 0000000000..e8be56e5f8 --- /dev/null +++ b/tools/detect/macosx_consts.nim @@ -0,0 +1,629 @@ +# Generated by detect.nim +const + AIO_ALLDONE* = cint(1) + AIO_CANCELED* = cint(2) + AIO_NOTCANCELED* = cint(4) + LIO_NOP* = cint(0) + LIO_NOWAIT* = cint(1) + LIO_READ* = cint(1) + LIO_WAIT* = cint(2) + LIO_WRITE* = cint(2) + RTLD_LAZY* = cint(1) + RTLD_NOW* = cint(2) + RTLD_GLOBAL* = cint(8) + RTLD_LOCAL* = cint(4) + E2BIG* = cint(7) + EACCES* = cint(13) + EADDRINUSE* = cint(48) + EADDRNOTAVAIL* = cint(49) + EAFNOSUPPORT* = cint(47) + EAGAIN* = cint(35) + EALREADY* = cint(37) + EBADF* = cint(9) + EBADMSG* = cint(94) + EBUSY* = cint(16) + ECANCELED* = cint(89) + ECHILD* = cint(10) + ECONNABORTED* = cint(53) + ECONNREFUSED* = cint(61) + ECONNRESET* = cint(54) + EDEADLK* = cint(11) + EDESTADDRREQ* = cint(39) + EDOM* = cint(33) + EDQUOT* = cint(69) + EEXIST* = cint(17) + EFAULT* = cint(14) + EFBIG* = cint(27) + EHOSTUNREACH* = cint(65) + EIDRM* = cint(90) + EILSEQ* = cint(92) + EINPROGRESS* = cint(36) + EINTR* = cint(4) + EINVAL* = cint(22) + EIO* = cint(5) + EISCONN* = cint(56) + EISDIR* = cint(21) + ELOOP* = cint(62) + EMFILE* = cint(24) + EMLINK* = cint(31) + EMSGSIZE* = cint(40) + EMULTIHOP* = cint(95) + ENAMETOOLONG* = cint(63) + ENETDOWN* = cint(50) + ENETRESET* = cint(52) + ENETUNREACH* = cint(51) + ENFILE* = cint(23) + ENOBUFS* = cint(55) + ENODATA* = cint(96) + ENODEV* = cint(19) + ENOENT* = cint(2) + ENOEXEC* = cint(8) + ENOLCK* = cint(77) + ENOLINK* = cint(97) + ENOMEM* = cint(12) + ENOMSG* = cint(91) + ENOPROTOOPT* = cint(42) + ENOSPC* = cint(28) + ENOSR* = cint(98) + ENOSTR* = cint(99) + ENOSYS* = cint(78) + ENOTCONN* = cint(57) + ENOTDIR* = cint(20) + ENOTEMPTY* = cint(66) + ENOTSOCK* = cint(38) + ENOTSUP* = cint(45) + ENOTTY* = cint(25) + ENXIO* = cint(6) + EOPNOTSUPP* = cint(102) + EOVERFLOW* = cint(84) + EPERM* = cint(1) + EPIPE* = cint(32) + EPROTO* = cint(100) + EPROTONOSUPPORT* = cint(43) + EPROTOTYPE* = cint(41) + ERANGE* = cint(34) + EROFS* = cint(30) + ESPIPE* = cint(29) + ESRCH* = cint(3) + ESTALE* = cint(70) + ETIME* = cint(101) + ETIMEDOUT* = cint(60) + ETXTBSY* = cint(26) + EWOULDBLOCK* = cint(35) + EXDEV* = cint(18) + F_DUPFD* = cint(0) + F_GETFD* = cint(1) + F_SETFD* = cint(2) + F_GETFL* = cint(3) + F_SETFL* = cint(4) + F_GETLK* = cint(7) + F_SETLK* = cint(8) + F_SETLKW* = cint(9) + F_GETOWN* = cint(5) + F_SETOWN* = cint(6) + FD_CLOEXEC* = cint(1) + F_RDLCK* = cint(1) + F_UNLCK* = cint(2) + F_WRLCK* = cint(3) + O_CREAT* = cint(512) + O_EXCL* = cint(2048) + O_NOCTTY* = cint(131072) + O_TRUNC* = cint(1024) + O_APPEND* = cint(8) + O_DSYNC* = cint(4194304) + O_NONBLOCK* = cint(4) + O_SYNC* = cint(128) + O_ACCMODE* = cint(3) + O_RDONLY* = cint(0) + O_RDWR* = cint(2) + O_WRONLY* = cint(1) + FE_DIVBYZERO* = cint(4) + FE_INEXACT* = cint(32) + FE_INVALID* = cint(1) + FE_OVERFLOW* = cint(8) + FE_UNDERFLOW* = cint(16) + FE_ALL_EXCEPT* = cint(63) + FE_DOWNWARD* = cint(1024) + FE_TONEAREST* = cint(0) + FE_TOWARDZERO* = cint(3072) + FE_UPWARD* = cint(2048) + FE_DFL_ENV* = when defined(amd64): cast[pointer](0x7fff9533b1b4) + else: cast[pointer](0x904797f4) + MM_HARD* = cint(1) + MM_SOFT* = cint(2) + MM_FIRM* = cint(4) + MM_APPL* = cint(16) + MM_UTIL* = cint(32) + MM_OPSYS* = cint(64) + MM_RECOVER* = cint(4096) + MM_NRECOV* = cint(8192) + MM_HALT* = cint(1) + MM_ERROR* = cint(2) + MM_WARNING* = cint(3) + MM_INFO* = cint(4) + MM_NOSEV* = cint(0) + MM_PRINT* = cint(256) + MM_CONSOLE* = cint(512) + MM_OK* = cint(0) + MM_NOTOK* = cint(3) + MM_NOMSG* = cint(1) + MM_NOCON* = cint(2) + FNM_NOMATCH* = cint(1) + FNM_PATHNAME* = cint(2) + FNM_PERIOD* = cint(4) + FNM_NOESCAPE* = cint(1) + FNM_NOSYS* = cint(-1) + FTW_F* = cint(0) + FTW_D* = cint(1) + FTW_DNR* = cint(2) + FTW_DP* = cint(3) + FTW_NS* = cint(4) + FTW_SL* = cint(5) + FTW_SLN* = cint(6) + FTW_PHYS* = cint(1) + FTW_MOUNT* = cint(2) + FTW_DEPTH* = cint(4) + FTW_CHDIR* = cint(8) + GLOB_APPEND* = cint(1) + GLOB_DOOFFS* = cint(2) + GLOB_ERR* = cint(4) + GLOB_MARK* = cint(8) + GLOB_NOCHECK* = cint(16) + GLOB_NOESCAPE* = cint(8192) + GLOB_NOSORT* = cint(32) + GLOB_ABORTED* = cint(-2) + GLOB_NOMATCH* = cint(-3) + GLOB_NOSPACE* = cint(-1) + GLOB_NOSYS* = cint(-4) + CODESET* = cint(0) + D_T_FMT* = cint(1) + D_FMT* = cint(2) + T_FMT* = cint(3) + T_FMT_AMPM* = cint(4) + AM_STR* = cint(5) + PM_STR* = cint(6) + DAY_1* = cint(7) + DAY_2* = cint(8) + DAY_3* = cint(9) + DAY_4* = cint(10) + DAY_5* = cint(11) + DAY_6* = cint(12) + DAY_7* = cint(13) + ABDAY_1* = cint(14) + ABDAY_2* = cint(15) + ABDAY_3* = cint(16) + ABDAY_4* = cint(17) + ABDAY_5* = cint(18) + ABDAY_6* = cint(19) + ABDAY_7* = cint(20) + MON_1* = cint(21) + MON_2* = cint(22) + MON_3* = cint(23) + MON_4* = cint(24) + MON_5* = cint(25) + MON_6* = cint(26) + MON_7* = cint(27) + MON_8* = cint(28) + MON_9* = cint(29) + MON_10* = cint(30) + MON_11* = cint(31) + MON_12* = cint(32) + ABMON_1* = cint(33) + ABMON_2* = cint(34) + ABMON_3* = cint(35) + ABMON_4* = cint(36) + ABMON_5* = cint(37) + ABMON_6* = cint(38) + ABMON_7* = cint(39) + ABMON_8* = cint(40) + ABMON_9* = cint(41) + ABMON_10* = cint(42) + ABMON_11* = cint(43) + ABMON_12* = cint(44) + ERA* = cint(45) + ERA_D_FMT* = cint(46) + ERA_D_T_FMT* = cint(47) + ERA_T_FMT* = cint(48) + ALT_DIGITS* = cint(49) + RADIXCHAR* = cint(50) + THOUSEP* = cint(51) + YESEXPR* = cint(52) + NOEXPR* = cint(53) + CRNCYSTR* = cint(56) + LC_ALL* = cint(0) + LC_COLLATE* = cint(1) + LC_CTYPE* = cint(2) + LC_MESSAGES* = cint(6) + LC_MONETARY* = cint(3) + LC_NUMERIC* = cint(4) + LC_TIME* = cint(5) + PTHREAD_CANCEL_ASYNCHRONOUS* = cint(0) + PTHREAD_CANCEL_ENABLE* = cint(1) + PTHREAD_CANCEL_DEFERRED* = cint(2) + PTHREAD_CANCEL_DISABLE* = cint(0) + PTHREAD_CREATE_DETACHED* = cint(2) + PTHREAD_CREATE_JOINABLE* = cint(1) + PTHREAD_EXPLICIT_SCHED* = cint(2) + PTHREAD_INHERIT_SCHED* = cint(1) + PTHREAD_MUTEX_DEFAULT* = cint(0) + PTHREAD_MUTEX_ERRORCHECK* = cint(1) + PTHREAD_MUTEX_NORMAL* = cint(0) + PTHREAD_MUTEX_RECURSIVE* = cint(2) + PTHREAD_PRIO_INHERIT* = cint(1) + PTHREAD_PRIO_NONE* = cint(0) + PTHREAD_PRIO_PROTECT* = cint(2) + PTHREAD_PROCESS_SHARED* = cint(1) + PTHREAD_PROCESS_PRIVATE* = cint(2) + PTHREAD_SCOPE_PROCESS* = cint(2) + PTHREAD_SCOPE_SYSTEM* = cint(1) + F_OK* = cint(0) + R_OK* = cint(4) + W_OK* = cint(2) + X_OK* = cint(1) + CS_PATH* = cint(1) + CS_POSIX_V6_ILP32_OFF32_CFLAGS* = cint(2) + CS_POSIX_V6_ILP32_OFF32_LDFLAGS* = cint(3) + CS_POSIX_V6_ILP32_OFF32_LIBS* = cint(4) + CS_POSIX_V6_ILP32_OFFBIG_CFLAGS* = cint(5) + CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS* = cint(6) + CS_POSIX_V6_ILP32_OFFBIG_LIBS* = cint(7) + CS_POSIX_V6_LP64_OFF64_CFLAGS* = cint(8) + CS_POSIX_V6_LP64_OFF64_LDFLAGS* = cint(9) + CS_POSIX_V6_LP64_OFF64_LIBS* = cint(10) + CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS* = cint(11) + CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS* = cint(12) + CS_POSIX_V6_LPBIG_OFFBIG_LIBS* = cint(13) + CS_POSIX_V6_WIDTH_RESTRICTED_ENVS* = cint(14) + F_LOCK* = cint(1) + F_TEST* = cint(3) + F_TLOCK* = cint(2) + F_ULOCK* = cint(0) + PC_2_SYMLINKS* = cint(15) + PC_ALLOC_SIZE_MIN* = cint(16) + PC_ASYNC_IO* = cint(17) + PC_CHOWN_RESTRICTED* = cint(7) + PC_FILESIZEBITS* = cint(18) + PC_LINK_MAX* = cint(1) + PC_MAX_CANON* = cint(2) + PC_MAX_INPUT* = cint(3) + PC_NAME_MAX* = cint(4) + PC_NO_TRUNC* = cint(8) + PC_PATH_MAX* = cint(5) + PC_PIPE_BUF* = cint(6) + PC_PRIO_IO* = cint(19) + PC_REC_INCR_XFER_SIZE* = cint(20) + PC_REC_MIN_XFER_SIZE* = cint(22) + PC_REC_XFER_ALIGN* = cint(23) + PC_SYMLINK_MAX* = cint(24) + PC_SYNC_IO* = cint(25) + PC_VDISABLE* = cint(9) + SC_2_C_BIND* = cint(18) + SC_2_C_DEV* = cint(19) + SC_2_CHAR_TERM* = cint(20) + SC_2_FORT_DEV* = cint(21) + SC_2_FORT_RUN* = cint(22) + SC_2_LOCALEDEF* = cint(23) + SC_2_PBS* = cint(59) + SC_2_PBS_ACCOUNTING* = cint(60) + SC_2_PBS_CHECKPOINT* = cint(61) + SC_2_PBS_LOCATE* = cint(62) + SC_2_PBS_MESSAGE* = cint(63) + SC_2_PBS_TRACK* = cint(64) + SC_2_SW_DEV* = cint(24) + SC_2_UPE* = cint(25) + SC_2_VERSION* = cint(17) + SC_ADVISORY_INFO* = cint(65) + SC_AIO_LISTIO_MAX* = cint(42) + SC_AIO_MAX* = cint(43) + SC_AIO_PRIO_DELTA_MAX* = cint(44) + SC_ARG_MAX* = cint(1) + SC_ASYNCHRONOUS_IO* = cint(28) + SC_ATEXIT_MAX* = cint(107) + SC_BARRIERS* = cint(66) + SC_BC_BASE_MAX* = cint(9) + SC_BC_DIM_MAX* = cint(10) + SC_BC_SCALE_MAX* = cint(11) + SC_BC_STRING_MAX* = cint(12) + SC_CHILD_MAX* = cint(2) + SC_CLK_TCK* = cint(3) + SC_CLOCK_SELECTION* = cint(67) + SC_COLL_WEIGHTS_MAX* = cint(13) + SC_CPUTIME* = cint(68) + SC_DELAYTIMER_MAX* = cint(45) + SC_EXPR_NEST_MAX* = cint(14) + SC_FSYNC* = cint(38) + SC_GETGR_R_SIZE_MAX* = cint(70) + SC_GETPW_R_SIZE_MAX* = cint(71) + SC_HOST_NAME_MAX* = cint(72) + SC_IOV_MAX* = cint(56) + SC_IPV6* = cint(118) + SC_JOB_CONTROL* = cint(6) + SC_LINE_MAX* = cint(15) + SC_LOGIN_NAME_MAX* = cint(73) + SC_MAPPED_FILES* = cint(47) + SC_MEMLOCK* = cint(30) + SC_MEMLOCK_RANGE* = cint(31) + SC_MEMORY_PROTECTION* = cint(32) + SC_MESSAGE_PASSING* = cint(33) + SC_MONOTONIC_CLOCK* = cint(74) + SC_MQ_OPEN_MAX* = cint(46) + SC_MQ_PRIO_MAX* = cint(75) + SC_NGROUPS_MAX* = cint(4) + SC_OPEN_MAX* = cint(5) + SC_PAGE_SIZE* = cint(29) + SC_PRIORITIZED_IO* = cint(34) + SC_PRIORITY_SCHEDULING* = cint(35) + SC_RAW_SOCKETS* = cint(119) + SC_RE_DUP_MAX* = cint(16) + SC_READER_WRITER_LOCKS* = cint(76) + SC_REALTIME_SIGNALS* = cint(36) + SC_REGEXP* = cint(77) + SC_RTSIG_MAX* = cint(48) + SC_SAVED_IDS* = cint(7) + SC_SEM_NSEMS_MAX* = cint(49) + SC_SEM_VALUE_MAX* = cint(50) + SC_SEMAPHORES* = cint(37) + SC_SHARED_MEMORY_OBJECTS* = cint(39) + SC_SHELL* = cint(78) + SC_SIGQUEUE_MAX* = cint(51) + SC_SPAWN* = cint(79) + SC_SPIN_LOCKS* = cint(80) + SC_SPORADIC_SERVER* = cint(81) + SC_SS_REPL_MAX* = cint(126) + SC_STREAM_MAX* = cint(26) + SC_SYMLOOP_MAX* = cint(120) + SC_SYNCHRONIZED_IO* = cint(40) + SC_THREAD_ATTR_STACKADDR* = cint(82) + SC_THREAD_ATTR_STACKSIZE* = cint(83) + SC_THREAD_CPUTIME* = cint(84) + SC_THREAD_DESTRUCTOR_ITERATIONS* = cint(85) + SC_THREAD_KEYS_MAX* = cint(86) + SC_THREAD_PRIO_INHERIT* = cint(87) + SC_THREAD_PRIO_PROTECT* = cint(88) + SC_THREAD_PRIORITY_SCHEDULING* = cint(89) + SC_THREAD_PROCESS_SHARED* = cint(90) + SC_THREAD_SAFE_FUNCTIONS* = cint(91) + SC_THREAD_SPORADIC_SERVER* = cint(92) + SC_THREAD_STACK_MIN* = cint(93) + SC_THREAD_THREADS_MAX* = cint(94) + SC_THREADS* = cint(96) + SC_TIMEOUTS* = cint(95) + SC_TIMER_MAX* = cint(52) + SC_TIMERS* = cint(41) + SC_TRACE* = cint(97) + SC_TRACE_EVENT_FILTER* = cint(98) + SC_TRACE_EVENT_NAME_MAX* = cint(127) + SC_TRACE_INHERIT* = cint(99) + SC_TRACE_LOG* = cint(100) + SC_TRACE_NAME_MAX* = cint(128) + SC_TRACE_SYS_MAX* = cint(129) + SC_TRACE_USER_EVENT_MAX* = cint(130) + SC_TTY_NAME_MAX* = cint(101) + SC_TYPED_MEMORY_OBJECTS* = cint(102) + SC_TZNAME_MAX* = cint(27) + SC_V6_ILP32_OFF32* = cint(103) + SC_V6_ILP32_OFFBIG* = cint(104) + SC_V6_LP64_OFF64* = cint(105) + SC_V6_LPBIG_OFFBIG* = cint(106) + SC_VERSION* = cint(8) + SC_XBS5_ILP32_OFF32* = cint(122) + SC_XBS5_ILP32_OFFBIG* = cint(123) + SC_XBS5_LP64_OFF64* = cint(124) + SC_XBS5_LPBIG_OFFBIG* = cint(125) + SC_XOPEN_CRYPT* = cint(108) + SC_XOPEN_ENH_I18N* = cint(109) + SC_XOPEN_LEGACY* = cint(110) + SC_XOPEN_REALTIME* = cint(111) + SC_XOPEN_REALTIME_THREADS* = cint(112) + SC_XOPEN_SHM* = cint(113) + SC_XOPEN_STREAMS* = cint(114) + SC_XOPEN_UNIX* = cint(115) + SC_XOPEN_VERSION* = cint(116) + SEEK_SET* = cint(0) + SEEK_CUR* = cint(1) + SEEK_END* = cint(2) + SEM_FAILED* = cast[pointer](-1) + IPC_CREAT* = cint(512) + IPC_EXCL* = cint(1024) + IPC_NOWAIT* = cint(2048) + IPC_PRIVATE* = cint(0) + IPC_RMID* = cint(0) + IPC_SET* = cint(1) + IPC_STAT* = cint(2) + S_IFMT* = cint(61440) + S_IFBLK* = cint(24576) + S_IFCHR* = cint(8192) + S_IFIFO* = cint(4096) + S_IFREG* = cint(32768) + S_IFDIR* = cint(16384) + S_IFLNK* = cint(40960) + S_IFSOCK* = cint(49152) + S_IRWXU* = cint(448) + S_IRUSR* = cint(256) + S_IWUSR* = cint(128) + S_IXUSR* = cint(64) + S_IRWXG* = cint(56) + S_IRGRP* = cint(32) + S_IWGRP* = cint(16) + S_IXGRP* = cint(8) + S_IRWXO* = cint(7) + S_IROTH* = cint(4) + S_IWOTH* = cint(2) + S_IXOTH* = cint(1) + S_ISUID* = cint(2048) + S_ISGID* = cint(1024) + S_ISVTX* = cint(512) + ST_RDONLY* = cint(1) + ST_NOSUID* = cint(2) + PROT_READ* = cint(1) + PROT_WRITE* = cint(2) + PROT_EXEC* = cint(4) + PROT_NONE* = cint(0) + MAP_SHARED* = cint(1) + MAP_PRIVATE* = cint(2) + MAP_FIXED* = cint(16) + MS_ASYNC* = cint(1) + MS_SYNC* = cint(16) + MS_INVALIDATE* = cint(2) + MCL_CURRENT* = cint(1) + MCL_FUTURE* = cint(2) + MAP_FAILED* = cast[pointer](-1) + POSIX_MADV_NORMAL* = cint(0) + POSIX_MADV_SEQUENTIAL* = cint(2) + POSIX_MADV_RANDOM* = cint(1) + POSIX_MADV_WILLNEED* = cint(3) + POSIX_MADV_DONTNEED* = cint(4) + CLOCKS_PER_SEC* = clong(1000000) + WNOHANG* = cint(1) + WUNTRACED* = cint(2) + WEXITED* = cint(4) + WSTOPPED* = cint(8) + WCONTINUED* = cint(16) + WNOWAIT* = cint(32) + SIGEV_NONE* = cint(0) + SIGEV_SIGNAL* = cint(1) + SIGEV_THREAD* = cint(3) + SIGABRT* = cint(6) + SIGALRM* = cint(14) + SIGBUS* = cint(10) + SIGCHLD* = cint(20) + SIGCONT* = cint(19) + SIGFPE* = cint(8) + SIGHUP* = cint(1) + SIGILL* = cint(4) + SIGINT* = cint(2) + SIGKILL* = cint(9) + SIGPIPE* = cint(13) + SIGQUIT* = cint(3) + SIGSEGV* = cint(11) + SIGSTOP* = cint(17) + SIGTERM* = cint(15) + SIGTSTP* = cint(18) + SIGTTIN* = cint(21) + SIGTTOU* = cint(22) + SIGUSR1* = cint(30) + SIGUSR2* = cint(31) + SIGPROF* = cint(27) + SIGSYS* = cint(12) + SIGTRAP* = cint(5) + SIGURG* = cint(16) + SIGVTALRM* = cint(26) + SIGXCPU* = cint(24) + SIGXFSZ* = cint(25) + SA_NOCLDSTOP* = cint(8) + SIG_BLOCK* = cint(1) + SIG_UNBLOCK* = cint(2) + SIG_SETMASK* = cint(3) + SA_ONSTACK* = cint(1) + SA_RESETHAND* = cint(4) + SA_RESTART* = cint(2) + SA_SIGINFO* = cint(64) + SA_NOCLDWAIT* = cint(32) + SA_NODEFER* = cint(16) + SS_ONSTACK* = cint(1) + SS_DISABLE* = cint(4) + MINSIGSTKSZ* = cint(32768) + SIGSTKSZ* = cint(131072) + NL_SETD* = cint(1) + NL_CAT_LOCALE* = cint(1) + SCHED_FIFO* = cint(4) + SCHED_RR* = cint(2) + SCHED_OTHER* = cint(1) + FD_SETSIZE* = cint(1024) + SCM_RIGHTS* = cint(1) + SOCK_DGRAM* = cint(2) + SOCK_RAW* = cint(3) + SOCK_SEQPACKET* = cint(5) + SOCK_STREAM* = cint(1) + SOL_SOCKET* = cint(65535) + SO_ACCEPTCONN* = cint(2) + SO_BROADCAST* = cint(32) + SO_DEBUG* = cint(1) + SO_DONTROUTE* = cint(16) + SO_ERROR* = cint(4103) + SO_KEEPALIVE* = cint(8) + SO_LINGER* = cint(128) + SO_OOBINLINE* = cint(256) + SO_RCVBUF* = cint(4098) + SO_RCVLOWAT* = cint(4100) + SO_RCVTIMEO* = cint(4102) + SO_REUSEADDR* = cint(4) + SO_SNDBUF* = cint(4097) + SO_SNDLOWAT* = cint(4099) + SO_SNDTIMEO* = cint(4101) + SO_TYPE* = cint(4104) + SOMAXCONN* = cint(128) + MSG_CTRUNC* = cint(32) + MSG_DONTROUTE* = cint(4) + MSG_EOR* = cint(8) + MSG_OOB* = cint(1) + MSG_PEEK* = cint(2) + MSG_TRUNC* = cint(16) + MSG_WAITALL* = cint(64) + AF_INET* = cint(2) + AF_INET6* = cint(30) + AF_UNIX* = cint(1) + AF_UNSPEC* = cint(0) + SHUT_RD* = cint(0) + SHUT_RDWR* = cint(2) + SHUT_WR* = cint(1) + IPPROTO_IP* = cint(0) + IPPROTO_IPV6* = cint(41) + IPPROTO_ICMP* = cint(1) + IPPROTO_RAW* = cint(255) + IPPROTO_TCP* = cint(6) + IPPROTO_UDP* = cint(17) + INADDR_ANY* = cint(0) + INADDR_BROADCAST* = cint(-1) + INET_ADDRSTRLEN* = cint(16) + IPV6_JOIN_GROUP* = cint(12) + IPV6_LEAVE_GROUP* = cint(13) + IPV6_MULTICAST_HOPS* = cint(10) + IPV6_MULTICAST_IF* = cint(9) + IPV6_MULTICAST_LOOP* = cint(11) + IPV6_UNICAST_HOPS* = cint(4) + IPV6_V6ONLY* = cint(27) + IPPORT_RESERVED* = cint(1024) + HOST_NOT_FOUND* = cint(1) + NO_DATA* = cint(4) + NO_RECOVERY* = cint(3) + TRY_AGAIN* = cint(2) + AI_PASSIVE* = cint(1) + AI_CANONNAME* = cint(2) + AI_NUMERICHOST* = cint(4) + AI_NUMERICSERV* = cint(4096) + AI_V4MAPPED* = cint(2048) + AI_ALL* = cint(256) + AI_ADDRCONFIG* = cint(1024) + NI_NOFQDN* = cint(1) + NI_NUMERICHOST* = cint(2) + NI_NAMEREQD* = cint(4) + NI_NUMERICSERV* = cint(8) + NI_DGRAM* = cint(16) + EAI_AGAIN* = cint(2) + EAI_BADFLAGS* = cint(3) + EAI_FAIL* = cint(4) + EAI_FAMILY* = cint(5) + EAI_MEMORY* = cint(6) + EAI_NONAME* = cint(8) + EAI_SERVICE* = cint(9) + EAI_SOCKTYPE* = cint(10) + EAI_SYSTEM* = cint(11) + EAI_OVERFLOW* = cint(14) + POLLIN* = cshort(1) + POLLRDNORM* = cshort(64) + POLLRDBAND* = cshort(128) + POLLPRI* = cshort(2) + POLLOUT* = cshort(4) + POLLWRNORM* = cshort(4) + POLLWRBAND* = cshort(256) + POLLERR* = cshort(8) + POLLHUP* = cshort(16) + POLLNVAL* = cshort(32) + POSIX_SPAWN_RESETIDS* = cint(1) + POSIX_SPAWN_SETPGROUP* = cint(2) + POSIX_SPAWN_SETSIGDEF* = cint(4) + POSIX_SPAWN_SETSIGMASK* = cint(8) + IOFBF* = cint(0) + IONBF* = cint(2) + diff --git a/tools/detect/windows_amd64_consts.nim b/tools/detect/windows_amd64_consts.nim new file mode 100644 index 0000000000..d72c9786db --- /dev/null +++ b/tools/detect/windows_amd64_consts.nim @@ -0,0 +1,152 @@ +# Generated by detect.nim +const + E2BIG* = cint(7) + EACCES* = cint(13) + EADDRINUSE* = cint(100) + EADDRNOTAVAIL* = cint(101) + EAFNOSUPPORT* = cint(102) + EAGAIN* = cint(11) + EALREADY* = cint(103) + EBADF* = cint(9) + EBUSY* = cint(16) + ECANCELED* = cint(105) + ECHILD* = cint(10) + ECONNABORTED* = cint(106) + ECONNREFUSED* = cint(107) + ECONNRESET* = cint(108) + EDEADLK* = cint(36) + EDESTADDRREQ* = cint(109) + EDOM* = cint(33) + EEXIST* = cint(17) + EFAULT* = cint(14) + EFBIG* = cint(27) + EHOSTUNREACH* = cint(110) + EILSEQ* = cint(42) + EINPROGRESS* = cint(112) + EINTR* = cint(4) + EINVAL* = cint(22) + EIO* = cint(5) + EISCONN* = cint(113) + EISDIR* = cint(21) + ELOOP* = cint(114) + EMFILE* = cint(24) + EMLINK* = cint(31) + EMSGSIZE* = cint(115) + ENAMETOOLONG* = cint(38) + ENETDOWN* = cint(116) + ENETRESET* = cint(117) + ENETUNREACH* = cint(118) + ENFILE* = cint(23) + ENOBUFS* = cint(119) + ENODEV* = cint(19) + ENOENT* = cint(2) + ENOEXEC* = cint(8) + ENOLCK* = cint(39) + ENOMEM* = cint(12) + ENOPROTOOPT* = cint(123) + ENOSPC* = cint(28) + ENOSYS* = cint(40) + ENOTCONN* = cint(126) + ENOTDIR* = cint(20) + ENOTEMPTY* = cint(41) + ENOTSOCK* = cint(128) + ENOTSUP* = cint(129) + ENOTTY* = cint(25) + ENXIO* = cint(6) + EOPNOTSUPP* = cint(130) + EOVERFLOW* = cint(132) + EPERM* = cint(1) + EPIPE* = cint(32) + EPROTO* = cint(134) + EPROTONOSUPPORT* = cint(135) + EPROTOTYPE* = cint(136) + ERANGE* = cint(34) + EROFS* = cint(30) + ESPIPE* = cint(29) + ESRCH* = cint(3) + ETIMEDOUT* = cint(138) + EWOULDBLOCK* = cint(140) + EXDEV* = cint(18) + O_CREAT* = cint(256) + O_EXCL* = cint(1024) + O_TRUNC* = cint(512) + O_APPEND* = cint(8) + O_ACCMODE* = cint(3) + O_RDONLY* = cint(0) + O_RDWR* = cint(2) + O_WRONLY* = cint(1) + FE_DIVBYZERO* = cint(4) + FE_INEXACT* = cint(32) + FE_INVALID* = cint(1) + FE_OVERFLOW* = cint(8) + FE_UNDERFLOW* = cint(16) + FE_ALL_EXCEPT* = cint(63) + FE_DOWNWARD* = cint(1024) + FE_TONEAREST* = cint(0) + FE_TOWARDZERO* = cint(3072) + FE_UPWARD* = cint(2048) + FE_DFL_ENV* = pointer(nil) + LC_ALL* = cint(0) + LC_COLLATE* = cint(1) + LC_CTYPE* = cint(2) + LC_MONETARY* = cint(3) + LC_NUMERIC* = cint(4) + LC_TIME* = cint(5) + PTHREAD_BARRIER_SERIAL_THREAD* = cint(1) + PTHREAD_CANCEL_ASYNCHRONOUS* = cint(2) + PTHREAD_CANCEL_ENABLE* = cint(1) + PTHREAD_CANCEL_DEFERRED* = cint(0) + PTHREAD_CANCEL_DISABLE* = cint(0) + PTHREAD_CREATE_DETACHED* = cint(4) + PTHREAD_CREATE_JOINABLE* = cint(0) + PTHREAD_EXPLICIT_SCHED* = cint(0) + PTHREAD_INHERIT_SCHED* = cint(8) + PTHREAD_MUTEX_DEFAULT* = cint(0) + PTHREAD_MUTEX_ERRORCHECK* = cint(1) + PTHREAD_MUTEX_NORMAL* = cint(0) + PTHREAD_MUTEX_RECURSIVE* = cint(2) + PTHREAD_PRIO_INHERIT* = cint(8) + PTHREAD_PRIO_NONE* = cint(0) + PTHREAD_PRIO_PROTECT* = cint(16) + PTHREAD_PROCESS_SHARED* = cint(1) + PTHREAD_PROCESS_PRIVATE* = cint(0) + PTHREAD_SCOPE_PROCESS* = cint(0) + PTHREAD_SCOPE_SYSTEM* = cint(16) + F_OK* = cint(0) + R_OK* = cint(4) + W_OK* = cint(2) + X_OK* = cint(1) + SEEK_SET* = cint(0) + SEEK_CUR* = cint(1) + SEEK_END* = cint(2) + SEM_FAILED* = pointer(nil) + S_IFMT* = cint(61440) + S_IFBLK* = cint(12288) + S_IFCHR* = cint(8192) + S_IFIFO* = cint(4096) + S_IFREG* = cint(32768) + S_IFDIR* = cint(16384) + S_IRWXU* = cint(448) + S_IRUSR* = cint(256) + S_IWUSR* = cint(128) + S_IXUSR* = cint(64) + CLOCKS_PER_SEC* = clong(1000) + CLOCK_PROCESS_CPUTIME_ID* = cint(2) + CLOCK_THREAD_CPUTIME_ID* = cint(3) + CLOCK_REALTIME* = cint(0) + TIMER_ABSTIME* = cint(1) + CLOCK_MONOTONIC* = cint(1) + SIGABRT* = cint(22) + SIGFPE* = cint(8) + SIGILL* = cint(4) + SIGINT* = cint(2) + SIGSEGV* = cint(11) + SIGTERM* = cint(15) + SIG_BLOCK* = cint(0) + SIG_UNBLOCK* = cint(1) + SIG_SETMASK* = cint(2) + SCHED_FIFO* = cint(1) + SCHED_RR* = cint(2) + SCHED_OTHER* = cint(0) + IOFBF* = cint(0) + IONBF* = cint(4) diff --git a/tools/detect/windows_i386_consts.nim b/tools/detect/windows_i386_consts.nim new file mode 100644 index 0000000000..cd6c475f4d --- /dev/null +++ b/tools/detect/windows_i386_consts.nim @@ -0,0 +1,96 @@ +# Generated by detect.nim +const + E2BIG* = cint(7) + EACCES* = cint(13) + EAGAIN* = cint(11) + EBADF* = cint(9) + EBUSY* = cint(16) + ECHILD* = cint(10) + EDEADLK* = cint(36) + EDOM* = cint(33) + EEXIST* = cint(17) + EFAULT* = cint(14) + EFBIG* = cint(27) + EILSEQ* = cint(42) + EINTR* = cint(4) + EINVAL* = cint(22) + EIO* = cint(5) + EISDIR* = cint(21) + EMFILE* = cint(24) + EMLINK* = cint(31) + ENAMETOOLONG* = cint(38) + ENFILE* = cint(23) + ENODEV* = cint(19) + ENOENT* = cint(2) + ENOEXEC* = cint(8) + ENOLCK* = cint(39) + ENOMEM* = cint(12) + ENOSPC* = cint(28) + ENOSYS* = cint(40) + ENOTDIR* = cint(20) + ENOTEMPTY* = cint(41) + ENOTSUP* = cint(48) + ENOTTY* = cint(25) + ENXIO* = cint(6) + EPERM* = cint(1) + EPIPE* = cint(32) + ERANGE* = cint(34) + EROFS* = cint(30) + ESPIPE* = cint(29) + ESRCH* = cint(3) + ETIMEDOUT* = cint(10060) + EXDEV* = cint(18) + O_CREAT* = cint(256) + O_EXCL* = cint(1024) + O_TRUNC* = cint(512) + O_APPEND* = cint(8) + O_ACCMODE* = cint(3) + O_RDONLY* = cint(0) + O_RDWR* = cint(2) + O_WRONLY* = cint(1) + FE_DIVBYZERO* = cint(4) + FE_INEXACT* = cint(32) + FE_INVALID* = cint(1) + FE_OVERFLOW* = cint(8) + FE_UNDERFLOW* = cint(16) + FE_ALL_EXCEPT* = cint(63) + FE_DOWNWARD* = cint(1024) + FE_TONEAREST* = cint(0) + FE_TOWARDZERO* = cint(3072) + FE_UPWARD* = cint(2048) + FE_DFL_ENV* = pointer(nil) + LC_ALL* = cint(0) + LC_COLLATE* = cint(1) + LC_CTYPE* = cint(2) + LC_MONETARY* = cint(3) + LC_NUMERIC* = cint(4) + LC_TIME* = cint(5) + F_OK* = cint(0) + R_OK* = cint(4) + W_OK* = cint(2) + X_OK* = cint(1) + SEEK_SET* = cint(0) + SEEK_CUR* = cint(1) + SEEK_END* = cint(2) + S_IFMT* = cint(61440) + S_IFBLK* = cint(12288) + S_IFCHR* = cint(8192) + S_IFIFO* = cint(4096) + S_IFREG* = cint(32768) + S_IFDIR* = cint(16384) + S_IRWXU* = cint(448) + S_IRUSR* = cint(256) + S_IWUSR* = cint(128) + S_IXUSR* = cint(64) + CLOCKS_PER_SEC* = clong(1000) + SIGABRT* = cint(22) + SIGFPE* = cint(8) + SIGILL* = cint(4) + SIGINT* = cint(2) + SIGSEGV* = cint(11) + SIGTERM* = cint(15) + SIG_BLOCK* = cint(0) + SIG_UNBLOCK* = cint(1) + SIG_SETMASK* = cint(2) + IOFBF* = cint(0) + IONBF* = cint(4) From 84e471032040b68461c638625dcac274176c594e Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Tue, 24 Dec 2013 01:39:33 +0100 Subject: [PATCH 136/326] bugfix: InvalidSockets needs to be a let variable --- lib/pure/sockets.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index 684def9786..66bb1e6a9e 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -131,7 +131,7 @@ type ETimeout* = object of ESynch -const +let InvalidSocket*: TSocket = nil ## invalid socket when defined(windows): From 83a0a3127667464b4aef73168747818926235514 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Tue, 24 Dec 2013 14:04:18 +0100 Subject: [PATCH 137/326] attempt to merge newtempl --- compiler/lookups.nim | 7 +- compiler/semtempl.nim | 4 +- lib/system/excpt.nim | 2 +- todo.txt | 8 +- tools/detect/linux_amd64_consts.nim | 631 ++++++++++++++++++++++++++++ 5 files changed, 646 insertions(+), 6 deletions(-) create mode 100644 tools/detect/linux_amd64_consts.nim diff --git a/compiler/lookups.nim b/compiler/lookups.nim index e1ec9e14be..642243468f 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -233,8 +233,11 @@ proc QualifiedLookUp*(c: PContext, n: PNode, flags = {checkUndeclared}): PSym = if result == nil and checkUndeclared in flags: LocalError(n.sons[1].info, errUndeclaredIdentifier, ident.s) result = errorSym(c, n.sons[1]) - elif checkUndeclared in flags: - LocalError(n.sons[1].info, errIdentifierExpected, + elif n.sons[1].kind == nkSym: + result = n.sons[1].sym + elif checkUndeclared in flags and + n.sons[1].kind notin {nkOpenSymChoice, nkClosedSymChoice}: + LocalError(n.sons[1].info, errIdentifierExpected, renderTree(n.sons[1])) result = errorSym(c, n.sons[1]) else: diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 66cc3a983d..e6e43944b4 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -476,6 +476,8 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = SymTabReplace(c.currentScope.symbols, proto, s) if n.sons[patternPos].kind != nkEmpty: c.patterns.add(s) + #if s.name.s == "move": + # echo renderTree(result) proc semPatternBody(c: var TemplCtx, n: PNode): PNode = template templToExpand(s: expr): expr = @@ -602,5 +604,5 @@ proc semPattern(c: PContext, n: PNode): PNode = if result.len == 1: result = result.sons[0] elif result.len == 0: - LocalError(n.info, errInvalidExpression) + localError(n.info, errInvalidExpression) closeScope(c) diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 9b6a64fb05..e5f20f22a9 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -280,7 +280,7 @@ when defined(endb): when not defined(noSignalHandler): proc signalHandler(sig: cint) {.exportc: "signalHandler", noconv.} = - template processSignal(s, action: expr) {.immediate.} = + template processSignal(s, action: expr) {.immediate, dirty.} = if s == SIGINT: action("SIGINT: Interrupted by Ctrl-C.\n") elif s == SIGSEGV: action("SIGSEGV: Illegal storage access. (Attempt to read from nil?)\n") diff --git a/todo.txt b/todo.txt index 4e216abb4f..160d8514c0 100644 --- a/todo.txt +++ b/todo.txt @@ -1,8 +1,10 @@ version 0.9.4 ============= -- new VM: - - implement overflow checking +- make new templating symbol binding rules work +- document new templating symbol binding rules +- convert all with "nimrod pretty" +- make '--implicitStatic:on' the default - special rule for ``[]=`` - ``=`` should be overloadable; requires specialization for ``=``; general @@ -15,6 +17,8 @@ version 0.9.4 Bugs ==== +- new VM: + - implement overflow checking - bug: 'type T = ref T' not recognized as illegal recursion - bug: type conversions concerning proc types are weird - compilation of niminst takes way too long. looks like a regression diff --git a/tools/detect/linux_amd64_consts.nim b/tools/detect/linux_amd64_consts.nim new file mode 100644 index 0000000000..eb85da0454 --- /dev/null +++ b/tools/detect/linux_amd64_consts.nim @@ -0,0 +1,631 @@ +# Generated by detect.nim +const + AIO_ALLDONE* = cint(2) + AIO_CANCELED* = cint(0) + AIO_NOTCANCELED* = cint(1) + LIO_NOP* = cint(2) + LIO_NOWAIT* = cint(1) + LIO_READ* = cint(0) + LIO_WAIT* = cint(0) + LIO_WRITE* = cint(1) + RTLD_LAZY* = cint(1) + RTLD_NOW* = cint(2) + RTLD_GLOBAL* = cint(256) + RTLD_LOCAL* = cint(0) + E2BIG* = cint(7) + EACCES* = cint(13) + EADDRINUSE* = cint(98) + EADDRNOTAVAIL* = cint(99) + EAFNOSUPPORT* = cint(97) + EAGAIN* = cint(11) + EALREADY* = cint(114) + EBADF* = cint(9) + EBADMSG* = cint(74) + EBUSY* = cint(16) + ECANCELED* = cint(125) + ECHILD* = cint(10) + ECONNABORTED* = cint(103) + ECONNREFUSED* = cint(111) + ECONNRESET* = cint(104) + EDEADLK* = cint(35) + EDESTADDRREQ* = cint(89) + EDOM* = cint(33) + EDQUOT* = cint(122) + EEXIST* = cint(17) + EFAULT* = cint(14) + EFBIG* = cint(27) + EHOSTUNREACH* = cint(113) + EIDRM* = cint(43) + EILSEQ* = cint(84) + EINPROGRESS* = cint(115) + EINTR* = cint(4) + EINVAL* = cint(22) + EIO* = cint(5) + EISCONN* = cint(106) + EISDIR* = cint(21) + ELOOP* = cint(40) + EMFILE* = cint(24) + EMLINK* = cint(31) + EMSGSIZE* = cint(90) + EMULTIHOP* = cint(72) + ENAMETOOLONG* = cint(36) + ENETDOWN* = cint(100) + ENETRESET* = cint(102) + ENETUNREACH* = cint(101) + ENFILE* = cint(23) + ENOBUFS* = cint(105) + ENODATA* = cint(61) + ENODEV* = cint(19) + ENOENT* = cint(2) + ENOEXEC* = cint(8) + ENOLCK* = cint(37) + ENOLINK* = cint(67) + ENOMEM* = cint(12) + ENOMSG* = cint(42) + ENOPROTOOPT* = cint(92) + ENOSPC* = cint(28) + ENOSR* = cint(63) + ENOSTR* = cint(60) + ENOSYS* = cint(38) + ENOTCONN* = cint(107) + ENOTDIR* = cint(20) + ENOTEMPTY* = cint(39) + ENOTSOCK* = cint(88) + ENOTSUP* = cint(95) + ENOTTY* = cint(25) + ENXIO* = cint(6) + EOPNOTSUPP* = cint(95) + EOVERFLOW* = cint(75) + EPERM* = cint(1) + EPIPE* = cint(32) + EPROTO* = cint(71) + EPROTONOSUPPORT* = cint(93) + EPROTOTYPE* = cint(91) + ERANGE* = cint(34) + EROFS* = cint(30) + ESPIPE* = cint(29) + ESRCH* = cint(3) + ESTALE* = cint(116) + ETIME* = cint(62) + ETIMEDOUT* = cint(110) + ETXTBSY* = cint(26) + EWOULDBLOCK* = cint(11) + EXDEV* = cint(18) + F_DUPFD* = cint(0) + F_GETFD* = cint(1) + F_SETFD* = cint(2) + F_GETFL* = cint(3) + F_SETFL* = cint(4) + F_GETLK* = cint(5) + F_SETLK* = cint(6) + F_SETLKW* = cint(7) + F_GETOWN* = cint(9) + F_SETOWN* = cint(8) + FD_CLOEXEC* = cint(1) + F_RDLCK* = cint(0) + F_UNLCK* = cint(2) + F_WRLCK* = cint(1) + O_CREAT* = cint(64) + O_EXCL* = cint(128) + O_NOCTTY* = cint(256) + O_TRUNC* = cint(512) + O_APPEND* = cint(1024) + O_DSYNC* = cint(4096) + O_NONBLOCK* = cint(2048) + O_RSYNC* = cint(1052672) + O_SYNC* = cint(1052672) + O_ACCMODE* = cint(3) + O_RDONLY* = cint(0) + O_RDWR* = cint(2) + O_WRONLY* = cint(1) + POSIX_FADV_NORMAL* = cint(0) + POSIX_FADV_SEQUENTIAL* = cint(2) + POSIX_FADV_RANDOM* = cint(1) + POSIX_FADV_WILLNEED* = cint(3) + POSIX_FADV_DONTNEED* = cint(4) + POSIX_FADV_NOREUSE* = cint(5) + FE_DIVBYZERO* = cint(4) + FE_INEXACT* = cint(32) + FE_INVALID* = cint(1) + FE_OVERFLOW* = cint(8) + FE_UNDERFLOW* = cint(16) + FE_ALL_EXCEPT* = cint(61) + FE_DOWNWARD* = cint(1024) + FE_TONEAREST* = cint(0) + FE_TOWARDZERO* = cint(3072) + FE_UPWARD* = cint(2048) + FE_DFL_ENV* = cast[pointer](0xffffffffffffffff) + MM_HARD* = cint(1) + MM_SOFT* = cint(2) + MM_FIRM* = cint(4) + MM_APPL* = cint(8) + MM_UTIL* = cint(16) + MM_OPSYS* = cint(32) + MM_RECOVER* = cint(64) + MM_NRECOV* = cint(128) + MM_HALT* = cint(1) + MM_ERROR* = cint(2) + MM_WARNING* = cint(3) + MM_INFO* = cint(4) + MM_NOSEV* = cint(0) + MM_PRINT* = cint(256) + MM_CONSOLE* = cint(512) + MM_OK* = cint(0) + MM_NOTOK* = cint(-1) + MM_NOMSG* = cint(1) + MM_NOCON* = cint(4) + FNM_NOMATCH* = cint(1) + FNM_PATHNAME* = cint(1) + FNM_PERIOD* = cint(4) + FNM_NOESCAPE* = cint(2) + FTW_F* = cint(0) + FTW_D* = cint(1) + FTW_DNR* = cint(2) + FTW_NS* = cint(3) + FTW_SL* = cint(4) + GLOB_APPEND* = cint(32) + GLOB_DOOFFS* = cint(8) + GLOB_ERR* = cint(1) + GLOB_MARK* = cint(2) + GLOB_NOCHECK* = cint(16) + GLOB_NOESCAPE* = cint(64) + GLOB_NOSORT* = cint(4) + GLOB_ABORTED* = cint(2) + GLOB_NOMATCH* = cint(3) + GLOB_NOSPACE* = cint(1) + GLOB_NOSYS* = cint(4) + CODESET* = cint(14) + D_T_FMT* = cint(131112) + D_FMT* = cint(131113) + T_FMT* = cint(131114) + T_FMT_AMPM* = cint(131115) + AM_STR* = cint(131110) + PM_STR* = cint(131111) + DAY_1* = cint(131079) + DAY_2* = cint(131080) + DAY_3* = cint(131081) + DAY_4* = cint(131082) + DAY_5* = cint(131083) + DAY_6* = cint(131084) + DAY_7* = cint(131085) + ABDAY_1* = cint(131072) + ABDAY_2* = cint(131073) + ABDAY_3* = cint(131074) + ABDAY_4* = cint(131075) + ABDAY_5* = cint(131076) + ABDAY_6* = cint(131077) + ABDAY_7* = cint(131078) + MON_1* = cint(131098) + MON_2* = cint(131099) + MON_3* = cint(131100) + MON_4* = cint(131101) + MON_5* = cint(131102) + MON_6* = cint(131103) + MON_7* = cint(131104) + MON_8* = cint(131105) + MON_9* = cint(131106) + MON_10* = cint(131107) + MON_11* = cint(131108) + MON_12* = cint(131109) + ABMON_1* = cint(131086) + ABMON_2* = cint(131087) + ABMON_3* = cint(131088) + ABMON_4* = cint(131089) + ABMON_5* = cint(131090) + ABMON_6* = cint(131091) + ABMON_7* = cint(131092) + ABMON_8* = cint(131093) + ABMON_9* = cint(131094) + ABMON_10* = cint(131095) + ABMON_11* = cint(131096) + ABMON_12* = cint(131097) + ERA* = cint(131116) + ERA_D_FMT* = cint(131118) + ERA_D_T_FMT* = cint(131120) + ERA_T_FMT* = cint(131121) + ALT_DIGITS* = cint(131119) + RADIXCHAR* = cint(65536) + THOUSEP* = cint(65537) + YESEXPR* = cint(327680) + NOEXPR* = cint(327681) + CRNCYSTR* = cint(262159) + LC_ALL* = cint(6) + LC_COLLATE* = cint(3) + LC_CTYPE* = cint(0) + LC_MESSAGES* = cint(5) + LC_MONETARY* = cint(4) + LC_NUMERIC* = cint(1) + LC_TIME* = cint(2) + PTHREAD_BARRIER_SERIAL_THREAD* = cint(-1) + PTHREAD_CANCEL_ASYNCHRONOUS* = cint(1) + PTHREAD_CANCEL_ENABLE* = cint(0) + PTHREAD_CANCEL_DEFERRED* = cint(0) + PTHREAD_CANCEL_DISABLE* = cint(1) + PTHREAD_CREATE_DETACHED* = cint(1) + PTHREAD_CREATE_JOINABLE* = cint(0) + PTHREAD_EXPLICIT_SCHED* = cint(1) + PTHREAD_INHERIT_SCHED* = cint(0) + PTHREAD_PROCESS_SHARED* = cint(1) + PTHREAD_PROCESS_PRIVATE* = cint(0) + PTHREAD_SCOPE_PROCESS* = cint(1) + PTHREAD_SCOPE_SYSTEM* = cint(0) + POSIX_ASYNC_IO* = cint(1) + F_OK* = cint(0) + R_OK* = cint(4) + W_OK* = cint(2) + X_OK* = cint(1) + CS_PATH* = cint(0) + CS_POSIX_V6_ILP32_OFF32_CFLAGS* = cint(1116) + CS_POSIX_V6_ILP32_OFF32_LDFLAGS* = cint(1117) + CS_POSIX_V6_ILP32_OFF32_LIBS* = cint(1118) + CS_POSIX_V6_ILP32_OFFBIG_CFLAGS* = cint(1120) + CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS* = cint(1121) + CS_POSIX_V6_ILP32_OFFBIG_LIBS* = cint(1122) + CS_POSIX_V6_LP64_OFF64_CFLAGS* = cint(1124) + CS_POSIX_V6_LP64_OFF64_LDFLAGS* = cint(1125) + CS_POSIX_V6_LP64_OFF64_LIBS* = cint(1126) + CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS* = cint(1128) + CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS* = cint(1129) + CS_POSIX_V6_LPBIG_OFFBIG_LIBS* = cint(1130) + CS_POSIX_V6_WIDTH_RESTRICTED_ENVS* = cint(1) + F_LOCK* = cint(1) + F_TEST* = cint(3) + F_TLOCK* = cint(2) + F_ULOCK* = cint(0) + PC_2_SYMLINKS* = cint(20) + PC_ALLOC_SIZE_MIN* = cint(18) + PC_ASYNC_IO* = cint(10) + PC_CHOWN_RESTRICTED* = cint(6) + PC_FILESIZEBITS* = cint(13) + PC_LINK_MAX* = cint(0) + PC_MAX_CANON* = cint(1) + PC_MAX_INPUT* = cint(2) + PC_NAME_MAX* = cint(3) + PC_NO_TRUNC* = cint(7) + PC_PATH_MAX* = cint(4) + PC_PIPE_BUF* = cint(5) + PC_PRIO_IO* = cint(11) + PC_REC_INCR_XFER_SIZE* = cint(14) + PC_REC_MIN_XFER_SIZE* = cint(16) + PC_REC_XFER_ALIGN* = cint(17) + PC_SYMLINK_MAX* = cint(19) + PC_SYNC_IO* = cint(9) + PC_VDISABLE* = cint(8) + SC_2_C_BIND* = cint(47) + SC_2_C_DEV* = cint(48) + SC_2_CHAR_TERM* = cint(95) + SC_2_FORT_DEV* = cint(49) + SC_2_FORT_RUN* = cint(50) + SC_2_LOCALEDEF* = cint(52) + SC_2_PBS* = cint(168) + SC_2_PBS_ACCOUNTING* = cint(169) + SC_2_PBS_CHECKPOINT* = cint(175) + SC_2_PBS_LOCATE* = cint(170) + SC_2_PBS_MESSAGE* = cint(171) + SC_2_PBS_TRACK* = cint(172) + SC_2_SW_DEV* = cint(51) + SC_2_UPE* = cint(97) + SC_2_VERSION* = cint(46) + SC_ADVISORY_INFO* = cint(132) + SC_AIO_LISTIO_MAX* = cint(23) + SC_AIO_MAX* = cint(24) + SC_AIO_PRIO_DELTA_MAX* = cint(25) + SC_ARG_MAX* = cint(0) + SC_ASYNCHRONOUS_IO* = cint(12) + SC_ATEXIT_MAX* = cint(87) + SC_BARRIERS* = cint(133) + SC_BC_BASE_MAX* = cint(36) + SC_BC_DIM_MAX* = cint(37) + SC_BC_SCALE_MAX* = cint(38) + SC_BC_STRING_MAX* = cint(39) + SC_CHILD_MAX* = cint(1) + SC_CLK_TCK* = cint(2) + SC_CLOCK_SELECTION* = cint(137) + SC_COLL_WEIGHTS_MAX* = cint(40) + SC_CPUTIME* = cint(138) + SC_DELAYTIMER_MAX* = cint(26) + SC_EXPR_NEST_MAX* = cint(42) + SC_FSYNC* = cint(15) + SC_GETGR_R_SIZE_MAX* = cint(69) + SC_GETPW_R_SIZE_MAX* = cint(70) + SC_HOST_NAME_MAX* = cint(180) + SC_IOV_MAX* = cint(60) + SC_IPV6* = cint(235) + SC_JOB_CONTROL* = cint(7) + SC_LINE_MAX* = cint(43) + SC_LOGIN_NAME_MAX* = cint(71) + SC_MAPPED_FILES* = cint(16) + SC_MEMLOCK* = cint(17) + SC_MEMLOCK_RANGE* = cint(18) + SC_MEMORY_PROTECTION* = cint(19) + SC_MESSAGE_PASSING* = cint(20) + SC_MONOTONIC_CLOCK* = cint(149) + SC_MQ_OPEN_MAX* = cint(27) + SC_MQ_PRIO_MAX* = cint(28) + SC_NGROUPS_MAX* = cint(3) + SC_OPEN_MAX* = cint(4) + SC_PAGE_SIZE* = cint(30) + SC_PRIORITIZED_IO* = cint(13) + SC_PRIORITY_SCHEDULING* = cint(10) + SC_RAW_SOCKETS* = cint(236) + SC_RE_DUP_MAX* = cint(44) + SC_READER_WRITER_LOCKS* = cint(153) + SC_REALTIME_SIGNALS* = cint(9) + SC_REGEXP* = cint(155) + SC_RTSIG_MAX* = cint(31) + SC_SAVED_IDS* = cint(8) + SC_SEM_NSEMS_MAX* = cint(32) + SC_SEM_VALUE_MAX* = cint(33) + SC_SEMAPHORES* = cint(21) + SC_SHARED_MEMORY_OBJECTS* = cint(22) + SC_SHELL* = cint(157) + SC_SIGQUEUE_MAX* = cint(34) + SC_SPAWN* = cint(159) + SC_SPIN_LOCKS* = cint(154) + SC_SPORADIC_SERVER* = cint(160) + SC_SS_REPL_MAX* = cint(241) + SC_STREAM_MAX* = cint(5) + SC_SYMLOOP_MAX* = cint(173) + SC_SYNCHRONIZED_IO* = cint(14) + SC_THREAD_ATTR_STACKADDR* = cint(77) + SC_THREAD_ATTR_STACKSIZE* = cint(78) + SC_THREAD_CPUTIME* = cint(139) + SC_THREAD_DESTRUCTOR_ITERATIONS* = cint(73) + SC_THREAD_KEYS_MAX* = cint(74) + SC_THREAD_PRIO_INHERIT* = cint(80) + SC_THREAD_PRIO_PROTECT* = cint(81) + SC_THREAD_PRIORITY_SCHEDULING* = cint(79) + SC_THREAD_PROCESS_SHARED* = cint(82) + SC_THREAD_SAFE_FUNCTIONS* = cint(68) + SC_THREAD_SPORADIC_SERVER* = cint(161) + SC_THREAD_STACK_MIN* = cint(75) + SC_THREAD_THREADS_MAX* = cint(76) + SC_THREADS* = cint(67) + SC_TIMEOUTS* = cint(164) + SC_TIMER_MAX* = cint(35) + SC_TIMERS* = cint(11) + SC_TRACE* = cint(181) + SC_TRACE_EVENT_FILTER* = cint(182) + SC_TRACE_EVENT_NAME_MAX* = cint(242) + SC_TRACE_INHERIT* = cint(183) + SC_TRACE_LOG* = cint(184) + SC_TRACE_NAME_MAX* = cint(243) + SC_TRACE_SYS_MAX* = cint(244) + SC_TRACE_USER_EVENT_MAX* = cint(245) + SC_TTY_NAME_MAX* = cint(72) + SC_TYPED_MEMORY_OBJECTS* = cint(165) + SC_TZNAME_MAX* = cint(6) + SC_V6_ILP32_OFF32* = cint(176) + SC_V6_ILP32_OFFBIG* = cint(177) + SC_V6_LP64_OFF64* = cint(178) + SC_V6_LPBIG_OFFBIG* = cint(179) + SC_VERSION* = cint(29) + SC_XBS5_ILP32_OFF32* = cint(125) + SC_XBS5_ILP32_OFFBIG* = cint(126) + SC_XBS5_LP64_OFF64* = cint(127) + SC_XBS5_LPBIG_OFFBIG* = cint(128) + SC_XOPEN_CRYPT* = cint(92) + SC_XOPEN_ENH_I18N* = cint(93) + SC_XOPEN_LEGACY* = cint(129) + SC_XOPEN_REALTIME* = cint(130) + SC_XOPEN_REALTIME_THREADS* = cint(131) + SC_XOPEN_SHM* = cint(94) + SC_XOPEN_STREAMS* = cint(246) + SC_XOPEN_UNIX* = cint(91) + SC_XOPEN_VERSION* = cint(89) + SEEK_SET* = cint(0) + SEEK_CUR* = cint(1) + SEEK_END* = cint(2) + SEM_FAILED* = cast[pointer]((nil)) + IPC_CREAT* = cint(512) + IPC_EXCL* = cint(1024) + IPC_NOWAIT* = cint(2048) + IPC_PRIVATE* = cint(0) + IPC_RMID* = cint(0) + IPC_SET* = cint(1) + IPC_STAT* = cint(2) + S_IFMT* = cint(61440) + S_IFBLK* = cint(24576) + S_IFCHR* = cint(8192) + S_IFIFO* = cint(4096) + S_IFREG* = cint(32768) + S_IFDIR* = cint(16384) + S_IFLNK* = cint(40960) + S_IFSOCK* = cint(49152) + S_IRWXU* = cint(448) + S_IRUSR* = cint(256) + S_IWUSR* = cint(128) + S_IXUSR* = cint(64) + S_IRWXG* = cint(56) + S_IRGRP* = cint(32) + S_IWGRP* = cint(16) + S_IXGRP* = cint(8) + S_IRWXO* = cint(7) + S_IROTH* = cint(4) + S_IWOTH* = cint(2) + S_IXOTH* = cint(1) + S_ISUID* = cint(2048) + S_ISGID* = cint(1024) + S_ISVTX* = cint(512) + ST_RDONLY* = cint(1) + ST_NOSUID* = cint(2) + PROT_READ* = cint(1) + PROT_WRITE* = cint(2) + PROT_EXEC* = cint(4) + PROT_NONE* = cint(0) + MAP_SHARED* = cint(1) + MAP_PRIVATE* = cint(2) + MAP_FIXED* = cint(16) + MS_ASYNC* = cint(1) + MS_SYNC* = cint(4) + MS_INVALIDATE* = cint(2) + MCL_CURRENT* = cint(1) + MCL_FUTURE* = cint(2) + MAP_FAILED* = cast[pointer](0xffffffffffffffff) + POSIX_MADV_NORMAL* = cint(0) + POSIX_MADV_SEQUENTIAL* = cint(2) + POSIX_MADV_RANDOM* = cint(1) + POSIX_MADV_WILLNEED* = cint(3) + POSIX_MADV_DONTNEED* = cint(4) + CLOCKS_PER_SEC* = clong(1000000) + CLOCK_PROCESS_CPUTIME_ID* = cint(2) + CLOCK_THREAD_CPUTIME_ID* = cint(3) + CLOCK_REALTIME* = cint(0) + TIMER_ABSTIME* = cint(1) + CLOCK_MONOTONIC* = cint(1) + WNOHANG* = cint(1) + WUNTRACED* = cint(2) + WEXITED* = cint(4) + WSTOPPED* = cint(2) + WCONTINUED* = cint(8) + WNOWAIT* = cint(16777216) + SIGEV_NONE* = cint(1) + SIGEV_SIGNAL* = cint(0) + SIGEV_THREAD* = cint(2) + SIGABRT* = cint(6) + SIGALRM* = cint(14) + SIGBUS* = cint(7) + SIGCHLD* = cint(17) + SIGCONT* = cint(18) + SIGFPE* = cint(8) + SIGHUP* = cint(1) + SIGILL* = cint(4) + SIGINT* = cint(2) + SIGKILL* = cint(9) + SIGPIPE* = cint(13) + SIGQUIT* = cint(3) + SIGSEGV* = cint(11) + SIGSTOP* = cint(19) + SIGTERM* = cint(15) + SIGTSTP* = cint(20) + SIGTTIN* = cint(21) + SIGTTOU* = cint(22) + SIGUSR1* = cint(10) + SIGUSR2* = cint(12) + SIGPOLL* = cint(29) + SIGPROF* = cint(27) + SIGSYS* = cint(31) + SIGTRAP* = cint(5) + SIGURG* = cint(23) + SIGVTALRM* = cint(26) + SIGXCPU* = cint(24) + SIGXFSZ* = cint(25) + SA_NOCLDSTOP* = cint(1) + SIG_BLOCK* = cint(0) + SIG_UNBLOCK* = cint(1) + SIG_SETMASK* = cint(2) + SA_ONSTACK* = cint(134217728) + SA_RESETHAND* = cint(-2147483648) + SA_RESTART* = cint(268435456) + SA_SIGINFO* = cint(4) + SA_NOCLDWAIT* = cint(2) + SA_NODEFER* = cint(1073741824) + SS_ONSTACK* = cint(1) + SS_DISABLE* = cint(2) + MINSIGSTKSZ* = cint(2048) + SIGSTKSZ* = cint(8192) + NL_SETD* = cint(1) + NL_CAT_LOCALE* = cint(1) + SCHED_FIFO* = cint(1) + SCHED_RR* = cint(2) + SCHED_OTHER* = cint(0) + FD_SETSIZE* = cint(1024) + IF_NAMESIZE* = cint(16) + SCM_RIGHTS* = cint(1) + SOCK_DGRAM* = cint(2) + SOCK_RAW* = cint(3) + SOCK_SEQPACKET* = cint(5) + SOCK_STREAM* = cint(1) + SOL_SOCKET* = cint(1) + SO_ACCEPTCONN* = cint(30) + SO_BROADCAST* = cint(6) + SO_DEBUG* = cint(1) + SO_DONTROUTE* = cint(5) + SO_ERROR* = cint(4) + SO_KEEPALIVE* = cint(9) + SO_LINGER* = cint(13) + SO_OOBINLINE* = cint(10) + SO_RCVBUF* = cint(8) + SO_RCVLOWAT* = cint(18) + SO_RCVTIMEO* = cint(20) + SO_REUSEADDR* = cint(2) + SO_SNDBUF* = cint(7) + SO_SNDLOWAT* = cint(19) + SO_SNDTIMEO* = cint(21) + SO_TYPE* = cint(3) + SOMAXCONN* = cint(128) + MSG_CTRUNC* = cint(8) + MSG_DONTROUTE* = cint(4) + MSG_EOR* = cint(128) + MSG_OOB* = cint(1) + MSG_PEEK* = cint(2) + MSG_TRUNC* = cint(32) + MSG_WAITALL* = cint(256) + AF_INET* = cint(2) + AF_INET6* = cint(10) + AF_UNIX* = cint(1) + AF_UNSPEC* = cint(0) + SHUT_RD* = cint(0) + SHUT_RDWR* = cint(2) + SHUT_WR* = cint(1) + IPPROTO_IP* = cint(0) + IPPROTO_IPV6* = cint(41) + IPPROTO_ICMP* = cint(1) + IPPROTO_RAW* = cint(255) + IPPROTO_TCP* = cint(6) + IPPROTO_UDP* = cint(17) + INADDR_ANY* = cint(0) + INADDR_BROADCAST* = cint(-1) + INET_ADDRSTRLEN* = cint(16) + IPV6_JOIN_GROUP* = cint(20) + IPV6_LEAVE_GROUP* = cint(21) + IPV6_MULTICAST_HOPS* = cint(18) + IPV6_MULTICAST_IF* = cint(17) + IPV6_MULTICAST_LOOP* = cint(19) + IPV6_UNICAST_HOPS* = cint(16) + IPV6_V6ONLY* = cint(26) + IPPORT_RESERVED* = cint(1024) + HOST_NOT_FOUND* = cint(1) + NO_DATA* = cint(4) + NO_RECOVERY* = cint(3) + TRY_AGAIN* = cint(2) + AI_PASSIVE* = cint(1) + AI_CANONNAME* = cint(2) + AI_NUMERICHOST* = cint(4) + AI_NUMERICSERV* = cint(1024) + AI_V4MAPPED* = cint(8) + AI_ALL* = cint(16) + AI_ADDRCONFIG* = cint(32) + NI_NOFQDN* = cint(4) + NI_NUMERICHOST* = cint(1) + NI_NAMEREQD* = cint(8) + NI_NUMERICSERV* = cint(2) + NI_DGRAM* = cint(16) + EAI_AGAIN* = cint(-3) + EAI_BADFLAGS* = cint(-1) + EAI_FAIL* = cint(-4) + EAI_FAMILY* = cint(-6) + EAI_MEMORY* = cint(-10) + EAI_NONAME* = cint(-2) + EAI_SERVICE* = cint(-8) + EAI_SOCKTYPE* = cint(-7) + EAI_SYSTEM* = cint(-11) + EAI_OVERFLOW* = cint(-12) + POLLIN* = cshort(1) + POLLRDNORM* = cshort(64) + POLLRDBAND* = cshort(128) + POLLPRI* = cshort(2) + POLLOUT* = cshort(4) + POLLWRNORM* = cshort(256) + POLLWRBAND* = cshort(512) + POLLERR* = cshort(8) + POLLHUP* = cshort(16) + POLLNVAL* = cshort(32) + POSIX_SPAWN_RESETIDS* = cint(1) + POSIX_SPAWN_SETPGROUP* = cint(2) + POSIX_SPAWN_SETSCHEDPARAM* = cint(16) + POSIX_SPAWN_SETSCHEDULER* = cint(32) + POSIX_SPAWN_SETSIGDEF* = cint(4) + POSIX_SPAWN_SETSIGMASK* = cint(8) + IOFBF* = cint(0) + IONBF* = cint(2) From 4d01408a4643a482af59c620add2a9e59f45c8f4 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Tue, 24 Dec 2013 16:42:24 +0100 Subject: [PATCH 138/326] bootstraps with new template symbol binding rules --- compiler/semtempl.nim | 16 ++++++++-------- lib/system/ansi_c.nim | 22 +++++++++++----------- lib/system/sysio.nim | 2 +- todo.txt | 1 - 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index e6e43944b4..0c7c2eff4b 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -359,6 +359,8 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = return symChoice(c.c, n, s, scClosed) elif Contains(c.toMixin, s.name.id): return symChoice(c.c, n, s, scForceOpen) + else: + return symChoice(c.c, n, s, scOpen) result = n for i in countup(0, sonsLen(n) - 1): result.sons[i] = semTemplBody(c, n.sons[i]) @@ -399,7 +401,7 @@ proc transformToExpr(n: PNode): PNode = for i in countup(0, sonsLen(n) - 1): case n.sons[i].kind of nkCommentStmt, nkEmpty, nkNilLit: - nil + discard else: if realStmt == - 1: realStmt = i else: realStmt = - 2 @@ -409,7 +411,7 @@ proc transformToExpr(n: PNode): PNode = n.kind = nkBlockExpr #nkIfStmt: n.kind = nkIfExpr // this is not correct! else: - nil + discard proc semTemplateDef(c: PContext, n: PNode): PNode = var s: PSym @@ -476,8 +478,6 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = SymTabReplace(c.currentScope.symbols, proto, s) if n.sons[patternPos].kind != nkEmpty: c.patterns.add(s) - #if s.name.s == "move": - # echo renderTree(result) proc semPatternBody(c: var TemplCtx, n: PNode): PNode = template templToExpand(s: expr): expr = @@ -522,7 +522,7 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = result = handleSym(c, n, s) of nkBindStmt: result = semBindStmt(c.c, n, c.toBind) - of nkEmpty, nkSym..nkNilLit: nil + of nkEmpty, nkSym..nkNilLit: discard of nkCurlyExpr: # we support '(pattern){x}' to bind a subpattern to a parameter 'x'; # '(pattern){|x}' does the same but the matches will be gathered in 'x' @@ -543,8 +543,8 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = of nkCallKinds: let s = QualifiedLookUp(c.c, n.sons[0], {}) if s != nil: - if s.owner == c.owner and s.kind == skParam: nil - elif Contains(c.toBind, s.id): nil + if s.owner == c.owner and s.kind == skParam: discard + elif Contains(c.toBind, s.id): discard elif templToExpand(s): return semPatternBody(c, semTemplateExpr(c.c, n, s, false)) @@ -588,7 +588,7 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = return newIdentNode(s.name, n.info) of nkPar: if n.len == 1: return semPatternBody(c, n.sons[0]) - else: nil + else: discard for i in countup(0, sonsLen(n) - 1): result.sons[i] = semPatternBody(c, n.sons[i]) diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim index 398656d0a3..064597df69 100644 --- a/lib/system/ansi_c.nim +++ b/lib/system/ansi_c.nim @@ -13,12 +13,12 @@ {.push hints:off} -proc c_strcmp(a, b: CString): cint {.header: "<string.h>", +proc c_strcmp(a, b: cstring): cint {.header: "<string.h>", noSideEffect, importc: "strcmp".} -proc c_memcmp(a, b: CString, size: int): cint {.header: "<string.h>", +proc c_memcmp(a, b: cstring, size: int): cint {.header: "<string.h>", noSideEffect, importc: "memcmp".} -proc c_memcpy(a, b: CString, size: int) {.header: "<string.h>", importc: "memcpy".} -proc c_strlen(a: CString): int {.header: "<string.h>", +proc c_memcpy(a, b: cstring, size: int) {.header: "<string.h>", importc: "memcpy".} +proc c_strlen(a: cstring): int {.header: "<string.h>", noSideEffect, importc: "strlen".} proc c_memset(p: pointer, value: cint, size: int) {. header: "<string.h>", importc: "memset".} @@ -49,7 +49,7 @@ when not defined(SIGINT): SIGINT = cint(2) SIGSEGV = cint(11) SIGTERM = cint(15) - elif defined(macosx): + elif defined(macosx) or defined(linux): const SIGABRT = cint(6) SIGFPE = cint(8) @@ -92,27 +92,27 @@ proc c_fgetc(stream: C_TextFileStar): int {.importc: "fgetc", header: "<stdio.h>".} proc c_ungetc(c: int, f: C_TextFileStar) {.importc: "ungetc", header: "<stdio.h>".} -proc c_putc(c: Char, stream: C_TextFileStar) {.importc: "putc", +proc c_putc(c: char, stream: C_TextFileStar) {.importc: "putc", header: "<stdio.h>".} -proc c_fprintf(f: C_TextFileStar, frmt: CString) {. +proc c_fprintf(f: C_TextFileStar, frmt: cstring) {. importc: "fprintf", header: "<stdio.h>", varargs.} -proc c_printf(frmt: CString) {. +proc c_printf(frmt: cstring) {. importc: "printf", header: "<stdio.h>", varargs.} proc c_fopen(filename, mode: cstring): C_TextFileStar {. importc: "fopen", header: "<stdio.h>".} proc c_fclose(f: C_TextFileStar) {.importc: "fclose", header: "<stdio.h>".} -proc c_sprintf(buf, frmt: CString) {.header: "<stdio.h>", +proc c_sprintf(buf, frmt: cstring) {.header: "<stdio.h>", importc: "sprintf", varargs, noSideEffect.} # 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 {. +proc c_fread(buf: pointer, size, n: int, f: C_BinaryFileStar): int {. importc: "fread", header: "<stdio.h>".} proc c_fseek(f: C_BinaryFileStar, offset: clong, whence: int): int {. importc: "fseek", header: "<stdio.h>".} -proc c_fwrite(buf: Pointer, size, n: int, f: C_BinaryFileStar): int {. +proc c_fwrite(buf: pointer, size, n: int, f: C_BinaryFileStar): int {. importc: "fwrite", header: "<stdio.h>".} proc c_exit(errorcode: cint) {.importc: "exit", header: "<stdlib.h>".} diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 8d9400a7de..41dbcd817e 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -50,7 +50,7 @@ when NoFakeVars: const IOFBF = cint(0) IONBF = cint(4) - elif defined(macosx): + elif defined(macosx) or defined(linux): const IOFBF = cint(0) IONBF = cint(2) diff --git a/todo.txt b/todo.txt index 160d8514c0..5aaa15a4d9 100644 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,6 @@ version 0.9.4 ============= -- make new templating symbol binding rules work - document new templating symbol binding rules - convert all with "nimrod pretty" - make '--implicitStatic:on' the default From 952dbc4b8fd41bdf0f6b587147f62d8d15a95751 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Wed, 25 Dec 2013 00:01:12 +0200 Subject: [PATCH 139/326] documented static params --- compiler/semtypes.nim | 2 ++ doc/manual.txt | 54 +++++++++++++++++++++++++++++++++++++++++++ lib/system.nim | 10 ++++++++ 3 files changed, 66 insertions(+) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index d4d9537571..85928ee751 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -684,6 +684,8 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, result.sons.setLen(result.sons.len - 1) of tyTypeClass: result = addImplicitGeneric(copyType(paramType, getCurrOwner(), false)) + of tyExpr: + result = addImplicitGeneric(newTypeS(tyGenericParam, c)) else: nil # result = liftingWalk(paramType) diff --git a/doc/manual.txt b/doc/manual.txt index dabff3d69d..dca43ecbb3 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -3827,6 +3827,60 @@ This is a simple syntactic transformation into: Special Types ============= +static[T] +--------- + +As their name suggests, static params must be known at compile-time: + +.. code-block:: nimrod + + proc precompiledRegex(pattern: static[string]): TRegEx = + var res {.global.} = re(pattern) + return res + + precompiledRegex("/d+") # Replaces the call with a precompiled + # regex, stored in a global variable + + precompiledRegex(paramStr(1)) # Error, command-line options + # are not known at compile-time + + +For the purposes of code generation, all static params are treated as +generic params - the proc will be compiled separately for each unique +supplied value (or combination of values). + +Furthermore, the system module defines a `semistatic[T]` type than can be +used to declare procs accepting both static and run-time values, which can +optimize their body according to the supplied param using the `isStatic(p)` +predicate: + +.. code-block:: nimrod + + # The following proc will be compiled once for each unique static + # value and also once for the case handling all run-time values: + + proc re(pattern: semistatic[string]): TRegEx = + when isStatic(pattern): + return precompiledRegex(pattern) + else: + return compile(pattern) + +Static params can also appear in the signatures of generic types: + +.. code-block:: nimrod + + type + Matrix[M,N: static[int]; T: Number] = array[0..(M*N - 1), T] + # Please, note how `Number` is just a type constraint here, while + # `static[int]` requires us to supply a compile-time int value + + AffineTransform2D[T] = Matrix[3, 3, T] + AffineTransform3D[T] = Matrix[4, 4, T] + + AffineTransform3D[float] # OK + AffineTransform2D[string] # Error, `string` is not a `Number` + + typedesc -------- diff --git a/lib/system.nim b/lib/system.nim index e58378c05b..d45137b9eb 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2675,3 +2675,13 @@ proc locals*(): TObject {.magic: "Locals", noSideEffect.} = ## the official signature says, the return type is not ``TObject`` but a ## tuple of a structure that depends on the current scope. nil + +when not defined(booting): + type + semistatic*[T] = static[T] | T + # indicates a param of proc specialized for each static value, + # but also accepting run-time values + + template isStatic*(x): expr = compiles(static(x)) + # checks whether `x` is a value known at compile-time + From 299cefdc984ef756ffb8dabb4e961a8d2505104f Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Wed, 25 Dec 2013 00:58:22 +0200 Subject: [PATCH 140/326] make the current PContext accessible through TCandidate the goal here is to remove all the hacks from ParamTypeMatch and to handle all type matching in typeRel (the context there is required to evaluate any static params and to run the compilation tests of user-defined type classes) --- compiler/semcall.nim | 20 +++++++-------- compiler/semexprs.nim | 16 ++++++------ compiler/semtypes.nim | 2 +- compiler/sigmatch.nim | 59 ++++++++++++++++++++++++------------------- compiler/suggest.nim | 2 +- 5 files changed, 53 insertions(+), 46 deletions(-) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 9e9614796d..0880f5fdef 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -47,14 +47,14 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode, var z: TCandidate if sym == nil: return - initCandidate(best, sym, initialBinding, symScope) - initCandidate(alt, sym, initialBinding, symScope) + initCandidate(c, best, sym, initialBinding, symScope) + initCandidate(c, alt, sym, initialBinding, symScope) best.state = csNoMatch while sym != nil: if sym.kind in filter: determineType(c, sym) - initCandidate(z, sym, initialBinding, o.lastOverloadScope) + initCandidate(c, z, sym, initialBinding, o.lastOverloadScope) z.calleeSym = sym matches(c, n, orig, z) if errors != nil: @@ -199,15 +199,15 @@ proc instGenericConvertersSons*(c: PContext, n: PNode, x: TCandidate) = proc IndexTypesMatch(c: PContext, f, a: PType, arg: PNode): PNode = var m: TCandidate - initCandidate(m, f) - result = paramTypesMatch(c, m, f, a, arg, nil) + initCandidate(c, m, f) + result = paramTypesMatch(m, f, a, arg, nil) if m.genericConverter and result != nil: instGenericConvertersArg(c, result, m) proc ConvertTo*(c: PContext, f: PType, n: PNode): PNode = var m: TCandidate - initCandidate(m, f) - result = paramTypesMatch(c, m, f, n.typ, n, nil) + initCandidate(c, m, f) + result = paramTypesMatch(m, f, n.typ, n, nil) if m.genericConverter and result != nil: instGenericConvertersArg(c, result, m) @@ -243,9 +243,9 @@ proc explicitGenericInstError(n: PNode): PNode = result = n proc explicitGenericSym(c: PContext, n: PNode, s: PSym): PNode = - var x: TCandidate - initCandidate(x, s, n) - var newInst = generateInstance(c, s, x.bindings, n.info) + var m: TCandidate + initCandidate(c, m, s, n) + var newInst = generateInstance(c, s, m.bindings, n.info) markUsed(n, s) result = newSymNode(newInst, n.info) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index a7fd1eaa08..67373c3032 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -142,7 +142,7 @@ proc checkConversionBetweenObjects(castDest, src: PType): TConvStatus = const IntegralTypes = {tyBool, tyEnum, tyChar, tyInt..tyUInt64} -proc checkConvertible(castDest, src: PType): TConvStatus = +proc checkConvertible(c: PContext, castDest, src: PType): TConvStatus = result = convOK if sameType(castDest, src) and castDest.sym == src.sym: # don't annoy conversions that may be needed on another processor: @@ -163,7 +163,7 @@ proc checkConvertible(castDest, src: PType): TConvStatus = # accept conversion between integral types else: # we use d, s here to speed up that operation a bit: - case cmpTypes(d, s) + case cmpTypes(c, d, s) of isNone, isGeneric: if not compareTypes(castDest, src, dcEqIgnoreDistinct): result = convNotLegal @@ -202,7 +202,7 @@ proc semConv(c: PContext, n: PNode): PNode = var op = result.sons[1] if not isSymChoice(op): - let status = checkConvertible(result.typ, op.typ) + let status = checkConvertible(c, result.typ, op.typ) case status of convOK: nil of convNotNeedeed: @@ -213,7 +213,7 @@ proc semConv(c: PContext, n: PNode): PNode = else: for i in countup(0, sonsLen(op) - 1): let it = op.sons[i] - let status = checkConvertible(result.typ, it.typ) + let status = checkConvertible(c, result.typ, it.typ) if status == convOK: markUsed(n, it.sym) markIndirect(c, it.sym) @@ -324,15 +324,15 @@ proc isOpImpl(c: PContext, n: PNode): PNode = case t2.kind of tyTypeClasses: var m: TCandidate - InitCandidate(m, t2) + InitCandidate(c, m, t2) match = matchUserTypeClass(c, m, emptyNode, t2, t1) != nil of tyOrdinal: var m: TCandidate - InitCandidate(m, t2) + InitCandidate(c, m, t2) match = isOrdinalType(t1) of tySequence, tyArray, tySet: var m: TCandidate - InitCandidate(m, t2) + InitCandidate(c, m, t2) match = typeRel(m, t2, t1) != isNone else: match = sameType(t1, t2) @@ -707,7 +707,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = if t != nil and t.kind == tyProc: # This is a proc variable, apply normal overload resolution var m: TCandidate - initCandidate(m, t) + initCandidate(c, m, t) matches(c, n, nOrig, m) if m.state != csMatch: if c.inCompilesContext > 0: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 85928ee751..7e76e950b6 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -838,7 +838,7 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = else: internalAssert s.typ.kind == tyGenericBody - var m = newCandidate(s, n) + var m = newCandidate(c, s, n) matches(c, n, copyTree(n), m) if m.state != csMatch: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 87f1decf48..42eefec5a2 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -21,7 +21,8 @@ type TCandidateState* = enum csEmpty, csMatch, csNoMatch - TCandidate* {.final.} = object + TCandidate* {.final.} = object + c*: PContext exactMatches*: int # also misused to prefer iters over procs genericMatches: int # also misused to prefer constraints subtypeMatches: int @@ -58,7 +59,9 @@ const proc markUsed*(n: PNode, s: PSym) -proc initCandidateAux(c: var TCandidate, callee: PType) {.inline.} = +proc initCandidateAux(ctx: PContext, + c: var TCandidate, callee: PType) {.inline.} = + c.c = ctx c.exactMatches = 0 c.subtypeMatches = 0 c.convMatches = 0 @@ -71,17 +74,17 @@ proc initCandidateAux(c: var TCandidate, callee: PType) {.inline.} = c.genericConverter = false c.inheritancePenalty = 0 -proc initCandidate*(c: var TCandidate, callee: PType) = - initCandidateAux(c, callee) +proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PType) = + initCandidateAux(ctx, c, callee) c.calleeSym = nil initIdTable(c.bindings) proc put(t: var TIdTable, key, val: PType) {.inline.} = IdTablePut(t, key, val) -proc initCandidate*(c: var TCandidate, callee: PSym, binding: PNode, - calleeScope = -1) = - initCandidateAux(c, callee.typ) +proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PSym, + binding: PNode, calleeScope = -1) = + initCandidateAux(ctx, c, callee.typ) c.calleeSym = callee c.calleeScope = calleeScope initIdTable(c.bindings) @@ -93,10 +96,12 @@ proc initCandidate*(c: var TCandidate, callee: PSym, binding: PNode, #debug(formalTypeParam) put(c.bindings, formalTypeParam, binding[i].typ) -proc newCandidate*(callee: PSym, binding: PNode, calleeScope = -1): TCandidate = - initCandidate(result, callee, binding, calleeScope) +proc newCandidate*(ctx: PContext, callee: PSym, + binding: PNode, calleeScope = -1): TCandidate = + initCandidate(ctx, result, callee, binding, calleeScope) proc copyCandidate(a: var TCandidate, b: TCandidate) = + a.c = b.c a.exactMatches = b.exactMatches a.subtypeMatches = b.subtypeMatches a.convMatches = b.convMatches @@ -762,10 +767,10 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = result = isEqual else: internalError("typeRel: " & $f.kind) -proc cmpTypes*(f, a: PType): TTypeRelation = - var c: TCandidate - InitCandidate(c, f) - result = typeRel(c, f, a) +proc cmpTypes*(c: PContext, f, a: PType): TTypeRelation = + var m: TCandidate + InitCandidate(c, m, f) + result = typeRel(m, f, a) proc getInstantiatedType(c: PContext, arg: PNode, m: TCandidate, f: PType): PType = @@ -887,13 +892,14 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, result = arg put(m.bindings, f, a) -proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, +proc ParamTypesMatchAux(m: var TCandidate, f, argType: PType, argSemantized, argOrig: PNode): PNode = var r: TTypeRelation arg = argSemantized let + c = m.c a0 = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) else: argType a = if a0 != nil: a0.skipTypes({tyStatic}) else: a0 @@ -1007,19 +1013,20 @@ proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, else: result = userConvMatch(c, m, base(f), a, arg) -proc ParamTypesMatch*(c: PContext, m: var TCandidate, f, a: PType, +proc ParamTypesMatch*(m: var TCandidate, f, a: PType, arg, argOrig: PNode): PNode = if arg == nil or arg.kind notin nkSymChoices: - result = ParamTypesMatchAux(c, m, f, a, arg, argOrig) + result = ParamTypesMatchAux(m, f, a, arg, argOrig) else: # CAUTION: The order depends on the used hashing scheme. Thus it is # incorrect to simply use the first fitting match. However, to implement # this correctly is inefficient. We have to copy `m` here to be able to # roll back the side effects of the unification algorithm. + let c = m.c var x, y, z: TCandidate - initCandidate(x, m.callee) - initCandidate(y, m.callee) - initCandidate(z, m.callee) + initCandidate(c, x, m.callee) + initCandidate(c, y, m.callee) + initCandidate(c, z, m.callee) x.calleeSym = m.calleeSym y.calleeSym = m.calleeSym z.calleeSym = m.calleeSym @@ -1051,7 +1058,7 @@ proc ParamTypesMatch*(c: PContext, m: var TCandidate, f, a: PType, else: # only one valid interpretation found: markUsed(arg, arg.sons[best].sym) - result = ParamTypesMatchAux(c, m, f, arg.sons[best].typ, arg.sons[best], + result = ParamTypesMatchAux(m, f, arg.sons[best].typ, arg.sons[best], argOrig) proc setSon(father: PNode, at: int, son: PNode) = @@ -1142,7 +1149,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode, m.baseTypeMatch = false n.sons[a].sons[1] = prepareOperand(c, formal.typ, n.sons[a].sons[1]) n.sons[a].typ = n.sons[a].sons[1].typ - var arg = ParamTypesMatch(c, m, formal.typ, n.sons[a].typ, + var arg = ParamTypesMatch(m, formal.typ, n.sons[a].typ, n.sons[a].sons[1], nOrig.sons[a].sons[1]) if arg == nil: m.state = csNoMatch @@ -1172,7 +1179,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode, elif formal != nil: m.baseTypeMatch = false n.sons[a] = prepareOperand(c, formal.typ, n.sons[a]) - var arg = ParamTypesMatch(c, m, formal.typ, n.sons[a].typ, + var arg = ParamTypesMatch(m, formal.typ, n.sons[a].typ, n.sons[a], nOrig.sons[a]) if (arg != nil) and m.baseTypeMatch and (container != nil): addSon(container, arg) @@ -1195,7 +1202,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode, return m.baseTypeMatch = false n.sons[a] = prepareOperand(c, formal.typ, n.sons[a]) - var arg = ParamTypesMatch(c, m, formal.typ, n.sons[a].typ, + var arg = ParamTypesMatch(m, formal.typ, n.sons[a].typ, n.sons[a], nOrig.sons[a]) if arg == nil: m.state = csNoMatch @@ -1249,8 +1256,8 @@ proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) = proc argtypeMatches*(c: PContext, f, a: PType): bool = var m: TCandidate - initCandidate(m, f) - let res = paramTypesMatch(c, m, f, a, ast.emptyNode, nil) + initCandidate(c, m, f) + let res = paramTypesMatch(m, f, a, ast.emptyNode, nil) #instantiateGenericConverters(c, res, m) # XXX this is used by patterns.nim too; I think it's better to not # instantiate generic converters for that @@ -1312,7 +1319,7 @@ tests: setup: var c: TCandidate - InitCandidate(c, nil) + InitCandidate(nil, c, nil) template yes(x, y) = test astToStr(x) & " is " & astToStr(y): diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 76a6c21d92..04a222db44 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -119,7 +119,7 @@ proc argsFit(c: PContext, candidate: PSym, n, nOrig: PNode): bool = case candidate.kind of OverloadableSyms: var m: TCandidate - initCandidate(m, candidate, nil) + initCandidate(c, m, candidate, nil) sigmatch.partialMatch(c, n, nOrig, m) result = m.state != csNoMatch else: From 9e92455a534956bfbb0a7ec5e6f2bdffd7268818 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Wed, 25 Dec 2013 14:53:00 +0100 Subject: [PATCH 141/326] templates can access hidden fields --- compiler/sem.nim | 32 +++++----------- doc/manual.txt | 40 ++++++++++++-------- lib/system/sysio.nim | 8 ++-- tests/templates/mcan_access_hidden_field.nim | 9 +++++ tests/templates/tcan_access_hidden_field.nim | 9 +++++ web/news.txt | 5 +++ 6 files changed, 61 insertions(+), 42 deletions(-) create mode 100644 tests/templates/mcan_access_hidden_field.nim create mode 100644 tests/templates/tcan_access_hidden_field.nim diff --git a/compiler/sem.nim b/compiler/sem.nim index ed3c0e045b..d0fc5bfe1a 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -146,29 +146,18 @@ proc semIdentWithPragma(c: PContext, kind: TSymKind, n: PNode, allowed: TSymFlags): PSym proc semStmtScope(c: PContext, n: PNode): PNode -proc ParamsTypeCheck(c: PContext, typ: PType) {.inline.} = +proc paramsTypeCheck(c: PContext, typ: PType) {.inline.} = if not typeAllowed(typ, skConst): - LocalError(typ.n.info, errXisNoType, typeToString(typ)) + localError(typ.n.info, errXisNoType, typeToString(typ)) proc expectMacroOrTemplateCall(c: PContext, n: PNode): PSym proc semTemplateExpr(c: PContext, n: PNode, s: PSym, semCheck = true): PNode proc semDirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode proc semWhen(c: PContext, n: PNode, semCheck: bool = true): PNode -proc IsOpImpl(c: PContext, n: PNode): PNode +proc isOpImpl(c: PContext, n: PNode): PNode proc semMacroExpr(c: PContext, n, nOrig: PNode, sym: PSym, semCheck: bool = true): PNode -when false: - proc symFromType(t: PType, info: TLineInfo): PSym = - if t.sym != nil: return t.sym - result = newSym(skType, getIdent"AnonType", t.owner, info) - result.flags.incl sfAnon - result.typ = t - - proc symNodeFromType(c: PContext, t: PType, info: TLineInfo): PNode = - result = newSymNode(symFromType(t, info), info) - result.typ = makeTypeDesc(c, t) - when false: proc createEvalContext(c: PContext, mode: TEvalMode): PEvalContext = result = newEvalContext(c.module, mode) @@ -184,12 +173,6 @@ when false: result.handleIsOperator = proc (n: PNode): PNode = result = IsOpImpl(c, n) - proc evalConstExpr(c: PContext, module: PSym, e: PNode): PNode = - result = evalConstExprAux(c.createEvalContext(emConst), module, nil, e) - - proc evalStaticExpr(c: PContext, module: PSym, e: PNode, prc: PSym): PNode = - result = evalConstExprAux(c.createEvalContext(emStatic), module, prc, e) - proc semConstExpr(c: PContext, n: PNode): PNode = var e = semExprWithType(c, n) if e == nil: @@ -226,7 +209,9 @@ include hlo, seminst, semcall proc semAfterMacroCall(c: PContext, n: PNode, s: PSym): PNode = inc(evalTemplateCounter) if evalTemplateCounter > 100: - GlobalError(s.info, errTemplateInstantiationTooNested) + globalError(s.info, errTemplateInstantiationTooNested) + let oldFriend = c.friendModule + c.friendModule = s.owner.getModule result = n if s.typ.sons[0] == nil: @@ -250,6 +235,7 @@ proc semAfterMacroCall(c: PContext, n: PNode, s: PSym): PNode = result = fitNode(c, s.typ.sons[0], result) #GlobalError(s.info, errInvalidParamKindX, typeToString(s.typ.sons[0])) dec(evalTemplateCounter) + c.friendModule = oldFriend proc semMacroExpr(c: PContext, n, nOrig: PNode, sym: PSym, semCheck: bool = true): PNode = @@ -316,7 +302,7 @@ proc myOpenCached(module: PSym, rd: PRodReader): PPassContext = result = myOpen(module) for m in items(rd.methods): methodDef(m, true) -proc SemStmtAndGenerateGenerics(c: PContext, n: PNode): PNode = +proc semStmtAndGenerateGenerics(c: PContext, n: PNode): PNode = result = semStmt(c, n) # BUGFIX: process newly generated generics here, not at the end! if c.lastGenericIdx < c.generics.len: @@ -331,7 +317,7 @@ proc SemStmtAndGenerateGenerics(c: PContext, n: PNode): PNode = result = buildEchoStmt(c, result) result = transformStmt(c.module, result) -proc RecoverContext(c: PContext) = +proc recoverContext(c: PContext) = # clean up in case of a semantic error: We clean up the stacks, etc. This is # faster than wrapping every stack operation in a 'try finally' block and # requires far less code. diff --git a/doc/manual.txt b/doc/manual.txt index 0a9aec8d0c..fd3db1b0da 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -1268,12 +1268,13 @@ exclude ``nil`` as a valid value with the `not nil`:idx: annotation: # compiler catches this: p(nil) - # but not this: + # and also this: var x: PObject p(x) -As shown in the example this is merely an annotation for documentation purposes; -for now the compiler can only catch the most trivial type violations. +The compiler ensures that every code path initializes variables which contain +not nilable pointers. The details of this analysis are still to be specified +here. Procedural type @@ -1504,8 +1505,8 @@ The ``void`` type is particularly useful for generic code: else: p(x) - proc intProc(x: int) = nil - proc emptyProc() = nil + proc intProc(x: int) = discard + proc emptyProc() = discard callProc[int](intProc, 12) callProc[void](emptyProc) @@ -1767,6 +1768,15 @@ been declared with the `discardable`:idx: pragma: p(3, 4) # now valid +An empty ``discard`` statement is often used as a null statement: + +.. code-block:: nimrod + proc classify(s: string) = + case s[0] + of SymChars, '_': echo "an identifier" + of '0'..'9': echo "a number" + else: discard + Var statement ------------- @@ -1816,7 +1826,7 @@ If a proc is annotated with the ``noinit`` pragma this refers to its implicit ``result`` variable: .. code-block:: nimrod - proc returnUndefinedValue: int {.noinit.} = nil + proc returnUndefinedValue: int {.noinit.} = discard The implicit initialization can be also prevented by the `requiresInit`:idx: @@ -3207,7 +3217,7 @@ Nimrod also allows for type classes and regular types to be specified as `type constraints`:idx: of the generic type parameter: .. code-block:: nimrod - proc onlyIntOrString[T: int|string](x, y: T) = nil + proc onlyIntOrString[T: int|string](x, y: T) = discard onlyIntOrString(450, 616) # valid onlyIntOrString(5.0, 0.0) # type mismatch @@ -3782,7 +3792,7 @@ regular expressions: macro case_token(n: stmt): stmt = # creates a lexical analyzer from regular expressions # ... (implementation is an exercise for the reader :-) - nil + discard case_token: # this colon tells the parser it is a macro statement of r"[A-Za-z_]+[A-Za-z_0-9]*": @@ -3811,17 +3821,17 @@ Whole routines (procs, iterators etc.) can also be passed to a template or a macro via the pragma notation: .. code-block:: nimrod - template m(s: stmt) = nil + template m(s: stmt) = discard - proc p() {.m.} = nil + proc p() {.m.} = discard This is a simple syntactic transformation into: .. code-block:: nimrod - template m(s: stmt) = nil + template m(s: stmt) = discard m: - proc p() = nil + proc p() = discard Special Types @@ -4142,9 +4152,9 @@ all the arguments, but also the matched operators in reverse polish notation: TMatrix = object dummy: int - proc `*`(a, b: TMatrix): TMatrix = nil - proc `+`(a, b: TMatrix): TMatrix = nil - proc `-`(a, b: TMatrix): TMatrix = nil + proc `*`(a, b: TMatrix): TMatrix = discard + proc `+`(a, b: TMatrix): TMatrix = discard + proc `-`(a, b: TMatrix): TMatrix = discard proc `$`(a: TMatrix): string = result = $a.dummy proc mat21(): TMatrix = result.dummy = 21 diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 41dbcd817e..82b4b183a9 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -106,7 +106,7 @@ proc write(f: TFile, b: bool) = proc write(f: TFile, r: float32) = fprintf(f, "%g", r) proc write(f: TFile, r: biggestFloat) = fprintf(f, "%g", r) -proc write(f: TFile, c: Char) = putc(c, f) +proc write(f: TFile, c: char) = putc(c, f) proc write(f: TFile, a: varargs[string, `$`]) = for x in items(a): write(f, x) @@ -184,7 +184,7 @@ when defined(windows) and not defined(useWinAnsi): proc wfreopen(filename, mode: widecstring, stream: TFile): TFile {. importc: "_wfreopen", nodecl.} - proc fopen(filename, mode: CString): pointer = + proc fopen(filename, mode: cstring): pointer = var f = newWideCString(filename) var m = newWideCString(mode) result = wfopen(f, m) @@ -195,7 +195,7 @@ when defined(windows) and not defined(useWinAnsi): result = wfreopen(f, m, stream) else: - proc fopen(filename, mode: CString): pointer {.importc: "fopen", noDecl.} + proc fopen(filename, mode: cstring): pointer {.importc: "fopen", noDecl.} proc freopen(filename, mode: cstring, stream: TFile): TFile {. importc: "freopen", nodecl.} @@ -229,7 +229,7 @@ proc open(f: var TFile, filehandle: TFileHandle, mode: TFileMode): bool = f = fdopen(filehandle, FormatOpen[mode]) result = f != nil -proc fwrite(buf: Pointer, size, n: int, f: TFile): int {. +proc fwrite(buf: pointer, size, n: int, f: TFile): int {. importc: "fwrite", noDecl.} proc readBuffer(f: TFile, buffer: pointer, len: int): int = diff --git a/tests/templates/mcan_access_hidden_field.nim b/tests/templates/mcan_access_hidden_field.nim new file mode 100644 index 0000000000..bf3592701c --- /dev/null +++ b/tests/templates/mcan_access_hidden_field.nim @@ -0,0 +1,9 @@ + +type + Foo* = object + fooa, foob: int + +proc createFoo*(a, b: int): Foo = Foo(fooa: a, foob: b) + +template geta*(f: Foo): expr = f.fooa + diff --git a/tests/templates/tcan_access_hidden_field.nim b/tests/templates/tcan_access_hidden_field.nim new file mode 100644 index 0000000000..a6f6490cc0 --- /dev/null +++ b/tests/templates/tcan_access_hidden_field.nim @@ -0,0 +1,9 @@ +discard """ + output: 33 +""" + +import mcan_access_hidden_field + +var myfoo = createFoo(33, 44) + +echo myfoo.geta diff --git a/web/news.txt b/web/news.txt index d6d269649b..7deda8dadc 100644 --- a/web/news.txt +++ b/web/news.txt @@ -30,6 +30,10 @@ Changes affecting backwards compatibility - ``os.parentDir`` now returns "" if there is no parent dir. - In CGI scripts stacktraces are shown user only if cgi.setStackTraceStdout is used. +- The symbol binding rules for clean templates changed: ``bind`` for any + symbol that's not a parameter is now the default. ``mixin`` can be used + to require instantiation scope for a symbol. + Compiler Additions ------------------ @@ -60,6 +64,7 @@ Language Additions - Added ``delegator pragma`` for handling calls to missing procs and fields at compile-time. - Support for user-defined type classes has been added. +- Exported templates are allowed to access hidden fields. Tools improvements From 1d02f2ea531ad14f686a75c30af9228ba84fa194 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Wed, 25 Dec 2013 19:25:04 +0200 Subject: [PATCH 142/326] wip type class reforms (the compiler bootstraps fine) * replace tfAny and tfAll with tyAnd and tyOr * integrate matchTypeClass into typeRel * introduce tyBuiltInTypeClass to handle types such as tuple, object, proc, etc --- compiler/ast.nim | 8 ++--- compiler/msgs.nim | 2 ++ compiler/semdata.nim | 15 +++++++++ compiler/semexprs.nim | 2 +- compiler/semtypes.nim | 53 ++++++++++++++++++------------ compiler/semtypinst.nim | 2 +- compiler/sigmatch.nim | 40 +++++++++++++---------- compiler/types.nim | 71 +++++++++-------------------------------- 8 files changed, 94 insertions(+), 99 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 462bad24f0..64f959fe26 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -339,6 +339,7 @@ type tyTypeClass tyParametricTypeClass # structured similarly to tyGenericInst # lastSon is the body of the type class + tyBuiltInTypeClass tyAnd tyOr tyNot @@ -349,7 +350,8 @@ const tyPureObject* = tyTuple GcTypeKinds* = {tyRef, tySequence, tyString} tyError* = tyProxy # as an errornous node should match everything - tyTypeClasses* = {tyTypeClass, tyParametricTypeClass, tyAnd, tyOr, tyNot, tyAnything} + tyTypeClasses* = {tyTypeClass, tyBuiltInTypeClass, + tyParametricTypeClass, tyAnd, tyOr, tyNot, tyAnything} type TTypeKinds* = set[TTypeKind] @@ -384,9 +386,6 @@ type # proc foo(T: typedesc, list: seq[T]): var T tfRetType, # marks return types in proc (used to detect type classes # used as return types for return type inference) - tfAll, # type class requires all constraints to be met (default) - tfAny, # type class requires any constraint to be met - tfNot, # type class with a negative check tfCapturesEnv, # whether proc really captures some environment tfByCopy, # pass object/tuple by copy (C backend) tfByRef, # pass object/tuple by reference (C backend) @@ -399,6 +398,7 @@ type tfHasShared, # type constains a "shared" constraint modifier somewhere tfHasMeta, # type has "typedesc" or "expr" somewhere; or uses '|' tfHasGCedMem, # type contains GC'ed memory + tfGenericTypeParam TTypeFlags* = set[TTypeFlag] diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 895ba71f30..9c24295a69 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -643,6 +643,8 @@ proc toFileLine*(info: TLineInfo): string {.inline.} = proc toFileLineCol*(info: TLineInfo): string {.inline.} = result = info.toFilename & "(" & $info.line & "," & $info.col & ")" +template `$`*(info: TLineInfo): expr = toFileLineCol(info) + proc `??`* (info: TLineInfo, filename: string): bool = # only for debugging purposes result = filename in info.toFilename diff --git a/compiler/semdata.nim b/compiler/semdata.nim index d02359d4ce..1984bfccb7 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -213,6 +213,21 @@ proc makeTypeSymNode*(c: PContext, typ: PType, info: TLineInfo): PNode = let sym = newSym(skType, idAnon, getCurrOwner(), info).linkTo(typedesc) return newSymNode(sym, info) +proc makeAndType*(c: PContext, t1, t2: PType): PType = + result = newTypeS(tyAnd, c) + result.sons = @[t1, t2] + result.flags.incl tfHasMeta + +proc makeOrType*(c: PContext, t1, t2: PType): PType = + result = newTypeS(tyOr, c) + result.sons = @[t1, t2] + result.flags.incl tfHasMeta + +proc makeNotType*(c: PContext, t1: PType): PType = + result = newTypeS(tyNot, c) + result.sons = @[t1] + result.flags.incl tfHasMeta + proc newTypeS(kind: TTypeKind, c: PContext): PType = result = newType(kind, getCurrOwner()) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 67373c3032..fde09400d9 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1163,7 +1163,7 @@ proc semAsgn(c: PContext, n: PNode): PNode = if lhsIsResult: n.typ = EnforceVoidContext if lhs.sym.typ.kind == tyGenericParam: - if matchTypeClass(lhs.typ, rhs.typ): + if cmpTypes(c, lhs.typ, rhs.typ) == isGeneric: InternalAssert c.p.resultSym != nil lhs.typ = rhs.typ c.p.resultSym.typ = rhs.typ diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 7e76e950b6..17b7687b49 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -18,7 +18,7 @@ proc newOrPrevType(kind: TTypeKind, prev: PType, c: PContext): PType = if result.kind == tyForward: result.kind = kind proc newConstraint(c: PContext, k: TTypeKind): PType = - result = newTypeS(tyTypeClass, c) + result = newTypeS(tyBuiltInTypeClass, c) result.addSonSkipIntLit(newTypeS(k, c)) proc semEnum(c: PContext, n: PNode, prev: PType): PType = @@ -603,6 +603,10 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, proc addImplicitGenericImpl(typeClass: PType, typId: PIdent): PType = let finalTypId = if typId != nil: typId else: getIdent(paramName & ":type") + if genericParams == nil: + # This happens with anonymous proc types appearing in signatures + # XXX: we need to lift these earlier + return # is this a bindOnce type class already present in the param list? for i in countup(0, genericParams.len - 1): if genericParams.sons[i].sym.name.id == finalTypId.id: @@ -674,7 +678,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, paramType.sons[i] = lifted result = paramType - if paramType.lastSon.kind == tyTypeClass: + if paramType.lastSon.kind == tyTypeClass and false: result = paramType result.kind = tyParametricTypeClass result = addImplicitGeneric(copyType(result, @@ -682,10 +686,16 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, elif result != nil: result.kind = tyGenericInvokation result.sons.setLen(result.sons.len - 1) - of tyTypeClass: + of tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: result = addImplicitGeneric(copyType(paramType, getCurrOwner(), false)) of tyExpr: result = addImplicitGeneric(newTypeS(tyGenericParam, c)) + of tyGenericParam: + if tfGenericTypeParam in paramType.flags and false: + if paramType.sonsLen > 0: + result = liftingWalk(paramType.lastSon) + else: + result = addImplicitGeneric(newTypeS(tyGenericParam, c)) else: nil # result = liftingWalk(paramType) @@ -917,24 +927,27 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = var t1 = semTypeNode(c, n.sons[1], nil) t2 = semTypeNode(c, n.sons[2], nil) - if t1 == nil: + if t1 == nil: LocalError(n.sons[1].info, errTypeExpected) result = newOrPrevType(tyError, prev, c) - elif t2 == nil: + elif t2 == nil: LocalError(n.sons[2].info, errTypeExpected) result = newOrPrevType(tyError, prev, c) else: - result = newTypeS(tyTypeClass, c) - result.addSonSkipIntLit(t1) - result.addSonSkipIntLit(t2) - result.flags.incl(if op.id == ord(wAnd): tfAll else: tfAny) - result.flags.incl(tfHasMeta) + result = if op.id == ord(wAnd): makeAndType(c, t1, t2) + else: makeOrType(c, t1, t2) elif op.id == ord(wNot): - checkSonsLen(n, 3) - result = semTypeNode(c, n.sons[1], prev) - if result.kind in NilableTypes and n.sons[2].kind == nkNilLit: - result = freshType(result, prev) - result.flags.incl(tfNotNil) + case n.len + of 3: + result = semTypeNode(c, n.sons[1], prev) + if result.kind in NilableTypes and n.sons[2].kind == nkNilLit: + result = freshType(result, prev) + result.flags.incl(tfNotNil) + else: + LocalError(n.info, errGenerated, "invalid type") + of 2: + let negated = semTypeNode(c, n.sons[1], prev) + result = makeNotType(c, negated) else: LocalError(n.info, errGenerated, "invalid type") else: @@ -1088,11 +1101,7 @@ proc processMagicType(c: PContext, m: PSym) = else: LocalError(m.info, errTypeExpected) proc semGenericConstraints(c: PContext, x: PType): PType = - if x.kind in StructuralEquivTypes and ( - sonsLen(x) == 0 or x.sons[0].kind in {tyGenericParam, tyEmpty}): - result = newConstraint(c, x.kind) - else: - result = newTypeWithSons(c, tyGenericParam, @[x]) + result = newTypeWithSons(c, tyGenericParam, @[x]) proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode = result = copyNode(n) @@ -1127,7 +1136,9 @@ proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode = if typ == nil: typ = newTypeS(tyGenericParam, c) - + + typ.flags.incl tfGenericTypeParam + for j in countup(0, L-3): let finalType = if j == 0: typ else: copyType(typ, typ.owner, false) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index d05d063aab..f23d87763d 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -19,7 +19,7 @@ proc checkPartialConstructedType(info: TLineInfo, t: PType) = proc checkConstructedType*(info: TLineInfo, typ: PType) = var t = typ.skipTypes({tyDistinct}) - if t.kind in {tyTypeClass}: nil + if t.kind in tyTypeClasses: nil elif tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject: LocalError(info, errInvalidPragmaX, "acyclic") elif t.kind == tyVar and t.sons[0].kind == tyVar: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 42eefec5a2..03c37438cb 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -370,10 +370,6 @@ proc procTypeRel(c: var TCandidate, f, a: PType): TTypeRelation = of tyNil: result = f.allowsNil else: nil -proc matchTypeClass(c: var TCandidate, f, a: PType): TTypeRelation = - result = if matchTypeClass(c.bindings, f, a): isGeneric - else: isNone - proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} = let a0 = firstOrd(a) @@ -406,7 +402,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = # order to give preferrence to the most specific one: # # seq[seq[any]] is a strict subset of seq[any] and hence more specific. - + result = isNone assert(f != nil) assert(a != nil) @@ -462,10 +458,10 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = else: nil case f.kind - of tyEnum: + of tyEnum: if a.kind == f.kind and sameEnumTypes(f, a): result = isEqual elif sameEnumTypes(f, skipTypes(a, {tyRange})): result = isSubtype - of tyBool, tyChar: + of tyBool, tyChar: if a.kind == f.kind: result = isEqual elif skipTypes(a, {tyRange}).kind == f.kind: result = isSubtype of tyRange: @@ -706,7 +702,20 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = return isGeneric else: return typeRel(c, prev, a) - + + of tyBuiltInTypeClass: + var prev = PType(idTableGet(c.bindings, f)) + if prev == nil: + let targetKind = f.sons[0].kind + if targetKind == a.skipTypes({tyRange}).kind or + (targetKind in {tyProc, tyPointer} and a.kind == tyNil): + put(c.bindings, f, a) + return isGeneric + else: + return isNone + else: + result = typeRel(c, prev, a) + of tyGenericParam, tyTypeClass: var x = PType(idTableGet(c.bindings, f)) if x == nil: @@ -727,11 +736,11 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = else: result = isNone else: - if a.kind == tyTypeClass: - result = isGeneric + if f.sonsLen > 0: + result = typeRel(c, f.lastSon, a) else: - result = matchTypeClass(c, f, a) - + result = isGeneric + if result == isGeneric: var concrete = concreteType(c, a) if concrete == nil: @@ -751,7 +760,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = if f.sonsLen == 0: result = isGeneric else: - result = matchTypeClass(c, f, a.sons[0]) + result = typeRel(c, f, a.sons[0]) if result == isGeneric: put(c.bindings, f, a) else: @@ -911,9 +920,8 @@ proc ParamTypesMatchAux(m: var TCandidate, f, argType: PType, InternalAssert a.len > 0 r = typeRel(m, f.lastSon, a.lastSon) else: - let match = matchTypeClass(m.bindings, fMaybeStatic, a) - if not match: r = isNone - else: + r = typeRel(m, fMaybeStatic, a) + if r != isNone: # XXX: Ideally, this should happen much earlier somewhere near # semOpAux, but to do that, we need to be able to query the # overload set to determine whether compile-time value is expected diff --git a/compiler/types.nim b/compiler/types.nim index 5fe128bbb9..872834810e 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -409,18 +409,8 @@ const "uint", "uint8", "uint16", "uint32", "uint64", "bignum", "const ", "!", "varargs[$1]", "iter[$1]", "Error Type", "TypeClass", - "ParametricTypeClass", "and", "or", "not", "any", "static"] - -proc consToStr(t: PType): string = - if t.len > 0: result = t.typeToString - else: result = typeToStr[t.kind].strip - -proc constraintsToStr(t: PType): string = - let sep = if tfAny in t.flags: " or " else: " and " - result = "" - for i in countup(0, t.len - 1): - if i > 0: result.add(sep) - result.add(t.sons[i].consToStr) + "ParametricTypeClass", "BuiltInTypeClass", + "and", "or", "not", "any", "static"] proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = var t = typ @@ -444,19 +434,24 @@ proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = add(result, ']') of tyTypeDesc: if t.len == 0: result = "typedesc" - else: result = "typedesc[" & constraintsToStr(t) & "]" + else: result = "typedesc[" & typeToString(t) & "]" of tyStatic: InternalAssert t.len > 0 - result = "static[" & constraintsToStr(t) & "]" + result = "static[" & typeToString(t) & "]" of tyTypeClass: - if t.n != nil: return t.sym.owner.name.s - case t.len - of 0: result = "typeclass[]" - of 1: result = "typeclass[" & consToStr(t.sons[0]) & "]" - else: result = constraintsToStr(t) + InternalAssert t.sym != nil and t.sym.owner != nil + return t.sym.owner.name.s + of tyBuiltInTypeClass: + return "TypeClass" + of tyAnd: + result = typeToString(t.sons[0]) & " and " & typeToString(t.sons[1]) + of tyOr: + result = typeToString(t.sons[0]) & " and " & typeToString(t.sons[1]) + of tyNot: + result = "not " & typeToString(t.sons[0]) of tyExpr: if t.len == 0: result = "expr" - else: result = "expr[" & constraintsToStr(t) & "]" + else: result = "expr[" & typeToString(t) & "]" of tyArray: if t.sons[0].kind == tyRange: result = "array[" & rangeToStr(t.sons[0].n) & ", " & @@ -978,42 +973,6 @@ proc isGenericAlias*(t: PType): bool = proc skipGenericAlias*(t: PType): PType = return if t.isGenericAlias: t.lastSon else: t -proc matchTypeClass*(bindings: var TIdTable, typeClass, t: PType): bool = - for i in countup(0, typeClass.sonsLen - 1): - let req = typeClass.sons[i] - var match = req.kind == skipTypes(t, {tyRange, tyGenericInst}).kind - - if not match: - case req.kind - of tyGenericBody: - if t.kind == tyGenericInst and t.sons[0] == req: - match = true - IdTablePut(bindings, typeClass, t) - of tyTypeClass: - match = matchTypeClass(bindings, req, t) - elif t.kind == tyTypeClass: - match = matchTypeClass(bindings, t, req) - - elif t.kind in {tyObject} and req.len != 0: - # empty 'object' is fine as constraint in a type class - match = sameType(t, req) - - if tfAny in typeClass.flags: - if match: return true - else: - if not match: return false - - # if the loop finished without returning, either all constraints matched - # or none of them matched. - result = if tfAny in typeClass.flags: false else: true - if result == true: - IdTablePut(bindings, typeClass, t) - -proc matchTypeClass*(typeClass, typ: PType): bool = - var bindings: TIdTable - initIdTable(bindings) - result = matchTypeClass(bindings, typeClass, typ) - proc typeAllowedAux(marker: var TIntSet, typ: PType, kind: TSymKind, flags: TTypeAllowedFlags = {}): bool = assert(kind in {skVar, skLet, skConst, skParam, skResult}) From edab4aaad02bf414f7f0c6e3148ade8a7b485c40 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Wed, 25 Dec 2013 22:29:44 +0200 Subject: [PATCH 143/326] better integration of tyStatic into typeRel --- compiler/ast.nim | 1 + compiler/evals.nim | 2 +- compiler/msgs.nim | 14 +++++----- compiler/sem.nim | 10 +++++++ compiler/semdata.nim | 5 ++++ compiler/semtypes.nim | 16 +++++------ compiler/semtypinst.nim | 8 +++--- compiler/sigmatch.nim | 60 +++++++++++++++++++---------------------- compiler/types.nim | 8 +++--- 9 files changed, 66 insertions(+), 58 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 64f959fe26..130f5a5adc 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -399,6 +399,7 @@ type tfHasMeta, # type has "typedesc" or "expr" somewhere; or uses '|' tfHasGCedMem, # type contains GC'ed memory tfGenericTypeParam + tfHasStatic TTypeFlags* = set[TTypeFlag] diff --git a/compiler/evals.nim b/compiler/evals.nim index 4a2586d5f8..f7d94e4c0f 100644 --- a/compiler/evals.nim +++ b/compiler/evals.nim @@ -91,7 +91,7 @@ proc evalMacroCall*(c: PEvalContext, n, nOrig: PNode, sym: PSym): PNode proc evalAux(c: PEvalContext, n: PNode, flags: TEvalFlags): PNode proc raiseCannotEval(c: PEvalContext, info: TLineInfo): PNode = - if defined(debug): writeStackTrace() + if defined(debug) and gVerbosity >= 3: writeStackTrace() result = newNodeI(nkExceptBranch, info) # creating a nkExceptBranch without sons # means that it could not be evaluated diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 9c24295a69..81e738ee82 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -701,23 +701,21 @@ type TErrorHandling = enum doNothing, doAbort, doRaise proc handleError(msg: TMsgKind, eh: TErrorHandling, s: string) = - template maybeTrace = - if defined(debug) or gVerbosity >= 3: - writeStackTrace() + template quit = + if defined(debug) or gVerbosity >= 3: writeStackTrace() + quit 1 if msg == errInternal: writeStackTrace() # we always want a stack trace here if msg >= fatalMin and msg <= fatalMax: - maybeTrace() - quit(1) + quit() if msg >= errMin and msg <= errMax: - maybeTrace() inc(gErrorCounter) options.gExitcode = 1'i8 if gErrorCounter >= gErrorMax: - quit(1) + quit() elif eh == doAbort and gCmd != cmdIdeTools: - quit(1) + quit() elif eh == doRaise: raiseRecoverableError(s) diff --git a/compiler/sem.nim b/compiler/sem.nim index 3ace623bca..67d400ac50 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -189,6 +189,15 @@ proc evalConstExpr(c: PContext, module: PSym, e: PNode): PNode = proc evalStaticExpr(c: PContext, module: PSym, e: PNode, prc: PSym): PNode = result = evalConstExprAux(c.createEvalContext(emStatic), module, prc, e) +proc tryConstExpr(c: PContext, n: PNode): PNode = + var e = semExprWithType(c, n) + if e == nil: return + result = getConstExpr(c.module, e) + if result == nil: + result = evalConstExpr(c, c.module, e) + if result == nil or result.kind == nkEmpty: + return nil + proc semConstExpr(c: PContext, n: PNode): PNode = var e = semExprWithType(c, n) if e == nil: @@ -282,6 +291,7 @@ proc myOpen(module: PSym): PPassContext = c.semConstExpr = semConstExpr c.semExpr = semExpr c.semTryExpr = tryExpr + c.semTryConstExpr = tryConstExpr c.semOperand = semOperand c.semConstBoolExpr = semConstBoolExpr c.semOverloadedCall = semOverloadedCall diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 1984bfccb7..874e5dab46 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -75,6 +75,7 @@ type semExpr*: proc (c: PContext, n: PNode, flags: TExprFlags = {}): PNode {.nimcall.} semTryExpr*: proc (c: PContext, n: PNode,flags: TExprFlags = {}, bufferErrors = false): PNode {.nimcall.} + semTryConstExpr*: proc (c: PContext, n: PNode): PNode {.nimcall.} semOperand*: proc (c: PContext, n: PNode, flags: TExprFlags = {}): PNode {.nimcall.} semConstBoolExpr*: proc (c: PContext, n: PNode): PNode {.nimcall.} # XXX bite the bullet semOverloadedCall*: proc (c: PContext, n, nOrig: PNode, @@ -217,11 +218,15 @@ proc makeAndType*(c: PContext, t1, t2: PType): PType = result = newTypeS(tyAnd, c) result.sons = @[t1, t2] result.flags.incl tfHasMeta + if tfHasStatic in t1.flags or tfHasStatic in t2.flags: + result.flags.incl tfHasStatic proc makeOrType*(c: PContext, t1, t2: PType): PType = result = newTypeS(tyOr, c) result.sons = @[t1, t2] result.flags.incl tfHasMeta + if tfHasStatic in t1.flags or tfHasStatic in t2.flags: + result.flags.incl tfHasStatic proc makeNotType*(c: PContext, t1: PType): PType = result = newTypeS(tyNot, c) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 17b7687b49..2016220162 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -678,12 +678,9 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, paramType.sons[i] = lifted result = paramType - if paramType.lastSon.kind == tyTypeClass and false: - result = paramType - result.kind = tyParametricTypeClass - result = addImplicitGeneric(copyType(result, - getCurrOwner(), false)) - elif result != nil: + if result == nil: + result = liftingWalk(paramType.lastSon) + else: result.kind = tyGenericInvokation result.sons.setLen(result.sons.len - 1) of tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: @@ -1014,9 +1011,10 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = of nkVarTy: result = semVarType(c, n, prev) of nkDistinctTy: result = semDistinct(c, n, prev) of nkStaticTy: - result = newOrPrevType(tyStatic, prev, c) - var base = semTypeNode(c, n.sons[0], nil) - result.rawAddSon(base) + result = newOrPrevType(tyStatic, prev, c) + var base = semTypeNode(c, n.sons[0], nil) + result.rawAddSon(base) + result.flags.incl tfHasStatic of nkProcTy, nkIteratorTy: if n.sonsLen == 0: result = newConstraint(c, tyProc) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index f23d87763d..69d91766b9 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -194,16 +194,16 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = result = t - if t == nil: return + if t == nil: return + if t.kind == tyStatic and t.sym != nil and t.sym.kind == skGenericParam: + return lookupTypeVar(cl, t) + case t.kind of tyTypeClass: nil of tyGenericParam: result = lookupTypeVar(cl, t) if result.kind == tyGenericInvokation: result = handleGenericInvokation(cl, result) - of tyStatic: - if t.sym != nil and t.sym.kind == skGenericParam: - result = lookupTypeVar(cl, t) of tyGenericInvokation: result = handleGenericInvokation(cl, t) of tyGenericBody: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 03c37438cb..c3d197c3ba 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -753,6 +753,14 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = result = isGeneric else: result = typeRel(c, x, a) # check if it fits + + of tyStatic: + if a.kind == tyStatic: + result = typeRel(c, f.lastSon, a.lastSon) + if result != isNone: put(c.bindings, f, a) + else: + result = isNone + of tyTypeDesc: var prev = PType(idTableGet(c.bindings, f)) if prev == nil: @@ -904,40 +912,28 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, proc ParamTypesMatchAux(m: var TCandidate, f, argType: PType, argSemantized, argOrig: PNode): PNode = var - r: TTypeRelation - arg = argSemantized - - let - c = m.c - a0 = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) - else: argType - a = if a0 != nil: a0.skipTypes({tyStatic}) else: a0 fMaybeStatic = f.skipTypes({tyDistinct}) + arg = argSemantized + c = m.c + argType = argType + if tfHasStatic in fMaybeStatic.flags: + # XXX: When implicit statics are the default + # this will be done earlier - we just have to + # make sure that static types enter here + var evaluated = c.semTryConstExpr(c, arg) + if evaluated != nil: + arg.typ = newTypeS(tyStatic, c) + arg.typ.sons = @[evaluated.typ] + arg.typ.n = evaluated + argType = arg.typ + + var + r: TTypeRelation + a = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) + else: argType + case fMaybeStatic.kind - of tyStatic: - if a.kind == tyStatic: - InternalAssert a.len > 0 - r = typeRel(m, f.lastSon, a.lastSon) - else: - r = typeRel(m, fMaybeStatic, a) - if r != isNone: - # XXX: Ideally, this should happen much earlier somewhere near - # semOpAux, but to do that, we need to be able to query the - # overload set to determine whether compile-time value is expected - # for the param before entering the full-blown sigmatch algorithm. - # This is related to the immediate pragma since querying the - # overload set could help there too. - var evaluated = c.semConstExpr(c, arg) - if evaluated != nil: - r = isGeneric - arg.typ = newTypeS(tyStatic, c) - arg.typ.sons = @[evaluated.typ] - arg.typ.n = evaluated - - if r == isGeneric: - put(m.bindings, f, arg.typ) - of tyTypeClass, tyParametricTypeClass: if fMaybeStatic.n != nil: let match = matchUserTypeClass(c, m, arg, fMaybeStatic, a) @@ -955,7 +951,7 @@ proc ParamTypesMatchAux(m: var TCandidate, f, argType: PType, r = typeRel(m, f, a) case r - of isConvertible: + of isConvertible: inc(m.convMatches) result = implicitConv(nkHiddenStdConv, f, copyTree(arg), m, c) of isIntConv: diff --git a/compiler/types.nim b/compiler/types.nim index 872834810e..f6e426f396 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -434,10 +434,10 @@ proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = add(result, ']') of tyTypeDesc: if t.len == 0: result = "typedesc" - else: result = "typedesc[" & typeToString(t) & "]" + else: result = "typedesc[" & typeToString(t.sons[0]) & "]" of tyStatic: InternalAssert t.len > 0 - result = "static[" & typeToString(t) & "]" + result = "static[" & typeToString(t.sons[0]) & "]" of tyTypeClass: InternalAssert t.sym != nil and t.sym.owner != nil return t.sym.owner.name.s @@ -450,8 +450,8 @@ proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = of tyNot: result = "not " & typeToString(t.sons[0]) of tyExpr: - if t.len == 0: result = "expr" - else: result = "expr[" & typeToString(t) & "]" + InternalAssert t.len == 0 + result = "expr" of tyArray: if t.sons[0].kind == tyRange: result = "array[" & rangeToStr(t.sons[0].n) & ", " & From 86108be24b43d1b4b02a6549e75f64b7625233ac Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Wed, 25 Dec 2013 22:40:06 +0200 Subject: [PATCH 144/326] test case for semistatic --- tests/run/tsemistatic.nim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/run/tsemistatic.nim diff --git a/tests/run/tsemistatic.nim b/tests/run/tsemistatic.nim new file mode 100644 index 0000000000..d187f153cc --- /dev/null +++ b/tests/run/tsemistatic.nim @@ -0,0 +1,24 @@ +discard """ + msg: "static 10\ndynamic\nstatic 20\n" + output: "s\nd\nd\ns" +""" + +proc foo(x: semistatic[int]) = + when isStatic(x): + static: echo "static ", x + echo "s" + else: + static: echo "dynamic" + echo "d" + +foo 10 + +var + x = 10 + y: int + +foo x +foo y + +foo 20 + From 8c1ea5cb3f72901be47dc20366d228b0a1c9b417 Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Wed, 25 Dec 2013 22:38:53 +0000 Subject: [PATCH 145/326] Added --noBabelPath override. --- compiler/commands.nim | 5 ++++- compiler/options.nim | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/commands.nim b/compiler/commands.nim index d3266930b1..fa78412758 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -249,10 +249,13 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = expectArg(switch, arg, pass, info) addPath(processPath(arg), info) of "babelpath": - if pass in {passCmd2, passPP}: + if pass in {passCmd2, passPP} and not options.gNoBabelPath: expectArg(switch, arg, pass, info) let path = processPath(arg, notRelativeToProj=true) babelpath(path, info) + of "nobabelpath": + expectNoArg(switch, arg, pass, info) + options.gNoBabelPath = true of "excludepath": expectArg(switch, arg, pass, info) let path = processPath(arg) diff --git a/compiler/options.nim b/compiler/options.nim index d4122c7b22..c62744485f 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -111,6 +111,7 @@ var gDirtyBufferIdx* = 0'i32 # indicates the fileIdx of the dirty version of # the tracked source X, saved by the CAAS client. gDirtyOriginalIdx* = 0'i32 # the original source file of the dirtified buffer. + gNoBabelPath* = false proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools} proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc From 69b816f07c78ab8e672eaa926e9bd3e28c6ff658 Mon Sep 17 00:00:00 2001 From: Satish BD <bdsatish@gmail.com> Date: Thu, 26 Dec 2013 00:40:50 +0200 Subject: [PATCH 146/326] Define $ operator for TRune --- lib/pure/unicode.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim index 4aacb2f717..0d5b06c92c 100644 --- a/lib/pure/unicode.nim +++ b/lib/pure/unicode.nim @@ -132,6 +132,8 @@ proc toUTF8*(c: TRune): string {.rtl, extern: "nuc$1".} = result = newString(1) result[0] = chr(i) +proc `$`*(rune: TRune): string = rune.toUTF8 + proc `$`*(runes: seq[TRune]): string = ## converts a sequence of runes to a string result = "" From 40bd63f83b045ab88c2da232d4848566aa5008ca Mon Sep 17 00:00:00 2001 From: Satish BD <bdsatish@gmail.com> Date: Thu, 26 Dec 2013 00:55:17 +0200 Subject: [PATCH 147/326] Define $ operator for TRune --- lib/pure/unicode.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim index 0d5b06c92c..f90fc2745d 100644 --- a/lib/pure/unicode.nim +++ b/lib/pure/unicode.nim @@ -132,7 +132,9 @@ proc toUTF8*(c: TRune): string {.rtl, extern: "nuc$1".} = result = newString(1) result[0] = chr(i) -proc `$`*(rune: TRune): string = rune.toUTF8 +proc `$`*(rune: TRune): string = + ## converts a rune to a string + rune.toUTF8 proc `$`*(runes: seq[TRune]): string = ## converts a sequence of runes to a string From e2594f44bdc99e1c7930dfb66fa258a504ee4d79 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Thu, 26 Dec 2013 01:09:10 +0200 Subject: [PATCH 148/326] bugfix: in some contexts, newSeq[T](n) is incorrectly inferred to have a seq[typedesc[T]] type --- compiler/sigmatch.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index c3d197c3ba..6a68882237 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -93,8 +93,10 @@ proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PSym, var typeParams = callee.ast[genericParamsPos] for i in 1..min(sonsLen(typeParams), sonsLen(binding)-1): var formalTypeParam = typeParams.sons[i-1].typ - #debug(formalTypeParam) - put(c.bindings, formalTypeParam, binding[i].typ) + var bound = binding[i].typ + if formalTypeParam.kind != tyTypeDesc: + bound = bound.skipTypes({tyTypeDesc}) + put(c.bindings, formalTypeParam, bound) proc newCandidate*(ctx: PContext, callee: PSym, binding: PNode, calleeScope = -1): TCandidate = From be5e13671cdd923953d7b1b2137f06673fe7bb96 Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Thu, 26 Dec 2013 21:32:30 +0000 Subject: [PATCH 149/326] Remove assert in asyncio which causes problems. This assert keeps failing occassionally in nimbuild causing it to crash. According to logic it shouldn't, but perhaps the socket's writeable status changes. --- lib/pure/asyncio.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pure/asyncio.nim b/lib/pure/asyncio.nim index c4a07d7513..3c2a5c17a4 100644 --- a/lib/pure/asyncio.nim +++ b/lib/pure/asyncio.nim @@ -233,8 +233,11 @@ proc asyncSockHandleWrite(h: PObject) = let sock = PAsyncSocket(h) try: let bytesSent = sock.socket.sendAsync(sock.sendBuffer) - assert bytesSent > 0 - if bytesSent != sock.sendBuffer.len: + if bytesSent == 0: + # Apparently the socket cannot be written to. Even though select + # just told us that it can be... This used to be an assert. Just + # do nothing instead. + elif bytesSent != sock.sendBuffer.len: sock.sendBuffer = sock.sendBuffer[bytesSent .. -1] elif bytesSent == sock.sendBuffer.len: sock.sendBuffer = "" From 4eea2f17d36b2cf239f0a987b5d9715a81b2b70f Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Fri, 27 Dec 2013 13:00:45 +0200 Subject: [PATCH 150/326] forgotten modification to the news files --- web/news.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web/news.txt b/web/news.txt index f919089a53..78079ea163 100644 --- a/web/news.txt +++ b/web/news.txt @@ -30,6 +30,8 @@ Changes affecting backwards compatibility - ``os.parentDir`` now returns "" if there is no parent dir. - ``quoteIfContainsWhite`` now escapes argument in such way that it can be safely passed to shell, instead of just adding double quotes. +- ``macros.dumpTree`` and ``macros.dumpLisp`` have been made ``immediate``, + ``dumpTreeImm`` and ``dumpLispImm`` are now deprecated. Compiler Additions @@ -50,13 +52,13 @@ Language Additions - Arrays can now be declared with a single integer literal ``N`` instead of a range; the range is then ``0..N-1``. -- ``macros.dumpTree`` and ``macros.dumpLisp`` have been made ``immediate``, - ``dumpTreeImm`` and ``dumpLispImm`` are now deprecated. - Added ``requiresInit`` pragma to enforce explicit initialization. -- Added ``using statement`` for better authoring domain-specific languages and - OOP-like syntactic sugar. -- Added ``delegator pragma`` for handling calls to missing procs and fields at - compile-time. +- The ``using statement`` enables you to more easily author domain-specific + languages and libraries providing OOP-like syntactic sugar. +- Added a new ``delegator pragma`` for handling calls to missing procs and + fields at compile-time. +- The overload resolution now supports ``static[T]`` params that must be + evaluatable at compile-time. - Support for user-defined type classes have been added. From 2df9b442c646e06cc577a723dc2592275bf9b6f5 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 27 Dec 2013 15:48:53 +0100 Subject: [PATCH 151/326] case consistency part 1 --- compiler/astalgo.nim | 177 ++++++++++++++-------------- compiler/bitsets.nim | 40 +++---- compiler/ccgexprs.nim | 4 +- compiler/ccgmerge.nim | 3 +- compiler/ccgstmts.nim | 32 +++--- compiler/ccgthreadvars.nim | 4 +- compiler/ccgtypes.nim | 6 +- compiler/ccgutils.nim | 36 +++--- compiler/cgen.nim | 8 +- compiler/cgmeth.nim | 6 +- compiler/commands.nim | 82 ++++++------- compiler/condsyms.nim | 64 +++++------ compiler/docgen.nim | 20 ++-- compiler/extccomp.nim | 18 +-- compiler/idents.nim | 2 +- compiler/idgen.nim | 6 +- compiler/lexer.nim | 8 +- compiler/lists.nim | 22 ++-- compiler/llstream.nim | 75 ++++++------ compiler/lookups.nim | 86 +++++++------- compiler/magicsys.nim | 17 ++- compiler/main.nim | 32 +++--- compiler/modules.nim | 2 +- compiler/msgs.nim | 52 ++++----- compiler/nimconf.nim | 2 +- compiler/nimlexbase.nim | 15 ++- compiler/nimrod.nim | 10 +- compiler/nimsets.nim | 8 +- compiler/options.nim | 2 +- compiler/parser.nim | 32 +++--- compiler/pbraces.nim | 2 +- compiler/platform.nim | 12 +- compiler/pragmas.nim | 32 +++--- compiler/pretty.nim | 166 ++++++++++++++++++++++++--- compiler/procfind.nim | 10 +- compiler/renderer.nim | 8 +- compiler/rodread.nim | 34 +++--- compiler/rodutils.nim | 4 +- compiler/ropes.nim | 26 ++--- compiler/sem.nim | 2 +- compiler/semcall.nim | 24 ++-- compiler/semdata.nim | 32 +++--- compiler/semdestruct.nim | 6 +- compiler/semexprs.nim | 20 ++-- compiler/semgnrc.nim | 2 +- compiler/seminst.nim | 8 +- compiler/semstmts.nim | 10 +- compiler/semtempl.nim | 4 +- compiler/semtypes.nim | 2 +- compiler/semtypinst.nim | 21 ++-- compiler/service.nim | 2 +- compiler/sigmatch.nim | 12 +- compiler/suggest.nim | 4 +- compiler/syntaxes.nim | 30 ++--- compiler/transf.nim | 2 +- compiler/trees.nim | 36 +++--- compiler/treetab.nim | 30 ++--- compiler/types.nim | 81 ++++++------- compiler/vm.nim | 2 +- compiler/vmgen.nim | 2 +- doc/manual.txt | 2 + lib/impure/rdstdin.nim | 8 +- lib/packages/docutils/rstast.nim | 4 +- lib/packages/docutils/rstgen.nim | 6 +- lib/pure/collections/intsets.nim | 8 +- lib/pure/collections/lists.nim | 8 +- lib/pure/collections/tables.nim | 72 ++++++------ lib/pure/lexbase.nim | 18 +-- lib/pure/os.nim | 190 +++++++++++++++---------------- lib/pure/osproc.nim | 16 +-- lib/pure/parseutils.nim | 4 +- lib/pure/sockets.nim | 24 ++-- lib/pure/strtabs.nim | 8 +- lib/pure/strutils.nim | 18 +-- lib/pure/times.nim | 10 +- lib/pure/unicode.nim | 4 +- lib/system.nim | 20 ++-- lib/system/alloc.nim | 45 ++++---- lib/system/assign.nim | 4 +- lib/system/atomics.nim | 122 +++++++++----------- lib/system/avltree.nim | 10 +- lib/system/cellsets.nim | 50 ++++---- lib/system/dyncalls.nim | 13 ++- lib/system/gc.nim | 4 +- lib/system/repr.nim | 2 +- lib/system/syslocks.nim | 54 ++++----- lib/windows/winlean.nim | 184 ++++++++++++++++-------------- todo.txt | 5 +- 88 files changed, 1266 insertions(+), 1144 deletions(-) diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 4f869cfcac..b04cff5986 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -24,35 +24,35 @@ proc symToYaml*(n: PSym, indent: int = 0, maxRecDepth: int = - 1): PRope proc lineInfoToStr*(info: TLineInfo): PRope # ----------------------- node sets: --------------------------------------- -proc ObjectSetContains*(t: TObjectSet, obj: PObject): bool +proc objectSetContains*(t: TObjectSet, obj: PObject): bool # returns true whether n is in t -proc ObjectSetIncl*(t: var TObjectSet, obj: PObject) +proc objectSetIncl*(t: var TObjectSet, obj: PObject) # include an element n in the table t -proc ObjectSetContainsOrIncl*(t: var TObjectSet, obj: PObject): bool +proc objectSetContainsOrIncl*(t: var TObjectSet, obj: PObject): bool # more are not needed ... # ----------------------- (key, val)-Hashtables ---------------------------- -proc TablePut*(t: var TTable, key, val: PObject) -proc TableGet*(t: TTable, key: PObject): PObject +proc tablePut*(t: var TTable, key, val: PObject) +proc tableGet*(t: TTable, key: PObject): PObject type TCmpProc* = proc (key, closure: PObject): bool {.nimcall.} # true if found -proc TableSearch*(t: TTable, key, closure: PObject, +proc tableSearch*(t: TTable, key, closure: PObject, comparator: TCmpProc): PObject # return val as soon as comparator returns true; if this never happens, # nil is returned # ----------------------- str table ----------------------------------------- -proc StrTableContains*(t: TStrTable, n: PSym): bool -proc StrTableAdd*(t: var TStrTable, n: PSym) -proc StrTableGet*(t: TStrTable, name: PIdent): PSym +proc strTableContains*(t: TStrTable, n: PSym): bool +proc strTableAdd*(t: var TStrTable, n: PSym) +proc strTableGet*(t: TStrTable, name: PIdent): PSym type TTabIter*{.final.} = object # consider all fields here private h*: THash # current hash -proc InitTabIter*(ti: var TTabIter, tab: TStrTable): PSym -proc NextIter*(ti: var TTabIter, tab: TStrTable): PSym +proc initTabIter*(ti: var TTabIter, tab: TStrTable): PSym +proc nextIter*(ti: var TTabIter, tab: TStrTable): PSym # usage: # var # i: TTabIter @@ -69,8 +69,8 @@ type name*: PIdent -proc InitIdentIter*(ti: var TIdentIter, tab: TStrTable, s: PIdent): PSym -proc NextIdentIter*(ti: var TIdentIter, tab: TStrTable): PSym +proc initIdentIter*(ti: var TIdentIter, tab: TStrTable, s: PIdent): PSym +proc nextIdentIter*(ti: var TIdentIter, tab: TStrTable): PSym # these are for debugging only: They are not really deprecated, but I want # the warning so that release versions do not contain debugging statements: @@ -79,15 +79,14 @@ proc debug*(n: PType) {.deprecated.} proc debug*(n: PNode) {.deprecated.} # --------------------------- ident tables ---------------------------------- -proc IdTableGet*(t: TIdTable, key: PIdObj): PObject -proc IdTableGet*(t: TIdTable, key: int): PObject -proc IdTablePut*(t: var TIdTable, key: PIdObj, val: PObject) -proc IdTableHasObjectAsKey*(t: TIdTable, key: PIdObj): bool +proc idTableGet*(t: TIdTable, key: PIdObj): PObject +proc idTableGet*(t: TIdTable, key: int): PObject +proc idTablePut*(t: var TIdTable, key: PIdObj, val: PObject) +proc idTableHasObjectAsKey*(t: TIdTable, key: PIdObj): bool # checks if `t` contains the `key` (compared by the pointer value, not only # `key`'s id) -proc IdNodeTableGet*(t: TIdNodeTable, key: PIdObj): PNode -proc IdNodeTablePut*(t: var TIdNodeTable, key: PIdObj, val: PNode) -proc writeIdNodeTable*(t: TIdNodeTable) +proc idNodeTableGet*(t: TIdNodeTable, key: PIdObj): PNode +proc idNodeTablePut*(t: var TIdNodeTable, key: PIdObj, val: PNode) # --------------------------------------------------------------------------- @@ -111,9 +110,9 @@ type data*: TIIPairSeq -proc initIITable*(x: var TIITable) -proc IITableGet*(t: TIITable, key: int): int -proc IITablePut*(t: var TIITable, key, val: int) +proc initIiTable*(x: var TIITable) +proc iiTableGet*(t: TIITable, key: int): int +proc iiTablePut*(t: var TIITable, key, val: int) # implementation @@ -129,7 +128,7 @@ proc skipConvTakeType*(n: PNode): PNode = result = n.skipConv result.typ = n.typ -proc SameValue*(a, b: PNode): bool = +proc sameValue*(a, b: PNode): bool = result = false case a.kind of nkCharLit..nkInt64Lit: @@ -141,7 +140,7 @@ proc SameValue*(a, b: PNode): bool = else: # don't raise an internal error for 'nimrod check': #InternalError(a.info, "SameValue") - nil + discard proc leValue*(a, b: PNode): bool = # a <= b? @@ -156,7 +155,7 @@ proc leValue*(a, b: PNode): bool = else: # don't raise an internal error for 'nimrod check': #InternalError(a.info, "leValue") - nil + discard proc lookupInRecord(n: PNode, field: PIdent): PSym = result = nil @@ -182,14 +181,14 @@ proc lookupInRecord(n: PNode, field: PIdent): PSym = proc getModule(s: PSym): PSym = result = s assert((result.kind == skModule) or (result.owner != result)) - while (result != nil) and (result.kind != skModule): result = result.owner + while result != nil and result.kind != skModule: result = result.owner proc getSymFromList(list: PNode, ident: PIdent, start: int = 0): PSym = for i in countup(start, sonsLen(list) - 1): if list.sons[i].kind == nkSym: result = list.sons[i].sym if result.name.id == ident.id: return - else: InternalError(list.info, "getSymFromList") + else: internalError(list.info, "getSymFromList") result = nil proc hashNode(p: PObject): THash = @@ -501,7 +500,7 @@ proc objectSetContainsOrIncl(t: var TObjectSet, obj: PObject): bool = inc(t.counter) result = false -proc TableRawGet(t: TTable, key: PObject): int = +proc tableRawGet(t: TTable, key: PObject): int = var h: THash = hashNode(key) and high(t.data) # start with real hash value while t.data[h].key != nil: if t.data[h].key == key: @@ -509,7 +508,7 @@ proc TableRawGet(t: TTable, key: PObject): int = h = nextTry(h, high(t.data)) result = -1 -proc TableSearch(t: TTable, key, closure: PObject, +proc tableSearch(t: TTable, key, closure: PObject, comparator: TCmpProc): PObject = var h: THash = hashNode(key) and high(t.data) # start with real hash value while t.data[h].key != nil: @@ -520,13 +519,13 @@ proc TableSearch(t: TTable, key, closure: PObject, h = nextTry(h, high(t.data)) result = nil -proc TableGet(t: TTable, key: PObject): PObject = - var index = TableRawGet(t, key) +proc tableGet(t: TTable, key: PObject): PObject = + var index = tableRawGet(t, key) if index >= 0: result = t.data[index].val else: result = nil -proc TableRawInsert(data: var TPairSeq, key, val: PObject) = - var h: THash = HashNode(key) and high(data) +proc tableRawInsert(data: var TPairSeq, key, val: PObject) = + var h: THash = hashNode(key) and high(data) while data[h].key != nil: assert(data[h].key != key) h = nextTry(h, high(data)) @@ -534,23 +533,23 @@ proc TableRawInsert(data: var TPairSeq, key, val: PObject) = data[h].key = key data[h].val = val -proc TableEnlarge(t: var TTable) = +proc tableEnlarge(t: var TTable) = var n: TPairSeq newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): - if t.data[i].key != nil: TableRawInsert(n, t.data[i].key, t.data[i].val) + if t.data[i].key != nil: tableRawInsert(n, t.data[i].key, t.data[i].val) swap(t.data, n) -proc TablePut(t: var TTable, key, val: PObject) = +proc tablePut(t: var TTable, key, val: PObject) = var index = TableRawGet(t, key) if index >= 0: t.data[index].val = val else: - if mustRehash(len(t.data), t.counter): TableEnlarge(t) - TableRawInsert(t.data, key, val) + if mustRehash(len(t.data), t.counter): tableEnlarge(t) + tableRawInsert(t.data, key, val) inc(t.counter) -proc StrTableContains(t: TStrTable, n: PSym): bool = +proc strTableContains(t: TStrTable, n: PSym): bool = var h: THash = n.name.h and high(t.data) # start with real hash value while t.data[h] != nil: if (t.data[h] == n): @@ -558,7 +557,7 @@ proc StrTableContains(t: TStrTable, n: PSym): bool = h = nextTry(h, high(t.data)) result = false -proc StrTableRawInsert(data: var TSymSeq, n: PSym) = +proc strTableRawInsert(data: var TSymSeq, n: PSym) = var h: THash = n.name.h and high(data) while data[h] != nil: if data[h] == n: @@ -569,7 +568,7 @@ proc StrTableRawInsert(data: var TSymSeq, n: PSym) = assert(data[h] == nil) data[h] = n -proc SymTabReplaceRaw(data: var TSymSeq, prevSym: PSym, newSym: PSym) = +proc symTabReplaceRaw(data: var TSymSeq, prevSym: PSym, newSym: PSym) = assert prevSym.name.h == newSym.name.h var h: THash = prevSym.name.h and high(data) while data[h] != nil: @@ -579,22 +578,22 @@ proc SymTabReplaceRaw(data: var TSymSeq, prevSym: PSym, newSym: PSym) = h = nextTry(h, high(data)) assert false -proc SymTabReplace*(t: var TStrTable, prevSym: PSym, newSym: PSym) = - SymTabReplaceRaw(t.data, prevSym, newSym) +proc symTabReplace*(t: var TStrTable, prevSym: PSym, newSym: PSym) = + symTabReplaceRaw(t.data, prevSym, newSym) -proc StrTableEnlarge(t: var TStrTable) = +proc strTableEnlarge(t: var TStrTable) = var n: TSymSeq newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): if t.data[i] != nil: StrTableRawInsert(n, t.data[i]) swap(t.data, n) -proc StrTableAdd(t: var TStrTable, n: PSym) = +proc strTableAdd(t: var TStrTable, n: PSym) = if mustRehash(len(t.data), t.counter): StrTableEnlarge(t) StrTableRawInsert(t.data, n) inc(t.counter) -proc StrTableIncl*(t: var TStrTable, n: PSym): bool {.discardable.} = +proc strTableIncl*(t: var TStrTable, n: PSym): bool {.discardable.} = # returns true if n is already in the string table: # It is essential that `n` is written nevertheless! # This way the newest redefinition is picked by the semantic analyses! @@ -616,7 +615,7 @@ proc StrTableIncl*(t: var TStrTable, n: PSym): bool {.discardable.} = inc(t.counter) result = false -proc StrTableGet(t: TStrTable, name: PIdent): PSym = +proc strTableGet(t: TStrTable, name: PIdent): PSym = var h: THash = name.h and high(t.data) while true: result = t.data[h] @@ -624,13 +623,13 @@ proc StrTableGet(t: TStrTable, name: PIdent): PSym = if result.name.id == name.id: break h = nextTry(h, high(t.data)) -proc InitIdentIter(ti: var TIdentIter, tab: TStrTable, s: PIdent): PSym = +proc initIdentIter(ti: var TIdentIter, tab: TStrTable, s: PIdent): PSym = ti.h = s.h ti.name = s if tab.Counter == 0: result = nil else: result = NextIdentIter(ti, tab) -proc NextIdentIter(ti: var TIdentIter, tab: TStrTable): PSym = +proc nextIdentIter(ti: var TIdentIter, tab: TStrTable): PSym = var h, start: THash h = ti.h and high(tab.data) start = h @@ -644,7 +643,7 @@ proc NextIdentIter(ti: var TIdentIter, tab: TStrTable): PSym = result = tab.data[h] ti.h = nextTry(h, high(tab.data)) -proc NextIdentExcluding*(ti: var TIdentIter, tab: TStrTable, +proc nextIdentExcluding*(ti: var TIdentIter, tab: TStrTable, excluding: TIntSet): PSym = var h: THash = ti.h and high(tab.data) var start = h @@ -660,33 +659,33 @@ proc NextIdentExcluding*(ti: var TIdentIter, tab: TStrTable, ti.h = nextTry(h, high(tab.data)) if result != nil and Contains(excluding, result.id): result = nil -proc FirstIdentExcluding*(ti: var TIdentIter, tab: TStrTable, s: PIdent, +proc firstIdentExcluding*(ti: var TIdentIter, tab: TStrTable, s: PIdent, excluding: TIntSet): PSym = ti.h = s.h ti.name = s if tab.Counter == 0: result = nil else: result = NextIdentExcluding(ti, tab, excluding) -proc InitTabIter(ti: var TTabIter, tab: TStrTable): PSym = +proc initTabIter(ti: var TTabIter, tab: TStrTable): PSym = ti.h = 0 # we start by zero ... if tab.counter == 0: result = nil # FIX 1: removed endless loop else: result = NextIter(ti, tab) -proc NextIter(ti: var TTabIter, tab: TStrTable): PSym = +proc nextIter(ti: var TTabIter, tab: TStrTable): PSym = result = nil while (ti.h <= high(tab.data)): result = tab.data[ti.h] - Inc(ti.h) # ... and increment by one always + inc(ti.h) # ... and increment by one always if result != nil: break iterator items*(tab: TStrTable): PSym = var it: TTabIter - var s = InitTabIter(it, tab) + var s = initTabIter(it, tab) while s != nil: yield s - s = NextIter(it, tab) + s = nextIter(it, tab) proc hasEmptySlot(data: TIdPairSeq): bool = for h in countup(0, high(data)): @@ -694,7 +693,7 @@ proc hasEmptySlot(data: TIdPairSeq): bool = return true result = false -proc IdTableRawGet(t: TIdTable, key: int): int = +proc idTableRawGet(t: TIdTable, key: int): int = var h: THash h = key and high(t.data) # start with real hash value while t.data[h].key != nil: @@ -703,18 +702,18 @@ proc IdTableRawGet(t: TIdTable, key: int): int = h = nextTry(h, high(t.data)) result = - 1 -proc IdTableHasObjectAsKey(t: TIdTable, key: PIdObj): bool = - var index = IdTableRawGet(t, key.id) +proc idTableHasObjectAsKey(t: TIdTable, key: PIdObj): bool = + var index = idTableRawGet(t, key.id) if index >= 0: result = t.data[index].key == key else: result = false -proc IdTableGet(t: TIdTable, key: PIdObj): PObject = - var index = IdTableRawGet(t, key.id) +proc idTableGet(t: TIdTable, key: PIdObj): PObject = + var index = idTableRawGet(t, key.id) if index >= 0: result = t.data[index].val else: result = nil -proc IdTableGet(t: TIdTable, key: int): PObject = - var index = IdTableRawGet(t, key) +proc idTableGet(t: TIdTable, key: int): PObject = + var index = idTableRawGet(t, key) if index >= 0: result = t.data[index].val else: result = nil @@ -723,7 +722,7 @@ iterator pairs*(t: TIdTable): tuple[key: int, value: PObject] = if t.data[i].key != nil: yield (t.data[i].key.id, t.data[i].val) -proc IdTableRawInsert(data: var TIdPairSeq, key: PIdObj, val: PObject) = +proc idTableRawInsert(data: var TIdPairSeq, key: PIdObj, val: PObject) = var h: THash h = key.id and high(data) while data[h].key != nil: @@ -733,7 +732,7 @@ proc IdTableRawInsert(data: var TIdPairSeq, key: PIdObj, val: PObject) = data[h].key = key data[h].val = val -proc IdTablePut(t: var TIdTable, key: PIdObj, val: PObject) = +proc idTablePut(t: var TIdTable, key: PIdObj, val: PObject) = var index: int n: TIdPairSeq @@ -752,14 +751,11 @@ proc IdTablePut(t: var TIdTable, key: PIdObj, val: PObject) = IdTableRawInsert(t.data, key, val) inc(t.counter) -iterator IdTablePairs*(t: TIdTable): tuple[key: PIdObj, val: PObject] = +iterator idTablePairs*(t: TIdTable): tuple[key: PIdObj, val: PObject] = for i in 0 .. high(t.data): if not isNil(t.data[i].key): yield (t.data[i].key, t.data[i].val) -proc writeIdNodeTable(t: TIdNodeTable) = - nil - -proc IdNodeTableRawGet(t: TIdNodeTable, key: PIdObj): int = +proc idNodeTableRawGet(t: TIdNodeTable, key: PIdObj): int = var h: THash h = key.id and high(t.data) # start with real hash value while t.data[h].key != nil: @@ -768,17 +764,17 @@ proc IdNodeTableRawGet(t: TIdNodeTable, key: PIdObj): int = h = nextTry(h, high(t.data)) result = - 1 -proc IdNodeTableGet(t: TIdNodeTable, key: PIdObj): PNode = +proc idNodeTableGet(t: TIdNodeTable, key: PIdObj): PNode = var index: int - index = IdNodeTableRawGet(t, key) + index = idNodeTableRawGet(t, key) if index >= 0: result = t.data[index].val else: result = nil -proc IdNodeTableGetLazy*(t: TIdNodeTable, key: PIdObj): PNode = +proc idNodeTableGetLazy*(t: TIdNodeTable, key: PIdObj): PNode = if not isNil(t.data): - result = IdNodeTableGet(t, key) + result = idNodeTableGet(t, key) -proc IdNodeTableRawInsert(data: var TIdNodePairSeq, key: PIdObj, val: PNode) = +proc idNodeTableRawInsert(data: var TIdNodePairSeq, key: PIdObj, val: PNode) = var h: THash h = key.id and high(data) while data[h].key != nil: @@ -788,7 +784,7 @@ proc IdNodeTableRawInsert(data: var TIdNodePairSeq, key: PIdObj, val: PNode) = data[h].key = key data[h].val = val -proc IdNodeTablePut(t: var TIdNodeTable, key: PIdObj, val: PNode) = +proc idNodeTablePut(t: var TIdNodeTable, key: PIdObj, val: PNode) = var index = IdNodeTableRawGet(t, key) if index >= 0: assert(t.data[index].key != nil) @@ -799,14 +795,14 @@ proc IdNodeTablePut(t: var TIdNodeTable, key: PIdObj, val: PNode) = newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: - IdNodeTableRawInsert(n, t.data[i].key, t.data[i].val) + idNodeTableRawInsert(n, t.data[i].key, t.data[i].val) swap(t.data, n) - IdNodeTableRawInsert(t.data, key, val) + idNodeTableRawInsert(t.data, key, val) inc(t.counter) -proc IdNodeTablePutLazy*(t: var TIdNodeTable, key: PIdObj, val: PNode) = +proc idNodeTablePutLazy*(t: var TIdNodeTable, key: PIdObj, val: PNode) = if isNil(t.data): initIdNodeTable(t) - IdNodeTablePut(t, key, val) + idNodeTablePut(t, key, val) iterator pairs*(t: TIdNodeTable): tuple[key: PIdObj, val: PNode] = for i in 0 .. high(t.data): @@ -817,21 +813,20 @@ proc initIITable(x: var TIITable) = newSeq(x.data, startSize) for i in countup(0, startSize - 1): x.data[i].key = InvalidKey -proc IITableRawGet(t: TIITable, key: int): int = +proc iiTableRawGet(t: TIITable, key: int): int = var h: THash h = key and high(t.data) # start with real hash value while t.data[h].key != InvalidKey: - if (t.data[h].key == key): - return h + if t.data[h].key == key: return h h = nextTry(h, high(t.data)) - result = - 1 + result = -1 -proc IITableGet(t: TIITable, key: int): int = - var index = IITableRawGet(t, key) +proc iiTableGet(t: TIITable, key: int): int = + var index = iiTableRawGet(t, key) if index >= 0: result = t.data[index].val else: result = InvalidKey -proc IITableRawInsert(data: var TIIPairSeq, key, val: int) = +proc iiTableRawInsert(data: var TIIPairSeq, key, val: int) = var h: THash h = key and high(data) while data[h].key != InvalidKey: @@ -841,7 +836,7 @@ proc IITableRawInsert(data: var TIIPairSeq, key, val: int) = data[h].key = key data[h].val = val -proc IITablePut(t: var TIITable, key, val: int) = +proc iiTablePut(t: var TIITable, key, val: int) = var index = IITableRawGet(t, key) if index >= 0: assert(t.data[index].key != InvalidKey) @@ -853,7 +848,7 @@ proc IITablePut(t: var TIITable, key, val: int) = for i in countup(0, high(n)): n[i].key = InvalidKey for i in countup(0, high(t.data)): if t.data[i].key != InvalidKey: - IITableRawInsert(n, t.data[i].key, t.data[i].val) + iiTableRawInsert(n, t.data[i].key, t.data[i].val) swap(t.data, n) - IITableRawInsert(t.data, key, val) + iiTableRawInsert(t.data, key, val) inc(t.counter) diff --git a/compiler/bitsets.nim b/compiler/bitsets.nim index dfb23b06d8..740bdd5ef9 100644 --- a/compiler/bitsets.nim +++ b/compiler/bitsets.nim @@ -18,53 +18,53 @@ type const ElemSize* = sizeof(int8) * 8 -proc BitSetInit*(b: var TBitSet, length: int) -proc BitSetUnion*(x: var TBitSet, y: TBitSet) -proc BitSetDiff*(x: var TBitSet, y: TBitSet) -proc BitSetSymDiff*(x: var TBitSet, y: TBitSet) -proc BitSetIntersect*(x: var TBitSet, y: TBitSet) -proc BitSetIncl*(x: var TBitSet, elem: BiggestInt) -proc BitSetExcl*(x: var TBitSet, elem: BiggestInt) -proc BitSetIn*(x: TBitSet, e: BiggestInt): bool -proc BitSetEquals*(x, y: TBitSet): bool -proc BitSetContains*(x, y: TBitSet): bool +proc bitSetInit*(b: var TBitSet, length: int) +proc bitSetUnion*(x: var TBitSet, y: TBitSet) +proc bitSetDiff*(x: var TBitSet, y: TBitSet) +proc bitSetSymDiff*(x: var TBitSet, y: TBitSet) +proc bitSetIntersect*(x: var TBitSet, y: TBitSet) +proc bitSetIncl*(x: var TBitSet, elem: BiggestInt) +proc bitSetExcl*(x: var TBitSet, elem: BiggestInt) +proc bitSetIn*(x: TBitSet, e: BiggestInt): bool +proc bitSetEquals*(x, y: TBitSet): bool +proc bitSetContains*(x, y: TBitSet): bool # implementation -proc BitSetIn(x: TBitSet, e: BiggestInt): bool = +proc bitSetIn(x: TBitSet, e: BiggestInt): bool = result = (x[int(e div ElemSize)] and toU8(int(1 shl (e mod ElemSize)))) != toU8(0) -proc BitSetIncl(x: var TBitSet, elem: BiggestInt) = +proc bitSetIncl(x: var TBitSet, elem: BiggestInt) = assert(elem >= 0) x[int(elem div ElemSize)] = x[int(elem div ElemSize)] or toU8(int(1 shl (elem mod ElemSize))) -proc BitSetExcl(x: var TBitSet, elem: BiggestInt) = +proc bitSetExcl(x: var TBitSet, elem: BiggestInt) = x[int(elem div ElemSize)] = x[int(elem div ElemSize)] and not toU8(int(1 shl (elem mod ElemSize))) -proc BitSetInit(b: var TBitSet, length: int) = +proc bitSetInit(b: var TBitSet, length: int) = newSeq(b, length) -proc BitSetUnion(x: var TBitSet, y: TBitSet) = +proc bitSetUnion(x: var TBitSet, y: TBitSet) = for i in countup(0, high(x)): x[i] = x[i] or y[i] -proc BitSetDiff(x: var TBitSet, y: TBitSet) = +proc bitSetDiff(x: var TBitSet, y: TBitSet) = for i in countup(0, high(x)): x[i] = x[i] and not y[i] -proc BitSetSymDiff(x: var TBitSet, y: TBitSet) = +proc bitSetSymDiff(x: var TBitSet, y: TBitSet) = for i in countup(0, high(x)): x[i] = x[i] xor y[i] -proc BitSetIntersect(x: var TBitSet, y: TBitSet) = +proc bitSetIntersect(x: var TBitSet, y: TBitSet) = for i in countup(0, high(x)): x[i] = x[i] and y[i] -proc BitSetEquals(x, y: TBitSet): bool = +proc bitSetEquals(x, y: TBitSet): bool = for i in countup(0, high(x)): if x[i] != y[i]: return false result = true -proc BitSetContains(x, y: TBitSet): bool = +proc bitSetContains(x, y: TBitSet): bool = for i in countup(0, high(x)): if (x[i] and not y[i]) != int8(0): return false diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 873c61ed4a..a9097a2641 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -1669,14 +1669,14 @@ proc genTupleConstr(p: BProc, n: PNode, d: var TLoc) = [rdLoc(d), mangleRecFieldName(t.n.sons[i].sym, t)]) expr(p, it, rec) -proc IsConstClosure(n: PNode): bool {.inline.} = +proc isConstClosure(n: PNode): bool {.inline.} = result = n.sons[0].kind == nkSym and isRoutine(n.sons[0].sym) and n.sons[1].kind == nkNilLit proc genClosure(p: BProc, n: PNode, d: var TLoc) = assert n.kind == nkClosure - if IsConstClosure(n): + if isConstClosure(n): inc(p.labels) var tmp = con("LOC", toRope(p.labels)) appf(p.module.s[cfsData], "NIM_CONST $1 $2 = $3;$n", diff --git a/compiler/ccgmerge.nim b/compiler/ccgmerge.nim index c6c294b97c..de207c532b 100644 --- a/compiler/ccgmerge.nim +++ b/compiler/ccgmerge.nim @@ -208,7 +208,7 @@ proc readKey(L: var TBaseLexer, result: var string) = if buf[pos] != ':': internalError("ccgmerge: ':' expected") L.bufpos = pos + 1 # skip ':' -proc NewFakeType(id: int): PType = +proc newFakeType(id: int): PType = new(result) result.id = id @@ -323,4 +323,3 @@ proc mergeFiles*(cfilename: string, m: BModule) = m.s[i] = con(old.f[i], m.s[i]) for i in low(TCProcSection)..high(TCProcSection): m.initProc.s(i) = con(old.p[i], m.initProc.s(i)) - diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index d9e6d83d0c..9b56556fc1 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -232,11 +232,11 @@ proc genIf(p: BProc, n: PNode, d: var TLoc) = # Lend: var a: TLoc - Lelse: TLabel + lelse: TLabel if not isEmptyType(n.typ) and d.k == locNone: getTemp(p, n.typ, d) genLineDir(p, n) - let Lend = getLabel(p) + let lend = getLabel(p) for i in countup(0, sonsLen(n) - 1): let it = n.sons[i] if it.len == 2: @@ -251,14 +251,14 @@ proc genIf(p: BProc, n: PNode, d: var TLoc) = expr(p, it.sons[1], d) endBlock(p) if sonsLen(n) > 1: - lineFF(p, cpsStmts, "goto $1;$n", "br label %$1$n", [Lend]) + lineFF(p, cpsStmts, "goto $1;$n", "br label %$1$n", [lend]) fixLabel(p, Lelse) elif it.len == 1: startBlock(p) expr(p, it.sons[0], d) endBlock(p) else: internalError(n.info, "genIf()") - if sonsLen(n) > 1: fixLabel(p, Lend) + if sonsLen(n) > 1: fixLabel(p, lend) proc blockLeaveActions(p: BProc, howMany: int) = var L = p.nestedTryStmts.len @@ -367,7 +367,7 @@ proc genWhileStmt(p: BProc, t: PNode) = # significantly worse code var a: TLoc - Labl: TLabel + labl: TLabel assert(sonsLen(t) == 2) inc(p.withinLoop) genLineDir(p, t) @@ -499,16 +499,16 @@ proc genCaseGenericBranch(p: BProc, b: PNode, e: TLoc, proc genCaseSecondPass(p: BProc, t: PNode, d: var TLoc, labId, until: int): TLabel = - var Lend = getLabel(p) + var lend = getLabel(p) for i in 1..until: lineF(p, cpsStmts, "LA$1: ;$n", [toRope(labId + i)]) if t.sons[i].kind == nkOfBranch: var length = sonsLen(t.sons[i]) exprBlock(p, t.sons[i].sons[length - 1], d) - lineF(p, cpsStmts, "goto $1;$n", [Lend]) + lineF(p, cpsStmts, "goto $1;$n", [lend]) else: exprBlock(p, t.sons[i].sons[0], d) - result = Lend + result = lend proc genIfForCaseUntil(p: BProc, t: PNode, d: var TLoc, rangeFormat, eqFormat: TFormatStr, @@ -535,8 +535,8 @@ proc genCaseGeneric(p: BProc, t: PNode, d: var TLoc, rangeFormat, eqFormat: TFormatStr) = var a: TLoc initLocExpr(p, t.sons[0], a) - var Lend = genIfForCaseUntil(p, t, d, rangeFormat, eqFormat, sonsLen(t)-1, a) - fixLabel(p, Lend) + var lend = genIfForCaseUntil(p, t, d, rangeFormat, eqFormat, sonsLen(t)-1, a) + fixLabel(p, lend) proc genCaseStringBranch(p: BProc, b: PNode, e: TLoc, labl: TLabel, branches: var openArray[PRope]) = @@ -580,8 +580,8 @@ proc genStringCase(p: BProc, t: PNode, d: var TLoc) = if t.sons[sonsLen(t)-1].kind != nkOfBranch: lineF(p, cpsStmts, "goto LA$1;$n", [toRope(p.labels)]) # third pass: generate statements - var Lend = genCaseSecondPass(p, t, d, labId, sonsLen(t)-1) - fixLabel(p, Lend) + var lend = genCaseSecondPass(p, t, d, labId, sonsLen(t)-1) + fixLabel(p, lend) else: genCaseGeneric(p, t, d, "", "if (#eqStrings($1, $2)) goto $3;$n") @@ -592,7 +592,7 @@ proc branchHasTooBigRange(b: PNode): bool = b.sons[i].sons[1].intVal - b.sons[i].sons[0].intVal > RangeExpandLimit: return true -proc IfSwitchSplitPoint(p: BProc, n: PNode): int = +proc ifSwitchSplitPoint(p: BProc, n: PNode): int = for i in 1..n.len-1: var branch = n[i] var stmtBlock = lastSon(branch) @@ -625,7 +625,7 @@ proc genOrdinalCase(p: BProc, n: PNode, d: var TLoc) = # generate if part (might be empty): var a: TLoc initLocExpr(p, n.sons[0], a) - var Lend = if splitPoint > 0: genIfForCaseUntil(p, n, d, + var lend = if splitPoint > 0: genIfForCaseUntil(p, n, d, rangeFormat = "if ($1 >= $2 && $1 <= $3) goto $4;$n", eqFormat = "if ($1 == $2) goto $3;$n", splitPoint, a) else: nil @@ -647,7 +647,7 @@ proc genOrdinalCase(p: BProc, n: PNode, d: var TLoc) = if (hasAssume in CC[ccompiler].props) and not hasDefault: lineF(p, cpsStmts, "default: __assume(0);$n") lineF(p, cpsStmts, "}$n") - if Lend != nil: fixLabel(p, Lend) + if lend != nil: fixLabel(p, lend) proc genCase(p: BProc, t: PNode, d: var TLoc) = genLineDir(p, t) @@ -928,7 +928,7 @@ proc genPragma(p: BProc, n: PNode) = p.module.injectStmt = p.s(cpsStmts) else: discard -proc FieldDiscriminantCheckNeeded(p: BProc, asgn: PNode): bool = +proc fieldDiscriminantCheckNeeded(p: BProc, asgn: PNode): bool = if optFieldCheck in p.options: var le = asgn.sons[0] if le.kind == nkCheckedFieldExpr: diff --git a/compiler/ccgthreadvars.nim b/compiler/ccgthreadvars.nim index d312ea0278..ee01972fce 100644 --- a/compiler/ccgthreadvars.nim +++ b/compiler/ccgthreadvars.nim @@ -17,7 +17,7 @@ proc emulatedThreadVars(): bool = proc accessThreadLocalVar(p: BProc, s: PSym) = if emulatedThreadVars() and not p.ThreadVarAccessed: - p.ThreadVarAccessed = true + p.threadVarAccessed = true p.module.usesThreadVars = true appf(p.procSec(cpsLocals), "\tNimThreadVars* NimTV;$n") app(p.procSec(cpsInit), @@ -55,7 +55,7 @@ proc generateThreadLocalStorage(m: BModule) = for t in items(nimtvDeps): discard getTypeDesc(m, t) appf(m.s[cfsSeqTypes], "typedef struct {$1} NimThreadVars;$n", [nimtv]) -proc GenerateThreadVarsSize(m: BModule) = +proc generateThreadVarsSize(m: BModule) = if nimtv != nil: app(m.s[cfsProcs], "NI NimThreadVarsSize(){return (NI)sizeof(NimThreadVars);}" & tnl) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 4548ac641f..66441af5e6 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -229,11 +229,11 @@ const "stdcall $1", "ccc $1", "safecall $1", "syscall $1", "$1 alwaysinline", "$1 noinline", "fastcc $1", "ccc $1", "$1"] -proc CacheGetType(tab: TIdTable, key: PType): PRope = +proc cacheGetType(tab: TIdTable, key: PType): PRope = # returns nil if we need to declare this type # since types are now unique via the ``GetUniqueType`` mechanism, this slow # linear search is not necessary anymore: - result = PRope(IdTableGet(tab, key)) + result = PRope(idTableGet(tab, key)) proc getTempName(): PRope = result = rfmt(nil, "TMP$1", toRope(backendId())) @@ -952,4 +952,4 @@ proc genTypeInfo(m: BModule, t: PType): PRope = result = con("(&".toRope, result, ")".toRope) proc genTypeSection(m: BModule, n: PNode) = - nil + discard diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index 310f7204ae..accb7a2614 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -22,7 +22,7 @@ proc getPragmaStmt*(n: PNode, w: TSpecialWord): PNode = of nkPragma: for i in 0 .. < n.len: if whichPragma(n[i]) == w: return n[i] - else: nil + else: discard proc stmtsContainPragma*(n: PNode, w: TSpecialWord): bool = result = getPragmaStmt(n, w) != nil @@ -70,7 +70,7 @@ when false: for i in countup(low(TTypeKind), high(TTypeKind)): echo i, " ", gTypeTable[i].counter -proc GetUniqueType*(key: PType): PType = +proc getUniqueType*(key: PType): PType = # this is a hotspot in the compiler! if key == nil: return var k = key.kind @@ -87,11 +87,11 @@ proc GetUniqueType*(key: PType): PType = gCanonicalTypes[k] = key result = key of tyTypeDesc, tyTypeClasses: - InternalError("value expected, but got a type") + internalError("value expected, but got a type") of tyGenericParam: - InternalError("GetUniqueType") + internalError("GetUniqueType") of tyGenericInst, tyDistinct, tyOrdinal, tyMutable, tyConst, tyIter: - result = GetUniqueType(lastSon(key)) + result = getUniqueType(lastSon(key)) of tyArrayConstr, tyGenericInvokation, tyGenericBody, tyOpenArray, tyArray, tySet, tyRange, tyTuple, tyPtr, tyRef, tySequence, tyForward, tyVarargs, tyProxy, tyVar: @@ -102,33 +102,33 @@ proc GetUniqueType*(key: PType): PType = # we have to do a slow linear search because types may need # to be compared by their structure: - if IdTableHasObjectAsKey(gTypeTable[k], key): return key + if idTableHasObjectAsKey(gTypeTable[k], key): return key for h in countup(0, high(gTypeTable[k].data)): var t = PType(gTypeTable[k].data[h].key) if t != nil and sameBackendType(t, key): return t - IdTablePut(gTypeTable[k], key, key) + idTablePut(gTypeTable[k], key, key) result = key of tyObject: if tfFromGeneric notin key.flags: # fast case; lookup per id suffices: - result = PType(IdTableGet(gTypeTable[k], key)) + result = PType(idTableGet(gTypeTable[k], key)) if result == nil: - IdTablePut(gTypeTable[k], key, key) + idTablePut(gTypeTable[k], key, key) result = key else: # ugly slow case: need to compare by structure - if IdTableHasObjectAsKey(gTypeTable[k], key): return key + if idTableHasObjectAsKey(gTypeTable[k], key): return key for h in countup(0, high(gTypeTable[k].data)): var t = PType(gTypeTable[k].data[h].key) if t != nil and sameType(t, key): return t - IdTablePut(gTypeTable[k], key, key) + idTablePut(gTypeTable[k], key, key) result = key of tyEnum: - result = PType(IdTableGet(gTypeTable[k], key)) + result = PType(idTableGet(gTypeTable[k], key)) if result == nil: - IdTablePut(gTypeTable[k], key, key) + idTablePut(gTypeTable[k], key, key) result = key of tyProc: # tyVar is not 100% correct, but would speeds things up a little: @@ -136,17 +136,17 @@ proc GetUniqueType*(key: PType): PType = result = key else: # ugh, we need the canon here: - if IdTableHasObjectAsKey(gTypeTable[k], key): return key + if idTableHasObjectAsKey(gTypeTable[k], key): return key for h in countup(0, high(gTypeTable[k].data)): var t = PType(gTypeTable[k].data[h].key) if t != nil and sameBackendType(t, key): return t - IdTablePut(gTypeTable[k], key, key) + idTablePut(gTypeTable[k], key, key) result = key -proc TableGetType*(tab: TIdTable, key: PType): PObject = +proc tableGetType*(tab: TIdTable, key: PType): PObject = # returns nil if we need to declare this type - result = IdTableGet(tab, key) + result = idTableGet(tab, key) if (result == nil) and (tab.counter > 0): # we have to do a slow linear search because types may need # to be compared by their structure: @@ -178,4 +178,4 @@ proc makeLLVMString*(s: string): PRope = add(res, "\\00\"") app(result, toRope(res)) -InitTypeTables() +initTypeTables() diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 6ccef5fde4..ad1dfa89ef 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -513,7 +513,7 @@ proc assignLocalVar(p: BProc, s: PSym) = include ccgthreadvars -proc VarInDynamicLib(m: BModule, sym: PSym) +proc varInDynamicLib(m: BModule, sym: PSym) proc mangleDynLibProc(sym: PSym): PRope proc assignGlobalVar(p: BProc, s: PSym) = @@ -641,7 +641,7 @@ proc mangleDynLibProc(sym: PSym): PRope = else: result = ropef("Dl_$1", [toRope(sym.id)]) -proc SymInDynamicLib(m: BModule, sym: PSym) = +proc symInDynamicLib(m: BModule, sym: PSym) = var lib = sym.annex let isCall = isGetProcAddr(lib) var extname = sym.loc.r @@ -682,7 +682,7 @@ proc SymInDynamicLib(m: BModule, sym: PSym) = "$1 = linkonce global $2 zeroinitializer$n", [sym.loc.r, getTypeDesc(m, sym.loc.t)]) -proc VarInDynamicLib(m: BModule, sym: PSym) = +proc varInDynamicLib(m: BModule, sym: PSym) = var lib = sym.annex var extname = sym.loc.r loadDynamicLib(m, lib) @@ -697,7 +697,7 @@ proc VarInDynamicLib(m: BModule, sym: PSym) = appf(m.s[cfsVars], "$2* $1;$n", [sym.loc.r, getTypeDesc(m, sym.loc.t)]) -proc SymInDynamicLibPartial(m: BModule, sym: PSym) = +proc symInDynamicLibPartial(m: BModule, sym: PSym) = sym.loc.r = mangleDynLibProc(sym) sym.typ.sym = nil # generate a new name diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim index 33bb94b38e..3467fea7e1 100644 --- a/compiler/cgmeth.nim +++ b/compiler/cgmeth.nim @@ -126,14 +126,14 @@ proc cmpSignatures(a, b: PSym, relevantCols: TIntSet): int = proc sortBucket(a: var TSymSeq, relevantCols: TIntSet) = # we use shellsort here; fast and simple - var N = len(a) + var n = len(a) var h = 1 while true: h = 3 * h + 1 - if h > N: break + if h > n: break while true: h = h div 3 - for i in countup(h, N - 1): + for i in countup(h, n - 1): var v = a[i] var j = i while cmpSignatures(a[j - h], v, relevantCols) >= 0: diff --git a/compiler/commands.nim b/compiler/commands.nim index a02728dacd..e67b0d4228 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -21,7 +21,7 @@ type passCmd2, # second pass over the command line passPP # preprocessor called ProcessCommand() -proc ProcessCommand*(switch: string, pass: TCmdLinePass) +proc processCommand*(switch: string, pass: TCmdLinePass) proc processSwitch*(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) # implementation @@ -38,21 +38,21 @@ proc getCommandLineDesc(): string = result = (HelpMessage % [VersionAsString, platform.os[platform.hostOS].name, cpu[platform.hostCPU].name]) & Usage -proc HelpOnError(pass: TCmdLinePass) = +proc helpOnError(pass: TCmdLinePass) = if pass == passCmd1: - MsgWriteln(getCommandLineDesc()) + msgWriteln(getCommandLineDesc()) quit(0) proc writeAdvancedUsage(pass: TCmdLinePass) = if pass == passCmd1: - MsgWriteln(`%`(HelpMessage, [VersionAsString, + msgWriteln(`%`(HelpMessage, [VersionAsString, platform.os[platform.hostOS].name, cpu[platform.hostCPU].name]) & AdvancedUsage) quit(0) proc writeVersionInfo(pass: TCmdLinePass) = if pass == passCmd1: - MsgWriteln(`%`(HelpMessage, [VersionAsString, + msgWriteln(`%`(HelpMessage, [VersionAsString, platform.os[platform.hostOS].name, cpu[platform.hostCPU].name])) quit(0) @@ -62,16 +62,16 @@ var proc writeCommandLineUsage() = if not helpWritten: - MsgWriteln(getCommandLineDesc()) + msgWriteln(getCommandLineDesc()) helpWritten = true proc addPrefix(switch: string): string = if len(switch) == 1: result = "-" & switch else: result = "--" & switch -proc InvalidCmdLineOption(pass: TCmdLinePass, switch: string, info: TLineInfo) = - if switch == " ": LocalError(info, errInvalidCmdLineOption, "-") - else: LocalError(info, errInvalidCmdLineOption, addPrefix(switch)) +proc invalidCmdLineOption(pass: TCmdLinePass, switch: string, info: TLineInfo) = + if switch == " ": localError(info, errInvalidCmdLineOption, "-") + else: localError(info, errInvalidCmdLineOption, addPrefix(switch)) proc splitSwitch(switch: string, cmd, arg: var string, pass: TCmdLinePass, info: TLineInfo) = @@ -86,29 +86,29 @@ proc splitSwitch(switch: string, cmd, arg: var string, pass: TCmdLinePass, inc(i) if i >= len(switch): arg = "" elif switch[i] in {':', '=', '['}: arg = substr(switch, i + 1) - else: InvalidCmdLineOption(pass, switch, info) + else: invalidCmdLineOption(pass, switch, info) -proc ProcessOnOffSwitch(op: TOptions, arg: string, pass: TCmdlinePass, +proc processOnOffSwitch(op: TOptions, arg: string, pass: TCmdlinePass, info: TLineInfo) = case whichKeyword(arg) of wOn: gOptions = gOptions + op of wOff: gOptions = gOptions - op - else: LocalError(info, errOnOrOffExpectedButXFound, arg) + else: localError(info, errOnOrOffExpectedButXFound, arg) -proc ProcessOnOffSwitchG(op: TGlobalOptions, arg: string, pass: TCmdlinePass, +proc processOnOffSwitchG(op: TGlobalOptions, arg: string, pass: TCmdlinePass, info: TLineInfo) = case whichKeyword(arg) of wOn: gGlobalOptions = gGlobalOptions + op of wOff: gGlobalOptions = gGlobalOptions - op - else: LocalError(info, errOnOrOffExpectedButXFound, arg) + else: localError(info, errOnOrOffExpectedButXFound, arg) -proc ExpectArg(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = - if arg == "": LocalError(info, errCmdLineArgExpected, addPrefix(switch)) +proc expectArg(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = + if arg == "": localError(info, errCmdLineArgExpected, addPrefix(switch)) -proc ExpectNoArg(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = - if arg != "": LocalError(info, errCmdLineNoArgExpected, addPrefix(switch)) +proc expectNoArg(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = + if arg != "": localError(info, errCmdLineNoArgExpected, addPrefix(switch)) -proc ProcessSpecificNote(arg: string, state: TSpecialWord, pass: TCmdlinePass, +proc processSpecificNote(arg: string, state: TSpecialWord, pass: TCmdlinePass, info: TLineInfo) = var id = "" # arg = "X]:on|off" var i = 0 @@ -117,21 +117,21 @@ proc ProcessSpecificNote(arg: string, state: TSpecialWord, pass: TCmdlinePass, add(id, arg[i]) inc(i) if i < len(arg) and (arg[i] == ']'): inc(i) - else: InvalidCmdLineOption(pass, arg, info) + else: invalidCmdLineOption(pass, arg, info) if i < len(arg) and (arg[i] in {':', '='}): inc(i) - else: InvalidCmdLineOption(pass, arg, info) + else: invalidCmdLineOption(pass, arg, info) if state == wHint: var x = findStr(msgs.HintsToStr, id) if x >= 0: n = TNoteKind(x + ord(hintMin)) - else: InvalidCmdLineOption(pass, arg, info) + else: invalidCmdLineOption(pass, arg, info) else: var x = findStr(msgs.WarningsToStr, id) if x >= 0: n = TNoteKind(x + ord(warnMin)) - else: InvalidCmdLineOption(pass, arg, info) + else: invalidCmdLineOption(pass, arg, info) case whichKeyword(substr(arg, i)) of wOn: incl(gNotes, n) of wOff: excl(gNotes, n) - else: LocalError(info, errOnOrOffExpectedButXFound, arg) + else: localError(info, errOnOrOffExpectedButXFound, arg) proc processCompile(filename: string) = var found = findFile(filename) @@ -150,14 +150,14 @@ proc testCompileOptionArg*(switch, arg: string, info: TLineInfo): bool = of "markandsweep": result = gSelectedGC == gcMarkAndSweep of "generational": result = gSelectedGC == gcGenerational of "none": result = gSelectedGC == gcNone - else: LocalError(info, errNoneBoehmRefcExpectedButXFound, arg) + else: localError(info, errNoneBoehmRefcExpectedButXFound, arg) of "opt": case arg.normalize of "speed": result = contains(gOptions, optOptimizeSpeed) of "size": result = contains(gOptions, optOptimizeSize) of "none": result = gOptions * {optOptimizeSpeed, optOptimizeSize} == {} - else: LocalError(info, errNoneSpeedOrSizeExpectedButXFound, arg) - else: InvalidCmdLineOption(passCmd1, switch, info) + else: localError(info, errNoneSpeedOrSizeExpectedButXFound, arg) + else: invalidCmdLineOption(passCmd1, switch, info) proc testCompileOption*(switch: string, info: TLineInfo): bool = case switch.normalize @@ -194,7 +194,7 @@ proc testCompileOption*(switch: string, info: TLineInfo): bool = of "tlsemulation": result = contains(gGlobalOptions, optTlsEmulation) of "implicitstatic": result = contains(gOptions, optImplicitStatic) of "patterns": result = contains(gOptions, optPatterns) - else: InvalidCmdLineOption(passCmd1, switch, info) + else: invalidCmdLineOption(passCmd1, switch, info) proc processPath(path: string, notRelativeToProj = false): string = let p = if notRelativeToProj or os.isAbsolute(path) or @@ -202,20 +202,20 @@ proc processPath(path: string, notRelativeToProj = false): string = path else: options.gProjectPath / path - result = UnixToNativePath(p % ["nimrod", getPrefixDir(), "lib", libpath, + result = unixToNativePath(p % ["nimrod", getPrefixDir(), "lib", libpath, "home", removeTrailingDirSep(os.getHomeDir()), "projectname", options.gProjectName, "projectpath", options.gProjectPath]) proc trackDirty(arg: string, info: TLineInfo) = var a = arg.split(',') - if a.len != 4: LocalError(info, errTokenExpected, + if a.len != 4: localError(info, errTokenExpected, "DIRTY_BUFFER,ORIGINAL_FILE,LINE,COLUMN") var line, column: int if parseUtils.parseInt(a[2], line) <= 0: - LocalError(info, errInvalidNumber, a[1]) + localError(info, errInvalidNumber, a[1]) if parseUtils.parseInt(a[3], column) <= 0: - LocalError(info, errInvalidNumber, a[2]) + localError(info, errInvalidNumber, a[2]) gDirtyBufferIdx = a[0].fileInfoIdx gDirtyOriginalIdx = a[1].fileInfoIdx @@ -225,12 +225,12 @@ proc trackDirty(arg: string, info: TLineInfo) = proc track(arg: string, info: TLineInfo) = var a = arg.split(',') - if a.len != 3: LocalError(info, errTokenExpected, "FILE,LINE,COLUMN") + if a.len != 3: localError(info, errTokenExpected, "FILE,LINE,COLUMN") var line, column: int if parseUtils.parseInt(a[1], line) <= 0: - LocalError(info, errInvalidNumber, a[1]) + localError(info, errInvalidNumber, a[1]) if parseUtils.parseInt(a[2], column) <= 0: - LocalError(info, errInvalidNumber, a[2]) + localError(info, errInvalidNumber, a[2]) optTrackPos = newLineInfo(a[0], line, column) msgs.addCheckpoint(optTrackPos) @@ -305,7 +305,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = case arg.normalize of "boehm": gSelectedGC = gcBoehm - DefineSymbol("boehmgc") + defineSymbol("boehmgc") of "refc": gSelectedGC = gcRefc of "v2": @@ -319,8 +319,8 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "none": gSelectedGC = gcNone defineSymbol("nogc") - else: LocalError(info, errNoneBoehmRefcExpectedButXFound, arg) - of "warnings", "w": ProcessOnOffSwitch({optWarns}, arg, pass, info) + else: localError(info, errNoneBoehmRefcExpectedButXFound, arg) + of "warnings", "w": processOnOffSwitch({optWarns}, arg, pass, info) of "warning": ProcessSpecificNote(arg, wWarning, pass, info) of "hint": ProcessSpecificNote(arg, wHint, pass, info) of "hints": ProcessOnOffSwitch({optHints}, arg, pass, info) @@ -517,13 +517,13 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = case arg of "partial": idents.firstCharIsCS = true of "none": idents.firstCharIsCS = false - else: LocalError(info, errGenerated, + else: localError(info, errGenerated, "'partial' or 'none' expected, but found " & arg) else: if strutils.find(switch, '.') >= 0: options.setConfigVar(switch, arg) - else: InvalidCmdLineOption(pass, switch, info) + else: invalidCmdLineOption(pass, switch, info) -proc ProcessCommand(switch: string, pass: TCmdLinePass) = +proc processCommand(switch: string, pass: TCmdLinePass) = var cmd, arg: string splitSwitch(switch, cmd, arg, pass, gCmdLineInfo) processSwitch(cmd, arg, pass, gCmdLineInfo) diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index 21095072b3..71dce9529e 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -16,10 +16,10 @@ import # to be style insensitive. Otherwise hell would break lose. var gSymbols: PStringTable -proc DefineSymbol*(symbol: string) = +proc defineSymbol*(symbol: string) = gSymbols[symbol] = "true" -proc UndefSymbol*(symbol: string) = +proc undefSymbol*(symbol: string) = gSymbols[symbol] = "false" proc isDefined*(symbol: string): bool = @@ -37,52 +37,52 @@ proc countDefinedSymbols*(): int = for key, val in pairs(gSymbols): if val == "true": inc(result) -proc InitDefines*() = +proc initDefines*() = gSymbols = newStringTable(modeStyleInsensitive) - DefineSymbol("nimrod") # 'nimrod' is always defined + defineSymbol("nimrod") # 'nimrod' is always defined # for bootstrapping purposes and old code: - DefineSymbol("nimhygiene") - DefineSymbol("niminheritable") - DefineSymbol("nimmixin") - DefineSymbol("nimeffects") - DefineSymbol("nimbabel") - DefineSymbol("nimcomputedgoto") + defineSymbol("nimhygiene") + defineSymbol("niminheritable") + defineSymbol("nimmixin") + defineSymbol("nimeffects") + defineSymbol("nimbabel") + defineSymbol("nimcomputedgoto") # add platform specific symbols: case targetCPU - of cpuI386: DefineSymbol("x86") - of cpuIa64: DefineSymbol("itanium") - of cpuAmd64: DefineSymbol("x8664") + of cpuI386: defineSymbol("x86") + of cpuIa64: defineSymbol("itanium") + of cpuAmd64: defineSymbol("x8664") else: discard case targetOS of osDOS: - DefineSymbol("msdos") + defineSymbol("msdos") of osWindows: - DefineSymbol("mswindows") - DefineSymbol("win32") + defineSymbol("mswindows") + defineSymbol("win32") of osLinux, osMorphOS, osSkyOS, osIrix, osPalmOS, osQNX, osAtari, osAix, osHaiku: # these are all 'unix-like' - DefineSymbol("unix") - DefineSymbol("posix") + defineSymbol("unix") + defineSymbol("posix") of osSolaris: - DefineSymbol("sunos") - DefineSymbol("unix") - DefineSymbol("posix") + defineSymbol("sunos") + defineSymbol("unix") + defineSymbol("posix") of osNetBSD, osFreeBSD, osOpenBSD: - DefineSymbol("unix") - DefineSymbol("bsd") - DefineSymbol("posix") + defineSymbol("unix") + defineSymbol("bsd") + defineSymbol("posix") of osMacOS: - DefineSymbol("macintosh") + defineSymbol("macintosh") of osMacOSX: - DefineSymbol("macintosh") - DefineSymbol("unix") + defineSymbol("macintosh") + defineSymbol("unix") DefineSymbol("posix") else: discard - DefineSymbol("cpu" & $cpu[targetCPU].bit) - DefineSymbol(normalize(endianToStr[cpu[targetCPU].endian])) - DefineSymbol(cpu[targetCPU].name) - DefineSymbol(platform.os[targetOS].name) + defineSymbol("cpu" & $cpu[targetCPU].bit) + defineSymbol(normalize(endianToStr[cpu[targetCPU].endian])) + defineSymbol(cpu[targetCPU].name) + defineSymbol(platform.os[targetOS].name) if platform.OS[targetOS].props.contains(ospLacksThreadVars): - DefineSymbol("emulatedthreadvars") + defineSymbol("emulatedthreadvars") diff --git a/compiler/docgen.nim b/compiler/docgen.nim index d44018a2ba..018dcd2700 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -313,7 +313,7 @@ proc generateDoc*(d: PDoc, n: PNode) = of nkImportStmt: for i in 0 .. sonsLen(n)-1: traceDeps(d, n.sons[i]) of nkFromStmt, nkImportExceptStmt: traceDeps(d, n.sons[0]) - else: nil + else: discard proc generateJson(d: PDoc, n: PNode, jArray: PJsonNode = nil): PJsonNode = case n.kind @@ -355,7 +355,7 @@ proc generateJson(d: PDoc, n: PNode, jArray: PJsonNode = nil): PJsonNode = # generate documentation for the first branch only: if not checkForFalse(n.sons[0].sons[0]) and jArray != nil: discard generateJson(d, lastSon(n.sons[0]), jArray) - else: nil + else: discard proc genSection(d: PDoc, kind: TSymKind) = const sectionNames: array[skModule..skTemplate, string] = [ @@ -417,7 +417,7 @@ proc writeOutput*(d: PDoc, filename, outExt: string, useWarning = false) = else: writeRope(content, getOutFile(filename, outExt), useWarning) -proc CommandDoc*() = +proc commandDoc*() = var ast = parseFile(gProjectMainIdx) if ast == nil: return var d = newDocumentor(gProjectFull, options.gConfigVars) @@ -426,7 +426,7 @@ proc CommandDoc*() = writeOutput(d, gProjectFull, HtmlExt) generateIndex(d) -proc CommandRstAux(filename, outExt: string) = +proc commandRstAux(filename, outExt: string) = var filen = addFileExt(filename, "txt") var d = newDocumentor(filen, options.gConfigVars) var rst = parseRst(readFile(filen), filen, 0, 1, d.hasToc, @@ -439,14 +439,14 @@ proc CommandRstAux(filename, outExt: string) = writeOutput(d, filename, outExt) generateIndex(d) -proc CommandRst2Html*() = - CommandRstAux(gProjectFull, HtmlExt) +proc commandRst2Html*() = + commandRstAux(gProjectFull, HtmlExt) -proc CommandRst2TeX*() = +proc commandRst2TeX*() = splitter = "\\-" - CommandRstAux(gProjectFull, TexExt) + commandRstAux(gProjectFull, TexExt) -proc CommandJSON*() = +proc commandJSON*() = var ast = parseFile(gProjectMainIdx) if ast == nil: return var d = newDocumentor(gProjectFull, options.gConfigVars) @@ -460,7 +460,7 @@ proc CommandJSON*() = echo getOutFile(gProjectFull, JsonExt) writeRope(content, getOutFile(gProjectFull, JsonExt), useWarning = false) -proc CommandBuildIndex*() = +proc commandBuildIndex*() = var content = mergeIndexes(gProjectFull).toRope let code = ropeFormatNamedVars(getConfigVar("doc.file"), ["title", diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index d3b3cee757..629cf95eb2 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -324,7 +324,7 @@ var compileOptions: string = "" ccompilerpath: string = "" -proc NameToCC*(name: string): TSystemCC = +proc nameToCC*(name: string): TSystemCC = for i in countup(succ(ccNone), high(TSystemCC)): if cmpIgnoreStyle(name, CC[i].name) == 0: return i @@ -405,7 +405,7 @@ proc execExternalProgram*(cmd: string) = proc generateScript(projectFile: string, script: PRope) = let (dir, name, ext) = splitFile(projectFile) - WriteRope(script, dir / addFileExt("compile_" & name, + writeRope(script, dir / addFileExt("compile_" & name, platform.os[targetOS].scriptExt)) proc getOptSpeed(c: TSystemCC): string = @@ -439,7 +439,7 @@ var fileCounter: int proc add(s: var string, many: openarray[string]) = s.add many.join -proc CFileSpecificOptions(cfilename: string): string = +proc cFileSpecificOptions(cfilename: string): string = result = compileOptions var trunk = splitFile(cfilename).name if optCDebug in gGlobalOptions: @@ -541,7 +541,7 @@ proc addExternalFileToCompile*(filename: string) = if optForceFullMake in gGlobalOptions or externalFileChanged(filename): appendStr(externalToCompile, filename) -proc CompileCFile(list: TLinkedList, script: var PRope, cmds: var TStringSeq, +proc compileCFile(list: TLinkedList, script: var PRope, cmds: var TStringSeq, isExternal: bool) = var it = PStrEntry(list.head) while it != nil: @@ -554,7 +554,7 @@ proc CompileCFile(list: TLinkedList, script: var PRope, cmds: var TStringSeq, app(script, tnl) it = PStrEntry(it.next) -proc CallCCompiler*(projectfile: string) = +proc callCCompiler*(projectfile: string) = var linkCmd, buildgui, builddll: string if gGlobalOptions * {optCompileOnly, optGenScript} == {optCompileOnly}: @@ -564,8 +564,8 @@ proc CallCCompiler*(projectfile: string) = var c = ccompiler var script: PRope = nil var cmds: TStringSeq = @[] - CompileCFile(toCompile, script, cmds, false) - CompileCFile(externalToCompile, script, cmds, true) + compileCFile(toCompile, script, cmds, false) + compileCFile(externalToCompile, script, cmds, true) if optCompileOnly notin gGlobalOptions: if gNumberOfProcessors == 0: gNumberOfProcessors = countProcessors() var res = 0 @@ -640,7 +640,7 @@ proc CallCCompiler*(projectfile: string) = proc genMappingFiles(list: TLinkedList): PRope = var it = PStrEntry(list.head) while it != nil: - appf(result, "--file:r\"$1\"$N", [toRope(AddFileExt(it.data, cExt))]) + appf(result, "--file:r\"$1\"$N", [toRope(addFileExt(it.data, cExt))]) it = PStrEntry(it.next) proc writeMapping*(gSymbolMapping: PRope) = @@ -658,5 +658,5 @@ proc writeMapping*(gSymbolMapping: PRope) = app(code, strutils.escape(libpath)) appf(code, "\n[Symbols]$n$1", [gSymbolMapping]) - WriteRope(code, joinPath(gProjectPath, "mapping.txt")) + writeRope(code, joinPath(gProjectPath, "mapping.txt")) diff --git a/compiler/idents.nim b/compiler/idents.nim index 1e6f9d2fd6..ec903826af 100644 --- a/compiler/idents.nim +++ b/compiler/idents.nim @@ -102,7 +102,7 @@ proc getIdent*(identifier: string): PIdent = proc getIdent*(identifier: string, h: THash): PIdent = result = getIdent(cstring(identifier), len(identifier), h) -proc IdentEq*(id: PIdent, name: string): bool = +proc identEq*(id: PIdent, name: string): bool = result = id.id == getIdent(name).id var idAnon* = getIdent":anonymous" diff --git a/compiler/idgen.nim b/compiler/idgen.nim index fbf450c903..f47e2e3b64 100644 --- a/compiler/idgen.nim +++ b/compiler/idgen.nim @@ -23,8 +23,8 @@ when debugIds: proc registerID*(id: PIdObj) = when debugIDs: - if id.id == -1 or ContainsOrIncl(usedIds, id.id): - InternalError("ID already used: " & $id.id) + if id.id == -1 or containsOrIncl(usedIds, id.id): + internalError("ID already used: " & $id.id) proc getID*(): int {.inline.} = result = gFrontEndId @@ -37,7 +37,7 @@ proc backendId*(): int {.inline.} = proc setId*(id: int) {.inline.} = gFrontEndId = max(gFrontEndId, id + 1) -proc IDsynchronizationPoint*(idRange: int) = +proc idSynchronizationPoint*(idRange: int) = gFrontEndId = (gFrontEndId div IdRange + 1) * IdRange + 1 proc toGid(f: string): string = diff --git a/compiler/lexer.nim b/compiler/lexer.nim index eb9287dfef..7410f7ec58 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -132,7 +132,7 @@ proc getLineInfo*(L: TLexer, tok: TToken): TLineInfo {.inline.} = newLineInfo(L.fileIdx, tok.line, tok.col) proc closeLexer*(lex: var TLexer) -proc PrintTok*(tok: TToken) +proc printTok*(tok: TToken) proc tokToStr*(tok: TToken): string proc openLexer*(lex: var TLexer, filename: string, inputstream: PLLStream) = @@ -172,7 +172,7 @@ proc prettyTok*(tok: TToken): string = if IsKeyword(tok.tokType): result = "keyword " & tok.ident.s else: result = tokToStr(tok) -proc PrintTok*(tok: TToken) = +proc printTok*(tok: TToken) = write(stdout, TokTypeToStr[tok.tokType]) write(stdout, " ") writeln(stdout, tokToStr(tok)) @@ -246,7 +246,7 @@ proc isFloatLiteral(s: string): bool = return true result = false -proc GetNumber(L: var TLexer): TToken = +proc getNumber(L: var TLexer): TToken = var pos, endpos: int xi: biggestInt @@ -499,7 +499,7 @@ proc newString(s: cstring, len: int): string = for i in 0 .. <len: result[i] = s[i] -proc HandleCRLF(L: var TLexer, pos: int): int = +proc handleCRLF(L: var TLexer, pos: int): int = template registerLine = let col = L.getColNumber(pos) diff --git a/compiler/lists.nim b/compiler/lists.nim index 22b1a183ae..70e177ba3d 100644 --- a/compiler/lists.nim +++ b/compiler/lists.nim @@ -24,12 +24,12 @@ type TCompareProc* = proc (entry: PListEntry, closure: Pointer): bool {.nimcall.} -proc InitLinkedList*(list: var TLinkedList) = +proc initLinkedList*(list: var TLinkedList) = list.Counter = 0 list.head = nil list.tail = nil -proc Append*(list: var TLinkedList, entry: PListEntry) = +proc append*(list: var TLinkedList, entry: PListEntry) = Inc(list.counter) entry.next = nil entry.prev = list.tail @@ -39,7 +39,7 @@ proc Append*(list: var TLinkedList, entry: PListEntry) = list.tail = entry if list.head == nil: list.head = entry -proc Contains*(list: TLinkedList, data: string): bool = +proc contains*(list: TLinkedList, data: string): bool = var it = list.head while it != nil: if PStrEntry(it).data == data: @@ -50,14 +50,14 @@ proc newStrEntry(data: string): PStrEntry = new(result) result.data = data -proc AppendStr*(list: var TLinkedList, data: string) = +proc appendStr*(list: var TLinkedList, data: string) = append(list, newStrEntry(data)) -proc IncludeStr*(list: var TLinkedList, data: string): bool = +proc includeStr*(list: var TLinkedList, data: string): bool = if Contains(list, data): return true AppendStr(list, data) # else: add to list -proc Prepend*(list: var TLinkedList, entry: PListEntry) = +proc prepend*(list: var TLinkedList, entry: PListEntry) = Inc(list.counter) entry.prev = nil entry.next = list.head @@ -67,10 +67,10 @@ proc Prepend*(list: var TLinkedList, entry: PListEntry) = list.head = entry if list.tail == nil: list.tail = entry -proc PrependStr*(list: var TLinkedList, data: string) = +proc prependStr*(list: var TLinkedList, data: string) = prepend(list, newStrEntry(data)) -proc InsertBefore*(list: var TLinkedList, pos, entry: PListEntry) = +proc insertBefore*(list: var TLinkedList, pos, entry: PListEntry) = assert(pos != nil) if pos == list.head: prepend(list, entry) @@ -81,7 +81,7 @@ proc InsertBefore*(list: var TLinkedList, pos, entry: PListEntry) = if pos.prev != nil: pos.prev.next = entry pos.prev = entry -proc Remove*(list: var TLinkedList, entry: PListEntry) = +proc remove*(list: var TLinkedList, entry: PListEntry) = Dec(list.counter) if entry == list.tail: list.tail = entry.prev @@ -103,14 +103,14 @@ proc bringToFront*(list: var TLinkedList, entry: PListEntry) = entry.next = list.head list.head = entry -proc ExcludeStr*(list: var TLinkedList, data: string) = +proc excludeStr*(list: var TLinkedList, data: string) = var it = list.head while it != nil: let nxt = it.next if PStrEntry(it).data == data: remove(list, it) it = nxt -proc Find*(list: TLinkedList, fn: TCompareProc, closure: Pointer): PListEntry = +proc find*(list: TLinkedList, fn: TCompareProc, closure: Pointer): PListEntry = result = list.head while result != nil: if fn(result, closure): return diff --git a/compiler/llstream.nim b/compiler/llstream.nim index 8ccf24b99d..68ad4d5874 100644 --- a/compiler/llstream.nim +++ b/compiler/llstream.nim @@ -30,56 +30,56 @@ type PLLStream* = ref TLLStream -proc LLStreamOpen*(data: string): PLLStream -proc LLStreamOpen*(f: var tfile): PLLStream -proc LLStreamOpen*(filename: string, mode: TFileMode): PLLStream -proc LLStreamOpen*(): PLLStream -proc LLStreamOpenStdIn*(): PLLStream -proc LLStreamClose*(s: PLLStream) -proc LLStreamRead*(s: PLLStream, buf: pointer, bufLen: int): int -proc LLStreamReadLine*(s: PLLStream, line: var string): bool -proc LLStreamReadAll*(s: PLLStream): string -proc LLStreamWrite*(s: PLLStream, data: string) -proc LLStreamWrite*(s: PLLStream, data: Char) -proc LLStreamWrite*(s: PLLStream, buf: pointer, buflen: int) -proc LLStreamWriteln*(s: PLLStream, data: string) +proc llStreamOpen*(data: string): PLLStream +proc llStreamOpen*(f: var tfile): PLLStream +proc llStreamOpen*(filename: string, mode: TFileMode): PLLStream +proc llStreamOpen*(): PLLStream +proc llStreamOpenStdIn*(): PLLStream +proc llStreamClose*(s: PLLStream) +proc llStreamRead*(s: PLLStream, buf: pointer, bufLen: int): int +proc llStreamReadLine*(s: PLLStream, line: var string): bool +proc llStreamReadAll*(s: PLLStream): string +proc llStreamWrite*(s: PLLStream, data: string) +proc llStreamWrite*(s: PLLStream, data: Char) +proc llStreamWrite*(s: PLLStream, buf: pointer, buflen: int) +proc llStreamWriteln*(s: PLLStream, data: string) # implementation -proc LLStreamOpen(data: string): PLLStream = +proc llStreamOpen(data: string): PLLStream = new(result) result.s = data result.kind = llsString -proc LLStreamOpen(f: var tfile): PLLStream = +proc llStreamOpen(f: var tfile): PLLStream = new(result) result.f = f result.kind = llsFile -proc LLStreamOpen(filename: string, mode: TFileMode): PLLStream = +proc llStreamOpen(filename: string, mode: TFileMode): PLLStream = new(result) result.kind = llsFile if not open(result.f, filename, mode): result = nil -proc LLStreamOpen(): PLLStream = +proc llStreamOpen(): PLLStream = new(result) result.kind = llsNone -proc LLStreamOpenStdIn(): PLLStream = +proc llStreamOpenStdIn(): PLLStream = new(result) result.kind = llsStdIn result.s = "" result.lineOffset = -1 -proc LLStreamClose(s: PLLStream) = +proc llStreamClose(s: PLLStream) = case s.kind of llsNone, llsString, llsStdIn: - nil + discard of llsFile: close(s.f) -when not defined(ReadLineFromStdin): +when not defined(readLineFromStdin): # fallback implementation: - proc ReadLineFromStdin(prompt: string, line: var string): bool = + proc readLineFromStdin(prompt: string, line: var string): bool = stdout.write(prompt) result = readLine(stdin, line) @@ -111,7 +111,7 @@ proc countTriples(s: string): int = inc i, 2 inc i -proc LLreadFromStdin(s: PLLStream, buf: pointer, bufLen: int): int = +proc llReadFromStdin(s: PLLStream, buf: pointer, bufLen: int): int = s.s = "" s.rd = 0 var line = newStringOfCap(120) @@ -127,7 +127,7 @@ proc LLreadFromStdin(s: PLLStream, buf: pointer, bufLen: int): int = copyMem(buf, addr(s.s[s.rd]), result) inc(s.rd, result) -proc LLStreamRead(s: PLLStream, buf: pointer, bufLen: int): int = +proc llStreamRead(s: PLLStream, buf: pointer, bufLen: int): int = case s.kind of llsNone: result = 0 @@ -141,7 +141,7 @@ proc LLStreamRead(s: PLLStream, buf: pointer, bufLen: int): int = of llsStdIn: result = LLreadFromStdin(s, buf, bufLen) -proc LLStreamReadLine(s: PLLStream, line: var string): bool = +proc llStreamReadLine(s: PLLStream, line: var string): bool = setLen(line, 0) case s.kind of llsNone: @@ -165,25 +165,25 @@ proc LLStreamReadLine(s: PLLStream, line: var string): bool = of llsStdIn: result = readLine(stdin, line) -proc LLStreamWrite(s: PLLStream, data: string) = +proc llStreamWrite(s: PLLStream, data: string) = case s.kind of llsNone, llsStdIn: - nil + discard of llsString: add(s.s, data) inc(s.wr, len(data)) of llsFile: write(s.f, data) -proc LLStreamWriteln(s: PLLStream, data: string) = - LLStreamWrite(s, data) - LLStreamWrite(s, "\n") +proc llStreamWriteln(s: PLLStream, data: string) = + llStreamWrite(s, data) + llStreamWrite(s, "\n") -proc LLStreamWrite(s: PLLStream, data: Char) = +proc llStreamWrite(s: PLLStream, data: Char) = var c: char case s.kind of llsNone, llsStdIn: - nil + discard of llsString: add(s.s, data) inc(s.wr) @@ -191,10 +191,10 @@ proc LLStreamWrite(s: PLLStream, data: Char) = c = data discard writeBuffer(s.f, addr(c), sizeof(c)) -proc LLStreamWrite(s: PLLStream, buf: pointer, buflen: int) = +proc llStreamWrite(s: PLLStream, buf: pointer, buflen: int) = case s.kind of llsNone, llsStdIn: - nil + discard of llsString: if bufLen > 0: setlen(s.s, len(s.s) + bufLen) @@ -203,10 +203,9 @@ proc LLStreamWrite(s: PLLStream, buf: pointer, buflen: int) = of llsFile: discard writeBuffer(s.f, buf, bufLen) -proc LLStreamReadAll(s: PLLStream): string = +proc llStreamReadAll(s: PLLStream): string = const bufSize = 2048 - var bytes, i: int case s.kind of llsNone, llsStdIn: result = "" @@ -216,8 +215,8 @@ proc LLStreamReadAll(s: PLLStream): string = s.rd = len(s.s) of llsFile: result = newString(bufSize) - bytes = readBuffer(s.f, addr(result[0]), bufSize) - i = bytes + var bytes = readBuffer(s.f, addr(result[0]), bufSize) + var i = bytes while bytes == bufSize: setlen(result, i + bufSize) bytes = readBuffer(s.f, addr(result[i + 0]), bufSize) diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 642243468f..951998d156 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -21,7 +21,7 @@ proc considerAcc*(n: PNode): PIdent = of nkSym: result = n.sym.name of nkAccQuoted: case n.len - of 0: GlobalError(n.info, errIdentifierExpected, renderTree(n)) + of 0: globalError(n.info, errIdentifierExpected, renderTree(n)) of 1: result = considerAcc(n.sons[0]) else: var id = "" @@ -30,16 +30,16 @@ proc considerAcc*(n: PNode): PIdent = case x.kind of nkIdent: id.add(x.ident.s) of nkSym: id.add(x.sym.name.s) - else: GlobalError(n.info, errIdentifierExpected, renderTree(n)) + else: globalError(n.info, errIdentifierExpected, renderTree(n)) result = getIdent(id) else: - GlobalError(n.info, errIdentifierExpected, renderTree(n)) + globalError(n.info, errIdentifierExpected, renderTree(n)) template addSym*(scope: PScope, s: PSym) = - StrTableAdd(scope.symbols, s) + strTableAdd(scope.symbols, s) proc addUniqueSym*(scope: PScope, s: PSym): TResult = - if StrTableIncl(scope.symbols, s): + if strTableIncl(scope.symbols, s): result = Failure else: result = Success @@ -64,17 +64,17 @@ iterator walkScopes*(scope: PScope): PScope = current = current.parent proc localSearchInScope*(c: PContext, s: PIdent): PSym = - result = StrTableGet(c.currentScope.symbols, s) + result = strTableGet(c.currentScope.symbols, s) proc searchInScopes*(c: PContext, s: PIdent): PSym = for scope in walkScopes(c.currentScope): - result = StrTableGet(scope.symbols, s) + result = strTableGet(scope.symbols, s) if result != nil: return result = nil proc searchInScopes*(c: PContext, s: PIdent, filter: TSymKinds): PSym = for scope in walkScopes(c.currentScope): - result = StrTableGet(scope.symbols, s) + result = strTableGet(scope.symbols, s) if result != nil and result.kind in filter: return result = nil @@ -114,22 +114,22 @@ proc getSymRepr*(s: PSym): string = proc ensureNoMissingOrUnusedSymbols(scope: PScope) = # check if all symbols have been used and defined: var it: TTabIter - var s = InitTabIter(it, scope.symbols) + var s = initTabIter(it, scope.symbols) var missingImpls = 0 while s != nil: if sfForward in s.flags: # too many 'implementation of X' errors are annoying # and slow 'suggest' down: if missingImpls == 0: - LocalError(s.info, errImplOfXexpected, getSymRepr(s)) + localError(s.info, errImplOfXexpected, getSymRepr(s)) inc missingImpls elif {sfUsed, sfExported} * s.flags == {} and optHints in s.options: # BUGFIX: check options in s! if s.kind notin {skForVar, skParam, skMethod, skUnknown, skGenericParam}: - Message(s.info, hintXDeclaredButNotUsed, getSymRepr(s)) - s = NextIter(it, scope.symbols) + message(s.info, hintXDeclaredButNotUsed, getSymRepr(s)) + s = nextIter(it, scope.symbols) -proc WrongRedefinition*(info: TLineInfo, s: string) = +proc wrongRedefinition*(info: TLineInfo, s: string) = if gCmd != cmdInteractive: localError(info, errAttemptToRedefine, s) @@ -144,7 +144,7 @@ proc addDeclAt*(scope: PScope, sym: PSym) = if scope.addUniqueSym(sym) == Failure: WrongRedefinition(sym.info, sym.Name.s) -proc AddInterfaceDeclAux(c: PContext, sym: PSym) = +proc addInterfaceDeclAux(c: PContext, sym: PSym) = if sfExported in sym.flags: # add to interface: if c.module != nil: StrTableAdd(c.module.tab, sym) @@ -152,27 +152,27 @@ proc AddInterfaceDeclAux(c: PContext, sym: PSym) = proc addInterfaceDeclAt*(c: PContext, scope: PScope, sym: PSym) = addDeclAt(scope, sym) - AddInterfaceDeclAux(c, sym) + addInterfaceDeclAux(c, sym) proc addOverloadableSymAt*(scope: PScope, fn: PSym) = if fn.kind notin OverloadableSyms: - InternalError(fn.info, "addOverloadableSymAt") + internalError(fn.info, "addOverloadableSymAt") return var check = StrTableGet(scope.symbols, fn.name) if check != nil and check.Kind notin OverloadableSyms: - WrongRedefinition(fn.info, fn.Name.s) + wrongRedefinition(fn.info, fn.Name.s) else: scope.addSym(fn) proc addInterfaceDecl*(c: PContext, sym: PSym) = # it adds the symbol to the interface if appropriate addDecl(c, sym) - AddInterfaceDeclAux(c, sym) + addInterfaceDeclAux(c, sym) proc addInterfaceOverloadableSymAt*(c: PContext, scope: PScope, sym: PSym) = # it adds the symbol to the interface if appropriate addOverloadableSymAt(scope, sym) - AddInterfaceDeclAux(c, sym) + addInterfaceDeclAux(c, sym) proc lookUp*(c: PContext, n: PNode): PSym = # Looks up a symbol. Generates an error in case of nil. @@ -180,7 +180,7 @@ proc lookUp*(c: PContext, n: PNode): PSym = of nkIdent: result = searchInScopes(c, n.ident) if result == nil: - LocalError(n.info, errUndeclaredIdentifier, n.ident.s) + localError(n.info, errUndeclaredIdentifier, n.ident.s) result = errorSym(c, n) of nkSym: result = n.sym @@ -188,34 +188,34 @@ proc lookUp*(c: PContext, n: PNode): PSym = var ident = considerAcc(n) result = searchInScopes(c, ident) if result == nil: - LocalError(n.info, errUndeclaredIdentifier, ident.s) + localError(n.info, errUndeclaredIdentifier, ident.s) result = errorSym(c, n) else: - InternalError(n.info, "lookUp") + internalError(n.info, "lookUp") return - if Contains(c.AmbiguousSymbols, result.id): - LocalError(n.info, errUseQualifier, result.name.s) + if contains(c.AmbiguousSymbols, result.id): + localError(n.info, errUseQualifier, result.name.s) if result.kind == skStub: loadStub(result) type TLookupFlag* = enum checkAmbiguity, checkUndeclared -proc QualifiedLookUp*(c: PContext, n: PNode, flags = {checkUndeclared}): PSym = +proc qualifiedLookUp*(c: PContext, n: PNode, flags = {checkUndeclared}): PSym = case n.kind of nkIdent, nkAccQuoted: var ident = considerAcc(n) result = searchInScopes(c, ident) if result == nil and checkUndeclared in flags: - LocalError(n.info, errUndeclaredIdentifier, ident.s) + localError(n.info, errUndeclaredIdentifier, ident.s) result = errorSym(c, n) elif checkAmbiguity in flags and result != nil and - Contains(c.AmbiguousSymbols, result.id): - LocalError(n.info, errUseQualifier, ident.s) + contains(c.AmbiguousSymbols, result.id): + localError(n.info, errUseQualifier, ident.s) of nkSym: result = n.sym - if checkAmbiguity in flags and Contains(c.AmbiguousSymbols, result.id): - LocalError(n.info, errUseQualifier, n.sym.name.s) + if checkAmbiguity in flags and contains(c.AmbiguousSymbols, result.id): + localError(n.info, errUseQualifier, n.sym.name.s) of nkDotExpr: result = nil var m = qualifiedLookUp(c, n.sons[0], flags*{checkUndeclared}) @@ -227,31 +227,31 @@ proc QualifiedLookUp*(c: PContext, n: PNode, flags = {checkUndeclared}): PSym = ident = considerAcc(n.sons[1]) if ident != nil: if m == c.module: - result = StrTableGet(c.topLevelScope.symbols, ident) + result = strTableGet(c.topLevelScope.symbols, ident) else: - result = StrTableGet(m.tab, ident) + result = strTableGet(m.tab, ident) if result == nil and checkUndeclared in flags: - LocalError(n.sons[1].info, errUndeclaredIdentifier, ident.s) + localError(n.sons[1].info, errUndeclaredIdentifier, ident.s) result = errorSym(c, n.sons[1]) elif n.sons[1].kind == nkSym: result = n.sons[1].sym elif checkUndeclared in flags and n.sons[1].kind notin {nkOpenSymChoice, nkClosedSymChoice}: - LocalError(n.sons[1].info, errIdentifierExpected, + localError(n.sons[1].info, errIdentifierExpected, renderTree(n.sons[1])) result = errorSym(c, n.sons[1]) else: result = nil if result != nil and result.kind == skStub: loadStub(result) -proc InitOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = +proc initOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = case n.kind of nkIdent, nkAccQuoted: var ident = considerAcc(n) o.scope = c.currentScope o.mode = oimNoQualifier while true: - result = InitIdentIter(o.it, o.scope.symbols, ident) + result = initIdentIter(o.it, o.scope.symbols, ident) if result != nil: break else: @@ -272,12 +272,12 @@ proc InitOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = if ident != nil: if o.m == c.module: # a module may access its private members: - result = InitIdentIter(o.it, c.topLevelScope.symbols, ident) + result = initIdentIter(o.it, c.topLevelScope.symbols, ident) o.mode = oimSelfModule else: result = InitIdentIter(o.it, o.m.tab, ident) else: - LocalError(n.sons[1].info, errIdentifierExpected, + localError(n.sons[1].info, errIdentifierExpected, renderTree(n.sons[1])) result = errorSym(c, n.sons[1]) of nkClosedSymChoice, nkOpenSymChoice: @@ -285,7 +285,7 @@ proc InitOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = result = n.sons[0].sym o.symChoiceIndex = 1 o.inSymChoice = initIntSet() - Incl(o.inSymChoice, result.id) + incl(o.inSymChoice, result.id) else: nil if result != nil and result.kind == skStub: loadStub(result) @@ -306,7 +306,7 @@ proc nextOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = while result == nil: o.scope = o.scope.parent if o.scope == nil: break - result = InitIdentIter(o.it, o.scope.symbols, o.it.name) + result = initIdentIter(o.it, o.scope.symbols, o.it.name) # BUGFIX: o.it.name <-> n.ident else: result = nil @@ -323,19 +323,19 @@ proc nextOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = # try 'local' symbols too for Koenig's lookup: o.mode = oimSymChoiceLocalLookup o.scope = c.currentScope - result = FirstIdentExcluding(o.it, o.scope.symbols, + result = firstIdentExcluding(o.it, o.scope.symbols, n.sons[0].sym.name, o.inSymChoice) while result == nil: o.scope = o.scope.parent if o.scope == nil: break - result = FirstIdentExcluding(o.it, o.scope.symbols, + result = firstIdentExcluding(o.it, o.scope.symbols, n.sons[0].sym.name, o.inSymChoice) of oimSymChoiceLocalLookup: result = nextIdentExcluding(o.it, o.scope.symbols, o.inSymChoice) while result == nil: o.scope = o.scope.parent if o.scope == nil: break - result = FirstIdentExcluding(o.it, o.scope.symbols, + result = firstIdentExcluding(o.it, o.scope.symbols, n.sons[0].sym.name, o.inSymChoice) if result != nil and result.kind == skStub: loadStub(result) diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim index 0c0b87222d..066ccc6cdc 100644 --- a/compiler/magicsys.nim +++ b/compiler/magicsys.nim @@ -12,14 +12,14 @@ import ast, astalgo, hashes, msgs, platform, nversion, times, idents, rodread -var SystemModule*: PSym +var systemModule*: PSym proc registerSysType*(t: PType) # magic symbols in the system module: proc getSysType*(kind: TTypeKind): PType proc getCompilerProc*(name: string): PSym proc registerCompilerProc*(s: PSym) -proc FinishSystem*(tab: TStrTable) +proc finishSystem*(tab: TStrTable) proc getSysSym*(name: string): PSym # implementation @@ -126,7 +126,7 @@ proc skipIntLit*(t: PType): PType {.inline.} = return getSysType(t.kind) result = t -proc AddSonSkipIntLit*(father, son: PType) = +proc addSonSkipIntLit*(father, son: PType) = if isNil(father.sons): father.sons = @[] let s = son.skipIntLit add(father.sons, s) @@ -158,13 +158,13 @@ proc setIntLitType*(result: PNode) = result.typ = getSysType(tyInt32) else: result.typ = getSysType(tyInt64) - else: InternalError(result.info, "invalid int size") + else: internalError(result.info, "invalid int size") proc getCompilerProc(name: string): PSym = var ident = getIdent(name, hashIgnoreStyle(name)) - result = StrTableGet(compilerprocs, ident) + result = strTableGet(compilerprocs, ident) if result == nil: - result = StrTableGet(rodCompilerProcs, ident) + result = strTableGet(rodCompilerProcs, ident) if result != nil: strTableAdd(compilerprocs, result) if result.kind == skStub: loadStub(result) @@ -172,7 +172,6 @@ proc getCompilerProc(name: string): PSym = proc registerCompilerProc(s: PSym) = strTableAdd(compilerprocs, s) -proc FinishSystem(tab: TStrTable) = nil - -initStrTable(compilerprocs) +proc finishSystem(tab: TStrTable) = discard +initStrTable(compilerprocs) diff --git a/compiler/main.nim b/compiler/main.nim index b91b596b0a..3f8b6aeba1 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -21,9 +21,9 @@ import from magicsys import SystemModule, resetSysTypes const - has_LLVM_Backend = false + hasLLVM_Backend = false -when has_LLVM_Backend: +when hasLLVM_Backend: import llvmgen proc rodPass = @@ -37,7 +37,7 @@ proc semanticPasses = registerPass verbosePass registerPass semPass -proc CommandGenDepend = +proc commandGenDepend = semanticPasses() registerPass(genDependPass) registerPass(cleanupPass) @@ -46,13 +46,13 @@ proc CommandGenDepend = execExternalProgram("dot -Tpng -o" & changeFileExt(gProjectFull, "png") & ' ' & changeFileExt(gProjectFull, "dot")) -proc CommandCheck = +proc commandCheck = msgs.gErrorMax = high(int) # do not stop after first error semanticPasses() # use an empty backend for semantic checking only rodPass() compileProject() -proc CommandDoc2 = +proc commandDoc2 = msgs.gErrorMax = high(int) # do not stop after first error semanticPasses() registerPass(docgen2Pass) @@ -60,7 +60,7 @@ proc CommandDoc2 = compileProject() finishDoc2Pass(gProjectName) -proc CommandCompileToC = +proc commandCompileToC = semanticPasses() registerPass(cgenPass) rodPass() @@ -111,15 +111,15 @@ proc CommandCompileToC = ccgutils.resetCaches() GC_fullCollect() -when has_LLVM_Backend: - proc CommandCompileToLLVM = +when hasLLVM_Backend: + proc commandCompileToLLVM = semanticPasses() registerPass(llvmgen.llvmgenPass()) rodPass() #registerPass(cleanupPass()) compileProject() -proc CommandCompileToJS = +proc commandCompileToJS = #incl(gGlobalOptions, optSafeCode) setTarget(osJS, cpuJS) #initDefines() @@ -130,7 +130,7 @@ proc CommandCompileToJS = registerPass(jsgenPass) compileProject() -proc InteractivePasses = +proc interactivePasses = #incl(gGlobalOptions, optSafeCode) #setTarget(osNimrodVM, cpuNimrodVM) initDefines() @@ -140,7 +140,7 @@ proc InteractivePasses = registerPass(semPass) registerPass(evalPass) -proc CommandInteractive = +proc commandInteractive = msgs.gErrorMax = high(int) # do not stop after first error InteractivePasses() compileSystemModule() @@ -163,20 +163,20 @@ proc commandEval(exp: string) = var echoExp = "echo \"eval\\t\", " & "repr(" & exp & ")" evalNim(echoExp.parseString, makeStdinModule()) -proc CommandPrettyOld = +proc commandPrettyOld = var projectFile = addFileExt(mainCommandArg(), NimExt) var module = parseFile(projectFile.fileInfoIdx) if module != nil: renderModule(module, getOutFile(mainCommandArg(), "pretty." & NimExt)) -proc CommandPretty = +proc commandPretty = msgs.gErrorMax = high(int) # do not stop after first error semanticPasses() registerPass(prettyPass) compileProject() pretty.overwriteFiles() -proc CommandScan = +proc commandScan = var f = addFileExt(mainCommandArg(), nimExt) var stream = LLStreamOpen(f, fmRead) if stream != nil: @@ -193,7 +193,7 @@ proc CommandScan = else: rawMessage(errCannotOpenFile, f) -proc CommandSuggest = +proc commandSuggest = if isServing: # XXX: hacky work-around ahead # Currently, it's possible to issue a idetools command, before @@ -286,7 +286,7 @@ const SimiluateCaasMemReset = false PrintRopeCacheStats = false -proc MainCommand* = +proc mainCommand* = when SimiluateCaasMemReset: gGlobalOptions.incl(optCaasEnabled) diff --git a/compiler/modules.nim b/compiler/modules.nim index ef6af3d69a..15af40363c 100644 --- a/compiler/modules.nim +++ b/compiler/modules.nim @@ -184,7 +184,7 @@ proc compileSystemModule* = SystemFileIdx = fileInfoIdx(options.libpath/"system.nim") discard CompileModule(SystemFileIdx, {sfSystemModule}) -proc CompileProject*(projectFile = gProjectMainIdx) = +proc compileProject*(projectFile = gProjectMainIdx) = let systemFileIdx = fileInfoIdx(options.libpath / "system.nim") if projectFile == SystemFileIdx: discard CompileModule(projectFile, {sfMainModule, sfSystemModule}) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 2a7d54d4eb..44139b5762 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -453,7 +453,7 @@ const var filenameToIndexTbl = initTable[string, int32]() fileInfos*: seq[TFileInfo] = @[] - SystemFileIdx*: int32 + systemFileIdx*: int32 proc toCChar*(c: Char): string = case c @@ -545,7 +545,7 @@ var when useCaas: var stdoutSocket*: TSocket -proc UnknownLineInfo*(): TLineInfo = +proc unknownLineInfo*(): TLineInfo = result.line = int16(-1) result.col = int16(-1) result.fileIndex = -1 @@ -560,7 +560,7 @@ var proc clearBufferedMsgs* = bufferedMsgs = nil -proc SuggestWriteln*(s: string) = +proc suggestWriteln*(s: string) = if eStdOut in errorOutputs: when useCaas: if isNil(stdoutSocket): Writeln(stdout, s) @@ -573,7 +573,7 @@ proc SuggestWriteln*(s: string) = if eInMemory in errorOutputs: bufferedMsgs.safeAdd(s) -proc SuggestQuit*() = +proc suggestQuit*() = if not isServing: quit(0) elif isWorkingWithDirtyBuffer: @@ -656,11 +656,11 @@ proc addCheckpoint*(info: TLineInfo) = proc addCheckpoint*(filename: string, line: int) = addCheckpoint(newLineInfo(filename, line, - 1)) -proc OutWriteln*(s: string) = +proc outWriteln*(s: string) = ## Writes to stdout. Always. if eStdOut in errorOutputs: Writeln(stdout, s) -proc MsgWriteln*(s: string) = +proc msgWriteln*(s: string) = ## Writes to stdout. If --stdout option is given, writes to stderr instead. if gCmd == cmdIdeTools and optCDebug notin gGlobalOptions: return @@ -675,7 +675,7 @@ proc coordToStr(coord: int): string = if coord == -1: result = "???" else: result = $coord -proc MsgKindToString*(kind: TMsgKind): string = +proc msgKindToString*(kind: TMsgKind): string = # later versions may provide translated error messages result = msgKindToStr[kind] @@ -724,7 +724,7 @@ proc writeContext(lastinfo: TLineInfo) = var info = lastInfo for i in countup(0, len(msgContext) - 1): if msgContext[i] != lastInfo and msgContext[i] != info: - MsgWriteln(posContextFormat % [toMsgFilename(msgContext[i]), + msgWriteln(posContextFormat % [toMsgFilename(msgContext[i]), coordToStr(msgContext[i].line), coordToStr(msgContext[i].col), getMessageStr(errInstantiationFrom, "")]) @@ -748,7 +748,7 @@ proc rawMessage*(msg: TMsgKind, args: openarray[string]) = frmt = rawHintFormat inc(gHintCounter) let s = `%`(frmt, `%`(msgKindToString(msg), args)) - MsgWriteln(s) + msgWriteln(s) handleError(msg, doAbort, s) proc rawMessage*(msg: TMsgKind, arg: string) = @@ -756,8 +756,8 @@ proc rawMessage*(msg: TMsgKind, arg: string) = proc writeSurroundingSrc(info: TLineInfo) = const indent = " " - MsgWriteln(indent & info.sourceLine.ropeToStr) - MsgWriteln(indent & repeatChar(info.col, ' ') & '^') + msgWriteln(indent & info.sourceLine.ropeToStr) + msgWriteln(indent & repeatChar(info.col, ' ') & '^') proc liMessage(info: TLineInfo, msg: TMsgKind, arg: string, eh: TErrorHandling) = @@ -783,45 +783,45 @@ proc liMessage(info: TLineInfo, msg: TMsgKind, arg: string, let s = frmt % [toMsgFilename(info), coordToStr(info.line), coordToStr(info.col), getMessageStr(msg, arg)] if not ignoreMsg: - MsgWriteln(s) + msgWriteln(s) if optPrintSurroundingSrc and msg in errMin..errMax: info.writeSurroundingSrc handleError(msg, eh, s) -proc Fatal*(info: TLineInfo, msg: TMsgKind, arg = "") = +proc fatal*(info: TLineInfo, msg: TMsgKind, arg = "") = liMessage(info, msg, arg, doAbort) -proc GlobalError*(info: TLineInfo, msg: TMsgKind, arg = "") = +proc globalError*(info: TLineInfo, msg: TMsgKind, arg = "") = liMessage(info, msg, arg, doRaise) -proc GlobalError*(info: TLineInfo, arg: string) = +proc globalError*(info: TLineInfo, arg: string) = liMessage(info, errGenerated, arg, doRaise) -proc LocalError*(info: TLineInfo, msg: TMsgKind, arg = "") = +proc localError*(info: TLineInfo, msg: TMsgKind, arg = "") = liMessage(info, msg, arg, doNothing) -proc LocalError*(info: TLineInfo, arg: string) = +proc localError*(info: TLineInfo, arg: string) = liMessage(info, errGenerated, arg, doNothing) -proc Message*(info: TLineInfo, msg: TMsgKind, arg = "") = +proc message*(info: TLineInfo, msg: TMsgKind, arg = "") = liMessage(info, msg, arg, doNothing) -proc InternalError*(info: TLineInfo, errMsg: string) = +proc internalError*(info: TLineInfo, errMsg: string) = if gCmd == cmdIdeTools: return writeContext(info) liMessage(info, errInternal, errMsg, doAbort) -proc InternalError*(errMsg: string) = +proc internalError*(errMsg: string) = if gCmd == cmdIdeTools: return writeContext(UnknownLineInfo()) rawMessage(errInternal, errMsg) -template AssertNotNil*(e: expr): expr = - if e == nil: InternalError($InstantiationInfo()) +template assertNotNil*(e: expr): expr = + if e == nil: internalError($instantiationInfo()) e -template InternalAssert*(e: bool): stmt = - if not e: InternalError($InstantiationInfo()) +template internalAssert*(e: bool): stmt = + if not e: internalError($instantiationInfo()) proc addSourceLine*(fileIdx: int32, line: string) = fileInfos[fileIdx].lines.add line.toRope @@ -835,14 +835,14 @@ proc sourceLine*(i: TLineInfo): PRope = addSourceLine i.fileIndex, line.string except EIO: discard - InternalAssert i.fileIndex < fileInfos.len + internalAssert i.fileIndex < fileInfos.len # can happen if the error points to EOF: if i.line > fileInfos[i.fileIndex].lines.len: return nil result = fileInfos[i.fileIndex].lines[i.line-1] proc quotedFilename*(i: TLineInfo): PRope = - InternalAssert i.fileIndex >= 0 + internalAssert i.fileIndex >= 0 result = fileInfos[i.fileIndex].quotedName ropes.ErrorHandler = proc (err: TRopesError, msg: string, useWarning: bool) = diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index 7ec566a01f..ae6487744e 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -219,7 +219,7 @@ proc getSystemConfigPath(filename: string): string = if not existsFile(result): result = joinPath([p, "etc", filename]) if not existsFile(result): result = "/etc/" & filename -proc LoadConfigs*(cfg: string) = +proc loadConfigs*(cfg: string) = # set default value (can be overwritten): if libpath == "": # choose default libpath: diff --git a/compiler/nimlexbase.nim b/compiler/nimlexbase.nim index 6d45a825ad..2e4f8dec7f 100644 --- a/compiler/nimlexbase.nim +++ b/compiler/nimlexbase.nim @@ -54,11 +54,11 @@ proc openBaseLexer*(L: var TBaseLexer, inputstream: PLLStream, proc closeBaseLexer*(L: var TBaseLexer) proc getCurrentLine*(L: TBaseLexer, marker: bool = true): string proc getColNumber*(L: TBaseLexer, pos: int): int -proc HandleCR*(L: var TBaseLexer, pos: int): int +proc handleCR*(L: var TBaseLexer, pos: int): int # Call this if you scanned over CR in the buffer; it returns the # position to continue the scanning from. `pos` must be the position # of the CR. -proc HandleLF*(L: var TBaseLexer, pos: int): int +proc handleLF*(L: var TBaseLexer, pos: int): int # Call this if you scanned over LF in the buffer; it returns the the # position to continue the scanning from. `pos` must be the position # of the LF. @@ -71,7 +71,7 @@ proc closeBaseLexer(L: var TBaseLexer) = dealloc(L.buf) LLStreamClose(L.stream) -proc FillBuffer(L: var TBaseLexer) = +proc fillBuffer(L: var TBaseLexer) = var charsRead, toCopy, s: int # all are in characters, # not bytes (in case this @@ -126,20 +126,20 @@ proc fillBaseLexer(L: var TBaseLexer, pos: int): int = result = 0 L.lineStart = result -proc HandleCR(L: var TBaseLexer, pos: int): int = +proc handleCR(L: var TBaseLexer, pos: int): int = assert(L.buf[pos] == CR) inc(L.linenumber) result = fillBaseLexer(L, pos) if L.buf[result] == LF: result = fillBaseLexer(L, result) -proc HandleLF(L: var TBaseLexer, pos: int): int = +proc handleLF(L: var TBaseLexer, pos: int): int = assert(L.buf[pos] == LF) inc(L.linenumber) result = fillBaseLexer(L, pos) #L.lastNL := result-1; // BUGFIX: was: result; -proc skip_UTF_8_BOM(L: var TBaseLexer) = - if (L.buf[0] == '\xEF') and (L.buf[1] == '\xBB') and (L.buf[2] == '\xBF'): +proc skipUTF8BOM(L: var TBaseLexer) = + if L.buf[0] == '\xEF' and L.buf[1] == '\xBB' and L.buf[2] == '\xBF': inc(L.bufpos, 3) inc(L.lineStart, 3) @@ -167,4 +167,3 @@ proc getCurrentLine(L: TBaseLexer, marker: bool = true): string = result.add("\n") if marker: result.add(RepeatChar(getColNumber(L, L.bufpos)) & '^' & "\n") - diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim index 2bc94e3f87..33c899647d 100644 --- a/compiler/nimrod.nim +++ b/compiler/nimrod.nim @@ -31,7 +31,7 @@ proc prependCurDir(f: string): string = else: result = f -proc HandleCmdLine() = +proc handleCmdLine() = if paramCount() == 0: writeCommandLineUsage() else: @@ -47,12 +47,12 @@ proc HandleCmdLine() = gProjectName = p.name else: gProjectPath = getCurrentDir() - LoadConfigs(DefaultConfig) # load all config files + loadConfigs(DefaultConfig) # load all config files # now process command line arguments again, because some options in the # command line can overwite the config file's settings extccomp.initVars() - ProcessCmdLine(passCmd2, "") - MainCommand() + processCmdLine(passCmd2, "") + mainCommand() if gVerbosity >= 2: echo(GC_getStatistics()) #echo(GC_getStatistics()) if msgs.gErrorCounter == 0: @@ -84,5 +84,5 @@ when compileOption("gc", "v2") or compileOption("gc", "refc"): condsyms.InitDefines() when not defined(selftest): - HandleCmdLine() + handleCmdLine() quit(int8(msgs.gErrorCounter > 0)) diff --git a/compiler/nimsets.nim b/compiler/nimsets.nim index 34f79e14bc..8c2fc42d3a 100644 --- a/compiler/nimsets.nim +++ b/compiler/nimsets.nim @@ -18,7 +18,7 @@ proc overlap*(a, b: PNode): bool proc inSet*(s: PNode, elem: PNode): bool proc someInSet*(s: PNode, a, b: PNode): bool proc emptyRange*(a, b: PNode): bool -proc SetHasRange*(s: PNode): bool +proc setHasRange*(s: PNode): bool # returns true if set contains a range (needed by the code generator) # these are used for constant folding: proc unionSets*(a, b: PNode): PNode @@ -87,7 +87,7 @@ proc toBitSet(s: PNode, b: var TBitSet) = else: BitSetIncl(b, getOrdValue(s.sons[i]) - first) -proc ToTreeSet(s: TBitSet, settype: PType, info: TLineInfo): PNode = +proc toTreeSet(s: TBitSet, settype: PType, info: TLineInfo): PNode = var a, b, e, first: BiggestInt # a, b are interval borders elemType: PType @@ -158,9 +158,9 @@ proc cardSet(s: PNode): BiggestInt = else: Inc(result) -proc SetHasRange(s: PNode): bool = +proc setHasRange(s: PNode): bool = if s.kind != nkCurly: - InternalError(s.info, "SetHasRange") + internalError(s.info, "SetHasRange") return false for i in countup(0, sonsLen(s) - 1): if s.sons[i].kind == nkRange: diff --git a/compiler/options.nim b/compiler/options.nim index d4122c7b22..d792b487e9 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -277,7 +277,7 @@ proc rawFindFile2(f: string): string = it = PStrEntry(it.Next) result = "" -proc FindFile*(f: string): string {.procvar.} = +proc findFile*(f: string): string {.procvar.} = result = f.rawFindFile if result.len == 0: result = f.toLower.rawFindFile diff --git a/compiler/parser.nim b/compiler/parser.nim index fd51b04ecd..652883360e 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -35,7 +35,7 @@ type lex*: TLexer # the lexer that is used for parsing tok*: TToken # the current token -proc ParseAll*(p: var TParser): PNode +proc parseAll*(p: var TParser): PNode proc openParser*(p: var TParser, filename: string, inputstream: PLLStream) proc closeParser*(p: var TParser) proc parseTopLevelStmt*(p: var TParser): PNode @@ -59,9 +59,9 @@ proc newFloatNodeP*(kind: TNodeKind, floatVal: BiggestFloat, p: TParser): PNode proc newStrNodeP*(kind: TNodeKind, strVal: string, p: TParser): PNode proc newIdentNodeP*(ident: PIdent, p: TParser): PNode proc expectIdentOrKeyw*(p: TParser) -proc ExpectIdent*(p: TParser) +proc expectIdent*(p: TParser) proc parLineInfo*(p: TParser): TLineInfo -proc Eat*(p: var TParser, TokType: TTokType) +proc eat*(p: var TParser, TokType: TTokType) proc skipInd*(p: var TParser) proc optPar*(p: var TParser) proc optInd*(p: var TParser, n: PNode) @@ -75,17 +75,17 @@ proc parseCase(p: var TParser): PNode proc getTok(p: var TParser) = rawGetTok(p.lex, p.tok) -proc OpenParser*(p: var TParser, fileIdx: int32, inputStream: PLLStream) = +proc openParser*(p: var TParser, fileIdx: int32, inputStream: PLLStream) = initToken(p.tok) - OpenLexer(p.lex, fileIdx, inputstream) + openLexer(p.lex, fileIdx, inputstream) getTok(p) # read the first token p.firstTok = true -proc OpenParser*(p: var TParser, filename: string, inputStream: PLLStream) = +proc openParser*(p: var TParser, filename: string, inputStream: PLLStream) = openParser(p, filename.fileInfoIdx, inputStream) -proc CloseParser(p: var TParser) = - CloseLexer(p.lex) +proc closeParser(p: var TParser) = + closeLexer(p.lex) proc parMessage(p: TParser, msg: TMsgKind, arg: string = "") = lexMessage(p.lex, msg, arg) @@ -135,11 +135,11 @@ proc expectIdentOrKeyw(p: TParser) = if p.tok.tokType != tkSymbol and not isKeyword(p.tok.tokType): lexMessage(p.lex, errIdentifierExpected, prettyTok(p.tok)) -proc ExpectIdent(p: TParser) = +proc expectIdent(p: TParser) = if p.tok.tokType != tkSymbol: lexMessage(p.lex, errIdentifierExpected, prettyTok(p.tok)) -proc Eat(p: var TParser, TokType: TTokType) = +proc eat(p: var TParser, TokType: TTokType) = if p.tok.TokType == TokType: getTok(p) else: lexMessage(p.lex, errTokenExpected, TokTypeToStr[tokType]) @@ -185,10 +185,10 @@ proc relevantOprChar(ident: PIdent): char {.inline.} = if result == '\\' and L > 1: result = ident.s[1] -proc IsSigilLike(tok: TToken): bool {.inline.} = +proc isSigilLike(tok: TToken): bool {.inline.} = result = tok.tokType == tkOpr and relevantOprChar(tok.ident) == '@' -proc IsLeftAssociative(tok: TToken): bool {.inline.} = +proc isLeftAssociative(tok: TToken): bool {.inline.} = result = tok.tokType != tkOpr or relevantOprChar(tok.ident) != '^' proc getPrecedence(tok: TToken): int = @@ -427,7 +427,7 @@ proc parseCast(p: var TParser): PNode = proc setBaseFlags(n: PNode, base: TNumericalBase) = case base - of base10: nil + of base10: discard of base2: incl(n.flags, nfBase2) of base8: incl(n.flags, nfBase8) of base16: incl(n.flags, nfBase16) @@ -1862,7 +1862,7 @@ proc parseTopLevelStmt(p: var TParser): PNode = result = ast.emptyNode while true: if p.tok.indent != 0: - if p.firstTok and p.tok.indent < 0: nil + if p.firstTok and p.tok.indent < 0: discard else: parMessage(p, errInvalidIndentation) p.firstTok = false case p.tok.tokType @@ -1881,7 +1881,7 @@ proc parseString(s: string, filename: string = "", line: int = 0): PNode = stream.lineOffset = line var parser: TParser - OpenParser(parser, filename, stream) + openParser(parser, filename, stream) result = parser.parseAll - CloseParser(parser) + closeParser(parser) diff --git a/compiler/pbraces.nim b/compiler/pbraces.nim index a944fe0ab4..ce6e0d9a96 100644 --- a/compiler/pbraces.nim +++ b/compiler/pbraces.nim @@ -10,7 +10,7 @@ import llstream, lexer, parser, idents, strutils, ast, msgs -proc ParseAll*(p: var TParser): PNode = +proc parseAll*(p: var TParser): PNode = result = nil proc parseTopLevelStmt*(p: var TParser): PNode = diff --git a/compiler/platform.nim b/compiler/platform.nim index 59091b6909..5245cba6a6 100644 --- a/compiler/platform.nim +++ b/compiler/platform.nim @@ -185,13 +185,13 @@ var targetCPU*, hostCPU*: TSystemCPU targetOS*, hostOS*: TSystemOS -proc NameToOS*(name: string): TSystemOS -proc NameToCPU*(name: string): TSystemCPU +proc nameToOS*(name: string): TSystemOS +proc nameToCPU*(name: string): TSystemCPU var - IntSize*: int + intSize*: int floatSize*: int - PtrSize*: int + ptrSize*: int tnl*: string # target newline proc setTarget*(o: TSystemOS, c: TSystemCPU) = @@ -205,13 +205,13 @@ proc setTarget*(o: TSystemOS, c: TSystemCPU) = ptrSize = cpu[c].bit div 8 tnl = os[o].newLine -proc NameToOS(name: string): TSystemOS = +proc nameToOS(name: string): TSystemOS = for i in countup(succ(osNone), high(TSystemOS)): if cmpIgnoreStyle(name, OS[i].name) == 0: return i result = osNone -proc NameToCPU(name: string): TSystemCPU = +proc nameToCPU(name: string): TSystemCPU = for i in countup(succ(cpuNone), high(TSystemCPU)): if cmpIgnoreStyle(name, CPU[i].name) == 0: return i diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 6f1e7af25e..41898caedb 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -92,12 +92,12 @@ proc setExternName(s: PSym, extname: string) = # note that '{.importc.}' is transformed into '{.importc: "$1".}' s.loc.flags.incl(lfFullExternalName) -proc MakeExternImport(s: PSym, extname: string) = +proc makeExternImport(s: PSym, extname: string) = setExternName(s, extname) incl(s.flags, sfImportc) excl(s.flags, sfForward) -proc MakeExternExport(s: PSym, extname: string) = +proc makeExternExport(s: PSym, extname: string) = setExternName(s, extname) incl(s.flags, sfExportc) @@ -133,7 +133,7 @@ proc getStrLitNode(c: PContext, n: PNode): PNode = case n.sons[1].kind of nkStrLit, nkRStrLit, nkTripleStrLit: result = n.sons[1] else: - LocalError(n.info, errStringLiteralExpected) + localError(n.info, errStringLiteralExpected) # error correction: result = newEmptyStrNode(n) @@ -142,12 +142,12 @@ proc expectStrLit(c: PContext, n: PNode): string = proc expectIntLit(c: PContext, n: PNode): int = if n.kind != nkExprColonExpr: - LocalError(n.info, errIntLiteralExpected) + localError(n.info, errIntLiteralExpected) else: n.sons[1] = c.semConstExpr(c, n.sons[1]) case n.sons[1].kind of nkIntLit..nkInt64Lit: result = int(n.sons[1].intVal) - else: LocalError(n.info, errIntLiteralExpected) + else: localError(n.info, errIntLiteralExpected) proc getOptionalStr(c: PContext, n: PNode, defaultStr: string): string = if n.kind == nkExprColonExpr: result = expectStrLit(c, n) @@ -160,7 +160,7 @@ proc processMagic(c: PContext, n: PNode, s: PSym) = #if sfSystemModule notin c.module.flags: # liMessage(n.info, errMagicOnlyInSystem) if n.kind != nkExprColonExpr: - LocalError(n.info, errStringLiteralExpected) + localError(n.info, errStringLiteralExpected) return var v: string if n.sons[1].kind == nkIdent: v = n.sons[1].ident.s @@ -176,15 +176,15 @@ proc wordToCallConv(sw: TSpecialWord): TCallingConvention = # the same result = TCallingConvention(ord(ccDefault) + ord(sw) - ord(wNimcall)) -proc IsTurnedOn(c: PContext, n: PNode): bool = +proc isTurnedOn(c: PContext, n: PNode): bool = if n.kind == nkExprColonExpr: let x = c.semConstBoolExpr(c, n.sons[1]) n.sons[1] = x if x.kind == nkIntLit: return x.intVal != 0 - LocalError(n.info, errOnOrOffExpected) + localError(n.info, errOnOrOffExpected) proc onOff(c: PContext, n: PNode, op: TOptions) = - if IsTurnedOn(c, n): gOptions = gOptions + op + if isTurnedOn(c, n): gOptions = gOptions + op else: gOptions = gOptions - op proc pragmaDeadCodeElim(c: PContext, n: PNode) = @@ -387,16 +387,16 @@ proc processCommonLink(c: PContext, n: PNode, feature: TLinkFeature) = extccomp.addFileToLink(libpath / completeCFilePath(found, false)) else: internalError(n.info, "processCommonLink") -proc PragmaBreakpoint(c: PContext, n: PNode) = +proc pragmaBreakpoint(c: PContext, n: PNode) = discard getOptionalStr(c, n, "") -proc PragmaCheckpoint(c: PContext, n: PNode) = +proc pragmaCheckpoint(c: PContext, n: PNode) = # checkpoints can be used to debug the compiler; they are not documented var info = n.info inc(info.line) # next line is affected! msgs.addCheckpoint(info) -proc PragmaWatchpoint(c: PContext, n: PNode) = +proc pragmaWatchpoint(c: PContext, n: PNode) = if n.kind == nkExprColonExpr: n.sons[1] = c.semExpr(c, n.sons[1]) else: @@ -431,14 +431,14 @@ proc semAsmOrEmit*(con: PContext, n: PNode, marker: char): PNode = a = c + 1 else: illFormedAst(n) -proc PragmaEmit(c: PContext, n: PNode) = +proc pragmaEmit(c: PContext, n: PNode) = discard getStrLitNode(c, n) n.sons[1] = semAsmOrEmit(c, n, '`') proc noVal(n: PNode) = if n.kind == nkExprColonExpr: invalidPragma(n) -proc PragmaUnroll(c: PContext, n: PNode) = +proc pragmaUnroll(c: PContext, n: PNode) = if c.p.nestedLoopCounter <= 0: invalidPragma(n) elif n.kind == nkExprColonExpr: @@ -448,7 +448,7 @@ proc PragmaUnroll(c: PContext, n: PNode) = else: invalidPragma(n) -proc PragmaLine(c: PContext, n: PNode) = +proc pragmaLine(c: PContext, n: PNode) = if n.kind == nkExprColonExpr: n.sons[1] = c.semConstExpr(c, n.sons[1]) let a = n.sons[1] @@ -465,7 +465,7 @@ proc PragmaLine(c: PContext, n: PNode) = n.info.fileIndex = msgs.fileInfoIdx(x.strVal) n.info.line = int16(y.intVal) else: - LocalError(n.info, errXExpected, "tuple") + localError(n.info, errXExpected, "tuple") else: # sensible default: n.info = getInfoContext(-1) diff --git a/compiler/pretty.nim b/compiler/pretty.nim index 5036a16a39..2955193d0e 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -12,7 +12,7 @@ import strutils, os, options, ast, astalgo, msgs, ropes, idents, passes, - intsets, strtabs + intsets, strtabs, semdata const removeTP = false # when true, "nimrod pretty" converts TTyp to Typ. @@ -50,7 +50,7 @@ proc overwriteFiles*() = try: var f = open(newFile, fmWrite) for line in gSourceFiles[i].lines: - f.writeln(line) + f.writeln(line.strip(leading = false, trailing = true)) f.close except EIO: rawMessage(errCannotOpenFile, newFile) @@ -60,18 +60,25 @@ proc `=~`(s: string, a: openArray[string]): bool = if s.startsWith(x): return true proc beautifyName(s: string, k: TSymKind): string = + # minimal set of rules here for transition: + # GC_ is allowed + + let allUpper = allCharsInSet(s, {'A'..'Z', '0'..'9', '_'}) + if allUpper and k in {skConst, skEnumField, skType}: return s result = newStringOfCap(s.len) var i = 0 case k of skType, skGenericParam: - # skip leading 'T' + # Types should start with a capital unless builtins like 'int' etc.: when removeTP: if s[0] == 'T' and s[1] in {'A'..'Z'}: i = 1 if s =~ ["int", "uint", "cint", "cuint", "clong", "cstring", "string", "char", "byte", "bool", "openArray", "seq", "array", "void", "pointer", "float", "csize", "cdouble", "cchar", "cschar", - "cshort", "cu"]: + "cshort", "cu", "nil", "expr", "stmt", "typedesc", "auto", "any", + "range", "openarray", "varargs", "set", "cfloat" + ]: result.add s[i] else: result.add toUpper(s[i]) @@ -81,13 +88,19 @@ proc beautifyName(s: string, k: TSymKind): string = else: # as a special rule, don't transform 'L' to 'l' if s.len == 1 and s[0] == 'L': result.add 'L' + elif '_' in s: result.add(s[i]) else: result.add toLower(s[0]) inc i - let allUpper = allCharsInSet(s, {'A'..'Z', '0'..'9', '_'}) while i < s.len: if s[i] == '_': - inc i - result.add toUpper(s[i]) + if i > 0 and s[i-1] in {'A'..'Z'}: + # don't skip '_' as it's essential for e.g. 'GC_disable' + result.add('_') + inc i + result.add s[i] + else: + inc i + result.add toUpper(s[i]) elif allUpper: result.add toLower(s[i]) else: @@ -97,7 +110,7 @@ proc beautifyName(s: string, k: TSymKind): string = proc checkStyle*(info: TLineInfo, s: string, k: TSymKind) = let beau = beautifyName(s, k) if s != beau: - Message(info, errGenerated, + message(info, errGenerated, "name does not adhere to naming convention; should be: " & beau) const @@ -119,11 +132,88 @@ proc differ(line: string, a, b: int, x: string): bool = var cannotRename = initIntSet() -proc processSym(c: PPassContext, n: PNode): PNode = - result = n - var g = PGen(c) - case n.kind - of nkSym: +proc checkDef(c: PGen; n: PNode) = + if n.kind != nkSym: return + let s = n.sym + + # operators stay as they are: + if s.kind in {skResult, skTemp} or s.name.s[0] notin Letters: return + if s.kind in {skType, skGenericParam} and sfAnon in s.flags: return + + checkStyle(n.info, s.name.s, s.kind) + +proc checkUse(c: PGen; n: PNode) = + if n.info.fileIndex < 0: return + let s = n.sym + # we simply convert it to what it looks like in the definition + # for consistency + + # operators stay as they are: + if s.kind in {skResult, skTemp} or s.name.s[0] notin Letters: return + if s.kind in {skType, skGenericParam} and sfAnon in s.flags: return + let newName = s.name.s + + loadFile(n.info) + + let line = gSourceFiles[n.info.fileIndex].lines[n.info.line-1] + var first = min(n.info.col.int, line.len) + if first < 0: return + #inc first, skipIgnoreCase(line, "proc ", first) + while first > 0 and line[first-1] in Letters: dec first + if first < 0: return + if line[first] == '`': inc first + + let last = first+identLen(line, first)-1 + if differ(line, first, last, newName): + # last-first+1 != newName.len or + var x = line.subStr(0, first-1) & newName & line.substr(last+1) + when removeTP: + # the WinAPI module is full of 'TX = X' which after the substitution + # becomes 'X = X'. We remove those lines: + if x.match(peg"\s* {\ident} \s* '=' \s* y$1 ('#' .*)?"): + x = "" + + system.shallowCopy(gSourceFiles[n.info.fileIndex].lines[n.info.line-1], x) + gSourceFiles[n.info.fileIndex].dirty = true + + +when false: + proc beautifyName(s: string, k: TSymKind): string = + let allUpper = allCharsInSet(s, {'A'..'Z', '0'..'9', '_'}) + result = newStringOfCap(s.len) + var i = 0 + case k + of skType, skGenericParam: + # skip leading 'T' + when removeTP: + if s[0] == 'T' and s[1] in {'A'..'Z'}: + i = 1 + if s =~ ["int", "uint", "cint", "cuint", "clong", "cstring", "string", + "char", "byte", "bool", "openArray", "seq", "array", "void", + "pointer", "float", "csize", "cdouble", "cchar", "cschar", + "cshort", "cu"]: + result.add s[i] + else: + result.add toUpper(s[i]) + of skConst, skEnumField: + # for 'const' we keep how it's spelt; either upper case or lower case: + result.add s[0] + else: + # as a special rule, don't transform 'L' to 'l' + if s.len == 1 and s[0] == 'L': result.add 'L' + else: result.add toLower(s[0]) + inc i + while i < s.len: + if s[i] == '_': + inc i + result.add toUpper(s[i]) + elif allUpper: + result.add toLower(s[i]) + else: + result.add s[i] + inc i + + proc checkUse(c: PGen; n: PNode) = if n.info.fileIndex < 0: return let s = n.sym # operators stay as they are: @@ -138,10 +228,11 @@ proc processSym(c: PPassContext, n: PNode): PNode = loadFile(n.info) let line = gSourceFiles[n.info.fileIndex].lines[n.info.line-1] - var first = n.info.col.int + var first = min(n.info.col.int, line.len) if first < 0: return #inc first, skipIgnoreCase(line, "proc ", first) while first > 0 and line[first-1] in Letters: dec first + if first < 0: return if line[first] == '`': inc first if {sfImportc, sfExportc} * s.flags != {}: @@ -149,8 +240,8 @@ proc processSym(c: PPassContext, n: PNode): PNode = # name: if newName != s.name.s and newName != s.loc.r.ropeToStr and lfFullExternalName notin s.loc.flags: - Message(n.info, errGenerated, - "cannot rename $# to $# due to external name" % [s.name.s, newName]) + #Message(n.info, errGenerated, + # "cannot rename $# to $# due to external name" % [s.name.s, newName]) cannotRename.incl(s.id) return let last = first+identLen(line, first)-1 @@ -165,9 +256,48 @@ proc processSym(c: PPassContext, n: PNode): PNode = system.shallowCopy(gSourceFiles[n.info.fileIndex].lines[n.info.line-1], x) gSourceFiles[n.info.fileIndex].dirty = true + +proc check(c: PGen, n: PNode) = + case n.kind + of nkSym: checkUse(c, n) + of nkBlockStmt, nkBlockExpr, nkBlockType: + if n.sons[0].kind != nkEmpty: checkDef(c, n[0]) + check(c, n.sons[1]) + of nkForStmt, nkParForStmt: + let L = n.len + for i in countup(0, L-3): + checkDef(c, n[i]) + check(c, n[L-2]) + check(c, n[L-1]) + of nkProcDef, nkLambdaKinds, nkMethodDef, nkIteratorDef, nkTemplateDef, + nkMacroDef, nkConverterDef: + checkDef(c, n[namePos]) + for i in namePos+1 .. <n.len: check(c, n.sons[i]) + of nkVarSection, nkLetSection: + for i in countup(0, sonsLen(n) - 1): + let a = n.sons[i] + if a.kind == nkCommentStmt: continue + if a.kind != nkIdentDefs and a.kind != nkVarTuple: + globalError(a.info, errGenerated, "invalid ast") + checkMinSonsLen(a, 3) + let L = len(a) + for j in countup(0, L-3): checkDef(c, a.sons[j]) + check(c, a.sons[L-2]) + check(c, a.sons[L-1]) + of nkTypeSection, nkConstSection: + for i in countup(0, sonsLen(n) - 1): + let a = n.sons[i] + if a.kind == nkCommentStmt: continue + checkSonsLen(a, 3) + checkDef(c, a.sons[0]) + check(c, a.sons[1]) + check(c, a.sons[2]) else: - for i in 0 .. <n.safeLen: - discard processSym(c, n.sons[i]) + for i in 0 .. <n.safeLen: check(c, n.sons[i]) + +proc processSym(c: PPassContext, n: PNode): PNode = + result = n + check(PGen(c), n) proc myOpen(module: PSym): PPassContext = var g: PGen diff --git a/compiler/procfind.nim b/compiler/procfind.nim index aefccd140f..1075d51296 100644 --- a/compiler/procfind.nim +++ b/compiler/procfind.nim @@ -17,20 +17,20 @@ proc equalGenericParams(procA, procB: PNode): bool = if sonsLen(procA) != sonsLen(procB): return for i in countup(0, sonsLen(procA) - 1): if procA.sons[i].kind != nkSym: - InternalError(procA.info, "equalGenericParams") + internalError(procA.info, "equalGenericParams") return if procB.sons[i].kind != nkSym: - InternalError(procB.info, "equalGenericParams") + internalError(procB.info, "equalGenericParams") return let a = procA.sons[i].sym let b = procB.sons[i].sym if a.name.id != b.name.id or not sameTypeOrNil(a.typ, b.typ, {TypeDescExactMatch}): return if a.ast != nil and b.ast != nil: - if not ExprStructuralEquivalent(a.ast, b.ast): return + if not exprStructuralEquivalent(a.ast, b.ast): return result = true -proc SearchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = +proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = # Searchs for a forward declaration or a "twin" symbol of fn # in the symbol table. If the parameter lists are exactly # the same the sym in the symbol table is returned, else nil. @@ -77,7 +77,7 @@ when false: dcEqOrDistinctOf): return result = true - proc SearchForBorrowProc*(c: PContext, startScope: PScope, fn: PSym): PSym = + proc searchForBorrowProc*(c: PContext, startScope: PScope, fn: PSym): PSym = # Searchs for the fn in the symbol table. If the parameter lists are suitable # for borrowing the sym in the symbol table is returned, else nil. var it: TIdentIter diff --git a/compiler/renderer.nim b/compiler/renderer.nim index c8fe70e028..27193c2293 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -62,7 +62,7 @@ const MaxLineLen = 80 LineCommentColumn = 30 -proc InitSrcGen(g: var TSrcGen, renderFlags: TRenderFlags) = +proc initSrcGen(g: var TSrcGen, renderFlags: TRenderFlags) = g.comStack = @[] g.tokens = @[] g.indent = 0 @@ -108,12 +108,12 @@ proc indentNL(g: var TSrcGen) = g.pendingNL = g.indent g.lineLen = g.indent -proc Dedent(g: var TSrcGen) = +proc dedent(g: var TSrcGen) = dec(g.indent, indentWidth) assert(g.indent >= 0) if g.pendingNL > indentWidth: - Dec(g.pendingNL, indentWidth) - Dec(g.lineLen, indentWidth) + dec(g.pendingNL, indentWidth) + dec(g.lineLen, indentWidth) proc put(g: var TSrcGen, kind: TTokType, s: string) = addPendingNL(g) diff --git a/compiler/rodread.nim b/compiler/rodread.nim index 6e6b832601..9f69f022a7 100644 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -184,7 +184,7 @@ proc skipNode(r: PRodReader) = if par == 0: break dec par of '(': inc par - else: nil + else: discard inc pos r.pos = pos+1 # skip ')' @@ -248,7 +248,7 @@ proc decodeNodeLazyBody(r: PRodReader, fInfo: TLineInfo, if r.s[r.pos] == ')': inc(r.pos) else: internalError(result.info, "decodeNode: ')' missing") else: - InternalError(fInfo, "decodeNode: '(' missing " & $r.pos) + internalError(fInfo, "decodeNode: '(' missing " & $r.pos) proc decodeNode(r: PRodReader, fInfo: TLineInfo): PNode = result = decodeNodeLazyBody(r, fInfo, nil) @@ -286,7 +286,7 @@ proc decodeLoc(r: PRodReader, loc: var TLoc, info: TLineInfo) = else: loc.a = 0 if r.s[r.pos] == '>': inc(r.pos) - else: InternalError(info, "decodeLoc " & r.s[r.pos]) + else: internalError(info, "decodeLoc " & r.s[r.pos]) proc decodeType(r: PRodReader, info: TLineInfo): PType = result = nil @@ -303,9 +303,9 @@ proc decodeType(r: PRodReader, info: TLineInfo): PType = setId(result.id) if debugIds: registerID(result) else: - InternalError(info, "decodeType: no id") + internalError(info, "decodeType: no id") # here this also avoids endless recursion for recursive type - IdTablePut(gTypeTable, result, result) + idTablePut(gTypeTable, result, result) if r.s[r.pos] == '(': result.n = decodeNode(r, UnknownLineInfo()) if r.s[r.pos] == '$': inc(r.pos) @@ -370,7 +370,7 @@ proc decodeSym(r: PRodReader, info: TLineInfo): PSym = id = decodeVInt(r.s, r.pos) setId(id) else: - InternalError(info, "decodeSym: no id") + internalError(info, "decodeSym: no id") if r.s[r.pos] == '&': inc(r.pos) ident = getIdent(decodeStr(r.s, r.pos)) @@ -384,7 +384,7 @@ proc decodeSym(r: PRodReader, info: TLineInfo): PSym = IdTablePut(r.syms, result, result) if debugIds: registerID(result) elif result.id != id: - InternalError(info, "decodeSym: wrong id") + internalError(info, "decodeSym: wrong id") elif result.kind != skStub and not r.inViewMode: # we already loaded the symbol return @@ -455,7 +455,7 @@ proc skipSection(r: PRodReader) = elif c > 0: dec(c) of '\0': break # end of file - else: nil + else: discard inc(r.pos) else: InternalError("skipSection " & $r.line) @@ -799,7 +799,7 @@ proc loadMethods(r: PRodReader) = r.methods.add(rrGetSym(r, d, UnknownLineInfo())) if r.s[r.pos] == ' ': inc(r.pos) -proc GetCRC*(fileIdx: int32): TCrc32 = +proc getCRC*(fileIdx: int32): TCrc32 = InternalAssert fileIdx >= 0 and fileIdx < gMods.len if gMods[fileIdx].crcDone: @@ -818,14 +818,14 @@ proc checkDep(fileIdx: int32): TReasonForRecompile = # reason has already been computed for this module: return gMods[fileIdx].reason let filename = fileIdx.toFilename - var crc = GetCRC(fileIdx) + var crc = getCRC(fileIdx) gMods[fileIdx].reason = rrNone # we need to set it here to avoid cycles result = rrNone var r: PRodReader = nil var rodfile = toGeneratedFile(filename.withPackageName, RodExt) r = newRodReader(rodfile, crc, fileIdx) if r == nil: - result = (if ExistsFile(rodfile): rrRodInvalid else: rrRodDoesNotExist) + result = (if existsFile(rodfile): rrRodInvalid else: rrRodDoesNotExist) else: processRodFile(r, crc) result = r.reason @@ -880,12 +880,12 @@ proc rawLoadStub(s: PSym) = if rs != s: #echo "rs: ", toHex(cast[int](rs.position), int.sizeof * 2), # "\ns: ", toHex(cast[int](s.position), int.sizeof * 2) - InternalError(rs.info, "loadStub: wrong symbol") + internalError(rs.info, "loadStub: wrong symbol") elif rs.id != theId: - InternalError(rs.info, "loadStub: wrong ID") + internalError(rs.info, "loadStub: wrong ID") #MessageOut('loaded stub: ' + s.name.s); -proc LoadStub*(s: PSym) = +proc loadStub*(s: PSym) = ## loads the stub symbol `s`. # deactivate the GC here because we do a deep recursion and generate no @@ -912,8 +912,8 @@ proc getBody*(s: PSym): PNode = s.ast.sons[bodyPos] = result s.offset = 0 -InitIdTable(gTypeTable) -InitStrTable(rodCompilerProcs) +initIdTable(gTypeTable) +initStrTable(rodCompilerProcs) # viewer: proc writeNode(f: TFile; n: PNode) = @@ -1166,7 +1166,7 @@ proc viewFile(rodfile: string) = if r.s[r.pos] == ')': inc r.pos outf.write("<not supported by viewer>)\n") else: - InternalError("invalid section: '" & section & + internalError("invalid section: '" & section & "' at " & $r.line & " in " & r.filename) skipSection(r) if r.s[r.pos] == '\x0A': diff --git a/compiler/rodutils.nim b/compiler/rodutils.nim index 0ee3b1ec4c..4527f77daa 100644 --- a/compiler/rodutils.nim +++ b/compiler/rodutils.nim @@ -12,7 +12,7 @@ import strutils proc c_sprintf(buf, frmt: cstring) {.importc: "sprintf", nodecl, varargs.} -proc ToStrMaxPrecision*(f: BiggestFloat): string = +proc toStrMaxPrecision*(f: BiggestFloat): string = if f != f: result = "NAN" elif f == 0.0: @@ -36,7 +36,7 @@ proc hexChar(c: char, xi: var int) = of '0'..'9': xi = (xi shl 4) or (ord(c) - ord('0')) of 'a'..'f': xi = (xi shl 4) or (ord(c) - ord('a') + 10) of 'A'..'F': xi = (xi shl 4) or (ord(c) - ord('A') + 10) - else: nil + else: discard proc decodeStr*(s: cstring, pos: var int): string = var i = pos diff --git a/compiler/ropes.nim b/compiler/ropes.nim index 707c291232..4f8553375f 100644 --- a/compiler/ropes.nim +++ b/compiler/ropes.nim @@ -91,13 +91,13 @@ proc writeRopeIfNotEqual*(r: PRope, filename: string): bool proc ropeToStr*(p: PRope): string proc ropef*(frmt: TFormatStr, args: varargs[PRope]): PRope proc appf*(c: var PRope, frmt: TFormatStr, args: varargs[PRope]) -proc RopeEqualsFile*(r: PRope, f: string): bool +proc ropeEqualsFile*(r: PRope, f: string): bool # returns true if the rope r is the same as the contents of file f -proc RopeInvariant*(r: PRope): bool +proc ropeInvariant*(r: PRope): bool # exported for debugging # implementation -var ErrorHandler*: proc(err: TRopesError, msg: string, useWarning = false) +var errorHandler*: proc(err: TRopesError, msg: string, useWarning = false) # avoid dependency on msgs.nim proc ropeLen(a: PRope): int = @@ -126,7 +126,7 @@ proc resetRopeCache* = for i in low(cache)..high(cache): cache[i] = nil -proc RopeInvariant(r: PRope): bool = +proc ropeInvariant(r: PRope): bool = if r == nil: result = true else: @@ -159,7 +159,7 @@ proc toRope(s: string): PRope = result = insertInCache(s) assert(RopeInvariant(result)) -proc RopeSeqInsert(rs: var TRopeSeq, r: PRope, at: Natural) = +proc ropeSeqInsert(rs: var TRopeSeq, r: PRope, at: Natural) = var length = len(rs) if at > length: setlen(rs, at + 1) @@ -177,8 +177,8 @@ proc newRecRopeToStr(result: var string, resultLen: var int, r: PRope) = add(stack, it.right) it = it.left assert(it.data != nil) - CopyMem(addr(result[resultLen]), addr(it.data[0]), it.length) - Inc(resultLen, it.length) + copyMem(addr(result[resultLen]), addr(it.data[0]), it.length) + inc(resultLen, it.length) assert(resultLen <= len(result)) proc ropeToStr(p: PRope): string = @@ -227,13 +227,13 @@ proc writeRope*(f: TFile, c: PRope) = assert(it.data != nil) write(f, it.data) -proc WriteRope*(head: PRope, filename: string, useWarning = false) = +proc writeRope*(head: PRope, filename: string, useWarning = false) = var f: tfile if open(f, filename, fmWrite): if head != nil: WriteRope(f, head) close(f) else: - ErrorHandler(rCannotOpenFile, filename, useWarning) + errorHandler(rCannotOpenFile, filename, useWarning) var rnl* = tnl.newRope @@ -263,7 +263,7 @@ proc ropef(frmt: TFormatStr, args: varargs[PRope]): PRope = if (i > length + 0 - 1) or not (frmt[i] in {'0'..'9'}): break num = j if j > high(args) + 1: - ErrorHandler(rInvalidFormatStr, $(j)) + errorHandler(rInvalidFormatStr, $(j)) else: app(result, args[j - 1]) of 'n': @@ -273,7 +273,7 @@ proc ropef(frmt: TFormatStr, args: varargs[PRope]): PRope = app(result, rnl) inc(i) else: - ErrorHandler(rInvalidFormatStr, $(frmt[i])) + errorHandler(rInvalidFormatStr, $(frmt[i])) var start = i while i < length: if frmt[i] != '$': inc(i) @@ -308,8 +308,8 @@ proc auxRopeEqualsFile(r: PRope, bin: var tfile, buf: Pointer): bool = result = auxRopeEqualsFile(r.left, bin, buf) if result: result = auxRopeEqualsFile(r.right, bin, buf) -proc RopeEqualsFile(r: PRope, f: string): bool = - var bin: tfile +proc ropeEqualsFile(r: PRope, f: string): bool = + var bin: TFile result = open(bin, f) if not result: return # not equal if file does not exist diff --git a/compiler/sem.nim b/compiler/sem.nim index d0fc5bfe1a..ee1019aa80 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -66,7 +66,7 @@ proc fitNode(c: PContext, formal: PType, arg: PNode): PNode = result = copyTree(arg) result.typ = formal -var CommonTypeBegin = PType(kind: tyExpr) +var commonTypeBegin = PType(kind: tyExpr) proc commonType*(x, y: PType): PType = # new type relation that is used for array constructors, diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 9e9614796d..8fe81c4c6a 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -19,7 +19,7 @@ proc sameMethodDispatcher(a, b: PSym): bool = if aa.sym == bb.sym: result = true else: - nil + discard # generics have no dispatcher yet, so we need to compare the method # names; however, the names are equal anyway because otherwise we # wouldn't even consider them to be overloaded. But even this does @@ -74,13 +74,13 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode, else: nil sym = nextOverloadIter(o, c, headSymbol) -proc NotFoundError*(c: PContext, n: PNode, errors: seq[string]) = +proc notFoundError*(c: PContext, n: PNode, errors: seq[string]) = # Gives a detailed error message; this is separated from semOverloadedCall, # as semOverlodedCall is already pretty slow (and we need this information # only in case of an error). - if c.InCompilesContext > 0: + if c.inCompilesContext > 0: # fail fast: - GlobalError(n.info, errTypeMismatch, "") + globalError(n.info, errTypeMismatch, "") var result = msgKindToString(errTypeMismatch) add(result, describeArgs(c, n, 1 + ord(nfDelegate in n.flags))) add(result, ')') @@ -93,7 +93,7 @@ proc NotFoundError*(c: PContext, n: PNode, errors: seq[string]) = if candidates != "": add(result, "\n" & msgKindToString(errButExpected) & "\n" & candidates) - LocalError(n.Info, errGenerated, result) + localError(n.Info, errGenerated, result) proc gatherUsedSyms(c: PContext, usedSyms: var seq[PNode]) = for scope in walkScopes(c.currentScope): @@ -164,12 +164,12 @@ proc resolveOverloads(c: PContext, n, orig: PNode, if alt.state == csMatch and cmpCandidates(result, alt) == 0 and not sameMethodDispatcher(result.calleeSym, alt.calleeSym): - InternalAssert result.state == csMatch + internalAssert result.state == csMatch #writeMatches(result) #writeMatches(alt) if c.inCompilesContext > 0: # quick error message for performance of 'compiles' built-in: - GlobalError(n.Info, errGenerated, "ambiguous call") + globalError(n.Info, errGenerated, "ambiguous call") elif gErrorCounter == 0: # don't cascade errors var args = "(" @@ -178,7 +178,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode, add(args, typeToString(n.sons[i].typ)) add(args, ")") - LocalError(n.Info, errGenerated, msgKindToString(errAmbiguousCallXYZ) % [ + localError(n.Info, errGenerated, msgKindToString(errAmbiguousCallXYZ) % [ getProcHeader(result.calleeSym), getProcHeader(alt.calleeSym), args]) @@ -197,14 +197,14 @@ proc instGenericConvertersSons*(c: PContext, n: PNode, x: TCandidate) = for i in 1 .. <n.len: instGenericConvertersArg(c, n.sons[i], x) -proc IndexTypesMatch(c: PContext, f, a: PType, arg: PNode): PNode = +proc indexTypesMatch(c: PContext, f, a: PType, arg: PNode): PNode = var m: TCandidate initCandidate(m, f) result = paramTypesMatch(c, m, f, a, arg, nil) if m.genericConverter and result != nil: instGenericConvertersArg(c, result, m) -proc ConvertTo*(c: PContext, f: PType, n: PNode): PNode = +proc convertTo*(c: PContext, f: PType, n: PNode): PNode = var m: TCandidate initCandidate(m, f) result = paramTypesMatch(c, m, f, n.typ, n, nil) @@ -239,7 +239,7 @@ proc semOverloadedCall(c: PContext, n, nOrig: PNode, # else: result = errorNode(c, n) proc explicitGenericInstError(n: PNode): PNode = - LocalError(n.info, errCannotInstantiateX, renderTree(n)) + localError(n.info, errCannotInstantiateX, renderTree(n)) result = n proc explicitGenericSym(c: PContext, n: PNode, s: PSym): PNode = @@ -283,7 +283,7 @@ proc explicitGenericInstantiation(c: PContext, n: PNode, s: PSym): PNode = else: result = explicitGenericInstError(n) -proc SearchForBorrowProc(c: PContext, startScope: PScope, fn: PSym): PSym = +proc searchForBorrowProc(c: PContext, startScope: PScope, fn: PSym): PSym = # Searchs for the fn in the symbol table. If the parameter lists are suitable # for borrowing the sym in the symbol table is returned, else nil. # New approach: generate fn(x, y, z) where x, y, z have the proper types diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 650a399f73..1ab38c9ce5 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -21,7 +21,7 @@ type options*: TOptions defaultCC*: TCallingConvention dynlib*: PLib - Notes*: TNoteKinds + notes*: TNoteKinds otherPragmas*: PNode # every pragma can be pushed POptionEntry* = ref TOptionEntry @@ -32,7 +32,7 @@ type resultSym*: PSym # the result symbol (if we are in a proc) nestedLoopCounter*: int # whether we are in a loop or not nestedBlockCounter*: int # whether we are in a block or not - InTryStmt*: int # whether we are in a try statement; works also + inTryStmt*: int # whether we are in a try statement; works also # in standalone ``except`` and ``finally`` next*: PProcCon # used for stacking procedure contexts @@ -55,16 +55,16 @@ type friendModule*: PSym # current friend module; may access private data; # this is used so that generic instantiations # can access private object fields - InstCounter*: int # to prevent endless instantiations + instCounter*: int # to prevent endless instantiations threadEntries*: TSymSeq # list of thread entries to check - AmbiguousSymbols*: TIntSet # ids of all ambiguous symbols (cannot + ambiguousSymbols*: TIntSet # ids of all ambiguous symbols (cannot # store this info in the syms themselves!) - InTypeClass*: int # > 0 if we are in a user-defined type class - InGenericContext*: int # > 0 if we are in a generic type - InUnrolledContext*: int # > 0 if we are unrolling a loop - InCompilesContext*: int # > 0 if we are in a ``compiles`` magic - InGenericInst*: int # > 0 if we are instantiating a generic + inTypeClass*: int # > 0 if we are in a user-defined type class + inGenericContext*: int # > 0 if we are in a generic type + inUnrolledContext*: int # > 0 if we are unrolling a loop + inCompilesContext*: int # > 0 if we are in a ``compiles`` magic + inGenericInst*: int # > 0 if we are instantiating a generic converters*: TSymSeq # sequence of converters patterns*: TSymSeq # sequence of pattern matchers optionStack*: TLinkedList @@ -83,7 +83,7 @@ type includedFiles*: TIntSet # used to detect recursive include files userPragmas*: TStrTable evalContext*: PEvalContext - UnknownIdents*: TIntSet # ids of all unknown identifiers to prevent + unknownIdents*: TIntSet # ids of all unknown identifiers to prevent # naming it multiple times generics*: seq[TInstantiationPair] # pending list of instantiated generics to compile lastGenericIdx*: int # used for the generics stack @@ -114,8 +114,8 @@ proc scopeDepth*(c: PContext): int {.inline.} = # owner handling: proc getCurrOwner*(): PSym -proc PushOwner*(owner: PSym) -proc PopOwner*() +proc pushOwner*(owner: PSym) +proc popOwner*() # implementation var gOwners*: seq[PSym] = @[] @@ -128,13 +128,13 @@ proc getCurrOwner(): PSym = # BUGFIX: global array is needed! result = gOwners[high(gOwners)] -proc PushOwner(owner: PSym) = +proc pushOwner(owner: PSym) = add(gOwners, owner) -proc PopOwner() = +proc popOwner() = var length = len(gOwners) if length > 0: setlen(gOwners, length - 1) - else: InternalError("popOwner") + else: internalError("popOwner") proc lastOptionEntry(c: PContext): POptionEntry = result = POptionEntry(c.optionStack.tail) @@ -249,7 +249,7 @@ proc markIndirect*(c: PContext, s: PSym) {.inline.} = # XXX add to 'c' for global analysis proc illFormedAst*(n: PNode) = - GlobalError(n.info, errIllFormedAstX, renderTree(n, {renderNoComments})) + globalError(n.info, errIllFormedAstX, renderTree(n, {renderNoComments})) proc checkSonsLen*(n: PNode, length: int) = if sonsLen(n) != length: illFormedAst(n) diff --git a/compiler/semdestruct.nim b/compiler/semdestruct.nim index 797d8895e6..47d7838181 100644 --- a/compiler/semdestruct.nim +++ b/compiler/semdestruct.nim @@ -15,9 +15,9 @@ # generation (needed for recursive types) # 2) DestructorIsTrivial: completed the analysis before and determined # that the type has a trivial destructor -var AnalyzingDestructor, DestructorIsTrivial: PSym -new(AnalyzingDestructor) -new(DestructorIsTrivial) +var analyzingDestructor, destructorIsTrivial: PSym +new(analyzingDestructor) +new(destructorIsTrivial) var destructorName = getIdent"destroy_" diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index c45b830956..5f41a8dd94 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1176,7 +1176,7 @@ proc semAsgn(c: PContext, n: PNode): PNode = asgnToResultVar(c, n, n.sons[0], n.sons[1]) result = n -proc SemReturn(c: PContext, n: PNode): PNode = +proc semReturn(c: PContext, n: PNode): PNode = result = n checkSonsLen(n, 1) if c.p.owner.kind in {skConverter, skMethod, skProc, skMacro} or @@ -1223,7 +1223,7 @@ proc semProcBody(c: PContext, n: PNode): PNode = discardCheck(c, result) closeScope(c) -proc SemYieldVarResult(c: PContext, n: PNode, restype: PType) = +proc semYieldVarResult(c: PContext, n: PNode, restype: PType) = var t = skipTypes(restype, {tyGenericInst}) case t.kind of tyVar: @@ -1242,7 +1242,7 @@ proc SemYieldVarResult(c: PContext, n: PNode, restype: PType) = localError(n.sons[0].info, errXExpected, "tuple constructor") else: nil -proc SemYield(c: PContext, n: PNode): PNode = +proc semYield(c: PContext, n: PNode): PNode = result = n checkSonsLen(n, 1) if c.p.owner == nil or c.p.owner.kind != skIterator: @@ -1267,30 +1267,30 @@ proc lookUpForDefined(c: PContext, i: PIdent, onlyCurrentScope: bool): PSym = else: result = searchInScopes(c, i) # no need for stub loading -proc LookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = +proc lookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = case n.kind of nkIdent: - result = LookupForDefined(c, n.ident, onlyCurrentScope) + result = lookupForDefined(c, n.ident, onlyCurrentScope) of nkDotExpr: result = nil if onlyCurrentScope: return checkSonsLen(n, 2) - var m = LookupForDefined(c, n.sons[0], onlyCurrentScope) + var m = lookupForDefined(c, n.sons[0], onlyCurrentScope) if (m != nil) and (m.kind == skModule): if (n.sons[1].kind == nkIdent): var ident = n.sons[1].ident if m == c.module: - result = StrTableGet(c.topLevelScope.symbols, ident) + result = strTableGet(c.topLevelScope.symbols, ident) else: - result = StrTableGet(m.tab, ident) + result = strTableGet(m.tab, ident) else: - LocalError(n.sons[1].info, errIdentifierExpected, "") + localError(n.sons[1].info, errIdentifierExpected, "") of nkAccQuoted: result = lookupForDefined(c, considerAcc(n), onlyCurrentScope) of nkSym: result = n.sym else: - LocalError(n.info, errIdentifierExpected, renderTree(n)) + localError(n.info, errIdentifierExpected, renderTree(n)) result = nil proc semDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PNode = diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index d626d2eb2d..760fd303fa 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -73,7 +73,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym): PNode = result = n else: result = newSymNode(s, n.info) -proc Lookup(c: PContext, n: PNode, flags: TSemGenericFlags, +proc lookup(c: PContext, n: PNode, flags: TSemGenericFlags, ctx: var TIntSet): PNode = result = n let ident = considerAcc(n) diff --git a/compiler/seminst.nim b/compiler/seminst.nim index d7d64fd547..5a4b832406 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -50,7 +50,7 @@ proc sameInstantiation(a, b: TInstantiation): bool = flags = {TypeDescExactMatch}): return result = true -proc GenericCacheGet(genericSym: Psym, entry: TInstantiation): PSym = +proc genericCacheGet(genericSym: Psym, entry: TInstantiation): PSym = if genericSym.procInstCache != nil: for inst in genericSym.procInstCache: if sameInstantiation(entry, inst[]): @@ -257,7 +257,7 @@ proc fixupProcType(c: PContext, genericType: PType, result.sons[i] = fixupProcType(c, result.sons[i], inst) result = instGenericContainer(c, getInfoContext(-1), result) - else: nil + else: discard proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, info: TLineInfo): PSym = @@ -290,7 +290,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, instantiateGenericParamList(c, n.sons[genericParamsPos], pt, entry[]) result.typ = fixupProcType(c, fn.typ, entry[]) n.sons[genericParamsPos] = ast.emptyNode - var oldPrc = GenericCacheGet(fn, entry[]) + var oldPrc = genericCacheGet(fn, entry[]) if oldPrc == nil: fn.procInstCache.safeAdd(entry) c.generics.add(makeInstPair(fn, entry)) @@ -311,5 +311,3 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, c.friendModule = oldFriend dec(c.InstCounter) if result.kind == skMethod: finishMethod(c, result) - - diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 6f0cc3c8b2..832e4e9626 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -10,7 +10,7 @@ ## this module does the semantic checking of statements # included from sem.nim -var EnforceVoidContext = PType(kind: tyStmt) +var enforceVoidContext = PType(kind: tyStmt) proc semCommand(c: PContext, n: PNode): PNode = result = semExprNoType(c, n) @@ -117,7 +117,7 @@ const nkElse, nkStmtListExpr, nkTryStmt, nkFinally, nkExceptBranch, nkElifBranch, nkElifExpr, nkElseExpr, nkBlockStmt, nkBlockExpr} -proc ImplicitlyDiscardable(n: PNode): bool = +proc implicitlyDiscardable(n: PNode): bool = var n = n while n.kind in skipForDiscardable: n = n.lastSon result = isCallExpr(n) and n.sons[0].kind == nkSym and @@ -197,7 +197,7 @@ proc semCase(c: PContext, n: PNode): PNode = of tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt32: chckCovered = true of tyFloat..tyFloat128, tyString, tyError: - nil + discard else: LocalError(n.info, errSelectorMustBeOfCertainTypes) return @@ -501,7 +501,7 @@ proc semForObjectFields(c: TFieldsCtx, typ, forLoop, father: PNode) = father.add(SemStmt(c.c, body)) dec c.c.InUnrolledContext closeScope(c.c) - of nkNilLit: nil + of nkNilLit: discard of nkRecCase: let L = forLoop.len let call = forLoop.sons[L-2] @@ -793,7 +793,7 @@ proc typeSectionFinalPass(c: PContext, n: PNode) = st.sons[0].sym = newSym(skType, getIdent(s.name.s & ":ObjectType"), getCurrOwner(), s.info) -proc SemTypeSection(c: PContext, n: PNode): PNode = +proc semTypeSection(c: PContext, n: PNode): PNode = typeSectionLeftSidePass(c, n) typeSectionRightSidePass(c, n) typeSectionFinalPass(c, n) diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 0c7c2eff4b..4f94cd1f65 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -380,7 +380,7 @@ proc semTemplBodyDirty(c: var TemplCtx, n: PNode): PNode = of nkBindStmt: result = semBindStmt(c.c, n, c.toBind) of nkEmpty, nkSym..nkNilLit: - nil + discard else: # dotExpr is ambiguous: note that we explicitely allow 'x.TemplateParam', # so we use the generic code for nkDotExpr too @@ -503,7 +503,7 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = elif templToExpand(s): result = semPatternBody(c, semTemplateExpr(c.c, n, s, false)) else: - nil + discard # we keep the ident unbound for matching instantiated symbols and # more flexibility diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 6c9c476d9b..1f995f5e76 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -356,7 +356,7 @@ proc semBranchRange(c: PContext, t, a, b: PNode, covered: var biggestInt): PNode if emptyRange(ac, bc): LocalError(b.info, errRangeIsEmpty) else: covered = covered + getOrdValue(bc) - getOrdValue(ac) + 1 -proc SemCaseBranchRange(c: PContext, t, b: PNode, +proc semCaseBranchRange(c: PContext, t, b: PNode, covered: var biggestInt): PNode = checkSonsLen(b, 3) result = semBranchRange(c, t, b.sons[1], b.sons[2], covered) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 61c31a4fe4..c872c39f32 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -68,9 +68,9 @@ type symMap*: TIdTable # map PSym to PSym info*: TLineInfo -proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType -proc ReplaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym -proc ReplaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode +proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType +proc replaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym +proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode = result = copyNode(n) @@ -81,13 +81,13 @@ proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode = if i == 0: result.add(n[i]) else: result.add(prepareNode(cl, n[i])) -proc ReplaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = +proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = if n == nil: return result = copyNode(n) result.typ = ReplaceTypeVarsT(cl, n.typ) case n.kind of nkNone..pred(nkSym), succ(nkSym)..nkNilLit: - nil + discard of nkSym: result.sym = ReplaceTypeVarsS(cl, n.sym) of nkRecWhen: @@ -118,7 +118,7 @@ proc ReplaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = for i in countup(0, length - 1): result.sons[i] = ReplaceTypeVarsN(cl, n.sons[i]) -proc ReplaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym = +proc replaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym = if s == nil: return nil result = PSym(idTableGet(cl.symMap, s)) if result == nil: @@ -192,11 +192,11 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = rawAddSon(result, newbody) checkPartialConstructedType(cl.info, newbody) -proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = +proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = result = t if t == nil: return case t.kind - of tyTypeClass: nil + of tyTypeClass: discard of tyGenericParam: result = lookupTypeVar(cl, t) if result.kind == tyGenericInvokation: @@ -235,11 +235,10 @@ proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = proc generateTypeInstance*(p: PContext, pt: TIdTable, arg: PNode, t: PType): PType = var cl: TReplTypeVars - InitIdTable(cl.symMap) + initIdTable(cl.symMap) copyIdTable(cl.typeMap, pt) cl.info = arg.info cl.c = p pushInfoContext(arg.info) - result = ReplaceTypeVarsT(cl, t) + result = replaceTypeVarsT(cl, t) popInfoContext() - diff --git a/compiler/service.nim b/compiler/service.nim index 1de83af7c6..1cae72f2a2 100644 --- a/compiler/service.nim +++ b/compiler/service.nim @@ -29,7 +29,7 @@ var # the arguments to be passed to the program that # should be run -proc ProcessCmdLine*(pass: TCmdLinePass, cmd: string) = +proc processCmdLine*(pass: TCmdLinePass, cmd: string) = var p = parseopt.initOptParser(cmd) var argsCount = 0 while true: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index cacf4782e3..7ccb1bdc18 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -887,7 +887,7 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, result = arg put(m.bindings, f, a) -proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, +proc paramTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, argSemantized, argOrig: PNode): PNode = var r: TTypeRelation @@ -1003,7 +1003,7 @@ proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, else: result = userConvMatch(c, m, base(f), a, arg) -proc ParamTypesMatch*(c: PContext, m: var TCandidate, f, a: PType, +proc paramTypesMatch*(c: PContext, m: var TCandidate, f, a: PType, arg, argOrig: PNode): PNode = if arg == nil or arg.kind notin nkSymChoices: result = ParamTypesMatchAux(c, m, f, a, arg, argOrig) @@ -1184,14 +1184,14 @@ proc matchesAux(c: PContext, n, nOrig: PNode, InternalError(n.sons[a].info, "matches") return formal = m.callee.n.sons[f].sym - if ContainsOrIncl(marker, formal.position): + if containsOrIncl(marker, formal.position): # already in namedParams: - LocalError(n.sons[a].info, errCannotBindXTwice, formal.name.s) + localError(n.sons[a].info, errCannotBindXTwice, formal.name.s) m.state = csNoMatch return m.baseTypeMatch = false n.sons[a] = prepareOperand(c, formal.typ, n.sons[a]) - var arg = ParamTypesMatch(c, m, formal.typ, n.sons[a].typ, + var arg = paramTypesMatch(c, m, formal.typ, n.sons[a].typ, n.sons[a], nOrig.sons[a]) if arg == nil: m.state = csNoMatch @@ -1228,7 +1228,7 @@ proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) = var f = 1 while f < sonsLen(m.callee.n): var formal = m.callee.n.sons[f].sym - if not ContainsOrIncl(marker, formal.position): + if not containsOrIncl(marker, formal.position): if formal.ast == nil: if formal.typ.kind == tyVarargs: var container = newNodeIT(nkBracket, n.info, arrayConstr(c, n.info)) diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 76a6c21d92..4f31728149 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -28,7 +28,7 @@ proc origModuleName(m: PSym): string = else: m.name.s -proc SymToStr(s: PSym, isLocal: bool, section: string, li: TLineInfo): string = +proc symToStr(s: PSym, isLocal: bool, section: string, li: TLineInfo): string = result = section result.add(sep) result.add($s.kind) @@ -55,7 +55,7 @@ proc SymToStr(s: PSym, isLocal: bool, section: string, li: TLineInfo): string = when not defined(noDocgen): result.add(s.extractDocComment.escape) -proc SymToStr(s: PSym, isLocal: bool, section: string): string = +proc symToStr(s: PSym, isLocal: bool, section: string): string = result = SymToStr(s, isLocal, section, s.info) proc filterSym(s: PSym): bool {.inline.} = diff --git a/compiler/syntaxes.nim b/compiler/syntaxes.nim index 3965cb3fe1..6970f0c44f 100644 --- a/compiler/syntaxes.nim +++ b/compiler/syntaxes.nim @@ -40,7 +40,7 @@ proc parseTopLevelStmt*(p: var TParsers): PNode # implementation -proc ParseFile(fileIdx: int32): PNode = +proc parseFile(fileIdx: int32): PNode = var p: TParsers f: tfile @@ -74,7 +74,7 @@ proc parseTopLevelStmt(p: var TParsers): PNode = result = ast.emptyNode #skinEndX: result := pendx.parseTopLevelStmt(p.parser); -proc UTF8_BOM(s: string): int = +proc utf8Bom(s: string): int = if (s[0] == '\xEF') and (s[1] == '\xBB') and (s[2] == '\xBF'): result = 3 else: @@ -92,7 +92,7 @@ proc parsePipe(filename: string, inputStream: PLLStream): PNode = if s != nil: var line = newStringOfCap(80) discard LLStreamReadLine(s, line) - var i = UTF8_Bom(line) + var i = utf8Bom(line) if containsShebang(line, i): discard LLStreamReadLine(s, line) i = 0 @@ -100,20 +100,20 @@ proc parsePipe(filename: string, inputStream: PLLStream): PNode = inc(i, 2) while line[i] in WhiteSpace: inc(i) var q: TParser - OpenParser(q, filename, LLStreamOpen(substr(line, i))) + openParser(q, filename, LLStreamOpen(substr(line, i))) result = parser.parseAll(q) - CloseParser(q) + closeParser(q) LLStreamClose(s) proc getFilter(ident: PIdent): TFilterKind = for i in countup(low(TFilterKind), high(TFilterKind)): - if IdentEq(ident, filterNames[i]): + if identEq(ident, filterNames[i]): return i result = filtNone proc getParser(ident: PIdent): TParserKind = for i in countup(low(TParserKind), high(TParserKind)): - if IdentEq(ident, parserNames[i]): + if identEq(ident, parserNames[i]): return i rawMessage(errInvalidDirectiveX, ident.s) @@ -142,23 +142,23 @@ proc applyFilter(p: var TParsers, n: PNode, filename: string, if f != filtNone: if gVerbosity >= 2: rawMessage(hintCodeBegin, []) - MsgWriteln(result.s) + msgWriteln(result.s) rawMessage(hintCodeEnd, []) proc evalPipe(p: var TParsers, n: PNode, filename: string, start: PLLStream): PLLStream = result = start if n.kind == nkEmpty: return - if (n.kind == nkInfix) and (n.sons[0].kind == nkIdent) and - IdentEq(n.sons[0].ident, "|"): - for i in countup(1, 2): - if n.sons[i].kind == nkInfix: + if n.kind == nkInfix and n.sons[0].kind == nkIdent and + identEq(n.sons[0].ident, "|"): + for i in countup(1, 2): + if n.sons[i].kind == nkInfix: result = evalPipe(p, n.sons[i], filename, result) - else: + else: result = applyFilter(p, n.sons[i], filename, result) - elif n.kind == nkStmtList: + elif n.kind == nkStmtList: result = evalPipe(p, n.sons[0], filename, result) - else: + else: result = applyFilter(p, n, filename, result) proc openParsers(p: var TParsers, fileIdx: int32, inputstream: PLLStream) = diff --git a/compiler/transf.nim b/compiler/transf.nim index 77642a3b85..d6f54eddb4 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -719,7 +719,7 @@ proc processTransf(c: PTransf, n: PNode, owner: PSym): PNode = # Note: For interactive mode we cannot call 'passes.skipCodegen' and skip # this step! We have to rely that the semantic pass transforms too errornous # nodes into an empty node. - if passes.skipCodegen(n) or c.fromCache or nfTransf in n.flags: return n + if c.fromCache or nfTransf in n.flags: return n pushTransCon(c, newTransCon(owner)) result = PNode(transform(c, n)) popTransCon(c) diff --git a/compiler/trees.nim b/compiler/trees.nim index ab5c97a196..ea2f8fbf11 100644 --- a/compiler/trees.nim +++ b/compiler/trees.nim @@ -36,7 +36,7 @@ proc cyclicTree*(n: PNode): bool = var s = newNodeI(nkEmpty, n.info) result = cyclicTreeAux(n, s) -proc ExprStructuralEquivalent*(a, b: PNode): bool = +proc exprStructuralEquivalent*(a, b: PNode): bool = result = false if a == b: result = true @@ -53,17 +53,17 @@ proc ExprStructuralEquivalent*(a, b: PNode): bool = else: if sonsLen(a) == sonsLen(b): for i in countup(0, sonsLen(a) - 1): - if not ExprStructuralEquivalent(a.sons[i], b.sons[i]): return + if not exprStructuralEquivalent(a.sons[i], b.sons[i]): return result = true -proc sameTree*(a, b: PNode): bool = +proc sameTree*(a, b: PNode): bool = result = false - if a == b: + if a == b: result = true - elif (a != nil) and (b != nil) and (a.kind == b.kind): - if a.flags != b.flags: return - if a.info.line != b.info.line: return - if a.info.col != b.info.col: + elif a != nil and b != nil and a.kind == b.kind: + if a.flags != b.flags: return + if a.info.line != b.info.line: return + if a.info.col != b.info.col: return #if a.info.fileIndex <> b.info.fileIndex then exit; case a.kind of nkSym: @@ -74,7 +74,7 @@ proc sameTree*(a, b: PNode): bool = of nkFloatLit..nkFloat64Lit: result = a.floatVal == b.floatVal of nkStrLit..nkTripleStrLit: result = a.strVal == b.strVal of nkEmpty, nkNilLit, nkType: result = true - else: + else: if sonsLen(a) == sonsLen(b): for i in countup(0, sonsLen(a) - 1): if not sameTree(a.sons[i], b.sons[i]): return @@ -84,13 +84,13 @@ proc getProcSym*(call: PNode): PSym = result = call.sons[0].sym proc getOpSym*(op: PNode): PSym = - if not (op.kind in {nkCall, nkHiddenCallConv, nkCommand, nkCallStrLit}): + if op.kind notin {nkCall, nkHiddenCallConv, nkCommand, nkCallStrLit}: result = nil - else: - if (sonsLen(op) <= 0): InternalError(op.info, "getOpSym") + else: + if sonsLen(op) <= 0: internalError(op.info, "getOpSym") elif op.sons[0].Kind == nkSym: result = op.sons[0].sym else: result = nil - + proc getMagic*(op: PNode): TMagic = case op.kind of nkCallKinds: @@ -99,7 +99,7 @@ proc getMagic*(op: PNode): TMagic = else: result = mNone else: result = mNone -proc TreeToSym*(t: PNode): PSym = +proc treeToSym*(t: PNode): PSym = result = t.sym proc isConstExpr*(n: PNode): bool = @@ -118,7 +118,7 @@ proc isDeepConstExpr*(n: PNode): bool = for i in 0 .. <n.len: if not isDeepConstExpr(n.sons[i]): return false result = true - else: nil + else: discard proc flattenTreeAux(d, a: PNode, op: TMagic) = if (getMagic(a) == op): # a is a "leaf", so add it: @@ -129,17 +129,17 @@ proc flattenTreeAux(d, a: PNode, op: TMagic) = proc flattenTree*(root: PNode, op: TMagic): PNode = result = copyNode(root) - if (getMagic(root) == op): + if getMagic(root) == op: # BUGFIX: forget to copy prc addSon(result, copyNode(root.sons[0])) flattenTreeAux(result, root, op) -proc SwapOperands*(op: PNode) = +proc swapOperands*(op: PNode) = var tmp = op.sons[1] op.sons[1] = op.sons[2] op.sons[2] = tmp -proc IsRange*(n: PNode): bool {.inline.} = +proc isRange*(n: PNode): bool {.inline.} = if n.kind == nkInfix: if n[0].kind == nkIdent and n[0].ident.id == ord(wDotDot) or n[0].kind in {nkClosedSymChoice, nkOpenSymChoice} and diff --git a/compiler/treetab.nim b/compiler/treetab.nim index 75e3fd20a9..d28dcd2367 100644 --- a/compiler/treetab.nim +++ b/compiler/treetab.nim @@ -17,7 +17,7 @@ proc hashTree(n: PNode): THash = result = ord(n.kind) case n.kind of nkEmpty, nkNilLit, nkType: - nil + discard of nkIdent: result = result !& n.ident.h of nkSym: @@ -34,7 +34,7 @@ proc hashTree(n: PNode): THash = for i in countup(0, sonsLen(n) - 1): result = result !& hashTree(n.sons[i]) -proc TreesEquivalent(a, b: PNode): bool = +proc treesEquivalent(a, b: PNode): bool = if a == b: result = true elif (a != nil) and (b != nil) and (a.kind == b.kind): @@ -48,24 +48,24 @@ proc TreesEquivalent(a, b: PNode): bool = else: if sonsLen(a) == sonsLen(b): for i in countup(0, sonsLen(a) - 1): - if not TreesEquivalent(a.sons[i], b.sons[i]): return + if not treesEquivalent(a.sons[i], b.sons[i]): return result = true if result: result = sameTypeOrNil(a.typ, b.typ) -proc NodeTableRawGet(t: TNodeTable, k: THash, key: PNode): int = +proc nodeTableRawGet(t: TNodeTable, k: THash, key: PNode): int = var h: THash = k and high(t.data) while t.data[h].key != nil: - if (t.data[h].h == k) and TreesEquivalent(t.data[h].key, key): + if (t.data[h].h == k) and treesEquivalent(t.data[h].key, key): return h h = nextTry(h, high(t.data)) result = -1 -proc NodeTableGet*(t: TNodeTable, key: PNode): int = - var index = NodeTableRawGet(t, hashTree(key), key) +proc nodeTableGet*(t: TNodeTable, key: PNode): int = + var index = nodeTableRawGet(t, hashTree(key), key) if index >= 0: result = t.data[index].val else: result = low(int) -proc NodeTableRawInsert(data: var TNodePairSeq, k: THash, key: PNode, +proc nodeTableRawInsert(data: var TNodePairSeq, k: THash, key: PNode, val: int) = var h: THash = k and high(data) while data[h].key != nil: h = nextTry(h, high(data)) @@ -74,7 +74,7 @@ proc NodeTableRawInsert(data: var TNodePairSeq, k: THash, key: PNode, data[h].key = key data[h].val = val -proc NodeTablePut*(t: var TNodeTable, key: PNode, val: int) = +proc nodeTablePut*(t: var TNodeTable, key: PNode, val: int) = var n: TNodePairSeq var k: THash = hashTree(key) var index = NodeTableRawGet(t, k, key) @@ -86,15 +86,15 @@ proc NodeTablePut*(t: var TNodeTable, key: PNode, val: int) = newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: - NodeTableRawInsert(n, t.data[i].h, t.data[i].key, t.data[i].val) + nodeTableRawInsert(n, t.data[i].h, t.data[i].key, t.data[i].val) swap(t.data, n) - NodeTableRawInsert(t.data, k, key, val) + nodeTableRawInsert(t.data, k, key, val) inc(t.counter) -proc NodeTableTestOrSet*(t: var TNodeTable, key: PNode, val: int): int = +proc nodeTableTestOrSet*(t: var TNodeTable, key: PNode, val: int): int = var n: TNodePairSeq var k: THash = hashTree(key) - var index = NodeTableRawGet(t, k, key) + var index = nodeTableRawGet(t, k, key) if index >= 0: assert(t.data[index].key != nil) result = t.data[index].val @@ -103,8 +103,8 @@ proc NodeTableTestOrSet*(t: var TNodeTable, key: PNode, val: int): int = newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: - NodeTableRawInsert(n, t.data[i].h, t.data[i].key, t.data[i].val) + nodeTableRawInsert(n, t.data[i].h, t.data[i].key, t.data[i].val) swap(t.data, n) - NodeTableRawInsert(t.data, k, key, val) + nodeTableRawInsert(t.data, k, key, val) result = val inc(t.counter) diff --git a/compiler/types.nim b/compiler/types.nim index 7e07a0667e..be948246c0 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -19,7 +19,7 @@ type TPreferedDesc* = enum preferName, preferDesc, preferExported -proc TypeToString*(typ: PType, prefer: TPreferedDesc = preferName): string +proc typeToString*(typ: PType, prefer: TPreferedDesc = preferName): string proc getProcHeader*(sym: PSym): string proc base*(t: PType): PType # ------------------- type iterator: ---------------------------------------- @@ -28,7 +28,7 @@ type TTypeMutator* = proc (t: PType, closure: PObject): PType {.nimcall.} # copy t and mutate it TTypePredicate* = proc (t: PType): bool {.nimcall.} -proc IterOverType*(t: PType, iter: TTypeIter, closure: PObject): bool +proc iterOverType*(t: PType, iter: TTypeIter, closure: PObject): bool # Returns result of `iter`. proc mutateType*(t: PType, iter: TTypeMutator, closure: PObject): PType # Returns result of `iter`. @@ -74,7 +74,7 @@ proc getOrdValue*(n: PNode): biggestInt proc computeSize*(typ: PType): biggestInt proc getSize*(typ: PType): biggestInt proc isPureObject*(typ: PType): bool -proc InvalidGenericInst*(f: PType): bool +proc invalidGenericInst*(f: PType): bool # for debugging type TTypeFieldResult* = enum @@ -89,8 +89,8 @@ proc analyseObjectWithTypeField*(t: PType): TTypeFieldResult proc typeAllowed*(t: PType, kind: TSymKind): bool # implementation -proc InvalidGenericInst(f: PType): bool = - result = (f.kind == tyGenericInst) and (lastSon(f) == nil) +proc invalidGenericInst(f: PType): bool = + result = f.kind == tyGenericInst and lastSon(f) == nil proc isPureObject(typ: PType): bool = var t = typ @@ -132,7 +132,7 @@ proc getProcHeader(sym: PSym): string = add(result, typeToString(p.sym.typ)) if i != sonsLen(n)-1: add(result, ", ") else: - InternalError("getProcHeader") + internalError("getProcHeader") add(result, ')') if n.sons[0].typ != nil: result.add(": " & typeToString(n.sons[0].typ)) @@ -194,7 +194,7 @@ proc iterOverTypeAux(marker: var TIntSet, t: PType, iter: TTypeIter, if result: return if t.n != nil: result = iterOverNode(marker, t.n, iter, closure) -proc IterOverType(t: PType, iter: TTypeIter, closure: PObject): bool = +proc iterOverType(t: PType, iter: TTypeIter, closure: PObject): bool = var marker = InitIntSet() result = iterOverTypeAux(marker, t, iter, closure) @@ -242,7 +242,7 @@ proc searchTypeForAux(t: PType, predicate: TTypePredicate, result = searchTypeForAux(t.sons[i], predicate, marker) if result: return else: - nil + discard proc searchTypeFor(t: PType, predicate: TTypePredicate): bool = var marker = InitIntSet() @@ -284,7 +284,7 @@ proc analyseObjectWithTypeFieldAux(t: PType, if res != frNone: return frEmbedded else: - nil + discard proc analyseObjectWithTypeField(t: PType): TTypeFieldResult = var marker = InitIntSet() @@ -322,7 +322,7 @@ proc canFormAcycleNode(marker: var TIntSet, n: PNode, startId: int): bool = if not result: case n.kind of nkNone..nkNilLit: - nil + discard else: for i in countup(0, sonsLen(n) - 1): result = canFormAcycleNode(marker, n.sons[i], startId) @@ -367,6 +367,7 @@ proc mutateNode(marker: var TIntSet, n: PNode, iter: TTypeMutator, case n.kind of nkNone..nkNilLit: # a leaf + discard else: for i in countup(0, sonsLen(n) - 1): addSon(result, mutateNode(marker, n.sons[i], iter, closure)) @@ -422,7 +423,7 @@ proc constraintsToStr(t: PType): string = if i > 0: result.add(sep) result.add(t.sons[i].consToStr) -proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = +proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = var t = typ result = "" if t == nil: return @@ -553,7 +554,7 @@ proc firstOrd(t: PType): biggestInt = of tyGenericInst, tyDistinct, tyConst, tyMutable, tyTypeDesc: result = firstOrd(lastSon(t)) else: - InternalError("invalid kind for first(" & $t.kind & ')') + internalError("invalid kind for first(" & $t.kind & ')') result = 0 proc lastOrd(t: PType): biggestInt = @@ -587,7 +588,7 @@ proc lastOrd(t: PType): biggestInt = result = lastOrd(lastSon(t)) of tyProxy: result = 0 else: - InternalError("invalid kind for last(" & $t.kind & ')') + internalError("invalid kind for last(" & $t.kind & ')') result = 0 proc lengthOrd(t: PType): biggestInt = @@ -621,7 +622,7 @@ type proc initSameTypeClosure: TSameTypeClosure = # we do the initialization lazily for performance (avoids memory allocations) - nil + discard proc containsOrIncl(c: var TSameTypeClosure, a, b: PType): bool = result = not IsNil(c.s) and c.s.contains((a.id, b.id)) @@ -629,15 +630,15 @@ proc containsOrIncl(c: var TSameTypeClosure, a, b: PType): bool = if IsNil(c.s): c.s = @[] c.s.add((a.id, b.id)) -proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool -proc SameTypeOrNilAux(a, b: PType, c: var TSameTypeClosure): bool = +proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool +proc sameTypeOrNilAux(a, b: PType, c: var TSameTypeClosure): bool = if a == b: result = true else: if a == nil or b == nil: result = false else: result = SameTypeAux(a, b, c) -proc SameTypeOrNil*(a, b: PType, flags: TTypeCmpFlags = {}): bool = +proc sameTypeOrNil*(a, b: PType, flags: TTypeCmpFlags = {}): bool = if a == b: result = true else: @@ -676,7 +677,7 @@ proc equalParams(a, b: PNode): TParamsEquality = of paramsNotEqual: return paramsNotEqual of paramsEqual: - nil + discard of paramsIncompatible: result = paramsIncompatible if (m.name.id != n.name.id): @@ -730,7 +731,7 @@ proc sameTuple(a, b: PType, c: var TSameTypeClosure): bool = else: result = false -template IfFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} = +template ifFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} = if tfFromGeneric notin a.flags + b.flags: # fast case: id comparison suffices: result = a.id == b.id @@ -751,7 +752,7 @@ template IfFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} = proc sameObjectTypes*(a, b: PType): bool = # specialized for efficiency (sigmatch uses it) - IfFastObjectTypeCheckFailed(a, b): + ifFastObjectTypeCheckFailed(a, b): var c = initSameTypeClosure() result = sameTypeAux(a, b, c) @@ -761,7 +762,7 @@ proc sameDistinctTypes*(a, b: PType): bool {.inline.} = proc sameEnumTypes*(a, b: PType): bool {.inline.} = result = a.id == b.id -proc SameObjectTree(a, b: PNode, c: var TSameTypeClosure): bool = +proc sameObjectTree(a, b: PNode, c: var TSameTypeClosure): bool = if a == b: result = true elif (a != nil) and (b != nil) and (a.kind == b.kind): @@ -778,26 +779,26 @@ proc SameObjectTree(a, b: PNode, c: var TSameTypeClosure): bool = else: if sonsLen(a) == sonsLen(b): for i in countup(0, sonsLen(a) - 1): - if not SameObjectTree(a.sons[i], b.sons[i], c): return + if not sameObjectTree(a.sons[i], b.sons[i], c): return result = true proc sameObjectStructures(a, b: PType, c: var TSameTypeClosure): bool = # check base types: if sonsLen(a) != sonsLen(b): return for i in countup(0, sonsLen(a) - 1): - if not SameTypeOrNilAux(a.sons[i], b.sons[i], c): return - if not SameObjectTree(a.n, b.n, c): return + if not sameTypeOrNilAux(a.sons[i], b.sons[i], c): return + if not sameObjectTree(a.n, b.n, c): return result = true proc sameChildrenAux(a, b: PType, c: var TSameTypeClosure): bool = if sonsLen(a) != sonsLen(b): return false result = true for i in countup(0, sonsLen(a) - 1): - result = SameTypeOrNilAux(a.sons[i], b.sons[i], c) + result = sameTypeOrNilAux(a.sons[i], b.sons[i], c) if not result: return -proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = - template CycleCheck() = +proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = + template cycleCheck() = # believe it or not, the direct check for ``containsOrIncl(c, a, b)`` # increases bootstrapping time from 2.4s to 3.3s on my laptop! So we cheat # again: Since the recursion check is only to not get caught in an endless @@ -831,16 +832,16 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = tyInt..tyBigNum, tyStmt: result = sameFlags(a, b) of tyExpr: - result = ExprStructuralEquivalent(a.n, b.n) and sameFlags(a, b) + result = exprStructuralEquivalent(a.n, b.n) and sameFlags(a, b) of tyObject: - IfFastObjectTypeCheckFailed(a, b): + ifFastObjectTypeCheckFailed(a, b): CycleCheck() result = sameObjectStructures(a, b, c) and sameFlags(a, b) of tyDistinct: - CycleCheck() + cycleCheck() if c.cmp == dcEq: if sameFlags(a, b): - IfFastObjectTypeCheckFailed(a, b): + ifFastObjectTypeCheckFailed(a, b): result = sameTypeAux(a.sons[0], b.sons[0], c) else: result = sameTypeAux(a.sons[0], b.sons[0], c) and sameFlags(a, b) @@ -848,14 +849,14 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = # XXX generic enums do not make much sense, but require structural checking result = a.id == b.id and sameFlags(a, b) of tyTuple: - CycleCheck() + cycleCheck() result = sameTuple(a, b, c) and sameFlags(a, b) of tyGenericInst: result = sameTypeAux(lastSon(a), lastSon(b), c) of tyTypeDesc: if c.cmp == dcEqIgnoreDistinct: result = false elif TypeDescExactMatch in c.flags: - CycleCheck() + cycleCheck() result = sameChildrenAux(x, y, c) and sameFlags(a, b) else: result = sameFlags(a, b) @@ -863,15 +864,15 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr, tyArray, tyProc, tyConst, tyMutable, tyVarargs, tyIter, tyOrdinal, tyTypeClasses: - CycleCheck() + cycleCheck() result = sameChildrenAux(a, b, c) and sameFlags(a, b) - if result and (a.kind == tyProc): + if result and a.kind == tyProc: result = a.callConv == b.callConv of tyRange: - CycleCheck() - result = SameTypeOrNilAux(a.sons[0], b.sons[0], c) and - SameValue(a.n.sons[0], b.n.sons[0]) and - SameValue(a.n.sons[1], b.n.sons[1]) + cycleCheck() + result = sameTypeOrNilAux(a.sons[0], b.sons[0], c) and + sameValue(a.n.sons[0], b.n.sons[0]) and + sameValue(a.n.sons[1], b.n.sons[1]) of tyNone: result = false proc sameType*(x, y: PType): bool = @@ -954,7 +955,7 @@ proc typeAllowedNode(marker: var TIntSet, n: PNode, kind: TSymKind, if result: case n.kind of nkNone..nkNilLit: - nil + discard else: for i in countup(0, sonsLen(n) - 1): result = typeAllowedNode(marker, n.sons[i], kind, flags) diff --git a/compiler/vm.nim b/compiler/vm.nim index 709baf7b2a..a89ad74bdf 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -109,7 +109,7 @@ template decodeBx(k: expr) {.immediate, dirty.} = let rbx = instr.regBx - wordExcess ensureKind(k) -template move(a, b: expr) = system.shallowCopy(a, b) +template move(a, b: expr) {.immediate, dirty.} = system.shallowCopy(a, b) # XXX fix minor 'shallowCopy' overloading bug in compiler proc moveConst(x, y: PNode) = diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index ab120f008d..d9cbb15144 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1295,7 +1295,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = else: dest = tmp0 of nkEmpty, nkCommentStmt, nkTypeSection, nkConstSection, nkPragma, - nkTemplateDef, nkIncludeStmt, nkImportStmt: + nkTemplateDef, nkIncludeStmt, nkImportStmt, nkFromStmt: unused(n, dest) of nkStringToCString, nkCStringToString: gen(c, n.sons[0], dest) diff --git a/doc/manual.txt b/doc/manual.txt index fd3db1b0da..5024fffec1 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -4574,6 +4574,8 @@ the support of destructors. delegator pragma ---------------- +**Note**: The design of the delegator feature is subject to change. + The delegator pragma can be used to intercept and rewrite proc call and field access attempts referring to previously undeclared symbol names. It can be used to provide a fluent interface to objects lying outside the static confines of diff --git a/lib/impure/rdstdin.nim b/lib/impure/rdstdin.nim index cf076e9297..c32a59b243 100644 --- a/lib/impure/rdstdin.nim +++ b/lib/impure/rdstdin.nim @@ -14,13 +14,13 @@ ## wanted functionality. when defined(Windows): - proc ReadLineFromStdin*(prompt: string): TaintedString {. + proc readLineFromStdin*(prompt: string): TaintedString {. tags: [FReadIO, FWriteIO].} = ## Reads a line from stdin. stdout.write(prompt) result = readLine(stdin) - proc ReadLineFromStdin*(prompt: string, line: var TaintedString): bool {. + proc readLineFromStdin*(prompt: string, line: var TaintedString): bool {. tags: [FReadIO, FWriteIO].} = ## Reads a `line` from stdin. `line` must not be ## ``nil``! May throw an IO exception. @@ -34,7 +34,7 @@ when defined(Windows): else: import readline, history - proc ReadLineFromStdin*(prompt: string): TaintedString {. + proc readLineFromStdin*(prompt: string): TaintedString {. tags: [FReadIO, FWriteIO].} = var buffer = readline.readLine(prompt) if isNil(buffer): quit(0) @@ -43,7 +43,7 @@ else: add_history(buffer) readline.free(buffer) - proc ReadLineFromStdin*(prompt: string, line: var TaintedString): bool {. + proc readLineFromStdin*(prompt: string, line: var TaintedString): bool {. tags: [FReadIO, FWriteIO].} = var buffer = readline.readLine(prompt) if isNil(buffer): quit(0) diff --git a/lib/packages/docutils/rstast.nim b/lib/packages/docutils/rstast.nim index 3d191dacb1..c2ff53b585 100644 --- a/lib/packages/docutils/rstast.nim +++ b/lib/packages/docutils/rstast.nim @@ -120,11 +120,11 @@ proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string) = let oldLen = result.len renderRstSons(d, n, result) - let HeadlineLen = result.len - oldLen + let headlineLen = result.len - oldLen result.add("\n") result.add(ind) - result.add repeatChar(HeadlineLen, lvlToChar[n.level]) + result.add repeatChar(headlineLen, lvlToChar[n.level]) of rnOverline: result.add("\n") result.add(ind) diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index 09c6ba8b8c..157e04d5bc 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -263,14 +263,14 @@ proc `<-`(a: var TIndexEntry, b: TIndexEntry) = proc sortIndex(a: var openArray[TIndexEntry]) = # we use shellsort here; fast and simple - let N = len(a) + let n = len(a) var h = 1 while true: h = 3 * h + 1 - if h > N: break + if h > n: break while true: h = h div 3 - for i in countup(h, N - 1): + for i in countup(h, n - 1): var v: TIndexEntry v <- a[i] var j = i diff --git a/lib/pure/collections/intsets.nim b/lib/pure/collections/intsets.nim index 2a8d7eec22..367caf2e75 100644 --- a/lib/pure/collections/intsets.nim +++ b/lib/pure/collections/intsets.nim @@ -50,7 +50,7 @@ proc mustRehash(length, counter: int): bool {.inline.} = proc nextTry(h, maxHash: THash): THash {.inline.} = result = ((5 * h) + 1) and maxHash -proc IntSetGet(t: TIntSet, key: int): PTrunk = +proc intSetGet(t: TIntSet, key: int): PTrunk = var h = key and t.max while t.data[h] != nil: if t.data[h].key == key: @@ -58,7 +58,7 @@ proc IntSetGet(t: TIntSet, key: int): PTrunk = h = nextTry(h, t.max) result = nil -proc IntSetRawInsert(t: TIntSet, data: var TTrunkSeq, desc: PTrunk) = +proc intSetRawInsert(t: TIntSet, data: var TTrunkSeq, desc: PTrunk) = var h = desc.key and t.max while data[h] != nil: assert(data[h] != desc) @@ -66,7 +66,7 @@ proc IntSetRawInsert(t: TIntSet, data: var TTrunkSeq, desc: PTrunk) = assert(data[h] == nil) data[h] = desc -proc IntSetEnlarge(t: var TIntSet) = +proc intSetEnlarge(t: var TIntSet) = var n: TTrunkSeq var oldMax = t.max t.max = ((t.max + 1) * 2) - 1 @@ -75,7 +75,7 @@ proc IntSetEnlarge(t: var TIntSet) = if t.data[i] != nil: IntSetRawInsert(t, n, t.data[i]) swap(t.data, n) -proc IntSetPut(t: var TIntSet, key: int): PTrunk = +proc intSetPut(t: var TIntSet, key: int): PTrunk = var h = key and t.max while t.data[h] != nil: if t.data[h].key == key: diff --git a/lib/pure/collections/lists.nim b/lib/pure/collections/lists.nim index ad8eca6a9f..b8f8d20b50 100644 --- a/lib/pure/collections/lists.nim +++ b/lib/pure/collections/lists.nim @@ -41,19 +41,19 @@ type proc initSinglyLinkedList*[T](): TSinglyLinkedList[T] = ## creates a new singly linked list that is empty. - nil + discard proc initDoublyLinkedList*[T](): TDoublyLinkedList[T] = ## creates a new doubly linked list that is empty. - nil + discard proc initSinglyLinkedRing*[T](): TSinglyLinkedRing[T] = ## creates a new singly linked ring that is empty. - nil + discard proc initDoublyLinkedRing*[T](): TDoublyLinkedRing[T] = ## creates a new doubly linked ring that is empty. - nil + discard proc newDoublyLinkedNode*[T](value: T): PDoublyLinkedNode[T] = ## creates a new doubly linked node with the given `value`. diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 02d099c1f0..ef3a529a15 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -85,7 +85,7 @@ template rawInsertImpl() {.dirty.} = data[h].val = val data[h].slot = seFilled -proc RawGet[A, B](t: TTable[A, B], key: A): int = +proc rawGet[A, B](t: TTable[A, B], key: A): int = rawGetImpl() proc `[]`*[A, B](t: TTable[A, B], key: A): B = @@ -93,13 +93,13 @@ proc `[]`*[A, B](t: TTable[A, B], key: A): B = ## default empty value for the type `B` is returned ## and no exception is raised. One can check with ``hasKey`` whether the key ## exists. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: result = t.data[index].val proc mget*[A, B](t: var TTable[A, B], key: A): var B = ## retrieves the value at ``t[key]``. The value can be modified. ## If `key` is not in `t`, the ``EInvalidKey`` exception is raised. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: result = t.data[index].val else: raise newException(EInvalidKey, "key not found: " & $key) @@ -107,39 +107,39 @@ proc hasKey*[A, B](t: TTable[A, B], key: A): bool = ## returns true iff `key` is in the table `t`. result = rawGet(t, key) >= 0 -proc RawInsert[A, B](t: var TTable[A, B], data: var TKeyValuePairSeq[A, B], +proc rawInsert[A, B](t: var TTable[A, B], data: var TKeyValuePairSeq[A, B], key: A, val: B) = rawInsertImpl() -proc Enlarge[A, B](t: var TTable[A, B]) = +proc enlarge[A, B](t: var TTable[A, B]) = var n: TKeyValuePairSeq[A, B] newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): - if t.data[i].slot == seFilled: RawInsert(t, n, t.data[i].key, t.data[i].val) + if t.data[i].slot == seFilled: rawInsert(t, n, t.data[i].key, t.data[i].val) swap(t.data, n) -template AddImpl() {.dirty.} = - if mustRehash(len(t.data), t.counter): Enlarge(t) - RawInsert(t, t.data, key, val) +template addImpl() {.dirty.} = + if mustRehash(len(t.data), t.counter): enlarge(t) + rawInsert(t, t.data, key, val) inc(t.counter) -template PutImpl() {.dirty.} = - var index = RawGet(t, key) +template putImpl() {.dirty.} = + var index = rawGet(t, key) if index >= 0: t.data[index].val = val else: - AddImpl() + addImpl() when false: # not yet used: - template HasKeyOrPutImpl() {.dirty.} = - var index = RawGet(t, key) + template hasKeyOrPutImpl() {.dirty.} = + var index = rawGet(t, key) if index >= 0: t.data[index].val = val result = true else: - if mustRehash(len(t.data), t.counter): Enlarge(t) - RawInsert(t, t.data, key, val) + if mustRehash(len(t.data), t.counter): enlarge(t) + rawInsert(t, t.data, key, val) inc(t.counter) result = false @@ -149,11 +149,11 @@ proc `[]=`*[A, B](t: var TTable[A, B], key: A, val: B) = proc add*[A, B](t: var TTable[A, B], key: A, val: B) = ## puts a new (key, value)-pair into `t` even if ``t[key]`` already exists. - AddImpl() + addImpl() proc del*[A, B](t: var TTable[A, B], key: A) = ## deletes `key` from hash table `t`. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: t.data[index].slot = seDeleted dec(t.counter) @@ -240,7 +240,7 @@ iterator mvalues*[A, B](t: var TOrderedTable[A, B]): var B = forAllOrderedPairs: yield t.data[h].val -proc RawGet[A, B](t: TOrderedTable[A, B], key: A): int = +proc rawGet[A, B](t: TOrderedTable[A, B], key: A): int = rawGetImpl() proc `[]`*[A, B](t: TOrderedTable[A, B], key: A): B = @@ -248,13 +248,13 @@ proc `[]`*[A, B](t: TOrderedTable[A, B], key: A): B = ## default empty value for the type `B` is returned ## and no exception is raised. One can check with ``hasKey`` whether the key ## exists. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: result = t.data[index].val proc mget*[A, B](t: var TOrderedTable[A, B], key: A): var B = ## retrieves the value at ``t[key]``. The value can be modified. ## If `key` is not in `t`, the ``EInvalidKey`` exception is raised. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: result = t.data[index].val else: raise newException(EInvalidKey, "key not found: " & $key) @@ -262,7 +262,7 @@ proc hasKey*[A, B](t: TOrderedTable[A, B], key: A): bool = ## returns true iff `key` is in the table `t`. result = rawGet(t, key) >= 0 -proc RawInsert[A, B](t: var TOrderedTable[A, B], +proc rawInsert[A, B](t: var TOrderedTable[A, B], data: var TOrderedKeyValuePairSeq[A, B], key: A, val: B) = rawInsertImpl() @@ -271,7 +271,7 @@ proc RawInsert[A, B](t: var TOrderedTable[A, B], if t.last >= 0: data[t.last].next = h t.last = h -proc Enlarge[A, B](t: var TOrderedTable[A, B]) = +proc enlarge[A, B](t: var TOrderedTable[A, B]) = var n: TOrderedKeyValuePairSeq[A, B] newSeq(n, len(t.data) * growthFactor) var h = t.first @@ -280,7 +280,7 @@ proc Enlarge[A, B](t: var TOrderedTable[A, B]) = while h >= 0: var nxt = t.data[h].next if t.data[h].slot == seFilled: - RawInsert(t, n, t.data[h].key, t.data[h].val) + rawInsert(t, n, t.data[h].key, t.data[h].val) h = nxt swap(t.data, n) @@ -290,7 +290,7 @@ proc `[]=`*[A, B](t: var TOrderedTable[A, B], key: A, val: B) = proc add*[A, B](t: var TOrderedTable[A, B], key: A, val: B) = ## puts a new (key, value)-pair into `t` even if ``t[key]`` already exists. - AddImpl() + addImpl() proc initOrderedTable*[A, B](initialSize=64): TOrderedTable[A, B] = ## creates a new ordered hash table that is empty. @@ -398,7 +398,7 @@ iterator mvalues*[A](t: TCountTable[A]): var int = for h in 0..high(t.data): if t.data[h].val != 0: yield t.data[h].val -proc RawGet[A](t: TCountTable[A], key: A): int = +proc rawGet[A](t: TCountTable[A], key: A): int = var h: THash = hash(key) and high(t.data) # start with real hash value while t.data[h].val != 0: if t.data[h].key == key: return h @@ -409,13 +409,13 @@ proc `[]`*[A](t: TCountTable[A], key: A): int = ## retrieves the value at ``t[key]``. If `key` is not in `t`, ## 0 is returned. One can check with ``hasKey`` whether the key ## exists. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: result = t.data[index].val proc mget*[A](t: var TCountTable[A], key: A): var int = ## retrieves the value at ``t[key]``. The value can be modified. ## If `key` is not in `t`, the ``EInvalidKey`` exception is raised. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: result = t.data[index].val else: raise newException(EInvalidKey, "key not found: " & $key) @@ -423,24 +423,24 @@ proc hasKey*[A](t: TCountTable[A], key: A): bool = ## returns true iff `key` is in the table `t`. result = rawGet(t, key) >= 0 -proc RawInsert[A](t: TCountTable[A], data: var seq[tuple[key: A, val: int]], +proc rawInsert[A](t: TCountTable[A], data: var seq[tuple[key: A, val: int]], key: A, val: int) = var h: THash = hash(key) and high(data) while data[h].val != 0: h = nextTry(h, high(data)) data[h].key = key data[h].val = val -proc Enlarge[A](t: var TCountTable[A]) = +proc enlarge[A](t: var TCountTable[A]) = var n: seq[tuple[key: A, val: int]] newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): - if t.data[i].val != 0: RawInsert(t, n, t.data[i].key, t.data[i].val) + if t.data[i].val != 0: rawInsert(t, n, t.data[i].key, t.data[i].val) swap(t.data, n) proc `[]=`*[A](t: var TCountTable[A], key: A, val: int) = ## puts a (key, value)-pair into `t`. `val` has to be positive. assert val > 0 - PutImpl() + putImpl() proc initCountTable*[A](initialSize=64): TCountTable[A] = ## creates a new count table that is empty. @@ -467,11 +467,11 @@ proc inc*[A](t: var TCountTable[A], key: A, val = 1) = if index >= 0: inc(t.data[index].val, val) else: - if mustRehash(len(t.data), t.counter): Enlarge(t) - RawInsert(t, t.data, key, val) + if mustRehash(len(t.data), t.counter): enlarge(t) + rawInsert(t, t.data, key, val) inc(t.counter) -proc Smallest*[A](t: TCountTable[A]): tuple[key: A, val: int] = +proc smallest*[A](t: TCountTable[A]): tuple[key: A, val: int] = ## returns the largest (key,val)-pair. Efficiency: O(n) assert t.len > 0 var minIdx = 0 @@ -480,7 +480,7 @@ proc Smallest*[A](t: TCountTable[A]): tuple[key: A, val: int] = result.key = t.data[minIdx].key result.val = t.data[minIdx].val -proc Largest*[A](t: TCountTable[A]): tuple[key: A, val: int] = +proc largest*[A](t: TCountTable[A]): tuple[key: A, val: int] = ## returns the (key,val)-pair with the largest `val`. Efficiency: O(n) assert t.len > 0 var maxIdx = 0 diff --git a/lib/pure/lexbase.nim b/lib/pure/lexbase.nim index 2756290d86..3b3e3810b6 100644 --- a/lib/pure/lexbase.nim +++ b/lib/pure/lexbase.nim @@ -48,11 +48,11 @@ proc getCurrentLine*(L: TBaseLexer, marker: bool = true): string proc getColNumber*(L: TBaseLexer, pos: int): int ## retrieves the current column. -proc HandleCR*(L: var TBaseLexer, pos: int): int +proc handleCR*(L: var TBaseLexer, pos: int): int ## Call this if you scanned over '\c' in the buffer; it returns the the ## position to continue the scanning from. `pos` must be the position ## of the '\c'. -proc HandleLF*(L: var TBaseLexer, pos: int): int +proc handleLF*(L: var TBaseLexer, pos: int): int ## Call this if you scanned over '\L' in the buffer; it returns the the ## position to continue the scanning from. `pos` must be the position ## of the '\L'. @@ -66,7 +66,7 @@ proc close(L: var TBaseLexer) = dealloc(L.buf) close(L.input) -proc FillBuffer(L: var TBaseLexer) = +proc fillBuffer(L: var TBaseLexer) = var charsRead, toCopy, s: int # all are in characters, # not bytes (in case this @@ -78,7 +78,7 @@ proc FillBuffer(L: var TBaseLexer) = toCopy = L.BufLen - L.sentinel - 1 assert(toCopy >= 0) if toCopy > 0: - MoveMem(L.buf, addr(L.buf[L.sentinel + 1]), toCopy * chrSize) + moveMem(L.buf, addr(L.buf[L.sentinel + 1]), toCopy * chrSize) # "moveMem" handles overlapping regions charsRead = readData(L.input, addr(L.buf[toCopy]), (L.sentinel + 1) * chrSize) div chrSize @@ -103,7 +103,7 @@ proc FillBuffer(L: var TBaseLexer) = L.bufLen = L.BufLen * 2 L.buf = cast[cstring](realloc(L.buf, L.bufLen * chrSize)) assert(L.bufLen - oldBuflen == oldBufLen) - charsRead = ReadData(L.input, addr(L.buf[oldBufLen]), + charsRead = readData(L.input, addr(L.buf[oldBufLen]), oldBufLen * chrSize) div chrSize if charsRead < oldBufLen: L.buf[oldBufLen + charsRead] = EndOfFile @@ -121,19 +121,19 @@ proc fillBaseLexer(L: var TBaseLexer, pos: int): int = result = 0 L.lineStart = result -proc HandleCR(L: var TBaseLexer, pos: int): int = +proc handleCR(L: var TBaseLexer, pos: int): int = assert(L.buf[pos] == '\c') inc(L.linenumber) result = fillBaseLexer(L, pos) if L.buf[result] == '\L': result = fillBaseLexer(L, result) -proc HandleLF(L: var TBaseLexer, pos: int): int = +proc handleLF(L: var TBaseLexer, pos: int): int = assert(L.buf[pos] == '\L') inc(L.linenumber) result = fillBaseLexer(L, pos) #L.lastNL := result-1; // BUGFIX: was: result; -proc skip_UTF_8_BOM(L: var TBaseLexer) = +proc skipUtf8Bom(L: var TBaseLexer) = if (L.buf[0] == '\xEF') and (L.buf[1] == '\xBB') and (L.buf[2] == '\xBF'): inc(L.bufpos, 3) inc(L.lineStart, 3) @@ -149,7 +149,7 @@ proc open(L: var TBaseLexer, input: PStream, bufLen: int = 8192) = L.lineStart = 0 L.linenumber = 1 # lines start at 1 fillBuffer(L) - skip_UTF_8_BOM(L) + skipUtf8Bom(L) proc getColNumber(L: TBaseLexer, pos: int): int = result = abs(pos - L.lineStart) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 2e15587f49..f5b9ced4c1 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -93,11 +93,11 @@ when defined(Nimdoc): # only for proper documentation: elif defined(macos): const - curdir* = ':' - pardir* = "::" - dirsep* = ':' - altsep* = dirsep - pathsep* = ',' + CurDir* = ':' + ParDir* = "::" + Dirsep* = ':' + Altsep* = dirsep + Pathsep* = ',' FileSystemCaseSensitive* = false ExeExt* = "" ScriptExt* = "" @@ -123,42 +123,42 @@ elif defined(macos): # grandparent etc. elif doslike: const - curdir* = '.' - pardir* = ".." - dirsep* = '\\' # seperator within paths - altsep* = '/' - pathSep* = ';' # seperator between paths + Curdir* = '.' + Pardir* = ".." + Dirsep* = '\\' # seperator within paths + Altsep* = '/' + PathSep* = ';' # seperator between paths FileSystemCaseSensitive* = false ExeExt* = "exe" ScriptExt* = "bat" DynlibFormat* = "$1.dll" elif defined(PalmOS) or defined(MorphOS): const - dirsep* = '/' - altsep* = dirsep + Dirsep* = '/' + Altsep* = dirsep PathSep* = ';' - pardir* = ".." + Pardir* = ".." FileSystemCaseSensitive* = false ExeExt* = "" ScriptExt* = "" DynlibFormat* = "$1.prc" elif defined(RISCOS): const - dirsep* = '.' - altsep* = '.' - pardir* = ".." # is this correct? - pathSep* = ',' + Dirsep* = '.' + Altsep* = '.' + Pardir* = ".." # is this correct? + PathSep* = ',' FileSystemCaseSensitive* = true ExeExt* = "" ScriptExt* = "" DynlibFormat* = "lib$1.so" else: # UNIX-like operating system const - curdir* = '.' - pardir* = ".." - dirsep* = '/' - altsep* = dirsep - pathSep* = ':' + Curdir* = '.' + Pardir* = ".." + Dirsep* = '/' + Altsep* = dirsep + PathSep* = ':' FileSystemCaseSensitive* = true ExeExt* = "" ScriptExt* = "" @@ -186,20 +186,20 @@ proc OSErrorMsg*(): string {.rtl, extern: "nos$1", deprecated.} = result = "" when defined(Windows): - var err = GetLastError() + var err = getLastError() if err != 0'i32: when useWinUnicode: var msgbuf: widecstring - if FormatMessageW(0x00000100 or 0x00001000 or 0x00000200, + if formatMessageW(0x00000100 or 0x00001000 or 0x00000200, nil, err, 0, addr(msgbuf), 0, nil) != 0'i32: result = $msgbuf - if msgbuf != nil: LocalFree(cast[pointer](msgbuf)) + if msgbuf != nil: localFree(cast[pointer](msgbuf)) else: var msgbuf: cstring - if FormatMessageA(0x00000100 or 0x00001000 or 0x00000200, + if formatMessageA(0x00000100 or 0x00001000 or 0x00000200, nil, err, 0, addr(msgbuf), 0, nil) != 0'i32: result = $msgbuf - if msgbuf != nil: LocalFree(msgbuf) + if msgbuf != nil: localFree(msgbuf) if errno != 0'i32: result = $os.strerror(errno) @@ -238,16 +238,16 @@ proc OSErrorMsg*(errorCode: TOSErrorCode): string = if errorCode != TOSErrorCode(0'i32): when useWinUnicode: var msgbuf: widecstring - if FormatMessageW(0x00000100 or 0x00001000 or 0x00000200, + if formatMessageW(0x00000100 or 0x00001000 or 0x00000200, nil, errorCode.int32, 0, addr(msgbuf), 0, nil) != 0'i32: result = $msgbuf - if msgbuf != nil: LocalFree(cast[pointer](msgbuf)) + if msgbuf != nil: localFree(cast[pointer](msgbuf)) else: var msgbuf: cstring - if FormatMessageA(0x00000100 or 0x00001000 or 0x00000200, + if formatMessageA(0x00000100 or 0x00001000 or 0x00000200, nil, errorCode.int32, 0, addr(msgbuf), 0, nil) != 0'i32: result = $msgbuf - if msgbuf != nil: LocalFree(msgbuf) + if msgbuf != nil: localFree(msgbuf) else: if errorCode != TOSErrorCode(0'i32): result = $os.strerror(errorCode.int32) @@ -287,7 +287,7 @@ proc OSLastError*(): TOSErrorCode = result = TOSErrorCode(errno) {.pop.} -proc UnixToNativePath*(path: string): string {. +proc unixToNativePath*(path: string): string {. noSideEffect, rtl, extern: "nos$1".} = ## Converts an UNIX-like path to a native one. ## @@ -340,16 +340,16 @@ when defined(windows): template wrapBinary(varname, winApiProc, arg, arg2: expr) {.immediate.} = var varname = winApiProc(newWideCString(arg), arg2) - proc FindFirstFile(a: string, b: var TWIN32_FIND_DATA): THandle = - result = FindFirstFileW(newWideCString(a), b) - template FindNextFile(a, b: expr): expr = FindNextFileW(a, b) + proc findFirstFile(a: string, b: var TWIN32_FIND_DATA): THandle = + result = findFirstFileW(newWideCString(a), b) + template findNextFile(a, b: expr): expr = findNextFileW(a, b) template getCommandLine(): expr = getCommandLineW() template getFilename(f: expr): expr = $cast[WideCString](addr(f.cFilename[0])) else: - template FindFirstFile(a, b: expr): expr = FindFirstFileA(a, b) - template FindNextFile(a, b: expr): expr = FindNextFileA(a, b) + template findFirstFile(a, b: expr): expr = findFirstFileA(a, b) + template findNextFile(a, b: expr): expr = findNextFileA(a, b) template getCommandLine(): expr = getCommandLineA() template getFilename(f: expr): expr = $f.cFilename @@ -364,9 +364,9 @@ proc existsFile*(filename: string): bool {.rtl, extern: "nos$1", ## Returns true if the file exists, false otherwise. when defined(windows): when useWinUnicode: - wrapUnary(a, GetFileAttributesW, filename) + wrapUnary(a, getFileAttributesW, filename) else: - var a = GetFileAttributesA(filename) + var a = getFileAttributesA(filename) if a != -1'i32: result = (a and FILE_ATTRIBUTE_DIRECTORY) == 0'i32 else: @@ -378,9 +378,9 @@ proc existsDir*(dir: string): bool {.rtl, extern: "nos$1", tags: [FReadDir].} = ## is returned. when defined(windows): when useWinUnicode: - wrapUnary(a, GetFileAttributesW, dir) + wrapUnary(a, getFileAttributesW, dir) else: - var a = GetFileAttributesA(dir) + var a = getFileAttributesA(dir) if a != -1'i32: result = (a and FILE_ATTRIBUTE_DIRECTORY) != 0'i32 else: @@ -395,7 +395,7 @@ proc getLastModificationTime*(file: string): TTime {.rtl, extern: "nos$1".} = return res.st_mtime else: var f: TWIN32_Find_Data - var h = findfirstFile(file, f) + var h = findFirstFile(file, f) if h == -1'i32: OSError(OSLastError()) result = winTimeToUnixTime(rdFileTime(f.ftLastWriteTime)) findclose(h) @@ -408,7 +408,7 @@ proc getLastAccessTime*(file: string): TTime {.rtl, extern: "nos$1".} = return res.st_atime else: var f: TWIN32_Find_Data - var h = findfirstFile(file, f) + var h = findFirstFile(file, f) if h == -1'i32: OSError(OSLastError()) result = winTimeToUnixTime(rdFileTime(f.ftLastAccessTime)) findclose(h) @@ -421,7 +421,7 @@ proc getCreationTime*(file: string): TTime {.rtl, extern: "nos$1".} = return res.st_ctime else: var f: TWIN32_Find_Data - var h = findfirstFile(file, f) + var h = findFirstFile(file, f) if h == -1'i32: OSError(OSLastError()) result = winTimeToUnixTime(rdFileTime(f.ftCreationTime)) findclose(h) @@ -437,12 +437,12 @@ proc getCurrentDir*(): string {.rtl, extern: "nos$1", tags: [].} = when defined(windows): when useWinUnicode: var res = newWideCString("", bufsize) - var L = GetCurrentDirectoryW(bufsize, res) + var L = getCurrentDirectoryW(bufsize, res) if L == 0'i32: OSError(OSLastError()) result = res$L else: result = newString(bufsize) - var L = GetCurrentDirectoryA(bufsize, result) + var L = getCurrentDirectoryA(bufsize, result) if L == 0'i32: OSError(OSLastError()) setLen(result, L) else: @@ -457,10 +457,10 @@ proc setCurrentDir*(newDir: string) {.inline, tags: [].} = ## `newDir` cannot been set. when defined(Windows): when useWinUnicode: - if SetCurrentDirectoryW(newWideCString(newDir)) == 0'i32: + if setCurrentDirectoryW(newWideCString(newDir)) == 0'i32: OSError(OSLastError()) else: - if SetCurrentDirectoryA(newDir) == 0'i32: OSError(OSLastError()) + if setCurrentDirectoryA(newDir) == 0'i32: OSError(OSLastError()) else: if chdir(newDir) != 0'i32: OSError(OSLastError()) @@ -512,7 +512,7 @@ proc joinPath*(parts: varargs[string]): string {.noSideEffect, result = joinPath(result, parts[i]) proc `/` * (head, tail: string): string {.noSideEffect.} = - ## The same as ``JoinPath(head, tail)`` + ## The same as ``joinPath(head, tail)`` ## ## Here are some examples for Unix: ## @@ -526,7 +526,7 @@ proc `/` * (head, tail: string): string {.noSideEffect.} = proc splitPath*(path: string): tuple[head, tail: string] {. noSideEffect, rtl, extern: "nos$1".} = ## Splits a directory into (head, tail), so that - ## ``JoinPath(head, tail) == path``. + ## ``joinPath(head, tail) == path``. ## ## Examples: ## @@ -672,14 +672,14 @@ proc expandFilename*(filename: string): string {.rtl, extern: "nos$1", when useWinUnicode: var unused: widecstring var res = newWideCString("", bufsize div 2) - var L = GetFullPathNameW(newWideCString(filename), bufsize, res, unused) + var L = getFullPathNameW(newWideCString(filename), bufsize, res, unused) if L <= 0'i32 or L >= bufsize: OSError(OSLastError()) result = res$L else: var unused: cstring result = newString(bufsize) - var L = GetFullPathNameA(filename, bufsize, result, unused) + var L = getFullPathNameA(filename, bufsize, result, unused) if L <= 0'i32 or L >= bufsize: OSError(OSLastError()) setLen(result, L) else: @@ -758,29 +758,29 @@ proc sameFile*(path1, path2: string): bool {.rtl, extern: "nos$1", when useWinUnicode: var p1 = newWideCString(path1) var p2 = newWideCString(path2) - template OpenHandle(path: expr): expr = - CreateFileW(path, 0'i32, FILE_SHARE_DELETE or FILE_SHARE_READ or + template openHandle(path: expr): expr = + createFileW(path, 0'i32, FILE_SHARE_DELETE or FILE_SHARE_READ or FILE_SHARE_WRITE, nil, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS or FILE_ATTRIBUTE_NORMAL, 0) - var f1 = OpenHandle(p1) - var f2 = OpenHandle(p2) + var f1 = openHandle(p1) + var f2 = openHandle(p2) else: - template OpenHandle(path: expr): expr = - CreateFileA(path, 0'i32, FILE_SHARE_DELETE or FILE_SHARE_READ or + template openHandle(path: expr): expr = + createFileA(path, 0'i32, FILE_SHARE_DELETE or FILE_SHARE_READ or FILE_SHARE_WRITE, nil, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS or FILE_ATTRIBUTE_NORMAL, 0) - var f1 = OpenHandle(path1) - var f2 = OpenHandle(path2) + var f1 = openHandle(path1) + var f2 = openHandle(path2) var lastErr: TOSErrorCode if f1 != INVALID_HANDLE_VALUE and f2 != INVALID_HANDLE_VALUE: var fi1, fi2: TBY_HANDLE_FILE_INFORMATION - if GetFileInformationByHandle(f1, addr(fi1)) != 0 and - GetFileInformationByHandle(f2, addr(fi2)) != 0: + if getFileInformationByHandle(f1, addr(fi1)) != 0 and + getFileInformationByHandle(f2, addr(fi2)) != 0: result = fi1.dwVolumeSerialNumber == fi2.dwVolumeSerialNumber and fi1.nFileIndexHigh == fi2.nFileIndexHigh and fi1.nFileIndexLow == fi2.nFileIndexLow @@ -791,8 +791,8 @@ proc sameFile*(path1, path2: string): bool {.rtl, extern: "nos$1", lastErr = OSLastError() success = false - discard CloseHandle(f1) - discard CloseHandle(f2) + discard closeHandle(f1) + discard closeHandle(f2) if not success: OSError(lastErr) else: @@ -867,9 +867,9 @@ proc getFilePermissions*(filename: string): set[TFilePermission] {. if (a.st_mode and S_IXOTH) != 0'i32: result.incl(fpOthersExec) else: when useWinUnicode: - wrapUnary(res, GetFileAttributesW, filename) + wrapUnary(res, getFileAttributesW, filename) else: - var res = GetFileAttributesA(filename) + var res = getFileAttributesA(filename) if res == -1'i32: OSError(OSLastError()) if (res and FILE_ATTRIBUTE_READONLY) != 0'i32: result = {fpUserExec, fpUserRead, fpGroupExec, fpGroupRead, @@ -899,18 +899,18 @@ proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. if chmod(filename, p) != 0: OSError(OSLastError()) else: when useWinUnicode: - wrapUnary(res, GetFileAttributesW, filename) + wrapUnary(res, getFileAttributesW, filename) else: - var res = GetFileAttributesA(filename) + var res = getFileAttributesA(filename) if res == -1'i32: OSError(OSLastError()) if fpUserWrite in permissions: res = res and not FILE_ATTRIBUTE_READONLY else: res = res or FILE_ATTRIBUTE_READONLY when useWinUnicode: - wrapBinary(res2, SetFileAttributesW, filename, res) + wrapBinary(res2, setFileAttributesW, filename, res) else: - var res2 = SetFileAttributesA(filename, res) + var res2 = setFileAttributesA(filename, res) if res2 == - 1'i32: OSError(OSLastError()) proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", @@ -928,9 +928,9 @@ proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", when useWinUnicode: let s = newWideCString(source) let d = newWideCString(dest) - if CopyFileW(s, d, 0'i32) == 0'i32: OSError(OSLastError()) + if copyFileW(s, d, 0'i32) == 0'i32: OSError(OSLastError()) else: - if CopyFileA(source, dest, 0'i32) == 0'i32: OSError(OSLastError()) + if copyFileA(source, dest, 0'i32) == 0'i32: OSError(OSLastError()) else: # generic version of copyFile which works for any platform: const bufSize = 8000 # better for memory manager @@ -940,7 +940,7 @@ proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", close(s) OSError(OSLastError()) var buf = alloc(bufsize) - while True: + while true: var bytesread = readBuffer(s, buf, bufsize) if bytesread > 0: var byteswritten = writeBuffer(d, buf, bytesread) @@ -968,13 +968,13 @@ when not defined(ENOENT) and not defined(Windows): when defined(Windows): when useWinUnicode: - template DeleteFile(file: expr): expr {.immediate.} = DeleteFileW(file) - template SetFileAttributes(file, attrs: expr): expr {.immediate.} = - SetFileAttributesW(file, attrs) + template deleteFile(file: expr): expr {.immediate.} = deleteFileW(file) + template setFileAttributes(file, attrs: expr): expr {.immediate.} = + setFileAttributesW(file, attrs) else: - template DeleteFile(file: expr): expr {.immediate.} = DeleteFileA(file) - template SetFileAttributes(file, attrs: expr): expr {.immediate.} = - SetFileAttributesA(file, attrs) + template deleteFile(file: expr): expr {.immediate.} = deleteFileA(file) + template setFileAttributes(file, attrs: expr): expr {.immediate.} = + setFileAttributesA(file, attrs) proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = ## Removes the `file`. If this fails, `EOS` is raised. This does not fail @@ -985,11 +985,11 @@ proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = let f = newWideCString(file) else: let f = file - if DeleteFile(f) == 0: - if GetLastError() == ERROR_ACCESS_DENIED: - if SetFileAttributes(f, FILE_ATTRIBUTE_NORMAL) == 0: + if deleteFile(f) == 0: + if getLastError() == ERROR_ACCESS_DENIED: + if setFileAttributes(f, FILE_ATTRIBUTE_NORMAL) == 0: OSError(OSLastError()) - if DeleteFile(f) == 0: + if deleteFile(f) == 0: OSError(OSLastError()) else: if cremove(file) != 0'i32 and errno != ENOENT: @@ -1076,7 +1076,7 @@ else: when useNSGetEnviron: var gEnv = NSGetEnviron()[] var i = 0 - while True: + while true: if gEnv[i] == nil: break add environment, $gEnv[i] inc(i) @@ -1130,9 +1130,9 @@ proc putEnv*(key, val: string) {.tags: [FWriteEnv].} = when useWinUnicode: var k = newWideCString(key) var v = newWideCString(val) - if SetEnvironmentVariableW(k, v) == 0'i32: OSError(OSLastError()) + if setEnvironmentVariableW(k, v) == 0'i32: OSError(OSLastError()) else: - if SetEnvironmentVariableA(key, val) == 0'i32: OSError(OSLastError()) + if setEnvironmentVariableA(key, val) == 0'i32: OSError(OSLastError()) iterator envPairs*(): tuple[key, value: TaintedString] {.tags: [FReadEnv].} = ## Iterate over all `environments variables`:idx:. In the first component @@ -1259,9 +1259,9 @@ iterator walkDirRec*(dir: string, filter={pcFile, pcDir}): string {. proc rawRemoveDir(dir: string) = when defined(windows): when useWinUnicode: - wrapUnary(res, RemoveDirectoryW, dir) + wrapUnary(res, removeDirectoryW, dir) else: - var res = RemoveDirectoryA(dir) + var res = removeDirectoryA(dir) let lastError = OSLastError() if res == 0'i32 and lastError.int32 != 3'i32 and lastError.int32 != 18'i32 and lastError.int32 != 2'i32: @@ -1291,10 +1291,10 @@ proc rawCreateDir(dir: string) = OSError(OSLastError()) else: when useWinUnicode: - wrapUnary(res, CreateDirectoryW, dir) + wrapUnary(res, createDirectoryW, dir) else: - var res = CreateDirectoryA(dir) - if res == 0'i32 and GetLastError() != 183'i32: + var res = createDirectoryA(dir) + if res == 0'i32 and getLastError() != 183'i32: OSError(OSLastError()) proc createDir*(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = @@ -1584,8 +1584,8 @@ proc getAppFilename*(): string {.rtl, extern: "nos$1", tags: [FReadIO].} = 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(string(getEnv("PATH")), {PathSep}): - var x = JoinPath(p, result) - if ExistsFile(x): return x + var x = joinPath(p, result) + if existsFile(x): return x proc getApplicationFilename*(): string {.rtl, extern: "nos$1", deprecated.} = ## Returns the filename of the application's executable. @@ -1636,11 +1636,11 @@ proc findExe*(exe: string): string {.tags: [FReadDir, FReadEnv].} = ## Returns "" if the `exe` cannot be found. On DOS-like platforms, `exe` ## is added an ``.exe`` file extension if it has no extension. result = addFileExt(exe, os.exeExt) - if ExistsFile(result): return + if existsFile(result): return var path = string(os.getEnv("PATH")) for candidate in split(path, pathSep): var x = candidate / result - if ExistsFile(x): return x + if existsFile(x): return x result = "" proc expandTilde*(path: string): string = diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 61b940ce83..605ca0f12a 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -383,16 +383,16 @@ when defined(Windows) and not defined(useNimRtl): # O_WRONLY {.importc: "_O_WRONLY", header: "<fcntl.h>".}: int # O_RDONLY {.importc: "_O_RDONLY", header: "<fcntl.h>".}: int - proc CreatePipeHandles(Rdhandle, WrHandle: var THandle) = + proc createPipeHandles(Rdhandle, WrHandle: var THandle) = var piInheritablePipe: TSecurityAttributes - piInheritablePipe.nlength = SizeOF(TSecurityAttributes).cint + piInheritablePipe.nlength = SizeOf(TSecurityAttributes).cint piInheritablePipe.lpSecurityDescriptor = nil piInheritablePipe.Binherithandle = 1 - if CreatePipe(Rdhandle, Wrhandle, piInheritablePipe, 1024) == 0'i32: + if createPipe(Rdhandle, Wrhandle, piInheritablePipe, 1024) == 0'i32: OSError(OSLastError()) proc fileClose(h: THandle) {.inline.} = - if h > 4: discard CloseHandle(h) + if h > 4: discard closeHandle(h) proc startProcess(command: string, workingDir: string = "", @@ -400,8 +400,8 @@ when defined(Windows) and not defined(useNimRtl): env: PStringTable = nil, options: set[TProcessOption] = {poStdErrToStdOut}): PProcess = var - SI: TStartupInfo - ProcInfo: TProcessInformation + si: TStartupInfo + procInfo: TProcessInformation success: int hi, ho, he: THandle new(result) @@ -511,8 +511,8 @@ when defined(Windows) and not defined(useNimRtl): proc execCmd(command: string): int = var - SI: TStartupInfo - ProcInfo: TProcessInformation + si: TStartupInfo + procInfo: TProcessInformation process: THandle L: int32 SI.cb = SizeOf(SI).cint diff --git a/lib/pure/parseutils.nim b/lib/pure/parseutils.nim index c11265bfdd..bccb274d67 100644 --- a/lib/pure/parseutils.nim +++ b/lib/pure/parseutils.nim @@ -51,7 +51,7 @@ proc parseHex*(s: string, number: var int, start = 0): int {. elif s[i] == '#': inc(i) while true: case s[i] - of '_': nil + of '_': discard of '0'..'9': number = number shl 4 or (ord(s[i]) - ord('0')) foundDigit = true @@ -74,7 +74,7 @@ proc parseOct*(s: string, number: var int, start = 0): int {. if s[i] == '0' and (s[i+1] == 'o' or s[i+1] == 'O'): inc(i, 2) while true: case s[i] - of '_': nil + of '_': discard of '0'..'7': number = number shl 3 or (ord(s[i]) - ord('0')) foundDigit = true diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index 66bb1e6a9e..f5351c41c7 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -132,17 +132,17 @@ type ETimeout* = object of ESynch let - InvalidSocket*: TSocket = nil ## invalid socket + invalidSocket*: TSocket = nil ## invalid socket when defined(windows): let - OSInvalidSocket = winlean.INVALID_SOCKET + osInvalidSocket = winlean.INVALID_SOCKET else: let - OSInvalidSocket = posix.INVALID_SOCKET + osInvalidSocket = posix.INVALID_SOCKET proc newTSocket(fd: TSocketHandle, isBuff: bool): TSocket = - if fd == OSInvalidSocket: + if fd == osInvalidSocket: return nil new(result) result.fd = fd @@ -187,14 +187,14 @@ proc htons*(x: int16): int16 = result = sockets.ntohs(x) when defined(Posix): - proc ToInt(domain: TDomain): cint = + proc toInt(domain: TDomain): cint = case domain of AF_UNIX: result = posix.AF_UNIX of AF_INET: result = posix.AF_INET of AF_INET6: result = posix.AF_INET6 else: nil - proc ToInt(typ: TType): cint = + proc toInt(typ: TType): cint = case typ of SOCK_STREAM: result = posix.SOCK_STREAM of SOCK_DGRAM: result = posix.SOCK_DGRAM @@ -202,7 +202,7 @@ when defined(Posix): of SOCK_RAW: result = posix.SOCK_RAW else: nil - proc ToInt(p: TProtocol): cint = + proc toInt(p: TProtocol): cint = case p of IPPROTO_TCP: result = posix.IPPROTO_TCP of IPPROTO_UDP: result = posix.IPPROTO_UDP @@ -216,10 +216,10 @@ else: proc toInt(domain: TDomain): cint = result = toU16(ord(domain)) - proc ToInt(typ: TType): cint = + proc toInt(typ: TType): cint = result = cint(ord(typ)) - proc ToInt(p: TProtocol): cint = + proc toInt(p: TProtocol): cint = result = cint(ord(p)) proc socket*(domain: TDomain = AF_INET, typ: TType = SOCK_STREAM, @@ -333,7 +333,7 @@ when defined(ssl): if SSLSetFd(socket.sslHandle, socket.fd) != 1: SSLError() -proc SocketError*(socket: TSocket, err: int = -1, async = false) = +proc socketError*(socket: TSocket, err: int = -1, async = false) = ## Raises proper errors based on return values of ``recv`` functions. ## ## If ``async`` is ``True`` no error will be thrown in the case when the @@ -471,7 +471,7 @@ template acceptAddrPlain(noClientRet, successRet: expr, var sock = accept(server.fd, cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen)) - if sock == OSInvalidSocket: + if sock == osInvalidSocket: let err = OSLastError() when defined(windows): if err.int32 == WSAEINPROGRESS: @@ -1661,7 +1661,7 @@ when defined(Windows): proc setBlocking(s: TSocket, blocking: bool) = when defined(Windows): var mode = clong(ord(not blocking)) # 1 for non-blocking, 0 for blocking - if ioctlsocket(TSocketHandle(s.fd), FIONBIO, addr(mode)) == -1: + if ioctlsocket(s.fd, FIONBIO, addr(mode)) == -1: OSError(OSLastError()) else: # BSD sockets var x: int = fcntl(s.fd, F_GETFL, 0) diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim index 77b463fc0a..d8bc94176b 100644 --- a/lib/pure/strtabs.nim +++ b/lib/pure/strtabs.nim @@ -88,7 +88,7 @@ proc mustRehash(length, counter: int): bool = proc nextTry(h, maxHash: THash): THash {.inline.} = result = ((5 * h) + 1) and maxHash -proc RawGet(t: PStringTable, key: string): int = +proc rawGet(t: PStringTable, key: string): int = var h: THash = myhash(t, key) and high(t.data) # start with real hash value while not isNil(t.data[h].key): if mycmp(t, t.data[h].key, key): @@ -116,14 +116,14 @@ proc hasKey*(t: PStringTable, key: string): bool {.rtl, extern: "nst$1".} = ## returns true iff `key` is in the table `t`. result = rawGet(t, key) >= 0 -proc RawInsert(t: PStringTable, data: var TKeyValuePairSeq, key, val: string) = +proc rawInsert(t: PStringTable, data: var TKeyValuePairSeq, key, val: string) = var h: THash = myhash(t, key) and high(data) while not isNil(data[h].key): h = nextTry(h, high(data)) data[h].key = key data[h].val = val -proc Enlarge(t: PStringTable) = +proc enlarge(t: PStringTable) = var n: TKeyValuePairSeq newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): @@ -140,7 +140,7 @@ proc `[]=`*(t: PStringTable, key, val: string) {.rtl, extern: "nstPut".} = RawInsert(t, t.data, key, val) inc(t.counter) -proc RaiseFormatException(s: string) = +proc raiseFormatException(s: string) = var e: ref EInvalidValue new(e) e.msg = "format string: key not found: " & s diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index e290226d2c..388a76e710 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -128,7 +128,7 @@ proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect, ## | > 0 iff a > b var i = 0 var j = 0 - while True: + while true: while a[i] == '_': inc(i) while b[j] == '_': inc(j) # BUGFIX: typo var aa = toLower(a[i]) @@ -344,7 +344,7 @@ proc intToStr*(x: int, minchars: int = 1): string {.noSideEffect, if x < 0: result = '-' & result -proc ParseInt*(s: string): int {.noSideEffect, procvar, +proc parseInt*(s: string): int {.noSideEffect, procvar, rtl, extern: "nsuParseInt".} = ## Parses a decimal integer value contained in `s`. If `s` is not ## a valid integer, `EInvalidValue` is raised. @@ -352,7 +352,7 @@ proc ParseInt*(s: string): int {.noSideEffect, procvar, if L != s.len or L == 0: raise newException(EInvalidValue, "invalid integer: " & s) -proc ParseBiggestInt*(s: string): biggestInt {.noSideEffect, procvar, +proc parseBiggestInt*(s: string): biggestInt {.noSideEffect, procvar, rtl, extern: "nsuParseBiggestInt".} = ## Parses a decimal integer value contained in `s`. If `s` is not ## a valid integer, `EInvalidValue` is raised. @@ -360,7 +360,7 @@ proc ParseBiggestInt*(s: string): biggestInt {.noSideEffect, procvar, if L != s.len or L == 0: raise newException(EInvalidValue, "invalid integer: " & s) -proc ParseFloat*(s: string): float {.noSideEffect, procvar, +proc parseFloat*(s: string): float {.noSideEffect, procvar, rtl, extern: "nsuParseFloat".} = ## Parses a decimal floating point value contained in `s`. If `s` is not ## a valid floating point number, `EInvalidValue` is raised. ``NAN``, @@ -369,7 +369,7 @@ proc ParseFloat*(s: string): float {.noSideEffect, procvar, if L != s.len or L == 0: raise newException(EInvalidValue, "invalid float: " & s) -proc ParseHexInt*(s: string): int {.noSideEffect, procvar, +proc parseHexInt*(s: string): int {.noSideEffect, procvar, rtl, extern: "nsuParseHexInt".} = ## Parses a hexadecimal integer value contained in `s`. If `s` is not ## a valid integer, `EInvalidValue` is raised. `s` can have one of the @@ -455,7 +455,7 @@ proc align*(s: string, count: int, padding = ' '): string {. ## assert align("1232", 6, '#') == "##1232" if s.len < count: result = newString(count) - var spaces = count - s.len + let spaces = count - s.len for i in 0..spaces-1: result[i] = padding for i in spaces..count-1: result[i] = s[i-spaces] else: @@ -649,7 +649,7 @@ proc join*(a: openArray[string]): string {. result = "" type - TSkipTable = array[Char, int] + TSkipTable = array[char, int] proc preprocessSub(sub: string, a: var TSkipTable) = var m = len(sub) @@ -795,7 +795,7 @@ proc delete*(s: var string, first, last: int) {.noSideEffect, inc(j) setlen(s, newLen) -proc ParseOctInt*(s: string): int {.noSideEffect, +proc parseOctInt*(s: string): int {.noSideEffect, rtl, extern: "nsuParseOctInt".} = ## Parses an octal integer value contained in `s`. If `s` is not ## a valid integer, `EInvalidValue` is raised. `s` can have one of the @@ -896,7 +896,7 @@ proc unescape*(s: string, prefix = "\"", suffix = "\""): string {.noSideEffect, raise newException(EInvalidValue, "String does not start with a prefix of: " & prefix) i.inc() - while True: + while true: if i == s.len-suffix.len: break case s[i] of '\\': diff --git a/lib/pure/times.nim b/lib/pure/times.nim index e967ef683e..a37091c52d 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -146,7 +146,7 @@ proc getGMTime*(t: TTime): TTimeInfo {.tags: [FTime], raises: [].} ## converts the calendar time `t` to broken-down time representation, ## expressed in Coordinated Universal Time (UTC). -proc TimeInfoToTime*(timeInfo: TTimeInfo): TTime {.tags: [].} +proc timeInfoToTime*(timeInfo: TTimeInfo): TTime {.tags: [].} ## converts a broken-down time structure to ## calendar time representation. The function ignores the specified ## contents of the structure members `weekday` and `yearday` and recomputes @@ -297,7 +297,7 @@ when not defined(JS): when not defined(JS): # C wrapper: type - structTM {.importc: "struct tm", final.} = object + StructTM {.importc: "struct tm", final.} = object second {.importc: "tm_sec".}, minute {.importc: "tm_min".}, hour {.importc: "tm_hour".}, @@ -308,7 +308,7 @@ when not defined(JS): yearday {.importc: "tm_yday".}, isdst {.importc: "tm_isdst".}: cint - PTimeInfo = ptr structTM + PTimeInfo = ptr StructTM PTime = ptr TTime TClock {.importc: "clock_t".} = distinct int @@ -401,7 +401,7 @@ when not defined(JS): # copying is needed anyway to provide reentrancity; thus # the conversion is not expensive - proc TimeInfoToTime(timeInfo: TTimeInfo): TTime = + 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)) @@ -498,7 +498,7 @@ elif defined(JS): result.weekday = weekDays[t.getUTCDay()] result.yearday = 0 - proc TimeInfoToTime*(timeInfo: TTimeInfo): TTime = + proc timeInfoToTime*(timeInfo: TTimeInfo): TTime = result = internGetTime() result.setSeconds(timeInfo.second) result.setMinutes(timeInfo.minute) diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim index 4aacb2f717..1cf2816b48 100644 --- a/lib/pure/unicode.nim +++ b/lib/pure/unicode.nim @@ -14,8 +14,8 @@ include "system/inclrtl" type - irune = int # underlying type of TRune - TRune* = distinct irune ## type that can hold any Unicode character + IRune = int # underlying type of TRune + TRune* = distinct IRune ## type that can hold any Unicode character TRune16* = distinct int16 ## 16 bit Unicode character proc `<=%`*(a, b: TRune): bool = return int(a) <=% int(b) diff --git a/lib/system.nim b/lib/system.nim index 14be9cc21a..726230613e 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1963,20 +1963,20 @@ when not defined(JS): #and not defined(NimrodVM): ## Template which expands to either stdout or stderr depending on ## `useStdoutAsStdmsg` compile-time switch. - proc Open*(f: var TFile, filename: string, + proc open*(f: var TFile, filename: string, mode: TFileMode = fmRead, bufSize: int = -1): Bool {.tags: [].} ## 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. - proc Open*(f: var TFile, filehandle: TFileHandle, + proc open*(f: var TFile, filehandle: TFileHandle, mode: TFileMode = fmRead): Bool {.tags: [].} ## Creates a ``TFile`` from a `filehandle` with given `mode`. ## ## Default mode is readonly. Returns true iff the file could be opened. - proc Open*(filename: string, + proc open*(filename: string, mode: TFileMode = fmRead, bufSize: int = -1): TFile = ## Opens a file named `filename` with given `mode`. ## @@ -1993,16 +1993,16 @@ when not defined(JS): #and not defined(NimrodVM): ## ## Default mode is readonly. Returns true iff the file could be reopened. - proc Close*(f: TFile) {.importc: "fclose", header: "<stdio.h>", tags: [].} + proc close*(f: TFile) {.importc: "fclose", header: "<stdio.h>", tags: [].} ## Closes the file. - proc EndOfFile*(f: TFile): Bool {.tags: [].} + proc endOfFile*(f: TFile): Bool {.tags: [].} ## Returns true iff `f` is at the end. proc readChar*(f: TFile): char {. importc: "fgetc", header: "<stdio.h>", tags: [FReadIO].} ## Reads a single character from the stream `f`. - proc FlushFile*(f: TFile) {. + proc flushFile*(f: TFile) {. importc: "fflush", header: "<stdio.h>", tags: [FWriteIO].} ## Flushes `f`'s buffer. @@ -2051,13 +2051,13 @@ when not defined(JS): #and not defined(NimrodVM): proc getFileSize*(f: TFile): int64 {.tags: [FReadIO].} ## retrieves the file size (in bytes) of `f`. - proc ReadBytes*(f: TFile, a: var openarray[int8], start, len: int): int {. + proc readBytes*(f: TFile, a: var openarray[int8], start, len: int): int {. tags: [FReadIO].} ## 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 {. + proc readChars*(f: TFile, a: var openarray[char], start, len: int): int {. tags: [FReadIO].} ## 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 @@ -2655,7 +2655,7 @@ proc compiles*(x: expr): bool {.magic: "Compiles", noSideEffect.} = ## .. code-block:: Nimrod ## when not compiles(3 + 4): ## echo "'+' for integers is available" - nil + discard when defined(initDebugger): initDebugger() @@ -2680,4 +2680,4 @@ proc locals*(): TObject {.magic: "Locals", noSideEffect.} = ## on any debug or runtime information. Note that in constrast to what ## the official signature says, the return type is not ``TObject`` but a ## tuple of a structure that depends on the current scope. - nil + discard diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 17258cf68a..e0f29a961d 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -59,15 +59,16 @@ elif defined(windows): MEM_DECOMMIT = 0x4000 MEM_RELEASE = 0x8000 - proc VirtualAlloc(lpAddress: pointer, dwSize: int, flAllocationType, + proc virtualAlloc(lpAddress: pointer, dwSize: int, flAllocationType, flProtect: int32): pointer {. - header: "<windows.h>", stdcall.} + header: "<windows.h>", stdcall, importc: "VirtualAlloc".} - proc VirtualFree(lpAddress: pointer, dwSize: int, - dwFreeType: int32) {.header: "<windows.h>", stdcall.} + proc virtualFree(lpAddress: pointer, dwSize: int, + dwFreeType: int32) {.header: "<windows.h>", stdcall, + importc: "VirtualFree".} proc osAllocPages(size: int): pointer {.inline.} = - result = VirtualAlloc(nil, size, MEM_RESERVE or MEM_COMMIT, + result = virtualAlloc(nil, size, MEM_RESERVE or MEM_COMMIT, PAGE_READWRITE) if result == nil: raiseOutOfMem() @@ -78,7 +79,7 @@ elif defined(windows): # Windows :-(. We have to live with MEM_DECOMMIT instead. # Well that used to be the case but MEM_DECOMMIT fragments the address # space heavily, so we now treat Windows as a strange unmap target. - when reallyOsDealloc: VirtualFree(p, 0, MEM_RELEASE) + when reallyOsDealloc: virtualFree(p, 0, MEM_RELEASE) #VirtualFree(p, size, MEM_DECOMMIT) else: @@ -251,14 +252,14 @@ proc llDeallocAll(a: var TMemRegion) = osDeallocPages(it, PageSize) it = next -proc IntSetGet(t: TIntSet, key: int): PTrunk = +proc intSetGet(t: TIntSet, key: int): PTrunk = var it = t.data[key and high(t.data)] while it != nil: if it.key == key: return it it = it.next result = nil -proc IntSetPut(a: var TMemRegion, t: var TIntSet, key: int): PTrunk = +proc intSetPut(a: var TMemRegion, t: var TIntSet, key: int): PTrunk = result = IntSetGet(t, key) if result == nil: result = cast[PTrunk](llAlloc(a, sizeof(result[]))) @@ -266,7 +267,7 @@ proc IntSetPut(a: var TMemRegion, t: var TIntSet, key: int): PTrunk = t.data[key and high(t.data)] = result result.key = key -proc Contains(s: TIntSet, key: int): bool = +proc contains(s: TIntSet, key: int): bool = var t = IntSetGet(s, key shr TrunkShift) if t != nil: var u = key and TrunkMask @@ -274,12 +275,12 @@ proc Contains(s: TIntSet, key: int): bool = else: result = false -proc Incl(a: var TMemRegion, s: var TIntSet, key: int) = +proc incl(a: var TMemRegion, s: var TIntSet, key: int) = var t = IntSetPut(a, s, key shr TrunkShift) var u = key and TrunkMask t.bits[u shr IntShift] = t.bits[u shr IntShift] or (1 shl (u and IntMask)) -proc Excl(s: var TIntSet, key: int) = +proc excl(s: var TIntSet, key: int) = var t = IntSetGet(s, key shr TrunkShift) if t != nil: var u = key and TrunkMask @@ -387,7 +388,7 @@ proc freeOsChunks(a: var TMemRegion, p: pointer, size: int) = #c_fprintf(c_stdout, "[Alloc] back to OS: %ld\n", size) proc isAccessible(a: TMemRegion, p: pointer): bool {.inline.} = - result = Contains(a.chunkStarts, pageIndex(p)) + result = contains(a.chunkStarts, pageIndex(p)) proc contains[T](list, x: T): bool = var it = list @@ -403,7 +404,7 @@ proc writeFreeList(a: TMemRegion) = it, it.next, it.prev) it = it.next -proc ListAdd[T](head: var T, c: T) {.inline.} = +proc listAdd[T](head: var T, c: T) {.inline.} = sysAssert(c notin head, "listAdd 1") sysAssert c.prev == nil, "listAdd 2" sysAssert c.next == nil, "listAdd 3" @@ -413,7 +414,7 @@ proc ListAdd[T](head: var T, c: T) {.inline.} = head.prev = c head = c -proc ListRemove[T](head: var T, c: T) {.inline.} = +proc listRemove[T](head: var T, c: T) {.inline.} = sysAssert(c in head, "listRemove") if c == head: head = c.next @@ -759,7 +760,7 @@ proc getOccupiedMem(a: TMemRegion): int {.inline.} = # ---------------------- thread memory region ------------------------------- -template InstantiateForRegion(allocator: expr) = +template instantiateForRegion(allocator: expr) = when defined(fulldebug): proc interiorAllocatedPtr*(p: pointer): pointer = result = interiorAllocatedPtr(allocator, p) @@ -801,13 +802,13 @@ template InstantiateForRegion(allocator: expr) = when hasThreadSupport: var sharedHeap: TMemRegion var heapLock: TSysLock - InitSysLock(HeapLock) + initSysLock(HeapLock) proc allocShared(size: int): pointer = when hasThreadSupport: - AcquireSys(HeapLock) + acquireSys(HeapLock) result = alloc(sharedHeap, size) - ReleaseSys(HeapLock) + releaseSys(HeapLock) else: result = alloc(size) @@ -817,17 +818,17 @@ template InstantiateForRegion(allocator: expr) = proc deallocShared(p: pointer) = when hasThreadSupport: - AcquireSys(HeapLock) + acquireSys(HeapLock) dealloc(sharedHeap, p) - ReleaseSys(HeapLock) + releaseSys(HeapLock) else: dealloc(p) proc reallocShared(p: pointer, newsize: int): pointer = when hasThreadSupport: - AcquireSys(HeapLock) + acquireSys(HeapLock) result = realloc(sharedHeap, p, newsize) - ReleaseSys(HeapLock) + releaseSys(HeapLock) else: result = realloc(p, newsize) diff --git a/lib/system/assign.nim b/lib/system/assign.nim index 3b43abcd1b..525822620a 100644 --- a/lib/system/assign.nim +++ b/lib/system/assign.nim @@ -168,12 +168,12 @@ proc objectInit(dest: Pointer, typ: PNimType) = 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 + else: discard # nothing to do # ---------------------- assign zero ----------------------------------------- when not defined(nimmixin): - proc destroy(x: int) = nil + proc destroy(x: int) = discard proc nimDestroyRange*[T](r: T) = # internal proc used for destroying sequences and arrays for i in countup(0, r.len - 1): destroy(r[i]) diff --git a/lib/system/atomics.nim b/lib/system/atomics.nim index 36185e0a89..68ee74e84e 100644 --- a/lib/system/atomics.nim +++ b/lib/system/atomics.nim @@ -7,62 +7,60 @@ # distribution, for details about the copyright. # -# Atomic operations for Nimrod. +## Atomic operations for Nimrod. -when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: - +when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: type AtomMemModel* = enum - ATOMIC_RELAXED, - ## No barriers or synchronization. - ATOMIC_CONSUME, - ## Data dependency only for both barrier and synchronization with another thread. - ATOMIC_ACQUIRE, - ## Barrier to hoisting of code and synchronizes with release (or stronger) - ## semantic stores from another thread. - ATOMIC_RELEASE, - ## Barrier to sinking of code and synchronizes with acquire (or stronger) - ## semantic loads from another thread. - ATOMIC_ACQ_REL, - ## Full barrier in both directions and synchronizes with acquire loads - ## and release stores in another thread. - ATOMIC_SEQ_CST - ## Full barrier in both directions and synchronizes with acquire loads - ## and release stores in all threads. + ATOMIC_RELAXED, ## No barriers or synchronization. + ATOMIC_CONSUME, ## Data dependency only for both barrier and + ## synchronization with another thread. + ATOMIC_ACQUIRE, ## Barrier to hoisting of code and synchronizes with + ## release (or stronger) + ## semantic stores from another thread. + ATOMIC_RELEASE, ## Barrier to sinking of code and synchronizes with + ## acquire (or stronger) + ## semantic loads from another thread. + ATOMIC_ACQ_REL, ## Full barrier in both directions and synchronizes + ## with acquire loads + ## and release stores in another thread. + ATOMIC_SEQ_CST ## Full barrier in both directions and synchronizes + ## with acquire loads + ## and release stores in all threads. TAtomType* = TNumber|pointer|ptr|char - ## Type Class representing valid types for use with atomic procs + ## Type Class representing valid types for use with atomic procs - proc atomic_load_n*[T: TAtomType](p: ptr T, mem: AtomMemModel): T {. + proc atomicLoadN*[T: TAtomType](p: ptr T, mem: AtomMemModel): T {. importc: "__atomic_load_n", nodecl.} ## This proc implements an atomic load operation. It returns the contents at p. ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_ACQUIRE, ATOMIC_CONSUME. - proc atomic_load*[T: TAtomType](p: ptr T, ret: ptr T, mem: AtomMemModel) {. + proc atomicLoad*[T: TAtomType](p: ptr T, ret: ptr T, mem: AtomMemModel) {. importc: "__atomic_load", nodecl.} ## This is the generic version of an atomic load. It returns the contents at p in ret. - proc atomic_store_n*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel) {. + proc atomicStoreN*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel) {. importc: "__atomic_store_n", nodecl.} ## This proc implements an atomic store operation. It writes val at p. ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, and ATOMIC_RELEASE. - proc atomic_store*[T: TAtomType](p: ptr T, val: ptr T, mem: AtomMemModel) {. + proc atomicStore*[T: TAtomType](p: ptr T, val: ptr T, mem: AtomMemModel) {. importc: "__atomic_store", nodecl.} ## This is the generic version of an atomic store. It stores the value of val at p - proc atomic_exchange_n*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicExchangeN*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_exchange_n", nodecl.} ## This proc implements an atomic exchange operation. It writes val at p, ## and returns the previous contents at p. ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_ACQUIRE, ATOMIC_RELEASE, ATOMIC_ACQ_REL - proc atomic_exchange*[T: TAtomType](p: ptr T, val: ptr T, ret: ptr T, mem: AtomMemModel) {. + proc atomicExchange*[T: TAtomType](p: ptr T, val: ptr T, ret: ptr T, mem: AtomMemModel) {. importc: "__atomic_exchange", nodecl.} ## This is the generic version of an atomic exchange. It stores the contents at val at p. ## The original value at p is copied into ret. - proc atomic_compare_exchange_n*[T: TAtomType](p: ptr T, expected: ptr T, desired: T, + proc atomicCompareExchangeN*[T: TAtomType](p: ptr T, expected: ptr T, desired: T, weak: bool, success_memmodel: AtomMemModel, failure_memmodel: AtomMemModel): bool {. importc: "__atomic_compare_exchange_n ", nodecl.} ## This proc implements an atomic compare and exchange operation. This compares the @@ -78,7 +76,7 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: ## cannot be __ATOMIC_RELEASE nor __ATOMIC_ACQ_REL. It also cannot be a stronger model ## than that specified by success_memmodel. - proc atomic_compare_exchange*[T: TAtomType](p: ptr T, expected: ptr T, desired: ptr T, + proc atomicCompareExchange*[T: TAtomType](p: ptr T, expected: ptr T, desired: ptr T, weak: bool, success_memmodel: AtomMemModel, failure_memmodel: AtomMemModel): bool {. importc: "__atomic_compare_exchange_n ", nodecl.} ## This proc implements the generic version of atomic_compare_exchange. @@ -86,58 +84,58 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: ## value is also a pointer. ## Perform the operation return the new value, all memory models are valid - proc atomic_add_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicAddFetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_add_fetch", nodecl.} - proc atomic_sub_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicSubFetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_sub_fetch", nodecl.} - proc atomic_or_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicOrFetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_or_fetch ", nodecl.} - proc atomic_and_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicAndFetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_and_fetch", nodecl.} - proc atomic_xor_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicXorFetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_xor_fetch", nodecl.} - proc atomic_nand_fetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicNandFetch*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_nand_fetch ", nodecl.} ## Perform the operation return the old value, all memory models are valid - proc atomic_fetch_add*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. - importc: "__atomic_fetch_add ", nodecl.} - proc atomic_fetch_sub*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. - importc: "__atomic_fetch_sub ", nodecl.} - proc atomic_fetch_or*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. - importc: "__atomic_fetch_or ", nodecl.} - proc atomic_fetch_and*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. - importc: "__atomic_fetch_and ", nodecl.} - proc atomic_fetch_xor*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. - importc: "__atomic_fetch_xor ", nodecl.} - proc atomic_fetch_nand*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicFetchAdd*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_add", nodecl.} + proc atomicFetchSub*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_sub", nodecl.} + proc atomicFetchOr*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_or", nodecl.} + proc atomicFetchAnd*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_and", nodecl.} + proc atomicFetchXor*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + importc: "__atomic_fetch_xor", nodecl.} + proc atomicFetchAand*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_fetch_nand", nodecl.} - proc atomic_test_and_set*(p: pointer, mem: AtomMemModel): bool {. - importc: "__atomic_test_and_set ", nodecl.} + proc atomicTestAndSet*(p: pointer, mem: AtomMemModel): bool {. + importc: "__atomic_test_and_set", nodecl.} ## This built-in function performs an atomic test-and-set operation on the byte at p. ## The byte is set to some implementation defined nonzero “set†value and the return ## value is true if and only if the previous contents were “setâ€. ## All memory models are valid. - proc atomic_clear*(p: pointer, mem: AtomMemModel) {. + proc atomicClear*(p: pointer, mem: AtomMemModel) {. importc: "__atomic_clear", nodecl.} ## This built-in function performs an atomic clear operation at p. ## After the operation, at p contains 0. ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_RELEASE - proc atomic_thread_fence*(mem: AtomMemModel) {. - importc: "__atomic_thread_fence ", nodecl.} + proc atomicThreadFence*(mem: AtomMemModel) {. + importc: "__atomic_thread_fence", nodecl.} ## This built-in function acts as a synchronization fence between threads based ## on the specified memory model. All memory orders are valid. - proc atomic_signal_fence*(mem: AtomMemModel) {. - importc: "__atomic_signal_fence ", nodecl.} + proc atomicSignalFence*(mem: AtomMemModel) {. + importc: "__atomic_signal_fence", nodecl.} ## This built-in function acts as a synchronization fence between a thread and ## signal handlers based in the same thread. All memory orders are valid. - proc atomic_always_lock_free*(size: int, p: pointer): bool {. - importc: "__atomic_always_lock_free ", nodecl.} + proc atomicAlwaysLockFree*(size: int, p: pointer): bool {. + importc: "__atomic_always_lock_free", nodecl.} ## This built-in function returns true if objects of size bytes always generate ## lock free atomic instructions for the target architecture. size must resolve ## to a compile-time constant and the result also resolves to a compile-time constant. @@ -145,8 +143,8 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: ## A value of 0 indicates typical alignment should be used. The compiler may also ## ignore this parameter. - proc atomic_is_lock_free*(size: int, p: pointer): bool {. - importc: "__atomic_is_lock_free ", nodecl.} + proc atomicIsLockFree*(size: int, p: pointer): bool {. + importc: "__atomic_is_lock_free", nodecl.} ## This built-in function returns true if objects of size bytes always generate ## lock free atomic instructions for the target architecture. If it is not known ## to be lock free a call is made to a runtime routine named __atomic_is_lock_free. @@ -154,19 +152,14 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: ## A value of 0 indicates typical alignment should be used. The compiler may also ## ignore this parameter. - - elif defined(vcc) and hasThreadSupport: - proc add_and_fetch*(p: ptr int, val: int): int {. + proc addAndFetch*(p: ptr int, val: int): int {. importc: "NimXadd", nodecl.} else: - proc add_and_fetch*(p: ptr int, val: int): int {.inline.} = + proc addAndFetch*(p: ptr int, val: int): int {.inline.} = inc(p[], val) result = p[] - - - # atomic compare and swap (CAS) funcitons to implement lock-free algorithms #if defined(windows) and not defined(gcc) and hasThreadSupport: @@ -210,6 +203,3 @@ proc atomicDec*(memLoc: var int, x: int = 1): int = else: dec(memLoc, x) result = memLoc - - - diff --git a/lib/system/avltree.nim b/lib/system/avltree.nim index 6a268b453d..fc965d6aaa 100644 --- a/lib/system/avltree.nim +++ b/lib/system/avltree.nim @@ -9,30 +9,30 @@ # not really an AVL tree anymore, but still balanced ... -template IsBottom(n: PAvlNode): bool = n == bottom +template isBottom(n: PAvlNode): bool = n == bottom proc lowGauge(n: PAvlNode): int = var it = n - while not IsBottom(it): + while not isBottom(it): result = it.key it = it.link[0] proc highGauge(n: PAvlNode): int = result = -1 var it = n - while not IsBottom(it): + while not isBottom(it): result = it.upperBound it = it.link[1] proc find(root: PAvlNode, key: int): PAvlNode = var it = root - while not IsBottom(it): + while not isBottom(it): if it.key == key: return it it = it.link[ord(it.key <% key)] proc inRange(root: PAvlNode, key: int): PAvlNode = var it = root - while not IsBottom(it): + while not isBottom(it): if it.key <=% key and key <% it.upperBound: return it it = it.link[ord(it.key <% key)] diff --git a/lib/system/cellsets.nim b/lib/system/cellsets.nim index 7ad814da4a..85a24e856d 100644 --- a/lib/system/cellsets.nim +++ b/lib/system/cellsets.nim @@ -43,15 +43,15 @@ type proc contains(s: TCellSeq, c: PCell): bool {.inline.} = for i in 0 .. s.len-1: - if s.d[i] == c: return True - return False + if s.d[i] == c: return true + return false proc add(s: var TCellSeq, c: PCell) {.inline.} = if s.len >= s.cap: s.cap = s.cap * 3 div 2 - var d = cast[PCellArray](Alloc(s.cap * sizeof(PCell))) + var d = cast[PCellArray](alloc(s.cap * sizeof(PCell))) copyMem(d, s.d, s.len * sizeof(PCell)) - Dealloc(s.d) + dealloc(s.d) s.d = d # XXX: realloc? s.d[s.len] = c @@ -60,10 +60,10 @@ proc add(s: var TCellSeq, c: PCell) {.inline.} = proc init(s: var TCellSeq, cap: int = 1024) = s.len = 0 s.cap = cap - s.d = cast[PCellArray](Alloc0(cap * sizeof(PCell))) + s.d = cast[PCellArray](alloc0(cap * sizeof(PCell))) proc deinit(s: var TCellSeq) = - Dealloc(s.d) + dealloc(s.d) s.d = nil s.len = 0 s.cap = 0 @@ -73,20 +73,20 @@ proc deinit(s: var TCellSeq) = const InitCellSetSize = 1024 # must be a power of two! -proc Init(s: var TCellSet) = - s.data = cast[PPageDescArray](Alloc0(InitCellSetSize * sizeof(PPageDesc))) +proc init(s: var TCellSet) = + s.data = cast[PPageDescArray](alloc0(InitCellSetSize * sizeof(PPageDesc))) s.max = InitCellSetSize-1 s.counter = 0 s.head = nil -proc Deinit(s: var TCellSet) = +proc deinit(s: var TCellSet) = var it = s.head while it != nil: var n = it.next - Dealloc(it) + dealloc(it) it = n s.head = nil # play it safe here - Dealloc(s.data) + dealloc(s.data) s.data = nil s.counter = 0 @@ -96,14 +96,14 @@ proc nextTry(h, maxHash: int): int {.inline.} = # generates each int in range(maxHash) exactly once (see any text on # random-number generation for proof). -proc CellSetGet(t: TCellSet, key: TAddress): PPageDesc = +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) = +proc cellSetRawInsert(t: TCellSet, data: PPageDescArray, desc: PPageDesc) = var h = cast[int](desc.key) and t.max while data[h] != nil: sysAssert(data[h] != desc, "CellSetRawInsert 1") @@ -111,17 +111,17 @@ proc CellSetRawInsert(t: TCellSet, data: PPageDescArray, desc: PPageDesc) = sysAssert(data[h] == nil, "CellSetRawInsert 2") data[h] = desc -proc CellSetEnlarge(t: var TCellSet) = +proc cellSetEnlarge(t: var TCellSet) = var oldMax = t.max t.max = ((t.max+1)*2)-1 - var n = cast[PPageDescArray](Alloc0((t.max + 1) * sizeof(PPageDesc))) + var n = cast[PPageDescArray](alloc0((t.max + 1) * sizeof(PPageDesc))) for i in 0 .. oldmax: if t.data[i] != nil: - CellSetRawInsert(t, n, t.data[i]) - Dealloc(t.data) + cellSetRawInsert(t, n, t.data[i]) + dealloc(t.data) t.data = n -proc CellSetPut(t: var TCellSet, key: TAddress): PPageDesc = +proc cellSetPut(t: var TCellSet, key: TAddress): PPageDesc = var h = cast[int](key) and t.max while true: var x = t.data[h] @@ -130,13 +130,13 @@ proc CellSetPut(t: var TCellSet, key: TAddress): PPageDesc = h = nextTry(h, t.max) if ((t.max+1)*2 < t.counter*3) or ((t.max+1)-t.counter < 4): - CellSetEnlarge(t) + cellSetEnlarge(t) inc(t.counter) h = cast[int](key) and t.max while t.data[h] != nil: h = nextTry(h, t.max) sysAssert(t.data[h] == nil, "CellSetPut") # the new page descriptor goes into result - result = cast[PPageDesc](Alloc0(sizeof(TPageDesc))) + result = cast[PPageDesc](alloc0(sizeof(TPageDesc))) result.next = t.head result.key = key t.head = result @@ -146,7 +146,7 @@ proc CellSetPut(t: var TCellSet, key: TAddress): PPageDesc = proc contains(s: TCellSet, cell: PCell): bool = var u = cast[TAddress](cell) - var t = CellSetGet(s, u shr PageShift) + var t = cellSetGet(s, u shr PageShift) if t != nil: u = (u %% PageSize) /% MemAlign result = (t.bits[u shr IntShift] and (1 shl (u and IntMask))) != 0 @@ -155,13 +155,13 @@ proc contains(s: TCellSet, cell: PCell): bool = proc incl(s: var TCellSet, cell: PCell) {.noinline.} = var u = cast[TAddress](cell) - var t = CellSetPut(s, u shr PageShift) + var t = cellSetPut(s, u shr PageShift) u = (u %% PageSize) /% MemAlign t.bits[u shr IntShift] = t.bits[u shr IntShift] or (1 shl (u and IntMask)) proc excl(s: var TCellSet, cell: PCell) = var u = cast[TAddress](cell) - var t = CellSetGet(s, u shr PageShift) + var t = cellSetGet(s, u shr PageShift) if t != nil: u = (u %% PageSize) /% MemAlign t.bits[u shr IntShift] = (t.bits[u shr IntShift] and @@ -169,7 +169,7 @@ proc excl(s: var TCellSet, cell: PCell) = proc containsOrIncl(s: var TCellSet, cell: PCell): bool = var u = cast[TAddress](cell) - var t = CellSetGet(s, u shr PageShift) + var t = cellSetGet(s, u shr PageShift) if t != nil: u = (u %% PageSize) /% MemAlign result = (t.bits[u shr IntShift] and (1 shl (u and IntMask))) != 0 @@ -177,7 +177,7 @@ proc containsOrIncl(s: var TCellSet, cell: PCell): bool = t.bits[u shr IntShift] = t.bits[u shr IntShift] or (1 shl (u and IntMask)) else: - Incl(s, cell) + incl(s, cell) result = false iterator elements(t: TCellSet): PCell {.inline.} = diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim index 6a80369b99..65f8cbb092 100644 --- a/lib/system/dyncalls.nim +++ b/lib/system/dyncalls.nim @@ -28,7 +28,7 @@ proc nimLoadLibraryError(path: string) = stdout.rawWrite("\n") quit(1) -proc ProcAddrError(name: cstring) {.noinline.} = +proc procAddrError(name: cstring) {.noinline.} = # carefully written to avoid memory allocation: stdout.rawWrite("could not import: ") stdout.write(name) @@ -83,21 +83,22 @@ elif defined(windows) or defined(dos): type THINSTANCE {.importc: "HINSTANCE".} = pointer - proc FreeLibrary(lib: THINSTANCE) {.importc, header: "<windows.h>", stdcall.} + proc freeLibrary(lib: THINSTANCE) {. + importc: "FreeLibrary", header: "<windows.h>", stdcall.} proc winLoadLibrary(path: cstring): THINSTANCE {. importc: "LoadLibraryA", header: "<windows.h>", stdcall.} - proc GetProcAddress(lib: THINSTANCE, name: cstring): TProcAddr {. + proc getProcAddress(lib: THINSTANCE, name: cstring): TProcAddr {. importc: "GetProcAddress", header: "<windows.h>", stdcall.} proc nimUnloadLibrary(lib: TLibHandle) = - FreeLibrary(cast[THINSTANCE](lib)) + freeLibrary(cast[THINSTANCE](lib)) proc nimLoadLibrary(path: string): TLibHandle = result = cast[TLibHandle](winLoadLibrary(path)) proc nimGetProcAddr(lib: TLibHandle, name: cstring): TProcAddr = - result = GetProcAddress(cast[THINSTANCE](lib), name) - if result == nil: ProcAddrError(name) + result = getProcAddress(cast[THINSTANCE](lib), name) + if result == nil: procAddrError(name) elif defined(mac): # diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 68e8b423db..2daa3eafa7 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -151,7 +151,7 @@ template gcTrace(cell, state: expr): stmt {.immediate.} = # forward declarations: proc collectCT(gch: var TGcHeap) -proc IsOnStack*(p: pointer): bool {.noinline.} +proc isOnStack*(p: pointer): bool {.noinline.} proc forAllChildren(cell: PCell, op: TWalkOp) proc doOperation(p: pointer, op: TWalkOp) proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) @@ -669,7 +669,7 @@ proc doOperation(p: pointer, op: TWalkOp) = proc nimGCvisit(d: pointer, op: int) {.compilerRtl.} = doOperation(d, TWalkOp(op)) -proc CollectZCT(gch: var TGcHeap): bool +proc collectZCT(gch: var TGcHeap): bool when useMarkForDebug or useBackupGc: proc markStackAndRegistersForSweep(gch: var TGcHeap) {.noinline, cdecl.} diff --git a/lib/system/repr.nim b/lib/system/repr.nim index a51864ac29..f0d620952b 100644 --- a/lib/system/repr.nim +++ b/lib/system/repr.nim @@ -72,7 +72,7 @@ proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} = result = $e & " (invalid data!)" type - pbyteArray = ptr array[0.. 0xffff, int8] + PByteArray = ptr array[0.. 0xffff, int8] proc addSetElem(result: var string, elem: int, typ: PNimType) = case typ.kind diff --git a/lib/system/syslocks.nim b/lib/system/syslocks.nim index 4d81dee019..0f67af40c9 100644 --- a/lib/system/syslocks.nim +++ b/lib/system/syslocks.nim @@ -22,48 +22,48 @@ when defined(Windows): TSysCond = THandle - proc InitSysLock(L: var TSysLock) {.stdcall, noSideEffect, + proc initSysLock(L: var TSysLock) {.stdcall, noSideEffect, dynlib: "kernel32", importc: "InitializeCriticalSection".} ## Initializes the lock `L`. - proc TryAcquireSysAux(L: var TSysLock): int32 {.stdcall, noSideEffect, + proc tryAcquireSysAux(L: var TSysLock): int32 {.stdcall, noSideEffect, dynlib: "kernel32", importc: "TryEnterCriticalSection".} ## Tries to acquire the lock `L`. - proc TryAcquireSys(L: var TSysLock): bool {.inline.} = + proc tryAcquireSys(L: var TSysLock): bool {.inline.} = result = TryAcquireSysAux(L) != 0'i32 - proc AcquireSys(L: var TSysLock) {.stdcall, noSideEffect, + proc acquireSys(L: var TSysLock) {.stdcall, noSideEffect, dynlib: "kernel32", importc: "EnterCriticalSection".} ## Acquires the lock `L`. - proc ReleaseSys(L: var TSysLock) {.stdcall, noSideEffect, + proc releaseSys(L: var TSysLock) {.stdcall, noSideEffect, dynlib: "kernel32", importc: "LeaveCriticalSection".} ## Releases the lock `L`. - proc DeinitSys(L: var TSysLock) {.stdcall, noSideEffect, + proc deinitSys(L: var TSysLock) {.stdcall, noSideEffect, dynlib: "kernel32", importc: "DeleteCriticalSection".} - proc CreateEvent(lpEventAttributes: pointer, + proc createEvent(lpEventAttributes: pointer, bManualReset, bInitialState: int32, lpName: cstring): TSysCond {.stdcall, noSideEffect, dynlib: "kernel32", importc: "CreateEventA".} - proc CloseHandle(hObject: THandle) {.stdcall, noSideEffect, + proc closeHandle(hObject: THandle) {.stdcall, noSideEffect, dynlib: "kernel32", importc: "CloseHandle".} - proc WaitForSingleObject(hHandle: THandle, dwMilliseconds: int32): int32 {. + proc waitForSingleObject(hHandle: THandle, dwMilliseconds: int32): int32 {. stdcall, dynlib: "kernel32", importc: "WaitForSingleObject".} - proc SignalSysCond(hEvent: TSysCond) {.stdcall, noSideEffect, + proc signalSysCond(hEvent: TSysCond) {.stdcall, noSideEffect, dynlib: "kernel32", importc: "SetEvent".} - proc InitSysCond(cond: var TSysCond) {.inline.} = - cond = CreateEvent(nil, 0'i32, 0'i32, nil) - proc DeinitSysCond(cond: var TSysCond) {.inline.} = - CloseHandle(cond) - proc WaitSysCond(cond: var TSysCond, lock: var TSysLock) = + proc initSysCond(cond: var TSysCond) {.inline.} = + cond = createEvent(nil, 0'i32, 0'i32, nil) + proc deinitSysCond(cond: var TSysCond) {.inline.} = + closeHandle(cond) + proc waitSysCond(cond: var TSysCond, lock: var TSysLock) = releaseSys(lock) - discard WaitForSingleObject(cond, -1'i32) + discard waitForSingleObject(cond, -1'i32) acquireSys(lock) else: @@ -73,29 +73,29 @@ else: TSysCond {.importc: "pthread_cond_t", pure, final, header: "<sys/types.h>".} = object - proc InitSysLock(L: var TSysLock, attr: pointer = nil) {. + proc initSysLock(L: var TSysLock, attr: pointer = nil) {. importc: "pthread_mutex_init", header: "<pthread.h>", noSideEffect.} - proc AcquireSys(L: var TSysLock) {.noSideEffect, + proc acquireSys(L: var TSysLock) {.noSideEffect, importc: "pthread_mutex_lock", header: "<pthread.h>".} - proc TryAcquireSysAux(L: var TSysLock): cint {.noSideEffect, + proc tryAcquireSysAux(L: var TSysLock): cint {.noSideEffect, importc: "pthread_mutex_trylock", header: "<pthread.h>".} - proc TryAcquireSys(L: var TSysLock): bool {.inline.} = - result = TryAcquireSysAux(L) == 0'i32 + proc tryAcquireSys(L: var TSysLock): bool {.inline.} = + result = tryAcquireSysAux(L) == 0'i32 - proc ReleaseSys(L: var TSysLock) {.noSideEffect, + proc releaseSys(L: var TSysLock) {.noSideEffect, importc: "pthread_mutex_unlock", header: "<pthread.h>".} - proc DeinitSys(L: var TSysLock) {. + proc deinitSys(L: var TSysLock) {. importc: "pthread_mutex_destroy", header: "<pthread.h>".} - proc InitSysCond(cond: var TSysCond, cond_attr: pointer = nil) {. + proc initSysCond(cond: var TSysCond, cond_attr: pointer = nil) {. importc: "pthread_cond_init", header: "<pthread.h>".} - proc WaitSysCond(cond: var TSysCond, lock: var TSysLock) {. + proc waitSysCond(cond: var TSysCond, lock: var TSysLock) {. importc: "pthread_cond_wait", header: "<pthread.h>".} - proc SignalSysCond(cond: var TSysCond) {. + proc signalSysCond(cond: var TSysCond) {. importc: "pthread_cond_signal", header: "<pthread.h>".} - proc DeinitSysCond(cond: var TSysCond) {. + proc deinitSysCond(cond: var TSysCond) {. importc: "pthread_cond_destroy", header: "<pthread.h>".} diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 264285d095..c2089906ad 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -96,25 +96,25 @@ const CREATE_UNICODE_ENVIRONMENT* = 1024'i32 -proc CloseHandle*(hObject: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", +proc closeHandle*(hObject: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", importc: "CloseHandle".} -proc ReadFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToRead: int32, +proc readFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToRead: int32, lpNumberOfBytesRead: var int32, lpOverlapped: pointer): WINBOOL{. stdcall, dynlib: "kernel32", importc: "ReadFile".} -proc WriteFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToWrite: int32, +proc writeFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToWrite: int32, lpNumberOfBytesWritten: var int32, lpOverlapped: pointer): WINBOOL{. stdcall, dynlib: "kernel32", importc: "WriteFile".} -proc CreatePipe*(hReadPipe, hWritePipe: var THandle, +proc createPipe*(hReadPipe, hWritePipe: var THandle, lpPipeAttributes: var TSECURITY_ATTRIBUTES, nSize: int32): WINBOOL{. stdcall, dynlib: "kernel32", importc: "CreatePipe".} when useWinUnicode: - proc CreateProcessW*(lpApplicationName, lpCommandLine: widecstring, + proc createProcessW*(lpApplicationName, lpCommandLine: widecstring, lpProcessAttributes: ptr TSECURITY_ATTRIBUTES, lpThreadAttributes: ptr TSECURITY_ATTRIBUTES, bInheritHandles: WINBOOL, dwCreationFlags: int32, @@ -124,7 +124,7 @@ when useWinUnicode: stdcall, dynlib: "kernel32", importc: "CreateProcessW".} else: - proc CreateProcessA*(lpApplicationName, lpCommandLine: cstring, + proc createProcessA*(lpApplicationName, lpCommandLine: cstring, lpProcessAttributes: ptr TSECURITY_ATTRIBUTES, lpThreadAttributes: ptr TSECURITY_ATTRIBUTES, bInheritHandles: WINBOOL, dwCreationFlags: int32, @@ -134,74 +134,76 @@ else: stdcall, dynlib: "kernel32", importc: "CreateProcessA".} -proc SuspendThread*(hThread: THANDLE): int32 {.stdcall, dynlib: "kernel32", +proc suspendThread*(hThread: THANDLE): int32 {.stdcall, dynlib: "kernel32", importc: "SuspendThread".} -proc ResumeThread*(hThread: THANDLE): int32 {.stdcall, dynlib: "kernel32", +proc resumeThread*(hThread: THANDLE): int32 {.stdcall, dynlib: "kernel32", importc: "ResumeThread".} -proc WaitForSingleObject*(hHandle: THANDLE, dwMilliseconds: int32): int32 {. +proc waitForSingleObject*(hHandle: THANDLE, dwMilliseconds: int32): int32 {. stdcall, dynlib: "kernel32", importc: "WaitForSingleObject".} -proc TerminateProcess*(hProcess: THANDLE, uExitCode: int): WINBOOL {.stdcall, +proc terminateProcess*(hProcess: THANDLE, uExitCode: int): WINBOOL {.stdcall, dynlib: "kernel32", importc: "TerminateProcess".} -proc GetExitCodeProcess*(hProcess: THANDLE, lpExitCode: var int32): WINBOOL {. +proc getExitCodeProcess*(hProcess: THANDLE, lpExitCode: var int32): WINBOOL {. stdcall, dynlib: "kernel32", importc: "GetExitCodeProcess".} -proc GetStdHandle*(nStdHandle: int32): THANDLE {.stdcall, dynlib: "kernel32", +proc getStdHandle*(nStdHandle: int32): THANDLE {.stdcall, dynlib: "kernel32", importc: "GetStdHandle".} -proc SetStdHandle*(nStdHandle: int32, hHandle: THANDLE): WINBOOL {.stdcall, +proc setStdHandle*(nStdHandle: int32, hHandle: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", importc: "SetStdHandle".} -proc FlushFileBuffers*(hFile: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", +proc flushFileBuffers*(hFile: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", importc: "FlushFileBuffers".} -proc GetLastError*(): int32 {.importc, stdcall, dynlib: "kernel32".} +proc getLastError*(): int32 {.importc: "GetLastError", + stdcall, dynlib: "kernel32".} when useWinUnicode: - proc FormatMessageW*(dwFlags: int32, lpSource: pointer, + proc formatMessageW*(dwFlags: int32, lpSource: pointer, dwMessageId, dwLanguageId: int32, lpBuffer: pointer, nSize: int32, Arguments: pointer): int32 {. - importc, stdcall, dynlib: "kernel32".} + importc: "FormatMessageW", stdcall, dynlib: "kernel32".} else: - proc FormatMessageA*(dwFlags: int32, lpSource: pointer, + proc formatMessageA*(dwFlags: int32, lpSource: pointer, dwMessageId, dwLanguageId: int32, lpBuffer: pointer, nSize: int32, Arguments: pointer): int32 {. - importc, stdcall, dynlib: "kernel32".} + importc: "FormatMessageA", stdcall, dynlib: "kernel32".} -proc LocalFree*(p: pointer) {.importc, stdcall, dynlib: "kernel32".} +proc localFree*(p: pointer) {. + importc: "LocalFree", stdcall, dynlib: "kernel32".} when useWinUnicode: - proc GetCurrentDirectoryW*(nBufferLength: int32, + proc getCurrentDirectoryW*(nBufferLength: int32, lpBuffer: widecstring): int32 {. - importc, dynlib: "kernel32", stdcall.} - proc SetCurrentDirectoryW*(lpPathName: widecstring): int32 {. - importc, dynlib: "kernel32", stdcall.} - proc CreateDirectoryW*(pathName: widecstring, security: Pointer=nil): int32 {. + importc: "GetCurrentDirectoryW", dynlib: "kernel32", stdcall.} + proc setCurrentDirectoryW*(lpPathName: widecstring): int32 {. + importc: "SetCurrentDirectoryW", dynlib: "kernel32", stdcall.} + proc createDirectoryW*(pathName: widecstring, security: Pointer=nil): int32 {. importc: "CreateDirectoryW", dynlib: "kernel32", stdcall.} - proc RemoveDirectoryW*(lpPathName: widecstring): int32 {. - importc, dynlib: "kernel32", stdcall.} - proc SetEnvironmentVariableW*(lpName, lpValue: widecstring): int32 {. - stdcall, dynlib: "kernel32", importc.} + proc removeDirectoryW*(lpPathName: widecstring): int32 {. + importc: "RemoveDirectoryW", dynlib: "kernel32", stdcall.} + proc setEnvironmentVariableW*(lpName, lpValue: widecstring): int32 {. + stdcall, dynlib: "kernel32", importc: "SetEnvironmentVariableW".} - proc GetModuleFileNameW*(handle: THandle, buf: wideCString, - size: int32): int32 {.importc, + proc getModuleFileNameW*(handle: THandle, buf: wideCString, + size: int32): int32 {.importc: "GetModuleFileNameW", dynlib: "kernel32", stdcall.} else: - proc GetCurrentDirectoryA*(nBufferLength: int32, lpBuffer: cstring): int32 {. - importc, dynlib: "kernel32", stdcall.} - proc SetCurrentDirectoryA*(lpPathName: cstring): int32 {. - importc, dynlib: "kernel32", stdcall.} - proc CreateDirectoryA*(pathName: cstring, security: Pointer=nil): int32 {. + proc getCurrentDirectoryA*(nBufferLength: int32, lpBuffer: cstring): int32 {. + importc: "GetCurrentDirectoryA", dynlib: "kernel32", stdcall.} + proc setCurrentDirectoryA*(lpPathName: cstring): int32 {. + importc: "SetCurrentDirectoryA", dynlib: "kernel32", stdcall.} + proc createDirectoryA*(pathName: cstring, security: Pointer=nil): int32 {. importc: "CreateDirectoryA", dynlib: "kernel32", stdcall.} - proc RemoveDirectoryA*(lpPathName: cstring): int32 {. - importc, dynlib: "kernel32", stdcall.} - proc SetEnvironmentVariableA*(lpName, lpValue: cstring): int32 {. - stdcall, dynlib: "kernel32", importc.} + proc removeDirectoryA*(lpPathName: cstring): int32 {. + importc: "RemoveDirectoryA", dynlib: "kernel32", stdcall.} + proc setEnvironmentVariableA*(lpName, lpValue: cstring): int32 {. + stdcall, dynlib: "kernel32", importc: "SetEnvironmentVariableA".} - proc GetModuleFileNameA*(handle: THandle, buf: CString, size: int32): int32 {. - importc, dynlib: "kernel32", stdcall.} + proc getModuleFileNameA*(handle: THandle, buf: CString, size: int32): int32 {. + importc: "GetModuleFileNameA", dynlib: "kernel32", stdcall.} const FILE_ATTRIBUTE_ARCHIVE* = 32'i32 @@ -228,65 +230,71 @@ type cAlternateFileName*: array[0..13, TWinChar] when useWinUnicode: - proc FindFirstFileW*(lpFileName: widecstring, + proc findFirstFileW*(lpFileName: widecstring, lpFindFileData: var TWIN32_FIND_DATA): THANDLE {. stdcall, dynlib: "kernel32", importc: "FindFirstFileW".} - proc FindNextFileW*(hFindFile: THANDLE, + proc findNextFileW*(hFindFile: THANDLE, lpFindFileData: var TWIN32_FIND_DATA): int32 {. stdcall, dynlib: "kernel32", importc: "FindNextFileW".} else: - proc FindFirstFileA*(lpFileName: cstring, + proc findFirstFileA*(lpFileName: cstring, lpFindFileData: var TWIN32_FIND_DATA): THANDLE {. stdcall, dynlib: "kernel32", importc: "FindFirstFileA".} - proc FindNextFileA*(hFindFile: THANDLE, + proc findNextFileA*(hFindFile: THANDLE, lpFindFileData: var TWIN32_FIND_DATA): int32 {. stdcall, dynlib: "kernel32", importc: "FindNextFileA".} -proc FindClose*(hFindFile: THANDLE) {.stdcall, dynlib: "kernel32", +proc findClose*(hFindFile: THANDLE) {.stdcall, dynlib: "kernel32", importc: "FindClose".} when useWinUnicode: - proc GetFullPathNameW*(lpFileName: widecstring, nBufferLength: int32, + proc getFullPathNameW*(lpFileName: widecstring, nBufferLength: int32, lpBuffer: widecstring, lpFilePart: var widecstring): int32 {. - stdcall, dynlib: "kernel32", importc.} - proc GetFileAttributesW*(lpFileName: widecstring): int32 {. - stdcall, dynlib: "kernel32", importc.} - proc SetFileAttributesW*(lpFileName: widecstring, + stdcall, dynlib: "kernel32", + importc: "GetFullPathNameW".} + proc getFileAttributesW*(lpFileName: widecstring): int32 {. + stdcall, dynlib: "kernel32", + importc: "GetFileAttributesW".} + proc setFileAttributesW*(lpFileName: widecstring, dwFileAttributes: int32): WINBOOL {. stdcall, dynlib: "kernel32", importc: "SetFileAttributesW".} - proc CopyFileW*(lpExistingFileName, lpNewFileName: wideCString, + proc copyFileW*(lpExistingFileName, lpNewFileName: wideCString, bFailIfExists: cint): cint {. - importc, stdcall, dynlib: "kernel32".} + importc: "CopyFileW", stdcall, dynlib: "kernel32".} - proc GetEnvironmentStringsW*(): widecstring {. - stdcall, dynlib: "kernel32", importc.} - proc FreeEnvironmentStringsW*(para1: widecstring): int32 {. - stdcall, dynlib: "kernel32", importc.} + proc getEnvironmentStringsW*(): widecstring {. + stdcall, dynlib: "kernel32", importc: "GetEnvironmentStringsW".} + proc freeEnvironmentStringsW*(para1: widecstring): int32 {. + stdcall, dynlib: "kernel32", importc: "FreeEnvironmentStringsW".} - proc GetCommandLineW*(): wideCString {.importc, stdcall, dynlib: "kernel32".} + proc getCommandLineW*(): wideCString {.importc: "GetCommandLineW", + stdcall, dynlib: "kernel32".} else: - proc GetFullPathNameA*(lpFileName: cstring, nBufferLength: int32, + proc getFullPathNameA*(lpFileName: cstring, nBufferLength: int32, lpBuffer: cstring, lpFilePart: var cstring): int32 {. - stdcall, dynlib: "kernel32", importc.} - proc GetFileAttributesA*(lpFileName: cstring): int32 {. - stdcall, dynlib: "kernel32", importc.} - proc SetFileAttributesA*(lpFileName: cstring, + stdcall, dynlib: "kernel32", + importc: "GetFullPathNameA".} + proc getFileAttributesA*(lpFileName: cstring): int32 {. + stdcall, dynlib: "kernel32", + importc: "GetFileAttributesA".} + proc setFileAttributesA*(lpFileName: cstring, dwFileAttributes: int32): WINBOOL {. stdcall, dynlib: "kernel32", importc: "SetFileAttributesA".} - proc CopyFileA*(lpExistingFileName, lpNewFileName: CString, + proc copyFileA*(lpExistingFileName, lpNewFileName: CString, bFailIfExists: cint): cint {. - importc, stdcall, dynlib: "kernel32".} + importc: "CopyFileA", stdcall, dynlib: "kernel32".} - proc GetEnvironmentStringsA*(): cstring {. - stdcall, dynlib: "kernel32", importc.} - proc FreeEnvironmentStringsA*(para1: cstring): int32 {. - stdcall, dynlib: "kernel32", importc.} + proc getEnvironmentStringsA*(): cstring {. + stdcall, dynlib: "kernel32", importc: "GetEnvironmentStringsA".} + proc freeEnvironmentStringsA*(para1: cstring): int32 {. + stdcall, dynlib: "kernel32", importc: "FreeEnvironmentStringsA".} - proc GetCommandLineA*(): CString {.importc, stdcall, dynlib: "kernel32".} + proc getCommandLineA*(): cstring {. + importc: "GetCommandLineA", stdcall, dynlib: "kernel32".} proc rdFileTime*(f: TFILETIME): int64 = result = ze64(f.dwLowDateTime) or (ze64(f.dwHighDateTime) shl 32) @@ -294,25 +302,25 @@ proc rdFileTime*(f: TFILETIME): int64 = proc rdFileSize*(f: TWin32FindData): int64 = result = ze64(f.nFileSizeLow) or (ze64(f.nFileSizeHigh) shl 32) -proc GetSystemTimeAsFileTime*(lpSystemTimeAsFileTime: var TFILETIME) {. +proc getSystemTimeAsFileTime*(lpSystemTimeAsFileTime: var TFILETIME) {. importc: "GetSystemTimeAsFileTime", dynlib: "kernel32", stdcall.} -proc Sleep*(dwMilliseconds: int32){.stdcall, dynlib: "kernel32", +proc sleep*(dwMilliseconds: int32){.stdcall, dynlib: "kernel32", importc: "Sleep".} when useWinUnicode: - proc ShellExecuteW*(HWND: THandle, lpOperation, lpFile, + proc shellExecuteW*(HWND: THandle, lpOperation, lpFile, lpParameters, lpDirectory: widecstring, nShowCmd: int32): THandle{. stdcall, dynlib: "shell32.dll", importc: "ShellExecuteW".} else: - proc ShellExecuteA*(HWND: THandle, lpOperation, lpFile, + proc shellExecuteA*(HWND: THandle, lpOperation, lpFile, lpParameters, lpDirectory: cstring, nShowCmd: int32): THandle{. stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".} -proc GetFileInformationByHandle*(hFile: THandle, +proc getFileInformationByHandle*(hFile: THandle, lpFileInformation: ptr TBY_HANDLE_FILE_INFORMATION): WINBOOL{. stdcall, dynlib: "kernel32", importc: "GetFileInformationByHandle".} @@ -526,7 +534,7 @@ type TWOHandleArray* = array[0..MAXIMUM_WAIT_OBJECTS - 1, THANDLE] PWOHandleArray* = ptr TWOHandleArray -proc WaitForMultipleObjects*(nCount: DWORD, lpHandles: PWOHandleArray, +proc waitForMultipleObjects*(nCount: DWORD, lpHandles: PWOHandleArray, bWaitAll: WINBOOL, dwMilliseconds: DWORD): DWORD{. stdcall, dynlib: "kernel32", importc: "WaitForMultipleObjects".} @@ -558,40 +566,40 @@ const ERROR_ACCESS_DENIED* = 5 when useWinUnicode: - proc CreateFileW*(lpFileName: widecstring, dwDesiredAccess, dwShareMode: DWORD, + proc createFileW*(lpFileName: widecstring, dwDesiredAccess, dwShareMode: DWORD, lpSecurityAttributes: pointer, dwCreationDisposition, dwFlagsAndAttributes: DWORD, hTemplateFile: THANDLE): THANDLE {. stdcall, dynlib: "kernel32", importc: "CreateFileW".} - proc DeleteFileW*(pathName: widecstring): int32 {. + proc deleteFileW*(pathName: widecstring): int32 {. importc: "DeleteFileW", dynlib: "kernel32", stdcall.} else: - proc CreateFileA*(lpFileName: cstring, dwDesiredAccess, dwShareMode: DWORD, + proc createFileA*(lpFileName: cstring, dwDesiredAccess, dwShareMode: DWORD, lpSecurityAttributes: pointer, dwCreationDisposition, dwFlagsAndAttributes: DWORD, hTemplateFile: THANDLE): THANDLE {. stdcall, dynlib: "kernel32", importc: "CreateFileA".} - proc DeleteFileA*(pathName: cstring): int32 {. + proc deleteFileA*(pathName: cstring): int32 {. importc: "DeleteFileA", dynlib: "kernel32", stdcall.} -proc SetEndOfFile*(hFile: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", +proc setEndOfFile*(hFile: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", importc: "SetEndOfFile".} -proc SetFilePointer*(hFile: THANDLE, lDistanceToMove: LONG, +proc setFilePointer*(hFile: THANDLE, lDistanceToMove: LONG, lpDistanceToMoveHigh: ptr LONG, dwMoveMethod: DWORD): DWORD {. stdcall, dynlib: "kernel32", importc: "SetFilePointer".} -proc GetFileSize*(hFile: THANDLE, lpFileSizeHigh: ptr DWORD): DWORD{.stdcall, +proc getFileSize*(hFile: THANDLE, lpFileSizeHigh: ptr DWORD): DWORD{.stdcall, dynlib: "kernel32", importc: "GetFileSize".} -proc MapViewOfFileEx*(hFileMappingObject: THANDLE, dwDesiredAccess: DWORD, +proc mapViewOfFileEx*(hFileMappingObject: THANDLE, dwDesiredAccess: DWORD, dwFileOffsetHigh, dwFileOffsetLow: DWORD, dwNumberOfBytesToMap: DWORD, lpBaseAddress: pointer): pointer{. stdcall, dynlib: "kernel32", importc: "MapViewOfFileEx".} -proc CreateFileMappingW*(hFile: THANDLE, +proc createFileMappingW*(hFile: THANDLE, lpFileMappingAttributes: pointer, flProtect, dwMaximumSizeHigh: DWORD, dwMaximumSizeLow: DWORD, @@ -599,12 +607,12 @@ proc CreateFileMappingW*(hFile: THANDLE, stdcall, dynlib: "kernel32", importc: "CreateFileMappingW".} when not useWinUnicode: - proc CreateFileMappingA*(hFile: THANDLE, + proc createFileMappingA*(hFile: THANDLE, lpFileMappingAttributes: pointer, flProtect, dwMaximumSizeHigh: DWORD, dwMaximumSizeLow: DWORD, lpName: cstring): THANDLE {. stdcall, dynlib: "kernel32", importc: "CreateFileMappingA".} -proc UnmapViewOfFile*(lpBaseAddress: pointer): WINBOOL {.stdcall, +proc unmapViewOfFile*(lpBaseAddress: pointer): WINBOOL {.stdcall, dynlib: "kernel32", importc: "UnmapViewOfFile".} diff --git a/todo.txt b/todo.txt index 5aaa15a4d9..e70e96f910 100644 --- a/todo.txt +++ b/todo.txt @@ -4,6 +4,8 @@ version 0.9.4 - document new templating symbol binding rules - convert all with "nimrod pretty" - make '--implicitStatic:on' the default +- test&finish first class iterators: + * nested iterators - special rule for ``[]=`` - ``=`` should be overloadable; requires specialization for ``=``; general @@ -11,6 +13,7 @@ version 0.9.4 - built-in 'getImpl' - optimize 'genericReset'; 'newException' leads to code bloat - stack-less GC +- fix eval in macros.nim Bugs @@ -50,8 +53,6 @@ version 0.9.x version 0.9.X ============= -- test&finish first class iterators: - * nested iterators - implement the missing features wrt inheritance - better support for macros that rewrite procs - macros need access to types and symbols (partially implemented) From a427648c48d99be292cb37b6c53bd1205414ad59 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 27 Dec 2013 16:35:21 +0100 Subject: [PATCH 152/326] case consistency part 2 --- compiler/nimconf.nim | 2 +- compiler/pretty.nim | 18 +++----- compiler/semtypinst.nim | 4 +- compiler/types.nim | 6 +-- lib/impure/dialogs.nim | 8 ++-- lib/pure/browsers.nim | 6 +-- lib/pure/os.nim | 98 ++++++++++++++++++++--------------------- lib/pure/osproc.nim | 40 ++++++++--------- lib/windows/winlean.nim | 2 +- 9 files changed, 90 insertions(+), 94 deletions(-) diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index ae6487744e..d7ce0d57fc 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -49,7 +49,7 @@ proc parseExpr(L: var TLexer, tok: var TToken): bool = var b = parseAndExpr(L, tok) result = result or b -proc EvalppIf(L: var TLexer, tok: var TToken): bool = +proc evalppIf(L: var TLexer, tok: var TToken): bool = ppGetTok(L, tok) # skip 'if' or 'elif' result = parseExpr(L, tok) if tok.tokType == tkColon: ppGetTok(L, tok) diff --git a/compiler/pretty.nim b/compiler/pretty.nim index 2955193d0e..095a132b3e 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -273,17 +273,13 @@ proc check(c: PGen, n: PNode) = nkMacroDef, nkConverterDef: checkDef(c, n[namePos]) for i in namePos+1 .. <n.len: check(c, n.sons[i]) - of nkVarSection, nkLetSection: - for i in countup(0, sonsLen(n) - 1): - let a = n.sons[i] - if a.kind == nkCommentStmt: continue - if a.kind != nkIdentDefs and a.kind != nkVarTuple: - globalError(a.info, errGenerated, "invalid ast") - checkMinSonsLen(a, 3) - let L = len(a) - for j in countup(0, L-3): checkDef(c, a.sons[j]) - check(c, a.sons[L-2]) - check(c, a.sons[L-1]) + of nkIdentDefs, nkVarTuple: + let a = n + checkMinSonsLen(a, 3) + let L = len(a) + for j in countup(0, L-3): checkDef(c, a.sons[j]) + check(c, a.sons[L-2]) + check(c, a.sons[L-1]) of nkTypeSection, nkConstSection: for i in countup(0, sonsLen(n) - 1): let a = n.sons[i] diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index c872c39f32..d51c1de8cb 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -47,11 +47,11 @@ proc searchInstTypes*(key: PType): PType = # types such as TChannel[empty]. Why? # See the notes for PActor in handleGenericInvokation return - block MatchType: + block matchType: for j in 1 .. high(key.sons): # XXX sameType is not really correct for nested generics? if not sameType(inst.sons[j], key.sons[j]): - break MatchType + break matchType return inst diff --git a/compiler/types.nim b/compiler/types.nim index be948246c0..3d040fdd5d 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -387,7 +387,7 @@ proc mutateType(t: PType, iter: TTypeMutator, closure: PObject): PType = var marker = InitIntSet() result = mutateTypeAux(marker, t, iter, closure) -proc ValueToString(a: PNode): string = +proc valueToString(a: PNode): string = case a.kind of nkCharLit..nkUInt64Lit: result = $(a.intVal) of nkFloatLit..nkFloat128Lit: result = $(a.floatVal) @@ -692,7 +692,7 @@ proc equalParams(a, b: PNode): TParamsEquality = result = paramsIncompatible # overloading by different # result types does not work -proc SameLiteral(x, y: PNode): bool = +proc sameLiteral(x, y: PNode): bool = if x.kind == y.kind: case x.kind of nkCharLit..nkInt64Lit: result = x.intVal == y.intVal @@ -700,7 +700,7 @@ proc SameLiteral(x, y: PNode): bool = of nkNilLit: result = true else: assert(false) -proc SameRanges(a, b: PNode): bool = +proc sameRanges(a, b: PNode): bool = result = SameLiteral(a.sons[0], b.sons[0]) and SameLiteral(a.sons[1], b.sons[1]) diff --git a/lib/impure/dialogs.nim b/lib/impure/dialogs.nim index 5bd7bf6f69..00ba2663e2 100644 --- a/lib/impure/dialogs.nim +++ b/lib/impure/dialogs.nim @@ -57,7 +57,7 @@ proc error*(window: PWindow, msg: string) = destroy(PWidget(dialog)) -proc ChooseFileToOpen*(window: PWindow, root: string = ""): string = +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. @@ -92,7 +92,7 @@ proc ChooseFileToOpen*(window: PWindow, root: string = ""): string = result = "" destroy(PWidget(chooser)) -proc ChooseFilesToOpen*(window: PWindow, root: string = ""): seq[string] = +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. @@ -153,7 +153,7 @@ proc ChooseFilesToOpen*(window: PWindow, root: string = ""): seq[string] = destroy(PWidget(chooser)) -proc ChooseFileToSave*(window: PWindow, root: string = ""): string = +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. @@ -190,7 +190,7 @@ proc ChooseFileToSave*(window: PWindow, root: string = ""): string = destroy(PWidget(chooser)) -proc ChooseDir*(window: PWindow, root: string = ""): string = +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. diff --git a/lib/pure/browsers.nim b/lib/pure/browsers.nim index b44f406c5e..3a8429f811 100644 --- a/lib/pure/browsers.nim +++ b/lib/pure/browsers.nim @@ -29,9 +29,9 @@ proc openDefaultBrowser*(url: string) = when useWinUnicode: var o = newWideCString("open") var u = newWideCString(url) - discard ShellExecuteW(0'i32, o, u, nil, nil, SW_SHOWNORMAL) + discard shellExecuteW(0'i32, o, u, nil, nil, SW_SHOWNORMAL) else: - discard ShellExecuteA(0'i32, "open", url, nil, nil, SW_SHOWNORMAL) + discard shellExecuteA(0'i32, "open", url, nil, nil, SW_SHOWNORMAL) elif defined(macosx): discard execShellCmd("open " & quoteShell(url)) else: @@ -45,4 +45,4 @@ proc openDefaultBrowser*(url: string) = discard startProcess(command=b, args=[url], options={poUseShell}) return except EOS: - nil + discard diff --git a/lib/pure/os.nim b/lib/pure/os.nim index f5b9ced4c1..761ed4bc45 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -177,7 +177,7 @@ const ## The character which separates the base filename from the extension; ## for example, the '.' in ``os.nim``. -proc OSErrorMsg*(): string {.rtl, extern: "nos$1", deprecated.} = +proc osErrorMsg*(): string {.rtl, extern: "nos$1", deprecated.} = ## Retrieves the operating system's error flag, ``errno``. ## On Windows ``GetLastError`` is checked before ``errno``. ## Returns "" if no error occured. @@ -204,7 +204,7 @@ proc OSErrorMsg*(): string {.rtl, extern: "nos$1", deprecated.} = result = $os.strerror(errno) {.push warning[deprecated]: off.} -proc OSError*(msg: string = "") {.noinline, rtl, extern: "nos$1", deprecated.} = +proc osError*(msg: string = "") {.noinline, rtl, extern: "nos$1", deprecated.} = ## raises an EOS exception with the given message ``msg``. ## If ``msg == ""``, the operating system's error flag ## (``errno``) is converted to a readable error message. On Windows @@ -213,7 +213,7 @@ proc OSError*(msg: string = "") {.noinline, rtl, extern: "nos$1", deprecated.} = ## ## **Deprecated since version 0.9.4**: use the other ``OSError`` proc. if len(msg) == 0: - var m = OSErrorMsg() + var m = osErrorMsg() raise newException(EOS, if m.len > 0: m else: "unknown OS error") else: raise newException(EOS, msg) @@ -222,7 +222,7 @@ proc OSError*(msg: string = "") {.noinline, rtl, extern: "nos$1", deprecated.} = proc `==`*(err1, err2: TOSErrorCode): bool {.borrow.} proc `$`*(err: TOSErrorCode): string {.borrow.} -proc OSErrorMsg*(errorCode: TOSErrorCode): string = +proc osErrorMsg*(errorCode: TOSErrorCode): string = ## Converts an OS error code into a human readable string. ## ## The error code can be retrieved using the ``OSLastError`` proc. @@ -252,7 +252,7 @@ proc OSErrorMsg*(errorCode: TOSErrorCode): string = if errorCode != TOSErrorCode(0'i32): result = $os.strerror(errorCode.int32) -proc OSError*(errorCode: TOSErrorCode) = +proc osError*(errorCode: TOSErrorCode) = ## Raises an ``EOS`` exception. The ``errorCode`` will determine the ## message, ``OSErrorMsg`` will be used to get this message. ## @@ -260,14 +260,14 @@ proc OSError*(errorCode: TOSErrorCode) = ## ## If the error code is ``0`` or an error message could not be retrieved, ## the message ``unknown OS error`` will be used. - let msg = OSErrorMsg(errorCode) + let msg = osErrorMsg(errorCode) if msg == "": raise newException(EOS, "unknown OS error") else: raise newException(EOS, msg) {.push stackTrace:off.} -proc OSLastError*(): TOSErrorCode = +proc osLastError*(): TOSErrorCode = ## Retrieves the last operating system error code. ## ## This procedure is useful in the event when an OS call fails. In that case @@ -391,12 +391,12 @@ proc getLastModificationTime*(file: string): TTime {.rtl, extern: "nos$1".} = ## Returns the `file`'s last modification time. when defined(posix): var res: TStat - if stat(file, res) < 0'i32: OSError(OSLastError()) + if stat(file, res) < 0'i32: osError(osLastError()) return res.st_mtime else: var f: TWIN32_Find_Data var h = findFirstFile(file, f) - if h == -1'i32: OSError(OSLastError()) + if h == -1'i32: osError(osLastError()) result = winTimeToUnixTime(rdFileTime(f.ftLastWriteTime)) findclose(h) @@ -404,12 +404,12 @@ proc getLastAccessTime*(file: string): TTime {.rtl, extern: "nos$1".} = ## Returns the `file`'s last read or write access time. when defined(posix): var res: TStat - if stat(file, res) < 0'i32: OSError(OSLastError()) + if stat(file, res) < 0'i32: osError(osLastError()) return res.st_atime else: var f: TWIN32_Find_Data var h = findFirstFile(file, f) - if h == -1'i32: OSError(OSLastError()) + if h == -1'i32: osError(osLastError()) result = winTimeToUnixTime(rdFileTime(f.ftLastAccessTime)) findclose(h) @@ -417,12 +417,12 @@ proc getCreationTime*(file: string): TTime {.rtl, extern: "nos$1".} = ## Returns the `file`'s creation time. when defined(posix): var res: TStat - if stat(file, res) < 0'i32: OSError(OSLastError()) + if stat(file, res) < 0'i32: osError(osLastError()) return res.st_ctime else: var f: TWIN32_Find_Data var h = findFirstFile(file, f) - if h == -1'i32: OSError(OSLastError()) + if h == -1'i32: osError(osLastError()) result = winTimeToUnixTime(rdFileTime(f.ftCreationTime)) findclose(h) @@ -438,19 +438,19 @@ proc getCurrentDir*(): string {.rtl, extern: "nos$1", tags: [].} = when useWinUnicode: var res = newWideCString("", bufsize) var L = getCurrentDirectoryW(bufsize, res) - if L == 0'i32: OSError(OSLastError()) + if L == 0'i32: osError(osLastError()) result = res$L else: result = newString(bufsize) var L = getCurrentDirectoryA(bufsize, result) - if L == 0'i32: OSError(OSLastError()) + if L == 0'i32: osError(osLastError()) setLen(result, L) else: result = newString(bufsize) if getcwd(result, bufsize) != nil: setlen(result, c_strlen(result)) else: - OSError(OSLastError()) + osError(osLastError()) proc setCurrentDir*(newDir: string) {.inline, tags: [].} = ## Sets the `current working directory`:idx:; `EOS` is raised if @@ -458,11 +458,11 @@ proc setCurrentDir*(newDir: string) {.inline, tags: [].} = when defined(Windows): when useWinUnicode: if setCurrentDirectoryW(newWideCString(newDir)) == 0'i32: - OSError(OSLastError()) + osError(osLastError()) else: - if setCurrentDirectoryA(newDir) == 0'i32: OSError(OSLastError()) + if setCurrentDirectoryA(newDir) == 0'i32: osError(osLastError()) else: - if chdir(newDir) != 0'i32: OSError(OSLastError()) + if chdir(newDir) != 0'i32: osError(osLastError()) proc joinPath*(head, tail: string): string {. noSideEffect, rtl, extern: "nos$1".} = @@ -674,19 +674,19 @@ proc expandFilename*(filename: string): string {.rtl, extern: "nos$1", var res = newWideCString("", bufsize div 2) var L = getFullPathNameW(newWideCString(filename), bufsize, res, unused) if L <= 0'i32 or L >= bufsize: - OSError(OSLastError()) + osError(osLastError()) result = res$L else: var unused: cstring result = newString(bufsize) var L = getFullPathNameA(filename, bufsize, result, unused) - if L <= 0'i32 or L >= bufsize: OSError(OSLastError()) + if L <= 0'i32 or L >= bufsize: osError(osLastError()) setLen(result, L) else: # careful, realpath needs to take an allocated buffer according to Posix: result = newString(pathMax) var r = realpath(filename, result) - if r.isNil: OSError(OSLastError()) + if r.isNil: osError(osLastError()) setlen(result, c_strlen(result)) proc changeFileExt*(filename, ext: string): string {. @@ -785,20 +785,20 @@ proc sameFile*(path1, path2: string): bool {.rtl, extern: "nos$1", fi1.nFileIndexHigh == fi2.nFileIndexHigh and fi1.nFileIndexLow == fi2.nFileIndexLow else: - lastErr = OSLastError() + lastErr = osLastError() success = false else: - lastErr = OSLastError() + lastErr = osLastError() success = false discard closeHandle(f1) discard closeHandle(f2) - if not success: OSError(lastErr) + if not success: osError(lastErr) else: var a, b: TStat if stat(path1, a) < 0'i32 or stat(path2, b) < 0'i32: - OSError(OSLastError()) + osError(osLastError()) else: result = a.st_dev == b.st_dev and a.st_ino == b.st_ino @@ -852,7 +852,7 @@ proc getFilePermissions*(filename: string): set[TFilePermission] {. ## permission is available in any case. when defined(posix): var a: TStat - if stat(filename, a) < 0'i32: OSError(OSLastError()) + if stat(filename, a) < 0'i32: osError(osLastError()) result = {} if (a.st_mode and S_IRUSR) != 0'i32: result.incl(fpUserRead) if (a.st_mode and S_IWUSR) != 0'i32: result.incl(fpUserWrite) @@ -870,7 +870,7 @@ proc getFilePermissions*(filename: string): set[TFilePermission] {. wrapUnary(res, getFileAttributesW, filename) else: var res = getFileAttributesA(filename) - if res == -1'i32: OSError(OSLastError()) + if res == -1'i32: osError(osLastError()) if (res and FILE_ATTRIBUTE_READONLY) != 0'i32: result = {fpUserExec, fpUserRead, fpGroupExec, fpGroupRead, fpOthersExec, fpOthersRead} @@ -896,13 +896,13 @@ proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. if fpOthersWrite in permissions: p = p or S_IWOTH if fpOthersExec in permissions: p = p or S_IXOTH - if chmod(filename, p) != 0: OSError(OSLastError()) + if chmod(filename, p) != 0: osError(osLastError()) else: when useWinUnicode: wrapUnary(res, getFileAttributesW, filename) else: var res = getFileAttributesA(filename) - if res == -1'i32: OSError(OSLastError()) + if res == -1'i32: osError(osLastError()) if fpUserWrite in permissions: res = res and not FILE_ATTRIBUTE_READONLY else: @@ -911,7 +911,7 @@ proc setFilePermissions*(filename: string, permissions: set[TFilePermission]) {. wrapBinary(res2, setFileAttributesW, filename, res) else: var res2 = setFileAttributesA(filename, res) - if res2 == - 1'i32: OSError(OSLastError()) + if res2 == - 1'i32: osError(osLastError()) proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", tags: [FReadIO, FWriteIO].} = @@ -928,17 +928,17 @@ proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", when useWinUnicode: let s = newWideCString(source) let d = newWideCString(dest) - if copyFileW(s, d, 0'i32) == 0'i32: OSError(OSLastError()) + if copyFileW(s, d, 0'i32) == 0'i32: osError(osLastError()) else: - if copyFileA(source, dest, 0'i32) == 0'i32: OSError(OSLastError()) + if copyFileA(source, dest, 0'i32) == 0'i32: osError(osLastError()) else: # generic version of copyFile which works for any platform: const bufSize = 8000 # better for memory manager var d, s: TFile - if not open(s, source): OSError(OSLastError()) + if not open(s, source): osError(osLastError()) if not open(d, dest, fmWrite): close(s) - OSError(OSLastError()) + osError(osLastError()) var buf = alloc(bufsize) while true: var bytesread = readBuffer(s, buf, bufsize) @@ -948,7 +948,7 @@ proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", dealloc(buf) close(s) close(d) - OSError(OSLastError()) + osError(osLastError()) if bytesread != bufSize: break dealloc(buf) close(s) @@ -988,9 +988,9 @@ proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = if deleteFile(f) == 0: if getLastError() == ERROR_ACCESS_DENIED: if setFileAttributes(f, FILE_ATTRIBUTE_NORMAL) == 0: - OSError(OSLastError()) + osError(osLastError()) if deleteFile(f) == 0: - OSError(OSLastError()) + osError(osLastError()) else: if cremove(file) != 0'i32 and errno != ENOENT: raise newException(EOS, $strerror(errno)) @@ -1125,14 +1125,14 @@ proc putEnv*(key, val: string) {.tags: [FWriteEnv].} = indx = high(environment) when defined(unix): if cputenv(environment[indx]) != 0'i32: - OSError(OSLastError()) + osError(osLastError()) else: when useWinUnicode: var k = newWideCString(key) var v = newWideCString(val) - if setEnvironmentVariableW(k, v) == 0'i32: OSError(OSLastError()) + if setEnvironmentVariableW(k, v) == 0'i32: osError(osLastError()) else: - if setEnvironmentVariableA(key, val) == 0'i32: OSError(OSLastError()) + if setEnvironmentVariableA(key, val) == 0'i32: osError(osLastError()) iterator envPairs*(): tuple[key, value: TaintedString] {.tags: [FReadEnv].} = ## Iterate over all `environments variables`:idx:. In the first component @@ -1262,12 +1262,12 @@ proc rawRemoveDir(dir: string) = wrapUnary(res, removeDirectoryW, dir) else: var res = removeDirectoryA(dir) - let lastError = OSLastError() + let lastError = osLastError() if res == 0'i32 and lastError.int32 != 3'i32 and lastError.int32 != 18'i32 and lastError.int32 != 2'i32: - OSError(lastError) + osError(lastError) else: - if rmdir(dir) != 0'i32 and errno != ENOENT: OSError(OSLastError()) + if rmdir(dir) != 0'i32 and errno != ENOENT: osError(osLastError()) proc removeDir*(dir: string) {.rtl, extern: "nos$1", tags: [ FWriteDir, FReadDir].} = @@ -1285,17 +1285,17 @@ proc removeDir*(dir: string) {.rtl, extern: "nos$1", tags: [ proc rawCreateDir(dir: string) = when defined(solaris): if mkdir(dir, 0o711) != 0'i32 and errno != EEXIST and errno != ENOSYS: - OSError(OSLastError()) + osError(osLastError()) elif defined(unix): if mkdir(dir, 0o711) != 0'i32 and errno != EEXIST: - OSError(OSLastError()) + osError(osLastError()) else: when useWinUnicode: wrapUnary(res, createDirectoryW, dir) else: var res = createDirectoryA(dir) if res == 0'i32 and getLastError() != 183'i32: - OSError(OSLastError()) + osError(osLastError()) proc createDir*(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = ## Creates the `directory`:idx: `dir`. @@ -1620,7 +1620,7 @@ proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1", when defined(windows): var a: TWin32FindData var resA = findfirstFile(file, a) - if resA == -1: OSError(OSLastError()) + if resA == -1: osError(osLastError()) result = rdFileSize(a) findclose(resA) else: @@ -1628,7 +1628,7 @@ proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1", if open(f, file): result = getFileSize(f) close(f) - else: OSError(OSLastError()) + else: osError(osLastError()) proc findExe*(exe: string): string {.tags: [FReadDir, FReadEnv].} = ## Searches for `exe` in the current working directory and then diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 605ca0f12a..1f04b79025 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -340,7 +340,7 @@ when defined(Windows) and not defined(useNimRtl): # TRUE and zero bytes returned (EOF). # TRUE and n (>0) bytes returned (good data). # FALSE and bytes returned undefined (system error). - if a == 0 and br != 0: OSError(OSLastError()) + if a == 0 and br != 0: osError(osLastError()) s.atTheEnd = br < bufLen result = br @@ -348,7 +348,7 @@ when defined(Windows) and not defined(useNimRtl): var s = PFileHandleStream(s) var bytesWritten: int32 var a = winlean.writeFile(s.handle, buffer, bufLen.cint, bytesWritten, nil) - if a == 0: OSError(OSLastError()) + if a == 0: osError(osLastError()) proc newFileHandleStream(handle: THandle): PFileHandleStream = new(result) @@ -389,7 +389,7 @@ when defined(Windows) and not defined(useNimRtl): piInheritablePipe.lpSecurityDescriptor = nil piInheritablePipe.Binherithandle = 1 if createPipe(Rdhandle, Wrhandle, piInheritablePipe, 1024) == 0'i32: - OSError(OSLastError()) + osError(osLastError()) proc fileClose(h: THandle) {.inline.} = if h > 4: discard closeHandle(h) @@ -446,7 +446,7 @@ when defined(Windows) and not defined(useNimRtl): else: success = winlean.CreateProcessA(nil, cmdl, nil, nil, 1, NORMAL_PRIORITY_CLASS, e, wd, SI, ProcInfo) - let lastError = OSLastError() + let lastError = osLastError() if poParentStreams notin options: FileClose(si.hStdInput) @@ -456,7 +456,7 @@ when defined(Windows) and not defined(useNimRtl): if e != nil: dealloc(e) dealloc(cmdl) - if success == 0: OSError(lastError) + if success == 0: osError(lastError) # Close the handle now so anyone waiting is woken: discard closeHandle(procInfo.hThread) result.FProcessHandle = procInfo.hProcess @@ -527,7 +527,7 @@ when defined(Windows) and not defined(useNimRtl): var res = winlean.CreateProcessA(nil, command, nil, nil, 0, NORMAL_PRIORITY_CLASS, nil, nil, SI, ProcInfo) if res == 0: - OSError(OSLastError()) + osError(osLastError()) else: Process = ProcInfo.hProcess discard CloseHandle(ProcInfo.hThread) @@ -550,7 +550,7 @@ when defined(Windows) and not defined(useNimRtl): of WAIT_TIMEOUT: return 0 of WAIT_FAILED: - OSError(OSLastError()) + osError(osLastError()) else: var i = ret - WAIT_OBJECT_0 readfds.del(i) @@ -608,7 +608,7 @@ elif not defined(useNimRtl): if poParentStreams notin options: if pipe(p_stdin) != 0'i32 or pipe(p_stdout) != 0'i32 or pipe(p_stderr) != 0'i32: - OSError(OSLastError()) + osError(osLastError()) var pid: TPid when defined(posix_spawn) and not defined(useFork): @@ -616,7 +616,7 @@ elif not defined(useNimRtl): var fops: Tposix_spawn_file_actions template chck(e: expr) = - if e != 0'i32: OSError(OSLastError()) + if e != 0'i32: osError(osLastError()) chck posix_spawn_file_actions_init(fops) chck posix_spawnattr_init(attr) @@ -661,20 +661,20 @@ elif not defined(useNimRtl): else: Pid = fork() - if Pid < 0: OSError(OSLastError()) + if Pid < 0: osError(osLastError()) if pid == 0: ## child process: if poParentStreams notin options: discard close(p_stdin[writeIdx]) - if dup2(p_stdin[readIdx], readIdx) < 0: OSError(OSLastError()) + if dup2(p_stdin[readIdx], readIdx) < 0: osError(osLastError()) discard close(p_stdout[readIdx]) - if dup2(p_stdout[writeIdx], writeIdx) < 0: OSError(OSLastError()) + if dup2(p_stdout[writeIdx], writeIdx) < 0: osError(osLastError()) discard close(p_stderr[readIdx]) if poStdErrToStdOut in options: - if dup2(p_stdout[writeIdx], 2) < 0: OSError(OSLastError()) + if dup2(p_stdout[writeIdx], 2) < 0: osError(osLastError()) else: - if dup2(p_stderr[writeIdx], 2) < 0: OSError(OSLastError()) + if dup2(p_stderr[writeIdx], 2) < 0: osError(osLastError()) # Create a new process group if setpgid(0, 0) == -1: quit("setpgid call failed: " & $strerror(errno)) @@ -729,10 +729,10 @@ elif not defined(useNimRtl): discard close(p.errHandle) proc suspend(p: PProcess) = - if kill(-p.id, SIGSTOP) != 0'i32: OSError(OSLastError()) + if kill(-p.id, SIGSTOP) != 0'i32: osError(osLastError()) proc resume(p: PProcess) = - if kill(-p.id, SIGCONT) != 0'i32: OSError(OSLastError()) + if kill(-p.id, SIGCONT) != 0'i32: osError(osLastError()) proc running(p: PProcess): bool = var ret = waitPid(p.id, p.exitCode, WNOHANG) @@ -742,8 +742,8 @@ elif not defined(useNimRtl): proc terminate(p: PProcess) = if kill(-p.id, SIGTERM) == 0'i32: if p.running(): - if kill(-p.id, SIGKILL) != 0'i32: OSError(OSLastError()) - else: OSError(OSLastError()) + if kill(-p.id, SIGKILL) != 0'i32: osError(osLastError()) + else: osError(osLastError()) proc waitForExit(p: PProcess, timeout: int = -1): int = #if waitPid(p.id, p.exitCode, 0) == int(p.id): @@ -753,7 +753,7 @@ elif not defined(useNimRtl): if p.exitCode != -3: return p.exitCode if waitPid(p.id, p.exitCode, 0) < 0: p.exitCode = -3 - OSError(OSLastError()) + osError(osLastError()) result = int(p.exitCode) shr 8 proc peekExitCode(p: PProcess): int = @@ -767,7 +767,7 @@ elif not defined(useNimRtl): proc createStream(stream: var PStream, handle: var TFileHandle, fileMode: TFileMode) = var f: TFile - if not open(f, handle, fileMode): OSError(OSLastError()) + if not open(f, handle, fileMode): osError(osLastError()) stream = newFileStream(f) proc inputStream(p: PProcess): PStream = diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index c2089906ad..481f61fda2 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -340,7 +340,7 @@ const WSAEWOULDBLOCK* = 10035 WSAEINPROGRESS* = 10036 -proc WSAGetLastError*(): cint {.importc: "WSAGetLastError", dynlib: ws2dll.} +proc wsaGetLastError*(): cint {.importc: "WSAGetLastError", dynlib: ws2dll.} type TSocketHandle* = distinct int From a27eb51535f9ff233b67e5bac80cc51b81c343c7 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Fri, 27 Dec 2013 18:34:28 +0200 Subject: [PATCH 153/326] towards support for composite type classes such as seq[Number] and SquareMatrix[T] --- compiler/ast.nim | 3 ++- compiler/procfind.nim | 2 +- compiler/seminst.nim | 6 +++-- compiler/semtypes.nim | 13 ++++++----- compiler/semtypinst.nim | 21 ++++++++++------- compiler/sigmatch.nim | 16 +++++++++++++ compiler/types.nim | 22 ++++++++++-------- tests/compile/tcompositetypeclasses.nim | 30 +++++++++++++++++++++++++ 8 files changed, 87 insertions(+), 26 deletions(-) create mode 100644 tests/compile/tcompositetypeclasses.nim diff --git a/compiler/ast.nim b/compiler/ast.nim index 130f5a5adc..45784bbcbf 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -340,6 +340,7 @@ type tyParametricTypeClass # structured similarly to tyGenericInst # lastSon is the body of the type class tyBuiltInTypeClass + tyCompositeTypeClass tyAnd tyOr tyNot @@ -350,7 +351,7 @@ const tyPureObject* = tyTuple GcTypeKinds* = {tyRef, tySequence, tyString} tyError* = tyProxy # as an errornous node should match everything - tyTypeClasses* = {tyTypeClass, tyBuiltInTypeClass, + tyTypeClasses* = {tyTypeClass, tyBuiltInTypeClass, tyCompositeTypeClass, tyParametricTypeClass, tyAnd, tyOr, tyNot, tyAnything} type diff --git a/compiler/procfind.nim b/compiler/procfind.nim index aefccd140f..aef1c4edc9 100644 --- a/compiler/procfind.nim +++ b/compiler/procfind.nim @@ -25,7 +25,7 @@ proc equalGenericParams(procA, procB: PNode): bool = let a = procA.sons[i].sym let b = procB.sons[i].sym if a.name.id != b.name.id or - not sameTypeOrNil(a.typ, b.typ, {TypeDescExactMatch}): return + not sameTypeOrNil(a.typ, b.typ, {ExactTypeDescValues}): return if a.ast != nil and b.ast != nil: if not ExprStructuralEquivalent(a.ast, b.ast): return result = true diff --git a/compiler/seminst.nim b/compiler/seminst.nim index a76c673dad..250e53ed6f 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -47,7 +47,7 @@ proc sameInstantiation(a, b: TInstantiation): bool = if a.concreteTypes.len == b.concreteTypes.len: for i in 0..a.concreteTypes.high: if not compareTypes(a.concreteTypes[i], b.concreteTypes[i], - flags = {TypeDescExactMatch}): return + flags = {ExactTypeDescValues}): return result = true proc GenericCacheGet(genericSym: Psym, entry: TInstantiation): PSym = @@ -165,7 +165,8 @@ proc lateInstantiateGeneric(c: PContext, invocation: PType, info: TLineInfo): PT result.sons.add instantiated cacheTypeInst result -proc instGenericContainer(c: PContext, info: TLineInfo, header: PType): PType = +proc instGenericContainer(c: PContext, info: TLineInfo, header: PType, + allowMetaTypes = false): PType = when oUseLateInstantiation: lateInstantiateGeneric(c, header, info) else: @@ -174,6 +175,7 @@ proc instGenericContainer(c: PContext, info: TLineInfo, header: PType): PType = InitIdTable(cl.typeMap) cl.info = info cl.c = c + cl.allowMetaTypes = allowMetaTypes result = ReplaceTypeVarsT(cl, header) proc instGenericContainer(c: PContext, n: PNode, header: PType): PType = diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 2016220162..d3a934c215 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -666,11 +666,14 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, paramType.sons[i] = lifted result = paramType of tyGenericBody: - # type Foo[T] = object - # proc x(a: Foo, b: Foo) - var typ = newTypeS(tyTypeClass, c) - typ.addSonSkipIntLit(paramType) - result = addImplicitGeneric(typ) + result = newTypeS(tyGenericInvokation, c) + result.rawAddSon(paramType) + for i in 0 .. paramType.sonsLen - 2: + result.rawAddSon(copyType(paramType.sons[i], getCurrOwner(), true)) + result = instGenericContainer(c, paramType.sym.info, result, + allowMetaTypes = true) + result = newTypeWithSons(c, tyCompositeTypeClass, @[paramType, result]) + result = addImplicitGeneric(result) of tyGenericInst: for i in 1 .. (paramType.sons.len - 2): var lifted = liftingWalk(paramType.sons[i]) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 69d91766b9..f7750171d6 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -50,9 +50,10 @@ proc searchInstTypes*(key: PType): PType = block MatchType: for j in 1 .. high(key.sons): # XXX sameType is not really correct for nested generics? - if not sameType(inst.sons[j], key.sons[j]): + if not compareTypes(inst.sons[j], key.sons[j], + flags = {ExactGenericParams}): break MatchType - + return inst proc cacheTypeInst*(inst: PType) = @@ -67,6 +68,8 @@ type typeMap*: TIdTable # map PType to PType symMap*: TIdTable # map PSym to PSym info*: TLineInfo + allowMetaTypes*: bool # allow types such as seq[Number] + # i.e. the result contains unresolved generics proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType proc ReplaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym @@ -132,9 +135,10 @@ proc ReplaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym = proc lookupTypeVar(cl: TReplTypeVars, t: PType): PType = result = PType(idTableGet(cl.typeMap, t)) if result == nil: + if cl.allowMetaTypes: return LocalError(t.sym.info, errCannotInstantiateX, typeToString(t)) result = errorType(cl.c) - elif result.kind == tyGenericParam: + elif result.kind == tyGenericParam and not cl.allowMetaTypes: InternalError(cl.info, "substitution with generic parameter") proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = @@ -150,11 +154,11 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = var x = t.sons[i] if x.kind == tyGenericParam: x = lookupTypeVar(cl, x) - if header == nil: header = copyType(t, t.owner, false) - header.sons[i] = x - propagateToOwner(header, x) - #idTablePut(cl.typeMap, body.sons[i-1], x) - + if x != nil: + if header == nil: header = copyType(t, t.owner, false) + header.sons[i] = x + propagateToOwner(header, x) + if header != nil: # search again after first pass: result = searchInstTypes(header) @@ -202,6 +206,7 @@ proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = of tyTypeClass: nil of tyGenericParam: result = lookupTypeVar(cl, t) + if result == nil: return t if result.kind == tyGenericInvokation: result = handleGenericInvokation(cl, result) of tyGenericInvokation: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 6a68882237..18020b95c4 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -647,6 +647,8 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = result = typeRel(c, lastSon(f), a) of tyGenericBody: + if a.kind == tyGenericInst and a.sons[0] == f: + return isGeneric let ff = lastSon(f) if ff != nil: result = typeRel(c, ff, a) @@ -718,6 +720,17 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = else: result = typeRel(c, prev, a) + of tyCompositeTypeClass: + var prev = PType(idTableGet(c.bindings, f)) + if prev == nil: + if typeRel(c, f.sons[1], a) != isNone: + put(c.bindings, f, a) + return isGeneric + else: + return isNone + else: + result = typeRel(c, prev, a) + of tyGenericParam, tyTypeClass: var x = PType(idTableGet(c.bindings, f)) if x == nil: @@ -780,10 +793,13 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = let toMatch = if tfUnresolved in f.flags: a else: a.sons[0] result = typeRel(c, prev.sons[0], toMatch) + of tyExpr, tyStmt: result = isGeneric + of tyProxy: result = isEqual + else: internalError("typeRel: " & $f.kind) proc cmpTypes*(c: PContext, f, a: PType): TTypeRelation = diff --git a/compiler/types.nim b/compiler/types.nim index f6e426f396..1b25a396c3 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -409,7 +409,7 @@ const "uint", "uint8", "uint16", "uint32", "uint64", "bignum", "const ", "!", "varargs[$1]", "iter[$1]", "Error Type", "TypeClass", - "ParametricTypeClass", "BuiltInTypeClass", + "ParametricTypeClass", "BuiltInTypeClass", "CompositeTypeClass", "and", "or", "not", "any", "static"] proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = @@ -604,8 +604,9 @@ type dcEqOrDistinctOf ## a equals b or a is distinct of b TTypeCmpFlag* = enum - IgnoreTupleFields, - TypeDescExactMatch, + IgnoreTupleFields + ExactTypeDescValues + ExactGenericParams AllowCommonBase TTypeCmpFlags* = set[TTypeCmpFlag] @@ -646,7 +647,7 @@ proc SameTypeOrNil*(a, b: PType, flags: TTypeCmpFlags = {}): bool = result = SameTypeAux(a, b, c) proc equalParam(a, b: PSym): TParamsEquality = - if SameTypeOrNil(a.typ, b.typ, {TypeDescExactMatch}) and + if SameTypeOrNil(a.typ, b.typ, {ExactTypeDescValues}) and ExprStructuralEquivalent(a.constraint, b.constraint): if a.ast == b.ast: result = paramsEqual @@ -682,7 +683,7 @@ proc equalParams(a, b: PNode): TParamsEquality = return paramsNotEqual # paramsIncompatible; # continue traversal! If not equal, we can return immediately; else # it stays incompatible - if not SameTypeOrNil(a.sons[0].typ, b.sons[0].typ, {TypeDescExactMatch}): + if not SameTypeOrNil(a.sons[0].typ, b.sons[0].typ, {ExactTypeDescValues}): if (a.sons[0].typ == nil) or (b.sons[0].typ == nil): result = paramsNotEqual # one proc has a result, the other not is OK else: @@ -749,9 +750,9 @@ template IfFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} = proc sameObjectTypes*(a, b: PType): bool = # specialized for efficiency (sigmatch uses it) - IfFastObjectTypeCheckFailed(a, b): + IfFastObjectTypeCheckFailed(a, b): var c = initSameTypeClosure() - result = sameTypeAux(a, b, c) + result = sameTypeAux(a, b, c) proc sameDistinctTypes*(a, b: PType): bool {.inline.} = result = sameObjectTypes(a, b) @@ -852,12 +853,15 @@ proc SameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = result = sameTypeAux(lastSon(a), lastSon(b), c) of tyTypeDesc: if c.cmp == dcEqIgnoreDistinct: result = false - elif TypeDescExactMatch in c.flags: + elif ExactTypeDescValues in c.flags: CycleCheck() result = sameChildrenAux(x, y, c) and sameFlags(a, b) else: result = sameFlags(a, b) - of tyGenericParam, tyGenericInvokation, tyGenericBody, tySequence, + of tyGenericParam: + result = if ExactGenericParams in c.flags: a.id == b.id + else: sameChildrenAux(a, b, c) and sameFlags(a, b) + of tyGenericInvokation, tyGenericBody, tySequence, tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr, tyArray, tyProc, tyConst, tyMutable, tyVarargs, tyIter, tyOrdinal, tyTypeClasses: diff --git a/tests/compile/tcompositetypeclasses.nim b/tests/compile/tcompositetypeclasses.nim new file mode 100644 index 0000000000..ea966f1a9d --- /dev/null +++ b/tests/compile/tcompositetypeclasses.nim @@ -0,0 +1,30 @@ +template accept(e) = + static: assert(compiles(e)) + +template reject(e) = + static: assert(not compiles(e)) + +type + TFoo[T, U] = tuple + x: T + y: U + + TBar[K] = TFoo[K, K] + + TUserClass = int|string + + # TBaz = TBar[TUserClass] + +var + vfoo: TFoo[int, string] + vbar: TFoo[string, string] + +proc foo(x: TFoo) = echo "foo" +proc bar(x: TBar) = echo "bar" +# proc baz(x: TBaz) = echo "baz" + +accept(foo(vfoo)) +accept(bar(vbar)) +# baz vbar +reject(bar(vfoo)) + From 706266d8b728b19fde6d69fd6ccdfb65ae7b6a17 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 27 Dec 2013 21:46:43 +0100 Subject: [PATCH 154/326] case consistency part 3 --- compiler/ast.nim | 8 ++++---- compiler/pretty.nim | 3 ++- lib/system.nim | 7 +++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 7199aa72d9..a511e08ce8 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1068,7 +1068,7 @@ proc newProcNode*(kind: TNodeKind, info: TLineInfo, body: PNode, pragmas, exceptions, body] -proc NewType(kind: TTypeKind, owner: PSym): PType = +proc newType(kind: TTypeKind, owner: PSym): PType = new(result) result.kind = kind result.owner = owner @@ -1161,7 +1161,7 @@ proc newSym(symKind: TSymKind, Name: PIdent, owner: PSym, result.offset = - 1 result.id = getID() when debugIds: - RegisterId(result) + registerId(result) #if result.id < 2000: # MessageOut(name.s & " has id: " & toString(result.id)) @@ -1276,7 +1276,7 @@ proc copyNode(src: PNode): PNode = of nkSym: result.sym = src.sym of nkIdent: result.ident = src.ident of nkStrLit..nkTripleStrLit: result.strVal = src.strVal - else: nil + else: discard proc shallowCopy*(src: PNode): PNode = # does not copy its sons, but provides space for them: @@ -1399,7 +1399,7 @@ proc isGenericRoutine*(s: PSym): bool = of skProcKinds: result = sfFromGeneric in s.flags or (s.ast != nil and s.ast[genericParamsPos].kind != nkEmpty) - else: nil + else: discard proc skipGenericOwner*(s: PSym): PSym = InternalAssert s.kind in skProcKinds diff --git a/compiler/pretty.nim b/compiler/pretty.nim index 095a132b3e..85b138822f 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -50,7 +50,8 @@ proc overwriteFiles*() = try: var f = open(newFile, fmWrite) for line in gSourceFiles[i].lines: - f.writeln(line.strip(leading = false, trailing = true)) + f.write line #.strip(leading = false, trailing = true) + f.write("\L") f.close except EIO: rawMessage(errCannotOpenFile, newFile) diff --git a/lib/system.nim b/lib/system.nim index 726230613e..da3fee35ae 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -159,7 +159,7 @@ 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. + 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. @@ -206,7 +206,7 @@ when not defined(JS) and not defined(NimrodVM): include "system/hti" type - Byte* = uInt8 ## this is an alias for ``uint8``, that is an unsigned + Byte* = uint8 ## this is an alias for ``uint8``, that is an unsigned ## int 8 bits wide. Natural* = range[0..high(int)] @@ -937,7 +937,6 @@ template sysAssert(cond: bool, msg: string) = if not cond: echo "[SYSASSERT] ", msg quit 1 - nil include "system/inclrtl" @@ -1376,7 +1375,7 @@ proc clamp*[T](x, a, b: T): T = if x > b: return b return x -iterator items*[T](a: openarray[T]): T {.inline.} = +iterator items*[T](a: openArray[T]): T {.inline.} = ## iterates over each item of `a`. var i = 0 while i < len(a): From 92b8fac94a7243cde785d985db3fd86b6025b079 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 27 Dec 2013 23:10:36 +0100 Subject: [PATCH 155/326] case consistency part 4 --- compiler/aliases.nim | 6 +- compiler/ast.nim | 22 +- compiler/astalgo.nim | 58 +- compiler/babelcmd.nim | 6 +- compiler/ccgcalls.nim | 4 +- compiler/ccgexprs.nim | 204 +-- compiler/ccgmerge.nim | 12 +- compiler/ccgstmts.nim | 54 +- compiler/ccgtrav.nim | 4 +- compiler/ccgtypes.nim | 70 +- compiler/ccgutils.nim | 10 +- compiler/cgen.nim | 68 +- compiler/cgendata.nim | 4 +- compiler/cgmeth.nim | 16 +- compiler/commands.nim | 92 +- compiler/condsyms.nim | 8 +- compiler/crc.nim | 8 +- compiler/depends.nim | 2 +- compiler/docgen.nim | 24 +- compiler/evaltempl.nim | 12 +- compiler/extccomp.nim | 98 +- compiler/filter_tmpl.nim | 106 +- compiler/filters.nim | 28 +- compiler/guards.nim | 6 +- compiler/hlo.nim | 4 +- compiler/idgen.nim | 6 +- compiler/importer.nim | 38 +- compiler/jsgen.nim | 80 +- compiler/jstypes.nim | 8 +- compiler/lambdalifting.nim | 48 +- compiler/lexer.nim | 122 +- compiler/lists.nim | 16 +- compiler/llstream.nim | 26 +- compiler/lookups.nim | 14 +- compiler/magicsys.nim | 14 +- compiler/main.nim | 104 +- compiler/modules.nim | 22 +- compiler/msgs.nim | 32 +- compiler/nimconf.nim | 14 +- compiler/nimlexbase.nim | 14 +- compiler/nimrod.nim | 2 +- compiler/nimsets.nim | 24 +- compiler/options.nim | 14 +- compiler/parampatterns.nim | 4 +- compiler/parser.nim | 14 +- compiler/passaux.nim | 6 +- compiler/passes.nim | 8 +- compiler/patterns.nim | 12 +- compiler/platform.nim | 8 +- compiler/pragmas.nim | 132 +- compiler/pretty.nim | 4 +- compiler/procfind.nim | 10 +- compiler/renderer.nim | 20 +- compiler/rodread.nim | 108 +- compiler/rodutils.nim | 2 +- compiler/rodwrite.nim | 52 +- compiler/ropes.nim | 14 +- compiler/saturate.nim | 12 +- compiler/sem.nim | 30 +- compiler/semcall.nim | 10 +- compiler/semdata.nim | 10 +- compiler/semdestruct.nim | 10 +- compiler/semexprs.nim | 178 +-- compiler/semfold.nim | 58 +- compiler/semgnrc.nim | 18 +- compiler/seminst.nim | 32 +- compiler/semmagic.nim | 14 +- compiler/sempass2.nim | 18 +- compiler/semstmts.nim | 152 +- compiler/semtempl.nim | 54 +- compiler/semthreads.nim | 36 +- compiler/semtypes.nim | 140 +- compiler/semtypinst.nim | 48 +- compiler/service.nim | 8 +- compiler/sigmatch.nim | 50 +- compiler/suggest.nim | 34 +- compiler/syntaxes.nim | 28 +- compiler/transf.nim | 26 +- compiler/treetab.nim | 2 +- compiler/types.nim | 94 +- compiler/vm.nim | 22 +- compiler/vmdeps.nim | 4 +- compiler/vmgen.nim | 24 +- compiler/wordrecg.nim | 4 +- lib/packages/docutils/highlite.nim | 6 +- lib/packages/docutils/rst.nim | 168 +-- lib/packages/docutils/rstast.nim | 24 +- lib/packages/docutils/rstgen.nim | 48 +- lib/pure/algorithm.nim | 4 +- lib/pure/collections/intsets.nim | 14 +- lib/pure/collections/sequtils.nim | 2 +- lib/pure/collections/tables.nim | 6 +- lib/pure/hashes.nim | 12 +- lib/pure/json.nim | 40 +- lib/pure/lexbase.nim | 4 +- lib/pure/math.nim | 8 +- lib/pure/memfiles.nim | 38 +- lib/pure/os.nim | 56 +- lib/pure/osproc.nim | 84 +- lib/pure/parseopt.nim | 6 +- lib/pure/parseutils.nim | 14 +- lib/pure/sockets.nim | 108 +- lib/pure/streams.nim | 4 +- lib/pure/strtabs.nim | 16 +- lib/pure/strutils.nim | 2212 ++++++++++++++-------------- lib/pure/times.nim | 16 +- lib/pure/unicode.nim | 40 +- lib/system.nim | 74 +- lib/system/alloc.nim | 46 +- lib/system/ansi_c.nim | 14 +- lib/system/assign.nim | 34 +- lib/system/cellsets.nim | 4 +- lib/system/chcks.nim | 2 +- lib/system/excpt.nim | 4 +- lib/system/gc.nim | 26 +- lib/system/hti.nim | 2 +- lib/system/mmdisp.nim | 2 +- lib/system/repr.nim | 28 +- lib/system/sysio.nim | 12 +- lib/system/sysstr.nim | 16 +- lib/system/widestrs.nim | 296 ++-- lib/windows/winlean.nim | 120 +- 122 files changed, 3322 insertions(+), 3322 deletions(-) diff --git a/compiler/aliases.nim b/compiler/aliases.nim index 7accb8ce30..5be7b5f124 100644 --- a/compiler/aliases.nim +++ b/compiler/aliases.nim @@ -42,7 +42,7 @@ proc isPartOfAux(n: PNode, b: PType, marker: var TIntSet): TAnalysisResult = proc isPartOfAux(a, b: PType, marker: var TIntSet): TAnalysisResult = result = arNo if a == nil or b == nil: return - if ContainsOrIncl(marker, a.id): return + if containsOrIncl(marker, a.id): return if compareTypes(a, b, dcEqIgnoreDistinct): return arYes case a.kind of tyObject: @@ -58,7 +58,7 @@ proc isPartOfAux(a, b: PType, marker: var TIntSet): TAnalysisResult = proc isPartOf(a, b: PType): TAnalysisResult = ## checks iff 'a' can be part of 'b'. Iterates over VALUE types! - var marker = InitIntSet() + var marker = initIntSet() # watch out: parameters reversed because I'm too lazy to change the code... result = isPartOfAux(b, a, marker) @@ -115,7 +115,7 @@ proc isPartOf*(a, b: PNode): TAnalysisResult = var x = if a[1].kind == nkHiddenStdConv: a[1][1] else: a[1] var y = if b[1].kind == nkHiddenStdConv: b[1][1] else: b[1] - if SameValue(x, y): result = arYes + if sameValue(x, y): result = arYes else: result = arNo # else: maybe and no are accurate else: diff --git a/compiler/ast.nim b/compiler/ast.nim index a511e08ce8..292283daf9 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -548,9 +548,9 @@ type flags*: TNodeFlags case Kind*: TNodeKind of nkCharLit..nkUInt64Lit: - intVal*: biggestInt + intVal*: BiggestInt of nkFloatLit..nkFloat128Lit: - floatVal*: biggestFloat + floatVal*: BiggestFloat of nkStrLit..nkTripleStrLit: strVal*: string of nkSym: @@ -911,7 +911,7 @@ template fileIdx*(c: PSym): int32 = template filename*(c: PSym): string = # XXX: this should be used only on module symbols - c.position.int32.toFileName + c.position.int32.toFilename proc appendToModule*(m: PSym, n: PNode) = ## The compiler will use this internally to add nodes that will be @@ -930,7 +930,7 @@ const # for all kind of hash tables: proc copyStrTable(dest: var TStrTable, src: TStrTable) = dest.counter = src.counter if isNil(src.data): return - setlen(dest.data, len(src.data)) + setLen(dest.data, len(src.data)) for i in countup(0, high(src.data)): dest.data[i] = src.data[i] proc copyIdTable(dest: var TIdTable, src: TIdTable) = @@ -942,13 +942,13 @@ proc copyIdTable(dest: var TIdTable, src: TIdTable) = proc copyTable(dest: var TTable, src: TTable) = dest.counter = src.counter if isNil(src.data): return - setlen(dest.data, len(src.data)) + setLen(dest.data, len(src.data)) for i in countup(0, high(src.data)): dest.data[i] = src.data[i] proc copyObjectSet(dest: var TObjectSet, src: TObjectSet) = dest.counter = src.counter if isNil(src.data): return - setlen(dest.data, len(src.data)) + setLen(dest.data, len(src.data)) for i in countup(0, high(src.data)): dest.data[i] = src.data[i] proc discardSons(father: PNode) = @@ -1204,7 +1204,7 @@ proc newSons(father: PType, length: int) = if isNil(father.sons): newSeq(father.sons, length) else: - setlen(father.sons, length) + setLen(father.sons, length) proc sonsLen(n: PNode): int = if isNil(n.sons): result = 0 @@ -1214,7 +1214,7 @@ proc newSons(father: PNode, length: int) = if isNil(father.sons): newSeq(father.sons, length) else: - setlen(father.sons, length) + setLen(father.sons, length) proc propagateToOwner*(owner, elem: PType) = const HaveTheirOwnEmpty = {tySequence, tySet} @@ -1257,7 +1257,7 @@ proc delSon(father: PNode, idx: int) = if isNil(father.sons): return var length = sonsLen(father) for i in countup(idx, length - 2): father.sons[i] = father.sons[i + 1] - setlen(father.sons, length - 1) + setLen(father.sons, length - 1) proc copyNode(src: PNode): PNode = # does not copy its sons! @@ -1365,14 +1365,14 @@ proc sonsNotNil(n: PNode): bool = return false result = true -proc getInt*(a: PNode): biggestInt = +proc getInt*(a: PNode): BiggestInt = case a.kind of nkIntLit..nkUInt64Lit: result = a.intVal else: internalError(a.info, "getInt") result = 0 -proc getFloat*(a: PNode): biggestFloat = +proc getFloat*(a: PNode): BiggestFloat = case a.kind of nkFloatLit..nkFloat128Lit: result = a.floatVal else: diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index b04cff5986..83218b31d3 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -165,7 +165,7 @@ proc lookupInRecord(n: PNode, field: PIdent): PSym = result = lookupInRecord(n.sons[i], field) if result != nil: return of nkRecCase: - if (n.sons[0].kind != nkSym): InternalError(n.info, "lookupInRecord") + if (n.sons[0].kind != nkSym): internalError(n.info, "lookupInRecord") result = lookupInRecord(n.sons[0], field) if result != nil: return for i in countup(1, sonsLen(n) - 1): @@ -202,7 +202,7 @@ proc spaces(x: int): PRope = # returns x spaces result = toRope(repeatChar(x)) -proc toYamlChar(c: Char): string = +proc toYamlChar(c: char): string = case c of '\0'..'\x1F', '\x80'..'\xFF': result = "\\u" & strutils.toHex(ord(c), 4) of '\'', '\"', '\\': result = '\\' & c @@ -261,7 +261,7 @@ proc strTableToYaml(n: TStrTable, marker: var TIntSet, indent: int, app(result, "]") assert(mycount == n.counter) -proc ropeConstr(indent: int, c: openarray[PRope]): PRope = +proc ropeConstr(indent: int, c: openArray[PRope]): PRope = # array of (name, value) pairs var istr = spaces(indent + 2) result = toRope("{") @@ -276,7 +276,7 @@ proc symToYamlAux(n: PSym, marker: var TIntSet, indent: int, maxRecDepth: int): PRope = if n == nil: result = toRope("null") - elif ContainsOrIncl(marker, n.id): + elif containsOrIncl(marker, n.id): result = ropef("\"$1 @$2\"", [toRope(n.name.s), toRope( strutils.toHex(cast[TAddress](n), sizeof(n) * 2))]) else: @@ -297,7 +297,7 @@ proc typeToYamlAux(n: PType, marker: var TIntSet, indent: int, maxRecDepth: int): PRope = if n == nil: result = toRope("null") - elif ContainsOrIncl(marker, n.id): + elif containsOrIncl(marker, n.id): result = ropef("\"$1 @$2\"", [toRope($n.kind), toRope( strutils.toHex(cast[TAddress](n), sizeof(n) * 2))]) else: @@ -314,7 +314,7 @@ proc typeToYamlAux(n: PType, marker: var TIntSet, indent: int, makeYamlString($n.kind), toRope("sym"), symToYamlAux(n.sym, marker, indent + 2, maxRecDepth - 1), toRope("n"), treeToYamlAux(n.n, marker, - indent + 2, maxRecDepth - 1), toRope("flags"), FlagsToStr(n.flags), + indent + 2, maxRecDepth - 1), toRope("flags"), flagsToStr(n.flags), toRope("callconv"), makeYamlString(CallingConvToStr[n.callConv]), toRope("size"), toRope(n.size), @@ -335,7 +335,7 @@ proc treeToYamlAux(n: PNode, marker: var TIntSet, indent: int, appf(result, ",$N$1\"intVal\": $2", [istr, toRope(n.intVal)]) of nkFloatLit, nkFloat32Lit, nkFloat64Lit: appf(result, ",$N$1\"floatVal\": $2", - [istr, toRope(n.floatVal.ToStrMaxPrecision)]) + [istr, toRope(n.floatVal.toStrMaxPrecision)]) of nkStrLit..nkTripleStrLit: appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)]) of nkSym: @@ -359,15 +359,15 @@ proc treeToYamlAux(n: PNode, marker: var TIntSet, indent: int, appf(result, "$N$1}", [spaces(indent)]) proc treeToYaml(n: PNode, indent: int = 0, maxRecDepth: int = - 1): PRope = - var marker = InitIntSet() + var marker = initIntSet() result = treeToYamlAux(n, marker, indent, maxRecDepth) proc typeToYaml(n: PType, indent: int = 0, maxRecDepth: int = - 1): PRope = - var marker = InitIntSet() + var marker = initIntSet() result = typeToYamlAux(n, marker, indent, maxRecDepth) proc symToYaml(n: PSym, indent: int = 0, maxRecDepth: int = - 1): PRope = - var marker = InitIntSet() + var marker = initIntSet() result = symToYamlAux(n, marker, indent, maxRecDepth) proc debugTree(n: PNode, indent: int, maxRecDepth: int): PRope @@ -405,7 +405,7 @@ proc debugTree(n: PNode, indent: int, maxRecDepth: int): PRope = appf(result, ",$N$1\"intVal\": $2", [istr, toRope(n.intVal)]) of nkFloatLit, nkFloat32Lit, nkFloat64Lit: appf(result, ",$N$1\"floatVal\": $2", - [istr, toRope(n.floatVal.ToStrMaxPrecision)]) + [istr, toRope(n.floatVal.toStrMaxPrecision)]) of nkStrLit..nkTripleStrLit: appf(result, ",$N$1\"strVal\": $2", [istr, makeYamlString(n.strVal)]) of nkSym: @@ -463,7 +463,7 @@ proc objectSetContains(t: TObjectSet, obj: PObject): bool = result = false proc objectSetRawInsert(data: var TObjectSeq, obj: PObject) = - var h: THash = HashNode(obj) and high(data) + var h: THash = hashNode(obj) and high(data) while data[h] != nil: assert(data[h] != obj) h = nextTry(h, high(data)) @@ -484,7 +484,7 @@ proc objectSetIncl(t: var TObjectSet, obj: PObject) = proc objectSetContainsOrIncl(t: var TObjectSet, obj: PObject): bool = # returns true if obj is already in the string table: - var h: THash = HashNode(obj) and high(t.data) + var h: THash = hashNode(obj) and high(t.data) while true: var it = t.data[h] if it == nil: break @@ -541,7 +541,7 @@ proc tableEnlarge(t: var TTable) = swap(t.data, n) proc tablePut(t: var TTable, key, val: PObject) = - var index = TableRawGet(t, key) + var index = tableRawGet(t, key) if index >= 0: t.data[index].val = val else: @@ -585,12 +585,12 @@ proc strTableEnlarge(t: var TStrTable) = var n: TSymSeq newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): - if t.data[i] != nil: StrTableRawInsert(n, t.data[i]) + if t.data[i] != nil: strTableRawInsert(n, t.data[i]) swap(t.data, n) proc strTableAdd(t: var TStrTable, n: PSym) = - if mustRehash(len(t.data), t.counter): StrTableEnlarge(t) - StrTableRawInsert(t.data, n) + if mustRehash(len(t.data), t.counter): strTableEnlarge(t) + strTableRawInsert(t.data, n) inc(t.counter) proc strTableIncl*(t: var TStrTable, n: PSym): bool {.discardable.} = @@ -607,8 +607,8 @@ proc strTableIncl*(t: var TStrTable, n: PSym): bool {.discardable.} = return true # found it h = nextTry(h, high(t.data)) if mustRehash(len(t.data), t.counter): - StrTableEnlarge(t) - StrTableRawInsert(t.data, n) + strTableEnlarge(t) + strTableRawInsert(t.data, n) else: assert(t.data[h] == nil) t.data[h] = n @@ -627,7 +627,7 @@ proc initIdentIter(ti: var TIdentIter, tab: TStrTable, s: PIdent): PSym = ti.h = s.h ti.name = s if tab.Counter == 0: result = nil - else: result = NextIdentIter(ti, tab) + else: result = nextIdentIter(ti, tab) proc nextIdentIter(ti: var TIdentIter, tab: TStrTable): PSym = var h, start: THash @@ -649,7 +649,7 @@ proc nextIdentExcluding*(ti: var TIdentIter, tab: TStrTable, var start = h result = tab.data[h] while result != nil: - if result.Name.id == ti.name.id and not Contains(excluding, result.id): + if result.Name.id == ti.name.id and not contains(excluding, result.id): break h = nextTry(h, high(tab.data)) if h == start: @@ -657,21 +657,21 @@ proc nextIdentExcluding*(ti: var TIdentIter, tab: TStrTable, break result = tab.data[h] ti.h = nextTry(h, high(tab.data)) - if result != nil and Contains(excluding, result.id): result = nil + if result != nil and contains(excluding, result.id): result = nil proc firstIdentExcluding*(ti: var TIdentIter, tab: TStrTable, s: PIdent, excluding: TIntSet): PSym = ti.h = s.h ti.name = s if tab.Counter == 0: result = nil - else: result = NextIdentExcluding(ti, tab, excluding) + else: result = nextIdentExcluding(ti, tab, excluding) proc initTabIter(ti: var TTabIter, tab: TStrTable): PSym = ti.h = 0 # we start by zero ... if tab.counter == 0: result = nil # FIX 1: removed endless loop else: - result = NextIter(ti, tab) + result = nextIter(ti, tab) proc nextIter(ti: var TTabIter, tab: TStrTable): PSym = result = nil @@ -736,7 +736,7 @@ proc idTablePut(t: var TIdTable, key: PIdObj, val: PObject) = var index: int n: TIdPairSeq - index = IdTableRawGet(t, key.id) + index = idTableRawGet(t, key.id) if index >= 0: assert(t.data[index].key != nil) t.data[index].val = val @@ -745,10 +745,10 @@ proc idTablePut(t: var TIdTable, key: PIdObj, val: PObject) = newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: - IdTableRawInsert(n, t.data[i].key, t.data[i].val) + idTableRawInsert(n, t.data[i].key, t.data[i].val) assert(hasEmptySlot(n)) swap(t.data, n) - IdTableRawInsert(t.data, key, val) + idTableRawInsert(t.data, key, val) inc(t.counter) iterator idTablePairs*(t: TIdTable): tuple[key: PIdObj, val: PObject] = @@ -785,7 +785,7 @@ proc idNodeTableRawInsert(data: var TIdNodePairSeq, key: PIdObj, val: PNode) = data[h].val = val proc idNodeTablePut(t: var TIdNodeTable, key: PIdObj, val: PNode) = - var index = IdNodeTableRawGet(t, key) + var index = idNodeTableRawGet(t, key) if index >= 0: assert(t.data[index].key != nil) t.data[index].val = val @@ -837,7 +837,7 @@ proc iiTableRawInsert(data: var TIIPairSeq, key, val: int) = data[h].val = val proc iiTablePut(t: var TIITable, key, val: int) = - var index = IITableRawGet(t, key) + var index = iiTableRawGet(t, key) if index >= 0: assert(t.data[index].key != InvalidKey) t.data[index].val = val diff --git a/compiler/babelcmd.nim b/compiler/babelcmd.nim index b67a260403..65a2fe5455 100644 --- a/compiler/babelcmd.nim +++ b/compiler/babelcmd.nim @@ -45,9 +45,9 @@ proc `<.`(a, b: string): bool = proc addPackage(packages: PStringTable, p: string) = let x = versionSplitPos(p) - let name = p.subStr(0, x-1) + let name = p.substr(0, x-1) if x < p.len: - let version = p.subStr(x+1) + let version = p.substr(x+1) if packages[name] <. version: packages[name] = version else: @@ -60,7 +60,7 @@ iterator chosen(packages: PStringTable): string = proc addBabelPath(p: string, info: TLineInfo) = if not contains(options.searchPaths, p): - if gVerbosity >= 1: Message(info, hintPath, p) + if gVerbosity >= 1: message(info, hintPath, p) lists.PrependStr(options.lazyPaths, p) proc addPathWithNimFiles(p: string, info: TLineInfo) = diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index 07fba95a3d..ec12501559 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -88,7 +88,7 @@ proc openArrayLoc(p: BProc, n: PNode): PRope = result = ropef("$1->data, $1->$2", [a.rdLoc, lenField()]) of tyArray, tyArrayConstr: result = ropef("$1, $2", [rdLoc(a), toRope(lengthOrd(a.t))]) - else: InternalError("openArrayLoc: " & typeToString(a.t)) + else: internalError("openArrayLoc: " & typeToString(a.t)) proc genArgStringToCString(p: BProc, n: PNode): PRope {.inline.} = @@ -243,7 +243,7 @@ proc genNamedParamCall(p: BProc, ri: PNode, d: var TLoc) = for i in countup(3, length-1): assert(sonsLen(typ) == sonsLen(typ.n)) if i >= sonsLen(typ): - InternalError(ri.info, "varargs for objective C method?") + internalError(ri.info, "varargs for objective C method?") assert(typ.n.sons[i].kind == nkSym) var param = typ.n.sons[i].sym app(pl, ~" ") diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index a9097a2641..b10d306a7d 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -22,7 +22,7 @@ proc intLiteral(i: biggestInt): PRope = else: result = ~"(IL64(-9223372036854775807) - IL64(1))" -proc int32Literal(i: Int): PRope = +proc int32Literal(i: int): PRope = if i == int(low(int32)): result = ~"(-2147483647 -1)" else: @@ -39,7 +39,7 @@ proc getStrLit(m: BModule, s: string): PRope = discard cgsym(m, "TGenericSeq") result = con("TMP", toRope(backendId())) appf(m.s[cfsData], "STRING_LITERAL($1, $2, $3);$n", - [result, makeCString(s), ToRope(len(s))]) + [result, makeCString(s), toRope(len(s))]) proc genLiteral(p: BProc, n: PNode, ty: PType): PRope = if ty == nil: internalError(n.info, "genLiteral: ty is nil") @@ -62,7 +62,7 @@ proc genLiteral(p: BProc, n: PNode, ty: PType): PRope = of nkNilLit: let t = skipTypes(ty, abstractVarRange) if t.kind == tyProc and t.callConv == ccClosure: - var id = NodeTableTestOrSet(p.module.dataCache, n, gBackendId) + var id = nodeTableTestOrSet(p.module.dataCache, n, gBackendId) result = con("TMP", toRope(id)) if id == gBackendId: # not found in cache: @@ -74,7 +74,7 @@ proc genLiteral(p: BProc, n: PNode, ty: PType): PRope = result = toRope("NIM_NIL") of nkStrLit..nkTripleStrLit: if skipTypes(ty, abstractVarRange).kind == tyString: - var id = NodeTableTestOrSet(p.module.dataCache, n, gBackendId) + var id = nodeTableTestOrSet(p.module.dataCache, n, gBackendId) if id == gBackendId: # string literal not found in the cache: result = ropecg(p.module, "((#NimStringDesc*) &$1)", @@ -84,9 +84,9 @@ proc genLiteral(p: BProc, n: PNode, ty: PType): PRope = else: result = makeCString(n.strVal) of nkFloatLit..nkFloat64Lit: - result = toRope(n.floatVal.ToStrMaxPrecision) + result = toRope(n.floatVal.toStrMaxPrecision) else: - InternalError(n.info, "genLiteral(" & $n.kind & ')') + internalError(n.info, "genLiteral(" & $n.kind & ')') result = nil proc genLiteral(p: BProc, n: PNode): PRope = @@ -96,7 +96,7 @@ proc bitSetToWord(s: TBitSet, size: int): BiggestInt = result = 0 when true: for j in countup(0, size - 1): - if j < len(s): result = result or `shl`(Ze64(s[j]), j * 8) + if j < len(s): result = result or `shl`(ze64(s[j]), j * 8) else: # not needed, too complex thinking: if CPU[platform.hostCPU].endian == CPU[targetCPU].endian: @@ -117,7 +117,7 @@ proc genRawSetData(cs: TBitSet, size: int): PRope = else: frmt = "0x$1, " else: frmt = "0x$1}$n" - appf(result, frmt, [toRope(toHex(Ze64(cs[i]), 2))]) + appf(result, frmt, [toRope(toHex(ze64(cs[i]), 2))]) else: result = intLiteral(bitSetToWord(cs, size)) # result := toRope('0x' + ToHex(bitSetToWord(cs, size), size * 2)) @@ -127,7 +127,7 @@ proc genSetNode(p: BProc, n: PNode): PRope = var size = int(getSize(n.typ)) toBitSet(n, cs) if size > 8: - var id = NodeTableTestOrSet(p.module.dataCache, n, gBackendId) + var id = nodeTableTestOrSet(p.module.dataCache, n, gBackendId) result = con("TMP", toRope(id)) if id == gBackendId: # not found in cache: @@ -155,7 +155,7 @@ proc getStorageLoc(n: PNode): TStorageLoc = of tyVar: result = OnUnknown of tyPtr: result = OnStack of tyRef: result = OnHeap - else: InternalError(n.info, "getStorageLoc") + else: internalError(n.info, "getStorageLoc") of nkBracketExpr, nkDotExpr, nkObjDownConv, nkObjUpConv: result = getStorageLoc(n.sons[0]) else: result = OnUnknown @@ -343,7 +343,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = of tyPtr, tyPointer, tyChar, tyBool, tyEnum, tyCString, tyInt..tyUInt64, tyRange, tyVar: linefmt(p, cpsStmts, "$1 = $2;$n", rdLoc(dest), rdLoc(src)) - else: InternalError("genAssignment(" & $ty.kind & ')') + else: internalError("genAssignment(" & $ty.kind & ')') proc getDestLoc(p: BProc, d: var TLoc, typ: PType) = if d.k == locNone: getTemp(p, typ, d) @@ -373,48 +373,48 @@ proc putIntoDest(p: BProc, d: var TLoc, t: PType, r: PRope) = proc binaryStmt(p: BProc, e: PNode, d: var TLoc, frmt: string) = var a, b: TLoc - if d.k != locNone: InternalError(e.info, "binaryStmt") - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + if d.k != locNone: internalError(e.info, "binaryStmt") + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) lineCg(p, cpsStmts, frmt, rdLoc(a), rdLoc(b)) proc unaryStmt(p: BProc, e: PNode, d: var TLoc, frmt: string) = var a: TLoc - if d.k != locNone: InternalError(e.info, "unaryStmt") - InitLocExpr(p, e.sons[1], a) + if d.k != locNone: internalError(e.info, "unaryStmt") + initLocExpr(p, e.sons[1], a) lineCg(p, cpsStmts, frmt, [rdLoc(a)]) proc binaryStmtChar(p: BProc, e: PNode, d: var TLoc, frmt: string) = var a, b: TLoc - if (d.k != locNone): InternalError(e.info, "binaryStmtChar") - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + if (d.k != locNone): internalError(e.info, "binaryStmtChar") + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) lineCg(p, cpsStmts, frmt, [rdCharLoc(a), rdCharLoc(b)]) proc binaryExpr(p: BProc, e: PNode, d: var TLoc, frmt: string) = var a, b: TLoc assert(e.sons[1].typ != nil) assert(e.sons[2].typ != nil) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) putIntoDest(p, d, e.typ, ropecg(p.module, frmt, [rdLoc(a), rdLoc(b)])) proc binaryExprChar(p: BProc, e: PNode, d: var TLoc, frmt: string) = var a, b: TLoc assert(e.sons[1].typ != nil) assert(e.sons[2].typ != nil) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) putIntoDest(p, d, e.typ, ropecg(p.module, frmt, [a.rdCharLoc, b.rdCharLoc])) proc unaryExpr(p: BProc, e: PNode, d: var TLoc, frmt: string) = var a: TLoc - InitLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[1], a) putIntoDest(p, d, e.typ, ropecg(p.module, frmt, [rdLoc(a)])) proc unaryExprChar(p: BProc, e: PNode, d: var TLoc, frmt: string) = var a: TLoc - InitLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[1], a) putIntoDest(p, d, e.typ, ropecg(p.module, frmt, [rdCharLoc(a)])) proc binaryArithOverflow(p: BProc, e: PNode, d: var TLoc, m: TMagic) = @@ -427,8 +427,8 @@ proc binaryArithOverflow(p: BProc, e: PNode, d: var TLoc, m: TMagic) = var a, b: TLoc assert(e.sons[1].typ != nil) assert(e.sons[2].typ != nil) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) var t = skipTypes(e.typ, abstractRange) if optOverflowCheck notin p.options: putIntoDest(p, d, e.typ, ropef("(NI$4)($2 $1 $3)", [toRope(opr[m]), @@ -460,7 +460,7 @@ proc unaryArithOverflow(p: BProc, e: PNode, d: var TLoc, m: TMagic) = a: TLoc t: PType assert(e.sons[1].typ != nil) - InitLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[1], a) t = skipTypes(e.typ, abstractRange) if optOverflowCheck in p.options: linefmt(p, cpsStmts, "if ($1 == $2) #raiseOverflow();$n", @@ -526,11 +526,11 @@ proc binaryArith(p: BProc, e: PNode, d: var TLoc, op: TMagic) = "($1 != $2)"] # Xor var a, b: TLoc - s: biggestInt + s: BiggestInt assert(e.sons[1].typ != nil) assert(e.sons[2].typ != nil) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) # BUGFIX: cannot use result-type here, as it may be a boolean s = max(getSize(a.t), getSize(b.t)) * 8 putIntoDest(p, d, e.typ, @@ -541,8 +541,8 @@ proc genEqProc(p: BProc, e: PNode, d: var TLoc) = var a, b: TLoc assert(e.sons[1].typ != nil) assert(e.sons[2].typ != nil) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) if a.t.callConv == ccClosure: putIntoDest(p, d, e.typ, ropef("($1.ClPrc == $2.ClPrc && $1.ClEnv == $2.ClEnv)", [ @@ -585,7 +585,7 @@ proc unaryArith(p: BProc, e: PNode, d: var TLoc, op: TMagic) = a: TLoc t: PType assert(e.sons[1].typ != nil) - InitLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[1], a) t = skipTypes(e.typ, abstractRange) putIntoDest(p, d, e.typ, ropef(unArithTab[op], [rdLoc(a), toRope(getSize(t) * 8), @@ -606,21 +606,21 @@ proc genDeref(p: BProc, e: PNode, d: var TLoc) = d.s = OnUnknown of tyPtr: d.s = OnUnknown # BUGFIX! - else: InternalError(e.info, "genDeref " & $a.t.kind) + else: internalError(e.info, "genDeref " & $a.t.kind) putIntoDest(p, d, a.t.sons[0], ropef("(*$1)", [rdLoc(a)])) proc genAddr(p: BProc, e: PNode, d: var TLoc) = # careful 'addr(myptrToArray)' needs to get the ampersand: if e.sons[0].typ.skipTypes(abstractInst).kind in {tyRef, tyPtr}: var a: TLoc - InitLocExpr(p, e.sons[0], a) + initLocExpr(p, e.sons[0], a) putIntoDest(p, d, e.typ, con("&", a.r)) #Message(e.info, warnUser, "HERE NEW &") elif mapType(e.sons[0].typ) == ctArray: expr(p, e.sons[0], d) else: var a: TLoc - InitLocExpr(p, e.sons[0], a) + initLocExpr(p, e.sons[0], a) putIntoDest(p, d, e.typ, addrLoc(a)) template inheritLocation(d: var TLoc, a: TLoc) = @@ -630,7 +630,7 @@ template inheritLocation(d: var TLoc, a: TLoc) = proc genRecordFieldAux(p: BProc, e: PNode, d, a: var TLoc): PType = initLocExpr(p, e.sons[0], a) - if e.sons[1].kind != nkSym: InternalError(e.info, "genRecordFieldAux") + if e.sons[1].kind != nkSym: internalError(e.info, "genRecordFieldAux") d.inheritLocation(a) discard getTypeDesc(p.module, a.t) # fill the record's fields.loc result = a.t @@ -664,13 +664,13 @@ proc genRecordField(p: BProc, e: PNode, d: var TLoc) = var field: PSym = nil while ty != nil: if ty.kind notin {tyTuple, tyObject}: - InternalError(e.info, "genRecordField") + internalError(e.info, "genRecordField") field = lookupInRecord(ty.n, f.name) if field != nil: break if gCmd != cmdCompileToCpp: app(r, ".Sup") - ty = GetUniqueType(ty.sons[0]) - if field == nil: InternalError(e.info, "genRecordField 2 ") - if field.loc.r == nil: InternalError(e.info, "genRecordField 3") + ty = getUniqueType(ty.sons[0]) + if field == nil: internalError(e.info, "genRecordField 2 ") + if field.loc.r == nil: internalError(e.info, "genRecordField 3") appf(r, ".$1", [field.loc.r]) putIntoDest(p, d, field.typ, r) @@ -686,11 +686,11 @@ proc genFieldCheck(p: BProc, e: PNode, obj: PRope, field: PSym) = if op.magic == mNot: it = it.sons[1] assert(it.sons[2].kind == nkSym) initLoc(test, locNone, it.typ, OnStack) - InitLocExpr(p, it.sons[1], u) + initLocExpr(p, it.sons[1], u) initLoc(v, locExpr, it.sons[2].typ, OnUnknown) v.r = ropef("$1.$2", [obj, it.sons[2].sym.loc.r]) genInExprAux(p, it, u, v, test) - let id = NodeTableTestOrSet(p.module.dataCache, + let id = nodeTableTestOrSet(p.module.dataCache, newStrNode(nkStrLit, field.name.s), gBackendId) let strLit = if id == gBackendId: getStrLit(p.module, field.name.s) else: con("TMP", toRope(id)) @@ -720,9 +720,9 @@ proc genCheckedRecordField(p: BProc, e: PNode, d: var TLoc) = if field != nil: break if gCmd != cmdCompileToCpp: app(r, ".Sup") ty = getUniqueType(ty.sons[0]) - if field == nil: InternalError(e.info, "genCheckedRecordField") + if field == nil: internalError(e.info, "genCheckedRecordField") if field.loc.r == nil: - InternalError(e.info, "genCheckedRecordField") # generate the checks: + internalError(e.info, "genCheckedRecordField") # generate the checks: genFieldCheck(p, e, r, field) app(r, rfmt(nil, ".$1", field.loc.r)) putIntoDest(p, d, field.typ, r) @@ -774,7 +774,7 @@ proc genOpenArrayElem(p: BProc, e: PNode, d: var TLoc) = putIntoDest(p, d, elemType(skipTypes(a.t, abstractVar)), rfmt(nil, "$1[$2]", rdLoc(a), rdCharLoc(b))) -proc genSeqElem(p: BPRoc, e: PNode, d: var TLoc) = +proc genSeqElem(p: BProc, e: PNode, d: var TLoc) = var a, b: TLoc initLocExpr(p, e.sons[0], a) initLocExpr(p, e.sons[1], b) @@ -873,11 +873,11 @@ proc genStrConcat(p: BProc, e: PNode, d: var TLoc) = # compute the length expression: initLocExpr(p, e.sons[i + 1], a) if skipTypes(e.sons[i + 1].Typ, abstractVarRange).kind == tyChar: - Inc(L) + inc(L) app(appends, rfmt(p.module, "#appendChar($1, $2);$n", tmp.r, rdLoc(a))) else: if e.sons[i + 1].kind in {nkStrLit..nkTripleStrLit}: - Inc(L, len(e.sons[i + 1].strVal)) + inc(L, len(e.sons[i + 1].strVal)) else: appf(lens, "$1->$2 + ", [rdLoc(a), lenField()]) app(appends, rfmt(p.module, "#appendString($1, $2);$n", tmp.r, rdLoc(a))) @@ -911,12 +911,12 @@ proc genStrAppend(p: BProc, e: PNode, d: var TLoc) = # compute the length expression: initLocExpr(p, e.sons[i + 2], a) if skipTypes(e.sons[i + 2].Typ, abstractVarRange).kind == tyChar: - Inc(L) + inc(L) app(appends, rfmt(p.module, "#appendChar($1, $2);$n", rdLoc(dest), rdLoc(a))) else: if e.sons[i + 2].kind in {nkStrLit..nkTripleStrLit}: - Inc(L, len(e.sons[i + 2].strVal)) + inc(L, len(e.sons[i + 2].strVal)) else: appf(lens, "$1->$2 + ", [rdLoc(a), lenField()]) app(appends, rfmt(p.module, "#appendString($1, $2);$n", @@ -935,8 +935,8 @@ proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) = else: "$1 = ($2) #incrSeq($1, sizeof($3));$n" var a, b, dest: TLoc - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) lineCg(p, cpsStmts, seqAppendPattern, [ rdLoc(a), getTypeDesc(p.module, skipTypes(e.sons[1].typ, abstractVar)), @@ -948,7 +948,7 @@ proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) = proc genReset(p: BProc, n: PNode) = var a: TLoc - InitLocExpr(p, n.sons[1], a) + initLocExpr(p, n.sons[1], a) linefmt(p, cpsStmts, "#genericReset((void*)$1, $2);$n", addrLoc(a), genTypeInfo(p.module, skipTypes(a.t, abstractVarRange))) @@ -959,8 +959,8 @@ proc rawGenNew(p: BProc, a: TLoc, sizeExpr: PRope) = initLoc(b, locExpr, a.t, OnHeap) if sizeExpr.isNil: sizeExpr = ropef("sizeof($1)", - getTypeDesc(p.module, skipTypes(reftype.sons[0], abstractRange))) - let args = [getTypeDesc(p.module, reftype), + getTypeDesc(p.module, skipTypes(refType.sons[0], abstractRange))) + let args = [getTypeDesc(p.module, refType), genTypeInfo(p.module, refType), sizeExpr] if a.s == OnHeap and usesNativeGC(): @@ -979,11 +979,11 @@ proc rawGenNew(p: BProc, a: TLoc, sizeExpr: PRope) = proc genNew(p: BProc, e: PNode) = var a: TLoc - InitLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[1], a) # 'genNew' also handles 'unsafeNew': if e.len == 3: var se: TLoc - InitLocExpr(p, e.sons[2], se) + initLocExpr(p, e.sons[2], se) rawGenNew(p, a, se.rdLoc) else: rawGenNew(p, a, nil) @@ -991,7 +991,7 @@ proc genNew(p: BProc, e: PNode) = proc genNewSeqAux(p: BProc, dest: TLoc, length: PRope) = let seqtype = skipTypes(dest.t, abstractVarRange) let args = [getTypeDesc(p.module, seqtype), - genTypeInfo(p.module, seqType), length] + genTypeInfo(p.module, seqtype), length] var call: TLoc initLoc(call, locExpr, dest.t, OnHeap) if dest.s == OnHeap and usesNativeGC(): @@ -1007,8 +1007,8 @@ proc genNewSeqAux(p: BProc, dest: TLoc, length: PRope) = proc genNewSeq(p: BProc, e: PNode) = var a, b: TLoc - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) genNewSeqAux(p, a, b.rdLoc) proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = @@ -1032,8 +1032,8 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = field = lookupInRecord(ty.n, it.sons[0].sym.name) if field != nil: break if gCmd != cmdCompileToCpp: app(tmp2.r, ".Sup") - ty = GetUniqueType(ty.sons[0]) - if field == nil or field.loc.r == nil: InternalError(e.info, "genObjConstr") + ty = getUniqueType(ty.sons[0]) + if field == nil or field.loc.r == nil: internalError(e.info, "genObjConstr") if it.len == 3 and optFieldCheck in p.options: genFieldCheck(p, it.sons[2], r, field) app(tmp2.r, ".") @@ -1088,14 +1088,14 @@ proc genNewFinalize(p: BProc, e: PNode) = ti: PRope oldModule: BModule refType = skipTypes(e.sons[1].typ, abstractVarRange) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], f) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], f) initLoc(b, locExpr, a.t, OnHeap) ti = genTypeInfo(p.module, refType) appf(p.module.s[cfsTypeInit3], "$1->finalizer = (void*)$2;$n", [ti, rdLoc(f)]) b.r = ropecg(p.module, "($1) #newObj($2, sizeof($3))", [ getTypeDesc(p.module, refType), - ti, getTypeDesc(p.module, skipTypes(reftype.sons[0], abstractRange))]) + ti, getTypeDesc(p.module, skipTypes(refType.sons[0], abstractRange))]) genAssignment(p, a, b, {needToKeepAlive}) # set the object type: bt = skipTypes(refType.sons[0], abstractRange) genObjectInit(p, cpsStmts, bt, a, false) @@ -1116,7 +1116,7 @@ proc genOf(p: BProc, x: PNode, typ: PType, d: var TLoc) = app(r, ~".Sup") t = skipTypes(t.sons[0], typedescInst) if isObjLackingTypeField(t): - GlobalError(x.info, errGenerated, + globalError(x.info, errGenerated, "no 'of' operator available for pure objects") if nilCheck != nil: r = rfmt(p.module, "(($1) && #isObj($2.m_type, $3))", @@ -1132,7 +1132,7 @@ proc genOf(p: BProc, n: PNode, d: var TLoc) = proc genRepr(p: BProc, e: PNode, d: var TLoc) = # XXX we don't generate keep alive info for now here var a: TLoc - InitLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[1], a) var t = skipTypes(e.sons[1].typ, abstractVarRange) case t.kind of tyInt..tyInt64, tyUInt..tyUInt64: @@ -1164,7 +1164,7 @@ proc genRepr(p: BProc, e: PNode, d: var TLoc) = of tyArray, tyArrayConstr: putIntoDest(p, b, e.typ, ropef("$1, $2", [rdLoc(a), toRope(lengthOrd(a.t))])) - else: InternalError(e.sons[0].info, "genRepr()") + else: internalError(e.sons[0].info, "genRepr()") putIntoDest(p, d, e.typ, ropecg(p.module, "#reprOpenArray($1, $2)", [rdLoc(b), genTypeInfo(p.module, elemType(t))])) @@ -1183,7 +1183,7 @@ proc genGetTypeInfo(p: BProc, e: PNode, d: var TLoc) = proc genDollar(p: BProc, n: PNode, d: var TLoc, frmt: string) = var a: TLoc - InitLocExpr(p, n.sons[1], a) + initLocExpr(p, n.sons[1], a) a.r = ropecg(p.module, frmt, [rdLoc(a)]) if d.k == locNone: getTemp(p, n.typ, d) genAssignment(p, d, a, {needToKeepAlive}) @@ -1208,15 +1208,15 @@ proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) = else: unaryExpr(p, e, d, "$1->len") of tyArray, tyArrayConstr: # YYY: length(sideeffect) is optimized away incorrectly? - if op == mHigh: putIntoDest(p, d, e.typ, toRope(lastOrd(Typ))) + if op == mHigh: putIntoDest(p, d, e.typ, toRope(lastOrd(typ))) else: putIntoDest(p, d, e.typ, toRope(lengthOrd(typ))) - else: InternalError(e.info, "genArrayLen()") + else: internalError(e.info, "genArrayLen()") proc genSetLengthSeq(p: BProc, e: PNode, d: var TLoc) = var a, b: TLoc assert(d.k == locNone) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) var t = skipTypes(e.sons[1].typ, abstractVar) let setLenPattern = if gCmd != cmdCompileToCpp: "$1 = ($3) #setLengthSeq(&($1)->Sup, sizeof($4), $2);$n" @@ -1230,7 +1230,7 @@ proc genSetLengthSeq(p: BProc, e: PNode, d: var TLoc) = proc genSetLengthStr(p: BProc, e: PNode, d: var TLoc) = binaryStmt(p, e, d, "$1 = #setLengthStr($1, $2);$n") - keepAlive(P, d) + keepAlive(p, d) proc genSwap(p: BProc, e: PNode, d: var TLoc) = # swap(a, b) --> @@ -1239,8 +1239,8 @@ proc genSwap(p: BProc, e: PNode, d: var TLoc) = # b = temp var a, b, tmp: TLoc getTemp(p, skipTypes(e.sons[1].typ, abstractVar), tmp) - InitLocExpr(p, e.sons[1], a) # eval a - InitLocExpr(p, e.sons[2], b) # eval b + initLocExpr(p, e.sons[1], a) # eval a + initLocExpr(p, e.sons[2], b) # eval b genAssignment(p, tmp, a, {}) genAssignment(p, a, b, {}) genAssignment(p, b, tmp, {}) @@ -1256,7 +1256,7 @@ proc rdSetElemLoc(a: TLoc, setType: PType): PRope = proc fewCmps(s: PNode): bool = # this function estimates whether it is better to emit code # for constructing the set or generating a bunch of comparisons directly - if s.kind != nkCurly: InternalError(s.info, "fewCmps") + if s.kind != nkCurly: internalError(s.info, "fewCmps") if (getSize(s.typ) <= platform.intSize) and (nfAllConst in s.flags): result = false # it is better to emit the set generation code elif elemType(s.typ).Kind in {tyInt, tyInt16..tyInt64}: @@ -1278,8 +1278,8 @@ proc genInExprAux(p: BProc, e: PNode, a, b, d: var TLoc) = proc binaryStmtInExcl(p: BProc, e: PNode, d: var TLoc, frmt: string) = var a, b: TLoc assert(d.k == locNone) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) lineF(p, cpsStmts, frmt, [rdLoc(a), rdSetElemLoc(b, a.t)]) proc genInOp(p: BProc, e: PNode, d: var TLoc) = @@ -1299,12 +1299,12 @@ proc genInOp(p: BProc, e: PNode, d: var TLoc) = var length = sonsLen(e.sons[1]) for i in countup(0, length - 1): if e.sons[1].sons[i].Kind == nkRange: - InitLocExpr(p, e.sons[1].sons[i].sons[0], x) - InitLocExpr(p, e.sons[1].sons[i].sons[1], y) + initLocExpr(p, e.sons[1].sons[i].sons[0], x) + initLocExpr(p, e.sons[1].sons[i].sons[1], y) appf(b.r, "$1 >= $2 && $1 <= $3", [rdCharLoc(a), rdCharLoc(x), rdCharLoc(y)]) else: - InitLocExpr(p, e.sons[1].sons[i], x) + initLocExpr(p, e.sons[1].sons[i], x) appf(b.r, "$1 == $2", [rdCharLoc(a), rdCharLoc(x)]) if i < length - 1: app(b.r, " || ") app(b.r, ")") @@ -1312,8 +1312,8 @@ proc genInOp(p: BProc, e: PNode, d: var TLoc) = else: assert(e.sons[1].typ != nil) assert(e.sons[2].typ != nil) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) genInExprAux(p, e, a, b, d) proc genSetOp(p: BProc, e: PNode, d: var TLoc, op: TMagic) = @@ -1391,7 +1391,7 @@ proc genSomeCast(p: BProc, e: PNode, d: var TLoc) = # we use whatever C gives us. Except if we have a value-type, we need to go # through its address: var a: TLoc - InitLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[1], a) let etyp = skipTypes(e.typ, abstractRange) if etyp.kind in ValueTypes and lfIndirect notin a.flags: putIntoDest(p, d, e.typ, ropef("(*($1*) ($2))", @@ -1433,13 +1433,13 @@ proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) = var dest = skipTypes(n.typ, abstractVar) # range checks for unsigned turned out to be buggy and annoying: if optRangeCheck notin p.options or dest.kind in {tyUInt..tyUInt64}: - InitLocExpr(p, n.sons[0], a) + initLocExpr(p, n.sons[0], a) putIntoDest(p, d, n.typ, ropef("(($1) ($2))", [getTypeDesc(p.module, dest), rdCharLoc(a)])) else: - InitLocExpr(p, n.sons[0], a) + initLocExpr(p, n.sons[0], a) if leValue(n.sons[2], n.sons[1]): - InternalError(n.info, "range check will always fail; empty range") + internalError(n.info, "range check will always fail; empty range") putIntoDest(p, d, dest, ropecg(p.module, "(($1)#$5($2, $3, $4))", [ getTypeDesc(p.module, dest), rdCharLoc(a), genLiteral(p, n.sons[1], dest), genLiteral(p, n.sons[2], dest), @@ -1486,8 +1486,8 @@ proc binaryFloatArith(p: BProc, e: PNode, d: var TLoc, m: TMagic) = var a, b: TLoc assert(e.sons[1].typ != nil) assert(e.sons[2].typ != nil) - InitLocExpr(p, e.sons[1], a) - InitLocExpr(p, e.sons[2], b) + initLocExpr(p, e.sons[1], a) + initLocExpr(p, e.sons[2], b) putIntoDest(p, d, e.typ, rfmt(nil, "(($4)($2) $1 ($4)($3))", toRope(opr[m]), rdLoc(a), rdLoc(b), getSimpleTypeDesc(p.module, e[1].typ))) @@ -1593,7 +1593,7 @@ proc handleConstExpr(p: BProc, n: PNode, d: var TLoc): bool = if (nfAllConst in n.flags) and (d.k == locNone) and (sonsLen(n) > 0): var t = getUniqueType(n.typ) discard getTypeDesc(p.module, t) # so that any fields are initialized - var id = NodeTableTestOrSet(p.module.dataCache, n, gBackendId) + var id = nodeTableTestOrSet(p.module.dataCache, n, gBackendId) fillLoc(d, locData, t, con("TMP", toRope(id)), OnHeap) if id == gBackendId: # expression not found in the cache: @@ -1760,7 +1760,7 @@ proc downConv(p: BProc, n: PNode, d: var TLoc) = proc exprComplexConst(p: BProc, n: PNode, d: var TLoc) = var t = getUniqueType(n.typ) discard getTypeDesc(p.module, t) # so that any fields are initialized - var id = NodeTableTestOrSet(p.module.dataCache, n, gBackendId) + var id = nodeTableTestOrSet(p.module.dataCache, n, gBackendId) var tmp = con("TMP", toRope(id)) if id == gBackendId: @@ -1790,7 +1790,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = of skProc, skConverter, skIterator: genProc(p.module, sym) if sym.loc.r == nil or sym.loc.t == nil: - InternalError(n.info, "expr: proc not init " & sym.name.s) + internalError(n.info, "expr: proc not init " & sym.name.s) putLocIntoDest(p, d, sym.loc) of skConst: if sfFakeConst in sym.flags: @@ -1805,9 +1805,9 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = of skVar, skForVar, skResult, skLet: if sfGlobal in sym.flags: genVarPrototype(p.module, sym) if sym.loc.r == nil or sym.loc.t == nil: - InternalError(n.info, "expr: var not init " & sym.name.s) + internalError(n.info, "expr: var not init " & sym.name.s) if sfThread in sym.flags: - AccessThreadLocalVar(p, sym) + accessThreadLocalVar(p, sym) if emulatedThreadVars(): putIntoDest(p, d, sym.loc.t, con("NimTV->", sym.loc.r)) else: @@ -1816,13 +1816,13 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = putLocIntoDest(p, d, sym.loc) of skTemp: if sym.loc.r == nil or sym.loc.t == nil: - InternalError(n.info, "expr: temp not init " & sym.name.s) + internalError(n.info, "expr: temp not init " & sym.name.s) putLocIntoDest(p, d, sym.loc) of skParam: if sym.loc.r == nil or sym.loc.t == nil: - InternalError(n.info, "expr: param not init " & sym.name.s) + internalError(n.info, "expr: param not init " & sym.name.s) putLocIntoDest(p, d, sym.loc) - else: InternalError(n.info, "expr(" & $sym.kind & "); unknown symbol") + else: internalError(n.info, "expr(" & $sym.kind & "); unknown symbol") of nkNilLit: if not isEmptyType(n.typ): putIntoDest(p, d, n.typ, genLiteral(p, n)) @@ -1876,7 +1876,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = of tySequence, tyString: genSeqElem(p, n, d) of tyCString: genCStringElem(p, n, d) of tyTuple: genTupleElem(p, n, d) - else: InternalError(n.info, "expr(nkBracketExpr, " & $ty.kind & ')') + else: internalError(n.info, "expr(nkBracketExpr, " & $ty.kind & ')') of nkDerefExpr, nkHiddenDeref: genDeref(p, n, d) of nkDotExpr: genRecordField(p, n, d) of nkCheckedFieldExpr: genCheckedRecordField(p, n, d) @@ -1896,7 +1896,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = var sym = n.sons[namePos].sym genProc(p.module, sym) if sym.loc.r == nil or sym.loc.t == nil: - InternalError(n.info, "expr: proc not init " & sym.name.s) + internalError(n.info, "expr: proc not init " & sym.name.s) putLocIntoDest(p, d, sym.loc) of nkClosure: genClosure(p, n, d) of nkMetaNode: expr(p, n.sons[0], d) @@ -1952,7 +1952,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = of nkState: genState(p, n) of nkGotoState: genGotoState(p, n) of nkBreakState: genBreakState(p, n) - else: InternalError(n.info, "expr(" & $n.kind & "); unknown node kind") + else: internalError(n.info, "expr(" & $n.kind & "); unknown node kind") proc genNamedConstExpr(p: BProc, n: PNode): PRope = if n.kind == nkExprColonExpr: result = genConstExpr(p, n.sons[1]) diff --git a/compiler/ccgmerge.nim b/compiler/ccgmerge.nim index de207c532b..0ea30bd04a 100644 --- a/compiler/ccgmerge.nim +++ b/compiler/ccgmerge.nim @@ -187,7 +187,7 @@ proc readVerbatimSection(L: var TBaseLexer): PRope = buf = L.buf r.add(tnl) of '\0': - InternalError("ccgmerge: expected: " & NimMergeEndMark) + internalError("ccgmerge: expected: " & NimMergeEndMark) break else: if atEndMark(buf, pos): @@ -224,7 +224,7 @@ proc readTypeCache(L: var TBaseLexer, result: var TIdTable) = # XXX little hack: we create a "fake" type object with the correct Id # better would be to adapt the data structure to not even store the # object as key, but only the Id - IdTablePut(result, newFakeType(key), value.toRope) + idTablePut(result, newFakeType(key), value.toRope) inc L.bufpos proc readIntSet(L: var TBaseLexer, result: var TIntSet) = @@ -250,13 +250,13 @@ proc processMergeInfo(L: var TBaseLexer, m: BModule) = of "typeInfo": readIntSet(L, m.typeInfoMarker) of "labels": m.labels = decodeVInt(L.buf, L.bufpos) of "hasframe": m.FrameDeclared = decodeVInt(L.buf, L.bufpos) != 0 - else: InternalError("ccgmerge: unkown key: " & k) + else: internalError("ccgmerge: unkown key: " & k) when not defined(nimhygiene): {.pragma: inject.} template withCFile(cfilename: string, body: stmt) {.immediate.} = - var s = LLStreamOpen(cfilename, fmRead) + var s = llStreamOpen(cfilename, fmRead) if s == nil: return var L {.inject.}: TBaseLexer openBaseLexer(L, s) @@ -300,9 +300,9 @@ proc readMergeSections(cfilename: string, m: var TMergeSections) = if sectionB >= 0 and sectionB <= high(TCProcSection).int: m.p[TCProcSection(sectionB)] = verbatim else: - InternalError("ccgmerge: unknown section: " & k) + internalError("ccgmerge: unknown section: " & k) else: - InternalError("ccgmerge: '*/' expected") + internalError("ccgmerge: '*/' expected") proc mergeRequired*(m: BModule): bool = for i in cfsHeaders..cfsProcs: diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 9b56556fc1..eb738b5742 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -16,7 +16,7 @@ const # above X strings a hash-switch for strings is generated proc registerGcRoot(p: BProc, v: PSym) = - if gSelectedGc in {gcMarkAndSweep, gcGenerational} and + if gSelectedGC in {gcMarkAndSweep, gcGenerational} and containsGarbageCollectedRef(v.loc.t): # we register a specialized marked proc here; this has the advantage # that it works out of the box for thread local storage then :-) @@ -26,7 +26,7 @@ proc registerGcRoot(p: BProc, v: PSym) = proc genVarTuple(p: BProc, n: PNode) = var tup, field: TLoc - if n.kind != nkVarTuple: InternalError(n.info, "genVarTuple") + if n.kind != nkVarTuple: internalError(n.info, "genVarTuple") var L = sonsLen(n) genLineDir(p, n) initLocExpr(p, n.sons[L-1], tup) @@ -45,7 +45,7 @@ proc genVarTuple(p: BProc, n: PNode) = if t.kind == tyTuple: field.r = ropef("$1.Field$2", [rdLoc(tup), toRope(i)]) else: - if t.n.sons[i].kind != nkSym: InternalError(n.info, "genVarTuple") + if t.n.sons[i].kind != nkSym: internalError(n.info, "genVarTuple") field.r = ropef("$1.$2", [rdLoc(tup), mangleRecFieldName(t.n.sons[i].sym, t)]) putLocIntoDest(p, v.loc, field) @@ -62,7 +62,7 @@ proc startBlock(p: BProc, start: TFormatStr = "{$n", lineCg(p, cpsStmts, start, args) inc(p.labels) result = len(p.blocks) - setlen(p.blocks, result + 1) + setLen(p.blocks, result + 1) p.blocks[result].id = p.labels p.blocks[result].nestedTryStmts = p.nestedTryStmts.len.int16 @@ -81,7 +81,7 @@ proc endBlock(p: BProc, blockEnd: PRope) = let topBlock = p.blocks.len-1 # the block is merged into the parent block app(p.blocks[topBlock-1].sections[cpsStmts], p.blocks[topBlock].blockBody) - setlen(p.blocks, topBlock) + setLen(p.blocks, topBlock) # this is done after the block is popped so $n is # properly indented when pretty printing is enabled line(p, cpsStmts, blockEnd) @@ -200,7 +200,7 @@ proc genConstStmt(p: BProc, t: PNode) = for i in countup(0, sonsLen(t) - 1): var it = t.sons[i] if it.kind == nkCommentStmt: continue - if it.kind != nkConstDef: InternalError(t.info, "genConstStmt") + if it.kind != nkConstDef: internalError(t.info, "genConstStmt") var c = it.sons[0].sym if c.typ.containsCompileTimeOnly: continue if sfFakeConst in c.flags: @@ -242,17 +242,17 @@ proc genIf(p: BProc, n: PNode, d: var TLoc) = if it.len == 2: when newScopeForIf: startBlock(p) initLocExpr(p, it.sons[0], a) - Lelse = getLabel(p) + lelse = getLabel(p) inc(p.labels) lineFF(p, cpsStmts, "if (!$1) goto $2;$n", "br i1 $1, label %LOC$3, label %$2$nLOC$3: $n", - [rdLoc(a), Lelse, toRope(p.labels)]) + [rdLoc(a), lelse, toRope(p.labels)]) when not newScopeForIf: startBlock(p) expr(p, it.sons[1], d) endBlock(p) if sonsLen(n) > 1: lineFF(p, cpsStmts, "goto $1;$n", "br label %$1$n", [lend]) - fixLabel(p, Lelse) + fixLabel(p, lelse) elif it.len == 1: startBlock(p) expr(p, it.sons[0], d) @@ -296,7 +296,7 @@ proc genReturnStmt(p: BProc, t: PNode) = proc genComputedGoto(p: BProc; n: PNode) = # first pass: Generate array of computed labels: var casePos = -1 - var arraySize: Int + var arraySize: int for i in 0 .. <n.len: let it = n.sons[i] if it.kind == nkCaseStmt: @@ -381,7 +381,7 @@ proc genWhileStmt(p: BProc, t: PNode) = lineF(p, cpsStmts, "if (!$1) goto $2;$n", [rdLoc(a), label]) var loopBody = t.sons[1] if loopBody.stmtsContainPragma(wComputedGoto) and - hasComputedGoto in CC[ccompiler].props: + hasComputedGoto in CC[cCompiler].props: # for closure support weird loop bodies are generated: if loopBody.len == 2 and loopBody.sons[0].kind == nkEmpty: loopBody = loopBody.sons[1] @@ -416,7 +416,7 @@ proc genParForStmt(p: BProc, t: PNode) = preserveBreakIdx: let forLoopVar = t.sons[0].sym var rangeA, rangeB: TLoc - assignLocalVar(P, forLoopVar) + assignLocalVar(p, forLoopVar) #initLoc(forLoopVar.loc, locLocalVar, forLoopVar.typ, onStack) #discard mangleName(forLoopVar) let call = t.sons[1] @@ -448,7 +448,7 @@ proc genBreakStmt(p: BProc, t: PNode) = # an unnamed 'break' can only break a loop after 'transf' pass: while idx >= 0 and not p.blocks[idx].isLoop: dec idx if idx < 0 or not p.blocks[idx].isLoop: - InternalError(t.info, "no loop to break") + internalError(t.info, "no loop to break") let label = assignLabel(p.blocks[idx]) blockLeaveActions(p, p.nestedTryStmts.len - p.blocks[idx].nestedTryStmts) genLineDir(p, t) @@ -469,7 +469,7 @@ proc genRaiseStmt(p: BProc, t: PNode) = genSimpleBlock(p, finallyBlock.sons[0]) if t.sons[0].kind != nkEmpty: var a: TLoc - InitLocExpr(p, t.sons[0], a) + initLocExpr(p, t.sons[0], a) var e = rdLoc(a) var typ = skipTypes(t.sons[0].typ, abstractPtrs) genLineDir(p, t) @@ -598,7 +598,7 @@ proc ifSwitchSplitPoint(p: BProc, n: PNode): int = var stmtBlock = lastSon(branch) if stmtBlock.stmtsContainPragma(wLinearScanEnd): result = i - elif hasSwitchRange notin CC[ccompiler].props: + elif hasSwitchRange notin CC[cCompiler].props: if branch.kind == nkOfBranch and branchHasTooBigRange(branch): result = i @@ -606,7 +606,7 @@ proc genCaseRange(p: BProc, branch: PNode) = var length = branch.len for j in 0 .. length-2: if branch[j].kind == nkRange: - if hasSwitchRange in CC[ccompiler].props: + if hasSwitchRange in CC[cCompiler].props: lineF(p, cpsStmts, "case $1 ... $2:$n", [ genLiteral(p, branch[j][0]), genLiteral(p, branch[j][1])]) @@ -614,13 +614,13 @@ proc genCaseRange(p: BProc, branch: PNode) = var v = copyNode(branch[j][0]) while v.intVal <= branch[j][1].intVal: lineF(p, cpsStmts, "case $1:$n", [genLiteral(p, v)]) - Inc(v.intVal) + inc(v.intVal) else: lineF(p, cpsStmts, "case $1:$n", [genLiteral(p, branch[j])]) proc genOrdinalCase(p: BProc, n: PNode, d: var TLoc) = # analyse 'case' statement: - var splitPoint = IfSwitchSplitPoint(p, n) + var splitPoint = ifSwitchSplitPoint(p, n) # generate if part (might be empty): var a: TLoc @@ -644,7 +644,7 @@ proc genOrdinalCase(p: BProc, n: PNode, d: var TLoc) = hasDefault = true exprBlock(p, branch.lastSon, d) lineF(p, cpsStmts, "break;$n") - if (hasAssume in CC[ccompiler].props) and not hasDefault: + if (hasAssume in CC[cCompiler].props) and not hasDefault: lineF(p, cpsStmts, "default: __assume(0);$n") lineF(p, cpsStmts, "}$n") if lend != nil: fixLabel(p, lend) @@ -850,9 +850,9 @@ proc genAsmOrEmitStmt(p: BProc, t: PNode, isAsmStmt=false): PRope = r = mangleName(sym) sym.loc.r = r # but be consequent! res.add(r.ropeToStr) - else: InternalError(t.sons[i].info, "genAsmOrEmitStmt()") + else: internalError(t.sons[i].info, "genAsmOrEmitStmt()") - if isAsmStmt and hasGnuAsm in CC[ccompiler].props: + if isAsmStmt and hasGnuAsm in CC[cCompiler].props: for x in splitLines(res): var j = 0 while x[j] in {' ', '\t'}: inc(j) @@ -873,9 +873,9 @@ proc genAsmStmt(p: BProc, t: PNode) = var s = genAsmOrEmitStmt(p, t, isAsmStmt=true) if p.prc == nil: # top level asm statement? - appf(p.module.s[cfsProcHeaders], CC[ccompiler].asmStmtFrmt, [s]) + appf(p.module.s[cfsProcHeaders], CC[cCompiler].asmStmtFrmt, [s]) else: - lineF(p, cpsStmts, CC[ccompiler].asmStmtFrmt, [s]) + lineF(p, cpsStmts, CC[cCompiler].asmStmtFrmt, [s]) proc genEmit(p: BProc, t: PNode) = genLineDir(p, t) @@ -944,7 +944,7 @@ proc genDiscriminantCheck(p: BProc, a, tmp: TLoc, objtype: PType, assert t.kind == tyObject discard genTypeInfo(p.module, t) var L = lengthOrd(field.typ) - if not ContainsOrIncl(p.module.declaredThings, field.id): + if not containsOrIncl(p.module.declaredThings, field.id): appcg(p.module, cfsVars, "extern $1", discriminatorTableDecl(p.module, t, field)) lineCg(p, cpsStmts, @@ -957,7 +957,7 @@ proc asgnFieldDiscriminant(p: BProc, e: PNode) = var dotExpr = e.sons[0] var d: PSym if dotExpr.kind == nkCheckedFieldExpr: dotExpr = dotExpr.sons[0] - InitLocExpr(p, e.sons[0], a) + initLocExpr(p, e.sons[0], a) getTemp(p, a.t, tmp) expr(p, e.sons[1], tmp) genDiscriminantCheck(p, a, tmp, dotExpr.sons[0].typ, dotExpr.sons[1].sym) @@ -965,9 +965,9 @@ proc asgnFieldDiscriminant(p: BProc, e: PNode) = proc genAsgn(p: BProc, e: PNode, fastAsgn: bool) = genLineDir(p, e) - if not FieldDiscriminantCheckNeeded(p, e): + if not fieldDiscriminantCheckNeeded(p, e): var a: TLoc - InitLocExpr(p, e.sons[0], a) + initLocExpr(p, e.sons[0], a) if fastAsgn: incl(a.flags, lfNoDeepCopy) assert(a.t != nil) loadInto(p, e.sons[0], e.sons[1], a) diff --git a/compiler/ccgtrav.nim b/compiler/ccgtrav.nim index 9534eae91d..6de425cfd1 100644 --- a/compiler/ccgtrav.nim +++ b/compiler/ccgtrav.nim @@ -28,7 +28,7 @@ proc genTraverseProc(c: var TTraversalClosure, accessor: PRope, n: PNode) = for i in countup(0, sonsLen(n) - 1): genTraverseProc(c, accessor, n.sons[i]) of nkRecCase: - if (n.sons[0].kind != nkSym): InternalError(n.info, "genTraverseProc") + if (n.sons[0].kind != nkSym): internalError(n.info, "genTraverseProc") var p = c.p let disc = n.sons[0].sym lineF(p, cpsStmts, "switch ($1.$2) {$n", accessor, disc.loc.r) @@ -74,7 +74,7 @@ proc genTraverseProc(c: var TTraversalClosure, accessor: PRope, typ: PType) = genTraverseProc(c, accessor.parentObj, typ.sons[i]) if typ.n != nil: genTraverseProc(c, accessor, typ.n) of tyTuple: - let typ = GetUniqueType(typ) + let typ = getUniqueType(typ) for i in countup(0, sonsLen(typ) - 1): genTraverseProc(c, rfmt(nil, "$1.Field$2", accessor, i.toRope), typ.sons[i]) of tyRef, tyString, tySequence: diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 66441af5e6..9d36290853 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -76,7 +76,7 @@ proc mangleName(s: PSym): PRope = else: result = ~"%" of skTemp, skParam, skType, skEnumField, skModule: result = ~"%" - else: InternalError(s.info, "mangleName") + else: internalError(s.info, "mangleName") when oKeepVariableNames: let keepOrigName = s.kind in skLocalVars - {skForVar} and {sfFromGeneric, sfGlobal, sfShadowed, sfGenSym} * s.flags == {} and @@ -150,7 +150,7 @@ proc getTypeName(typ: PType): PRope = typ.loc.r = if gCmd != cmdCompileToLLVM: con(typ.typeName, typ.id.toRope) else: con([~"%", typ.typeName, typ.id.toRope]) result = typ.loc.r - if result == nil: InternalError("getTypeName: " & $typ.kind) + if result == nil: internalError("getTypeName: " & $typ.kind) proc mapSetType(typ: PType): TCTypeKind = case int(getSize(typ)) @@ -194,7 +194,7 @@ proc mapType(typ: PType): TCTypeKind = of tyCString: result = ctCString of tyInt..tyUInt64: result = TCTypeKind(ord(typ.kind) - ord(tyInt) + ord(ctInt)) - else: InternalError("mapType") + else: internalError("mapType") proc mapReturnType(typ: PType): TCTypeKind = if skipTypes(typ, typedescInst).kind == tyArray: result = ctPtr @@ -262,7 +262,7 @@ proc ccgIntroducedPtr(s: PSym): bool = proc fillResult(param: PSym) = fillLoc(param.loc, locParam, param.typ, ~"Result", OnStack) - if (mapReturnType(param.typ) != ctArray) and IsInvalidReturnType(param.typ): + if (mapReturnType(param.typ) != ctArray) and isInvalidReturnType(param.typ): incl(param.loc.flags, lfIndirect) param.loc.s = OnUnknown @@ -288,7 +288,7 @@ proc genProcParams(m: BModule, t: PType, rettype, params: var PRope, else: rettype = getTypeDescAux(m, t.sons[0], check) for i in countup(1, sonsLen(t.n) - 1): - if t.n.sons[i].kind != nkSym: InternalError(t.n.info, "genProcParams") + if t.n.sons[i].kind != nkSym: internalError(t.n.info, "genProcParams") var param = t.n.sons[i].sym if isCompileTimeOnly(param.typ): continue if params != nil: app(params, ~", ") @@ -375,14 +375,14 @@ proc getTypePre(m: BModule, typ: PType): PRope = if typ == nil: result = toRope("void") else: result = getSimpleTypeDesc(m, typ) - if result == nil: result = CacheGetType(m.typeCache, typ) + if result == nil: result = cacheGetType(m.typeCache, typ) proc getForwardStructFormat(): string = if gCmd == cmdCompileToCpp: result = "struct $1;$n" else: result = "typedef struct $1 $1;$n" proc getTypeForward(m: BModule, typ: PType): PRope = - result = CacheGetType(m.forwTypeCache, typ) + result = cacheGetType(m.forwTypeCache, typ) if result != nil: return result = getTypePre(m, typ) if result != nil: return @@ -391,8 +391,8 @@ proc getTypeForward(m: BModule, typ: PType): PRope = result = getTypeName(typ) if not isImportedType(typ): appf(m.s[cfsForwardTypes], getForwardStructFormat(), [result]) - IdTablePut(m.forwTypeCache, typ, result) - else: InternalError("getTypeForward(" & $typ.kind & ')') + idTablePut(m.forwTypeCache, typ, result) + else: internalError("getTypeForward(" & $typ.kind & ')') proc mangleRecFieldName(field: PSym, rectype: PType): PRope = if (rectype.sym != nil) and @@ -400,7 +400,7 @@ proc mangleRecFieldName(field: PSym, rectype: PType): PRope = result = field.loc.r else: result = toRope(mangleField(field.name.s)) - if result == nil: InternalError(field.info, "mangleRecFieldName") + if result == nil: internalError(field.info, "mangleRecFieldName") proc genRecordFieldsAux(m: BModule, n: PNode, accessExpr: PRope, rectype: PType, @@ -415,7 +415,7 @@ proc genRecordFieldsAux(m: BModule, n: PNode, for i in countup(0, sonsLen(n) - 1): app(result, genRecordFieldsAux(m, n.sons[i], accessExpr, rectype, check)) of nkRecCase: - if (n.sons[0].kind != nkSym): InternalError(n.info, "genRecordFieldsAux") + if (n.sons[0].kind != nkSym): internalError(n.info, "genRecordFieldsAux") app(result, genRecordFieldsAux(m, n.sons[0], accessExpr, rectype, check)) uname = toRope(mangle(n.sons[0].sym.name.s) & 'U') if accessExpr != nil: ae = ropef("$1.$2", [accessExpr, uname]) @@ -497,15 +497,15 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope = # returns only the type's name var name, rettype, desc, recdesc: PRope - n: biggestInt + n: BiggestInt t, et: PType t = getUniqueType(typ) - if t == nil: InternalError("getTypeDescAux: t == nil") + if t == nil: internalError("getTypeDescAux: t == nil") if t.sym != nil: useHeader(m, t.sym) result = getTypePre(m, t) if result != nil: return - if ContainsOrIncl(check, t.id): - InternalError("cannot generate C type for: " & typeToString(typ)) + if containsOrIncl(check, t.id): + internalError("cannot generate C type for: " & typeToString(typ)) # XXX: this BUG is hard to fix -> we need to introduce helper structs, # but determining when this needs to be done is hard. We should split # C type generation into an analysis and a code generation phase somehow. @@ -521,25 +521,25 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope = # no restriction! We have a forward declaration for structs name = getTypeForward(m, et) result = con(name, "*") - IdTablePut(m.typeCache, t, result) + idTablePut(m.typeCache, t, result) pushType(m, et) of tySequence: # no restriction! We have a forward declaration for structs name = getTypeForward(m, et) result = con(name, "**") - IdTablePut(m.typeCache, t, result) + idTablePut(m.typeCache, t, result) pushType(m, et) else: # else we have a strong dependency :-( result = con(getTypeDescAux(m, et, check), "*") - IdTablePut(m.typeCache, t, result) + idTablePut(m.typeCache, t, result) of tyOpenArray, tyVarargs: et = getUniqueType(t.sons[0]) result = con(getTypeDescAux(m, et, check), "*") - IdTablePut(m.typeCache, t, result) + idTablePut(m.typeCache, t, result) of tyProc: result = getTypeName(t) - IdTablePut(m.typeCache, t, result) + idTablePut(m.typeCache, t, result) genProcParams(m, t, rettype, desc, check) if not isImportedType(t): if t.callConv != ccClosure: # procedure vars may need a closure! @@ -553,14 +553,14 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope = of tySequence: # we cannot use getTypeForward here because then t would be associated # with the name of the struct, not with the pointer to the struct: - result = CacheGetType(m.forwTypeCache, t) + result = cacheGetType(m.forwTypeCache, t) if result == nil: result = getTypeName(t) if not isImportedType(t): appf(m.s[cfsForwardTypes], getForwardStructFormat(), [result]) - IdTablePut(m.forwTypeCache, t, result) + idTablePut(m.forwTypeCache, t, result) assert(CacheGetType(m.typeCache, t) == nil) - IdTablePut(m.typeCache, t, con(result, "*")) + idTablePut(m.typeCache, t, con(result, "*")) if not isImportedType(t): if skipTypes(t.sons[0], typedescInst).kind != tyEmpty: const @@ -579,18 +579,18 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope = if n <= 0: n = 1 # make an array of at least one element result = getTypeName(t) - IdTablePut(m.typeCache, t, result) + idTablePut(m.typeCache, t, result) if not isImportedType(t): appf(m.s[cfsTypes], "typedef $1 $2[$3];$n", - [getTypeDescAux(m, t.sons[1], check), result, ToRope(n)]) + [getTypeDescAux(m, t.sons[1], check), result, toRope(n)]) of tyObject, tyTuple: - result = CacheGetType(m.forwTypeCache, t) + result = cacheGetType(m.forwTypeCache, t) if result == nil: result = getTypeName(t) if not isImportedType(t): appf(m.s[cfsForwardTypes], getForwardStructFormat(), [result]) - IdTablePut(m.forwTypeCache, t, result) - IdTablePut(m.typeCache, t, result) # always call for sideeffects: + idTablePut(m.forwTypeCache, t, result) + idTablePut(m.typeCache, t, result) # always call for sideeffects: if t.kind != tyTuple: recdesc = getRecordDesc(m, t, result, check) else: recdesc = getTupleDesc(m, t, result, check) if not isImportedType(t): app(m.s[cfsTypes], recdesc) @@ -602,7 +602,7 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope = of 8: result = toRope("NU64") else: result = getTypeName(t) - IdTablePut(m.typeCache, t, result) + idTablePut(m.typeCache, t, result) if not isImportedType(t): appf(m.s[cfsTypes], "typedef NU8 $1[$2];$n", [result, toRope(getSize(t))]) @@ -610,7 +610,7 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope = tyIter, tyTypeDesc: result = getTypeDescAux(m, lastSon(t), check) else: - InternalError("getTypeDescAux(" & $t.kind & ')') + internalError("getTypeDescAux(" & $t.kind & ')') result = nil # fixes bug #145: excl(check, t.id) @@ -737,10 +737,10 @@ proc discriminatorTableName(m: BModule, objtype: PType, d: PSym): PRope = var objtype = objtype while lookupInRecord(objtype.n, d.name) == nil: objtype = objtype.sons[0] - if objType.sym == nil: - InternalError(d.info, "anonymous obj with discriminator") + if objtype.sym == nil: + internalError(d.info, "anonymous obj with discriminator") result = ropef("NimDT_$1_$2", [ - toRope(objType.sym.name.s.mangle), toRope(d.name.s.mangle)]) + toRope(objtype.sym.name.s.mangle), toRope(d.name.s.mangle)]) proc discriminatorTableDecl(m: BModule, objtype: PType, d: PSym): PRope = discard cgsym(m, "TNimNode") @@ -911,7 +911,7 @@ include ccgtrav proc genTypeInfo(m: BModule, t: PType): PRope = var t = getUniqueType(t) result = ropef("NTI$1", [toRope(t.id)]) - if ContainsOrIncl(m.typeInfoMarker, t.id): + if containsOrIncl(m.typeInfoMarker, t.id): return con("(&".toRope, result, ")".toRope) let owner = t.skipTypes(typedescPtrs).owner.getModule if owner != m.module: @@ -948,7 +948,7 @@ proc genTypeInfo(m: BModule, t: PType): PRope = # BUGFIX: use consistently RTTI without proper field names; otherwise # results are not deterministic! genTupleInfo(m, t, result) - else: InternalError("genTypeInfo(" & $t.kind & ')') + else: internalError("genTypeInfo(" & $t.kind & ')') result = con("(&".toRope, result, ")".toRope) proc genTypeSection(m: BModule, n: PNode) = diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index accb7a2614..1c2d7e0381 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -27,14 +27,14 @@ proc getPragmaStmt*(n: PNode, w: TSpecialWord): PNode = proc stmtsContainPragma*(n: PNode, w: TSpecialWord): bool = result = getPragmaStmt(n, w) != nil -proc hashString*(s: string): biggestInt = +proc hashString*(s: string): BiggestInt = # has to be the same algorithm as system.hashString! if CPU[targetCPU].bit == 64: # we have to use the same bitwidth # as the target CPU var b = 0'i64 for i in countup(0, len(s) - 1): - b = b +% Ord(s[i]) + b = b +% ord(s[i]) b = b +% `shl`(b, 10) b = b xor `shr`(b, 6) b = b +% `shl`(b, 3) @@ -44,7 +44,7 @@ proc hashString*(s: string): biggestInt = else: var a = 0'i32 for i in countup(0, len(s) - 1): - a = a +% Ord(s[i]).int32 + a = a +% ord(s[i]).int32 a = a +% `shl`(a, 10'i32) a = a xor `shr`(a, 6'i32) a = a +% `shl`(a, 3'i32) @@ -57,7 +57,7 @@ var gCanonicalTypes: array[TTypeKind, PType] proc initTypeTables() = - for i in countup(low(TTypeKind), high(TTypeKind)): InitIdTable(gTypeTable[i]) + for i in countup(low(TTypeKind), high(TTypeKind)): initIdTable(gTypeTable[i]) proc resetCaches* = ## XXX: fix that more properly @@ -169,7 +169,7 @@ proc makeLLVMString*(s: string): PRope = for i in countup(0, len(s) - 1): if (i + 1) mod MaxLineLength == 0: app(result, toRope(res)) - setlen(res, 0) + setLen(res, 0) case s[i] of '\0'..'\x1F', '\x80'..'\xFF', '\"', '\\': add(res, '\\') diff --git a/compiler/cgen.nim b/compiler/cgen.nim index ad1dfa89ef..97177a0ec3 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -52,7 +52,7 @@ proc emitLazily(s: PSym): bool {.inline.} = proc initLoc(result: var TLoc, k: TLocKind, typ: PType, s: TStorageLoc) = result.k = k result.s = s - result.t = GetUniqueType(typ) + result.t = getUniqueType(typ) result.r = nil result.a = - 1 result.flags = {} @@ -103,7 +103,7 @@ proc ropecg(m: BModule, frmt: TFormatStr, args: varargs[PRope]): PRope = of '0'..'9': var j = 0 while true: - j = (j * 10) + Ord(frmt[i]) - ord('0') + j = (j * 10) + ord(frmt[i]) - ord('0') inc(i) if i >= length or not (frmt[i] in {'0'..'9'}): break num = j @@ -116,7 +116,7 @@ proc ropecg(m: BModule, frmt: TFormatStr, args: varargs[PRope]): PRope = of 'N': app(result, rnl) inc(i) - else: InternalError("ropes: invalid format string $" & frmt[i]) + else: internalError("ropes: invalid format string $" & frmt[i]) elif frmt[i] == '#' and frmt[i+1] in IdentStartChars: inc(i) var j = i @@ -128,7 +128,7 @@ proc ropecg(m: BModule, frmt: TFormatStr, args: varargs[PRope]): PRope = inc(i, 2) var j = 0 while frmt[i] in Digits: - j = (j * 10) + Ord(frmt[i]) - ord('0') + j = (j * 10) + ord(frmt[i]) - ord('0') inc(i) app(result, cgsym(m, args[j-1].ropeToStr)) var start = i @@ -522,8 +522,8 @@ proc assignGlobalVar(p: BProc, s: PSym) = if lfDynamicLib in s.loc.flags: var q = findPendingModule(p.module, s) - if q != nil and not ContainsOrIncl(q.declaredThings, s.id): - VarInDynamicLib(q, s) + if q != nil and not containsOrIncl(q.declaredThings, s.id): + varInDynamicLib(q, s) else: s.loc.r = mangleDynLibProc(s) return @@ -578,7 +578,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) proc genProcPrototype(m: BModule, sym: PSym) proc putLocIntoDest(p: BProc, d: var TLoc, s: TLoc) proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) -proc intLiteral(i: biggestInt): PRope +proc intLiteral(i: BiggestInt): PRope proc genLiteral(p: BProc, n: PNode): PRope proc initLocExpr(p: BProc, e: PNode, result: var TLoc) = @@ -610,7 +610,7 @@ proc loadDynamicLib(m: BModule, lib: PLib) = var s: TStringSeq = @[] libCandidates(lib.path.strVal, s) if gVerbosity >= 2: - MsgWriteln("Dependency: " & lib.path.strVal) + msgWriteln("Dependency: " & lib.path.strVal) var loadlib: PRope = nil for i in countup(0, high(s)): inc(m.labels) @@ -632,7 +632,7 @@ proc loadDynamicLib(m: BModule, lib: PLib) = "if (!($1 = #nimLoadLibrary($2))) #nimLoadLibraryError($2);$n", [tmp, rdLoc(dest)]) - if lib.name == nil: InternalError("loadDynamicLib") + if lib.name == nil: internalError("loadDynamicLib") proc mangleDynLibProc(sym: PSym): PRope = if sfCompilerProc in sym.flags: @@ -672,7 +672,7 @@ proc symInDynamicLib(m: BModule, sym: PSym) = elif idx.len == 1 and idx[0] in {'0'..'9'}: app(m.extensionLoaders[idx[0]], load) else: - InternalError(sym.info, "wrong index: " & idx) + internalError(sym.info, "wrong index: " & idx) else: appcg(m, m.s[cfsDynLibInit], "\t$1 = ($2) #nimGetProcAddr($3, $4);$n", @@ -708,7 +708,7 @@ proc cgsym(m: BModule, name: string): PRope = of skProc, skMethod, skConverter, skIterator: genProc(m, sym) of skVar, skResult, skLet: genVarPrototype(m, sym) of skType: discard getTypeDesc(m, sym.typ) - else: InternalError("cgsym: " & name) + else: internalError("cgsym: " & name) else: # we used to exclude the system module from this check, but for DLL # generation support this sloppyness leads to hard to detect bugs, so @@ -747,7 +747,7 @@ proc closureSetup(p: BProc, prc: PSym) = # prc.ast[paramsPos].last contains the type we're after: var ls = lastSon(prc.ast[paramsPos]) if ls.kind != nkSym: - InternalError(prc.info, "closure generation failed") + internalError(prc.info, "closure generation failed") var env = ls.sym #echo "created environment: ", env.id, " for ", prc.name.s assignLocalVar(p, env) @@ -793,7 +793,7 @@ proc genProcAux(m: BModule, prc: PSym) = app(generatedProc, initGCFrame(p)) if optStackTrace in prc.options: app(generatedProc, p.s(cpsLocals)) - var procname = CStringLit(p, generatedProc, prc.name.s) + var procname = cstringLit(p, generatedProc, prc.name.s) app(generatedProc, initFrame(p, procname, prc.info.quotedFilename)) else: app(generatedProc, p.s(cpsLocals)) @@ -814,13 +814,13 @@ proc genProcPrototype(m: BModule, sym: PSym) = if lfNoDecl in sym.loc.Flags: return if lfDynamicLib in sym.loc.Flags: if getModule(sym).id != m.module.id and - not ContainsOrIncl(m.declaredThings, sym.id): + not containsOrIncl(m.declaredThings, sym.id): app(m.s[cfsVars], rfmt(nil, "extern $1 $2;$n", getTypeDesc(m, sym.loc.t), mangleDynLibProc(sym))) if gCmd == cmdCompileToLLVM: incl(sym.loc.flags, lfIndirect) - elif not ContainsOrIncl(m.declaredProtos, sym.id): + elif not containsOrIncl(m.declaredProtos, sym.id): var header = genProcHeader(m, sym) - if sfPure in sym.flags and hasNakedAttribute in CC[ccompiler].props: + if sfPure in sym.flags and hasNakedAttribute in CC[cCompiler].props: header.app(" __attribute__((naked))") app(m.s[cfsProcHeaders], rfmt(nil, "$1;$n", header)) @@ -837,16 +837,16 @@ proc genProcNoForward(m: BModule, prc: PSym) = # We add inline procs to the calling module to enable C based inlining. # This also means that a check with ``q.declaredThings`` is wrong, we need # a check for ``m.declaredThings``. - if not ContainsOrIncl(m.declaredThings, prc.id): genProcAux(m, prc) + if not containsOrIncl(m.declaredThings, prc.id): genProcAux(m, prc) elif lfDynamicLib in prc.loc.flags: var q = findPendingModule(m, prc) - if q != nil and not ContainsOrIncl(q.declaredThings, prc.id): - SymInDynamicLib(q, prc) + if q != nil and not containsOrIncl(q.declaredThings, prc.id): + symInDynamicLib(q, prc) else: - SymInDynamicLibPartial(m, prc) + symInDynamicLibPartial(m, prc) elif sfImportc notin prc.flags: var q = findPendingModule(m, prc) - if q != nil and not ContainsOrIncl(q.declaredThings, prc.id): + if q != nil and not containsOrIncl(q.declaredThings, prc.id): genProcAux(q, prc) proc requestConstImpl(p: BProc, sym: PSym) = @@ -857,12 +857,12 @@ proc requestConstImpl(p: BProc, sym: PSym) = if lfNoDecl in sym.loc.Flags: return # declare implementation: var q = findPendingModule(m, sym) - if q != nil and not ContainsOrIncl(q.declaredThings, sym.id): + if q != nil and not containsOrIncl(q.declaredThings, sym.id): assert q.initProc.module == q appf(q.s[cfsData], "NIM_CONST $1 $2 = $3;$n", [getTypeDesc(q, sym.typ), sym.loc.r, genConstExpr(q.initProc, sym.ast)]) # declare header: - if q != m and not ContainsOrIncl(m.declaredThings, sym.id): + if q != m and not containsOrIncl(m.declaredThings, sym.id): assert(sym.loc.r != nil) let headerDecl = ropef("extern NIM_CONST $1 $2;$n", [getTypeDesc(m, sym.loc.t), sym.loc.r]) @@ -882,14 +882,14 @@ proc genProc(m: BModule, prc: PSym) = generatedHeader != nil and lfNoDecl notin prc.loc.Flags: genProcPrototype(generatedHeader, prc) if prc.typ.callConv == ccInline: - if not ContainsOrIncl(generatedHeader.declaredThings, prc.id): + if not containsOrIncl(generatedHeader.declaredThings, prc.id): genProcAux(generatedHeader, prc) proc genVarPrototypeAux(m: BModule, sym: PSym) = assert(sfGlobal in sym.flags) useHeader(m, sym) fillLoc(sym.loc, locGlobalVar, sym.typ, mangleName(sym), OnHeap) - if (lfNoDecl in sym.loc.Flags) or ContainsOrIncl(m.declaredThings, sym.id): + if (lfNoDecl in sym.loc.Flags) or containsOrIncl(m.declaredThings, sym.id): return if sym.owner.id != m.module.id: # else we already have the symbol generated! @@ -1058,7 +1058,7 @@ proc genInitCode(m: BModule) = # declare it nevertheless: m.FrameDeclared = true if not m.PreventStackTrace: - var procname = CStringLit(m.initProc, prc, m.module.name.s) + var procname = cstringLit(m.initProc, prc, m.module.name.s) app(prc, initFrame(m.initProc, procname, m.module.info.quotedFilename)) else: app(prc, ~"\tTFrame F; F.len = 0;$N") @@ -1127,7 +1127,7 @@ proc initProcOptions(m: BModule): TOptions = proc rawNewModule(module: PSym, filename: string): BModule = new(result) - InitLinkedList(result.headerFiles) + initLinkedList(result.headerFiles) result.declaredThings = initIntSet() result.declaredProtos = initIntSet() result.cfilename = filename @@ -1159,7 +1159,7 @@ proc nullify[T](arr: var T) = proc resetModule*(m: var BModule) = # between two compilations in CAAS mode, we can throw # away all the data that was written to disk - InitLinkedList(m.headerFiles) + initLinkedList(m.headerFiles) m.declaredProtos = initIntSet() initIdTable(m.forwTypeCache) m.initProc = newProc(nil, m) @@ -1210,7 +1210,7 @@ proc newModule(module: PSym): BModule = if (optDeadCodeElim in gGlobalOptions): if (sfDeadCodeElim in module.flags): - InternalError("added pending module twice: " & module.filename) + internalError("added pending module twice: " & module.filename) proc myOpen(module: PSym): PPassContext = result = newModule(module) @@ -1263,19 +1263,19 @@ proc finishModule(m: BModule) = # a ``for`` loop here var prc = m.forwardedProcs[i] if sfForward in prc.flags: - InternalError(prc.info, "still forwarded: " & prc.name.s) + internalError(prc.info, "still forwarded: " & prc.name.s) genProcNoForward(m, prc) inc(i) assert(gForwardedProcsCounter >= i) dec(gForwardedProcsCounter, i) - setlen(m.forwardedProcs, 0) + setLen(m.forwardedProcs, 0) proc shouldRecompile(code: PRope, cfile, cfilenoext: string): bool = result = true if optForceFullMake notin gGlobalOptions: var objFile = toObjFile(cfilenoext) if writeRopeIfNotEqual(code, cfile): return - if ExistsFile(objFile) and os.FileNewer(objFile, cfile): result = false + if existsFile(objFile) and os.FileNewer(objFile, cfile): result = false else: writeRope(code, cfile) @@ -1296,7 +1296,7 @@ proc writeModule(m: BModule, pending: bool) = if sfMainModule in m.module.flags: # generate main file: app(m.s[cfsProcHeaders], mainModProcs) - GenerateThreadVarsSize(m) + generateThreadVarsSize(m) var code = genModule(m, cfilenoext) when hasTinyCBackend: @@ -1313,7 +1313,7 @@ proc writeModule(m: BModule, pending: bool) = var code = genModule(m, cfilenoext) writeRope(code, cfile) addFileToCompile(cfilenoext) - elif not ExistsFile(toObjFile(cfilenoext)): + elif not existsFile(toObjFile(cfilenoext)): # Consider: first compilation compiles ``system.nim`` and produces # ``system.c`` but then compilation fails due to an error. This means # that ``system.o`` is missing, so we need to call the C compiler for it: diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index a803c0ba1e..58584552d9 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -78,7 +78,7 @@ type maxFrameLen*: int # max length of frame descriptor module*: BModule # used to prevent excessive parameter passing withinLoop*: int # > 0 if we are within a loop - gcFrameId*: natural # for the GC stack marking + gcFrameId*: Natural # for the GC stack marking gcFrameType*: PRope # the struct {} we put the GC markers into TTypeSeq* = seq[PType] @@ -108,7 +108,7 @@ type forwardedProcs*: TSymSeq # keep forwarded procs here typeNodes*, nimTypes*: int # used for type info generation typeNodesName*, nimTypesName*: PRope # used for type info generation - labels*: natural # for generating unique module-scope names + labels*: Natural # for generating unique module-scope names extensionLoaders*: array['0'..'9', PRope] # special procs for the # OpenGL wrapper injectStmt*: PRope diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim index 3467fea7e1..9613eb525e 100644 --- a/compiler/cgmeth.nim +++ b/compiler/cgmeth.nim @@ -18,16 +18,16 @@ proc genConv(n: PNode, d: PType, downcast: bool): PNode = var source = skipTypes(n.typ, abstractPtrs) if (source.kind == tyObject) and (dest.kind == tyObject): var diff = inheritanceDiff(dest, source) - if diff == high(int): InternalError(n.info, "cgmeth.genConv") + if diff == high(int): internalError(n.info, "cgmeth.genConv") if diff < 0: result = newNodeIT(nkObjUpConv, n.info, d) addSon(result, n) - if downCast: InternalError(n.info, "cgmeth.genConv: no upcast allowed") + if downcast: internalError(n.info, "cgmeth.genConv: no upcast allowed") elif diff > 0: result = newNodeIT(nkObjDownConv, n.info, d) addSon(result, n) - if not downCast: - InternalError(n.info, "cgmeth.genConv: no downcast allowed") + if not downcast: + internalError(n.info, "cgmeth.genConv: no downcast allowed") else: result = n else: @@ -112,12 +112,12 @@ proc relevantCol(methods: TSymSeq, col: int): bool = if t.kind == tyObject: for i in countup(1, high(methods)): let t2 = skipTypes(methods[i].typ.sons[col], skipPtrs) - if not SameType(t2, t): + if not sameType(t2, t): return true proc cmpSignatures(a, b: PSym, relevantCols: TIntSet): int = for col in countup(1, sonsLen(a.typ) - 1): - if Contains(relevantCols, col): + if contains(relevantCols, col): var aa = skipTypes(a.typ.sons[col], skipPtrs) var bb = skipTypes(b.typ.sons[col], skipPtrs) var d = inheritanceDiff(aa, bb) @@ -154,7 +154,7 @@ proc genDispatcher(methods: TSymSeq, relevantCols: TIntSet): PSym = var curr = methods[meth] # generate condition: var cond: PNode = nil for col in countup(1, paramLen - 1): - if Contains(relevantCols, col): + if contains(relevantCols, col): var isn = newNodeIT(nkCall, base.info, getSysType(tyBool)) addSon(isn, newSymNode(iss)) addSon(isn, newSymNode(base.typ.n.sons[col].sym)) @@ -195,7 +195,7 @@ proc generateMethodDispatchers*(): PNode = for bucket in countup(0, len(gMethods) - 1): var relevantCols = initIntSet() for col in countup(1, sonsLen(gMethods[bucket][0].typ) - 1): - if relevantCol(gMethods[bucket], col): Incl(relevantCols, col) + if relevantCol(gMethods[bucket], col): incl(relevantCols, col) sortBucket(gMethods[bucket], relevantCols) addSon(result, newSymNode(genDispatcher(gMethods[bucket], relevantCols))) diff --git a/compiler/commands.nim b/compiler/commands.nim index e67b0d4228..acb9af8ac4 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -22,7 +22,7 @@ type passPP # preprocessor called ProcessCommand() proc processCommand*(switch: string, pass: TCmdLinePass) -proc processSwitch*(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) +proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) # implementation @@ -36,7 +36,7 @@ const proc getCommandLineDesc(): string = result = (HelpMessage % [VersionAsString, platform.os[platform.hostOS].name, - cpu[platform.hostCPU].name]) & Usage + CPU[platform.hostCPU].name]) & Usage proc helpOnError(pass: TCmdLinePass) = if pass == passCmd1: @@ -47,14 +47,14 @@ proc writeAdvancedUsage(pass: TCmdLinePass) = if pass == passCmd1: msgWriteln(`%`(HelpMessage, [VersionAsString, platform.os[platform.hostOS].name, - cpu[platform.hostCPU].name]) & AdvancedUsage) + CPU[platform.hostCPU].name]) & AdvancedUsage) quit(0) proc writeVersionInfo(pass: TCmdLinePass) = if pass == passCmd1: msgWriteln(`%`(HelpMessage, [VersionAsString, platform.os[platform.hostOS].name, - cpu[platform.hostCPU].name])) + CPU[platform.hostCPU].name])) quit(0) var @@ -88,14 +88,14 @@ proc splitSwitch(switch: string, cmd, arg: var string, pass: TCmdLinePass, elif switch[i] in {':', '=', '['}: arg = substr(switch, i + 1) else: invalidCmdLineOption(pass, switch, info) -proc processOnOffSwitch(op: TOptions, arg: string, pass: TCmdlinePass, +proc processOnOffSwitch(op: TOptions, arg: string, pass: TCmdLinePass, info: TLineInfo) = case whichKeyword(arg) of wOn: gOptions = gOptions + op of wOff: gOptions = gOptions - op else: localError(info, errOnOrOffExpectedButXFound, arg) -proc processOnOffSwitchG(op: TGlobalOptions, arg: string, pass: TCmdlinePass, +proc processOnOffSwitchG(op: TGlobalOptions, arg: string, pass: TCmdLinePass, info: TLineInfo) = case whichKeyword(arg) of wOn: gGlobalOptions = gGlobalOptions + op @@ -108,7 +108,7 @@ proc expectArg(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = proc expectNoArg(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = if arg != "": localError(info, errCmdLineNoArgExpected, addPrefix(switch)) -proc processSpecificNote(arg: string, state: TSpecialWord, pass: TCmdlinePass, +proc processSpecificNote(arg: string, state: TSpecialWord, pass: TCmdLinePass, info: TLineInfo) = var id = "" # arg = "X]:on|off" var i = 0 @@ -234,7 +234,7 @@ proc track(arg: string, info: TLineInfo) = optTrackPos = newLineInfo(a[0], line, column) msgs.addCheckpoint(optTrackPos) -proc dynlibOverride(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = +proc dynlibOverride(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = if pass in {passCmd2, passPP}: expectArg(switch, arg, pass, info) options.inclDynlibOverride(arg) @@ -252,7 +252,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = if pass in {passCmd2, passPP}: expectArg(switch, arg, pass, info) let path = processPath(arg, notRelativeToProj=true) - babelpath(path, info) + babelPath(path, info) of "excludepath": expectArg(switch, arg, pass, info) let path = processPath(arg) @@ -269,10 +269,10 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = optMainModule = arg of "define", "d": expectArg(switch, arg, pass, info) - DefineSymbol(arg) + defineSymbol(arg) of "undef", "u": expectArg(switch, arg, pass, info) - UndefSymbol(arg) + undefSymbol(arg) of "compile": expectArg(switch, arg, pass, info) if pass in {passCmd2, passPP}: processCompile(arg) @@ -321,40 +321,40 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = defineSymbol("nogc") else: localError(info, errNoneBoehmRefcExpectedButXFound, arg) of "warnings", "w": processOnOffSwitch({optWarns}, arg, pass, info) - of "warning": ProcessSpecificNote(arg, wWarning, pass, info) - of "hint": ProcessSpecificNote(arg, wHint, pass, info) - of "hints": ProcessOnOffSwitch({optHints}, arg, pass, info) - of "threadanalysis": ProcessOnOffSwitchG({optThreadAnalysis}, arg, pass, info) - of "stacktrace": ProcessOnOffSwitch({optStackTrace}, arg, pass, info) - of "linetrace": ProcessOnOffSwitch({optLineTrace}, arg, pass, info) + of "warning": processSpecificNote(arg, wWarning, pass, info) + of "hint": processSpecificNote(arg, wHint, pass, info) + of "hints": processOnOffSwitch({optHints}, arg, pass, info) + of "threadanalysis": processOnOffSwitchG({optThreadAnalysis}, arg, pass, info) + of "stacktrace": processOnOffSwitch({optStackTrace}, arg, pass, info) + of "linetrace": processOnOffSwitch({optLineTrace}, arg, pass, info) of "debugger": - ProcessOnOffSwitch({optEndb}, arg, pass, info) - if optEndb in gOptions: DefineSymbol("endb") - else: UndefSymbol("endb") + processOnOffSwitch({optEndb}, arg, pass, info) + if optEndb in gOptions: defineSymbol("endb") + else: undefSymbol("endb") of "profiler": - ProcessOnOffSwitch({optProfiler}, arg, pass, info) - if optProfiler in gOptions: DefineSymbol("profiler") - else: UndefSymbol("profiler") - of "checks", "x": ProcessOnOffSwitch(checksOptions, arg, pass, info) + processOnOffSwitch({optProfiler}, arg, pass, info) + if optProfiler in gOptions: defineSymbol("profiler") + else: undefSymbol("profiler") + of "checks", "x": processOnOffSwitch(checksOptions, arg, pass, info) of "floatchecks": - ProcessOnOffSwitch({optNanCheck, optInfCheck}, arg, pass, info) - of "infchecks": ProcessOnOffSwitch({optInfCheck}, arg, pass, info) - of "nanchecks": ProcessOnOffSwitch({optNanCheck}, arg, pass, info) - of "objchecks": ProcessOnOffSwitch({optObjCheck}, arg, pass, info) - of "fieldchecks": ProcessOnOffSwitch({optFieldCheck}, arg, pass, info) - of "rangechecks": ProcessOnOffSwitch({optRangeCheck}, arg, pass, info) - of "boundchecks": ProcessOnOffSwitch({optBoundsCheck}, arg, pass, info) - of "overflowchecks": ProcessOnOffSwitch({optOverflowCheck}, arg, pass, info) - of "linedir": ProcessOnOffSwitch({optLineDir}, arg, pass, info) - of "assertions", "a": ProcessOnOffSwitch({optAssert}, arg, pass, info) - of "deadcodeelim": ProcessOnOffSwitchG({optDeadCodeElim}, arg, pass, info) - of "threads": ProcessOnOffSwitchG({optThreads}, arg, pass, info) - of "tlsemulation": ProcessOnOffSwitchG({optTlsEmulation}, arg, pass, info) - of "taintmode": ProcessOnOffSwitchG({optTaintMode}, arg, pass, info) + processOnOffSwitch({optNanCheck, optInfCheck}, arg, pass, info) + of "infchecks": processOnOffSwitch({optInfCheck}, arg, pass, info) + of "nanchecks": processOnOffSwitch({optNanCheck}, arg, pass, info) + of "objchecks": processOnOffSwitch({optObjCheck}, arg, pass, info) + of "fieldchecks": processOnOffSwitch({optFieldCheck}, arg, pass, info) + of "rangechecks": processOnOffSwitch({optRangeCheck}, arg, pass, info) + of "boundchecks": processOnOffSwitch({optBoundsCheck}, arg, pass, info) + of "overflowchecks": processOnOffSwitch({optOverflowCheck}, arg, pass, info) + of "linedir": processOnOffSwitch({optLineDir}, arg, pass, info) + of "assertions", "a": processOnOffSwitch({optAssert}, arg, pass, info) + of "deadcodeelim": processOnOffSwitchG({optDeadCodeElim}, arg, pass, info) + of "threads": processOnOffSwitchG({optThreads}, arg, pass, info) + of "tlsemulation": processOnOffSwitchG({optTlsEmulation}, arg, pass, info) + of "taintmode": processOnOffSwitchG({optTaintMode}, arg, pass, info) of "implicitstatic": - ProcessOnOffSwitch({optImplicitStatic}, arg, pass, info) + processOnOffSwitch({optImplicitStatic}, arg, pass, info) of "patterns": - ProcessOnOffSwitch({optPatterns}, arg, pass, info) + processOnOffSwitch({optPatterns}, arg, pass, info) of "opt": expectArg(switch, arg, pass, info) case arg.normalize @@ -367,7 +367,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "none": excl(gOptions, optOptimizeSpeed) excl(gOptions, optOptimizeSize) - else: LocalError(info, errNoneSpeedOrSizeExpectedButXFound, arg) + else: localError(info, errNoneSpeedOrSizeExpectedButXFound, arg) of "app": expectArg(switch, arg, pass, info) case arg.normalize @@ -389,7 +389,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = excl(gGlobalOptions, optGenGuiApp) defineSymbol("library") defineSymbol("staticlib") - else: LocalError(info, errGuiConsoleOrLibExpectedButXFound, arg) + else: localError(info, errGuiConsoleOrLibExpectedButXFound, arg) of "passc", "t": expectArg(switch, arg, pass, info) if pass in {passCmd2, passPP}: extccomp.addCompileOption(arg) @@ -409,7 +409,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = headerFile = arg incl(gGlobalOptions, optGenIndex) of "index": - ProcessOnOffSwitchG({optGenIndex}, arg, pass, info) + processOnOffSwitchG({optGenIndex}, arg, pass, info) of "import": expectArg(switch, arg, pass, info) if pass in {passCmd2, passPP}: implicitImports.add arg @@ -426,7 +426,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = expectArg(switch, arg, pass, info) if pass in {passCmd1, passPP}: theOS = platform.NameToOS(arg) - if theOS == osNone: LocalError(info, errUnknownOS, arg) + if theOS == osNone: localError(info, errUnknownOS, arg) elif theOS != platform.hostOS: setTarget(theOS, targetCPU) condsyms.InitDefines() @@ -434,7 +434,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = expectArg(switch, arg, pass, info) if pass in {passCmd1, passPP}: cpu = platform.NameToCPU(arg) - if cpu == cpuNone: LocalError(info, errUnknownCPU, arg) + if cpu == cpuNone: localError(info, errUnknownCPU, arg) elif cpu != platform.hostCPU: setTarget(targetOS, cpu) condsyms.InitDefines() @@ -457,7 +457,7 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = expectNoArg(switch, arg, pass, info) helpOnError(pass) of "symbolfiles": - ProcessOnOffSwitchG({optSymbolFiles}, arg, pass, info) + processOnOffSwitchG({optSymbolFiles}, arg, pass, info) of "skipcfg": expectNoArg(switch, arg, pass, info) incl(gGlobalOptions, optSkipConfigFile) diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index 71dce9529e..575cda412e 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -78,11 +78,11 @@ proc initDefines*() = of osMacOSX: defineSymbol("macintosh") defineSymbol("unix") - DefineSymbol("posix") + defineSymbol("posix") else: discard - defineSymbol("cpu" & $cpu[targetCPU].bit) - defineSymbol(normalize(endianToStr[cpu[targetCPU].endian])) - defineSymbol(cpu[targetCPU].name) + defineSymbol("cpu" & $CPU[targetCPU].bit) + defineSymbol(normalize(EndianToStr[CPU[targetCPU].endian])) + defineSymbol(CPU[targetCPU].name) defineSymbol(platform.os[targetOS].name) if platform.OS[targetOS].props.contains(ospLacksThreadVars): defineSymbol("emulatedthreadvars") diff --git a/compiler/crc.nim b/compiler/crc.nim index a3b181e200..3291ce7c09 100644 --- a/compiler/crc.nim +++ b/compiler/crc.nim @@ -18,8 +18,8 @@ const InitAdler32* = int32(1) proc updateCrc32*(val: int8, crc: TCrc32): TCrc32 {.inline.} -proc updateCrc32*(val: Char, crc: TCrc32): TCrc32 {.inline.} -proc crcFromBuf*(buf: Pointer, length: int): TCrc32 +proc updateCrc32*(val: char, crc: TCrc32): TCrc32 {.inline.} +proc crcFromBuf*(buf: pointer, length: int): TCrc32 proc strCrc32*(s: string): TCrc32 proc crcFromFile*(filename: string): TCrc32 proc updateAdler32*(adler: int32, buf: pointer, length: int): int32 @@ -75,7 +75,7 @@ const 755167117] proc updateCrc32(val: int8, crc: TCrc32): TCrc32 = - result = TCrc32(crc32Table[(int(crc) xor (int(val) and 0x000000FF)) and + result = TCrc32(crc32table[(int(crc) xor (int(val) and 0x000000FF)) and 0x000000FF]) xor (crc shr TCrc32(8)) proc updateCrc32(val: Char, crc: TCrc32): TCrc32 = @@ -102,7 +102,7 @@ proc crcFromFile(filename: string): TCrc32 = const bufSize = 8000 # don't use 8K for the memory allocator! var - bin: tfile + bin: TFile result = InitCrc32 if not open(bin, filename): return # not equal if file does not exist diff --git a/compiler/depends.nim b/compiler/depends.nim index 1468cbdb9d..5b02275c6a 100644 --- a/compiler/depends.nim +++ b/compiler/depends.nim @@ -43,7 +43,7 @@ proc addDotDependency(c: PPassContext, n: PNode): PNode = proc generateDot(project: string) = writeRope(ropef("digraph $1 {$n$2}$n", [ - toRope(changeFileExt(extractFileName(project), "")), gDotGraph]), + toRope(changeFileExt(extractFilename(project), "")), gDotGraph]), changeFileExt(project, "dot")) proc myOpen(module: PSym): PPassContext = diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 018dcd2700..b38f530158 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -40,11 +40,11 @@ proc compilerMsgHandler(filename: string, line, col: int, of mwRedefinitionOfLabel: k = warnRedefinitionOfLabel of mwUnknownSubstitution: k = warnUnknownSubstitutionX of mwUnsupportedLanguage: k = warnLanguageXNotSupported - GlobalError(newLineInfo(filename, line, col), k, arg) + globalError(newLineInfo(filename, line, col), k, arg) proc parseRst(text, filename: string, line, column: int, hasToc: var bool, - rstOptions: TRstParseOptions): PRstNode = + rstOptions: TRstParseOptions): PRSTNode = result = rstParse(text, filename, line, column, hasToc, rstOptions, options.FindFile, compilerMsgHandler) @@ -55,18 +55,18 @@ proc newDocumentor*(filename: string, config: PStringTable): PDoc = options.FindFile, compilerMsgHandler) result.id = 100 -proc dispA(dest: var PRope, xml, tex: string, args: openarray[PRope]) = +proc dispA(dest: var PRope, xml, tex: string, args: openArray[PRope]) = if gCmd != cmdRst2Tex: appf(dest, xml, args) else: appf(dest, tex, args) -proc getVarIdx(varnames: openarray[string], id: string): int = +proc getVarIdx(varnames: openArray[string], id: string): int = for i in countup(0, high(varnames)): if cmpIgnoreStyle(varnames[i], id) == 0: return i result = -1 -proc ropeFormatNamedVars(frmt: TFormatStr, varnames: openarray[string], - varvalues: openarray[PRope]): PRope = +proc ropeFormatNamedVars(frmt: TFormatStr, varnames: openArray[string], + varvalues: openArray[PRope]): PRope = var i = 0 var L = len(frmt) result = nil @@ -85,7 +85,7 @@ proc ropeFormatNamedVars(frmt: TFormatStr, varnames: openarray[string], of '0'..'9': var j = 0 while true: - j = (j * 10) + Ord(frmt[i]) - ord('0') + j = (j * 10) + ord(frmt[i]) - ord('0') inc(i) if (i > L + 0 - 1) or not (frmt[i] in {'0'..'9'}): break if j > high(varvalues) + 1: internalError("ropeFormatNamedVars") @@ -112,7 +112,7 @@ proc ropeFormatNamedVars(frmt: TFormatStr, varnames: openarray[string], var idx = getVarIdx(varnames, id) if idx >= 0: app(result, varvalues[idx]) else: rawMessage(errUnkownSubstitionVar, id) - else: InternalError("ropeFormatNamedVars") + else: internalError("ropeFormatNamedVars") var start = i while i < L: if frmt[i] != '$': inc(i) @@ -124,7 +124,7 @@ proc genComment(d: PDoc, n: PNode): string = var dummyHasToc: bool if n.comment != nil and startsWith(n.comment, "##"): renderRstToOut(d[], parseRst(n.comment, toFilename(n.info), - toLineNumber(n.info), toColumn(n.info), + toLinenumber(n.info), toColumn(n.info), dummyHasToc, d.options + {roSkipPounds}), result) proc genRecComment(d: PDoc, n: PNode): PRope = @@ -152,7 +152,7 @@ proc extractDocComment*(s: PSym, d: PDoc = nil): string = if not d.isNil: var dummyHasToc: bool renderRstToOut(d[], parseRst(n.comment, toFilename(n.info), - toLineNumber(n.info), toColumn(n.info), + toLinenumber(n.info), toColumn(n.info), dummyHasToc, d.options + {roSkipPounds}), result) else: @@ -186,7 +186,7 @@ proc getName(d: PDoc, n: PNode, splitAfter = -1): string = internalError(n.info, "getName()") result = "" -proc getRstName(n: PNode): PRstNode = +proc getRstName(n: PNode): PRSTNode = case n.kind of nkPostfix: result = getRstName(n.sons[1]) of nkPragmaExpr: result = getRstName(n.sons[0]) @@ -272,7 +272,7 @@ proc genJSONItem(d: PDoc, n, nameNode: PNode, k: TSymKind): PJsonNode = result["code"] = %r.buf proc checkForFalse(n: PNode): bool = - result = n.kind == nkIdent and IdentEq(n.ident, "false") + result = n.kind == nkIdent and identEq(n.ident, "false") proc traceDeps(d: PDoc, n: PNode) = const k = skModule diff --git a/compiler/evaltempl.nim b/compiler/evaltempl.nim index 4bff9ae5e2..14202dbcae 100644 --- a/compiler/evaltempl.nim +++ b/compiler/evaltempl.nim @@ -37,11 +37,11 @@ proc evalTemplateAux(templ, actual: PNode, c: var TemplCtx, result: PNode) = result.add copyTree(x) else: InternalAssert sfGenSym in s.flags - var x = PSym(IdTableGet(c.mapping, s)) + var x = PSym(idTableGet(c.mapping, s)) if x == nil: x = copySym(s, false) x.owner = c.genSymOwner - IdTablePut(c.mapping, s, x) + idTablePut(c.mapping, s, x) result.add newSymNode(x, if c.instLines: actual.info else: templ.info) else: result.add copyNode(c, templ, actual) @@ -62,13 +62,13 @@ proc evalTemplateArgs(n: PNode, s: PSym): PNode = a = sonsLen(n) else: a = 0 var f = s.typ.sonsLen - if a > f: GlobalError(n.info, errWrongNumberOfArguments) + if a > f: globalError(n.info, errWrongNumberOfArguments) result = newNodeI(nkArgList, n.info) for i in countup(1, f - 1): var arg = if i < a: n.sons[i] else: copyTree(s.typ.n.sons[i].sym.ast) if arg == nil or arg.kind == nkEmpty: - LocalError(n.info, errWrongNumberOfArguments) + localError(n.info, errWrongNumberOfArguments) addSon(result, arg) var evalTemplateCounter* = 0 @@ -77,7 +77,7 @@ var evalTemplateCounter* = 0 proc evalTemplate*(n: PNode, tmpl, genSymOwner: PSym): PNode = inc(evalTemplateCounter) if evalTemplateCounter > 100: - GlobalError(n.info, errTemplateInstantiationTooNested) + globalError(n.info, errTemplateInstantiationTooNested) result = n # replace each param by the corresponding node: @@ -93,7 +93,7 @@ proc evalTemplate*(n: PNode, tmpl, genSymOwner: PSym): PNode = evalTemplateAux(body, args, ctx, result) if result.len == 1: result = result.sons[0] else: - GlobalError(result.info, errIllFormedAstX, + globalError(result.info, errIllFormedAstX, renderTree(result, {renderNoComments})) else: result = copyNode(body) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index 629cf95eb2..afcba8b4b8 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -346,13 +346,13 @@ proc getConfigVar(c: TSystemCC, suffix: string): string = result = getConfigVar(CC[c].name & suffix) proc setCC*(ccname: string) = - ccompiler = nameToCC(ccname) - if ccompiler == ccNone: rawMessage(errUnknownCcompiler, ccname) - compileOptions = getConfigVar(ccompiler, ".options.always") - linkOptions = getConfigVar(ccompiler, ".options.linker") - ccompilerpath = getConfigVar(ccompiler, ".path") + cCompiler = nameToCC(ccname) + if cCompiler == ccNone: rawMessage(errUnknownCcompiler, ccname) + compileOptions = getConfigVar(cCompiler, ".options.always") + linkOptions = getConfigVar(cCompiler, ".options.linker") + ccompilerpath = getConfigVar(cCompiler, ".path") for i in countup(low(CC), high(CC)): undefSymbol(CC[i].name) - defineSymbol(CC[ccompiler].name) + defineSymbol(CC[cCompiler].name) proc addOpt(dest: var string, src: string) = if len(dest) == 0 or dest[len(dest)-1] != ' ': add(dest, " ") @@ -368,20 +368,20 @@ proc addCompileOption*(option: string) = proc initVars*() = # we need to define the symbol here, because ``CC`` may have never been set! for i in countup(low(CC), high(CC)): undefSymbol(CC[i].name) - defineSymbol(CC[ccompiler].name) + defineSymbol(CC[cCompiler].name) if gCmd == cmdCompileToCpp: cExt = ".cpp" elif gCmd == cmdCompileToOC: cExt = ".m" - addCompileOption(getConfigVar(ccompiler, ".options.always")) - addLinkOption(getConfigVar(ccompiler, ".options.linker")) - if len(ccompilerPath) == 0: - ccompilerpath = getConfigVar(ccompiler, ".path") + addCompileOption(getConfigVar(cCompiler, ".options.always")) + addLinkOption(getConfigVar(cCompiler, ".options.linker")) + if len(ccompilerpath) == 0: + ccompilerpath = getConfigVar(cCompiler, ".path") proc completeCFilePath*(cfile: string, createSubDir: bool = true): string = result = completeGeneratedFilePath(cfile, createSubDir) proc toObjFile*(filenameWithoutExt: string): string = # Object file for compilation - result = changeFileExt(filenameWithoutExt, cc[ccompiler].objExt) + result = changeFileExt(filenameWithoutExt, CC[cCompiler].objExt) proc addFileToCompile*(filename: string) = appendStr(toCompile, filename) @@ -400,7 +400,7 @@ proc addFileToLink*(filename: string) = # BUGFIX: was ``appendStr`` proc execExternalProgram*(cmd: string) = - if optListCmd in gGlobalOptions or gVerbosity > 0: MsgWriteln(cmd) + if optListCmd in gGlobalOptions or gVerbosity > 0: msgWriteln(cmd) if execCmd(cmd) != 0: rawMessage(errExecutionOfProgramFailed, "") proc generateScript(projectFile: string, script: PRope) = @@ -411,17 +411,17 @@ proc generateScript(projectFile: string, script: PRope) = proc getOptSpeed(c: TSystemCC): string = result = getConfigVar(c, ".options.speed") if result == "": - result = cc[c].optSpeed # use default settings from this file + result = CC[c].optSpeed # use default settings from this file proc getDebug(c: TSystemCC): string = result = getConfigVar(c, ".options.debug") if result == "": - result = cc[c].debug # use default settings from this file + result = CC[c].debug # use default settings from this file proc getOptSize(c: TSystemCC): string = result = getConfigVar(c, ".options.size") if result == "": - result = cc[c].optSize # use default settings from this file + result = CC[c].optSize # use default settings from this file proc noAbsolutePaths: bool {.inline.} = # We used to check current OS != specified OS, but this makes no sense @@ -436,7 +436,7 @@ const var fileCounter: int -proc add(s: var string, many: openarray[string]) = +proc add(s: var string, many: openArray[string]) = s.add many.join proc cFileSpecificOptions(cfilename: string): string = @@ -445,69 +445,69 @@ proc cFileSpecificOptions(cfilename: string): string = if optCDebug in gGlobalOptions: var key = trunk & ".debug" if existsConfigVar(key): addOpt(result, getConfigVar(key)) - else: addOpt(result, getDebug(ccompiler)) + else: addOpt(result, getDebug(cCompiler)) if optOptimizeSpeed in gOptions: var key = trunk & ".speed" if existsConfigVar(key): addOpt(result, getConfigVar(key)) - else: addOpt(result, getOptSpeed(ccompiler)) + else: addOpt(result, getOptSpeed(cCompiler)) elif optOptimizeSize in gOptions: var key = trunk & ".size" if existsConfigVar(key): addOpt(result, getConfigVar(key)) - else: addOpt(result, getOptSize(ccompiler)) + else: addOpt(result, getOptSize(cCompiler)) var key = trunk & ".always" if existsConfigVar(key): addOpt(result, getConfigVar(key)) proc getCompileOptions: string = - result = CFileSpecificOptions("__dummy__") + result = cFileSpecificOptions("__dummy__") proc getLinkOptions: string = result = linkOptions for linkedLib in items(cLinkedLibs): - result.add(cc[ccompiler].linkLibCmd % linkedLib.quoteShell) + result.add(CC[cCompiler].linkLibCmd % linkedLib.quoteShell) for libDir in items(cLibs): - result.add([cc[ccompiler].linkDirCmd, libDir.quoteShell]) + result.add([CC[cCompiler].linkDirCmd, libDir.quoteShell]) proc needsExeExt(): bool {.inline.} = result = (optGenScript in gGlobalOptions and targetOS == osWindows) or (platform.hostOS == osWindows) proc getCompileCFileCmd*(cfilename: string, isExternal = false): string = - var c = ccompiler - var options = CFileSpecificOptions(cfilename) + var c = cCompiler + var options = cFileSpecificOptions(cfilename) var exe = getConfigVar(c, ".exe") - if exe.len == 0: exe = cc[c].compilerExe + if exe.len == 0: exe = CC[c].compilerExe if needsExeExt(): exe = addFileExt(exe, "exe") if optGenDynLib in gGlobalOptions and ospNeedsPIC in platform.OS[targetOS].props: - add(options, ' ' & cc[c].pic) + add(options, ' ' & CC[c].pic) var includeCmd, compilePattern: string if not noAbsolutePaths(): # compute include paths: - includeCmd = cc[c].includeCmd & quoteShell(libpath) + includeCmd = CC[c].includeCmd & quoteShell(libpath) for includeDir in items(cIncludes): - includeCmd.add([cc[c].includeCmd, includeDir.quoteShell]) + includeCmd.add([CC[c].includeCmd, includeDir.quoteShell]) - compilePattern = JoinPath(ccompilerpath, exe) + compilePattern = joinPath(ccompilerpath, exe) else: includeCmd = "" - compilePattern = cc[c].compilerExe + compilePattern = CC[c].compilerExe - var cfile = if noAbsolutePaths(): extractFileName(cfilename) + var cfile = if noAbsolutePaths(): extractFilename(cfilename) else: cfilename var objfile = if not isExternal or noAbsolutePaths(): toObjFile(cfile) else: completeCFilePath(toObjFile(cfile)) - cfile = quoteShell(AddFileExt(cfile, cExt)) + cfile = quoteShell(addFileExt(cfile, cExt)) objfile = quoteShell(objfile) result = quoteShell(compilePattern % [ "file", cfile, "objfile", objfile, "options", options, "include", includeCmd, "nimrod", getPrefixDir(), "lib", libpath]) add(result, ' ') - addf(result, cc[c].compileTmpl, [ + addf(result, CC[c].compileTmpl, [ "file", cfile, "objfile", objfile, "options", options, "include", includeCmd, "nimrod", quoteShell(getPrefixDir()), @@ -561,7 +561,7 @@ proc callCCompiler*(projectfile: string) = return # speed up that call if only compiling and no script shall be # generated fileCounter = 0 - var c = ccompiler + var c = cCompiler var script: PRope = nil var cmds: TStringSeq = @[] compileCFile(toCompile, script, cmds, false) @@ -591,40 +591,40 @@ proc callCCompiler*(projectfile: string) = let objFile = if noAbsolutePaths(): it.data.extractFilename else: it.data add(objfiles, ' ') add(objfiles, quoteShell( - addFileExt(objFile, cc[ccompiler].objExt))) + addFileExt(objFile, CC[cCompiler].objExt))) it = PStrEntry(it.next) if optGenStaticLib in gGlobalOptions: - linkcmd = cc[c].buildLib % ["libfile", (libNameTmpl() % gProjectName), + linkCmd = CC[c].buildLib % ["libfile", (libNameTmpl() % gProjectName), "objfiles", objfiles] if optCompileOnly notin gGlobalOptions: execExternalProgram(linkCmd) else: var linkerExe = getConfigVar(c, ".linkerexe") - if len(linkerExe) == 0: linkerExe = cc[c].linkerExe + if len(linkerExe) == 0: linkerExe = CC[c].linkerExe if needsExeExt(): linkerExe = addFileExt(linkerExe, "exe") if noAbsolutePaths(): linkCmd = quoteShell(linkerExe) - else: linkCmd = quoteShell(JoinPath(ccompilerpath, linkerExe)) - if optGenGuiApp in gGlobalOptions: buildGui = cc[c].buildGui - else: buildGui = "" + else: linkCmd = quoteShell(joinPath(ccompilerpath, linkerExe)) + if optGenGuiApp in gGlobalOptions: buildgui = CC[c].buildGui + else: buildgui = "" var exefile: string if optGenDynLib in gGlobalOptions: - exefile = platform.os[targetOS].dllFrmt % splitFile(projectFile).name - buildDll = cc[c].buildDll + exefile = platform.os[targetOS].dllFrmt % splitFile(projectfile).name + builddll = CC[c].buildDll else: - exefile = splitFile(projectFile).name & platform.os[targetOS].exeExt - buildDll = "" + exefile = splitFile(projectfile).name & platform.os[targetOS].exeExt + builddll = "" if options.outFile.len > 0: exefile = options.outFile if not noAbsolutePaths(): - if not exeFile.isAbsolute(): - exefile = joinPath(splitFile(projectFile).dir, exefile) + if not exefile.isAbsolute(): + exefile = joinPath(splitFile(projectfile).dir, exefile) exefile = quoteShell(exefile) let linkOptions = getLinkOptions() linkCmd = quoteShell(linkCmd % ["builddll", builddll, "buildgui", buildgui, "options", linkOptions, "objfiles", objfiles, "exefile", exefile, "nimrod", getPrefixDir(), "lib", libpath]) linkCmd.add ' ' - addf(linkCmd, cc[c].linkTmpl, ["builddll", builddll, + addf(linkCmd, CC[c].linkTmpl, ["builddll", builddll, "buildgui", buildgui, "options", linkOptions, "objfiles", objfiles, "exefile", exefile, "nimrod", quoteShell(getPrefixDir()), @@ -635,7 +635,7 @@ proc callCCompiler*(projectfile: string) = if optGenScript in gGlobalOptions: app(script, linkCmd) app(script, tnl) - generateScript(projectFile, script) + generateScript(projectfile, script) proc genMappingFiles(list: TLinkedList): PRope = var it = PStrEntry(list.head) diff --git a/compiler/filter_tmpl.nim b/compiler/filter_tmpl.nim index d16639d086..749d38b341 100644 --- a/compiler/filter_tmpl.nim +++ b/compiler/filter_tmpl.nim @@ -27,7 +27,7 @@ type indent, emitPar: int x: string # the current input line outp: PLLStream # the ouput will be parsed by pnimsyn - subsChar, NimDirective: Char + subsChar, NimDirective: char emit, conc, toStr: string curly, bracket, par: int pendingExprLine: bool @@ -37,11 +37,11 @@ const PatternChars = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF', '.', '_'} proc newLine(p: var TTmplParser) = - LLStreamWrite(p.outp, repeatChar(p.emitPar, ')')) + llStreamWrite(p.outp, repeatChar(p.emitPar, ')')) p.emitPar = 0 - if p.info.line > int16(1): LLStreamWrite(p.outp, "\n") + if p.info.line > int16(1): llStreamWrite(p.outp, "\n") if p.pendingExprLine: - LLStreamWrite(p.outp, repeatChar(2)) + llStreamWrite(p.outp, repeatChar(2)) p.pendingExprLine = false proc scanPar(p: var TTmplParser, d: int) = @@ -87,26 +87,26 @@ proc parseLine(p: var TTmplParser) = dec(p.indent, 2) else: p.info.col = int16(j) - LocalError(p.info, errXNotAllowedHere, "end") - LLStreamWrite(p.outp, repeatChar(p.indent)) - LLStreamWrite(p.outp, "#end") + localError(p.info, errXNotAllowedHere, "end") + llStreamWrite(p.outp, repeatChar(p.indent)) + llStreamWrite(p.outp, "#end") of wIf, wWhen, wTry, wWhile, wFor, wBlock, wCase, wProc, wIterator, wConverter, wMacro, wTemplate, wMethod: - LLStreamWrite(p.outp, repeatChar(p.indent)) - LLStreamWrite(p.outp, substr(p.x, d)) + llStreamWrite(p.outp, repeatChar(p.indent)) + llStreamWrite(p.outp, substr(p.x, d)) inc(p.indent, 2) of wElif, wOf, wElse, wExcept, wFinally: - LLStreamWrite(p.outp, repeatChar(p.indent - 2)) - LLStreamWrite(p.outp, substr(p.x, d)) + llStreamWrite(p.outp, repeatChar(p.indent - 2)) + llStreamWrite(p.outp, substr(p.x, d)) of wLet, wVar, wConst, wType: - LLStreamWrite(p.outp, repeatChar(p.indent)) - LLStreamWrite(p.outp, substr(p.x, d)) + llStreamWrite(p.outp, repeatChar(p.indent)) + llStreamWrite(p.outp, substr(p.x, d)) if not p.x.contains({':', '='}): # no inline element --> treat as block: inc(p.indent, 2) else: - LLStreamWrite(p.outp, repeatChar(p.indent)) - LLStreamWrite(p.outp, substr(p.x, d)) + llStreamWrite(p.outp, repeatChar(p.indent)) + llStreamWrite(p.outp, substr(p.x, d)) p.state = psDirective else: # data line @@ -118,15 +118,15 @@ proc parseLine(p: var TTmplParser) = case p.state of psTempl: # next line of string literal: - LLStreamWrite(p.outp, p.conc) - LLStreamWrite(p.outp, "\n") - LLStreamWrite(p.outp, repeatChar(p.indent + 2)) - LLStreamWrite(p.outp, "\"") + llStreamWrite(p.outp, p.conc) + llStreamWrite(p.outp, "\n") + llStreamWrite(p.outp, repeatChar(p.indent + 2)) + llStreamWrite(p.outp, "\"") of psDirective: newLine(p) - LLStreamWrite(p.outp, repeatChar(p.indent)) - LLStreamWrite(p.outp, p.emit) - LLStreamWrite(p.outp, "(\"") + llStreamWrite(p.outp, repeatChar(p.indent)) + llStreamWrite(p.outp, p.emit) + llStreamWrite(p.outp, "(\"") inc(p.emitPar) p.state = psTempl while true: @@ -134,17 +134,17 @@ proc parseLine(p: var TTmplParser) = of '\0': break of '\x01'..'\x1F', '\x80'..'\xFF': - LLStreamWrite(p.outp, "\\x") - LLStreamWrite(p.outp, toHex(ord(p.x[j]), 2)) + llStreamWrite(p.outp, "\\x") + llStreamWrite(p.outp, toHex(ord(p.x[j]), 2)) inc(j) of '\\': - LLStreamWrite(p.outp, "\\\\") + llStreamWrite(p.outp, "\\\\") inc(j) of '\'': - LLStreamWrite(p.outp, "\\\'") + llStreamWrite(p.outp, "\\\'") inc(j) of '\"': - LLStreamWrite(p.outp, "\\\"") + llStreamWrite(p.outp, "\\\"") inc(j) else: if p.x[j] == p.subsChar: @@ -153,59 +153,59 @@ proc parseLine(p: var TTmplParser) = case p.x[j] of '{': p.info.col = int16(j) - LLStreamWrite(p.outp, '\"') - LLStreamWrite(p.outp, p.conc) - LLStreamWrite(p.outp, p.toStr) - LLStreamWrite(p.outp, '(') + llStreamWrite(p.outp, '\"') + llStreamWrite(p.outp, p.conc) + llStreamWrite(p.outp, p.toStr) + llStreamWrite(p.outp, '(') inc(j) curly = 0 while true: case p.x[j] of '\0': - LocalError(p.info, errXExpected, "}") + localError(p.info, errXExpected, "}") break of '{': inc(j) inc(curly) - LLStreamWrite(p.outp, '{') + llStreamWrite(p.outp, '{') of '}': inc(j) if curly == 0: break if curly > 0: dec(curly) - LLStreamWrite(p.outp, '}') + llStreamWrite(p.outp, '}') else: - LLStreamWrite(p.outp, p.x[j]) + llStreamWrite(p.outp, p.x[j]) inc(j) - LLStreamWrite(p.outp, ')') - LLStreamWrite(p.outp, p.conc) - LLStreamWrite(p.outp, '\"') + llStreamWrite(p.outp, ')') + llStreamWrite(p.outp, p.conc) + llStreamWrite(p.outp, '\"') of 'a'..'z', 'A'..'Z', '\x80'..'\xFF': - LLStreamWrite(p.outp, '\"') - LLStreamWrite(p.outp, p.conc) - LLStreamWrite(p.outp, p.toStr) - LLStreamWrite(p.outp, '(') + llStreamWrite(p.outp, '\"') + llStreamWrite(p.outp, p.conc) + llStreamWrite(p.outp, p.toStr) + llStreamWrite(p.outp, '(') while p.x[j] in PatternChars: - LLStreamWrite(p.outp, p.x[j]) + llStreamWrite(p.outp, p.x[j]) inc(j) - LLStreamWrite(p.outp, ')') - LLStreamWrite(p.outp, p.conc) - LLStreamWrite(p.outp, '\"') + llStreamWrite(p.outp, ')') + llStreamWrite(p.outp, p.conc) + llStreamWrite(p.outp, '\"') else: if p.x[j] == p.subsChar: - LLStreamWrite(p.outp, p.subsChar) + llStreamWrite(p.outp, p.subsChar) inc(j) else: p.info.col = int16(j) - LocalError(p.info, errInvalidExpression, "$") + localError(p.info, errInvalidExpression, "$") else: - LLStreamWrite(p.outp, p.x[j]) + llStreamWrite(p.outp, p.x[j]) inc(j) - LLStreamWrite(p.outp, "\\n\"") + llStreamWrite(p.outp, "\\n\"") proc filterTmpl(stdin: PLLStream, filename: string, call: PNode): PLLStream = var p: TTmplParser p.info = newLineInfo(filename, 0, 0) - p.outp = LLStreamOpen("") + p.outp = llStreamOpen("") p.inp = stdin p.subsChar = charArg(call, "subschar", 1, '$') p.nimDirective = charArg(call, "metachar", 2, '#') @@ -213,9 +213,9 @@ proc filterTmpl(stdin: PLLStream, filename: string, call: PNode): PLLStream = p.conc = strArg(call, "conc", 4, " & ") p.toStr = strArg(call, "tostring", 5, "$") p.x = newStringOfCap(120) - while LLStreamReadLine(p.inp, p.x): + while llStreamReadLine(p.inp, p.x): p.info.line = p.info.line + int16(1) parseLine(p) newLine(p) result = p.outp - LLStreamClose(p.inp) + llStreamClose(p.inp) diff --git a/compiler/filters.nim b/compiler/filters.nim index 19da11bca3..db8731d8ca 100644 --- a/compiler/filters.nim +++ b/compiler/filters.nim @@ -16,13 +16,13 @@ import proc filterReplace*(stdin: PLLStream, filename: string, call: PNode): PLLStream proc filterStrip*(stdin: PLLStream, filename: string, call: PNode): PLLStream # helpers to retrieve arguments: -proc charArg*(n: PNode, name: string, pos: int, default: Char): Char +proc charArg*(n: PNode, name: string, pos: int, default: char): char proc strArg*(n: PNode, name: string, pos: int, default: string): string proc boolArg*(n: PNode, name: string, pos: int, default: bool): bool # implementation proc invalidPragma(n: PNode) = - LocalError(n.info, errXNotAllowedHere, renderTree(n, {renderNoComments})) + localError(n.info, errXNotAllowedHere, renderTree(n, {renderNoComments})) proc getArg(n: PNode, name: string, pos: int): PNode = result = nil @@ -30,7 +30,7 @@ proc getArg(n: PNode, name: string, pos: int): PNode = for i in countup(1, sonsLen(n) - 1): if n.sons[i].kind == nkExprEqExpr: if n.sons[i].sons[0].kind != nkIdent: invalidPragma(n) - if IdentEq(n.sons[i].sons[0].ident, name): + if identEq(n.sons[i].sons[0].ident, name): return n.sons[i].sons[1] elif i == pos: return n.sons[i] @@ -50,30 +50,30 @@ proc strArg(n: PNode, name: string, pos: int, default: string): string = proc boolArg(n: PNode, name: string, pos: int, default: bool): bool = var x = getArg(n, name, pos) if x == nil: result = default - elif (x.kind == nkIdent) and IdentEq(x.ident, "true"): result = true - elif (x.kind == nkIdent) and IdentEq(x.ident, "false"): result = false + elif (x.kind == nkIdent) and identEq(x.ident, "true"): result = true + elif (x.kind == nkIdent) and identEq(x.ident, "false"): result = false else: invalidPragma(n) proc filterStrip(stdin: PLLStream, filename: string, call: PNode): PLLStream = var pattern = strArg(call, "startswith", 1, "") var leading = boolArg(call, "leading", 2, true) var trailing = boolArg(call, "trailing", 3, true) - result = LLStreamOpen("") + result = llStreamOpen("") var line = newStringOfCap(80) - while LLStreamReadLine(stdin, line): + while llStreamReadLine(stdin, line): var stripped = strip(line, leading, trailing) if (len(pattern) == 0) or startsWith(stripped, pattern): - LLStreamWriteln(result, stripped) + llStreamWriteln(result, stripped) else: - LLStreamWriteln(result, line) - LLStreamClose(stdin) + llStreamWriteln(result, line) + llStreamClose(stdin) proc filterReplace(stdin: PLLStream, filename: string, call: PNode): PLLStream = var sub = strArg(call, "sub", 1, "") if len(sub) == 0: invalidPragma(call) var by = strArg(call, "by", 2, "") - result = LLStreamOpen("") + result = llStreamOpen("") var line = newStringOfCap(80) - while LLStreamReadLine(stdin, line): - LLStreamWriteln(result, replace(line, sub, by)) - LLStreamClose(stdin) + while llStreamReadLine(stdin, line): + llStreamWriteln(result, replace(line, sub, by)) + llStreamClose(stdin) diff --git a/compiler/guards.nim b/compiler/guards.nim index 8d271fa6dc..b35d9b8720 100644 --- a/compiler/guards.nim +++ b/compiler/guards.nim @@ -251,7 +251,7 @@ proc invalidateFacts*(m: var TModel, n: PNode) = proc valuesUnequal(a, b: PNode): bool = if a.isValue and b.isValue: - result = not SameValue(a, b) + result = not sameValue(a, b) proc pred(n: PNode): PNode = if n.kind in {nkCharLit..nkUInt64Lit} and n.intVal != low(biggestInt): @@ -484,7 +484,7 @@ proc factImplies(fact, prop: PNode): TImplication = if a == b: return ~a return impUnknown else: - InternalError(fact.info, "invalid fact") + internalError(fact.info, "invalid fact") of mAnd: result = factImplies(fact.sons[1], prop) if result != impUnknown: return result @@ -575,4 +575,4 @@ proc checkFieldAccess*(m: TModel, n: PNode) = for i in 1..n.len-1: let check = buildProperFieldCheck(n.sons[0], n.sons[i]) if m.doesImply(check) != impYes: - Message(n.info, warnProveField, renderTree(n.sons[0])); break + message(n.info, warnProveField, renderTree(n.sons[0])); break diff --git a/compiler/hlo.nim b/compiler/hlo.nim index 1492ed76f9..7905761dd8 100644 --- a/compiler/hlo.nim +++ b/compiler/hlo.nim @@ -28,7 +28,7 @@ proc evalPattern(c: PContext, n, orig: PNode): PNode = else: result = semDirectOp(c, n, {}) if optHints in gOptions and hintPattern in gNotes: - Message(orig.info, hintPattern, rule & " --> '" & + message(orig.info, hintPattern, rule & " --> '" & renderTree(result, {renderNoComments}) & "'") proc applyPatterns(c: PContext, n: PNode): PNode = @@ -45,7 +45,7 @@ proc applyPatterns(c: PContext, n: PNode): PNode = # better be safe than sorry, so check evalTemplateCounter too: inc(evalTemplateCounter) if evalTemplateCounter > 100: - GlobalError(n.info, errTemplateInstantiationTooNested) + globalError(n.info, errTemplateInstantiationTooNested) # deactivate this pattern: c.patterns[i] = nil if x.kind == nkStmtList: diff --git a/compiler/idgen.nim b/compiler/idgen.nim index f47e2e3b64..5a1c909305 100644 --- a/compiler/idgen.nim +++ b/compiler/idgen.nim @@ -38,7 +38,7 @@ proc setId*(id: int) {.inline.} = gFrontEndId = max(gFrontEndId, id + 1) proc idSynchronizationPoint*(idRange: int) = - gFrontEndId = (gFrontEndId div IdRange + 1) * IdRange + 1 + gFrontEndId = (gFrontEndId div idRange + 1) * idRange + 1 proc toGid(f: string): string = # we used to use ``f.addFileExt("gid")`` (aka ``$project.gid``), but this @@ -49,7 +49,7 @@ proc toGid(f: string): string = proc saveMaxIds*(project: string) = var f = open(project.toGid, fmWrite) f.writeln($gFrontEndId) - f.writeln($gBackEndId) + f.writeln($gBackendId) f.close() proc loadMaxIds*(project: string) = @@ -61,5 +61,5 @@ proc loadMaxIds*(project: string) = if f.readLine(line): var backEndId = parseInt(line) gFrontEndId = max(gFrontEndId, frontEndId) - gBackEndId = max(gBackEndId, backEndId) + gBackendId = max(gBackendId, backEndId) f.close() diff --git a/compiler/importer.nim b/compiler/importer.nim index 8b854bcc68..24779f2ae6 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -22,7 +22,7 @@ proc getModuleName*(n: PNode): string = # The proc won't perform any checks that the path is actually valid case n.kind of nkStrLit, nkRStrLit, nkTripleStrLit: - result = UnixToNativePath(n.strVal) + result = unixToNativePath(n.strVal) of nkIdent: result = n.ident.s of nkSym: @@ -50,7 +50,7 @@ proc checkModuleName*(n: PNode): int32 = let modulename = n.getModuleName let fullPath = findModule(modulename, n.info.toFullPath) if fullPath.len == 0: - LocalError(n.info, errCannotOpenFile, modulename) + localError(n.info, errCannotOpenFile, modulename) result = InvalidFileIDX else: result = fullPath.fileInfoIdx @@ -59,32 +59,32 @@ proc rawImportSymbol(c: PContext, s: PSym) = # This does not handle stubs, because otherwise loading on demand would be # pointless in practice. So importing stubs is fine here! # check if we have already a symbol of the same name: - var check = StrTableGet(c.importTable.symbols, s.name) + var check = strTableGet(c.importTable.symbols, s.name) if check != nil and check.id != s.id: if s.kind notin OverloadableSyms: # s and check need to be qualified: - Incl(c.AmbiguousSymbols, s.id) - Incl(c.AmbiguousSymbols, check.id) + incl(c.AmbiguousSymbols, s.id) + incl(c.AmbiguousSymbols, check.id) # thanks to 'export' feature, it could be we import the same symbol from # multiple sources, so we need to call 'StrTableAdd' here: - StrTableAdd(c.importTable.symbols, s) + strTableAdd(c.importTable.symbols, s) if s.kind == skType: var etyp = s.typ if etyp.kind in {tyBool, tyEnum} and sfPure notin s.flags: for j in countup(0, sonsLen(etyp.n) - 1): var e = etyp.n.sons[j].sym if e.Kind != skEnumField: - InternalError(s.info, "rawImportSymbol") + internalError(s.info, "rawImportSymbol") # BUGFIX: because of aliases for enums the symbol may already # have been put into the symbol table # BUGFIX: but only iff they are the same symbols! var it: TIdentIter - check = InitIdentIter(it, c.importTable.symbols, e.name) + check = initIdentIter(it, c.importTable.symbols, e.name) while check != nil: if check.id == e.id: e = nil break - check = NextIdentIter(it, c.importTable.symbols) + check = nextIdentIter(it, c.importTable.symbols) if e != nil: rawImportSymbol(c, e) else: @@ -94,36 +94,36 @@ proc rawImportSymbol(c: PContext, s: PSym) = proc importSymbol(c: PContext, n: PNode, fromMod: PSym) = let ident = lookups.considerAcc(n) - let s = StrTableGet(fromMod.tab, ident) + let s = strTableGet(fromMod.tab, ident) if s == nil: - LocalError(n.info, errUndeclaredIdentifier, ident.s) + localError(n.info, errUndeclaredIdentifier, ident.s) else: if s.kind == skStub: loadStub(s) if s.Kind notin ExportableSymKinds: - InternalError(n.info, "importSymbol: 2") + internalError(n.info, "importSymbol: 2") # for an enumeration we have to add all identifiers case s.Kind of skProc, skMethod, skIterator, skMacro, skTemplate, skConverter: # for a overloadable syms add all overloaded routines var it: TIdentIter - var e = InitIdentIter(it, fromMod.tab, s.name) + var e = initIdentIter(it, fromMod.tab, s.name) while e != nil: - if e.name.id != s.Name.id: InternalError(n.info, "importSymbol: 3") + if e.name.id != s.Name.id: internalError(n.info, "importSymbol: 3") rawImportSymbol(c, e) - e = NextIdentIter(it, fromMod.tab) + e = nextIdentIter(it, fromMod.tab) else: rawImportSymbol(c, s) proc importAllSymbolsExcept(c: PContext, fromMod: PSym, exceptSet: TIntSet) = var i: TTabIter - var s = InitTabIter(i, fromMod.tab) + var s = initTabIter(i, fromMod.tab) while s != nil: if s.kind != skModule: if s.kind != skEnumField: if s.Kind notin ExportableSymKinds: - InternalError(s.info, "importAllSymbols: " & $s.kind) + internalError(s.info, "importAllSymbols: " & $s.kind) if exceptSet.empty or s.name.id notin exceptSet: rawImportSymbol(c, s) - s = NextIter(i, fromMod.tab) + s = nextIter(i, fromMod.tab) proc importAllSymbols*(c: PContext, fromMod: PSym) = var exceptSet: TIntSet @@ -160,7 +160,7 @@ proc myImportModule(c: PContext, n: PNode): PSym = if f != InvalidFileIDX: result = importModuleAs(n, gImportModule(c.module, f)) if sfDeprecated in result.flags: - Message(n.info, warnDeprecated, result.name.s) + message(n.info, warnDeprecated, result.name.s) proc evalImport(c: PContext, n: PNode): PNode = result = n diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index a3c88824d0..8fd72623ae 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -175,7 +175,7 @@ proc useMagic(p: PProc, name: string) = # we used to exclude the system module from this check, but for DLL # generation support this sloppyness leads to hard to detect bugs, so # we're picky here for the system module too: - if p.prc != nil: GlobalError(p.prc.info, errSystemNeeds, name) + if p.prc != nil: globalError(p.prc.info, errSystemNeeds, name) else: rawMessage(errSystemNeeds, name) proc isSimpleExpr(n: PNode): bool = @@ -504,7 +504,7 @@ proc genWhileStmt(p: PProc, n: PNode) = genLineDir(p, n) inc(p.unique) var length = len(p.blocks) - setlen(p.blocks, length + 1) + setLen(p.blocks, length + 1) p.blocks[length].id = -p.unique p.blocks[length].isLoop = true let labl = p.unique.toRope @@ -514,7 +514,7 @@ proc genWhileStmt(p: PProc, n: PNode) = [cond.res, labl]) genStmt(p, n.sons[1]) appf(p.body, "}$n" | "end ::L$#::$n", [labl]) - setlen(p.blocks, length) + setLen(p.blocks, length) proc moveInto(p: PProc, src: var TCompRes, dest: TCompRes) = if src.kind != resNone: @@ -579,7 +579,7 @@ proc genTry(p: PProc, n: PNode, r: var TCompRes) = useMagic(p, "isObj") for j in countup(0, blen - 2): if n.sons[i].sons[j].kind != nkType: - InternalError(n.info, "genTryStmt") + internalError(n.info, "genTryStmt") if orExpr != nil: app(orExpr, "||" | " or ") appf(orExpr, "isObj($1.exc.m_type, $2)", [safePoint, genTypeInfo(p, n.sons[i].sons[j].typ)]) @@ -641,13 +641,13 @@ proc genCaseJS(p: PProc, n: PNode, r: var TCompRes) = while v.intVal <= e.sons[1].intVal: gen(p, v, cond) appf(p.body, "case $1: ", [cond.rdLoc]) - Inc(v.intVal) + inc(v.intVal) else: if stringSwitch: case e.kind of nkStrLit..nkTripleStrLit: appf(p.body, "case $1: ", [makeJSString(e.strVal)]) - else: InternalError(e.info, "jsgen.genCaseStmt: 2") + else: internalError(e.info, "jsgen.genCaseStmt: 2") else: gen(p, e, cond) appf(p.body, "case $1: ", [cond.rdLoc]) @@ -694,7 +694,7 @@ proc genCaseLua(p: PProc, n: PNode, r: var TCompRes) = case e.kind of nkStrLit..nkTripleStrLit: appf(p.body, "eqStr($1, $2)", [tmp, makeJSString(e.strVal)]) - else: InternalError(e.info, "jsgen.genCaseStmt: 2") + else: internalError(e.info, "jsgen.genCaseStmt: 2") else: gen(p, e, cond) appf(p.body, "$1 == $2", [tmp, cond.rdLoc]) @@ -713,17 +713,17 @@ proc genBlock(p: PProc, n: PNode, r: var TCompRes) = let idx = len(p.blocks) if n.sons[0].kind != nkEmpty: # named block? - if (n.sons[0].kind != nkSym): InternalError(n.info, "genBlock") + if (n.sons[0].kind != nkSym): internalError(n.info, "genBlock") var sym = n.sons[0].sym sym.loc.k = locOther sym.loc.a = idx - setlen(p.blocks, idx + 1) + setLen(p.blocks, idx + 1) p.blocks[idx].id = - p.unique # negative because it isn't used yet let labl = p.unique appf(p.body, "L$1: do {$n" | "", labl.toRope) gen(p, n.sons[1], r) appf(p.body, "} while(false);$n" | "$n::L$#::$n", labl.toRope) - setlen(p.blocks, idx) + setLen(p.blocks, idx) proc genBreakStmt(p: PProc, n: PNode) = var idx: int @@ -739,7 +739,7 @@ proc genBreakStmt(p: PProc, n: PNode) = idx = len(p.blocks) - 1 while idx >= 0 and not p.blocks[idx].isLoop: dec idx if idx < 0 or not p.blocks[idx].isLoop: - InternalError(n.info, "no loop to break") + internalError(n.info, "no loop to break") p.blocks[idx].id = abs(p.blocks[idx].id) # label is used appf(p.body, "break L$1;$n" | "goto ::L$1::;$n", [toRope(p.blocks[idx].id)]) @@ -750,7 +750,7 @@ proc genAsmStmt(p: PProc, n: PNode) = case n.sons[i].Kind of nkStrLit..nkTripleStrLit: app(p.body, n.sons[i].strVal) of nkSym: app(p.body, mangleName(n.sons[i].sym)) - else: InternalError(n.sons[i].info, "jsgen: genAsmStmt()") + else: internalError(n.sons[i].info, "jsgen: genAsmStmt()") proc genIf(p: PProc, n: PNode, r: var TCompRes) = var cond, stmt: TCompRes @@ -851,7 +851,7 @@ proc getFieldPosition(f: PNode): int = case f.kind of nkIntLit..nkUInt64Lit: result = int(f.intVal) of nkSym: result = f.sym.position - else: InternalError(f.info, "genFieldPosition") + else: internalError(f.info, "genFieldPosition") proc genFieldAddr(p: PProc, n: PNode, r: var TCompRes) = var a: TCompRes @@ -861,7 +861,7 @@ proc genFieldAddr(p: PProc, n: PNode, r: var TCompRes) = if skipTypes(b.sons[0].typ, abstractVarRange).kind == tyTuple: r.res = makeJSString("Field" & $getFieldPosition(b.sons[1])) else: - if b.sons[1].kind != nkSym: InternalError(b.sons[1].info, "genFieldAddr") + if b.sons[1].kind != nkSym: internalError(b.sons[1].info, "genFieldAddr") var f = b.sons[1].sym if f.loc.r == nil: f.loc.r = mangleName(f) r.res = makeJSString(ropeToStr(f.loc.r)) @@ -875,7 +875,7 @@ proc genFieldAccess(p: PProc, n: PNode, r: var TCompRes) = if skipTypes(n.sons[0].typ, abstractVarRange).kind == tyTuple: r.res = ropef("$1.Field$2", [r.res, getFieldPosition(n.sons[1]).toRope]) else: - if n.sons[1].kind != nkSym: InternalError(n.sons[1].info, "genFieldAddr") + if n.sons[1].kind != nkSym: internalError(n.sons[1].info, "genFieldAddr") var f = n.sons[1].sym if f.loc.r == nil: f.loc.r = mangleName(f) r.res = ropef("$1.$2", [r.res, f.loc.r]) @@ -890,14 +890,14 @@ proc genCheckedFieldAccess(p: PProc, n: PNode, r: var TCompRes) = proc genArrayAddr(p: PProc, n: PNode, r: var TCompRes) = var a, b: TCompRes - first: biggestInt + first: BiggestInt r.typ = etyBaseIndex gen(p, n.sons[0], a) gen(p, n.sons[1], b) InternalAssert a.typ != etyBaseIndex and b.typ != etyBaseIndex r.address = a.res var typ = skipTypes(n.sons[0].typ, abstractPtrs) - if typ.kind in {tyArray, tyArrayConstr}: first = FirstOrd(typ.sons[0]) + if typ.kind in {tyArray, tyArrayConstr}: first = firstOrd(typ.sons[0]) else: first = 0 if optBoundsCheck in p.options and not isConstExpr(n.sons[1]): useMagic(p, "chckIndx") @@ -918,9 +918,9 @@ proc genArrayAccess(p: PProc, n: PNode, r: var TCompRes) = genArrayAddr(p, n, r) of tyTuple: genFieldAddr(p, n, r) - else: InternalError(n.info, "expr(nkBracketExpr, " & $ty.kind & ')') + else: internalError(n.info, "expr(nkBracketExpr, " & $ty.kind & ')') r.typ = etyNone - if r.res == nil: InternalError(n.info, "genArrayAccess") + if r.res == nil: internalError(n.info, "genArrayAccess") r.res = ropef("$1[$2]", [r.address, r.res]) r.address = nil r.kind = resExpr @@ -929,7 +929,7 @@ proc genAddr(p: PProc, n: PNode, r: var TCompRes) = case n.sons[0].kind of nkSym: let s = n.sons[0].sym - if s.loc.r == nil: InternalError(n.info, "genAddr: 3") + if s.loc.r == nil: internalError(n.info, "genAddr: 3") case s.kind of skVar, skLet, skResult: r.kind = resExpr @@ -948,8 +948,8 @@ proc genAddr(p: PProc, n: PNode, r: var TCompRes) = r.address = s.loc.r r.res = toRope("0") else: - InternalError(n.info, "genAddr: 4") - else: InternalError(n.info, "genAddr: 2") + internalError(n.info, "genAddr: 4") + else: internalError(n.info, "genAddr: 2") of nkCheckedFieldExpr: genCheckedFieldAddr(p, n, r) of nkDotExpr: @@ -963,15 +963,15 @@ proc genAddr(p: PProc, n: PNode, r: var TCompRes) = genArrayAddr(p, n, r) of tyTuple: genFieldAddr(p, n, r) - else: InternalError(n.info, "expr(nkBracketExpr, " & $ty.kind & ')') - else: InternalError(n.info, "genAddr") + else: internalError(n.info, "expr(nkBracketExpr, " & $ty.kind & ')') + else: internalError(n.info, "genAddr") proc genSym(p: PProc, n: PNode, r: var TCompRes) = var s = n.sym case s.kind of skVar, skLet, skParam, skTemp, skResult: if s.loc.r == nil: - InternalError(n.info, "symbol has no generated name: " & s.name.s) + internalError(n.info, "symbol has no generated name: " & s.name.s) var k = mapType(s.typ) if k == etyBaseIndex: r.typ = etyBaseIndex @@ -988,7 +988,7 @@ proc genSym(p: PProc, n: PNode, r: var TCompRes) = of skConst: genConstant(p, s) if s.loc.r == nil: - InternalError(n.info, "symbol has no generated name: " & s.name.s) + internalError(n.info, "symbol has no generated name: " & s.name.s) r.res = s.loc.r of skProc, skConverter, skMethod: discard mangleName(s) @@ -1010,7 +1010,7 @@ proc genSym(p: PProc, n: PNode, r: var TCompRes) = else: app(p.g.code, newp) else: if s.loc.r == nil: - InternalError(n.info, "symbol has no generated name: " & s.name.s) + internalError(n.info, "symbol has no generated name: " & s.name.s) r.res = s.loc.r r.kind = resVal @@ -1020,7 +1020,7 @@ proc genDeref(p: PProc, n: PNode, r: var TCompRes) = else: var a: TCompRes gen(p, n.sons[0], a) - if a.typ != etyBaseIndex: InternalError(n.info, "genDeref") + if a.typ != etyBaseIndex: internalError(n.info, "genDeref") r.res = ropef("$1[$2]", [a.address, a.res]) proc genArg(p: PProc, n: PNode, r: var TCompRes) = @@ -1051,7 +1051,7 @@ proc genInfixCall(p: PProc, n: PNode, r: var TCompRes) = gen(p, n.sons[1], r) if r.typ == etyBaseIndex: if r.address == nil: - GlobalError(n.info, "cannot invoke with infix syntax") + globalError(n.info, "cannot invoke with infix syntax") r.res = ropef("$1[$2]", [r.address, r.res]) r.address = nil r.typ = etyNone @@ -1093,7 +1093,7 @@ proc createRecordVarAux(p: PProc, rec: PNode, c: var int): PRope = app(result, ": ") app(result, createVar(p, rec.sym.typ, false)) inc(c) - else: InternalError(rec.info, "createRecordVarAux") + else: internalError(rec.info, "createRecordVarAux") proc createVar(p: PProc, typ: PType, indirect: bool): PRope = var t = skipTypes(typ, abstractInst) @@ -1125,7 +1125,7 @@ proc createVar(p: PProc, typ: PType, indirect: bool): PRope = app(result, "]") of tyTuple: result = toRope("{") - for i in 0.. <t.sonslen: + for i in 0.. <t.sonsLen: if i > 0: app(result, ", ") appf(result, "Field$1: $2" | "Field$# = $#", i.toRope, createVar(p, t.sons[i], false)) @@ -1173,7 +1173,7 @@ proc genVarInit(p: PProc, v: PSym, n: PNode) = useMagic(p, "NimCopy") s = ropef("NimCopy($1, $2)", [a.res, genTypeInfo(p, n.typ)]) of etyBaseIndex: - if (a.typ != etyBaseIndex): InternalError(n.info, "genVarInit") + if (a.typ != etyBaseIndex): internalError(n.info, "genVarInit") if {sfAddrTaken, sfGlobal} * v.flags != {}: appf(p.body, "var $1 = [$2, $3];$n" | "local $1 = {$2, $3};$n", [v.loc.r, a.address, a.res]) @@ -1227,7 +1227,7 @@ proc genOrd(p: PProc, n: PNode, r: var TCompRes) = case skipTypes(n.sons[1].typ, abstractVar).kind of tyEnum, tyInt..tyInt64, tyChar: gen(p, n.sons[1], r) of tyBool: unaryExpr(p, n, r, "", "($1 ? 1:0)" | "toBool($#)") - else: InternalError(n.info, "genOrd") + else: internalError(n.info, "genOrd") proc genConStrStr(p: PProc, n: PNode, r: var TCompRes) = var a: TCompRes @@ -1451,7 +1451,7 @@ proc convStrToCStr(p: PProc, n: PNode, r: var TCompRes) = gen(p, n.sons[0].sons[0], r) else: gen(p, n.sons[0], r) - if r.res == nil: InternalError(n.info, "convStrToCStr") + if r.res == nil: internalError(n.info, "convStrToCStr") useMagic(p, "toJSStr") r.res = ropef("toJSStr($1)", [r.res]) r.kind = resExpr @@ -1463,13 +1463,13 @@ proc convCStrToStr(p: PProc, n: PNode, r: var TCompRes) = gen(p, n.sons[0].sons[0], r) else: gen(p, n.sons[0], r) - if r.res == nil: InternalError(n.info, "convCStrToStr") + if r.res == nil: internalError(n.info, "convCStrToStr") useMagic(p, "cstrToNimstr") r.res = ropef("cstrToNimstr($1)", [r.res]) r.kind = resExpr proc genReturnStmt(p: PProc, n: PNode) = - if p.procDef == nil: InternalError(n.info, "genReturnStmt") + if p.procDef == nil: internalError(n.info, "genReturnStmt") p.BeforeRetNeeded = true if (n.sons[0].kind != nkEmpty): genStmt(p, n.sons[0]) @@ -1564,7 +1564,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) = elif f == 0.5 * f: if f > 0.0: r.res = toRope"Infinity" else: r.res = toRope"-Infinity" - else: r.res = toRope(f.ToStrMaxPrecision) + else: r.res = toRope(f.toStrMaxPrecision) of nkCallKinds: if (n.sons[0].kind == nkSym) and (n.sons[0].sym.magic != mNone): genMagic(p, n, r) @@ -1640,7 +1640,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) = r.res = nil of nkGotoState, nkState: internalError(n.info, "first class iterators not implemented") - else: InternalError(n.info, "gen: unknown node type: " & $n.kind) + else: internalError(n.info, "gen: unknown node type: " & $n.kind) var globals: PGlobals @@ -1671,7 +1671,7 @@ proc myProcess(b: PPassContext, n: PNode): PNode = if passes.skipCodegen(n): return n result = n var m = BModule(b) - if m.module == nil: InternalError(n.info, "myProcess") + if m.module == nil: internalError(n.info, "myProcess") var p = newProc(globals, m, nil, m.module.options) genModule(p, n) app(p.g.code, p.locals) @@ -1702,7 +1702,7 @@ proc myClose(b: PPassContext, n: PNode): PNode = discard writeRopeIfNotEqual(con(genHeader(), code), outfile) proc myOpenCached(s: PSym, rd: PRodReader): PPassContext = - InternalError("symbol files are not possible with the JS code generator") + internalError("symbol files are not possible with the JS code generator") result = nil proc myOpen(s: PSym): PPassContext = diff --git a/compiler/jstypes.nim b/compiler/jstypes.nim index 0be1e99dc2..cbe87bbc19 100644 --- a/compiler/jstypes.nim +++ b/compiler/jstypes.nim @@ -37,7 +37,7 @@ proc genObjectFields(p: PProc, typ: PType, n: PNode): PRope = [mangleName(field), s, makeJSString(field.name.s)]) of nkRecCase: length = sonsLen(n) - if (n.sons[0].kind != nkSym): InternalError(n.info, "genObjectFields") + if (n.sons[0].kind != nkSym): internalError(n.info, "genObjectFields") field = n.sons[0].sym s = genTypeInfo(p, field.typ) for i in countup(1, length - 1): @@ -98,7 +98,7 @@ proc genEnumInfo(p: PProc, typ: PType, name: PRope) = let length = sonsLen(typ.n) var s: PRope = nil for i in countup(0, length - 1): - if (typ.n.sons[i].kind != nkSym): InternalError(typ.n.info, "genEnumInfo") + if (typ.n.sons[i].kind != nkSym): internalError(typ.n.info, "genEnumInfo") let field = typ.n.sons[i].sym if i > 0: app(s, ", " & tnl) let extName = if field.ast == nil: field.name.s else: field.ast.strVal @@ -119,7 +119,7 @@ proc genTypeInfo(p: PProc, typ: PType): PRope = var t = typ if t.kind == tyGenericInst: t = lastSon(t) result = ropef("NTI$1", [toRope(t.id)]) - if ContainsOrIncl(p.g.TypeInfoGenerated, t.id): return + if containsOrIncl(p.g.TypeInfoGenerated, t.id): return case t.kind of tyDistinct: result = genTypeInfo(p, typ.sons[0]) @@ -145,4 +145,4 @@ proc genTypeInfo(p: PProc, typ: PType): PRope = of tyEnum: genEnumInfo(p, t, result) of tyObject: genObjectInfo(p, t, result) of tyTuple: genTupleInfo(p, t, result) - else: InternalError("genTypeInfo(" & $t.kind & ')') + else: internalError("genTypeInfo(" & $t.kind & ')') diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index dd48a0bc3f..558b2cfd39 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -236,8 +236,8 @@ proc addClosureParam(i: PInnerContext, e: PEnv) = proc dummyClosureParam(o: POuterContext, i: PInnerContext) = var e = o.currentEnv - if IdTableGet(o.lambdasToEnv, i.fn) == nil: - IdTablePut(o.lambdasToEnv, i.fn, e) + if idTableGet(o.lambdasToEnv, i.fn) == nil: + idTablePut(o.lambdasToEnv, i.fn, e) if i.closureParam == nil: addClosureParam(i, e) proc illegalCapture(s: PSym): bool {.inline.} = @@ -249,13 +249,13 @@ proc captureVar(o: POuterContext, i: PInnerContext, local: PSym, info: TLineInfo) = # for inlined variables the owner is still wrong, so it can happen that it's # not a captured variable at all ... *sigh* - var it = PEnv(IdTableGet(o.localsToEnv, local)) + var it = PEnv(idTableGet(o.localsToEnv, local)) if it == nil: return if illegalCapture(local) or o.fn.id != local.owner.id or i.fn.typ.callConv notin {ccClosure, ccDefault}: # Currently captures are restricted to a single level of nesting: - LocalError(info, errIllegalCaptureX, local.name.s) + localError(info, errIllegalCaptureX, local.name.s) i.fn.typ.callConv = ccClosure #echo "captureVar ", i.fn.name.s, i.fn.id, " ", local.name.s, local.id @@ -263,11 +263,11 @@ proc captureVar(o: POuterContext, i: PInnerContext, local: PSym, # we need to remember which inner most closure belongs to this lambda: var e = o.currentEnv - if IdTableGet(o.lambdasToEnv, i.fn) == nil: - IdTablePut(o.lambdasToEnv, i.fn, e) + if idTableGet(o.lambdasToEnv, i.fn) == nil: + idTablePut(o.lambdasToEnv, i.fn, e) # variable already captured: - if IdNodeTableGet(i.localsToAccess, local) != nil: return + if idNodeTableGet(i.localsToAccess, local) != nil: return if i.closureParam == nil: addClosureParam(i, e) # check which environment `local` belongs to: @@ -281,7 +281,7 @@ proc captureVar(o: POuterContext, i: PInnerContext, local: PSym, access = indirectAccess(access, addDep(e, it, i.fn), info) access = indirectAccess(access, local, info) incl(o.capturedVars, local.id) - IdNodeTablePut(i.localsToAccess, local, access) + idNodeTablePut(i.localsToAccess, local, access) proc interestingVar(s: PSym): bool {.inline.} = result = s.kind in {skVar, skLet, skTemp, skForVar, skParam, skResult} and @@ -309,11 +309,11 @@ proc gatherVars(o: POuterContext, i: PInnerContext, n: PNode) = elif isInnerProc(s, o.fn) and tfCapturesEnv in s.typ.flags and s != i.fn: # call to some other inner proc; we need to track the dependencies for # this: - let env = PEnv(IdTableGet(o.lambdasToEnv, i.fn)) - if env == nil: InternalError(n.info, "no environment computed") + let env = PEnv(idTableGet(o.lambdasToEnv, i.fn)) + if env == nil: internalError(n.info, "no environment computed") if o.currentEnv != env: discard addDep(o.currentEnv, env, i.fn) - InternalError(n.info, "too complex environment handling required") + internalError(n.info, "too complex environment handling required") of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: nil else: for k in countup(0, sonsLen(n) - 1): @@ -365,7 +365,7 @@ proc transformInnerProc(o: POuterContext, i: PInnerContext, n: PNode): PNode = result = makeClosure(s, i.closureParam, n.info) else: # captured symbol? - result = IdNodeTableGet(i.localsToAccess, n.sym) + result = idNodeTableGet(i.localsToAccess, n.sym) of nkLambdaKinds: result = transformInnerProc(o, i, n.sons[namePos]) of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, @@ -425,18 +425,18 @@ proc searchForInnerProcs(o: POuterContext, n: PNode) = if it.kind == nkCommentStmt: nil elif it.kind == nkIdentDefs: var L = sonsLen(it) - if it.sons[0].kind != nkSym: InternalError(it.info, "transformOuter") + if it.sons[0].kind != nkSym: internalError(it.info, "transformOuter") #echo "set: ", it.sons[0].sym.name.s, " ", o.currentBlock == nil - IdTablePut(o.localsToEnv, it.sons[0].sym, o.currentEnv) + idTablePut(o.localsToEnv, it.sons[0].sym, o.currentEnv) searchForInnerProcs(o, it.sons[L-1]) elif it.kind == nkVarTuple: var L = sonsLen(it) for j in countup(0, L-3): #echo "set: ", it.sons[j].sym.name.s, " ", o.currentBlock == nil - IdTablePut(o.localsToEnv, it.sons[j].sym, o.currentEnv) + idTablePut(o.localsToEnv, it.sons[j].sym, o.currentEnv) searchForInnerProcs(o, it.sons[L-1]) else: - InternalError(it.info, "transformOuter") + internalError(it.info, "transformOuter") of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, nkIteratorDef: # don't recurse here: @@ -490,7 +490,7 @@ proc generateClosureCreation(o: POuterContext, scope: PEnv): PNode = # maybe later: (sfByCopy in local.flags) # add ``env.param = param`` result.add(newAsgnStmt(fieldAccess, newSymNode(local), env.info)) - IdNodeTablePut(o.localsToAccess, local, fieldAccess) + idNodeTablePut(o.localsToAccess, local, fieldAccess) # add support for 'up' references: for e, field in items(scope.deps): # add ``env.up = env2`` @@ -503,7 +503,7 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: nil of nkSym: var local = n.sym - var closure = PEnv(IdTableGet(o.lambdasToEnv, local)) + var closure = PEnv(idTableGet(o.lambdasToEnv, local)) if closure != nil: # we need to replace the lambda with '(lambda, env)': let a = closure.closure @@ -521,7 +521,7 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = return makeClosure(local, x, n.info) if not contains(o.capturedVars, local.id): return - var env = PEnv(IdTableGet(o.localsToEnv, local)) + var env = PEnv(idTableGet(o.localsToEnv, local)) if env == nil: return var scope = env.attachedNode assert scope.kind == nkStmtList @@ -531,7 +531,7 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = # change 'local' to 'closure.local', unless it's a 'byCopy' variable: # if sfByCopy notin local.flags: - result = IdNodeTableGet(o.localsToAccess, local) + result = idNodeTableGet(o.localsToAccess, local) assert result != nil, "cannot find: " & local.name.s # else it is captured by copy and this means that 'outer' should continue # to access the local as a local. @@ -564,13 +564,13 @@ proc liftLambdas*(fn: PSym, body: PNode): PNode = let params = fn.typ.n for i in 1.. <params.len: if params.sons[i].kind != nkSym: - InternalError(params.info, "liftLambdas: strange params") + internalError(params.info, "liftLambdas: strange params") let param = params.sons[i].sym - IdTablePut(o.localsToEnv, param, o.currentEnv) + idTablePut(o.localsToEnv, param, o.currentEnv) # put the 'result' into the environment so it can be captured: let ast = fn.ast if resultPos < sonsLen(ast) and ast.sons[resultPos].kind == nkSym: - IdTablePut(o.localsToEnv, ast.sons[resultPos].sym, o.currentEnv) + idTablePut(o.localsToEnv, ast.sons[resultPos].sym, o.currentEnv) searchForInnerProcs(o, body) discard transformOuterProc(o, body) result = ex @@ -793,7 +793,7 @@ proc liftForLoop*(body: PNode): PNode = addSon(vpart, body[i]) addSon(vpart, ast.emptyNode) # no explicit type - if not env.isnil: + if not env.isNil: call.sons[0] = makeClosure(call.sons[0].sym, env, body.info) addSon(vpart, call) addSon(v2, vpart) diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 7410f7ec58..17c9719121 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -136,7 +136,7 @@ proc printTok*(tok: TToken) proc tokToStr*(tok: TToken): string proc openLexer*(lex: var TLexer, filename: string, inputstream: PLLStream) = - OpenLexer(lex, filename.fileInfoIdx, inputStream) + openLexer(lex, filename.fileInfoIdx, inputstream) proc lexMessage*(L: TLexer, msg: TMsgKind, arg = "") @@ -160,16 +160,16 @@ proc tokToStr*(tok: TToken): string = of tkFloatLit..tkFloat64Lit: result = $tok.fNumber of tkInvalid, tkStrLit..tkCharLit, tkComment: result = tok.literal of tkParLe..tkColon, tkEof, tkAccent: - result = tokTypeToStr[tok.tokType] + result = TokTypeToStr[tok.tokType] else: if tok.ident != nil: result = tok.ident.s else: - InternalError("tokToStr") + internalError("tokToStr") result = "" proc prettyTok*(tok: TToken): string = - if IsKeyword(tok.tokType): result = "keyword " & tok.ident.s + if isKeyword(tok.tokType): result = "keyword " & tok.ident.s else: result = tokToStr(tok) proc printTok*(tok: TToken) = @@ -199,7 +199,7 @@ proc fillToken(L: var TToken) = proc openLexer(lex: var TLexer, fileIdx: int32, inputstream: PLLStream) = openBaseLexer(lex, inputstream) - lex.fileIdx = fileIdx + lex.fileIdx = fileidx lex.indentAhead = - 1 inc(lex.Linenumber, inputstream.lineOffset) @@ -226,7 +226,7 @@ proc matchUnderscoreChars(L: var TLexer, tok: var TToken, chars: TCharSet) = while true: if buf[pos] in chars: add(tok.literal, buf[pos]) - Inc(pos) + inc(pos) else: break if buf[pos] == '_': @@ -234,11 +234,11 @@ proc matchUnderscoreChars(L: var TLexer, tok: var TToken, chars: TCharSet) = lexMessage(L, errInvalidToken, "_") break add(tok.literal, '_') - Inc(pos) + inc(pos) L.bufPos = pos -proc matchTwoChars(L: TLexer, first: Char, second: TCharSet): bool = - result = (L.buf[L.bufpos] == first) and (L.buf[L.bufpos + 1] in Second) +proc matchTwoChars(L: TLexer, first: char, second: TCharSet): bool = + result = (L.buf[L.bufpos] == first) and (L.buf[L.bufpos + 1] in second) proc isFloatLiteral(s: string): bool = for i in countup(0, len(s) - 1): @@ -249,7 +249,7 @@ proc isFloatLiteral(s: string): bool = proc getNumber(L: var TLexer): TToken = var pos, endpos: int - xi: biggestInt + xi: BiggestInt # get the base: result.tokType = tkIntLit # int literal until we know better result.literal = "" @@ -390,22 +390,22 @@ proc getNumber(L: var TLexer): TToken = xi = `shl`(xi, 4) or (ord(L.buf[pos]) - ord('A') + 10) inc(pos) else: break - else: InternalError(getLineInfo(L), "getNumber") + else: internalError(getLineInfo(L), "getNumber") case result.tokType of tkIntLit, tkInt64Lit: result.iNumber = xi - of tkInt8Lit: result.iNumber = biggestInt(int8(toU8(int(xi)))) - of tkInt16Lit: result.iNumber = biggestInt(toU16(int(xi))) - of tkInt32Lit: result.iNumber = biggestInt(toU32(xi)) + of tkInt8Lit: result.iNumber = BiggestInt(int8(toU8(int(xi)))) + of tkInt16Lit: result.iNumber = BiggestInt(toU16(int(xi))) + of tkInt32Lit: result.iNumber = BiggestInt(toU32(xi)) of tkUIntLit, tkUInt64Lit: result.iNumber = xi - of tkUInt8Lit: result.iNumber = biggestInt(int8(toU8(int(xi)))) - of tkUInt16Lit: result.iNumber = biggestInt(toU16(int(xi))) - of tkUInt32Lit: result.iNumber = biggestInt(toU32(xi)) + of tkUInt8Lit: result.iNumber = BiggestInt(int8(toU8(int(xi)))) + of tkUInt16Lit: result.iNumber = BiggestInt(toU16(int(xi))) + of tkUInt32Lit: result.iNumber = BiggestInt(toU32(xi)) of tkFloat32Lit: result.fNumber = (cast[PFloat32](addr(xi)))[] # note: this code is endian neutral! # XXX: Test this on big endian machine! of tkFloat64Lit: result.fNumber = (cast[PFloat64](addr(xi)))[] - else: InternalError(getLineInfo(L), "getNumber") + else: internalError(getLineInfo(L), "getNumber") elif isFloatLiteral(result.literal) or (result.tokType == tkFloat32Lit) or (result.tokType == tkFloat64Lit): result.fnumber = parseFloat(result.literal) @@ -447,49 +447,49 @@ proc getEscapedChar(L: var TLexer, tok: var TToken) = of 'n', 'N': if tok.toktype == tkCharLit: lexMessage(L, errNnotAllowedInCharacter) add(tok.literal, tnl) - Inc(L.bufpos) + inc(L.bufpos) of 'r', 'R', 'c', 'C': add(tok.literal, CR) - Inc(L.bufpos) + inc(L.bufpos) of 'l', 'L': add(tok.literal, LF) - Inc(L.bufpos) + inc(L.bufpos) of 'f', 'F': add(tok.literal, FF) inc(L.bufpos) of 'e', 'E': add(tok.literal, ESC) - Inc(L.bufpos) + inc(L.bufpos) of 'a', 'A': add(tok.literal, BEL) - Inc(L.bufpos) + inc(L.bufpos) of 'b', 'B': add(tok.literal, BACKSPACE) - Inc(L.bufpos) + inc(L.bufpos) of 'v', 'V': add(tok.literal, VT) - Inc(L.bufpos) + inc(L.bufpos) of 't', 'T': add(tok.literal, Tabulator) - Inc(L.bufpos) + inc(L.bufpos) of '\'', '\"': add(tok.literal, L.buf[L.bufpos]) - Inc(L.bufpos) + inc(L.bufpos) of '\\': add(tok.literal, '\\') - Inc(L.bufpos) + inc(L.bufpos) of 'x', 'X': inc(L.bufpos) var xi = 0 handleHexChar(L, xi) handleHexChar(L, xi) - add(tok.literal, Chr(xi)) + add(tok.literal, chr(xi)) of '0'..'9': if matchTwoChars(L, '0', {'0'..'9'}): lexMessage(L, warnOctalEscape) var xi = 0 handleDecChars(L, xi) - if (xi <= 255): add(tok.literal, Chr(xi)) + if (xi <= 255): add(tok.literal, chr(xi)) else: lexMessage(L, errInvalidCharacterConstant) else: lexMessage(L, errInvalidCharacterConstant) @@ -528,7 +528,7 @@ proc getString(L: var TLexer, tok: var TToken, rawMode: bool) = tok.tokType = tkTripleStrLit # long string literal: inc(pos, 2) # skip "" # skip leading newline: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf while true: case buf[pos] @@ -538,9 +538,9 @@ proc getString(L: var TLexer, tok: var TToken, rawMode: bool) = L.bufpos = pos + 3 # skip the three """ break add(tok.literal, '\"') - Inc(pos) + inc(pos) of CR, LF: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf add(tok.literal, tnl) of nimlexbase.EndOfFile: @@ -551,7 +551,7 @@ proc getString(L: var TLexer, tok: var TToken, rawMode: bool) = break else: add(tok.literal, buf[pos]) - Inc(pos) + inc(pos) else: # ordinary string literal if rawMode: tok.tokType = tkRStrLit @@ -574,18 +574,18 @@ proc getString(L: var TLexer, tok: var TToken, rawMode: bool) = pos = L.bufPos else: add(tok.literal, c) - Inc(pos) + inc(pos) L.bufpos = pos proc getCharacter(L: var TLexer, tok: var TToken) = - Inc(L.bufpos) # skip ' + inc(L.bufpos) # skip ' var c = L.buf[L.bufpos] case c of '\0'..Pred(' '), '\'': lexMessage(L, errInvalidCharacterConstant) of '\\': getEscapedChar(L, tok) else: tok.literal = $c - Inc(L.bufpos) + inc(L.bufpos) if L.buf[L.bufpos] != '\'': lexMessage(L, errMissingFinalQuote) inc(L.bufpos) # skip ' @@ -606,7 +606,7 @@ proc getSymbol(L: var TLexer, tok: var TToken) = lexMessage(L, errInvalidToken, "_") break else: break - Inc(pos) + inc(pos) h = !$h tok.ident = getIdent(addr(L.buf[L.bufpos]), pos - L.bufpos, h) L.bufpos = pos @@ -631,8 +631,8 @@ proc getOperator(L: var TLexer, tok: var TToken) = while true: var c = buf[pos] if c notin OpChars: break - h = h !& Ord(c) - Inc(pos) + h = h !& ord(c) + inc(pos) endOperator(L, tok, pos, h) proc scanComment(L: var TLexer, tok: var TToken) = @@ -680,17 +680,17 @@ proc skip(L: var TLexer, tok: var TToken) = while true: case buf[pos] of ' ': - Inc(pos) + inc(pos) of Tabulator: lexMessagePos(L, errTabulatorsAreNotAllowed, pos) inc(pos) of CR, LF: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf var indent = 0 while buf[pos] == ' ': - Inc(pos) - Inc(indent) + inc(pos) + inc(indent) if buf[pos] > ' ': tok.indent = indent break @@ -725,7 +725,7 @@ proc rawGetTok(L: var TLexer, tok: var TToken) = getOperator(L, tok) of ',': tok.toktype = tkComma - Inc(L.bufpos) + inc(L.bufpos) of 'l': # if we parsed exactly one character and its a small L (l), this # is treated as a warning because it may be confused with the number 1 @@ -734,58 +734,58 @@ proc rawGetTok(L: var TLexer, tok: var TToken) = getSymbol(L, tok) of 'r', 'R': if L.buf[L.bufPos + 1] == '\"': - Inc(L.bufPos) + inc(L.bufPos) getString(L, tok, true) else: getSymbol(L, tok) of '(': - Inc(L.bufpos) + inc(L.bufpos) if L.buf[L.bufPos] == '.' and L.buf[L.bufPos+1] != '.': tok.toktype = tkParDotLe - Inc(L.bufpos) + inc(L.bufpos) else: tok.toktype = tkParLe of ')': tok.toktype = tkParRi - Inc(L.bufpos) + inc(L.bufpos) of '[': - Inc(L.bufpos) + inc(L.bufpos) if L.buf[L.bufPos] == '.' and L.buf[L.bufPos+1] != '.': tok.toktype = tkBracketDotLe - Inc(L.bufpos) + inc(L.bufpos) else: tok.toktype = tkBracketLe of ']': tok.toktype = tkBracketRi - Inc(L.bufpos) + inc(L.bufpos) of '.': if L.buf[L.bufPos+1] == ']': tok.tokType = tkBracketDotRi - Inc(L.bufpos, 2) + inc(L.bufpos, 2) elif L.buf[L.bufPos+1] == '}': tok.tokType = tkCurlyDotRi - Inc(L.bufpos, 2) + inc(L.bufpos, 2) elif L.buf[L.bufPos+1] == ')': tok.tokType = tkParDotRi - Inc(L.bufpos, 2) + inc(L.bufpos, 2) else: getOperator(L, tok) of '{': - Inc(L.bufpos) + inc(L.bufpos) if L.buf[L.bufPos] == '.' and L.buf[L.bufPos+1] != '.': tok.toktype = tkCurlyDotLe - Inc(L.bufpos) + inc(L.bufpos) else: tok.toktype = tkCurlyLe of '}': tok.toktype = tkCurlyRi - Inc(L.bufpos) + inc(L.bufpos) of ';': tok.toktype = tkSemiColon - Inc(L.bufpos) + inc(L.bufpos) of '`': tok.tokType = tkAccent - Inc(L.bufpos) + inc(L.bufpos) of '\"': # check for extended raw string literal: var rawMode = L.bufpos > 0 and L.buf[L.bufpos-1] in SymChars @@ -810,6 +810,6 @@ proc rawGetTok(L: var TLexer, tok: var TToken) = tok.literal = $c tok.tokType = tkInvalid lexMessage(L, errInvalidToken, c & " (\\" & $(ord(c)) & ')') - Inc(L.bufpos) + inc(L.bufpos) dummyIdent = getIdent("") diff --git a/compiler/lists.nim b/compiler/lists.nim index 70e177ba3d..93448c0b27 100644 --- a/compiler/lists.nim +++ b/compiler/lists.nim @@ -22,7 +22,7 @@ type head*, tail*: PListEntry Counter*: int - TCompareProc* = proc (entry: PListEntry, closure: Pointer): bool {.nimcall.} + TCompareProc* = proc (entry: PListEntry, closure: pointer): bool {.nimcall.} proc initLinkedList*(list: var TLinkedList) = list.Counter = 0 @@ -30,7 +30,7 @@ proc initLinkedList*(list: var TLinkedList) = list.tail = nil proc append*(list: var TLinkedList, entry: PListEntry) = - Inc(list.counter) + inc(list.counter) entry.next = nil entry.prev = list.tail if list.tail != nil: @@ -54,11 +54,11 @@ proc appendStr*(list: var TLinkedList, data: string) = append(list, newStrEntry(data)) proc includeStr*(list: var TLinkedList, data: string): bool = - if Contains(list, data): return true - AppendStr(list, data) # else: add to list + if contains(list, data): return true + appendStr(list, data) # else: add to list proc prepend*(list: var TLinkedList, entry: PListEntry) = - Inc(list.counter) + inc(list.counter) entry.prev = nil entry.next = list.head if list.head != nil: @@ -75,14 +75,14 @@ proc insertBefore*(list: var TLinkedList, pos, entry: PListEntry) = if pos == list.head: prepend(list, entry) else: - Inc(list.counter) + inc(list.counter) entry.next = pos entry.prev = pos.prev if pos.prev != nil: pos.prev.next = entry pos.prev = entry proc remove*(list: var TLinkedList, entry: PListEntry) = - Dec(list.counter) + dec(list.counter) if entry == list.tail: list.tail = entry.prev if entry == list.head: @@ -110,7 +110,7 @@ proc excludeStr*(list: var TLinkedList, data: string) = if PStrEntry(it).data == data: remove(list, it) it = nxt -proc find*(list: TLinkedList, fn: TCompareProc, closure: Pointer): PListEntry = +proc find*(list: TLinkedList, fn: TCompareProc, closure: pointer): PListEntry = result = list.head while result != nil: if fn(result, closure): return diff --git a/compiler/llstream.nim b/compiler/llstream.nim index 68ad4d5874..6eac08dbd3 100644 --- a/compiler/llstream.nim +++ b/compiler/llstream.nim @@ -23,7 +23,7 @@ type llsStdIn # stream encapsulates stdin TLLStream* = object of TObject kind*: TLLStreamKind # accessible for low-level access (lexbase uses this) - f*: tfile + f*: TFile s*: string rd*, wr*: int # for string streams lineOffset*: int # for fake stdin line numbers @@ -31,7 +31,7 @@ type PLLStream* = ref TLLStream proc llStreamOpen*(data: string): PLLStream -proc llStreamOpen*(f: var tfile): PLLStream +proc llStreamOpen*(f: var TFile): PLLStream proc llStreamOpen*(filename: string, mode: TFileMode): PLLStream proc llStreamOpen*(): PLLStream proc llStreamOpenStdIn*(): PLLStream @@ -40,7 +40,7 @@ proc llStreamRead*(s: PLLStream, buf: pointer, bufLen: int): int proc llStreamReadLine*(s: PLLStream, line: var string): bool proc llStreamReadAll*(s: PLLStream): string proc llStreamWrite*(s: PLLStream, data: string) -proc llStreamWrite*(s: PLLStream, data: Char) +proc llStreamWrite*(s: PLLStream, data: char) proc llStreamWrite*(s: PLLStream, buf: pointer, buflen: int) proc llStreamWriteln*(s: PLLStream, data: string) # implementation @@ -99,7 +99,7 @@ proc endsWithOpr*(x: string): bool = result = x.endsWith(LineContinuationOprs) proc continueLine(line: string, inTripleString: bool): bool {.inline.} = - result = inTriplestring or + result = inTripleString or line[0] == ' ' or line.endsWith(LineContinuationOprs+AdditionalLineContinuationOprs) @@ -116,7 +116,7 @@ proc llReadFromStdin(s: PLLStream, buf: pointer, bufLen: int): int = s.rd = 0 var line = newStringOfCap(120) var triples = 0 - while ReadLineFromStdin(if s.s.len == 0: ">>> " else: "... ", line): + while readLineFromStdin(if s.s.len == 0: ">>> " else: "... ", line): add(s.s, line) add(s.s, "\n") inc triples, countTriples(line) @@ -139,7 +139,7 @@ proc llStreamRead(s: PLLStream, buf: pointer, bufLen: int): int = of llsFile: result = readBuffer(s.f, buf, bufLen) of llsStdIn: - result = LLreadFromStdin(s, buf, bufLen) + result = llReadFromStdin(s, buf, bufLen) proc llStreamReadLine(s: PLLStream, line: var string): bool = setLen(line, 0) @@ -196,12 +196,12 @@ proc llStreamWrite(s: PLLStream, buf: pointer, buflen: int) = of llsNone, llsStdIn: discard of llsString: - if bufLen > 0: - setlen(s.s, len(s.s) + bufLen) - copyMem(addr(s.s[0 + s.wr]), buf, bufLen) - inc(s.wr, bufLen) + if buflen > 0: + setLen(s.s, len(s.s) + buflen) + copyMem(addr(s.s[0 + s.wr]), buf, buflen) + inc(s.wr, buflen) of llsFile: - discard writeBuffer(s.f, buf, bufLen) + discard writeBuffer(s.f, buf, buflen) proc llStreamReadAll(s: PLLStream): string = const @@ -218,7 +218,7 @@ proc llStreamReadAll(s: PLLStream): string = var bytes = readBuffer(s.f, addr(result[0]), bufSize) var i = bytes while bytes == bufSize: - setlen(result, i + bufSize) + setLen(result, i + bufSize) bytes = readBuffer(s.f, addr(result[i + 0]), bufSize) inc(i, bytes) - setlen(result, i) + setLen(result, i) diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 951998d156..379e00b0e4 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -135,20 +135,20 @@ proc wrongRedefinition*(info: TLineInfo, s: string) = proc addDecl*(c: PContext, sym: PSym) = if c.currentScope.addUniqueSym(sym) == Failure: - WrongRedefinition(sym.info, sym.Name.s) + wrongRedefinition(sym.info, sym.Name.s) proc addPrelimDecl*(c: PContext, sym: PSym) = discard c.currentScope.addUniqueSym(sym) proc addDeclAt*(scope: PScope, sym: PSym) = if scope.addUniqueSym(sym) == Failure: - WrongRedefinition(sym.info, sym.Name.s) + wrongRedefinition(sym.info, sym.Name.s) proc addInterfaceDeclAux(c: PContext, sym: PSym) = if sfExported in sym.flags: # add to interface: - if c.module != nil: StrTableAdd(c.module.tab, sym) - else: InternalError(sym.info, "AddInterfaceDeclAux") + if c.module != nil: strTableAdd(c.module.tab, sym) + else: internalError(sym.info, "AddInterfaceDeclAux") proc addInterfaceDeclAt*(c: PContext, scope: PScope, sym: PSym) = addDeclAt(scope, sym) @@ -158,7 +158,7 @@ proc addOverloadableSymAt*(scope: PScope, fn: PSym) = if fn.kind notin OverloadableSyms: internalError(fn.info, "addOverloadableSymAt") return - var check = StrTableGet(scope.symbols, fn.name) + var check = strTableGet(scope.symbols, fn.name) if check != nil and check.Kind notin OverloadableSyms: wrongRedefinition(fn.info, fn.Name.s) else: @@ -275,7 +275,7 @@ proc initOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = result = initIdentIter(o.it, c.topLevelScope.symbols, ident) o.mode = oimSelfModule else: - result = InitIdentIter(o.it, o.m.tab, ident) + result = initIdentIter(o.it, o.m.tab, ident) else: localError(n.sons[1].info, errIdentifierExpected, renderTree(n.sons[1])) @@ -317,7 +317,7 @@ proc nextOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = of oimSymChoice: if o.symChoiceIndex < sonsLen(n): result = n.sons[o.symChoiceIndex].sym - Incl(o.inSymChoice, result.id) + incl(o.inSymChoice, result.id) inc o.symChoiceIndex elif n.kind == nkOpenSymChoice: # try 'local' symbols too for Koenig's lookup: diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim index 066ccc6cdc..f81347faea 100644 --- a/compiler/magicsys.nim +++ b/compiler/magicsys.nim @@ -36,7 +36,7 @@ proc newSysType(kind: TTypeKind, size: int): PType = result.align = size proc getSysSym(name: string): PSym = - result = StrTableGet(systemModule.tab, getIdent(name)) + result = strTableGet(systemModule.tab, getIdent(name)) if result == nil: rawMessage(errSystemNeeds, name) result = newSym(skError, getIdent(name), systemModule, systemModule.info) @@ -46,11 +46,11 @@ proc getSysSym(name: string): PSym = proc getSysMagic*(name: string, m: TMagic): PSym = var ti: TIdentIter let id = getIdent(name) - result = InitIdentIter(ti, systemModule.tab, id) + result = initIdentIter(ti, systemModule.tab, id) while result != nil: if result.kind == skStub: loadStub(result) if result.magic == m: return result - result = NextIdentIter(ti, systemModule.tab) + result = nextIdentIter(ti, systemModule.tab) rawMessage(errSystemNeeds, name) result = newSym(skError, id, systemModule, systemModule.info) result.typ = newType(tyError, systemModule) @@ -82,11 +82,11 @@ proc getSysType(kind: TTypeKind): PType = of tyCstring: result = sysTypeFromName("cstring") of tyPointer: result = sysTypeFromName("pointer") of tyNil: result = newSysType(tyNil, ptrSize) - else: InternalError("request for typekind: " & $kind) + else: internalError("request for typekind: " & $kind) gSysTypes[kind] = result if result.kind != kind: - InternalError("wanted: " & $kind & " got: " & $result.kind) - if result == nil: InternalError("type not found: " & $kind) + internalError("wanted: " & $kind & " got: " & $result.kind) + if result == nil: internalError("type not found: " & $kind) var intTypeCache: array[-5..64, PType] @@ -164,7 +164,7 @@ proc getCompilerProc(name: string): PSym = var ident = getIdent(name, hashIgnoreStyle(name)) result = strTableGet(compilerprocs, ident) if result == nil: - result = strTableGet(rodCompilerProcs, ident) + result = strTableGet(rodCompilerprocs, ident) if result != nil: strTableAdd(compilerprocs, result) if result.kind == skStub: loadStub(result) diff --git a/compiler/main.nim b/compiler/main.nim index 3f8b6aeba1..275d657815 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -123,9 +123,9 @@ proc commandCompileToJS = #incl(gGlobalOptions, optSafeCode) setTarget(osJS, cpuJS) #initDefines() - DefineSymbol("nimrod") # 'nimrod' is always defined - DefineSymbol("ecmascript") # For backward compatibility - DefineSymbol("js") + defineSymbol("nimrod") # 'nimrod' is always defined + defineSymbol("ecmascript") # For backward compatibility + defineSymbol("js") semanticPasses() registerPass(jsgenPass) compileProject() @@ -134,7 +134,7 @@ proc interactivePasses = #incl(gGlobalOptions, optSafeCode) #setTarget(osNimrodVM, cpuNimrodVM) initDefines() - DefineSymbol("nimrodvm") + defineSymbol("nimrodvm") when hasFFI: DefineSymbol("nimffi") registerPass(verbosePass) registerPass(semPass) @@ -142,14 +142,14 @@ proc interactivePasses = proc commandInteractive = msgs.gErrorMax = high(int) # do not stop after first error - InteractivePasses() + interactivePasses() compileSystemModule() if commandArgs.len > 0: - discard CompileModule(fileInfoIdx(gProjectFull), {}) + discard compileModule(fileInfoIdx(gProjectFull), {}) else: var m = makeStdinModule() incl(m.flags, sfMainModule) - processModule(m, LLStreamOpenStdIn(), nil) + processModule(m, llStreamOpenStdIn(), nil) const evalPasses = [verbosePass, semPass, evalPass] @@ -157,8 +157,8 @@ proc evalNim(nodes: PNode, module: PSym) = carryPasses(nodes, module, evalPasses) proc commandEval(exp: string) = - if SystemModule == nil: - InteractivePasses() + if systemModule == nil: + interactivePasses() compileSystemModule() var echoExp = "echo \"eval\\t\", " & "repr(" & exp & ")" evalNim(echoExp.parseString, makeStdinModule()) @@ -178,7 +178,7 @@ proc commandPretty = proc commandScan = var f = addFileExt(mainCommandArg(), nimExt) - var stream = LLStreamOpen(f, fmRead) + var stream = llStreamOpen(f, fmRead) if stream != nil: var L: TLexer @@ -187,9 +187,9 @@ proc commandScan = openLexer(L, f, stream) while true: rawGetTok(L, tok) - PrintTok(tok) + printTok(tok) if tok.tokType == tkEof: break - CloseLexer(L) + closeLexer(L) else: rawMessage(errCannotOpenFile, f) @@ -200,7 +200,7 @@ proc commandSuggest = # issuing the first compile command. This will leave the compiler # cache in a state where "no recompilation is necessary", but the # cgen pass was never executed at all. - CommandCompileToC() + commandCompileToC() if gDirtyBufferIdx != 0: discard compileModule(gDirtyBufferIdx, {sfDirty}) resetModule(gDirtyBufferIdx) @@ -219,7 +219,7 @@ proc commandSuggest = proc wantMainModule = if gProjectFull.len == 0: if optMainModule.len == 0: - Fatal(gCmdLineInfo, errCommandExpectsFilename) + fatal(gCmdLineInfo, errCommandExpectsFilename) else: gProjectName = optMainModule gProjectFull = gProjectPath / gProjectName @@ -228,7 +228,7 @@ proc wantMainModule = proc requireMainModuleOption = if optMainModule.len == 0: - Fatal(gCmdLineInfo, errMainModuleMustBeSpecified) + fatal(gCmdLineInfo, errMainModuleMustBeSpecified) else: gProjectName = optMainModule gProjectFull = gProjectPath / gProjectName @@ -297,7 +297,7 @@ proc mainCommand* = if gProjectFull.len != 0: # current path is always looked first for modules prependStr(searchPaths, gProjectPath) - setID(100) + setId(100) passes.gIncludeFile = includeModule passes.gImportModule = importModule case command.normalize @@ -305,20 +305,20 @@ proc mainCommand* = # compile means compileToC currently gCmd = cmdCompileToC wantMainModule() - CommandCompileToC() + commandCompileToC() of "cpp", "compiletocpp": extccomp.cExt = ".cpp" gCmd = cmdCompileToCpp if cCompiler == ccGcc: setCC("gpp") wantMainModule() - DefineSymbol("cpp") - CommandCompileToC() + defineSymbol("cpp") + commandCompileToC() of "objc", "compiletooc": extccomp.cExt = ".m" gCmd = cmdCompileToOC wantMainModule() - DefineSymbol("objc") - CommandCompileToC() + defineSymbol("objc") + commandCompileToC() of "run": gCmd = cmdRun wantMainModule() @@ -330,7 +330,7 @@ proc mainCommand* = of "js", "compiletojs": gCmd = cmdCompileToJS wantMainModule() - CommandCompileToJS() + commandCompileToJS() of "compiletollvm": gCmd = cmdCompileToLLVM wantMainModule() @@ -341,52 +341,52 @@ proc mainCommand* = of "pretty": gCmd = cmdPretty wantMainModule() - CommandPretty() + commandPretty() of "doc": gCmd = cmdDoc - LoadConfigs(DocConfig) + loadConfigs(DocConfig) wantMainModule() - CommandDoc() + commandDoc() of "doc2": gCmd = cmdDoc - LoadConfigs(DocConfig) + loadConfigs(DocConfig) wantMainModule() - DefineSymbol("nimdoc") - CommandDoc2() + defineSymbol("nimdoc") + commandDoc2() of "rst2html": gCmd = cmdRst2html - LoadConfigs(DocConfig) + loadConfigs(DocConfig) wantMainModule() - CommandRst2Html() + commandRst2Html() of "rst2tex": gCmd = cmdRst2tex - LoadConfigs(DocTexConfig) + loadConfigs(DocTexConfig) wantMainModule() - CommandRst2TeX() + commandRst2TeX() of "jsondoc": gCmd = cmdDoc - LoadConfigs(DocConfig) + loadConfigs(DocConfig) wantMainModule() - DefineSymbol("nimdoc") - CommandJSON() + defineSymbol("nimdoc") + commandJSON() of "buildindex": gCmd = cmdDoc - LoadConfigs(DocConfig) - CommandBuildIndex() + loadConfigs(DocConfig) + commandBuildIndex() of "gendepend": gCmd = cmdGenDepend wantMainModule() - CommandGenDepend() + commandGenDepend() of "dump": - gcmd = cmdDump - if getconfigvar("dump.format") == "json": + gCmd = cmdDump + if getConfigVar("dump.format") == "json": requireMainModuleOption() var definedSymbols = newJArray() for s in definedSymbolNames(): definedSymbols.elems.add(%s) var libpaths = newJArray() - for dir in itersearchpath(searchpaths): libpaths.elems.add(%dir) + for dir in itersearchpath(searchPaths): libpaths.elems.add(%dir) var dumpdata = % [ (key: "version", val: %VersionAsString), @@ -395,17 +395,17 @@ proc mainCommand* = (key: "lib_paths", val: libpaths) ] - outWriteLn($dumpdata) + outWriteln($dumpdata) else: - outWriteLn("-- list of currently defined symbols --") - for s in definedSymbolNames(): outWriteLn(s) - outWriteLn("-- end of list --") + outWriteln("-- list of currently defined symbols --") + for s in definedSymbolNames(): outWriteln(s) + outWriteln("-- end of list --") - for it in iterSearchPath(searchpaths): msgWriteLn(it) + for it in iterSearchPath(searchPaths): msgWriteln(it) of "check": gCmd = cmdCheck wantMainModule() - CommandCheck() + commandCheck() of "parse": gCmd = cmdParse wantMainModule() @@ -413,11 +413,11 @@ proc mainCommand* = of "scan": gCmd = cmdScan wantMainModule() - CommandScan() - MsgWriteln("Beware: Indentation tokens depend on the parser\'s state!") + commandScan() + msgWriteln("Beware: Indentation tokens depend on the parser\'s state!") of "i": gCmd = cmdInteractive - CommandInteractive() + commandInteractive() of "e": # XXX: temporary command for easier testing commandEval(mainCommandArg()) @@ -429,12 +429,12 @@ proc mainCommand* = commandEval(gEvalExpr) else: wantMainModule() - CommandSuggest() + commandSuggest() of "serve": isServing = true gGlobalOptions.incl(optCaasEnabled) msgs.gErrorMax = high(int) # do not stop after first error - serve(MainCommand) + serve(mainCommand) else: rawMessage(errInvalidCommandX, command) diff --git a/compiler/modules.nim b/compiler/modules.nim index 15af40363c..e1fc1ad958 100644 --- a/compiler/modules.nim +++ b/compiler/modules.nim @@ -68,7 +68,7 @@ proc doCRC(fileIdx: int32) = # echo "FIRST CRC: ", fileIdx.ToFilename gMemCacheData[fileIdx].crc = crcFromFile(fileIdx.toFilename) -proc addDep(x: Psym, dep: int32) = +proc addDep(x: PSym, dep: int32) = growCache gMemCacheData, dep gMemCacheData[x.position].deps.safeAdd(dep) @@ -130,7 +130,7 @@ proc newModule(fileIdx: int32): PSym = incl(result.flags, sfUsed) initStrTable(result.tab) - StrTableAdd(result.tab, result) # a module knows itself + strTableAdd(result.tab, result) # a module knows itself proc compileModule*(fileIdx: int32, flags: TSymFlags): PSym = result = getModule(fileIdx) @@ -144,7 +144,7 @@ proc compileModule*(fileIdx: int32, flags: TSymFlags): PSym = if gCmd in {cmdCompileToC, cmdCompileToCpp, cmdCheck, cmdIdeTools}: rd = handleSymbolFile(result) if result.id < 0: - InternalError("handleSymbolFile should have set the module\'s ID") + internalError("handleSymbolFile should have set the module\'s ID") return else: result.id = getID() @@ -155,7 +155,7 @@ proc compileModule*(fileIdx: int32, flags: TSymFlags): PSym = doCRC fileIdx else: if checkDepMem(fileIdx) == Yes: - result = CompileModule(fileIdx, flags) + result = compileModule(fileIdx, flags) else: result = gCompiledModules[fileIdx] @@ -164,14 +164,14 @@ proc importModule*(s: PSym, fileIdx: int32): PSym {.procvar.} = result = compileModule(fileIdx, {}) if optCaasEnabled in gGlobalOptions: addDep(s, fileIdx) if sfSystemModule in result.flags: - LocalError(result.info, errAttemptToRedefine, result.Name.s) + localError(result.info, errAttemptToRedefine, result.Name.s) proc includeModule*(s: PSym, fileIdx: int32): PNode {.procvar.} = result = syntaxes.parseFile(fileIdx) if optCaasEnabled in gGlobalOptions: growCache gMemCacheData, fileIdx addDep(s, fileIdx) - doCrc(fileIdx) + doCRC(fileIdx) proc `==^`(a, b: string): bool = try: @@ -181,16 +181,16 @@ proc `==^`(a, b: string): bool = proc compileSystemModule* = if magicsys.SystemModule == nil: - SystemFileIdx = fileInfoIdx(options.libpath/"system.nim") - discard CompileModule(SystemFileIdx, {sfSystemModule}) + systemFileIdx = fileInfoIdx(options.libpath/"system.nim") + discard compileModule(systemFileIdx, {sfSystemModule}) proc compileProject*(projectFile = gProjectMainIdx) = let systemFileIdx = fileInfoIdx(options.libpath / "system.nim") - if projectFile == SystemFileIdx: - discard CompileModule(projectFile, {sfMainModule, sfSystemModule}) + if projectFile == systemFileIdx: + discard compileModule(projectFile, {sfMainModule, sfSystemModule}) else: compileSystemModule() - discard CompileModule(projectFile, {sfMainModule}) + discard compileModule(projectFile, {sfMainModule}) var stdinModule: PSym proc makeStdinModule*(): PSym = diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 44139b5762..edc1dade31 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -445,7 +445,7 @@ type TErrorOutputs* = set[TErrorOutput] ERecoverableError* = object of EInvalidValue - ESuggestDone* = object of EBase + ESuggestDone* = object of E_Base const InvalidFileIDX* = int32(-1) @@ -455,7 +455,7 @@ var fileInfos*: seq[TFileInfo] = @[] systemFileIdx*: int32 -proc toCChar*(c: Char): string = +proc toCChar*(c: char): string = case c of '\0'..'\x1F', '\x80'..'\xFF': result = '\\' & toOctal(c) of '\'', '\"', '\\': result = '\\' & c @@ -474,7 +474,7 @@ proc makeCString*(s: string): PRope = add(res, '\"') add(res, tnl) app(result, toRope(res)) # reset: - setlen(res, 1) + setLen(res, 1) res[0] = '\"' add(res, toCChar(s[i])) add(res, '\"') @@ -552,7 +552,7 @@ proc unknownLineInfo*(): TLineInfo = var msgContext: seq[TLineInfo] = @[] - lastError = UnknownLineInfo() + lastError = unknownLineInfo() bufferedMsgs*: seq[string] errorOutputs* = {eStdOut, eStdErr} @@ -563,9 +563,9 @@ proc clearBufferedMsgs* = proc suggestWriteln*(s: string) = if eStdOut in errorOutputs: when useCaas: - if isNil(stdoutSocket): Writeln(stdout, s) + if isNil(stdoutSocket): writeln(stdout, s) else: - Writeln(stdout, s) + writeln(stdout, s) stdoutSocket.send(s & "\c\L") else: Writeln(stdout, s) @@ -601,12 +601,12 @@ proc pushInfoContext*(info: TLineInfo) = msgContext.add(info) proc popInfoContext*() = - setlen(msgContext, len(msgContext) - 1) + setLen(msgContext, len(msgContext) - 1) proc getInfoContext*(index: int): TLineInfo = let L = msgContext.len let i = if index < 0: L + index else: index - if i >=% L: result = UnknownLineInfo() + if i >=% L: result = unknownLineInfo() else: result = msgContext[i] proc toFilename*(fileIdx: int32): string = @@ -658,16 +658,16 @@ proc addCheckpoint*(filename: string, line: int) = proc outWriteln*(s: string) = ## Writes to stdout. Always. - if eStdOut in errorOutputs: Writeln(stdout, s) + if eStdOut in errorOutputs: writeln(stdout, s) proc msgWriteln*(s: string) = ## Writes to stdout. If --stdout option is given, writes to stderr instead. if gCmd == cmdIdeTools and optCDebug notin gGlobalOptions: return if optStdout in gGlobalOptions: - if eStdErr in errorOutputs: Writeln(stderr, s) + if eStdErr in errorOutputs: writeln(stderr, s) else: - if eStdOut in errorOutputs: Writeln(stdout, s) + if eStdOut in errorOutputs: writeln(stdout, s) if eInMemory in errorOutputs: bufferedMsgs.safeAdd(s) @@ -677,7 +677,7 @@ proc coordToStr(coord: int): string = proc msgKindToString*(kind: TMsgKind): string = # later versions may provide translated error messages - result = msgKindToStr[kind] + result = MsgKindToStr[kind] proc getMessageStr(msg: TMsgKind, arg: string): string = result = msgKindToString(msg) % [arg] @@ -721,16 +721,16 @@ proc `==`*(a, b: TLineInfo): bool = result = a.line == b.line and a.fileIndex == b.fileIndex proc writeContext(lastinfo: TLineInfo) = - var info = lastInfo + var info = lastinfo for i in countup(0, len(msgContext) - 1): - if msgContext[i] != lastInfo and msgContext[i] != info: + if msgContext[i] != lastinfo and msgContext[i] != info: msgWriteln(posContextFormat % [toMsgFilename(msgContext[i]), coordToStr(msgContext[i].line), coordToStr(msgContext[i].col), getMessageStr(errInstantiationFrom, "")]) info = msgContext[i] -proc rawMessage*(msg: TMsgKind, args: openarray[string]) = +proc rawMessage*(msg: TMsgKind, args: openArray[string]) = var frmt: string case msg of errMin..errMax: @@ -813,7 +813,7 @@ proc internalError*(info: TLineInfo, errMsg: string) = proc internalError*(errMsg: string) = if gCmd == cmdIdeTools: return - writeContext(UnknownLineInfo()) + writeContext(unknownLineInfo()) rawMessage(errInternal, errMsg) template assertNotNil*(e: expr): expr = diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index d7ce0d57fc..50f24043be 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -60,7 +60,7 @@ var condStack: seq[bool] = @[] proc doEnd(L: var TLexer, tok: var TToken) = if high(condStack) < 0: lexMessage(L, errTokenExpected, "@if") ppGetTok(L, tok) # skip 'end' - setlen(condStack, high(condStack)) + setLen(condStack, high(condStack)) type TJumpDest = enum @@ -75,7 +75,7 @@ proc doElse(L: var TLexer, tok: var TToken) = proc doElif(L: var TLexer, tok: var TToken) = if high(condStack) < 0: lexMessage(L, errTokenExpected, "@if") - var res = EvalppIf(L, tok) + var res = evalppIf(L, tok) if condStack[high(condStack)] or not res: jumpToDirective(L, tok, jdElseEndif) else: condStack[high(condStack)] = true @@ -86,7 +86,7 @@ proc jumpToDirective(L: var TLexer, tok: var TToken, dest: TJumpDest) = ppGetTok(L, tok) case whichKeyword(tok.ident) of wIf: - Inc(nestedIfs) + inc(nestedIfs) of wElse: if (dest == jdElseEndif) and (nestedIfs == 0): doElse(L, tok) @@ -99,7 +99,7 @@ proc jumpToDirective(L: var TLexer, tok: var TToken, dest: TJumpDest) = if nestedIfs == 0: doEnd(L, tok) break - if nestedIfs > 0: Dec(nestedIfs) + if nestedIfs > 0: dec(nestedIfs) else: nil ppGetTok(L, tok) @@ -112,8 +112,8 @@ proc parseDirective(L: var TLexer, tok: var TToken) = ppGetTok(L, tok) # skip @ case whichKeyword(tok.ident) of wIf: - setlen(condStack, len(condStack) + 1) - var res = EvalppIf(L, tok) + setLen(condStack, len(condStack) + 1) + var res = evalppIf(L, tok) condStack[high(condStack)] = res if not res: jumpToDirective(L, tok, jdElseEndif) of wElif: doElif(L, tok) @@ -196,7 +196,7 @@ proc readConfigFile(filename: string) = L: TLexer tok: TToken stream: PLLStream - stream = LLStreamOpen(filename, fmRead) + stream = llStreamOpen(filename, fmRead) if stream != nil: initToken(tok) openLexer(L, filename, stream) diff --git a/compiler/nimlexbase.nim b/compiler/nimlexbase.nim index 2e4f8dec7f..1dcb927cee 100644 --- a/compiler/nimlexbase.nim +++ b/compiler/nimlexbase.nim @@ -69,7 +69,7 @@ const proc closeBaseLexer(L: var TBaseLexer) = dealloc(L.buf) - LLStreamClose(L.stream) + llStreamClose(L.stream) proc fillBuffer(L: var TBaseLexer) = var @@ -83,9 +83,9 @@ proc fillBuffer(L: var TBaseLexer) = toCopy = L.BufLen - L.sentinel - 1 assert(toCopy >= 0) if toCopy > 0: - MoveMem(L.buf, addr(L.buf[L.sentinel + 1]), toCopy * chrSize) + moveMem(L.buf, addr(L.buf[L.sentinel + 1]), toCopy * chrSize) # "moveMem" handles overlapping regions - charsRead = LLStreamRead(L.stream, addr(L.buf[toCopy]), + charsRead = llStreamRead(L.stream, addr(L.buf[toCopy]), (L.sentinel + 1) * chrSize) div chrSize s = toCopy + charsRead if charsRead < L.sentinel + 1: @@ -96,7 +96,7 @@ proc fillBuffer(L: var TBaseLexer) = dec(s) # BUGFIX (valgrind) while true: assert(s < L.bufLen) - while (s >= 0) and not (L.buf[s] in NewLines): Dec(s) + while (s >= 0) and not (L.buf[s] in NewLines): dec(s) if s >= 0: # we found an appropriate character for a sentinel: L.sentinel = s @@ -108,7 +108,7 @@ proc fillBuffer(L: var TBaseLexer) = L.bufLen = L.BufLen * 2 L.buf = cast[cstring](realloc(L.buf, L.bufLen * chrSize)) assert(L.bufLen - oldBuflen == oldBufLen) - charsRead = LLStreamRead(L.stream, addr(L.buf[oldBufLen]), + charsRead = llStreamRead(L.stream, addr(L.buf[oldBufLen]), oldBufLen * chrSize) div chrSize if charsRead < oldBufLen: L.buf[oldBufLen + charsRead] = EndOfFile @@ -153,7 +153,7 @@ proc openBaseLexer(L: var TBaseLexer, inputstream: PLLStream, bufLen = 8192) = L.linenumber = 1 # lines start at 1 L.stream = inputstream fillBuffer(L) - skip_UTF_8_BOM(L) + skipUTF8BOM(L) proc getColNumber(L: TBaseLexer, pos: int): int = result = abs(pos - L.lineStart) @@ -166,4 +166,4 @@ proc getCurrentLine(L: TBaseLexer, marker: bool = true): string = inc(i) result.add("\n") if marker: - result.add(RepeatChar(getColNumber(L, L.bufpos)) & '^' & "\n") + result.add(repeatChar(getColNumber(L, L.bufpos)) & '^' & "\n") diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim index 33c899647d..c4c4f887c6 100644 --- a/compiler/nimrod.nim +++ b/compiler/nimrod.nim @@ -36,7 +36,7 @@ proc handleCmdLine() = writeCommandLineUsage() else: # Process command line arguments: - ProcessCmdLine(passCmd1, "") + processCmdLine(passCmd1, "") if gProjectName != "": try: gProjectFull = canonicalizePath(gProjectName) diff --git a/compiler/nimsets.nim b/compiler/nimsets.nim index 8c2fc42d3a..8e5de4194a 100644 --- a/compiler/nimsets.nim +++ b/compiler/nimsets.nim @@ -32,7 +32,7 @@ proc cardSet*(s: PNode): BiggestInt proc inSet(s: PNode, elem: PNode): bool = if s.kind != nkCurly: - InternalError(s.info, "inSet") + internalError(s.info, "inSet") return false for i in countup(0, sonsLen(s) - 1): if s.sons[i].kind == nkRange: @@ -61,7 +61,7 @@ proc overlap(a, b: PNode): bool = proc SomeInSet(s: PNode, a, b: PNode): bool = # checks if some element of a..b is in the set s if s.kind != nkCurly: - InternalError(s.info, "SomeInSet") + internalError(s.info, "SomeInSet") return false for i in countup(0, sonsLen(s) - 1): if s.sons[i].kind == nkRange: @@ -82,10 +82,10 @@ proc toBitSet(s: PNode, b: var TBitSet) = if s.sons[i].kind == nkRange: j = getOrdValue(s.sons[i].sons[0]) while j <= getOrdValue(s.sons[i].sons[1]): - BitSetIncl(b, j - first) + bitSetIncl(b, j - first) inc(j) else: - BitSetIncl(b, getOrdValue(s.sons[i]) - first) + bitSetIncl(b, getOrdValue(s.sons[i]) - first) proc toTreeSet(s: TBitSet, settype: PType, info: TLineInfo): PNode = var @@ -103,9 +103,9 @@ proc toTreeSet(s: TBitSet, settype: PType, info: TLineInfo): PNode = a = e b = e while true: - Inc(b) + inc(b) if (b >= len(s) * elemSize) or not bitSetIn(s, b): break - Dec(b) + dec(b) if a == b: addSon(result, newIntTypeNode(nkIntLit, a + first, elemType)) else: @@ -115,7 +115,7 @@ proc toTreeSet(s: TBitSet, settype: PType, info: TLineInfo): PNode = addSon(n, newIntTypeNode(nkIntLit, b + first, elemType)) addSon(result, n) e = b - Inc(e) + inc(e) template nodeSetOp(a, b: PNode, op: expr) {.dirty.} = var x, y: TBitSet @@ -124,10 +124,10 @@ template nodeSetOp(a, b: PNode, op: expr) {.dirty.} = op(x, y) result = toTreeSet(x, a.typ, a.info) -proc unionSets(a, b: PNode): PNode = nodeSetOp(a, b, BitSetUnion) -proc diffSets(a, b: PNode): PNode = nodeSetOp(a, b, BitSetDiff) -proc intersectSets(a, b: PNode): PNode = nodeSetOp(a, b, BitSetIntersect) -proc symdiffSets(a, b: PNode): PNode = nodeSetOp(a, b, BitSetSymDiff) +proc unionSets(a, b: PNode): PNode = nodeSetOp(a, b, bitSetUnion) +proc diffSets(a, b: PNode): PNode = nodeSetOp(a, b, bitSetDiff) +proc intersectSets(a, b: PNode): PNode = nodeSetOp(a, b, bitSetIntersect) +proc symdiffSets(a, b: PNode): PNode = nodeSetOp(a, b, bitSetSymDiff) proc containsSets(a, b: PNode): bool = var x, y: TBitSet @@ -156,7 +156,7 @@ proc cardSet(s: PNode): BiggestInt = result = result + getOrdValue(s.sons[i].sons[1]) - getOrdValue(s.sons[i].sons[0]) + 1 else: - Inc(result) + inc(result) proc setHasRange(s: PNode): bool = if s.kind != nkCurly: diff --git a/compiler/options.nim b/compiler/options.nim index d792b487e9..ae62af1c5d 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -142,7 +142,7 @@ const # additional configuration variables: var gConfigVars* = newStringTable(modeStyleInsensitive) - gDllOverrides = newStringtable(modeCaseInsensitive) + gDllOverrides = newStringTable(modeCaseInsensitive) libpath* = "" gProjectName* = "" # holds a name like 'nimrod' gProjectPath* = "" # holds a path like /home/alice/projects/nimrod/compiler/ @@ -184,7 +184,7 @@ proc getOutFile*(filename, ext: string): string = proc getPrefixDir*(): string = ## gets the application directory - result = SplitPath(getAppDir()).head + result = splitPath(getAppDir()).head proc canonicalizePath*(path: string): string = result = path.expandFilename @@ -261,8 +261,8 @@ iterator iterSearchPath*(SearchPaths: TLinkedList): string = it = PStrEntry(it.Next) proc rawFindFile(f: string): string = - for it in iterSearchPath(SearchPaths): - result = JoinPath(it, f) + for it in iterSearchPath(searchPaths): + result = joinPath(it, f) if existsFile(result): return result.canonicalizePath result = "" @@ -270,7 +270,7 @@ proc rawFindFile(f: string): string = proc rawFindFile2(f: string): string = var it = PStrEntry(lazyPaths.head) while it != nil: - result = JoinPath(it.data, f) + result = joinPath(it.data, f) if existsFile(result): bringToFront(lazyPaths, it) return result.canonicalizePath @@ -292,7 +292,7 @@ proc findModule*(modulename, currentModule: string): string = let currentPath = currentModule.splitFile.dir result = currentPath / m if not existsFile(result): - result = FindFile(m) + result = findFile(m) proc libCandidates*(s: string, dest: var seq[string]) = var le = strutils.find(s, '(') @@ -319,7 +319,7 @@ proc inclDynlibOverride*(lib: string) = proc isDynlibOverride*(lib: string): bool = result = gDllOverrides.hasKey(lib.canonDynlibName) -proc binaryStrSearch*(x: openarray[string], y: string): int = +proc binaryStrSearch*(x: openArray[string], y: string): int = var a = 0 var b = len(x) - 1 while a <= b: diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim index 283f839062..91c230ccb3 100644 --- a/compiler/parampatterns.nim +++ b/compiler/parampatterns.nim @@ -42,7 +42,7 @@ const MaxStackSize* = 64 ## max required stack size by the VM proc patternError(n: PNode) = - LocalError(n.info, errIllFormedAstX, renderTree(n, {renderNoComments})) + localError(n.info, errIllFormedAstX, renderTree(n, {renderNoComments})) proc add(code: var TPatternCode, op: TOpcode) {.inline.} = add(code, chr(ord(op))) @@ -125,7 +125,7 @@ proc semNodeKindConstraints*(p: PNode): PNode = for i in 1.. <p.len: compileConstraints(p.sons[i], result.strVal) if result.strVal.len > maxStackSize-1: - InternalError(p.info, "parameter pattern too complex") + internalError(p.info, "parameter pattern too complex") else: patternError(p) result.strVal.add(ppEof) diff --git a/compiler/parser.nim b/compiler/parser.nim index 652883360e..47e8e9a543 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -77,12 +77,12 @@ proc getTok(p: var TParser) = proc openParser*(p: var TParser, fileIdx: int32, inputStream: PLLStream) = initToken(p.tok) - openLexer(p.lex, fileIdx, inputstream) + openLexer(p.lex, fileIdx, inputStream) getTok(p) # read the first token p.firstTok = true proc openParser*(p: var TParser, filename: string, inputStream: PLLStream) = - openParser(p, filename.fileInfoIdx, inputStream) + openParser(p, filename.fileInfoIdx, inputstream) proc closeParser(p: var TParser) = closeLexer(p.lex) @@ -141,7 +141,7 @@ proc expectIdent(p: TParser) = proc eat(p: var TParser, TokType: TTokType) = if p.tok.TokType == TokType: getTok(p) - else: lexMessage(p.lex, errTokenExpected, TokTypeToStr[tokType]) + else: lexMessage(p.lex, errTokenExpected, TokTypeToStr[TokType]) proc parLineInfo(p: TParser): TLineInfo = result = getLineInfo(p.lex, p.tok) @@ -672,7 +672,7 @@ proc simpleExprAux(p: var TParser, limit: int, mode: TPrimaryMode): PNode = let modeB = if mode == pmTypeDef: pmTypeDesc else: mode # the operator itself must not start on a new line: while opPrec >= limit and p.tok.indent < 0: - var leftAssoc = ord(IsLeftAssociative(p.tok)) + var leftAssoc = ord(isLeftAssociative(p.tok)) var a = newNodeP(nkInfix, p) var opNode = newIdentNodeP(p.tok.ident, p) # skip operator: getTok(p) @@ -846,7 +846,7 @@ proc parseParamList(p: var TParser, retColon = true): PNode = optPar(p) eat(p, tkParRi) let hasRet = if retColon: p.tok.tokType == tkColon - else: p.tok.tokType == tkOpr and IdentEq(p.tok.ident, "->") + else: p.tok.tokType == tkOpr and identEq(p.tok.ident, "->") if hasRet and p.tok.indent < 0: getTok(p) optInd(p, result) @@ -941,7 +941,7 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode = #| / 'static' primary #| / 'bind' primary if isOperator(p.tok): - let isSigil = IsSigilLike(p.tok) + let isSigil = isSigilLike(p.tok) result = newNodeP(nkPrefix, p) var a = newIdentNodeP(p.tok.ident, p) addSon(result, a) @@ -1877,7 +1877,7 @@ proc parseTopLevelStmt(p: var TParser): PNode = break proc parseString(s: string, filename: string = "", line: int = 0): PNode = - var stream = LLStreamOpen(s) + var stream = llStreamOpen(s) stream.lineOffset = line var parser: TParser diff --git a/compiler/passaux.nim b/compiler/passaux.nim index 4a85c994c9..79d11419b8 100644 --- a/compiler/passaux.nim +++ b/compiler/passaux.nim @@ -19,12 +19,12 @@ proc verboseOpen(s: PSym): PPassContext = proc verboseProcess(context: PPassContext, n: PNode): PNode = result = n - if context != nil: InternalError("logpass: context is not nil") + if context != nil: internalError("logpass: context is not nil") if gVerbosity == 3: # system.nim deactivates all hints, for verbosity:3 we want the processing # messages nonetheless, so we activate them again unconditionally: incl(msgs.gNotes, hintProcessing) - Message(n.info, hintProcessing, $idgen.gBackendId) + message(n.info, hintProcessing, $idgen.gBackendId) const verbosePass* = makePass(open = verboseOpen, process = verboseProcess) @@ -34,7 +34,7 @@ proc cleanUp(c: PPassContext, n: PNode): PNode = if optDeadCodeElim in gGlobalOptions or n == nil: return case n.kind of nkStmtList: - for i in countup(0, sonsLen(n) - 1): discard cleanup(c, n.sons[i]) + for i in countup(0, sonsLen(n) - 1): discard cleanUp(c, n.sons[i]) of nkProcDef, nkMethodDef: if n.sons[namePos].kind == nkSym: var s = n.sons[namePos].sym diff --git a/compiler/passes.nim b/compiler/passes.nim index 8d228fe9a7..3dc31e7ac6 100644 --- a/compiler/passes.nim +++ b/compiler/passes.nim @@ -30,8 +30,8 @@ type TPass* = tuple[open: TPassOpen, openCached: TPassOpenCached, process: TPassProcess, close: TPassClose] - TPassData* = tuple[input: PNode, closeOutput: Pnode] - TPasses* = openarray[TPass] + TPassData* = tuple[input: PNode, closeOutput: PNode] + TPasses* = openArray[TPass] # a pass is a tuple of procedure vars ``TPass.close`` may produce additional # nodes. These are passed to the other close procedures. @@ -169,7 +169,7 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) = openPasses(a, module) if stream == nil: let filename = fileIdx.toFullPath - s = LLStreamOpen(filename, fmRead) + s = llStreamOpen(filename, fmRead) if s == nil: rawMessage(errCannotOpenFile, filename) return @@ -195,7 +195,7 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) = if s.kind != llsStdIn: break closePasses(a) # id synchronization point for more consistent code generation: - IDsynchronizationPoint(1000) + idSynchronizationPoint(1000) else: openPassesCached(a, module, rd) var n = loadInitSection(rd) diff --git a/compiler/patterns.nim b/compiler/patterns.nim index b7792100f5..54f8d3af44 100644 --- a/compiler/patterns.nim +++ b/compiler/patterns.nim @@ -87,22 +87,22 @@ proc matchChoice(c: PPatternContext, p, n: PNode): bool = if matches(c, p.sons[i], n): return true proc bindOrCheck(c: PPatternContext, param: PSym, n: PNode): bool = - var pp = GetLazy(c, param) + var pp = getLazy(c, param) if pp != nil: # check if we got the same pattern (already unified): result = sameTrees(pp, n) #matches(c, pp, n) elif n.kind == nkArgList or checkTypes(c, param, n): - PutLazy(c, param, n) + putLazy(c, param, n) result = true proc gather(c: PPatternContext, param: PSym, n: PNode) = - var pp = GetLazy(c, param) + var pp = getLazy(c, param) if pp != nil and pp.kind == nkArgList: pp.add(n) else: pp = newNodeI(nkArgList, n.info, 1) pp.sons[0] = n - PutLazy(c, param, pp) + putLazy(c, param, pp) proc matchNested(c: PPatternContext, p, n: PNode, rpn: bool): bool = # match ``op * param`` or ``op *| param`` @@ -148,7 +148,7 @@ proc matches(c: PPatternContext, p, n: PNode): bool = of "*": result = matchNested(c, p, n, rpn=false) of "**": result = matchNested(c, p, n, rpn=true) of "~": result = not matches(c, p.sons[1], n) - else: InternalError(p.info, "invalid pattern") + else: internalError(p.info, "invalid pattern") # template {add(a, `&` * b)}(a: string{noalias}, b: varargs[string]) = # add(a, b) elif p.kind == nkCurlyExpr: @@ -256,7 +256,7 @@ proc applyRule*(c: PContext, s: PSym, n: PNode): PNode = args = newNodeI(nkArgList, n.info) for i in 1 .. < params.len: let param = params.sons[i].sym - let x = GetLazy(ctx, param) + let x = getLazy(ctx, param) # couldn't bind parameter: if isNil(x): return nil result.add(x) diff --git a/compiler/platform.nim b/compiler/platform.nim index 5245cba6a6..2e78d4fc59 100644 --- a/compiler/platform.nim +++ b/compiler/platform.nim @@ -200,10 +200,10 @@ proc setTarget*(o: TSystemOS, c: TSystemCPU) = #echo "new Target: OS: ", o, " CPU: ", c targetCPU = c targetOS = o - intSize = cpu[c].intSize div 8 - floatSize = cpu[c].floatSize div 8 - ptrSize = cpu[c].bit div 8 - tnl = os[o].newLine + intSize = CPU[c].intSize div 8 + floatSize = CPU[c].floatSize div 8 + ptrSize = CPU[c].bit div 8 + tnl = OS[o].newLine proc nameToOS(name: string): TSystemOS = for i in countup(succ(osNone), high(TSystemOS)): diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 41898caedb..5c9247fedc 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -70,7 +70,7 @@ proc pragma*(c: PContext, sym: PSym, n: PNode, validPragmas: TSpecialWords) # implementation proc invalidPragma(n: PNode) = - LocalError(n.info, errInvalidPragmaX, renderTree(n, {renderNoComments})) + localError(n.info, errInvalidPragmaX, renderTree(n, {renderNoComments})) proc pragmaAsm*(c: PContext, n: PNode): char = result = '\0' @@ -125,7 +125,7 @@ proc newEmptyStrNode(n: PNode): PNode {.noinline.} = proc getStrLitNode(c: PContext, n: PNode): PNode = if n.kind != nkExprColonExpr: - LocalError(n.info, errStringLiteralExpected) + localError(n.info, errStringLiteralExpected) # error correction: result = newEmptyStrNode(n) else: @@ -169,7 +169,7 @@ proc processMagic(c: PContext, n: PNode, s: PSym) = if substr($m, 1) == v: s.magic = m break - if s.magic == mNone: Message(n.info, warnUnknownMagic, v) + if s.magic == mNone: message(n.info, warnUnknownMagic, v) proc wordToCallConv(sw: TSpecialWord): TCallingConvention = # this assumes that the order of special words and calling conventions is @@ -188,11 +188,11 @@ proc onOff(c: PContext, n: PNode, op: TOptions) = else: gOptions = gOptions - op proc pragmaDeadCodeElim(c: PContext, n: PNode) = - if IsTurnedOn(c, n): incl(c.module.flags, sfDeadCodeElim) + if isTurnedOn(c, n): incl(c.module.flags, sfDeadCodeElim) else: excl(c.module.flags, sfDeadCodeElim) proc pragmaNoForward(c: PContext, n: PNode) = - if IsTurnedOn(c, n): incl(c.module.flags, sfNoForward) + if isTurnedOn(c, n): incl(c.module.flags, sfNoForward) else: excl(c.module.flags, sfNoForward) proc processCallConv(c: PContext, n: PNode) = @@ -201,9 +201,9 @@ proc processCallConv(c: PContext, n: PNode) = case sw of firstCallConv..lastCallConv: POptionEntry(c.optionStack.tail).defaultCC = wordToCallConv(sw) - else: LocalError(n.info, errCallConvExpected) + else: localError(n.info, errCallConvExpected) else: - LocalError(n.info, errCallConvExpected) + localError(n.info, errCallConvExpected) proc getLib(c: PContext, kind: TLibKind, path: PNode): PLib = var it = PLib(c.libs.head) @@ -213,13 +213,13 @@ proc getLib(c: PContext, kind: TLibKind, path: PNode): PLib = it = PLib(it.next) result = newLib(kind) result.path = path - Append(c.libs, result) + append(c.libs, result) if path.kind in {nkStrLit..nkTripleStrLit}: result.isOverriden = options.isDynLibOverride(path.strVal) proc expectDynlibNode(c: PContext, n: PNode): PNode = if n.kind != nkExprColonExpr: - LocalError(n.info, errStringLiteralExpected) + localError(n.info, errStringLiteralExpected) # error correction: result = newEmptyStrNode(n) else: @@ -229,7 +229,7 @@ proc expectDynlibNode(c: PContext, n: PNode): PNode = if result.kind == nkSym and result.sym.kind == skConst: result = result.sym.ast # look it up if result.typ == nil or result.typ.kind notin {tyPointer, tyString, tyProc}: - LocalError(n.info, errStringLiteralExpected) + localError(n.info, errStringLiteralExpected) result = newEmptyStrNode(n) proc processDynLib(c: PContext, n: PNode, sym: PSym) = @@ -265,7 +265,7 @@ proc processNote(c: PContext, n: PNode) = of wWarning: var x = findStr(msgs.WarningsToStr, n.sons[0].sons[1].ident.s) if x >= 0: nk = TNoteKind(x + ord(warnMin)) - else: InvalidPragma(n); return + else: invalidPragma(n); return else: invalidPragma(n) return @@ -284,26 +284,26 @@ proc processOption(c: PContext, n: PNode): bool = else: var sw = whichKeyword(n.sons[0].ident) case sw - of wChecks: OnOff(c, n, checksOptions) - of wObjChecks: OnOff(c, n, {optObjCheck}) - of wFieldchecks: OnOff(c, n, {optFieldCheck}) - of wRangechecks: OnOff(c, n, {optRangeCheck}) - of wBoundchecks: OnOff(c, n, {optBoundsCheck}) - of wOverflowchecks: OnOff(c, n, {optOverflowCheck}) - of wNilchecks: OnOff(c, n, {optNilCheck}) - of wFloatChecks: OnOff(c, n, {optNanCheck, optInfCheck}) - of wNaNchecks: OnOff(c, n, {optNanCheck}) - of wInfChecks: OnOff(c, n, {optInfCheck}) - of wAssertions: OnOff(c, n, {optAssert}) - of wWarnings: OnOff(c, n, {optWarns}) - of wHints: OnOff(c, n, {optHints}) + of wChecks: onOff(c, n, checksOptions) + of wObjChecks: onOff(c, n, {optObjCheck}) + of wFieldchecks: onOff(c, n, {optFieldCheck}) + of wRangechecks: onOff(c, n, {optRangeCheck}) + of wBoundchecks: onOff(c, n, {optBoundsCheck}) + of wOverflowchecks: onOff(c, n, {optOverflowCheck}) + of wNilchecks: onOff(c, n, {optNilCheck}) + of wFloatChecks: onOff(c, n, {optNanCheck, optInfCheck}) + of wNaNchecks: onOff(c, n, {optNanCheck}) + of wInfChecks: onOff(c, n, {optInfCheck}) + of wAssertions: onOff(c, n, {optAssert}) + of wWarnings: onOff(c, n, {optWarns}) + of wHints: onOff(c, n, {optHints}) of wCallConv: processCallConv(c, n) - of wLinedir: OnOff(c, n, {optLineDir}) - of wStacktrace: OnOff(c, n, {optStackTrace}) - of wLinetrace: OnOff(c, n, {optLineTrace}) - of wDebugger: OnOff(c, n, {optEndb}) - of wProfiler: OnOff(c, n, {optProfiler}) - of wByRef: OnOff(c, n, {optByRef}) + of wLinedir: onOff(c, n, {optLineDir}) + of wStacktrace: onOff(c, n, {optStackTrace}) + of wLinetrace: onOff(c, n, {optLineTrace}) + of wDebugger: onOff(c, n, {optEndb}) + of wProfiler: onOff(c, n, {optProfiler}) + of wByRef: onOff(c, n, {optByRef}) of wDynLib: processDynLib(c, n, nil) of wOptimization: if n.sons[1].kind != nkIdent: @@ -319,14 +319,14 @@ proc processOption(c: PContext, n: PNode): bool = of "none": excl(gOptions, optOptimizeSpeed) excl(gOptions, optOptimizeSize) - else: LocalError(n.info, errNoneSpeedOrSizeExpected) - of wImplicitStatic: OnOff(c, n, {optImplicitStatic}) - of wPatterns: OnOff(c, n, {optPatterns}) + else: localError(n.info, errNoneSpeedOrSizeExpected) + of wImplicitStatic: onOff(c, n, {optImplicitStatic}) + of wPatterns: onOff(c, n, {optPatterns}) else: result = true proc processPush(c: PContext, n: PNode, start: int) = if n.sons[start-1].kind == nkExprColonExpr: - LocalError(n.info, errGenerated, "':' after 'push' not supported") + localError(n.info, errGenerated, "':' after 'push' not supported") var x = newOptionEntry() var y = POptionEntry(c.optionStack.tail) x.options = gOptions @@ -344,7 +344,7 @@ proc processPush(c: PContext, n: PNode, start: int) = proc processPop(c: PContext, n: PNode) = if c.optionStack.counter <= 1: - LocalError(n.info, errAtPopWithoutPush) + localError(n.info, errAtPopWithoutPush) else: gOptions = POptionEntry(c.optionStack.tail).options gNotes = POptionEntry(c.optionStack.tail).notes @@ -352,15 +352,15 @@ proc processPop(c: PContext, n: PNode) = proc processDefine(c: PContext, n: PNode) = if (n.kind == nkExprColonExpr) and (n.sons[1].kind == nkIdent): - DefineSymbol(n.sons[1].ident.s) - Message(n.info, warnDeprecated, "define") + defineSymbol(n.sons[1].ident.s) + message(n.info, warnDeprecated, "define") else: invalidPragma(n) proc processUndef(c: PContext, n: PNode) = if (n.kind == nkExprColonExpr) and (n.sons[1].kind == nkIdent): - UndefSymbol(n.sons[1].ident.s) - Message(n.info, warnDeprecated, "undef") + undefSymbol(n.sons[1].ident.s) + message(n.info, warnDeprecated, "undef") else: invalidPragma(n) @@ -372,13 +372,13 @@ proc processCompile(c: PContext, n: PNode) = var s = expectStrLit(c, n) var found = findFile(s) if found == "": found = s - var trunc = ChangeFileExt(found, "") + var trunc = changeFileExt(found, "") extccomp.addExternalFileToCompile(found) extccomp.addFileToLink(completeCFilePath(trunc, false)) proc processCommonLink(c: PContext, n: PNode, feature: TLinkFeature) = var f = expectStrLit(c, n) - if splitFile(f).ext == "": f = addFileExt(f, cc[ccompiler].objExt) + if splitFile(f).ext == "": f = addFileExt(f, CC[cCompiler].objExt) var found = findFile(f) if found == "": found = f # use the default case feature @@ -408,7 +408,7 @@ proc semAsmOrEmit*(con: PContext, n: PNode, marker: char): PNode = result = newNode(if n.kind == nkAsmStmt: nkAsmStmt else: nkArgList, n.info) var str = n.sons[1].strVal if str == "": - LocalError(n.info, errEmptyAsm) + localError(n.info, errEmptyAsm) return # now parse the string literal and substitute symbols: var a = 0 @@ -458,9 +458,9 @@ proc pragmaLine(c: PContext, n: PNode) = if x.kind == nkExprColonExpr: x = x.sons[1] if y.kind == nkExprColonExpr: y = y.sons[1] if x.kind != nkStrLit: - LocalError(n.info, errStringLiteralExpected) + localError(n.info, errStringLiteralExpected) elif y.kind != nkIntLit: - LocalError(n.info, errIntLiteralExpected) + localError(n.info, errIntLiteralExpected) else: n.info.fileIndex = msgs.fileInfoIdx(x.strVal) n.info.line = int16(y.intVal) @@ -476,11 +476,11 @@ proc processPragma(c: PContext, n: PNode, i: int) = elif it.sons[0].kind != nkIdent: invalidPragma(n) elif it.sons[1].kind != nkIdent: invalidPragma(n) - var userPragma = NewSym(skTemplate, it.sons[1].ident, nil, it.info) + var userPragma = newSym(skTemplate, it.sons[1].ident, nil, it.info) var body = newNodeI(nkPragma, n.info) for j in i+1 .. sonsLen(n)-1: addSon(body, n.sons[j]) userPragma.ast = body - StrTableAdd(c.userPragmas, userPragma) + strTableAdd(c.userPragmas, userPragma) proc pragmaRaisesOrTags(c: PContext, n: PNode) = proc processExc(c: PContext, x: PNode) = @@ -503,11 +503,11 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, var it = n.sons[i] var key = if it.kind == nkExprColonExpr: it.sons[0] else: it if key.kind == nkIdent: - var userPragma = StrTableGet(c.userPragmas, key.ident) + var userPragma = strTableGet(c.userPragmas, key.ident) if userPragma != nil: inc c.InstCounter if c.InstCounter > 100: - GlobalError(it.info, errRecursiveDependencyX, userPragma.name.s) + globalError(it.info, errRecursiveDependencyX, userPragma.name.s) pragma(c, sym, userPragma.ast, validPragmas) dec c.InstCounter else: @@ -534,15 +534,15 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wAlign: if sym.typ == nil: invalidPragma(it) var align = expectIntLit(c, it) - if not IsPowerOfTwo(align) and align != 0: - LocalError(it.info, errPowerOfTwoExpected) + if not isPowerOfTwo(align) and align != 0: + localError(it.info, errPowerOfTwoExpected) else: sym.typ.align = align of wSize: if sym.typ == nil: invalidPragma(it) var size = expectIntLit(c, it) - if not IsPowerOfTwo(size) or size <= 0 or size > 8: - LocalError(it.info, errPowerOfTwoExpected) + if not isPowerOfTwo(size) or size <= 0 or size > 8: + localError(it.info, errPowerOfTwoExpected) else: sym.typ.size = size of wNodecl: @@ -572,7 +572,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, incl(sym.flags, sfGlobal) incl(sym.flags, sfPure) of wMerge: - noval(it) + noVal(it) incl(sym.flags, sfMerge) of wHeader: var lib = getLib(c, libHeader, getStrLitNode(c, it)) @@ -640,8 +640,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, incl(sym.flags, sfThread) incl(sym.flags, sfProcVar) if sym.typ != nil: incl(sym.typ.flags, tfThread) - of wHint: Message(it.info, hintUser, expectStrLit(c, it)) - of wWarning: Message(it.info, warnUser, expectStrLit(c, it)) + of wHint: message(it.info, hintUser, expectStrLit(c, it)) + of wWarning: message(it.info, warnUser, expectStrLit(c, it)) of wError: if sym != nil and sym.isRoutine: # This is subtle but correct: the error *statement* is only @@ -651,8 +651,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, noVal(it) incl(sym.flags, sfError) else: - LocalError(it.info, errUser, expectStrLit(c, it)) - of wFatal: Fatal(it.info, errUser, expectStrLit(c, it)) + localError(it.info, errUser, expectStrLit(c, it)) + of wFatal: fatal(it.info, errUser, expectStrLit(c, it)) of wDefine: processDefine(c, it) of wUndef: processUndef(c, it) of wCompile: processCompile(c, it) @@ -660,8 +660,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wLinkSys: processCommonLink(c, it, linkSys) of wPassL: extccomp.addLinkOption(expectStrLit(c, it)) of wPassC: extccomp.addCompileOption(expectStrLit(c, it)) - of wBreakpoint: PragmaBreakpoint(c, it) - of wWatchpoint: PragmaWatchpoint(c, it) + of wBreakpoint: pragmaBreakpoint(c, it) + of wWatchpoint: pragmaWatchpoint(c, it) of wPush: processPush(c, n, i + 1) result = true @@ -684,13 +684,13 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, wPatterns: if processOption(c, it): # calling conventions (boring...): - LocalError(it.info, errOptionExpected) + localError(it.info, errOptionExpected) of firstCallConv..lastCallConv: assert(sym != nil) if sym.typ == nil: invalidPragma(it) else: sym.typ.callConv = wordToCallConv(k) - of wEmit: PragmaEmit(c, it) - of wUnroll: PragmaUnroll(c, it) + of wEmit: pragmaEmit(c, it) + of wUnroll: pragmaUnroll(c, it) of wLinearScanEnd, wComputedGoto: noVal(it) of wEffects: # is later processed in effect analysis: @@ -706,7 +706,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wByRef: noVal(it) if sym == nil or sym.typ == nil: - if processOption(c, it): LocalError(it.info, errOptionExpected) + if processOption(c, it): localError(it.info, errOptionExpected) else: incl(sym.typ.flags, tfByRef) of wByCopy: @@ -718,7 +718,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, # as they are handled directly in 'evalTemplate'. noVal(it) if sym == nil: invalidPragma(it) - of wLine: PragmaLine(c, it) + of wLine: pragmaLine(c, it) of wRaises, wTags: pragmaRaisesOrTags(c, it) of wOperator: if sym == nil: invalidPragma(it) @@ -741,11 +741,11 @@ proc implictPragmas*(c: PContext, sym: PSym, n: PNode, if not o.isNil: for i in countup(0, sonsLen(o) - 1): if singlePragma(c, sym, o, i, validPragmas): - InternalError(n.info, "implicitPragmas") + internalError(n.info, "implicitPragmas") it = it.next.POptionEntry if lfExportLib in sym.loc.flags and sfExportc notin sym.flags: - LocalError(n.info, errDynlibRequiresExportc) + localError(n.info, errDynlibRequiresExportc) var lib = POptionEntry(c.optionstack.tail).dynlib if {lfDynamicLib, lfHeader} * sym.loc.flags == {} and sfImportc in sym.flags and lib != nil: diff --git a/compiler/pretty.nim b/compiler/pretty.nim index 85b138822f..a59694d8f6 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -46,7 +46,7 @@ proc loadFile(info: TLineInfo) = proc overwriteFiles*() = for i in 0 .. high(gSourceFiles): if not gSourceFiles[i].dirty: continue - let newFile = gSourceFiles[i].fullpath.changeFileExt(".pretty.nim") + let newFile = gSourceFiles[i].fullpath #.changeFileExt(".pretty.nim") try: var f = open(newFile, fmWrite) for line in gSourceFiles[i].lines: @@ -167,7 +167,7 @@ proc checkUse(c: PGen; n: PNode) = let last = first+identLen(line, first)-1 if differ(line, first, last, newName): # last-first+1 != newName.len or - var x = line.subStr(0, first-1) & newName & line.substr(last+1) + var x = line.substr(0, first-1) & newName & line.substr(last+1) when removeTP: # the WinAPI module is full of 'TX = X' which after the substitution # becomes 'X = X'. We remove those lines: diff --git a/compiler/procfind.nim b/compiler/procfind.nim index 1075d51296..a59df11784 100644 --- a/compiler/procfind.nim +++ b/compiler/procfind.nim @@ -44,12 +44,12 @@ proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = if result.Kind == fn.kind and isGenericRoutine(result): let genR = result.ast.sons[genericParamsPos] let genF = fn.ast.sons[genericParamsPos] - if ExprStructuralEquivalent(genR, genF) and - ExprStructuralEquivalent(result.ast.sons[paramsPos], + if exprStructuralEquivalent(genR, genF) and + exprStructuralEquivalent(result.ast.sons[paramsPos], fn.ast.sons[paramsPos]) and equalGenericParams(genR, genF): return - result = NextIdentIter(it, scope.symbols) + result = nextIdentIter(it, scope.symbols) else: while result != nil: if result.Kind == fn.kind and not isGenericRoutine(result): @@ -57,11 +57,11 @@ proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = of paramsEqual: return of paramsIncompatible: - LocalError(fn.info, errNotOverloadable, fn.name.s) + localError(fn.info, errNotOverloadable, fn.name.s) return of paramsNotEqual: nil - result = NextIdentIter(it, scope.symbols) + result = nextIdentIter(it, scope.symbols) when false: proc paramsFitBorrow(child, parent: PNode): bool = diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 27193c2293..79486da6bf 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -76,7 +76,7 @@ proc initSrcGen(g: var TSrcGen, renderFlags: TRenderFlags) = proc addTok(g: var TSrcGen, kind: TTokType, s: string) = var length = len(g.tokens) - setlen(g.tokens, length + 1) + setLen(g.tokens, length + 1) g.tokens[length].kind = kind g.tokens[length].length = int16(len(s)) add(g.buf, s) @@ -127,7 +127,7 @@ proc putLong(g: var TSrcGen, kind: TTokType, s: string, lineLen: int) = addTok(g, kind, s) g.lineLen = lineLen -proc toNimChar(c: Char): string = +proc toNimChar(c: char): string = case c of '\0': result = "\\0" of '\x01'..'\x1F', '\x80'..'\xFF': result = "\\x" & strutils.toHex(ord(c), 2) @@ -241,14 +241,14 @@ proc containsNL(s: string): bool = proc pushCom(g: var TSrcGen, n: PNode) = var length = len(g.comStack) - setlen(g.comStack, length + 1) + setLen(g.comStack, length + 1) g.comStack[length] = n proc popAllComs(g: var TSrcGen) = - setlen(g.comStack, 0) + setLen(g.comStack, 0) proc popCom(g: var TSrcGen) = - setlen(g.comStack, len(g.comStack) - 1) + setLen(g.comStack, len(g.comStack) - 1) const Space = " " @@ -278,7 +278,7 @@ proc gcoms(g: var TSrcGen) = popAllComs(g) proc lsub(n: PNode): int -proc litAux(n: PNode, x: biggestInt, size: int): string = +proc litAux(n: PNode, x: BiggestInt, size: int): string = proc skip(t: PType): PType = result = t while result.kind in {tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal, @@ -295,7 +295,7 @@ proc litAux(n: PNode, x: biggestInt, size: int): string = elif nfBase16 in n.flags: result = "0x" & toHex(x, size * 2) else: result = $x -proc ulitAux(n: PNode, x: biggestInt, size: int): string = +proc ulitAux(n: PNode, x: BiggestInt, size: int): string = if nfBase2 in n.flags: result = "0b" & toBin(x, size * 8) elif nfBase8 in n.flags: result = "0o" & toOct(x, size * 3) elif nfBase16 in n.flags: result = "0x" & toHex(x, size * 2) @@ -341,7 +341,7 @@ proc atom(n: PNode): string = if (n.typ != nil) and (n.typ.sym != nil): result = n.typ.sym.name.s else: result = "[type node]" else: - InternalError("rnimsyn.atom " & $n.kind) + internalError("rnimsyn.atom " & $n.kind) result = "" proc lcomma(n: PNode, start: int = 0, theEnd: int = - 1): int = @@ -1252,7 +1252,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkParRi, ")") else: #nkNone, nkExplicitTypeListCall: - InternalError(n.info, "rnimsyn.gsub(" & $n.kind & ')') + internalError(n.info, "rnimsyn.gsub(" & $n.kind & ')') proc renderTree(n: PNode, renderFlags: TRenderFlags = {}): string = var g: TSrcGen @@ -1263,7 +1263,7 @@ proc renderTree(n: PNode, renderFlags: TRenderFlags = {}): string = proc renderModule(n: PNode, filename: string, renderFlags: TRenderFlags = {}) = var - f: tfile + f: TFile g: TSrcGen initSrcGen(g, renderFlags) for i in countup(0, sonsLen(n) - 1): diff --git a/compiler/rodread.nim b/compiler/rodread.nim index 9f69f022a7..eba8766599 100644 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -306,7 +306,7 @@ proc decodeType(r: PRodReader, info: TLineInfo): PType = internalError(info, "decodeType: no id") # here this also avoids endless recursion for recursive type idTablePut(gTypeTable, result, result) - if r.s[r.pos] == '(': result.n = decodeNode(r, UnknownLineInfo()) + if r.s[r.pos] == '(': result.n = decodeNode(r, unknownLineInfo()) if r.s[r.pos] == '$': inc(r.pos) result.flags = cast[TTypeFlags](int32(decodeVInt(r.s, r.pos))) @@ -335,7 +335,7 @@ proc decodeType(r: PRodReader, info: TLineInfo): PType = if r.s[r.pos] == '(': inc(r.pos) if r.s[r.pos] == ')': inc(r.pos) - else: InternalError(info, "decodeType ^(" & r.s[r.pos]) + else: internalError(info, "decodeType ^(" & r.s[r.pos]) rawAddSon(result, nil) else: var d = decodeVInt(r.s, r.pos) @@ -347,10 +347,10 @@ proc decodeLib(r: PRodReader, info: TLineInfo): PLib = new(result) inc(r.pos) result.kind = TLibKind(decodeVInt(r.s, r.pos)) - if r.s[r.pos] != '|': InternalError("decodeLib: 1") + if r.s[r.pos] != '|': internalError("decodeLib: 1") inc(r.pos) result.name = toRope(decodeStr(r.s, r.pos)) - if r.s[r.pos] != '|': InternalError("decodeLib: 2") + if r.s[r.pos] != '|': internalError("decodeLib: 2") inc(r.pos) result.path = decodeNode(r, info) @@ -375,13 +375,13 @@ proc decodeSym(r: PRodReader, info: TLineInfo): PSym = inc(r.pos) ident = getIdent(decodeStr(r.s, r.pos)) else: - InternalError(info, "decodeSym: no ident") + internalError(info, "decodeSym: no ident") #echo "decoding: {", ident.s - result = PSym(IdTableGet(r.syms, id)) + result = PSym(idTableGet(r.syms, id)) if result == nil: new(result) result.id = id - IdTablePut(r.syms, result, result) + idTablePut(r.syms, result, result) if debugIds: registerID(result) elif result.id != id: internalError(info, "decodeSym: wrong id") @@ -427,7 +427,7 @@ proc decodeSym(r: PRodReader, info: TLineInfo): PSym = result.annex = decodeLib(r, info) if r.s[r.pos] == '#': inc(r.pos) - result.constraint = decodeNode(r, UnknownLineInfo()) + result.constraint = decodeNode(r, unknownLineInfo()) if r.s[r.pos] == '(': if result.kind in routineKinds: result.ast = decodeNodeLazyBody(r, result.info, result) @@ -458,7 +458,7 @@ proc skipSection(r: PRodReader) = else: discard inc(r.pos) else: - InternalError("skipSection " & $r.line) + internalError("skipSection " & $r.line) proc rdWord(r: PRodReader): string = result = "" @@ -472,11 +472,11 @@ proc newStub(r: PRodReader, name: string, id: int): PSym = result.id = id result.name = getIdent(name) result.position = r.readerIndex - setID(id) #MessageOut(result.name.s); + setId(id) #MessageOut(result.name.s); if debugIds: registerID(result) proc processInterf(r: PRodReader, module: PSym) = - if r.interfIdx == 0: InternalError("processInterf") + if r.interfIdx == 0: internalError("processInterf") r.pos = r.interfIdx while (r.s[r.pos] > '\x0A') and (r.s[r.pos] != ')'): var w = decodeStr(r.s, r.pos) @@ -485,23 +485,23 @@ proc processInterf(r: PRodReader, module: PSym) = inc(r.pos) # #10 var s = newStub(r, w, key) s.owner = module - StrTableAdd(module.tab, s) - IdTablePut(r.syms, s, s) + strTableAdd(module.tab, s) + idTablePut(r.syms, s, s) proc processCompilerProcs(r: PRodReader, module: PSym) = - if r.compilerProcsIdx == 0: InternalError("processCompilerProcs") + if r.compilerProcsIdx == 0: internalError("processCompilerProcs") r.pos = r.compilerProcsIdx while (r.s[r.pos] > '\x0A') and (r.s[r.pos] != ')'): var w = decodeStr(r.s, r.pos) inc(r.pos) var key = decodeVInt(r.s, r.pos) inc(r.pos) # #10 - var s = PSym(IdTableGet(r.syms, key)) + var s = PSym(idTableGet(r.syms, key)) if s == nil: s = newStub(r, w, key) s.owner = module - IdTablePut(r.syms, s, s) - StrTableAdd(rodCompilerProcs, s) + idTablePut(r.syms, s, s) + strTableAdd(rodCompilerprocs, s) proc processIndex(r: PRodReader; idx: var TIndex; outf: TFile = nil) = var key, val, tmp: int @@ -516,11 +516,11 @@ proc processIndex(r: PRodReader; idx: var TIndex; outf: TFile = nil) = else: key = idx.lastIdxKey + 1 val = tmp + idx.lastIdxVal - IITablePut(idx.tab, key, val) + iiTablePut(idx.tab, key, val) if not outf.isNil: outf.write(key, " ", val, "\n") idx.lastIdxKey = key idx.lastIdxVal = val - setID(key) # ensure that this id will not be used + setId(key) # ensure that this id will not be used if r.s[r.pos] == '\x0A': inc(r.pos) inc(r.line) @@ -558,7 +558,7 @@ proc processRodFile(r: PRodReader, crc: TCrc32) = of "ID": inc(r.pos) # skip ':' r.moduleID = decodeVInt(r.s, r.pos) - setID(r.moduleID) + setId(r.moduleID) of "ORIGFILE": inc(r.pos) r.origFile = decodeStr(r.s, r.pos) @@ -603,7 +603,7 @@ proc processRodFile(r: PRodReader, crc: TCrc32) = inc(r.pos) # skip ' ' inclCrc = decodeVInt(r.s, r.pos) if r.reason == rrNone: - if not ExistsFile(w) or (inclCrc != int(crcFromFile(w))): + if not existsFile(w) or (inclCrc != int(crcFromFile(w))): r.reason = rrInclDeps if r.s[r.pos] == '\x0A': inc(r.pos) @@ -639,7 +639,7 @@ proc processRodFile(r: PRodReader, crc: TCrc32) = r.initIdx = r.pos + 2 # "(\10" skipSection(r) else: - InternalError("invalid section: '" & section & + internalError("invalid section: '" & section & "' at " & $r.line & " in " & r.filename) #MsgWriteln("skipping section: " & section & # " at " & $r.line & " in " & r.filename) @@ -670,13 +670,13 @@ proc newRodReader(modfilename: string, crc: TCrc32, r.line = 1 r.readerIndex = readerIndex r.filename = modfilename - InitIdTable(r.syms) + initIdTable(r.syms) # we terminate the file explicitely with ``\0``, so the cast to `cstring` # is safe: r.s = cast[cstring](r.memFile.mem) if startsWith(r.s, "NIM:"): - initIITable(r.index.tab) - initIITable(r.imports.tab) # looks like a ROD file + initIiTable(r.index.tab) + initIiTable(r.imports.tab) # looks like a ROD file inc(r.pos, 4) var version = "" while r.s[r.pos] notin {'\0', '\x0A'}: @@ -691,12 +691,12 @@ proc newRodReader(modfilename: string, crc: TCrc32, result = nil proc rrGetType(r: PRodReader, id: int, info: TLineInfo): PType = - result = PType(IdTableGet(gTypeTable, id)) + result = PType(idTableGet(gTypeTable, id)) if result == nil: # load the type: var oldPos = r.pos - var d = IITableGet(r.index.tab, id) - if d == invalidKey: InternalError(info, "rrGetType") + var d = iiTableGet(r.index.tab, id) + if d == invalidKey: internalError(info, "rrGetType") r.pos = d + r.dataIdx result = decodeType(r, info) r.pos = oldPos @@ -715,7 +715,7 @@ var gMods*: TFileModuleMap = @[] proc decodeSymSafePos(rd: PRodReader, offset: int, info: TLineInfo): PSym = # all compiled modules - if rd.dataIdx == 0: InternalError(info, "dataIdx == 0") + if rd.dataIdx == 0: internalError(info, "dataIdx == 0") var oldPos = rd.pos rd.pos = offset + rd.dataIdx result = decodeSym(rd, info) @@ -725,7 +725,7 @@ proc findSomeWhere(id: int) = for i in countup(0, high(gMods)): var rd = gMods[i].rd if rd != nil: - var d = IITableGet(rd.index.tab, id) + var d = iiTableGet(rd.index.tab, id) if d != invalidKey: echo "found id ", id, " in ", gMods[i].filename @@ -740,33 +740,33 @@ proc getReader(moduleId: int): PRodReader = return nil proc rrGetSym(r: PRodReader, id: int, info: TLineInfo): PSym = - result = PSym(IdTableGet(r.syms, id)) + result = PSym(idTableGet(r.syms, id)) if result == nil: # load the symbol: - var d = IITableGet(r.index.tab, id) + var d = iiTableGet(r.index.tab, id) if d == invalidKey: # import from other module: - var moduleID = IiTableGet(r.imports.tab, id) + var moduleID = iiTableGet(r.imports.tab, id) if moduleID < 0: var x = "" encodeVInt(id, x) - InternalError(info, "missing from both indexes: +" & x) + internalError(info, "missing from both indexes: +" & x) var rd = getReader(moduleID) - d = IITableGet(rd.index.tab, id) + d = iiTableGet(rd.index.tab, id) if d != invalidKey: result = decodeSymSafePos(rd, d, info) else: var x = "" encodeVInt(id, x) when false: findSomeWhere(id) - InternalError(info, "rrGetSym: no reader found: +" & x) + internalError(info, "rrGetSym: no reader found: +" & x) else: # own symbol: result = decodeSymSafePos(r, d, info) if result != nil and result.kind == skStub: rawLoadStub(result) proc loadInitSection(r: PRodReader): PNode = - if r.initIdx == 0 or r.dataIdx == 0: InternalError("loadInitSection") + if r.initIdx == 0 or r.dataIdx == 0: internalError("loadInitSection") var oldPos = r.pos r.pos = r.initIdx result = newNode(nkStmtList) @@ -775,7 +775,7 @@ proc loadInitSection(r: PRodReader): PNode = inc(r.pos) # #10 var p = r.pos r.pos = d + r.dataIdx - addSon(result, decodeNode(r, UnknownLineInfo())) + addSon(result, decodeNode(r, unknownLineInfo())) r.pos = p r.pos = oldPos @@ -783,20 +783,20 @@ proc loadConverters(r: PRodReader) = # We have to ensure that no exported converter is a stub anymore, and the # import mechanism takes care of the rest. if r.convertersIdx == 0 or r.dataIdx == 0: - InternalError("importConverters") + internalError("importConverters") r.pos = r.convertersIdx while r.s[r.pos] > '\x0A': var d = decodeVInt(r.s, r.pos) - discard rrGetSym(r, d, UnknownLineInfo()) + discard rrGetSym(r, d, unknownLineInfo()) if r.s[r.pos] == ' ': inc(r.pos) proc loadMethods(r: PRodReader) = if r.methodsIdx == 0 or r.dataIdx == 0: - InternalError("loadMethods") + internalError("loadMethods") r.pos = r.methodsIdx while r.s[r.pos] > '\x0A': var d = decodeVInt(r.s, r.pos) - r.methods.add(rrGetSym(r, d, UnknownLineInfo())) + r.methods.add(rrGetSym(r, d, unknownLineInfo())) if r.s[r.pos] == ' ': inc(r.pos) proc getCRC*(fileIdx: int32): TCrc32 = @@ -834,7 +834,7 @@ proc checkDep(fileIdx: int32): TReasonForRecompile = # NOTE: we need to process the entire module graph so that no ID will # be used twice! However, compilation speed does not suffer much from # this, since results are cached. - var res = checkDep(SystemFileIdx) + var res = checkDep(systemFileIdx) if res != rrNone: result = rrModDeps for i in countup(0, high(r.modDeps)): res = checkDep(r.modDeps[i]) @@ -858,11 +858,11 @@ proc handleSymbolFile(module: PSym): PRodReader = idgen.loadMaxIds(options.gProjectPath / options.gProjectName) discard checkDep(fileIdx) - if gMods[fileIdx].reason == rrEmpty: InternalError("handleSymbolFile") + if gMods[fileIdx].reason == rrEmpty: internalError("handleSymbolFile") result = gMods[fileIdx].rd if result != nil: module.id = result.moduleID - IdTablePut(result.syms, module, module) + idTablePut(result.syms, module, module) processInterf(result, module) processCompilerProcs(result, module) loadConverters(result) @@ -871,12 +871,12 @@ proc handleSymbolFile(module: PSym): PRodReader = module.id = getID() proc rawLoadStub(s: PSym) = - if s.kind != skStub: InternalError("loadStub") + if s.kind != skStub: internalError("loadStub") var rd = gMods[s.position].rd var theId = s.id # used for later check - var d = IITableGet(rd.index.tab, s.id) - if d == invalidKey: InternalError("loadStub: invalid key") - var rs = decodeSymSafePos(rd, d, UnknownLineInfo()) + var d = iiTableGet(rd.index.tab, s.id) + if d == invalidKey: internalError("loadStub: invalid key") + var rs = decodeSymSafePos(rd, d, unknownLineInfo()) if rs != s: #echo "rs: ", toHex(cast[int](rs.position), int.sizeof * 2), # "\ns: ", toHex(cast[int](s.position), int.sizeof * 2) @@ -913,7 +913,7 @@ proc getBody*(s: PSym): PNode = s.offset = 0 initIdTable(gTypeTable) -initStrTable(rodCompilerProcs) +initStrTable(rodCompilerprocs) # viewer: proc writeNode(f: TFile; n: PNode) = @@ -1038,7 +1038,7 @@ proc viewFile(rodfile: string) = of "ID": inc(r.pos) # skip ':' r.moduleID = decodeVInt(r.s, r.pos) - setID(r.moduleID) + setId(r.moduleID) outf.writeln("ID:", $r.moduleID) of "ORIGFILE": inc(r.pos) @@ -1140,12 +1140,12 @@ proc viewFile(rodfile: string) = outf.write("DATA(\n") while r.s[r.pos] != ')': if r.s[r.pos] == '(': - outf.writeNode decodeNode(r, UnknownLineInfo()) + outf.writeNode decodeNode(r, unknownLineInfo()) outf.write("\n") elif r.s[r.pos] == '[': - outf.writeType decodeType(r, UnknownLineInfo()) + outf.writeType decodeType(r, unknownLineInfo()) else: - outf.writeSym decodeSym(r, UnknownLineInfo()) + outf.writeSym decodeSym(r, unknownLineInfo()) if r.s[r.pos] == '\x0A': inc(r.pos) inc(r.line) diff --git a/compiler/rodutils.nim b/compiler/rodutils.nim index 4527f77daa..4433ed4abd 100644 --- a/compiler/rodutils.nim +++ b/compiler/rodutils.nim @@ -119,7 +119,7 @@ template decodeIntImpl() = proc decodeVInt*(s: cstring, pos: var int): int = decodeIntImpl() -proc decodeVBiggestInt*(s: cstring, pos: var int): biggestInt = +proc decodeVBiggestInt*(s: cstring, pos: var int): BiggestInt = decodeIntImpl() iterator decodeVIntArray*(s: cstring): int = diff --git a/compiler/rodwrite.nim b/compiler/rodwrite.nim index 2e52aeaa7a..be55a5c172 100644 --- a/compiler/rodwrite.nim +++ b/compiler/rodwrite.nim @@ -56,7 +56,7 @@ proc fileIdx(w: PRodWriter, filename: string): int = if w.files[i] == filename: return i result = len(w.files) - setlen(w.files, result + 1) + setLen(w.files, result + 1) w.files[result] = filename template filename*(w: PRodWriter): string = @@ -66,8 +66,8 @@ proc newRodWriter(crc: TCrc32, module: PSym): PRodWriter = new(result) result.sstack = @[] result.tstack = @[] - InitIITable(result.index.tab) - InitIITable(result.imports.tab) + initIiTable(result.index.tab) + initIiTable(result.imports.tab) result.index.r = "" result.imports.r = "" result.crc = crc @@ -101,12 +101,12 @@ proc addInclDep(w: PRodWriter, dep: string) = proc pushType(w: PRodWriter, t: PType) = # check so that the stack does not grow too large: - if IiTableGet(w.index.tab, t.id) == invalidKey: + if iiTableGet(w.index.tab, t.id) == invalidKey: w.tstack.add(t) proc pushSym(w: PRodWriter, s: PSym) = # check so that the stack does not grow too large: - if IiTableGet(w.index.tab, s.id) == invalidKey: + if iiTableGet(w.index.tab, s.id) == invalidKey: w.sstack.add(s) proc encodeNode(w: PRodWriter, fInfo: TLineInfo, n: PNode, @@ -120,19 +120,19 @@ proc encodeNode(w: PRodWriter, fInfo: TLineInfo, n: PNode, # we do not write comments for now # Line information takes easily 20% or more of the filesize! Therefore we # omit line information if it is the same as the father's line information: - if finfo.fileIndex != n.info.fileIndex: + if fInfo.fileIndex != n.info.fileIndex: result.add('?') encodeVInt(n.info.col, result) result.add(',') encodeVInt(n.info.line, result) result.add(',') encodeVInt(fileIdx(w, toFilename(n.info)), result) - elif finfo.line != n.info.line: + elif fInfo.line != n.info.line: result.add('?') encodeVInt(n.info.col, result) result.add(',') encodeVInt(n.info.line, result) - elif finfo.col != n.info.col: + elif fInfo.col != n.info.col: result.add('?') encodeVInt(n.info.col, result) # No need to output the file index, as this is the serialization of one @@ -190,7 +190,7 @@ proc encodeLoc(w: PRodWriter, loc: TLoc, result: var string) = if loc.a != 0: add(result, '?') encodeVInt(loc.a, result) - if oldlen + 1 == result.len: + if oldLen + 1 == result.len: # no data was necessary, so remove the '<' again: setLen(result, oldLen) else: @@ -202,7 +202,7 @@ proc encodeType(w: PRodWriter, t: PType, result: var string) = result.add("[]") return # we need no surrounding [] here because the type is in a line of its own - if t.kind == tyForward: InternalError("encodeType: tyForward") + if t.kind == tyForward: internalError("encodeType: tyForward") # for the new rodfile viewer we use a preceeding [ so that the data section # can easily be disambiguated: add(result, '[') @@ -210,7 +210,7 @@ proc encodeType(w: PRodWriter, t: PType, result: var string) = add(result, '+') encodeVInt(t.id, result) if t.n != nil: - encodeNode(w, UnknownLineInfo(), t.n, result) + encodeNode(w, unknownLineInfo(), t.n, result) if t.flags != {}: add(result, '$') encodeVInt(cast[int32](t.flags), result) @@ -292,7 +292,7 @@ proc encodeSym(w: PRodWriter, s: PSym, result: var string) = if s.annex != nil: encodeLib(w, s.annex, s.info, result) if s.constraint != nil: add(result, '#') - encodeNode(w, UnknownLineInfo(), s.constraint, result) + encodeNode(w, unknownLineInfo(), s.constraint, result) # lazy loading will soon reload the ast lazily, so the ast needs to be # the last entry of a symbol: if s.ast != nil: @@ -322,7 +322,7 @@ proc addToIndex(w: var TIndex, key, val: int) = add(w.r, rodNL) w.lastIdxKey = key w.lastIdxVal = val - IiTablePut(w.tab, key, val) + iiTablePut(w.tab, key, val) const debugWrittenIds = false @@ -336,9 +336,9 @@ proc symStack(w: PRodWriter): int = if sfForward in s.flags: w.sstack[result] = s inc result - elif IiTableGet(w.index.tab, s.id) == invalidKey: + elif iiTableGet(w.index.tab, s.id) == invalidKey: var m = getModule(s) - if m == nil: InternalError("symStack: module nil: " & s.name.s) + if m == nil: internalError("symStack: module nil: " & s.name.s) if (m.id == w.module.id) or (sfFromGeneric in s.flags): # put definition in here var L = w.data.len @@ -364,7 +364,7 @@ proc symStack(w: PRodWriter): int = if s.kind == skMethod and sfDispatcher notin s.flags: if w.methods.len != 0: add(w.methods, ' ') encodeVInt(s.id, w.methods) - elif IiTableGet(w.imports.tab, s.id) == invalidKey: + elif iiTableGet(w.imports.tab, s.id) == invalidKey: addToIndex(w.imports, s.id, m.id) when debugWrittenIds: if not Contains(debugWritten, s.id): @@ -374,7 +374,7 @@ proc symStack(w: PRodWriter): int = debug(m) InternalError("Symbol referred to but never written") inc(i) - setlen(w.sstack, result) + setLen(w.sstack, result) proc typeStack(w: PRodWriter): int = var i = 0 @@ -383,13 +383,13 @@ proc typeStack(w: PRodWriter): int = if t.kind == tyForward: w.tstack[result] = t inc result - elif IiTableGet(w.index.tab, t.id) == invalidKey: + elif iiTableGet(w.index.tab, t.id) == invalidKey: var L = w.data.len addToIndex(w.index, t.id, L) encodeType(w, t, w.data) add(w.data, rodNL) inc(i) - setlen(w.tstack, result) + setLen(w.tstack, result) proc processStacks(w: PRodWriter, finalPass: bool) = var oldS = 0 @@ -401,7 +401,7 @@ proc processStacks(w: PRodWriter, finalPass: bool) = oldS = slen oldT = tlen if finalPass and (oldS != 0 or oldT != 0): - InternalError("could not serialize some forwarded symbols/types") + internalError("could not serialize some forwarded symbols/types") proc rawAddInterfaceSym(w: PRodWriter, s: PSym) = pushSym(w, s) @@ -416,7 +416,7 @@ proc addInterfaceSym(w: PRodWriter, s: PSym) = proc addStmt(w: PRodWriter, n: PNode) = encodeVInt(w.data.len, w.init) add(w.init, rodNL) - encodeNode(w, UnknownLineInfo(), n, w.data) + encodeNode(w, unknownLineInfo(), n, w.data) add(w.data, rodNL) processStacks(w, false) @@ -534,9 +534,9 @@ proc process(c: PPassContext, n: PNode): PNode = of nkProcDef, nkMethodDef, nkIteratorDef, nkConverterDef, nkTemplateDef, nkMacroDef: var s = n.sons[namePos].sym - if s == nil: InternalError(n.info, "rodwrite.process") + if s == nil: internalError(n.info, "rodwrite.process") if n.sons[bodyPos] == nil: - InternalError(n.info, "rodwrite.process: body is nil") + internalError(n.info, "rodwrite.process: body is nil") if n.sons[bodyPos].kind != nkEmpty or s.magic != mNone or sfForward notin s.flags: addInterfaceSym(w, s) @@ -549,7 +549,7 @@ proc process(c: PPassContext, n: PNode): PNode = for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if a.sons[0].kind != nkSym: InternalError(a.info, "rodwrite.process") + if a.sons[0].kind != nkSym: internalError(a.info, "rodwrite.process") var s = a.sons[0].sym addInterfaceSym(w, s) # this takes care of enum fields too @@ -576,8 +576,8 @@ proc process(c: PPassContext, n: PNode): PNode = nil proc myOpen(module: PSym): PPassContext = - if module.id < 0: InternalError("rodwrite: module ID not set") - var w = newRodWriter(module.fileIdx.GetCRC, module) + if module.id < 0: internalError("rodwrite: module ID not set") + var w = newRodWriter(module.fileIdx.getCRC, module) rawAddInterfaceSym(w, module) result = w diff --git a/compiler/ropes.nim b/compiler/ropes.nim index 4f8553375f..f3c0a00e00 100644 --- a/compiler/ropes.nim +++ b/compiler/ropes.nim @@ -162,9 +162,9 @@ proc toRope(s: string): PRope = proc ropeSeqInsert(rs: var TRopeSeq, r: PRope, at: Natural) = var length = len(rs) if at > length: - setlen(rs, at + 1) + setLen(rs, at + 1) else: - setlen(rs, length + 1) # move old rope elements: + setLen(rs, length + 1) # move old rope elements: for i in countdown(length, at + 1): rs[i] = rs[i - 1] # this is correct, I used pen and paper to validate it rs[at] = r @@ -228,9 +228,9 @@ proc writeRope*(f: TFile, c: PRope) = write(f, it.data) proc writeRope*(head: PRope, filename: string, useWarning = false) = - var f: tfile + var f: TFile if open(f, filename, fmWrite): - if head != nil: WriteRope(f, head) + if head != nil: writeRope(f, head) close(f) else: errorHandler(rCannotOpenFile, filename, useWarning) @@ -258,7 +258,7 @@ proc ropef(frmt: TFormatStr, args: varargs[PRope]): PRope = of '0'..'9': var j = 0 while true: - j = (j * 10) + Ord(frmt[i]) - ord('0') + j = (j * 10) + ord(frmt[i]) - ord('0') inc(i) if (i > length + 0 - 1) or not (frmt[i] in {'0'..'9'}): break num = j @@ -296,10 +296,10 @@ proc appf(c: var PRope, frmt: TFormatStr, args: varargs[PRope]) = const bufSize = 1024 # 1 KB is reasonable -proc auxRopeEqualsFile(r: PRope, bin: var tfile, buf: Pointer): bool = +proc auxRopeEqualsFile(r: PRope, bin: var TFile, buf: pointer): bool = if r.data != nil: if r.length > bufSize: - ErrorHandler(rTokenTooLong, r.data) + errorHandler(rTokenTooLong, r.data) return var readBytes = readBuffer(bin, buf, r.length) result = readBytes == r.length and diff --git a/compiler/saturate.nim b/compiler/saturate.nim index e0968843b6..ed197bdd1b 100644 --- a/compiler/saturate.nim +++ b/compiler/saturate.nim @@ -9,7 +9,7 @@ ## Saturated arithmetic routines. XXX Make part of the stdlib? -proc `|+|`*(a, b: biggestInt): biggestInt = +proc `|+|`*(a, b: BiggestInt): BiggestInt = ## saturated addition. result = a +% b if (result xor a) >= 0'i64 or (result xor b) >= 0'i64: @@ -19,7 +19,7 @@ proc `|+|`*(a, b: biggestInt): biggestInt = else: result = high(result) -proc `|-|`*(a, b: biggestInt): biggestInt = +proc `|-|`*(a, b: BiggestInt): BiggestInt = result = a -% b if (result xor a) >= 0'i64 or (result xor not b) >= 0'i64: return result @@ -28,14 +28,14 @@ proc `|-|`*(a, b: biggestInt): biggestInt = else: result = high(result) -proc `|abs|`*(a: biggestInt): biggestInt = +proc `|abs|`*(a: BiggestInt): BiggestInt = if a != low(a): if a >= 0: result = a else: result = -a else: result = low(a) -proc `|div|`*(a, b: biggestInt): biggestInt = +proc `|div|`*(a, b: BiggestInt): BiggestInt = # (0..5) div (0..4) == (0..5) div (1..4) == (0 div 4) .. (5 div 1) if b == 0'i64: # make the same as ``div 1``: @@ -45,13 +45,13 @@ proc `|div|`*(a, b: biggestInt): biggestInt = else: result = a div b -proc `|mod|`*(a, b: biggestInt): biggestInt = +proc `|mod|`*(a, b: BiggestInt): BiggestInt = if b == 0'i64: result = a else: result = a mod b -proc `|*|`*(a, b: biggestInt): biggestInt = +proc `|*|`*(a, b: BiggestInt): BiggestInt = var resAsFloat, floatProd: float64 result = a *% b diff --git a/compiler/sem.nim b/compiler/sem.nim index ee1019aa80..123a813af7 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -47,19 +47,19 @@ proc indexTypesMatch(c: PContext, f, a: PType, arg: PNode): PNode proc typeMismatch(n: PNode, formal, actual: PType) = if formal.kind != tyError and actual.kind != tyError: - LocalError(n.Info, errGenerated, msgKindToString(errTypeMismatch) & + localError(n.Info, errGenerated, msgKindToString(errTypeMismatch) & typeToString(actual) & ") " & `%`(msgKindToString(errButExpectedX), [typeToString(formal)])) proc fitNode(c: PContext, formal: PType, arg: PNode): PNode = if arg.typ.isNil: - LocalError(arg.info, errExprXHasNoType, + localError(arg.info, errExprXHasNoType, renderTree(arg, {renderNoComments})) # error correction: result = copyNode(arg) result.typ = formal else: - result = IndexTypesMatch(c, formal, arg.typ, arg) + result = indexTypesMatch(c, formal, arg.typ, arg) if result == nil: typeMismatch(arg, formal, arg.typ) # error correction: @@ -176,7 +176,7 @@ when false: proc semConstExpr(c: PContext, n: PNode): PNode = var e = semExprWithType(c, n) if e == nil: - LocalError(n.info, errConstExprExpected) + localError(n.info, errConstExprExpected) return n result = getConstExpr(c.module, e) if result == nil: @@ -184,10 +184,10 @@ proc semConstExpr(c: PContext, n: PNode): PNode = if result == nil or result.kind == nkEmpty: if e.info != n.info: pushInfoContext(n.info) - LocalError(e.info, errConstExprExpected) + localError(e.info, errConstExprExpected) popInfoContext() else: - LocalError(e.info, errConstExprExpected) + localError(e.info, errConstExprExpected) # error correction: result = e else: @@ -241,7 +241,7 @@ proc semMacroExpr(c: PContext, n, nOrig: PNode, sym: PSym, semCheck: bool = true): PNode = markUsed(n, sym) if sym == c.p.owner: - GlobalError(n.info, errRecursiveDependencyX, sym.name.s) + globalError(n.info, errRecursiveDependencyX, sym.name.s) #if c.evalContext == nil: # c.evalContext = c.createEvalContext(emStatic) @@ -257,11 +257,11 @@ proc semConstBoolExpr(c: PContext, n: PNode): PNode = let nn = semExprWithType(c, n) result = fitNode(c, getSysType(tyBool), nn) if result == nil: - LocalError(n.info, errConstExprExpected) + localError(n.info, errConstExprExpected) return nn result = getConstExpr(c.module, result) if result == nil: - LocalError(n.info, errConstExprExpected) + localError(n.info, errConstExprExpected) result = nn include semtypes, semtempl, semgnrc, semstmts, semexprs @@ -271,14 +271,14 @@ proc addCodeForGenerics(c: PContext, n: PNode) = var prc = c.generics[i].inst.sym if prc.kind in {skProc, skMethod, skConverter} and prc.magic == mNone: if prc.ast == nil or prc.ast.sons[bodyPos] == nil: - InternalError(prc.info, "no code for " & prc.name.s) + internalError(prc.info, "no code for " & prc.name.s) else: addSon(n, prc.ast) c.lastGenericIdx = c.generics.len proc myOpen(module: PSym): PPassContext = var c = newContext(module) - if c.p != nil: InternalError(module.info, "sem.myOpen") + if c.p != nil: internalError(module.info, "sem.myOpen") c.semConstExpr = semConstExpr c.semExpr = semExpr c.semTryExpr = tryExpr @@ -329,14 +329,14 @@ proc myProcess(context: PPassContext, n: PNode): PNode = var c = PContext(context) # no need for an expensive 'try' if we stop after the first error anyway: if msgs.gErrorMax <= 1: - result = SemStmtAndGenerateGenerics(c, n) + result = semStmtAndGenerateGenerics(c, n) else: let oldContextLen = msgs.getInfoContextLen() let oldInGenericInst = c.InGenericInst try: - result = SemStmtAndGenerateGenerics(c, n) + result = semStmtAndGenerateGenerics(c, n) except ERecoverableError, ESuggestDone: - RecoverContext(c) + recoverContext(c) c.InGenericInst = oldInGenericInst msgs.setInfoContextLen(oldContextLen) if getCurrentException() of ESuggestDone: result = nil @@ -354,7 +354,7 @@ proc myClose(context: PPassContext, n: PNode): PNode = rawCloseScope(c) # imported symbols; don't check for unused ones! result = newNode(nkStmtList) if n != nil: - InternalError(n.info, "n is not nil") #result := n; + internalError(n.info, "n is not nil") #result := n; addCodeForGenerics(c, result) if c.module.ast != nil: result.add(c.module.ast) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 8fe81c4c6a..38ff0f3be6 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -150,16 +150,16 @@ proc resolveOverloads(c: PContext, n, orig: PNode, pickBest(callOp) if overloadsState == csEmpty and result.state == csEmpty: - LocalError(n.info, errUndeclaredIdentifier, considerAcc(f).s) + localError(n.info, errUndeclaredIdentifier, considerAcc(f).s) return elif result.state != csMatch: if nfExprCall in n.flags: - LocalError(n.info, errExprXCannotBeCalled, + localError(n.info, errExprXCannotBeCalled, renderTree(n, {renderNoComments})) else: errors = @[] pickBest(f) - NotFoundError(c, n, errors) + notFoundError(c, n, errors) return if alt.state == csMatch and cmpCandidates(result, alt) == 0 and @@ -225,7 +225,7 @@ proc semResolvedCall(c: PContext, n: PNode, x: TCandidate): PNode = result = x.call result.sons[0] = newSymNode(finalCallee, result.sons[0].info) result.typ = finalCallee.typ.sons[0] - if ContainsGenericType(result.typ): result.typ = errorType(c) + if containsGenericType(result.typ): result.typ = errorType(c) return result = x.call instGenericConvertersSons(c, result, x) @@ -260,7 +260,7 @@ proc explicitGenericInstantiation(c: PContext, n: PNode, s: PSym): PNode = # number of generic type parameters: if safeLen(s.ast.sons[genericParamsPos]) != n.len-1: let expected = safeLen(s.ast.sons[genericParamsPos]) - LocalError(n.info, errGenerated, "cannot instantiate: " & renderTree(n) & + localError(n.info, errGenerated, "cannot instantiate: " & renderTree(n) & "; got " & $(n.len-1) & " type(s) but expected " & $expected) return n result = explicitGenericSym(c, n, s) diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 1ab38c9ce5..15f0f71f07 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -133,7 +133,7 @@ proc pushOwner(owner: PSym) = proc popOwner() = var length = len(gOwners) - if length > 0: setlen(gOwners, length - 1) + if length > 0: setLen(gOwners, length - 1) else: internalError("popOwner") proc lastOptionEntry(c: PContext): POptionEntry = @@ -141,7 +141,7 @@ proc lastOptionEntry(c: PContext): POptionEntry = proc pushProcCon*(c: PContext, owner: PSym) {.inline.} = if owner == nil: - InternalError("owner is nil") + internalError("owner is nil") return var x: PProcCon new(x) @@ -160,7 +160,7 @@ proc newOptionEntry(): POptionEntry = proc newContext(module: PSym): PContext = new(result) - result.AmbiguousSymbols = initIntset() + result.AmbiguousSymbols = initIntSet() initLinkedList(result.optionStack) initLinkedList(result.libs) append(result.optionStack, newOptionEntry()) @@ -178,7 +178,7 @@ proc inclSym(sq: var TSymSeq, s: PSym) = var L = len(sq) for i in countup(0, L - 1): if sq[i].id == s.id: return - setlen(sq, L + 1) + setLen(sq, L + 1) sq[L] = s proc addConverter*(c: PContext, conv: PSym) = @@ -234,7 +234,7 @@ proc fillTypeS(dest: PType, kind: TTypeKind, c: PContext) = dest.owner = getCurrOwner() dest.size = - 1 -proc makeRangeType*(c: PContext; first, last: biggestInt; +proc makeRangeType*(c: PContext; first, last: BiggestInt; info: TLineInfo; intType = getSysType(tyInt)): PType = var n = newNodeI(nkRange, info) addSon(n, newIntTypeNode(nkIntLit, first, intType)) diff --git a/compiler/semdestruct.nim b/compiler/semdestruct.nim index 47d7838181..6965b36bc9 100644 --- a/compiler/semdestruct.nim +++ b/compiler/semdestruct.nim @@ -22,7 +22,7 @@ new(destructorIsTrivial) var destructorName = getIdent"destroy_" destructorParam = getIdent"this_" - destructorPragma = newIdentNode(getIdent"destructor", UnknownLineInfo()) + destructorPragma = newIdentNode(getIdent"destructor", unknownLineInfo()) rangeDestructorProc*: PSym proc instantiateDestructor(c: PContext, typ: PType): bool @@ -90,7 +90,7 @@ proc generateDestructor(c: PContext, t: PType): PNode = # Tposix_spawnattr if t.n == nil or t.n.sons == nil: return internalAssert t.n.kind == nkRecList - let destructedObj = newIdentNode(destructorParam, UnknownLineInfo()) + let destructedObj = newIdentNode(destructorParam, unknownLineInfo()) # call the destructods of all fields for s in countup(0, t.n.sons.len - 1): case t.n.sons[s].kind @@ -114,7 +114,7 @@ proc instantiateDestructor(c: PContext, typ: PType): bool = if t.destructor != nil: # XXX: This is not entirely correct for recursive types, but we need # it temporarily to hide the "destroy is already defined" problem - return t.destructor notin [AnalyzingDestructor, DestructorIsTrivial] + return t.destructor notin [analyzingDestructor, destructorIsTrivial] case t.kind of tySequence, tyArray, tyArrayConstr, tyOpenArray, tyVarargs: @@ -126,7 +126,7 @@ proc instantiateDestructor(c: PContext, typ: PType): bool = else: return false of tyTuple, tyObject: - t.destructor = AnalyzingDestructor + t.destructor = analyzingDestructor let generated = generateDestructor(c, t) if generated != nil: internalAssert t.sym != nil @@ -150,7 +150,7 @@ proc instantiateDestructor(c: PContext, typ: PType): bool = internalAssert t.destructor != nil return true else: - t.destructor = DestructorIsTrivial + t.destructor = destructorIsTrivial return false else: return false diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 5f41a8dd94..43091aa741 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -30,7 +30,7 @@ proc semOperand(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = # XXX tyGenericInst here? if result.typ.kind == tyVar: result = newDeref(result) else: - LocalError(n.info, errExprXHasNoType, + localError(n.info, errExprXHasNoType, renderTree(result, {renderNoComments})) result.typ = errorType(c) @@ -40,9 +40,9 @@ proc semExprWithType(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = # do not produce another redundant error message: #raiseRecoverableError("") result = errorNode(c, n) - if result.typ == nil or result.typ == EnforceVoidContext: + if result.typ == nil or result.typ == enforceVoidContext: # we cannot check for 'void' in macros ... - LocalError(n.info, errExprXHasNoType, + localError(n.info, errExprXHasNoType, renderTree(result, {renderNoComments})) result.typ = errorType(c) else: @@ -57,7 +57,7 @@ proc semExprNoDeref(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = # do not produce another redundant error message: result = errorNode(c, n) if result.typ == nil: - LocalError(n.info, errExprXHasNoType, + localError(n.info, errExprXHasNoType, renderTree(result, {renderNoComments})) result.typ = errorType(c) else: @@ -117,7 +117,7 @@ proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = elif s.ast != nil: result = semExpr(c, s.ast) else: - InternalError(n.info, "no default for") + internalError(n.info, "no default for") result = emptyNode of skType: markUsed(n, s) @@ -175,7 +175,7 @@ proc isCastable(dst, src: PType): bool = # castableTypeKinds = {tyInt, tyPtr, tyRef, tyCstring, tyString, # tySequence, tyPointer, tyNil, tyOpenArray, # tyProc, tySet, tyEnum, tyBool, tyChar} - var ds, ss: biggestInt + var ds, ss: BiggestInt # this is very unrestrictive; cast is allowed if castDest.size >= src.size ds = computeSize(dst) ss = computeSize(src) @@ -193,7 +193,7 @@ proc isSymChoice(n: PNode): bool {.inline.} = proc semConv(c: PContext, n: PNode): PNode = if sonsLen(n) != 2: - LocalError(n.info, errConvNeedsOneArg) + localError(n.info, errConvNeedsOneArg) return n result = newNodeI(nkConv, n.info) result.typ = semTypeNode(c, n.sons[0], nil).skipTypes({tyGenericInst}) @@ -206,9 +206,9 @@ proc semConv(c: PContext, n: PNode): PNode = case status of convOK: nil of convNotNeedeed: - Message(n.info, hintConvFromXtoItselfNotNeeded, result.typ.typeToString) + message(n.info, hintConvFromXtoItselfNotNeeded, result.typ.typeToString) of convNotLegal: - LocalError(n.info, errGenerated, MsgKindToString(errIllegalConvFromXtoY)% + localError(n.info, errGenerated, msgKindToString(errIllegalConvFromXtoY)% [op.typ.typeToString, result.typ.typeToString]) else: for i in countup(0, sonsLen(op) - 1): @@ -229,14 +229,14 @@ proc semCast(c: PContext, n: PNode): PNode = addSon(result, copyTree(n.sons[0])) addSon(result, semExprWithType(c, n.sons[1])) if not isCastable(result.typ, result.sons[1].Typ): - LocalError(result.info, errExprCannotBeCastedToX, + localError(result.info, errExprCannotBeCastedToX, typeToString(result.Typ)) proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = const opToStr: array[mLow..mHigh, string] = ["low", "high"] if sonsLen(n) != 2: - LocalError(n.info, errXExpectsTypeOrValue, opToStr[m]) + localError(n.info, errXExpectsTypeOrValue, opToStr[m]) else: n.sons[1] = semExprWithType(c, n.sons[1], {efDetermineType}) var typ = skipTypes(n.sons[1].typ, abstractVarRange) @@ -252,12 +252,12 @@ proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = # leave it for now, it will be resolved in semtypinst n.typ = getSysType(tyInt) else: - LocalError(n.info, errInvalidArgForX, opToStr[m]) + localError(n.info, errInvalidArgForX, opToStr[m]) result = n proc semSizeof(c: PContext, n: PNode): PNode = if sonsLen(n) != 2: - LocalError(n.info, errXExpectsTypeOrValue, "sizeof") + localError(n.info, errXExpectsTypeOrValue, "sizeof") else: n.sons[1] = semExprWithType(c, n.sons[1], {efDetermineType}) #restoreOldStyleType(n.sons[1]) @@ -276,9 +276,9 @@ proc semOf(c: PContext, n: PNode): PNode = let y = skipTypes(n.sons[2].typ, abstractPtrs-{tyTypeDesc}) if x.kind == tyTypeDesc or y.kind != tyTypeDesc: - LocalError(n.info, errXExpectsObjectTypes, "of") + localError(n.info, errXExpectsObjectTypes, "of") elif b.kind != tyObject or a.kind != tyObject: - LocalError(n.info, errXExpectsObjectTypes, "of") + localError(n.info, errXExpectsObjectTypes, "of") else: let diff = inheritanceDiff(a, b) # | returns: 0 iff `a` == `b` @@ -287,15 +287,15 @@ proc semOf(c: PContext, n: PNode): PNode = # | returns: `maxint` iff `a` and `b` are not compatible at all if diff <= 0: # optimize to true: - Message(n.info, hintConditionAlwaysTrue, renderTree(n)) + message(n.info, hintConditionAlwaysTrue, renderTree(n)) result = newIntNode(nkIntLit, 1) result.info = n.info result.typ = getSysType(tyBool) return result elif diff == high(int): - LocalError(n.info, errXcanNeverBeOfThisSubtype, typeToString(a)) + localError(n.info, errXcanNeverBeOfThisSubtype, typeToString(a)) else: - LocalError(n.info, errXExpectsTwoArguments, "of") + localError(n.info, errXExpectsTwoArguments, "of") n.typ = getSysType(tyBool) result = n @@ -324,15 +324,15 @@ proc isOpImpl(c: PContext, n: PNode): PNode = case t2.kind of tyTypeClasses: var m: TCandidate - InitCandidate(m, t2) + initCandidate(m, t2) match = matchUserTypeClass(c, m, emptyNode, t2, t1) != nil of tyOrdinal: var m: TCandidate - InitCandidate(m, t2) + initCandidate(m, t2) match = isOrdinalType(t1) of tySequence, tyArray, tySet: var m: TCandidate - InitCandidate(m, t2) + initCandidate(m, t2) match = typeRel(m, t2, t1) != isNone else: match = sameType(t1, t2) @@ -343,7 +343,7 @@ proc isOpImpl(c: PContext, n: PNode): PNode = proc semIs(c: PContext, n: PNode): PNode = if sonsLen(n) != 3: - LocalError(n.info, errXExpectsTwoArguments, "is") + localError(n.info, errXExpectsTwoArguments, "is") result = n n.typ = getSysType(tyBool) @@ -394,7 +394,7 @@ proc changeType(n: PNode, newType: PType, check: bool) = changeType(n.sons[i], elemType(newType), check) of nkPar: if newType.kind != tyTuple: - InternalError(n.info, "changeType: no tuple type for constructor") + internalError(n.info, "changeType: no tuple type for constructor") elif newType.n == nil: nil elif sonsLen(n) > 0 and n.sons[0].kind == nkExprColonExpr: for i in countup(0, sonsLen(n) - 1): @@ -419,7 +419,7 @@ proc changeType(n: PNode, newType: PType, check: bool) = if check: let value = n.intVal if value < firstOrd(newType) or value > lastOrd(newType): - LocalError(n.info, errGenerated, "cannot convert " & $value & + localError(n.info, errGenerated, "cannot convert " & $value & " to " & typeToString(newType)) else: nil n.typ = newType @@ -431,7 +431,7 @@ proc arrayConstrType(c: PContext, n: PNode): PType = rawAddSon(typ, newTypeS(tyEmpty, c)) # needs an empty basetype! else: var x = n.sons[0] - var lastIndex: biggestInt = sonsLen(n) - 1 + var lastIndex: BiggestInt = sonsLen(n) - 1 var t = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar, tyOrdinal}) addSonSkipIntLit(typ, t) typ.sons[0] = makeRangeType(c, 0, sonsLen(n) - 1, n.info) @@ -445,7 +445,7 @@ proc semArrayConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = rawAddSon(result.typ, newTypeS(tyEmpty, c)) # needs an empty basetype! else: var x = n.sons[0] - var lastIndex: biggestInt = 0 + var lastIndex: BiggestInt = 0 var indexType = getSysType(tyInt) if x.kind == nkExprColonExpr and sonsLen(x) == 2: var idx = semConstExpr(c, x.sons[0]) @@ -582,7 +582,7 @@ proc analyseIfAddressTakenInCall(c: PContext, n: PNode) = skipTypes(t.sons[i], abstractInst-{tyTypeDesc}).kind == tyVar: if isAssignable(c, n.sons[i]) notin {arLValue, arLocalLValue}: if n.sons[i].kind != nkHiddenAddr: - LocalError(n.sons[i].info, errVarForOutParamNeeded) + localError(n.sons[i].info, errVarForOutParamNeeded) return for i in countup(1, sonsLen(n) - 1): if n.sons[i].kind == nkHiddenCallConv: @@ -642,7 +642,7 @@ proc evalAtCompileTime(c: PContext, n: PNode): PNode = if sfCompileTime in callee.flags: result = evalStaticExpr(c.module, call, c.p.owner) if result.isNil: - LocalError(n.info, errCannotInterpretNodeX, renderTree(call)) + localError(n.info, errCannotInterpretNodeX, renderTree(call)) else: result = evalConstExpr(c.module, call) if result.isNil: result = n @@ -653,7 +653,7 @@ proc semStaticExpr(c: PContext, n: PNode): PNode = let a = semExpr(c, n.sons[0]) result = evalStaticExpr(c.module, a, c.p.owner) if result.isNil: - LocalError(n.info, errCannotInterpretNodeX, renderTree(n)) + localError(n.info, errCannotInterpretNodeX, renderTree(n)) result = emptyNode proc semOverloadedCallAnalyseEffects(c: PContext, n: PNode, nOrig: PNode, @@ -670,14 +670,14 @@ proc semOverloadedCallAnalyseEffects(c: PContext, n: PNode, nOrig: PNode, {skProc, skMethod, skConverter, skMacro, skTemplate}) if result != nil: if result.sons[0].kind != nkSym: - InternalError("semOverloadedCallAnalyseEffects") + internalError("semOverloadedCallAnalyseEffects") return let callee = result.sons[0].sym case callee.kind of skMacro, skTemplate: nil else: if (callee.kind == skIterator) and (callee.id == c.p.owner.id): - LocalError(n.info, errRecursiveDependencyX, callee.name.s) + localError(n.info, errRecursiveDependencyX, callee.name.s) if sfNoSideEffect notin callee.flags: if {sfImportc, sfSideEffect} * callee.flags != {}: incl(c.p.owner.flags, sfSideEffect) @@ -711,7 +711,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = if m.state != csMatch: if c.inCompilesContext > 0: # speed up error generation: - GlobalError(n.Info, errTypeMismatch, "") + globalError(n.Info, errTypeMismatch, "") return emptyNode else: var hasErrorType = false @@ -726,7 +726,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = if not hasErrorType: add(msg, ")\n" & msgKindToString(errButExpected) & "\n" & typeToString(n.sons[0].typ)) - LocalError(n.Info, errGenerated, msg) + localError(n.Info, errGenerated, msg) return errorNode(c, n) result = nil else: @@ -801,7 +801,7 @@ proc semEcho(c: PContext, n: PNode): PNode = let t = arg.typ if (t == nil or t.skipTypes(abstractInst).kind != tyString) and arg.kind != nkEmpty: - LocalError(n.info, errGenerated, + localError(n.info, errGenerated, "implicitly invoked '$' does not return string") let t = n.sons[0].typ if tfNoSideEffect notin t.flags: incl(c.p.owner.flags, sfSideEffect) @@ -810,11 +810,11 @@ proc semEcho(c: PContext, n: PNode): PNode = proc buildEchoStmt(c: PContext, n: PNode): PNode = # we MUST not check 'n' for semantics again here! result = newNodeI(nkCall, n.info) - var e = StrTableGet(magicsys.systemModule.Tab, getIdent"echo") + var e = strTableGet(magicsys.systemModule.Tab, getIdent"echo") if e != nil: addSon(result, newSymNode(e)) else: - LocalError(n.info, errSystemNeeds, "echo") + localError(n.info, errSystemNeeds, "echo") addSon(result, errorNode(c, n)) var arg = buildStringify(c, n) # problem is: implicit '$' is not checked for semantics yet. So we give up @@ -844,7 +844,7 @@ proc lookupInRecordAndBuildCheck(c: PContext, n, r: PNode, field: PIdent, if result != nil: return of nkRecCase: checkMinSonsLen(r, 2) - if (r.sons[0].kind != nkSym): IllFormedAst(r) + if (r.sons[0].kind != nkSym): illFormedAst(r) result = lookupInRecordAndBuildCheck(c, n, r.sons[0], field, check) if result != nil: return var s = newNodeI(nkCurly, r.info) @@ -906,7 +906,7 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = # early exit for this; see tests/compile/tbindoverload.nim: if isSymChoice(n.sons[1]): return - var s = qualifiedLookup(c, n, {checkAmbiguity, checkUndeclared}) + var s = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared}) if s != nil: return semSym(c, n, s, flags) @@ -1038,7 +1038,7 @@ proc semSubscript(c: PContext, n: PNode, flags: TExprFlags): PNode = n.sons[i] = semExprWithType(c, n.sons[i], flags*{efInTypeof, efDetermineType}) var indexType = if arr.kind == tyArray: arr.sons[0] else: getSysType(tyInt) - var arg = IndexTypesMatch(c, indexType, n.sons[1].typ, n.sons[1]) + var arg = indexTypesMatch(c, indexType, n.sons[1].typ, n.sons[1]) if arg != nil: n.sons[1] = arg result = n @@ -1060,9 +1060,9 @@ proc semSubscript(c: PContext, n: PNode, flags: TExprFlags): PNode = {tyInt..tyInt64}: var idx = getOrdValue(n.sons[1]) if idx >= 0 and idx < sonsLen(arr): n.typ = arr.sons[int(idx)] - else: LocalError(n.info, errInvalidIndexValueForTuple) + else: localError(n.info, errInvalidIndexValueForTuple) else: - LocalError(n.info, errIndexTypesDoNotMatch) + localError(n.info, errIndexTypesDoNotMatch) result = n else: nil @@ -1098,9 +1098,9 @@ proc takeImplicitAddr(c: PContext, n: PNode): PNode = var valid = isAssignable(c, n) if valid != arLValue: if valid == arLocalLValue: - LocalError(n.info, errXStackEscape, renderTree(n, {renderNoComments})) + localError(n.info, errXStackEscape, renderTree(n, {renderNoComments})) else: - LocalError(n.info, errExprHasNoAddress) + localError(n.info, errExprHasNoAddress) result = newNodeIT(nkHiddenAddr, n.info, makePtrType(c, n.typ)) result.add(n) @@ -1149,7 +1149,7 @@ proc semAsgn(c: PContext, n: PNode): PNode = # a = b # b no 'var T' means: a = addr(b) var le = a.typ if skipTypes(le, {tyGenericInst}).kind != tyVar and - IsAssignable(c, a) == arNone: + isAssignable(c, a) == arNone: # Direct assignment to a discriminant is allowed! localError(a.info, errXCannotBeAssignedTo, renderTree(a, {renderNoComments})) @@ -1161,7 +1161,7 @@ proc semAsgn(c: PContext, n: PNode): PNode = rhs = semExprWithType(c, n.sons[1], if lhsIsResult: {efAllowDestructor} else: {}) if lhsIsResult: - n.typ = EnforceVoidContext + n.typ = enforceVoidContext if lhs.sym.typ.kind == tyGenericParam: if matchTypeClass(lhs.typ, rhs.typ): InternalAssert c.p.resultSym != nil @@ -1192,9 +1192,9 @@ proc semReturn(c: PContext, n: PNode): PNode = if n[0][1].kind == nkSym and n[0][1].sym == c.p.resultSym: n.sons[0] = ast.emptyNode else: - LocalError(n.info, errNoReturnTypeDeclared) + localError(n.info, errNoReturnTypeDeclared) else: - LocalError(n.info, errXNotAllowedHere, "\'return\'") + localError(n.info, errXNotAllowedHere, "\'return\'") proc semProcBody(c: PContext, n: PNode): PNode = openScope(c) @@ -1246,16 +1246,16 @@ proc semYield(c: PContext, n: PNode): PNode = result = n checkSonsLen(n, 1) if c.p.owner == nil or c.p.owner.kind != skIterator: - LocalError(n.info, errYieldNotAllowedHere) + localError(n.info, errYieldNotAllowedHere) elif c.p.inTryStmt > 0 and c.p.owner.typ.callConv != ccInline: - LocalError(n.info, errYieldNotAllowedInTryStmt) + localError(n.info, errYieldNotAllowedInTryStmt) elif n.sons[0].kind != nkEmpty: - n.sons[0] = SemExprWithType(c, n.sons[0]) # check for type compatibility: + n.sons[0] = semExprWithType(c, n.sons[0]) # check for type compatibility: var restype = c.p.owner.typ.sons[0] if restype != nil: n.sons[0] = fitNode(c, restype, n.sons[0]) - if n.sons[0].typ == nil: InternalError(n.info, "semYield") - SemYieldVarResult(c, n, restype) + if n.sons[0].typ == nil: internalError(n.info, "semYield") + semYieldVarResult(c, n, restype) else: localError(n.info, errCannotReturnExpr) elif c.p.owner.typ.sons[0] != nil: @@ -1270,12 +1270,12 @@ proc lookUpForDefined(c: PContext, i: PIdent, onlyCurrentScope: bool): PSym = proc lookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = case n.kind of nkIdent: - result = lookupForDefined(c, n.ident, onlyCurrentScope) + result = lookUpForDefined(c, n.ident, onlyCurrentScope) of nkDotExpr: result = nil if onlyCurrentScope: return checkSonsLen(n, 2) - var m = lookupForDefined(c, n.sons[0], onlyCurrentScope) + var m = lookUpForDefined(c, n.sons[0], onlyCurrentScope) if (m != nil) and (m.kind == skModule): if (n.sons[1].kind == nkIdent): var ident = n.sons[1].ident @@ -1286,7 +1286,7 @@ proc lookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = else: localError(n.sons[1].info, errIdentifierExpected, "") of nkAccQuoted: - result = lookupForDefined(c, considerAcc(n), onlyCurrentScope) + result = lookUpForDefined(c, considerAcc(n), onlyCurrentScope) of nkSym: result = n.sym else: @@ -1297,7 +1297,7 @@ proc semDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PNode = checkSonsLen(n, 2) # we replace this node by a 'true' or 'false' node: result = newIntNode(nkIntLit, 0) - if LookUpForDefined(c, n.sons[1], onlyCurrentScope) != nil: + if lookUpForDefined(c, n.sons[1], onlyCurrentScope) != nil: result.intVal = 1 elif not onlyCurrentScope and (n.sons[1].kind == nkIdent) and condsyms.isDefined(n.sons[1].ident): @@ -1314,18 +1314,18 @@ proc expectMacroOrTemplateCall(c: PContext, n: PNode): PSym = ## The argument to the proc should be nkCall(...) or similar ## Returns the macro/template symbol if isCallExpr(n): - var expandedSym = qualifiedLookup(c, n[0], {checkUndeclared}) + var expandedSym = qualifiedLookUp(c, n[0], {checkUndeclared}) if expandedSym == nil: - LocalError(n.info, errUndeclaredIdentifier, n[0].renderTree) + localError(n.info, errUndeclaredIdentifier, n[0].renderTree) return errorSym(c, n[0]) if expandedSym.kind notin {skMacro, skTemplate}: - LocalError(n.info, errXisNoMacroOrTemplate, expandedSym.name.s) + localError(n.info, errXisNoMacroOrTemplate, expandedSym.name.s) return errorSym(c, n[0]) result = expandedSym else: - LocalError(n.info, errXisNoMacroOrTemplate, n.renderTree) + localError(n.info, errXisNoMacroOrTemplate, n.renderTree) result = errorSym(c, n) proc expectString(c: PContext, n: PNode): string = @@ -1333,10 +1333,10 @@ proc expectString(c: PContext, n: PNode): string = if n.kind in nkStrKinds: return n.strVal else: - LocalError(n.info, errStringLiteralExpected) + localError(n.info, errStringLiteralExpected) proc getMagicSym(magic: TMagic): PSym = - result = newSym(skProc, getIdent($magic), GetCurrOwner(), gCodegenLineInfo) + result = newSym(skProc, getIdent($magic), getCurrOwner(), gCodegenLineInfo) result.magic = magic proc newAnonSym(kind: TSymKind, info: TLineInfo, @@ -1358,7 +1358,7 @@ proc semUsing(c: PContext, n: PNode): PNode = continue else: nil - LocalError(e.info, errUsingNoSymbol, e.renderTree) + localError(e.info, errUsingNoSymbol, e.renderTree) proc semExpandToAst(c: PContext, n: PNode): PNode = var macroCall = n[1] @@ -1422,7 +1422,7 @@ proc semQuoteAst(c: PContext, n: PNode): PNode = # this will store the generated param names if doBlk.kind != nkDo: - LocalError(n.info, errXExpected, "block") + localError(n.info, errXExpected, "block") processQuotations(doBlk.sons[bodyPos], op, quotes, ids) @@ -1476,7 +1476,7 @@ proc tryExpr(c: PContext, n: PNode, c.InGenericInst = oldInGenericInst c.p = oldProcCon msgs.setInfoContextLen(oldContextLen) - setlen(gOwners, oldOwnerLen) + setLen(gOwners, oldOwnerLen) c.currentScope = oldScope dec c.InCompilesContext errorOutputs = oldErrorOutputs @@ -1556,7 +1556,7 @@ proc semWhen(c: PContext, n: PNode, semCheck = true): PNode = # The ``when`` statement implements the mechanism for platform dependent # code. Thus we try to ensure here consistent ID allocation after the # ``when`` statement. - IDsynchronizationPoint(200) + idSynchronizationPoint(200) proc semSetConstr(c: PContext, n: PNode): PNode = result = newNodeI(nkCurly, n.info) @@ -1585,7 +1585,7 @@ proc semSetConstr(c: PContext, n: PNode): PNode = if typ == nil: typ = skipTypes(n.sons[i].typ, {tyGenericInst, tyVar, tyOrdinal}) if not isOrdinalType(typ): - LocalError(n.info, errOrdinalTypeExpected) + localError(n.info, errOrdinalTypeExpected) typ = makeRangeType(c, 0, MaxSetElements - 1, n.info) elif lengthOrd(typ) > MaxSetElements: typ = makeRangeType(c, 0, MaxSetElements - 1, n.info) @@ -1642,11 +1642,11 @@ proc checkPar(n: PNode): TParKind = if result == paTupleFields: if (n.sons[i].kind != nkExprColonExpr) or not (n.sons[i].sons[0].kind in {nkSym, nkIdent}): - LocalError(n.sons[i].info, errNamedExprExpected) + localError(n.sons[i].info, errNamedExprExpected) return paNone else: if n.sons[i].kind == nkExprColonExpr: - LocalError(n.sons[i].info, errNamedExprNotAllowed) + localError(n.sons[i].info, errNamedExprNotAllowed) return paNone proc semTupleFieldsConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = @@ -1661,7 +1661,7 @@ proc semTupleFieldsConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = var id: PIdent if n.sons[i].sons[0].kind == nkIdent: id = n.sons[i].sons[0].ident else: id = n.sons[i].sons[0].sym.name - if ContainsOrIncl(ids, id.id): + if containsOrIncl(ids, id.id): localError(n.sons[i].info, errFieldInitTwice, id.s) n.sons[i].sons[1] = semExprWithType(c, n.sons[i].sons[1], flags*{efAllowDestructor}) @@ -1688,7 +1688,7 @@ proc checkInitialized(n: PNode, ids: TIntSet, info: TLineInfo) = for i in countup(0, sonsLen(n) - 1): checkInitialized(n.sons[i], ids, info) of nkRecCase: - if (n.sons[0].kind != nkSym): InternalError(info, "checkInitialized") + if (n.sons[0].kind != nkSym): internalError(info, "checkInitialized") checkInitialized(n.sons[0], ids, info) when false: # XXX we cannot check here, as we don't know the branch! @@ -1698,7 +1698,7 @@ proc checkInitialized(n: PNode, ids: TIntSet, info: TLineInfo) = else: internalError(info, "checkInitialized") of nkSym: if tfNeedsInit in n.sym.typ.flags and n.sym.name.id notin ids: - Message(info, errGenerated, "field not initialized: " & n.sym.name.s) + message(info, errGenerated, "field not initialized: " & n.sym.name.s) else: internalError(info, "checkInitialized") proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = @@ -1721,7 +1721,7 @@ proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = var id: PIdent if it.sons[0].kind == nkIdent: id = it.sons[0].ident else: id = it.sons[0].sym.name - if ContainsOrIncl(ids, id.id): + if containsOrIncl(ids, id.id): localError(it.info, errFieldInitTwice, id.s) var e = semExprWithType(c, it.sons[1], flags*{efAllowDestructor}) var @@ -1754,7 +1754,7 @@ proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = proc semBlock(c: PContext, n: PNode): PNode = result = n - Inc(c.p.nestedBlockCounter) + inc(c.p.nestedBlockCounter) checkSonsLen(n, 2) openScope(c) # BUGFIX: label is in the scope of block! if n.sons[0].kind != nkEmpty: @@ -1768,7 +1768,7 @@ proc semBlock(c: PContext, n: PNode): PNode = if isEmptyType(n.typ): n.kind = nkBlockStmt else: n.kind = nkBlockExpr closeScope(c) - Dec(c.p.nestedBlockCounter) + dec(c.p.nestedBlockCounter) proc buildCall(n: PNode): PNode = if n.kind == nkDotExpr and n.len == 2: @@ -1834,7 +1834,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = if result.kind == nkSym: markIndirect(c, result.sym) if isGenericRoutine(result.sym): - LocalError(n.info, errInstantiateXExplicitely, s.name.s) + localError(n.info, errInstantiateXExplicitely, s.name.s) of nkSym: # because of the changed symbol binding, this does not mean that we # don't have to check the symbol for semantics here again! @@ -1881,7 +1881,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result.kind = nkCall result = semExpr(c, result, flags) of nkBind: - Message(n.info, warnDeprecated, "bind") + message(n.info, warnDeprecated, "bind") result = semExpr(c, n.sons[0], flags) of nkTypeOfExpr, nkTupleTy, nkRefTy..nkEnumTy: var typ = semTypeNode(c, n, nil).skipTypes({tyTypeDesc}) @@ -1891,7 +1891,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = # check if it is an expression macro: checkMinSonsLen(n, 1) let mode = if nfDelegate in n.flags: {} else: {checkUndeclared} - var s = qualifiedLookup(c, n.sons[0], mode) + var s = qualifiedLookUp(c, n.sons[0], mode) if s != nil: case s.kind of skMacro: @@ -1912,8 +1912,8 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result = semConv(c, n) elif n.len == 1: result = semObjConstr(c, n, flags) - elif Contains(c.AmbiguousSymbols, s.id): - LocalError(n.info, errUseQualifier, s.name.s) + elif contains(c.AmbiguousSymbols, s.id): + localError(n.info, errUseQualifier, s.name.s) elif s.magic == mNone: result = semDirectOp(c, n, flags) else: result = semMagic(c, n, s, flags) of skProc, skMethod, skConverter, skIterator: @@ -1937,7 +1937,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result = semExpr(c, result, flags) of nkBracketExpr: checkMinSonsLen(n, 1) - var s = qualifiedLookup(c, n.sons[0], {checkUndeclared}) + var s = qualifiedLookUp(c, n.sons[0], {checkUndeclared}) if s != nil and s.kind in {skProc, skMethod, skConverter, skIterator}: # type parameters: partial generic specialization n.sons[0] = semSymGenericInstantiation(c, n.sons[0], s) @@ -1965,7 +1965,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = checkSonsLen(n, 1) n.sons[0] = semExprWithType(c, n.sons[0]) if isAssignable(c, n.sons[0]) notin {arLValue, arLocalLValue}: - LocalError(n.info, errExprHasNoAddress) + localError(n.info, errExprHasNoAddress) n.typ = makePtrType(c, n.sons[0].typ) of nkHiddenAddr, nkHiddenDeref: checkSonsLen(n, 1) @@ -1994,7 +1994,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of nkVarSection: result = semVarOrLet(c, n, skVar) of nkLetSection: result = semVarOrLet(c, n, skLet) of nkConstSection: result = semConst(c, n) - of nkTypeSection: result = SemTypeSection(c, n) + of nkTypeSection: result = semTypeSection(c, n) of nkDiscardStmt: result = semDiscard(c, n) of nkWhileStmt: result = semWhile(c, n) of nkTryStmt: result = semTry(c, n) @@ -2013,25 +2013,25 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of nkMacroDef: result = semMacroDef(c, n) of nkTemplateDef: result = semTemplateDef(c, n) of nkImportStmt: - if not isTopLevel(c): LocalError(n.info, errXOnlyAtModuleScope, "import") + if not isTopLevel(c): localError(n.info, errXOnlyAtModuleScope, "import") result = evalImport(c, n) of nkImportExceptStmt: - if not isTopLevel(c): LocalError(n.info, errXOnlyAtModuleScope, "import") + if not isTopLevel(c): localError(n.info, errXOnlyAtModuleScope, "import") result = evalImportExcept(c, n) of nkFromStmt: - if not isTopLevel(c): LocalError(n.info, errXOnlyAtModuleScope, "from") + if not isTopLevel(c): localError(n.info, errXOnlyAtModuleScope, "from") result = evalFrom(c, n) of nkIncludeStmt: - if not isTopLevel(c): LocalError(n.info, errXOnlyAtModuleScope, "include") + if not isTopLevel(c): localError(n.info, errXOnlyAtModuleScope, "include") result = evalInclude(c, n) of nkExportStmt, nkExportExceptStmt: - if not isTopLevel(c): LocalError(n.info, errXOnlyAtModuleScope, "export") + if not isTopLevel(c): localError(n.info, errXOnlyAtModuleScope, "export") result = semExport(c, n) of nkPragmaBlock: result = semPragmaBlock(c, n) of nkStaticStmt: result = semStaticStmt(c, n) else: - LocalError(n.info, errInvalidExpressionX, + localError(n.info, errInvalidExpressionX, renderTree(n, {renderNoComments})) if result != nil: incl(result.flags, nfSem) diff --git a/compiler/semfold.nim b/compiler/semfold.nim index fb1816f9c8..731085c3af 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -66,14 +66,14 @@ proc ordinalValToString*(a: PNode): string = of tyEnum: var n = t.n for i in countup(0, sonsLen(n) - 1): - if n.sons[i].kind != nkSym: InternalError(a.info, "ordinalValToString") + if n.sons[i].kind != nkSym: internalError(a.info, "ordinalValToString") var field = n.sons[i].sym if field.position == x: if field.ast == nil: return field.name.s else: return field.ast.strVal - InternalError(a.info, "no symbol for ordinal value: " & $x) + internalError(a.info, "no symbol for ordinal value: " & $x) else: result = $x @@ -92,7 +92,7 @@ proc pickIntRange(a, b: PType): PType = proc isIntRangeOrLit(t: PType): bool = result = isIntRange(t) or isIntLit(t) -proc pickMinInt(n: PNode): biggestInt = +proc pickMinInt(n: PNode): BiggestInt = if n.kind in {nkIntLit..nkUInt64Lit}: result = n.intVal elif isIntLit(n.typ): @@ -100,9 +100,9 @@ proc pickMinInt(n: PNode): biggestInt = elif isIntRange(n.typ): result = firstOrd(n.typ) else: - InternalError(n.info, "pickMinInt") + internalError(n.info, "pickMinInt") -proc pickMaxInt(n: PNode): biggestInt = +proc pickMaxInt(n: PNode): BiggestInt = if n.kind in {nkIntLit..nkUInt64Lit}: result = n.intVal elif isIntLit(n.typ): @@ -110,9 +110,9 @@ proc pickMaxInt(n: PNode): biggestInt = elif isIntRange(n.typ): result = lastOrd(n.typ) else: - InternalError(n.info, "pickMaxInt") + internalError(n.info, "pickMaxInt") -proc makeRange(typ: PType, first, last: biggestInt): PType = +proc makeRange(typ: PType, first, last: BiggestInt): PType = var n = newNode(nkRange) addSon(n, newIntNode(nkIntLit, min(first, last))) addSon(n, newIntNode(nkIntLit, max(first, last))) @@ -120,7 +120,7 @@ proc makeRange(typ: PType, first, last: biggestInt): PType = result.n = n addSonSkipIntLit(result, skipTypes(typ, {tyRange})) -proc makeRangeF(typ: PType, first, last: biggestFloat): PType = +proc makeRangeF(typ: PType, first, last: BiggestFloat): PType = var n = newNode(nkRange) addSon(n, newFloatNode(nkFloatLit, min(first.float, last.float))) addSon(n, newFloatNode(nkFloatLit, max(first.float, last.float))) @@ -303,7 +303,7 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = of tyInt32: result = newIntNodeT(int32(getInt(a)) shl int32(getInt(b)), n) of tyInt64, tyInt, tyUInt..tyUInt64: result = newIntNodeT(`shl`(getInt(a), getInt(b)), n) - else: InternalError(n.info, "constant folding for shl") + else: internalError(n.info, "constant folding for shl") of mShrI, mShrI64: case skipTypes(n.typ, abstractRange).kind of tyInt8: result = newIntNodeT(int8(getInt(a)) shr int8(getInt(b)), n) @@ -311,7 +311,7 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = of tyInt32: result = newIntNodeT(int32(getInt(a)) shr int32(getInt(b)), n) of tyInt64, tyInt, tyUInt..tyUInt64: result = newIntNodeT(`shr`(getInt(a), getInt(b)), n) - else: InternalError(n.info, "constant folding for shr") + else: internalError(n.info, "constant folding for shr") of mDivI, mDivI64: result = newIntNodeT(getInt(a) div getInt(b), n) of mModI, mModI64: result = newIntNodeT(getInt(a) mod getInt(b), n) of mAddF64: result = newFloatNodeT(getFloat(a) + getFloat(b), n) @@ -354,10 +354,10 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = of mMulU: result = newIntNodeT(`*%`(getInt(a), getInt(b)), n) of mModU: result = newIntNodeT(`%%`(getInt(a), getInt(b)), n) of mDivU: result = newIntNodeT(`/%`(getInt(a), getInt(b)), n) - of mLeSet: result = newIntNodeT(Ord(containsSets(a, b)), n) - of mEqSet: result = newIntNodeT(Ord(equalSets(a, b)), n) + of mLeSet: result = newIntNodeT(ord(containsSets(a, b)), n) + of mEqSet: result = newIntNodeT(ord(equalSets(a, b)), n) of mLtSet: - result = newIntNodeT(Ord(containsSets(a, b) and not equalSets(a, b)), n) + result = newIntNodeT(ord(containsSets(a, b) and not equalSets(a, b)), n) of mMulSet: result = nimsets.intersectSets(a, b) result.info = n.info @@ -371,7 +371,7 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = result = nimsets.symdiffSets(a, b) result.info = n.info of mConStrStr: result = newStrNodeT(getStrOrChar(a) & getStrOrChar(b), n) - of mInSet: result = newIntNodeT(Ord(inSet(a, b)), n) + of mInSet: result = newIntNodeT(ord(inSet(a, b)), n) of mRepr: # BUGFIX: we cannot eval mRepr here for reasons that I forgot. of mIntToStr, mInt64ToStr: result = newStrNodeT($(getOrdValue(a)), n) @@ -390,9 +390,9 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = result = copyTree(a) result.typ = n.typ of mCompileOption: - result = newIntNodeT(Ord(commands.testCompileOption(a.getStr, n.info)), n) + result = newIntNodeT(ord(commands.testCompileOption(a.getStr, n.info)), n) of mCompileOptionArg: - result = newIntNodeT(Ord( + result = newIntNodeT(ord( testCompileOptionArg(getStr(a), getStr(b), n.info)), n) of mNewString, mNewStringOfCap, mExit, mInc, ast.mDec, mEcho, mSwap, mAppendStrCh, @@ -402,7 +402,7 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = discard of mRand: result = newIntNodeT(math.random(a.getInt.int), n) - else: InternalError(a.info, "evalOp(" & $m & ')') + else: internalError(a.info, "evalOp(" & $m & ')') proc getConstIfExpr(c: PSym, n: PNode): PNode = result = nil @@ -452,13 +452,13 @@ proc leValueConv(a, b: PNode): bool = case b.kind of nkCharLit..nkUInt64Lit: result = a.intVal <= b.intVal of nkFloatLit..nkFloat128Lit: result = a.intVal <= round(b.floatVal) - else: InternalError(a.info, "leValueConv") + else: internalError(a.info, "leValueConv") of nkFloatLit..nkFloat128Lit: case b.kind of nkFloatLit..nkFloat128Lit: result = a.floatVal <= b.floatVal of nkCharLit..nkUInt64Lit: result = a.floatVal <= toFloat(int(b.intVal)) - else: InternalError(a.info, "leValueConv") - else: InternalError(a.info, "leValueConv") + else: internalError(a.info, "leValueConv") + else: internalError(a.info, "leValueConv") proc magicCall(m: PSym, n: PNode): PNode = if sonsLen(n) <= 1: return @@ -485,9 +485,9 @@ proc getAppType(n: PNode): PNode = else: result = newStrNodeT("console", n) -proc rangeCheck(n: PNode, value: biggestInt) = +proc rangeCheck(n: PNode, value: BiggestInt) = if value < firstOrd(n.typ) or value > lastOrd(n.typ): - LocalError(n.info, errGenerated, "cannot convert " & $value & + localError(n.info, errGenerated, "cannot convert " & $value & " to " & typeToString(n.typ)) proc foldConv*(n, a: PNode; check = false): PNode = @@ -536,10 +536,10 @@ proc foldArrayAccess(m: PSym, n: PNode): PNode = result = x.sons[int(idx)] if result.kind == nkExprColonExpr: result = result.sons[1] else: - LocalError(n.info, errIndexOutOfBounds) + localError(n.info, errIndexOutOfBounds) of nkBracket, nkMetaNode: if (idx >= 0) and (idx < sonsLen(x)): result = x.sons[int(idx)] - else: LocalError(n.info, errIndexOutOfBounds) + else: localError(n.info, errIndexOutOfBounds) of nkStrLit..nkTripleStrLit: result = newNodeIT(nkCharLit, x.info, n.typ) if (idx >= 0) and (idx < len(x.strVal)): @@ -547,7 +547,7 @@ proc foldArrayAccess(m: PSym, n: PNode): PNode = elif idx == len(x.strVal): nil else: - LocalError(n.info, errIndexOutOfBounds) + localError(n.info, errIndexOutOfBounds) else: discard proc foldFieldAccess(m: PSym, n: PNode): PNode = @@ -634,7 +634,7 @@ proc getConstExpr(m: PSym, n: PNode): PNode = of mSizeOf: var a = n.sons[1] if computeSize(a.typ) < 0: - LocalError(a.info, errCannotEvalXBecauseIncompletelyDefined, + localError(a.info, errCannotEvalXBecauseIncompletelyDefined, "sizeof") result = nil elif skipTypes(a.typ, typedescInst).kind in @@ -677,9 +677,9 @@ proc getConstExpr(m: PSym, n: PNode): PNode = else: result = magicCall(m, n) except EOverflow: - LocalError(n.info, errOverOrUnderflow) + localError(n.info, errOverOrUnderflow) except EDivByZero: - LocalError(n.info, errConstantDivisionByZero) + localError(n.info, errConstantDivisionByZero) of nkAddr: var a = getConstExpr(m, n.sons[0]) if a != nil: @@ -735,7 +735,7 @@ proc getConstExpr(m: PSym, n: PNode): PNode = result = a # a <= x and x <= b result.typ = n.typ else: - LocalError(n.info, errGenerated, `%`( + localError(n.info, errGenerated, `%`( msgKindToString(errIllegalConvFromXtoY), [typeToString(n.sons[0].typ), typeToString(n.typ)])) of nkStringToCString, nkCStringToString: diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index 760fd303fa..9f477492c6 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -96,10 +96,10 @@ proc semGenericStmt(c: PContext, n: PNode, if gCmd == cmdIdeTools: suggestStmt(c, n) case n.kind of nkIdent, nkAccQuoted: - result = Lookup(c, n, flags, ctx) + result = lookup(c, n, flags, ctx) of nkDotExpr: let luf = if withinMixin notin flags: {checkUndeclared} else: {} - var s = QualifiedLookUp(c, n, luf) + var s = qualifiedLookUp(c, n, luf) if s != nil: result = semGenericStmtSymbol(c, n, s) # XXX for example: ``result.add`` -- ``add`` needs to be looked up here... of nkEmpty, nkSym..nkNilLit: @@ -119,7 +119,7 @@ proc semGenericStmt(c: PContext, n: PNode, # check if it is an expression macro: checkMinSonsLen(n, 1) let fn = n.sons[0] - var s = qualifiedLookup(c, fn, {}) + var s = qualifiedLookUp(c, fn, {}) if s == nil and withinMixin notin flags and fn.kind in {nkIdent, nkAccQuoted} and considerAcc(fn).id notin ctx: localError(n.info, errUndeclaredIdentifier, fn.renderTree) @@ -219,7 +219,7 @@ proc semGenericStmt(c: PContext, n: PNode, for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkIdentDefs) and (a.kind != nkVarTuple): IllFormedAst(a) + if (a.kind != nkIdentDefs) and (a.kind != nkVarTuple): illFormedAst(a) checkMinSonsLen(a, 3) var L = sonsLen(a) a.sons[L-2] = semGenericStmt(c, a.sons[L-2], flags+{withinTypeDesc}, @@ -230,7 +230,7 @@ proc semGenericStmt(c: PContext, n: PNode, of nkGenericParams: for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] - if (a.kind != nkIdentDefs): IllFormedAst(a) + if (a.kind != nkIdentDefs): illFormedAst(a) checkMinSonsLen(a, 3) var L = sonsLen(a) a.sons[L-2] = semGenericStmt(c, a.sons[L-2], flags+{withinTypeDesc}, @@ -242,7 +242,7 @@ proc semGenericStmt(c: PContext, n: PNode, for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkConstDef): IllFormedAst(a) + if (a.kind != nkConstDef): illFormedAst(a) checkSonsLen(a, 3) addPrelimDecl(c, newSymS(skUnknown, getIdentNode(a.sons[0]), c)) a.sons[1] = semGenericStmt(c, a.sons[1], flags+{withinTypeDesc}, ctx) @@ -251,13 +251,13 @@ proc semGenericStmt(c: PContext, n: PNode, for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkTypeDef): IllFormedAst(a) + if (a.kind != nkTypeDef): illFormedAst(a) checkSonsLen(a, 3) addPrelimDecl(c, newSymS(skUnknown, getIdentNode(a.sons[0]), c)) for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkTypeDef): IllFormedAst(a) + if (a.kind != nkTypeDef): illFormedAst(a) checkSonsLen(a, 3) if a.sons[1].kind != nkEmpty: openScope(c) @@ -285,7 +285,7 @@ proc semGenericStmt(c: PContext, n: PNode, n.sons[0] = semGenericStmt(c, n.sons[0], flags+{withinTypeDesc}, ctx) for i in countup(1, sonsLen(n) - 1): var a = n.sons[i] - if (a.kind != nkIdentDefs): IllFormedAst(a) + if (a.kind != nkIdentDefs): illFormedAst(a) checkMinSonsLen(a, 3) var L = sonsLen(a) a.sons[L-2] = semGenericStmt(c, a.sons[L-2], flags+{withinTypeDesc}, diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 5a4b832406..b03f20259e 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -13,28 +13,28 @@ proc instantiateGenericParamList(c: PContext, n: PNode, pt: TIdTable, entry: var TInstantiation) = if n.kind != nkGenericParams: - InternalError(n.info, "instantiateGenericParamList; no generic params") + internalError(n.info, "instantiateGenericParamList; no generic params") newSeq(entry.concreteTypes, n.len) for i in countup(0, n.len - 1): var a = n.sons[i] if a.kind != nkSym: - InternalError(a.info, "instantiateGenericParamList; no symbol") + internalError(a.info, "instantiateGenericParamList; no symbol") var q = a.sym if q.typ.kind notin {tyTypeDesc, tyGenericParam, tyExpr}+tyTypeClasses: continue var s = newSym(skType, q.name, getCurrOwner(), q.info) s.flags = s.flags + {sfUsed, sfFromGeneric} - var t = PType(IdTableGet(pt, q.typ)) + var t = PType(idTableGet(pt, q.typ)) if t == nil: if tfRetType in q.typ.flags: # keep the generic type and allow the return type to be bound # later by semAsgn in return type inference scenario t = q.typ else: - LocalError(a.info, errCannotInstantiateX, s.name.s) + localError(a.info, errCannotInstantiateX, s.name.s) t = errorType(c) elif t.kind == tyGenericParam: - InternalError(a.info, "instantiateGenericParamList: " & q.name.s) + internalError(a.info, "instantiateGenericParamList: " & q.name.s) elif t.kind == tyGenericInvokation: #t = instGenericContainer(c, a, t) t = generateTypeInstance(c, pt, a, t) @@ -50,7 +50,7 @@ proc sameInstantiation(a, b: TInstantiation): bool = flags = {TypeDescExactMatch}): return result = true -proc genericCacheGet(genericSym: Psym, entry: TInstantiation): PSym = +proc genericCacheGet(genericSym: PSym, entry: TInstantiation): PSym = if genericSym.procInstCache != nil: for inst in genericSym.procInstCache: if sameInstantiation(entry, inst[]): @@ -75,11 +75,11 @@ proc removeDefaultParamValues(n: PNode) = proc freshGenSyms(n: PNode, owner: PSym, symMap: var TIdTable) = # we need to create a fresh set of gensym'ed symbols: if n.kind == nkSym and sfGenSym in n.sym.flags: - var x = PSym(IdTableGet(symMap, n.sym)) + var x = PSym(idTableGet(symMap, n.sym)) if x == nil: x = copySym(n.sym, false) x.owner = owner - IdTablePut(symMap, n.sym, x) + idTablePut(symMap, n.sym, x) n.sym = x else: for i in 0 .. <safeLen(n): freshGenSyms(n.sons[i], owner, symMap) @@ -101,7 +101,7 @@ proc instantiateBody(c: PContext, n: PNode, result: PSym) = maybeAddResult(c, result, n) var b = n.sons[bodyPos] var symMap: TIdTable - InitIdTable symMap + initIdTable symMap freshGenSyms(b, result, symMap) b = semProcBody(c, b) b = hloBody(c, b) @@ -126,7 +126,7 @@ proc fixupInstantiatedSymbols(c: PContext, s: PSym) = proc sideEffectsCheck(c: PContext, s: PSym) = if {sfNoSideEffect, sfSideEffect} * s.flags == {sfNoSideEffect, sfSideEffect}: - LocalError(s.info, errXhasSideEffects, s.name.s) + localError(s.info, errXhasSideEffects, s.name.s) elif sfThread in s.flags and semthreads.needsGlobalAnalysis() and s.ast.sons[genericParamsPos].kind == nkEmpty: c.threadEntries.add(s) @@ -170,11 +170,11 @@ proc instGenericContainer(c: PContext, info: TLineInfo, header: PType): PType = lateInstantiateGeneric(c, header, info) else: var cl: TReplTypeVars - InitIdTable(cl.symMap) - InitIdTable(cl.typeMap) + initIdTable(cl.symMap) + initIdTable(cl.typeMap) cl.info = info cl.c = c - result = ReplaceTypeVarsT(cl, header) + result = replaceTypeVarsT(cl, header) proc instGenericContainer(c: PContext, n: PNode, header: PType): PType = result = instGenericContainer(c, n.info, header) @@ -265,7 +265,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, if fn.kind in {skTemplate, skMacro}: return fn # generates an instantiated proc - if c.InstCounter > 1000: InternalError(fn.ast.info, "nesting too deep") + if c.InstCounter > 1000: internalError(fn.ast.info, "nesting too deep") inc(c.InstCounter) # careful! we copy the whole AST including the possibly nil body! var n = copyTree(fn.ast) @@ -282,7 +282,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, pushOwner(result) openScope(c) if n.sons[genericParamsPos].kind == nkEmpty: - InternalError(n.info, "generateInstance") + internalError(n.info, "generateInstance") n.sons[namePos] = newSymNode(result) pushInfoContext(info) var entry = TInstantiation.new @@ -301,7 +301,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, if fn.kind != skTemplate: instantiateBody(c, n, result) sideEffectsCheck(c, result) - ParamsTypeCheck(c, result.typ) + paramsTypeCheck(c, result.typ) else: result = oldPrc popInfoContext() diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index aab4c82f53..e6c5fc5748 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -18,7 +18,7 @@ proc expectIntLit(c: PContext, n: PNode): int = let x = c.semConstExpr(c, n) case x.kind of nkIntLit..nkInt64Lit: result = int(x.intVal) - else: LocalError(n.info, errIntLiteralExpected) + else: localError(n.info, errIntLiteralExpected) proc semInstantiationInfo(c: PContext, n: PNode): PNode = result = newNodeIT(nkPar, n.info, n.typ) @@ -28,7 +28,7 @@ proc semInstantiationInfo(c: PContext, n: PNode): PNode = var filename = newNodeIT(nkStrLit, n.info, getSysType(tyString)) filename.strVal = if useFullPaths != 0: info.toFullPath else: info.ToFilename var line = newNodeIT(nkIntLit, n.info, getSysType(tyInt)) - line.intVal = ToLinenumber(info) + line.intVal = toLinenumber(info) result.add(filename) result.add(line) @@ -54,7 +54,7 @@ proc semTypeTraits(c: PContext, n: PNode): PNode = if t.kind == tyTypeDesc and t.len == 0: result = n elif not containsGenericType(t): - result = evalTypeTrait(n[0], t, GetCurrOwner()) + result = evalTypeTrait(n[0], t, getCurrOwner()) else: # a typedesc variable, pass unmodified to evals result = n @@ -70,23 +70,23 @@ proc semBindSym(c: PContext, n: PNode): PNode = let sl = semConstExpr(c, n.sons[1]) if sl.kind notin {nkStrLit, nkRStrLit, nkTripleStrLit}: - LocalError(n.sons[1].info, errStringLiteralExpected) + localError(n.sons[1].info, errStringLiteralExpected) return errorNode(c, n) let isMixin = semConstExpr(c, n.sons[2]) if isMixin.kind != nkIntLit or isMixin.intVal < 0 or isMixin.intVal > high(TSymChoiceRule).int: - LocalError(n.sons[2].info, errConstExprExpected) + localError(n.sons[2].info, errConstExprExpected) return errorNode(c, n) let id = newIdentNode(getIdent(sl.strVal), n.info) - let s = QualifiedLookUp(c, id) + let s = qualifiedLookUp(c, id) if s != nil: # we need to mark all symbols: var sc = symChoice(c, id, s, TSymChoiceRule(isMixin.intVal)) result.add(sc) else: - LocalError(n.sons[1].info, errUndeclaredIdentifier, sl.strVal) + localError(n.sons[1].info, errUndeclaredIdentifier, sl.strVal) proc semLocals(c: PContext, n: PNode): PNode = var counter = 0 diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index 7dec557bea..efab8ddb6e 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -95,12 +95,12 @@ proc useVar(a: PEffects, n: PNode) = if s.id notin a.init: if {tfNeedsInit, tfNotNil} * s.typ.flags != {}: when true: - Message(n.info, warnProveInit, s.name.s) + message(n.info, warnProveInit, s.name.s) else: Message(n.info, errGenerated, "'$1' might not have been initialized" % s.name.s) else: - Message(n.info, warnUninit, s.name.s) + message(n.info, warnUninit, s.name.s) # prevent superfluous warnings about the same variable: a.init.add s.id @@ -162,8 +162,8 @@ proc mergeTags(a: PEffects, b, comesFrom: PNode) = for effect in items(b): addTag(a, effect, useLineInfo=comesFrom != nil) proc listEffects(a: PEffects) = - for e in items(a.exc): Message(e.info, hintUser, typeToString(e.typ)) - for e in items(a.tags): Message(e.info, hintUser, typeToString(e.typ)) + for e in items(a.exc): message(e.info, hintUser, typeToString(e.typ)) + for e in items(a.tags): message(e.info, hintUser, typeToString(e.typ)) proc catches(tracked: PEffects, e: PType) = let e = skipTypes(e, skipPtrs) @@ -310,10 +310,10 @@ proc notNilCheck(tracked: PEffects, n: PNode, paramType: PType) = return case impliesNotNil(tracked.guards, n) of impUnknown: - Message(n.info, errGenerated, + message(n.info, errGenerated, "cannot prove '$1' is not nil" % n.renderTree) of impNo: - Message(n.info, errGenerated, "'$1' is provably nil" % n.renderTree) + message(n.info, errGenerated, "'$1' is provably nil" % n.renderTree) of impYes: discard proc trackOperand(tracked: PEffects, n: PNode, paramType: PType) = @@ -549,7 +549,7 @@ proc checkRaisesSpec(spec, real: PNode, msg: string, hints: bool) = if hints: for s in 0 .. <spec.len: if not used.contains(s): - Message(spec[s].info, hintXDeclaredButNotUsed, renderTree(spec[s])) + message(spec[s].info, hintXDeclaredButNotUsed, renderTree(spec[s])) proc checkMethodEffects*(disp, branch: PSym) = ## checks for consistent effects for multi methods. @@ -603,7 +603,7 @@ proc trackProc*(s: PSym, body: PNode) = s.kind in {skProc, skConverter, skMethod}: var res = s.ast.sons[resultPos].sym # get result symbol if res.id notin t.init: - Message(body.info, warnProveInit, "result") + message(body.info, warnProveInit, "result") let p = s.ast.sons[pragmasPos] let raisesSpec = effectSpec(p, wRaises) if not isNil(raisesSpec): @@ -618,4 +618,4 @@ proc trackProc*(s: PSym, body: PNode) = hints=off) # after the check, use the formal spec: effects.sons[tagEffects] = tagsSpec - \ No newline at end of file + diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 832e4e9626..c89fb46a2f 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -58,10 +58,10 @@ proc semWhile(c: PContext, n: PNode): PNode = n.sons[1] = semStmt(c, n.sons[1]) dec(c.p.nestedLoopCounter) closeScope(c) - if n.sons[1].typ == EnforceVoidContext: - result.typ = EnforceVoidContext + if n.sons[1].typ == enforceVoidContext: + result.typ = enforceVoidContext -proc toCover(t: PType): biggestInt = +proc toCover(t: PType): BiggestInt = var t2 = skipTypes(t, abstractVarRange-{tyTypeDesc}) if t2.kind == tyEnum and enumHasHoles(t2): result = sonsLen(t2.n) @@ -72,7 +72,7 @@ proc performProcvarCheck(c: PContext, n: PNode, s: PSym) = var smoduleId = getModule(s).id if sfProcVar notin s.flags and s.typ.callConv == ccDefault and smoduleId != c.module.id and smoduleId != c.friendModule.id: - LocalError(n.info, errXCannotBePassedToProcVar, s.name.s) + localError(n.info, errXCannotBePassedToProcVar, s.name.s) proc semProcvarCheck(c: PContext, n: PNode) = let n = n.skipConv @@ -87,7 +87,7 @@ include semdestruct proc semDestructorCheck(c: PContext, n: PNode, flags: TExprFlags) {.inline.} = if efAllowDestructor notin flags and n.kind in nkCallKinds+{nkObjConstr}: if instantiateDestructor(c, n.typ): - LocalError(n.info, errGenerated, + localError(n.info, errGenerated, "usage of a type with a destructor in a non destructible context") # This still breaks too many things: when false: @@ -136,7 +136,7 @@ proc discardCheck(c: PContext, result: PNode) = if result.typ != nil and result.typ.kind notin {tyStmt, tyEmpty}: if result.kind == nkNilLit: result.typ = nil - elif ImplicitlyDiscardable(result): + elif implicitlyDiscardable(result): var n = result result.typ = nil while n.kind in skipForDiscardable: @@ -156,7 +156,7 @@ proc discardCheck(c: PContext, result: PNode) = proc semIf(c: PContext, n: PNode): PNode = result = n - var typ = CommonTypeBegin + var typ = commonTypeBegin var hasElse = false for i in countup(0, sonsLen(n) - 1): var it = n.sons[i] @@ -176,7 +176,7 @@ proc semIf(c: PContext, n: PNode): PNode = for it in n: discardCheck(c, it.lastSon) result.kind = nkIfStmt # propagate any enforced VoidContext: - if typ == EnforceVoidContext: result.typ = EnforceVoidContext + if typ == enforceVoidContext: result.typ = enforceVoidContext else: for it in n: let j = it.len-1 @@ -190,8 +190,8 @@ proc semCase(c: PContext, n: PNode): PNode = openScope(c) n.sons[0] = semExprWithType(c, n.sons[0]) var chckCovered = false - var covered: biggestint = 0 - var typ = CommonTypeBegin + var covered: BiggestInt = 0 + var typ = commonTypeBegin var hasElse = false case skipTypes(n.sons[0].Typ, abstractVarRange-{tyTypeDesc}).Kind of tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt32: @@ -199,7 +199,7 @@ proc semCase(c: PContext, n: PNode): PNode = of tyFloat..tyFloat128, tyString, tyError: discard else: - LocalError(n.info, errSelectorMustBeOfCertainTypes) + localError(n.info, errSelectorMustBeOfCertainTypes) return for i in countup(1, sonsLen(n) - 1): var x = n.sons[i] @@ -236,8 +236,8 @@ proc semCase(c: PContext, n: PNode): PNode = if isEmptyType(typ) or typ.kind == tyNil or not hasElse: for i in 1..n.len-1: discardCheck(c, n.sons[i].lastSon) # propagate any enforced VoidContext: - if typ == EnforceVoidContext: - result.typ = EnforceVoidContext + if typ == enforceVoidContext: + result.typ = enforceVoidContext else: for i in 1..n.len-1: var it = n.sons[i] @@ -249,7 +249,7 @@ proc semTry(c: PContext, n: PNode): PNode = result = n inc c.p.inTryStmt checkMinSonsLen(n, 2) - var typ = CommonTypeBegin + var typ = commonTypeBegin n.sons[0] = semExprBranchScope(c, n.sons[0]) typ = commonType(typ, n.sons[0].typ) var check = initIntSet() @@ -267,10 +267,10 @@ proc semTry(c: PContext, n: PNode): PNode = var typ = semTypeNode(c, a.sons[j], nil) if typ.kind == tyRef: typ = typ.sons[0] if typ.kind != tyObject: - LocalError(a.sons[j].info, errExprCannotBeRaised) + localError(a.sons[j].info, errExprCannotBeRaised) a.sons[j] = newNodeI(nkType, a.sons[j].info) a.sons[j].typ = typ - if ContainsOrIncl(check, typ.id): + if containsOrIncl(check, typ.id): localError(a.sons[j].info, errExceptionAlreadyHandled) elif a.kind != nkFinally: illFormedAst(n) @@ -281,8 +281,8 @@ proc semTry(c: PContext, n: PNode): PNode = if isEmptyType(typ) or typ.kind == tyNil: discardCheck(c, n.sons[0]) for i in 1..n.len-1: discardCheck(c, n.sons[i].lastSon) - if typ == EnforceVoidContext: - result.typ = EnforceVoidContext + if typ == enforceVoidContext: + result.typ = enforceVoidContext else: n.sons[0] = fitNode(c, typ, n.sons[0]) for i in 1..n.len-1: @@ -291,7 +291,7 @@ proc semTry(c: PContext, n: PNode): PNode = it.sons[j] = fitNode(c, typ, it.sons[j]) result.typ = typ -proc fitRemoveHiddenConv(c: PContext, typ: Ptype, n: PNode): PNode = +proc fitRemoveHiddenConv(c: PContext, typ: PType, n: PNode): PNode = result = fitNode(c, typ, n) if result.kind in {nkHiddenStdConv, nkHiddenSubConv}: changeType(result.sons[1], typ, check=true) @@ -302,7 +302,7 @@ proc fitRemoveHiddenConv(c: PContext, typ: Ptype, n: PNode): PNode = proc findShadowedVar(c: PContext, v: PSym): PSym = for scope in walkScopes(c.currentScope.parent): if scope == c.topLevelScope: break - let shadowed = StrTableGet(scope.symbols, v.name) + let shadowed = strTableGet(scope.symbols, v.name) if shadowed != nil and shadowed.kind in skLocalVars: return shadowed @@ -322,9 +322,9 @@ proc semIdentDef(c: PContext, n: PNode, kind: TSymKind): PSym = proc checkNilable(v: PSym) = if sfGlobal in v.flags and {tfNotNil, tfNeedsInit} * v.typ.flags != {}: if v.ast.isNil: - Message(v.info, warnProveInit, v.name.s) + message(v.info, warnProveInit, v.name.s) elif tfNotNil in v.typ.flags and tfNotNil notin v.ast.typ.flags: - Message(v.info, warnProveInit, v.name.s) + message(v.info, warnProveInit, v.name.s) proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = var b: PNode @@ -333,7 +333,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = var a = n.sons[i] if gCmd == cmdIdeTools: suggestStmt(c, a) if a.kind == nkCommentStmt: continue - if a.kind notin {nkIdentDefs, nkVarTuple, nkConstDef}: IllFormedAst(a) + if a.kind notin {nkIdentDefs, nkVarTuple, nkConstDef}: illFormedAst(a) checkMinSonsLen(a, 3) var length = sonsLen(a) var typ: PType @@ -350,12 +350,12 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = else: typ = skipIntLit(def.typ) else: def = ast.emptyNode - if symkind == skLet: LocalError(a.info, errLetNeedsInit) + if symkind == skLet: localError(a.info, errLetNeedsInit) # this can only happen for errornous var statements: if typ == nil: continue if not typeAllowed(typ, symkind): - LocalError(a.info, errXisNoType, typeToString(typ)) + localError(a.info, errXisNoType, typeToString(typ)) var tup = skipTypes(typ, {tyGenericInst}) if a.kind == nkVarTuple: if tup.kind != tyTuple: @@ -370,7 +370,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = addSon(result, b) elif tup.kind == tyTuple and def.kind == nkPar and a.kind == nkIdentDefs and a.len > 3: - Message(a.info, warnEachIdentIsTuple) + message(a.info, warnEachIdentIsTuple) for j in countup(0, length-3): var v = semIdentDef(c, a.sons[j], symkind) if sfGenSym notin v.flags: addInterfaceDecl(c, v) @@ -383,12 +383,12 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = # a shadowed variable is an error unless it appears on the right # side of the '=': if warnShadowIdent in gNotes and not identWithin(def, v.name): - Message(a.info, warnShadowIdent, v.name.s) + message(a.info, warnShadowIdent, v.name.s) if a.kind != nkVarTuple: if def != nil and def.kind != nkEmpty: # this is needed for the evaluation pass and for the guard checking: v.ast = def - if sfThread in v.flags: LocalError(def.info, errThreadvarCannotInit) + if sfThread in v.flags: localError(def.info, errThreadvarCannotInit) v.typ = typ b = newNodeI(nkIdentDefs, a.info) if importantComments(): @@ -410,7 +410,7 @@ proc semConst(c: PContext, n: PNode): PNode = var a = n.sons[i] if gCmd == cmdIdeTools: suggestStmt(c, a) if a.kind == nkCommentStmt: continue - if (a.kind != nkConstDef): IllFormedAst(a) + if (a.kind != nkConstDef): illFormedAst(a) checkSonsLen(a, 3) var v = semIdentDef(c, a.sons[0], skConst) var typ: PType = nil @@ -418,7 +418,7 @@ proc semConst(c: PContext, n: PNode): PNode = var def = semConstExpr(c, a.sons[2]) if def == nil: - LocalError(a.sons[2].info, errConstExprExpected) + localError(a.sons[2].info, errConstExprExpected) continue # check type compatibility between def.typ and typ: if typ != nil: @@ -426,10 +426,10 @@ proc semConst(c: PContext, n: PNode): PNode = else: typ = def.typ if typ == nil: - LocalError(a.sons[2].info, errConstExprExpected) + localError(a.sons[2].info, errConstExprExpected) continue if not typeAllowed(typ, skConst): - LocalError(a.info, errXisNoType, typeToString(typ)) + localError(a.info, errXisNoType, typeToString(typ)) continue v.typ = typ v.ast = def # no need to copy @@ -498,7 +498,7 @@ proc semForObjectFields(c: TFieldsCtx, typ, forLoop, father: PNode) = openScope(c.c) inc c.c.InUnrolledContext let body = instFieldLoopBody(fc, lastSon(forLoop), forLoop) - father.add(SemStmt(c.c, body)) + father.add(semStmt(c.c, body)) dec c.c.InUnrolledContext closeScope(c.c) of nkNilLit: discard @@ -506,7 +506,7 @@ proc semForObjectFields(c: TFieldsCtx, typ, forLoop, father: PNode) = let L = forLoop.len let call = forLoop.sons[L-2] if call.len > 2: - LocalError(forLoop.info, errGenerated, + localError(forLoop.info, errGenerated, "parallel 'fields' iterator does not work for 'case' objects") return # iterate over the selector: @@ -535,9 +535,9 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = # so that 'break' etc. work as expected, we produce # a 'while true: stmt; break' loop ... result = newNodeI(nkWhileStmt, n.info, 2) - var trueSymbol = StrTableGet(magicsys.systemModule.Tab, getIdent"true") + var trueSymbol = strTableGet(magicsys.systemModule.Tab, getIdent"true") if trueSymbol == nil: - LocalError(n.info, errSystemNeeds, "true") + localError(n.info, errSystemNeeds, "true") trueSymbol = newSym(skUnknown, getIdent"true", getCurrOwner(), n.info) trueSymbol.typ = getSysType(tyBool) @@ -548,7 +548,7 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = var length = sonsLen(n) var call = n.sons[length-2] if length-2 != sonsLen(call)-1 + ord(m==mFieldPairs): - LocalError(n.info, errWrongNumberOfVariables) + localError(n.info, errWrongNumberOfVariables) return result var tupleTypeA = skipTypes(call.sons[1].typ, abstractVar-{tyTypeDesc}) @@ -557,10 +557,10 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = return result for i in 1..call.len-1: var tupleTypeB = skipTypes(call.sons[i].typ, abstractVar-{tyTypeDesc}) - if not SameType(tupleTypeA, tupleTypeB): + if not sameType(tupleTypeA, tupleTypeB): typeMismatch(call.sons[i], tupleTypeA, tupleTypeB) - Inc(c.p.nestedLoopCounter) + inc(c.p.nestedLoopCounter) if tupleTypeA.kind == tyTuple: var loopBody = n.sons[length-1] for i in 0..sonsLen(tupleTypeA)-1: @@ -571,7 +571,7 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = fc.replaceByFieldName = m == mFieldPairs var body = instFieldLoopBody(fc, loopBody, n) inc c.InUnrolledContext - stmts.add(SemStmt(c, body)) + stmts.add(semStmt(c, body)) dec c.InUnrolledContext closeScope(c) else: @@ -579,7 +579,7 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = fc.m = m fc.c = c semForObjectFields(fc, tupleTypeA.n, n, stmts) - Dec(c.p.nestedLoopCounter) + dec(c.p.nestedLoopCounter) # for TR macros this 'while true: ...; break' loop is pretty bad, so # we avoid it now if we can: if hasSonWith(stmts, nkBreakStmt): @@ -595,7 +595,7 @@ proc addForVarDecl(c: PContext, v: PSym) = if shadowed != nil: # XXX should we do this here? #shadowed.flags.incl(sfShadowed) - Message(v.info, warnShadowIdent, v.name.s) + message(v.info, warnShadowIdent, v.name.s) addDecl(c, v) proc symForVar(c: PContext, n: PNode): PSym = @@ -619,9 +619,9 @@ proc semForVars(c: PContext, n: PNode): PNode = n.sons[0] = newSymNode(v) if sfGenSym notin v.flags: addForVarDecl(c, v) else: - LocalError(n.info, errWrongNumberOfVariables) + localError(n.info, errWrongNumberOfVariables) elif length-2 != sonsLen(iter): - LocalError(n.info, errWrongNumberOfVariables) + localError(n.info, errWrongNumberOfVariables) else: for i in countup(0, length - 3): var v = symForVar(c, n.sons[i]) @@ -629,9 +629,9 @@ proc semForVars(c: PContext, n: PNode): PNode = v.typ = iter.sons[i] n.sons[i] = newSymNode(v) if sfGenSym notin v.flags: addForVarDecl(c, v) - Inc(c.p.nestedLoopCounter) - n.sons[length-1] = SemStmt(c, n.sons[length-1]) - Dec(c.p.nestedLoopCounter) + inc(c.p.nestedLoopCounter) + n.sons[length-1] = semStmt(c, n.sons[length-1]) + dec(c.p.nestedLoopCounter) proc implicitIterator(c: PContext, it: string, arg: PNode): PNode = result = newNodeI(nkCall, arg.info) @@ -659,7 +659,7 @@ proc semFor(c: PContext, n: PNode): PNode = elif length == 4: n.sons[length-2] = implicitIterator(c, "pairs", n.sons[length-2]) else: - LocalError(n.sons[length-2].info, errIteratorExpected) + localError(n.sons[length-2].info, errIteratorExpected) result = semForVars(c, n) elif call.sons[0].sym.magic != mNone: if call.sons[0].sym.magic == mOmpParFor: @@ -670,8 +670,8 @@ proc semFor(c: PContext, n: PNode): PNode = else: result = semForVars(c, n) # propagate any enforced VoidContext: - if n.sons[length-1].typ == EnforceVoidContext: - result.typ = EnforceVoidContext + if n.sons[length-1].typ == enforceVoidContext: + result.typ = enforceVoidContext closeScope(c) proc semRaise(c: PContext, n: PNode): PNode = @@ -697,7 +697,7 @@ proc typeSectionLeftSidePass(c: PContext, n: PNode) = var a = n.sons[i] if gCmd == cmdIdeTools: suggestStmt(c, a) if a.kind == nkCommentStmt: continue - if a.kind != nkTypeDef: IllFormedAst(a) + if a.kind != nkTypeDef: illFormedAst(a) checkSonsLen(a, 3) var s = semIdentDef(c, a.sons[0], skType) s.typ = newTypeS(tyForward, c) @@ -712,12 +712,12 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) = for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkTypeDef): IllFormedAst(a) + if (a.kind != nkTypeDef): illFormedAst(a) checkSonsLen(a, 3) - if (a.sons[0].kind != nkSym): IllFormedAst(a) + if (a.sons[0].kind != nkSym): illFormedAst(a) var s = a.sons[0].sym if s.magic == mNone and a.sons[2].kind == nkEmpty: - LocalError(a.info, errImplOfXexpected, s.name.s) + localError(a.info, errImplOfXexpected, s.name.s) if s.magic != mNone: processMagicType(c, s) if a.sons[1].kind != nkEmpty: # We have a generic type declaration here. In generic types, @@ -770,7 +770,7 @@ proc typeSectionFinalPass(c: PContext, n: PNode) = for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if a.sons[0].kind != nkSym: IllFormedAst(a) + if a.sons[0].kind != nkSym: illFormedAst(a) var s = a.sons[0].sym # compute the type's size and check for illegal recursions: if a.sons[1].kind == nkEmpty: @@ -812,12 +812,12 @@ proc addParams(c: PContext, n: PNode, kind: TSymKind) = proc semBorrow(c: PContext, n: PNode, s: PSym) = # search for the correct alias: - var b = SearchForBorrowProc(c, c.currentScope.parent, s) + var b = searchForBorrowProc(c, c.currentScope.parent, s) if b != nil: # store the alias: n.sons[bodyPos] = newSymNode(b) else: - LocalError(n.info, errNoSymbolToBorrowFromFound) + localError(n.info, errNoSymbolToBorrowFromFound) proc addResult(c: PContext, t: PType, info: TLineInfo, owner: TSymKind) = if t != nil: @@ -855,7 +855,7 @@ proc semProcAnnotation(c: PContext, prc: PNode): PNode = prc.sons[namePos] = newIdentNode(idDelegator, prc.info) prc.sons[pragmasPos] = copyExcept(n, i) else: - LocalError(prc.info, errOnlyACallOpCanBeDelegator) + localError(prc.info, errOnlyACallOpCanBeDelegator) continue # we transform ``proc p {.m, rest.}`` into ``m(do: proc p {.rest.})`` and # let the semantic checker deal with it: @@ -888,7 +888,7 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode = if n.sons[paramsPos].kind != nkEmpty: var gp = newNodeI(nkGenericParams, n.info) semParamList(c, n.sons[ParamsPos], gp, s) - ParamsTypeCheck(c, s.typ) + paramsTypeCheck(c, s.typ) else: s.typ = newTypeS(tyProc, c) rawAddSon(s.typ, nil) @@ -897,7 +897,7 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode = s.options = gOptions if n.sons[bodyPos].kind != nkEmpty: if sfImportc in s.flags: - LocalError(n.sons[bodyPos].info, errImplOfXNotAllowed, s.name.s) + localError(n.sons[bodyPos].info, errImplOfXNotAllowed, s.name.s) #if efDetermineType notin flags: # XXX not good enough; see tnamedparamanonproc.nim pushProcCon(c, s) @@ -908,7 +908,7 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode = popProcCon(c) sideEffectsCheck(c, s) else: - LocalError(n.info, errImplOfXexpected, s.name.s) + localError(n.info, errImplOfXexpected, s.name.s) closeScope(c) # close scope for parameters popOwner() result.typ = s.typ @@ -996,7 +996,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, n.sons[patternPos] = semPattern(c, n.sons[patternPos]) if s.kind == skIterator: s.typ.flags.incl(tfIterator) - var proto = SearchForProc(c, s.scope, s) + var proto = searchForProc(c, s.scope, s) if proto == nil: s.typ.callConv = lastOptionEntry(c).defaultCC # add it here, so that recursive procs are possible: @@ -1013,9 +1013,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, implictPragmas(c, s, n, validPragmas) else: if n.sons[pragmasPos].kind != nkEmpty: - LocalError(n.sons[pragmasPos].info, errPragmaOnlyInHeaderOfProc) + localError(n.sons[pragmasPos].info, errPragmaOnlyInHeaderOfProc) if sfForward notin proto.flags: - WrongRedefinition(n.info, proto.name.s) + wrongRedefinition(n.info, proto.name.s) excl(proto.flags, sfForward) closeScope(c) # close scope with wrong parameter symbols openScope(c) # open scope for old (correct) parameter symbols @@ -1028,7 +1028,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, n.sons[genericParamsPos] = proto.ast.sons[genericParamsPos] n.sons[paramsPos] = proto.ast.sons[paramsPos] n.sons[pragmasPos] = proto.ast.sons[pragmasPos] - if n.sons[namePos].kind != nkSym: InternalError(n.info, "semProcAux") + if n.sons[namePos].kind != nkSym: internalError(n.info, "semProcAux") n.sons[namePos].sym = proto if importantComments() and not isNil(proto.ast.comment): n.comment = proto.ast.comment @@ -1040,9 +1040,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, if n.sons[bodyPos].kind != nkEmpty: # for DLL generation it is annoying to check for sfImportc! if sfBorrow in s.flags: - LocalError(n.sons[bodyPos].info, errImplOfXNotAllowed, s.name.s) + localError(n.sons[bodyPos].info, errImplOfXNotAllowed, s.name.s) if n.sons[genericParamsPos].kind == nkEmpty: - ParamsTypeCheck(c, s.typ) + paramsTypeCheck(c, s.typ) pushProcCon(c, s) maybeAddResult(c, s, n) if sfImportc notin s.flags: @@ -1062,7 +1062,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, # so we just ignore the body after semantic checking for importc: n.sons[bodyPos] = ast.emptyNode else: - if proto != nil: LocalError(n.info, errImplOfXexpected, proto.name.s) + if proto != nil: localError(n.info, errImplOfXexpected, proto.name.s) if {sfImportc, sfBorrow} * s.flags == {} and s.magic == mNone: incl(s.flags, sfForward) elif sfBorrow in s.flags: semBorrow(c, n, s) @@ -1083,7 +1083,7 @@ proc semIterator(c: PContext, n: PNode): PNode = var s = result.sons[namePos].sym var t = s.typ if t.sons[0] == nil and s.typ.callConv != ccClosure: - LocalError(n.info, errXNeedsReturnType, "iterator") + localError(n.info, errXNeedsReturnType, "iterator") # iterators are either 'inline' or 'closure'; for backwards compatibility, # we require first class iterators to be marked with 'closure' explicitly # -- at least for 0.9.2. @@ -1097,7 +1097,7 @@ proc semIterator(c: PContext, n: PNode): PNode = # and they always at least use the 'env' for the state field: incl(s.typ.flags, tfCapturesEnv) if n.sons[bodyPos].kind == nkEmpty and s.magic == mNone: - LocalError(n.info, errImplOfXexpected, s.name.s) + localError(n.info, errImplOfXexpected, s.name.s) proc semProc(c: PContext, n: PNode): PNode = result = semProcAux(c, n, skProc, procPragmas) @@ -1148,11 +1148,11 @@ proc evalInclude(c: PContext, n: PNode): PNode = for i in countup(0, sonsLen(n) - 1): var f = checkModuleName(n.sons[i]) if f != InvalidFileIDX: - if ContainsOrIncl(c.includedFiles, f): - LocalError(n.info, errRecursiveDependencyX, f.toFilename) + if containsOrIncl(c.includedFiles, f): + localError(n.info, errRecursiveDependencyX, f.toFilename) else: addSon(result, semStmt(c, gIncludeFile(c.module, f))) - Excl(c.includedFiles, f) + excl(c.includedFiles, f) proc setLine(n: PNode, info: TLineInfo) = for i in 0 .. <safeLen(n): setLine(n.sons[i], info) @@ -1231,9 +1231,9 @@ proc semStmtList(c: PContext, n: PNode): PNode = return else: n.sons[i] = semExpr(c, n.sons[i]) - if n.sons[i].typ == EnforceVoidContext or usesResult(n.sons[i]): + if n.sons[i].typ == enforceVoidContext or usesResult(n.sons[i]): voidContext = true - n.typ = EnforceVoidContext + n.typ = enforceVoidContext if i != last or voidContext: discardCheck(c, n.sons[i]) else: @@ -1246,7 +1246,7 @@ proc semStmtList(c: PContext, n: PNode): PNode = if outer != nil: n.sons[i] = outer for j in countup(i+1, length-1): - inner.addSon(SemStmt(c, n.sons[j])) + inner.addSon(semStmt(c, n.sons[j])) n.sons.setLen(i+1) return of LastBlockStmts: diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 4f94cd1f65..f6c841e60f 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -79,7 +79,7 @@ proc semBindStmt(c: PContext, n: PNode, toBind: var TIntSet): PNode = # the same symbol! # This is however not true anymore for hygienic templates as semantic # processing for them changes the symbol table... - let s = QualifiedLookUp(c, a) + let s = qualifiedLookUp(c, a) if s != nil: # we need to mark all symbols: let sc = symChoice(c, n, s, scClosed) @@ -115,7 +115,7 @@ proc getIdentNode(c: var TemplCtx, n: PNode): PNode = of nkPragmaExpr: result = getIdentNode(c, n.sons[0]) of nkIdent: result = n - let s = QualifiedLookUp(c.c, n, {}) + let s = qualifiedLookUp(c.c, n, {}) if s != nil: if s.owner == c.owner and s.kind == skParam: result = newSymNode(s, n.info) @@ -178,7 +178,7 @@ proc semTemplSymbol(c: PContext, n: PNode, s: PSym): PNode = proc semRoutineInTemplName(c: var TemplCtx, n: PNode): PNode = result = n if n.kind == nkIdent: - let s = QualifiedLookUp(c.c, n, {}) + let s = qualifiedLookUp(c.c, n, {}) if s != nil: if s.owner == c.owner and (s.kind == skParam or sfGenSym in s.flags): incl(s.flags, sfUsed) @@ -211,7 +211,7 @@ proc semTemplSomeDecl(c: var TemplCtx, n: PNode, symKind: TSymKind) = for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkIdentDefs) and (a.kind != nkVarTuple): IllFormedAst(a) + if (a.kind != nkIdentDefs) and (a.kind != nkVarTuple): illFormedAst(a) checkMinSonsLen(a, 3) var L = sonsLen(a) a.sons[L-2] = semTemplBody(c, a.sons[L-2]) @@ -224,14 +224,14 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = result = n case n.kind of nkIdent: - let s = QualifiedLookUp(c.c, n, {}) + let s = qualifiedLookUp(c.c, n, {}) if s != nil: if s.owner == c.owner and s.kind == skParam: incl(s.flags, sfUsed) result = newSymNode(s, n.info) - elif Contains(c.toBind, s.id): + elif contains(c.toBind, s.id): result = symChoice(c.c, n, s, scClosed) - elif Contains(c.toMixin, s.name.id): + elif contains(c.toMixin, s.name.id): result = symChoice(c.c, n, s, scForceOpen) elif s.owner == c.owner and sfGenSym in s.flags: # template tmp[T](x: var seq[T]) = @@ -309,7 +309,7 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkConstDef): IllFormedAst(a) + if (a.kind != nkConstDef): illFormedAst(a) checkSonsLen(a, 3) addLocalDecl(c, a.sons[0], skConst) a.sons[1] = semTemplBody(c, a.sons[1]) @@ -318,13 +318,13 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkTypeDef): IllFormedAst(a) + if (a.kind != nkTypeDef): illFormedAst(a) checkSonsLen(a, 3) addLocalDecl(c, a.sons[0], skType) for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] if a.kind == nkCommentStmt: continue - if (a.kind != nkTypeDef): IllFormedAst(a) + if (a.kind != nkTypeDef): illFormedAst(a) checkSonsLen(a, 3) if a.sons[1].kind != nkEmpty: openScope(c) @@ -353,11 +353,11 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = # dotExpr is ambiguous: note that we explicitely allow 'x.TemplateParam', # so we use the generic code for nkDotExpr too if n.kind == nkDotExpr or n.kind == nkAccQuoted: - let s = QualifiedLookUp(c.c, n, {}) + let s = qualifiedLookUp(c.c, n, {}) if s != nil: - if Contains(c.toBind, s.id): + if contains(c.toBind, s.id): return symChoice(c.c, n, s, scClosed) - elif Contains(c.toMixin, s.name.id): + elif contains(c.toMixin, s.name.id): return symChoice(c.c, n, s, scForceOpen) else: return symChoice(c.c, n, s, scOpen) @@ -369,11 +369,11 @@ proc semTemplBodyDirty(c: var TemplCtx, n: PNode): PNode = result = n case n.kind of nkIdent: - let s = QualifiedLookUp(c.c, n, {}) + let s = qualifiedLookUp(c.c, n, {}) if s != nil: if s.owner == c.owner and s.kind == skParam: result = newSymNode(s, n.info) - elif Contains(c.toBind, s.id): + elif contains(c.toBind, s.id): result = symChoice(c.c, n, s, scClosed) of nkBind: result = semTemplBodyDirty(c, n.sons[0]) @@ -385,8 +385,8 @@ proc semTemplBodyDirty(c: var TemplCtx, n: PNode): PNode = # dotExpr is ambiguous: note that we explicitely allow 'x.TemplateParam', # so we use the generic code for nkDotExpr too if n.kind == nkDotExpr or n.kind == nkAccQuoted: - let s = QualifiedLookUp(c.c, n, {}) - if s != nil and Contains(c.toBind, s.id): + let s = qualifiedLookUp(c.c, n, {}) + if s != nil and contains(c.toBind, s.id): return symChoice(c.c, n, s, scClosed) result = n for i in countup(0, sonsLen(n) - 1): @@ -470,12 +470,12 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = s.ast = n result = n if n.sons[bodyPos].kind == nkEmpty: - LocalError(n.info, errImplOfXexpected, s.name.s) - var proto = SearchForProc(c, c.currentScope, s) + localError(n.info, errImplOfXexpected, s.name.s) + var proto = searchForProc(c, c.currentScope, s) if proto == nil: addInterfaceOverloadableSymAt(c, c.currentScope, s) else: - SymTabReplace(c.currentScope.symbols, proto, s) + symTabReplace(c.currentScope.symbols, proto, s) if n.sons[patternPos].kind != nkEmpty: c.patterns.add(s) @@ -498,7 +498,7 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = if s != nil: if s.owner == c.owner and s.kind == skParam: result = newParam(c, n, s) - elif Contains(c.toBind, s.id): + elif contains(c.toBind, s.id): result = symChoice(c.c, n, s, scClosed) elif templToExpand(s): result = semPatternBody(c, semTemplateExpr(c.c, n, s, false)) @@ -508,7 +508,7 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = # more flexibility proc expectParam(c: var TemplCtx, n: PNode): PNode = - let s = QualifiedLookUp(c.c, n, {}) + let s = qualifiedLookUp(c.c, n, {}) if s != nil and s.owner == c.owner and s.kind == skParam: result = newParam(c, n, s) else: @@ -518,7 +518,7 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = result = n case n.kind of nkIdent: - let s = QualifiedLookUp(c.c, n, {}) + let s = qualifiedLookUp(c.c, n, {}) result = handleSym(c, n, s) of nkBindStmt: result = semBindStmt(c.c, n, c.toBind) @@ -541,10 +541,10 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = else: localError(n.info, errInvalidExpression) of nkCallKinds: - let s = QualifiedLookUp(c.c, n.sons[0], {}) + let s = qualifiedLookUp(c.c, n.sons[0], {}) if s != nil: if s.owner == c.owner and s.kind == skParam: discard - elif Contains(c.toBind, s.id): discard + elif contains(c.toBind, s.id): discard elif templToExpand(s): return semPatternBody(c, semTemplateExpr(c.c, n, s, false)) @@ -580,9 +580,9 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode = # so we use the generic code for nkDotExpr too case n.kind of nkDotExpr, nkAccQuoted: - let s = QualifiedLookUp(c.c, n, {}) + let s = qualifiedLookUp(c.c, n, {}) if s != nil: - if Contains(c.toBind, s.id): + if contains(c.toBind, s.id): return symChoice(c.c, n, s, scClosed) else: return newIdentNode(s.name, n.info) diff --git a/compiler/semthreads.nim b/compiler/semthreads.nim index eded993254..c96acf2f18 100644 --- a/compiler/semthreads.nim +++ b/compiler/semthreads.nim @@ -97,7 +97,7 @@ proc `==`(a, b: TCall): bool = proc newProcCtx(owner: PSym): PProcCtx = assert owner != nil new(result) - result.mapping = tables.InitTable[int, TThreadOwner]() + result.mapping = tables.initTable[int, TThreadOwner]() result.owner = owner proc analyse(c: PProcCtx, n: PNode): TThreadOwner @@ -119,7 +119,7 @@ proc analyseSym(c: PProcCtx, n: PNode): TThreadOwner = of skParam: result = c.mapping[v.id] if result == toUndefined: - InternalError(n.info, "param not set: " & v.name.s) + internalError(n.info, "param not set: " & v.name.s) else: result = toNil c.mapping[v.id] = result @@ -132,7 +132,7 @@ proc lvalueSym(n: PNode): PNode = proc writeAccess(c: PProcCtx, n: PNode, owner: TThreadOwner) = if owner notin {toNil, toMine, toTheirs}: - InternalError(n.info, "writeAccess: " & $owner) + internalError(n.info, "writeAccess: " & $owner) var a = lvalueSym(n) if a.kind == nkSym: var v = a.sym @@ -151,21 +151,21 @@ proc writeAccess(c: PProcCtx, n: PNode, owner: TThreadOwner) = newOwner = toMine # XXX BUG what if the tuple contains both ``tyRef`` and ``tyString``? c.mapping[v.id] = newOwner - of toVoid, toUndefined: InternalError(n.info, "writeAccess") - of toTheirs: Message(n.info, warnWriteToForeignHeap) + of toVoid, toUndefined: internalError(n.info, "writeAccess") + of toTheirs: message(n.info, warnWriteToForeignHeap) of toMine: if lastOwner != owner and owner != toNil: - Message(n.info, warnDifferentHeaps) + message(n.info, warnDifferentHeaps) else: # we could not backtrack to a concrete symbol, but that's fine: var lastOwner = analyse(c, n) case lastOwner of toNil: nil # fine, toNil can be overwritten - of toVoid, toUndefined: InternalError(n.info, "writeAccess") - of toTheirs: Message(n.info, warnWriteToForeignHeap) + of toVoid, toUndefined: internalError(n.info, "writeAccess") + of toTheirs: message(n.info, warnWriteToForeignHeap) of toMine: if lastOwner != owner and owner != toNil: - Message(n.info, warnDifferentHeaps) + message(n.info, warnDifferentHeaps) proc analyseAssign(c: PProcCtx, le, ri: PNode) = var y = analyse(c, ri) # read access; ok @@ -192,7 +192,7 @@ proc analyseCall(c: PProcCtx, n: PNode): TThreadOwner = result = analyse(newCtx, prc.getBody) if prc.ast.sons[bodyPos].kind == nkEmpty and {sfNoSideEffect, sfThread, sfImportc} * prc.flags == {}: - Message(n.info, warnAnalysisLoophole, renderTree(n)) + message(n.info, warnAnalysisLoophole, renderTree(n)) if result == toUndefined: result = toNil if prc.typ.sons[0] != nil: if prc.ast.len > resultPos: @@ -215,12 +215,12 @@ proc analyseCall(c: PProcCtx, n: PNode): TThreadOwner = else: result = toNil proc analyseVarTuple(c: PProcCtx, n: PNode) = - if n.kind != nkVarTuple: InternalError(n.info, "analyseVarTuple") + if n.kind != nkVarTuple: internalError(n.info, "analyseVarTuple") var L = n.len - for i in countup(0, L-3): AnalyseAssign(c, n.sons[i], n.sons[L-1]) + for i in countup(0, L-3): analyseAssign(c, n.sons[i], n.sons[L-1]) proc analyseSingleVar(c: PProcCtx, a: PNode) = - if a.sons[2].kind != nkEmpty: AnalyseAssign(c, a.sons[0], a.sons[2]) + if a.sons[2].kind != nkEmpty: analyseAssign(c, a.sons[0], a.sons[2]) proc analyseVarSection(c: PProcCtx, n: PNode): TThreadOwner = for i in countup(0, sonsLen(n) - 1): @@ -238,7 +238,7 @@ proc analyseConstSection(c: PProcCtx, t: PNode): TThreadOwner = for i in countup(0, sonsLen(t) - 1): var it = t.sons[i] if it.kind == nkCommentStmt: continue - if it.kind != nkConstDef: InternalError(t.info, "analyseConstSection") + if it.kind != nkConstDef: internalError(t.info, "analyseConstSection") if sfFakeConst in it.sons[0].sym.flags: analyseSingleVar(c, it) result = toVoid @@ -246,7 +246,7 @@ template aggregateOwner(result, ana: expr) = var a = ana # eval once if result != a: if result == toNil: result = a - elif a != toNil: Message(n.info, warnDifferentHeaps) + elif a != toNil: message(n.info, warnDifferentHeaps) proc analyseArgs(c: PProcCtx, n: PNode, start = 1) = for i in start..n.len-1: discard analyse(c, n[i]) @@ -254,7 +254,7 @@ proc analyseArgs(c: PProcCtx, n: PNode, start = 1) = proc analyseOp(c: PProcCtx, n: PNode): TThreadOwner = if n[0].kind != nkSym or n[0].sym.kind != skProc: if {tfNoSideEffect, tfThread} * n[0].typ.flags == {}: - Message(n.info, warnAnalysisLoophole, renderTree(n)) + message(n.info, warnAnalysisLoophole, renderTree(n)) result = toNil else: var prc = n[0].sym @@ -352,7 +352,7 @@ proc analyse(c: PProcCtx, n: PNode): TThreadOwner = result = analyse(c, n.sons[0]) of nkRaiseStmt: var a = analyse(c, n.sons[0]) - if a != toMine: Message(n.info, warnDifferentHeaps) + if a != toMine: message(n.info, warnDifferentHeaps) result = toVoid of nkVarSection, nkLetSection: result = analyseVarSection(c, n) of nkConstSection: result = analyseConstSection(c, n) @@ -373,7 +373,7 @@ proc analyse(c: PProcCtx, n: PNode): TThreadOwner = result = toVoid of nkExprColonExpr: result = analyse(c, n.sons[1]) - else: InternalError(n.info, "analysis not implemented for: " & $n.kind) + else: internalError(n.info, "analysis not implemented for: " & $n.kind) proc analyseThreadProc*(prc: PSym) = var c = newProcCtx(prc) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 1f995f5e76..91bbb467e3 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -53,9 +53,9 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = if skipTypes(strVal.typ, abstractInst).kind in {tyString, tyCstring}: x = getOrdValue(v.sons[0]) # first tuple part is the ordinal else: - LocalError(strVal.info, errStringLiteralExpected) + localError(strVal.info, errStringLiteralExpected) else: - LocalError(v.info, errWrongNumberOfVariables) + localError(v.info, errWrongNumberOfVariables) of tyString, tyCstring: strVal = v x = counter @@ -64,7 +64,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = if i != 1: if x != counter: incl(result.flags, tfEnumHasHoles) if x < counter: - LocalError(n.sons[i].info, errInvalidOrderInEnumX, e.name.s) + localError(n.sons[i].info, errInvalidOrderInEnumX, e.name.s) x = counter e.ast = strVal # might be nil counter = x @@ -79,7 +79,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = if result.sym != nil and sfExported in result.sym.flags: incl(e.flags, sfUsed) incl(e.flags, sfExported) - if not isPure: StrTableAdd(c.module.tab, e) + if not isPure: strTableAdd(c.module.tab, e) addSon(result.n, newSymNode(e)) if sfGenSym notin e.flags and not isPure: addDecl(c, e) inc(counter) @@ -93,11 +93,11 @@ proc semSet(c: PContext, n: PNode, prev: PType): PType = if base.kind == tyGenericInst: base = lastSon(base) if base.kind != tyGenericParam: if not isOrdinalType(base): - LocalError(n.info, errOrdinalTypeExpected) + localError(n.info, errOrdinalTypeExpected) elif lengthOrd(base) > MaxSetElements: - LocalError(n.info, errSetTooBig) + localError(n.info, errSetTooBig) else: - LocalError(n.info, errXExpectsOneTypeParam, "set") + localError(n.info, errXExpectsOneTypeParam, "set") addSonSkipIntLit(result, errorType(c)) proc semContainer(c: PContext, n: PNode, kind: TTypeKind, kindStr: string, @@ -107,7 +107,7 @@ proc semContainer(c: PContext, n: PNode, kind: TTypeKind, kindStr: string, var base = semTypeNode(c, n.sons[1], nil) addSonSkipIntLit(result, base) else: - LocalError(n.info, errXExpectsOneTypeParam, kindStr) + localError(n.info, errXExpectsOneTypeParam, kindStr) addSonSkipIntLit(result, errorType(c)) proc semVarargs(c: PContext, n: PNode, prev: PType): PType = @@ -118,7 +118,7 @@ proc semVarargs(c: PContext, n: PNode, prev: PType): PType = if sonsLen(n) == 3: result.n = newIdentNode(considerAcc(n.sons[2]), n.sons[2].info) else: - LocalError(n.info, errXExpectsOneTypeParam, "varargs") + localError(n.info, errXExpectsOneTypeParam, "varargs") addSonSkipIntLit(result, errorType(c)) proc semAnyRef(c: PContext, n: PNode, kind: TTypeKind, prev: PType): PType = @@ -134,7 +134,7 @@ proc semVarType(c: PContext, n: PNode, prev: PType): PType = result = newOrPrevType(tyVar, prev, c) var base = semTypeNode(c, n.sons[0], nil) if base.kind == tyVar: - LocalError(n.info, errVarVarTypeNotAllowed) + localError(n.info, errVarVarTypeNotAllowed) base = base.sons[0] addSonSkipIntLit(result, base) else: @@ -153,17 +153,17 @@ proc semRangeAux(c: PContext, n: PNode, prev: PType): PType = result = newOrPrevType(tyRange, prev, c) result.n = newNodeI(nkRange, n.info) if (n[1].kind == nkEmpty) or (n[2].kind == nkEmpty): - LocalError(n.Info, errRangeIsEmpty) + localError(n.Info, errRangeIsEmpty) var a = semConstExpr(c, n[1]) var b = semConstExpr(c, n[2]) if not sameType(a.typ, b.typ): - LocalError(n.info, errPureTypeMismatch) + localError(n.info, errPureTypeMismatch) elif a.typ.kind notin {tyInt..tyInt64,tyEnum,tyBool,tyChar, tyFloat..tyFloat128,tyUInt8..tyUInt32}: - LocalError(n.info, errOrdinalTypeExpected) + localError(n.info, errOrdinalTypeExpected) elif enumHasHoles(a.typ): - LocalError(n.info, errEnumXHasHoles, a.typ.sym.name.s) - elif not leValue(a, b): LocalError(n.Info, errRangeIsEmpty) + localError(n.info, errEnumXHasHoles, a.typ.sym.name.s) + elif not leValue(a, b): localError(n.Info, errRangeIsEmpty) addSon(result.n, a) addSon(result.n, b) addSonSkipIntLit(result, b.typ) @@ -180,10 +180,10 @@ proc semRange(c: PContext, n: PNode, prev: PType): PType = elif n.sons[0].floatVal > 0.0 or n.sons[1].floatVal < 0.0: incl(result.flags, tfNeedsInit) else: - LocalError(n.sons[0].info, errRangeExpected) + localError(n.sons[0].info, errRangeExpected) result = newOrPrevType(tyError, prev, c) else: - LocalError(n.info, errXExpectsOneTypeParam, "range") + localError(n.info, errXExpectsOneTypeParam, "range") result = newOrPrevType(tyError, prev, c) proc semArray(c: PContext, n: PNode, prev: PType): PType = @@ -208,13 +208,13 @@ proc semArray(c: PContext, n: PNode, prev: PType): PType = if indx.kind == tyGenericInst: indx = lastSon(indx) if indx.kind notin {tyGenericParam, tyExpr}: if not isOrdinalType(indx): - LocalError(n.sons[1].info, errOrdinalTypeExpected) + localError(n.sons[1].info, errOrdinalTypeExpected) elif enumHasHoles(indx): - LocalError(n.sons[1].info, errEnumXHasHoles, indx.sym.name.s) + localError(n.sons[1].info, errEnumXHasHoles, indx.sym.name.s) base = semTypeNode(c, n.sons[2], nil) addSonSkipIntLit(result, base) else: - LocalError(n.info, errArrayExpectsTwoTypeParams) + localError(n.info, errArrayExpectsTwoTypeParams) result = newOrPrevType(tyError, prev, c) proc semOrdinal(c: PContext, n: PNode, prev: PType): PType = @@ -223,17 +223,17 @@ proc semOrdinal(c: PContext, n: PNode, prev: PType): PType = var base = semTypeNode(c, n.sons[1], nil) if base.kind != tyGenericParam: if not isOrdinalType(base): - LocalError(n.sons[1].info, errOrdinalTypeExpected) + localError(n.sons[1].info, errOrdinalTypeExpected) addSonSkipIntLit(result, base) else: - LocalError(n.info, errXExpectsOneTypeParam, "ordinal") + localError(n.info, errXExpectsOneTypeParam, "ordinal") result = newOrPrevType(tyError, prev, c) proc semTypeIdent(c: PContext, n: PNode): PSym = if n.kind == nkSym: result = n.sym else: - result = qualifiedLookup(c, n, {checkAmbiguity, checkUndeclared}) + result = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared}) if result != nil: markUsed(n, result) if result.kind == skParam and result.typ.kind == tyTypeDesc: @@ -245,7 +245,7 @@ proc semTypeIdent(c: PContext, n: PNode): PSym = if bound != nil: return bound return result if result.typ.sym == nil: - LocalError(n.info, errTypeExpected) + localError(n.info, errTypeExpected) return errorSym(c, n) result = result.typ.sym.copySym result.typ = copyType(result.typ, result.typ.owner, true) @@ -253,12 +253,12 @@ proc semTypeIdent(c: PContext, n: PNode): PSym = if result.kind != skType: # this implements the wanted ``var v: V, x: V`` feature ... var ov: TOverloadIter - var amb = InitOverloadIter(ov, c, n) + var amb = initOverloadIter(ov, c, n) while amb != nil and amb.kind != skType: amb = nextOverloadIter(ov, c, n) if amb != nil: result = amb else: - if result.kind != skError: LocalError(n.info, errTypeExpected) + if result.kind != skError: localError(n.info, errTypeExpected) return errorSym(c, n) if result.typ.kind != tyGenericParam: # XXX get rid of this hack! @@ -268,7 +268,7 @@ proc semTypeIdent(c: PContext, n: PNode): PSym = n.sym = result n.info = oldInfo else: - LocalError(n.info, errIdentifierExpected) + localError(n.info, errIdentifierExpected) result = errorSym(c, n) proc semTuple(c: PContext, n: PNode, prev: PType): PType = @@ -280,23 +280,23 @@ proc semTuple(c: PContext, n: PNode, prev: PType): PType = var counter = 0 for i in countup(0, sonsLen(n) - 1): var a = n.sons[i] - if (a.kind != nkIdentDefs): IllFormedAst(a) + if (a.kind != nkIdentDefs): illFormedAst(a) checkMinSonsLen(a, 3) var length = sonsLen(a) if a.sons[length - 2].kind != nkEmpty: typ = semTypeNode(c, a.sons[length - 2], nil) else: - LocalError(a.info, errTypeExpected) + localError(a.info, errTypeExpected) typ = errorType(c) if a.sons[length - 1].kind != nkEmpty: - LocalError(a.sons[length - 1].info, errInitHereNotAllowed) + localError(a.sons[length - 1].info, errInitHereNotAllowed) for j in countup(0, length - 3): var field = newSymG(skField, a.sons[j], c) field.typ = typ field.position = counter inc(counter) - if ContainsOrIncl(check, field.name.id): - LocalError(a.sons[j].info, errAttemptToRedefine, field.name.s) + if containsOrIncl(check, field.name.id): + localError(a.sons[j].info, errAttemptToRedefine, field.name.s) else: addSon(result.n, newSymNode(field)) addSonSkipIntLit(result, typ) @@ -313,7 +313,7 @@ proc semIdentVis(c: PContext, kind: TSymKind, n: PNode, if sfExported in allowed and v.id == ord(wStar): incl(result.flags, sfExported) else: - LocalError(n.sons[0].info, errInvalidVisibilityX, v.s) + localError(n.sons[0].info, errInvalidVisibilityX, v.s) else: illFormedAst(n) else: @@ -341,9 +341,9 @@ proc checkForOverlap(c: PContext, t: PNode, currentEx, branchIndex: int) = for j in countup(0, sonsLen(t.sons[i]) - 2): if i == branchIndex and j == currentEx: break if overlap(t.sons[i].sons[j].skipConv, ex): - LocalError(ex.info, errDuplicateCaseLabel) + localError(ex.info, errDuplicateCaseLabel) -proc semBranchRange(c: PContext, t, a, b: PNode, covered: var biggestInt): PNode = +proc semBranchRange(c: PContext, t, a, b: PNode, covered: var BiggestInt): PNode = checkMinSonsLen(t, 1) let ac = semConstExpr(c, a) let bc = semConstExpr(c, b) @@ -353,16 +353,16 @@ proc semBranchRange(c: PContext, t, a, b: PNode, covered: var biggestInt): PNode result = newNodeI(nkRange, a.info) result.add(at) result.add(bt) - if emptyRange(ac, bc): LocalError(b.info, errRangeIsEmpty) + if emptyRange(ac, bc): localError(b.info, errRangeIsEmpty) else: covered = covered + getOrdValue(bc) - getOrdValue(ac) + 1 proc semCaseBranchRange(c: PContext, t, b: PNode, - covered: var biggestInt): PNode = + covered: var BiggestInt): PNode = checkSonsLen(b, 3) result = semBranchRange(c, t, b.sons[1], b.sons[2], covered) proc semCaseBranchSetElem(c: PContext, t, b: PNode, - covered: var biggestInt): PNode = + covered: var BiggestInt): PNode = if isRange(b): checkSonsLen(b, 3) result = semBranchRange(c, t, b.sons[1], b.sons[2], covered) @@ -374,7 +374,7 @@ proc semCaseBranchSetElem(c: PContext, t, b: PNode, inc(covered) proc semCaseBranch(c: PContext, t, branch: PNode, branchIndex: int, - covered: var biggestInt) = + covered: var BiggestInt) = for i in countup(0, sonsLen(branch) - 2): var b = branch.sons[i] if b.kind == nkRange: @@ -411,14 +411,14 @@ proc semRecordCase(c: PContext, n: PNode, check: var TIntSet, pos: var int, internalError("semRecordCase: discriminant is no symbol") return incl(a.sons[0].sym.flags, sfDiscriminant) - var covered: biggestInt = 0 + var covered: BiggestInt = 0 var typ = skipTypes(a.sons[0].Typ, abstractVar-{tyTypeDesc}) if not isOrdinalType(typ): - LocalError(n.info, errSelectorMustBeOrdinal) + localError(n.info, errSelectorMustBeOrdinal) elif firstOrd(typ) < 0: - LocalError(n.info, errOrdXMustNotBeNegative, a.sons[0].sym.name.s) + localError(n.info, errOrdXMustNotBeNegative, a.sons[0].sym.name.s) elif lengthOrd(typ) > 0x00007FFF: - LocalError(n.info, errLenXinvalid, a.sons[0].sym.name.s) + localError(n.info, errLenXinvalid, a.sons[0].sym.name.s) var chckCovered = true for i in countup(1, sonsLen(n) - 1): var b = copyTree(n.sons[i]) @@ -452,7 +452,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var TIntSet, pos: var int, checkSonsLen(it, 2) if c.InGenericContext == 0: var e = semConstBoolExpr(c, it.sons[0]) - if e.kind != nkIntLit: InternalError(e.info, "semRecordNodeAux") + if e.kind != nkIntLit: internalError(e.info, "semRecordNodeAux") elif e.intVal != 0 and branch == nil: branch = it.sons[1] else: it.sons[0] = forceBool(c, semExprWithType(c, it.sons[0])) @@ -467,7 +467,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var TIntSet, pos: var int, assign(newCheck, check) var newPos = pos var newf = newNodeI(nkRecList, n.info) - semRecordNodeAux(c, it.sons[idx], newcheck, newpos, newf, rectype) + semRecordNodeAux(c, it.sons[idx], newCheck, newPos, newf, rectype) it.sons[idx] = if newf.len == 1: newf[0] else: newf if c.InGenericContext > 0: addSon(father, n) @@ -493,7 +493,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var TIntSet, pos: var int, localError(n.sons[length-1].info, errInitHereNotAllowed) var typ: PType if n.sons[length-2].kind == nkEmpty: - LocalError(n.info, errTypeExpected) + localError(n.info, errTypeExpected) typ = errorType(c) else: typ = semTypeNode(c, n.sons[length-2], nil) @@ -509,7 +509,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var TIntSet, pos: var int, f.loc.r = toRope(f.name.s) f.flags = f.flags + ({sfImportc, sfExportc} * rec.flags) inc(pos) - if ContainsOrIncl(check, f.name.id): + if containsOrIncl(check, f.name.id): localError(n.sons[i].info, errAttemptToRedefine, f.name.s) if a.kind == nkEmpty: addSon(father, newSymNode(f)) else: addSon(a, newSymNode(f)) @@ -521,7 +521,7 @@ proc addInheritedFieldsAux(c: PContext, check: var TIntSet, pos: var int, n: PNode) = case n.kind of nkRecCase: - if (n.sons[0].kind != nkSym): InternalError(n.info, "addInheritedFieldsAux") + if (n.sons[0].kind != nkSym): internalError(n.info, "addInheritedFieldsAux") addInheritedFieldsAux(c, check, pos, n.sons[0]) for i in countup(1, sonsLen(n) - 1): case n.sons[i].kind @@ -532,9 +532,9 @@ proc addInheritedFieldsAux(c: PContext, check: var TIntSet, pos: var int, for i in countup(0, sonsLen(n) - 1): addInheritedFieldsAux(c, check, pos, n.sons[i]) of nkSym: - Incl(check, n.sym.name.id) + incl(check, n.sym.name.id) inc(pos) - else: InternalError(n.info, "addInheritedFieldsAux()") + else: internalError(n.info, "addInheritedFieldsAux()") proc addInheritedFields(c: PContext, check: var TIntSet, pos: var int, obj: PType) = @@ -565,7 +565,7 @@ proc semObjectNode(c: PContext, n: PNode, prev: PType): PType = if concreteBase.kind != tyError: localError(n.sons[1].info, errInheritanceOnlyWithNonFinalObjects) base = nil - if n.kind != nkObjectTy: InternalError(n.info, "semObjectNode") + if n.kind != nkObjectTy: internalError(n.info, "semObjectNode") result = newOrPrevType(tyObject, prev, c) rawAddSon(result, base) result.n = newNodeI(nkRecList, n.info) @@ -719,7 +719,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode, var counter = 0 for i in countup(1, n.len - 1): var a = n.sons[i] - if a.kind != nkIdentDefs: IllFormedAst(a) + if a.kind != nkIdentDefs: illFormedAst(a) checkMinSonsLen(a, 3) var typ: PType = nil @@ -756,8 +756,8 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode, arg.constraint = constraint inc(counter) if def != nil and def.kind != nkEmpty: arg.ast = copyTree(def) - if ContainsOrIncl(check, arg.name.id): - LocalError(a.sons[j].info, errAttemptToRedefine, arg.name.s) + if containsOrIncl(check, arg.name.id): + localError(a.sons[j].info, errAttemptToRedefine, arg.name.s) addSon(result.n, newSymNode(arg)) rawAddSon(result, finalType) addParamOrResult(c, arg, kind) @@ -788,7 +788,7 @@ proc semStmtListType(c: PContext, n: PNode, prev: PType): PType = result = nil proc semBlockType(c: PContext, n: PNode, prev: PType): PType = - Inc(c.p.nestedBlockCounter) + inc(c.p.nestedBlockCounter) checkSonsLen(n, 2) openScope(c) if n.sons[0].kind notin {nkEmpty, nkSym}: @@ -797,7 +797,7 @@ proc semBlockType(c: PContext, n: PNode, prev: PType): PType = n.sons[1].typ = result n.typ = result closeScope(c) - Dec(c.p.nestedBlockCounter) + dec(c.p.nestedBlockCounter) proc semGenericParamInInvokation(c: PContext, n: PNode): PType = # XXX hack 1022 for generics ... would have been nice if the compiler had @@ -824,12 +824,12 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = template addToResult(typ) = if typ.isNil: - InternalAssert false + internalAssert false rawAddSon(result, typ) else: addSonSkipIntLit(result, typ) if s.typ == nil: - LocalError(n.info, errCannotInstantiateX, s.name.s) + localError(n.info, errCannotInstantiateX, s.name.s) return newOrPrevType(tyError, prev, c) elif s.typ.kind == tyForward: for i in countup(1, sonsLen(n)-1): @@ -845,7 +845,7 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = var err = "cannot instantiate " & typeToString(s.typ) & "\n" & "got: (" & describeArgs(c, n) & ")\n" & "but expected: (" & describeArgs(c, s.typ.n, 0) & ")" - LocalError(n.info, errGenerated, err) + localError(n.info, errGenerated, err) return newOrPrevType(tyError, prev, c) var isConcrete = true @@ -857,7 +857,7 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = if isConcrete: if s.ast == nil: - LocalError(n.info, errCannotInstantiateX, s.name.s) + localError(n.info, errCannotInstantiateX, s.name.s) result = newOrPrevType(tyError, prev, c) else: when oUseLateInstantiation: @@ -870,7 +870,7 @@ proc semTypeExpr(c: PContext, n: PNode): PType = if n.kind == nkSym and n.sym.kind == skType: result = n.sym.typ else: - LocalError(n.info, errTypeExpected, n.renderTree) + localError(n.info, errTypeExpected, n.renderTree) proc freshType(res, prev: PType): PType {.inline.} = if prev.isNil: @@ -905,7 +905,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = if sonsLen(n) == 1: result = semTypeNode(c, n.sons[0], prev) else: # XXX support anon tuple here - LocalError(n.info, errTypeExpected) + localError(n.info, errTypeExpected) result = newOrPrevType(tyError, prev, c) of nkCallKinds: if isRange(n): @@ -918,10 +918,10 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = t1 = semTypeNode(c, n.sons[1], nil) t2 = semTypeNode(c, n.sons[2], nil) if t1 == nil: - LocalError(n.sons[1].info, errTypeExpected) + localError(n.sons[1].info, errTypeExpected) result = newOrPrevType(tyError, prev, c) elif t2 == nil: - LocalError(n.sons[2].info, errTypeExpected) + localError(n.sons[2].info, errTypeExpected) result = newOrPrevType(tyError, prev, c) else: result = newTypeS(tyTypeClass, c) @@ -936,7 +936,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = result = freshType(result, prev) result.flags.incl(tfNotNil) else: - LocalError(n.info, errGenerated, "invalid type") + localError(n.info, errGenerated, "invalid type") else: result = semTypeExpr(c, n) else: @@ -966,7 +966,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = of nkIdent, nkDotExpr, nkAccQuoted: var s = semTypeIdent(c, n) if s.typ == nil: - if s.kind != skError: LocalError(n.info, errTypeExpected) + if s.kind != skError: localError(n.info, errTypeExpected) result = newOrPrevType(tyError, prev, c) elif s.kind == skParam and s.typ.kind == tyTypeDesc: assert s.typ.len > 0 @@ -991,7 +991,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = result = prev markUsed(n, n.sym) else: - if n.sym.kind != skError: LocalError(n.info, errTypeExpected) + if n.sym.kind != skError: localError(n.info, errTypeExpected) result = newOrPrevType(tyError, prev, c) of nkObjectTy: result = semObjectNode(c, n, prev) of nkTupleTy: result = semTuple(c, n, prev) @@ -1016,7 +1016,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = #Message(n.info, warnImplicitClosure, renderTree(n)) else: pragma(c, s, n.sons[1], procTypePragmas) - when useEffectSystem: SetEffectsForProcType(result, n.sons[1]) + when useEffectSystem: setEffectsForProcType(result, n.sons[1]) closeScope(c) if n.kind == nkIteratorTy: result.flags.incl(tfIterator) @@ -1031,7 +1031,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = result = freshType(result, prev) result.flags.incl(tfShared) else: - LocalError(n.info, errTypeExpected) + localError(n.info, errTypeExpected) result = newOrPrevType(tyError, prev, c) proc setMagicType(m: PSym, kind: TTypeKind, size: int) = @@ -1081,7 +1081,7 @@ proc processMagicType(c: PContext, m: PSym) = of mSeq: setMagicType(m, tySequence, 0) of mOrdinal: setMagicType(m, tyOrdinal, 0) of mPNimrodNode: nil - else: LocalError(m.info, errTypeExpected) + else: localError(m.info, errTypeExpected) proc semGenericConstraints(c: PContext, x: PType): PType = if x.kind in StructuralEquivTypes and ( diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index d51c1de8cb..2afdeb5ae7 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -13,19 +13,19 @@ import ast, astalgo, msgs, types, magicsys, semdata, renderer proc checkPartialConstructedType(info: TLineInfo, t: PType) = if tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject: - LocalError(info, errInvalidPragmaX, "acyclic") + localError(info, errInvalidPragmaX, "acyclic") elif t.kind == tyVar and t.sons[0].kind == tyVar: - LocalError(info, errVarVarTypeNotAllowed) + localError(info, errVarVarTypeNotAllowed) proc checkConstructedType*(info: TLineInfo, typ: PType) = var t = typ.skipTypes({tyDistinct}) if t.kind in {tyTypeClass}: nil elif tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject: - LocalError(info, errInvalidPragmaX, "acyclic") + localError(info, errInvalidPragmaX, "acyclic") elif t.kind == tyVar and t.sons[0].kind == tyVar: - LocalError(info, errVarVarTypeNotAllowed) + localError(info, errVarVarTypeNotAllowed) elif computeSize(t) < 0: - LocalError(info, errIllegalRecursionInTypeX, typeToString(t)) + localError(info, errIllegalRecursionInTypeX, typeToString(t)) when false: if t.kind == tyObject and t.sons[0] != nil: if t.sons[0].kind != tyObject or tfFinal in t.sons[0].flags: @@ -74,8 +74,8 @@ proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode = result = copyNode(n) - result.typ = ReplaceTypeVarsT(cl, n.typ) - if result.kind == nkSym: result.sym = ReplaceTypeVarsS(cl, n.sym) + result.typ = replaceTypeVarsT(cl, n.typ) + if result.kind == nkSym: result.sym = replaceTypeVarsS(cl, n.sym) for i in 0 .. safeLen(n)-1: # XXX HACK: ``f(a, b)``, avoid to instantiate `f` if i == 0: result.add(n[i]) @@ -84,12 +84,12 @@ proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode = proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = if n == nil: return result = copyNode(n) - result.typ = ReplaceTypeVarsT(cl, n.typ) + result.typ = replaceTypeVarsT(cl, n.typ) case n.kind of nkNone..pred(nkSym), succ(nkSym)..nkNilLit: discard of nkSym: - result.sym = ReplaceTypeVarsS(cl, n.sym) + result.sym = replaceTypeVarsS(cl, n.sym) of nkRecWhen: var branch: PNode = nil # the branch to take for i in countup(0, sonsLen(n) - 1): @@ -101,14 +101,14 @@ proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = var cond = prepareNode(cl, it.sons[0]) var e = cl.c.semConstExpr(cl.c, cond) if e.kind != nkIntLit: - InternalError(e.info, "ReplaceTypeVarsN: when condition not a bool") + internalError(e.info, "ReplaceTypeVarsN: when condition not a bool") if e.intVal != 0 and branch == nil: branch = it.sons[1] of nkElse: checkSonsLen(it, 1) if branch == nil: branch = it.sons[0] else: illFormedAst(n) if branch != nil: - result = ReplaceTypeVarsN(cl, branch) + result = replaceTypeVarsN(cl, branch) else: result = newNodeI(nkRecList, n.info) else: @@ -116,7 +116,7 @@ proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = if length > 0: newSons(result, length) for i in countup(0, length - 1): - result.sons[i] = ReplaceTypeVarsN(cl, n.sons[i]) + result.sons[i] = replaceTypeVarsN(cl, n.sons[i]) proc replaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym = if s == nil: return nil @@ -125,23 +125,23 @@ proc replaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym = result = copySym(s, false) incl(result.flags, sfFromGeneric) idTablePut(cl.symMap, s, result) - result.typ = ReplaceTypeVarsT(cl, s.typ) + result.typ = replaceTypeVarsT(cl, s.typ) result.owner = s.owner - result.ast = ReplaceTypeVarsN(cl, s.ast) + result.ast = replaceTypeVarsN(cl, s.ast) proc lookupTypeVar(cl: TReplTypeVars, t: PType): PType = result = PType(idTableGet(cl.typeMap, t)) if result == nil: - LocalError(t.sym.info, errCannotInstantiateX, typeToString(t)) + localError(t.sym.info, errCannotInstantiateX, typeToString(t)) result = errorType(cl.c) elif result.kind == tyGenericParam: - InternalError(cl.info, "substitution with generic parameter") + internalError(cl.info, "substitution with generic parameter") proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = # tyGenericInvokation[A, tyGenericInvokation[A, B]] # is difficult to handle: var body = t.sons[0] - if body.kind != tyGenericBody: InternalError(cl.info, "no generic body") + if body.kind != tyGenericBody: internalError(cl.info, "no generic body") var header: PType = nil # search for some instantiation here: result = searchInstTypes(t) @@ -180,11 +180,11 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = # but we already raised an error! rawAddSon(result, header.sons[i]) - var newbody = ReplaceTypeVarsT(cl, lastSon(body)) + var newbody = replaceTypeVarsT(cl, lastSon(body)) newbody.flags = newbody.flags + t.flags + body.flags result.flags = result.flags + newbody.flags newbody.callConv = body.callConv - newbody.n = ReplaceTypeVarsN(cl, lastSon(body).n) + newbody.n = replaceTypeVarsN(cl, lastSon(body).n) # This type may be a generic alias and we want to resolve it here. # One step is enough, because the recursive nature of # handleGenericInvokation will handle the alias-to-alias-to-alias case @@ -207,8 +207,8 @@ proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = of tyGenericInvokation: result = handleGenericInvokation(cl, t) of tyGenericBody: - InternalError(cl.info, "ReplaceTypeVarsT: tyGenericBody") - result = ReplaceTypeVarsT(cl, lastSon(t)) + internalError(cl.info, "ReplaceTypeVarsT: tyGenericBody") + result = replaceTypeVarsT(cl, lastSon(t)) of tyInt: result = skipIntLit(t) # XXX now there are also float literals @@ -224,10 +224,10 @@ proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = incl(result.flags, tfFromGeneric) result.size = -1 # needs to be recomputed for i in countup(0, sonsLen(result) - 1): - result.sons[i] = ReplaceTypeVarsT(cl, result.sons[i]) - result.n = ReplaceTypeVarsN(cl, result.n) + result.sons[i] = replaceTypeVarsT(cl, result.sons[i]) + result.n = replaceTypeVarsN(cl, result.n) if result.Kind in GenericTypes: - LocalError(cl.info, errCannotInstantiateX, TypeToString(t, preferName)) + localError(cl.info, errCannotInstantiateX, typeToString(t, preferName)) if result.kind == tyProc and result.sons[0] != nil: if result.sons[0].kind == tyEmpty: result.sons[0] = nil diff --git a/compiler/service.nim b/compiler/service.nim index 1cae72f2a2..209ccd8e30 100644 --- a/compiler/service.nim +++ b/compiler/service.nim @@ -43,9 +43,9 @@ proc processCmdLine*(pass: TCmdLinePass, cmd: string) = if bracketLe >= 0: var key = substr(p.key, 0, bracketLe - 1) var val = substr(p.key, bracketLe + 1) & ':' & p.val - ProcessSwitch(key, val, pass, gCmdLineInfo) + processSwitch(key, val, pass, gCmdLineInfo) else: - ProcessSwitch(p.key, p.val, pass, gCmdLineInfo) + processSwitch(p.key, p.val, pass, gCmdLineInfo) of cmdArgument: if argsCount == 0: options.command = p.key @@ -79,11 +79,11 @@ proc serve*(action: proc (){.nimcall.}) = if line == "quit": quit() execute line echo "" - FlushFile(stdout) + flushFile(stdout) of "tcp", "": when useCaas: - var server = Socket() + var server = socket() let p = getConfigVar("server.port") let port = if p.len > 0: parseInt(p).TPort else: 6000.TPort server.bindAddr(port, getConfigVar("server.address")) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 7ccb1bdc18..7a30dadc8b 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -77,7 +77,7 @@ proc initCandidate*(c: var TCandidate, callee: PType) = initIdTable(c.bindings) proc put(t: var TIdTable, key, val: PType) {.inline.} = - IdTablePut(t, key, val) + idTablePut(t, key, val) proc initCandidate*(c: var TCandidate, callee: PSym, binding: PNode, calleeScope = -1) = @@ -169,11 +169,11 @@ proc cmpCandidates*(a, b: TCandidate): int = result = complexDisambiguation(a.callee, b.callee) proc writeMatches*(c: TCandidate) = - Writeln(stdout, "exact matches: " & $c.exactMatches) - Writeln(stdout, "subtype matches: " & $c.subtypeMatches) - Writeln(stdout, "conv matches: " & $c.convMatches) - Writeln(stdout, "intconv matches: " & $c.intConvMatches) - Writeln(stdout, "generic matches: " & $c.genericMatches) + writeln(stdout, "exact matches: " & $c.exactMatches) + writeln(stdout, "subtype matches: " & $c.subtypeMatches) + writeln(stdout, "conv matches: " & $c.convMatches) + writeln(stdout, "intconv matches: " & $c.intConvMatches) + writeln(stdout, "generic matches: " & $c.genericMatches) proc argTypeToString(arg: PNode): string = if arg.kind in nkSymChoices: @@ -223,7 +223,7 @@ proc concreteType(c: TCandidate, t: PType): PType = # proc sort[T](cmp: proc(a, b: T): int = cmp) if result.kind != tyGenericParam: break of tyGenericInvokation: - InternalError("cannot resolve type: " & typeToString(t)) + internalError("cannot resolve type: " & typeToString(t)) result = t else: result = t # Note: empty is valid here @@ -309,8 +309,8 @@ proc tupleRel(c: var TCandidate, f, a: PType): TTypeRelation = if f.n != nil and a.n != nil: for i in countup(0, sonsLen(f.n) - 1): # check field names: - if f.n.sons[i].kind != nkSym: InternalError(f.n.info, "tupleRel") - elif a.n.sons[i].kind != nkSym: InternalError(a.n.info, "tupleRel") + if f.n.sons[i].kind != nkSym: internalError(f.n.info, "tupleRel") + elif a.n.sons[i].kind != nkSym: internalError(a.n.info, "tupleRel") else: var x = f.n.sons[i].sym var y = a.n.sons[i].sym @@ -552,7 +552,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = if result < isGeneric: result = isNone elif a.kind == tyGenericParam: result = isGeneric - of tyForward: InternalError("forward type in typeRel()") + of tyForward: internalError("forward type in typeRel()") of tyNil: if a.kind == f.kind: result = isEqual of tyTuple: @@ -658,7 +658,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = (sonsLen(x) - 1 == sonsLen(f)): for i in countup(1, sonsLen(f) - 1): if x.sons[i].kind == tyGenericParam: - InternalError("wrong instantiated type!") + internalError("wrong instantiated type!") elif typeRel(c, f.sons[i], x.sons[i]) <= isSubtype: return result = isGeneric else: @@ -668,7 +668,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = for i in countup(1, sonsLen(f) - 1): var x = PType(idTableGet(c.bindings, f.sons[0].sons[i - 1])) if x == nil or x.kind in {tyGenericInvokation, tyGenericParam}: - InternalError("wrong instantiated type!") + internalError("wrong instantiated type!") put(c.bindings, f.sons[i], x) of tyAnd: @@ -764,7 +764,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = proc cmpTypes*(f, a: PType): TTypeRelation = var c: TCandidate - InitCandidate(c, f) + initCandidate(c, f) result = typeRel(c, f, a) proc getInstantiatedType(c: PContext, arg: PNode, m: TCandidate, @@ -773,7 +773,7 @@ proc getInstantiatedType(c: PContext, arg: PNode, m: TCandidate, if result == nil: result = generateTypeInstance(c, m.bindings, arg, f) if result == nil: - InternalError(arg.info, "getInstantiatedType") + internalError(arg.info, "getInstantiatedType") result = errorType(c) proc implicitConv(kind: TNodeKind, f: PType, arg: PNode, m: TCandidate, @@ -786,7 +786,7 @@ proc implicitConv(kind: TNodeKind, f: PType, arg: PNode, m: TCandidate, result.typ = errorType(c) else: result.typ = f - if result.typ == nil: InternalError(arg.info, "implicitConv") + if result.typ == nil: internalError(arg.info, "implicitConv") addSon(result, ast.emptyNode) addSon(result, arg) @@ -1006,7 +1006,7 @@ proc paramTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, proc paramTypesMatch*(c: PContext, m: var TCandidate, f, a: PType, arg, argOrig: PNode): PNode = if arg == nil or arg.kind notin nkSymChoices: - result = ParamTypesMatchAux(c, m, f, a, arg, argOrig) + result = paramTypesMatchAux(c, m, f, a, arg, argOrig) else: # CAUTION: The order depends on the used hashing scheme. Thus it is # incorrect to simply use the first fitting match. However, to implement @@ -1041,17 +1041,17 @@ proc paramTypesMatch*(c: PContext, m: var TCandidate, f, a: PType, result = nil elif (y.state == csMatch) and (cmpCandidates(x, y) == 0): if x.state != csMatch: - InternalError(arg.info, "x.state is not csMatch") + internalError(arg.info, "x.state is not csMatch") # ambiguous: more than one symbol fits result = nil else: # only one valid interpretation found: markUsed(arg, arg.sons[best].sym) - result = ParamTypesMatchAux(c, m, f, arg.sons[best].typ, arg.sons[best], + result = paramTypesMatchAux(c, m, f, arg.sons[best].typ, arg.sons[best], argOrig) proc setSon(father: PNode, at: int, son: PNode) = - if sonsLen(father) <= at: setlen(father.sons, at + 1) + if sonsLen(father) <= at: setLen(father.sons, at + 1) father.sons[at] = son # we are allowed to modify the calling node in the 'prepare*' procs: @@ -1122,7 +1122,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode, # check if m.callee has such a param: prepareNamedParam(n.sons[a]) if n.sons[a].sons[0].kind != nkIdent: - LocalError(n.sons[a].info, errNamedParamHasToBeIdent) + localError(n.sons[a].info, errNamedParamHasToBeIdent) m.state = csNoMatch return formal = getSymFromList(m.callee.n, n.sons[a].sons[0].ident, 1) @@ -1130,15 +1130,15 @@ proc matchesAux(c: PContext, n, nOrig: PNode, # no error message! m.state = csNoMatch return - if ContainsOrIncl(marker, formal.position): + if containsOrIncl(marker, formal.position): # already in namedParams: - LocalError(n.sons[a].info, errCannotBindXTwice, formal.name.s) + localError(n.sons[a].info, errCannotBindXTwice, formal.name.s) m.state = csNoMatch return m.baseTypeMatch = false n.sons[a].sons[1] = prepareOperand(c, formal.typ, n.sons[a].sons[1]) n.sons[a].typ = n.sons[a].sons[1].typ - var arg = ParamTypesMatch(c, m, formal.typ, n.sons[a].typ, + var arg = paramTypesMatch(c, m, formal.typ, n.sons[a].typ, n.sons[a].sons[1], nOrig.sons[a].sons[1]) if arg == nil: m.state = csNoMatch @@ -1168,7 +1168,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode, elif formal != nil: m.baseTypeMatch = false n.sons[a] = prepareOperand(c, formal.typ, n.sons[a]) - var arg = ParamTypesMatch(c, m, formal.typ, n.sons[a].typ, + var arg = paramTypesMatch(c, m, formal.typ, n.sons[a].typ, n.sons[a], nOrig.sons[a]) if (arg != nil) and m.baseTypeMatch and (container != nil): addSon(container, arg) @@ -1181,7 +1181,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode, return else: if m.callee.n.sons[f].kind != nkSym: - InternalError(n.sons[a].info, "matches") + internalError(n.sons[a].info, "matches") return formal = m.callee.n.sons[f].sym if containsOrIncl(marker, formal.position): diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 4f31728149..888f958d07 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -48,15 +48,15 @@ proc symToStr(s: PSym, isLocal: bool, section: string, li: TLineInfo): string = result.add(sep) result.add(toFullPath(li)) result.add(sep) - result.add($ToLinenumber(li)) + result.add($toLinenumber(li)) result.add(sep) - result.add($ToColumn(li)) + result.add($toColumn(li)) result.add(sep) when not defined(noDocgen): result.add(s.extractDocComment.escape) proc symToStr(s: PSym, isLocal: bool, section: string): string = - result = SymToStr(s, isLocal, section, s.info) + result = symToStr(s, isLocal, section, s.info) proc filterSym(s: PSym): bool {.inline.} = result = s.name.s[0] in lexer.SymChars and s.kind != skModule @@ -68,7 +68,7 @@ proc fieldVisible*(c: PContext, f: PSym): bool {.inline.} = proc suggestField(c: PContext, s: PSym, outputs: var int) = if filterSym(s) and fieldVisible(c, s): - SuggestWriteln(SymToStr(s, isLocal=true, sectionSuggest)) + suggestWriteln(symToStr(s, isLocal=true, sectionSuggest)) inc outputs when not defined(nimhygiene): @@ -84,7 +84,7 @@ template wholeSymTab(cond, section: expr) {.immediate.} = for item in entries: let it {.inject.} = item if cond: - SuggestWriteln(SymToStr(it, isLocal = isLocal, section)) + suggestWriteln(symToStr(it, isLocal = isLocal, section)) inc outputs proc suggestSymList(c: PContext, list: PNode, outputs: var int) = @@ -144,7 +144,7 @@ proc suggestEverything(c: PContext, n: PNode, outputs: var int) = if scope == c.topLevelScope: isLocal = false for it in items(scope.symbols): if filterSym(it): - SuggestWriteln(SymToStr(it, isLocal = isLocal, sectionSuggest)) + suggestWriteln(symToStr(it, isLocal = isLocal, sectionSuggest)) inc outputs if scope == c.topLevelScope: break @@ -159,12 +159,12 @@ proc suggestFieldAccess(c: PContext, n: PNode, outputs: var int) = # all symbols accessible, because we are in the current module: for it in items(c.topLevelScope.symbols): if filterSym(it): - SuggestWriteln(SymToStr(it, isLocal=false, sectionSuggest)) + suggestWriteln(symToStr(it, isLocal=false, sectionSuggest)) inc outputs else: for it in items(n.sym.tab): if filterSym(it): - SuggestWriteln(SymToStr(it, isLocal=false, sectionSuggest)) + suggestWriteln(symToStr(it, isLocal=false, sectionSuggest)) inc outputs else: # fallback: @@ -246,16 +246,16 @@ var proc findUsages(node: PNode, s: PSym) = if usageSym == nil and isTracked(node.info, s.name.s.len): usageSym = s - SuggestWriteln(SymToStr(s, isLocal=false, sectionUsage)) + suggestWriteln(symToStr(s, isLocal=false, sectionUsage)) elif s == usageSym: if lastLineInfo != node.info: - SuggestWriteln(SymToStr(s, isLocal=false, sectionUsage, node.info)) + suggestWriteln(symToStr(s, isLocal=false, sectionUsage, node.info)) lastLineInfo = node.info proc findDefinition(node: PNode, s: PSym) = if isTracked(node.info, s.name.s.len): - SuggestWriteln(SymToStr(s, isLocal=false, sectionDef)) - SuggestQuit() + suggestWriteln(symToStr(s, isLocal=false, sectionDef)) + suggestQuit() type TSourceMap = object @@ -281,7 +281,7 @@ proc resetSourceMap*(fileIdx: int32) = ensureIdx(gSourceMaps, fileIdx) gSourceMaps[fileIdx].lines = @[] -proc addToSourceMap(sym: Psym, info: TLineInfo) = +proc addToSourceMap(sym: PSym, info: TLineInfo) = ensureIdx(gSourceMaps, info.fileIndex) ensureSeq(gSourceMaps[info.fileIndex].lines) ensureIdx(gSourceMaps[info.fileIndex].lines, info.line) @@ -302,7 +302,7 @@ proc defFromLine(entries: var seq[TEntry], col: int32) = # that the first expr that ends after the cursor column is # the one we are looking for. if e.pos >= col: - SuggestWriteln(SymToStr(e.sym, isLocal=false, sectionDef)) + suggestWriteln(symToStr(e.sym, isLocal=false, sectionDef)) return proc defFromSourceMap*(i: TLineInfo) = @@ -324,8 +324,8 @@ proc suggestSym*(n: PNode, s: PSym) {.inline.} = proc markUsed(n: PNode, s: PSym) = incl(s.flags, sfUsed) if {sfDeprecated, sfError} * s.flags != {}: - if sfDeprecated in s.flags: Message(n.info, warnDeprecated, s.name.s) - if sfError in s.flags: LocalError(n.info, errWrongSymbolX, s.name.s) + if sfDeprecated in s.flags: message(n.info, warnDeprecated, s.name.s) + if sfError in s.flags: localError(n.info, errWrongSymbolX, s.name.s) suggestSym(n, s) proc useSym*(sym: PSym): PNode = @@ -369,7 +369,7 @@ proc suggestExpr*(c: PContext, node: PNode) = suggestCall(c, a, n, outputs) dec(c.InCompilesContext) - if outputs > 0 and optUsages notin gGlobalOptions: SuggestQuit() + if outputs > 0 and optUsages notin gGlobalOptions: suggestQuit() proc suggestStmt*(c: PContext, n: PNode) = suggestExpr(c, n) diff --git a/compiler/syntaxes.nim b/compiler/syntaxes.nim index 6970f0c44f..3f2863c7ff 100644 --- a/compiler/syntaxes.nim +++ b/compiler/syntaxes.nim @@ -43,14 +43,14 @@ proc parseTopLevelStmt*(p: var TParsers): PNode proc parseFile(fileIdx: int32): PNode = var p: TParsers - f: tfile + f: TFile let filename = fileIdx.toFullPath if not open(f, filename): rawMessage(errCannotOpenFile, filename) return - OpenParsers(p, fileIdx, LLStreamOpen(f)) - result = ParseAll(p) - CloseParsers(p) + openParsers(p, fileIdx, llStreamOpen(f)) + result = parseAll(p) + closeParsers(p) proc parseAll(p: var TParsers): PNode = case p.skin @@ -59,7 +59,7 @@ proc parseAll(p: var TParsers): PNode = of skinBraces: result = pbraces.parseAll(p.parser) of skinEndX: - InternalError("parser to implement") + internalError("parser to implement") result = ast.emptyNode # skinEndX: result := pendx.parseAll(p.parser); @@ -70,7 +70,7 @@ proc parseTopLevelStmt(p: var TParsers): PNode = of skinBraces: result = pbraces.parseTopLevelStmt(p.parser) of skinEndX: - InternalError("parser to implement") + internalError("parser to implement") result = ast.emptyNode #skinEndX: result := pendx.parseTopLevelStmt(p.parser); @@ -88,22 +88,22 @@ proc containsShebang(s: string, i: int): bool = proc parsePipe(filename: string, inputStream: PLLStream): PNode = result = ast.emptyNode - var s = LLStreamOpen(filename, fmRead) + var s = llStreamOpen(filename, fmRead) if s != nil: var line = newStringOfCap(80) - discard LLStreamReadLine(s, line) + discard llStreamReadLine(s, line) var i = utf8Bom(line) if containsShebang(line, i): - discard LLStreamReadLine(s, line) + discard llStreamReadLine(s, line) i = 0 if line[i] == '#' and line[i+1] == '!': inc(i, 2) while line[i] in WhiteSpace: inc(i) var q: TParser - openParser(q, filename, LLStreamOpen(substr(line, i))) + openParser(q, filename, llStreamOpen(substr(line, i))) result = parser.parseAll(q) closeParser(q) - LLStreamClose(s) + llStreamClose(s) proc getFilter(ident: PIdent): TFilterKind = for i in countup(low(TFilterKind), high(TFilterKind)): @@ -165,9 +165,9 @@ proc openParsers(p: var TParsers, fileIdx: int32, inputstream: PLLStream) = var s: PLLStream p.skin = skinStandard let filename = fileIdx.toFullPath - var pipe = parsePipe(filename, inputStream) - if pipe != nil: s = evalPipe(p, pipe, filename, inputStream) - else: s = inputStream + var pipe = parsePipe(filename, inputstream) + if pipe != nil: s = evalPipe(p, pipe, filename, inputstream) + else: s = inputstream case p.skin of skinStandard, skinBraces, skinEndX: parser.openParser(p.parser, fileIdx, s) diff --git a/compiler/transf.nim b/compiler/transf.nim index d6f54eddb4..ea9036f1f1 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -88,7 +88,7 @@ proc pushTransCon(c: PTransf, t: PTransCon) = c.transCon = t proc popTransCon(c: PTransf) = - if (c.transCon == nil): InternalError("popTransCon") + if (c.transCon == nil): internalError("popTransCon") c.transCon = c.transCon.next proc getCurrOwner(c: PTransf): PSym = @@ -126,7 +126,7 @@ proc transformSymAux(c: PTransf, n: PNode): PNode = else: b = n while tc != nil: - result = IdNodeTableGet(tc.mapping, b.sym) + result = idNodeTableGet(tc.mapping, b.sym) if result != nil: return tc = tc.next result = b @@ -141,14 +141,14 @@ proc transformVarSection(c: PTransf, v: PNode): PTransNode = if it.kind == nkCommentStmt: result[i] = PTransNode(it) elif it.kind == nkIdentDefs: - if it.sons[0].kind != nkSym: InternalError(it.info, "transformVarSection") + if it.sons[0].kind != nkSym: internalError(it.info, "transformVarSection") InternalAssert(it.len == 3) var newVar = copySym(it.sons[0].sym) incl(newVar.flags, sfFromGeneric) # fixes a strange bug for rodgen: #include(it.sons[0].sym.flags, sfFromGeneric); newVar.owner = getCurrOwner(c) - IdNodeTablePut(c.transCon.mapping, it.sons[0].sym, newSymNode(newVar)) + idNodeTablePut(c.transCon.mapping, it.sons[0].sym, newSymNode(newVar)) var defs = newTransNode(nkIdentDefs, it.info, 3) if importantComments(): # keep documentation information: @@ -159,14 +159,14 @@ proc transformVarSection(c: PTransf, v: PNode): PTransNode = result[i] = defs else: if it.kind != nkVarTuple: - InternalError(it.info, "transformVarSection: not nkVarTuple") + internalError(it.info, "transformVarSection: not nkVarTuple") var L = sonsLen(it) var defs = newTransNode(it.kind, it.info, L) for j in countup(0, L-3): var newVar = copySym(it.sons[j].sym) incl(newVar.flags, sfFromGeneric) newVar.owner = getCurrOwner(c) - IdNodeTablePut(c.transCon.mapping, it.sons[j].sym, newSymNode(newVar)) + idNodeTablePut(c.transCon.mapping, it.sons[j].sym, newSymNode(newVar)) defs[j] = newSymNode(newVar).PTransNode assert(it.sons[L-2].kind == nkEmpty) defs[L-1] = transform(c, it.sons[L-1]) @@ -179,9 +179,9 @@ proc transformConstSection(c: PTransf, v: PNode): PTransNode = if it.kind == nkCommentStmt: result[i] = PTransNode(it) else: - if it.kind != nkConstDef: InternalError(it.info, "transformConstSection") + if it.kind != nkConstDef: internalError(it.info, "transformConstSection") if it.sons[0].kind != nkSym: - InternalError(it.info, "transformConstSection") + internalError(it.info, "transformConstSection") if sfFakeConst in it[0].sym.flags: var b = newNodeI(nkConstDef, it.info) addSon(b, it[0]) @@ -429,7 +429,7 @@ proc findWrongOwners(c: PTransf, n: PNode) = proc transformFor(c: PTransf, n: PNode): PTransNode = # generate access statements for the parameters (unless they are constant) # put mapping from formal parameters to actual parameters - if n.kind != nkForStmt: InternalError(n.info, "transformFor") + if n.kind != nkForStmt: internalError(n.info, "transformFor") var length = sonsLen(n) var call = n.sons[length - 2] @@ -454,7 +454,7 @@ proc transformFor(c: PTransf, n: PNode): PTransNode = var newC = newTransCon(getCurrOwner(c)) newC.forStmt = n newC.forLoopBody = loopBody - if iter.kind != skIterator: InternalError(call.info, "transformFor") + if iter.kind != skIterator: internalError(call.info, "transformFor") # generate access statements for the parameters (unless they are constant) pushTransCon(c, newC) for i in countup(1, sonsLen(call) - 1): @@ -462,16 +462,16 @@ proc transformFor(c: PTransf, n: PNode): PTransNode = var formal = skipTypes(iter.typ, abstractInst).n.sons[i].sym case putArgInto(arg, formal.typ) of paDirectMapping: - IdNodeTablePut(newC.mapping, formal, arg) + idNodeTablePut(newC.mapping, formal, arg) of paFastAsgn: # generate a temporary and produce an assignment statement: var temp = newTemp(c, formal.typ, formal.info) addVar(v, newSymNode(temp)) add(result, newAsgnStmt(c, newSymNode(temp), arg.ptransNode)) - IdNodeTablePut(newC.mapping, formal, newSymNode(temp)) + idNodeTablePut(newC.mapping, formal, newSymNode(temp)) of paVarAsgn: assert(skipTypes(formal.typ, abstractInst).kind == tyVar) - IdNodeTablePut(newC.mapping, formal, arg) + idNodeTablePut(newC.mapping, formal, arg) # XXX BUG still not correct if the arg has a side effect! var body = iter.getBody pushInfoContext(n.info) diff --git a/compiler/treetab.nim b/compiler/treetab.nim index d28dcd2367..cccb1096ad 100644 --- a/compiler/treetab.nim +++ b/compiler/treetab.nim @@ -77,7 +77,7 @@ proc nodeTableRawInsert(data: var TNodePairSeq, k: THash, key: PNode, proc nodeTablePut*(t: var TNodeTable, key: PNode, val: int) = var n: TNodePairSeq var k: THash = hashTree(key) - var index = NodeTableRawGet(t, k, key) + var index = nodeTableRawGet(t, k, key) if index >= 0: assert(t.data[index].key != nil) t.data[index].val = val diff --git a/compiler/types.nim b/compiler/types.nim index 3d040fdd5d..5870ccacd8 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -12,9 +12,9 @@ import intsets, ast, astalgo, trees, msgs, strutils, platform -proc firstOrd*(t: PType): biggestInt -proc lastOrd*(t: PType): biggestInt -proc lengthOrd*(t: PType): biggestInt +proc firstOrd*(t: PType): BiggestInt +proc lastOrd*(t: PType): BiggestInt +proc lengthOrd*(t: PType): BiggestInt type TPreferedDesc* = enum preferName, preferDesc, preferExported @@ -70,9 +70,9 @@ proc containsGarbageCollectedRef*(typ: PType): bool proc containsHiddenPointer*(typ: PType): bool proc canFormAcycle*(typ: PType): bool proc isCompatibleToCString*(a: PType): bool -proc getOrdValue*(n: PNode): biggestInt -proc computeSize*(typ: PType): biggestInt -proc getSize*(typ: PType): biggestInt +proc getOrdValue*(n: PNode): BiggestInt +proc computeSize*(typ: PType): BiggestInt +proc getSize*(typ: PType): BiggestInt proc isPureObject*(typ: PType): bool proc invalidGenericInst*(f: PType): bool # for debugging @@ -103,7 +103,7 @@ proc getOrdValue(n: PNode): biggestInt = of nkNilLit: result = 0 of nkHiddenStdConv: result = getOrdValue(n.sons[1]) else: - LocalError(n.info, errOrdinalTypeExpected) + localError(n.info, errOrdinalTypeExpected) result = 0 proc isIntLit*(t: PType): bool {.inline.} = @@ -184,7 +184,7 @@ proc iterOverTypeAux(marker: var TIntSet, t: PType, iter: TTypeIter, if t == nil: return result = iter(t, closure) if result: return - if not ContainsOrIncl(marker, t.id): + if not containsOrIncl(marker, t.id): case t.kind of tyGenericInst, tyGenericBody: result = iterOverTypeAux(marker, lastSon(t), iter, closure) @@ -195,7 +195,7 @@ proc iterOverTypeAux(marker: var TIntSet, t: PType, iter: TTypeIter, if t.n != nil: result = iterOverNode(marker, t.n, iter, closure) proc iterOverType(t: PType, iter: TTypeIter, closure: PObject): bool = - var marker = InitIntSet() + var marker = initIntSet() result = iterOverTypeAux(marker, t, iter, closure) proc searchTypeForAux(t: PType, predicate: TTypePredicate, @@ -228,8 +228,8 @@ proc searchTypeForAux(t: PType, predicate: TTypePredicate, # iterates over VALUE types! result = false if t == nil: return - if ContainsOrIncl(marker, t.id): return - result = Predicate(t) + if containsOrIncl(marker, t.id): return + result = predicate(t) if result: return case t.kind of tyObject: @@ -245,7 +245,7 @@ proc searchTypeForAux(t: PType, predicate: TTypePredicate, discard proc searchTypeFor(t: PType, predicate: TTypePredicate): bool = - var marker = InitIntSet() + var marker = initIntSet() result = searchTypeForAux(t, predicate, marker) proc isObjectPredicate(t: PType): bool = @@ -287,7 +287,7 @@ proc analyseObjectWithTypeFieldAux(t: PType, discard proc analyseObjectWithTypeField(t: PType): TTypeFieldResult = - var marker = InitIntSet() + var marker = initIntSet() result = analyseObjectWithTypeFieldAux(t, marker) proc isGCRef(t: PType): bool = @@ -337,7 +337,7 @@ proc canFormAcycleAux(marker: var TIntSet, typ: PType, startId: int): bool = case t.kind of tyTuple, tyObject, tyRef, tySequence, tyArray, tyArrayConstr, tyOpenArray, tyVarargs: - if not ContainsOrIncl(marker, t.id): + if not containsOrIncl(marker, t.id): for i in countup(0, sonsLen(t) - 1): result = canFormAcycleAux(marker, t.sons[i], startId) if result: return @@ -353,7 +353,7 @@ proc canFormAcycleAux(marker: var TIntSet, typ: PType, startId: int): bool = else: nil proc canFormAcycle(typ: PType): bool = - var marker = InitIntSet() + var marker = initIntSet() result = canFormAcycleAux(marker, typ, typ.id) proc mutateTypeAux(marker: var TIntSet, t: PType, iter: TTypeMutator, @@ -377,14 +377,14 @@ proc mutateTypeAux(marker: var TIntSet, t: PType, iter: TTypeMutator, result = nil if t == nil: return result = iter(t, closure) - if not ContainsOrIncl(marker, t.id): + if not containsOrIncl(marker, t.id): for i in countup(0, sonsLen(t) - 1): result.sons[i] = mutateTypeAux(marker, result.sons[i], iter, closure) if t.n != nil: result.n = mutateNode(marker, t.n, iter, closure) assert(result != nil) proc mutateType(t: PType, iter: TTypeMutator, closure: PObject): PType = - var marker = InitIntSet() + var marker = initIntSet() result = mutateTypeAux(marker, t, iter, closure) proc valueToString(a: PNode): string = @@ -396,7 +396,7 @@ proc valueToString(a: PNode): string = proc rangeToStr(n: PNode): string = assert(n.kind == nkRange) - result = ValueToString(n.sons[0]) & ".." & ValueToString(n.sons[1]) + result = valueToString(n.sons[0]) & ".." & valueToString(n.sons[1]) const typeToStr: array[TTypeKind, string] = ["None", "bool", "Char", "empty", @@ -501,7 +501,7 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = add(result, typeToString(t.sons[i])) if i < sonsLen(t) - 1: add(result, ", ") add(result, ')') - if t.sons[0] != nil: add(result, ": " & TypeToString(t.sons[0])) + if t.sons[0] != nil: add(result, ": " & typeToString(t.sons[0])) var prag: string if t.callConv != ccDefault: prag = CallingConvToStr[t.callConv] else: prag = "" @@ -625,9 +625,9 @@ proc initSameTypeClosure: TSameTypeClosure = discard proc containsOrIncl(c: var TSameTypeClosure, a, b: PType): bool = - result = not IsNil(c.s) and c.s.contains((a.id, b.id)) + result = not isNil(c.s) and c.s.contains((a.id, b.id)) if not result: - if IsNil(c.s): c.s = @[] + if isNil(c.s): c.s = @[] c.s.add((a.id, b.id)) proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool @@ -636,7 +636,7 @@ proc sameTypeOrNilAux(a, b: PType, c: var TSameTypeClosure): bool = result = true else: if a == nil or b == nil: result = false - else: result = SameTypeAux(a, b, c) + else: result = sameTypeAux(a, b, c) proc sameTypeOrNil*(a, b: PType, flags: TTypeCmpFlags = {}): bool = if a == b: @@ -646,15 +646,15 @@ proc sameTypeOrNil*(a, b: PType, flags: TTypeCmpFlags = {}): bool = else: var c = initSameTypeClosure() c.flags = flags - result = SameTypeAux(a, b, c) + result = sameTypeAux(a, b, c) proc equalParam(a, b: PSym): TParamsEquality = - if SameTypeOrNil(a.typ, b.typ, {TypeDescExactMatch}) and - ExprStructuralEquivalent(a.constraint, b.constraint): + if sameTypeOrNil(a.typ, b.typ, {TypeDescExactMatch}) and + exprStructuralEquivalent(a.constraint, b.constraint): if a.ast == b.ast: result = paramsEqual elif a.ast != nil and b.ast != nil: - if ExprStructuralEquivalent(a.ast, b.ast): result = paramsEqual + if exprStructuralEquivalent(a.ast, b.ast): result = paramsEqual else: result = paramsIncompatible elif a.ast != nil: result = paramsEqual @@ -685,7 +685,7 @@ proc equalParams(a, b: PNode): TParamsEquality = return paramsNotEqual # paramsIncompatible; # continue traversal! If not equal, we can return immediately; else # it stays incompatible - if not SameTypeOrNil(a.sons[0].typ, b.sons[0].typ, {TypeDescExactMatch}): + if not sameTypeOrNil(a.sons[0].typ, b.sons[0].typ, {TypeDescExactMatch}): if (a.sons[0].typ == nil) or (b.sons[0].typ == nil): result = paramsNotEqual # one proc has a result, the other not is OK else: @@ -701,8 +701,8 @@ proc sameLiteral(x, y: PNode): bool = else: assert(false) proc sameRanges(a, b: PNode): bool = - result = SameLiteral(a.sons[0], b.sons[0]) and - SameLiteral(a.sons[1], b.sons[1]) + result = sameLiteral(a.sons[0], b.sons[0]) and + sameLiteral(a.sons[1], b.sons[1]) proc sameTuple(a, b: PType, c: var TSameTypeClosure): bool = # two tuples are equivalent iff the names, types and positions are the same; @@ -717,7 +717,7 @@ proc sameTuple(a, b: PType, c: var TSameTypeClosure): bool = x = skipTypes(x, {tyRange}) y = skipTypes(y, {tyRange}) - result = SameTypeAux(x, y, c) + result = sameTypeAux(x, y, c) if not result: return if a.n != nil and b.n != nil and IgnoreTupleFields notin c.flags: for i in countup(0, sonsLen(a.n) - 1): @@ -727,12 +727,12 @@ proc sameTuple(a, b: PType, c: var TSameTypeClosure): bool = var y = b.n.sons[i].sym result = x.name.id == y.name.id if not result: break - else: InternalError(a.n.info, "sameTuple") + else: internalError(a.n.info, "sameTuple") else: result = false template ifFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} = - if tfFromGeneric notin a.flags + b.flags: + if tfFromGeneric not_in a.flags + b.flags: # fast case: id comparison suffices: result = a.id == b.id else: @@ -966,7 +966,7 @@ proc matchType*(a: PType, pattern: openArray[tuple[k:TTypeKind, i:int]], var a = a for k, i in pattern.items: if a.kind != k: return false - if i >= a.sonslen or a.sons[i] == nil: return false + if i >= a.sonsLen or a.sons[i] == nil: return false a = a.sons[i] result = a.kind == last @@ -986,7 +986,7 @@ proc matchTypeClass*(bindings: var TIdTable, typeClass, t: PType): bool = of tyGenericBody: if t.kind == tyGenericInst and t.sons[0] == req: match = true - IdTablePut(bindings, typeClass, t) + idTablePut(bindings, typeClass, t) of tyTypeClass: match = matchTypeClass(bindings, req, t) elif t.kind == tyTypeClass: @@ -1005,7 +1005,7 @@ proc matchTypeClass*(bindings: var TIdTable, typeClass, t: PType): bool = # or none of them matched. result = if tfAny in typeClass.flags: false else: true if result == true: - IdTablePut(bindings, typeClass, t) + idTablePut(bindings, typeClass, t) proc matchTypeClass*(typeClass, typ: PType): bool = var bindings: TIdTable @@ -1019,7 +1019,7 @@ proc typeAllowedAux(marker: var TIntSet, typ: PType, kind: TSymKind, # evaluation if something is wrong: result = true if typ == nil: return - if ContainsOrIncl(marker, typ.id): return + if containsOrIncl(marker, typ.id): return var t = skipTypes(typ, abstractInst-{tyTypeDesc}) case t.kind of tyVar: @@ -1089,15 +1089,15 @@ proc typeAllowedAux(marker: var TIntSet, typ: PType, kind: TSymKind, result = true proc typeAllowed(t: PType, kind: TSymKind): bool = - var marker = InitIntSet() + var marker = initIntSet() result = typeAllowedAux(marker, t, kind, {}) -proc align(address, alignment: biggestInt): biggestInt = +proc align(address, alignment: BiggestInt): BiggestInt = result = (address + (alignment - 1)) and not (alignment - 1) -proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt -proc computeRecSizeAux(n: PNode, a, currOffset: var biggestInt): biggestInt = - var maxAlign, maxSize, b, res: biggestInt +proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt +proc computeRecSizeAux(n: PNode, a, currOffset: var BiggestInt): BiggestInt = + var maxAlign, maxSize, b, res: BiggestInt case n.kind of nkRecCase: assert(n.sons[0].kind == nkSym) @@ -1129,12 +1129,12 @@ proc computeRecSizeAux(n: PNode, a, currOffset: var biggestInt): biggestInt = result = computeSizeAux(n.sym.typ, a) n.sym.offset = int(currOffset) else: - InternalError("computeRecSizeAux()") + internalError("computeRecSizeAux()") a = 1 result = - 1 proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = - var res, maxAlign, length, currOffset: biggestInt + var res, maxAlign, length, currOffset: BiggestInt if typ.size == - 2: # we are already computing the size of the type # --> illegal recursion in type @@ -1147,7 +1147,7 @@ proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = typ.size = - 2 # mark as being computed case typ.kind of tyInt, tyUInt: - result = IntSize + result = intSize a = result of tyInt8, tyUInt8, tyBool, tyChar: result = 1 @@ -1236,7 +1236,7 @@ proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = typ.align = int(a) proc computeSize(typ: PType): biggestInt = - var a: biggestInt = 1 + var a: BiggestInt = 1 result = computeSizeAux(typ, a) proc getReturnType*(s: PSym): PType = @@ -1246,7 +1246,7 @@ proc getReturnType*(s: PSym): PType = proc getSize(typ: PType): biggestInt = result = computeSize(typ) - if result < 0: InternalError("getSize: " & $typ.kind) + if result < 0: internalError("getSize: " & $typ.kind) proc containsGenericTypeIter(t: PType, closure: PObject): bool = @@ -1300,7 +1300,7 @@ proc compatibleEffects*(formal, actual: PType): bool = # if 'se.kind == nkArgList' it is no formal type really, but a # computed effect and as such no spec: # 'r.msgHandler = if isNil(msgHandler): defaultMsgHandler else: msgHandler' - if not IsNil(se) and se.kind != nkArgList: + if not isNil(se) and se.kind != nkArgList: # spec requires some exception or tag, but we don't know anything: if real.len == 0: return false result = compatibleEffectsAux(se, real.sons[exceptionEffects]) diff --git a/compiler/vm.nim b/compiler/vm.nim index a89ad74bdf..3d76638bc4 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -40,7 +40,7 @@ proc stackTraceAux(c: PCtx; x: PStackFrame; pc: int) = var info = c.debug[pc] # we now use the same format as in system/except.nim var s = toFilename(info) - var line = toLineNumber(info) + var line = toLinenumber(info) if line > 0: add(s, '(') add(s, $line) @@ -48,7 +48,7 @@ proc stackTraceAux(c: PCtx; x: PStackFrame; pc: int) = if x.prc != nil: for k in 1..max(1, 25-s.len): add(s, ' ') add(s, x.prc.name.s) - MsgWriteln(s) + msgWriteln(s) proc stackTrace(c: PCtx, tos: PStackFrame, pc: int, msg: TMsgKind, arg = "") = @@ -716,7 +716,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcFinallyEnd: if c.currentExceptionA != nil: # we are in a cleanup run: - pc = cleanupOnException(c, tos, regs)-1 + pc = cleanUpOnException(c, tos, regs)-1 if pc < 0: bailOut(c, tos) return @@ -725,7 +725,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = c.currentExceptionA = raised c.exceptionInstr = pc # -1 because of the following 'inc' - pc = cleanupOnException(c, tos, regs) - 1 + pc = cleanUpOnException(c, tos, regs) - 1 if pc < 0: bailOut(c, tos) return @@ -776,7 +776,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra].strVal = renderTree(regs[rb].skipMeta, {renderNoComments}) of opcQuit: if c.mode in {emRepl, emStaticExpr, emStaticStmt}: - Message(c.debug[pc], hintQuitCalled) + message(c.debug[pc], hintQuitCalled) quit(int(getOrdValue(regs[ra]))) else: return nil @@ -866,7 +866,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = else: stackTrace(c, tos, pc, errFieldXNotFound, "ident") of opcNGetType: - InternalError(c.debug[pc], "unknown opcode " & $instr.opcode) + internalError(c.debug[pc], "unknown opcode " & $instr.opcode) of opcNStrVal: decodeB(nkStrLit) let a = regs[rb].uast @@ -882,16 +882,16 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcNError: stackTrace(c, tos, pc, errUser, regs[ra].strVal) of opcNWarning: - Message(c.debug[pc], warnUser, regs[ra].strVal) + message(c.debug[pc], warnUser, regs[ra].strVal) of opcNHint: - Message(c.debug[pc], hintUser, regs[ra].strVal) + message(c.debug[pc], hintUser, regs[ra].strVal) of opcParseExprToAst: decodeB(nkMetaNode) # c.debug[pc].line.int - countLines(regs[rb].strVal) ? let ast = parseString(regs[rb].strVal, c.debug[pc].toFilename, c.debug[pc].line.int) if sonsLen(ast) != 1: - GlobalError(c.debug[pc], errExprExpected, "multiple statements") + globalError(c.debug[pc], errExprExpected, "multiple statements") setMeta(regs[ra], ast.sons[0]) of opcParseStmtToAst: decodeB(nkMetaNode) @@ -1137,7 +1137,7 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = # XXX GlobalError() is ugly here, but I don't know a better solution for now inc(evalMacroCounter) if evalMacroCounter > 100: - GlobalError(n.info, errTemplateInstantiationTooNested) + globalError(n.info, errTemplateInstantiationTooNested) setupGlobalCtx(module) var c = globalCtx @@ -1161,7 +1161,7 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = # temporary storage: for i in L .. <maxSlots: tos.slots[i] = newNode(nkEmpty) result = rawExecute(c, start, tos) - if cyclicTree(result): GlobalError(n.info, errCyclicTree) + if cyclicTree(result): globalError(n.info, errCyclicTree) dec(evalMacroCounter) if result != nil: result = result.skipMeta diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim index 07100897b2..0e01f50313 100644 --- a/compiler/vmdeps.nim +++ b/compiler/vmdeps.nim @@ -25,12 +25,12 @@ proc opGorge*(cmd, input: string): string = proc opSlurp*(file: string, info: TLineInfo, module: PSym): string = try: - let filename = file.FindFile + let filename = file.findFile result = readFile(filename) # we produce a fake include statement for every slurped filename, so that # the module dependencies are accurate: appendToModule(module, newNode(nkIncludeStmt, info, @[ newStrNode(nkStrLit, filename)])) except EIO: - LocalError(info, errCannotOpenFile, file) + localError(info, errCannotOpenFile, file) result = "" diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index d9cbb15144..f686f10c29 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -61,7 +61,7 @@ proc gABC(ctx: PCtx; n: PNode; opc: TOpcode; a, b, c: TRegister = 0) = ctx.code.add(ins) ctx.debug.add(n.info) -proc gABI(c: PCtx; n: PNode; opc: TOpcode; a, b: TRegister; imm: biggestInt) = +proc gABI(c: PCtx; n: PNode; opc: TOpcode; a, b: TRegister; imm: BiggestInt) = let ins = (opc.uint32 or (a.uint32 shl 8'u32) or (b.uint32 shl 16'u32) or (imm+byteExcess).uint32 shl 24'u32).TInstr @@ -166,7 +166,7 @@ proc getTempRange(c: PCtx; n: int; kind: TSlotKind): TRegister = for k in result .. result+n-1: c.slots[k] = (inUse: true, kind: kind) return if c.maxSlots+n >= high(TRegister): - InternalError("cannot generate code; too many registers required") + internalError("cannot generate code; too many registers required") result = TRegister(c.maxSlots) inc c.maxSlots, n for k in result .. result+n-1: c.slots[k] = (inUse: true, kind: kind) @@ -257,7 +257,7 @@ proc genBreak(c: PCtx; n: PNode) = if c.prc.blocks[i].label == n.sons[0].sym: c.prc.blocks[i].fixups.add L1 return - InternalError(n.info, "cannot find 'break' target") + internalError(n.info, "cannot find 'break' target") else: c.prc.blocks[c.prc.blocks.high].fixups.add L1 @@ -338,7 +338,7 @@ proc genLiteral(c: PCtx; n: PNode): int = proc unused(n: PNode; x: TDest) {.inline.} = if x >= 0: #debug(n) - InternalError(n.info, "not unused") + internalError(n.info, "not unused") proc genCase(c: PCtx; n: PNode; dest: var TDest) = # if (!expr1) goto L1; @@ -709,7 +709,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = c.freeTemp(tmp) c.freeTemp(idx) of mSizeOf: - GlobalError(n.info, errCannotInterpretNodeX, renderTree(n)) + globalError(n.info, errCannotInterpretNodeX, renderTree(n)) of mHigh: if dest < 0: dest = c.getTemp(n.typ) let tmp = c.genx(n.sons[1]) @@ -828,7 +828,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = globalError(n.info, "expandToAst requires a call expression") else: # mGCref, mGCunref, - InternalError(n.info, "cannot generate code for: " & $m) + internalError(n.info, "cannot generate code for: " & $m) const atomicTypes = {tyBool, tyChar, @@ -1027,7 +1027,7 @@ proc getNullValueAux(obj: PNode, result: PNode) = getNullValueAux(lastSon(obj.sons[i]), result) of nkSym: addSon(result, getNullValue(obj.sym.typ, result.info)) - else: InternalError(result.info, "getNullValueAux") + else: internalError(result.info, "getNullValueAux") proc getNullValue(typ: PType, info: TLineInfo): PNode = var t = skipTypes(typ, abstractRange-{tyTypeDesc}) @@ -1038,7 +1038,7 @@ proc getNullValue(typ: PType, info: TLineInfo): PNode = of tyUInt..tyUInt64: result = newNodeIT(nkUIntLit, info, t) of tyFloat..tyFloat128: - result = newNodeIt(nkFloatLit, info, t) + result = newNodeIT(nkFloatLit, info, t) of tyVar, tyPointer, tyPtr, tyCString, tySequence, tyString, tyExpr, tyStmt, tyTypeDesc, tyRef: result = newNodeIT(nkNilLit, info, t) @@ -1067,7 +1067,7 @@ proc getNullValue(typ: PType, info: TLineInfo): PNode = addSon(result, getNullValue(t.sons[i], info)) of tySet: result = newNodeIT(nkCurly, info, t) - else: InternalError("getNullValue: " & $t.kind) + else: internalError("getNullValue: " & $t.kind) proc setSlot(c: PCtx; v: PSym) = # XXX generate type initialization here? @@ -1214,13 +1214,13 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = of skField: InternalAssert dest < 0 if s.position > high(dest): - InternalError(n.info, + internalError(n.info, "too large offset! cannot generate code for: " & s.name.s) dest = s.position of skType: genTypeLit(c, s.typ, dest) else: - InternalError(n.info, "cannot generate code for: " & s.name.s) + internalError(n.info, "cannot generate code for: " & s.name.s) of nkCallKinds: if n.sons[0].kind == nkSym and n.sons[0].sym.magic != mNone: genMagic(c, n, dest) @@ -1309,7 +1309,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = else: localError(n.info, errGenerated, "VM is not allowed to 'cast'") else: - InternalError n.info, "too implement " & $n.kind + internalError n.info, "too implement " & $n.kind proc removeLastEof(c: PCtx) = let last = c.code.len-1 diff --git a/compiler/wordrecg.nim b/compiler/wordrecg.nim index 5f0e5be949..837bb4f50f 100644 --- a/compiler/wordrecg.nim +++ b/compiler/wordrecg.nim @@ -166,7 +166,7 @@ const "inout", "bycopy", "byref", "oneway", ] -proc findStr*(a: openarray[string], s: string): int = +proc findStr*(a: openArray[string], s: string): int = for i in countup(low(a), high(a)): if cmpIgnoreStyle(a[i], s) == 0: return i @@ -176,7 +176,7 @@ proc whichKeyword*(id: PIdent): TSpecialWord = if id.id < 0: result = wInvalid else: result = TSpecialWord(id.id) -proc whichKeyword*(id: String): TSpecialWord = +proc whichKeyword*(id: string): TSpecialWord = result = whichKeyword(getIdent(id)) proc initSpecials() = diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim index 4bfdf5e58a..737780a122 100644 --- a/lib/packages/docutils/highlite.nim +++ b/lib/packages/docutils/highlite.nim @@ -321,7 +321,7 @@ proc generalStrLit(g: var TGeneralTokenizer, position: int): int = inc(pos) result = pos -proc isKeyword(x: openarray[string], y: string): int = +proc isKeyword(x: openArray[string], y: string): int = var a = 0 var b = len(x) - 1 while a <= b: @@ -335,7 +335,7 @@ proc isKeyword(x: openarray[string], y: string): int = return mid result = - 1 -proc isKeywordIgnoreCase(x: openarray[string], y: string): int = +proc isKeywordIgnoreCase(x: openArray[string], y: string): int = var a = 0 var b = len(x) - 1 while a <= b: @@ -354,7 +354,7 @@ type hasPreprocessor, hasNestedComments TTokenizerFlags = set[TTokenizerFlag] -proc clikeNextToken(g: var TGeneralTokenizer, keywords: openarray[string], +proc clikeNextToken(g: var TGeneralTokenizer, keywords: openArray[string], flags: TTokenizerFlags) = const hexChars = {'0'..'9', 'A'..'F', 'a'..'f'} diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index 6dd407155c..316476ce0c 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -58,10 +58,10 @@ const mwUnsupportedLanguage: "language '$1' not supported" ] -proc rstnodeToRefname*(n: PRstNode): string -proc addNodes*(n: PRstNode): string -proc getFieldValue*(n: PRstNode, fieldname: string): string -proc getArgument*(n: PRstNode): string +proc rstnodeToRefname*(n: PRSTNode): string +proc addNodes*(n: PRSTNode): string +proc getFieldValue*(n: PRSTNode, fieldname: string): string +proc getArgument*(n: PRSTNode): string # ----------------------------- scanner part -------------------------------- @@ -242,7 +242,7 @@ proc getTokens(buffer: string, skipPounds: bool, tokens: var TTokenSeq): int = inc(result) while true: inc(length) - setlen(tokens, length) + setLen(tokens, length) rawGetTok(L, tokens[length - 1]) if tokens[length - 1].kind == tkEof: break if tokens[0].kind == tkWhite: @@ -254,7 +254,7 @@ type TLevelMap = array[Char, int] TSubstitution{.final.} = object key*: string - value*: PRstNode + value*: PRSTNode TSharedState {.final.} = object options: TRstParseOptions # parsing options @@ -294,11 +294,11 @@ proc whichMsgClass*(k: TMsgKind): TMsgClass = proc defaultMsgHandler*(filename: string, line, col: int, msgkind: TMsgKind, arg: string) {.procvar.} = - let mc = msgKind.whichMsgClass - let a = messages[msgKind] % arg + let mc = msgkind.whichMsgClass + let a = messages[msgkind] % arg let message = "$1($2, $3) $4: $5" % [filename, $line, $col, $mc, a] if mc == mcError: raise newException(EParseError, message) - else: Writeln(stdout, message) + else: writeln(stdout, message) proc defaultFindFile*(filename: string): string {.procvar.} = if existsFile(filename): result = filename @@ -339,7 +339,7 @@ proc pushInd(p: var TRstParser, ind: int) = add(p.indentStack, ind) proc popInd(p: var TRstParser) = - if len(p.indentStack) > 1: setlen(p.indentStack, len(p.indentStack) - 1) + if len(p.indentStack) > 1: setLen(p.indentStack, len(p.indentStack) - 1) proc initParser(p: var TRstParser, sharedState: PSharedState) = p.indentStack = @[0] @@ -351,7 +351,7 @@ proc initParser(p: var TRstParser, sharedState: PSharedState) = p.line = 1 p.s = sharedState -proc addNodesAux(n: PRstNode, result: var string) = +proc addNodesAux(n: PRSTNode, result: var string) = if n.kind == rnLeaf: add(result, n.text) else: @@ -361,7 +361,7 @@ proc addNodes(n: PRstNode): string = result = "" addNodesAux(n, result) -proc rstnodeToRefnameAux(n: PRstNode, r: var string, b: var bool) = +proc rstnodeToRefnameAux(n: PRSTNode, r: var string, b: var bool) = if n.kind == rnLeaf: for i in countup(0, len(n.text) - 1): case n.text[i] @@ -391,7 +391,7 @@ proc rstnodeToRefname(n: PRstNode): string = var b = false rstnodeToRefnameAux(n, result, b) -proc findSub(p: var TRstParser, n: PRstNode): int = +proc findSub(p: var TRstParser, n: PRSTNode): int = var key = addNodes(n) # the spec says: if no exact match, try one without case distinction: for i in countup(0, high(p.s.subs)): @@ -402,17 +402,17 @@ proc findSub(p: var TRstParser, n: PRstNode): int = return i result = -1 -proc setSub(p: var TRstParser, key: string, value: PRstNode) = +proc setSub(p: var TRstParser, key: string, value: PRSTNode) = var length = len(p.s.subs) for i in countup(0, length - 1): if key == p.s.subs[i].key: p.s.subs[i].value = value return - setlen(p.s.subs, length + 1) + setLen(p.s.subs, length + 1) p.s.subs[length].key = key p.s.subs[length].value = value -proc setRef(p: var TRstParser, key: string, value: PRstNode) = +proc setRef(p: var TRstParser, key: string, value: PRSTNode) = var length = len(p.s.refs) for i in countup(0, length - 1): if key == p.s.refs[i].key: @@ -421,19 +421,19 @@ proc setRef(p: var TRstParser, key: string, value: PRstNode) = p.s.refs[i].value = value return - setlen(p.s.refs, length + 1) + setLen(p.s.refs, length + 1) p.s.refs[length].key = key p.s.refs[length].value = value -proc findRef(p: var TRstParser, key: string): PRstNode = +proc findRef(p: var TRstParser, key: string): PRSTNode = for i in countup(0, high(p.s.refs)): if key == p.s.refs[i].key: return p.s.refs[i].value -proc newLeaf(p: var TRstParser): PRstNode = +proc newLeaf(p: var TRstParser): PRSTNode = result = newRstNode(rnLeaf, p.tok[p.idx].symbol) -proc getReferenceName(p: var TRstParser, endStr: string): PRstNode = +proc getReferenceName(p: var TRstParser, endStr: string): PRSTNode = var res = newRstNode(rnInner) while true: case p.tok[p.idx].kind @@ -451,7 +451,7 @@ proc getReferenceName(p: var TRstParser, endStr: string): PRstNode = inc(p.idx) result = res -proc untilEol(p: var TRstParser): PRstNode = +proc untilEol(p: var TRstParser): PRSTNode = result = newRstNode(rnInner) while not (p.tok[p.idx].kind in {tkIndent, tkEof}): add(result, newLeaf(p)) @@ -479,7 +479,7 @@ proc isInlineMarkupEnd(p: TRstParser, markup: string): bool = result = false proc isInlineMarkupStart(p: TRstParser, markup: string): bool = - var d: Char + var d: char result = p.tok[p.idx].symbol == markup if not result: return # Rule 1: @@ -550,7 +550,7 @@ proc match(p: TRstParser, start: int, expr: string): bool = inc(i) result = true -proc fixupEmbeddedRef(n, a, b: PRstNode) = +proc fixupEmbeddedRef(n, a, b: PRSTNode) = var sep = - 1 for i in countdown(len(n) - 2, 0): if n.sons[i].text == "<": @@ -560,7 +560,7 @@ proc fixupEmbeddedRef(n, a, b: PRstNode) = for i in countup(0, sep - incr): add(a, n.sons[i]) for i in countup(sep + 1, len(n) - 2): add(b, n.sons[i]) -proc parsePostfix(p: var TRstParser, n: PRstNode): PRstNode = +proc parsePostfix(p: var TRstParser, n: PRSTNode): PRSTNode = result = n if isInlineMarkupEnd(p, "_"): inc(p.idx) @@ -613,9 +613,9 @@ proc matchVerbatim(p: TRstParser, start: int, expr: string): int = inc result if j < expr.len: result = 0 -proc parseSmiley(p: var TRstParser): PRstNode = +proc parseSmiley(p: var TRstParser): PRSTNode = if p.tok[p.idx].symbol[0] notin SmileyStartChars: return - for key, val in items(smilies): + for key, val in items(Smilies): let m = matchVerbatim(p, p.idx, key) if m > 0: p.idx = m @@ -634,7 +634,7 @@ proc isURL(p: TRstParser, i: int): bool = (p.tok[i+3].kind == tkWord) and (p.tok[i].symbol in ["http", "https", "ftp", "telnet", "file"]) -proc parseURL(p: var TRstParser, father: PRstNode) = +proc parseURL(p: var TRstParser, father: PRSTNode) = #if p.tok[p.idx].symbol[strStart] == '<': if isURL(p, p.idx): var n = newRstNode(rnStandaloneHyperlink) @@ -654,7 +654,7 @@ proc parseURL(p: var TRstParser, father: PRstNode) = if p.tok[p.idx].symbol == "_": n = parsePostfix(p, n) add(father, n) -proc parseBackslash(p: var TRstParser, father: PRstNode) = +proc parseBackslash(p: var TRstParser, father: PRSTNode) = assert(p.tok[p.idx].kind == tkPunct) if p.tok[p.idx].symbol == "\\\\": add(father, newRstNode(rnLeaf, "\\")) @@ -692,7 +692,7 @@ when false: if p.tok[p.idx].symbol == "_": n = parsePostfix(p, n) add(father, n) -proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string, +proc parseUntil(p: var TRstParser, father: PRSTNode, postfix: string, interpretBackslash: bool) = let line = p.tok[p.idx].line @@ -723,7 +723,7 @@ proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string, inc(p.idx) else: rstMessage(p, meExpected, postfix, line, col) -proc parseMarkdownCodeblock(p: var TRstParser): PRstNode = +proc parseMarkdownCodeblock(p: var TRstParser): PRSTNode = var args = newRstNode(rnDirArg) if p.tok[p.idx].kind == tkWord: add(args, newLeaf(p)) @@ -753,7 +753,7 @@ proc parseMarkdownCodeblock(p: var TRstParser): PRstNode = add(result, nil) add(result, lb) -proc parseInline(p: var TRstParser, father: PRstNode) = +proc parseInline(p: var TRstParser, father: PRSTNode) = case p.tok[p.idx].kind of tkPunct: if isInlineMarkupStart(p, "***"): @@ -797,7 +797,7 @@ proc parseInline(p: var TRstParser, father: PRstNode) = if n != nil: add(father, n) return - parseUrl(p, father) + parseURL(p, father) of tkAdornment, tkOther, tkWhite: if roSupportSmilies in p.s.options: let n = parseSmiley(p) @@ -828,7 +828,7 @@ proc getDirective(p: var TRstParser): string = else: result = "" -proc parseComment(p: var TRstParser): PRstNode = +proc parseComment(p: var TRstParser): PRSTNode = case p.tok[p.idx].kind of tkIndent, tkEof: if p.tok[p.idx].kind != tkEof and p.tok[p.idx + 1].kind == tkIndent: @@ -863,20 +863,20 @@ proc getDirKind(s: string): TDirKind = if i >= 0: result = TDirKind(i) else: result = dkNone -proc parseLine(p: var TRstParser, father: PRstNode) = +proc parseLine(p: var TRstParser, father: PRSTNode) = while True: case p.tok[p.idx].kind of tkWhite, tkWord, tkOther, tkPunct: parseInline(p, father) else: break -proc parseUntilNewline(p: var TRstParser, father: PRstNode) = +proc parseUntilNewline(p: var TRstParser, father: PRSTNode) = while True: case p.tok[p.idx].kind of tkWhite, tkWord, tkAdornment, tkOther, tkPunct: parseInline(p, father) of tkEof, tkIndent: break -proc parseSection(p: var TRstParser, result: PRstNode) -proc parseField(p: var TRstParser): PRstNode = +proc parseSection(p: var TRstParser, result: PRSTNode) +proc parseField(p: var TRstParser): PRSTNode = result = newRstNode(rnField) var col = p.tok[p.idx].col var fieldname = newRstNode(rnFieldname) @@ -892,7 +892,7 @@ proc parseField(p: var TRstParser): PRstNode = add(result, fieldname) add(result, fieldbody) -proc parseFields(p: var TRstParser): PRstNode = +proc parseFields(p: var TRstParser): PRSTNode = result = nil var atStart = p.idx == 0 and p.tok[0].symbol == ":" if (p.tok[p.idx].kind == tkIndent) and (p.tok[p.idx + 1].symbol == ":") or @@ -926,8 +926,8 @@ proc getArgument(n: PRstNode): string = if n.sons[0] == nil: result = "" else: result = addNodes(n.sons[0]) -proc parseDotDot(p: var TRstParser): PRstNode -proc parseLiteralBlock(p: var TRstParser): PRstNode = +proc parseDotDot(p: var TRstParser): PRSTNode +proc parseLiteralBlock(p: var TRstParser): PRSTNode = result = newRstNode(rnLiteralBlock) var n = newRstNode(rnLeaf, "") if p.tok[p.idx].kind == tkIndent: @@ -953,7 +953,7 @@ proc parseLiteralBlock(p: var TRstParser): PRstNode = inc(p.idx) add(result, n) -proc getLevel(map: var TLevelMap, lvl: var int, c: Char): int = +proc getLevel(map: var TLevelMap, lvl: var int, c: char): int = if map[c] == 0: inc(lvl) map[c] = lvl @@ -999,7 +999,7 @@ proc whichSection(p: TRstParser): TRstNodeKind = elif match(p, p.idx + 1, "i"): result = rnOverline else: result = rnLeaf of tkPunct: - if match(p, tokenAfterNewLine(p), "ai"): + if match(p, tokenAfterNewline(p), "ai"): result = rnHeadline elif p.tok[p.idx].symbol == "::": result = rnLiteralBlock @@ -1026,13 +1026,13 @@ proc whichSection(p: TRstParser): TRstNodeKind = else: result = rnParagraph of tkWord, tkOther, tkWhite: - if match(p, tokenAfterNewLine(p), "ai"): result = rnHeadline + if match(p, tokenAfterNewline(p), "ai"): result = rnHeadline elif match(p, p.idx, "e) ") or match(p, p.idx, "e. "): result = rnEnumList elif isDefList(p): result = rnDefList else: result = rnParagraph else: result = rnLeaf -proc parseLineBlock(p: var TRstParser): PRstNode = +proc parseLineBlock(p: var TRstParser): PRSTNode = result = nil if p.tok[p.idx + 1].kind == tkWhite: var col = p.tok[p.idx].col @@ -1051,7 +1051,7 @@ proc parseLineBlock(p: var TRstParser): PRstNode = break popInd(p) -proc parseParagraph(p: var TRstParser, result: PRstNode) = +proc parseParagraph(p: var TRstParser, result: PRSTNode) = while True: case p.tok[p.idx].kind of tkIndent: @@ -1082,9 +1082,9 @@ proc parseParagraph(p: var TRstParser, result: PRstNode) = parseInline(p, result) else: break -proc parseHeadline(p: var TRstParser): PRstNode = +proc parseHeadline(p: var TRstParser): PRSTNode = result = newRstNode(rnHeadline) - parseUntilNewLine(p, result) + parseUntilNewline(p, result) assert(p.tok[p.idx].kind == tkIndent) assert(p.tok[p.idx + 1].kind == tkAdornment) var c = p.tok[p.idx + 1].symbol[0] @@ -1101,7 +1101,7 @@ proc getColumns(p: var TRstParser, cols: var TIntSeq) = var L = 0 while true: inc(L) - setlen(cols, L) + setLen(cols, L) cols[L - 1] = tokEnd(p) assert(p.tok[p.idx].kind == tkAdornment) inc(p.idx) @@ -1112,16 +1112,16 @@ proc getColumns(p: var TRstParser, cols: var TIntSeq) = # last column has no limit: cols[L - 1] = 32000 -proc parseDoc(p: var TRstParser): PRstNode +proc parseDoc(p: var TRstParser): PRSTNode -proc parseSimpleTable(p: var TRstParser): PRstNode = +proc parseSimpleTable(p: var TRstParser): PRSTNode = var cols: TIntSeq row: seq[string] i, last, line: int - c: Char + c: char q: TRstParser - a, b: PRstNode + a, b: PRSTNode result = newRstNode(rnTable) cols = @[] row = @[] @@ -1135,7 +1135,7 @@ proc parseSimpleTable(p: var TRstParser): PRstNode = p.idx = last break getColumns(p, cols) - setlen(row, len(cols)) + setLen(row, len(cols)) if a != nil: for j in 0..len(a)-1: a.sons[j].kind = rnTableHeaderCell if p.tok[p.idx].kind == tkEof: break @@ -1167,13 +1167,13 @@ proc parseSimpleTable(p: var TRstParser): PRstNode = add(a, b) add(result, a) -proc parseTransition(p: var TRstParser): PRstNode = +proc parseTransition(p: var TRstParser): PRSTNode = result = newRstNode(rnTransition) inc(p.idx) if p.tok[p.idx].kind == tkIndent: inc(p.idx) if p.tok[p.idx].kind == tkIndent: inc(p.idx) -proc parseOverline(p: var TRstParser): PRstNode = +proc parseOverline(p: var TRstParser): PRSTNode = var c = p.tok[p.idx].symbol[0] inc(p.idx, 2) result = newRstNode(rnOverline) @@ -1192,7 +1192,7 @@ proc parseOverline(p: var TRstParser): PRstNode = inc(p.idx) # XXX: check? if p.tok[p.idx].kind == tkIndent: inc(p.idx) -proc parseBulletList(p: var TRstParser): PRstNode = +proc parseBulletList(p: var TRstParser): PRSTNode = result = nil if p.tok[p.idx + 1].kind == tkWhite: var bullet = p.tok[p.idx].symbol @@ -1212,7 +1212,7 @@ proc parseBulletList(p: var TRstParser): PRstNode = break popInd(p) -proc parseOptionList(p: var TRstParser): PRstNode = +proc parseOptionList(p: var TRstParser): PRSTNode = result = newRstNode(rnOptionList) while true: if isOptionList(p): @@ -1241,9 +1241,9 @@ proc parseOptionList(p: var TRstParser): PRstNode = else: break -proc parseDefinitionList(p: var TRstParser): PRstNode = +proc parseDefinitionList(p: var TRstParser): PRSTNode = result = nil - var j = tokenAfterNewLine(p) - 1 + var j = tokenAfterNewline(p) - 1 if (j >= 1) and (p.tok[j].kind == tkIndent) and (p.tok[j].ival > currInd(p)) and (p.tok[j - 1].symbol != "::"): var col = p.tok[p.idx].col @@ -1269,7 +1269,7 @@ proc parseDefinitionList(p: var TRstParser): PRstNode = break if (p.tok[p.idx].kind == tkIndent) and (p.tok[p.idx].ival == col): inc(p.idx) - j = tokenAfterNewLine(p) - 1 + j = tokenAfterNewline(p) - 1 if j >= 1 and p.tok[j].kind == tkIndent and p.tok[j].ival > col and p.tok[j-1].symbol != "::" and p.tok[j+1].kind != tkIndent: nil @@ -1277,7 +1277,7 @@ proc parseDefinitionList(p: var TRstParser): PRstNode = break if len(result) == 0: result = nil -proc parseEnumList(p: var TRstParser): PRstNode = +proc parseEnumList(p: var TRstParser): PRSTNode = const wildcards: array[0..2, string] = ["(e) ", "e) ", "e. "] wildpos: array[0..2, int] = [1, 0, 0] @@ -1290,7 +1290,7 @@ proc parseEnumList(p: var TRstParser): PRstNode = var col = p.tok[p.idx].col result = newRstNode(rnEnumList) inc(p.idx, wildpos[w] + 3) - var j = tokenAfterNewLine(p) + var j = tokenAfterNewline(p) if (p.tok[j].col == p.tok[p.idx].col) or match(p, j, wildcards[w]): pushInd(p, p.tok[p.idx].col) while true: @@ -1307,7 +1307,7 @@ proc parseEnumList(p: var TRstParser): PRstNode = dec(p.idx, wildpos[w] + 3) result = nil -proc sonKind(father: PRstNode, i: int): TRstNodeKind = +proc sonKind(father: PRSTNode, i: int): TRstNodeKind = result = rnLeaf if i < len(father): result = father.sons[i].kind @@ -1328,7 +1328,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) = leave = true break if leave or p.tok[p.idx].kind == tkEof: break - var a: PRstNode = nil + var a: PRSTNode = nil var k = whichSection(p) case k of rnLiteralBlock: @@ -1359,7 +1359,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) = if sonKind(result, 0) == rnParagraph and sonKind(result, 1) != rnParagraph: result.sons[0].kind = rnInner -proc parseSectionWrapper(p: var TRstParser): PRstNode = +proc parseSectionWrapper(p: var TRstParser): PRSTNode = result = newRstNode(rnInner) parseSection(p, result) while (result.kind == rnInner) and (len(result) == 1): @@ -1385,12 +1385,12 @@ type TDirFlag = enum hasArg, hasOptions, argIsFile, argIsWord TDirFlags = set[TDirFlag] - TSectionParser = proc (p: var TRstParser): PRstNode {.nimcall.} + TSectionParser = proc (p: var TRstParser): PRSTNode {.nimcall.} -proc parseDirective(p: var TRstParser, flags: TDirFlags): PRstNode = +proc parseDirective(p: var TRstParser, flags: TDirFlags): PRSTNode = result = newRstNode(rnDirective) - var args: PRstNode = nil - var options: PRstNode = nil + var args: PRSTNode = nil + var options: PRSTNode = nil if hasArg in flags: args = newRstNode(rnDirArg) if argIsFile in flags: @@ -1420,7 +1420,7 @@ proc indFollows(p: TRstParser): bool = result = p.tok[p.idx].kind == tkIndent and p.tok[p.idx].ival > currInd(p) proc parseDirective(p: var TRstParser, flags: TDirFlags, - contentParser: TSectionParser): PRstNode = + contentParser: TSectionParser): PRSTNode = result = parseDirective(p, flags) if not isNil(contentParser) and indFollows(p): pushInd(p, p.tok[p.idx].ival) @@ -1430,13 +1430,13 @@ proc parseDirective(p: var TRstParser, flags: TDirFlags, else: add(result, nil) -proc parseDirBody(p: var TRstParser, contentParser: TSectionParser): PRstNode = +proc parseDirBody(p: var TRstParser, contentParser: TSectionParser): PRSTNode = if indFollows(p): pushInd(p, p.tok[p.idx].ival) result = contentParser(p) popInd(p) -proc dirInclude(p: var TRstParser): PRstNode = +proc dirInclude(p: var TRstParser): PRSTNode = # #The following options are recognized: # @@ -1474,7 +1474,7 @@ proc dirInclude(p: var TRstParser): PRstNode = # InternalError("Too many binary zeros in include file") result = parseDoc(q) -proc dirCodeBlock(p: var TRstParser): PRstNode = +proc dirCodeBlock(p: var TRstParser): PRSTNode = result = parseDirective(p, {hasArg, hasOptions}, parseLiteralBlock) var filename = strip(getFieldValue(result, "file")) if filename != "": @@ -1485,34 +1485,34 @@ proc dirCodeBlock(p: var TRstParser): PRstNode = result.sons[2] = n result.kind = rnCodeBlock -proc dirContainer(p: var TRstParser): PRstNode = +proc dirContainer(p: var TRstParser): PRSTNode = result = parseDirective(p, {hasArg}, parseSectionWrapper) assert(result.kind == rnDirective) assert(len(result) == 3) result.kind = rnContainer -proc dirImage(p: var TRstParser): PRstNode = +proc dirImage(p: var TRstParser): PRSTNode = result = parseDirective(p, {hasOptions, hasArg, argIsFile}, nil) result.kind = rnImage -proc dirFigure(p: var TRstParser): PRstNode = +proc dirFigure(p: var TRstParser): PRSTNode = result = parseDirective(p, {hasOptions, hasArg, argIsFile}, parseSectionWrapper) result.kind = rnFigure -proc dirTitle(p: var TRstParser): PRstNode = +proc dirTitle(p: var TRstParser): PRSTNode = result = parseDirective(p, {hasArg}, nil) result.kind = rnTitle -proc dirContents(p: var TRstParser): PRstNode = +proc dirContents(p: var TRstParser): PRSTNode = result = parseDirective(p, {hasArg}, nil) result.kind = rnContents -proc dirIndex(p: var TRstParser): PRstNode = +proc dirIndex(p: var TRstParser): PRSTNode = result = parseDirective(p, {}, parseSectionWrapper) result.kind = rnIndex -proc dirRawAux(p: var TRstParser, result: var PRstNode, kind: TRstNodeKind, +proc dirRawAux(p: var TRstParser, result: var PRSTNode, kind: TRstNodeKind, contentParser: TSectionParser) = var filename = getFieldValue(result, "file") if filename.len > 0: @@ -1527,7 +1527,7 @@ proc dirRawAux(p: var TRstParser, result: var PRstNode, kind: TRstNodeKind, result.kind = kind add(result, parseDirBody(p, contentParser)) -proc dirRaw(p: var TRstParser): PRstNode = +proc dirRaw(p: var TRstParser): PRSTNode = # #The following options are recognized: # @@ -1581,7 +1581,7 @@ proc parseDotDot(p: var TRstParser): PRstNode = # substitution definitions: inc(p.idx, 2) var a = getReferenceName(p, "|") - var b: PRstNode + var b: PRSTNode if p.tok[p.idx].kind == tkWhite: inc(p.idx) if cmpIgnoreStyle(p.tok[p.idx].symbol, "replace") == 0: inc(p.idx) @@ -1603,7 +1603,7 @@ proc parseDotDot(p: var TRstParser): PRstNode = else: result = parseComment(p) -proc resolveSubs(p: var TRstParser, n: PRstNode): PRstNode = +proc resolveSubs(p: var TRstParser, n: PRSTNode): PRSTNode = result = n if n == nil: return case n.kind @@ -1634,7 +1634,7 @@ proc rstParse*(text, filename: string, line, column: int, hasToc: var bool, options: TRstParseOptions, findFile: TFindFileHandler = nil, - msgHandler: TMsgHandler = nil): PRstNode = + msgHandler: TMsgHandler = nil): PRSTNode = var p: TRstParser initParser(p, newSharedState(options, findFile, msgHandler)) p.filename = filename diff --git a/lib/packages/docutils/rstast.nim b/lib/packages/docutils/rstast.nim index c2ff53b585..bb0b618893 100644 --- a/lib/packages/docutils/rstast.nim +++ b/lib/packages/docutils/rstast.nim @@ -62,8 +62,8 @@ type # leaf val - PRSTNode* = ref TRstNode ## an RST node - TRstNodeSeq* = seq[PRstNode] + PRSTNode* = ref TRSTNode ## an RST node + TRstNodeSeq* = seq[PRSTNode] TRSTNode* {.acyclic, final.} = object ## an RST node's description kind*: TRstNodeKind ## the node's kind text*: string ## valid for leafs in the AST; and the title of @@ -71,25 +71,25 @@ type level*: int ## valid for some node kinds sons*: TRstNodeSeq ## the node's sons -proc len*(n: PRstNode): int = +proc len*(n: PRSTNode): int = result = len(n.sons) -proc newRstNode*(kind: TRstNodeKind): PRstNode = +proc newRstNode*(kind: TRstNodeKind): PRSTNode = new(result) result.sons = @[] result.kind = kind -proc newRstNode*(kind: TRstNodeKind, s: string): PRstNode = +proc newRstNode*(kind: TRstNodeKind, s: string): PRSTNode = result = newRstNode(kind) result.text = s -proc lastSon*(n: PRstNode): PRstNode = +proc lastSon*(n: PRSTNode): PRSTNode = result = n.sons[len(n.sons)-1] -proc add*(father, son: PRstNode) = +proc add*(father, son: PRSTNode) = add(father.sons, son) -proc addIfNotNil*(father, son: PRstNode) = +proc addIfNotNil*(father, son: PRSTNode) = if son != nil: add(father, son) @@ -98,9 +98,9 @@ type indent: int verbatim: int -proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string) +proc renderRstToRst(d: var TRenderContext, n: PRSTNode, result: var string) -proc renderRstSons(d: var TRenderContext, n: PRstNode, result: var string) = +proc renderRstSons(d: var TRenderContext, n: PRSTNode, result: var string) = for i in countup(0, len(n) - 1): renderRstToRst(d, n.sons[i], result) @@ -132,7 +132,7 @@ proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string) = var headline = "" renderRstSons(d, n, headline) - let lvl = repeatChar(headline.Len - d.indent, lvlToChar[n.level]) + let lvl = repeatChar(headline.len - d.indent, lvlToChar[n.level]) result.add(lvl) result.add("\n") result.add(headline) @@ -281,7 +281,7 @@ proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string) = else: result.add("Error: cannot render: " & $n.kind) -proc renderRstToRst*(n: PRstNode, result: var string) = +proc renderRstToRst*(n: PRSTNode, result: var string) = ## renders `n` into its string representation and appends to `result`. var d: TRenderContext renderRstToRst(d, n, result) diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index 157e04d5bc..f43c6e478b 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -32,7 +32,7 @@ type outLatex # output is Latex TTocEntry{.final.} = object - n*: PRstNode + n*: PRSTNode refname*, header*: string TMetaEnum* = enum @@ -113,7 +113,7 @@ proc initRstGenerator*(g: var TRstGenerator, target: TOutputTarget, proc writeIndexFile*(g: var TRstGenerator, outfile: string) = if g.theIndex.len > 0: writeFile(outfile, g.theIndex) -proc addXmlChar(dest: var string, c: Char) = +proc addXmlChar(dest: var string, c: char) = case c of '&': add(dest, "&amp;") of '<': add(dest, "&lt;") @@ -121,14 +121,14 @@ proc addXmlChar(dest: var string, c: Char) = of '\"': add(dest, "&quot;") else: add(dest, c) -proc addRtfChar(dest: var string, c: Char) = +proc addRtfChar(dest: var string, c: char) = case c of '{': add(dest, "\\{") of '}': add(dest, "\\}") of '\\': add(dest, "\\\\") else: add(dest, c) -proc addTexChar(dest: var string, c: Char) = +proc addTexChar(dest: var string, c: char) = case c of '_': add(dest, "\\_") of '{': add(dest, "\\symbol{123}") @@ -148,7 +148,7 @@ proc addTexChar(dest: var string, c: Char) = var splitter*: string = "<wbr />" -proc escChar*(target: TOutputTarget, dest: var string, c: Char) {.inline.} = +proc escChar*(target: TOutputTarget, dest: var string, c: char) {.inline.} = case target of outHtml: addXmlChar(dest, c) of outLatex: addTexChar(dest, c) @@ -196,7 +196,7 @@ proc dispA(target: TOutputTarget, dest: var string, if target != outLatex: addf(dest, xml, args) else: addf(dest, tex, args) -proc renderRstToOut*(d: var TRstGenerator, n: PRstNode, result: var string) +proc renderRstToOut*(d: var TRstGenerator, n: PRSTNode, result: var string) ## Writes into ``result`` the rst ast ``n`` using the ``d`` configuration. ## ## Before using this proc you need to initialise a ``TRstGenerator`` with @@ -210,10 +210,10 @@ proc renderRstToOut*(d: var TRstGenerator, n: PRstNode, result: var string) ## renderRstToOut(gen, rst, generatedHTML) ## echo generatedHTML -proc renderAux(d: PDoc, n: PRstNode, result: var string) = +proc renderAux(d: PDoc, n: PRSTNode, result: var string) = for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], result) -proc renderAux(d: PDoc, n: PRstNode, frmtA, frmtB: string, result: var string) = +proc renderAux(d: PDoc, n: PRSTNode, frmtA, frmtB: string, result: var string) = var tmp = "" for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], tmp) if d.target != outLatex: @@ -232,7 +232,7 @@ proc setIndexTerm*(d: var TRstGenerator, id, term: string) = d.theIndex.add(id) d.theIndex.add("\n") -proc hash(n: PRstNode): int = +proc hash(n: PRSTNode): int = if n.kind == rnLeaf: result = hash(n.text) elif n.len > 0: @@ -241,7 +241,7 @@ proc hash(n: PRstNode): int = result = result !& hash(n.sons[i]) result = !$result -proc renderIndexTerm(d: PDoc, n: PRstNode, result: var string) = +proc renderIndexTerm(d: PDoc, n: PRSTNode, result: var string) = let id = rstnodeToRefname(n) & '_' & $abs(hash(n)) var term = "" renderAux(d, n, term) @@ -314,13 +314,13 @@ proc mergeIndexes*(dir: string): string = # ---------------------------------------------------------------------------- -proc renderHeadline(d: PDoc, n: PRstNode, result: var string) = +proc renderHeadline(d: PDoc, n: PRSTNode, result: var string) = var tmp = "" for i in countup(0, len(n) - 1): renderRstToOut(d, n.sons[i], tmp) var refname = rstnodeToRefname(n) if d.hasToc: var length = len(d.tocPart) - setlen(d.tocPart, length + 1) + setLen(d.tocPart, length + 1) d.tocPart[length].refname = refname d.tocPart[length].n = n d.tocPart[length].header = tmp @@ -336,7 +336,7 @@ proc renderHeadline(d: PDoc, n: PRstNode, result: var string) = $n.level, refname, tmp, $chr(n.level - 1 + ord('A'))]) -proc renderOverline(d: PDoc, n: PRstNode, result: var string) = +proc renderOverline(d: PDoc, n: PRSTNode, result: var string) = if d.meta[metaTitle].len == 0: for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], d.meta[metaTitle]) @@ -373,7 +373,7 @@ proc renderTocEntries*(d: var TRstGenerator, j: var int, lvl: int, result: var s else: result.add(tmp) -proc renderImage(d: PDoc, n: PRstNode, result: var string) = +proc renderImage(d: PDoc, n: PRSTNode, result: var string) = var options = "" var s = getFieldValue(n, "scale") if s != "": dispA(d.target, options, " scale=\"$1\"", " scale=$1", [strip(s)]) @@ -396,13 +396,13 @@ proc renderImage(d: PDoc, n: PRstNode, result: var string) = [getArgument(n), options]) if len(n) >= 3: renderRstToOut(d, n.sons[2], result) -proc renderSmiley(d: PDoc, n: PRstNode, result: var string) = +proc renderSmiley(d: PDoc, n: PRSTNode, result: var string) = dispA(d.target, result, """<img src="/images/smilies/$1.gif" width="15" height="17" hspace="2" vspace="2" />""", "\\includegraphics{$1}", [n.text]) -proc renderCodeBlock(d: PDoc, n: PRstNode, result: var string) = +proc renderCodeBlock(d: PDoc, n: PRSTNode, result: var string) = if n.sons[2] == nil: return var m = n.sons[2].sons[0] assert m.kind == rnLeaf @@ -433,7 +433,7 @@ proc renderCodeBlock(d: PDoc, n: PRstNode, result: var string) = deinitGeneralTokenizer(g) dispA(d.target, result, "</pre>", "\n\\end{rstpre}\n") -proc renderContainer(d: PDoc, n: PRstNode, result: var string) = +proc renderContainer(d: PDoc, n: PRSTNode, result: var string) = var tmp = "" renderRstToOut(d, n.sons[2], tmp) var arg = strip(getArgument(n)) @@ -442,11 +442,11 @@ proc renderContainer(d: PDoc, n: PRstNode, result: var string) = else: dispA(d.target, result, "<div class=\"$1\">$2</div>", "$2", [arg, tmp]) -proc texColumns(n: PRstNode): string = +proc texColumns(n: PRSTNode): string = result = "" for i in countup(1, len(n)): add(result, "|X") -proc renderField(d: PDoc, n: PRstNode, result: var string) = +proc renderField(d: PDoc, n: PRSTNode, result: var string) = var b = false if d.target == outLatex: var fieldname = addNodes(n.sons[0]) @@ -456,7 +456,7 @@ proc renderField(d: PDoc, n: PRstNode, result: var string) = if d.meta[metaAuthor].len == 0: d.meta[metaAuthor] = fieldval b = true - elif cmpIgnoreStyle(fieldName, "version") == 0: + elif cmpIgnoreStyle(fieldname, "version") == 0: if d.meta[metaVersion].len == 0: d.meta[metaVersion] = fieldval b = true @@ -620,14 +620,14 @@ proc renderRstToOut(d: PDoc, n: PRstNode, result: var string) = # ----------------------------------------------------------------------------- -proc getVarIdx(varnames: openarray[string], id: string): int = +proc getVarIdx(varnames: openArray[string], id: string): int = for i in countup(0, high(varnames)): if cmpIgnoreStyle(varnames[i], id) == 0: return i result = -1 -proc formatNamedVars*(frmt: string, varnames: openarray[string], - varvalues: openarray[string]): string = +proc formatNamedVars*(frmt: string, varnames: openArray[string], + varvalues: openArray[string]): string = var i = 0 var L = len(frmt) result = "" @@ -646,7 +646,7 @@ proc formatNamedVars*(frmt: string, varnames: openarray[string], of '0'..'9': var j = 0 while true: - j = (j * 10) + Ord(frmt[i]) - ord('0') + j = (j * 10) + ord(frmt[i]) - ord('0') inc(i) if i > L-1 or frmt[i] notin {'0'..'9'}: break if j > high(varvalues) + 1: diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index 8b44e69d9b..df7ae6d176 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -34,7 +34,7 @@ proc reverse*[T](a: var openArray[T]) = ## reverses the array `a`. reverse(a, 0, a.high) -proc binarySearch*[T](a: openarray[T], key: T): int = +proc binarySearch*[T](a: openArray[T], key: T): int = ## binary search for `key` in `a`. Returns -1 if not found. var b = len(a) while result < b: @@ -79,7 +79,7 @@ proc merge[T](a, b: var openArray[T], lo, m, hi: int, inc(bb) inc(j) else: - CopyMem(addr(b[0]), addr(a[j]), sizeof(T)*(m-j+1)) + copyMem(addr(b[0]), addr(a[j]), sizeof(T)*(m-j+1)) j = m+1 var i = 0 var k = lo diff --git a/lib/pure/collections/intsets.nim b/lib/pure/collections/intsets.nim index 367caf2e75..f1e67fc0e3 100644 --- a/lib/pure/collections/intsets.nim +++ b/lib/pure/collections/intsets.nim @@ -71,8 +71,8 @@ proc intSetEnlarge(t: var TIntSet) = var oldMax = t.max t.max = ((t.max + 1) * 2) - 1 newSeq(n, t.max + 1) - for i in countup(0, oldmax): - if t.data[i] != nil: IntSetRawInsert(t, n, t.data[i]) + for i in countup(0, oldMax): + if t.data[i] != nil: intSetRawInsert(t, n, t.data[i]) swap(t.data, n) proc intSetPut(t: var TIntSet, key: int): PTrunk = @@ -81,7 +81,7 @@ proc intSetPut(t: var TIntSet, key: int): PTrunk = if t.data[h].key == key: return t.data[h] h = nextTry(h, t.max) - if mustRehash(t.max + 1, t.counter): IntSetEnlarge(t) + if mustRehash(t.max + 1, t.counter): intSetEnlarge(t) inc(t.counter) h = key and t.max while t.data[h] != nil: h = nextTry(h, t.max) @@ -94,7 +94,7 @@ proc intSetPut(t: var TIntSet, key: int): PTrunk = proc contains*(s: TIntSet, key: int): bool = ## returns true iff `key` is in `s`. - var t = IntSetGet(s, `shr`(key, TrunkShift)) + var t = intSetGet(s, `shr`(key, TrunkShift)) if t != nil: var u = key and TrunkMask result = (t.bits[`shr`(u, IntShift)] and `shl`(1, u and IntMask)) != 0 @@ -103,14 +103,14 @@ proc contains*(s: TIntSet, key: int): bool = proc incl*(s: var TIntSet, key: int) = ## includes an element `key` in `s`. - var t = IntSetPut(s, `shr`(key, TrunkShift)) + var t = intSetPut(s, `shr`(key, TrunkShift)) var u = key and TrunkMask t.bits[`shr`(u, IntShift)] = t.bits[`shr`(u, IntShift)] or `shl`(1, u and IntMask) proc excl*(s: var TIntSet, key: int) = ## excludes `key` from the set `s`. - var t = IntSetGet(s, `shr`(key, TrunkShift)) + var t = intSetGet(s, `shr`(key, TrunkShift)) if t != nil: var u = key and TrunkMask t.bits[`shr`(u, IntShift)] = t.bits[`shr`(u, IntShift)] and @@ -119,7 +119,7 @@ proc excl*(s: var TIntSet, key: int) = proc containsOrIncl*(s: var TIntSet, key: int): bool = ## returns true if `s` contains `key`, otherwise `key` is included in `s` ## and false is returned. - var t = IntSetGet(s, `shr`(key, TrunkShift)) + var t = intSetGet(s, `shr`(key, TrunkShift)) if t != nil: var u = key and TrunkMask result = (t.bits[`shr`(u, IntShift)] and `shl`(1, u and IntMask)) != 0 diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index 3a009a8cb4..3993f1ccc7 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -136,7 +136,7 @@ proc delete*[T](s: var seq[T], first=0, last=0) = s[i].shallowCopy(s[j]) inc(i) inc(j) - setlen(s, newLen) + setLen(s, newLen) proc insert*[T](dest: var seq[T], src: openArray[T], pos=0) = ## Inserts items from `src` into `dest` at position `pos`. This modifies diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index ef3a529a15..4b9e8af0e8 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -168,7 +168,7 @@ proc initTable*[A, B](initialSize=64): TTable[A, B] = result.counter = 0 newSeq(result.data, initialSize) -proc toTable*[A, B](pairs: openarray[tuple[key: A, +proc toTable*[A, B](pairs: openArray[tuple[key: A, val: B]]): TTable[A, B] = ## creates a new hash table that contains the given `pairs`. result = initTable[A, B](nextPowerOfTwo(pairs.len+10)) @@ -304,7 +304,7 @@ proc initOrderedTable*[A, B](initialSize=64): TOrderedTable[A, B] = result.last = -1 newSeq(result.data, initialSize) -proc toOrderedTable*[A, B](pairs: openarray[tuple[key: A, +proc toOrderedTable*[A, B](pairs: openArray[tuple[key: A, val: B]]): TOrderedTable[A, B] = ## creates a new ordered hash table that contains the given `pairs`. result = initOrderedTable[A, B](nextPowerOfTwo(pairs.len+10)) @@ -463,7 +463,7 @@ proc `$`*[A](t: TCountTable[A]): string = proc inc*[A](t: var TCountTable[A], key: A, val = 1) = ## increments `t[key]` by `val`. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: inc(t.data[index].val, val) else: diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim index 8a3135f89c..1c0c59a7c7 100644 --- a/lib/pure/hashes.nim +++ b/lib/pure/hashes.nim @@ -32,7 +32,7 @@ proc `!$`*(h: THash): THash {.inline.} = result = result xor (result shr 11) result = result +% result shl 15 -proc hashData*(Data: Pointer, Size: int): THash = +proc hashData*(Data: pointer, Size: int): THash = ## hashes an array of bytes of size `size` var h: THash = 0 when defined(js): @@ -41,17 +41,17 @@ proc hashData*(Data: Pointer, Size: int): THash = else: var p = cast[cstring](Data) var i = 0 - var s = size + var s = Size while s > 0: h = h !& ord(p[i]) - Inc(i) - Dec(s) + inc(i) + dec(s) result = !$h when defined(js): var objectID = 0 -proc hash*(x: Pointer): THash {.inline.} = +proc hash*(x: pointer): THash {.inline.} = ## efficient hashing of pointers when defined(js): asm """ @@ -126,6 +126,6 @@ proc hash*(x: float): THash {.inline.} = var y = x + 1.0 result = cast[ptr THash](addr(y))[] -proc hash*[A](x: openarray[A]): THash = +proc hash*[A](x: openArray[A]): THash = for it in items(x): result = result !& hash(it) result = !$result diff --git a/lib/pure/json.nim b/lib/pure/json.nim index df20bd8524..f0d0aa0c0c 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -135,7 +135,7 @@ proc str*(my: TJsonParser): string {.inline.} = assert(my.kind in {jsonInt, jsonFloat, jsonString}) return my.a -proc getInt*(my: TJsonParser): biggestInt {.inline.} = +proc getInt*(my: TJsonParser): BiggestInt {.inline.} = ## returns the number for the event: ``jsonInt`` assert(my.kind == jsonInt) return parseBiggestInt(my.a) @@ -173,7 +173,7 @@ proc errorMsgExpected*(my: TJsonParser, e: string): string = result = "$1($2, $3) Error: $4" % [ my.filename, $getLine(my), $getColumn(my), e & " expected"] -proc handleHexChar(c: Char, x: var int): bool = +proc handleHexChar(c: char, x: var int): bool = result = true # Success case c of '0'..'9': x = (x shl 4) or (ord(c) - ord('0')) @@ -286,7 +286,7 @@ proc skip(my: var TJsonParser) = else: break of ' ', '\t': - Inc(pos) + inc(pos) of '\c': pos = lexbase.HandleCR(my, pos) buf = my.buf @@ -517,7 +517,7 @@ type of JString: str*: string of JInt: - num*: biggestInt + num*: BiggestInt of JFloat: fnum*: float of JBool: @@ -535,30 +535,30 @@ proc raiseParseErr*(p: TJsonParser, msg: string) {.noinline, noreturn.} = ## raises an `EJsonParsingError` exception. raise newException(EJsonParsingError, errorMsgExpected(p, msg)) -proc newJString*(s: String): PJsonNode = +proc newJString*(s: string): PJsonNode = ## Creates a new `JString PJsonNode`. new(result) result.kind = JString result.str = s -proc newJStringMove(s: String): PJsonNode = +proc newJStringMove(s: string): PJsonNode = new(result) result.kind = JString shallowCopy(result.str, s) -proc newJInt*(n: biggestInt): PJsonNode = +proc newJInt*(n: BiggestInt): PJsonNode = ## Creates a new `JInt PJsonNode`. new(result) result.kind = JInt result.num = n -proc newJFloat*(n: Float): PJsonNode = +proc newJFloat*(n: float): PJsonNode = ## Creates a new `JFloat PJsonNode`. new(result) result.kind = JFloat result.fnum = n -proc newJBool*(b: Bool): PJsonNode = +proc newJBool*(b: bool): PJsonNode = ## Creates a new `JBool PJsonNode`. new(result) result.kind = JBool @@ -587,7 +587,7 @@ proc `%`*(s: string): PJsonNode = result.kind = JString result.str = s -proc `%`*(n: biggestInt): PJsonNode = +proc `%`*(n: BiggestInt): PJsonNode = ## Generic constructor for JSON data. Creates a new `JInt PJsonNode`. new(result) result.kind = JInt @@ -612,7 +612,7 @@ proc `%`*(keyVals: openArray[tuple[key: string, val: PJsonNode]]): PJsonNode = newSeq(result.fields, keyVals.len) for i, p in pairs(keyVals): result.fields[i] = p -proc `%`*(elements: openArray[PJSonNode]): PJsonNode = +proc `%`*(elements: openArray[PJsonNode]): PJsonNode = ## Generic constructor for JSON data. Creates a new `JArray PJsonNode` new(result) result.kind = JArray @@ -628,7 +628,7 @@ proc len*(n: PJsonNode): int = of JObject: result = n.fields.len else: nil -proc `[]`*(node: PJsonNode, name: String): PJsonNode = +proc `[]`*(node: PJsonNode, name: string): PJsonNode = ## Gets a field from a `JObject`. Returns nil if the key is not found. assert(node.kind == JObject) for key, item in items(node.fields): @@ -636,17 +636,17 @@ proc `[]`*(node: PJsonNode, name: String): PJsonNode = return item return nil -proc `[]`*(node: PJsonNode, index: Int): PJsonNode = +proc `[]`*(node: PJsonNode, index: int): PJsonNode = ## Gets the node at `index` in an Array. assert(node.kind == JArray) return node.elems[index] -proc hasKey*(node: PJsonNode, key: String): Bool = +proc hasKey*(node: PJsonNode, key: string): bool = ## Checks if `key` exists in `node`. assert(node.kind == JObject) for k, item in items(node.fields): if k == key: return True -proc existsKey*(node: PJsonNode, key: String): Bool {.deprecated.} = node.hasKey(key) +proc existsKey*(node: PJsonNode, key: string): bool {.deprecated.} = node.hasKey(key) ## Deprecated for `hasKey` proc add*(father, child: PJsonNode) = @@ -661,7 +661,7 @@ proc add*(obj: PJsonNode, key: string, val: PJsonNode) = assert obj.kind == JObject obj.fields.add((key, val)) -proc `[]=`*(obj: PJsonNode, key: String, val: PJsonNode) = +proc `[]=`*(obj: PJsonNode, key: string, val: PJsonNode) = ## Sets a field from a `JObject`. Performs a check for duplicate keys. assert(obj.kind == JObject) for i in 0..obj.fields.len-1: @@ -706,7 +706,7 @@ proc copy*(p: PJsonNode): PJsonNode = proc indent(s: var string, i: int) = s.add(repeatChar(i)) -proc newIndent(curr, indent: int, ml: bool): Int = +proc newIndent(curr, indent: int, ml: bool): int = if ml: return curr + indent else: return indent @@ -785,18 +785,18 @@ proc toPretty(result: var string, node: PJsonNode, indent = 2, ml = True, if lstArr: result.indent(currIndent) result.add("null") -proc pretty*(node: PJsonNode, indent = 2): String = +proc pretty*(node: PJsonNode, indent = 2): string = ## Converts `node` to its JSON Representation, with indentation and ## on multiple lines. result = "" toPretty(result, node, indent) -proc `$`*(node: PJsonNode): String = +proc `$`*(node: PJsonNode): string = ## Converts `node` to its JSON Representation on one line. result = "" toPretty(result, node, 1, False) -iterator items*(node: PJsonNode): PJSonNode = +iterator items*(node: PJsonNode): PJsonNode = ## Iterator for the items of `node`. `node` has to be a JArray. assert node.kind == JArray for i in items(node.elems): diff --git a/lib/pure/lexbase.nim b/lib/pure/lexbase.nim index 3b3e3810b6..243c7dc4a4 100644 --- a/lib/pure/lexbase.nim +++ b/lib/pure/lexbase.nim @@ -91,7 +91,7 @@ proc fillBuffer(L: var TBaseLexer) = dec(s) # BUGFIX (valgrind) while true: assert(s < L.bufLen) - while (s >= 0) and not (L.buf[s] in NewLines): Dec(s) + while (s >= 0) and not (L.buf[s] in NewLines): dec(s) if s >= 0: # we found an appropriate character for a sentinel: L.sentinel = s @@ -163,5 +163,5 @@ proc getCurrentLine(L: TBaseLexer, marker: bool = true): string = inc(i) add(result, "\n") if marker: - add(result, RepeatChar(getColNumber(L, L.bufpos)) & "^\n") + add(result, repeatChar(getColNumber(L, L.bufpos)) & "^\n") diff --git a/lib/pure/math.nim b/lib/pure/math.nim index 35b9607e0e..062cfae252 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -94,7 +94,7 @@ proc nextPowerOfTwo*(x: int): int = result = result or (result shr 4) result = result or (result shr 2) result = result or (result shr 1) - Inc(result) + inc(result) proc countBits32*(n: int32): int {.noSideEffect.} = ## counts the set bits in `n`. @@ -103,17 +103,17 @@ proc countBits32*(n: int32): int {.noSideEffect.} = v = (v and 0x33333333'i32) +% ((v shr 2'i32) and 0x33333333'i32) result = ((v +% (v shr 4'i32) and 0xF0F0F0F'i32) *% 0x1010101'i32) shr 24'i32 -proc sum*[T](x: openarray[T]): T {.noSideEffect.} = +proc sum*[T](x: openArray[T]): T {.noSideEffect.} = ## computes the sum of the elements in `x`. ## If `x` is empty, 0 is returned. for i in items(x): result = result + i -proc mean*(x: openarray[float]): float {.noSideEffect.} = +proc mean*(x: openArray[float]): float {.noSideEffect.} = ## computes the mean of the elements in `x`. ## If `x` is empty, NaN is returned. result = sum(x) / toFloat(len(x)) -proc variance*(x: openarray[float]): float {.noSideEffect.} = +proc variance*(x: openArray[float]): float {.noSideEffect.} = ## computes the variance of the elements in `x`. ## If `x` is empty, NaN is returned. result = 0.0 diff --git a/lib/pure/memfiles.nim b/lib/pure/memfiles.nim index 9f4094b40e..d8a27fde39 100644 --- a/lib/pure/memfiles.nim +++ b/lib/pure/memfiles.nim @@ -52,9 +52,9 @@ proc open*(filename: string, mode: TFileMode = fmRead, when defined(windows): template fail(errCode: TOSErrorCode, msg: expr) = rollback() - if result.fHandle != 0: discard CloseHandle(result.fHandle) - if result.mapHandle != 0: discard CloseHandle(result.mapHandle) - OSError(errCode) + if result.fHandle != 0: discard closeHandle(result.fHandle) + if result.mapHandle != 0: discard closeHandle(result.mapHandle) + osError(errCode) # return false #raise newException(EIO, msg) @@ -69,36 +69,36 @@ proc open*(filename: string, mode: TFileMode = fmRead, 0) when useWinUnicode: - result.fHandle = callCreateFile(CreateFileW, newWideCString(filename)) + result.fHandle = callCreateFile(createFileW, newWideCString(filename)) else: result.fHandle = callCreateFile(CreateFileA, filename) if result.fHandle == INVALID_HANDLE_VALUE: - fail(OSLastError(), "error opening file") + fail(osLastError(), "error opening file") if newFileSize != -1: var sizeHigh = int32(newFileSize shr 32) sizeLow = int32(newFileSize and 0xffffffff) - var status = SetFilePointer(result.fHandle, sizeLow, addr(sizeHigh), + var status = setFilePointer(result.fHandle, sizeLow, addr(sizeHigh), FILE_BEGIN) - let lastErr = OSLastError() + let lastErr = osLastError() if (status == INVALID_SET_FILE_POINTER and lastErr.int32 != NO_ERROR) or - (SetEndOfFile(result.fHandle) == 0): + (setEndOfFile(result.fHandle) == 0): fail(lastErr, "error setting file size") # since the strings are always 'nil', we simply always call # CreateFileMappingW which should be slightly faster anyway: - result.mapHandle = CreateFileMappingW( + result.mapHandle = createFileMappingW( result.fHandle, nil, if readonly: PAGE_READONLY else: PAGE_READWRITE, 0, 0, nil) if result.mapHandle == 0: - fail(OSLastError(), "error creating mapping") + fail(osLastError(), "error creating mapping") - result.mem = MapViewOfFileEx( + result.mem = mapViewOfFileEx( result.mapHandle, if readonly: FILE_MAP_READ else: FILE_MAP_WRITE, int32(offset shr 32), @@ -107,12 +107,12 @@ proc open*(filename: string, mode: TFileMode = fmRead, nil) if result.mem == nil: - fail(OSLastError(), "error mapping view") + fail(osLastError(), "error mapping view") var hi, low: int32 - low = GetFileSize(result.fHandle, addr(hi)) + low = getFileSize(result.fHandle, addr(hi)) if low == INVALID_FILE_SIZE: - fail(OSLastError(), "error getting file size") + fail(osLastError(), "error getting file size") else: var fileSize = (int64(hi) shr 32) or low if mappedSize != -1: result.size = min(fileSize, mappedSize).int @@ -170,10 +170,10 @@ proc close*(f: var TMemFile) = when defined(windows): if f.fHandle != INVALID_HANDLE_VALUE: - lastErr = OSLastError() - error = UnmapViewOfFile(f.mem) == 0 - error = (CloseHandle(f.mapHandle) == 0) or error - error = (CloseHandle(f.fHandle) == 0) or error + lastErr = osLastError() + error = unmapViewOfFile(f.mem) == 0 + error = (closeHandle(f.mapHandle) == 0) or error + error = (closeHandle(f.fHandle) == 0) or error else: if f.handle != 0: lastErr = OSLastError() @@ -189,5 +189,5 @@ proc close*(f: var TMemFile) = else: f.handle = 0 - if error: OSError(lastErr) + if error: osError(lastErr) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 761ed4bc45..fbca89f52d 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -189,7 +189,7 @@ proc osErrorMsg*(): string {.rtl, extern: "nos$1", deprecated.} = var err = getLastError() if err != 0'i32: when useWinUnicode: - var msgbuf: widecstring + var msgbuf: WideCString if formatMessageW(0x00000100 or 0x00001000 or 0x00000200, nil, err, 0, addr(msgbuf), 0, nil) != 0'i32: result = $msgbuf @@ -237,7 +237,7 @@ proc osErrorMsg*(errorCode: TOSErrorCode): string = when defined(Windows): if errorCode != TOSErrorCode(0'i32): when useWinUnicode: - var msgbuf: widecstring + var msgbuf: WideCString if formatMessageW(0x00000100 or 0x00001000 or 0x00000200, nil, errorCode.int32, 0, addr(msgbuf), 0, nil) != 0'i32: result = $msgbuf @@ -282,7 +282,7 @@ proc osLastError*(): TOSErrorCode = ## immediately after an OS call fails. On POSIX systems this is not a problem. when defined(windows): - result = TOSErrorCode(GetLastError()) + result = TOSErrorCode(getLastError()) else: result = TOSErrorCode(errno) {.pop.} @@ -394,11 +394,11 @@ proc getLastModificationTime*(file: string): TTime {.rtl, extern: "nos$1".} = if stat(file, res) < 0'i32: osError(osLastError()) return res.st_mtime else: - var f: TWIN32_Find_Data + var f: TWIN32_FIND_DATA var h = findFirstFile(file, f) if h == -1'i32: osError(osLastError()) result = winTimeToUnixTime(rdFileTime(f.ftLastWriteTime)) - findclose(h) + findClose(h) proc getLastAccessTime*(file: string): TTime {.rtl, extern: "nos$1".} = ## Returns the `file`'s last read or write access time. @@ -407,11 +407,11 @@ proc getLastAccessTime*(file: string): TTime {.rtl, extern: "nos$1".} = if stat(file, res) < 0'i32: osError(osLastError()) return res.st_atime else: - var f: TWIN32_Find_Data + var f: TWIN32_FIND_DATA var h = findFirstFile(file, f) if h == -1'i32: osError(osLastError()) result = winTimeToUnixTime(rdFileTime(f.ftLastAccessTime)) - findclose(h) + findClose(h) proc getCreationTime*(file: string): TTime {.rtl, extern: "nos$1".} = ## Returns the `file`'s creation time. @@ -420,11 +420,11 @@ proc getCreationTime*(file: string): TTime {.rtl, extern: "nos$1".} = if stat(file, res) < 0'i32: osError(osLastError()) return res.st_ctime else: - var f: TWIN32_Find_Data + var f: TWIN32_FIND_DATA var h = findFirstFile(file, f) if h == -1'i32: osError(osLastError()) result = winTimeToUnixTime(rdFileTime(f.ftCreationTime)) - findclose(h) + findClose(h) proc fileNewer*(a, b: string): bool {.rtl, extern: "nos$1".} = ## Returns true if the file `a` is newer than file `b`, i.e. if `a`'s @@ -670,7 +670,7 @@ proc expandFilename*(filename: string): string {.rtl, extern: "nos$1", when defined(windows): const bufsize = 3072'i32 when useWinUnicode: - var unused: widecstring + var unused: WideCString var res = newWideCString("", bufsize div 2) var L = getFullPathNameW(newWideCString(filename), bufsize, res, unused) if L <= 0'i32 or L >= bufsize: @@ -957,7 +957,7 @@ proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", tags: [FReadIO, FWriteIO].} = ## Moves a file from `source` to `dest`. If this fails, `EOS` is raised. - if crename(source, dest) != 0'i32: + if c_rename(source, dest) != 0'i32: raise newException(EOS, $strerror(errno)) when not defined(ENOENT) and not defined(Windows): @@ -1005,7 +1005,7 @@ proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", ## the process has finished. To execute a program without having a ## shell involved, use the `execProcess` proc of the `osproc` ## module. - result = csystem(command) + result = c_system(command) # Environment handling cannot be put into RTL, because the ``envPairs`` # iterator depends on ``environment``. @@ -1018,7 +1018,7 @@ when defined(windows): # because we support Windows GUI applications, things get really # messy here... when useWinUnicode: - proc strEnd(cstr: wideCString, c = 0'i32): wideCString {. + proc strEnd(cstr: WideCString, c = 0'i32): WideCString {. importc: "wcschr", header: "<string.h>".} else: proc strEnd(cstr: cstring, c = 0'i32): cstring {. @@ -1035,9 +1035,9 @@ when defined(windows): while True: var eend = strEnd(e) add(environment, $e) - e = cast[wideCString](cast[TAddress](eend)+2) + e = cast[WideCString](cast[TAddress](eend)+2) if eend[1].int == 0: break - discard FreeEnvironmentStringsW(env) + discard freeEnvironmentStringsW(env) else: var env = getEnvironmentStringsA() @@ -1099,14 +1099,14 @@ proc getEnv*(key: string): TaintedString {.tags: [FReadEnv].} = if i >= 0: return TaintedString(substr(environment[i], find(environment[i], '=')+1)) else: - var env = cgetenv(key) + var env = c_getenv(key) if env == nil: return TaintedString("") result = TaintedString($env) proc existsEnv*(key: string): bool {.tags: [FReadEnv].} = ## Checks whether the environment variable named `key` exists. ## Returns true if it exists, false otherwise. - if cgetenv(key) != nil: return true + if c_getenv(key) != nil: return true else: return findEnvVar(key) >= 0 proc putEnv*(key, val: string) {.tags: [FWriteEnv].} = @@ -1152,15 +1152,15 @@ iterator walkFiles*(pattern: string): string {.tags: [FReadDir].} = ## notation is supported. when defined(windows): var - f: TWin32FindData + f: TWIN32_FIND_DATA res: int - res = findfirstFile(pattern, f) + res = findFirstFile(pattern, f) if res != -1: while true: if not skipFindData(f): yield splitFile(pattern).dir / extractFilename(getFilename(f)) if findnextFile(res, f) == 0'i32: break - findclose(res) + findClose(res) else: # here we use glob var f: TGlob @@ -1205,8 +1205,8 @@ iterator walkDir*(dir: string): tuple[kind: TPathComponent, path: string] {. ## dirA/fileA1.txt ## dirA/fileA2.txt when defined(windows): - var f: TWIN32_Find_Data - var h = findfirstFile(dir / "*", f) + var f: TWIN32_FIND_DATA + var h = findFirstFile(dir / "*", f) if h != -1: while true: var k = pcFile @@ -1215,7 +1215,7 @@ iterator walkDir*(dir: string): tuple[kind: TPathComponent, path: string] {. k = pcDir yield (k, dir / extractFilename(getFilename(f))) if findnextFile(h, f) == 0'i32: break - findclose(h) + findClose(h) else: var d = openDir(dir) if d != nil: @@ -1553,7 +1553,7 @@ proc getAppFilename*(): string {.rtl, extern: "nos$1", tags: [FReadIO].} = # /proc/<pid>/file when defined(windows): when useWinUnicode: - var buf = cast[wideCString](alloc(256*2)) + var buf = cast[WideCString](alloc(256*2)) var len = getModuleFileNameW(0, buf, 256) result = buf$len else: @@ -1614,15 +1614,15 @@ proc sleep*(milsecs: int) {.rtl, extern: "nos$1", tags: [FTime].} = a.tv_nsec = (milsecs mod 1000) * 1000 * 1000 discard posix.nanosleep(a, b) -proc getFileSize*(file: string): biggestInt {.rtl, extern: "nos$1", +proc getFileSize*(file: string): BiggestInt {.rtl, extern: "nos$1", tags: [FReadIO].} = ## returns the file size of `file`. Can raise ``EOS``. when defined(windows): - var a: TWin32FindData - var resA = findfirstFile(file, a) + var a: TWIN32_FIND_DATA + var resA = findFirstFile(file, a) if resA == -1: osError(osLastError()) result = rdFileSize(a) - findclose(resA) + findClose(resA) else: var f: TFile if open(f, file): diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 1f04b79025..49b4b6fabf 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -23,7 +23,7 @@ else: type TProcess = object of TObject when defined(windows): - FProcessHandle: Thandle + FProcessHandle: THandle inHandle, outHandle, errHandle: TFileHandle id: THandle else: @@ -108,7 +108,7 @@ proc execCmd*(command: string): int {.rtl, extern: "nosp$1", tags: [FExecIO].} proc startProcess*(command: string, workingDir: string = "", - args: openarray[string] = [], + args: openArray[string] = [], env: PStringTable = nil, options: set[TProcessOption] = {poStdErrToStdOut}): PProcess {.rtl, extern: "nosp$1", tags: [FExecIO, FReadEnv].} @@ -219,7 +219,7 @@ proc countProcessors*(): int {.rtl, extern: "nosp$1".} = ## returns the numer of the processors/cores the machine has. ## Returns 0 if it cannot be detected. when defined(windows): - var x = getenv("NUMBER_OF_PROCESSORS") + var x = getEnv("NUMBER_OF_PROCESSORS") if x.len > 0: result = parseInt(x.string) elif defined(macosx) or defined(bsd): var @@ -358,7 +358,7 @@ when defined(Windows) and not defined(useNimRtl): result.readDataImpl = hsReadData result.writeDataImpl = hsWriteData - proc buildCommandLine(a: string, args: openarray[string]): cstring = + proc buildCommandLine(a: string, args: openArray[string]): cstring = var res = quoteShell(a) for i in 0..high(args): res.add(' ') @@ -384,11 +384,11 @@ when defined(Windows) and not defined(useNimRtl): # O_RDONLY {.importc: "_O_RDONLY", header: "<fcntl.h>".}: int proc createPipeHandles(Rdhandle, WrHandle: var THandle) = - var piInheritablePipe: TSecurityAttributes - piInheritablePipe.nlength = SizeOf(TSecurityAttributes).cint + var piInheritablePipe: TSECURITY_ATTRIBUTES + piInheritablePipe.nlength = sizeof(TSECURITY_ATTRIBUTES).cint piInheritablePipe.lpSecurityDescriptor = nil piInheritablePipe.Binherithandle = 1 - if createPipe(Rdhandle, Wrhandle, piInheritablePipe, 1024) == 0'i32: + if createPipe(Rdhandle, WrHandle, piInheritablePipe, 1024) == 0'i32: osError(osLastError()) proc fileClose(h: THandle) {.inline.} = @@ -400,28 +400,28 @@ when defined(Windows) and not defined(useNimRtl): env: PStringTable = nil, options: set[TProcessOption] = {poStdErrToStdOut}): PProcess = var - si: TStartupInfo - procInfo: TProcessInformation + si: TSTARTUPINFO + procInfo: TPROCESS_INFORMATION success: int hi, ho, he: THandle new(result) - SI.cb = SizeOf(SI).cint + si.cb = sizeof(si).cint if poParentStreams notin options: - SI.dwFlags = STARTF_USESTDHANDLES # STARTF_USESHOWWINDOW or - CreatePipeHandles(SI.hStdInput, HI) - CreatePipeHandles(HO, Si.hStdOutput) + si.dwFlags = STARTF_USESTDHANDLES # STARTF_USESHOWWINDOW or + createPipeHandles(si.hStdInput, hi) + createPipeHandles(ho, si.hStdOutput) if poStdErrToStdOut in options: - SI.hStdError = SI.hStdOutput - HE = HO + si.hStdError = si.hStdOutput + he = ho else: - CreatePipeHandles(HE, Si.hStdError) + createPipeHandles(he, si.hStdError) result.inHandle = TFileHandle(hi) result.outHandle = TFileHandle(ho) result.errHandle = TFileHandle(he) else: - SI.hStdError = GetStdHandle(STD_ERROR_HANDLE) - SI.hStdInput = GetStdHandle(STD_INPUT_HANDLE) - SI.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE) + si.hStdError = getStdHandle(STD_ERROR_HANDLE) + si.hStdInput = getStdHandle(STD_INPUT_HANDLE) + si.hStdOutput = getStdHandle(STD_OUTPUT_HANDLE) result.inHandle = TFileHandle(si.hStdInput) result.outHandle = TFileHandle(si.hStdOutput) result.errHandle = TFileHandle(si.hStdError) @@ -442,17 +442,17 @@ when defined(Windows) and not defined(useNimRtl): var wwd = newWideCString(wd) success = winlean.CreateProcessW(nil, tmp, nil, nil, 1, NORMAL_PRIORITY_CLASS or CREATE_UNICODE_ENVIRONMENT, - ee, wwd, SI, ProcInfo) + ee, wwd, si, procInfo) else: success = winlean.CreateProcessA(nil, cmdl, nil, nil, 1, NORMAL_PRIORITY_CLASS, e, wd, SI, ProcInfo) let lastError = osLastError() if poParentStreams notin options: - FileClose(si.hStdInput) - FileClose(si.hStdOutput) + fileClose(si.hStdInput) + fileClose(si.hStdOutput) if poStdErrToStdOut notin options: - FileClose(si.hStdError) + fileClose(si.hStdError) if e != nil: dealloc(e) dealloc(cmdl) @@ -471,10 +471,10 @@ when defined(Windows) and not defined(useNimRtl): discard CloseHandle(p.FProcessHandle) proc suspend(p: PProcess) = - discard SuspendThread(p.FProcessHandle) + discard suspendThread(p.FProcessHandle) proc resume(p: PProcess) = - discard ResumeThread(p.FProcessHandle) + discard resumeThread(p.FProcessHandle) proc running(p: PProcess): bool = var x = waitForSingleObject(p.FProcessHandle, 50) @@ -482,22 +482,22 @@ when defined(Windows) and not defined(useNimRtl): proc terminate(p: PProcess) = if running(p): - discard TerminateProcess(p.FProcessHandle, 0) + discard terminateProcess(p.FProcessHandle, 0) proc waitForExit(p: PProcess, timeout: int = -1): int = - discard WaitForSingleObject(p.FProcessHandle, timeout.int32) + discard waitForSingleObject(p.FProcessHandle, timeout.int32) var res: int32 - discard GetExitCodeProcess(p.FProcessHandle, res) + discard getExitCodeProcess(p.FProcessHandle, res) result = res - discard CloseHandle(p.FProcessHandle) + discard closeHandle(p.FProcessHandle) proc peekExitCode(p: PProcess): int = var b = waitForSingleObject(p.FProcessHandle, 50) == WAIT_TIMEOUT if b: result = -1 else: var res: int32 - discard GetExitCodeProcess(p.FProcessHandle, res) + discard getExitCodeProcess(p.FProcessHandle, res) return res proc inputStream(p: PProcess): PStream = @@ -511,32 +511,32 @@ when defined(Windows) and not defined(useNimRtl): proc execCmd(command: string): int = var - si: TStartupInfo - procInfo: TProcessInformation + si: TSTARTUPINFO + procInfo: TPROCESS_INFORMATION process: THandle L: int32 - SI.cb = SizeOf(SI).cint - SI.hStdError = GetStdHandle(STD_ERROR_HANDLE) - SI.hStdInput = GetStdHandle(STD_INPUT_HANDLE) - SI.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE) + si.cb = sizeof(si).cint + si.hStdError = getStdHandle(STD_ERROR_HANDLE) + si.hStdInput = getStdHandle(STD_INPUT_HANDLE) + si.hStdOutput = getStdHandle(STD_OUTPUT_HANDLE) when useWinUnicode: var c = newWideCString(command) var res = winlean.CreateProcessW(nil, c, nil, nil, 0, - NORMAL_PRIORITY_CLASS, nil, nil, SI, ProcInfo) + NORMAL_PRIORITY_CLASS, nil, nil, si, procInfo) else: var res = winlean.CreateProcessA(nil, command, nil, nil, 0, NORMAL_PRIORITY_CLASS, nil, nil, SI, ProcInfo) if res == 0: osError(osLastError()) else: - Process = ProcInfo.hProcess - discard CloseHandle(ProcInfo.hThread) - if WaitForSingleObject(Process, INFINITE) != -1: - discard GetExitCodeProcess(Process, L) + process = procInfo.hProcess + discard closeHandle(procInfo.hThread) + if waitForSingleObject(process, INFINITE) != -1: + discard getExitCodeProcess(process, L) result = int(L) else: result = -1 - discard CloseHandle(Process) + discard closeHandle(process) proc select(readfds: var seq[PProcess], timeout = 500): int = assert readfds.len <= MAXIMUM_WAIT_OBJECTS diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index fa704bbcee..1be292af1c 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -50,7 +50,7 @@ when defined(os.ParamCount): result.cmd = cmdline else: result.cmd = "" - for i in countup(1, ParamCount()): + for i in countup(1, paramCount()): result.cmd = result.cmd & quoteIfContainsWhite(paramStr(i).string) & ' ' result.kind = cmdEnd result.key = TaintedString"" @@ -94,8 +94,8 @@ proc next*(p: var TOptParser) {. var i = p.pos while p.cmd[i] in {'\x09', ' '}: inc(i) p.pos = i - setlen(p.key.string, 0) - setlen(p.val.string, 0) + setLen(p.key.string, 0) + setLen(p.val.string, 0) if p.inShortState: handleShortOption(p) return diff --git a/lib/pure/parseutils.nim b/lib/pure/parseutils.nim index bccb274d67..6423b3ab07 100644 --- a/lib/pure/parseutils.nim +++ b/lib/pure/parseutils.nim @@ -189,7 +189,7 @@ proc captureBetween*(s: string, first: char, second = '\0', start = 0): string = {.push overflowChecks: on.} # this must be compiled with overflow checking turned on: -proc rawParseInt(s: string, b: var biggestInt, start = 0): int = +proc rawParseInt(s: string, b: var BiggestInt, start = 0): int = var sign: BiggestInt = -1 i = start @@ -207,12 +207,12 @@ proc rawParseInt(s: string, b: var biggestInt, start = 0): int = result = i - start {.pop.} # overflowChecks -proc parseBiggestInt*(s: string, number: var biggestInt, start = 0): int {. +proc parseBiggestInt*(s: string, number: var BiggestInt, start = 0): int {. rtl, extern: "npuParseBiggestInt", noSideEffect.} = ## parses an integer starting at `start` and stores the value into `number`. ## Result is the number of processed chars or 0 if there is no integer. ## `EOverflow` is raised if an overflow occurs. - var res: biggestInt + var res: BiggestInt # use 'res' for exception safety (don't write to 'number' in case of an # overflow exception: result = rawParseInt(s, res, start) @@ -223,7 +223,7 @@ proc parseInt*(s: string, number: var int, start = 0): int {. ## parses an integer starting at `start` and stores the value into `number`. ## Result is the number of processed chars or 0 if there is no integer. ## `EOverflow` is raised if an overflow occurs. - var res: biggestInt + var res: BiggestInt result = parseBiggestInt(s, res, start) if (sizeof(int) <= 4) and ((res < low(int)) or (res > high(int))): @@ -231,7 +231,7 @@ proc parseInt*(s: string, number: var int, start = 0): int {. else: number = int(res) -proc tenToThePowerOf(b: int): biggestFloat = +proc tenToThePowerOf(b: int): BiggestFloat = var b = b var a = 10.0 result = 1.0 @@ -242,7 +242,7 @@ proc tenToThePowerOf(b: int): biggestFloat = if b == 0: break a *= a -proc parseBiggestFloat*(s: string, number: var biggestFloat, start = 0): int {. +proc parseBiggestFloat*(s: string, number: var BiggestFloat, start = 0): int {. rtl, extern: "npuParseBiggestFloat", noSideEffect.} = ## parses a float starting at `start` and stores the value into `number`. ## Result is the number of processed chars or 0 if there occured a parsing @@ -319,7 +319,7 @@ proc parseFloat*(s: string, number: var float, start = 0): int {. ## parses a float starting at `start` and stores the value into `number`. ## Result is the number of processed chars or 0 if there occured a parsing ## error. - var bf: biggestFloat + var bf: BiggestFloat result = parseBiggestFloat(s, bf, start) number = bf diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index f5351c41c7..2ae37e3721 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -362,28 +362,28 @@ proc socketError*(socket: TSocket, err: int = -1, async = false) = else: SSLError("Unknown Error") if err == -1 and not (when defined(ssl): socket.isSSL else: false): - let lastError = OSLastError() + let lastError = osLastError() if async: when defined(windows): if lastError.int32 == WSAEWOULDBLOCK: return - else: OSError(lastError) + else: osError(lastError) else: if lastError.int32 == EAGAIN or lastError.int32 == EWOULDBLOCK: return else: OSError(lastError) - else: OSError(lastError) + else: osError(lastError) proc listen*(socket: TSocket, backlog = SOMAXCONN) {.tags: [FReadIO].} = ## Marks ``socket`` as accepting connections. ## ``Backlog`` specifies the maximum length of the ## queue of pending connections. - if listen(socket.fd, cint(backlog)) < 0'i32: OSError(OSLastError()) + if listen(socket.fd, cint(backlog)) < 0'i32: osError(osLastError()) proc invalidIp4(s: string) {.noreturn, noinline.} = raise newException(EInvalidValue, "invalid ip4 address: " & s) -proc parseIp4*(s: string): biggestInt = +proc parseIp4*(s: string): BiggestInt = ## parses an IP version 4 in dotted decimal form like "a.b.c.d". ## ## This is equivalent to `inet_ntoa`:idx:. @@ -410,14 +410,14 @@ proc parseIp4*(s: string): biggestInt = if j <= 0: invalidIp4(s) inc(i, j) if s[i] != '\0': invalidIp4(s) - result = biggestInt(a shl 24 or b shl 16 or c shl 8 or d) + result = BiggestInt(a shl 24 or b shl 16 or c shl 8 or d) template gaiNim(a, p, h, list: expr): stmt = block: - var gaiResult = getAddrInfo(a, $p, addr(h), list) + var gaiResult = getaddrinfo(a, $p, addr(h), list) if gaiResult != 0'i32: when defined(windows): - OSError(OSLastError()) + osError(osLastError()) else: raise newException(EOS, $gai_strerror(gaiResult)) @@ -437,7 +437,7 @@ proc bindAddr*(socket: TSocket, port = TPort(0), address = "") {. name.sin_addr.s_addr = sockets.htonl(INADDR_ANY) if bindSocket(socket.fd, cast[ptr TSockAddr](addr(name)), sizeof(name).TSockLen) < 0'i32: - OSError(OSLastError()) + osError(osLastError()) else: var hints: TAddrInfo var aiList: ptr TAddrInfo = nil @@ -446,7 +446,7 @@ proc bindAddr*(socket: TSocket, port = TPort(0), address = "") {. hints.ai_protocol = toInt(IPPROTO_TCP) gaiNim(address, port, hints, aiList) if bindSocket(socket.fd, aiList.ai_addr, aiList.ai_addrLen.TSockLen) < 0'i32: - OSError(OSLastError()) + osError(osLastError()) proc getSockName*(socket: TSocket): TPort = ## returns the socket's associated port number. @@ -460,37 +460,37 @@ proc getSockName*(socket: TSocket): TPort = var namelen = sizeof(name).TSockLen if getsockname(socket.fd, cast[ptr TSockAddr](addr(name)), addr(namelen)) == -1'i32: - OSError(OSLastError()) + osError(osLastError()) result = TPort(sockets.ntohs(name.sin_port)) template acceptAddrPlain(noClientRet, successRet: expr, sslImplementation: stmt): stmt {.immediate.} = assert(client != nil) var sockAddress: Tsockaddr_in - var addrLen = sizeof(sockAddress).TSockLen + var addrLen = sizeof(sockAddress).Tsocklen var sock = accept(server.fd, cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen)) if sock == osInvalidSocket: - let err = OSLastError() + let err = osLastError() when defined(windows): if err.int32 == WSAEINPROGRESS: - client = InvalidSocket + client = invalidSocket address = "" when noClientRet.int == -1: return else: return noClientRet - else: OSError(err) + else: osError(err) else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: - client = InvalidSocket + client = invalidSocket address = "" when noClientRet.int == -1: return else: return noClientRet - else: OSError(err) + else: osError(err) else: client.fd = sock client.isBuffered = server.isBuffered @@ -669,7 +669,7 @@ proc getServByPort*(port: TPort, proto: string): TServent {.tags: [FReadIO].} = result.port = TPort(s.s_port) result.proto = $s.s_proto -proc getHostByAddr*(ip: string): THostEnt {.tags: [FReadIO].} = +proc getHostByAddr*(ip: string): Thostent {.tags: [FReadIO].} = ## This function will lookup the hostname of an IP Address. var myaddr: TInAddr myaddr.s_addr = inet_addr(ip) @@ -677,7 +677,7 @@ proc getHostByAddr*(ip: string): THostEnt {.tags: [FReadIO].} = when defined(windows): var s = winlean.gethostbyaddr(addr(myaddr), sizeof(myaddr).cuint, cint(sockets.AF_INET)) - if s == nil: OSError(OSLastError()) + if s == nil: osError(osLastError()) else: var s = posix.gethostbyaddr(addr(myaddr), sizeof(myaddr).TSockLen, cint(posix.AF_INET)) @@ -698,13 +698,13 @@ proc getHostByAddr*(ip: string): THostEnt {.tags: [FReadIO].} = result.addrList = cstringArrayToSeq(s.h_addr_list) result.length = int(s.h_length) -proc getHostByName*(name: string): THostEnt {.tags: [FReadIO].} = +proc getHostByName*(name: string): Thostent {.tags: [FReadIO].} = ## This function will lookup the IP address of a hostname. when defined(Windows): var s = winlean.gethostbyname(name) else: var s = posix.gethostbyname(name) - if s == nil: OSError(OSLastError()) + if s == nil: osError(osLastError()) result.name = $s.h_name result.aliases = cstringArrayToSeq(s.h_aliases) when defined(windows): @@ -726,7 +726,7 @@ proc getSockOptInt*(socket: TSocket, level, optname: int): int {. var size = sizeof(res).TSockLen if getsockopt(socket.fd, cint(level), cint(optname), addr(res), addr(size)) < 0'i32: - OSError(OSLastError()) + osError(osLastError()) result = int(res) proc setSockOptInt*(socket: TSocket, level, optname, optval: int) {. @@ -735,7 +735,7 @@ proc setSockOptInt*(socket: TSocket, level, optname, optval: int) {. var value = cint(optval) if setsockopt(socket.fd, cint(level), cint(optname), addr(value), sizeof(value).TSockLen) < 0'i32: - OSError(OSLastError()) + osError(osLastError()) proc toCInt(opt: TSOBool): cint = case opt @@ -754,7 +754,7 @@ proc getSockOpt*(socket: TSocket, opt: TSOBool, level = SOL_SOCKET): bool {. var size = sizeof(res).TSockLen if getsockopt(socket.fd, cint(level), toCInt(opt), addr(res), addr(size)) < 0'i32: - OSError(OSLastError()) + osError(osLastError()) result = res != 0 proc setSockOpt*(socket: TSocket, opt: TSOBool, value: bool, level = SOL_SOCKET) {. @@ -763,7 +763,7 @@ proc setSockOpt*(socket: TSocket, opt: TSOBool, value: bool, level = SOL_SOCKET) var valuei = cint(if value: 1 else: 0) if setsockopt(socket.fd, cint(level), toCInt(opt), addr(valuei), sizeof(valuei).TSockLen) < 0'i32: - OSError(OSLastError()) + osError(osLastError()) proc connect*(socket: TSocket, address: string, port = TPort(0), af: TDomain = AF_INET) {.tags: [FReadIO].} = @@ -787,11 +787,11 @@ proc connect*(socket: TSocket, address: string, port = TPort(0), if connect(socket.fd, it.ai_addr, it.ai_addrlen.TSockLen) == 0'i32: success = true break - else: lastError = OSLastError() + else: lastError = osLastError() it = it.ai_next freeaddrinfo(aiList) - if not success: OSError(lastError) + if not success: osError(lastError) when defined(ssl): if socket.isSSL: @@ -852,7 +852,7 @@ proc connectAsync*(socket: TSocket, name: string, port = TPort(0), success = true break else: - lastError = OSLastError() + lastError = osLastError() when defined(windows): # Windows EINTR doesn't behave same as POSIX. if lastError.int32 == WSAEWOULDBLOCK: @@ -866,7 +866,7 @@ proc connectAsync*(socket: TSocket, name: string, port = TPort(0), it = it.ai_next freeaddrinfo(aiList) - if not success: OSError(lastError) + if not success: osError(lastError) when defined(ssl): if socket.isSSL: socket.sslNoHandshake = true @@ -912,7 +912,7 @@ when defined(ssl): else: SSLError("Socket is not an SSL socket.") -proc timeValFromMilliseconds(timeout = 500): TTimeVal = +proc timeValFromMilliseconds(timeout = 500): TTimeval = if timeout != -1: var seconds = timeout div 1000 result.tv_sec = seconds.int32 @@ -970,7 +970,7 @@ proc select*(readfds, writefds, exceptfds: var seq[TSocket], if buffersFilled > 0: return buffersFilled - var tv {.noInit.}: TTimeVal = timeValFromMilliseconds(timeout) + var tv {.noInit.}: TTimeval = timeValFromMilliseconds(timeout) var rd, wr, ex: TFdSet var m = 0 @@ -993,7 +993,7 @@ proc select*(readfds, writefds: var seq[TSocket], let buffersFilled = checkBuffer(readfds) if buffersFilled > 0: return buffersFilled - var tv {.noInit.}: TTimeVal = timeValFromMilliseconds(timeout) + var tv {.noInit.}: TTimeval = timeValFromMilliseconds(timeout) var rd, wr: TFdSet var m = 0 @@ -1017,7 +1017,7 @@ proc selectWrite*(writefds: var seq[TSocket], ## ## ``timeout`` is specified in miliseconds and ``-1`` can be specified for ## an unlimited time. - var tv {.noInit.}: TTimeVal = timeValFromMilliseconds(timeout) + var tv {.noInit.}: TTimeval = timeValFromMilliseconds(timeout) var wr: TFdSet var m = 0 @@ -1035,7 +1035,7 @@ proc select*(readfds: var seq[TSocket], timeout = 500): int = let buffersFilled = checkBuffer(readfds) if buffersFilled > 0: return buffersFilled - var tv {.noInit.}: TTimeVal = timeValFromMilliseconds(timeout) + var tv {.noInit.}: TTimeval = timeValFromMilliseconds(timeout) var rd: TFdSet var m = 0 @@ -1142,7 +1142,7 @@ proc waitFor(socket: TSocket, waited: var float, timeout, size: int, var s = @[socket] var startTime = epochTime() let selRet = select(s, timeout - int(waited * 1000.0)) - if selRet < 0: OSError(OSLastError()) + if selRet < 0: osError(osLastError()) if selRet != 1: raise newException(ETimeout, "Call to '" & funcName & "' timed out.") waited += (epochTime() - startTime) @@ -1180,7 +1180,7 @@ proc recv*(socket: TSocket, data: var string, size: int, timeout = -1): int = result = recv(socket, cstring(data), size, timeout) if result < 0: data.setLen(0) - socket.SocketError(result) + socket.socketError(result) data.setLen(result) proc recvAsync*(socket: TSocket, data: var string, size: int): int = @@ -1194,7 +1194,7 @@ proc recvAsync*(socket: TSocket, data: var string, size: int): int = result = recv(socket, cstring(data), size) if result < 0: data.setLen(0) - socket.SocketError(async = true) + socket.socketError(async = true) result = -1 data.setLen(result) @@ -1291,14 +1291,14 @@ proc readLine*(socket: TSocket, line: var TaintedString, timeout = -1) {. var c: char discard waitFor(socket, waited, timeout, 1, "readLine") var n = recv(socket, addr(c), 1) - if n < 0: OSError(OSLastError()) + if n < 0: osError(osLastError()) elif n == 0: return if c == '\r': discard waitFor(socket, waited, timeout, 1, "readLine") n = peekChar(socket, c) if n > 0 and c == '\L': discard recv(socket, addr(c), 1) - elif n <= 0: OSError(OSLastError()) + elif n <= 0: osError(osLastError()) addNlIfEmpty() return elif c == '\L': @@ -1352,7 +1352,7 @@ proc readLineAsync*(socket: TSocket, setLen(line.string, 0) template errorOrNone = - socket.SocketError(async = true) + socket.socketError(async = true) return ReadNone while true: @@ -1385,7 +1385,7 @@ proc recv*(socket: TSocket): TaintedString {.tags: [FReadIO], deprecated.} = var pos = 0 while true: var bytesRead = recv(socket, addr(string(result)[pos]), bufSize-1) - if bytesRead == -1: OSError(OSLastError()) + if bytesRead == -1: osError(osLastError()) setLen(result.string, pos + bytesRead) if bytesRead != bufSize-1: break # increase capacity: @@ -1454,11 +1454,11 @@ proc recvAsync*(socket: TSocket, s: var TaintedString): bool {. else: SSLError("Unknown Error") if bytesRead == -1 and not (when defined(ssl): socket.isSSL else: false): - let err = OSLastError() + let err = osLastError() when defined(windows): if err.int32 == WSAEWOULDBLOCK: return False - else: OSError(err) + else: osError(err) else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: return False @@ -1489,7 +1489,7 @@ proc recvFrom*(socket: TSocket, data: var string, length: int, data.setLen(length) var sockAddress: Tsockaddr_in var addrLen = sizeof(sockAddress).TSockLen - result = recvFrom(socket.fd, cstring(data), length.cint, flags.cint, + result = recvfrom(socket.fd, cstring(data), length.cint, flags.cint, cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen)) if result != -1: @@ -1497,7 +1497,7 @@ proc recvFrom*(socket: TSocket, data: var string, length: int, address = $inet_ntoa(sockAddress.sin_addr) port = ntohs(sockAddress.sin_port).TPort -proc recvFromAsync*(socket: TSocket, data: var String, length: int, +proc recvFromAsync*(socket: TSocket, data: var string, length: int, address: var string, port: var TPort, flags = 0'i32): bool {.tags: [FReadIO].} = ## Variant of ``recvFrom`` for non-blocking sockets. Unlike ``recvFrom``, @@ -1507,11 +1507,11 @@ proc recvFromAsync*(socket: TSocket, data: var String, length: int, result = true var callRes = recvFrom(socket, data, length, address, port, flags) if callRes < 0: - let err = OSLastError() + let err = osLastError() when defined(windows): if err.int32 == WSAEWOULDBLOCK: return False - else: OSError(err) + else: osError(err) else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: return False @@ -1565,7 +1565,7 @@ proc send*(socket: TSocket, data: string) {.tags: [FWriteIO].} = if socket.isSSL: SSLError() - OSError(OSLastError()) + osError(osLastError()) if sent != data.len: raise newException(EOS, "Could not send all data.") @@ -1598,11 +1598,11 @@ proc sendAsync*(socket: TSocket, data: string): int {.tags: [FWriteIO].} = else: return if result == -1: - let err = OSLastError() + let err = osLastError() when defined(windows): if err.int32 == WSAEINPROGRESS: return 0 - else: OSError(err) + else: osError(err) else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: return 0 @@ -1633,7 +1633,7 @@ proc sendTo*(socket: TSocket, address: string, port: TPort, data: pointer, var success = false var it = aiList while it != nil: - result = sendTo(socket.fd, data, size.cint, flags.cint, it.ai_addr, + result = sendto(socket.fd, data, size.cint, flags.cint, it.ai_addr, it.ai_addrlen.TSockLen) if result != -1'i32: success = true @@ -1662,7 +1662,7 @@ proc setBlocking(s: TSocket, blocking: bool) = when defined(Windows): var mode = clong(ord(not blocking)) # 1 for non-blocking, 0 for blocking if ioctlsocket(s.fd, FIONBIO, addr(mode)) == -1: - OSError(OSLastError()) + osError(osLastError()) else: # BSD sockets var x: int = fcntl(s.fd, F_GETFL, 0) if x == -1: @@ -1709,7 +1709,7 @@ proc isBlocking*(socket: TSocket): bool = not socket.nonblocking ## Determines whether ``socket`` is blocking. when defined(Windows): - var wsa: TWSADATA - if WSAStartup(0x0101'i16, addr wsa) != 0: OSError(OSLastError()) + var wsa: TWSAData + if WSAStartup(0x0101'i16, addr wsa) != 0: osError(osLastError()) diff --git a/lib/pure/streams.nim b/lib/pure/streams.nim index 764471b782..302742eb41 100644 --- a/lib/pure/streams.nim +++ b/lib/pure/streams.nim @@ -249,7 +249,7 @@ proc fsClose(s: PStream) = close(PFileStream(s).f) PFileStream(s).f = nil proc fsFlush(s: PStream) = flushFile(PFileStream(s).f) -proc fsAtEnd(s: PStream): bool = return EndOfFile(PFileStream(s).f) +proc fsAtEnd(s: PStream): bool = return endOfFile(PFileStream(s).f) proc fsSetPosition(s: PStream, pos: int) = setFilePos(PFileStream(s).f, pos) proc fsGetPosition(s: PStream): int = return int(getFilePos(PFileStream(s).f)) @@ -277,7 +277,7 @@ proc newFileStream*(filename: string, mode: TFileMode): PFileStream = ## If the file cannot be opened, nil is returned. See the `system ## <system.html>`_ module for a list of available TFileMode enums. var f: TFile - if Open(f, filename, mode): result = newFileStream(f) + if open(f, filename, mode): result = newFileStream(f) when true: diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim index d8bc94176b..7003acfcfa 100644 --- a/lib/pure/strtabs.nim +++ b/lib/pure/strtabs.nim @@ -91,7 +91,7 @@ proc nextTry(h, maxHash: THash): THash {.inline.} = proc rawGet(t: PStringTable, key: string): int = var h: THash = myhash(t, key) and high(t.data) # start with real hash value while not isNil(t.data[h].key): - if mycmp(t, t.data[h].key, key): + if myCmp(t, t.data[h].key, key): return h h = nextTry(h, high(t.data)) result = - 1 @@ -100,7 +100,7 @@ proc `[]`*(t: PStringTable, key: string): string {.rtl, extern: "nstGet".} = ## retrieves the value at ``t[key]``. If `key` is not in `t`, "" is returned ## and no exception is raised. One can check with ``hasKey`` whether the key ## exists. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: result = t.data[index].val else: result = "" @@ -108,7 +108,7 @@ proc mget*(t: PStringTable, key: string): var string {. rtl, extern: "nstTake".} = ## retrieves the location at ``t[key]``. If `key` is not in `t`, the ## ``EInvalidKey`` exception is raised. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: result = t.data[index].val else: raise newException(EInvalidKey, "key does not exist: " & key) @@ -127,17 +127,17 @@ proc enlarge(t: PStringTable) = var n: TKeyValuePairSeq newSeq(n, len(t.data) * growthFactor) for i in countup(0, high(t.data)): - if not isNil(t.data[i].key): RawInsert(t, n, t.data[i].key, t.data[i].val) + if not isNil(t.data[i].key): rawInsert(t, n, t.data[i].key, t.data[i].val) swap(t.data, n) proc `[]=`*(t: PStringTable, key, val: string) {.rtl, extern: "nstPut".} = ## puts a (key, value)-pair into `t`. - var index = RawGet(t, key) + var index = rawGet(t, key) if index >= 0: t.data[index].val = val else: - if mustRehash(len(t.data), t.counter): Enlarge(t) - RawInsert(t, t.data, key, val) + if mustRehash(len(t.data), t.counter): enlarge(t) + rawInsert(t, t.data, key, val) inc(t.counter) proc raiseFormatException(s: string) = @@ -184,7 +184,7 @@ proc newStringTable*(keyValuePairs: varargs[tuple[key, val: string]], ## var mytab = newStringTable({"key1": "val1", "key2": "val2"}, ## modeCaseInsensitive) result = newStringTable(mode) - for key, val in items(keyvaluePairs): result[key] = val + for key, val in items(keyValuePairs): result[key] = val proc `%`*(f: string, t: PStringTable, flags: set[TFormatFlag] = {}): string {. rtl, extern: "nstFormat".} = diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 388a76e710..b7e3de6cfc 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -1,170 +1,170 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2012 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 `re <re.html>`_ for regular expression support. -## See the module `pegs <pegs.html>`_ for PEG support. - -import parseutils - -{.deadCodeElim: on.} - -{.push debugger:off .} # the user does not want to trace a part - # of the standard library! - -include "system/inclrtl" - -type - TCharSet* = set[char] # for compatibility with Nim - -const - Whitespace* = {' ', '\t', '\v', '\r', '\l', '\f'} - ## All the characters that count as whitespace. - - Letters* = {'A'..'Z', 'a'..'z'} - ## the set of letters - - Digits* = {'0'..'9'} - ## the set of digits - - HexDigits* = {'0'..'9', 'A'..'F', 'a'..'f'} - ## the set of hexadecimal digits - - IdentChars* = {'a'..'z', 'A'..'Z', '0'..'9', '_'} - ## the set of characters an identifier can consist of - - IdentStartChars* = {'a'..'z', 'A'..'Z', '_'} - ## the set of characters an identifier can start with - - NewLines* = {'\13', '\10'} - ## the set of characters a newline terminator can start with - -proc toLower*(c: Char): Char {.noSideEffect, procvar, - rtl, extern: "nsuToLowerChar".} = - ## Converts `c` into lower case. This works only for the letters A-Z. - ## See `unicode.toLower` for a version that works for any Unicode character. - if c in {'A'..'Z'}: - result = chr(ord(c) + (ord('a') - ord('A'))) - else: - result = c - -proc toLower*(s: string): string {.noSideEffect, procvar, - rtl, extern: "nsuToLowerStr".} = - ## Converts `s` into lower case. This works only for the letters A-Z. - ## See `unicode.toLower` for a version that works for any Unicode character. - result = newString(len(s)) - for i in 0..len(s) - 1: - result[i] = toLower(s[i]) - -proc toUpper*(c: Char): Char {.noSideEffect, procvar, - rtl, extern: "nsuToUpperChar".} = - ## Converts `c` into upper case. This works only for the letters a-z. - ## See `unicode.toUpper` for a version that works for any Unicode character. - if c in {'a'..'z'}: - result = Chr(Ord(c) - (Ord('a') - Ord('A'))) - else: - result = c - -proc toUpper*(s: string): string {.noSideEffect, procvar, - rtl, extern: "nsuToUpperStr".} = - ## Converts `s` into upper case. This works only for the letters a-z. - ## See `unicode.toUpper` for a version that works for any Unicode character. - result = newString(len(s)) - for i in 0..len(s) - 1: - result[i] = toUpper(s[i]) - -proc capitalize*(s: string): string {.noSideEffect, procvar, - rtl, extern: "nsuCapitalize".} = - ## Converts the first character of `s` into upper case. - ## This works only for the letters a-z. - result = toUpper(s[0]) & substr(s, 1) - -proc normalize*(s: string): string {.noSideEffect, procvar, - rtl, extern: "nsuNormalize".} = - ## Normalizes the string `s`. That means to convert it to lower case and - ## remove any '_'. This is needed for Nimrod identifiers for example. - result = newString(s.len) - var j = 0 - for i in 0..len(s) - 1: - if s[i] in {'A'..'Z'}: - result[j] = chr(ord(s[i]) + (ord('a') - ord('A'))) - inc j - elif s[i] != '_': - result[j] = s[i] - inc j - if j != s.len: setLen(result, j) - -proc cmpIgnoreCase*(a, b: string): int {.noSideEffect, - rtl, extern: "nsuCmpIgnoreCase", procvar, operator: 4.} = - ## Compares two strings in a case insensitive manner. Returns: - ## - ## | 0 iff a == b - ## | < 0 iff a < b - ## | > 0 iff a > b - var i = 0 - var m = min(a.len, b.len) - while i < m: - result = ord(toLower(a[i])) - ord(toLower(b[i])) - if result != 0: return - inc(i) - result = a.len - b.len - -{.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 {.noSideEffect, - rtl, extern: "nsuCmpIgnoreStyle", procvar, operator: 3.} = - ## 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 - var i = 0 - var j = 0 - while true: - while a[i] == '_': inc(i) - while b[j] == '_': inc(j) # BUGFIX: typo - var aa = toLower(a[i]) - var bb = toLower(b[j]) - result = ord(aa) - ord(bb) - if result != 0 or aa == '\0': break - inc(i) - inc(j) - -{.pop.} - -proc strip*(s: string, leading = true, trailing = true): string {.noSideEffect, - rtl, extern: "nsuStrip", operator: 5.} = - ## Strips whitespace from `s` and returns the resulting string. - ## If `leading` is true, leading whitespace is stripped. - ## If `trailing` is true, trailing whitespace is stripped. - const - chars: set[Char] = Whitespace - var - first = 0 - last = len(s)-1 - if leading: - while s[first] in chars: inc(first) - if trailing: - while last >= 0 and s[last] in chars: dec(last) - result = substr(s, first, last) - -proc toOctal*(c: char): string {.noSideEffect, rtl, extern: "nsuToOctal".} = - ## Converts a character `c` to its octal representation. The resulting - ## string may not have a leading zero. Its length is always exactly 3. - result = newString(3) - var val = ord(c) - for i in countdown(2, 0): - result[i] = Chr(val mod 8 + ord('0')) - val = val div 8 - +# +# +# Nimrod's Runtime Library +# (c) Copyright 2012 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 `re <re.html>`_ for regular expression support. +## See the module `pegs <pegs.html>`_ for PEG support. + +import parseutils + +{.deadCodeElim: on.} + +{.push debugger:off .} # the user does not want to trace a part + # of the standard library! + +include "system/inclrtl" + +type + TCharSet* = set[char] # for compatibility with Nim + +const + Whitespace* = {' ', '\t', '\v', '\r', '\l', '\f'} + ## All the characters that count as whitespace. + + Letters* = {'A'..'Z', 'a'..'z'} + ## the set of letters + + Digits* = {'0'..'9'} + ## the set of digits + + HexDigits* = {'0'..'9', 'A'..'F', 'a'..'f'} + ## the set of hexadecimal digits + + IdentChars* = {'a'..'z', 'A'..'Z', '0'..'9', '_'} + ## the set of characters an identifier can consist of + + IdentStartChars* = {'a'..'z', 'A'..'Z', '_'} + ## the set of characters an identifier can start with + + NewLines* = {'\13', '\10'} + ## the set of characters a newline terminator can start with + +proc toLower*(c: char): char {.noSideEffect, procvar, + rtl, extern: "nsuToLowerChar".} = + ## Converts `c` into lower case. This works only for the letters A-Z. + ## See `unicode.toLower` for a version that works for any Unicode character. + if c in {'A'..'Z'}: + result = chr(ord(c) + (ord('a') - ord('A'))) + else: + result = c + +proc toLower*(s: string): string {.noSideEffect, procvar, + rtl, extern: "nsuToLowerStr".} = + ## Converts `s` into lower case. This works only for the letters A-Z. + ## See `unicode.toLower` for a version that works for any Unicode character. + result = newString(len(s)) + for i in 0..len(s) - 1: + result[i] = toLower(s[i]) + +proc toUpper*(c: char): char {.noSideEffect, procvar, + rtl, extern: "nsuToUpperChar".} = + ## Converts `c` into upper case. This works only for the letters a-z. + ## See `unicode.toUpper` for a version that works for any Unicode character. + if c in {'a'..'z'}: + result = chr(ord(c) - (Ord('a') - Ord('A'))) + else: + result = c + +proc toUpper*(s: string): string {.noSideEffect, procvar, + rtl, extern: "nsuToUpperStr".} = + ## Converts `s` into upper case. This works only for the letters a-z. + ## See `unicode.toUpper` for a version that works for any Unicode character. + result = newString(len(s)) + for i in 0..len(s) - 1: + result[i] = toUpper(s[i]) + +proc capitalize*(s: string): string {.noSideEffect, procvar, + rtl, extern: "nsuCapitalize".} = + ## Converts the first character of `s` into upper case. + ## This works only for the letters a-z. + result = toUpper(s[0]) & substr(s, 1) + +proc normalize*(s: string): string {.noSideEffect, procvar, + rtl, extern: "nsuNormalize".} = + ## Normalizes the string `s`. That means to convert it to lower case and + ## remove any '_'. This is needed for Nimrod identifiers for example. + result = newString(s.len) + var j = 0 + for i in 0..len(s) - 1: + if s[i] in {'A'..'Z'}: + result[j] = chr(ord(s[i]) + (ord('a') - ord('A'))) + inc j + elif s[i] != '_': + result[j] = s[i] + inc j + if j != s.len: setLen(result, j) + +proc cmpIgnoreCase*(a, b: string): int {.noSideEffect, + rtl, extern: "nsuCmpIgnoreCase", procvar, operator: 4.} = + ## Compares two strings in a case insensitive manner. Returns: + ## + ## | 0 iff a == b + ## | < 0 iff a < b + ## | > 0 iff a > b + var i = 0 + var m = min(a.len, b.len) + while i < m: + result = ord(toLower(a[i])) - ord(toLower(b[i])) + if result != 0: return + inc(i) + result = a.len - b.len + +{.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 {.noSideEffect, + rtl, extern: "nsuCmpIgnoreStyle", procvar, operator: 3.} = + ## 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 + var i = 0 + var j = 0 + while true: + while a[i] == '_': inc(i) + while b[j] == '_': inc(j) # BUGFIX: typo + var aa = toLower(a[i]) + var bb = toLower(b[j]) + result = ord(aa) - ord(bb) + if result != 0 or aa == '\0': break + inc(i) + inc(j) + +{.pop.} + +proc strip*(s: string, leading = true, trailing = true): string {.noSideEffect, + rtl, extern: "nsuStrip", operator: 5.} = + ## Strips whitespace from `s` and returns the resulting string. + ## If `leading` is true, leading whitespace is stripped. + ## If `trailing` is true, trailing whitespace is stripped. + const + chars: set[char] = Whitespace + var + first = 0 + last = len(s)-1 + if leading: + while s[first] in chars: inc(first) + if trailing: + while last >= 0 and s[last] in chars: dec(last) + result = substr(s, first, last) + +proc toOctal*(c: char): string {.noSideEffect, rtl, extern: "nsuToOctal".} = + ## Converts a character `c` to its octal representation. The resulting + ## string may not have a leading zero. Its length is always exactly 3. + result = newString(3) + var val = ord(c) + for i in countdown(2, 0): + result[i] = chr(val mod 8 + ord('0')) + val = val div 8 + iterator split*(s: string, seps: set[char] = Whitespace): string = ## Splits the string `s` into substrings using a group of separators. ## @@ -209,199 +209,199 @@ iterator split*(s: string, seps: set[char] = Whitespace): string = ## "08" ## "08.398990" ## - var last = 0 - assert(not ('\0' in seps)) - while last < len(s): - while s[last] in seps: inc(last) - var first = last - while last < len(s) and s[last] not_in seps: inc(last) # BUGFIX! - if first <= last-1: - yield substr(s, first, last-1) - -iterator split*(s: string, sep: char): string = - ## Splits the string `s` into substrings using a single separator. - ## - ## Substrings are separated by the character `sep`. - ## Unlike the version of the iterator which accepts a set of separator - ## characters, this proc will not coalesce groups of the - ## separator, returning a string for each found character. The code: - ## - ## .. code-block:: nimrod - ## for word in split(";;this;is;an;;example;;;", ';'): - ## writeln(stdout, word) - ## - ## Results in: - ## - ## .. code-block:: - ## "" - ## "" - ## "this" - ## "is" - ## "an" - ## "" - ## "example" - ## "" - ## "" - ## "" - ## - var last = 0 - assert('\0' != sep) - if len(s) > 0: - # `<=` is correct here for the edge cases! - while last <= len(s): - var first = last - while last < len(s) and s[last] != sep: inc(last) - yield substr(s, first, last-1) - inc(last) - -iterator splitLines*(s: string): string = - ## Splits the string `s` into its containing lines. Every newline - ## combination (CR, LF, CR-LF) is supported. The result strings contain - ## no trailing ``\n``. - ## - ## Example: - ## - ## .. code-block:: nimrod - ## for line in splitLines("\nthis\nis\nan\n\nexample\n"): - ## writeln(stdout, line) - ## - ## Results in: - ## - ## .. code-block:: nimrod - ## "" - ## "this" - ## "is" - ## "an" - ## "" - ## "example" - ## "" - var first = 0 - var last = 0 - while true: - while s[last] notin {'\0', '\c', '\l'}: inc(last) - yield substr(s, first, last-1) - # skip newlines: - if s[last] == '\l': inc(last) - elif s[last] == '\c': - inc(last) - if s[last] == '\l': inc(last) - else: break # was '\0' - first = last - -proc splitLines*(s: string): seq[string] {.noSideEffect, - rtl, extern: "nsuSplitLines".} = - ## The same as the `splitLines` iterator, but is a proc that returns a - ## sequence of substrings. - accumulateResult(splitLines(s)) - -proc countLines*(s: string): int {.noSideEffect, - rtl, extern: "nsuCountLines".} = - ## same as ``len(splitLines(s))``, but much more efficient. - var i = 0 - while i < s.len: - case s[i] - of '\c': - if s[i+1] == '\l': inc i - inc result - of '\l': inc result - else: nil - inc i - -proc split*(s: string, seps: set[char] = Whitespace): seq[string] {. - noSideEffect, rtl, extern: "nsuSplitCharSet".} = - ## The same as the `split` iterator, but is a proc that returns a - ## sequence of substrings. - accumulateResult(split(s, seps)) - -proc split*(s: string, sep: char): seq[string] {.noSideEffect, - rtl, extern: "nsuSplitChar".} = - ## The same as the `split` iterator, but is a proc that returns a sequence - ## of substrings. - accumulateResult(split(s, sep)) - -proc toHex*(x: BiggestInt, len: int): string {.noSideEffect, - rtl, extern: "nsuToHex".} = - ## 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 an unsigned value. - const - HexChars = "0123456789ABCDEF" - var - shift: BiggestInt - result = newString(len) - for j in countdown(len-1, 0): - result[j] = HexChars[toU32(x shr shift) and 0xF'i32] - shift = shift + 4 - -proc intToStr*(x: int, minchars: int = 1): string {.noSideEffect, - rtl, extern: "nsuIntToStr".} = - ## Converts `x` to its decimal representation. The resulting string - ## will be minimally `minchars` characters long. This is achieved by - ## adding leading zeros. - result = $abs(x) - for i in 1 .. minchars - len(result): - result = '0' & result - if x < 0: - result = '-' & result - -proc parseInt*(s: string): int {.noSideEffect, procvar, - rtl, extern: "nsuParseInt".} = - ## Parses a decimal integer value contained in `s`. If `s` is not - ## a valid integer, `EInvalidValue` is raised. - var L = parseutils.parseInt(s, result, 0) - if L != s.len or L == 0: - raise newException(EInvalidValue, "invalid integer: " & s) - -proc parseBiggestInt*(s: string): biggestInt {.noSideEffect, procvar, - rtl, extern: "nsuParseBiggestInt".} = - ## Parses a decimal integer value contained in `s`. If `s` is not - ## a valid integer, `EInvalidValue` is raised. - var L = parseutils.parseBiggestInt(s, result, 0) - if L != s.len or L == 0: - raise newException(EInvalidValue, "invalid integer: " & s) - -proc parseFloat*(s: string): float {.noSideEffect, procvar, - rtl, extern: "nsuParseFloat".} = - ## Parses a decimal floating point value contained in `s`. If `s` is not - ## a valid floating point number, `EInvalidValue` is raised. ``NAN``, - ## ``INF``, ``-INF`` are also supported (case insensitive comparison). - var L = parseutils.parseFloat(s, result, 0) - if L != s.len or L == 0: - raise newException(EInvalidValue, "invalid float: " & s) - -proc parseHexInt*(s: string): int {.noSideEffect, procvar, - rtl, extern: "nsuParseHexInt".} = - ## Parses a hexadecimal integer value contained in `s`. If `s` is not - ## a valid integer, `EInvalidValue` is raised. `s` can have one of the - ## following optional prefixes: ``0x``, ``0X``, ``#``. - ## Underscores within `s` are ignored. - var i = 0 - if s[i] == '0' and (s[i+1] == 'x' or s[i+1] == 'X'): inc(i, 2) - elif s[i] == '#': inc(i) - while true: - case s[i] - of '_': inc(i) - of '0'..'9': - result = result shl 4 or (ord(s[i]) - ord('0')) - inc(i) - of 'a'..'f': - result = result shl 4 or (ord(s[i]) - ord('a') + 10) - inc(i) - of 'A'..'F': - result = result shl 4 or (ord(s[i]) - ord('A') + 10) - inc(i) - of '\0': break - else: raise newException(EInvalidValue, "invalid integer: " & s) - -proc parseBool*(s: string): bool = - ## Parses a value into a `bool`. If ``s`` is one of the following values: - ## ``y, yes, true, 1, on``, then returns `true`. If ``s`` is one of the - ## following values: ``n, no, false, 0, off``, then returns `false`. - ## If ``s`` is something else a ``EInvalidValue`` exception is raised. - case normalize(s) - of "y", "yes", "true", "1", "on": result = true - of "n", "no", "false", "0", "off": result = false - else: raise newException(EInvalidValue, "cannot interpret as a bool: " & s) + var last = 0 + assert(not ('\0' in seps)) + while last < len(s): + while s[last] in seps: inc(last) + var first = last + while last < len(s) and s[last] not_in seps: inc(last) # BUGFIX! + if first <= last-1: + yield substr(s, first, last-1) + +iterator split*(s: string, sep: char): string = + ## Splits the string `s` into substrings using a single separator. + ## + ## Substrings are separated by the character `sep`. + ## Unlike the version of the iterator which accepts a set of separator + ## characters, this proc will not coalesce groups of the + ## separator, returning a string for each found character. The code: + ## + ## .. code-block:: nimrod + ## for word in split(";;this;is;an;;example;;;", ';'): + ## writeln(stdout, word) + ## + ## Results in: + ## + ## .. code-block:: + ## "" + ## "" + ## "this" + ## "is" + ## "an" + ## "" + ## "example" + ## "" + ## "" + ## "" + ## + var last = 0 + assert('\0' != sep) + if len(s) > 0: + # `<=` is correct here for the edge cases! + while last <= len(s): + var first = last + while last < len(s) and s[last] != sep: inc(last) + yield substr(s, first, last-1) + inc(last) + +iterator splitLines*(s: string): string = + ## Splits the string `s` into its containing lines. Every newline + ## combination (CR, LF, CR-LF) is supported. The result strings contain + ## no trailing ``\n``. + ## + ## Example: + ## + ## .. code-block:: nimrod + ## for line in splitLines("\nthis\nis\nan\n\nexample\n"): + ## writeln(stdout, line) + ## + ## Results in: + ## + ## .. code-block:: nimrod + ## "" + ## "this" + ## "is" + ## "an" + ## "" + ## "example" + ## "" + var first = 0 + var last = 0 + while true: + while s[last] notin {'\0', '\c', '\l'}: inc(last) + yield substr(s, first, last-1) + # skip newlines: + if s[last] == '\l': inc(last) + elif s[last] == '\c': + inc(last) + if s[last] == '\l': inc(last) + else: break # was '\0' + first = last + +proc splitLines*(s: string): seq[string] {.noSideEffect, + rtl, extern: "nsuSplitLines".} = + ## The same as the `splitLines` iterator, but is a proc that returns a + ## sequence of substrings. + accumulateResult(splitLines(s)) + +proc countLines*(s: string): int {.noSideEffect, + rtl, extern: "nsuCountLines".} = + ## same as ``len(splitLines(s))``, but much more efficient. + var i = 0 + while i < s.len: + case s[i] + of '\c': + if s[i+1] == '\l': inc i + inc result + of '\l': inc result + else: nil + inc i + +proc split*(s: string, seps: set[char] = Whitespace): seq[string] {. + noSideEffect, rtl, extern: "nsuSplitCharSet".} = + ## The same as the `split` iterator, but is a proc that returns a + ## sequence of substrings. + accumulateResult(split(s, seps)) + +proc split*(s: string, sep: char): seq[string] {.noSideEffect, + rtl, extern: "nsuSplitChar".} = + ## The same as the `split` iterator, but is a proc that returns a sequence + ## of substrings. + accumulateResult(split(s, sep)) + +proc toHex*(x: BiggestInt, len: int): string {.noSideEffect, + rtl, extern: "nsuToHex".} = + ## 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 an unsigned value. + const + HexChars = "0123456789ABCDEF" + var + shift: BiggestInt + result = newString(len) + for j in countdown(len-1, 0): + result[j] = HexChars[toU32(x shr shift) and 0xF'i32] + shift = shift + 4 + +proc intToStr*(x: int, minchars: int = 1): string {.noSideEffect, + rtl, extern: "nsuIntToStr".} = + ## Converts `x` to its decimal representation. The resulting string + ## will be minimally `minchars` characters long. This is achieved by + ## adding leading zeros. + result = $abs(x) + for i in 1 .. minchars - len(result): + result = '0' & result + if x < 0: + result = '-' & result + +proc parseInt*(s: string): int {.noSideEffect, procvar, + rtl, extern: "nsuParseInt".} = + ## Parses a decimal integer value contained in `s`. If `s` is not + ## a valid integer, `EInvalidValue` is raised. + var L = parseutils.parseInt(s, result, 0) + if L != s.len or L == 0: + raise newException(EInvalidValue, "invalid integer: " & s) + +proc parseBiggestInt*(s: string): BiggestInt {.noSideEffect, procvar, + rtl, extern: "nsuParseBiggestInt".} = + ## Parses a decimal integer value contained in `s`. If `s` is not + ## a valid integer, `EInvalidValue` is raised. + var L = parseutils.parseBiggestInt(s, result, 0) + if L != s.len or L == 0: + raise newException(EInvalidValue, "invalid integer: " & s) + +proc parseFloat*(s: string): float {.noSideEffect, procvar, + rtl, extern: "nsuParseFloat".} = + ## Parses a decimal floating point value contained in `s`. If `s` is not + ## a valid floating point number, `EInvalidValue` is raised. ``NAN``, + ## ``INF``, ``-INF`` are also supported (case insensitive comparison). + var L = parseutils.parseFloat(s, result, 0) + if L != s.len or L == 0: + raise newException(EInvalidValue, "invalid float: " & s) + +proc parseHexInt*(s: string): int {.noSideEffect, procvar, + rtl, extern: "nsuParseHexInt".} = + ## Parses a hexadecimal integer value contained in `s`. If `s` is not + ## a valid integer, `EInvalidValue` is raised. `s` can have one of the + ## following optional prefixes: ``0x``, ``0X``, ``#``. + ## Underscores within `s` are ignored. + var i = 0 + if s[i] == '0' and (s[i+1] == 'x' or s[i+1] == 'X'): inc(i, 2) + elif s[i] == '#': inc(i) + while true: + case s[i] + of '_': inc(i) + of '0'..'9': + result = result shl 4 or (ord(s[i]) - ord('0')) + inc(i) + of 'a'..'f': + result = result shl 4 or (ord(s[i]) - ord('a') + 10) + inc(i) + of 'A'..'F': + result = result shl 4 or (ord(s[i]) - ord('A') + 10) + inc(i) + of '\0': break + else: raise newException(EInvalidValue, "invalid integer: " & s) + +proc parseBool*(s: string): bool = + ## Parses a value into a `bool`. If ``s`` is one of the following values: + ## ``y, yes, true, 1, on``, then returns `true`. If ``s`` is one of the + ## following values: ``n, no, false, 0, off``, then returns `false`. + ## If ``s`` is something else a ``EInvalidValue`` exception is raised. + case normalize(s) + of "y", "yes", "true", "1", "on": result = true + of "n", "no", "false", "0", "off": result = false + else: raise newException(EInvalidValue, "cannot interpret as a bool: " & s) proc parseEnum*[T: enum](s: string): T = ## parses an enum ``T``. Raises ``EInvalidValue`` for an invalid value in @@ -418,30 +418,30 @@ proc parseEnum*[T: enum](s: string, default: T): T = if cmpIgnoreStyle(s, $e) == 0: return e result = default - -proc repeatChar*(count: int, c: Char = ' '): string {.noSideEffect, - rtl, extern: "nsuRepeatChar".} = - ## Returns a string of length `count` consisting only of - ## the character `c`. You can use this proc to left align strings. Example: - ## - ## .. code-block:: nimrod - ## let - ## width = 15 - ## text1 = "Hello user!" - ## text2 = "This is a very long string" - ## echo text1 & repeatChar(max(0, width - text1.len)) & "|" - ## echo text2 & repeatChar(max(0, width - text2.len)) & "|" - result = newString(count) - for i in 0..count-1: result[i] = c - -proc repeatStr*(count: int, s: string): string {.noSideEffect, - rtl, extern: "nsuRepeatStr".} = - ## Returns `s` concatenated `count` times. - result = newStringOfCap(count*s.len) - for i in 0..count-1: result.add(s) - -proc align*(s: string, count: int, padding = ' '): string {. - noSideEffect, rtl, extern: "nsuAlignString".} = + +proc repeatChar*(count: int, c: char = ' '): string {.noSideEffect, + rtl, extern: "nsuRepeatChar".} = + ## Returns a string of length `count` consisting only of + ## the character `c`. You can use this proc to left align strings. Example: + ## + ## .. code-block:: nimrod + ## let + ## width = 15 + ## text1 = "Hello user!" + ## text2 = "This is a very long string" + ## echo text1 & repeatChar(max(0, width - text1.len)) & "|" + ## echo text2 & repeatChar(max(0, width - text2.len)) & "|" + result = newString(count) + for i in 0..count-1: result[i] = c + +proc repeatStr*(count: int, s: string): string {.noSideEffect, + rtl, extern: "nsuRepeatStr".} = + ## Returns `s` concatenated `count` times. + result = newStringOfCap(count*s.len) + for i in 0..count-1: result.add(s) + +proc align*(s: string, count: int, padding = ' '): string {. + noSideEffect, rtl, extern: "nsuAlignString".} = ## Aligns a string `s` with `padding`, so that is of length `count`. ## `padding` characters (by default spaces) are added before `s` resulting in ## right alignment. If ``s.len >= count``, no spaces are added and `s` is @@ -453,247 +453,247 @@ proc align*(s: string, count: int, padding = ' '): string {. ## assert align("a", 0) == "a" ## assert align("1232", 6) == " 1232" ## assert align("1232", 6, '#') == "##1232" - if s.len < count: - result = newString(count) - let spaces = count - s.len - for i in 0..spaces-1: result[i] = padding - for i in spaces..count-1: result[i] = s[i-spaces] - else: - result = s - -iterator tokenize*(s: string, seps: set[char] = Whitespace): tuple[ - token: string, isSep: bool] = - ## Tokenizes the string `s` into substrings. - ## - ## Substrings are separated by a substring containing only `seps`. - ## Examples: - ## - ## .. code-block:: nimrod - ## for word in tokenize(" this is an example "): - ## writeln(stdout, word) - ## - ## Results in: - ## - ## .. code-block:: nimrod - ## (" ", true) - ## ("this", false) - ## (" ", true) - ## ("is", false) - ## (" ", true) - ## ("an", false) - ## (" ", true) - ## ("example", false) - ## (" ", true) - var i = 0 - while true: - var j = i - var isSep = s[j] in seps - while j < s.len and (s[j] in seps) == isSep: inc(j) - if j > i: - yield (substr(s, i, j-1), isSep) - else: - break - i = j - -proc wordWrap*(s: string, maxLineWidth = 80, - splitLongWords = true, - seps: set[char] = whitespace, - newLine = "\n"): string {. - noSideEffect, rtl, extern: "nsuWordWrap".} = - ## word wraps `s`. - result = newStringOfCap(s.len + s.len shr 6) - var SpaceLeft = maxLineWidth - for word, isSep in tokenize(s, seps): - if len(word) > SpaceLeft: - if splitLongWords and len(word) > maxLineWidth: - result.add(substr(word, 0, spaceLeft-1)) - var w = spaceLeft+1 - var wordLeft = len(word) - spaceLeft - while wordLeft > 0: - result.add(newLine) - var L = min(maxLineWidth, wordLeft) - SpaceLeft = maxLineWidth - L - result.add(substr(word, w, w+L-1)) - inc(w, L) - dec(wordLeft, L) - else: - SpaceLeft = maxLineWidth - len(Word) - result.add(newLine) - result.add(word) - else: - SpaceLeft = SpaceLeft - len(Word) - result.add(word) - -proc unindent*(s: string, eatAllIndent = false): string {. - noSideEffect, rtl, extern: "nsuUnindent".} = - ## unindents `s`. - result = newStringOfCap(s.len) - var i = 0 - var pattern = true - var indent = 0 - while s[i] == ' ': inc i - var level = if i == 0: -1 else: i - while i < s.len: - if s[i] == ' ': - if i > 0 and s[i-1] in {'\l', '\c'}: - pattern = true - indent = 0 - if pattern: - inc(indent) - if indent > level and not eatAllIndent: - result.add(s[i]) - if level < 0: level = indent - else: - # a space somewhere: do not delete - result.add(s[i]) - else: - pattern = false - result.add(s[i]) - inc i - -proc startsWith*(s, prefix: string): bool {.noSideEffect, - rtl, extern: "nsuStartsWith".} = - ## Returns true iff ``s`` starts with ``prefix``. - ## If ``prefix == ""`` true is returned. - 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 {.noSideEffect, - rtl, extern: "nsuEndsWith".} = - ## Returns true iff ``s`` ends with ``suffix``. - ## If ``suffix == ""`` true is returned. - var i = 0 - var j = len(s) - len(suffix) - while i+j <% s.len: - if s[i+j] != suffix[i]: return false - inc(i) - if suffix[i] == '\0': return true + if s.len < count: + result = newString(count) + let spaces = count - s.len + for i in 0..spaces-1: result[i] = padding + for i in spaces..count-1: result[i] = s[i-spaces] + else: + result = s + +iterator tokenize*(s: string, seps: set[char] = Whitespace): tuple[ + token: string, isSep: bool] = + ## Tokenizes the string `s` into substrings. + ## + ## Substrings are separated by a substring containing only `seps`. + ## Examples: + ## + ## .. code-block:: nimrod + ## for word in tokenize(" this is an example "): + ## writeln(stdout, word) + ## + ## Results in: + ## + ## .. code-block:: nimrod + ## (" ", true) + ## ("this", false) + ## (" ", true) + ## ("is", false) + ## (" ", true) + ## ("an", false) + ## (" ", true) + ## ("example", false) + ## (" ", true) + var i = 0 + while true: + var j = i + var isSep = s[j] in seps + while j < s.len and (s[j] in seps) == isSep: inc(j) + if j > i: + yield (substr(s, i, j-1), isSep) + else: + break + i = j + +proc wordWrap*(s: string, maxLineWidth = 80, + splitLongWords = true, + seps: set[char] = whitespace, + newLine = "\n"): string {. + noSideEffect, rtl, extern: "nsuWordWrap".} = + ## word wraps `s`. + result = newStringOfCap(s.len + s.len shr 6) + var SpaceLeft = maxLineWidth + for word, isSep in tokenize(s, seps): + if len(word) > SpaceLeft: + if splitLongWords and len(word) > maxLineWidth: + result.add(substr(word, 0, SpaceLeft-1)) + var w = SpaceLeft+1 + var wordLeft = len(word) - SpaceLeft + while wordLeft > 0: + result.add(newLine) + var L = min(maxLineWidth, wordLeft) + SpaceLeft = maxLineWidth - L + result.add(substr(word, w, w+L-1)) + inc(w, L) + dec(wordLeft, L) + else: + SpaceLeft = maxLineWidth - len(word) + result.add(newLine) + result.add(word) + else: + SpaceLeft = SpaceLeft - len(word) + result.add(word) + +proc unindent*(s: string, eatAllIndent = false): string {. + noSideEffect, rtl, extern: "nsuUnindent".} = + ## unindents `s`. + result = newStringOfCap(s.len) + var i = 0 + var pattern = true + var indent = 0 + while s[i] == ' ': inc i + var level = if i == 0: -1 else: i + while i < s.len: + if s[i] == ' ': + if i > 0 and s[i-1] in {'\l', '\c'}: + pattern = true + indent = 0 + if pattern: + inc(indent) + if indent > level and not eatAllIndent: + result.add(s[i]) + if level < 0: level = indent + else: + # a space somewhere: do not delete + result.add(s[i]) + else: + pattern = false + result.add(s[i]) + inc i + +proc startsWith*(s, prefix: string): bool {.noSideEffect, + rtl, extern: "nsuStartsWith".} = + ## Returns true iff ``s`` starts with ``prefix``. + ## If ``prefix == ""`` true is returned. + 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 {.noSideEffect, + rtl, extern: "nsuEndsWith".} = + ## Returns true iff ``s`` ends with ``suffix``. + ## If ``suffix == ""`` true is returned. + var i = 0 + var j = len(s) - len(suffix) + while i+j <% s.len: + if s[i+j] != suffix[i]: return false + inc(i) + if suffix[i] == '\0': return true proc continuesWith*(s, substr: string, start: int): bool {.noSideEffect, rtl, extern: "nsuContinuesWith".} = - ## Returns true iff ``s`` continues with ``substr`` at position ``start``. - ## If ``substr == ""`` true is returned. - var i = 0 - while true: - if substr[i] == '\0': return true - if s[i+start] != substr[i]: return false - inc(i) - -proc addSep*(dest: var string, sep = ", ", startLen = 0) {.noSideEffect, - inline.} = - ## A shorthand for: - ## - ## .. code-block:: nimrod - ## if dest.len > startLen: add(dest, sep) - ## - ## This is often useful for generating some code where the items need to - ## be *separated* by `sep`. `sep` is only added if `dest` is longer than - ## `startLen`. The following example creates a string describing - ## an array of integers: - ## - ## .. code-block:: nimrod - ## var arr = "[" - ## for x in items([2, 3, 5, 7, 11]): - ## addSep(arr, startLen=len("[")) - ## add(arr, $x) - ## add(arr, "]") - if dest.len > startLen: add(dest, sep) - -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 c notin theSet: return false - return true - -proc abbrev*(s: string, possibilities: openarray[string]): int = - ## returns the index of the first item in `possibilities` if not - ## ambiguous; -1 if no item has been found; -2 if multiple items - ## match. - result = -1 # none found - for i in 0..possibilities.len-1: - if possibilities[i].startsWith(s): - if possibilities[i] == s: - # special case: exact match shouldn't be ambiguous - return i - if result >= 0: return -2 # ambiguous - result = i - -# --------------------------------------------------------------------------- - -proc join*(a: openArray[string], sep: string): string {. - noSideEffect, rtl, extern: "nsuJoinSep".} = - ## concatenates all strings in `a` separating them with `sep`. - if len(a) > 0: - var L = sep.len * (a.len-1) - for i in 0..high(a): inc(L, a[i].len) - result = newStringOfCap(L) - add(result, a[0]) - for i in 1..high(a): - add(result, sep) - add(result, a[i]) - else: - result = "" - -proc join*(a: openArray[string]): string {. - noSideEffect, rtl, extern: "nsuJoin".} = - ## concatenates all strings in `a`. - if len(a) > 0: - var L = 0 - for i in 0..high(a): inc(L, a[i].len) - result = newStringOfCap(L) - for i in 0..high(a): add(result, a[i]) - else: - result = "" - -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 findAux(s, sub: 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 find*(s, sub: string, start: int = 0): int {.noSideEffect, - rtl, extern: "nsuFindStr", operator: 6.} = - ## Searches for `sub` in `s` starting at position `start`. Searching is - ## case-sensitive. If `sub` is not in `s`, -1 is returned. - var a {.noinit.}: TSkipTable - preprocessSub(sub, a) - result = findAux(s, sub, start, a) - -proc find*(s: string, sub: char, start: int = 0): int {.noSideEffect, - rtl, extern: "nsuFindChar".} = - ## Searches for `sub` in `s` starting at position `start`. Searching is - ## case-sensitive. If `sub` is not in `s`, -1 is returned. - for i in start..len(s)-1: - if sub == s[i]: return i - return -1 - -proc find*(s: string, chars: set[char], start: int = 0): int {.noSideEffect, - rtl, extern: "nsuFindCharSet".} = - ## Searches for `chars` in `s` starting at position `start`. If `s` contains - ## none of the characters in `chars`, -1 is returned. - for i in start..s.len-1: - if s[i] in chars: return i - return -1 + ## Returns true iff ``s`` continues with ``substr`` at position ``start``. + ## If ``substr == ""`` true is returned. + var i = 0 + while true: + if substr[i] == '\0': return true + if s[i+start] != substr[i]: return false + inc(i) + +proc addSep*(dest: var string, sep = ", ", startLen = 0) {.noSideEffect, + inline.} = + ## A shorthand for: + ## + ## .. code-block:: nimrod + ## if dest.len > startLen: add(dest, sep) + ## + ## This is often useful for generating some code where the items need to + ## be *separated* by `sep`. `sep` is only added if `dest` is longer than + ## `startLen`. The following example creates a string describing + ## an array of integers: + ## + ## .. code-block:: nimrod + ## var arr = "[" + ## for x in items([2, 3, 5, 7, 11]): + ## addSep(arr, startLen=len("[")) + ## add(arr, $x) + ## add(arr, "]") + if dest.len > startLen: add(dest, sep) + +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 c notin theSet: return false + return true + +proc abbrev*(s: string, possibilities: openArray[string]): int = + ## returns the index of the first item in `possibilities` if not + ## ambiguous; -1 if no item has been found; -2 if multiple items + ## match. + result = -1 # none found + for i in 0..possibilities.len-1: + if possibilities[i].startsWith(s): + if possibilities[i] == s: + # special case: exact match shouldn't be ambiguous + return i + if result >= 0: return -2 # ambiguous + result = i + +# --------------------------------------------------------------------------- + +proc join*(a: openArray[string], sep: string): string {. + noSideEffect, rtl, extern: "nsuJoinSep".} = + ## concatenates all strings in `a` separating them with `sep`. + if len(a) > 0: + var L = sep.len * (a.len-1) + for i in 0..high(a): inc(L, a[i].len) + result = newStringOfCap(L) + add(result, a[0]) + for i in 1..high(a): + add(result, sep) + add(result, a[i]) + else: + result = "" + +proc join*(a: openArray[string]): string {. + noSideEffect, rtl, extern: "nsuJoin".} = + ## concatenates all strings in `a`. + if len(a) > 0: + var L = 0 + for i in 0..high(a): inc(L, a[i].len) + result = newStringOfCap(L) + for i in 0..high(a): add(result, a[i]) + else: + result = "" + +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 findAux(s, sub: 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 find*(s, sub: string, start: int = 0): int {.noSideEffect, + rtl, extern: "nsuFindStr", operator: 6.} = + ## Searches for `sub` in `s` starting at position `start`. Searching is + ## case-sensitive. If `sub` is not in `s`, -1 is returned. + var a {.noinit.}: TSkipTable + preprocessSub(sub, a) + result = findAux(s, sub, start, a) + +proc find*(s: string, sub: char, start: int = 0): int {.noSideEffect, + rtl, extern: "nsuFindChar".} = + ## Searches for `sub` in `s` starting at position `start`. Searching is + ## case-sensitive. If `sub` is not in `s`, -1 is returned. + for i in start..len(s)-1: + if sub == s[i]: return i + return -1 + +proc find*(s: string, chars: set[char], start: int = 0): int {.noSideEffect, + rtl, extern: "nsuFindCharSet".} = + ## Searches for `chars` in `s` starting at position `start`. If `s` contains + ## none of the characters in `chars`, -1 is returned. + for i in start..s.len-1: + if s[i] in chars: return i + return -1 proc rfind*(s, sub: string, start: int = -1): int {.noSideEffect.} = ## Searches for `sub` in `s` in reverse, starting at `start` and going @@ -708,180 +708,180 @@ proc rfind*(s, sub: string, start: int = -1): int {.noSideEffect.} = break if result != -1: return return -1 - + proc quoteIfContainsWhite*(s: string): string {.deprecated.} = - ## returns ``'"' & s & '"'`` if `s` contains a space and does not - ## start with a quote, else returns `s` + ## returns ``'"' & s & '"'`` if `s` contains a space and does not + ## start with a quote, else returns `s` ## DEPRECATED as it was confused for shell quoting function. ## For this application use osproc.quoteShell. - if find(s, {' ', '\t'}) >= 0 and s[0] != '"': - result = '"' & s & '"' - else: - result = s - -proc contains*(s: string, c: char): bool {.noSideEffect.} = - ## Same as ``find(s, c) >= 0``. - return find(s, c) >= 0 - -proc contains*(s, sub: string): bool {.noSideEffect.} = - ## Same as ``find(s, sub) >= 0``. - return find(s, sub) >= 0 - -proc contains*(s: string, chars: set[char]): bool {.noSideEffect.} = - ## Same as ``find(s, chars) >= 0``. - return find(s, chars) >= 0 - -proc replace*(s, sub: string, by = ""): string {.noSideEffect, - rtl, extern: "nsuReplaceStr", operator: 1.} = - ## Replaces `sub` in `s` by the string `by`. - var a {.noinit.}: TSkipTable - result = "" - preprocessSub(sub, a) - var i = 0 - while true: - var j = findAux(s, sub, i, a) - if j < 0: break - add result, substr(s, i, j - 1) - add result, by - i = j + len(sub) - # copy the rest: - add result, substr(s, i) - -proc replace*(s: string, sub, by: char): string {.noSideEffect, - rtl, extern: "nsuReplaceChar".} = - ## optimized version for characters. - result = newString(s.len) - var i = 0 - while i < s.len: - if s[i] == sub: result[i] = by - else: result[i] = s[i] - inc(i) - -proc replaceWord*(s, sub: string, by = ""): string {.noSideEffect, - rtl, extern: "nsuReplaceWord".} = - ## Replaces `sub` in `s` by the string `by`. Each occurance of `sub` - ## has to be surrounded by word boundaries (comparable to ``\\w`` in - ## regular expressions), otherwise it is not replaced. - const wordChars = {'a'..'z', 'A'..'Z', '0'..'9', '_', '\128'..'\255'} - var a {.noinit.}: TSkipTable - result = "" - preprocessSub(sub, a) - var i = 0 - while true: - var j = findAux(s, sub, i, a) - if j < 0: break - # word boundary? - if (j == 0 or s[j-1] notin wordChars) and - (j+sub.len >= s.len or s[j+sub.len] notin wordChars): - add result, substr(s, i, j - 1) - add result, by - i = j + len(sub) - else: - add result, substr(s, i, j) - i = j + 1 - # copy the rest: - add result, substr(s, i) - -proc delete*(s: var string, first, last: int) {.noSideEffect, - rtl, extern: "nsuDelete".} = - ## Deletes in `s` the characters at position `first` .. `last`. This modifies - ## `s` itself, it does not return a copy. - var i = first - var j = last+1 - var newLen = len(s)-j+i - while i < newLen: - s[i] = s[j] - inc(i) - inc(j) - setlen(s, newLen) - -proc parseOctInt*(s: string): int {.noSideEffect, - rtl, extern: "nsuParseOctInt".} = - ## Parses an octal integer value contained in `s`. If `s` is not - ## a valid integer, `EInvalidValue` is raised. `s` can have one of the - ## following optional prefixes: ``0o``, ``0O``. - ## Underscores within `s` are ignored. - var i = 0 - if s[i] == '0' and (s[i+1] == 'o' or s[i+1] == 'O'): inc(i, 2) - while true: - case s[i] - of '_': inc(i) - of '0'..'7': - result = result shl 3 or (ord(s[i]) - ord('0')) - inc(i) - of '\0': break - else: raise newException(EInvalidValue, "invalid integer: " & s) - -proc toOct*(x: BiggestInt, len: int): string {.noSideEffect, - rtl, extern: "nsuToOct".} = - ## converts `x` into its octal representation. The resulting string is - ## always `len` characters long. No leading ``0o`` prefix is generated. - var - mask: BiggestInt = 7 - shift: BiggestInt = 0 - assert(len > 0) - result = newString(len) - 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 {.noSideEffect, - rtl, extern: "nsuToBin".} = - ## converts `x` into its binary representation. The resulting string is - ## always `len` characters long. No leading ``0b`` prefix is generated. - var - mask: BiggestInt = 1 - shift: BiggestInt = 0 - assert(len > 0) - result = newString(len) - 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 - -proc insertSep*(s: string, sep = '_', digits = 3): string {.noSideEffect, - rtl, extern: "nsuInsertSep".} = - ## inserts the separator `sep` after `digits` digits from right to left. - ## Even though the algorithm works with any string `s`, it is only useful - ## if `s` contains a number. - ## Example: ``insertSep("1000000") == "1_000_000"`` - var L = (s.len-1) div digits + s.len - result = newString(L) - var j = 0 - dec(L) - for i in countdown(len(s)-1, 0): - if j == digits: - result[L] = sep - dec(L) - j = 0 - result[L] = s[i] - inc(j) - dec(L) - -proc escape*(s: string, prefix = "\"", suffix = "\""): string {.noSideEffect, - rtl, extern: "nsuEscape".} = - ## Escapes a string `s`. This does these operations (at the same time): - ## * replaces any ``\`` by ``\\`` - ## * replaces any ``'`` by ``\'`` - ## * replaces any ``"`` by ``\"`` - ## * replaces any other character in the set ``{'\0'..'\31', '\128'..'\255'}`` - ## by ``\xHH`` where ``HH`` is its hexadecimal value. - ## The procedure has been designed so that its output is usable for many - ## different common syntaxes. The resulting string is prefixed with - ## `prefix` and suffixed with `suffix`. Both may be empty strings. - result = newStringOfCap(s.len + s.len shr 2) - result.add(prefix) - for c in items(s): - case c - of '\0'..'\31', '\128'..'\255': - add(result, "\\x") - add(result, toHex(ord(c), 2)) - of '\\': add(result, "\\\\") - of '\'': add(result, "\\'") - of '\"': add(result, "\\\"") - else: add(result, c) - add(result, suffix) + if find(s, {' ', '\t'}) >= 0 and s[0] != '"': + result = '"' & s & '"' + else: + result = s + +proc contains*(s: string, c: char): bool {.noSideEffect.} = + ## Same as ``find(s, c) >= 0``. + return find(s, c) >= 0 + +proc contains*(s, sub: string): bool {.noSideEffect.} = + ## Same as ``find(s, sub) >= 0``. + return find(s, sub) >= 0 + +proc contains*(s: string, chars: set[char]): bool {.noSideEffect.} = + ## Same as ``find(s, chars) >= 0``. + return find(s, chars) >= 0 + +proc replace*(s, sub: string, by = ""): string {.noSideEffect, + rtl, extern: "nsuReplaceStr", operator: 1.} = + ## Replaces `sub` in `s` by the string `by`. + var a {.noinit.}: TSkipTable + result = "" + preprocessSub(sub, a) + var i = 0 + while true: + var j = findAux(s, sub, i, a) + if j < 0: break + add result, substr(s, i, j - 1) + add result, by + i = j + len(sub) + # copy the rest: + add result, substr(s, i) + +proc replace*(s: string, sub, by: char): string {.noSideEffect, + rtl, extern: "nsuReplaceChar".} = + ## optimized version for characters. + result = newString(s.len) + var i = 0 + while i < s.len: + if s[i] == sub: result[i] = by + else: result[i] = s[i] + inc(i) + +proc replaceWord*(s, sub: string, by = ""): string {.noSideEffect, + rtl, extern: "nsuReplaceWord".} = + ## Replaces `sub` in `s` by the string `by`. Each occurance of `sub` + ## has to be surrounded by word boundaries (comparable to ``\\w`` in + ## regular expressions), otherwise it is not replaced. + const wordChars = {'a'..'z', 'A'..'Z', '0'..'9', '_', '\128'..'\255'} + var a {.noinit.}: TSkipTable + result = "" + preprocessSub(sub, a) + var i = 0 + while true: + var j = findAux(s, sub, i, a) + if j < 0: break + # word boundary? + if (j == 0 or s[j-1] notin wordChars) and + (j+sub.len >= s.len or s[j+sub.len] notin wordChars): + add result, substr(s, i, j - 1) + add result, by + i = j + len(sub) + else: + add result, substr(s, i, j) + i = j + 1 + # copy the rest: + add result, substr(s, i) + +proc delete*(s: var string, first, last: int) {.noSideEffect, + rtl, extern: "nsuDelete".} = + ## Deletes in `s` the characters at position `first` .. `last`. This modifies + ## `s` itself, it does not return a copy. + var i = first + var j = last+1 + var newLen = len(s)-j+i + while i < newLen: + s[i] = s[j] + inc(i) + inc(j) + setLen(s, newLen) + +proc parseOctInt*(s: string): int {.noSideEffect, + rtl, extern: "nsuParseOctInt".} = + ## Parses an octal integer value contained in `s`. If `s` is not + ## a valid integer, `EInvalidValue` is raised. `s` can have one of the + ## following optional prefixes: ``0o``, ``0O``. + ## Underscores within `s` are ignored. + var i = 0 + if s[i] == '0' and (s[i+1] == 'o' or s[i+1] == 'O'): inc(i, 2) + while true: + case s[i] + of '_': inc(i) + of '0'..'7': + result = result shl 3 or (ord(s[i]) - ord('0')) + inc(i) + of '\0': break + else: raise newException(EInvalidValue, "invalid integer: " & s) + +proc toOct*(x: BiggestInt, len: int): string {.noSideEffect, + rtl, extern: "nsuToOct".} = + ## converts `x` into its octal representation. The resulting string is + ## always `len` characters long. No leading ``0o`` prefix is generated. + var + mask: BiggestInt = 7 + shift: BiggestInt = 0 + assert(len > 0) + result = newString(len) + 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 {.noSideEffect, + rtl, extern: "nsuToBin".} = + ## converts `x` into its binary representation. The resulting string is + ## always `len` characters long. No leading ``0b`` prefix is generated. + var + mask: BiggestInt = 1 + shift: BiggestInt = 0 + assert(len > 0) + result = newString(len) + 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 + +proc insertSep*(s: string, sep = '_', digits = 3): string {.noSideEffect, + rtl, extern: "nsuInsertSep".} = + ## inserts the separator `sep` after `digits` digits from right to left. + ## Even though the algorithm works with any string `s`, it is only useful + ## if `s` contains a number. + ## Example: ``insertSep("1000000") == "1_000_000"`` + var L = (s.len-1) div digits + s.len + result = newString(L) + var j = 0 + dec(L) + for i in countdown(len(s)-1, 0): + if j == digits: + result[L] = sep + dec(L) + j = 0 + result[L] = s[i] + inc(j) + dec(L) + +proc escape*(s: string, prefix = "\"", suffix = "\""): string {.noSideEffect, + rtl, extern: "nsuEscape".} = + ## Escapes a string `s`. This does these operations (at the same time): + ## * replaces any ``\`` by ``\\`` + ## * replaces any ``'`` by ``\'`` + ## * replaces any ``"`` by ``\"`` + ## * replaces any other character in the set ``{'\0'..'\31', '\128'..'\255'}`` + ## by ``\xHH`` where ``HH`` is its hexadecimal value. + ## The procedure has been designed so that its output is usable for many + ## different common syntaxes. The resulting string is prefixed with + ## `prefix` and suffixed with `suffix`. Both may be empty strings. + result = newStringOfCap(s.len + s.len shr 2) + result.add(prefix) + for c in items(s): + case c + of '\0'..'\31', '\128'..'\255': + add(result, "\\x") + add(result, toHex(ord(c), 2)) + of '\\': add(result, "\\\\") + of '\'': add(result, "\\'") + of '\"': add(result, "\\\"") + else: add(result, c) + add(result, suffix) proc unescape*(s: string, prefix = "\"", suffix = "\""): string {.noSideEffect, rtl, extern: "nsuUnescape".} = @@ -920,323 +920,323 @@ proc unescape*(s: string, prefix = "\"", suffix = "\""): string {.noSideEffect, if s[i .. -1] != suffix: raise newException(EInvalidValue, "String does not end with a suffix of: " & suffix) - -proc validIdentifier*(s: string): bool {.noSideEffect, - rtl, extern: "nsuValidIdentifier".} = - ## returns true if `s` is a valid identifier. A valid identifier starts - ## with a character of the set `IdentStartChars` and is followed by any - ## number of characters of the set `IdentChars`. - if s[0] in IdentStartChars: - for i in 1..s.len-1: - if s[i] notin IdentChars: return false - return true - -proc editDistance*(a, b: string): int {.noSideEffect, - rtl, extern: "nsuEditDistance".} = - ## returns the edit distance between `a` and `b`. This uses the - ## `Levenshtein`:idx: distance algorithm with only a linear memory overhead. - ## This implementation is highly optimized! - var len1 = a.len - var len2 = b.len - if len1 > len2: - # make `b` the longer string - return editDistance(b, a) - - # strip common prefix: - var s = 0 - while a[s] == b[s] and a[s] != '\0': - inc(s) - dec(len1) - dec(len2) - # strip common suffix: - while len1 > 0 and len2 > 0 and a[s+len1-1] == b[s+len2-1]: - dec(len1) - dec(len2) - # trivial cases: - if len1 == 0: return len2 - if len2 == 0: return len1 - - # another special case: - if len1 == 1: - for j in s..len2-1: - if a[s] == b[j]: return len2 - 1 - return len2 - - inc(len1) - inc(len2) - var half = len1 shr 1 - # initalize first row: - #var row = cast[ptr array[0..high(int) div 8, int]](alloc(len2*sizeof(int))) - var row: seq[int] - newSeq(row, len2) - var e = s + len2 - 1 # end marker - for i in 1..len2 - half - 1: row[i] = i - row[0] = len1 - half - 1 - for i in 1 .. len1 - 1: - var char1 = a[i + s - 1] - var char2p: int - var D, x: int - var p: int - if i >= len1 - half: - # skip the upper triangle: - var offset = i - len1 + half - char2p = offset - p = offset - var c3 = row[p] + ord(char1 != b[s + char2p]) - inc(p) - inc(char2p) - x = row[p] + 1 - D = x - if x > c3: x = c3 - row[p] = x - inc(p) - else: - p = 1 - char2p = 0 - D = i - x = i - if i <= half + 1: - # skip the lower triangle: - e = len2 + i - half - 2 - # main: - while p <= e: - dec(D) - var c3 = D + ord(char1 != b[char2p + s]) - inc(char2p) - inc(x) - if x > c3: x = c3 - D = row[p] + 1 - if x > D: x = D - row[p] = x - inc(p) - # lower triangle sentinel: - if i <= half: - dec(D) - var c3 = D + ord(char1 != b[char2p + s]) - inc(x) - if x > c3: x = c3 - row[p] = x - result = row[e] - #dealloc(row) - - -# floating point formating: - -proc c_sprintf(buf, frmt: CString) {.header: "<stdio.h>", importc: "sprintf", - varargs, noSideEffect.} - -type - TFloatFormat* = enum ## the different modes of floating point formating - ffDefault, ## use the shorter floating point notation - ffDecimal, ## use decimal floating point notation - ffScientific ## use scientific notation (using ``e`` character) - -proc formatBiggestFloat*(f: BiggestFloat, format: TFloatFormat = ffDefault, + +proc validIdentifier*(s: string): bool {.noSideEffect, + rtl, extern: "nsuValidIdentifier".} = + ## returns true if `s` is a valid identifier. A valid identifier starts + ## with a character of the set `IdentStartChars` and is followed by any + ## number of characters of the set `IdentChars`. + if s[0] in IdentStartChars: + for i in 1..s.len-1: + if s[i] notin IdentChars: return false + return true + +proc editDistance*(a, b: string): int {.noSideEffect, + rtl, extern: "nsuEditDistance".} = + ## returns the edit distance between `a` and `b`. This uses the + ## `Levenshtein`:idx: distance algorithm with only a linear memory overhead. + ## This implementation is highly optimized! + var len1 = a.len + var len2 = b.len + if len1 > len2: + # make `b` the longer string + return editDistance(b, a) + + # strip common prefix: + var s = 0 + while a[s] == b[s] and a[s] != '\0': + inc(s) + dec(len1) + dec(len2) + # strip common suffix: + while len1 > 0 and len2 > 0 and a[s+len1-1] == b[s+len2-1]: + dec(len1) + dec(len2) + # trivial cases: + if len1 == 0: return len2 + if len2 == 0: return len1 + + # another special case: + if len1 == 1: + for j in s..len2-1: + if a[s] == b[j]: return len2 - 1 + return len2 + + inc(len1) + inc(len2) + var half = len1 shr 1 + # initalize first row: + #var row = cast[ptr array[0..high(int) div 8, int]](alloc(len2*sizeof(int))) + var row: seq[int] + newSeq(row, len2) + var e = s + len2 - 1 # end marker + for i in 1..len2 - half - 1: row[i] = i + row[0] = len1 - half - 1 + for i in 1 .. len1 - 1: + var char1 = a[i + s - 1] + var char2p: int + var D, x: int + var p: int + if i >= len1 - half: + # skip the upper triangle: + var offset = i - len1 + half + char2p = offset + p = offset + var c3 = row[p] + ord(char1 != b[s + char2p]) + inc(p) + inc(char2p) + x = row[p] + 1 + D = x + if x > c3: x = c3 + row[p] = x + inc(p) + else: + p = 1 + char2p = 0 + D = i + x = i + if i <= half + 1: + # skip the lower triangle: + e = len2 + i - half - 2 + # main: + while p <= e: + dec(D) + var c3 = D + ord(char1 != b[char2p + s]) + inc(char2p) + inc(x) + if x > c3: x = c3 + D = row[p] + 1 + if x > D: x = D + row[p] = x + inc(p) + # lower triangle sentinel: + if i <= half: + dec(D) + var c3 = D + ord(char1 != b[char2p + s]) + inc(x) + if x > c3: x = c3 + row[p] = x + result = row[e] + #dealloc(row) + + +# floating point formating: + +proc c_sprintf(buf, frmt: cstring) {.header: "<stdio.h>", importc: "sprintf", + varargs, noSideEffect.} + +type + TFloatFormat* = enum ## the different modes of floating point formating + ffDefault, ## use the shorter floating point notation + ffDecimal, ## use decimal floating point notation + ffScientific ## use scientific notation (using ``e`` character) + +proc formatBiggestFloat*(f: BiggestFloat, format: TFloatFormat = ffDefault, precision: range[0..32] = 16): string {. - noSideEffect, operator: 2, rtl, extern: "nsu$1".} = - ## converts a floating point value `f` to a string. - ## - ## If ``format == ffDecimal`` then precision is the number of digits to - ## be printed after the decimal point. - ## If ``format == ffScientific`` then precision is the maximum number - ## of significant digits to be printed. - ## `precision`'s default value is the maximum number of meaningful digits + noSideEffect, operator: 2, rtl, extern: "nsu$1".} = + ## converts a floating point value `f` to a string. + ## + ## If ``format == ffDecimal`` then precision is the number of digits to + ## be printed after the decimal point. + ## If ``format == ffScientific`` then precision is the maximum number + ## of significant digits to be printed. + ## `precision`'s default value is the maximum number of meaningful digits ## after the decimal point for Nimrod's ``biggestFloat`` type. ## - ## If ``precision == 0``, it tries to format it nicely. - const floatFormatToChar: array[TFloatFormat, char] = ['g', 'f', 'e'] - var - frmtstr {.noinit.}: array[0..5, char] - buf {.noinit.}: array[0..2500, char] - frmtstr[0] = '%' - if precision > 0: - frmtstr[1] = '#' - frmtstr[2] = '.' - frmtstr[3] = '*' - frmtstr[4] = floatFormatToChar[format] - frmtstr[5] = '\0' - c_sprintf(buf, frmtstr, precision, f) - else: - frmtstr[1] = floatFormatToChar[format] - frmtstr[2] = '\0' - c_sprintf(buf, frmtstr, f) - result = $buf - -proc formatFloat*(f: float, format: TFloatFormat = ffDefault, + ## If ``precision == 0``, it tries to format it nicely. + const floatFormatToChar: array[TFloatFormat, char] = ['g', 'f', 'e'] + var + frmtstr {.noinit.}: array[0..5, char] + buf {.noinit.}: array[0..2500, char] + frmtstr[0] = '%' + if precision > 0: + frmtstr[1] = '#' + frmtstr[2] = '.' + frmtstr[3] = '*' + frmtstr[4] = floatFormatToChar[format] + frmtstr[5] = '\0' + c_sprintf(buf, frmtstr, precision, f) + else: + frmtstr[1] = floatFormatToChar[format] + frmtstr[2] = '\0' + c_sprintf(buf, frmtstr, f) + result = $buf + +proc formatFloat*(f: float, format: TFloatFormat = ffDefault, precision: range[0..32] = 16): string {. - noSideEffect, operator: 2, rtl, extern: "nsu$1".} = - ## converts a floating point value `f` to a string. - ## - ## If ``format == ffDecimal`` then precision is the number of digits to - ## be printed after the decimal point. - ## If ``format == ffScientific`` then precision is the maximum number - ## of significant digits to be printed. - ## `precision`'s default value is the maximum number of meaningful digits - ## after the decimal point for Nimrod's ``float`` type. - result = formatBiggestFloat(f, format, precision) - -proc formatSize*(bytes: biggestInt, decimalSep = '.'): string = - ## Rounds and formats `bytes`. Examples: - ## - ## .. code-block:: nimrod - ## - ## formatSize(1'i64 shl 31 + 300'i64) == "2.204GB" - ## formatSize(4096) == "4KB" - ## - template frmt(a, b, c: expr): expr = - let bs = $b - insertSep($a) & decimalSep & bs.substr(0, 2) & c - let gigabytes = bytes shr 30 - let megabytes = bytes shr 20 - let kilobytes = bytes shr 10 - if gigabytes != 0: - result = frmt(gigabytes, megabytes, "GB") - elif megabytes != 0: - result = frmt(megabytes, kilobytes, "MB") - elif kilobytes != 0: - result = frmt(kilobytes, bytes, "KB") - else: - result = insertSep($bytes) & "B" - -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 lead to a - # security hole... - return -1 - -proc invalidFormatString() {.noinline.} = - raise newException(EInvalidValue, "invalid format string") - -proc addf*(s: var string, formatstr: string, a: varargs[string, `$`]) {. - noSideEffect, rtl, extern: "nsuAddf".} = - ## The same as ``add(s, formatstr % a)``, but more efficient. - const PatternChars = {'a'..'z', 'A'..'Z', '0'..'9', '\128'..'\255', '_'} - var i = 0 - var num = 0 - while i < len(formatstr): - if formatstr[i] == '$': - case formatstr[i+1] # again we use the fact that strings - # are zero-terminated here - of '#': - if num >% a.high: invalidFormatString() - add s, a[num] - inc i, 2 - inc num - of '$': - add s, '$' - inc(i, 2) - of '1'..'9', '-': - var j = 0 - inc(i) # skip $ - var negative = formatstr[i] == '-' - if negative: inc i - while formatstr[i] in Digits: - j = j * 10 + ord(formatstr[i]) - ord('0') - inc(i) - let idx = if not negative: j-1 else: a.len-j - if idx >% a.high: invalidFormatString() - add s, a[idx] - of '{': - var j = i+1 - while formatstr[j] notin {'\0', '}'}: inc(j) - var x = findNormalized(substr(formatstr, i+2, j-1), a) - if x >= 0 and x < high(a): add s, a[x+1] - else: invalidFormatString() - i = j+1 - of 'a'..'z', 'A'..'Z', '\128'..'\255', '_': - var j = i+1 - while formatstr[j] in PatternChars: inc(j) - var x = findNormalized(substr(formatstr, i+1, j-1), a) - if x >= 0 and x < high(a): add s, a[x+1] - else: invalidFormatString() - i = j - else: - invalidFormatString() - else: - add s, formatstr[i] - inc(i) - -proc `%` *(formatstr: string, a: openarray[string]): string {.noSideEffect, - rtl, extern: "nsuFormatOpenArray".} = - ## The `substitution`:idx: operator performs string substitutions in - ## `formatstr` and returns a modified `formatstr`. This is often called - ## `string interpolation`:idx:. - ## - ## This is best explained by an example: - ## - ## .. code-block:: nimrod - ## "$1 eats $2." % ["The cat", "fish"] - ## - ## Results in: - ## - ## .. code-block:: nimrod - ## "The cat eats fish." - ## - ## The substitution variables (the thing after the ``$``) are enumerated - ## from 1 to ``a.len``. - ## To produce a verbatim ``$``, use ``$$``. - ## The notation ``$#`` can be used to refer to the next substitution - ## variable: - ## - ## .. code-block:: nimrod - ## "$# eats $#." % ["The cat", "fish"] - ## - ## 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. - ## An example: - ## - ## .. code-block:: nimrod - ## "$animal eats $food." % ["animal", "The cat", "food", "fish"] - ## - ## Results in: - ## - ## .. code-block:: nimrod - ## "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. - result = newStringOfCap(formatstr.len + a.len shl 4) - addf(result, formatstr, a) - -proc `%` *(formatstr, a: string): string {.noSideEffect, - rtl, extern: "nsuFormatSingleElem".} = - ## This is the same as ``formatstr % [a]``. - result = newStringOfCap(formatstr.len + a.len) - addf(result, formatstr, [a]) + noSideEffect, operator: 2, rtl, extern: "nsu$1".} = + ## converts a floating point value `f` to a string. + ## + ## If ``format == ffDecimal`` then precision is the number of digits to + ## be printed after the decimal point. + ## If ``format == ffScientific`` then precision is the maximum number + ## of significant digits to be printed. + ## `precision`'s default value is the maximum number of meaningful digits + ## after the decimal point for Nimrod's ``float`` type. + result = formatBiggestFloat(f, format, precision) -proc format*(formatstr: string, a: varargs[string, `$`]): string {.noSideEffect, - rtl, extern: "nsuFormatVarargs".} = +proc formatSize*(bytes: BiggestInt, decimalSep = '.'): string = + ## Rounds and formats `bytes`. Examples: + ## + ## .. code-block:: nimrod + ## + ## formatSize(1'i64 shl 31 + 300'i64) == "2.204GB" + ## formatSize(4096) == "4KB" + ## + template frmt(a, b, c: expr): expr = + let bs = $b + insertSep($a) & decimalSep & bs.substr(0, 2) & c + let gigabytes = bytes shr 30 + let megabytes = bytes shr 20 + let kilobytes = bytes shr 10 + if gigabytes != 0: + result = frmt(gigabytes, megabytes, "GB") + elif megabytes != 0: + result = frmt(megabytes, kilobytes, "MB") + elif kilobytes != 0: + result = frmt(kilobytes, bytes, "KB") + else: + result = insertSep($bytes) & "B" + +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 lead to a + # security hole... + return -1 + +proc invalidFormatString() {.noinline.} = + raise newException(EInvalidValue, "invalid format string") + +proc addf*(s: var string, formatstr: string, a: varargs[string, `$`]) {. + noSideEffect, rtl, extern: "nsuAddf".} = + ## The same as ``add(s, formatstr % a)``, but more efficient. + const PatternChars = {'a'..'z', 'A'..'Z', '0'..'9', '\128'..'\255', '_'} + var i = 0 + var num = 0 + while i < len(formatstr): + if formatstr[i] == '$': + case formatstr[i+1] # again we use the fact that strings + # are zero-terminated here + of '#': + if num >% a.high: invalidFormatString() + add s, a[num] + inc i, 2 + inc num + of '$': + add s, '$' + inc(i, 2) + of '1'..'9', '-': + var j = 0 + inc(i) # skip $ + var negative = formatstr[i] == '-' + if negative: inc i + while formatstr[i] in Digits: + j = j * 10 + ord(formatstr[i]) - ord('0') + inc(i) + let idx = if not negative: j-1 else: a.len-j + if idx >% a.high: invalidFormatString() + add s, a[idx] + of '{': + var j = i+1 + while formatstr[j] notin {'\0', '}'}: inc(j) + var x = findNormalized(substr(formatstr, i+2, j-1), a) + if x >= 0 and x < high(a): add s, a[x+1] + else: invalidFormatString() + i = j+1 + of 'a'..'z', 'A'..'Z', '\128'..'\255', '_': + var j = i+1 + while formatstr[j] in PatternChars: inc(j) + var x = findNormalized(substr(formatstr, i+1, j-1), a) + if x >= 0 and x < high(a): add s, a[x+1] + else: invalidFormatString() + i = j + else: + invalidFormatString() + else: + add s, formatstr[i] + inc(i) + +proc `%` *(formatstr: string, a: openArray[string]): string {.noSideEffect, + rtl, extern: "nsuFormatOpenArray".} = + ## The `substitution`:idx: operator performs string substitutions in + ## `formatstr` and returns a modified `formatstr`. This is often called + ## `string interpolation`:idx:. + ## + ## This is best explained by an example: + ## + ## .. code-block:: nimrod + ## "$1 eats $2." % ["The cat", "fish"] + ## + ## Results in: + ## + ## .. code-block:: nimrod + ## "The cat eats fish." + ## + ## The substitution variables (the thing after the ``$``) are enumerated + ## from 1 to ``a.len``. + ## To produce a verbatim ``$``, use ``$$``. + ## The notation ``$#`` can be used to refer to the next substitution + ## variable: + ## + ## .. code-block:: nimrod + ## "$# eats $#." % ["The cat", "fish"] + ## + ## 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. + ## An example: + ## + ## .. code-block:: nimrod + ## "$animal eats $food." % ["animal", "The cat", "food", "fish"] + ## + ## Results in: + ## + ## .. code-block:: nimrod + ## "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. + result = newStringOfCap(formatstr.len + a.len shl 4) + addf(result, formatstr, a) + +proc `%` *(formatstr, a: string): string {.noSideEffect, + rtl, extern: "nsuFormatSingleElem".} = + ## This is the same as ``formatstr % [a]``. + result = newStringOfCap(formatstr.len + a.len) + addf(result, formatstr, [a]) + +proc format*(formatstr: string, a: varargs[string, `$`]): string {.noSideEffect, + rtl, extern: "nsuFormatVarargs".} = ## This is the same as ``formatstr % a`` except that it supports - ## auto stringification. - result = newStringOfCap(formatstr.len + a.len) - addf(result, formatstr, a) - -{.pop.} - -when isMainModule: - doAssert align("abc", 4) == " abc" - doAssert align("a", 0) == "a" - doAssert align("1232", 6) == " 1232" - doAssert align("1232", 6, '#') == "##1232" - echo wordWrap(""" this is a long text -- muchlongerthan10chars and here - it goes""", 10, false) - doAssert formatBiggestFloat(0.00000000001, ffDecimal, 11) == "0.00000000001" - doAssert formatBiggestFloat(0.00000000001, ffScientific, 1) == "1.0e-11" - - doAssert "$# $3 $# $#" % ["a", "b", "c"] == "a c b c" - echo formatSize(1'i64 shl 31 + 300'i64) # == "4,GB" - echo formatSize(1'i64 shl 31) - - doAssert "$animal eats $food." % ["animal", "The cat", "food", "fish"] == - "The cat eats fish." - - doAssert "-ld a-ldz -ld".replaceWord("-ld") == " a-ldz " - doAssert "-lda-ldz -ld abc".replaceWord("-ld") == "-lda-ldz abc" - - type TMyEnum = enum enA, enB, enC, enuD, enE - doAssert parseEnum[TMyEnum]("enu_D") == enuD + ## auto stringification. + result = newStringOfCap(formatstr.len + a.len) + addf(result, formatstr, a) - doAssert parseEnum("invalid enum value", enC) == enC +{.pop.} + +when isMainModule: + doAssert align("abc", 4) == " abc" + doAssert align("a", 0) == "a" + doAssert align("1232", 6) == " 1232" + doAssert align("1232", 6, '#') == "##1232" + echo wordWrap(""" this is a long text -- muchlongerthan10chars and here + it goes""", 10, false) + doAssert formatBiggestFloat(0.00000000001, ffDecimal, 11) == "0.00000000001" + doAssert formatBiggestFloat(0.00000000001, ffScientific, 1) == "1.0e-11" + + doAssert "$# $3 $# $#" % ["a", "b", "c"] == "a c b c" + echo formatSize(1'i64 shl 31 + 300'i64) # == "4,GB" + echo formatSize(1'i64 shl 31) + + doAssert "$animal eats $food." % ["animal", "The cat", "food", "fish"] == + "The cat eats fish." + + doAssert "-ld a-ldz -ld".replaceWord("-ld") == " a-ldz " + doAssert "-lda-ldz -ld abc".replaceWord("-ld") == "-lda-ldz abc" + + type TMyEnum = enum enA, enB, enC, enuD, enE + doAssert parseEnum[TMyEnum]("enu_D") == enuD + + doAssert parseEnum("invalid enum value", enC) == enC diff --git a/lib/pure/times.nim b/lib/pure/times.nim index a37091c52d..6dfe80ca15 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -256,7 +256,7 @@ proc `+`*(a: TTimeInfo, interval: TTimeInterval): TTimeInfo = ## ## **Note:** This has been only briefly tested and it may not be ## very accurate. - let t = toSeconds(TimeInfoToTime(a)) + let t = toSeconds(timeInfoToTime(a)) let secs = toSeconds(a, interval) if a.tzname == "UTC": result = getGMTime(fromSeconds(t + secs)) @@ -268,7 +268,7 @@ proc `-`*(a: TTimeInfo, interval: TTimeInterval): TTimeInfo = ## ## **Note:** This has been only briefly tested, it is inaccurate especially ## when you subtract so much that you reach the Julian calendar. - let t = toSeconds(TimeInfoToTime(a)) + let t = toSeconds(timeInfoToTime(a)) let secs = toSeconds(a, interval) if a.tzname == "UTC": result = getGMTime(fromSeconds(t - secs)) @@ -319,11 +319,11 @@ when not defined(JS): importc: "gmtime", header: "<time.h>", tags: [].} proc timec(timer: PTime): TTime {. importc: "time", header: "<time.h>", tags: [].} - proc mktime(t: structTM): TTime {. + proc mktime(t: StructTM): TTime {. importc: "mktime", header: "<time.h>", tags: [].} - proc asctime(tblock: structTM): CString {. + proc asctime(tblock: StructTM): cstring {. importc: "asctime", header: "<time.h>", tags: [].} - proc ctime(time: PTime): CString {. + proc ctime(time: PTime): cstring {. importc: "ctime", header: "<time.h>", tags: [].} # strftime(s: CString, maxsize: int, fmt: CString, t: tm): int {. # importc: "strftime", header: "<time.h>".} @@ -335,7 +335,7 @@ when not defined(JS): clocksPerSec {.importc: "CLOCKS_PER_SEC", nodecl.}: int # our own procs on top of that: - proc tmToTimeInfo(tm: structTM, local: bool): TTimeInfo = + proc tmToTimeInfo(tm: StructTM, local: bool): TTimeInfo = const weekDays: array [0..6, TWeekDay] = [ dSun, dMon, dTue, dWed, dThu, dFri, dSat] @@ -358,7 +358,7 @@ when not defined(JS): timezone: if local: getTimezone() else: 0 ) - proc timeInfoToTM(t: TTimeInfo): structTM = + proc timeInfoToTM(t: TTimeInfo): StructTM = const weekDays: array [TWeekDay, int8] = [1'i8,2'i8,3'i8,4'i8,5'i8,6'i8,0'i8] result.second = t.second @@ -453,7 +453,7 @@ when not defined(JS): result = toFloat(a.tv_sec) + toFloat(a.tv_usec)*0.00_0001 elif defined(windows): var f: winlean.TFiletime - GetSystemTimeAsFileTime(f) + getSystemTimeAsFileTime(f) var i64 = rdFileTime(f) - epochDiff var secs = i64 div rateDiff var subsecs = i64 mod rateDiff diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim index 1cf2816b48..b67341e895 100644 --- a/lib/pure/unicode.nim +++ b/lib/pure/unicode.nim @@ -109,7 +109,7 @@ proc runeAt*(s: string, i: int): TRune = proc toUTF8*(c: TRune): string {.rtl, extern: "nuc$1".} = ## converts a rune into its UTF8 representation - var i = irune(c) + var i = IRune(c) if i <=% 127: result = newString(1) result[0] = chr(i) @@ -1096,7 +1096,7 @@ const 0x01f1, 501, # 0x01f3, 499] # -proc binarySearch(c: irune, tab: openArray[iRune], len, stride: int): int = +proc binarySearch(c: IRune, tab: openArray[IRune], len, stride: int): int = var n = len var t = 0 while n > 1: @@ -1114,29 +1114,29 @@ proc binarySearch(c: irune, tab: openArray[iRune], len, stride: int): int = proc toLower*(c: TRune): TRune {.rtl, extern: "nuc$1", procvar.} = ## Converts `c` into lower case. This works for any Unicode character. ## If possible, prefer `toLower` over `toUpper`. - var c = irune(c) + var c = IRune(c) var p = binarySearch(c, tolowerRanges, len(toLowerRanges) div 3, 3) if p >= 0 and c >= tolowerRanges[p] and c <= tolowerRanges[p+1]: return TRune(c + tolowerRanges[p+2] - 500) p = binarySearch(c, toLowerSinglets, len(toLowerSinglets) div 2, 2) - if p >= 0 and c == toLowerSinglets[p]: - return TRune(c + toLowerSinglets[p+1] - 500) + if p >= 0 and c == tolowerSinglets[p]: + return TRune(c + tolowerSinglets[p+1] - 500) return TRune(c) proc toUpper*(c: TRune): TRune {.rtl, extern: "nuc$1", procvar.} = ## Converts `c` into upper case. This works for any Unicode character. ## If possible, prefer `toLower` over `toUpper`. - var c = irune(c) + var c = IRune(c) var p = binarySearch(c, toUpperRanges, len(toUpperRanges) div 3, 3) - if p >= 0 and c >= toUpperRanges[p] and c <= toUpperRanges[p+1]: - return TRune(c + toUpperRanges[p+2] - 500) + if p >= 0 and c >= toupperRanges[p] and c <= toupperRanges[p+1]: + return TRune(c + toupperRanges[p+2] - 500) p = binarySearch(c, toUpperSinglets, len(toUpperSinglets) div 2, 2) - if p >= 0 and c == toUpperSinglets[p]: - return TRune(c + toUpperSinglets[p+1] - 500) + if p >= 0 and c == toupperSinglets[p]: + return TRune(c + toupperSinglets[p+1] - 500) return TRune(c) proc toTitle*(c: TRune): TRune {.rtl, extern: "nuc$1", procvar.} = - var c = irune(c) + var c = IRune(c) var p = binarySearch(c, toTitleSinglets, len(toTitleSinglets) div 2, 2) if p >= 0 and c == toTitleSinglets[p]: return TRune(c + toTitleSinglets[p+1] - 500) @@ -1145,32 +1145,32 @@ proc toTitle*(c: TRune): TRune {.rtl, extern: "nuc$1", procvar.} = proc isLower*(c: TRune): bool {.rtl, extern: "nuc$1", procvar.} = ## returns true iff `c` is a lower case Unicode character ## If possible, prefer `isLower` over `isUpper`. - var c = irune(c) + var c = IRune(c) # Note: toUpperRanges is correct here! var p = binarySearch(c, toUpperRanges, len(toUpperRanges) div 3, 3) - if p >= 0 and c >= toUpperRanges[p] and c <= toUpperRanges[p+1]: + if p >= 0 and c >= toupperRanges[p] and c <= toupperRanges[p+1]: return true p = binarySearch(c, toUpperSinglets, len(toUpperSinglets) div 2, 2) - if p >= 0 and c == toUpperSinglets[p]: + if p >= 0 and c == toupperSinglets[p]: return true proc isUpper*(c: TRune): bool {.rtl, extern: "nuc$1", procvar.} = ## returns true iff `c` is a upper case Unicode character ## If possible, prefer `isLower` over `isUpper`. - var c = irune(c) + var c = IRune(c) # Note: toLowerRanges is correct here! var p = binarySearch(c, toLowerRanges, len(toLowerRanges) div 3, 3) - if p >= 0 and c >= toLowerRanges[p] and c <= toLowerRanges[p+1]: + if p >= 0 and c >= tolowerRanges[p] and c <= tolowerRanges[p+1]: return true p = binarySearch(c, toLowerSinglets, len(toLowerSinglets) div 2, 2) - if p >= 0 and c == toLowerSinglets[p]: + if p >= 0 and c == tolowerSinglets[p]: return true proc isAlpha*(c: TRune): bool {.rtl, extern: "nuc$1", procvar.} = ## returns true iff `c` is an *alpha* Unicode character (i.e. a letter) if isUpper(c) or isLower(c): return true - var c = irune(c) + var c = IRune(c) var p = binarySearch(c, alphaRanges, len(alphaRanges) div 2, 2) if p >= 0 and c >= alphaRanges[p] and c <= alphaRanges[p+1]: return true @@ -1183,7 +1183,7 @@ proc isTitle*(c: TRune): bool {.rtl, extern: "nuc$1", procvar.} = proc isWhiteSpace*(c: TRune): bool {.rtl, extern: "nuc$1", procvar.} = ## returns true iff `c` is a Unicode whitespace character - var c = irune(c) + var c = IRune(c) var p = binarySearch(c, spaceRanges, len(spaceRanges) div 2, 2) if p >= 0 and c >= spaceRanges[p] and c <= spaceRanges[p+1]: return true @@ -1210,7 +1210,7 @@ proc cmpRunesIgnoreCase*(a, b: string): int {.rtl, extern: "nuc$1", procvar.} = # slow path: fastRuneAt(a, i, ar) fastRuneAt(b, j, br) - result = irune(toLower(ar)) - irune(toLower(br)) + result = IRune(toLower(ar)) - IRune(toLower(br)) if result != 0: return result = a.len - b.len diff --git a/lib/system.nim b/lib/system.nim index da3fee35ae..7df4be4df9 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -339,13 +339,13 @@ type TResult* = enum Failure, Success -proc sizeof*[T](x: T): natural {.magic: "SizeOf", noSideEffect.} +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 `<`*[T](x: ordinal[T]): T {.magic: "UnaryLt", noSideEffect.} +proc `<`*[T](x: Ordinal[T]): T {.magic: "UnaryLt", noSideEffect.} ## unary ``<`` that can be used for nice looking excluding ranges: ## ## .. code-block:: nimrod @@ -353,22 +353,22 @@ proc `<`*[T](x: ordinal[T]): T {.magic: "UnaryLt", noSideEffect.} ## ## Semantically this is the same as ``pred``. -proc succ*[T](x: ordinal[T], y = 1): T {.magic: "Succ", noSideEffect.} +proc succ*[T](x: Ordinal[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: ordinal[T], y = 1): T {.magic: "Pred", noSideEffect.} +proc pred*[T](x: Ordinal[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 ordinal[T], y = 1) {.magic: "Inc", noSideEffect.} +proc inc*[T](x: var Ordinal[T], y = 1) {.magic: "Inc", noSideEffect.} ## 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 ordinal[T], y = 1) {.magic: "Dec", noSideEffect.} +proc dec*[T](x: var Ordinal[T], y = 1) {.magic: "Dec", noSideEffect.} ## 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)``. @@ -591,43 +591,43 @@ type IntMax32 = bool|int|int8|int16|int32 proc `+%` *(x, y: IntMax32): IntMax32 {.magic: "AddU", noSideEffect.} -proc `+%` *(x, y: Int64): Int64 {.magic: "AddU", noSideEffect.} +proc `+%` *(x, y: int64): int64 {.magic: "AddU", 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: IntMax32): IntMax32 {.magic: "SubU", noSideEffect.} -proc `-%` *(x, y: Int64): Int64 {.magic: "SubU", noSideEffect.} +proc `-%` *(x, y: int64): int64 {.magic: "SubU", 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: IntMax32): IntMax32 {.magic: "MulU", noSideEffect.} -proc `*%` *(x, y: Int64): Int64 {.magic: "MulU", noSideEffect.} +proc `*%` *(x, y: int64): int64 {.magic: "MulU", 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: IntMax32): IntMax32 {.magic: "DivU", noSideEffect.} -proc `/%` *(x, y: Int64): Int64 {.magic: "DivU", noSideEffect.} +proc `/%` *(x, y: int64): int64 {.magic: "DivU", 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: IntMax32): IntMax32 {.magic: "ModU", noSideEffect.} -proc `%%` *(x, y: Int64): Int64 {.magic: "ModU", noSideEffect.} +proc `%%` *(x, y: int64): int64 {.magic: "ModU", 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: IntMax32): bool {.magic: "LeU", noSideEffect.} -proc `<=%` *(x, y: Int64): bool {.magic: "LeU64", 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: IntMax32): bool {.magic: "LtU", noSideEffect.} -proc `<%` *(x, y: Int64): bool {.magic: "LtU64", 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)``. @@ -1064,7 +1064,7 @@ proc toFloat*(i: int): float {. ## fails, `EInvalidValue` is raised. However, on most platforms the ## conversion cannot fail. -proc toBiggestFloat*(i: biggestint): biggestfloat {. +proc toBiggestFloat*(i: BiggestInt): BiggestFloat {. magic: "ToBiggestFloat", noSideEffect, importc: "toBiggestFloat".} ## converts an biggestint `i` into a ``biggestfloat``. If the conversion ## fails, `EInvalidValue` is raised. However, on most platforms the @@ -1076,7 +1076,7 @@ proc toInt*(f: float): int {. ## 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 {. +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 @@ -1118,19 +1118,19 @@ proc substr*(s: string, first, last: int): string {. ## or `limit`:idx: a string's length. when not defined(nimrodVM): - proc zeroMem*(p: Pointer, size: int) {.importc, noDecl.} + 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) {. + proc copyMem*(dest, source: pointer, size: int) {. importc: "memcpy", header: "<string.h>".} ## 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) {. + proc moveMem*(dest, source: pointer, size: int) {. importc: "memmove", header: "<string.h>".} ## copies the contents from the memory at ``source`` to the memory ## at ``dest``. Exactly ``size`` bytes will be copied. The memory @@ -1138,7 +1138,7 @@ when not defined(nimrodVM): ## 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 {. + 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 @@ -1160,7 +1160,7 @@ when not defined(nimrodVM): ## containing zero, so it is somewhat safer than ``alloc``. ## The allocated memory belongs to its allocating thread! ## Use `allocShared0` to allocate from a shared heap. - proc realloc*(p: Pointer, newsize: int): pointer {.noconv, rtl, tags: [].} + proc realloc*(p: pointer, newsize: int): pointer {.noconv, rtl, tags: [].} ## 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** @@ -1168,7 +1168,7 @@ when not defined(nimrodVM): ## be freed with ``dealloc``. ## The allocated memory belongs to its allocating thread! ## Use `reallocShared` to reallocate from a shared heap. - proc dealloc*(p: Pointer) {.noconv, rtl, tags: [].} + proc dealloc*(p: pointer) {.noconv, rtl, tags: [].} ## 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 @@ -1189,13 +1189,13 @@ when not defined(nimrodVM): ## ``reallocShared(block, 0)`` or ``deallocShared(block)``. ## The block is initialized with all bytes ## containing zero, so it is somewhat safer than ``allocShared``. - proc reallocShared*(p: Pointer, newsize: int): pointer {.noconv, rtl.} + proc reallocShared*(p: pointer, newsize: int): pointer {.noconv, rtl.} ## grows or shrinks a given memory block on the heap. 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** ## ``reallocShared`` calls ``deallocShared(p)``. In other cases the ## block has to be freed with ``deallocShared``. - proc deallocShared*(p: Pointer) {.noconv, rtl.} + proc deallocShared*(p: pointer) {.noconv, rtl.} ## frees the memory allocated with ``allocShared``, ``allocShared0`` or ## ``reallocShared``. This procedure is dangerous! If one forgets to ## free the memory a leak occurs; if one tries to access freed @@ -1240,7 +1240,7 @@ proc `$` *(x: char): string {.magic: "CharToStr", noSideEffect.} ## The stingify operator for a character argument. Returns `x` ## converted to a string. -proc `$` *(x: Cstring): string {.magic: "CStrToStr", noSideEffect.} +proc `$` *(x: cstring): string {.magic: "CStrToStr", noSideEffect.} ## The stingify operator for a CString argument. Returns `x` ## converted to a string. @@ -1428,7 +1428,7 @@ iterator items*(E: typedesc[enum]): E = for v in low(E)..high(E): yield v -iterator pairs*[T](a: openarray[T]): tuple[key: int, val: T] {.inline.} = +iterator pairs*[T](a: openArray[T]): tuple[key: int, val: T] {.inline.} = ## iterates over each item of `a`. Yields ``(index, a[index])`` pairs. var i = 0 while i < len(a): @@ -1963,14 +1963,14 @@ when not defined(JS): #and not defined(NimrodVM): ## `useStdoutAsStdmsg` compile-time switch. proc open*(f: var TFile, filename: string, - mode: TFileMode = fmRead, bufSize: int = -1): Bool {.tags: [].} + mode: TFileMode = fmRead, bufSize: int = -1): bool {.tags: [].} ## 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. proc open*(f: var TFile, filehandle: TFileHandle, - mode: TFileMode = fmRead): Bool {.tags: [].} + mode: TFileMode = fmRead): bool {.tags: [].} ## Creates a ``TFile`` from a `filehandle` with given `mode`. ## ## Default mode is readonly. Returns true iff the file could be opened. @@ -1995,7 +1995,7 @@ when not defined(JS): #and not defined(NimrodVM): proc close*(f: TFile) {.importc: "fclose", header: "<stdio.h>", tags: [].} ## Closes the file. - proc endOfFile*(f: TFile): Bool {.tags: [].} + proc endOfFile*(f: TFile): bool {.tags: [].} ## Returns true iff `f` is at the end. proc readChar*(f: TFile): char {. @@ -2021,10 +2021,10 @@ when not defined(JS): #and not defined(NimrodVM): proc write*(f: TFile, r: float32) {.tags: [FWriteIO].} proc write*(f: TFile, i: int) {.tags: [FWriteIO].} - proc write*(f: TFile, i: biggestInt) {.tags: [FWriteIO].} - proc write*(f: TFile, r: biggestFloat) {.tags: [FWriteIO].} + proc write*(f: TFile, i: BiggestInt) {.tags: [FWriteIO].} + proc write*(f: TFile, r: BiggestFloat) {.tags: [FWriteIO].} proc write*(f: TFile, s: string) {.tags: [FWriteIO].} - proc write*(f: TFile, b: Bool) {.tags: [FWriteIO].} + proc write*(f: TFile, b: bool) {.tags: [FWriteIO].} proc write*(f: TFile, c: char) {.tags: [FWriteIO].} proc write*(f: TFile, c: cstring) {.tags: [FWriteIO].} proc write*(f: TFile, a: varargs[string, `$`]) {.tags: [FWriteIO].} @@ -2050,13 +2050,13 @@ when not defined(JS): #and not defined(NimrodVM): proc getFileSize*(f: TFile): int64 {.tags: [FReadIO].} ## retrieves the file size (in bytes) of `f`. - proc readBytes*(f: TFile, a: var openarray[int8], start, len: int): int {. + proc readBytes*(f: TFile, a: var openArray[int8], start, len: int): int {. tags: [FReadIO].} ## 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 {. + proc readChars*(f: TFile, a: var openArray[char], start, len: int): int {. tags: [FReadIO].} ## 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 @@ -2067,13 +2067,13 @@ when not defined(JS): #and not defined(NimrodVM): ## 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[int8], start, len: int): int {. + proc writeBytes*(f: TFile, a: openArray[int8], start, len: int): int {. tags: [FWriteIO].} ## 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 {. + proc writeChars*(f: TFile, a: openArray[char], start, len: int): int {. tags: [FWriteIO].} ## 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 @@ -2195,7 +2195,7 @@ when not defined(JS): #and not defined(NimrodVM): const GenericSeqSize = (2 * sizeof(int)) - proc getDiscriminant(aa: Pointer, n: ptr TNimNode): int = + proc getDiscriminant(aa: pointer, n: ptr TNimNode): int = sysAssert(n.kind == nkCase, "getDiscriminant: node != nkCase") var d: int var a = cast[TAddress](aa) @@ -2206,7 +2206,7 @@ when not defined(JS): #and not defined(NimrodVM): else: sysAssert(false, "getDiscriminant: invalid n.typ.size") return d - proc selectBranch(aa: Pointer, n: ptr TNimNode): ptr TNimNode = + proc selectBranch(aa: pointer, n: ptr TNimNode): ptr TNimNode = var discr = getDiscriminant(aa, n) if discr <% n.len: result = n.sons[discr] diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index e0f29a961d..204d98a2c9 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -109,7 +109,7 @@ type data: TTrunkBuckets type - TAlignType = biggestFloat + TAlignType = BiggestFloat TFreeCell {.final, pure.} = object next: ptr TFreeCell # next free cell in chunk (overlaid with refcount) zeroField: int # 0 means cell is not used (overlaid with typ field) @@ -260,7 +260,7 @@ proc intSetGet(t: TIntSet, key: int): PTrunk = result = nil proc intSetPut(a: var TMemRegion, t: var TIntSet, key: int): PTrunk = - result = IntSetGet(t, key) + result = intSetGet(t, key) if result == nil: result = cast[PTrunk](llAlloc(a, sizeof(result[]))) result.next = t.data[key and high(t.data)] @@ -268,7 +268,7 @@ proc intSetPut(a: var TMemRegion, t: var TIntSet, key: int): PTrunk = result.key = key proc contains(s: TIntSet, key: int): bool = - var t = IntSetGet(s, key shr TrunkShift) + var t = intSetGet(s, key shr TrunkShift) if t != nil: var u = key and TrunkMask result = (t.bits[u shr IntShift] and (1 shl (u and IntMask))) != 0 @@ -276,12 +276,12 @@ proc contains(s: TIntSet, key: int): bool = result = false proc incl(a: var TMemRegion, s: var TIntSet, key: int) = - var t = IntSetPut(a, s, key shr TrunkShift) + var t = intSetPut(a, s, key shr TrunkShift) var u = key and TrunkMask t.bits[u shr IntShift] = t.bits[u shr IntShift] or (1 shl (u and IntMask)) proc excl(s: var TIntSet, key: int) = - var t = IntSetGet(s, key shr TrunkShift) + var t = intSetGet(s, key shr TrunkShift) if t != nil: var u = key and TrunkMask t.bits[u shr IntShift] = t.bits[u shr IntShift] and not @@ -444,7 +444,7 @@ proc freeBigChunk(a: var TMemRegion, c: PBigChunk) = if isAccessible(a, ri) and chunkUnused(ri): sysAssert(not isSmallChunk(ri), "freeBigChunk 3") if not isSmallChunk(ri): - ListRemove(a.freeChunksList, cast[PBigChunk](ri)) + listRemove(a.freeChunksList, cast[PBigChunk](ri)) inc(c.size, ri.size) excl(a.chunkStarts, pageIndex(ri)) when coalescLeft: @@ -454,7 +454,7 @@ proc freeBigChunk(a: var TMemRegion, c: PBigChunk) = if isAccessible(a, le) and chunkUnused(le): sysAssert(not isSmallChunk(le), "freeBigChunk 5") if not isSmallChunk(le): - ListRemove(a.freeChunksList, cast[PBigChunk](le)) + listRemove(a.freeChunksList, cast[PBigChunk](le)) inc(le.size, c.size) excl(a.chunkStarts, pageIndex(c)) c = cast[PBigChunk](le) @@ -462,7 +462,7 @@ proc freeBigChunk(a: var TMemRegion, c: PBigChunk) = if c.size < ChunkOsReturn or weirdUnmap: incl(a, a.chunkStarts, pageIndex(c)) updatePrevSize(a, c, c.size) - ListAdd(a.freeChunksList, c) + listAdd(a.freeChunksList, c) c.used = false else: freeOsChunks(a, c, c.size) @@ -478,7 +478,7 @@ proc splitChunk(a: var TMemRegion, c: PBigChunk, size: int) = updatePrevSize(a, c, rest.size) c.size = size incl(a, a.chunkStarts, pageIndex(rest)) - ListAdd(a.freeChunksList, rest) + listAdd(a.freeChunksList, rest) proc getBigChunk(a: var TMemRegion, size: int): PBigChunk = # use first fit for now: @@ -489,10 +489,10 @@ proc getBigChunk(a: var TMemRegion, size: int): PBigChunk = while result != nil: sysAssert chunkUnused(result), "getBigChunk 3" if result.size == size: - ListRemove(a.freeChunksList, result) + listRemove(a.freeChunksList, result) break search elif result.size > size: - ListRemove(a.freeChunksList, result) + listRemove(a.freeChunksList, result) splitChunk(a, result, size) break search result = result.next @@ -531,7 +531,7 @@ proc allocInv(a: TMemRegion): bool = while it != nil: if it.zeroField != 0: echo "[SYSASSERT] it.zeroField != 0" - cprintf("%ld %p\n", it.zeroField, it) + c_printf("%ld %p\n", it.zeroField, it) return false it = it.next c = c.next @@ -557,7 +557,7 @@ proc rawAlloc(a: var TMemRegion, requestedSize: int): pointer = c.free = SmallChunkSize - smallChunkOverhead() - size c.next = nil c.prev = nil - ListAdd(a.freeSmallChunks[s], c) + listAdd(a.freeSmallChunks[s], c) result = addr(c.data) sysAssert((cast[TAddress](result) and (MemAlign-1)) == 0, "rawAlloc 4") else: @@ -581,7 +581,7 @@ proc rawAlloc(a: var TMemRegion, requestedSize: int): pointer = sysAssert(allocInv(a), "rawAlloc: before c.free < size") if c.free < size: sysAssert(allocInv(a), "rawAlloc: before listRemove test") - ListRemove(a.freeSmallChunks[s], c) + listRemove(a.freeSmallChunks[s], c) sysAssert(allocInv(a), "rawAlloc: end listRemove test") sysAssert(((cast[TAddress](result) and PageMask) - smallChunkOverhead()) %% size == 0, "rawAlloc 21") @@ -628,12 +628,12 @@ proc rawDealloc(a: var TMemRegion, p: pointer) = # check if it is not in the freeSmallChunks[s] list: if c.free < s: # add it to the freeSmallChunks[s] array: - ListAdd(a.freeSmallChunks[s div memAlign], c) + listAdd(a.freeSmallChunks[s div memAlign], c) inc(c.free, s) else: inc(c.free, s) if c.free == SmallChunkSize-smallChunkOverhead(): - ListRemove(a.freeSmallChunks[s div memAlign], c) + listRemove(a.freeSmallChunks[s div memAlign], c) c.size = SmallChunkSize freeBigChunk(a, cast[PBigChunk](c)) sysAssert(((cast[TAddress](p) and PageMask) - smallChunkOverhead()) %% @@ -802,13 +802,13 @@ template instantiateForRegion(allocator: expr) = when hasThreadSupport: var sharedHeap: TMemRegion var heapLock: TSysLock - initSysLock(HeapLock) + initSysLock(heapLock) proc allocShared(size: int): pointer = when hasThreadSupport: - acquireSys(HeapLock) + acquireSys(heapLock) result = alloc(sharedHeap, size) - releaseSys(HeapLock) + releaseSys(heapLock) else: result = alloc(size) @@ -818,17 +818,17 @@ template instantiateForRegion(allocator: expr) = proc deallocShared(p: pointer) = when hasThreadSupport: - acquireSys(HeapLock) + acquireSys(heapLock) dealloc(sharedHeap, p) - releaseSys(HeapLock) + releaseSys(heapLock) else: dealloc(p) proc reallocShared(p: pointer, newsize: int): pointer = when hasThreadSupport: - acquireSys(HeapLock) + acquireSys(heapLock) result = realloc(sharedHeap, p, newsize) - releaseSys(HeapLock) + releaseSys(heapLock) else: result = realloc(p, newsize) diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim index 064597df69..2d33965e3d 100644 --- a/lib/system/ansi_c.nim +++ b/lib/system/ansi_c.nim @@ -28,8 +28,8 @@ type final, incompleteStruct.} = object C_BinaryFile {.importc: "FILE", header: "<stdio.h>", final, incompleteStruct.} = object - C_TextFileStar = ptr CTextFile - C_BinaryFileStar = ptr CBinaryFile + C_TextFileStar = ptr C_TextFile + C_BinaryFileStar = ptr C_BinaryFile C_JmpBuf {.importc: "jmp_buf", header: "<setjmp.h>".} = object @@ -43,11 +43,11 @@ when not defined(SIGINT): when NoFakeVars: when defined(windows): const - SIGABRT = cint(22) - SIGFPE = cint(8) - SIGILL = cint(4) - SIGINT = cint(2) - SIGSEGV = cint(11) + SIGABRT = cint(22) + SIGFPE = cint(8) + SIGILL = cint(4) + SIGINT = cint(2) + SIGSEGV = cint(11) SIGTERM = cint(15) elif defined(macosx) or defined(linux): const diff --git a/lib/system/assign.nim b/lib/system/assign.nim index 525822620a..6b7ffaf7b6 100644 --- a/lib/system/assign.nim +++ b/lib/system/assign.nim @@ -7,10 +7,10 @@ # distribution, for details about the copyright. # -proc genericResetAux(dest: Pointer, n: ptr TNimNode) +proc genericResetAux(dest: pointer, n: ptr TNimNode) -proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) -proc genericAssignAux(dest, src: Pointer, n: ptr TNimNode, shallow: bool) = +proc genericAssignAux(dest, src: pointer, mt: PNimType, shallow: bool) +proc genericAssignAux(dest, src: pointer, n: ptr TNimNode, shallow: bool) = var d = cast[TAddress](dest) s = cast[TAddress](src) @@ -44,28 +44,28 @@ proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) = sysAssert(mt != nil, "genericAssignAux 2") case mt.Kind of tyString: - var x = cast[ppointer](dest) - var s2 = cast[ppointer](s)[] + var x = cast[PPointer](dest) + var s2 = cast[PPointer](s)[] if s2 == nil or shallow or ( cast[PGenericSeq](s2).reserved and seqShallowFlag) != 0: unsureAsgnRef(x, s2) else: unsureAsgnRef(x, copyString(cast[NimString](s2))) of tySequence: - var s2 = cast[ppointer](src)[] + var s2 = cast[PPointer](src)[] var seq = cast[PGenericSeq](s2) - var x = cast[ppointer](dest) + var x = cast[PPointer](dest) if s2 == nil or shallow or (seq.reserved and seqShallowFlag) != 0: # this can happen! nil sequences are allowed unsureAsgnRef(x, s2) return sysAssert(dest != nil, "genericAssignAux 3") unsureAsgnRef(x, newSeq(mt, seq.len)) - var dst = cast[taddress](cast[ppointer](dest)[]) + var dst = cast[TAddress](cast[PPointer](dest)[]) for i in 0..seq.len-1: genericAssignAux( cast[pointer](dst +% i*% mt.base.size +% GenericSeqSize), - cast[pointer](cast[taddress](s2) +% i *% mt.base.size +% + cast[pointer](cast[TAddress](s2) +% i *% mt.base.size +% GenericSeqSize), mt.Base, shallow) of tyObject: @@ -83,16 +83,16 @@ proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) = genericAssignAux(cast[pointer](d +% i*% mt.base.size), cast[pointer](s +% i*% mt.base.size), mt.base, shallow) of tyRef: - unsureAsgnRef(cast[ppointer](dest), cast[ppointer](s)[]) + unsureAsgnRef(cast[PPointer](dest), cast[PPointer](s)[]) else: copyMem(dest, src, mt.size) # copy raw bits -proc genericAssign(dest, src: Pointer, mt: PNimType) {.compilerProc.} = +proc genericAssign(dest, src: pointer, mt: PNimType) {.compilerProc.} = GC_disable() genericAssignAux(dest, src, mt, false) GC_enable() -proc genericShallowAssign(dest, src: Pointer, mt: PNimType) {.compilerProc.} = +proc genericShallowAssign(dest, src: pointer, mt: PNimType) {.compilerProc.} = GC_disable() genericAssignAux(dest, src, mt, true) GC_enable() @@ -126,7 +126,7 @@ when false: cprintf("%s %ld\n", k, t.size) debugNimType(t.base) -proc genericSeqAssign(dest, src: Pointer, mt: PNimType) {.compilerProc.} = +proc genericSeqAssign(dest, src: pointer, mt: PNimType) {.compilerProc.} = var src = src # ugly, but I like to stress the parser sometimes :-) genericAssign(dest, addr(src), mt) @@ -139,8 +139,8 @@ proc genericAssignOpenArray(dest, src: pointer, len: int, 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) = +proc objectInit(dest: pointer, typ: PNimType) {.compilerProc.} +proc objectInitAux(dest: pointer, n: ptr TNimNode) = var d = cast[TAddress](dest) case n.kind of nkNone: sysAssert(false, "objectInitAux") @@ -184,7 +184,7 @@ else: mixin destroy for i in countup(0, r.len - 1): destroy(r[i]) -proc genericReset(dest: Pointer, mt: PNimType) {.compilerProc.} +proc genericReset(dest: pointer, mt: PNimType) {.compilerProc.} proc genericResetAux(dest: Pointer, n: ptr TNimNode) = var d = cast[TAddress](dest) case n.kind @@ -202,7 +202,7 @@ proc genericReset(dest: Pointer, mt: PNimType) = sysAssert(mt != nil, "genericReset 2") case mt.Kind of tyString, tyRef, tySequence: - unsureAsgnRef(cast[ppointer](dest), nil) + unsureAsgnRef(cast[PPointer](dest), nil) of tyObject, tyTuple: # we don't need to reset m_type field for tyObject genericResetAux(dest, mt.node) diff --git a/lib/system/cellsets.nim b/lib/system/cellsets.nim index 85a24e856d..9a22ed0c5f 100644 --- a/lib/system/cellsets.nim +++ b/lib/system/cellsets.nim @@ -115,7 +115,7 @@ proc cellSetEnlarge(t: var TCellSet) = var oldMax = t.max t.max = ((t.max+1)*2)-1 var n = cast[PPageDescArray](alloc0((t.max + 1) * sizeof(PPageDesc))) - for i in 0 .. oldmax: + for i in 0 .. oldMax: if t.data[i] != nil: cellSetRawInsert(t, n, t.data[i]) dealloc(t.data) @@ -201,7 +201,7 @@ iterator elements(t: TCellSet): PCell {.inline.} = iterator elementsExcept(t, s: TCellSet): PCell {.inline.} = var r = t.head while r != nil: - let ss = CellSetGet(s, r.key) + let ss = cellSetGet(s, r.key) var i = 0 while i <= high(r.bits): var w = r.bits[i] diff --git a/lib/system/chcks.nim b/lib/system/chcks.nim index e781294832..eb1bf752ed 100644 --- a/lib/system/chcks.nim +++ b/lib/system/chcks.nim @@ -9,7 +9,7 @@ # Implementation of some runtime checks. -proc raiseRangeError(val: biggestInt) {.compilerproc, noreturn, noinline.} = +proc raiseRangeError(val: BiggestInt) {.compilerproc, noreturn, noinline.} = when hostOs == "standalone": sysFatal(EOutOfRange, "value out of range") else: diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index e5f20f22a9..5b00afc5bb 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -17,7 +17,7 @@ var ## Unstable API. when not defined(windows) or not defined(guiapp): - proc writeToStdErr(msg: CString) = write(stdmsg, msg) + proc writeToStdErr(msg: cstring) = write(stdmsg, msg) else: proc MessageBoxA(hWnd: cint, lpText, lpCaption: cstring, uType: int): int32 {. @@ -240,7 +240,7 @@ proc raiseExceptionAux(e: ref E_Base) = showErrorMessage(buf) quitOrDebug() -proc raiseException(e: ref E_Base, ename: CString) {.compilerRtl.} = +proc raiseException(e: ref E_Base, ename: cstring) {.compilerRtl.} = e.name = ename when hasSomeStackTrace: e.trace = "" diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 2daa3eafa7..2a137d7fbd 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -154,7 +154,7 @@ proc collectCT(gch: var TGcHeap) proc isOnStack*(p: pointer): bool {.noinline.} proc forAllChildren(cell: PCell, op: TWalkOp) proc doOperation(p: pointer, op: TWalkOp) -proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) +proc forAllChildrenAux(dest: pointer, mt: PNimType, op: TWalkOp) # we need the prototype here for debugging purposes when hasThreadSupport and hasSharedHeap: @@ -162,9 +162,9 @@ when hasThreadSupport and hasSharedHeap: template `++`(x: expr): stmt = discard atomicInc(x, rcIncrement) else: template `--`(x: expr): expr = - Dec(x, rcIncrement) + dec(x, rcIncrement) x <% rcIncrement - template `++`(x: expr): stmt = Inc(x, rcIncrement) + template `++`(x: expr): stmt = inc(x, rcIncrement) proc prepareDealloc(cell: PCell) = when useMarkForDebug: @@ -203,7 +203,7 @@ proc decRef(c: PCell) {.inline.} = gcAssert(c.refcount >=% rcIncrement, "decRef") if --c.refcount: rtlAddZCT(c) - elif canBeCycleRoot(c): + elif canbeCycleRoot(c): # unfortunately this is necessary here too, because a cycle might just # have been broken up and we could recycle it. rtlAddCycleRoot(c) @@ -214,7 +214,7 @@ proc incRef(c: PCell) {.inline.} = c.refcount = c.refCount +% rcIncrement # and not colorMask #writeCell("incRef", c) - if canBeCycleRoot(c): + if canbeCycleRoot(c): rtlAddCycleRoot(c) proc nimGCref(p: pointer) {.compilerProc, inline.} = incRef(usrToCell(p)) @@ -235,7 +235,7 @@ proc nimGCunrefNoCycle(p: pointer) {.compilerProc, inline.} = sysAssert(allocInv(gch.region), "end nimGCunrefNoCycle 2") sysAssert(allocInv(gch.region), "end nimGCunrefNoCycle 5") -proc asgnRef(dest: ppointer, src: pointer) {.compilerProc, inline.} = +proc asgnRef(dest: PPointer, src: pointer) {.compilerProc, inline.} = # the code generator calls this proc! gcAssert(not isOnStack(dest), "asgnRef") # BUGFIX: first incRef then decRef! @@ -243,7 +243,7 @@ proc asgnRef(dest: ppointer, src: pointer) {.compilerProc, inline.} = if dest[] != nil: decRef(usrToCell(dest[])) dest[] = src -proc asgnRefNoCycle(dest: ppointer, src: pointer) {.compilerProc, inline.} = +proc asgnRefNoCycle(dest: PPointer, src: pointer) {.compilerProc, inline.} = # the code generator calls this proc if it is known at compile time that no # cycle is possible. if src != nil: @@ -255,7 +255,7 @@ proc asgnRefNoCycle(dest: ppointer, src: pointer) {.compilerProc, inline.} = rtlAddZCT(c) dest[] = src -proc unsureAsgnRef(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 var parameters). @@ -318,7 +318,7 @@ proc forAllSlotsAux(dest: pointer, n: ptr TNimNode, op: TWalkOp) = # inlined for speed if n.sons[i].kind == nkSlot: if n.sons[i].typ.kind in {tyRef, tyString, tySequence}: - doOperation(cast[ppointer](d +% n.sons[i].offset)[], op) + doOperation(cast[PPointer](d +% n.sons[i].offset)[], op) else: forAllChildrenAux(cast[pointer](d +% n.sons[i].offset), n.sons[i].typ, op) @@ -335,7 +335,7 @@ proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) = if ntfNoRefs notin mt.flags: case mt.Kind of tyRef, tyString, tySequence: # leaf: - doOperation(cast[ppointer](d)[], op) + doOperation(cast[PPointer](d)[], op) of tyObject, tyTuple: forAllSlotsAux(dest, mt.node, op) of tyArray, tyArrayConstr, tyOpenArray: @@ -519,7 +519,7 @@ proc growObj(old: pointer, newsize: int, gch: var TGcHeap): pointer = d[j] = res break dec(j) - if canBeCycleRoot(ol): excl(gch.cycleRoots, ol) + if canbeCycleRoot(ol): excl(gch.cycleRoots, ol) when logGC: writeCell("growObj old cell", ol) writeCell("growObj new cell", res) @@ -869,7 +869,7 @@ else: sp = sp +% sizeof(pointer)*8 # last few entries: while sp <=% max: - gcMark(gch, cast[ppointer](sp)[]) + gcMark(gch, cast[PPointer](sp)[]) sp = sp +% sizeof(pointer) proc markStackAndRegisters(gch: var TGcHeap) {.noinline, cdecl.} = @@ -913,7 +913,7 @@ proc collectZCT(gch: var TGcHeap): bool = # In any case, it should be removed from the ZCT. But not # freed. **KEEP THIS IN MIND WHEN MAKING THIS INCREMENTAL!** when cycleGC: - if canBeCycleRoot(c): excl(gch.cycleRoots, c) + if canbeCycleRoot(c): excl(gch.cycleRoots, c) when logGC: writeCell("zct dealloc cell", c) gcTrace(c, csZctFreed) # We are about to free the object, call the finalizer BEFORE its diff --git a/lib/system/hti.nim b/lib/system/hti.nim index a2d132dbf9..9d8ece7df6 100644 --- a/lib/system/hti.nim +++ b/lib/system/hti.nim @@ -69,7 +69,7 @@ type kind: TNimNodeKind offset: int typ: ptr TNimType - name: Cstring + name: cstring len: int sons: ptr array [0..0x7fff, ptr TNimNode] diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index 942b6778ed..a80fdad8fe 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -33,7 +33,7 @@ const type PPointer = ptr pointer - TByteArray = array[0..1000_0000, byte] + TByteArray = array[0..1000_0000, Byte] PByte = ptr TByteArray PString = ptr string diff --git a/lib/system/repr.nim b/lib/system/repr.nim index f0d620952b..aacf266531 100644 --- a/lib/system/repr.nim +++ b/lib/system/repr.nim @@ -96,7 +96,7 @@ proc reprSetAux(result: var string, p: pointer, typ: PNimType) = of 4: u = ze64(cast[ptr int32](p)[]) of 8: u = cast[ptr int64](p)[] else: - var a = cast[pbyteArray](p) + var a = cast[PByteArray](p) for i in 0 .. typ.size*8-1: if (ze(a[i div 8]) and (1 shl (i mod 8))) != 0: if elemCounter > 0: add result, ", " @@ -129,12 +129,12 @@ when not defined(useNimRtl): when hasThreadSupport and hasSharedHeap and defined(heapLock): AcquireSys(HeapLock) when defined(TCellSet): - Init(cl.marked) + init(cl.marked) cl.recdepth = -1 # default is to display everything! cl.indent = 0 proc deinitReprClosure(cl: var TReprClosure) = - when defined(TCellSet): Deinit(cl.marked) + when defined(TCellSet): deinit(cl.marked) when hasThreadSupport and hasSharedHeap and defined(heapLock): ReleaseSys(HeapLock) @@ -224,17 +224,17 @@ when not defined(useNimRtl): reprRecord(result, p, t, cl) of tyRef, tyPtr: sysAssert(p != nil, "reprAux") - if cast[ppointer](p)[] == nil: add result, "nil" - else: reprRef(result, cast[ppointer](p)[], typ, cl) + 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) + 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 tyUInt8: add result, $ze(cast[ptr Int8](p)[]) - of tyUInt16: add result, $ze(cast[ptr Int16](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 tyUInt8: add result, $ze(cast[ptr int8](p)[]) + of tyUInt16: add result, $ze(cast[ptr int16](p)[]) of tyFloat: add result, $(cast[ptr float](p)[]) of tyFloat32: add result, $(cast[ptr float32](p)[]) @@ -246,8 +246,8 @@ when not defined(useNimRtl): 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)[]) + if cast[PPointer](p)[] == nil: add result, "nil" + else: add result, reprPointer(cast[PPointer](p)[]) else: add result, "(invalid data!)" inc(cl.recdepth) diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 82b4b183a9..9c0b0c5899 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -24,16 +24,16 @@ proc fgetc(stream: TFile): cint {.importc: "fgetc", header: "<stdio.h>", tags: [FReadIO].} proc ungetc(c: cint, f: TFile) {.importc: "ungetc", header: "<stdio.h>", tags: [].} -proc putc(c: Char, stream: TFile) {.importc: "putc", header: "<stdio.h>", +proc putc(c: char, stream: TFile) {.importc: "putc", header: "<stdio.h>", tags: [FWriteIO].} -proc fprintf(f: TFile, frmt: CString) {.importc: "fprintf", +proc fprintf(f: TFile, frmt: cstring) {.importc: "fprintf", header: "<stdio.h>", varargs, tags: [FWriteIO].} proc strlen(c: cstring): int {. importc: "strlen", header: "<string.h>", tags: [].} # C routine that is used here: -proc fread(buf: Pointer, size, n: int, f: TFile): int {. +proc fread(buf: pointer, size, n: int, f: TFile): int {. importc: "fread", header: "<stdio.h>", tags: [FReadIO].} proc fseek(f: TFile, offset: clong, whence: int): int {. importc: "fseek", header: "<stdio.h>", tags: [].} @@ -48,7 +48,7 @@ proc write(f: TFile, c: cstring) = fputs(c, f) when NoFakeVars: when defined(windows): const - IOFBF = cint(0) + IOFBF = cint(0) IONBF = cint(4) elif defined(macosx) or defined(linux): const @@ -179,9 +179,9 @@ proc rawEchoNL() {.inline, compilerproc.} = write(stdout, "\n") when defined(windows) and not defined(useWinAnsi): include "system/widestrs" - proc wfopen(filename, mode: widecstring): pointer {. + proc wfopen(filename, mode: WideCString): pointer {. importc: "_wfopen", nodecl.} - proc wfreopen(filename, mode: widecstring, stream: TFile): TFile {. + proc wfreopen(filename, mode: WideCString, stream: TFile): TFile {. importc: "_wfreopen", nodecl.} proc fopen(filename, mode: cstring): pointer = diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index d62a987ff4..bca14bb9d1 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -63,14 +63,14 @@ proc copyStrLast(s: NimString, start, last: int): NimString {.compilerProc.} = proc copyStr(s: NimString, start: int): NimString {.compilerProc.} = result = copyStrLast(s, start, s.len-1) -proc toNimStr(str: CString, len: int): NimString {.compilerProc.} = +proc toNimStr(str: cstring, len: int): NimString {.compilerProc.} = result = rawNewString(len) result.len = len c_memcpy(result.data, str, (len+1) * sizeof(Char)) #result.data[len] = '\0' # readline relies on this! -proc cstrToNimstr(str: CString): NimString {.compilerRtl.} = - result = toNimstr(str, c_strlen(str)) +proc cstrToNimstr(str: cstring): NimString {.compilerRtl.} = + result = toNimStr(str, c_strlen(str)) proc copyString(src: NimString): NimString {.compilerRtl.} = if src != nil: @@ -98,8 +98,8 @@ 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 = 0 - for i in 0..Len(s)-1: - h = h +% Ord(s[i]) + 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 @@ -150,10 +150,10 @@ proc addChar(s: NimString, c: char): NimString = # s = rawNewString(0); proc resizeString(dest: NimString, addlen: int): NimString {.compilerRtl.} = - if dest.len + addLen <= dest.space: + if dest.len + addlen <= dest.space: result = dest else: # slow path: - var sp = max(resize(dest.space), dest.len + addLen) + var sp = max(resize(dest.space), dest.len + addlen) result = cast[NimString](growObj(dest, sizeof(TGenericSeq) + sp + 1)) result.reserved = sp #result = rawNewString(sp) @@ -280,7 +280,7 @@ proc nimCharToStr(x: char): string {.compilerRtl.} = result = newString(1) result[0] = x -proc binaryStrSearch(x: openarray[string], y: string): int {.compilerproc.} = +proc binaryStrSearch(x: openArray[string], y: string): int {.compilerproc.} = var a = 0 b = len(x) diff --git a/lib/system/widestrs.nim b/lib/system/widestrs.nim index d856cc830a..e2a5d87e90 100644 --- a/lib/system/widestrs.nim +++ b/lib/system/widestrs.nim @@ -1,153 +1,153 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2012 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -## Nimrod support for C/C++'s `wide strings`:idx:. This is part of the system -## module! Do not import it directly! +# +# +# Nimrod's Runtime Library +# (c) Copyright 2012 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## Nimrod support for C/C++'s `wide strings`:idx:. This is part of the system +## module! Do not import it directly! when not defined(NimString): {.error: "You must not import this module explicitly".} - -type - TUtf16Char* = distinct int16 - WideCString* = ref array[0.. 1_000_000, TUtf16Char] - -proc len*(w: WideCString): int = - ## returns the length of a widestring. This traverses the whole string to - ## find the binary zero end marker! - while int16(w[result]) != 0'i16: inc result - -const - UNI_REPLACEMENT_CHAR = TUtf16Char(0xFFFD'i16) - UNI_MAX_BMP = 0x0000FFFF - UNI_MAX_UTF16 = 0x0010FFFF - UNI_MAX_UTF32 = 0x7FFFFFFF - UNI_MAX_LEGAL_UTF32 = 0x0010FFFF - - halfShift = 10 - halfBase = 0x0010000 - halfMask = 0x3FF - - UNI_SUR_HIGH_START = 0xD800 - UNI_SUR_HIGH_END = 0xDBFF - UNI_SUR_LOW_START = 0xDC00 - UNI_SUR_LOW_END = 0xDFFF - -template ones(n: expr): expr = ((1 shl n)-1) - -template fastRuneAt(s: cstring, i: int, result: expr, doInc = true) = - ## Returns the unicode character ``s[i]`` in `result`. If ``doInc == true`` - ## `i` is incremented by the number of bytes that have been processed. - bind ones - - if ord(s[i]) <=% 127: - result = ord(s[i]) - when doInc: inc(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)) - when doInc: inc(i, 2) - 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)) - when doInc: inc(i, 3) - 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)) - when doInc: inc(i, 4) - else: - result = 0xFFFD - when doInc: inc(i) - -iterator runes(s: cstring): int = - var - i = 0 - result: int - while s[i] != '\0': - fastRuneAt(s, i, result, true) - yield result - -proc newWideCString*(source: cstring, L: int): WideCString = + +type + TUtf16Char* = distinct int16 + WideCString* = ref array[0.. 1_000_000, TUtf16Char] + +proc len*(w: WideCString): int = + ## returns the length of a widestring. This traverses the whole string to + ## find the binary zero end marker! + while int16(w[result]) != 0'i16: inc result + +const + UNI_REPLACEMENT_CHAR = TUtf16Char(0xFFFD'i16) + UNI_MAX_BMP = 0x0000FFFF + UNI_MAX_UTF16 = 0x0010FFFF + UNI_MAX_UTF32 = 0x7FFFFFFF + UNI_MAX_LEGAL_UTF32 = 0x0010FFFF + + halfShift = 10 + halfBase = 0x0010000 + halfMask = 0x3FF + + UNI_SUR_HIGH_START = 0xD800 + UNI_SUR_HIGH_END = 0xDBFF + UNI_SUR_LOW_START = 0xDC00 + UNI_SUR_LOW_END = 0xDFFF + +template ones(n: expr): expr = ((1 shl n)-1) + +template fastRuneAt(s: cstring, i: int, result: expr, doInc = true) = + ## Returns the unicode character ``s[i]`` in `result`. If ``doInc == true`` + ## `i` is incremented by the number of bytes that have been processed. + bind ones + + if ord(s[i]) <=% 127: + result = ord(s[i]) + when doInc: inc(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)) + when doInc: inc(i, 2) + 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)) + when doInc: inc(i, 3) + 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)) + when doInc: inc(i, 4) + else: + result = 0xFFFD + when doInc: inc(i) + +iterator runes(s: cstring): int = + var + i = 0 + result: int + while s[i] != '\0': + fastRuneAt(s, i, result, true) + yield result + +proc newWideCString*(source: cstring, L: int): WideCString = unsafeNew(result, L * 4 + 2) - #result = cast[wideCString](alloc(L * 4 + 2)) - var d = 0 - for ch in runes(source): - if ch <=% UNI_MAX_BMP: - if ch >=% UNI_SUR_HIGH_START and ch <=% UNI_SUR_LOW_END: - result[d] = UNI_REPLACEMENT_CHAR - else: - result[d] = TUtf16Char(toU16(ch)) - elif ch >% UNI_MAX_UTF16: - result[d] = UNI_REPLACEMENT_CHAR - else: - let ch = ch -% halfBase - result[d] = TUtf16Char(toU16((ch shr halfShift) +% UNI_SUR_HIGH_START)) - inc d - result[d] = TUtf16Char(toU16((ch and halfMask) +% UNI_SUR_LOW_START)) - inc d - result[d] = TUtf16Char(0'i16) - -proc newWideCString*(s: cstring): WideCString = - if s.isNil: return nil - - when not defined(c_strlen): + #result = cast[wideCString](alloc(L * 4 + 2)) + var d = 0 + for ch in runes(source): + if ch <=% UNI_MAX_BMP: + if ch >=% UNI_SUR_HIGH_START and ch <=% UNI_SUR_LOW_END: + result[d] = UNI_REPLACEMENT_CHAR + else: + result[d] = TUtf16Char(toU16(ch)) + elif ch >% UNI_MAX_UTF16: + result[d] = UNI_REPLACEMENT_CHAR + else: + let ch = ch -% halfBase + result[d] = TUtf16Char(toU16((ch shr halfShift) +% UNI_SUR_HIGH_START)) + inc d + result[d] = TUtf16Char(toU16((ch and halfMask) +% UNI_SUR_LOW_START)) + inc d + result[d] = TUtf16Char(0'i16) + +proc newWideCString*(s: cstring): WideCString = + if s.isNil: return nil + + when not defined(c_strlen): proc c_strlen(a: cstring): int {. - header: "<string.h>", noSideEffect, importc: "strlen".} - - let L = cstrlen(s) - result = newWideCString(s, L) - -proc newWideCString*(s: string): WideCString = - result = newWideCString(s, s.len) - -proc `$`*(w: wideCString, estimate: int): string = - result = newStringOfCap(estimate + estimate shr 2) - - var i = 0 - while w[i].int16 != 0'i16: - var ch = w[i].int - inc i - if ch >=% UNI_SUR_HIGH_START and ch <=% UNI_SUR_HIGH_END: - # If the 16 bits following the high surrogate are in the source buffer... - let ch2 = w[i].int - # If it's a low surrogate, convert to UTF32: - if ch2 >=% UNI_SUR_LOW_START and ch2 <=% UNI_SUR_LOW_END: - ch = ((ch -% UNI_SUR_HIGH_START) shr halfShift) +% - (ch2 -% UNI_SUR_LOW_START) +% halfBase - inc i - - if ch <=% 127: - result.add chr(ch) - elif ch <=% 0x07FF: - result.add chr((ch shr 6) or 0b110_00000) - result.add chr((ch and ones(6)) or 0b10_000000) - elif ch <=% 0xFFFF: - result.add chr(ch shr 12 or 0b1110_0000) - result.add chr(ch shr 6 and ones(6) or 0b10_0000_00) - result.add chr(ch and ones(6) or 0b10_0000_00) - elif ch <=% 0x0010FFFF: - result.add chr(ch shr 18 or 0b1111_0000) - result.add chr(ch shr 12 and ones(6) or 0b10_0000_00) - result.add chr(ch shr 6 and ones(6) or 0b10_0000_00) - result.add chr(ch and ones(6) or 0b10_0000_00) - else: - # replacement char: - result.add chr(0xFFFD shr 12 or 0b1110_0000) - result.add chr(0xFFFD shr 6 and ones(6) or 0b10_0000_00) - result.add chr(0xFFFD and ones(6) or 0b10_0000_00) - -proc `$`*(s: WideCString): string = - result = s $ 80 + header: "<string.h>", noSideEffect, importc: "strlen".} + + let L = c_strlen(s) + result = newWideCString(s, L) + +proc newWideCString*(s: string): WideCString = + result = newWideCString(s, s.len) + +proc `$`*(w: WideCString, estimate: int): string = + result = newStringOfCap(estimate + estimate shr 2) + + var i = 0 + while w[i].int16 != 0'i16: + var ch = w[i].int + inc i + if ch >=% UNI_SUR_HIGH_START and ch <=% UNI_SUR_HIGH_END: + # If the 16 bits following the high surrogate are in the source buffer... + let ch2 = w[i].int + # If it's a low surrogate, convert to UTF32: + if ch2 >=% UNI_SUR_LOW_START and ch2 <=% UNI_SUR_LOW_END: + ch = ((ch -% UNI_SUR_HIGH_START) shr halfShift) +% + (ch2 -% UNI_SUR_LOW_START) +% halfBase + inc i + + if ch <=% 127: + result.add chr(ch) + elif ch <=% 0x07FF: + result.add chr((ch shr 6) or 0b110_00000) + result.add chr((ch and ones(6)) or 0b10_000000) + elif ch <=% 0xFFFF: + result.add chr(ch shr 12 or 0b1110_0000) + result.add chr(ch shr 6 and ones(6) or 0b10_0000_00) + result.add chr(ch and ones(6) or 0b10_0000_00) + elif ch <=% 0x0010FFFF: + result.add chr(ch shr 18 or 0b1111_0000) + result.add chr(ch shr 12 and ones(6) or 0b10_0000_00) + result.add chr(ch shr 6 and ones(6) or 0b10_0000_00) + result.add chr(ch and ones(6) or 0b10_0000_00) + else: + # replacement char: + result.add chr(0xFFFD shr 12 or 0b1110_0000) + result.add chr(0xFFFD shr 6 and ones(6) or 0b10_0000_00) + result.add chr(0xFFFD and ones(6) or 0b10_0000_00) + +proc `$`*(s: WideCString): string = + result = s $ 80 diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 481f61fda2..e288910d7a 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -42,13 +42,13 @@ type wShowWindow*: int16 cbReserved2*: int16 lpReserved2*: pointer - hStdInput*: THANDLE - hStdOutput*: THANDLE - hStdError*: THANDLE + hStdInput*: THandle + hStdOutput*: THandle + hStdError*: THandle TPROCESS_INFORMATION* {.final, pure.} = object - hProcess*: THANDLE - hThread*: THANDLE + hProcess*: THandle + hThread*: THandle dwProcessId*: int32 dwThreadId*: int32 @@ -96,7 +96,7 @@ const CREATE_UNICODE_ENVIRONMENT* = 1024'i32 -proc closeHandle*(hObject: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", +proc closeHandle*(hObject: THandle): WINBOOL {.stdcall, dynlib: "kernel32", importc: "CloseHandle".} proc readFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToRead: int32, @@ -114,11 +114,11 @@ proc createPipe*(hReadPipe, hWritePipe: var THandle, stdcall, dynlib: "kernel32", importc: "CreatePipe".} when useWinUnicode: - proc createProcessW*(lpApplicationName, lpCommandLine: widecstring, + proc createProcessW*(lpApplicationName, lpCommandLine: WideCString, lpProcessAttributes: ptr TSECURITY_ATTRIBUTES, lpThreadAttributes: ptr TSECURITY_ATTRIBUTES, bInheritHandles: WINBOOL, dwCreationFlags: int32, - lpEnvironment, lpCurrentDirectory: widecstring, + lpEnvironment, lpCurrentDirectory: WideCString, lpStartupInfo: var TSTARTUPINFO, lpProcessInformation: var TPROCESS_INFORMATION): WINBOOL{. stdcall, dynlib: "kernel32", importc: "CreateProcessW".} @@ -134,25 +134,25 @@ else: stdcall, dynlib: "kernel32", importc: "CreateProcessA".} -proc suspendThread*(hThread: THANDLE): int32 {.stdcall, dynlib: "kernel32", +proc suspendThread*(hThread: THandle): int32 {.stdcall, dynlib: "kernel32", importc: "SuspendThread".} -proc resumeThread*(hThread: THANDLE): int32 {.stdcall, dynlib: "kernel32", +proc resumeThread*(hThread: THandle): int32 {.stdcall, dynlib: "kernel32", importc: "ResumeThread".} -proc waitForSingleObject*(hHandle: THANDLE, dwMilliseconds: int32): int32 {. +proc waitForSingleObject*(hHandle: THandle, dwMilliseconds: int32): int32 {. stdcall, dynlib: "kernel32", importc: "WaitForSingleObject".} -proc terminateProcess*(hProcess: THANDLE, uExitCode: int): WINBOOL {.stdcall, +proc terminateProcess*(hProcess: THandle, uExitCode: int): WINBOOL {.stdcall, dynlib: "kernel32", importc: "TerminateProcess".} -proc getExitCodeProcess*(hProcess: THANDLE, lpExitCode: var int32): WINBOOL {. +proc getExitCodeProcess*(hProcess: THandle, lpExitCode: var int32): WINBOOL {. stdcall, dynlib: "kernel32", importc: "GetExitCodeProcess".} -proc getStdHandle*(nStdHandle: int32): THANDLE {.stdcall, dynlib: "kernel32", +proc getStdHandle*(nStdHandle: int32): THandle {.stdcall, dynlib: "kernel32", importc: "GetStdHandle".} -proc setStdHandle*(nStdHandle: int32, hHandle: THANDLE): WINBOOL {.stdcall, +proc setStdHandle*(nStdHandle: int32, hHandle: THandle): WINBOOL {.stdcall, dynlib: "kernel32", importc: "SetStdHandle".} -proc flushFileBuffers*(hFile: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", +proc flushFileBuffers*(hFile: THandle): WINBOOL {.stdcall, dynlib: "kernel32", importc: "FlushFileBuffers".} proc getLastError*(): int32 {.importc: "GetLastError", @@ -176,18 +176,18 @@ proc localFree*(p: pointer) {. when useWinUnicode: proc getCurrentDirectoryW*(nBufferLength: int32, - lpBuffer: widecstring): int32 {. + lpBuffer: WideCString): int32 {. importc: "GetCurrentDirectoryW", dynlib: "kernel32", stdcall.} - proc setCurrentDirectoryW*(lpPathName: widecstring): int32 {. + proc setCurrentDirectoryW*(lpPathName: WideCString): int32 {. importc: "SetCurrentDirectoryW", dynlib: "kernel32", stdcall.} - proc createDirectoryW*(pathName: widecstring, security: Pointer=nil): int32 {. + proc createDirectoryW*(pathName: WideCString, security: pointer=nil): int32 {. importc: "CreateDirectoryW", dynlib: "kernel32", stdcall.} - proc removeDirectoryW*(lpPathName: widecstring): int32 {. + proc removeDirectoryW*(lpPathName: WideCString): int32 {. importc: "RemoveDirectoryW", dynlib: "kernel32", stdcall.} - proc setEnvironmentVariableW*(lpName, lpValue: widecstring): int32 {. + proc setEnvironmentVariableW*(lpName, lpValue: WideCString): int32 {. stdcall, dynlib: "kernel32", importc: "SetEnvironmentVariableW".} - proc getModuleFileNameW*(handle: THandle, buf: wideCString, + proc getModuleFileNameW*(handle: THandle, buf: WideCString, size: int32): int32 {.importc: "GetModuleFileNameW", dynlib: "kernel32", stdcall.} else: @@ -230,10 +230,10 @@ type cAlternateFileName*: array[0..13, TWinChar] when useWinUnicode: - proc findFirstFileW*(lpFileName: widecstring, - lpFindFileData: var TWIN32_FIND_DATA): THANDLE {. + proc findFirstFileW*(lpFileName: WideCString, + lpFindFileData: var TWIN32_FIND_DATA): THandle {. stdcall, dynlib: "kernel32", importc: "FindFirstFileW".} - proc findNextFileW*(hFindFile: THANDLE, + proc findNextFileW*(hFindFile: THandle, lpFindFileData: var TWIN32_FIND_DATA): int32 {. stdcall, dynlib: "kernel32", importc: "FindNextFileW".} else: @@ -244,32 +244,32 @@ else: lpFindFileData: var TWIN32_FIND_DATA): int32 {. stdcall, dynlib: "kernel32", importc: "FindNextFileA".} -proc findClose*(hFindFile: THANDLE) {.stdcall, dynlib: "kernel32", +proc findClose*(hFindFile: THandle) {.stdcall, dynlib: "kernel32", importc: "FindClose".} when useWinUnicode: - proc getFullPathNameW*(lpFileName: widecstring, nBufferLength: int32, - lpBuffer: widecstring, - lpFilePart: var widecstring): int32 {. + proc getFullPathNameW*(lpFileName: WideCString, nBufferLength: int32, + lpBuffer: WideCString, + lpFilePart: var WideCString): int32 {. stdcall, dynlib: "kernel32", importc: "GetFullPathNameW".} - proc getFileAttributesW*(lpFileName: widecstring): int32 {. + proc getFileAttributesW*(lpFileName: WideCString): int32 {. stdcall, dynlib: "kernel32", importc: "GetFileAttributesW".} - proc setFileAttributesW*(lpFileName: widecstring, + proc setFileAttributesW*(lpFileName: WideCString, dwFileAttributes: int32): WINBOOL {. stdcall, dynlib: "kernel32", importc: "SetFileAttributesW".} - proc copyFileW*(lpExistingFileName, lpNewFileName: wideCString, + proc copyFileW*(lpExistingFileName, lpNewFileName: WideCString, bFailIfExists: cint): cint {. importc: "CopyFileW", stdcall, dynlib: "kernel32".} - proc getEnvironmentStringsW*(): widecstring {. + proc getEnvironmentStringsW*(): WideCString {. stdcall, dynlib: "kernel32", importc: "GetEnvironmentStringsW".} - proc freeEnvironmentStringsW*(para1: widecstring): int32 {. + proc freeEnvironmentStringsW*(para1: WideCString): int32 {. stdcall, dynlib: "kernel32", importc: "FreeEnvironmentStringsW".} - proc getCommandLineW*(): wideCString {.importc: "GetCommandLineW", + proc getCommandLineW*(): WideCString {.importc: "GetCommandLineW", stdcall, dynlib: "kernel32".} else: @@ -299,7 +299,7 @@ else: proc rdFileTime*(f: TFILETIME): int64 = result = ze64(f.dwLowDateTime) or (ze64(f.dwHighDateTime) shl 32) -proc rdFileSize*(f: TWin32FindData): int64 = +proc rdFileSize*(f: TWIN32_FIND_DATA): int64 = result = ze64(f.nFileSizeLow) or (ze64(f.nFileSizeHigh) shl 32) proc getSystemTimeAsFileTime*(lpSystemTimeAsFileTime: var TFILETIME) {. @@ -310,7 +310,7 @@ proc sleep*(dwMilliseconds: int32){.stdcall, dynlib: "kernel32", when useWinUnicode: proc shellExecuteW*(HWND: THandle, lpOperation, lpFile, - lpParameters, lpDirectory: widecstring, + lpParameters, lpDirectory: WideCString, nShowCmd: int32): THandle{. stdcall, dynlib: "shell32.dll", importc: "ShellExecuteW".} @@ -445,10 +445,10 @@ proc getservbyname*(name, proto: cstring): ptr TServent {. proc getservbyport*(port: cint, proto: cstring): ptr TServent {. stdcall, importc: "getservbyport", dynlib: ws2dll.} -proc gethostbyaddr*(ip: ptr TInAddr, len: cuint, theType: cint): ptr THostEnt {. +proc gethostbyaddr*(ip: ptr TInAddr, len: cuint, theType: cint): ptr Thostent {. stdcall, importc: "gethostbyaddr", dynlib: ws2dll.} -proc gethostbyname*(name: cstring): ptr THostEnt {. +proc gethostbyname*(name: cstring): ptr Thostent {. stdcall, importc: "gethostbyname", dynlib: ws2dll.} proc socket*(af, typ, protocol: cint): TSocketHandle {. @@ -457,20 +457,20 @@ proc socket*(af, typ, protocol: cint): TSocketHandle {. proc closesocket*(s: TSocketHandle): cint {. stdcall, importc: "closesocket", dynlib: ws2dll.} -proc accept*(s: TSocketHandle, a: ptr TSockAddr, addrlen: ptr TSockLen): TSocketHandle {. +proc accept*(s: TSocketHandle, a: ptr TSockAddr, addrlen: ptr Tsocklen): TSocketHandle {. stdcall, importc: "accept", dynlib: ws2dll.} -proc bindSocket*(s: TSocketHandle, name: ptr TSockAddr, namelen: TSockLen): cint {. +proc bindSocket*(s: TSocketHandle, name: ptr TSockAddr, namelen: Tsocklen): cint {. stdcall, importc: "bind", dynlib: ws2dll.} -proc connect*(s: TSocketHandle, name: ptr TSockAddr, namelen: TSockLen): cint {. +proc connect*(s: TSocketHandle, name: ptr TSockAddr, namelen: Tsocklen): cint {. stdcall, importc: "connect", dynlib: ws2dll.} proc getsockname*(s: TSocketHandle, name: ptr TSockAddr, - namelen: ptr TSockLen): cint {. + namelen: ptr Tsocklen): cint {. stdcall, importc: "getsockname", dynlib: ws2dll.} proc getsockopt*(s: TSocketHandle, level, optname: cint, optval: pointer, - optlen: ptr TSockLen): cint {. + optlen: ptr Tsocklen): cint {. stdcall, importc: "getsockopt", dynlib: ws2dll.} proc setsockopt*(s: TSocketHandle, level, optname: cint, optval: pointer, - optlen: TSockLen): cint {. + optlen: Tsocklen): cint {. stdcall, importc: "setsockopt", dynlib: ws2dll.} proc listen*(s: TSocketHandle, backlog: cint): cint {. @@ -492,7 +492,7 @@ proc sendto*(s: TSocketHandle, buf: pointer, len, flags: cint, proc shutdown*(s: TSocketHandle, how: cint): cint {. stdcall, importc: "shutdown", dynlib: ws2dll.} -proc getnameinfo*(a1: ptr Tsockaddr, a2: Tsocklen, +proc getnameinfo*(a1: ptr TSockAddr, a2: Tsocklen, a3: cstring, a4: Tsocklen, a5: cstring, a6: Tsocklen, a7: cint): cint {. stdcall, importc: "getnameinfo", dynlib: ws2dll.} @@ -500,18 +500,18 @@ proc getnameinfo*(a1: ptr Tsockaddr, a2: Tsocklen, proc inet_addr*(cp: cstring): int32 {. stdcall, importc: "inet_addr", dynlib: ws2dll.} -proc WSAFDIsSet(s: TSocketHandle, FDSet: var TFDSet): bool {. +proc WSAFDIsSet(s: TSocketHandle, FDSet: var TFdSet): bool {. stdcall, importc: "__WSAFDIsSet", dynlib: ws2dll.} -proc FD_ISSET*(Socket: TSocketHandle, FDSet: var TFDSet): cint = +proc FD_ISSET*(Socket: TSocketHandle, FDSet: var TFdSet): cint = result = if WSAFDIsSet(Socket, FDSet): 1'i32 else: 0'i32 -proc FD_SET*(Socket: TSocketHandle, FDSet: var TFDSet) = +proc FD_SET*(Socket: TSocketHandle, FDSet: var TFdSet) = if FDSet.fd_count < FD_SETSIZE: FDSet.fd_array[int(FDSet.fd_count)] = Socket inc(FDSet.fd_count) -proc FD_ZERO*(FDSet: var TFDSet) = +proc FD_ZERO*(FDSet: var TFdSet) = FDSet.fd_count = 0 proc WSAStartup*(wVersionRequired: int16, WSData: ptr TWSAData): cint {. @@ -531,7 +531,7 @@ const MAXIMUM_WAIT_OBJECTS* = 0x00000040 type - TWOHandleArray* = array[0..MAXIMUM_WAIT_OBJECTS - 1, THANDLE] + TWOHandleArray* = array[0..MAXIMUM_WAIT_OBJECTS - 1, THandle] PWOHandleArray* = ptr TWOHandleArray proc waitForMultipleObjects*(nCount: DWORD, lpHandles: PWOHandleArray, @@ -566,12 +566,12 @@ const ERROR_ACCESS_DENIED* = 5 when useWinUnicode: - proc createFileW*(lpFileName: widecstring, dwDesiredAccess, dwShareMode: DWORD, + proc createFileW*(lpFileName: WideCString, dwDesiredAccess, dwShareMode: DWORD, lpSecurityAttributes: pointer, dwCreationDisposition, dwFlagsAndAttributes: DWORD, - hTemplateFile: THANDLE): THANDLE {. + hTemplateFile: THandle): THandle {. stdcall, dynlib: "kernel32", importc: "CreateFileW".} - proc deleteFileW*(pathName: widecstring): int32 {. + proc deleteFileW*(pathName: WideCString): int32 {. importc: "DeleteFileW", dynlib: "kernel32", stdcall.} else: proc createFileA*(lpFileName: cstring, dwDesiredAccess, dwShareMode: DWORD, @@ -582,28 +582,28 @@ else: proc deleteFileA*(pathName: cstring): int32 {. importc: "DeleteFileA", dynlib: "kernel32", stdcall.} -proc setEndOfFile*(hFile: THANDLE): WINBOOL {.stdcall, dynlib: "kernel32", +proc setEndOfFile*(hFile: THandle): WINBOOL {.stdcall, dynlib: "kernel32", importc: "SetEndOfFile".} -proc setFilePointer*(hFile: THANDLE, lDistanceToMove: LONG, +proc setFilePointer*(hFile: THandle, lDistanceToMove: LONG, lpDistanceToMoveHigh: ptr LONG, dwMoveMethod: DWORD): DWORD {. stdcall, dynlib: "kernel32", importc: "SetFilePointer".} -proc getFileSize*(hFile: THANDLE, lpFileSizeHigh: ptr DWORD): DWORD{.stdcall, +proc getFileSize*(hFile: THandle, lpFileSizeHigh: ptr DWORD): DWORD{.stdcall, dynlib: "kernel32", importc: "GetFileSize".} -proc mapViewOfFileEx*(hFileMappingObject: THANDLE, dwDesiredAccess: DWORD, +proc mapViewOfFileEx*(hFileMappingObject: THandle, dwDesiredAccess: DWORD, dwFileOffsetHigh, dwFileOffsetLow: DWORD, dwNumberOfBytesToMap: DWORD, lpBaseAddress: pointer): pointer{. stdcall, dynlib: "kernel32", importc: "MapViewOfFileEx".} -proc createFileMappingW*(hFile: THANDLE, +proc createFileMappingW*(hFile: THandle, lpFileMappingAttributes: pointer, flProtect, dwMaximumSizeHigh: DWORD, dwMaximumSizeLow: DWORD, - lpName: pointer): THANDLE {. + lpName: pointer): THandle {. stdcall, dynlib: "kernel32", importc: "CreateFileMappingW".} when not useWinUnicode: From 9c3751a37c1ccba33853fbdab3e87e3af95deec5 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 28 Dec 2013 00:37:45 +0100 Subject: [PATCH 156/326] case consistency part 5 --- compiler/msgs.nim | 2 +- koch.nim | 10 +++---- lib/pure/parsecfg.nim | 54 +++++++++++++++++------------------ tools/niminst/buildbat.tmpl | 2 +- tools/niminst/buildsh.tmpl | 2 +- tools/niminst/debcreation.nim | 2 +- tools/niminst/deinstall.tmpl | 2 +- tools/niminst/inno.tmpl | 2 +- tools/niminst/install.tmpl | 2 +- tools/niminst/niminst.nim | 6 ++-- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index edc1dade31..7e851d1b2f 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -568,7 +568,7 @@ proc suggestWriteln*(s: string) = writeln(stdout, s) stdoutSocket.send(s & "\c\L") else: - Writeln(stdout, s) + writeln(stdout, s) if eInMemory in errorOutputs: bufferedMsgs.safeAdd(s) diff --git a/koch.nim b/koch.nim index 6e0d5bdf2e..f09dcb044e 100644 --- a/koch.nim +++ b/koch.nim @@ -110,16 +110,16 @@ proc findStartNimrod: string = # If these fail, we try to build nimrod with the "build.(sh|bat)" script. var nimrod = "nimrod".exe result = "bin" / nimrod - if ExistsFile(result): return + if existsFile(result): return for dir in split(getEnv("PATH"), PathSep): - if ExistsFile(dir / nimrod): return nimrod + if existsFile(dir / nimrod): return nimrod when defined(Posix): const buildScript = "build.sh" if ExistsFile(buildScript): if tryExec("./" & buildScript): return "bin" / nimrod else: const buildScript = "build.bat" - if ExistsFile(buildScript): + if existsFile(buildScript): if tryExec(buildScript): return "bin" / nimrod echo("Found no nimrod compiler and every attempt to build one failed!") @@ -188,14 +188,14 @@ proc removePattern(pattern: string) = removeFile(f) proc clean(args: string) = - if ExistsFile("koch.dat"): removeFile("koch.dat") + if existsFile("koch.dat"): removeFile("koch.dat") removePattern("web/*.html") removePattern("doc/*.html") cleanAux(getCurrentDir()) for kind, path in walkDir(getCurrentDir() / "build"): if kind == pcDir: echo "removing dir: ", path - RemoveDir(path) + removeDir(path) # -------------- update ------------------------------------------------------- diff --git a/lib/pure/parsecfg.nim b/lib/pure/parsecfg.nim index e8014cece5..b8f4bcae1c 100644 --- a/lib/pure/parsecfg.nim +++ b/lib/pure/parsecfg.nim @@ -113,7 +113,7 @@ proc handleHexChar(c: var TCfgParser, xi: var int) = xi = (xi shl 4) or (ord(c.buf[c.bufpos]) - ord('A') + 10) inc(c.bufpos) else: - nil + discard proc handleDecChars(c: var TCfgParser, xi: var int) = while c.buf[c.bufpos] in {'0'..'9'}: @@ -125,54 +125,54 @@ proc getEscapedChar(c: var TCfgParser, tok: var TToken) = case c.buf[c.bufpos] of 'n', 'N': add(tok.literal, "\n") - Inc(c.bufpos) + inc(c.bufpos) of 'r', 'R', 'c', 'C': add(tok.literal, '\c') - Inc(c.bufpos) + inc(c.bufpos) of 'l', 'L': add(tok.literal, '\L') - Inc(c.bufpos) + inc(c.bufpos) of 'f', 'F': add(tok.literal, '\f') inc(c.bufpos) of 'e', 'E': add(tok.literal, '\e') - Inc(c.bufpos) + inc(c.bufpos) of 'a', 'A': add(tok.literal, '\a') - Inc(c.bufpos) + inc(c.bufpos) of 'b', 'B': add(tok.literal, '\b') - Inc(c.bufpos) + inc(c.bufpos) of 'v', 'V': add(tok.literal, '\v') - Inc(c.bufpos) + inc(c.bufpos) of 't', 'T': add(tok.literal, '\t') - Inc(c.bufpos) + inc(c.bufpos) of '\'', '"': add(tok.literal, c.buf[c.bufpos]) - Inc(c.bufpos) + inc(c.bufpos) of '\\': add(tok.literal, '\\') - Inc(c.bufpos) + inc(c.bufpos) of 'x', 'X': inc(c.bufpos) var xi = 0 handleHexChar(c, xi) handleHexChar(c, xi) - add(tok.literal, Chr(xi)) + add(tok.literal, chr(xi)) of '0'..'9': var xi = 0 handleDecChars(c, xi) - if (xi <= 255): add(tok.literal, Chr(xi)) + if (xi <= 255): add(tok.literal, chr(xi)) else: tok.kind = tkInvalid else: tok.kind = tkInvalid -proc HandleCRLF(c: var TCfgParser, pos: int): int = +proc handleCRLF(c: var TCfgParser, pos: int): int = case c.buf[pos] - of '\c': result = lexbase.HandleCR(c, pos) - of '\L': result = lexbase.HandleLF(c, pos) + of '\c': result = lexbase.handleCR(c, pos) + of '\L': result = lexbase.handleLF(c, pos) else: result = pos proc getString(c: var TCfgParser, tok: var TToken, rawMode: bool) = @@ -183,16 +183,16 @@ proc getString(c: var TCfgParser, tok: var TToken, rawMode: bool) = # long string literal: inc(pos, 2) # skip "" # skip leading newline: - pos = HandleCRLF(c, pos) + pos = handleCRLF(c, pos) buf = c.buf while true: case buf[pos] of '"': if (buf[pos + 1] == '"') and (buf[pos + 2] == '"'): break add(tok.literal, '"') - Inc(pos) + inc(pos) of '\c', '\L': - pos = HandleCRLF(c, pos) + pos = handleCRLF(c, pos) buf = c.buf add(tok.literal, "\n") of lexbase.EndOfFile: @@ -200,7 +200,7 @@ proc getString(c: var TCfgParser, tok: var TToken, rawMode: bool) = break else: add(tok.literal, buf[pos]) - Inc(pos) + inc(pos) c.bufpos = pos + 3 # skip the three """ else: # ordinary string literal @@ -218,7 +218,7 @@ proc getString(c: var TCfgParser, tok: var TToken, rawMode: bool) = pos = c.bufPos else: add(tok.literal, ch) - Inc(pos) + inc(pos) c.bufpos = pos proc getSymbol(c: var TCfgParser, tok: var TToken) = @@ -226,7 +226,7 @@ proc getSymbol(c: var TCfgParser, tok: var TToken) = var buf = c.buf while true: add(tok.literal, buf[pos]) - Inc(pos) + inc(pos) if not (buf[pos] in SymChars): break c.bufpos = pos tok.kind = tkSymbol @@ -237,11 +237,11 @@ proc skip(c: var TCfgParser) = while true: case buf[pos] of ' ', '\t': - Inc(pos) + inc(pos) of '#', ';': while not (buf[pos] in {'\c', '\L', lexbase.EndOfFile}): inc(pos) of '\c', '\L': - pos = HandleCRLF(c, pos) + pos = handleCRLF(c, pos) buf = c.buf else: break # EndOfFile also leaves the loop @@ -249,7 +249,7 @@ proc skip(c: var TCfgParser) = proc rawGetTok(c: var TCfgParser, tok: var TToken) = tok.kind = tkInvalid - setlen(tok.literal, 0) + setLen(tok.literal, 0) skip(c) case c.buf[c.bufpos] of '=': @@ -267,7 +267,7 @@ proc rawGetTok(c: var TCfgParser, tok: var TToken) = tok.literal = ":" of 'r', 'R': if c.buf[c.bufPos + 1] == '\"': - Inc(c.bufPos) + inc(c.bufPos) getString(c, tok, true) else: getSymbol(c, tok) @@ -277,7 +277,7 @@ proc rawGetTok(c: var TCfgParser, tok: var TToken) = tok.literal = "]" of ']': tok.kind = tkBracketRi - Inc(c.bufpos) + inc(c.bufpos) tok.literal = "]" of '"': getString(c, tok, false) diff --git a/tools/niminst/buildbat.tmpl b/tools/niminst/buildbat.tmpl index 36e1a3e796..ca76b0ef2e 100644 --- a/tools/niminst/buildbat.tmpl +++ b/tools/niminst/buildbat.tmpl @@ -1,5 +1,5 @@ #! stdtmpl(subsChar='?') | standard -#proc GenerateBuildBatchScript(c: TConfigData, winIndex, cpuIndex: int): string = +#proc generateBuildBatchScript(c: TConfigData, winIndex, cpuIndex: int): string = # result = "@echo off\nREM Generated by niminst\n" SET CC=gcc SET LINKER=gcc diff --git a/tools/niminst/buildsh.tmpl b/tools/niminst/buildsh.tmpl index 0fb4907cfb..37ea35bd36 100644 --- a/tools/niminst/buildsh.tmpl +++ b/tools/niminst/buildsh.tmpl @@ -1,5 +1,5 @@ #! stdtmpl(subsChar='?') | standard -#proc GenerateBuildShellScript(c: TConfigData): string = +#proc generateBuildShellScript(c: TConfigData): string = # result = "#! /bin/sh\n# Generated from niminst\n" & # "# Template is in tools/buildsh.tmpl\n" & # "# To regenerate run ``niminst csource`` or ``koch csource``\n" diff --git a/tools/niminst/debcreation.nim b/tools/niminst/debcreation.nim index 982bfaf3d9..1f4a8630e1 100644 --- a/tools/niminst/debcreation.nim +++ b/tools/niminst/debcreation.nim @@ -101,7 +101,7 @@ proc createChangelog(pkgName, version, maintainer: string): string = addN(" * Initial release.") addN("") addN(" -- " & maintainer & " " & - formatDateTime(getGmTime(getTime()), "+0000")) + formatDateTime(getGMTime(getTime()), "+0000")) proc createRules(): string = ## Creates a nimrod application-agnostic rules file for building deb packages. diff --git a/tools/niminst/deinstall.tmpl b/tools/niminst/deinstall.tmpl index d9abf9228f..15f912af60 100644 --- a/tools/niminst/deinstall.tmpl +++ b/tools/niminst/deinstall.tmpl @@ -1,5 +1,5 @@ #! stdtmpl(subsChar='?') | standard -#proc GenerateDeinstallScript(c: TConfigData): string = +#proc generateDeinstallScript(c: TConfigData): string = # result = "#! /bin/sh\n# Generated by niminst\n" # var proj = c.name.toLower diff --git a/tools/niminst/inno.tmpl b/tools/niminst/inno.tmpl index 40edcc7909..b9d04755ee 100644 --- a/tools/niminst/inno.tmpl +++ b/tools/niminst/inno.tmpl @@ -1,5 +1,5 @@ #! stdtmpl | standard -#proc GenerateInnoSetup(c: TConfigData): string = +#proc generateInnoSetup(c: TConfigData): string = # result = "" ; Default Template for NimInst [Setup] diff --git a/tools/niminst/install.tmpl b/tools/niminst/install.tmpl index fa61eea5ef..437e13dfb5 100644 --- a/tools/niminst/install.tmpl +++ b/tools/niminst/install.tmpl @@ -1,5 +1,5 @@ #! stdtmpl(subsChar = '?') | standard -#proc GenerateInstallScript(c: TConfigData): string = +#proc generateInstallScript(c: TConfigData): string = # result = "#! /bin/sh\n# Generated by niminst\n" # var proj = c.name.toLower diff --git a/tools/niminst/niminst.nim b/tools/niminst/niminst.nim index 0c9717e12e..efedcf19d9 100644 --- a/tools/niminst/niminst.nim +++ b/tools/niminst/niminst.nim @@ -188,7 +188,7 @@ proc parseCmdLine(c: var TConfigData) = proc walkDirRecursively(s: var seq[string], root: string) = for k, f in walkDir(root): case k - of pcFile, pcLinkToFile: add(s, UnixToNativePath(f)) + of pcFile, pcLinkToFile: add(s, unixToNativePath(f)) of pcDir: walkDirRecursively(s, f) of pcLinkToDir: nil @@ -199,7 +199,7 @@ proc addFiles(s: var seq[string], patterns: seq[string]) = else: var i = 0 for f in walkFiles(p): - add(s, UnixToNativePath(f)) + add(s, unixToNativePath(f)) inc(i) if i == 0: echo("[Warning] No file found that matches: " & p) @@ -286,7 +286,7 @@ proc parseIniFile(c: var TConfigData) = of "console": c.app = appConsole of "gui": c.app = appGUI else: quit(errorStr(p, "expected: console or gui")) - of "license": c.license = UnixToNativePath(k.value) + of "license": c.license = unixToNativePath(k.value) else: quit(errorStr(p, "unknown variable: " & k.key)) of "var": nil of "winbin": filesOnly(p, k.key, v, c.cat[fcWinBin]) From bf205fa85d5b3b1caa5f7def0e2d73999ddfb6a9 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 28 Dec 2013 01:17:02 +0100 Subject: [PATCH 157/326] case consistency part 6 --- lib/core/macros.nim | 30 +++++----- lib/impure/re.nim | 66 +++++++++++----------- lib/pure/pegs.nim | 128 +++++++++++++++++++++--------------------- lib/pure/terminal.nim | 86 ++++++++++++++-------------- lib/system.nim | 4 +- lib/wrappers/pcre.nim | 18 +++--- tools/nimgrep.nim | 6 +- 7 files changed, 169 insertions(+), 169 deletions(-) diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 8ffd268fff..f1f1c8ddb6 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -147,15 +147,15 @@ proc del*(father: PNimrodNode, idx = 0, n = 1) {.magic: "NDel".} proc kind*(n: PNimrodNode): TNimrodNodeKind {.magic: "NKind".} ## returns the `kind` of the node `n`. -proc intVal*(n: PNimrodNode): biggestInt {.magic: "NIntVal".} -proc floatVal*(n: PNimrodNode): biggestFloat {.magic: "NFloatVal".} +proc intVal*(n: PNimrodNode): BiggestInt {.magic: "NIntVal".} +proc floatVal*(n: PNimrodNode): BiggestFloat {.magic: "NFloatVal".} proc symbol*(n: PNimrodNode): PNimrodSymbol {.magic: "NSymbol".} proc ident*(n: PNimrodNode): TNimrodIdent {.magic: "NIdent".} proc typ*(n: PNimrodNode): typedesc {.magic: "NGetType".} proc strVal*(n: PNimrodNode): string {.magic: "NStrVal".} -proc `intVal=`*(n: PNimrodNode, val: biggestInt) {.magic: "NSetIntVal".} -proc `floatVal=`*(n: PNimrodNode, val: biggestFloat) {.magic: "NSetFloatVal".} +proc `intVal=`*(n: PNimrodNode, val: BiggestInt) {.magic: "NSetIntVal".} +proc `floatVal=`*(n: PNimrodNode, val: BiggestFloat) {.magic: "NSetFloatVal".} proc `symbol=`*(n: PNimrodNode, val: PNimrodSymbol) {.magic: "NSetSymbol".} proc `ident=`*(n: PNimrodNode, val: TNimrodIdent) {.magic: "NSetIdent".} #proc `typ=`*(n: PNimrodNode, typ: typedesc) {.magic: "NSetType".} @@ -187,12 +187,12 @@ proc newStrLitNode*(s: string): PNimrodNode {.compileTime.} = result = newNimNode(nnkStrLit) result.strVal = s -proc newIntLitNode*(i: biggestInt): PNimrodNode {.compileTime.} = +proc newIntLitNode*(i: BiggestInt): PNimrodNode {.compileTime.} = ## creates a int literal node from `i` result = newNimNode(nnkIntLit) result.intVal = i -proc newFloatLitNode*(f: biggestFloat): PNimrodNode {.compileTime.} = +proc newFloatLitNode*(f: BiggestFloat): PNimrodNode {.compileTime.} = ## creates a float literal node from `f` result = newNimNode(nnkFloatLit) result.floatVal = f @@ -351,12 +351,12 @@ proc newLit*(c: char): PNimrodNode {.compileTime.} = result = newNimNode(nnkCharLit) result.intVal = ord(c) -proc newLit*(i: biggestInt): PNimrodNode {.compileTime.} = +proc newLit*(i: BiggestInt): PNimrodNode {.compileTime.} = ## produces a new integer literal node. result = newNimNode(nnkIntLit) result.intVal = i -proc newLit*(f: biggestFloat): PNimrodNode {.compileTime.} = +proc newLit*(f: BiggestFloat): PNimrodNode {.compileTime.} = ## produces a new float literal node. result = newNimNode(nnkFloatLit) result.floatVal = f @@ -535,7 +535,7 @@ from strutils import cmpIgnoreStyle, format proc expectKind*(n: PNimrodNode; k: set[TNimrodNodeKind]) {.compileTime.} = assert n.kind in k, "Expected one of $1, got $2".format(k, n.kind) -proc newProc*(name = newEmptyNode(); params: openarray[PNimrodNode] = [newEmptyNode()]; +proc newProc*(name = newEmptyNode(); params: openArray[PNimrodNode] = [newEmptyNode()]; body: PNimrodNode = newStmtList(), procType = nnkProcDef): PNimrodNode {.compileTime.} = ## shortcut for creating a new proc ## @@ -573,7 +573,7 @@ proc copyChildrenTo*(src, dest: PNimrodNode) {.compileTime.}= dest.add src[i].copyNimTree template expectRoutine(node: PNimrodNode): stmt = - expectKind(node, routineNodes) + expectKind(node, RoutineNodes) proc name*(someProc: PNimrodNode): PNimrodNode {.compileTime.} = someProc.expectRoutine @@ -610,7 +610,7 @@ proc body*(someProc: PNimrodNode): PNimrodNode {.compileTime.} = of routineNodes: return someProc[6] of nnkBlockStmt, nnkWhileStmt: - return someproc[1] + return someProc[1] of nnkForStmt: return someProc.last else: @@ -634,7 +634,7 @@ proc `$`*(node: PNimrodNode): string {.compileTime.} = of nnkIdent: result = $node.ident of nnkStrLit: - result = node.strval + result = node.strVal else: badNodeKind node.kind, "$" @@ -657,7 +657,7 @@ template findChild*(n: PNimrodNode; cond: expr): PNimrodNode {.immediate, dirty. break result -proc insert*(a: PNimrodNOde; pos: int; b: PNimrodNode) {.compileTime.} = +proc insert*(a: PNimrodNode; pos: int; b: PNimrodNode) {.compileTime.} = ## Insert node B into A at pos if high(a) < pos: ## add some empty nodes first @@ -678,14 +678,14 @@ proc basename*(a: PNimrodNode): PNimrodNode {.compiletime.} = of nnkIdent: return a of nnkPostfix, nnkPrefix: return a[1] else: - quit "Do not know how to get basename of ("& treerepr(a) &")\n"& repr(a) + quit "Do not know how to get basename of ("& treeRepr(a) &")\n"& repr(a) proc `basename=`*(a: PNimrodNode; val: string) {.compileTime.}= case a.kind of nnkIdent: macros.`ident=`(a, !val) of nnkPostfix, nnkPrefix: a[1] = ident(val) else: - quit "Do not know how to get basename of ("& treerepr(a)& ")\n"& repr(a) + quit "Do not know how to get basename of ("& treeRepr(a)& ")\n"& repr(a) proc postfix*(node: PNimrodNode; op: string): PNimrodNode {.compileTime.} = newNimNode(nnkPostfix).add(ident(op), node) diff --git a/lib/impure/re.nim b/lib/impure/re.nim index b92d39bf02..f6511dab4a 100644 --- a/lib/impure/re.nim +++ b/lib/impure/re.nim @@ -28,7 +28,7 @@ const ## More subpatterns cannot be captured! type - TRegExFlag* = enum ## options for regular expressions + TRegexFlag* = enum ## options for regular expressions reIgnoreCase = 0, ## do caseless matching reMultiLine = 1, ## ``^`` and ``$`` match newlines within data reDotAll = 2, ## ``.`` matches anything including NL @@ -36,11 +36,11 @@ type reStudy = 4 ## study the expression (may be omitted if the ## expression will be used only once) - TRegExDesc {.pure, final.} = object + TRegexDesc {.pure, final.} = object h: PPcre e: ptr TExtra - TRegEx* = ref TRegExDesc ## a compiled regular expression + TRegex* = ref TRegexDesc ## a compiled regular expression EInvalidRegEx* = object of EInvalidValue ## is raised if the pattern is no valid regular expression. @@ -53,13 +53,13 @@ proc raiseInvalidRegex(msg: string) {.noinline, noreturn.} = proc rawCompile(pattern: string, flags: cint): PPcre = var - msg: CString + msg: cstring offset: cint result = pcre.Compile(pattern, flags, addr(msg), addr(offset), nil) if result == nil: - raiseInvalidRegEx($msg & "\n" & pattern & "\n" & repeatChar(offset) & "^\n") + raiseInvalidRegex($msg & "\n" & pattern & "\n" & repeatChar(offset) & "^\n") -proc finalizeRegEx(x: TRegEx) = +proc finalizeRegEx(x: TRegex) = # XXX This is a hack, but PCRE does not export its "free" function properly. # Sigh. The hack relies on PCRE's implementation (see ``pcre_get.c``). # Fortunately the implementation is unlikely to change. @@ -67,7 +67,7 @@ proc finalizeRegEx(x: TRegEx) = if not isNil(x.e): pcre.free_substring(cast[cstring](x.e)) -proc re*(s: string, flags = {reExtended, reStudy}): TRegEx = +proc re*(s: string, flags = {reExtended, reStudy}): TRegex = ## Constructor of regular expressions. Note that Nimrod's ## extended raw string literals support this syntax ``re"[abc]"`` as ## a short form for ``re(r"[abc]")``. @@ -78,7 +78,7 @@ proc re*(s: string, flags = {reExtended, reStudy}): TRegEx = result.e = pcre.study(result.h, 0, msg) if not isNil(msg): raiseInvalidRegex($msg) -proc matchOrFind(s: string, pattern: TRegEx, matches: var openarray[string], +proc matchOrFind(s: string, pattern: TRegex, matches: var openArray[string], start, flags: cint): cint = var rawMatches: array[0..maxSubpatterns * 3 - 1, cint] @@ -92,7 +92,7 @@ proc matchOrFind(s: string, pattern: TRegEx, matches: var openarray[string], else: matches[i-1] = "" return rawMatches[1] - rawMatches[0] -proc findBounds*(s: string, pattern: TRegEx, matches: var openarray[string], +proc findBounds*(s: string, pattern: TRegex, matches: var openArray[string], start = 0): tuple[first, last: int] = ## returns the starting position and end position of `pattern` in `s` ## and the captured @@ -110,8 +110,8 @@ proc findBounds*(s: string, pattern: TRegEx, matches: var openarray[string], else: matches[i-1] = "" return (rawMatches[0].int, rawMatches[1].int - 1) -proc findBounds*(s: string, pattern: TRegEx, - matches: var openarray[tuple[first, last: int]], +proc findBounds*(s: string, pattern: TRegex, + matches: var openArray[tuple[first, last: int]], start = 0): tuple[first, last: int] = ## returns the starting position and end position of ``pattern`` in ``s`` ## and the captured substrings in the array `matches`. @@ -129,7 +129,7 @@ proc findBounds*(s: string, pattern: TRegEx, else: matches[i-1] = (-1,0) return (rawMatches[0].int, rawMatches[1].int - 1) -proc findBounds*(s: string, pattern: TRegEx, +proc findBounds*(s: string, pattern: TRegex, start = 0): tuple[first, last: int] = ## returns the starting position of `pattern` in `s`. If it does not ## match, ``(-1,0)`` is returned. @@ -140,14 +140,14 @@ proc findBounds*(s: string, pattern: TRegEx, if res < 0'i32: return (int(res), 0) return (int(rawMatches[0]), int(rawMatches[1]-1)) -proc matchOrFind(s: string, pattern: TRegEx, start, flags: cint): cint = +proc matchOrFind(s: string, pattern: TRegex, start, flags: cint): cint = var rawMatches: array [0..maxSubpatterns * 3 - 1, cint] result = pcre.Exec(pattern.h, pattern.e, s, len(s).cint, start, flags, cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3) if result >= 0'i32: result = rawMatches[1] - rawMatches[0] -proc match*(s: string, pattern: TRegEx, matches: var openarray[string], +proc match*(s: string, pattern: TRegex, matches: var openArray[string], start = 0): bool = ## returns ``true`` if ``s[start..]`` matches the ``pattern`` and ## the captured substrings in the array ``matches``. If it does not @@ -156,24 +156,24 @@ proc match*(s: string, pattern: TRegEx, matches: var openarray[string], return matchOrFind(s, pattern, matches, start.cint, pcre.ANCHORED) == cint(s.len - start) -proc match*(s: string, pattern: TRegEx, start = 0): bool = +proc match*(s: string, pattern: TRegex, start = 0): bool = ## returns ``true`` if ``s[start..]`` matches the ``pattern``. return matchOrFind(s, pattern, start.cint, pcre.ANCHORED) == cint(s.len-start) -proc matchLen*(s: string, pattern: TRegEx, matches: var openarray[string], +proc matchLen*(s: string, pattern: TRegex, matches: var openArray[string], start = 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. return matchOrFind(s, pattern, matches, start.cint, pcre.ANCHORED) -proc matchLen*(s: string, pattern: TRegEx, start = 0): int = +proc matchLen*(s: string, pattern: TRegex, start = 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. return matchOrFind(s, pattern, start.cint, pcre.ANCHORED) -proc find*(s: string, pattern: TRegEx, matches: var openarray[string], +proc find*(s: string, pattern: TRegex, matches: var openArray[string], start = 0): int = ## returns the starting position of ``pattern`` in ``s`` and the captured ## substrings in the array ``matches``. If it does not match, nothing @@ -190,7 +190,7 @@ proc find*(s: string, pattern: TRegEx, matches: var openarray[string], else: matches[i-1] = "" return rawMatches[0] -proc find*(s: string, pattern: TRegEx, start = 0): int = +proc find*(s: string, pattern: TRegex, start = 0): int = ## returns the starting position of ``pattern`` in ``s``. If it does not ## match, -1 is returned. var @@ -200,7 +200,7 @@ proc find*(s: string, pattern: TRegEx, start = 0): int = if res < 0'i32: return res return rawMatches[0] -iterator findAll*(s: string, pattern: TRegEx, start = 0): string = +iterator findAll*(s: string, pattern: TRegex, start = 0): string = ## Yields all matching *substrings* of `s` that match `pattern`. ## ## Note that since this is an iterator you should not modify the string you @@ -216,7 +216,7 @@ iterator findAll*(s: string, pattern: TRegEx, start = 0): string = yield substr(s, int(a), int(b)-1) i = b -proc findAll*(s: string, pattern: TRegEx, start = 0): seq[string] = +proc findAll*(s: string, pattern: TRegex, start = 0): seq[string] = ## returns all matching *substrings* of `s` that match `pattern`. ## If it does not match, @[] is returned. accumulateResult(findAll(s, pattern, start)) @@ -224,7 +224,7 @@ proc findAll*(s: string, pattern: TRegEx, start = 0): seq[string] = when not defined(nimhygiene): {.pragma: inject.} -template `=~` *(s: string, pattern: TRegEx): expr = +template `=~` *(s: string, pattern: TRegex): expr = ## This calls ``match`` with an implicit declared ``matches`` array that ## can be used in the scope of the ``=~`` call: ## @@ -244,30 +244,30 @@ template `=~` *(s: string, pattern: TRegEx): expr = ## bind maxSubPatterns when not definedInScope(matches): - var matches {.inject.}: array[0..maxSubPatterns-1, string] + var matches {.inject.}: array[0..MaxSubpatterns-1, string] match(s, pattern, matches) # ------------------------- more string handling ------------------------------ -proc contains*(s: string, pattern: TRegEx, start = 0): bool = +proc contains*(s: string, pattern: TRegex, start = 0): bool = ## same as ``find(s, pattern, start) >= 0`` return find(s, pattern, start) >= 0 -proc contains*(s: string, pattern: TRegEx, matches: var openArray[string], +proc contains*(s: string, pattern: TRegex, matches: var openArray[string], start = 0): bool = ## same as ``find(s, pattern, matches, start) >= 0`` return find(s, pattern, matches, start) >= 0 -proc startsWith*(s: string, prefix: TRegEx): bool = +proc startsWith*(s: string, prefix: TRegex): bool = ## returns true if `s` starts with the pattern `prefix` result = matchLen(s, prefix) >= 0 -proc endsWith*(s: string, suffix: TRegEx): bool = +proc endsWith*(s: string, suffix: TRegex): bool = ## returns true if `s` ends with the pattern `prefix` for i in 0 .. s.len-1: if matchLen(s, suffix, i) == s.len - i: return true -proc replace*(s: string, sub: TRegEx, by = ""): string = +proc replace*(s: string, sub: TRegex, by = ""): string = ## Replaces `sub` in `s` by the string `by`. Captures cannot be ## accessed in `by`. Examples: ## @@ -289,7 +289,7 @@ proc replace*(s: string, sub: TRegEx, by = ""): string = prev = match.last + 1 add(result, substr(s, prev)) -proc replacef*(s: string, sub: TRegEx, by: string): string = +proc replacef*(s: string, sub: TRegex, by: string): string = ## Replaces `sub` in `s` by the string `by`. Captures can be accessed in `by` ## with the notation ``$i`` and ``$#`` (see strutils.`%`). Examples: ## @@ -327,7 +327,7 @@ proc replacef*(s: string, sub: TRegEx, by: string): string = add(result, substr(s, i)) proc parallelReplace*(s: string, subs: openArray[ - tuple[pattern: TRegEx, repl: string]]): string = + tuple[pattern: TRegex, repl: string]]): string = ## Returns a modified copy of `s` with the substitutions in `subs` ## applied in parallel. result = "" @@ -347,14 +347,14 @@ proc parallelReplace*(s: string, subs: openArray[ add(result, substr(s, i)) proc transformFile*(infile, outfile: string, - subs: openArray[tuple[pattern: TRegEx, repl: string]]) = + subs: openArray[tuple[pattern: TRegex, repl: string]]) = ## reads in the file `infile`, performs a parallel replacement (calls ## `parallelReplace`) and writes back to `outfile`. Raises ``EIO`` if an ## error occurs. This is supposed to be used for quick scripting. var x = readFile(infile).string writeFile(outfile, x.parallelReplace(subs)) -iterator split*(s: string, sep: TRegEx): string = +iterator split*(s: string, sep: TRegex): string = ## Splits the string `s` into substrings. ## ## Substrings are separated by the regular expression `sep`. @@ -386,7 +386,7 @@ iterator split*(s: string, sep: TRegEx): string = if first < last: yield substr(s, first, last-1) -proc split*(s: string, sep: TRegEx): seq[string] = +proc split*(s: string, sep: TRegex): seq[string] = ## Splits the string `s` into substrings. accumulateResult(split(s, sep)) diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index d8fed845a3..a6147a96ca 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -249,23 +249,23 @@ proc newLine*: TPeg {.inline.} = ## constructs the PEG `newline`:idx: (``\n``) result.kind = pkNewline -proc UnicodeLetter*: TPeg {.inline.} = +proc unicodeLetter*: TPeg {.inline.} = ## constructs the PEG ``\letter`` which matches any Unicode letter. result.kind = pkLetter -proc UnicodeLower*: TPeg {.inline.} = +proc unicodeLower*: TPeg {.inline.} = ## constructs the PEG ``\lower`` which matches any Unicode lowercase letter. result.kind = pkLower -proc UnicodeUpper*: TPeg {.inline.} = +proc unicodeUpper*: TPeg {.inline.} = ## constructs the PEG ``\upper`` which matches any Unicode uppercase letter. result.kind = pkUpper -proc UnicodeTitle*: TPeg {.inline.} = +proc unicodeTitle*: TPeg {.inline.} = ## constructs the PEG ``\title`` which matches any Unicode title letter. result.kind = pkTitle -proc UnicodeWhitespace*: TPeg {.inline.} = +proc unicodeWhitespace*: TPeg {.inline.} = ## constructs the PEG ``\white`` which matches any Unicode ## whitespace character. result.kind = pkWhitespace @@ -340,28 +340,28 @@ proc newNonTerminal*(name: string, line, column: int): PNonTerminal {. template letters*: expr = ## expands to ``charset({'A'..'Z', 'a'..'z'})`` - charset({'A'..'Z', 'a'..'z'}) + charSet({'A'..'Z', 'a'..'z'}) template digits*: expr = ## expands to ``charset({'0'..'9'})`` - charset({'0'..'9'}) + charSet({'0'..'9'}) template whitespace*: expr = ## expands to ``charset({' ', '\9'..'\13'})`` - charset({' ', '\9'..'\13'}) + charSet({' ', '\9'..'\13'}) template identChars*: expr = ## expands to ``charset({'a'..'z', 'A'..'Z', '0'..'9', '_'})`` - charset({'a'..'z', 'A'..'Z', '0'..'9', '_'}) + charSet({'a'..'z', 'A'..'Z', '0'..'9', '_'}) template identStartChars*: expr = ## expands to ``charset({'A'..'Z', 'a'..'z', '_'})`` - charset({'a'..'z', 'A'..'Z', '_'}) + charSet({'a'..'z', 'A'..'Z', '_'}) template ident*: expr = ## same as ``[a-zA-Z_][a-zA-z_0-9]*``; standard identifier - sequence(charset({'a'..'z', 'A'..'Z', '_'}), - *charset({'a'..'z', 'A'..'Z', '0'..'9', '_'})) + sequence(charSet({'a'..'z', 'A'..'Z', '_'}), + *charSet({'a'..'z', 'A'..'Z', '0'..'9', '_'})) template natural*: expr = ## same as ``\d+`` @@ -385,7 +385,7 @@ proc esc(c: char, reserved = {'\0'..'\255'}): string = elif c in reserved: result = '\\' & c else: result = $c -proc singleQuoteEsc(c: Char): string = return "'" & esc(c, {'\''}) & "'" +proc singleQuoteEsc(c: char): string = return "'" & esc(c, {'\''}) & "'" proc singleQuoteEsc(str: string): string = result = "'" @@ -409,11 +409,11 @@ proc charSetEscAux(cc: set[char]): string = c1 = c2 inc(c1) -proc CharSetEsc(cc: set[char]): string = +proc charSetEsc(cc: set[char]): string = if card(cc) >= 128+64: - result = "[^" & CharSetEscAux({'\1'..'\xFF'} - cc) & ']' + result = "[^" & charSetEscAux({'\1'..'\xFF'} - cc) & ']' else: - result = '[' & CharSetEscAux(cc) & ']' + result = '[' & charSetEscAux(cc) & ']' proc toStrAux(r: TPeg, res: var string) = case r.kind @@ -590,7 +590,7 @@ proc rawMatch*(s: string, p: TPeg, start: int, c: var TCaptures): int {. var a: TRune result = start fastRuneAt(s, result, a) - if isWhitespace(a): dec(result, start) + if isWhiteSpace(a): dec(result, start) else: result = -1 else: result = -1 @@ -747,7 +747,7 @@ template fillMatches(s, caps, c: expr) = for k in 0..c.ml-1: caps[k] = substr(s, c.matches[k][0], c.matches[k][1]) -proc match*(s: string, pattern: TPeg, matches: var openarray[string], +proc match*(s: string, pattern: TPeg, matches: var openArray[string], start = 0): bool {.nosideEffect, rtl, extern: "npegs$1Capture".} = ## returns ``true`` if ``s[start..]`` matches the ``pattern`` and ## the captured substrings in the array ``matches``. If it does not @@ -765,7 +765,7 @@ proc match*(s: string, pattern: TPeg, c.origStart = start result = rawMatch(s, pattern, start, c) == len(s)-start -proc matchLen*(s: string, pattern: TPeg, matches: var openarray[string], +proc matchLen*(s: string, pattern: TPeg, matches: var openArray[string], start = 0): int {.nosideEffect, rtl, extern: "npegs$1Capture".} = ## 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 @@ -786,7 +786,7 @@ proc matchLen*(s: string, pattern: TPeg, c.origStart = start result = rawMatch(s, pattern, start, c) -proc find*(s: string, pattern: TPeg, matches: var openarray[string], +proc find*(s: string, pattern: TPeg, matches: var openArray[string], start = 0): int {.nosideEffect, rtl, extern: "npegs$1Capture".} = ## returns the starting position of ``pattern`` in ``s`` and the captured ## substrings in the array ``matches``. If it does not match, nothing @@ -801,7 +801,7 @@ proc find*(s: string, pattern: TPeg, matches: var openarray[string], return -1 # could also use the pattern here: (!P .)* P -proc findBounds*(s: string, pattern: TPeg, matches: var openarray[string], +proc findBounds*(s: string, pattern: TPeg, matches: var openArray[string], start = 0): tuple[first, last: int] {. nosideEffect, rtl, extern: "npegs$1Capture".} = ## returns the starting position and end position of ``pattern`` in ``s`` @@ -869,7 +869,7 @@ template `=~`*(s: string, pattern: TPeg): bool = ## bind maxSubpatterns when not definedInScope(matches): - var matches {.inject.}: array[0..maxSubpatterns-1, string] + var matches {.inject.}: array[0..MaxSubpatterns-1, string] match(s, pattern, matches) # ------------------------- more string handling ------------------------------ @@ -1074,14 +1074,14 @@ const "@", "built-in", "escaped", "$", "$", "^" ] -proc HandleCR(L: var TPegLexer, pos: int): int = +proc handleCR(L: var TPegLexer, pos: int): int = assert(L.buf[pos] == '\c') inc(L.linenumber) result = pos+1 if L.buf[result] == '\L': inc(result) L.lineStart = result -proc HandleLF(L: var TPegLexer, pos: int): int = +proc handleLF(L: var TPegLexer, pos: int): int = assert(L.buf[pos] == '\L') inc(L.linenumber) result = pos+1 @@ -1124,38 +1124,38 @@ proc getEscapedChar(c: var TPegLexer, tok: var TToken) = case c.buf[c.bufpos] of 'r', 'R', 'c', 'C': add(tok.literal, '\c') - Inc(c.bufpos) + inc(c.bufpos) of 'l', 'L': add(tok.literal, '\L') - Inc(c.bufpos) + inc(c.bufpos) of 'f', 'F': add(tok.literal, '\f') inc(c.bufpos) of 'e', 'E': add(tok.literal, '\e') - Inc(c.bufpos) + inc(c.bufpos) of 'a', 'A': add(tok.literal, '\a') - Inc(c.bufpos) + inc(c.bufpos) of 'b', 'B': add(tok.literal, '\b') - Inc(c.bufpos) + inc(c.bufpos) of 'v', 'V': add(tok.literal, '\v') - Inc(c.bufpos) + inc(c.bufpos) of 't', 'T': add(tok.literal, '\t') - Inc(c.bufpos) + inc(c.bufpos) of 'x', 'X': inc(c.bufpos) var xi = 0 handleHexChar(c, xi) handleHexChar(c, xi) if xi == 0: tok.kind = tkInvalid - else: add(tok.literal, Chr(xi)) + else: add(tok.literal, chr(xi)) of '0'..'9': var val = ord(c.buf[c.bufpos]) - ord('0') - Inc(c.bufpos) + inc(c.bufpos) var i = 1 while (i <= 3) and (c.buf[c.bufpos] in {'0'..'9'}): val = val * 10 + ord(c.buf[c.bufpos]) - ord('0') @@ -1169,7 +1169,7 @@ proc getEscapedChar(c: var TPegLexer, tok: var TToken) = tok.kind = tkInvalid else: add(tok.literal, c.buf[c.bufpos]) - Inc(c.bufpos) + inc(c.bufpos) proc skip(c: var TPegLexer) = var pos = c.bufpos @@ -1177,14 +1177,14 @@ proc skip(c: var TPegLexer) = while true: case buf[pos] of ' ', '\t': - Inc(pos) + inc(pos) of '#': while not (buf[pos] in {'\c', '\L', '\0'}): inc(pos) of '\c': - pos = HandleCR(c, pos) + pos = handleCR(c, pos) buf = c.buf of '\L': - pos = HandleLF(c, pos) + pos = handleLF(c, pos) buf = c.buf else: break # EndOfFile also leaves the loop @@ -1209,7 +1209,7 @@ proc getString(c: var TPegLexer, tok: var TToken) = break else: add(tok.literal, buf[pos]) - Inc(pos) + inc(pos) c.bufpos = pos proc getDollar(c: var TPegLexer, tok: var TToken) = @@ -1250,7 +1250,7 @@ proc getCharSet(c: var TPegLexer, tok: var TToken) = break else: ch = buf[pos] - Inc(pos) + inc(pos) incl(tok.charset, ch) if buf[pos] == '-': if buf[pos+1] == ']': @@ -1270,7 +1270,7 @@ proc getCharSet(c: var TPegLexer, tok: var TToken) = break else: ch2 = buf[pos] - Inc(pos) + inc(pos) for i in ord(ch)+1 .. ord(ch2): incl(tok.charset, chr(i)) c.bufpos = pos @@ -1281,7 +1281,7 @@ proc getSymbol(c: var TPegLexer, tok: var TToken) = var buf = c.buf while true: add(tok.literal, buf[pos]) - Inc(pos) + inc(pos) if buf[pos] notin strutils.IdentChars: break c.bufpos = pos tok.kind = tkIdentifier @@ -1298,7 +1298,7 @@ proc getBuiltin(c: var TPegLexer, tok: var TToken) = proc getTok(c: var TPegLexer, tok: var TToken) = tok.kind = tkInvalid tok.modifier = modNone - setlen(tok.literal, 0) + setLen(tok.literal, 0) skip(c) case c.buf[c.bufpos] of '{': @@ -1315,14 +1315,14 @@ proc getTok(c: var TPegLexer, tok: var TToken) = inc(c.bufpos) add(tok.literal, '}') of '[': - getCharset(c, tok) + getCharSet(c, tok) of '(': tok.kind = tkParLe - Inc(c.bufpos) + inc(c.bufpos) add(tok.literal, '(') of ')': tok.kind = tkParRi - Inc(c.bufpos) + inc(c.bufpos) add(tok.literal, ')') of '.': tok.kind = tkAny @@ -1452,28 +1452,28 @@ proc modifiedTerm(s: string, m: TModifier): TPeg = proc modifiedBackref(s: int, m: TModifier): TPeg = case m - of modNone, modVerbatim: result = backRef(s) - of modIgnoreCase: result = backRefIgnoreCase(s) - of modIgnoreStyle: result = backRefIgnoreStyle(s) + of modNone, modVerbatim: result = backref(s) + of modIgnoreCase: result = backrefIgnoreCase(s) + of modIgnoreStyle: result = backrefIgnoreStyle(s) proc builtin(p: var TPegParser): TPeg = # do not use "y", "skip" or "i" as these would be ambiguous case p.tok.literal of "n": result = newLine() - of "d": result = charset({'0'..'9'}) - of "D": result = charset({'\1'..'\xff'} - {'0'..'9'}) - of "s": result = charset({' ', '\9'..'\13'}) - of "S": result = charset({'\1'..'\xff'} - {' ', '\9'..'\13'}) - of "w": result = charset({'a'..'z', 'A'..'Z', '_', '0'..'9'}) - of "W": result = charset({'\1'..'\xff'} - {'a'..'z','A'..'Z','_','0'..'9'}) - of "a": result = charset({'a'..'z', 'A'..'Z'}) - of "A": result = charset({'\1'..'\xff'} - {'a'..'z', 'A'..'Z'}) + of "d": result = charSet({'0'..'9'}) + of "D": result = charSet({'\1'..'\xff'} - {'0'..'9'}) + of "s": result = charSet({' ', '\9'..'\13'}) + of "S": result = charSet({'\1'..'\xff'} - {' ', '\9'..'\13'}) + of "w": result = charSet({'a'..'z', 'A'..'Z', '_', '0'..'9'}) + of "W": result = charSet({'\1'..'\xff'} - {'a'..'z','A'..'Z','_','0'..'9'}) + of "a": result = charSet({'a'..'z', 'A'..'Z'}) + of "A": result = charSet({'\1'..'\xff'} - {'a'..'z', 'A'..'Z'}) of "ident": result = pegs.ident - of "letter": result = UnicodeLetter() - of "upper": result = UnicodeUpper() - of "lower": result = UnicodeLower() - of "title": result = UnicodeTitle() - of "white": result = UnicodeWhitespace() + of "letter": result = unicodeLetter() + of "upper": result = unicodeUpper() + of "lower": result = unicodeLower() + of "title": result = unicodeTitle() + of "white": result = unicodeWhitespace() else: pegError(p, "unknown built-in: " & p.tok.literal) proc token(terminal: TPeg, p: TPegParser): TPeg = @@ -1505,7 +1505,7 @@ proc primary(p: var TPegParser): TPeg = elif not arrowIsNextTok(p): var nt = getNonTerminal(p, p.tok.literal) incl(nt.flags, ntUsed) - result = nonTerminal(nt).token(p) + result = nonterminal(nt).token(p) getTok(p) else: pegError(p, "expression expected, but found: " & p.tok.literal) @@ -1517,7 +1517,7 @@ proc primary(p: var TPegParser): TPeg = of tkCharSet: if '\0' in p.tok.charset: pegError(p, "binary zero ('\\0') not allowed in character class") - result = charset(p.tok.charset).token(p) + result = charSet(p.tok.charset).token(p) getTok(p) of tkParLe: getTok(p) @@ -1549,7 +1549,7 @@ proc primary(p: var TPegParser): TPeg = of tkBackref: var m = p.tok.modifier if m == modNone: m = p.modifier - result = modifiedBackRef(p.tok.index, m).token(p) + result = modifiedBackref(p.tok.index, m).token(p) if p.tok.index < 0 or p.tok.index > p.captures: pegError(p, "invalid back reference index: " & $p.tok.index) getTok(p) diff --git a/lib/pure/terminal.nim b/lib/pure/terminal.nim index 501184aca3..20f1d06954 100644 --- a/lib/pure/terminal.nim +++ b/lib/pure/terminal.nim @@ -27,15 +27,15 @@ when defined(windows): var hTemp = GetStdHandle(STD_OUTPUT_HANDLE) if DuplicateHandle(GetCurrentProcess(), hTemp, GetCurrentProcess(), addr(conHandle), 0, 1, DUPLICATE_SAME_ACCESS) == 0: - OSError(OSLastError()) + osError(osLastError()) proc getCursorPos(): tuple [x,y: int] = - var c: TCONSOLE_SCREEN_BUFFER_INFO - if GetConsoleScreenBufferInfo(conHandle, addr(c)) == 0: OSError(OSLastError()) + var c: TCONSOLESCREENBUFFERINFO + if GetConsoleScreenBufferInfo(conHandle, addr(c)) == 0: osError(osLastError()) return (int(c.dwCursorPosition.x), int(c.dwCursorPosition.y)) proc getAttributes(): int16 = - var c: TCONSOLE_SCREEN_BUFFER_INFO + var c: TCONSOLESCREENBUFFERINFO # workaround Windows bugs: try several times if GetConsoleScreenBufferInfo(conHandle, addr(c)) != 0: return c.wAttributes @@ -48,10 +48,10 @@ proc setCursorPos*(x, y: int) = ## sets the terminal's cursor to the (x,y) position. (0,0) is the ## upper left of the screen. when defined(windows): - var c: TCoord + var c: TCOORD c.x = int16(x) c.y = int16(y) - if SetConsoleCursorPosition(conHandle, c) == 0: OSError(OSLastError()) + if SetConsoleCursorPosition(conHandle, c) == 0: osError(osLastError()) else: stdout.write("\e[" & $y & ';' & $x & 'f') @@ -59,12 +59,12 @@ proc setCursorXPos*(x: int) = ## sets the terminal's cursor to the x position. The y position is ## not changed. when defined(windows): - var scrbuf: TCONSOLE_SCREEN_BUFFER_INFO + var scrbuf: TCONSOLESCREENBUFFERINFO var hStdout = conHandle - if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: OSError(OSLastError()) + if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: osError(osLastError()) var origin = scrbuf.dwCursorPosition origin.x = int16(x) - if SetConsoleCursorPosition(conHandle, origin) == 0: OSError(OSLastError()) + if SetConsoleCursorPosition(conHandle, origin) == 0: osError(osLastError()) else: stdout.write("\e[" & $x & 'G') @@ -73,16 +73,16 @@ when defined(windows): ## sets the terminal's cursor to the y position. The x position is ## not changed. **Warning**: This is not supported on UNIX! when defined(windows): - var scrbuf: TCONSOLE_SCREEN_BUFFER_INFO + var scrbuf: TCONSOLESCREENBUFFERINFO var hStdout = conHandle - if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: OSError(OSLastError()) + if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: osError(osLastError()) var origin = scrbuf.dwCursorPosition origin.y = int16(y) - if SetConsoleCursorPosition(conHandle, origin) == 0: OSError(OSLastError()) + if SetConsoleCursorPosition(conHandle, origin) == 0: osError(osLastError()) else: - nil + discard -proc CursorUp*(count=1) = +proc cursorUp*(count=1) = ## Moves the cursor up by `count` rows. when defined(windows): var p = getCursorPos() @@ -91,7 +91,7 @@ proc CursorUp*(count=1) = else: stdout.write("\e[" & $count & 'A') -proc CursorDown*(count=1) = +proc cursorDown*(count=1) = ## Moves the cursor down by `count` rows. when defined(windows): var p = getCursorPos() @@ -100,7 +100,7 @@ proc CursorDown*(count=1) = else: stdout.write("\e[" & $count & 'B') -proc CursorForward*(count=1) = +proc cursorForward*(count=1) = ## Moves the cursor forward by `count` columns. when defined(windows): var p = getCursorPos() @@ -109,7 +109,7 @@ proc CursorForward*(count=1) = else: stdout.write("\e[" & $count & 'C') -proc CursorBackward*(count=1) = +proc cursorBackward*(count=1) = ## Moves the cursor backward by `count` columns. when defined(windows): var p = getCursorPos() @@ -119,78 +119,78 @@ proc CursorBackward*(count=1) = stdout.write("\e[" & $count & 'D') when true: - nil + discard else: - proc EraseLineEnd* = + proc eraseLineEnd* = ## Erases from the current cursor position to the end of the current line. when defined(windows): - nil + discard else: stdout.write("\e[K") - proc EraseLineStart* = + proc eraseLineStart* = ## Erases from the current cursor position to the start of the current line. when defined(windows): - nil + discard else: stdout.write("\e[1K") - proc EraseDown* = + proc eraseDown* = ## Erases the screen from the current line down to the bottom of the screen. when defined(windows): - nil + discard else: stdout.write("\e[J") - proc EraseUp* = + proc eraseUp* = ## Erases the screen from the current line up to the top of the screen. when defined(windows): - nil + discard else: stdout.write("\e[1J") -proc EraseLine* = +proc eraseLine* = ## Erases the entire current line. when defined(windows): - var scrbuf: TCONSOLE_SCREEN_BUFFER_INFO + var scrbuf: TCONSOLESCREENBUFFERINFO var numwrote: DWORD var hStdout = conHandle - if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: OSError(OSLastError()) + if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: osError(osLastError()) var origin = scrbuf.dwCursorPosition origin.x = 0'i16 - if SetConsoleCursorPosition(conHandle, origin) == 0: OSError(OSLastError()) + if SetConsoleCursorPosition(conHandle, origin) == 0: osError(osLastError()) var ht = scrbuf.dwSize.Y - origin.Y var wt = scrbuf.dwSize.X - origin.X if FillConsoleOutputCharacter(hStdout,' ', ht*wt, origin, addr(numwrote)) == 0: - OSError(OSLastError()) + osError(osLastError()) if FillConsoleOutputAttribute(hStdout, scrbuf.wAttributes, ht * wt, scrbuf.dwCursorPosition, addr(numwrote)) == 0: - OSError(OSLastError()) + osError(osLastError()) else: stdout.write("\e[2K") setCursorXPos(0) -proc EraseScreen* = +proc eraseScreen* = ## Erases the screen with the background colour and moves the cursor to home. when defined(windows): - var scrbuf: TCONSOLE_SCREEN_BUFFER_INFO + var scrbuf: TCONSOLESCREENBUFFERINFO var numwrote: DWORD - var origin: TCoord # is inititalized to 0, 0 + var origin: TCOORD # is inititalized to 0, 0 var hStdout = conHandle - if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: OSError(OSLastError()) + if GetConsoleScreenBufferInfo(hStdout, addr(scrbuf)) == 0: osError(osLastError()) if FillConsoleOutputCharacter(hStdout, ' ', scrbuf.dwSize.X*scrbuf.dwSize.Y, origin, addr(numwrote)) == 0: - OSError(OSLastError()) + osError(osLastError()) if FillConsoleOutputAttribute(hStdout, scrbuf.wAttributes, scrbuf.dwSize.X * scrbuf.dwSize.Y, origin, addr(numwrote)) == 0: - OSError(OSLastError()) + osError(osLastError()) setCursorXPos(0) else: stdout.write("\e[2J") -proc ResetAttributes* {.noconv.} = +proc resetAttributes* {.noconv.} = ## resets all attributes; it is advisable to register this as a quit proc ## with ``system.addQuitProc(resetAttributes)``. when defined(windows): @@ -227,7 +227,7 @@ proc setStyle*(style: set[TStyle]) = for s in items(style): stdout.write("\e[" & $ord(s) & 'm') -proc WriteStyled*(txt: string, style: set[TStyle] = {styleBright}) = +proc writeStyled*(txt: string, style: set[TStyle] = {styleBright}) = ## writes the text `txt` in a given `style`. when defined(windows): var old = getAttributes() @@ -320,8 +320,8 @@ proc isatty*(f: TFile): bool = proc styledEchoProcessArg(s: string) = write stdout, s proc styledEchoProcessArg(style: TStyle) = setStyle({style}) proc styledEchoProcessArg(style: set[TStyle]) = setStyle style -proc styledEchoProcessArg(color: TForegroundColor) = setForeGroundColor color -proc styledEchoProcessArg(color: TBackgroundColor) = setBackGroundColor color +proc styledEchoProcessArg(color: TForegroundColor) = setForegroundColor color +proc styledEchoProcessArg(color: TBackgroundColor) = setBackgroundColor color macro styledEcho*(m: varargs[expr]): stmt = ## to be documented. @@ -345,4 +345,4 @@ when isMainModule: writeln(stdout, "ordinary text") styledEcho("styled text ", {styleBright, styleBlink, styleUnderscore}) - \ No newline at end of file + diff --git a/lib/system.nim b/lib/system.nim index 7df4be4df9..b320f14dda 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -732,10 +732,10 @@ proc contains*[T](s: TSlice[T], value: T): bool {.noSideEffect, inline.} = result = s.a <= value and value <= s.b template `in` * (x, y: expr): expr {.immediate.} = contains(y, x) -template `not_in` * (x, y: expr): expr {.immediate.} = not contains(y, x) +template `notin` * (x, y: expr): expr {.immediate.} = not contains(y, x) proc `is` *[T, S](x: T, y: S): bool {.magic: "Is", noSideEffect.} -template `is_not` *(x, y: expr): expr {.immediate.} = not (x is y) +template `isnot` *(x, y: expr): expr {.immediate.} = not (x is y) proc `of` *[T, S](x: T, y: S): bool {.magic: "Of", noSideEffect.} diff --git a/lib/wrappers/pcre.nim b/lib/wrappers/pcre.nim index 46248dde54..afa8f447ab 100644 --- a/lib/wrappers/pcre.nim +++ b/lib/wrappers/pcre.nim @@ -243,7 +243,7 @@ type # remain compatible. type - Textra*{.pure, final.} = object + TExtra*{.pure, final.} = object flags*: int ## Bits for which fields are set study_data*: pointer ## Opaque data from pcre_study() match_limit*: int ## Maximum number of calls to match() @@ -260,7 +260,7 @@ type # without modification. type - Tcallout_block*{.pure, final.} = object + TCalloutBlock*{.pure, final.} = object version*: cint ## Identifies version of block callout_number*: cint ## Number compiled into pattern offset_vector*: ptr cint ## The offset vector @@ -284,7 +284,7 @@ type # User defined callback which provides a stack just before the match starts. type - Tjit_callback* = proc(p: pointer): ptr Tjit_stack{.cdecl.} + TJitCallback* = proc(p: pointer): ptr Tjit_stack{.cdecl.} # Exported PCRE functions @@ -303,18 +303,18 @@ proc copy_substring*(a2: cstring, a3: ptr cint, a4: cint, a5: cint, a6: cstring, a7: cint): cint{.cdecl, importc: "pcre_copy_substring", pcreImport.} -proc dfa_exec*(a2: ptr TPcre, a3: ptr Textra, a4: cstring, a5: cint, +proc dfa_exec*(a2: ptr TPcre, a3: ptr TExtra, a4: cstring, a5: cint, a6: cint, a7: cint, a8: ptr cint, a9: cint, a10: ptr cint, a11: cint): cint{.cdecl, importc: "pcre_dfa_exec", pcreImport.} -proc exec*(a2: ptr TPcre, a3: ptr Textra, a4: cstring, a5: cint, a6: cint, +proc exec*(a2: ptr TPcre, a3: ptr TExtra, a4: cstring, a5: cint, a6: cint, a7: cint, a8: ptr cint, a9: cint): cint {. cdecl, importc: "pcre_exec", pcreImport.} proc free_substring*(a2: cstring){.cdecl, importc: "pcre_free_substring", pcreImport.} proc free_substring_list*(a2: cstringArray){.cdecl, importc: "pcre_free_substring_list", pcreImport.} -proc fullinfo*(a2: ptr TPcre, a3: ptr Textra, a4: cint, a5: pointer): cint{. +proc fullinfo*(a2: ptr TPcre, a3: ptr TExtra, a4: cint, a5: pointer): cint{. cdecl, importc: "pcre_fullinfo", pcreImport.} proc get_named_substring*(a2: ptr TPcre, a3: cstring, a4: ptr cint, a5: cint, a6: cstring, a7: cstringArray): cint{.cdecl, @@ -334,13 +334,13 @@ proc maketables*(): ptr char{.cdecl, importc: "pcre_maketables", pcreImport.} proc refcount*(a2: ptr TPcre, a3: cint): cint{.cdecl, importc: "pcre_refcount", pcreImport.} -proc study*(a2: ptr TPcre, a3: cint, a4: var cstring): ptr Textra{.cdecl, +proc study*(a2: ptr TPcre, a3: cint, a4: var cstring): ptr TExtra{.cdecl, importc: "pcre_study", pcreImport.} proc version*(): cstring{.cdecl, importc: "pcre_version", pcreImport.} # Utility functions for byte order swaps. -proc pattern_to_host_byte_order*(a2: ptr TPcre, a3: ptr Textra, +proc pattern_to_host_byte_order*(a2: ptr TPcre, a3: ptr TExtra, a4: ptr char): cint{.cdecl, importc: "pcre_pattern_to_host_byte_order", pcreImport.} @@ -350,7 +350,7 @@ proc jit_stack_alloc*(a2: cint, a3: cint): ptr Tjit_stack{.cdecl, importc: "pcre_jit_stack_alloc", pcreImport.} proc jit_stack_free*(a2: ptr Tjit_stack){.cdecl, importc: "pcre_jit_stack_free", pcreImport.} -proc assign_jit_stack*(a2: ptr Textra, a3: Tjit_callback, a4: pointer){.cdecl, +proc assign_jit_stack*(a2: ptr TExtra, a3: TJitCallback, a4: pointer){.cdecl, importc: "pcre_assign_jit_stack", pcreImport.} var diff --git a/tools/nimgrep.nim b/tools/nimgrep.nim index c7893fe789..b20e86a68f 100644 --- a/tools/nimgrep.nim +++ b/tools/nimgrep.nim @@ -56,7 +56,7 @@ var proc ask(msg: string): string = stdout.write(msg) - result = stdin.readline() + result = stdin.readLine() proc Confirm: TConfirmEnum = while true: @@ -66,7 +66,7 @@ proc Confirm: TConfirmEnum = of "l", "all": return ceAll of "n", "no": return ceNo of "e", "none": return ceNone - else: nil + else: discard proc countLines(s: string, first, last: int): int = var i = first @@ -308,7 +308,7 @@ checkOptions({optIgnoreCase, optIgnoreStyle}, "ignore_case", "ignore_style") if optStdin in options: pattern = ask("pattern [ENTER to exit]: ") - if IsNil(pattern) or pattern.len == 0: quit(0) + if isNil(pattern) or pattern.len == 0: quit(0) if optReplace in options: replacement = ask("replacement [supports $1, $# notations]: ") From 7e0da3e8f7687ba9eb2c24beca7b7a833621d1bc Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 28 Dec 2013 01:36:35 +0100 Subject: [PATCH 158/326] case consistency part 7 --- lib/pure/collections/sets.nim | 40 +++++++++++------------ lib/pure/htmlgen.nim | 2 +- lib/pure/md5.nim | 60 +++++++++++++++++------------------ tools/cmerge.nim | 4 +-- tools/nimweb.nim | 22 ++++++------- 5 files changed, 63 insertions(+), 65 deletions(-) diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index 42b77d427c..7259772aad 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -65,38 +65,38 @@ template rawInsertImpl() {.dirty.} = data[h].key = key data[h].slot = seFilled -proc RawGet[A](s: TSet[A], key: A): int = +proc rawGet[A](s: TSet[A], key: A): int = rawGetImpl() proc contains*[A](s: TSet[A], key: A): bool = ## returns true iff `key` is in `s`. - var index = RawGet(s, key) + var index = rawGet(s, key) result = index >= 0 -proc RawInsert[A](s: var TSet[A], data: var TKeyValuePairSeq[A], key: A) = +proc rawInsert[A](s: var TSet[A], data: var TKeyValuePairSeq[A], key: A) = rawInsertImpl() -proc Enlarge[A](s: var TSet[A]) = +proc enlarge[A](s: var TSet[A]) = var n: TKeyValuePairSeq[A] newSeq(n, len(s.data) * growthFactor) for i in countup(0, high(s.data)): - if s.data[i].slot == seFilled: RawInsert(s, n, s.data[i].key) + if s.data[i].slot == seFilled: rawInsert(s, n, s.data[i].key) swap(s.data, n) template inclImpl() {.dirty.} = - var index = RawGet(s, key) + var index = rawGet(s, key) if index < 0: - if mustRehash(len(s.data), s.counter): Enlarge(s) - RawInsert(s, s.data, key) + if mustRehash(len(s.data), s.counter): enlarge(s) + rawInsert(s, s.data, key) inc(s.counter) template containsOrInclImpl() {.dirty.} = - var index = RawGet(s, key) + var index = rawGet(s, key) if index >= 0: result = true else: - if mustRehash(len(s.data), s.counter): Enlarge(s) - RawInsert(s, s.data, key) + if mustRehash(len(s.data), s.counter): enlarge(s) + rawInsert(s, s.data, key) inc(s.counter) proc incl*[A](s: var TSet[A], key: A) = @@ -105,7 +105,7 @@ proc incl*[A](s: var TSet[A], key: A) = proc excl*[A](s: var TSet[A], key: A) = ## excludes `key` from the set `s`. - var index = RawGet(s, key) + var index = rawGet(s, key) if index >= 0: s.data[index].slot = seDeleted dec(s.counter) @@ -122,7 +122,7 @@ proc initSet*[A](initialSize=64): TSet[A] = result.counter = 0 newSeq(result.data, initialSize) -proc toSet*[A](keys: openarray[A]): TSet[A] = +proc toSet*[A](keys: openArray[A]): TSet[A] = ## creates a new hash set that contains the given `keys`. result = initSet[A](nextPowerOfTwo(keys.len+10)) for key in items(keys): result.incl(key) @@ -169,15 +169,15 @@ iterator items*[A](s: TOrderedSet[A]): A = forAllOrderedPairs: yield s.data[h].key -proc RawGet[A](s: TOrderedSet[A], key: A): int = +proc rawGet[A](s: TOrderedSet[A], key: A): int = rawGetImpl() proc contains*[A](s: TOrderedSet[A], key: A): bool = ## returns true iff `key` is in `s`. - var index = RawGet(s, key) + var index = rawGet(s, key) result = index >= 0 -proc RawInsert[A](s: var TOrderedSet[A], +proc rawInsert[A](s: var TOrderedSet[A], data: var TOrderedKeyValuePairSeq[A], key: A) = rawInsertImpl() data[h].next = -1 @@ -185,7 +185,7 @@ proc RawInsert[A](s: var TOrderedSet[A], if s.last >= 0: data[s.last].next = h s.last = h -proc Enlarge[A](s: var TOrderedSet[A]) = +proc enlarge[A](s: var TOrderedSet[A]) = var n: TOrderedKeyValuePairSeq[A] newSeq(n, len(s.data) * growthFactor) var h = s.first @@ -194,7 +194,7 @@ proc Enlarge[A](s: var TOrderedSet[A]) = while h >= 0: var nxt = s.data[h].next if s.data[h].slot == seFilled: - RawInsert(s, n, s.data[h].key) + rawInsert(s, n, s.data[h].key) h = nxt swap(s.data, n) @@ -216,7 +216,7 @@ proc initOrderedSet*[A](initialSize=64): TOrderedSet[A] = result.last = -1 newSeq(result.data, initialSize) -proc toOrderedSet*[A](keys: openarray[A]): TOrderedSet[A] = +proc toOrderedSet*[A](keys: openArray[A]): TOrderedSet[A] = ## creates a new ordered hash set that contains the given `keys`. result = initOrderedSet[A](nextPowerOfTwo(keys.len+10)) for key in items(keys): result.incl(key) @@ -224,5 +224,3 @@ proc toOrderedSet*[A](keys: openarray[A]): TOrderedSet[A] = proc `$`*[A](s: TOrderedSet[A]): string = ## The `$` operator for ordered hash sets. dollarImpl() - - diff --git a/lib/pure/htmlgen.nim b/lib/pure/htmlgen.nim index 8d90f8589d..63737d583c 100644 --- a/lib/pure/htmlgen.nim +++ b/lib/pure/htmlgen.nim @@ -88,7 +88,7 @@ proc xmlCheckedTag*(e: PNimrodNode, tag: string, result.add(newStrLitNode("</")) result.add(newStrLitNode(tag)) result.add(newStrLitNode(">")) - result = NestList(!"&", result) + result = nestList(!"&", result) macro a*(e: expr): expr {.immediate.} = diff --git a/lib/pure/md5.nim b/lib/pure/md5.nim index e75f80b4cf..0328932fd0 100644 --- a/lib/pure/md5.nim +++ b/lib/pure/md5.nim @@ -16,9 +16,9 @@ type MD5Digest* = array[0..15, int8] MD5Buffer = array[0..63, int8] MD5Context* {.final.} = object - State: MD5State - Count: array[0..1, int32] - Buffer: MD5Buffer + state: MD5State + count: array[0..1, int32] + buffer: MD5Buffer const padding: cstring = "\x80\0\0\0" & @@ -32,16 +32,16 @@ const "\0\0\0\0" proc F(x, y, z: int32): int32 {.inline.} = - Result = (x and y) or ((not x) and z) + result = (x and y) or ((not x) and z) proc G(x, y, z: int32): int32 {.inline.} = - Result = (x and z) or (y and (not z)) + result = (x and z) or (y and (not z)) proc H(x, y, z: int32): int32 {.inline.} = - Result = x xor y xor z + result = x xor y xor z proc I(x, y, z: int32): int32 {.inline.} = - Result = y xor (x or (not z)) + result = y xor (x or (not z)) proc rot(x: var int32, n: int8) {.inline.} = x = toU32(x shl ze(n)) or (x shr toU32(32 -% ze(n))) @@ -75,7 +75,7 @@ proc encode(dest: var MD5Block, src: cstring) = ord(src[j+3]) shl 24) inc(j, 4) -proc decode(dest: var openarray[int8], src: openarray[int32]) = +proc decode(dest: var openArray[int8], src: openArray[int32]) = var i = 0 for j in 0..high(src): dest[i] = toU8(src[j] and 0xff'i32) @@ -87,7 +87,7 @@ proc decode(dest: var openarray[int8], src: openarray[int32]) = proc transform(Buffer: pointer, State: var MD5State) = var myBlock: MD5Block - encode(myBlock, cast[cstring](buffer)) + encode(myBlock, cast[cstring](Buffer)) var a = State[0] var b = State[1] var c = State[2] @@ -161,7 +161,7 @@ proc transform(Buffer: pointer, State: var MD5State) = State[2] = State[2] +% c State[3] = State[3] +% d -proc MD5Init*(c: var MD5Context) = +proc md5Init*(c: var MD5Context) = ## initializes a MD5Context c.State[0] = 0x67452301'i32 c.State[1] = 0xEFCDAB89'i32 @@ -169,64 +169,64 @@ proc MD5Init*(c: var MD5Context) = c.State[3] = 0x10325476'i32 c.Count[0] = 0'i32 c.Count[1] = 0'i32 - ZeroMem(addr(c.Buffer), SizeOf(MD5Buffer)) + zeroMem(addr(c.Buffer), sizeof(MD5Buffer)) -proc MD5Update*(c: var MD5Context, input: cstring, len: int) = +proc md5Update*(c: var MD5Context, input: cstring, len: int) = ## updates the MD5Context with the `input` data of length `len` var input = input - var Index = (c.Count[0] shr 3) and 0x3F + var Index = (c.count[0] shr 3) and 0x3F c.Count[0] = c.count[0] +% toU32(len shl 3) if c.Count[0] < (len shl 3): c.Count[1] = c.count[1] +% 1'i32 c.Count[1] = c.count[1] +% toU32(len shr 29) var PartLen = 64 - Index if len >= PartLen: - CopyMem(addr(c.Buffer[Index]), Input, PartLen) + copyMem(addr(c.Buffer[Index]), input, PartLen) transform(addr(c.Buffer), c.State) var i = PartLen while i + 63 < len: - Transform(addr(Input[I]), c.State) + transform(addr(input[i]), c.State) inc(i, 64) - CopyMem(addr(c.Buffer[0]), addr(Input[i]), len-i) + copyMem(addr(c.Buffer[0]), addr(input[i]), len-i) else: - CopyMem(addr(c.Buffer[Index]), addr(Input[0]), len) + copyMem(addr(c.Buffer[Index]), addr(input[0]), len) -proc MD5Final*(c: var MD5Context, digest: var MD5Digest) = +proc md5Final*(c: var MD5Context, digest: var MD5Digest) = ## finishes the MD5Context and stores the result in `digest` var Bits: MD5CBits PadLen: int - decode(bits, c.Count) + decode(Bits, c.Count) var Index = (c.Count[0] shr 3) and 0x3F if Index < 56: PadLen = 56 - Index else: PadLen = 120 - Index - MD5Update(c, padding, PadLen) - MD5Update(c, cast[cstring](addr(Bits)), 8) + md5Update(c, padding, PadLen) + md5Update(c, cast[cstring](addr(Bits)), 8) decode(digest, c.State) - ZeroMem(addr(c), SizeOf(MD5Context)) + zeroMem(addr(c), sizeof(MD5Context)) proc toMD5*(s: string): MD5Digest = ## computes the MD5Digest value for a string `s` var c: MD5Context - MD5Init(c) - MD5Update(c, cstring(s), len(s)) - MD5Final(c, result) + md5Init(c) + md5Update(c, cstring(s), len(s)) + md5Final(c, result) proc `$`*(D: MD5Digest): string = ## converts a MD5Digest value into its string representation const digits = "0123456789abcdef" result = "" for i in 0..15: - add(result, Digits[(D[I] shr 4) and 0xF]) - add(result, Digits[D[I] and 0xF]) + add(result, Digits[(D[i] shr 4) and 0xF]) + add(result, Digits[D[i] and 0xF]) proc getMD5*(s: string): string = ## computes an MD5 value of `s` and returns its string representation var c: MD5Context d: MD5Digest - MD5Init(c) - MD5Update(c, cstring(s), len(s)) - MD5Final(c, d) + md5Init(c) + md5Update(c, cstring(s), len(s)) + md5Final(c, d) result = $d proc `==`*(D1, D2: MD5Digest): bool = diff --git a/tools/cmerge.nim b/tools/cmerge.nim index ca221014f5..003b0e555e 100644 --- a/tools/cmerge.nim +++ b/tools/cmerge.nim @@ -34,7 +34,7 @@ proc main(dir, outfile: string) = else: quit("Cannot open for writing: " & outfile) -if ParamCount() != 2: +if paramCount() != 2: quit "Usage: cmerge directory outfile" else: - main(ParamStr(1), addFileExt(ParamStr(2), "c")) + main(paramStr(1), addFileExt(paramStr(2), "c")) diff --git a/tools/nimweb.nim b/tools/nimweb.nim index c5d510eacc..84b7902488 100644 --- a/tools/nimweb.nim +++ b/tools/nimweb.nim @@ -200,32 +200,32 @@ proc parseIniFile(c: var TConfigData) = # ------------------- main ---------------------------------------------------- -proc Exec(cmd: string) = +proc exec(cmd: string) = echo(cmd) if os.execShellCmd(cmd) != 0: quit("external program failed") proc buildDoc(c: var TConfigData, destPath: string) = # call nim for the documentation: for d in items(c.doc): - Exec("nimrod rst2html $# -o:$# --index:on $#" % + exec("nimrod rst2html $# -o:$# --index:on $#" % [c.nimrodArgs, destPath / changeFileExt(splitFile(d).name, "html"), d]) for d in items(c.srcdoc): - Exec("nimrod doc $# -o:$# --index:on $#" % + exec("nimrod doc $# -o:$# --index:on $#" % [c.nimrodArgs, destPath / changeFileExt(splitFile(d).name, "html"), d]) for d in items(c.srcdoc2): - Exec("nimrod doc2 $# -o:$# --index:on $#" % + exec("nimrod doc2 $# -o:$# --index:on $#" % [c.nimrodArgs, destPath / changeFileExt(splitFile(d).name, "html"), d]) - Exec("nimrod buildIndex -o:$1/theindex.html $1" % [destPath]) + exec("nimrod buildIndex -o:$1/theindex.html $1" % [destPath]) proc buildPdfDoc(c: var TConfigData, destPath: string) = if os.execShellCmd("pdflatex -version") != 0: echo "pdflatex not found; no PDF documentation generated" else: for d in items(c.pdf): - Exec("nimrod rst2tex $# $#" % [c.nimrodArgs, d]) + exec("nimrod rst2tex $# $#" % [c.nimrodArgs, d]) # call LaTeX twice to get cross references right: - Exec("pdflatex " & changeFileExt(d, "tex")) - Exec("pdflatex " & changeFileExt(d, "tex")) + exec("pdflatex " & changeFileExt(d, "tex")) + exec("pdflatex " & changeFileExt(d, "tex")) # delete all the crappy temporary files: var pdf = splitFile(d).name & ".pdf" moveFile(dest=destPath / pdf, source=pdf) @@ -239,7 +239,7 @@ proc buildPdfDoc(c: var TConfigData, destPath: string) = proc buildAddDoc(c: var TConfigData, destPath: string) = # build additional documentation (without the index): for d in items(c.webdoc): - Exec("nimrod doc $# -o:$# $#" % + exec("nimrod doc $# -o:$# $#" % [c.nimrodArgs, destPath / changeFileExt(splitFile(d).name, "html"), d]) proc parseNewsTitles(inputFilename: string): seq[TRssItem] = @@ -253,7 +253,7 @@ proc parseNewsTitles(inputFilename: string): seq[TRssItem] = if not open(input, inputFilename): quit("Could not read $1 for rss generation" % [inputFilename]) finally: input.close() - while input.readline(line): + while input.readLine(line): if line =~ reYearMonthDayTitle: result.add(TRssItem(year: matches[0], month: matches[1], day: matches[2], title: matches[3])) @@ -332,7 +332,7 @@ proc main(c: var TConfigData) = for i in 0..c.tabs.len-1: var file = c.tabs[i].val let rss = if file in ["news", "index"]: extractFilename(rssUrl) else: "" - Exec(cmd % [c.nimrodArgs, file]) + exec(cmd % [c.nimrodArgs, file]) var temp = "web" / changeFileExt(file, "temp") var content: string try: From e2648fa3fb7b00b3485b8f34daf7dcdb32d53778 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 28 Dec 2013 01:47:40 +0100 Subject: [PATCH 159/326] case consistency part 8 --- compiler/c2nim/c2nim.nim | 2 +- compiler/c2nim/clex.nim | 58 +++++++++++++++++++-------------------- compiler/c2nim/cparse.nim | 52 +++++++++++++++++------------------ compiler/c2nim/cpp.nim | 12 ++++---- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/compiler/c2nim/c2nim.nim b/compiler/c2nim/c2nim.nim index df1e42f23d..1c701a386c 100644 --- a/compiler/c2nim/c2nim.nim +++ b/compiler/c2nim/c2nim.nim @@ -40,7 +40,7 @@ Options: proc main(infile, outfile: string, options: PParserOptions) = var start = getTime() - var stream = LLStreamOpen(infile, fmRead) + var stream = llStreamOpen(infile, fmRead) if stream == nil: rawMessage(errCannotOpenFile, infile) var p: TParser openParser(p, infile, stream, options) diff --git a/compiler/c2nim/clex.nim b/compiler/c2nim/clex.nim index f949b97cbd..7e5526a10f 100644 --- a/compiler/c2nim/clex.nim +++ b/compiler/c2nim/clex.nim @@ -103,7 +103,7 @@ type inDirective: bool proc getTok*(L: var TLexer, tok: var TToken) -proc PrintTok*(tok: TToken) +proc printTok*(tok: TToken) proc `$`*(tok: TToken): string # implementation @@ -138,7 +138,7 @@ proc lexMessagePos(L: var TLexer, msg: TMsgKind, pos: int, arg = "") = var info = newLineInfo(L.fileIdx, L.linenumber, pos - L.lineStart) msgs.GlobalError(info, msg, arg) -proc TokKindToStr*(k: TTokKind): string = +proc tokKindToStr*(k: TTokKind): string = case k of pxEof: result = "[EOF]" of pxInvalid: result = "[invalid]" @@ -211,9 +211,9 @@ proc `$`(tok: TToken): string = of pxSymbol, pxInvalid, pxStarComment, pxLineComment, pxStrLit: result = tok.s of pxIntLit, pxInt64Lit: result = $tok.iNumber of pxFloatLit: result = $tok.fNumber - else: result = TokKindToStr(tok.xkind) + else: result = tokKindToStr(tok.xkind) -proc PrintTok(tok: TToken) = +proc printTok(tok: TToken) = writeln(stdout, $tok) proc matchUnderscoreChars(L: var TLexer, tok: var TToken, chars: TCharSet) = @@ -223,12 +223,12 @@ proc matchUnderscoreChars(L: var TLexer, tok: var TToken, chars: TCharSet) = while true: if buf[pos] in chars: add(tok.s, buf[pos]) - Inc(pos) + inc(pos) else: break if buf[pos] == '_': add(tok.s, '_') - Inc(pos) + inc(pos) L.bufPos = pos proc isFloatLiteral(s: string): bool = @@ -239,7 +239,7 @@ proc isFloatLiteral(s: string): bool = proc getNumber2(L: var TLexer, tok: var TToken) = var pos = L.bufpos + 2 # skip 0b tok.base = base2 - var xi: biggestInt = 0 + var xi: BiggestInt = 0 var bits = 0 while true: case L.buf[pos] @@ -264,7 +264,7 @@ proc getNumber2(L: var TLexer, tok: var TToken) = proc getNumber8(L: var TLexer, tok: var TToken) = var pos = L.bufpos + 1 # skip 0 tok.base = base8 - var xi: biggestInt = 0 + var xi: BiggestInt = 0 var bits = 0 while true: case L.buf[pos] @@ -289,7 +289,7 @@ proc getNumber8(L: var TLexer, tok: var TToken) = proc getNumber16(L: var TLexer, tok: var TToken) = var pos = L.bufpos + 2 # skip 0x tok.base = base16 - var xi: biggestInt = 0 + var xi: BiggestInt = 0 var bits = 0 while true: case L.buf[pos] @@ -327,7 +327,7 @@ proc getNumber(L: var TLexer, tok: var TToken) = tok.fnumber = parseFloat(tok.s) tok.xkind = pxFloatLit else: - tok.iNumber = ParseInt(tok.s) + tok.iNumber = parseInt(tok.s) if (tok.iNumber < low(int32)) or (tok.iNumber > high(int32)): tok.xkind = pxInt64Lit else: @@ -339,10 +339,10 @@ proc getNumber(L: var TLexer, tok: var TToken) = # ignore type suffix: while L.buf[L.bufpos] in {'A'..'Z', 'a'..'z'}: inc(L.bufpos) -proc HandleCRLF(L: var TLexer, pos: int): int = +proc handleCRLF(L: var TLexer, pos: int): int = case L.buf[pos] - of CR: result = nimlexbase.HandleCR(L, pos) - of LF: result = nimlexbase.HandleLF(L, pos) + of CR: result = nimlexbase.handleCR(L, pos) + of LF: result = nimlexbase.handleLF(L, pos) else: result = pos proc escape(L: var TLexer, tok: var TToken, allowEmpty=false) = @@ -405,7 +405,7 @@ proc getString(L: var TLexer, tok: var TToken) = while true: case buf[pos] of '\"': - Inc(pos) + inc(pos) break of CR: pos = nimlexbase.HandleCR(L, pos) @@ -427,7 +427,7 @@ proc getString(L: var TLexer, tok: var TToken) = pos = L.bufpos else: add(tok.s, buf[pos]) - Inc(pos) + inc(pos) L.bufpos = pos tok.xkind = pxStrLit @@ -438,7 +438,7 @@ proc getSymbol(L: var TLexer, tok: var TToken) = var c = buf[pos] if c notin SymChars: break add(tok.s, c) - Inc(pos) + inc(pos) L.bufpos = pos tok.xkind = pxSymbol @@ -475,7 +475,7 @@ proc scanStarComment(L: var TLexer, tok: var TToken) = while true: case buf[pos] of CR, LF: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf add(tok.s, "\n#") # skip annoying stars as line prefix: (eg. @@ -511,12 +511,12 @@ proc skip(L: var TLexer, tok: var TToken) = if L.inDirective: while buf[pos] in {' ', '\t'}: inc(pos) if buf[pos] in {CR, LF}: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf of ' ', Tabulator: - Inc(pos) # newline is special: + inc(pos) # newline is special: of CR, LF: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf if L.inDirective: tok.xkind = pxNewLine @@ -565,7 +565,7 @@ proc getTok(L: var TLexer, tok: var TToken) = case c of ';': tok.xkind = pxSemicolon - Inc(L.bufpos) + inc(L.bufpos) of '/': if L.buf[L.bufpos + 1] == '/': scanLineComment(L, tok) @@ -580,9 +580,9 @@ proc getTok(L: var TLexer, tok: var TToken) = inc(L.bufpos) of ',': tok.xkind = pxComma - Inc(L.bufpos) + inc(L.bufpos) of '(': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxParLe of '*': inc(L.bufpos) @@ -592,13 +592,13 @@ proc getTok(L: var TLexer, tok: var TToken) = else: tok.xkind = pxStar of ')': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxParRi of '[': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxBracketLe of ']': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxBracketRi of '.': inc(L.bufpos) @@ -608,10 +608,10 @@ proc getTok(L: var TLexer, tok: var TToken) = else: tok.xkind = pxDot of '{': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxCurlyLe of '}': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxCurlyRi of '+': inc(L.bufpos) @@ -752,4 +752,4 @@ proc getTok(L: var TLexer, tok: var TToken) = tok.s = $c tok.xkind = pxInvalid lexMessage(L, errInvalidToken, c & " (\\" & $(ord(c)) & ')') - Inc(L.bufpos) + inc(L.bufpos) diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index 44be556dbb..3adab0f44e 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -93,16 +93,16 @@ proc setOption*(parserOptions: PParserOptions, key: string, val=""): bool = of "class": parserOptions.classes[val] = "true" else: result = false -proc ParseUnit*(p: var TParser): PNode +proc parseUnit*(p: var TParser): PNode proc openParser*(p: var TParser, filename: string, inputStream: PLLStream, options = newParserOptions()) proc closeParser*(p: var TParser) # implementation -proc OpenParser(p: var TParser, filename: string, +proc openParser(p: var TParser, filename: string, inputStream: PLLStream, options = newParserOptions()) = - OpenLexer(p.lex, filename, inputStream) + openLexer(p.lex, filename, inputStream) p.options = options p.backtrack = @[] new(p.tok) @@ -111,7 +111,7 @@ proc parMessage(p: TParser, msg: TMsgKind, arg = "") = #assert false lexMessage(p.lex, msg, arg) -proc CloseParser(p: var TParser) = CloseLexer(p.lex) +proc closeParser(p: var TParser) = closeLexer(p.lex) proc saveContext(p: var TParser) = p.backtrack.add(p.tok) proc closeContext(p: var TParser) = discard p.backtrack.pop() proc backtrackContext(p: var TParser) = p.tok = p.backtrack.pop() @@ -145,7 +145,7 @@ proc findMacro(p: TParser): int = proc rawEat(p: var TParser, xkind: TTokKind) = if p.tok.xkind == xkind: rawGetTok(p) - else: parMessage(p, errTokenExpected, TokKindToStr(xkind)) + else: parMessage(p, errTokenExpected, tokKindToStr(xkind)) proc parseMacroArguments(p: var TParser): seq[seq[ref TToken]] = result = @[] @@ -228,7 +228,7 @@ proc skipComAux(p: var TParser, n: PNode) = getTok(p) proc skipCom(p: var TParser, n: PNode) = - while p.tok.xkind in {pxLineComment, pxStarComment}: skipcomAux(p, n) + while p.tok.xkind in {pxLineComment, pxStarComment}: skipComAux(p, n) proc skipStarCom(p: var TParser, n: PNode) = while p.tok.xkind == pxStarComment: skipComAux(p, n) @@ -242,11 +242,11 @@ proc expectIdent(p: TParser) = proc eat(p: var TParser, xkind: TTokKind, n: PNode) = if p.tok.xkind == xkind: getTok(p, n) - else: parMessage(p, errTokenExpected, TokKindToStr(xkind)) + else: parMessage(p, errTokenExpected, tokKindToStr(xkind)) proc eat(p: var TParser, xkind: TTokKind) = if p.tok.xkind == xkind: getTok(p) - else: parMessage(p, errTokenExpected, TokKindToStr(xkind)) + else: parMessage(p, errTokenExpected, tokKindToStr(xkind)) proc eat(p: var TParser, tok: string, n: PNode) = if p.tok.s == tok: getTok(p, n) @@ -605,7 +605,7 @@ proc addPragmas(father, pragmas: PNode) = proc addReturnType(params, rettyp: PNode) = if rettyp == nil: addSon(params, ast.emptyNode) elif rettyp.kind != nkNilLit: addSon(params, rettyp) - else: addson(params, ast.emptyNode) + else: addSon(params, ast.emptyNode) proc parseFormalParams(p: var TParser, params, pragmas: PNode) @@ -690,8 +690,8 @@ proc parseStructBody(p: var TParser, isUnion: bool, proc structPragmas(p: TParser, name: PNode, origName: string): PNode = assert name.kind == nkIdent result = newNodeP(nkPragmaExpr, p) - addson(result, exportSym(p, name, origName)) - var pragmas = newNodep(nkPragma, p) + addSon(result, exportSym(p, name, origName)) + var pragmas = newNodeP(nkPragma, p) addSon(pragmas, newIdentNodeP("pure", p), newIdentNodeP("final", p)) if p.options.header.len > 0: addSon(pragmas, newIdentStrLitPair("importc", origName, p), @@ -700,8 +700,8 @@ proc structPragmas(p: TParser, name: PNode, origName: string): PNode = proc enumPragmas(p: TParser, name: PNode): PNode = result = newNodeP(nkPragmaExpr, p) - addson(result, name) - var pragmas = newNodep(nkPragma, p) + addSon(result, name) + var pragmas = newNodeP(nkPragma, p) var e = newNodeP(nkExprColonExpr, p) # HACK: sizeof(cint) should be constructed as AST addSon(e, newIdentNodeP("size", p), newIdentNodeP("sizeof(cint)", p)) @@ -1045,7 +1045,7 @@ proc declaration(p: var TParser): PNode = of pxSemicolon: getTok(p) addSon(result, ast.emptyNode) # nobody - if p.scopeCounter == 0: DoImport(origName, pragmas, p) + if p.scopeCounter == 0: doImport(origName, pragmas, p) of pxCurlyLe: addSon(result, compoundStatement(p)) else: @@ -1264,7 +1264,7 @@ proc additiveExpression(p: var TParser): PNode = proc incdec(p: var TParser, opr: string): PNode = result = newNodeP(nkCall, p) addSon(result, newIdentNodeP(opr, p)) - gettok(p, result) + getTok(p, result) addSon(result, unaryExpression(p)) proc unaryOp(p: var TParser, kind: TNodeKind): PNode = @@ -1275,7 +1275,7 @@ proc unaryOp(p: var TParser, kind: TNodeKind): PNode = proc prefixCall(p: var TParser, opr: string): PNode = result = newNodeP(nkPrefix, p) addSon(result, newIdentNodeP(opr, p)) - gettok(p, result) + getTok(p, result) addSon(result, castExpression(p)) proc postfixExpression(p: var TParser): PNode = @@ -1313,13 +1313,13 @@ proc postfixExpression(p: var TParser): PNode = var a = result result = newNodeP(nkCall, p) addSon(result, newIdentNodeP("inc", p)) - gettok(p, result) + getTok(p, result) addSon(result, a) of pxMinusMinus: var a = result result = newNodeP(nkCall, p) addSon(result, newIdentNodeP("dec", p)) - gettok(p, result) + getTok(p, result) addSon(result, a) of pxLt: if isTemplateAngleBracket(p): @@ -1406,8 +1406,8 @@ proc assignmentExpression(p: var TParser): PNode = var b = assignmentExpression(p) result = newNodeP(nkAsgn, p) addSon(result, a, b) - of pxPlusAsgn: result = incDec(p, "inc", a) - of pxMinusAsgn: result = incDec(p, "dec", a) + of pxPlusAsgn: result = incdec(p, "inc", a) + of pxMinusAsgn: result = incdec(p, "dec", a) of pxStarAsgn: result = asgnExpr(p, "*", a) of pxSlashAsgn: result = asgnExpr(p, "/", a) of pxModAsgn: result = asgnExpr(p, "mod", a) @@ -1433,7 +1433,7 @@ proc relationalExpression(p: var TParser): PNode = result = shiftExpression(p) # Nimrod uses ``<`` and ``<=``, etc. too: while p.tok.xkind in {pxLt, pxLe, pxGt, pxGe}: - var op = TokKindToStr(p.tok.xkind) + var op = tokKindToStr(p.tok.xkind) getTok(p, result) var a = result var b = shiftExpression(p) @@ -1443,7 +1443,7 @@ proc equalityExpression(p: var TParser): PNode = result = relationalExpression(p) # Nimrod uses ``==`` and ``!=`` too: while p.tok.xkind in {pxEquals, pxNeq}: - var op = TokKindToStr(p.tok.xkind) + var op = tokKindToStr(p.tok.xkind) getTok(p, result) var a = result var b = relationalExpression(p) @@ -1818,7 +1818,7 @@ proc parseConstructor(p: var TParser, pragmas: PNode, else: parMessage(p, errTokenExpected, ";") if result.sons[bodyPos].kind == nkEmpty: - DoImport((if isDestructor: "~" else: "") & origName, pragmas, p) + doImport((if isDestructor: "~" else: "") & origName, pragmas, p) elif isDestructor: addSon(pragmas, newIdentNodeP("destructor", p)) if sonsLen(result.sons[pragmasPos]) == 0: @@ -1862,8 +1862,8 @@ proc parseMethod(p: var TParser, origName: string, rettyp, pragmas: PNode, else: parMessage(p, errTokenExpected, ";") if result.sons[bodyPos].kind == nkEmpty: - if isStatic: DoImport(origName, pragmas, p) - else: DoImportCpp(origName, pragmas, p) + if isStatic: doImport(origName, pragmas, p) + else: doImportCpp(origName, pragmas, p) if sonsLen(result.sons[pragmasPos]) == 0: result.sons[pragmasPos] = ast.emptyNode @@ -1880,7 +1880,7 @@ proc parseOperator(p: var TParser, origName: var string): bool = case p.tok.xkind of pxAmp..pxArrow: # ordinary operator symbol: - origName.add(TokKindToStr(p.tok.xkind)) + origName.add(tokKindToStr(p.tok.xkind)) getTok(p) of pxSymbol: if p.tok.s == "new" or p.tok.s == "delete": diff --git a/compiler/c2nim/cpp.nim b/compiler/c2nim/cpp.nim index 2ce64e59bf..1707b75dbe 100644 --- a/compiler/c2nim/cpp.nim +++ b/compiler/c2nim/cpp.nim @@ -226,7 +226,7 @@ proc skipUntilElifElseEndif(p: var TParser): TEndifMarker = proc parseIfdef(p: var TParser): PNode = getTok(p) # skip #ifdef - ExpectIdent(p) + expectIdent(p) case p.tok.s of "__cplusplus": skipUntilEndif(p) @@ -245,7 +245,7 @@ proc parseIfdef(p: var TParser): PNode = proc parseIfndef(p: var TParser): PNode = result = ast.emptyNode getTok(p) # skip #ifndef - ExpectIdent(p) + expectIdent(p) if p.tok.s == c2nimSymbol: skipLine(p) case skipUntilElifElseEndif(p) @@ -282,11 +282,11 @@ proc parseIfDir(p: var TParser): PNode = proc parsePegLit(p: var TParser): TPeg = var col = getColumn(p.lex) + 2 getTok(p) - if p.tok.xkind != pxStrLit: ExpectIdent(p) + if p.tok.xkind != pxStrLit: expectIdent(p) try: result = parsePeg( pattern = if p.tok.xkind == pxStrLit: p.tok.s else: escapePeg(p.tok.s), - filename = p.lex.fileIdx.ToFilename, + filename = p.lex.fileIdx.toFilename, line = p.lex.linenumber, col = col) getTok(p) @@ -295,7 +295,7 @@ proc parsePegLit(p: var TParser): TPeg = proc parseMangleDir(p: var TParser) = var pattern = parsePegLit(p) - if p.tok.xkind != pxStrLit: ExpectIdent(p) + if p.tok.xkind != pxStrLit: expectIdent(p) p.options.mangleRules.add((pattern, p.tok.s)) getTok(p) eatNewLine(p, nil) @@ -326,7 +326,7 @@ proc parseDir(p: var TParser): PNode = of "dynlib", "header", "prefix", "suffix", "class": var key = p.tok.s getTok(p) - if p.tok.xkind != pxStrLit: ExpectIdent(p) + if p.tok.xkind != pxStrLit: expectIdent(p) discard setOption(p.options, key, p.tok.s) getTok(p) eatNewLine(p, nil) From f2b9905b4e4365e0dd51a67ad90ac690f584feca Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 28 Dec 2013 01:57:19 +0100 Subject: [PATCH 160/326] case consistency part 9 --- compiler/pas2nim/pas2nim.nim | 2 +- compiler/pas2nim/paslex.nim | 74 +++++++++++++++++------------------ compiler/pas2nim/pasparse.nim | 52 ++++++++++++------------ 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/compiler/pas2nim/pas2nim.nim b/compiler/pas2nim/pas2nim.nim index ce5eb5c1ad..d100281670 100644 --- a/compiler/pas2nim/pas2nim.nim +++ b/compiler/pas2nim/pas2nim.nim @@ -26,7 +26,7 @@ Options: """ proc main(infile, outfile: string, flags: set[TParserFlag]) = - var stream = LLStreamOpen(infile, fmRead) + var stream = llStreamOpen(infile, fmRead) if stream == nil: rawMessage(errCannotOpenFile, infile) var p: TParser openParser(p, infile, stream, flags) diff --git a/compiler/pas2nim/paslex.nim b/compiler/pas2nim/paslex.nim index 94e664832f..67473e71fa 100644 --- a/compiler/pas2nim/paslex.nim +++ b/compiler/pas2nim/paslex.nim @@ -78,7 +78,7 @@ type proc getTok*(L: var TLexer, tok: var TToken) -proc PrintTok*(tok: TToken) +proc printTok*(tok: TToken) proc `$`*(tok: TToken): string # implementation @@ -109,17 +109,17 @@ proc getLineInfo*(L: TLexer): TLineInfo = result = newLineInfo(L.filename, L.linenumber, getColNumber(L, L.bufpos)) proc lexMessage*(L: TLexer, msg: TMsgKind, arg = "") = - msgs.GlobalError(getLineInfo(L), msg, arg) + msgs.globalError(getLineInfo(L), msg, arg) proc lexMessagePos(L: var TLexer, msg: TMsgKind, pos: int, arg = "") = var info = newLineInfo(L.filename, L.linenumber, pos - L.lineStart) - msgs.GlobalError(info, msg, arg) + msgs.globalError(info, msg, arg) -proc TokKindToStr*(k: TTokKind): string = +proc tokKindToStr*(k: TTokKind): string = case k of pxEof: result = "[EOF]" of firstKeyword..lastKeyword: - result = keywords[ord(k)-ord(firstKeyword)] + result = Keywords[ord(k)-ord(firstKeyword)] of pxInvalid, pxComment, pxStrLit: result = "string literal" of pxCommand: result = "{@" of pxAmp: result = "{&" @@ -160,9 +160,9 @@ proc `$`(tok: TToken): string = of pxSymbol: result = tok.ident.s of pxIntLit, pxInt64Lit: result = $tok.iNumber of pxFloatLit: result = $tok.fNumber - else: result = TokKindToStr(tok.xkind) + else: result = tokKindToStr(tok.xkind) -proc PrintTok(tok: TToken) = +proc printTok(tok: TToken) = writeln(stdout, $tok) proc setKeyword(L: var TLexer, tok: var TToken) = @@ -177,12 +177,12 @@ proc matchUnderscoreChars(L: var TLexer, tok: var TToken, chars: TCharSet) = while true: if buf[pos] in chars: add(tok.literal, buf[pos]) - Inc(pos) + inc(pos) else: break if buf[pos] == '_': add(tok.literal, '_') - Inc(pos) + inc(pos) L.bufPos = pos proc isFloatLiteral(s: string): bool = @@ -199,7 +199,7 @@ proc getNumber2(L: var TLexer, tok: var TToken) = inc(L.bufpos) return tok.base = base2 - var xi: biggestInt = 0 + var xi: BiggestInt = 0 var bits = 0 while true: case L.buf[pos] @@ -221,7 +221,7 @@ proc getNumber2(L: var TLexer, tok: var TToken) = proc getNumber16(L: var TLexer, tok: var TToken) = var pos = L.bufpos + 1 # skip $ tok.base = base16 - var xi: biggestInt = 0 + var xi: BiggestInt = 0 var bits = 0 while true: case L.buf[pos] @@ -261,7 +261,7 @@ proc getNumber10(L: var TLexer, tok: var TToken) = tok.fnumber = parseFloat(tok.literal) tok.xkind = pxFloatLit else: - tok.iNumber = ParseInt(tok.literal) + tok.iNumber = parseInt(tok.literal) if (tok.iNumber < low(int32)) or (tok.iNumber > high(int32)): tok.xkind = pxInt64Lit else: @@ -271,10 +271,10 @@ proc getNumber10(L: var TLexer, tok: var TToken) = except EOverflow: lexMessage(L, errNumberOutOfRange, tok.literal) -proc HandleCRLF(L: var TLexer, pos: int): int = +proc handleCRLF(L: var TLexer, pos: int): int = case L.buf[pos] - of CR: result = nimlexbase.HandleCR(L, pos) - of LF: result = nimlexbase.HandleLF(L, pos) + of CR: result = nimlexbase.handleCR(L, pos) + of LF: result = nimlexbase.handleLF(L, pos) else: result = pos proc getString(L: var TLexer, tok: var TToken) = @@ -319,7 +319,7 @@ proc getString(L: var TLexer, tok: var TToken) = xi = (xi * 10) + (ord(buf[pos]) - ord('0')) inc(pos) else: lexMessage(L, errInvalidCharacterConstant) - if (xi <= 255): add(tok.literal, Chr(xi)) + if (xi <= 255): add(tok.literal, chr(xi)) else: lexMessage(L, errInvalidCharacterConstant) else: break @@ -334,17 +334,17 @@ proc getSymbol(L: var TLexer, tok: var TToken) = var c = buf[pos] case c of 'a'..'z', '0'..'9', '\x80'..'\xFF': - h = h +% Ord(c) + h = h +% ord(c) h = h +% h shl 10 h = h xor (h shr 6) of 'A'..'Z': c = chr(ord(c) + (ord('a') - ord('A'))) # toLower() - h = h +% Ord(c) + h = h +% ord(c) h = h +% h shl 10 h = h xor (h shr 6) of '_': nil else: break - Inc(pos) + inc(pos) h = h +% h shl 3 h = h xor (h shr 11) h = h +% h shl 15 @@ -385,7 +385,7 @@ proc scanCurlyComment(L: var TLexer, tok: var TToken) = while true: case buf[pos] of CR, LF: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf add(tok.literal, "\n#") of '}': @@ -405,7 +405,7 @@ proc scanStarComment(L: var TLexer, tok: var TToken) = while true: case buf[pos] of CR, LF: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf add(tok.literal, "\n#") of '*': @@ -428,9 +428,9 @@ proc skip(L: var TLexer, tok: var TToken) = while true: case buf[pos] of ' ', Tabulator: - Inc(pos) # newline is special: + inc(pos) # newline is special: of CR, LF: - pos = HandleCRLF(L, pos) + pos = handleCRLF(L, pos) buf = L.buf else: break # EndOfFile also leaves the loop @@ -449,7 +449,7 @@ proc getTok(L: var TLexer, tok: var TToken) = case c of ';': tok.xkind = pxSemicolon - Inc(L.bufpos) + inc(L.bufpos) of '/': if L.buf[L.bufpos + 1] == '/': scanLineComment(L, tok) @@ -458,12 +458,12 @@ proc getTok(L: var TLexer, tok: var TToken) = inc(L.bufpos) of ',': tok.xkind = pxComma - Inc(L.bufpos) + inc(L.bufpos) of '(': - Inc(L.bufpos) + inc(L.bufpos) if (L.buf[L.bufPos] == '*'): if (L.buf[L.bufPos + 1] == '$'): - Inc(L.bufpos, 2) + inc(L.bufpos, 2) skip(L, tok) getSymbol(L, tok) tok.xkind = pxStarDirLe @@ -481,12 +481,12 @@ proc getTok(L: var TLexer, tok: var TToken) = tok.xkind = pxStar of ')': tok.xkind = pxParRi - Inc(L.bufpos) + inc(L.bufpos) of '[': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxBracketLe of ']': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxBracketRi of '.': inc(L.bufpos) @@ -496,21 +496,21 @@ proc getTok(L: var TLexer, tok: var TToken) = else: tok.xkind = pxDot of '{': - Inc(L.bufpos) + inc(L.bufpos) case L.buf[L.bufpos] of '$': - Inc(L.bufpos) + inc(L.bufpos) skip(L, tok) getSymbol(L, tok) tok.xkind = pxCurlyDirLe of '&': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxAmp of '%': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxPer of '@': - Inc(L.bufpos) + inc(L.bufpos) tok.xkind = pxCommand else: scanCurlyComment(L, tok) of '+': @@ -554,7 +554,7 @@ proc getTok(L: var TLexer, tok: var TToken) = inc(L.bufpos) of '}': tok.xkind = pxCurlyDirRi - Inc(L.bufpos) + inc(L.bufpos) of '\'', '#': getString(L, tok) of '$': @@ -567,4 +567,4 @@ proc getTok(L: var TLexer, tok: var TToken) = tok.literal = c & "" tok.xkind = pxInvalid lexMessage(L, errInvalidToken, c & " (\\" & $(ord(c)) & ')') - Inc(L.bufpos) + inc(L.bufpos) diff --git a/compiler/pas2nim/pasparse.nim b/compiler/pas2nim/pasparse.nim index 61d57dec30..9288963386 100644 --- a/compiler/pas2nim/pasparse.nim +++ b/compiler/pas2nim/pasparse.nim @@ -57,7 +57,7 @@ const ["tbinaryfile", "tfile"], ["strstart", "0"], ["nl", "\"\\n\""], ["tostring", "$"]] -proc ParseUnit*(p: var TParser): PNode +proc parseUnit*(p: var TParser): PNode proc openParser*(p: var TParser, filename: string, inputStream: PLLStream, flags: set[TParserFlag] = {}) proc closeParser*(p: var TParser) @@ -67,20 +67,20 @@ proc fixRecordDef*(n: var PNode) # implementation -proc OpenParser(p: var TParser, filename: string, +proc openParser(p: var TParser, filename: string, inputStream: PLLStream, flags: set[TParserFlag] = {}) = - OpenLexer(p.lex, filename, inputStream) + openLexer(p.lex, filename, inputStream) initIdTable(p.repl) for i in countup(low(stdReplacements), high(stdReplacements)): - IdTablePut(p.repl, getIdent(stdReplacements[i][0]), + idTablePut(p.repl, getIdent(stdReplacements[i][0]), getIdent(stdReplacements[i][1])) if pfMoreReplacements in flags: for i in countup(low(nimReplacements), high(nimReplacements)): - IdTablePut(p.repl, getIdent(nimReplacements[i][0]), + idTablePut(p.repl, getIdent(nimReplacements[i][0]), getIdent(nimReplacements[i][1])) p.flags = flags -proc CloseParser(p: var TParser) = CloseLexer(p.lex) +proc closeParser(p: var TParser) = closeLexer(p.lex) proc getTok(p: var TParser) = getTok(p.lex, p.tok) proc parMessage(p: TParser, msg: TMsgKind, arg = "") = @@ -98,15 +98,15 @@ proc skipCom(p: var TParser, n: PNode) = parMessage(p, warnCommentXIgnored, p.tok.literal) getTok(p) -proc ExpectIdent(p: TParser) = +proc expectIdent(p: TParser) = if p.tok.xkind != pxSymbol: lexMessage(p.lex, errIdentifierExpected, $(p.tok)) -proc Eat(p: var TParser, xkind: TTokKind) = +proc eat(p: var TParser, xkind: TTokKind) = if p.tok.xkind == xkind: getTok(p) - else: lexMessage(p.lex, errTokenExpected, TokKindToStr(xkind)) + else: lexMessage(p.lex, errTokenExpected, tokKindToStr(xkind)) -proc Opt(p: var TParser, xkind: TTokKind) = +proc opt(p: var TParser, xkind: TTokKind) = if p.tok.xkind == xkind: getTok(p) proc newNodeP(kind: TNodeKind, p: TParser): PNode = @@ -131,7 +131,7 @@ proc newIdentNodeP(ident: PIdent, p: TParser): PNode = proc createIdentNodeP(ident: PIdent, p: TParser): PNode = result = newNodeP(nkIdent, p) - var x = PIdent(IdTableGet(p.repl, ident)) + var x = PIdent(idTableGet(p.repl, ident)) if x != nil: result.ident = x else: result.ident = ident @@ -170,7 +170,7 @@ proc parseCommand(p: var TParser, definition: PNode = nil): PNode = getTok(p) eat(p, pxCurlyDirRi) result = parseExpr(p) - if result.kind == nkEmpty: InternalError("emptyNode modified") + if result.kind == nkEmpty: internalError("emptyNode modified") result.kind = nkCurly elif p.tok.ident.id == getIdent("cast").id: getTok(p) @@ -251,7 +251,7 @@ proc bracketExprList(p: var TParser, first: PNode): PNode = getTok(p) break if p.tok.xkind == pxEof: - parMessage(p, errTokenExpected, TokKindToStr(pxBracketRi)) + parMessage(p, errTokenExpected, tokKindToStr(pxBracketRi)) break var a = rangeExpr(p) skipCom(p, a) @@ -281,7 +281,7 @@ proc exprListAux(p: var TParser, elemKind: TNodeKind, getTok(p) break if p.tok.xkind == pxEof: - parMessage(p, errTokenExpected, TokKindToStr(endtok)) + parMessage(p, errTokenExpected, tokKindToStr(endTok)) break var a = exprColonEqExpr(p, elemKind, sepTok) skipCom(p, a) @@ -319,7 +319,7 @@ proc qualifiedIdentListAux(p: var TParser, endTok: TTokKind, getTok(p) break if p.tok.xkind == pxEof: - parMessage(p, errTokenExpected, TokKindToStr(endtok)) + parMessage(p, errTokenExpected, tokKindToStr(endTok)) break var a = qualifiedIdent(p) skipCom(p, a) @@ -584,7 +584,7 @@ proc parseIncludeDir(p: var TParser): PNode = proc definedExprAux(p: var TParser): PNode = result = newNodeP(nkCall, p) addSon(result, newIdentNodeP(getIdent("defined"), p)) - ExpectIdent(p) + expectIdent(p) addSon(result, createIdentNodeP(p.tok.ident, p)) getTok(p) @@ -753,7 +753,7 @@ proc parseCase(p: var TParser): PNode = while (p.tok.xkind != pxEof) and (p.tok.xkind != pxColon): addSon(b, rangeExpr(p)) opt(p, pxComma) - skipcom(p, b) + skipCom(p, b) eat(p, pxColon) skipCom(p, b) addSon(b, parseStmt(p)) @@ -818,7 +818,7 @@ proc parseFor(p: var TParser): PNode = getTok(p) b = parseExpr(p) else: - parMessage(p, errTokenExpected, TokKindToStr(pxTo)) + parMessage(p, errTokenExpected, tokKindToStr(pxTo)) addSon(c, a) addSon(c, b) eat(p, pxDo) @@ -915,7 +915,7 @@ proc parseCallingConvention(p: var TParser): PNode = getTok(p) opt(p, pxSemicolon) else: - nil + discard proc parseRoutineSpecifiers(p: var TParser, noBody: var bool): PNode = var e: PNode @@ -1096,7 +1096,7 @@ proc parseRecordCase(p: var TParser): PNode = while (p.tok.xkind != pxEof) and (p.tok.xkind != pxColon): addSon(b, rangeExpr(p)) opt(p, pxComma) - skipcom(p, b) + skipCom(p, b) eat(p, pxColon) skipCom(p, b) c = newNodeP(nkRecList, p) @@ -1168,7 +1168,7 @@ proc addPragmaToIdent(ident: var PNode, pragma: PNode) = else: pragmasNode = ident.sons[1] if pragmasNode.kind != nkPragma: - InternalError(ident.info, "addPragmaToIdent") + internalError(ident.info, "addPragmaToIdent") addSon(pragmasNode, pragma) proc parseRecordBody(p: var TParser, result, definition: PNode) = @@ -1183,13 +1183,13 @@ proc parseRecordBody(p: var TParser, result, definition: PNode) = if definition != nil: addPragmaToIdent(definition.sons[0], newIdentNodeP(p.tok.ident, p)) else: - InternalError(result.info, "anonymous record is not supported") + internalError(result.info, "anonymous record is not supported") getTok(p) else: - InternalError(result.info, "parseRecordBody") + internalError(result.info, "parseRecordBody") of pxCommand: if definition != nil: addPragmaToIdent(definition.sons[0], parseCommand(p)) - else: InternalError(result.info, "anonymous record is not supported") + else: internalError(result.info, "anonymous record is not supported") else: nil opt(p, pxSemicolon) @@ -1223,7 +1223,7 @@ proc parseTypeDesc(p: var TParser, definition: PNode = nil): PNode = getTok(p) if p.tok.xkind == pxCommand: result = parseCommand(p) - if result.kind != nkTupleTy: InternalError(result.info, "parseTypeDesc") + if result.kind != nkTupleTy: internalError(result.info, "parseTypeDesc") parseRecordBody(p, result, definition) var a = lastSon(result) # embed nkRecList directly into nkTupleTy for i in countup(0, sonsLen(a) - 1): @@ -1237,7 +1237,7 @@ proc parseTypeDesc(p: var TParser, definition: PNode = nil): PNode = if definition != nil: addPragmaToIdent(definition.sons[0], newIdentNodeP(getIdent("final"), p)) else: - InternalError(result.info, "anonymous record is not supported") + internalError(result.info, "anonymous record is not supported") of pxObject: result = parseRecordOrObject(p, nkObjectTy, definition) of pxParLe: result = parseEnum(p) of pxArray: From a59f13b00dff570865201e860ea24d202b60c85a Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sat, 28 Dec 2013 12:50:45 +0200 Subject: [PATCH 161/326] lift generic parameters from concrete composite type classes --- compiler/seminst.nim | 5 ++++- compiler/semtypes.nim | 17 ++++++++++------- compiler/semtypinst.nim | 9 +++++---- compiler/types.nim | 17 ++++++++++------- tests/compile/tcompositetypeclasses.nim | 17 +++++++++++------ 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 250e53ed6f..ba26635a1d 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -204,6 +204,8 @@ proc fixupProcType(c: PContext, genericType: PType, result = result.sons[0] of tyStatic: result = inst.concreteTypes[genericType.sym.position] + of tyGenericInst: + result = fixupProcType(c, result.lastSon, inst) of tyOpenArray, tyArray, tySet, tySequence, tyTuple, tyProc, tyPtr, tyVar, tyRef, tyOrdinal, tyRange, tyVarargs: if genericType.sons == nil: return @@ -234,7 +236,8 @@ proc fixupProcType(c: PContext, genericType: PType, continue result.sons[head] = changed - + result.size = 0 + if result.n != nil: if result.n.kind == nkRecList: for son in result.n.sons: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index d3a934c215..6f6d0c4c58 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -620,7 +620,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, s.position = genericParams.len genericParams.addSon(newSymNode(s)) result = typeClass - + # XXX: There are codegen errors if this is turned into a nested proc template liftingWalk(typ: PType, anonFlag = false): expr = liftParamType(c, procKind, genericParams, typ, paramName, info, anonFlag) @@ -665,6 +665,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, if lifted != nil: paramType.sons[i] = lifted result = paramType + of tyGenericBody: result = newTypeS(tyGenericInvokation, c) result.rawAddSon(paramType) @@ -674,6 +675,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, allowMetaTypes = true) result = newTypeWithSons(c, tyCompositeTypeClass, @[paramType, result]) result = addImplicitGeneric(result) + of tyGenericInst: for i in 1 .. (paramType.sons.len - 2): var lifted = liftingWalk(paramType.sons[i]) @@ -681,21 +683,22 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, paramType.sons[i] = lifted result = paramType - if result == nil: - result = liftingWalk(paramType.lastSon) - else: - result.kind = tyGenericInvokation - result.sons.setLen(result.sons.len - 1) + let liftBody = liftingWalk(paramType.lastSon) + if liftBody != nil: result = liftBody + of tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: - result = addImplicitGeneric(copyType(paramType, getCurrOwner(), false)) + result = addImplicitGeneric(copyType(paramType, getCurrOwner(), true)) + of tyExpr: result = addImplicitGeneric(newTypeS(tyGenericParam, c)) + of tyGenericParam: if tfGenericTypeParam in paramType.flags and false: if paramType.sonsLen > 0: result = liftingWalk(paramType.lastSon) else: result = addImplicitGeneric(newTypeS(tyGenericParam, c)) + else: nil # result = liftingWalk(paramType) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index f7750171d6..384ce3498c 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -17,14 +17,14 @@ proc checkPartialConstructedType(info: TLineInfo, t: PType) = elif t.kind == tyVar and t.sons[0].kind == tyVar: LocalError(info, errVarVarTypeNotAllowed) -proc checkConstructedType*(info: TLineInfo, typ: PType) = +proc checkConstructedType*(info: TLineInfo, typ: PType) = var t = typ.skipTypes({tyDistinct}) if t.kind in tyTypeClasses: nil elif tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject: LocalError(info, errInvalidPragmaX, "acyclic") elif t.kind == tyVar and t.sons[0].kind == tyVar: LocalError(info, errVarVarTypeNotAllowed) - elif computeSize(t) < 0: + elif computeSize(t) == szIllegalRecursion: LocalError(info, errIllegalRecursionInTypeX, typeToString(t)) when false: if t.kind == tyObject and t.sons[0] != nil: @@ -140,7 +140,7 @@ proc lookupTypeVar(cl: TReplTypeVars, t: PType): PType = result = errorType(cl.c) elif result.kind == tyGenericParam and not cl.allowMetaTypes: InternalError(cl.info, "substitution with generic parameter") - + proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = # tyGenericInvokation[A, tyGenericInvokation[A, B]] # is difficult to handle: @@ -170,7 +170,8 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = # recursive instantions: result = newType(tyGenericInst, t.sons[0].owner) result.rawAddSon(header.sons[0]) - cacheTypeInst(result) + if not cl.allowMetaTypes: + cacheTypeInst(result) for i in countup(1, sonsLen(t) - 1): var x = replaceTypeVarsT(cl, t.sons[i]) diff --git a/compiler/types.nim b/compiler/types.nim index 1b25a396c3..d47015836d 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1098,18 +1098,22 @@ proc computeRecSizeAux(n: PNode, a, currOffset: var biggestInt): biggestInt = a = 1 result = - 1 -proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = +const + szIllegalRecursion* = -2 + szUnknownSize* = -1 + +proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = var res, maxAlign, length, currOffset: biggestInt - if typ.size == - 2: + if typ.size == szIllegalRecursion: # we are already computing the size of the type # --> illegal recursion in type - return - 2 - if typ.size >= 0: + return szIllegalRecursion + if typ.size >= 0: # size already computed result = typ.size a = typ.align return - typ.size = - 2 # mark as being computed + typ.size = szIllegalRecursion # mark as being computed case typ.kind of tyInt, tyUInt: result = IntSize @@ -1196,7 +1200,7 @@ proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = of tyProxy: result = 1 else: #internalError("computeSizeAux()") - result = - 1 + result = szUnknownSize typ.size = result typ.align = int(a) @@ -1213,7 +1217,6 @@ proc getSize(typ: PType): biggestInt = result = computeSize(typ) if result < 0: InternalError("getSize: " & $typ.kind) - proc containsGenericTypeIter(t: PType, closure: PObject): bool = result = t.kind in GenericTypes diff --git a/tests/compile/tcompositetypeclasses.nim b/tests/compile/tcompositetypeclasses.nim index ea966f1a9d..4ba92fed1a 100644 --- a/tests/compile/tcompositetypeclasses.nim +++ b/tests/compile/tcompositetypeclasses.nim @@ -13,18 +13,23 @@ type TUserClass = int|string - # TBaz = TBar[TUserClass] + TBaz = TBar[TUserClass] var vfoo: TFoo[int, string] vbar: TFoo[string, string] + vbaz: TFoo[int, int] + vnotbaz: TFoo[TObject, TObject] proc foo(x: TFoo) = echo "foo" proc bar(x: TBar) = echo "bar" -# proc baz(x: TBaz) = echo "baz" +proc baz(x: TBaz) = echo "baz" -accept(foo(vfoo)) -accept(bar(vbar)) -# baz vbar -reject(bar(vfoo)) +accept foo(vfoo) +accept bar(vbar) +accept baz(vbar) +accept baz(vbaz) + +reject baz(vnotbaz) +reject bar(vfoo) From f34ca1a7d7fe22c762b1a4bc29f4f1e19d5da0ec Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sat, 28 Dec 2013 13:26:41 +0200 Subject: [PATCH 162/326] fix illegal recursion checks --- compiler/types.nim | 11 +++++++---- tests/reject/tillrec.nim | 19 +++++++++---------- tests/reject/typredef.nim | 6 ++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/compiler/types.nim b/compiler/types.nim index d47015836d..a2869f0da5 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1144,8 +1144,10 @@ proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = tyBigNum: result = ptrSize a = result - of tyArray, tyArrayConstr: - result = lengthOrd(typ.sons[0]) * computeSizeAux(typ.sons[1], a) + of tyArray, tyArrayConstr: + let elemSize = computeSizeAux(typ.sons[1], a) + if elemSize < 0: return elemSize + result = lengthOrd(typ.sons[0]) * elemSize of tyEnum: if firstOrd(typ) < 0: result = 4 # use signed int32 @@ -1196,8 +1198,9 @@ proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = of tyGenericInst, tyDistinct, tyGenericBody, tyMutable, tyConst, tyIter: result = computeSizeAux(lastSon(typ), a) of tyTypeDesc: - result = (if typ.len == 1: computeSizeAux(typ.sons[0], a) else: -1) - of tyProxy: result = 1 + result = if typ.len == 1: computeSizeAux(typ.sons[0], a) + else: szUnknownSize + of tyForward: return szIllegalRecursion else: #internalError("computeSizeAux()") result = szUnknownSize diff --git a/tests/reject/tillrec.nim b/tests/reject/tillrec.nim index 3f8fe60fca..1d1ec06229 100644 --- a/tests/reject/tillrec.nim +++ b/tests/reject/tillrec.nim @@ -3,15 +3,14 @@ discard """ line: 13 errormsg: "illegal recursion in type \'TIllegal\'" """ -# test illegal recursive types - -type - TLegal {.final.} = object - x: int - kids: seq[TLegal] - - TIllegal {.final.} = object #ERROR_MSG illegal recursion in type 'TIllegal' - y: Int - x: array[0..3, TIllegal] +# test illegal recursive types +type + TLegal {.final.} = object + x: int + kids: seq[TLegal] + + TIllegal {.final.} = object #ERROR_MSG illegal recursion in type 'TIllegal' + y: Int + x: array[0..3, TIllegal] diff --git a/tests/reject/typredef.nim b/tests/reject/typredef.nim index b2182d116d..0b6aed8750 100644 --- a/tests/reject/typredef.nim +++ b/tests/reject/typredef.nim @@ -3,8 +3,6 @@ discard """ line: 7 errormsg: "illegal recursion in type \'Uint8\'" """ -type - Uint8 = Uint8 #ERROR_MSG illegal recursion in type 'Uint8' - - +type + Uint8 = Uint8 #ERROR_MSG illegal recursion in type 'Uint8' From f622504b5b093b51f9bb4db77f81f96d096a3f54 Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Sat, 28 Dec 2013 12:25:01 +0000 Subject: [PATCH 163/326] Fixes #594 This was already partially fixed, ``expandTilde`` was the missing piece from perfection. --- compiler/extccomp.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index d3b3cee757..bbbbbfb8ee 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -614,7 +614,7 @@ proc CallCCompiler*(projectfile: string) = exefile = splitFile(projectFile).name & platform.os[targetOS].exeExt buildDll = "" if options.outFile.len > 0: - exefile = options.outFile + exefile = options.outFile.expandTilde if not noAbsolutePaths(): if not exeFile.isAbsolute(): exefile = joinPath(splitFile(projectFile).dir, exefile) From 5d75ce2f2eec8d4ec6f152105a144abcf73e4a37 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sat, 28 Dec 2013 15:01:40 +0200 Subject: [PATCH 164/326] fix tclosure4 --- compiler/semtypes.nim | 1 + compiler/sigmatch.nim | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 6f6d0c4c58..1251a25c06 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -673,6 +673,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, result.rawAddSon(copyType(paramType.sons[i], getCurrOwner(), true)) result = instGenericContainer(c, paramType.sym.info, result, allowMetaTypes = true) + result.lastSon.flags.incl tfHasMeta result = newTypeWithSons(c, tyCompositeTypeClass, @[paramType, result]) result = addImplicitGeneric(result) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 18020b95c4..43ca6e6669 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -303,21 +303,23 @@ proc minRel(a, b: TTypeRelation): TTypeRelation = if a <= b: result = a else: result = b -proc tupleRel(c: var TCandidate, f, a: PType): TTypeRelation = +proc recordRel(c: var TCandidate, f, a: PType): TTypeRelation = result = isNone if sameType(f, a): result = isEqual elif sonsLen(a) == sonsLen(f): result = isEqual - for i in countup(0, sonsLen(f) - 1): + let firstField = if f.kind == tyTuple: 0 + else: 1 + for i in countup(firstField, sonsLen(f) - 1): var m = typeRel(c, f.sons[i], a.sons[i]) if m < isSubtype: return isNone result = minRel(result, m) if f.n != nil and a.n != nil: for i in countup(0, sonsLen(f.n) - 1): # check field names: - if f.n.sons[i].kind != nkSym: InternalError(f.n.info, "tupleRel") - elif a.n.sons[i].kind != nkSym: InternalError(a.n.info, "tupleRel") + if f.n.sons[i].kind != nkSym: InternalError(f.n.info, "recordRel") + elif a.n.sons[i].kind != nkSym: InternalError(a.n.info, "recordRel") else: var x = f.n.sons[i].sym var y = a.n.sons[i].sym @@ -408,11 +410,13 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = result = isNone assert(f != nil) assert(a != nil) + if a.kind == tyGenericInst and skipTypes(f, {tyVar}).kind notin { tyGenericBody, tyGenericInvokation, - tyGenericParam, tyTypeClass}: + tyGenericParam} + tyTypeClasses: return typeRel(c, f, lastSon(a)) + if a.kind == tyVar and f.kind != tyVar: return typeRel(c, f, a.sons[0]) @@ -559,10 +563,11 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = of tyNil: if a.kind == f.kind: result = isEqual of tyTuple: - if a.kind == tyTuple: result = tupleRel(c, f, a) + if a.kind == tyTuple: result = recordRel(c, f, a) of tyObject: if a.kind == tyObject: if sameObjectTypes(f, a): result = isEqual + elif tfHasMeta in f.flags: result = recordRel(c, f, a) else: var depth = isObjectSubtype(a, f) if depth > 0: From 0420c8c363a755486d6ef8f822b33e5a0f75cb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= <michal@zielinscy.org.pl> Date: Sat, 28 Dec 2013 17:07:52 +0100 Subject: [PATCH 165/326] httpclient: strip trailing whitespace from headers. - we can do that according to the RFC. - fixes #783 --- lib/pure/httpclient.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 2c0e7b8351..bb9835fe78 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -220,9 +220,8 @@ proc parseResponse(s: TSocket, getBody: bool, timeout: int): TResponse = inc(linei, le) if line[linei] != ':': httpError("invalid headers") inc(linei) # Skip : - linei += skipWhitespace(line, linei) - result.headers[name] = line[linei.. -1] + result.headers[name] = line[linei.. -1].strip() if not fullyRead: httpError("Connection was closed before full request has been made") if getBody: From eb1d23c0c745c64225e8db22f62d8ebf596f4448 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sat, 28 Dec 2013 23:53:48 +0200 Subject: [PATCH 166/326] fixes #787 --- lib/system.nim | 18 ++++++------- tests/run/tfailedassert.nim | 51 +++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 tests/run/tfailedassert.nim diff --git a/lib/system.nim b/lib/system.nim index d45137b9eb..e9719c7e1e 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2545,7 +2545,7 @@ proc raiseAssert*(msg: string) {.noinline.} = sysFatal(EAssertionFailed, msg) when true: - proc hiddenRaiseAssert(msg: string) {.raises: [], tags: [].} = + proc failedAssertImpl*(msg: string) {.raises: [], tags: [].} = # trick the compiler to not list ``EAssertionFailed`` when called # by ``assert``. type THide = proc (msg: string) {.noinline, raises: [], noSideEffect, @@ -2558,11 +2558,11 @@ template assert*(cond: bool, msg = "") = ## raises an ``EAssertionFailure`` exception. However, the compiler may ## not generate any code at all for ``assert`` if it is advised to do so. ## Use ``assert`` for debugging purposes only. - bind instantiationInfo, hiddenRaiseAssert + bind instantiationInfo + mixin failedAssertImpl when compileOption("assertions"): {.line.}: - if not cond: - hiddenRaiseAssert(astToStr(cond) & ' ' & msg) + if not cond: failedAssertImpl(astToStr(cond) & ' ' & msg) template doAssert*(cond: bool, msg = "") = ## same as `assert` but is always turned on and not affected by the @@ -2575,9 +2575,9 @@ template doAssert*(cond: bool, msg = "") = when not defined(nimhygiene): {.pragma: inject.} -template onFailedAssert*(msg: expr, code: stmt): stmt = - ## Sets an assertion failure handler that will intercept any assert statements - ## following `onFailedAssert` in the current lexical scope. +template onFailedAssert*(msg: expr, code: stmt): stmt {.dirty, immediate.} = + ## Sets an assertion failure handler that will intercept any assert + ## statements following `onFailedAssert` in the current lexical scope. ## Can be defined multiple times in a single function. ## ## .. code-block:: nimrod @@ -2594,8 +2594,8 @@ template onFailedAssert*(msg: expr, code: stmt): stmt = ## ## assert(...) ## - template raiseAssert(msgIMPL: string): stmt = - let msg {.inject.} = msgIMPL + template failedAssertImpl(msgIMPL: string): stmt {.dirty, immediate.} = + let msg = msgIMPL code proc shallow*[T](s: var seq[T]) {.noSideEffect, inline.} = diff --git a/tests/run/tfailedassert.nim b/tests/run/tfailedassert.nim new file mode 100644 index 0000000000..0e536cffd4 --- /dev/null +++ b/tests/run/tfailedassert.nim @@ -0,0 +1,51 @@ +discard """ + output: ''' +WARNING: false first asseertion from bar +ERROR: false second assertion from bar +-1 +tests/run/tfailedassert.nim:40 false assertion from foo +''' +""" + +type + TLineInfo = tuple[filename: string, line: int] + + TMyError = object of E_Base + lineinfo: TLineInfo + + EMyError = ref TMyError + +# module-wide policy to change the failed assert +# exception type in order to include a lineinfo +onFailedAssert(msg): + var e = new(TMyError) + e.msg = msg + e.lineinfo = instantiationInfo(-2) + raise e + +proc foo = + assert(false, "assertion from foo") + +proc bar: int = + # local overrides that are active only + # in this proc + onFailedAssert(msg): echo "WARNING: " & msg + + assert(false, "first asseertion from bar") + + onFailedAssert(msg): + echo "ERROR: " & msg + return -1 + + assert(false, "second assertion from bar") + return 10 + +echo("") +echo(bar()) + +try: + foo() +except: + let e = EMyError(getCurrentException()) + echo e.lineinfo.filename, ":", e.lineinfo.line, " ", e.msg + From 66a255652572b48440b68878e99d7f5290e384b3 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sun, 29 Dec 2013 00:00:37 +0200 Subject: [PATCH 167/326] make more tests green --- compiler/evals.nim | 10 ++- compiler/sem.nim | 17 +++-- compiler/semexprs.nim | 8 ++- compiler/semfold.nim | 5 +- compiler/seminst.nim | 19 ++++- compiler/semmagic.nim | 7 +- compiler/semstmts.nim | 8 ++- compiler/semtypes.nim | 33 +++++---- compiler/semtypinst.nim | 7 +- compiler/sigmatch.nim | 50 ++++++------- tests/compile/tloops.nim | 128 +++++++++++++++++----------------- tests/run/tmemoization.nim | 8 +-- tests/run/tstaticparams.nim | 12 ++-- tests/run/ttypetraits.nim | 2 +- tests/run/tusingstatement.nim | 24 ++----- 15 files changed, 176 insertions(+), 162 deletions(-) diff --git a/compiler/evals.nim b/compiler/evals.nim index f7d94e4c0f..151adf6909 100644 --- a/compiler/evals.nim +++ b/compiler/evals.nim @@ -906,17 +906,15 @@ proc evalParseStmt(c: PEvalContext, n: PNode): PNode = result = parseString(code.getStrValue, code.info.toFilename, code.info.line.int) #result.typ = newType(tyStmt, c.module) - -proc evalTypeTrait*(trait, operand: PNode, context: PSym): PNode = - InternalAssert operand.kind == nkSym - let typ = operand.sym.typ.skipTypes({tyTypeDesc}) +proc evalTypeTrait*(trait, operand: PNode, context: PSym): PNode = + let typ = operand.typ.skipTypes({tyTypeDesc}) case trait.sym.name.s.normalize of "name": result = newStrNode(nkStrLit, typ.typeToString(preferName)) result.typ = newType(tyString, context) result.info = trait.info - of "arity": + of "arity": result = newIntNode(nkIntLit, typ.n.len-1) result.typ = newType(tyInt, context) result.info = trait.info @@ -1330,7 +1328,7 @@ proc evalAux(c: PEvalContext, n: PNode, flags: TEvalFlags): PNode = if gNestedEvals <= 0: stackTrace(c, n.info, errTooManyIterations) case n.kind of nkSym: result = evalSym(c, n, flags) - of nkType..nkNilLit: + of nkType..nkNilLit, nkTypeOfExpr: # nkStrLit is VERY common in the traces, so we should avoid # the 'copyNode' here. result = n #.copyNode diff --git a/compiler/sem.nim b/compiler/sem.nim index 67d400ac50..4b4a3da50c 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -158,16 +158,15 @@ proc IsOpImpl(c: PContext, n: PNode): PNode proc semMacroExpr(c: PContext, n, nOrig: PNode, sym: PSym, semCheck: bool = true): PNode -when false: - proc symFromType(t: PType, info: TLineInfo): PSym = - if t.sym != nil: return t.sym - result = newSym(skType, getIdent"AnonType", t.owner, info) - result.flags.incl sfAnon - result.typ = t +proc symFromType(t: PType, info: TLineInfo): PSym = + if t.sym != nil: return t.sym + result = newSym(skType, getIdent"AnonType", t.owner, info) + result.flags.incl sfAnon + result.typ = t - proc symNodeFromType(c: PContext, t: PType, info: TLineInfo): PNode = - result = newSymNode(symFromType(t, info), info) - result.typ = makeTypeDesc(c, t) +proc symNodeFromType(c: PContext, t: PType, info: TLineInfo): PNode = + result = newSymNode(symFromType(t, info), info) + result.typ = makeTypeDesc(c, t) proc createEvalContext(c: PContext, mode: TEvalMode): PEvalContext = result = newEvalContext(c.module, mode) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index fde09400d9..6294fb3c90 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -301,10 +301,10 @@ proc semOf(c: PContext, n: PNode): PNode = proc isOpImpl(c: PContext, n: PNode): PNode = InternalAssert n.sonsLen == 3 and - n[1].kind == nkSym and n[1].sym.kind == skType and + n[1].typ != nil and n[1].typ.kind == tyTypeDesc and n[2].kind in {nkStrLit..nkTripleStrLit, nkType} - let t1 = n[1].sym.typ.skipTypes({tyTypeDesc}) + let t1 = n[1].typ.skipTypes({tyTypeDesc}) if n[2].kind in {nkStrLit..nkTripleStrLit}: case n[2].strVal.normalize @@ -1942,7 +1942,9 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = # type parameters: partial generic specialization n.sons[0] = semSymGenericInstantiation(c, n.sons[0], s) result = explicitGenericInstantiation(c, n, s) - else: + elif s != nil and s.kind in {skType}: + result = symNodeFromType(c, semTypeNode(c, n, nil), n.info) + else: result = semArrayAccess(c, n, flags) of nkCurlyExpr: result = semExpr(c, buildOverloadedSubscripts(n, getIdent"{}"), flags) diff --git a/compiler/semfold.nim b/compiler/semfold.nim index ddbe3053c7..5e5403c280 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -588,8 +588,9 @@ proc getConstExpr(m: PSym, n: PNode): PNode = result = newSymNodeTypeDesc(s, n.info) of skGenericParam: if s.typ.kind == tyStatic: - result = s.typ.n - result.typ = s.typ.sons[0] + if s.typ.n != nil: + result = s.typ.n + result.typ = s.typ.sons[0] else: result = newSymNodeTypeDesc(s, n.info) else: nil diff --git a/compiler/seminst.nim b/compiler/seminst.nim index ba26635a1d..969ff2d590 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -198,14 +198,31 @@ proc fixupProcType(c: PContext, genericType: PType, case genericType.kind of tyGenericParam, tyTypeClasses: result = inst.concreteTypes[genericType.sym.position] + of tyTypeDesc: result = inst.concreteTypes[genericType.sym.position] if tfUnresolved in genericType.flags: result = result.sons[0] + of tyStatic: result = inst.concreteTypes[genericType.sym.position] + of tyGenericInst: result = fixupProcType(c, result.lastSon, inst) + + of tyObject: + var recList = genericType.n + for i in 0 .. <recList.sonsLen: + let field = recList[i].sym + let changed = fixupProcType(c, field.typ, inst) + if field.typ != changed: + if result == genericType: + result = copyType(genericType, genericType.owner, false) + result.n = copyTree(recList) + result.n.sons[i].sym = copySym(recList[i].sym, true) + result.n.sons[i].typ = changed + result.n.sons[i].sym.typ = changed + of tyOpenArray, tyArray, tySet, tySequence, tyTuple, tyProc, tyPtr, tyVar, tyRef, tyOrdinal, tyRange, tyVarargs: if genericType.sons == nil: return @@ -268,7 +285,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, info: TLineInfo): PSym = # no need to instantiate generic templates/macros: if fn.kind in {skTemplate, skMacro}: return fn - + # generates an instantiated proc if c.InstCounter > 1000: InternalError(fn.ast.info, "nesting too deep") inc(c.InstCounter) diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 4c667e27e9..b97cde63a9 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -34,10 +34,9 @@ proc semInstantiationInfo(c: PContext, n: PNode): PNode = proc semTypeTraits(c: PContext, n: PNode): PNode = checkMinSonsLen(n, 2) - internalAssert n.sons[1].kind == nkSym - let typArg = n.sons[1].sym - if typArg.kind == skType or - (typArg.kind == skParam and typArg.typ.sonsLen > 0): + internalAssert n.sons[1].typ.kind == tyTypeDesc + let typArg = n.sons[1].typ + if typArg.sonsLen > 0: # This is either a type known to sem or a typedesc # param to a regular proc (again, known at instantiation) result = evalTypeTrait(n[0], n[1], GetCurrOwner()) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index a1805fdec0..33e942844e 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1039,8 +1039,12 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, # for DLL generation it is annoying to check for sfImportc! if sfBorrow in s.flags: LocalError(n.sons[bodyPos].info, errImplOfXNotAllowed, s.name.s) - if n.sons[genericParamsPos].kind == nkEmpty: - ParamsTypeCheck(c, s.typ) + let usePseudoGenerics = kind in {skMacro, skTemplate} + # Macros and Templates can have generic parameters, but they are + # only used for overload resolution (there is no instantiation of + # the symbol, so we must process the body now) + if n.sons[genericParamsPos].kind == nkEmpty or usePseudoGenerics: + if not usePseudoGenerics: ParamsTypeCheck(c, s.typ) pushProcCon(c, s) maybeAddResult(c, s, n) if sfImportc notin s.flags: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 1251a25c06..29fad00599 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -594,12 +594,7 @@ let typedescId = getIdent"typedesc" proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, paramType: PType, paramName: string, info: TLineInfo, anon = false): PType = - if procKind in {skMacro, skTemplate}: - # generic param types in macros and templates affect overload - # resolution, but don't work as generic params when it comes - # to proc instantiation. We don't need to lift such params here. - return - + proc addImplicitGenericImpl(typeClass: PType, typId: PIdent): PType = let finalTypId = if typId != nil: typId else: getIdent(paramName & ":type") @@ -620,7 +615,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, s.position = genericParams.len genericParams.addSon(newSymNode(s)) result = typeClass - + # XXX: There are codegen errors if this is turned into a nested proc template liftingWalk(typ: PType, anonFlag = false): expr = liftParamType(c, procKind, genericParams, typ, paramName, info, anonFlag) @@ -635,20 +630,25 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, case paramType.kind: of tyAnything: result = addImplicitGeneric(newTypeS(tyGenericParam, c)) + of tyStatic: # proc(a: expr{string}, b: expr{nkLambda}) # overload on compile time values and AST trees result = addImplicitGeneric(c.newTypeWithSons(tyStatic, paramType.sons)) + result.flags.incl tfHasStatic + of tyTypeDesc: if tfUnresolved notin paramType.flags: # naked typedescs are not bindOnce types if paramType.sonsLen == 0 and paramTypId != nil and paramTypId.id == typedescId.id: paramTypId = nil result = addImplicitGeneric(c.newTypeWithSons(tyTypeDesc, paramType.sons)) + of tyDistinct: if paramType.sonsLen == 1: # disable the bindOnce behavior for the type class result = liftingWalk(paramType.sons[0], true) + of tySequence, tySet, tyArray, tyOpenArray: # XXX: this is a bit strange, but proc(s: seq) # produces tySequence(tyGenericParam, null). @@ -657,7 +657,8 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, # Maybe there is another better place to associate # the seq type class with the seq identifier. if paramType.lastSon == nil: - let typ = c.newTypeWithSons(tyTypeClass, @[newTypeS(paramType.kind, c)]) + let typ = c.newTypeWithSons(tyBuiltInTypeClass, + @[newTypeS(paramType.kind, c)]) result = addImplicitGeneric(typ) else: for i in 0 .. <paramType.sons.len: @@ -678,20 +679,26 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, result = addImplicitGeneric(result) of tyGenericInst: + # XXX: It should be possible to set tfHasMeta in semtypinst, when the + # instance was generated for i in 1 .. (paramType.sons.len - 2): var lifted = liftingWalk(paramType.sons[i]) if lifted != nil: paramType.sons[i] = lifted result = paramType + paramType.lastSon.flags.incl tfHasMeta let liftBody = liftingWalk(paramType.lastSon) - if liftBody != nil: result = liftBody - + if liftBody != nil: + result = liftBody + result.flags.incl tfHasMeta + of tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: result = addImplicitGeneric(copyType(paramType, getCurrOwner(), true)) of tyExpr: - result = addImplicitGeneric(newTypeS(tyGenericParam, c)) + if procKind notin {skMacro, skTemplate}: + result = addImplicitGeneric(newTypeS(tyGenericParam, c)) of tyGenericParam: if tfGenericTypeParam in paramType.flags and false: @@ -881,8 +888,8 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = proc semTypeExpr(c: PContext, n: PNode): PType = var n = semExprWithType(c, n, {efDetermineType}) - if n.kind == nkSym and n.sym.kind == skType: - result = n.sym.typ + if n.typ.kind == tyTypeDesc: + result = n.typ.base else: LocalError(n.info, errTypeExpected, n.renderTree) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 384ce3498c..1bd6e23d5e 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -201,11 +201,12 @@ proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = result = t if t == nil: return if t.kind == tyStatic and t.sym != nil and t.sym.kind == skGenericParam: - return lookupTypeVar(cl, t) + let s = lookupTypeVar(cl, t) + return if s != nil: s else: t case t.kind - of tyTypeClass: nil - of tyGenericParam: + of tyTypeClass, tyBuiltInTypeClass: nil + of tyGenericParam, tyCompositeTypeClass: result = lookupTypeVar(cl, t) if result == nil: return t if result.kind == tyGenericInvokation: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 43ca6e6669..27be1b7d59 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -210,7 +210,7 @@ proc describeArgs*(c: PContext, n: PNode, startIdx = 1): string = add(result, argTypeToString(arg)) if i != sonsLen(n) - 1: add(result, ", ") -proc typeRel*(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation +proc typeRel*(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation proc concreteType(c: TCandidate, t: PType): PType = case t.kind of tyArrayConstr: @@ -305,8 +305,7 @@ proc minRel(a, b: TTypeRelation): TTypeRelation = proc recordRel(c: var TCandidate, f, a: PType): TTypeRelation = result = isNone - if sameType(f, a): - result = isEqual + if sameType(f, a): result = isEqual elif sonsLen(a) == sonsLen(f): result = isEqual let firstField = if f.kind == tyTuple: 0 @@ -323,6 +322,8 @@ proc recordRel(c: var TCandidate, f, a: PType): TTypeRelation = else: var x = f.n.sons[i].sym var y = a.n.sons[i].sym + if f.kind == tyObject and typeRel(c, x.typ, y.typ) < isSubtype: + return isNone if x.name.id != y.name.id: return isNone proc allowsNil(f: PType): TTypeRelation {.inline.} = @@ -390,7 +391,7 @@ proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} = else: result = isNone -proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = +proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = # typeRel can be used to establish various relationships between types: # # 1) When used with concrete types, it will check for type equivalence @@ -409,7 +410,10 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = result = isNone assert(f != nil) - assert(a != nil) + assert(aOrig != nil) + + # var and static arguments match regular modifier-free types + let a = aOrig.skipTypes({tyStatic, tyVar}) if a.kind == tyGenericInst and skipTypes(f, {tyVar}).kind notin { @@ -417,11 +421,8 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = tyGenericParam} + tyTypeClasses: return typeRel(c, f, lastSon(a)) - if a.kind == tyVar and f.kind != tyVar: - return typeRel(c, f, a.sons[0]) - template bindingRet(res) = - when res == isGeneric: put(c.bindings, f, a) + when res == isGeneric: put(c.bindings, f, aOrig) return res case a.kind @@ -495,9 +496,9 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = of tyFloat32: result = handleFloatRange(f, a) of tyFloat64: result = handleFloatRange(f, a) of tyFloat128: result = handleFloatRange(f, a) - of tyVar: - if a.kind == f.kind: result = typeRel(c, base(f), base(a)) - else: result = typeRel(c, base(f), a) + of tyVar: + if aOrig.kind == tyVar: result = typeRel(c, f.base, aOrig.base) + else: result = typeRel(c, f.base, aOrig) of tyArray, tyArrayConstr: # tyArrayConstr cannot happen really, but # we wanna be safe here @@ -551,7 +552,6 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = of tyOrdinal: if isOrdinalType(a): var x = if a.kind == tyOrdinal: a.sons[0] else: a - if f.sonsLen == 0: result = isGeneric else: @@ -683,21 +683,21 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = of tyAnd: for branch in f.sons: - if typeRel(c, branch, a) == isNone: + if typeRel(c, branch, aOrig) == isNone: return isNone bindingRet isGeneric of tyOr: for branch in f.sons: - if typeRel(c, branch, a) != isNone: + if typeRel(c, branch, aOrig) != isNone: bindingRet isGeneric - + return isNone of tyNot: for branch in f.sons: - if typeRel(c, branch, a) != isNone: + if typeRel(c, branch, aOrig) != isNone: return isNone bindingRet isGeneric @@ -716,7 +716,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = var prev = PType(idTableGet(c.bindings, f)) if prev == nil: let targetKind = f.sons[0].kind - if targetKind == a.skipTypes({tyRange}).kind or + if targetKind == a.skipTypes({tyRange, tyGenericInst}).kind or (targetKind in {tyProc, tyPointer} and a.kind == tyNil): put(c.bindings, f, a) return isGeneric @@ -775,9 +775,9 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = result = typeRel(c, x, a) # check if it fits of tyStatic: - if a.kind == tyStatic: - result = typeRel(c, f.lastSon, a.lastSon) - if result != isNone: put(c.bindings, f, a) + if aOrig.kind == tyStatic: + result = typeRel(c, f.lastSon, a) + if result != isNone: put(c.bindings, f, aOrig) else: result = isNone @@ -788,8 +788,8 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = if f.sonsLen == 0: result = isGeneric else: - result = typeRel(c, f, a.sons[0]) - if result == isGeneric: + result = typeRel(c, f.sons[0], a.sons[0]) + if result != isNone: put(c.bindings, f, a) else: result = isNone @@ -939,7 +939,7 @@ proc ParamTypesMatchAux(m: var TCandidate, f, argType: PType, arg = argSemantized c = m.c argType = argType - + if tfHasStatic in fMaybeStatic.flags: # XXX: When implicit statics are the default # this will be done earlier - we just have to @@ -950,7 +950,7 @@ proc ParamTypesMatchAux(m: var TCandidate, f, argType: PType, arg.typ.sons = @[evaluated.typ] arg.typ.n = evaluated argType = arg.typ - + var r: TTypeRelation a = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) diff --git a/tests/compile/tloops.nim b/tests/compile/tloops.nim index 2b1765b007..f6f9397698 100644 --- a/tests/compile/tloops.nim +++ b/tests/compile/tloops.nim @@ -1,67 +1,67 @@ -# Test nested loops and some other things - -proc andTest() = - var a = 0 == 5 and 6 == 6 - -proc incx(x: var int) = # is built-in proc - x = x + 1 - -proc decx(x: var int) = - x = x - 1 - -proc First(y: var int) = - var x: int - i_ncx(x) - if x == 10: - y = 0 - else: - if x == 0: - incx(x) - else: - x=11 - -proc TestLoops() = - var i, j: int - while i >= 0: - if i mod 3 == 0: - break - i = i + 1 - while j == 13: - j = 13 - break - break - - while True: - break - - -proc Foo(n: int): int = - var - a, old: int - b, c: bool - F_irst(a) - if a == 10: - a = 30 - elif a == 11: - a = 22 - elif a == 12: - a = 23 - elif b: - old = 12 - else: - a = 40 - - # - b = false or 2 == 0 and 3 == 9 - a = 0 + 3 * 5 + 6 + 7 + +8 # 36 - while b: - a = a + 3 - a = a + 5 - write(stdout, "Hello!") - - -# We should come till here :-) -discard Foo(345) +# Test nested loops and some other things + +proc andTest() = + var a = 0 == 5 and 6 == 6 + +proc incx(x: var int) = # is built-in proc + x = x + 1 + +proc decx(x: var int) = + x = x - 1 + +proc First(y: var int) = + var x: int + i_ncx(x) + if x == 10: + y = 0 + else: + if x == 0: + incx(x) + else: + x=11 + +proc TestLoops() = + var i, j: int + while i >= 0: + if i mod 3 == 0: + break + i = i + 1 + while j == 13: + j = 13 + break + break + + while True: + break + + +proc Foo(n: int): int = + var + a, old: int + b, c: bool + F_irst(a) + if a == 10: + a = 30 + elif a == 11: + a = 22 + elif a == 12: + a = 23 + elif b: + old = 12 + else: + a = 40 + + # + b = false or 2 == 0 and 3 == 9 + a = 0 + 3 * 5 + 6 + 7 + +8 # 36 + while b: + a = a + 3 + a = a + 5 + write(stdout, "Hello!") + + +# We should come till here :-) +discard Foo(345) # test the new type symbol lookup feature: diff --git a/tests/run/tmemoization.nim b/tests/run/tmemoization.nim index b59ff44ea2..180acd89b6 100644 --- a/tests/run/tmemoization.nim +++ b/tests/run/tmemoization.nim @@ -1,6 +1,6 @@ discard """ - msg: "test 1\ntest 2" - output: "TEST 1\nTEST 2\nTEST 2" + msg: "test 1\ntest 2\ntest 3" + output: "TEST 1\nTEST 2\nTEST 3" """ import strutils @@ -10,8 +10,8 @@ proc foo(s: static[string]): string = const R = s.toUpper return R - + echo foo("test 1") echo foo("test 2") -echo foo("test " & $2) +echo foo("test " & $3) diff --git a/tests/run/tstaticparams.nim b/tests/run/tstaticparams.nim index 23d644bce3..b1377443bb 100644 --- a/tests/run/tstaticparams.nim +++ b/tests/run/tstaticparams.nim @@ -10,9 +10,9 @@ type TBar[T; I: static[int]] = object data: array[I, T] - #TA1[T; I: static[int]] = array[I, T] - #TA2[T; I: static[int]] = array[0..I, T] - TA3[T; I: static[int]] = array[I-1, T] + TA1[T; I: static[int]] = array[I, T] + # TA2[T; I: static[int]] = array[0..I, T] + # TA3[T; I: static[int]] = array[I-1, T] proc takeFoo(x: TFoo) = echo "abracadabra" @@ -25,7 +25,7 @@ var y: TBar[float, 4] echo high(y.data) var - t1: TA1 - t2: TA2 - t3: TA3 + t1: TA1[float, 1] + # t2: TA2[string, 4] + # t3: TA3[int, 10] diff --git a/tests/run/ttypetraits.nim b/tests/run/ttypetraits.nim index 9a4a7d0d30..4344855eb6 100644 --- a/tests/run/ttypetraits.nim +++ b/tests/run/ttypetraits.nim @@ -1,6 +1,6 @@ discard """ msg: "int\nstring\nTBar[int]" - output: "int\nstring\nTBar[int]\nint\nrange 0..2\nstring" + output: "int\nstring\nTBar[int]\nint\nrange 0..2(int)\nstring" """ import typetraits diff --git a/tests/run/tusingstatement.nim b/tests/run/tusingstatement.nim index b9d4663775..a33aced4c5 100644 --- a/tests/run/tusingstatement.nim +++ b/tests/run/tusingstatement.nim @@ -8,25 +8,11 @@ import # This macro mimics the using statement from C# # -# XXX: -# It doen't match the C# version exactly yet. -# In particular, it's not recursive, which prevents it from dealing -# with exceptions thrown from the variable initializers when multiple. -# variables are used. +# It's kept only as a test for the macro system +# Nimrod's destructors offer a mechanism for automatic +# disposal of resources. # -# Also, since nimrod relies less on exceptions in general, a more -# idiomatic definition could be: -# var x = init() -# if opened(x): -# try: -# body -# finally: -# close(x) -# -# `opened` here could be an overloaded proc which any type can define. -# A common practice can be returing an Optional[Resource] obj for which -# `opened` is defined to `optional.hasValue` -macro using(e: expr): stmt {.immediate.} = +macro autoClose(e: expr): stmt {.immediate.} = let e = callsite() if e.len != 3: error "Using statement: unexpected number of arguments. Got " & @@ -97,7 +83,7 @@ proc close(r: var TResource) = proc use(r: var TResource) = write(stdout, "Using " & r.field & ".") -using(r = openResource("test")): +autoClose(r = openResource("test")): use r From 1101a40f91880b6cd1f0807d2b272eda7b5c9491 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 28 Dec 2013 23:30:53 +0100 Subject: [PATCH 168/326] improvements for 'pretty' --- compiler/lists.nim | 4 ++-- compiler/pretty.nim | 30 ++++++++++++++--------- compiler/suggest.nim | 3 ++- lib/pure/os.nim | 56 +++++++++++++++++++++---------------------- lib/pure/strutils.nim | 20 ++++++++-------- lib/pure/times.nim | 2 +- lib/system.nim | 8 +++---- lib/system/alloc.nim | 6 ++--- lib/system/assign.nim | 14 +++++------ lib/system/excpt.nim | 2 +- lib/system/gc.nim | 12 +++++----- lib/system/repr.nim | 2 +- lib/system/sysio.nim | 18 +++++++------- lib/system/sysstr.nim | 10 ++++---- todo.txt | 3 +-- 15 files changed, 99 insertions(+), 91 deletions(-) diff --git a/compiler/lists.nim b/compiler/lists.nim index 93448c0b27..dd4f5d6be5 100644 --- a/compiler/lists.nim +++ b/compiler/lists.nim @@ -20,12 +20,12 @@ type PStrEntry* = ref TStrEntry TLinkedList* = object # for the "find" operation: head*, tail*: PListEntry - Counter*: int + counter*: int TCompareProc* = proc (entry: PListEntry, closure: pointer): bool {.nimcall.} proc initLinkedList*(list: var TLinkedList) = - list.Counter = 0 + list.counter = 0 list.head = nil list.tail = nil diff --git a/compiler/pretty.nim b/compiler/pretty.nim index a59694d8f6..704857f37d 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -17,9 +17,10 @@ import const removeTP = false # when true, "nimrod pretty" converts TTyp to Typ. -type +type TGen = object of TPassContext module*: PSym + checkExtern: bool PGen = ref TGen TSourceFile = object @@ -44,13 +45,19 @@ proc loadFile(info: TLineInfo) = gSourceFiles[i].lines.add(line) proc overwriteFiles*() = + let overWrite = options.getConfigVar("pretty.overwrite").normalize == "on" + let doStrip = options.getConfigVar("pretty.strip").normalize == "on" for i in 0 .. high(gSourceFiles): if not gSourceFiles[i].dirty: continue - let newFile = gSourceFiles[i].fullpath #.changeFileExt(".pretty.nim") + let newFile = if overWrite: gSourceFiles[i].fullpath + else: gSourceFiles[i].fullpath.changeFileExt(".pretty.nim") try: var f = open(newFile, fmWrite) for line in gSourceFiles[i].lines: - f.write line #.strip(leading = false, trailing = true) + if doStrip: + f.write line.strip(leading = false, trailing = true) + else: + f.write line f.write("\L") f.close except EIO: @@ -131,8 +138,6 @@ proc differ(line: string, a, b: int, x: string): bool = inc j return false -var cannotRename = initIntSet() - proc checkDef(c: PGen; n: PNode) = if n.kind != nkSym: return let s = n.sym @@ -141,10 +146,11 @@ proc checkDef(c: PGen; n: PNode) = if s.kind in {skResult, skTemp} or s.name.s[0] notin Letters: return if s.kind in {skType, skGenericParam} and sfAnon in s.flags: return - checkStyle(n.info, s.name.s, s.kind) + if {sfImportc, sfExportc} * s.flags == {} or c.checkExtern: + checkStyle(n.info, s.name.s, s.kind) -proc checkUse(c: PGen; n: PNode) = - if n.info.fileIndex < 0: return +proc checkUse*(n: PNode) = + if n.info.fileIndex < 0 or n.kind != nkSym: return let s = n.sym # we simply convert it to what it looks like in the definition # for consistency @@ -177,8 +183,9 @@ proc checkUse(c: PGen; n: PNode) = system.shallowCopy(gSourceFiles[n.info.fileIndex].lines[n.info.line-1], x) gSourceFiles[n.info.fileIndex].dirty = true - when false: + var cannotRename = initIntSet() + proc beautifyName(s: string, k: TSymKind): string = let allUpper = allCharsInSet(s, {'A'..'Z', '0'..'9', '_'}) result = newStringOfCap(s.len) @@ -260,9 +267,9 @@ when false: proc check(c: PGen, n: PNode) = case n.kind - of nkSym: checkUse(c, n) + of nkSym: checkUse(n) of nkBlockStmt, nkBlockExpr, nkBlockType: - if n.sons[0].kind != nkEmpty: checkDef(c, n[0]) + checkDef(c, n[0]) check(c, n.sons[1]) of nkForStmt, nkParForStmt: let L = n.len @@ -300,6 +307,7 @@ proc myOpen(module: PSym): PPassContext = var g: PGen new(g) g.module = module + g.checkExtern = options.getConfigVar("pretty.checkextern").normalize == "on" result = g if rules.isNil: rules = newStringTable(modeStyleInsensitive) diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 888f958d07..7e0a28afb7 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -11,7 +11,7 @@ # included from sigmatch.nim -import algorithm, sequtils +import algorithm, sequtils, pretty const sep = '\t' @@ -327,6 +327,7 @@ proc markUsed(n: PNode, s: PSym) = if sfDeprecated in s.flags: message(n.info, warnDeprecated, s.name.s) if sfError in s.flags: localError(n.info, errWrongSymbolX, s.name.s) suggestSym(n, s) + if gCmd == cmdPretty: checkUse(n) proc useSym*(sym: PSym): PNode = result = newSymNode(sym) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index fbca89f52d..202052bc67 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -96,8 +96,8 @@ elif defined(macos): CurDir* = ':' ParDir* = "::" Dirsep* = ':' - Altsep* = dirsep - Pathsep* = ',' + Altsep* = Dirsep + PathSep* = ',' FileSystemCaseSensitive* = false ExeExt* = "" ScriptExt* = "" @@ -135,7 +135,7 @@ elif doslike: elif defined(PalmOS) or defined(MorphOS): const Dirsep* = '/' - Altsep* = dirsep + Altsep* = Dirsep PathSep* = ';' Pardir* = ".." FileSystemCaseSensitive* = false @@ -157,7 +157,7 @@ else: # UNIX-like operating system Curdir* = '.' Pardir* = ".." Dirsep* = '/' - Altsep* = dirsep + Altsep* = Dirsep PathSep* = ':' FileSystemCaseSensitive* = true ExeExt* = "" @@ -304,11 +304,11 @@ proc unixToNativePath*(path: string): string {. elif defined(macos): result = "" # must not start with ':' else: - result = $dirSep + result = $DirSep start = 1 elif path[0] == '.' and path[1] == '/': # current directory - result = $curdir + result = $Curdir start = 2 else: result = "" @@ -322,12 +322,12 @@ proc unixToNativePath*(path: string): string {. if result[high(result)] == ':': add result, ':' else: - add result, pardir + add result, ParDir else: - add result, pardir & dirSep + add result, ParDir & DirSep inc(i, 3) elif path[i] == '/': - add result, dirSep + add result, DirSep inc(i) else: add result, path[i] @@ -538,7 +538,7 @@ proc splitPath*(path: string): tuple[head, tail: string] {. ## splitPath("") -> ("", "") var sepPos = -1 for i in countdown(len(path)-1, 0): - if path[i] in {dirsep, altsep}: + if path[i] in {Dirsep, Altsep}: sepPos = i break if sepPos >= 0: @@ -550,9 +550,9 @@ proc splitPath*(path: string): tuple[head, tail: string] {. proc parentDirPos(path: string): int = var q = 1 - if path[len(path)-1] in {dirsep, altsep}: q = 2 + if path[len(path)-1] in {Dirsep, Altsep}: q = 2 for i in countdown(len(path)-q, 0): - if path[i] in {dirsep, altsep}: return i + if path[i] in {Dirsep, Altsep}: return i result = -1 proc parentDir*(path: string): string {. @@ -593,8 +593,8 @@ iterator parentDirs*(path: string, fromRoot=false, inclusive=true): string = else: for i in countup(0, path.len - 2): # ignore the last / # deal with non-normalized paths such as /foo//bar//baz - if path[i] in {dirsep, altsep} and - (i == 0 or path[i-1] notin {dirsep, altsep}): + if path[i] in {Dirsep, Altsep} and + (i == 0 or path[i-1] notin {Dirsep, Altsep}): yield path.substr(0, i) if inclusive: yield path @@ -609,17 +609,17 @@ proc `/../` * (head, tail: string): string {.noSideEffect.} = result = head / tail proc normExt(ext: string): string = - if ext == "" or ext[0] == extSep: result = ext # no copy needed here - else: result = extSep & ext + if ext == "" or ext[0] == ExtSep: result = ext # no copy needed here + else: result = ExtSep & ext proc searchExtPos(s: string): int = # BUGFIX: do not search until 0! .DS_Store is no file extension! result = -1 for i in countdown(len(s)-1, 1): - if s[i] == extsep: + if s[i] == ExtSep: result = i break - elif s[i] in {dirsep, altsep}: + elif s[i] in {Dirsep, Altsep}: break # do not skip over path proc splitFile*(path: string): tuple[dir, name, ext: string] {. @@ -639,7 +639,7 @@ proc splitFile*(path: string): tuple[dir, name, ext: string] {. ## If `path` has no extension, `ext` is the empty string. ## If `path` has no directory component, `dir` is the empty string. ## If `path` has no filename component, `name` and `ext` are empty strings. - if path.len == 0 or path[path.len-1] in {dirSep, altSep}: + if path.len == 0 or path[path.len-1] in {DirSep, Altsep}: result = (path, "", "") else: var sepPos = -1 @@ -647,8 +647,8 @@ proc splitFile*(path: string): tuple[dir, name, ext: string] {. for i in countdown(len(path)-1, 0): if path[i] == ExtSep: if dotPos == path.len and i > 0 and - path[i-1] notin {dirsep, altsep}: dotPos = i - elif path[i] in {dirsep, altsep}: + path[i-1] notin {Dirsep, Altsep}: dotPos = i + elif path[i] in {Dirsep, Altsep}: sepPos = i break result.dir = substr(path, 0, sepPos-1) @@ -659,7 +659,7 @@ proc extractFilename*(path: string): string {. noSideEffect, rtl, extern: "nos$1".} = ## Extracts the filename of a given `path`. This is the same as ## ``name & ext`` from ``splitFile(path)``. - if path.len == 0 or path[path.len-1] in {dirSep, altSep}: + if path.len == 0 or path[path.len-1] in {DirSep, Altsep}: result = "" else: result = splitPath(path).tail @@ -816,7 +816,7 @@ proc sameFileContent*(path1, path2: string): bool {.rtl, extern: "nos$1", return false var bufA = alloc(bufsize) var bufB = alloc(bufsize) - while True: + while true: var readA = readBuffer(a, bufA, bufsize) var readB = readBuffer(b, bufB, bufsize) if readA != readB: @@ -1032,7 +1032,7 @@ when defined(windows): env = getEnvironmentStringsW() e = env if e == nil: return # an error occured - while True: + while true: var eend = strEnd(e) add(environment, $e) e = cast[WideCString](cast[TAddress](eend)+2) @@ -1043,7 +1043,7 @@ when defined(windows): env = getEnvironmentStringsA() e = env if e == nil: return # an error occured - while True: + while true: var eend = strEnd(e) add(environment, $e) e = cast[CString](cast[TAddress](eend)+1) @@ -1308,7 +1308,7 @@ proc createDir*(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = when defined(doslike): omitNext = isAbsolute(dir) for i in 1.. dir.len-1: - if dir[i] in {dirsep, altsep}: + if dir[i] in {Dirsep, Altsep}: if omitNext: omitNext = false else: @@ -1635,10 +1635,10 @@ proc findExe*(exe: string): string {.tags: [FReadDir, FReadEnv].} = ## in directories listed in the ``PATH`` environment variable. ## Returns "" if the `exe` cannot be found. On DOS-like platforms, `exe` ## is added an ``.exe`` file extension if it has no extension. - result = addFileExt(exe, os.exeExt) + result = addFileExt(exe, os.ExeExt) if existsFile(result): return var path = string(os.getEnv("PATH")) - for candidate in split(path, pathSep): + for candidate in split(path, PathSep): var x = candidate / result if existsFile(x): return x result = "" diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index b7e3de6cfc..2a6d499a72 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -67,7 +67,7 @@ proc toUpper*(c: char): char {.noSideEffect, procvar, ## Converts `c` into upper case. This works only for the letters a-z. ## See `unicode.toUpper` for a version that works for any Unicode character. if c in {'a'..'z'}: - result = chr(ord(c) - (Ord('a') - Ord('A'))) + result = chr(ord(c) - (ord('a') - ord('A'))) else: result = c @@ -497,31 +497,31 @@ iterator tokenize*(s: string, seps: set[char] = Whitespace): tuple[ proc wordWrap*(s: string, maxLineWidth = 80, splitLongWords = true, - seps: set[char] = whitespace, + seps: set[char] = Whitespace, newLine = "\n"): string {. noSideEffect, rtl, extern: "nsuWordWrap".} = ## word wraps `s`. result = newStringOfCap(s.len + s.len shr 6) - var SpaceLeft = maxLineWidth + var spaceLeft = maxLineWidth for word, isSep in tokenize(s, seps): - if len(word) > SpaceLeft: + if len(word) > spaceLeft: if splitLongWords and len(word) > maxLineWidth: - result.add(substr(word, 0, SpaceLeft-1)) - var w = SpaceLeft+1 - var wordLeft = len(word) - SpaceLeft + result.add(substr(word, 0, spaceLeft-1)) + var w = spaceLeft+1 + var wordLeft = len(word) - spaceLeft while wordLeft > 0: result.add(newLine) var L = min(maxLineWidth, wordLeft) - SpaceLeft = maxLineWidth - L + spaceLeft = maxLineWidth - L result.add(substr(word, w, w+L-1)) inc(w, L) dec(wordLeft, L) else: - SpaceLeft = maxLineWidth - len(word) + spaceLeft = maxLineWidth - len(word) result.add(newLine) result.add(word) else: - SpaceLeft = SpaceLeft - len(word) + spaceLeft = spaceLeft - len(word) result.add(word) proc unindent*(s: string, eatAllIndent = false): string {. diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 6dfe80ca15..246126828f 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -593,7 +593,7 @@ proc format*(info: TTimeInfo, f: string): string = result = "" var i = 0 var currentF = "" - while True: + while true: case f[i] of ' ', '-', '/', ':', '\'', '\0', '(', ')', '[', ']', ',': case currentF diff --git a/lib/system.nim b/lib/system.nim index b320f14dda..ebe7226800 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1262,13 +1262,13 @@ proc getRefcount*[T](x: seq[T]): int {.importc: "getRefcount", noSideEffect.} ## retrieves the reference count of an heap-allocated object. The ## value is implementation-dependent. -# new constants: + const - inf* {.magic: "Inf".} = 1.0 / 0.0 + Inf* {.magic: "Inf".} = 1.0 / 0.0 ## contains the IEEE floating point value of positive infinity. - neginf* {.magic: "NegInf".} = -inf + NegInf* {.magic: "NegInf".} = -Inf ## contains the IEEE floating point value of negative infinity. - nan* {.magic: "NaN".} = 0.0 / 0.0 + NaN* {.magic: "NaN".} = 0.0 / 0.0 ## contains an 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 diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 204d98a2c9..954485eb49 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -628,12 +628,12 @@ proc rawDealloc(a: var TMemRegion, p: pointer) = # check if it is not in the freeSmallChunks[s] list: if c.free < s: # add it to the freeSmallChunks[s] array: - listAdd(a.freeSmallChunks[s div memAlign], c) + listAdd(a.freeSmallChunks[s div MemAlign], c) inc(c.free, s) else: inc(c.free, s) if c.free == SmallChunkSize-smallChunkOverhead(): - listRemove(a.freeSmallChunks[s div memAlign], c) + listRemove(a.freeSmallChunks[s div MemAlign], c) c.size = SmallChunkSize freeBigChunk(a, cast[PBigChunk](c)) sysAssert(((cast[TAddress](p) and PageMask) - smallChunkOverhead()) %% @@ -739,7 +739,7 @@ proc realloc(allocator: var TMemRegion, p: pointer, newsize: int): pointer = proc deallocOsPages(a: var TMemRegion) = # we free every 'ordinarily' allocated page by iterating over the page bits: for p in elements(a.chunkStarts): - var page = cast[PChunk](p shl pageShift) + var page = cast[PChunk](p shl PageShift) when not weirdUnmap: var size = if page.size < PageSize: PageSize else: page.size osDeallocPages(page, size) diff --git a/lib/system/assign.nim b/lib/system/assign.nim index 6b7ffaf7b6..9e39306225 100644 --- a/lib/system/assign.nim +++ b/lib/system/assign.nim @@ -37,12 +37,12 @@ proc genericAssignAux(dest, src: pointer, n: ptr TNimNode, shallow: bool) = # echo "ugh memory corruption! ", n.kind # quit 1 -proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) = +proc genericAssignAux(dest, src: pointer, mt: PNimType, shallow: bool) = var d = cast[TAddress](dest) s = cast[TAddress](src) sysAssert(mt != nil, "genericAssignAux 2") - case mt.Kind + case mt.kind of tyString: var x = cast[PPointer](dest) var s2 = cast[PPointer](s)[] @@ -67,7 +67,7 @@ proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) = cast[pointer](dst +% i*% mt.base.size +% GenericSeqSize), cast[pointer](cast[TAddress](s2) +% i *% mt.base.size +% GenericSeqSize), - mt.Base, shallow) + mt.base, shallow) of tyObject: # we need to copy m_type field for tyObject, as it could be empty for # sequence reallocations: @@ -152,7 +152,7 @@ proc objectInitAux(dest: pointer, n: ptr TNimNode) = var m = selectBranch(dest, n) if m != nil: objectInitAux(dest, m) -proc objectInit(dest: Pointer, typ: PNimType) = +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) @@ -185,7 +185,7 @@ else: for i in countup(0, r.len - 1): destroy(r[i]) proc genericReset(dest: pointer, mt: PNimType) {.compilerProc.} -proc genericResetAux(dest: Pointer, n: ptr TNimNode) = +proc genericResetAux(dest: pointer, n: ptr TNimNode) = var d = cast[TAddress](dest) case n.kind of nkNone: sysAssert(false, "genericResetAux") @@ -197,10 +197,10 @@ proc genericResetAux(dest: Pointer, n: ptr TNimNode) = if m != nil: genericResetAux(dest, m) zeroMem(cast[pointer](d +% n.offset), n.typ.size) -proc genericReset(dest: Pointer, mt: PNimType) = +proc genericReset(dest: pointer, mt: PNimType) = var d = cast[TAddress](dest) sysAssert(mt != nil, "genericReset 2") - case mt.Kind + case mt.kind of tyString, tyRef, tySequence: unsureAsgnRef(cast[PPointer](dest), nil) of tyObject, tyTuple: diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 5b00afc5bb..1964e4d3dc 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -253,7 +253,7 @@ proc reraiseException() {.compilerRtl.} = else: raiseExceptionAux(currException) -proc WriteStackTrace() = +proc writeStackTrace() = when hasSomeStackTrace: var s = "" rawWriteStackTrace(s) diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 2a137d7fbd..376d1502c1 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -84,7 +84,7 @@ var gch {.rtlThreadVar.}: TGcHeap when not defined(useNimRtl): - InstantiateForRegion(gch.region) + instantiateForRegion(gch.region) template acquire(gch: TGcHeap) = when hasThreadSupport and hasSharedHeap: @@ -329,11 +329,11 @@ proc forAllSlotsAux(dest: pointer, n: ptr TNimNode, op: TWalkOp) = if m != nil: forAllSlotsAux(dest, m, op) of nkNone: sysAssert(false, "forAllSlotsAux") -proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) = +proc forAllChildrenAux(dest: pointer, mt: PNimType, op: TWalkOp) = var d = cast[TAddress](dest) if dest == nil: return # nothing to do if ntfNoRefs notin mt.flags: - case mt.Kind + case mt.kind of tyRef, tyString, tySequence: # leaf: doOperation(cast[PPointer](d)[], op) of tyObject, tyTuple: @@ -341,7 +341,7 @@ proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) = 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) - else: nil + else: discard proc forAllChildren(cell: PCell, op: TWalkOp) = gcAssert(cell != nil, "forAllChildren: 1") @@ -352,7 +352,7 @@ proc forAllChildren(cell: PCell, op: TWalkOp) = if marker != nil: marker(cellToUsr(cell), op.int) else: - case cell.typ.Kind + case cell.typ.kind of tyRef: # common case forAllChildrenAux(cellToUsr(cell), cell.typ.base, op) of tySequence: @@ -970,7 +970,7 @@ proc collectCTBody(gch: var TGcHeap) = #discard collectZCT(gch) inc(gch.stat.cycleCollections) gch.cycleThreshold = max(InitialCycleThreshold, getOccupiedMem() * - cycleIncrease) + CycleIncrease) gch.stat.maxThreshold = max(gch.stat.maxThreshold, gch.cycleThreshold) unmarkStackAndRegisters(gch) sysAssert(allocInv(gch.region), "collectCT: end") diff --git a/lib/system/repr.nim b/lib/system/repr.nim index aacf266531..cd3f7c3f4c 100644 --- a/lib/system/repr.nim +++ b/lib/system/repr.nim @@ -164,7 +164,7 @@ when not defined(useNimRtl): 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) + typ.base, cl) add result, "]" proc reprRecordAux(result: var string, p: pointer, n: ptr TNimNode, diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 9c0b0c5899..2b6ad8df19 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -62,7 +62,7 @@ else: IONBF {.importc: "_IONBF", nodecl.}: cint const - buf_size = 4000 + BufSize = 4000 proc raiseEIO(msg: string) {.noinline, noreturn.} = sysFatal(EIO, msg) @@ -71,7 +71,7 @@ proc readLine(f: TFile, line: var TaintedString): bool = # 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 setLen(line.string, 0) # reuse the buffer! - while True: + while true: var c = fgetc(f) if c < 0'i32: if line.len > 0: break @@ -94,8 +94,8 @@ proc write(f: TFile, i: int) = else: fprintf(f, "%ld", i) -proc write(f: TFile, i: biggestInt) = - when sizeof(biggestint) == 8: +proc write(f: TFile, i: BiggestInt) = + when sizeof(Biggestint) == 8: fprintf(f, "%lld", i) else: fprintf(f, "%ld", i) @@ -104,7 +104,7 @@ proc write(f: TFile, b: bool) = if b: write(f, "true") else: write(f, "false") proc write(f: TFile, r: float32) = fprintf(f, "%g", r) -proc write(f: TFile, r: biggestFloat) = fprintf(f, "%g", r) +proc write(f: TFile, r: BiggestFloat) = fprintf(f, "%g", r) proc write(f: TFile, c: char) = putc(c, f) proc write(f: TFile, a: varargs[string, `$`]) = @@ -114,10 +114,10 @@ proc readAllBuffer(file: TFile): string = # This proc is for TFile we want to read but don't know how many # bytes we need to read before the buffer is empty. result = "" - var buffer = newString(buf_size) - var bytesRead = buf_size - while bytesRead == buf_size: - bytesRead = readBuffer(file, addr(buffer[0]), buf_size) + var buffer = newString(BufSize) + var bytesRead = BufSize + while bytesRead == BufSize: + bytesRead = readBuffer(file, addr(buffer[0]), BufSize) result.add(buffer) proc rawFileSize(file: TFile): int = diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index bca14bb9d1..4244bae4cb 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -55,7 +55,7 @@ proc copyStrLast(s: NimString, start, last: int): NimString {.compilerProc.} = if len > 0: result = rawNewString(len) result.len = len - c_memcpy(result.data, addr(s.data[start]), len * sizeof(Char)) + c_memcpy(result.data, addr(s.data[start]), len * sizeof(char)) #result.data[len] = '\0' else: result = rawNewString(len) @@ -66,7 +66,7 @@ proc copyStr(s: NimString, start: int): NimString {.compilerProc.} = proc toNimStr(str: cstring, len: int): NimString {.compilerProc.} = result = rawNewString(len) result.len = len - c_memcpy(result.data, str, (len+1) * sizeof(Char)) + c_memcpy(result.data, str, (len+1) * sizeof(char)) #result.data[len] = '\0' # readline relies on this! proc cstrToNimstr(str: cstring): NimString {.compilerRtl.} = @@ -79,7 +79,7 @@ proc copyString(src: NimString): NimString {.compilerRtl.} = else: result = rawNewString(src.space) result.len = src.len - c_memcpy(result.data, src.data, (src.len + 1) * sizeof(Char)) + c_memcpy(result.data, src.data, (src.len + 1) * sizeof(char)) proc copyStringRC1(src: NimString): NimString {.compilerRtl.} = if src != nil: @@ -236,7 +236,7 @@ proc nimIntToStr(x: int): string {.compilerRtl.} = result = newString(sizeof(x)*4) var i = 0 var y = x - while True: + while true: var d = y div 10 result[i] = chr(abs(int(y - d*10)) + ord('0')) inc(i) @@ -259,7 +259,7 @@ proc nimInt64ToStr(x: int64): string {.compilerRtl.} = result = newString(sizeof(x)*4) var i = 0 var y = x - while True: + while true: var d = y div 10 result[i] = chr(abs(int(y - d*10)) + ord('0')) inc(i) diff --git a/todo.txt b/todo.txt index e70e96f910..59d18429ab 100644 --- a/todo.txt +++ b/todo.txt @@ -1,8 +1,8 @@ version 0.9.4 ============= +- convert all with "nimrod pretty": macosx and linux versions - document new templating symbol binding rules -- convert all with "nimrod pretty" - make '--implicitStatic:on' the default - test&finish first class iterators: * nested iterators @@ -87,7 +87,6 @@ Concurrency/Effect system version 0.9.XX ============== -- document nimdoc properly finally - make 'clamp' a magic for the range stuff - better type syntax for functions and tuples: tuple(int, int); (int,int)->int From 438703f59e4d226f6e83e78c4f549a381526c6c2 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 29 Dec 2013 01:13:51 +0100 Subject: [PATCH 169/326] case consistency: next steps --- compiler/ast.nim | 14 +-- compiler/astalgo.nim | 16 +-- compiler/ccgexprs.nim | 16 +-- compiler/ccgstmts.nim | 4 +- compiler/ccgtrav.nim | 2 +- compiler/ccgtypes.nim | 4 +- compiler/cgen.nim | 14 +-- compiler/commands.nim | 16 +-- compiler/condsyms.nim | 10 +- compiler/crc.nim | 6 +- compiler/docgen.nim | 10 +- compiler/evaltempl.nim | 2 +- compiler/filters.nim | 2 +- compiler/guards.nim | 4 +- compiler/hlo.nim | 2 +- compiler/idgen.nim | 2 +- compiler/jsgen.nim | 14 +-- compiler/lambdalifting.nim | 6 +- compiler/lexer.nim | 2 +- compiler/llstream.nim | 4 +- compiler/magicsys.nim | 2 +- compiler/main.nim | 14 +-- compiler/modules.nim | 2 +- compiler/msgs.nim | 14 +-- compiler/nimconf.nim | 2 +- compiler/nimlexbase.nim | 2 +- compiler/nimrod.nim | 2 +- compiler/nimsets.nim | 4 +- compiler/options.nim | 12 +-- compiler/parampatterns.nim | 8 +- compiler/parser.nim | 20 ++-- compiler/pragmas.nim | 90 ++++++++-------- compiler/pretty.nim | 7 +- compiler/renderer.nim | 60 +++++------ compiler/rodread.nim | 12 +-- compiler/rodwrite.nim | 10 +- compiler/ropes.nim | 8 +- compiler/sem.nim | 4 +- compiler/semcall.nim | 2 +- compiler/semdata.nim | 6 +- compiler/semexprs.nim | 16 +-- compiler/seminst.nim | 2 +- compiler/semmagic.nim | 2 +- compiler/sempass2.nim | 10 +- compiler/semstmts.nim | 12 +-- compiler/semtempl.nim | 4 +- compiler/semtypes.nim | 12 +-- compiler/semtypinst.nim | 2 +- compiler/service.nim | 2 +- compiler/sigmatch.nim | 14 +-- compiler/suggest.nim | 4 +- compiler/syntaxes.nim | 4 +- compiler/transf.nim | 48 ++++----- compiler/treetab.nim | 4 +- compiler/types.nim | 26 ++--- compiler/vm.nim | 4 +- compiler/vmdef.nim | 2 +- compiler/vmgen.nim | 22 ++-- koch.nim | 4 +- lib/packages/docutils/highlite.nim | 2 +- lib/packages/docutils/rst.nim | 166 ++++++++++++++--------------- lib/packages/docutils/rstast.nim | 24 ++--- lib/packages/docutils/rstgen.nim | 28 ++--- lib/pure/json.nim | 12 +-- lib/pure/lexbase.nim | 2 +- lib/pure/os.nim | 68 ++++++------ lib/pure/osproc.nim | 2 +- lib/pure/parseopt.nim | 2 +- lib/pure/sockets.nim | 20 ++-- lib/pure/strutils.nim | 2 +- lib/pure/unicode.nim | 16 +-- lib/system.nim | 2 +- lib/system/assign.nim | 2 +- lib/system/chcks.nim | 2 +- lib/system/gc.nim | 14 +-- lib/system/sysio.nim | 10 +- lib/windows/winlean.nim | 28 ++--- 77 files changed, 513 insertions(+), 514 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 292283daf9..a2f5fad171 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1167,30 +1167,30 @@ proc newSym(symKind: TSymKind, Name: PIdent, owner: PSym, proc initStrTable(x: var TStrTable) = x.counter = 0 - newSeq(x.data, startSize) + newSeq(x.data, StartSize) proc newStrTable*: TStrTable = initStrTable(result) proc initTable(x: var TTable) = x.counter = 0 - newSeq(x.data, startSize) + newSeq(x.data, StartSize) proc initIdTable(x: var TIdTable) = x.counter = 0 - newSeq(x.data, startSize) + newSeq(x.data, StartSize) proc initObjectSet(x: var TObjectSet) = x.counter = 0 - newSeq(x.data, startSize) + newSeq(x.data, StartSize) proc initIdNodeTable(x: var TIdNodeTable) = x.counter = 0 - newSeq(x.data, startSize) + newSeq(x.data, StartSize) proc initNodeTable(x: var TNodeTable) = x.counter = 0 - newSeq(x.data, startSize) + newSeq(x.data, StartSize) proc sonsLen(n: PType): int = if isNil(n.sons): result = 0 @@ -1402,7 +1402,7 @@ proc isGenericRoutine*(s: PSym): bool = else: discard proc skipGenericOwner*(s: PSym): PSym = - InternalAssert s.kind in skProcKinds + internalAssert s.kind in skProcKinds ## Generic instantiations are owned by their originating generic ## symbol. This proc skips such owners and goes straigh to the owner ## of the generic itself (the module or the enclosing proc). diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 83218b31d3..35c306bcf7 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -472,7 +472,7 @@ proc objectSetRawInsert(data: var TObjectSeq, obj: PObject) = proc objectSetEnlarge(t: var TObjectSet) = var n: TObjectSeq - newSeq(n, len(t.data) * growthFactor) + newSeq(n, len(t.data) * GrowthFactor) for i in countup(0, high(t.data)): if t.data[i] != nil: objectSetRawInsert(n, t.data[i]) swap(t.data, n) @@ -535,7 +535,7 @@ proc tableRawInsert(data: var TPairSeq, key, val: PObject) = proc tableEnlarge(t: var TTable) = var n: TPairSeq - newSeq(n, len(t.data) * growthFactor) + newSeq(n, len(t.data) * GrowthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: tableRawInsert(n, t.data[i].key, t.data[i].val) swap(t.data, n) @@ -583,7 +583,7 @@ proc symTabReplace*(t: var TStrTable, prevSym: PSym, newSym: PSym) = proc strTableEnlarge(t: var TStrTable) = var n: TSymSeq - newSeq(n, len(t.data) * growthFactor) + newSeq(n, len(t.data) * GrowthFactor) for i in countup(0, high(t.data)): if t.data[i] != nil: strTableRawInsert(n, t.data[i]) swap(t.data, n) @@ -742,7 +742,7 @@ proc idTablePut(t: var TIdTable, key: PIdObj, val: PObject) = t.data[index].val = val else: if mustRehash(len(t.data), t.counter): - newSeq(n, len(t.data) * growthFactor) + newSeq(n, len(t.data) * GrowthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: idTableRawInsert(n, t.data[i].key, t.data[i].val) @@ -792,7 +792,7 @@ proc idNodeTablePut(t: var TIdNodeTable, key: PIdObj, val: PNode) = else: if mustRehash(len(t.data), t.counter): var n: TIdNodePairSeq - newSeq(n, len(t.data) * growthFactor) + newSeq(n, len(t.data) * GrowthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: idNodeTableRawInsert(n, t.data[i].key, t.data[i].val) @@ -810,8 +810,8 @@ iterator pairs*(t: TIdNodeTable): tuple[key: PIdObj, val: PNode] = proc initIITable(x: var TIITable) = x.counter = 0 - newSeq(x.data, startSize) - for i in countup(0, startSize - 1): x.data[i].key = InvalidKey + newSeq(x.data, StartSize) + for i in countup(0, StartSize - 1): x.data[i].key = InvalidKey proc iiTableRawGet(t: TIITable, key: int): int = var h: THash @@ -844,7 +844,7 @@ proc iiTablePut(t: var TIITable, key, val: int) = else: if mustRehash(len(t.data), t.counter): var n: TIIPairSeq - newSeq(n, len(t.data) * growthFactor) + newSeq(n, len(t.data) * GrowthFactor) for i in countup(0, high(n)): n[i].key = InvalidKey for i in countup(0, high(t.data)): if t.data[i].key != InvalidKey: diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index b10d306a7d..495c342ed1 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -11,7 +11,7 @@ # -------------------------- constant expressions ------------------------ -proc intLiteral(i: biggestInt): PRope = +proc intLiteral(i: BiggestInt): PRope = if (i > low(int32)) and (i <= high(int32)): result = toRope(i) elif i == low(int32): @@ -419,10 +419,10 @@ proc unaryExprChar(p: BProc, e: PNode, d: var TLoc, frmt: string) = proc binaryArithOverflow(p: BProc, e: PNode, d: var TLoc, m: TMagic) = const - prc: array[mAddi..mModi64, string] = ["addInt", "subInt", "mulInt", + prc: array[mAddI..mModI64, string] = ["addInt", "subInt", "mulInt", "divInt", "modInt", "addInt64", "subInt64", "mulInt64", "divInt64", "modInt64"] - opr: array[mAddi..mModi64, string] = ["+", "-", "*", "/", "%", "+", "-", + opr: array[mAddI..mModI64, string] = ["+", "-", "*", "/", "%", "+", "-", "*", "/", "%"] var a, b: TLoc assert(e.sons[1].typ != nil) @@ -1040,7 +1040,7 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = app(tmp2.r, field.loc.r) tmp2.k = locTemp tmp2.t = field.loc.t - tmp2.s = onHeap + tmp2.s = OnHeap tmp2.heapRoot = tmp.r expr(p, it.sons[1], tmp2) if d.k == locNone: @@ -1196,7 +1196,7 @@ proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) = of tyOpenArray, tyVarargs: if op == mHigh: unaryExpr(p, e, d, "($1Len0-1)") else: unaryExpr(p, e, d, "$1Len0") - of tyCstring: + of tyCString: if op == mHigh: unaryExpr(p, e, d, "(strlen($1)-1)") else: unaryExpr(p, e, d, "strlen($1)") of tyString, tySequence: @@ -1481,7 +1481,7 @@ proc genStrEquals(p: BProc, e: PNode, d: var TLoc) = binaryExpr(p, e, d, "#eqStrings($1, $2)") proc binaryFloatArith(p: BProc, e: PNode, d: var TLoc, m: TMagic) = - if {optNanCheck, optInfCheck} * p.options != {}: + if {optNaNCheck, optInfCheck} * p.options != {}: const opr: array[mAddF64..mDivF64, string] = ["+", "-", "*", "/"] var a, b: TLoc assert(e.sons[1].typ != nil) @@ -1491,7 +1491,7 @@ proc binaryFloatArith(p: BProc, e: PNode, d: var TLoc, m: TMagic) = putIntoDest(p, d, e.typ, rfmt(nil, "(($4)($2) $1 ($4)($3))", toRope(opr[m]), rdLoc(a), rdLoc(b), getSimpleTypeDesc(p.module, e[1].typ))) - if optNanCheck in p.options: + if optNaNCheck in p.options: linefmt(p, cpsStmts, "#nanCheck($1);$n", rdLoc(d)) if optInfCheck in p.options: linefmt(p, cpsStmts, "#infCheck($1);$n", rdLoc(d)) @@ -1507,7 +1507,7 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) = of mAddF64..mDivF64: binaryFloatArith(p, e, d, op) of mShrI..mXor: binaryArith(p, e, d, op) of mEqProc: genEqProc(p, e, d) - of mAddi..mModi64: binaryArithOverflow(p, e, d, op) + of mAddI..mModI64: binaryArithOverflow(p, e, d, op) of mRepr: genRepr(p, e, d) of mGetTypeInfo: genGetTypeInfo(p, e, d) of mSwap: genSwap(p, e, d) diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index eb738b5742..e9291edc56 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -920,7 +920,7 @@ proc genPragma(p: BProc, n: PNode) = case whichPragma(it) of wEmit: genEmit(p, it) of wBreakpoint: genBreakPoint(p, it) - of wWatchpoint: genWatchpoint(p, it) + of wWatchPoint: genWatchpoint(p, it) of wInjectStmt: var p = newProc(nil, p.module) p.options = p.options - {optLineTrace, optStackTrace} @@ -977,4 +977,4 @@ proc genAsgn(p: BProc, e: PNode, fastAsgn: bool) = proc genStmts(p: BProc, t: PNode) = var a: TLoc expr(p, t, a) - InternalAssert a.k in {locNone, locTemp, locLocalVar} + internalAssert a.k in {locNone, locTemp, locLocalVar} diff --git a/compiler/ccgtrav.nim b/compiler/ccgtrav.nim index 6de425cfd1..ecf1eb152e 100644 --- a/compiler/ccgtrav.nim +++ b/compiler/ccgtrav.nim @@ -111,7 +111,7 @@ proc genTraverseProc(m: BModule, typ: PType, reason: TTypeInfoReason): PRope = lineF(p, cpsInit, "a = ($1)p;$n", t) c.p = p - assert typ.kind != tyTypedesc + assert typ.kind != tyTypeDesc if typ.kind == tySequence: genTraverseProcSeq(c, "a".toRope, typ) else: diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 9d36290853..f1e824e14a 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -362,7 +362,7 @@ proc getSimpleTypeDesc(m: BModule, typ: PType): PRope = of tyString: discard cgsym(m, "NimStringDesc") result = typeNameOrLiteral(typ, "NimStringDesc*") - of tyCstring: result = typeNameOrLiteral(typ, "NCSTRING") + of tyCString: result = typeNameOrLiteral(typ, "NCSTRING") of tyBool: result = typeNameOrLiteral(typ, "NIM_BOOL") of tyChar: result = typeNameOrLiteral(typ, "NIM_CHAR") of tyNil: result = typeNameOrLiteral(typ, "0") @@ -559,7 +559,7 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope = if not isImportedType(t): appf(m.s[cfsForwardTypes], getForwardStructFormat(), [result]) idTablePut(m.forwTypeCache, t, result) - assert(CacheGetType(m.typeCache, t) == nil) + assert(cacheGetType(m.typeCache, t) == nil) idTablePut(m.typeCache, t, con(result, "*")) if not isImportedType(t): if skipTypes(t.sons[0], typedescInst).kind != tyEmpty: diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 97177a0ec3..97965def02 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -351,7 +351,7 @@ proc resetLoc(p: BProc, loc: var TLoc) = if not isComplexValueType(skipTypes(loc.t, abstractVarRange)): if containsGcRef: var nilLoc: TLoc - initLoc(nilLoc, locTemp, loc.t, onStack) + initLoc(nilLoc, locTemp, loc.t, OnStack) nilLoc.r = toRope("NIM_NIL") genRefAssign(p, loc, nilLoc, {afSrcIsNil}) else: @@ -665,7 +665,7 @@ proc symInDynamicLib(m: BModule, sym: PSym) = params, cstringLit(m, m.s[cfsDynLibInit], ropeToStr(extname))]) var last = lastSon(n) if last.kind == nkHiddenStdConv: last = last.sons[1] - InternalAssert(last.kind == nkStrLit) + internalAssert(last.kind == nkStrLit) let idx = last.strVal if idx.len == 0: app(m.initProc.s(cpsStmts), load) @@ -917,7 +917,7 @@ proc getCopyright(cfilenoext: string): PRope = "/* (c) 2012 Andreas Rumpf */$n" & "/* The generated code is subject to the original license. */$n", "; Generated by Nimrod Compiler v$1$n" & - "; (c) 2012 Andreas Rumpf$n", [toRope(versionAsString)]) + "; (c) 2012 Andreas Rumpf$n", [toRope(VersionAsString)]) else: result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & "/* (c) 2012 Andreas Rumpf */$n" & @@ -927,7 +927,7 @@ proc getCopyright(cfilenoext: string): PRope = "; Generated by Nimrod Compiler v$1$n" & "; (c) 2012 Andreas Rumpf$n" & "; Compiled for: $2, $3, $4$n" & - "; Command for LLVM compiler:$n $5$n", [toRope(versionAsString), + "; Command for LLVM compiler:$n $5$n", [toRope(VersionAsString), toRope(platform.OS[targetOS].name), toRope(platform.CPU[targetCPU].name), toRope(extccomp.CC[extccomp.ccompiler].name), @@ -992,8 +992,8 @@ proc genMainProc(m: BModule) = otherMain = WinCDllMain discard lists.IncludeStr(m.headerFiles, "<windows.h>") elif optGenDynLib in gGlobalOptions: - nimMain = posixNimDllMain - otherMain = posixCDllMain + nimMain = PosixNimDllMain + otherMain = PosixCDllMain elif platform.targetOS == osStandalone: nimMain = PosixNimMain otherMain = StandaloneCMain @@ -1202,7 +1202,7 @@ proc rawNewModule(module: PSym): BModule = proc newModule(module: PSym): BModule = # we should create only one cgen module for each module sym - InternalAssert getCgenModule(module) == nil + internalAssert getCgenModule(module) == nil result = rawNewModule(module) growCache gModules, module.position diff --git a/compiler/commands.nim b/compiler/commands.nim index acb9af8ac4..96fa34ae06 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -27,7 +27,7 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) # implementation const - HelpMessage = "Nimrod Compiler Version $1 (" & compileDate & ") [$2: $3]\n" & + HelpMessage = "Nimrod Compiler Version $1 (" & CompileDate & ") [$2: $3]\n" & "Copyright (c) 2004-2013 by Andreas Rumpf\n" const @@ -173,11 +173,11 @@ proc testCompileOption*(switch: string, info: TLineInfo): bool = of "linetrace": result = contains(gOptions, optLineTrace) of "debugger": result = contains(gOptions, optEndb) of "profiler": result = contains(gOptions, optProfiler) - of "checks", "x": result = gOptions * checksOptions == checksOptions + of "checks", "x": result = gOptions * ChecksOptions == ChecksOptions of "floatchecks": - result = gOptions * {optNanCheck, optInfCheck} == {optNanCheck, optInfCheck} + result = gOptions * {optNaNCheck, optInfCheck} == {optNaNCheck, optInfCheck} of "infchecks": result = contains(gOptions, optInfCheck) - of "nanchecks": result = contains(gOptions, optNanCheck) + of "nanchecks": result = contains(gOptions, optNaNCheck) of "objchecks": result = contains(gOptions, optObjCheck) of "fieldchecks": result = contains(gOptions, optFieldCheck) of "rangechecks": result = contains(gOptions, optRangeCheck) @@ -239,7 +239,7 @@ proc dynlibOverride(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = expectArg(switch, arg, pass, info) options.inclDynlibOverride(arg) -proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = +proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = var theOS: TSystemOS cpu: TSystemCPU @@ -335,11 +335,11 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = processOnOffSwitch({optProfiler}, arg, pass, info) if optProfiler in gOptions: defineSymbol("profiler") else: undefSymbol("profiler") - of "checks", "x": processOnOffSwitch(checksOptions, arg, pass, info) + of "checks", "x": processOnOffSwitch(ChecksOptions, arg, pass, info) of "floatchecks": - processOnOffSwitch({optNanCheck, optInfCheck}, arg, pass, info) + processOnOffSwitch({optNaNCheck, optInfCheck}, arg, pass, info) of "infchecks": processOnOffSwitch({optInfCheck}, arg, pass, info) - of "nanchecks": processOnOffSwitch({optNanCheck}, arg, pass, info) + of "nanchecks": processOnOffSwitch({optNaNCheck}, arg, pass, info) of "objchecks": processOnOffSwitch({optObjCheck}, arg, pass, info) of "fieldchecks": processOnOffSwitch({optFieldCheck}, arg, pass, info) of "rangechecks": processOnOffSwitch({optRangeCheck}, arg, pass, info) diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index 575cda412e..e74ab5853c 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -55,12 +55,12 @@ proc initDefines*() = of cpuAmd64: defineSymbol("x8664") else: discard case targetOS - of osDOS: + of osDos: defineSymbol("msdos") of osWindows: defineSymbol("mswindows") defineSymbol("win32") - of osLinux, osMorphOS, osSkyOS, osIrix, osPalmOS, osQNX, osAtari, osAix, + of osLinux, osMorphos, osSkyos, osIrix, osPalmos, osQnx, osAtari, osAix, osHaiku: # these are all 'unix-like' defineSymbol("unix") @@ -69,13 +69,13 @@ proc initDefines*() = defineSymbol("sunos") defineSymbol("unix") defineSymbol("posix") - of osNetBSD, osFreeBSD, osOpenBSD: + of osNetbsd, osFreebsd, osOpenbsd: defineSymbol("unix") defineSymbol("bsd") defineSymbol("posix") - of osMacOS: + of osMacos: defineSymbol("macintosh") - of osMacOSX: + of osMacosx: defineSymbol("macintosh") defineSymbol("unix") defineSymbol("posix") diff --git a/compiler/crc.nim b/compiler/crc.nim index 3291ce7c09..ae1df3ff12 100644 --- a/compiler/crc.nim +++ b/compiler/crc.nim @@ -78,7 +78,7 @@ proc updateCrc32(val: int8, crc: TCrc32): TCrc32 = result = TCrc32(crc32table[(int(crc) xor (int(val) and 0x000000FF)) and 0x000000FF]) xor (crc shr TCrc32(8)) -proc updateCrc32(val: Char, crc: TCrc32): TCrc32 = +proc updateCrc32(val: char, crc: TCrc32): TCrc32 = result = updateCrc32(toU8(ord(val)), crc) proc strCrc32(s: string): TCrc32 = @@ -93,7 +93,7 @@ type TByteArray = array[0..10000000, int8] PByteArray = ref TByteArray -proc crcFromBuf(buf: Pointer, length: int): TCrc32 = +proc crcFromBuf(buf: pointer, length: int): TCrc32 = var p = cast[PByteArray](buf) result = InitCrc32 for i in countup(0, length - 1): result = updateCrc32(p[i], result) @@ -106,7 +106,7 @@ proc crcFromFile(filename: string): TCrc32 = result = InitCrc32 if not open(bin, filename): return # not equal if file does not exist - var buf = alloc(BufSize) + var buf = alloc(bufSize) var p = cast[PByteArray](buf) while true: var readBytes = readBuffer(bin, buf, bufSize) diff --git a/compiler/docgen.nim b/compiler/docgen.nim index b38f530158..031b7d429b 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -44,19 +44,19 @@ proc compilerMsgHandler(filename: string, line, col: int, proc parseRst(text, filename: string, line, column: int, hasToc: var bool, - rstOptions: TRstParseOptions): PRSTNode = + rstOptions: TRstParseOptions): PRstNode = result = rstParse(text, filename, line, column, hasToc, rstOptions, options.FindFile, compilerMsgHandler) proc newDocumentor*(filename: string, config: PStringTable): PDoc = new(result) - initRstGenerator(result[], (if gCmd != cmdRst2Tex: outHtml else: outLatex), + initRstGenerator(result[], (if gCmd != cmdRst2tex: outHtml else: outLatex), options.gConfigVars, filename, {roSupportRawDirective}, options.FindFile, compilerMsgHandler) result.id = 100 proc dispA(dest: var PRope, xml, tex: string, args: openArray[PRope]) = - if gCmd != cmdRst2Tex: appf(dest, xml, args) + if gCmd != cmdRst2tex: appf(dest, xml, args) else: appf(dest, tex, args) proc getVarIdx(varnames: openArray[string], id: string): int = @@ -186,7 +186,7 @@ proc getName(d: PDoc, n: PNode, splitAfter = -1): string = internalError(n.info, "getName()") result = "" -proc getRstName(n: PNode): PRSTNode = +proc getRstName(n: PNode): PRstNode = case n.kind of nkPostfix: result = getRstName(n.sons[1]) of nkPragmaExpr: result = getRstName(n.sons[0]) @@ -408,7 +408,7 @@ proc genOutFile(d: PDoc): PRope = proc generateIndex*(d: PDoc) = if optGenIndex in gGlobalOptions: writeIndexFile(d[], splitFile(options.outFile).dir / - splitFile(d.filename).name & indexExt) + splitFile(d.filename).name & IndexExt) proc writeOutput*(d: PDoc, filename, outExt: string, useWarning = false) = var content = genOutFile(d) diff --git a/compiler/evaltempl.nim b/compiler/evaltempl.nim index 14202dbcae..78cdbb45fd 100644 --- a/compiler/evaltempl.nim +++ b/compiler/evaltempl.nim @@ -36,7 +36,7 @@ proc evalTemplateAux(templ, actual: PNode, c: var TemplCtx, result: PNode) = else: result.add copyTree(x) else: - InternalAssert sfGenSym in s.flags + internalAssert sfGenSym in s.flags var x = PSym(idTableGet(c.mapping, s)) if x == nil: x = copySym(s, false) diff --git a/compiler/filters.nim b/compiler/filters.nim index db8731d8ca..ce0ffd196c 100644 --- a/compiler/filters.nim +++ b/compiler/filters.nim @@ -35,7 +35,7 @@ proc getArg(n: PNode, name: string, pos: int): PNode = elif i == pos: return n.sons[i] -proc charArg(n: PNode, name: string, pos: int, default: Char): Char = +proc charArg(n: PNode, name: string, pos: int, default: char): char = var x = getArg(n, name, pos) if x == nil: result = default elif x.kind == nkCharLit: result = chr(int(x.intVal)) diff --git a/compiler/guards.nim b/compiler/guards.nim index b35d9b8720..3d27c85c9d 100644 --- a/compiler/guards.nim +++ b/compiler/guards.nim @@ -254,7 +254,7 @@ proc valuesUnequal(a, b: PNode): bool = result = not sameValue(a, b) proc pred(n: PNode): PNode = - if n.kind in {nkCharLit..nkUInt64Lit} and n.intVal != low(biggestInt): + if n.kind in {nkCharLit..nkUInt64Lit} and n.intVal != low(BiggestInt): result = copyNode(n) dec result.intVal else: @@ -366,7 +366,7 @@ proc impliesIsNil(fact, eq: PNode): TImplication = else: discard proc impliesGe(fact, x, c: PNode): TImplication = - InternalAssert isLocation(x) + internalAssert isLocation(x) case fact.sons[0].sym.magic of someEq: if sameTree(fact.sons[1], x): diff --git a/compiler/hlo.nim b/compiler/hlo.nim index 7905761dd8..e3f80ad36d 100644 --- a/compiler/hlo.nim +++ b/compiler/hlo.nim @@ -12,7 +12,7 @@ proc hlo(c: PContext, n: PNode): PNode proc evalPattern(c: PContext, n, orig: PNode): PNode = - InternalAssert n.kind == nkCall and n.sons[0].kind == nkSym + internalAssert n.kind == nkCall and n.sons[0].kind == nkSym # we need to ensure that the resulting AST is semchecked. However, it's # aweful to semcheck before macro invocation, so we don't and treat # templates and macros as immediate in this context. diff --git a/compiler/idgen.nim b/compiler/idgen.nim index 5a1c909305..c4f5f2a9ee 100644 --- a/compiler/idgen.nim +++ b/compiler/idgen.nim @@ -22,7 +22,7 @@ when debugIds: var usedIds = InitIntSet() proc registerID*(id: PIdObj) = - when debugIDs: + when debugIds: if id.id == -1 or containsOrIncl(usedIds, id.id): internalError("ID already used: " & $id.id) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 8fd72623ae..1ba40f95d8 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -111,7 +111,7 @@ proc mapType(typ: PType): TJSTypeKind = let t = skipTypes(typ, abstractInst) case t.kind of tyVar, tyRef, tyPtr: - if skipTypes(t.sons[0], abstractInst).kind in mappedToObject: + if skipTypes(t.sons[0], abstractInst).kind in MappedToObject: result = etyObject else: result = etyBaseIndex @@ -240,7 +240,7 @@ proc genOr(p: PProc, a, b: PNode, r: var TCompRes) = type TMagicFrmt = array[0..3, string] - TMagicOps = array[mAddi..mStrToStr, TMagicFrmt] + TMagicOps = array[mAddI..mStrToStr, TMagicFrmt] const # magic checked op; magic unchecked op; checked op; unchecked op jsOps: TMagicOps = [ @@ -865,7 +865,7 @@ proc genFieldAddr(p: PProc, n: PNode, r: var TCompRes) = var f = b.sons[1].sym if f.loc.r == nil: f.loc.r = mangleName(f) r.res = makeJSString(ropeToStr(f.loc.r)) - InternalAssert a.typ != etyBaseIndex + internalAssert a.typ != etyBaseIndex r.address = a.res r.kind = resExpr @@ -894,7 +894,7 @@ proc genArrayAddr(p: PProc, n: PNode, r: var TCompRes) = r.typ = etyBaseIndex gen(p, n.sons[0], a) gen(p, n.sons[1], b) - InternalAssert a.typ != etyBaseIndex and b.typ != etyBaseIndex + internalAssert a.typ != etyBaseIndex and b.typ != etyBaseIndex r.address = a.res var typ = skipTypes(n.sons[0].typ, abstractPtrs) if typ.kind in {tyArray, tyArrayConstr}: first = firstOrd(typ.sons[0]) @@ -1293,7 +1293,7 @@ proc genMagic(p: PProc, n: PNode, r: var TCompRes) = case op of mOr: genOr(p, n.sons[1], n.sons[2], r) of mAnd: genAnd(p, n.sons[1], n.sons[2], r) - of mAddi..mStrToStr: arith(p, n, r, op) + of mAddI..mStrToStr: arith(p, n, r, op) of mRepr: genRepr(p, n, r) of mSwap: genSwap(p, n) of mUnaryLt: @@ -1416,7 +1416,7 @@ proc genObjConstr(p: PProc, n: PNode, r: var TCompRes) = for i in countup(1, sonsLen(n) - 1): if i > 0: app(r.res, ", ") var it = n.sons[i] - InternalAssert it.kind == nkExprColonExpr + internalAssert it.kind == nkExprColonExpr gen(p, it.sons[1], a) var f = it.sons[0].sym if f.loc.r == nil: f.loc.r = mangleName(f) @@ -1655,7 +1655,7 @@ proc genHeader(): PRope = "$nvar Globals = this;$n" & "var framePtr = null;$n" & "var excHandler = null;$n", - [toRope(versionAsString)]) + [toRope(VersionAsString)]) proc genModule(p: PProc, n: PNode) = if optStackTrace in p.options: diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 558b2cfd39..9e42210c0d 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -226,7 +226,7 @@ proc isInnerProc(s, outerProc: PSym): bool {.inline.} = #s.typ.callConv == ccClosure proc addClosureParam(i: PInnerContext, e: PEnv) = - var cp = newSym(skParam, getIdent(paramname), i.fn, i.fn.info) + var cp = newSym(skParam, getIdent(paramName), i.fn, i.fn.info) incl(cp.flags, sfFromGeneric) cp.typ = newType(tyRef, i.fn) rawAddSon(cp.typ, e.tup) @@ -679,7 +679,7 @@ proc liftIterator*(iter: PSym, body: PNode): PNode = c.tup = newType(tyTuple, iter) c.tup.n = newNodeI(nkRecList, iter.info) - var cp = newSym(skParam, getIdent(paramname), iter, iter.info) + var cp = newSym(skParam, getIdent(paramName), iter, iter.info) incl(cp.flags, sfFromGeneric) cp.typ = newType(tyRef, iter) rawAddSon(cp.typ, c.tup) @@ -758,7 +758,7 @@ proc liftForLoop*(body: PNode): PNode = ... """ var L = body.len - InternalAssert body.kind == nkForStmt and body[L-2].kind in nkCallKinds + internalAssert body.kind == nkForStmt and body[L-2].kind in nkCallKinds var call = body[L-2] result = newNodeI(nkStmtList, body.info) diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 17c9719121..a258765cf9 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -581,7 +581,7 @@ proc getCharacter(L: var TLexer, tok: var TToken) = inc(L.bufpos) # skip ' var c = L.buf[L.bufpos] case c - of '\0'..Pred(' '), '\'': lexMessage(L, errInvalidCharacterConstant) + of '\0'..pred(' '), '\'': lexMessage(L, errInvalidCharacterConstant) of '\\': getEscapedChar(L, tok) else: tok.literal = $c diff --git a/compiler/llstream.nim b/compiler/llstream.nim index 6eac08dbd3..510880ffd1 100644 --- a/compiler/llstream.nim +++ b/compiler/llstream.nim @@ -50,7 +50,7 @@ proc llStreamOpen(data: string): PLLStream = result.s = data result.kind = llsString -proc llStreamOpen(f: var tfile): PLLStream = +proc llStreamOpen(f: var TFile): PLLStream = new(result) result.f = f result.kind = llsFile @@ -179,7 +179,7 @@ proc llStreamWriteln(s: PLLStream, data: string) = llStreamWrite(s, data) llStreamWrite(s, "\n") -proc llStreamWrite(s: PLLStream, data: Char) = +proc llStreamWrite(s: PLLStream, data: char) = var c: char case s.kind of llsNone, llsStdIn: diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim index f81347faea..281c642b70 100644 --- a/compiler/magicsys.nim +++ b/compiler/magicsys.nim @@ -79,7 +79,7 @@ proc getSysType(kind: TTypeKind): PType = of tyBool: result = sysTypeFromName("bool") of tyChar: result = sysTypeFromName("char") of tyString: result = sysTypeFromName("string") - of tyCstring: result = sysTypeFromName("cstring") + of tyCString: result = sysTypeFromName("cstring") of tyPointer: result = sysTypeFromName("pointer") of tyNil: result = newSysType(tyNil, ptrSize) else: internalError("request for typekind: " & $kind) diff --git a/compiler/main.nim b/compiler/main.nim index 275d657815..3571e6a4ee 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -39,7 +39,7 @@ proc semanticPasses = proc commandGenDepend = semanticPasses() - registerPass(genDependPass) + registerPass(gendependPass) registerPass(cleanupPass) compileProject() generateDot(gProjectFull) @@ -127,7 +127,7 @@ proc commandCompileToJS = defineSymbol("ecmascript") # For backward compatibility defineSymbol("js") semanticPasses() - registerPass(jsgenPass) + registerPass(JSgenPass) compileProject() proc interactivePasses = @@ -177,7 +177,7 @@ proc commandPretty = pretty.overwriteFiles() proc commandScan = - var f = addFileExt(mainCommandArg(), nimExt) + var f = addFileExt(mainCommandArg(), NimExt) var stream = llStreamOpen(f, fmRead) if stream != nil: var @@ -224,7 +224,7 @@ proc wantMainModule = gProjectName = optMainModule gProjectFull = gProjectPath / gProjectName - gProjectMainIdx = addFileExt(gProjectFull, nimExt).fileInfoIdx + gProjectMainIdx = addFileExt(gProjectFull, NimExt).fileInfoIdx proc requireMainModuleOption = if optMainModule.len == 0: @@ -233,7 +233,7 @@ proc requireMainModuleOption = gProjectName = optMainModule gProjectFull = gProjectPath / gProjectName - gProjectMainIdx = addFileExt(gProjectFull, nimExt).fileInfoIdx + gProjectMainIdx = addFileExt(gProjectFull, NimExt).fileInfoIdx proc resetMemory = resetCompilationLists() @@ -334,7 +334,7 @@ proc mainCommand* = of "compiletollvm": gCmd = cmdCompileToLLVM wantMainModule() - when has_LLVM_Backend: + when hasLLVM_Backend: CommandCompileToLLVM() else: rawMessage(errInvalidCommandX, command) @@ -386,7 +386,7 @@ proc mainCommand* = for s in definedSymbolNames(): definedSymbols.elems.add(%s) var libpaths = newJArray() - for dir in itersearchpath(searchPaths): libpaths.elems.add(%dir) + for dir in iterSearchPath(searchPaths): libpaths.elems.add(%dir) var dumpdata = % [ (key: "version", val: %VersionAsString), diff --git a/compiler/modules.nim b/compiler/modules.nim index e1fc1ad958..1775599a91 100644 --- a/compiler/modules.nim +++ b/compiler/modules.nim @@ -41,7 +41,7 @@ template crc(x: PSym): expr = gMemCacheData[x.position].crc proc crcChanged(fileIdx: int32): bool = - InternalAssert fileIdx >= 0 and fileIdx < gMemCacheData.len + internalAssert fileIdx >= 0 and fileIdx < gMemCacheData.len template updateStatus = gMemCacheData[fileIdx].crcStatus = if result: crcHasChanged diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 7e851d1b2f..cdfbc3ece1 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -724,7 +724,7 @@ proc writeContext(lastinfo: TLineInfo) = var info = lastinfo for i in countup(0, len(msgContext) - 1): if msgContext[i] != lastinfo and msgContext[i] != info: - msgWriteln(posContextFormat % [toMsgFilename(msgContext[i]), + msgWriteln(PosContextFormat % [toMsgFilename(msgContext[i]), coordToStr(msgContext[i].line), coordToStr(msgContext[i].col), getMessageStr(errInstantiationFrom, "")]) @@ -735,17 +735,17 @@ proc rawMessage*(msg: TMsgKind, args: openArray[string]) = case msg of errMin..errMax: writeContext(unknownLineInfo()) - frmt = rawErrorFormat + frmt = RawErrorFormat of warnMin..warnMax: if optWarns notin gOptions: return if msg notin gNotes: return writeContext(unknownLineInfo()) - frmt = rawWarningFormat + frmt = RawWarningFormat inc(gWarnCounter) of hintMin..hintMax: if optHints notin gOptions: return if msg notin gNotes: return - frmt = rawHintFormat + frmt = RawHintFormat inc(gHintCounter) let s = `%`(frmt, `%`(msgKindToString(msg), args)) msgWriteln(s) @@ -766,7 +766,7 @@ proc liMessage(info: TLineInfo, msg: TMsgKind, arg: string, case msg of errMin..errMax: writeContext(info) - frmt = posErrorFormat + frmt = PosErrorFormat # we try to filter error messages so that not two error message # in the same file and line are produced: #ignoreMsg = lastError == info and eh != doAbort @@ -774,11 +774,11 @@ proc liMessage(info: TLineInfo, msg: TMsgKind, arg: string, of warnMin..warnMax: ignoreMsg = optWarns notin gOptions or msg notin gNotes if not ignoreMsg: writeContext(info) - frmt = posWarningFormat + frmt = PosWarningFormat inc(gWarnCounter) of hintMin..hintMax: ignoreMsg = optHints notin gOptions or msg notin gNotes - frmt = posHintFormat + frmt = PosHintFormat inc(gHintCounter) let s = frmt % [toMsgFilename(info), coordToStr(info.line), coordToStr(info.col), getMessageStr(msg, arg)] diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index 50f24043be..fee96a54a1 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -81,7 +81,7 @@ proc doElif(L: var TLexer, tok: var TToken) = proc jumpToDirective(L: var TLexer, tok: var TToken, dest: TJumpDest) = var nestedIfs = 0 - while True: + while true: if (tok.ident != nil) and (tok.ident.s == "@"): ppGetTok(L, tok) case whichKeyword(tok.ident) diff --git a/compiler/nimlexbase.nim b/compiler/nimlexbase.nim index 1dcb927cee..e6dcd8ce74 100644 --- a/compiler/nimlexbase.nim +++ b/compiler/nimlexbase.nim @@ -107,7 +107,7 @@ proc fillBuffer(L: var TBaseLexer) = oldBufLen = L.BufLen L.bufLen = L.BufLen * 2 L.buf = cast[cstring](realloc(L.buf, L.bufLen * chrSize)) - assert(L.bufLen - oldBuflen == oldBufLen) + assert(L.bufLen - oldBufLen == oldBufLen) charsRead = llStreamRead(L.stream, addr(L.buf[oldBufLen]), oldBufLen * chrSize) div chrSize if charsRead < oldBufLen: diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim index c4c4f887c6..60124e3350 100644 --- a/compiler/nimrod.nim +++ b/compiler/nimrod.nim @@ -71,7 +71,7 @@ proc handleCmdLine() = binPath = options.outFile.prependCurDir else: # Figure out ourselves a valid binary name. - binPath = changeFileExt(gProjectFull, exeExt).prependCurDir + binPath = changeFileExt(gProjectFull, ExeExt).prependCurDir var ex = quoteShell(binPath) execExternalProgram(ex & ' ' & service.arguments) diff --git a/compiler/nimsets.nim b/compiler/nimsets.nim index 8e5de4194a..f24d3a3560 100644 --- a/compiler/nimsets.nim +++ b/compiler/nimsets.nim @@ -98,13 +98,13 @@ proc toTreeSet(s: TBitSet, settype: PType, info: TLineInfo): PNode = result.typ = settype result.info = info e = 0 - while e < len(s) * elemSize: + while e < len(s) * ElemSize: if bitSetIn(s, e): a = e b = e while true: inc(b) - if (b >= len(s) * elemSize) or not bitSetIn(s, b): break + if (b >= len(s) * ElemSize) or not bitSetIn(s, b): break dec(b) if a == b: addSon(result, newIntTypeNode(nkIntLit, a + first, elemType)) diff --git a/compiler/options.nim b/compiler/options.nim index ae62af1c5d..640f70f28c 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -192,16 +192,16 @@ proc canonicalizePath*(path: string): string = proc shortenDir*(dir: string): string = ## returns the interesting part of a dir - var prefix = getPrefixDir() & dirSep + var prefix = getPrefixDir() & DirSep if startsWith(dir, prefix): return substr(dir, len(prefix)) - prefix = gProjectPath & dirSep + prefix = gProjectPath & DirSep if startsWith(dir, prefix): return substr(dir, len(prefix)) result = dir proc removeTrailingDirSep*(path: string): string = - if (len(path) > 0) and (path[len(path) - 1] == dirSep): + if (len(path) > 0) and (path[len(path) - 1] == DirSep): result = substr(path, 0, len(path) - 2) else: result = path @@ -213,9 +213,9 @@ proc getGeneratedPath: string = proc getPackageName*(path: string): string = var q = 1 var b = 0 - if path[len(path)-1] in {dirsep, altsep}: q = 2 + if path[len(path)-1] in {DirSep, AltSep}: q = 2 for i in countdown(len(path)-q, 0): - if path[i] in {dirsep, altsep}: + if path[i] in {DirSep, AltSep}: if b == 0: b = i else: let x = path.substr(i+1, b-1) @@ -288,7 +288,7 @@ proc findFile*(f: string): string {.procvar.} = proc findModule*(modulename, currentModule: string): string = # returns path to module - let m = addFileExt(modulename, nimExt) + let m = addFileExt(modulename, NimExt) let currentPath = currentModule.splitFile.dir result = currentPath / m if not existsFile(result): diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim index 91c230ccb3..be0f995b6d 100644 --- a/compiler/parampatterns.nim +++ b/compiler/parampatterns.nim @@ -97,14 +97,14 @@ proc compileConstraints(p: PNode, result: var TPatternCode) = of "nosideeffect": result.add(ppNoSideEffect) else: # check all symkinds: - InternalAssert int(high(TSymKind)) < 255 + internalAssert int(high(TSymKind)) < 255 for i in low(TSymKind)..high(TSymKind): if cmpIgnoreStyle(($i).substr(2), spec) == 0: result.add(ppSymKind) result.add(chr(i.ord)) return # check all nodekinds: - InternalAssert int(high(TNodeKind)) < 255 + internalAssert int(high(TNodeKind)) < 255 for i in low(TNodeKind)..high(TNodeKind): if cmpIgnoreStyle($i, spec) == 0: result.add(ppNodeKind) @@ -124,7 +124,7 @@ proc semNodeKindConstraints*(p: PNode): PNode = if p.len >= 2: for i in 1.. <p.len: compileConstraints(p.sons[i], result.strVal) - if result.strVal.len > maxStackSize-1: + if result.strVal.len > MaxStackSize-1: internalError(p.info, "parameter pattern too complex") else: patternError(p) @@ -221,7 +221,7 @@ proc isAssignable*(owner: PSym, n: PNode): TAssignableResult = proc matchNodeKinds*(p, n: PNode): bool = # matches the parameter constraint 'p' against the concrete AST 'n'. # Efficiency matters here. - var stack {.noinit.}: array[0..maxStackSize, bool] + var stack {.noinit.}: array[0..MaxStackSize, bool] # empty patterns are true: stack[0] = true var sp = 1 diff --git a/compiler/parser.nim b/compiler/parser.nim index 47e8e9a543..49fdd57038 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -211,7 +211,7 @@ proc getPrecedence(tok: TToken): int = of '?': result = 2 else: considerAsgn(2) of tkDiv, tkMod, tkShl, tkShr: result = 9 - of tkIn, tkNotIn, tkIs, tkIsNot, tkNot, tkOf, tkAs: result = 5 + of tkIn, tkNotin, tkIs, tkIsnot, tkNot, tkOf, tkAs: result = 5 of tkDotDot: result = 6 of tkAnd: result = 4 of tkOr, tkXor: result = 3 @@ -455,7 +455,7 @@ proc simpleExpr(p: var TParser, mode = pmNormal): PNode proc semiStmtList(p: var TParser, result: PNode) = result.add(complexOrSimpleStmt(p)) - while p.tok.tokType == tkSemicolon: + while p.tok.tokType == tkSemiColon: getTok(p) optInd(p, result) result.add(complexOrSimpleStmt(p)) @@ -482,7 +482,7 @@ proc parsePar(p: var TParser): PNode = # XXX 'bind' used to be an expression, so we exclude it here; # tests/reject/tbind2 fails otherwise. semiStmtList(p, result) - elif p.tok.tokType == tkSemicolon: + elif p.tok.tokType == tkSemiColon: # '(;' enforces 'stmt' context: getTok(p) optInd(p, result) @@ -498,7 +498,7 @@ proc parsePar(p: var TParser): PNode = asgn.sons[0] = a asgn.sons[1] = b result.add(asgn) - elif p.tok.tokType == tkSemicolon: + elif p.tok.tokType == tkSemiColon: # stmt context: result.add(a) semiStmtList(p, result) @@ -798,7 +798,7 @@ proc parseTuple(p: var TParser, indentAllowed = false): PNode = while p.tok.tokType in {tkSymbol, tkAccent}: var a = parseIdentColonEquals(p, {}) addSon(result, a) - if p.tok.tokType notin {tkComma, tkSemicolon}: break + if p.tok.tokType notin {tkComma, tkSemiColon}: break getTok(p) skipComment(p, a) optPar(p) @@ -840,7 +840,7 @@ proc parseParamList(p: var TParser, retColon = true): PNode = parMessage(p, errTokenExpected, ")") break addSon(result, a) - if p.tok.tokType notin {tkComma, tkSemicolon}: break + if p.tok.tokType notin {tkComma, tkSemiColon}: break getTok(p) skipComment(p, a) optPar(p) @@ -1378,7 +1378,7 @@ proc parseGenericParamList(p: var TParser): PNode = while p.tok.tokType in {tkSymbol, tkAccent}: var a = parseGenericParam(p) addSon(result, a) - if p.tok.tokType notin {tkComma, tkSemicolon}: break + if p.tok.tokType notin {tkComma, tkSemiColon}: break getTok(p) skipComment(p, a) optPar(p) @@ -1810,7 +1810,7 @@ proc parseStmt(p: var TParser): PNode = while true: if p.tok.indent == p.currInd: nil - elif p.tok.tokType == tkSemicolon: + elif p.tok.tokType == tkSemiColon: getTok(p) if p.tok.indent < 0 or p.tok.indent == p.currInd: discard else: break @@ -1842,7 +1842,7 @@ proc parseStmt(p: var TParser): PNode = let a = simpleStmt(p) if a.kind == nkEmpty: parMessage(p, errExprExpected, p.tok) result.add(a) - if p.tok.tokType != tkSemicolon: break + if p.tok.tokType != tkSemiColon: break getTok(p) proc parseAll(p: var TParser): PNode = @@ -1866,7 +1866,7 @@ proc parseTopLevelStmt(p: var TParser): PNode = else: parMessage(p, errInvalidIndentation) p.firstTok = false case p.tok.tokType - of tkSemicolon: + of tkSemiColon: getTok(p) if p.tok.indent <= 0: discard else: parMessage(p, errInvalidIndentation) diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 5c9247fedc..b313e49f54 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -20,49 +20,49 @@ const const procPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl, - wMagic, wNosideEffect, wSideEffect, wNoreturn, wDynLib, wHeader, - wCompilerProc, wProcVar, wDeprecated, wVarargs, wCompileTime, wMerge, + wMagic, wNosideeffect, wSideeffect, wNoreturn, wDynlib, wHeader, + wCompilerproc, wProcVar, wDeprecated, wVarargs, wCompileTime, wMerge, wBorrow, wExtern, wImportCompilerProc, wThread, wImportCpp, wImportObjC, wNoStackFrame, wError, wDiscardable, wNoInit, wDestructor, wCodegenDecl, - wGenSym, wInject, wRaises, wTags, wOperator, wDelegator} + wGensym, wInject, wRaises, wTags, wOperator, wDelegator} converterPragmas* = procPragmas methodPragmas* = procPragmas - templatePragmas* = {wImmediate, wDeprecated, wError, wGenSym, wInject, wDirty, + templatePragmas* = {wImmediate, wDeprecated, wError, wGensym, wInject, wDirty, wDelegator} macroPragmas* = {FirstCallConv..LastCallConv, wImmediate, wImportc, wExportc, - wNodecl, wMagic, wNosideEffect, wCompilerProc, wDeprecated, wExtern, - wImportcpp, wImportobjc, wError, wDiscardable, wGenSym, wInject, wDelegator} - iteratorPragmas* = {FirstCallConv..LastCallConv, wNosideEffect, wSideEffect, + wNodecl, wMagic, wNosideeffect, wCompilerproc, wDeprecated, wExtern, + wImportCpp, wImportObjC, wError, wDiscardable, wGensym, wInject, wDelegator} + iteratorPragmas* = {FirstCallConv..LastCallConv, wNosideeffect, wSideeffect, wImportc, wExportc, wNodecl, wMagic, wDeprecated, wBorrow, wExtern, - wImportcpp, wImportobjc, wError, wDiscardable, wGenSym, wInject, wRaises, + wImportCpp, wImportObjC, wError, wDiscardable, wGensym, wInject, wRaises, wTags, wOperator} exprPragmas* = {wLine} stmtPragmas* = {wChecks, wObjChecks, wFieldChecks, wRangechecks, wBoundchecks, wOverflowchecks, wNilchecks, wAssertions, wWarnings, wHints, wLinedir, wStacktrace, wLinetrace, wOptimization, wHint, wWarning, wError, - wFatal, wDefine, wUndef, wCompile, wLink, wLinkSys, wPure, wPush, wPop, - wBreakpoint, wWatchpoint, wPassL, wPassC, wDeadCodeElim, wDeprecated, - wFloatChecks, wInfChecks, wNanChecks, wPragma, wEmit, wUnroll, + wFatal, wDefine, wUndef, wCompile, wLink, wLinksys, wPure, wPush, wPop, + wBreakpoint, wWatchPoint, wPassl, wPassc, wDeadCodeElim, wDeprecated, + wFloatchecks, wInfChecks, wNanChecks, wPragma, wEmit, wUnroll, wLinearScanEnd, wPatterns, wEffects, wNoForward, wComputedGoto, wInjectStmt} lambdaPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl, - wNosideEffect, wSideEffect, wNoreturn, wDynLib, wHeader, - wDeprecated, wExtern, wThread, wImportcpp, wImportobjc, wNoStackFrame, + wNosideeffect, wSideeffect, wNoreturn, wDynlib, wHeader, + wDeprecated, wExtern, wThread, wImportCpp, wImportObjC, wNoStackFrame, wRaises, wTags} typePragmas* = {wImportc, wExportc, wDeprecated, wMagic, wAcyclic, wNodecl, - wPure, wHeader, wCompilerProc, wFinal, wSize, wExtern, wShallow, - wImportcpp, wImportobjc, wError, wIncompleteStruct, wByCopy, wByRef, - wInheritable, wGenSym, wInject, wRequiresInit} + wPure, wHeader, wCompilerproc, wFinal, wSize, wExtern, wShallow, + wImportCpp, wImportObjC, wError, wIncompleteStruct, wByCopy, wByRef, + wInheritable, wGensym, wInject, wRequiresInit} fieldPragmas* = {wImportc, wExportc, wDeprecated, wExtern, - wImportcpp, wImportobjc, wError} + wImportCpp, wImportObjC, wError} varPragmas* = {wImportc, wExportc, wVolatile, wRegister, wThreadVar, wNodecl, - wMagic, wHeader, wDeprecated, wCompilerProc, wDynLib, wExtern, - wImportcpp, wImportobjc, wError, wNoInit, wCompileTime, wGlobal, - wGenSym, wInject, wCodegenDecl} + wMagic, wHeader, wDeprecated, wCompilerproc, wDynlib, wExtern, + wImportCpp, wImportObjC, wError, wNoInit, wCompileTime, wGlobal, + wGensym, wInject, wCodegenDecl} constPragmas* = {wImportc, wExportc, wHeader, wDeprecated, wMagic, wNodecl, - wExtern, wImportcpp, wImportobjc, wError, wGenSym, wInject} + wExtern, wImportCpp, wImportObjC, wError, wGensym, wInject} letPragmas* = varPragmas - procTypePragmas* = {FirstCallConv..LastCallConv, wVarargs, wNosideEffect, + procTypePragmas* = {FirstCallConv..LastCallConv, wVarargs, wNosideeffect, wThread, wRaises, wTags} allRoutinePragmas* = procPragmas + iteratorPragmas + lambdaPragmas @@ -199,7 +199,7 @@ proc processCallConv(c: PContext, n: PNode) = if (n.kind == nkExprColonExpr) and (n.sons[1].kind == nkIdent): var sw = whichKeyword(n.sons[1].ident) case sw - of firstCallConv..lastCallConv: + of FirstCallConv..LastCallConv: POptionEntry(c.optionStack.tail).defaultCC = wordToCallConv(sw) else: localError(n.info, errCallConvExpected) else: @@ -247,7 +247,7 @@ proc processDynLib(c: PContext, n: PNode, sym: PSym) = # since we'll be loading the dynlib symbols dynamically, we must use # a calling convention that doesn't introduce custom name mangling # cdecl is the default - the user can override this explicitly - if sym.kind in RoutineKinds and sym.typ != nil and + if sym.kind in routineKinds and sym.typ != nil and sym.typ.callConv == ccDefault: sym.typ.callConv = ccCDecl @@ -284,27 +284,27 @@ proc processOption(c: PContext, n: PNode): bool = else: var sw = whichKeyword(n.sons[0].ident) case sw - of wChecks: onOff(c, n, checksOptions) + of wChecks: onOff(c, n, ChecksOptions) of wObjChecks: onOff(c, n, {optObjCheck}) - of wFieldchecks: onOff(c, n, {optFieldCheck}) + of wFieldChecks: onOff(c, n, {optFieldCheck}) of wRangechecks: onOff(c, n, {optRangeCheck}) of wBoundchecks: onOff(c, n, {optBoundsCheck}) of wOverflowchecks: onOff(c, n, {optOverflowCheck}) of wNilchecks: onOff(c, n, {optNilCheck}) - of wFloatChecks: onOff(c, n, {optNanCheck, optInfCheck}) - of wNaNchecks: onOff(c, n, {optNanCheck}) + of wFloatchecks: onOff(c, n, {optNaNCheck, optInfCheck}) + of wNanChecks: onOff(c, n, {optNaNCheck}) of wInfChecks: onOff(c, n, {optInfCheck}) of wAssertions: onOff(c, n, {optAssert}) of wWarnings: onOff(c, n, {optWarns}) of wHints: onOff(c, n, {optHints}) - of wCallConv: processCallConv(c, n) + of wCallconv: processCallConv(c, n) of wLinedir: onOff(c, n, {optLineDir}) of wStacktrace: onOff(c, n, {optStackTrace}) of wLinetrace: onOff(c, n, {optLineTrace}) of wDebugger: onOff(c, n, {optEndb}) of wProfiler: onOff(c, n, {optProfiler}) of wByRef: onOff(c, n, {optByRef}) - of wDynLib: processDynLib(c, n, nil) + of wDynlib: processDynLib(c, n, nil) of wOptimization: if n.sons[1].kind != nkIdent: invalidPragma(n) @@ -591,23 +591,23 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, noVal(it) incl(sym.flags, sfNoSideEffect) if sym.typ != nil: incl(sym.typ.flags, tfNoSideEffect) - of wSideEffect: + of wSideeffect: noVal(it) incl(sym.flags, sfSideEffect) - of wNoReturn: + of wNoreturn: noVal(it) incl(sym.flags, sfNoReturn) - of wDynLib: + of wDynlib: processDynLib(c, it, sym) - of wCompilerProc: + of wCompilerproc: noVal(it) # compilerproc may not get a string! makeExternExport(sym, "$1") incl(sym.flags, sfCompilerProc) incl(sym.flags, sfUsed) # suppress all those stupid warnings registerCompilerProc(sym) - of wProcvar: + of wProcVar: noVal(it) - incl(sym.flags, sfProcVar) + incl(sym.flags, sfProcvar) of wDeprecated: noVal(it) if sym != nil: incl(sym.flags, sfDeprecated) @@ -638,7 +638,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wThread: noVal(it) incl(sym.flags, sfThread) - incl(sym.flags, sfProcVar) + incl(sym.flags, sfProcvar) if sym.typ != nil: incl(sym.typ.flags, tfThread) of wHint: message(it.info, hintUser, expectStrLit(c, it)) of wWarning: message(it.info, warnUser, expectStrLit(c, it)) @@ -657,11 +657,11 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wUndef: processUndef(c, it) of wCompile: processCompile(c, it) of wLink: processCommonLink(c, it, linkNormal) - of wLinkSys: processCommonLink(c, it, linkSys) - of wPassL: extccomp.addLinkOption(expectStrLit(c, it)) - of wPassC: extccomp.addCompileOption(expectStrLit(c, it)) + of wLinksys: processCommonLink(c, it, linkSys) + of wPassl: extccomp.addLinkOption(expectStrLit(c, it)) + of wPassc: extccomp.addCompileOption(expectStrLit(c, it)) of wBreakpoint: pragmaBreakpoint(c, it) - of wWatchpoint: pragmaWatchpoint(c, it) + of wWatchPoint: pragmaWatchpoint(c, it) of wPush: processPush(c, n, i + 1) result = true @@ -679,13 +679,13 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wChecks, wObjChecks, wFieldChecks, wRangechecks, wBoundchecks, wOverflowchecks, wNilchecks, wAssertions, wWarnings, wHints, wLinedir, wStacktrace, wLinetrace, wOptimization, - wCallConv, - wDebugger, wProfiler, wFloatChecks, wNanChecks, wInfChecks, + wCallconv, + wDebugger, wProfiler, wFloatchecks, wNanChecks, wInfChecks, wPatterns: if processOption(c, it): # calling conventions (boring...): localError(it.info, errOptionExpected) - of firstCallConv..lastCallConv: + of FirstCallConv..LastCallConv: assert(sym != nil) if sym.typ == nil: invalidPragma(it) else: sym.typ.callConv = wordToCallConv(k) @@ -713,7 +713,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, noVal(it) if sym.kind != skType or sym.typ == nil: invalidPragma(it) else: incl(sym.typ.flags, tfByCopy) - of wInject, wGenSym: + of wInject, wGensym: # We check for errors, but do nothing with these pragmas otherwise # as they are handled directly in 'evalTemplate'. noVal(it) diff --git a/compiler/pretty.nim b/compiler/pretty.nim index 704857f37d..54d47393e5 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -149,9 +149,8 @@ proc checkDef(c: PGen; n: PNode) = if {sfImportc, sfExportc} * s.flags == {} or c.checkExtern: checkStyle(n.info, s.name.s, s.kind) -proc checkUse*(n: PNode) = - if n.info.fileIndex < 0 or n.kind != nkSym: return - let s = n.sym +proc checkUse*(n: PNode, s: PSym) = + if n.info.fileIndex < 0: return # we simply convert it to what it looks like in the definition # for consistency @@ -267,7 +266,7 @@ when false: proc check(c: PGen, n: PNode) = case n.kind - of nkSym: checkUse(n) + of nkSym: checkUse(n, n.sym) of nkBlockStmt, nkBlockExpr, nkBlockType: checkDef(c, n[0]) check(c, n.sons[1]) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 79486da6bf..99891df25e 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -104,16 +104,16 @@ proc optNL(g: var TSrcGen) = optNL(g, g.indent) proc indentNL(g: var TSrcGen) = - inc(g.indent, indentWidth) + inc(g.indent, IndentWidth) g.pendingNL = g.indent g.lineLen = g.indent proc dedent(g: var TSrcGen) = - dec(g.indent, indentWidth) + dec(g.indent, IndentWidth) assert(g.indent >= 0) - if g.pendingNL > indentWidth: - dec(g.pendingNL, indentWidth) - dec(g.lineLen, indentWidth) + if g.pendingNL > IndentWidth: + dec(g.pendingNL, IndentWidth) + dec(g.lineLen, IndentWidth) proc put(g: var TSrcGen, kind: TTokType, s: string) = addPendingNL(g) @@ -269,7 +269,7 @@ proc gcom(g: var TSrcGen, n: PNode) = if (g.pendingNL < 0) and (len(g.buf) > 0) and (g.lineLen < LineCommentColumn): var ml = maxLineLength(n.comment) - if ml + LineCommentColumn <= maxLineLen: + if ml + LineCommentColumn <= MaxLineLen: put(g, tkSpaces, repeatChar(LineCommentColumn - g.lineLen)) putComment(g, n.comment) #assert(g.comStack[high(g.comStack)] = n); @@ -361,11 +361,11 @@ proc lsons(n: PNode, start: int = 0, theEnd: int = - 1): int = proc lsub(n: PNode): int = # computes the length of a tree if isNil(n): return 0 - if n.comment != nil: return maxLineLen + 1 + if n.comment != nil: return MaxLineLen + 1 case n.kind of nkEmpty: result = 0 of nkTripleStrLit: - if containsNL(n.strVal): result = maxLineLen + 1 + if containsNL(n.strVal): result = MaxLineLen + 1 else: result = len(atom(n)) of succ(nkEmpty)..pred(nkTripleStrLit), succ(nkTripleStrLit)..nkNilLit: result = len(atom(n)) @@ -437,7 +437,7 @@ proc lsub(n: PNode): int = result = len("enum") of nkEnumFieldDef: result = lsons(n) + 3 of nkVarSection, nkLetSection: - if sonsLen(n) > 1: result = maxLineLen + 1 + if sonsLen(n) > 1: result = MaxLineLen + 1 else: result = lsons(n) + len("var_") of nkReturnStmt: result = lsub(n.sons[0]) + len("return_") of nkRaiseStmt: result = lsub(n.sons[0]) + len("raise_") @@ -458,10 +458,10 @@ proc lsub(n: PNode): int = if n.sons[0].kind != nkEmpty: result = result + lsub(n.sons[0]) + 2 of nkExceptBranch: result = lcomma(n, 0, -2) + lsub(lastSon(n)) + len("except_:_") - else: result = maxLineLen + 1 + else: result = MaxLineLen + 1 proc fits(g: TSrcGen, x: int): bool = - result = x + g.lineLen <= maxLineLen + result = x + g.lineLen <= MaxLineLen type TSubFlag = enum @@ -500,7 +500,7 @@ proc gcommaAux(g: var TSrcGen, n: PNode, ind: int, start: int = 0, for i in countup(start, sonsLen(n) + theEnd): var c = i < sonsLen(n) + theEnd var sublen = lsub(n.sons[i]) + ord(c) - if not fits(g, sublen) and (ind + sublen < maxLineLen): optNL(g, ind) + if not fits(g, sublen) and (ind + sublen < MaxLineLen): optNL(g, ind) let oldLen = g.tokens.len gsub(g, n.sons[i]) if c: @@ -514,21 +514,21 @@ proc gcomma(g: var TSrcGen, n: PNode, c: TContext, start: int = 0, theEnd: int = - 1) = var ind: int if rfInConstExpr in c.flags: - ind = g.indent + indentWidth + ind = g.indent + IndentWidth else: ind = g.lineLen - if ind > maxLineLen div 2: ind = g.indent + longIndentWid + if ind > MaxLineLen div 2: ind = g.indent + longIndentWid gcommaAux(g, n, ind, start, theEnd) proc gcomma(g: var TSrcGen, n: PNode, start: int = 0, theEnd: int = - 1) = var ind = g.lineLen - if ind > maxLineLen div 2: ind = g.indent + longIndentWid + if ind > MaxLineLen div 2: ind = g.indent + longIndentWid gcommaAux(g, n, ind, start, theEnd) proc gsemicolon(g: var TSrcGen, n: PNode, start: int = 0, theEnd: int = - 1) = var ind = g.lineLen - if ind > maxLineLen div 2: ind = g.indent + longIndentWid - gcommaAux(g, n, ind, start, theEnd, tkSemicolon) + if ind > MaxLineLen div 2: ind = g.indent + longIndentWid + gcommaAux(g, n, ind, start, theEnd, tkSemiColon) proc gsons(g: var TSrcGen, n: PNode, c: TContext, start: int = 0, theEnd: int = - 1) = @@ -551,7 +551,7 @@ proc longMode(n: PNode, start: int = 0, theEnd: int = - 1): bool = if not result: # check further for i in countup(start, sonsLen(n) + theEnd): - if (lsub(n.sons[i]) > maxLineLen): + if (lsub(n.sons[i]) > MaxLineLen): result = true break @@ -576,7 +576,7 @@ proc gif(g: var TSrcGen, n: PNode) = gsub(g, n.sons[0].sons[0]) initContext(c) putWithSpace(g, tkColon, ":") - if longMode(n) or (lsub(n.sons[0].sons[1]) + g.lineLen > maxLineLen): + if longMode(n) or (lsub(n.sons[0].sons[1]) + g.lineLen > MaxLineLen): incl(c.flags, rfLongMode) gcoms(g) # a good place for comments gstmts(g, n.sons[0].sons[1], c) @@ -591,7 +591,7 @@ proc gwhile(g: var TSrcGen, n: PNode) = gsub(g, n.sons[0]) putWithSpace(g, tkColon, ":") initContext(c) - if longMode(n) or (lsub(n.sons[1]) + g.lineLen > maxLineLen): + if longMode(n) or (lsub(n.sons[1]) + g.lineLen > MaxLineLen): incl(c.flags, rfLongMode) gcoms(g) # a good place for comments gstmts(g, n.sons[1], c) @@ -600,7 +600,7 @@ proc gpattern(g: var TSrcGen, n: PNode) = var c: TContext put(g, tkCurlyLe, "{") initContext(c) - if longMode(n) or (lsub(n.sons[0]) + g.lineLen > maxLineLen): + if longMode(n) or (lsub(n.sons[0]) + g.lineLen > MaxLineLen): incl(c.flags, rfLongMode) gcoms(g) # a good place for comments gstmts(g, n.sons[0], c) @@ -611,7 +611,7 @@ proc gpragmaBlock(g: var TSrcGen, n: PNode) = gsub(g, n.sons[0]) putWithSpace(g, tkColon, ":") initContext(c) - if longMode(n) or (lsub(n.sons[1]) + g.lineLen > maxLineLen): + if longMode(n) or (lsub(n.sons[1]) + g.lineLen > MaxLineLen): incl(c.flags, rfLongMode) gcoms(g) # a good place for comments gstmts(g, n.sons[1], c) @@ -621,7 +621,7 @@ proc gtry(g: var TSrcGen, n: PNode) = put(g, tkTry, "try") putWithSpace(g, tkColon, ":") initContext(c) - if longMode(n) or (lsub(n.sons[0]) + g.lineLen > maxLineLen): + if longMode(n) or (lsub(n.sons[0]) + g.lineLen > MaxLineLen): incl(c.flags, rfLongMode) gcoms(g) # a good place for comments gstmts(g, n.sons[0], c) @@ -634,7 +634,7 @@ proc gfor(g: var TSrcGen, n: PNode) = initContext(c) if longMode(n) or (lsub(n.sons[length - 1]) + lsub(n.sons[length - 2]) + 6 + g.lineLen > - maxLineLen): + MaxLineLen): incl(c.flags, rfLongMode) gcomma(g, n, c, 0, - 3) put(g, tkSpaces, Space) @@ -649,7 +649,7 @@ proc gmacro(g: var TSrcGen, n: PNode) = initContext(c) gsub(g, n.sons[0]) putWithSpace(g, tkColon, ":") - if longMode(n) or (lsub(n.sons[1]) + g.lineLen > maxLineLen): + if longMode(n) or (lsub(n.sons[1]) + g.lineLen > MaxLineLen): incl(c.flags, rfLongMode) gcoms(g) gsons(g, n, c, 1) @@ -709,7 +709,7 @@ proc gblock(g: var TSrcGen, n: PNode) = else: put(g, tkBlock, "block") putWithSpace(g, tkColon, ":") - if longMode(n) or (lsub(n.sons[1]) + g.lineLen > maxLineLen): + if longMode(n) or (lsub(n.sons[1]) + g.lineLen > MaxLineLen): incl(c.flags, rfLongMode) gcoms(g) # XXX I don't get why this is needed here! gstmts should already handle this! @@ -722,7 +722,7 @@ proc gstaticStmt(g: var TSrcGen, n: PNode) = putWithSpace(g, tkStatic, "static") putWithSpace(g, tkColon, ":") initContext(c) - if longMode(n) or (lsub(n.sons[0]) + g.lineLen > maxLineLen): + if longMode(n) or (lsub(n.sons[0]) + g.lineLen > MaxLineLen): incl(c.flags, rfLongMode) gcoms(g) # a good place for comments gstmts(g, n.sons[0], c) @@ -816,7 +816,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkParRi, ")") of nkStaticExpr: put(g, tkStatic, "static") - put(g, tkSpaces, space) + put(g, tkSpaces, Space) gsub(g, n.sons[0]) of nkBracketExpr: gsub(g, n.sons[0]) @@ -833,7 +833,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = gcomma(g, n, 1) of nkCommand: gsub(g, n.sons[0]) - put(g, tkSpaces, space) + put(g, tkSpaces, Space) gcomma(g, n, 1) of nkExprEqExpr, nkAsgn, nkFastAsgn: gsub(g, n.sons[0]) @@ -940,7 +940,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = of nkPrefix: gsub(g, n.sons[0]) if n.len > 1: - put(g, tkSpaces, space) + put(g, tkSpaces, Space) if n.sons[1].kind == nkInfix: put(g, tkParLe, "(") gsub(g, n.sons[1]) diff --git a/compiler/rodread.nim b/compiler/rodread.nim index eba8766599..c3083852a1 100644 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -696,7 +696,7 @@ proc rrGetType(r: PRodReader, id: int, info: TLineInfo): PType = # load the type: var oldPos = r.pos var d = iiTableGet(r.index.tab, id) - if d == invalidKey: internalError(info, "rrGetType") + if d == InvalidKey: internalError(info, "rrGetType") r.pos = d + r.dataIdx result = decodeType(r, info) r.pos = oldPos @@ -726,7 +726,7 @@ proc findSomeWhere(id: int) = var rd = gMods[i].rd if rd != nil: var d = iiTableGet(rd.index.tab, id) - if d != invalidKey: + if d != InvalidKey: echo "found id ", id, " in ", gMods[i].filename proc getReader(moduleId: int): PRodReader = @@ -744,7 +744,7 @@ proc rrGetSym(r: PRodReader, id: int, info: TLineInfo): PSym = if result == nil: # load the symbol: var d = iiTableGet(r.index.tab, id) - if d == invalidKey: + if d == InvalidKey: # import from other module: var moduleID = iiTableGet(r.imports.tab, id) if moduleID < 0: @@ -753,7 +753,7 @@ proc rrGetSym(r: PRodReader, id: int, info: TLineInfo): PSym = internalError(info, "missing from both indexes: +" & x) var rd = getReader(moduleID) d = iiTableGet(rd.index.tab, id) - if d != invalidKey: + if d != InvalidKey: result = decodeSymSafePos(rd, d, info) else: var x = "" @@ -800,7 +800,7 @@ proc loadMethods(r: PRodReader) = if r.s[r.pos] == ' ': inc(r.pos) proc getCRC*(fileIdx: int32): TCrc32 = - InternalAssert fileIdx >= 0 and fileIdx < gMods.len + internalAssert fileIdx >= 0 and fileIdx < gMods.len if gMods[fileIdx].crcDone: return gMods[fileIdx].crc @@ -875,7 +875,7 @@ proc rawLoadStub(s: PSym) = var rd = gMods[s.position].rd var theId = s.id # used for later check var d = iiTableGet(rd.index.tab, s.id) - if d == invalidKey: internalError("loadStub: invalid key") + if d == InvalidKey: internalError("loadStub: invalid key") var rs = decodeSymSafePos(rd, d, unknownLineInfo()) if rs != s: #echo "rs: ", toHex(cast[int](rs.position), int.sizeof * 2), diff --git a/compiler/rodwrite.nim b/compiler/rodwrite.nim index be55a5c172..c393ce1dae 100644 --- a/compiler/rodwrite.nim +++ b/compiler/rodwrite.nim @@ -101,12 +101,12 @@ proc addInclDep(w: PRodWriter, dep: string) = proc pushType(w: PRodWriter, t: PType) = # check so that the stack does not grow too large: - if iiTableGet(w.index.tab, t.id) == invalidKey: + if iiTableGet(w.index.tab, t.id) == InvalidKey: w.tstack.add(t) proc pushSym(w: PRodWriter, s: PSym) = # check so that the stack does not grow too large: - if iiTableGet(w.index.tab, s.id) == invalidKey: + if iiTableGet(w.index.tab, s.id) == InvalidKey: w.sstack.add(s) proc encodeNode(w: PRodWriter, fInfo: TLineInfo, n: PNode, @@ -336,7 +336,7 @@ proc symStack(w: PRodWriter): int = if sfForward in s.flags: w.sstack[result] = s inc result - elif iiTableGet(w.index.tab, s.id) == invalidKey: + elif iiTableGet(w.index.tab, s.id) == InvalidKey: var m = getModule(s) if m == nil: internalError("symStack: module nil: " & s.name.s) if (m.id == w.module.id) or (sfFromGeneric in s.flags): @@ -364,7 +364,7 @@ proc symStack(w: PRodWriter): int = if s.kind == skMethod and sfDispatcher notin s.flags: if w.methods.len != 0: add(w.methods, ' ') encodeVInt(s.id, w.methods) - elif iiTableGet(w.imports.tab, s.id) == invalidKey: + elif iiTableGet(w.imports.tab, s.id) == InvalidKey: addToIndex(w.imports, s.id, m.id) when debugWrittenIds: if not Contains(debugWritten, s.id): @@ -383,7 +383,7 @@ proc typeStack(w: PRodWriter): int = if t.kind == tyForward: w.tstack[result] = t inc result - elif iiTableGet(w.index.tab, t.id) == invalidKey: + elif iiTableGet(w.index.tab, t.id) == InvalidKey: var L = w.data.len addToIndex(w.index, t.id, L) encodeType(w, t, w.data) diff --git a/compiler/ropes.nim b/compiler/ropes.nim index f3c0a00e00..2be40524af 100644 --- a/compiler/ropes.nim +++ b/compiler/ropes.nim @@ -157,7 +157,7 @@ proc toRope(s: string): PRope = result = nil else: result = insertInCache(s) - assert(RopeInvariant(result)) + assert(ropeInvariant(result)) proc ropeSeqInsert(rs: var TRopeSeq, r: PRope, at: Natural) = var length = len(rs) @@ -280,7 +280,7 @@ proc ropef(frmt: TFormatStr, args: varargs[PRope]): PRope = else: break if i - 1 >= start: app(result, substr(frmt, start, i - 1)) - assert(RopeInvariant(result)) + assert(ropeInvariant(result)) {.push stack_trace: off, line_trace: off.} proc `~`*(r: expr[string]): PRope = @@ -313,7 +313,7 @@ proc ropeEqualsFile(r: PRope, f: string): bool = result = open(bin, f) if not result: return # not equal if file does not exist - var buf = alloc(BufSize) + var buf = alloc(bufSize) result = auxRopeEqualsFile(r, bin, buf) if result: result = readBuffer(bin, buf, bufSize) == 0 # really at the end of file? @@ -346,7 +346,7 @@ proc newCrcFromRopeAux(r: PRope, startVal: TCrc32): TCrc32 = inc(i) proc crcFromRope(r: PRope): TCrc32 = - result = newCrcFromRopeAux(r, initCrc32) + result = newCrcFromRopeAux(r, InitCrc32) proc writeRopeIfNotEqual(r: PRope, filename: string): bool = # returns true if overwritten diff --git a/compiler/sem.nim b/compiler/sem.nim index 123a813af7..72b06da65e 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -134,8 +134,8 @@ proc newSymG*(kind: TSymKind, n: PNode, c: PContext): PSym = # like newSymS, but considers gensym'ed symbols if n.kind == nkSym: result = n.sym - InternalAssert sfGenSym in result.flags - InternalAssert result.kind == kind + internalAssert sfGenSym in result.flags + internalAssert result.kind == kind else: result = newSym(kind, considerAcc(n), getCurrOwner(), n.info) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 38ff0f3be6..bc4e8cd05b 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -139,7 +139,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode, let overloadsState = result.state if overloadsState != csMatch: if nfDelegate in n.flags: - InternalAssert f.kind == nkIdent + internalAssert f.kind == nkIdent let calleeName = newStrNode(nkStrLit, f.ident.s) calleeName.info = n.info diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 15f0f71f07..8f00d91c61 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -198,15 +198,15 @@ proc addToLib(lib: PLib, sym: PSym) = proc makePtrType(c: PContext, baseType: PType): PType = result = newTypeS(tyPtr, c) - addSonSkipIntLit(result, baseType.AssertNotNil) + addSonSkipIntLit(result, baseType.assertNotNil) proc makeVarType(c: PContext, baseType: PType): PType = result = newTypeS(tyVar, c) - addSonSkipIntLit(result, baseType.AssertNotNil) + addSonSkipIntLit(result, baseType.assertNotNil) proc makeTypeDesc*(c: PContext, typ: PType): PType = result = newTypeS(tyTypeDesc, c) - result.addSonSkipIntLit(typ.AssertNotNil) + result.addSonSkipIntLit(typ.assertNotNil) proc makeTypeSymNode*(c: PContext, typ: PType, info: TLineInfo): PNode = let typedesc = makeTypeDesc(c, typ) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 43091aa741..46902e776c 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -658,7 +658,7 @@ proc semStaticExpr(c: PContext, n: PNode): PNode = proc semOverloadedCallAnalyseEffects(c: PContext, n: PNode, nOrig: PNode, flags: TExprFlags): PNode = - if flags*{efInTypeOf, efWantIterator} != {}: + if flags*{efInTypeof, efWantIterator} != {}: # consider: 'for x in pReturningArray()' --> we don't want the restriction # to 'skIterator' anymore; skIterator is preferred in sigmatch already for # typeof support. @@ -702,7 +702,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = semOpAux(c, n) var t: PType = nil if n.sons[0].typ != nil: - t = skipTypes(n.sons[0].typ, abstractInst-{tyTypedesc}) + t = skipTypes(n.sons[0].typ, abstractInst-{tyTypeDesc}) if t != nil and t.kind == tyProc: # This is a proc variable, apply normal overload resolution var m: TCandidate @@ -964,10 +964,10 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = if f != nil: if fieldVisible(c, f): # is the access to a public field or in the same module or in a friend? + markUsed(n.sons[1], f) n.sons[0] = makeDeref(n.sons[0]) n.sons[1] = newSymNode(f) # we now have the correct field n.typ = f.typ - markUsed(n, f) if check == nil: result = n else: @@ -977,11 +977,11 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = elif ty.kind == tyTuple and ty.n != nil: f = getSymFromList(ty.n, i) if f != nil: + markUsed(n.sons[1], f) n.sons[0] = makeDeref(n.sons[0]) n.sons[1] = newSymNode(f) n.typ = f.typ result = n - markUsed(n, f) proc dotTransformation(c: PContext, n: PNode): PNode = if isSymChoice(n.sons[1]): @@ -1164,7 +1164,7 @@ proc semAsgn(c: PContext, n: PNode): PNode = n.typ = enforceVoidContext if lhs.sym.typ.kind == tyGenericParam: if matchTypeClass(lhs.typ, rhs.typ): - InternalAssert c.p.resultSym != nil + internalAssert c.p.resultSym != nil lhs.typ = rhs.typ c.p.resultSym.typ = rhs.typ c.p.owner.typ.sons[0] = rhs.typ @@ -1356,7 +1356,7 @@ proc semUsing(c: PContext, n: PNode): PNode = of skProcKinds: addDeclAt(c.currentScope, usedSym.sym) continue - else: nil + else: discard localError(e.info, errUsingNoSymbol, e.renderTree) @@ -1372,7 +1372,7 @@ proc semExpandToAst(c: PContext, n: PNode): PNode = macroCall.sons[i] = semExprWithType(c, macroCall[i], {}) # Preserve the magic symbol in order to be handled in evals.nim - InternalAssert n.sons[0].sym.magic == mExpandToAst + internalAssert n.sons[0].sym.magic == mExpandToAst n.typ = getSysSym("PNimrodNode").typ # expandedSym.getReturnType result = n @@ -1409,7 +1409,7 @@ proc processQuotations(n: var PNode, op: string, processQuotations(n.sons[i], op, quotes, ids) proc semQuoteAst(c: PContext, n: PNode): PNode = - InternalAssert n.len == 2 or n.len == 3 + internalAssert n.len == 2 or n.len == 3 # We transform the do block into a template with a param for # each interpolation. We'll pass this template to getAst. var diff --git a/compiler/seminst.nim b/compiler/seminst.nim index b03f20259e..faf0aae117 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -132,7 +132,7 @@ proc sideEffectsCheck(c: PContext, s: PSym) = c.threadEntries.add(s) proc lateInstantiateGeneric(c: PContext, invocation: PType, info: TLineInfo): PType = - InternalAssert invocation.kind == tyGenericInvokation + internalAssert invocation.kind == tyGenericInvokation let cacheHit = searchInstTypes(invocation) if cacheHit != nil: diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index e6c5fc5748..9a2645f7ed 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -26,7 +26,7 @@ proc semInstantiationInfo(c: PContext, n: PNode): PNode = let useFullPaths = expectIntLit(c, n.sons[2]) let info = getInfoContext(idx) var filename = newNodeIT(nkStrLit, n.info, getSysType(tyString)) - filename.strVal = if useFullPaths != 0: info.toFullPath else: info.ToFilename + filename.strVal = if useFullPaths != 0: info.toFullPath else: info.toFilename var line = newNodeIT(nkIntLit, n.info, getSysType(tyInt)) line.intVal = toLinenumber(info) result.add(filename) diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index efab8ddb6e..c9d5036d80 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -305,7 +305,7 @@ proc notNilCheck(tracked: PEffects, n: PNode, paramType: PType) = if n.kind == nkAddr: # addr(x[]) can't be proven, but addr(x) can: if not containsNode(n, {nkDerefExpr, nkHiddenDeref}): return - elif n.kind == nkSym and n.sym.kind in RoutineKinds: + elif n.kind == nkSym and n.sym.kind in routineKinds: # 'p' is not nil obviously: return case impliesNotNil(tracked.guards, n) @@ -319,7 +319,7 @@ proc notNilCheck(tracked: PEffects, n: PNode, paramType: PType) = proc trackOperand(tracked: PEffects, n: PNode, paramType: PType) = let op = n.typ if op != nil and op.kind == tyProc and n.kind != nkNilLit: - InternalAssert op.n.sons[0].kind == nkEffectList + internalAssert op.n.sons[0].kind == nkEffectList var effectList = op.n.sons[0] let s = n.skipConv if s.kind == nkSym and s.sym.kind in routineKinds: @@ -568,13 +568,13 @@ proc checkMethodEffects*(disp, branch: PSym) = proc setEffectsForProcType*(t: PType, n: PNode) = var effects = t.n.sons[0] - InternalAssert t.kind == tyProc and effects.kind == nkEffectList + internalAssert t.kind == tyProc and effects.kind == nkEffectList let raisesSpec = effectSpec(n, wRaises) tagsSpec = effectSpec(n, wTags) if not isNil(raisesSpec) or not isNil(tagsSpec): - InternalAssert effects.len == 0 + internalAssert effects.len == 0 newSeq(effects.sons, effectListLen) if not isNil(raisesSpec): effects.sons[exceptionEffects] = raisesSpec @@ -583,7 +583,7 @@ proc setEffectsForProcType*(t: PType, n: PNode) = proc trackProc*(s: PSym, body: PNode) = var effects = s.typ.n.sons[0] - InternalAssert effects.kind == nkEffectList + internalAssert effects.kind == nkEffectList # effects already computed? if sfForward in s.flags: return if effects.len == effectListLen: return diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index c89fb46a2f..137f409b2f 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -70,7 +70,7 @@ proc toCover(t: PType): BiggestInt = proc performProcvarCheck(c: PContext, n: PNode, s: PSym) = var smoduleId = getModule(s).id - if sfProcVar notin s.flags and s.typ.callConv == ccDefault and + if sfProcvar notin s.flags and s.typ.callConv == ccDefault and smoduleId != c.module.id and smoduleId != c.friendModule.id: localError(n.info, errXCannotBePassedToProcVar, s.name.s) @@ -788,8 +788,8 @@ proc typeSectionFinalPass(c: PContext, n: PNode) = # give anonymous object a dummy symbol: var st = s.typ if st.kind == tyGenericBody: st = st.lastSon - InternalAssert st.kind in {tyPtr, tyRef} - InternalAssert st.sons[0].sym == nil + internalAssert st.kind in {tyPtr, tyRef} + internalAssert st.sons[0].sym == nil st.sons[0].sym = newSym(skType, getIdent(s.name.s & ":ObjectType"), getCurrOwner(), s.info) @@ -887,7 +887,7 @@ proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode = illFormedAst(n) # process parameters: if n.sons[paramsPos].kind != nkEmpty: var gp = newNodeI(nkGenericParams, n.info) - semParamList(c, n.sons[ParamsPos], gp, s) + semParamList(c, n.sons[paramsPos], gp, s) paramsTypeCheck(c, s.typ) else: s.typ = newTypeS(tyProc, c) @@ -939,7 +939,7 @@ type stepCompileBody proc isForwardDecl(s: PSym): bool = - InternalAssert s.kind == skProc + internalAssert s.kind == skProc result = s.ast[bodyPos].kind != nkEmpty proc semProcAux(c: PContext, n: PNode, kind: TSymKind, @@ -982,7 +982,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, gp = newNodeI(nkGenericParams, n.info) # process parameters: if n.sons[paramsPos].kind != nkEmpty: - semParamList(c, n.sons[ParamsPos], gp, s) + semParamList(c, n.sons[paramsPos], gp, s) if sonsLen(gp) > 0: if n.sons[genericParamsPos].kind == nkEmpty: # we have a list of implicit type parameters: diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index f6c841e60f..da38f8625a 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -36,7 +36,7 @@ proc symBinding(n: PNode): TSymBinding = var key = if it.kind == nkExprColonExpr: it.sons[0] else: it if key.kind == nkIdent: case whichKeyword(key.ident) - of wGenSym: return spGenSym + of wGensym: return spGenSym of wInject: return spInject else: nil @@ -435,7 +435,7 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = gp = newNodeI(nkGenericParams, n.info) # process parameters: if n.sons[paramsPos].kind != nkEmpty: - semParamList(c, n.sons[ParamsPos], gp, s) + semParamList(c, n.sons[paramsPos], gp, s) if sonsLen(gp) > 0: if n.sons[genericParamsPos].kind == nkEmpty: # we have a list of implicit type parameters: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 91bbb467e3..69649a58c8 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -50,13 +50,13 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = of tyTuple: if sonsLen(v) == 2: strVal = v.sons[1] # second tuple part is the string value - if skipTypes(strVal.typ, abstractInst).kind in {tyString, tyCstring}: + if skipTypes(strVal.typ, abstractInst).kind in {tyString, tyCString}: x = getOrdValue(v.sons[0]) # first tuple part is the ordinal else: localError(strVal.info, errStringLiteralExpected) else: localError(v.info, errWrongNumberOfVariables) - of tyString, tyCstring: + of tyString, tyCString: strVal = v x = counter else: @@ -148,7 +148,7 @@ proc semDistinct(c: PContext, n: PNode, prev: PType): PType = result = newConstraint(c, tyDistinct) proc semRangeAux(c: PContext, n: PNode, prev: PType): PType = - assert IsRange(n) + assert isRange(n) checkSonsLen(n, 3) result = newOrPrevType(tyRange, prev, c) result.n = newNodeI(nkRange, n.info) @@ -198,7 +198,7 @@ proc semArray(c: PContext, n: PNode, prev: PType): PType = indx = makeRangeType(c, 0, e.intVal-1, n.info, e.typ) elif e.kind == nkSym and e.typ.kind == tyExpr: if e.sym.ast != nil: return semArray(c, e.sym.ast, nil) - InternalAssert c.InGenericContext > 0 + internalAssert c.InGenericContext > 0 if not isOrdinalType(e.typ.lastSon): localError(n[1].info, errOrdinalTypeExpected) indx = e.typ @@ -331,7 +331,7 @@ proc semIdentWithPragma(c: PContext, kind: TSymKind, n: PNode, of skVar: pragma(c, result, n.sons[1], varPragmas) of skLet: pragma(c, result, n.sons[1], letPragmas) of skConst: pragma(c, result, n.sons[1], constPragmas) - else: nil + else: discard else: result = semIdentVis(c, kind, n, allowed) @@ -970,7 +970,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = result = newOrPrevType(tyError, prev, c) elif s.kind == skParam and s.typ.kind == tyTypeDesc: assert s.typ.len > 0 - InternalAssert prev == nil + internalAssert prev == nil result = s.typ.sons[0] elif prev == nil: result = s.typ diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 2afdeb5ae7..6940af7b78 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -33,7 +33,7 @@ proc checkConstructedType*(info: TLineInfo, typ: PType) = proc searchInstTypes*(key: PType): PType = let genericTyp = key.sons[0] - InternalAssert genericTyp.kind == tyGenericBody and + internalAssert genericTyp.kind == tyGenericBody and key.sons[0] == genericTyp and genericTyp.sym != nil diff --git a/compiler/service.nim b/compiler/service.nim index 209ccd8e30..42c4aa9f48 100644 --- a/compiler/service.nim +++ b/compiler/service.nim @@ -36,7 +36,7 @@ proc processCmdLine*(pass: TCmdLinePass, cmd: string) = parseopt.next(p) case p.kind of cmdEnd: break - of cmdLongOption, cmdShortOption: + of cmdLongoption, cmdShortOption: # hint[X]:off is parsed as (p.key = "hint[X]", p.val = "off") # we fix this here var bracketLe = strutils.find(p.key, '[') diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 7a30dadc8b..3b1f3e7153 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -86,7 +86,7 @@ proc initCandidate*(c: var TCandidate, callee: PSym, binding: PNode, c.calleeScope = calleeScope initIdTable(c.bindings) c.errors = nil - if binding != nil and callee.kind in RoutineKinds: + if binding != nil and callee.kind in routineKinds: var typeParams = callee.ast[genericParamsPos] for i in 1..min(sonsLen(typeParams), sonsLen(binding)-1): var formalTypeParam = typeParams.sons[i-1].typ @@ -716,7 +716,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = if f.sons == nil or f.sons.len == 0: result = isGeneric else: - InternalAssert a.sons != nil and a.sons.len > 0 + internalAssert a.sons != nil and a.sons.len > 0 c.typedescMatched = true result = typeRel(c, f.sons[0], a.sons[0]) else: @@ -752,7 +752,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = else: result = isNone else: - InternalAssert prev.sonsLen == 1 + internalAssert prev.sonsLen == 1 let toMatch = if tfUnresolved in f.flags: a else: a.sons[0] result = typeRel(c, prev.sons[0], toMatch) @@ -825,7 +825,7 @@ proc localConvMatch(c: PContext, m: var TCandidate, f, a: PType, var call = newNodeI(nkCall, arg.info) call.add(f.n.copyTree) call.add(arg.copyTree) - result = c.semOverloadedCall(c, call, call, RoutineKinds) + result = c.semOverloadedCall(c, call, call, routineKinds) if result != nil: # resulting type must be consistent with the other arguments: var r = typeRel(m, f.sons[0], result.typ) @@ -867,7 +867,7 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, dummyName = param dummyType = a - InternalAssert dummyName.kind == nkIdent + internalAssert dummyName.kind == nkIdent var dummyParam = newSym(skType, dummyName.ident, f.sym, f.sym.info) dummyParam.typ = dummyType addDecl(c, dummyParam) @@ -904,7 +904,7 @@ proc paramTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, r = isGeneric else: if a.kind == tyExpr: - InternalAssert a.len > 0 + internalAssert a.len > 0 r = typeRel(m, f.lastSon, a.lastSon) else: let match = matchTypeClass(m.bindings, fMaybeExpr, a) @@ -1156,7 +1156,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode, # unnamed param if f >= formalLen: # too many arguments? - if tfVarArgs in m.callee.flags: + if tfVarargs in m.callee.flags: # is ok... but don't increment any counters... # we have no formal here to snoop at: n.sons[a] = prepareOperand(c, n.sons[a]) diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 7e0a28afb7..c88687f2ce 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -203,7 +203,7 @@ const CallNodes = {nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit} proc findClosestCall(n: PNode): PNode = - if n.kind in callNodes and msgs.inCheckpoint(n.info) == cpExact: + if n.kind in CallNodes and msgs.inCheckpoint(n.info) == cpExact: result = n else: for i in 0.. <safeLen(n): @@ -327,7 +327,7 @@ proc markUsed(n: PNode, s: PSym) = if sfDeprecated in s.flags: message(n.info, warnDeprecated, s.name.s) if sfError in s.flags: localError(n.info, errWrongSymbolX, s.name.s) suggestSym(n, s) - if gCmd == cmdPretty: checkUse(n) + if gCmd == cmdPretty: checkUse(n, s) proc useSym*(sym: PSym): PNode = result = newSymNode(sym) diff --git a/compiler/syntaxes.nim b/compiler/syntaxes.nim index 3f2863c7ff..7c44ec0b4c 100644 --- a/compiler/syntaxes.nim +++ b/compiler/syntaxes.nim @@ -83,7 +83,7 @@ proc utf8Bom(s: string): int = proc containsShebang(s: string, i: int): bool = if (s[i] == '#') and (s[i + 1] == '!'): var j = i + 2 - while s[j] in WhiteSpace: inc(j) + while s[j] in Whitespace: inc(j) result = s[j] == '/' proc parsePipe(filename: string, inputStream: PLLStream): PNode = @@ -98,7 +98,7 @@ proc parsePipe(filename: string, inputStream: PLLStream): PNode = i = 0 if line[i] == '#' and line[i+1] == '!': inc(i, 2) - while line[i] in WhiteSpace: inc(i) + while line[i] in Whitespace: inc(i) var q: TParser openParser(q, filename, llStreamOpen(substr(line, i))) result = parser.parseAll(q) diff --git a/compiler/transf.nim b/compiler/transf.nim index ea9036f1f1..936cf89ae8 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -142,7 +142,7 @@ proc transformVarSection(c: PTransf, v: PNode): PTransNode = result[i] = PTransNode(it) elif it.kind == nkIdentDefs: if it.sons[0].kind != nkSym: internalError(it.info, "transformVarSection") - InternalAssert(it.len == 3) + internalAssert(it.len == 3) var newVar = copySym(it.sons[0].sym) incl(newVar.flags, sfFromGeneric) # fixes a strange bug for rodgen: @@ -152,7 +152,7 @@ proc transformVarSection(c: PTransf, v: PNode): PTransNode = var defs = newTransNode(nkIdentDefs, it.info, 3) if importantComments(): # keep documentation information: - pnode(defs).comment = it.comment + PNode(defs).comment = it.comment defs[0] = newSymNode(newVar).PTransNode defs[1] = it.sons[1].PTransNode defs[2] = transform(c, it.sons[2]) @@ -186,7 +186,7 @@ proc transformConstSection(c: PTransf, v: PNode): PTransNode = var b = newNodeI(nkConstDef, it.info) addSon(b, it[0]) addSon(b, ast.emptyNode) # no type description - addSon(b, transform(c, it[2]).pnode) + addSon(b, transform(c, it[2]).PNode) result[i] = PTransNode(b) else: result[i] = PTransNode(it) @@ -217,7 +217,7 @@ proc transformBlock(c: PTransf, n: PNode): PTransNode = proc transformBreak(c: PTransf, n: PNode): PTransNode = if c.inLoop > 0 or n.sons[0].kind != nkEmpty: - result = n.ptransNode + result = n.PTransNode else: let labl = c.breakSyms[c.breakSyms.high] result = transformSons(c, n) @@ -292,11 +292,11 @@ proc transformYield(c: PTransf, n: PNode): PTransNode = add(result, c.transCon.forLoopBody) else: # we need to introduce new local variables: - add(result, introduceNewLocalVars(c, c.transCon.forLoopBody.pnode)) + add(result, introduceNewLocalVars(c, c.transCon.forLoopBody.PNode)) proc transformAddrDeref(c: PTransf, n: PNode, a, b: TNodeKind): PTransNode = result = transformSons(c, n) - var n = result.pnode + var n = result.PNode case n.sons[0].kind of nkObjUpConv, nkObjDownConv, nkChckRange, nkChckRangeF, nkChckRange64: var m = n.sons[0].sons[0] @@ -436,8 +436,8 @@ proc transformFor(c: PTransf, n: PNode): PTransNode = if call.kind notin nkCallKinds or call.sons[0].kind != nkSym or call.sons[0].typ.callConv == ccClosure or call.sons[0].sym.kind != skIterator: - n.sons[length-1] = transformLoopBody(c, n.sons[length-1]).pnode - return lambdalifting.liftForLoop(n).ptransNode + n.sons[length-1] = transformLoopBody(c, n.sons[length-1]).PNode + return lambdalifting.liftForLoop(n).PTransNode #InternalError(call.info, "transformFor") #echo "transforming: ", renderTree(n) @@ -446,7 +446,7 @@ proc transformFor(c: PTransf, n: PNode): PTransNode = var v = newNodeI(nkVarSection, n.info) for i in countup(0, length - 3): addVar(v, copyTree(n.sons[i])) # declare new vars - add(result, v.ptransNode) + add(result, v.PTransNode) # Bugfix: inlined locals belong to the invoking routine, not to the invoked # iterator! @@ -458,7 +458,7 @@ proc transformFor(c: PTransf, n: PNode): PTransNode = # generate access statements for the parameters (unless they are constant) pushTransCon(c, newC) for i in countup(1, sonsLen(call) - 1): - var arg = transform(c, call.sons[i]).pnode + var arg = transform(c, call.sons[i]).PNode var formal = skipTypes(iter.typ, abstractInst).n.sons[i].sym case putArgInto(arg, formal.typ) of paDirectMapping: @@ -467,7 +467,7 @@ proc transformFor(c: PTransf, n: PNode): PTransNode = # generate a temporary and produce an assignment statement: var temp = newTemp(c, formal.typ, formal.info) addVar(v, newSymNode(temp)) - add(result, newAsgnStmt(c, newSymNode(temp), arg.ptransNode)) + add(result, newAsgnStmt(c, newSymNode(temp), arg.PTransNode)) idNodeTablePut(newC.mapping, formal, newSymNode(temp)) of paVarAsgn: assert(skipTypes(formal.typ, abstractInst).kind == tyVar) @@ -500,19 +500,19 @@ proc transformCase(c: PTransf, n: PNode): PTransNode = var e = transform(c, it) case it.kind of nkElifBranch: - if ifs.pnode == nil: + if ifs.PNode == nil: ifs = newTransNode(nkIfStmt, it.info, 0) ifs.add(e) of nkElse: - if ifs.pnode == nil: result.add(e) + if ifs.PNode == nil: result.add(e) else: ifs.add(e) else: result.add(e) - if ifs.pnode != nil: + if ifs.PNode != nil: var elseBranch = newTransNode(nkElse, n.info, 1) elseBranch[0] = ifs result.add(elseBranch) - elif result.Pnode.lastSon.kind != nkElse and not ( + elif result.PNode.lastSon.kind != nkElse and not ( skipTypes(n.sons[0].Typ, abstractVarRange).Kind in {tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt32}): # fix a stupid code gen bug by normalizing: @@ -523,7 +523,7 @@ proc transformCase(c: PTransf, n: PNode): PTransNode = proc transformArrayAccess(c: PTransf, n: PNode): PTransNode = # XXX this is really bad; transf should use a proper AST visitor if n.sons[0].kind == nkSym and n.sons[0].sym.kind == skType: - result = n.ptransnode + result = n.PTransNode else: result = newTransNode(n) for i in 0 .. < n.len: @@ -563,24 +563,24 @@ proc transformCall(c: PTransf, n: PNode): PTransNode = add(result, transform(c, n.sons[0])) var j = 1 while j < sonsLen(n): - var a = transform(c, n.sons[j]).pnode + var a = transform(c, n.sons[j]).PNode inc(j) if isConstExpr(a): while (j < sonsLen(n)): - let b = transform(c, n.sons[j]).pnode + let b = transform(c, n.sons[j]).PNode if not isConstExpr(b): break a = evalOp(op.magic, n, a, b, nil) inc(j) - add(result, a.ptransnode) + add(result, a.PTransNode) if len(result) == 2: result = result[1] else: - let s = transformSons(c, n).pnode + let s = transformSons(c, n).PNode # bugfix: check after 'transformSons' if it's still a method call: # use the dispatcher for the call: if s.sons[0].kind == nkSym and s.sons[0].sym.kind == skMethod: - result = methodCall(s).ptransNode + result = methodCall(s).PTransNode else: - result = s.ptransNode + result = s.PTransNode proc dontInlineConstant(orig, cnst: PNode): bool {.inline.} = # symbols that expand to a complex constant (array, etc.) should not be @@ -683,7 +683,7 @@ proc transform(c: PTransf, n: PNode): PTransNode = # completely: result = PTransNode(newNode(nkCommentStmt)) of nkCommentStmt, nkTemplateDef: - return n.ptransNode + return n.PTransNode of nkConstSection: # do not replace ``const c = 3`` with ``const 3 = 3`` return transformConstSection(c, n) @@ -707,7 +707,7 @@ proc transform(c: PTransf, n: PNode): PTransNode = result = transformSons(c, n) # XXX comment handling really sucks: if importantComments(): - pnode(result).comment = n.comment + PNode(result).comment = n.comment else: result = transformSons(c, n) var cnst = getConstExpr(c.module, PNode(result)) diff --git a/compiler/treetab.nim b/compiler/treetab.nim index cccb1096ad..ecb8fb083a 100644 --- a/compiler/treetab.nim +++ b/compiler/treetab.nim @@ -83,7 +83,7 @@ proc nodeTablePut*(t: var TNodeTable, key: PNode, val: int) = t.data[index].val = val else: if mustRehash(len(t.data), t.counter): - newSeq(n, len(t.data) * growthFactor) + newSeq(n, len(t.data) * GrowthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: nodeTableRawInsert(n, t.data[i].h, t.data[i].key, t.data[i].val) @@ -100,7 +100,7 @@ proc nodeTableTestOrSet*(t: var TNodeTable, key: PNode, val: int): int = result = t.data[index].val else: if mustRehash(len(t.data), t.counter): - newSeq(n, len(t.data) * growthFactor) + newSeq(n, len(t.data) * GrowthFactor) for i in countup(0, high(t.data)): if t.data[i].key != nil: nodeTableRawInsert(n, t.data[i].h, t.data[i].key, t.data[i].val) diff --git a/compiler/types.nim b/compiler/types.nim index 5870ccacd8..a921c59ba3 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -97,7 +97,7 @@ proc isPureObject(typ: PType): bool = while t.kind == tyObject and t.sons[0] != nil: t = t.sons[0] result = t.sym != nil and sfPure in t.sym.flags -proc getOrdValue(n: PNode): biggestInt = +proc getOrdValue(n: PNode): BiggestInt = case n.kind of nkCharLit..nkInt64Lit: result = n.intVal of nkNilLit: result = 0 @@ -526,7 +526,7 @@ proc resultType(t: PType): PType = proc base(t: PType): PType = result = t.sons[0] -proc firstOrd(t: PType): biggestInt = +proc firstOrd(t: PType): BiggestInt = case t.kind of tyBool, tyChar, tySequence, tyOpenArray, tyString, tyVarargs, tyProxy: result = 0 @@ -557,7 +557,7 @@ proc firstOrd(t: PType): biggestInt = internalError("invalid kind for first(" & $t.kind & ')') result = 0 -proc lastOrd(t: PType): biggestInt = +proc lastOrd(t: PType): BiggestInt = case t.kind of tyBool: result = 1 of tyChar: result = 255 @@ -591,7 +591,7 @@ proc lastOrd(t: PType): biggestInt = internalError("invalid kind for last(" & $t.kind & ')') result = 0 -proc lengthOrd(t: PType): biggestInt = +proc lengthOrd(t: PType): BiggestInt = case t.kind of tyInt64, tyInt32, tyInt: result = lastOrd(t) of tyDistinct, tyConst, tyMutable: result = lengthOrd(t.sons[0]) @@ -732,7 +732,7 @@ proc sameTuple(a, b: PType, c: var TSameTypeClosure): bool = result = false template ifFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} = - if tfFromGeneric not_in a.flags + b.flags: + if tfFromGeneric notin a.flags + b.flags: # fast case: id comparison suffices: result = a.id == b.id else: @@ -835,7 +835,7 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = result = exprStructuralEquivalent(a.n, b.n) and sameFlags(a, b) of tyObject: ifFastObjectTypeCheckFailed(a, b): - CycleCheck() + cycleCheck() result = sameObjectStructures(a, b, c) and sameFlags(a, b) of tyDistinct: cycleCheck() @@ -1133,7 +1133,7 @@ proc computeRecSizeAux(n: PNode, a, currOffset: var BiggestInt): BiggestInt = a = 1 result = - 1 -proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = +proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt = var res, maxAlign, length, currOffset: BiggestInt if typ.size == - 2: # we are already computing the size of the type @@ -1184,7 +1184,7 @@ proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = length = lastOrd(typ) # BUGFIX: use lastOrd! if length + 1 < `shl`(1, 8): result = 1 elif length + 1 < `shl`(1, 16): result = 2 - elif length + 1 < `shl`(biggestInt(1), 32): result = 4 + elif length + 1 < `shl`(BiggestInt(1), 32): result = 4 else: result = 8 a = result of tySet: @@ -1235,7 +1235,7 @@ proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = typ.size = result typ.align = int(a) -proc computeSize(typ: PType): biggestInt = +proc computeSize(typ: PType): BiggestInt = var a: BiggestInt = 1 result = computeSizeAux(typ, a) @@ -1244,7 +1244,7 @@ proc getReturnType*(s: PSym): PType = assert s.kind in {skProc, skTemplate, skMacro, skIterator} result = s.typ.sons[0] -proc getSize(typ: PType): biggestInt = +proc getSize(typ: PType): BiggestInt = result = computeSize(typ) if result < 0: internalError("getSize: " & $typ.kind) @@ -1289,8 +1289,8 @@ proc compatibleEffectsAux(se, re: PNode): bool = proc compatibleEffects*(formal, actual: PType): bool = # for proc type compatibility checking: assert formal.kind == tyProc and actual.kind == tyProc - InternalAssert formal.n.sons[0].kind == nkEffectList - InternalAssert actual.n.sons[0].kind == nkEffectList + internalAssert formal.n.sons[0].kind == nkEffectList + internalAssert actual.n.sons[0].kind == nkEffectList var spec = formal.n.sons[0] if spec.len != 0: @@ -1315,7 +1315,7 @@ proc compatibleEffects*(formal, actual: PType): bool = result = true proc isCompileTimeOnly*(t: PType): bool {.inline.} = - result = t.kind in {tyTypedesc, tyExpr} + result = t.kind in {tyTypeDesc, tyExpr} proc containsCompileTimeOnly*(t: PType): bool = if isCompileTimeOnly(t): return true diff --git a/compiler/vm.nim b/compiler/vm.nim index 3d76638bc4..215b3486e4 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -579,7 +579,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcMinusSet: decodeBC(nkCurly) move(regs[ra].sons, nimsets.diffSets(regs[rb], regs[rc]).sons) - of opcSymDiffSet: + of opcSymdiffSet: decodeBC(nkCurly) move(regs[ra].sons, nimsets.symdiffSets(regs[rb], regs[rc]).sons) of opcConcatStr: @@ -982,7 +982,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = of opcNSetType: decodeB(nkMetaNode) let b = regs[rb].skipMeta - InternalAssert b.kind == nkSym and b.sym.kind == skType + internalAssert b.kind == nkSym and b.sym.kind == skType regs[ra].uast.typ = b.sym.typ of opcNSetStrVal: decodeB(nkMetaNode) diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index b4b7877987..480c7f31b9 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -198,7 +198,7 @@ proc refresh*(c: PCtx, module: PSym) = const firstABxInstr* = opcTJmp largeInstrs* = { # instructions which use 2 int32s instead of 1: - opcSubstr, opcConv, opcCast, opcNewSeq, opcOf} + opcSubStr, opcConv, opcCast, opcNewSeq, opcOf} slotSomeTemp* = slotTempUnknown relativeJumps* = {opcTJmp, opcFJmp, opcJmp} diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index f686f10c29..563dbc6d17 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -85,7 +85,7 @@ proc genLabel(c: PCtx): TPosition = proc jmpBack(c: PCtx, n: PNode, opc: TOpcode, p = TPosition(0)) = let dist = p.int - c.code.len - InternalAssert(-0x7fff < dist and dist < 0x7fff) + internalAssert(-0x7fff < dist and dist < 0x7fff) gABx(c, n, opc, 0, dist) proc patch(c: PCtx, p: TPosition) = @@ -93,7 +93,7 @@ proc patch(c: PCtx, p: TPosition) = let p = p.int let diff = c.code.len - p #c.jumpTargets.incl(c.code.len) - InternalAssert(-0x7fff < diff and diff < 0x7fff) + internalAssert(-0x7fff < diff and diff < 0x7fff) let oldInstr = c.code[p] # opcode and regA stay the same: c.code[p] = ((oldInstr.uint32 and 0xffff'u32).uint32 or @@ -194,7 +194,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) proc gen(c: PCtx; n: PNode; dest: TRegister) = var d: TDest = dest gen(c, n, d) - InternalAssert d == dest + internalAssert d == dest proc gen(c: PCtx; n: PNode) = var tmp: TDest = -1 @@ -308,7 +308,7 @@ proc genAndOr(c: PCtx; n: PNode; opc: TOpcode; dest: var TDest) = proc rawGenLiteral(c: PCtx; n: PNode): int = result = c.constants.len c.constants.add n - InternalAssert result < 0x7fff + internalAssert result < 0x7fff proc sameConstant*(a, b: PNode): bool = result = false @@ -678,8 +678,8 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = tmp2 = c.genx(n.sons[2]) tmp3 = c.getTemp(n.sons[2].typ) c.gABC(n, opcLenStr, tmp3, tmp1) - c.gABC(n, opcSubstr, dest, tmp1, tmp2) - c.gABC(n, opcSubstr, tmp3) + c.gABC(n, opcSubStr, dest, tmp1, tmp2) + c.gABC(n, opcSubStr, tmp3) c.freeTemp(tmp1) c.freeTemp(tmp2) c.freeTemp(tmp3) @@ -689,8 +689,8 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = tmp1 = c.genx(n.sons[1]) tmp2 = c.genx(n.sons[2]) tmp3 = c.genx(n.sons[3]) - c.gABC(n, opcSubstr, dest, tmp1, tmp2) - c.gABC(n, opcSubstr, tmp3) + c.gABC(n, opcSubStr, dest, tmp1, tmp2) + c.gABC(n, opcSubStr, tmp3) c.freeTemp(tmp1) c.freeTemp(tmp2) c.freeTemp(tmp3) @@ -922,7 +922,7 @@ proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) = gen(c, ri, tmp) c.gABx(le, whichAsgnOpc(le, opcWrGlobal), tmp, s.position) else: - InternalAssert s.position > 0 or (s.position == 0 and + internalAssert s.position > 0 or (s.position == 0 and s.kind in {skParam, skResult}) var dest: TRegister = s.position + ord(s.kind == skParam) gen(c, ri, dest) @@ -1212,7 +1212,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = var lit = genLiteral(c, newIntNode(nkIntLit, s.position)) c.gABx(n, opcLdConst, dest, lit) of skField: - InternalAssert dest < 0 + internalAssert dest < 0 if s.position > high(dest): internalError(n.info, "too large offset! cannot generate code for: " & s.name.s) @@ -1346,7 +1346,7 @@ proc genParams(c: PCtx; params: PNode) = c.prc.maxSlots = max(params.len, 1) proc finalJumpTarget(c: PCtx; pc, diff: int) = - InternalAssert(-0x7fff < diff and diff < 0x7fff) + internalAssert(-0x7fff < diff and diff < 0x7fff) let oldInstr = c.code[pc] # opcode and regA stay the same: c.code[pc] = ((oldInstr.uint32 and 0xffff'u32).uint32 or diff --git a/koch.nim b/koch.nim index f09dcb044e..2dac27fbf2 100644 --- a/koch.nim +++ b/koch.nim @@ -115,7 +115,7 @@ proc findStartNimrod: string = if existsFile(dir / nimrod): return nimrod when defined(Posix): const buildScript = "build.sh" - if ExistsFile(buildScript): + if existsFile(buildScript): if tryExec("./" & buildScript): return "bin" / nimrod else: const buildScript = "build.bat" @@ -183,7 +183,7 @@ proc cleanAux(dir: string) = else: nil proc removePattern(pattern: string) = - for f in WalkFiles(pattern): + for f in walkFiles(pattern): echo "removing: ", f removeFile(f) diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim index 737780a122..b41a37309e 100644 --- a/lib/packages/docutils/highlite.nim +++ b/lib/packages/docutils/highlite.nim @@ -428,7 +428,7 @@ proc clikeNextToken(g: var TGeneralTokenizer, keywords: openArray[string], g.kind = gtOperator of 'a'..'z', 'A'..'Z', '_', '\x80'..'\xFF': var id = "" - while g.buf[pos] in SymChars: + while g.buf[pos] in symChars: add(id, g.buf[pos]) inc(pos) if isKeyword(keywords, id) >= 0: g.kind = gtKeyword diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index 316476ce0c..e6ffadcbd7 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -58,10 +58,10 @@ const mwUnsupportedLanguage: "language '$1' not supported" ] -proc rstnodeToRefname*(n: PRSTNode): string -proc addNodes*(n: PRSTNode): string -proc getFieldValue*(n: PRSTNode, fieldname: string): string -proc getArgument*(n: PRSTNode): string +proc rstnodeToRefname*(n: PRstNode): string +proc addNodes*(n: PRstNode): string +proc getFieldValue*(n: PRstNode, fieldname: string): string +proc getArgument*(n: PRstNode): string # ----------------------------- scanner part -------------------------------- @@ -130,7 +130,7 @@ proc getThing(L: var TLexer, tok: var TToken, s: TCharSet) = tok.line = L.line tok.col = L.col var pos = L.bufpos - while True: + while true: add(tok.symbol, L.buf[pos]) inc(pos) if L.buf[pos] notin s: break @@ -143,7 +143,7 @@ proc getAdornment(L: var TLexer, tok: var TToken) = tok.col = L.col var pos = L.bufpos var c = L.buf[pos] - while True: + while true: add(tok.symbol, L.buf[pos]) inc(pos) if L.buf[pos] != c: break @@ -162,7 +162,7 @@ proc getIndentAux(L: var TLexer, start: int): int = if L.skipPounds: if buf[pos] == '#': inc(pos) if buf[pos] == '#': inc(pos) - while True: + while true: case buf[pos] of ' ', '\x0B', '\x0C': inc(pos) @@ -251,10 +251,10 @@ proc getTokens(buffer: string, skipPounds: bool, tokens: var TTokenSeq): int = tokens[0].kind = tkIndent type - TLevelMap = array[Char, int] + TLevelMap = array[char, int] TSubstitution{.final.} = object key*: string - value*: PRSTNode + value*: PRstNode TSharedState {.final.} = object options: TRstParseOptions # parsing options @@ -351,7 +351,7 @@ proc initParser(p: var TRstParser, sharedState: PSharedState) = p.line = 1 p.s = sharedState -proc addNodesAux(n: PRSTNode, result: var string) = +proc addNodesAux(n: PRstNode, result: var string) = if n.kind == rnLeaf: add(result, n.text) else: @@ -361,7 +361,7 @@ proc addNodes(n: PRstNode): string = result = "" addNodesAux(n, result) -proc rstnodeToRefnameAux(n: PRSTNode, r: var string, b: var bool) = +proc rstnodeToRefnameAux(n: PRstNode, r: var string, b: var bool) = if n.kind == rnLeaf: for i in countup(0, len(n.text) - 1): case n.text[i] @@ -391,7 +391,7 @@ proc rstnodeToRefname(n: PRstNode): string = var b = false rstnodeToRefnameAux(n, result, b) -proc findSub(p: var TRstParser, n: PRSTNode): int = +proc findSub(p: var TRstParser, n: PRstNode): int = var key = addNodes(n) # the spec says: if no exact match, try one without case distinction: for i in countup(0, high(p.s.subs)): @@ -402,7 +402,7 @@ proc findSub(p: var TRstParser, n: PRSTNode): int = return i result = -1 -proc setSub(p: var TRstParser, key: string, value: PRSTNode) = +proc setSub(p: var TRstParser, key: string, value: PRstNode) = var length = len(p.s.subs) for i in countup(0, length - 1): if key == p.s.subs[i].key: @@ -412,7 +412,7 @@ proc setSub(p: var TRstParser, key: string, value: PRSTNode) = p.s.subs[length].key = key p.s.subs[length].value = value -proc setRef(p: var TRstParser, key: string, value: PRSTNode) = +proc setRef(p: var TRstParser, key: string, value: PRstNode) = var length = len(p.s.refs) for i in countup(0, length - 1): if key == p.s.refs[i].key: @@ -425,15 +425,15 @@ proc setRef(p: var TRstParser, key: string, value: PRSTNode) = p.s.refs[length].key = key p.s.refs[length].value = value -proc findRef(p: var TRstParser, key: string): PRSTNode = +proc findRef(p: var TRstParser, key: string): PRstNode = for i in countup(0, high(p.s.refs)): if key == p.s.refs[i].key: return p.s.refs[i].value -proc newLeaf(p: var TRstParser): PRSTNode = +proc newLeaf(p: var TRstParser): PRstNode = result = newRstNode(rnLeaf, p.tok[p.idx].symbol) -proc getReferenceName(p: var TRstParser, endStr: string): PRSTNode = +proc getReferenceName(p: var TRstParser, endStr: string): PRstNode = var res = newRstNode(rnInner) while true: case p.tok[p.idx].kind @@ -451,7 +451,7 @@ proc getReferenceName(p: var TRstParser, endStr: string): PRSTNode = inc(p.idx) result = res -proc untilEol(p: var TRstParser): PRSTNode = +proc untilEol(p: var TRstParser): PRstNode = result = newRstNode(rnInner) while not (p.tok[p.idx].kind in {tkIndent, tkEof}): add(result, newLeaf(p)) @@ -550,7 +550,7 @@ proc match(p: TRstParser, start: int, expr: string): bool = inc(i) result = true -proc fixupEmbeddedRef(n, a, b: PRSTNode) = +proc fixupEmbeddedRef(n, a, b: PRstNode) = var sep = - 1 for i in countdown(len(n) - 2, 0): if n.sons[i].text == "<": @@ -560,7 +560,7 @@ proc fixupEmbeddedRef(n, a, b: PRSTNode) = for i in countup(0, sep - incr): add(a, n.sons[i]) for i in countup(sep + 1, len(n) - 2): add(b, n.sons[i]) -proc parsePostfix(p: var TRstParser, n: PRSTNode): PRSTNode = +proc parsePostfix(p: var TRstParser, n: PRstNode): PRstNode = result = n if isInlineMarkupEnd(p, "_"): inc(p.idx) @@ -613,7 +613,7 @@ proc matchVerbatim(p: TRstParser, start: int, expr: string): int = inc result if j < expr.len: result = 0 -proc parseSmiley(p: var TRstParser): PRSTNode = +proc parseSmiley(p: var TRstParser): PRstNode = if p.tok[p.idx].symbol[0] notin SmileyStartChars: return for key, val in items(Smilies): let m = matchVerbatim(p, p.idx, key) @@ -629,14 +629,14 @@ when false: '$', '(', ')', '~', '_', '?', '+', '-', '=', '\\', '.', '&', '\128'..'\255'} -proc isURL(p: TRstParser, i: int): bool = +proc isUrl(p: TRstParser, i: int): bool = result = (p.tok[i+1].symbol == ":") and (p.tok[i+2].symbol == "//") and (p.tok[i+3].kind == tkWord) and (p.tok[i].symbol in ["http", "https", "ftp", "telnet", "file"]) -proc parseURL(p: var TRstParser, father: PRSTNode) = +proc parseUrl(p: var TRstParser, father: PRstNode) = #if p.tok[p.idx].symbol[strStart] == '<': - if isURL(p, p.idx): + if isUrl(p, p.idx): var n = newRstNode(rnStandaloneHyperlink) while true: case p.tok[p.idx].kind @@ -654,7 +654,7 @@ proc parseURL(p: var TRstParser, father: PRSTNode) = if p.tok[p.idx].symbol == "_": n = parsePostfix(p, n) add(father, n) -proc parseBackslash(p: var TRstParser, father: PRSTNode) = +proc parseBackslash(p: var TRstParser, father: PRstNode) = assert(p.tok[p.idx].kind == tkPunct) if p.tok[p.idx].symbol == "\\\\": add(father, newRstNode(rnLeaf, "\\")) @@ -692,7 +692,7 @@ when false: if p.tok[p.idx].symbol == "_": n = parsePostfix(p, n) add(father, n) -proc parseUntil(p: var TRstParser, father: PRSTNode, postfix: string, +proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string, interpretBackslash: bool) = let line = p.tok[p.idx].line @@ -723,7 +723,7 @@ proc parseUntil(p: var TRstParser, father: PRSTNode, postfix: string, inc(p.idx) else: rstMessage(p, meExpected, postfix, line, col) -proc parseMarkdownCodeblock(p: var TRstParser): PRSTNode = +proc parseMarkdownCodeblock(p: var TRstParser): PRstNode = var args = newRstNode(rnDirArg) if p.tok[p.idx].kind == tkWord: add(args, newLeaf(p)) @@ -753,7 +753,7 @@ proc parseMarkdownCodeblock(p: var TRstParser): PRSTNode = add(result, nil) add(result, lb) -proc parseInline(p: var TRstParser, father: PRSTNode) = +proc parseInline(p: var TRstParser, father: PRstNode) = case p.tok[p.idx].kind of tkPunct: if isInlineMarkupStart(p, "***"): @@ -797,7 +797,7 @@ proc parseInline(p: var TRstParser, father: PRSTNode) = if n != nil: add(father, n) return - parseURL(p, father) + parseUrl(p, father) of tkAdornment, tkOther, tkWhite: if roSupportSmilies in p.s.options: let n = parseSmiley(p) @@ -828,21 +828,21 @@ proc getDirective(p: var TRstParser): string = else: result = "" -proc parseComment(p: var TRstParser): PRSTNode = +proc parseComment(p: var TRstParser): PRstNode = case p.tok[p.idx].kind of tkIndent, tkEof: if p.tok[p.idx].kind != tkEof and p.tok[p.idx + 1].kind == tkIndent: inc(p.idx) # empty comment else: var indent = p.tok[p.idx].ival - while True: + while true: case p.tok[p.idx].kind of tkEof: break of tkIndent: if (p.tok[p.idx].ival < indent): break else: - nil + discard inc(p.idx) else: while p.tok[p.idx].kind notin {tkIndent, tkEof}: inc(p.idx) @@ -863,25 +863,25 @@ proc getDirKind(s: string): TDirKind = if i >= 0: result = TDirKind(i) else: result = dkNone -proc parseLine(p: var TRstParser, father: PRSTNode) = - while True: +proc parseLine(p: var TRstParser, father: PRstNode) = + while true: case p.tok[p.idx].kind of tkWhite, tkWord, tkOther, tkPunct: parseInline(p, father) else: break -proc parseUntilNewline(p: var TRstParser, father: PRSTNode) = - while True: +proc parseUntilNewline(p: var TRstParser, father: PRstNode) = + while true: case p.tok[p.idx].kind of tkWhite, tkWord, tkAdornment, tkOther, tkPunct: parseInline(p, father) of tkEof, tkIndent: break -proc parseSection(p: var TRstParser, result: PRSTNode) -proc parseField(p: var TRstParser): PRSTNode = +proc parseSection(p: var TRstParser, result: PRstNode) +proc parseField(p: var TRstParser): PRstNode = result = newRstNode(rnField) var col = p.tok[p.idx].col - var fieldname = newRstNode(rnFieldname) + var fieldname = newRstNode(rnFieldName) parseUntil(p, fieldname, ":", false) - var fieldbody = newRstNode(rnFieldbody) + var fieldbody = newRstNode(rnFieldBody) if p.tok[p.idx].kind != tkIndent: parseLine(p, fieldbody) if p.tok[p.idx].kind == tkIndent: var indent = p.tok[p.idx].ival @@ -892,7 +892,7 @@ proc parseField(p: var TRstParser): PRSTNode = add(result, fieldname) add(result, fieldbody) -proc parseFields(p: var TRstParser): PRSTNode = +proc parseFields(p: var TRstParser): PRstNode = result = nil var atStart = p.idx == 0 and p.tok[0].symbol == ":" if (p.tok[p.idx].kind == tkIndent) and (p.tok[p.idx + 1].symbol == ":") or @@ -926,14 +926,14 @@ proc getArgument(n: PRstNode): string = if n.sons[0] == nil: result = "" else: result = addNodes(n.sons[0]) -proc parseDotDot(p: var TRstParser): PRSTNode -proc parseLiteralBlock(p: var TRstParser): PRSTNode = +proc parseDotDot(p: var TRstParser): PRstNode +proc parseLiteralBlock(p: var TRstParser): PRstNode = result = newRstNode(rnLiteralBlock) var n = newRstNode(rnLeaf, "") if p.tok[p.idx].kind == tkIndent: var indent = p.tok[p.idx].ival inc(p.idx) - while True: + while true: case p.tok[p.idx].kind of tkEof: break @@ -1032,7 +1032,7 @@ proc whichSection(p: TRstParser): TRstNodeKind = else: result = rnParagraph else: result = rnLeaf -proc parseLineBlock(p: var TRstParser): PRSTNode = +proc parseLineBlock(p: var TRstParser): PRstNode = result = nil if p.tok[p.idx + 1].kind == tkWhite: var col = p.tok[p.idx].col @@ -1051,8 +1051,8 @@ proc parseLineBlock(p: var TRstParser): PRSTNode = break popInd(p) -proc parseParagraph(p: var TRstParser, result: PRSTNode) = - while True: +proc parseParagraph(p: var TRstParser, result: PRstNode) = + while true: case p.tok[p.idx].kind of tkIndent: if p.tok[p.idx + 1].kind == tkIndent: @@ -1082,7 +1082,7 @@ proc parseParagraph(p: var TRstParser, result: PRSTNode) = parseInline(p, result) else: break -proc parseHeadline(p: var TRstParser): PRSTNode = +proc parseHeadline(p: var TRstParser): PRstNode = result = newRstNode(rnHeadline) parseUntilNewline(p, result) assert(p.tok[p.idx].kind == tkIndent) @@ -1112,16 +1112,16 @@ proc getColumns(p: var TRstParser, cols: var TIntSeq) = # last column has no limit: cols[L - 1] = 32000 -proc parseDoc(p: var TRstParser): PRSTNode +proc parseDoc(p: var TRstParser): PRstNode -proc parseSimpleTable(p: var TRstParser): PRSTNode = +proc parseSimpleTable(p: var TRstParser): PRstNode = var cols: TIntSeq row: seq[string] i, last, line: int c: char q: TRstParser - a, b: PRSTNode + a, b: PRstNode result = newRstNode(rnTable) cols = @[] row = @[] @@ -1167,13 +1167,13 @@ proc parseSimpleTable(p: var TRstParser): PRSTNode = add(a, b) add(result, a) -proc parseTransition(p: var TRstParser): PRSTNode = +proc parseTransition(p: var TRstParser): PRstNode = result = newRstNode(rnTransition) inc(p.idx) if p.tok[p.idx].kind == tkIndent: inc(p.idx) if p.tok[p.idx].kind == tkIndent: inc(p.idx) -proc parseOverline(p: var TRstParser): PRSTNode = +proc parseOverline(p: var TRstParser): PRstNode = var c = p.tok[p.idx].symbol[0] inc(p.idx, 2) result = newRstNode(rnOverline) @@ -1192,7 +1192,7 @@ proc parseOverline(p: var TRstParser): PRSTNode = inc(p.idx) # XXX: check? if p.tok[p.idx].kind == tkIndent: inc(p.idx) -proc parseBulletList(p: var TRstParser): PRSTNode = +proc parseBulletList(p: var TRstParser): PRstNode = result = nil if p.tok[p.idx + 1].kind == tkWhite: var bullet = p.tok[p.idx].symbol @@ -1212,7 +1212,7 @@ proc parseBulletList(p: var TRstParser): PRSTNode = break popInd(p) -proc parseOptionList(p: var TRstParser): PRSTNode = +proc parseOptionList(p: var TRstParser): PRstNode = result = newRstNode(rnOptionList) while true: if isOptionList(p): @@ -1241,7 +1241,7 @@ proc parseOptionList(p: var TRstParser): PRSTNode = else: break -proc parseDefinitionList(p: var TRstParser): PRSTNode = +proc parseDefinitionList(p: var TRstParser): PRstNode = result = nil var j = tokenAfterNewline(p) - 1 if (j >= 1) and (p.tok[j].kind == tkIndent) and @@ -1272,12 +1272,12 @@ proc parseDefinitionList(p: var TRstParser): PRSTNode = j = tokenAfterNewline(p) - 1 if j >= 1 and p.tok[j].kind == tkIndent and p.tok[j].ival > col and p.tok[j-1].symbol != "::" and p.tok[j+1].kind != tkIndent: - nil + discard else: break if len(result) == 0: result = nil -proc parseEnumList(p: var TRstParser): PRSTNode = +proc parseEnumList(p: var TRstParser): PRstNode = const wildcards: array[0..2, string] = ["(e) ", "e) ", "e. "] wildpos: array[0..2, int] = [1, 0, 0] @@ -1307,7 +1307,7 @@ proc parseEnumList(p: var TRstParser): PRSTNode = dec(p.idx, wildpos[w] + 3) result = nil -proc sonKind(father: PRSTNode, i: int): TRstNodeKind = +proc sonKind(father: PRstNode, i: int): TRstNodeKind = result = rnLeaf if i < len(father): result = father.sons[i].kind @@ -1328,14 +1328,14 @@ proc parseSection(p: var TRstParser, result: PRstNode) = leave = true break if leave or p.tok[p.idx].kind == tkEof: break - var a: PRSTNode = nil + var a: PRstNode = nil var k = whichSection(p) case k of rnLiteralBlock: inc(p.idx) # skip '::' a = parseLiteralBlock(p) of rnBulletList: a = parseBulletList(p) - of rnLineblock: a = parseLineBlock(p) + of rnLineBlock: a = parseLineBlock(p) of rnDirective: a = parseDotDot(p) of rnEnumList: a = parseEnumList(p) of rnLeaf: rstMessage(p, meNewSectionExpected) @@ -1359,7 +1359,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) = if sonKind(result, 0) == rnParagraph and sonKind(result, 1) != rnParagraph: result.sons[0].kind = rnInner -proc parseSectionWrapper(p: var TRstParser): PRSTNode = +proc parseSectionWrapper(p: var TRstParser): PRstNode = result = newRstNode(rnInner) parseSection(p, result) while (result.kind == rnInner) and (len(result) == 1): @@ -1385,16 +1385,16 @@ type TDirFlag = enum hasArg, hasOptions, argIsFile, argIsWord TDirFlags = set[TDirFlag] - TSectionParser = proc (p: var TRstParser): PRSTNode {.nimcall.} + TSectionParser = proc (p: var TRstParser): PRstNode {.nimcall.} -proc parseDirective(p: var TRstParser, flags: TDirFlags): PRSTNode = +proc parseDirective(p: var TRstParser, flags: TDirFlags): PRstNode = result = newRstNode(rnDirective) - var args: PRSTNode = nil - var options: PRSTNode = nil + var args: PRstNode = nil + var options: PRstNode = nil if hasArg in flags: args = newRstNode(rnDirArg) if argIsFile in flags: - while True: + while true: case p.tok[p.idx].kind of tkWord, tkOther, tkPunct, tkAdornment: add(args, newLeaf(p)) @@ -1420,7 +1420,7 @@ proc indFollows(p: TRstParser): bool = result = p.tok[p.idx].kind == tkIndent and p.tok[p.idx].ival > currInd(p) proc parseDirective(p: var TRstParser, flags: TDirFlags, - contentParser: TSectionParser): PRSTNode = + contentParser: TSectionParser): PRstNode = result = parseDirective(p, flags) if not isNil(contentParser) and indFollows(p): pushInd(p, p.tok[p.idx].ival) @@ -1430,13 +1430,13 @@ proc parseDirective(p: var TRstParser, flags: TDirFlags, else: add(result, nil) -proc parseDirBody(p: var TRstParser, contentParser: TSectionParser): PRSTNode = +proc parseDirBody(p: var TRstParser, contentParser: TSectionParser): PRstNode = if indFollows(p): pushInd(p, p.tok[p.idx].ival) result = contentParser(p) popInd(p) -proc dirInclude(p: var TRstParser): PRSTNode = +proc dirInclude(p: var TRstParser): PRstNode = # #The following options are recognized: # @@ -1474,7 +1474,7 @@ proc dirInclude(p: var TRstParser): PRSTNode = # InternalError("Too many binary zeros in include file") result = parseDoc(q) -proc dirCodeBlock(p: var TRstParser): PRSTNode = +proc dirCodeBlock(p: var TRstParser): PRstNode = result = parseDirective(p, {hasArg, hasOptions}, parseLiteralBlock) var filename = strip(getFieldValue(result, "file")) if filename != "": @@ -1485,34 +1485,34 @@ proc dirCodeBlock(p: var TRstParser): PRSTNode = result.sons[2] = n result.kind = rnCodeBlock -proc dirContainer(p: var TRstParser): PRSTNode = +proc dirContainer(p: var TRstParser): PRstNode = result = parseDirective(p, {hasArg}, parseSectionWrapper) assert(result.kind == rnDirective) assert(len(result) == 3) result.kind = rnContainer -proc dirImage(p: var TRstParser): PRSTNode = +proc dirImage(p: var TRstParser): PRstNode = result = parseDirective(p, {hasOptions, hasArg, argIsFile}, nil) result.kind = rnImage -proc dirFigure(p: var TRstParser): PRSTNode = +proc dirFigure(p: var TRstParser): PRstNode = result = parseDirective(p, {hasOptions, hasArg, argIsFile}, parseSectionWrapper) result.kind = rnFigure -proc dirTitle(p: var TRstParser): PRSTNode = +proc dirTitle(p: var TRstParser): PRstNode = result = parseDirective(p, {hasArg}, nil) result.kind = rnTitle -proc dirContents(p: var TRstParser): PRSTNode = +proc dirContents(p: var TRstParser): PRstNode = result = parseDirective(p, {hasArg}, nil) result.kind = rnContents -proc dirIndex(p: var TRstParser): PRSTNode = +proc dirIndex(p: var TRstParser): PRstNode = result = parseDirective(p, {}, parseSectionWrapper) result.kind = rnIndex -proc dirRawAux(p: var TRstParser, result: var PRSTNode, kind: TRstNodeKind, +proc dirRawAux(p: var TRstParser, result: var PRstNode, kind: TRstNodeKind, contentParser: TSectionParser) = var filename = getFieldValue(result, "file") if filename.len > 0: @@ -1527,7 +1527,7 @@ proc dirRawAux(p: var TRstParser, result: var PRSTNode, kind: TRstNodeKind, result.kind = kind add(result, parseDirBody(p, contentParser)) -proc dirRaw(p: var TRstParser): PRSTNode = +proc dirRaw(p: var TRstParser): PRstNode = # #The following options are recognized: # @@ -1566,7 +1566,7 @@ proc parseDotDot(p: var TRstParser): PRstNode = result = dirRaw(p) else: rstMessage(p, meInvalidDirective, d) - of dkCodeblock: result = dirCodeBlock(p) + of dkCodeBlock: result = dirCodeBlock(p) of dkIndex: result = dirIndex(p) else: rstMessage(p, meInvalidDirective, d) popInd(p) @@ -1581,7 +1581,7 @@ proc parseDotDot(p: var TRstParser): PRstNode = # substitution definitions: inc(p.idx, 2) var a = getReferenceName(p, "|") - var b: PRSTNode + var b: PRstNode if p.tok[p.idx].kind == tkWhite: inc(p.idx) if cmpIgnoreStyle(p.tok[p.idx].symbol, "replace") == 0: inc(p.idx) @@ -1603,7 +1603,7 @@ proc parseDotDot(p: var TRstParser): PRstNode = else: result = parseComment(p) -proc resolveSubs(p: var TRstParser, n: PRSTNode): PRSTNode = +proc resolveSubs(p: var TRstParser, n: PRstNode): PRstNode = result = n if n == nil: return case n.kind @@ -1634,7 +1634,7 @@ proc rstParse*(text, filename: string, line, column: int, hasToc: var bool, options: TRstParseOptions, findFile: TFindFileHandler = nil, - msgHandler: TMsgHandler = nil): PRSTNode = + msgHandler: TMsgHandler = nil): PRstNode = var p: TRstParser initParser(p, newSharedState(options, findFile, msgHandler)) p.filename = filename diff --git a/lib/packages/docutils/rstast.nim b/lib/packages/docutils/rstast.nim index bb0b618893..f5ef0f53d0 100644 --- a/lib/packages/docutils/rstast.nim +++ b/lib/packages/docutils/rstast.nim @@ -62,34 +62,34 @@ type # leaf val - PRSTNode* = ref TRSTNode ## an RST node - TRstNodeSeq* = seq[PRSTNode] - TRSTNode* {.acyclic, final.} = object ## an RST node's description + PRstNode* = ref TRstNode ## an RST node + TRstNodeSeq* = seq[PRstNode] + TRstNode* {.acyclic, final.} = object ## an RST node's description kind*: TRstNodeKind ## the node's kind text*: string ## valid for leafs in the AST; and the title of ## the document or the section level*: int ## valid for some node kinds sons*: TRstNodeSeq ## the node's sons -proc len*(n: PRSTNode): int = +proc len*(n: PRstNode): int = result = len(n.sons) -proc newRstNode*(kind: TRstNodeKind): PRSTNode = +proc newRstNode*(kind: TRstNodeKind): PRstNode = new(result) result.sons = @[] result.kind = kind -proc newRstNode*(kind: TRstNodeKind, s: string): PRSTNode = +proc newRstNode*(kind: TRstNodeKind, s: string): PRstNode = result = newRstNode(kind) result.text = s -proc lastSon*(n: PRSTNode): PRSTNode = +proc lastSon*(n: PRstNode): PRstNode = result = n.sons[len(n.sons)-1] -proc add*(father, son: PRSTNode) = +proc add*(father, son: PRstNode) = add(father.sons, son) -proc addIfNotNil*(father, son: PRSTNode) = +proc addIfNotNil*(father, son: PRstNode) = if son != nil: add(father, son) @@ -98,9 +98,9 @@ type indent: int verbatim: int -proc renderRstToRst(d: var TRenderContext, n: PRSTNode, result: var string) +proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string) -proc renderRstSons(d: var TRenderContext, n: PRSTNode, result: var string) = +proc renderRstSons(d: var TRenderContext, n: PRstNode, result: var string) = for i in countup(0, len(n) - 1): renderRstToRst(d, n.sons[i], result) @@ -281,7 +281,7 @@ proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string) = else: result.add("Error: cannot render: " & $n.kind) -proc renderRstToRst*(n: PRSTNode, result: var string) = +proc renderRstToRst*(n: PRstNode, result: var string) = ## renders `n` into its string representation and appends to `result`. var d: TRenderContext renderRstToRst(d, n, result) diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index f43c6e478b..988338da19 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -32,7 +32,7 @@ type outLatex # output is Latex TTocEntry{.final.} = object - n*: PRSTNode + n*: PRstNode refname*, header*: string TMetaEnum* = enum @@ -196,7 +196,7 @@ proc dispA(target: TOutputTarget, dest: var string, if target != outLatex: addf(dest, xml, args) else: addf(dest, tex, args) -proc renderRstToOut*(d: var TRstGenerator, n: PRSTNode, result: var string) +proc renderRstToOut*(d: var TRstGenerator, n: PRstNode, result: var string) ## Writes into ``result`` the rst ast ``n`` using the ``d`` configuration. ## ## Before using this proc you need to initialise a ``TRstGenerator`` with @@ -210,10 +210,10 @@ proc renderRstToOut*(d: var TRstGenerator, n: PRSTNode, result: var string) ## renderRstToOut(gen, rst, generatedHTML) ## echo generatedHTML -proc renderAux(d: PDoc, n: PRSTNode, result: var string) = +proc renderAux(d: PDoc, n: PRstNode, result: var string) = for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], result) -proc renderAux(d: PDoc, n: PRSTNode, frmtA, frmtB: string, result: var string) = +proc renderAux(d: PDoc, n: PRstNode, frmtA, frmtB: string, result: var string) = var tmp = "" for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], tmp) if d.target != outLatex: @@ -232,7 +232,7 @@ proc setIndexTerm*(d: var TRstGenerator, id, term: string) = d.theIndex.add(id) d.theIndex.add("\n") -proc hash(n: PRSTNode): int = +proc hash(n: PRstNode): int = if n.kind == rnLeaf: result = hash(n.text) elif n.len > 0: @@ -241,7 +241,7 @@ proc hash(n: PRSTNode): int = result = result !& hash(n.sons[i]) result = !$result -proc renderIndexTerm(d: PDoc, n: PRSTNode, result: var string) = +proc renderIndexTerm(d: PDoc, n: PRstNode, result: var string) = let id = rstnodeToRefname(n) & '_' & $abs(hash(n)) var term = "" renderAux(d, n, term) @@ -314,7 +314,7 @@ proc mergeIndexes*(dir: string): string = # ---------------------------------------------------------------------------- -proc renderHeadline(d: PDoc, n: PRSTNode, result: var string) = +proc renderHeadline(d: PDoc, n: PRstNode, result: var string) = var tmp = "" for i in countup(0, len(n) - 1): renderRstToOut(d, n.sons[i], tmp) var refname = rstnodeToRefname(n) @@ -336,7 +336,7 @@ proc renderHeadline(d: PDoc, n: PRSTNode, result: var string) = $n.level, refname, tmp, $chr(n.level - 1 + ord('A'))]) -proc renderOverline(d: PDoc, n: PRSTNode, result: var string) = +proc renderOverline(d: PDoc, n: PRstNode, result: var string) = if d.meta[metaTitle].len == 0: for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], d.meta[metaTitle]) @@ -373,7 +373,7 @@ proc renderTocEntries*(d: var TRstGenerator, j: var int, lvl: int, result: var s else: result.add(tmp) -proc renderImage(d: PDoc, n: PRSTNode, result: var string) = +proc renderImage(d: PDoc, n: PRstNode, result: var string) = var options = "" var s = getFieldValue(n, "scale") if s != "": dispA(d.target, options, " scale=\"$1\"", " scale=$1", [strip(s)]) @@ -396,13 +396,13 @@ proc renderImage(d: PDoc, n: PRSTNode, result: var string) = [getArgument(n), options]) if len(n) >= 3: renderRstToOut(d, n.sons[2], result) -proc renderSmiley(d: PDoc, n: PRSTNode, result: var string) = +proc renderSmiley(d: PDoc, n: PRstNode, result: var string) = dispA(d.target, result, """<img src="/images/smilies/$1.gif" width="15" height="17" hspace="2" vspace="2" />""", "\\includegraphics{$1}", [n.text]) -proc renderCodeBlock(d: PDoc, n: PRSTNode, result: var string) = +proc renderCodeBlock(d: PDoc, n: PRstNode, result: var string) = if n.sons[2] == nil: return var m = n.sons[2].sons[0] assert m.kind == rnLeaf @@ -433,7 +433,7 @@ proc renderCodeBlock(d: PDoc, n: PRSTNode, result: var string) = deinitGeneralTokenizer(g) dispA(d.target, result, "</pre>", "\n\\end{rstpre}\n") -proc renderContainer(d: PDoc, n: PRSTNode, result: var string) = +proc renderContainer(d: PDoc, n: PRstNode, result: var string) = var tmp = "" renderRstToOut(d, n.sons[2], tmp) var arg = strip(getArgument(n)) @@ -442,11 +442,11 @@ proc renderContainer(d: PDoc, n: PRSTNode, result: var string) = else: dispA(d.target, result, "<div class=\"$1\">$2</div>", "$2", [arg, tmp]) -proc texColumns(n: PRSTNode): string = +proc texColumns(n: PRstNode): string = result = "" for i in countup(1, len(n)): add(result, "|X") -proc renderField(d: PDoc, n: PRSTNode, result: var string) = +proc renderField(d: PDoc, n: PRstNode, result: var string) = var b = false if d.target == outLatex: var fieldname = addNodes(n.sons[0]) diff --git a/lib/pure/json.nim b/lib/pure/json.nim index f0d0aa0c0c..c79e6e6da4 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -645,7 +645,7 @@ proc hasKey*(node: PJsonNode, key: string): bool = ## Checks if `key` exists in `node`. assert(node.kind == JObject) for k, item in items(node.fields): - if k == key: return True + if k == key: return true proc existsKey*(node: PJsonNode, key: string): bool {.deprecated.} = node.hasKey(key) ## Deprecated for `hasKey` @@ -730,8 +730,8 @@ proc escapeJson*(s: string): string = result.add(toHex(r, 4)) result.add("\"") -proc toPretty(result: var string, node: PJsonNode, indent = 2, ml = True, - lstArr = False, currIndent = 0) = +proc toPretty(result: var string, node: PJsonNode, indent = 2, ml = true, + lstArr = false, currIndent = 0) = case node.kind of JObject: if currIndent != 0 and not lstArr: result.nl(ml) @@ -747,7 +747,7 @@ proc toPretty(result: var string, node: PJsonNode, indent = 2, ml = True, result.indent(newIndent(currIndent, indent, ml)) result.add(escapeJson(node.fields[i].key)) result.add(": ") - toPretty(result, node.fields[i].val, indent, ml, False, + toPretty(result, node.fields[i].val, indent, ml, false, newIndent(currIndent, indent, ml)) result.nl(ml) result.indent(currIndent) # indent the same as { @@ -776,7 +776,7 @@ proc toPretty(result: var string, node: PJsonNode, indent = 2, ml = True, result.add(", ") result.nl(ml) # New Line toPretty(result, node.elems[i], indent, ml, - True, newIndent(currIndent, indent, ml)) + true, newIndent(currIndent, indent, ml)) result.nl(ml) result.indent(currIndent) result.add("]") @@ -794,7 +794,7 @@ proc pretty*(node: PJsonNode, indent = 2): string = proc `$`*(node: PJsonNode): string = ## Converts `node` to its JSON Representation on one line. result = "" - toPretty(result, node, 1, False) + toPretty(result, node, 1, false) iterator items*(node: PJsonNode): PJsonNode = ## Iterator for the items of `node`. `node` has to be a JArray. diff --git a/lib/pure/lexbase.nim b/lib/pure/lexbase.nim index 243c7dc4a4..81f53b8743 100644 --- a/lib/pure/lexbase.nim +++ b/lib/pure/lexbase.nim @@ -102,7 +102,7 @@ proc fillBuffer(L: var TBaseLexer) = oldBufLen = L.BufLen L.bufLen = L.BufLen * 2 L.buf = cast[cstring](realloc(L.buf, L.bufLen * chrSize)) - assert(L.bufLen - oldBuflen == oldBufLen) + assert(L.bufLen - oldBufLen == oldBufLen) charsRead = readData(L.input, addr(L.buf[oldBufLen]), oldBufLen * chrSize) div chrSize if charsRead < oldBufLen: diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 202052bc67..c1b71c2023 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -95,8 +95,8 @@ elif defined(macos): const CurDir* = ':' ParDir* = "::" - Dirsep* = ':' - Altsep* = Dirsep + DirSep* = ':' + AltSep* = Dirsep PathSep* = ',' FileSystemCaseSensitive* = false ExeExt* = "" @@ -123,10 +123,10 @@ elif defined(macos): # grandparent etc. elif doslike: const - Curdir* = '.' - Pardir* = ".." - Dirsep* = '\\' # seperator within paths - Altsep* = '/' + CurDir* = '.' + ParDir* = ".." + DirSep* = '\\' # seperator within paths + AltSep* = '/' PathSep* = ';' # seperator between paths FileSystemCaseSensitive* = false ExeExt* = "exe" @@ -134,19 +134,19 @@ elif doslike: DynlibFormat* = "$1.dll" elif defined(PalmOS) or defined(MorphOS): const - Dirsep* = '/' - Altsep* = Dirsep + DirSep* = '/' + AltSep* = Dirsep PathSep* = ';' - Pardir* = ".." + ParDir* = ".." FileSystemCaseSensitive* = false ExeExt* = "" ScriptExt* = "" DynlibFormat* = "$1.prc" elif defined(RISCOS): const - Dirsep* = '.' - Altsep* = '.' - Pardir* = ".." # is this correct? + DirSep* = '.' + AltSep* = '.' + ParDir* = ".." # is this correct? PathSep* = ',' FileSystemCaseSensitive* = true ExeExt* = "" @@ -154,10 +154,10 @@ elif defined(RISCOS): DynlibFormat* = "lib$1.so" else: # UNIX-like operating system const - Curdir* = '.' - Pardir* = ".." - Dirsep* = '/' - Altsep* = Dirsep + CurDir* = '.' + ParDir* = ".." + DirSep* = '/' + AltSep* = Dirsep PathSep* = ':' FileSystemCaseSensitive* = true ExeExt* = "" @@ -308,7 +308,7 @@ proc unixToNativePath*(path: string): string {. start = 1 elif path[0] == '.' and path[1] == '/': # current directory - result = $Curdir + result = $CurDir start = 2 else: result = "" @@ -538,7 +538,7 @@ proc splitPath*(path: string): tuple[head, tail: string] {. ## splitPath("") -> ("", "") var sepPos = -1 for i in countdown(len(path)-1, 0): - if path[i] in {Dirsep, Altsep}: + if path[i] in {DirSep, AltSep}: sepPos = i break if sepPos >= 0: @@ -550,9 +550,9 @@ proc splitPath*(path: string): tuple[head, tail: string] {. proc parentDirPos(path: string): int = var q = 1 - if path[len(path)-1] in {Dirsep, Altsep}: q = 2 + if path[len(path)-1] in {DirSep, AltSep}: q = 2 for i in countdown(len(path)-q, 0): - if path[i] in {Dirsep, Altsep}: return i + if path[i] in {DirSep, AltSep}: return i result = -1 proc parentDir*(path: string): string {. @@ -593,8 +593,8 @@ iterator parentDirs*(path: string, fromRoot=false, inclusive=true): string = else: for i in countup(0, path.len - 2): # ignore the last / # deal with non-normalized paths such as /foo//bar//baz - if path[i] in {Dirsep, Altsep} and - (i == 0 or path[i-1] notin {Dirsep, Altsep}): + if path[i] in {DirSep, AltSep} and + (i == 0 or path[i-1] notin {DirSep, AltSep}): yield path.substr(0, i) if inclusive: yield path @@ -619,7 +619,7 @@ proc searchExtPos(s: string): int = if s[i] == ExtSep: result = i break - elif s[i] in {Dirsep, Altsep}: + elif s[i] in {DirSep, AltSep}: break # do not skip over path proc splitFile*(path: string): tuple[dir, name, ext: string] {. @@ -639,7 +639,7 @@ proc splitFile*(path: string): tuple[dir, name, ext: string] {. ## If `path` has no extension, `ext` is the empty string. ## If `path` has no directory component, `dir` is the empty string. ## If `path` has no filename component, `name` and `ext` are empty strings. - if path.len == 0 or path[path.len-1] in {DirSep, Altsep}: + if path.len == 0 or path[path.len-1] in {DirSep, AltSep}: result = (path, "", "") else: var sepPos = -1 @@ -647,8 +647,8 @@ proc splitFile*(path: string): tuple[dir, name, ext: string] {. for i in countdown(len(path)-1, 0): if path[i] == ExtSep: if dotPos == path.len and i > 0 and - path[i-1] notin {Dirsep, Altsep}: dotPos = i - elif path[i] in {Dirsep, Altsep}: + path[i-1] notin {DirSep, AltSep}: dotPos = i + elif path[i] in {DirSep, AltSep}: sepPos = i break result.dir = substr(path, 0, sepPos-1) @@ -659,7 +659,7 @@ proc extractFilename*(path: string): string {. noSideEffect, rtl, extern: "nos$1".} = ## Extracts the filename of a given `path`. This is the same as ## ``name & ext`` from ``splitFile(path)``. - if path.len == 0 or path[path.len-1] in {DirSep, Altsep}: + if path.len == 0 or path[path.len-1] in {DirSep, AltSep}: result = "" else: result = splitPath(path).tail @@ -814,11 +814,11 @@ proc sameFileContent*(path1, path2: string): bool {.rtl, extern: "nos$1", if not open(b, path2): close(a) return false - var bufA = alloc(bufsize) - var bufB = alloc(bufsize) + var bufA = alloc(bufSize) + var bufB = alloc(bufSize) while true: - var readA = readBuffer(a, bufA, bufsize) - var readB = readBuffer(b, bufB, bufsize) + var readA = readBuffer(a, bufA, bufSize) + var readB = readBuffer(b, bufB, bufSize) if readA != readB: result = false break @@ -1159,7 +1159,7 @@ iterator walkFiles*(pattern: string): string {.tags: [FReadDir].} = while true: if not skipFindData(f): yield splitFile(pattern).dir / extractFilename(getFilename(f)) - if findnextFile(res, f) == 0'i32: break + if findNextFile(res, f) == 0'i32: break findClose(res) else: # here we use glob var @@ -1214,7 +1214,7 @@ iterator walkDir*(dir: string): tuple[kind: TPathComponent, path: string] {. if (f.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) != 0'i32: k = pcDir yield (k, dir / extractFilename(getFilename(f))) - if findnextFile(h, f) == 0'i32: break + if findNextFile(h, f) == 0'i32: break findClose(h) else: var d = openDir(dir) @@ -1308,7 +1308,7 @@ proc createDir*(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = when defined(doslike): omitNext = isAbsolute(dir) for i in 1.. dir.len-1: - if dir[i] in {Dirsep, Altsep}: + if dir[i] in {DirSep, AltSep}: if omitNext: omitNext = false else: diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 49b4b6fabf..1be30f006c 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -396,7 +396,7 @@ when defined(Windows) and not defined(useNimRtl): proc startProcess(command: string, workingDir: string = "", - args: openarray[string] = [], + args: openArray[string] = [], env: PStringTable = nil, options: set[TProcessOption] = {poStdErrToStdOut}): PProcess = var diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index 1be292af1c..5076d72fdd 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -105,7 +105,7 @@ proc next*(p: var TOptParser) {. of '-': inc(i) if p.cmd[i] == '-': - p.kind = cmdLongOption + p.kind = cmdLongoption inc(i) i = parseWord(p.cmd, i, p.key.string, {'\0', ' ', '\x09', ':', '='}) while p.cmd[i] in {'\x09', ' '}: inc(i) diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index 2ae37e3721..dee45cbd66 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -26,7 +26,7 @@ {.deadCodeElim: on.} -when hostos == "solaris": +when hostOS == "solaris": {.passl: "-lsocket -lnsl".} import os, parseutils @@ -467,7 +467,7 @@ template acceptAddrPlain(noClientRet, successRet: expr, sslImplementation: stmt): stmt {.immediate.} = assert(client != nil) var sockAddress: Tsockaddr_in - var addrLen = sizeof(sockAddress).Tsocklen + var addrLen = sizeof(sockAddress).TSockLen var sock = accept(server.fd, cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen)) @@ -1258,10 +1258,10 @@ proc recvLine*(socket: TSocket, line: var TaintedString, timeout = -1): bool {. if n > 0 and c == '\L': discard recv(socket, addr(c), 1) elif n <= 0: return false - addNlIfEmpty() + addNLIfEmpty() return true elif c == '\L': - addNlIfEmpty() + addNLIfEmpty() return true add(line.string, c) @@ -1299,10 +1299,10 @@ proc readLine*(socket: TSocket, line: var TaintedString, timeout = -1) {. if n > 0 and c == '\L': discard recv(socket, addr(c), 1) elif n <= 0: osError(osLastError()) - addNlIfEmpty() + addNLIfEmpty() return elif c == '\L': - addNlIfEmpty() + addNLIfEmpty() return add(line.string, c) @@ -1457,7 +1457,7 @@ proc recvAsync*(socket: TSocket, s: var TaintedString): bool {. let err = osLastError() when defined(windows): if err.int32 == WSAEWOULDBLOCK: - return False + return false else: osError(err) else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: @@ -1469,7 +1469,7 @@ proc recvAsync*(socket: TSocket, s: var TaintedString): bool {. # increase capacity: setLen(s.string, s.string.len + bufSize) inc(pos, bytesRead) - result = True + result = true proc recvFrom*(socket: TSocket, data: var string, length: int, address: var string, port: var TPort, flags = 0'i32): int {. @@ -1510,7 +1510,7 @@ proc recvFromAsync*(socket: TSocket, data: var string, length: int, let err = osLastError() when defined(windows): if err.int32 == WSAEWOULDBLOCK: - return False + return false else: osError(err) else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: @@ -1710,6 +1710,6 @@ proc isBlocking*(socket: TSocket): bool = not socket.nonblocking when defined(Windows): var wsa: TWSAData - if WSAStartup(0x0101'i16, addr wsa) != 0: osError(osLastError()) + if wsaStartup(0x0101'i16, addr wsa) != 0: osError(osLastError()) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 2a6d499a72..20109cfa26 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -214,7 +214,7 @@ iterator split*(s: string, seps: set[char] = Whitespace): string = while last < len(s): while s[last] in seps: inc(last) var first = last - while last < len(s) and s[last] not_in seps: inc(last) # BUGFIX! + while last < len(s) and s[last] notin seps: inc(last) # BUGFIX! if first <= last-1: yield substr(s, first, last-1) diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim index b67341e895..37a64a8f36 100644 --- a/lib/pure/unicode.nim +++ b/lib/pure/unicode.nim @@ -1115,10 +1115,10 @@ proc toLower*(c: TRune): TRune {.rtl, extern: "nuc$1", procvar.} = ## Converts `c` into lower case. This works for any Unicode character. ## If possible, prefer `toLower` over `toUpper`. var c = IRune(c) - var p = binarySearch(c, tolowerRanges, len(toLowerRanges) div 3, 3) + var p = binarySearch(c, tolowerRanges, len(tolowerRanges) div 3, 3) if p >= 0 and c >= tolowerRanges[p] and c <= tolowerRanges[p+1]: return TRune(c + tolowerRanges[p+2] - 500) - p = binarySearch(c, toLowerSinglets, len(toLowerSinglets) div 2, 2) + p = binarySearch(c, tolowerSinglets, len(tolowerSinglets) div 2, 2) if p >= 0 and c == tolowerSinglets[p]: return TRune(c + tolowerSinglets[p+1] - 500) return TRune(c) @@ -1127,10 +1127,10 @@ proc toUpper*(c: TRune): TRune {.rtl, extern: "nuc$1", procvar.} = ## Converts `c` into upper case. This works for any Unicode character. ## If possible, prefer `toLower` over `toUpper`. var c = IRune(c) - var p = binarySearch(c, toUpperRanges, len(toUpperRanges) div 3, 3) + var p = binarySearch(c, toupperRanges, len(toupperRanges) div 3, 3) if p >= 0 and c >= toupperRanges[p] and c <= toupperRanges[p+1]: return TRune(c + toupperRanges[p+2] - 500) - p = binarySearch(c, toUpperSinglets, len(toUpperSinglets) div 2, 2) + p = binarySearch(c, toupperSinglets, len(toupperSinglets) div 2, 2) if p >= 0 and c == toupperSinglets[p]: return TRune(c + toupperSinglets[p+1] - 500) return TRune(c) @@ -1147,10 +1147,10 @@ proc isLower*(c: TRune): bool {.rtl, extern: "nuc$1", procvar.} = ## If possible, prefer `isLower` over `isUpper`. var c = IRune(c) # Note: toUpperRanges is correct here! - var p = binarySearch(c, toUpperRanges, len(toUpperRanges) div 3, 3) + var p = binarySearch(c, toupperRanges, len(toupperRanges) div 3, 3) if p >= 0 and c >= toupperRanges[p] and c <= toupperRanges[p+1]: return true - p = binarySearch(c, toUpperSinglets, len(toUpperSinglets) div 2, 2) + p = binarySearch(c, toupperSinglets, len(toupperSinglets) div 2, 2) if p >= 0 and c == toupperSinglets[p]: return true @@ -1159,10 +1159,10 @@ proc isUpper*(c: TRune): bool {.rtl, extern: "nuc$1", procvar.} = ## If possible, prefer `isLower` over `isUpper`. var c = IRune(c) # Note: toLowerRanges is correct here! - var p = binarySearch(c, toLowerRanges, len(toLowerRanges) div 3, 3) + var p = binarySearch(c, tolowerRanges, len(tolowerRanges) div 3, 3) if p >= 0 and c >= tolowerRanges[p] and c <= tolowerRanges[p+1]: return true - p = binarySearch(c, toLowerSinglets, len(toLowerSinglets) div 2, 2) + p = binarySearch(c, tolowerSinglets, len(tolowerSinglets) div 2, 2) if p >= 0 and c == tolowerSinglets[p]: return true diff --git a/lib/system.nim b/lib/system.nim index ebe7226800..dddf77858f 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1145,7 +1145,7 @@ when not defined(nimrodVM): ## otherwise. Like any procedure dealing with raw memory this is ## *unsafe*. - when hostOs != "standalone": + when hostOS != "standalone": proc alloc*(size: int): pointer {.noconv, rtl, tags: [].} ## allocates a new memory block with at least ``size`` bytes. The ## block has to be freed with ``realloc(block, 0)`` or diff --git a/lib/system/assign.nim b/lib/system/assign.nim index 9e39306225..bed8820bee 100644 --- a/lib/system/assign.nim +++ b/lib/system/assign.nim @@ -144,7 +144,7 @@ proc objectInitAux(dest: pointer, n: ptr TNimNode) = var d = cast[TAddress](dest) case n.kind of nkNone: sysAssert(false, "objectInitAux") - of nkSLot: objectInit(cast[pointer](d +% n.offset), n.typ) + of nkSlot: objectInit(cast[pointer](d +% n.offset), n.typ) of nkList: for i in 0..n.len-1: objectInitAux(dest, n.sons[i]) diff --git a/lib/system/chcks.nim b/lib/system/chcks.nim index eb1bf752ed..f29e222e89 100644 --- a/lib/system/chcks.nim +++ b/lib/system/chcks.nim @@ -10,7 +10,7 @@ # Implementation of some runtime checks. proc raiseRangeError(val: BiggestInt) {.compilerproc, noreturn, noinline.} = - when hostOs == "standalone": + when hostOS == "standalone": sysFatal(EOutOfRange, "value out of range") else: sysFatal(EOutOfRange, "value out of range: ", $val) diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 376d1502c1..6d6be33d0f 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -573,7 +573,7 @@ proc scan(s: PCell) = proc collectWhite(s: PCell) = if s.color == rcWhite and s notin gch.cycleRoots: - s.setcolor(rcBlack) + s.setColor(rcBlack) forAllChildren(s, waCollectWhite) freeCyclicCell(gch, s) @@ -891,7 +891,7 @@ proc collectZCT(gch: var TGcHeap): bool = const workPackage = 100 var L = addr(gch.zct.len) - when withRealtime: + when withRealTime: var steps = workPackage var t0: TTicks if gch.maxPause > 0: t0 = getticks() @@ -904,7 +904,7 @@ proc collectZCT(gch: var TGcHeap): bool = c.refcount = c.refcount and not ZctFlag gch.zct.d[0] = gch.zct.d[L[] - 1] dec(L[]) - when withRealtime: dec steps + when withRealTime: dec steps if c.refcount <% rcIncrement: # It may have a RC > 0, if it is in the hardware stack or # it has not been removed yet from the ZCT. This is because @@ -927,7 +927,7 @@ proc collectZCT(gch: var TGcHeap): bool = else: sysAssert(c.typ != nil, "collectZCT 2") zeroMem(c, sizeof(TCell)) - when withRealtime: + when withRealTime: if steps == 0: steps = workPackage if gch.maxPause > 0: @@ -952,7 +952,7 @@ proc unmarkStackAndRegisters(gch: var TGcHeap) = gch.decStack.len = 0 proc collectCTBody(gch: var TGcHeap) = - when withRealtime: + when withRealTime: let t0 = getticks() sysAssert(allocInv(gch.region), "collectCT: begin") @@ -975,7 +975,7 @@ proc collectCTBody(gch: var TGcHeap) = unmarkStackAndRegisters(gch) sysAssert(allocInv(gch.region), "collectCT: end") - when withRealtime: + when withRealTime: let duration = getticks() - t0 gch.stat.maxPause = max(gch.stat.maxPause, duration) when defined(reportMissedDeadlines): @@ -997,7 +997,7 @@ proc collectCT(gch: var TGcHeap) = markForDebug(gch) collectCTBody(gch) -when withRealtime: +when withRealTime: proc toNano(x: int): TNanos {.inline.} = result = x * 1000 diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 2b6ad8df19..56e6a9e5fb 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -95,7 +95,7 @@ proc write(f: TFile, i: int) = fprintf(f, "%ld", i) proc write(f: TFile, i: BiggestInt) = - when sizeof(Biggestint) == 8: + when sizeof(BiggestInt) == 8: fprintf(f, "%lld", i) else: fprintf(f, "%ld", i) @@ -235,17 +235,17 @@ proc fwrite(buf: pointer, size, n: int, f: TFile): int {. proc readBuffer(f: TFile, buffer: pointer, len: int): int = result = fread(buffer, 1, len, f) -proc readBytes(f: TFile, a: var openarray[int8], start, len: int): int = +proc readBytes(f: TFile, a: var openArray[int8], start, len: int): int = result = readBuffer(f, addr(a[start]), len) -proc readChars(f: TFile, a: var openarray[char], start, len: int): int = +proc readChars(f: TFile, a: var openArray[char], start, len: int): int = result = readBuffer(f, addr(a[start]), len) {.push stackTrace:off, profiler:off.} -proc writeBytes(f: TFile, a: openarray[int8], start, len: int): int = +proc writeBytes(f: TFile, a: openArray[int8], start, len: int): int = var x = cast[ptr array[0..1000_000_000, int8]](a) result = writeBuffer(f, addr(x[start]), len) -proc writeChars(f: TFile, a: openarray[char], start, len: int): int = +proc writeChars(f: TFile, a: openArray[char], start, len: int): int = var x = cast[ptr array[0..1000_000_000, int8]](a) result = writeBuffer(f, addr(x[start]), len) proc writeBuffer(f: TFile, buffer: pointer, len: int): int = diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index e288910d7a..91c6495cec 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -92,7 +92,7 @@ const DETACHED_PROCESS* = 8'i32 SW_SHOWNORMAL* = 1'i32 - INVALID_HANDLE_VALUE* = THANDLE(-1) + INVALID_HANDLE_VALUE* = THandle(-1) CREATE_UNICODE_ENVIRONMENT* = 1024'i32 @@ -418,7 +418,7 @@ type ai_addr*: ptr TSockAddr ## Socket address of socket. ai_next*: ptr TAddrInfo ## Pointer to next in list. - Tsocklen* = cuint + TSockLen* = cuint var SOMAXCONN* {.importc, header: "Winsock2.h".}: cint @@ -457,20 +457,20 @@ proc socket*(af, typ, protocol: cint): TSocketHandle {. proc closesocket*(s: TSocketHandle): cint {. stdcall, importc: "closesocket", dynlib: ws2dll.} -proc accept*(s: TSocketHandle, a: ptr TSockAddr, addrlen: ptr Tsocklen): TSocketHandle {. +proc accept*(s: TSocketHandle, a: ptr TSockAddr, addrlen: ptr TSockLen): TSocketHandle {. stdcall, importc: "accept", dynlib: ws2dll.} -proc bindSocket*(s: TSocketHandle, name: ptr TSockAddr, namelen: Tsocklen): cint {. +proc bindSocket*(s: TSocketHandle, name: ptr TSockAddr, namelen: TSockLen): cint {. stdcall, importc: "bind", dynlib: ws2dll.} -proc connect*(s: TSocketHandle, name: ptr TSockAddr, namelen: Tsocklen): cint {. +proc connect*(s: TSocketHandle, name: ptr TSockAddr, namelen: TSockLen): cint {. stdcall, importc: "connect", dynlib: ws2dll.} proc getsockname*(s: TSocketHandle, name: ptr TSockAddr, - namelen: ptr Tsocklen): cint {. + namelen: ptr TSockLen): cint {. stdcall, importc: "getsockname", dynlib: ws2dll.} proc getsockopt*(s: TSocketHandle, level, optname: cint, optval: pointer, - optlen: ptr Tsocklen): cint {. + optlen: ptr TSockLen): cint {. stdcall, importc: "getsockopt", dynlib: ws2dll.} proc setsockopt*(s: TSocketHandle, level, optname: cint, optval: pointer, - optlen: Tsocklen): cint {. + optlen: TSockLen): cint {. stdcall, importc: "setsockopt", dynlib: ws2dll.} proc listen*(s: TSocketHandle, backlog: cint): cint {. @@ -478,7 +478,7 @@ proc listen*(s: TSocketHandle, backlog: cint): cint {. proc recv*(s: TSocketHandle, buf: pointer, len, flags: cint): cint {. stdcall, importc: "recv", dynlib: ws2dll.} proc recvfrom*(s: TSocketHandle, buf: cstring, len, flags: cint, - fromm: ptr TSockAddr, fromlen: ptr Tsocklen): cint {. + fromm: ptr TSockAddr, fromlen: ptr TSockLen): cint {. stdcall, importc: "recvfrom", dynlib: ws2dll.} proc select*(nfds: cint, readfds, writefds, exceptfds: ptr TFdSet, timeout: ptr TTimeval): cint {. @@ -486,15 +486,15 @@ proc select*(nfds: cint, readfds, writefds, exceptfds: ptr TFdSet, proc send*(s: TSocketHandle, buf: pointer, len, flags: cint): cint {. stdcall, importc: "send", dynlib: ws2dll.} proc sendto*(s: TSocketHandle, buf: pointer, len, flags: cint, - to: ptr TSockAddr, tolen: Tsocklen): cint {. + to: ptr TSockAddr, tolen: TSockLen): cint {. stdcall, importc: "sendto", dynlib: ws2dll.} proc shutdown*(s: TSocketHandle, how: cint): cint {. stdcall, importc: "shutdown", dynlib: ws2dll.} -proc getnameinfo*(a1: ptr TSockAddr, a2: Tsocklen, - a3: cstring, a4: Tsocklen, a5: cstring, - a6: Tsocklen, a7: cint): cint {. +proc getnameinfo*(a1: ptr TSockAddr, a2: TSockLen, + a3: cstring, a4: TSockLen, a5: cstring, + a6: TSockLen, a7: cint): cint {. stdcall, importc: "getnameinfo", dynlib: ws2dll.} proc inet_addr*(cp: cstring): int32 {. @@ -514,7 +514,7 @@ proc FD_SET*(Socket: TSocketHandle, FDSet: var TFdSet) = proc FD_ZERO*(FDSet: var TFdSet) = FDSet.fd_count = 0 -proc WSAStartup*(wVersionRequired: int16, WSData: ptr TWSAData): cint {. +proc wsaStartup*(wVersionRequired: int16, WSData: ptr TWSAData): cint {. stdcall, importc: "WSAStartup", dynlib: ws2dll.} proc getaddrinfo*(nodename, servname: cstring, hints: ptr TAddrInfo, From b731e6ef1c4f10b9ba544c0a66ea1066b3c471a8 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 29 Dec 2013 03:19:10 +0100 Subject: [PATCH 170/326] case consistency: cs:partial bootstraps on windows --- compiler/ast.nim | 18 ++++---- compiler/astalgo.nim | 8 ++-- compiler/babelcmd.nim | 4 +- compiler/ccgexprs.nim | 36 ++++++++-------- compiler/ccgmerge.nim | 16 +++---- compiler/ccgstmts.nim | 16 +++---- compiler/ccgthreadvars.nim | 2 +- compiler/ccgtypes.nim | 12 +++--- compiler/cgen.nim | 44 +++++++++---------- compiler/cgendata.nim | 8 ++-- compiler/commands.nim | 18 ++++---- compiler/condsyms.nim | 2 +- compiler/docgen.nim | 4 +- compiler/extccomp.nim | 12 +++--- compiler/filter_tmpl.nim | 6 +-- compiler/importer.nim | 14 +++--- compiler/jsgen.nim | 24 +++++------ compiler/jstypes.nim | 2 +- compiler/lexer.nim | 88 +++++++++++++++++++------------------- compiler/lookups.nim | 14 +++--- compiler/magicsys.nim | 2 +- compiler/main.nim | 4 +- compiler/modules.nim | 4 +- compiler/msgs.nim | 2 +- compiler/nimconf.nim | 6 +-- compiler/nimlexbase.nim | 14 +++--- compiler/nimrod.nim | 2 +- compiler/nimsets.nim | 2 +- compiler/options.nim | 8 ++-- compiler/parser.nim | 14 +++--- compiler/pragmas.nim | 20 ++++----- compiler/pretty.nim | 18 ++++---- compiler/procfind.nim | 6 +-- compiler/rodread.nim | 8 ++-- compiler/sem.nim | 16 +++---- compiler/semcall.nim | 6 +-- compiler/semdata.nim | 4 +- compiler/semexprs.nim | 45 ++++++++++--------- compiler/seminst.nim | 10 ++--- compiler/sempass2.nim | 2 +- compiler/semstmts.nim | 22 +++++----- compiler/semtypes.nim | 20 +++++---- compiler/semtypinst.nim | 2 +- compiler/sigmatch.nim | 16 +++---- compiler/suggest.nim | 8 ++-- compiler/transf.nim | 4 +- compiler/trees.nim | 4 +- compiler/types.nim | 16 +++---- compiler/vm.nim | 2 +- lib/pure/hashes.nim | 6 +-- lib/pure/json.nim | 20 ++++----- lib/pure/lexbase.nim | 14 +++--- lib/pure/os.nim | 4 +- lib/pure/osproc.nim | 52 +++++++++++----------- lib/pure/parseopt.nim | 2 +- lib/pure/sockets.nim | 10 ++--- lib/pure/times.nim | 10 ++--- lib/system/gc.nim | 8 ++-- 58 files changed, 384 insertions(+), 377 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index a2f5fad171..5a3af27e81 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -546,7 +546,7 @@ type typ*: PType info*: TLineInfo flags*: TNodeFlags - case Kind*: TNodeKind + case kind*: TNodeKind of nkCharLit..nkUInt64Lit: intVal*: BiggestInt of nkFloatLit..nkFloat128Lit: @@ -822,7 +822,7 @@ const # imported via 'importc: "fullname"' and no format string. # creator procs: -proc newSym*(symKind: TSymKind, Name: PIdent, owner: PSym, +proc newSym*(symKind: TSymKind, name: PIdent, owner: PSym, info: TLineInfo): PSym proc newType*(kind: TTypeKind, owner: PSym): PType proc newNode*(kind: TNodeKind): PNode @@ -1108,7 +1108,7 @@ proc assignType(dest, src: PType) = for i in countup(0, sonsLen(src) - 1): dest.sons[i] = src.sons[i] proc copyType(t: PType, owner: PSym, keepId: bool): PType = - result = newType(t.Kind, owner) + result = newType(t.kind, owner) assignType(result, t) if keepId: result.id = t.id @@ -1148,12 +1148,12 @@ proc createModuleAlias*(s: PSym, newIdent: PIdent, info: TLineInfo): PSym = # XXX once usedGenerics is used, ensure module aliases keep working! assert s.usedGenerics == nil -proc newSym(symKind: TSymKind, Name: PIdent, owner: PSym, +proc newSym(symKind: TSymKind, name: PIdent, owner: PSym, info: TLineInfo): PSym = # generates a symbol and initializes the hash field too new(result) - result.Name = Name - result.Kind = symKind + result.name = name + result.kind = symKind result.flags = {} result.info = info result.options = gOptions @@ -1270,7 +1270,7 @@ proc copyNode(src: PNode): PNode = when defined(useNodeIds): if result.id == nodeIdToDebug: echo "COMES FROM ", src.id - case src.Kind + case src.kind of nkCharLit..nkUInt64Lit: result.intVal = src.intVal of nkFloatLit..nkFloat128Lit: result.floatVal = src.floatVal of nkSym: result.sym = src.sym @@ -1288,7 +1288,7 @@ proc shallowCopy*(src: PNode): PNode = when defined(useNodeIds): if result.id == nodeIdToDebug: echo "COMES FROM ", src.id - case src.Kind + case src.kind of nkCharLit..nkUInt64Lit: result.intVal = src.intVal of nkFloatLit..nkFloat128Lit: result.floatVal = src.floatVal of nkSym: result.sym = src.sym @@ -1307,7 +1307,7 @@ proc copyTree(src: PNode): PNode = when defined(useNodeIds): if result.id == nodeIdToDebug: echo "COMES FROM ", src.id - case src.Kind + case src.kind of nkCharLit..nkUInt64Lit: result.intVal = src.intVal of nkFloatLit..nkFloat128Lit: result.floatVal = src.floatVal of nkSym: result.sym = src.sym diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 35c306bcf7..4b73485667 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -626,7 +626,7 @@ proc strTableGet(t: TStrTable, name: PIdent): PSym = proc initIdentIter(ti: var TIdentIter, tab: TStrTable, s: PIdent): PSym = ti.h = s.h ti.name = s - if tab.Counter == 0: result = nil + if tab.counter == 0: result = nil else: result = nextIdentIter(ti, tab) proc nextIdentIter(ti: var TIdentIter, tab: TStrTable): PSym = @@ -635,7 +635,7 @@ proc nextIdentIter(ti: var TIdentIter, tab: TStrTable): PSym = start = h result = tab.data[h] while result != nil: - if result.Name.id == ti.name.id: break + if result.name.id == ti.name.id: break h = nextTry(h, high(tab.data)) if h == start: result = nil @@ -649,7 +649,7 @@ proc nextIdentExcluding*(ti: var TIdentIter, tab: TStrTable, var start = h result = tab.data[h] while result != nil: - if result.Name.id == ti.name.id and not contains(excluding, result.id): + if result.name.id == ti.name.id and not contains(excluding, result.id): break h = nextTry(h, high(tab.data)) if h == start: @@ -663,7 +663,7 @@ proc firstIdentExcluding*(ti: var TIdentIter, tab: TStrTable, s: PIdent, excluding: TIntSet): PSym = ti.h = s.h ti.name = s - if tab.Counter == 0: result = nil + if tab.counter == 0: result = nil else: result = nextIdentExcluding(ti, tab, excluding) proc initTabIter(ti: var TTabIter, tab: TStrTable): PSym = diff --git a/compiler/babelcmd.nim b/compiler/babelcmd.nim index 65a2fe5455..7fa233732a 100644 --- a/compiler/babelcmd.nim +++ b/compiler/babelcmd.nim @@ -13,7 +13,7 @@ import parseutils, strutils, strtabs, os, options, msgs, lists proc addPath*(path: string, info: TLineInfo) = if not contains(options.searchPaths, path): - lists.PrependStr(options.searchPaths, path) + lists.prependStr(options.searchPaths, path) proc versionSplitPos(s: string): int = result = s.len-2 @@ -61,7 +61,7 @@ iterator chosen(packages: PStringTable): string = proc addBabelPath(p: string, info: TLineInfo) = if not contains(options.searchPaths, p): if gVerbosity >= 1: message(info, hintPath, p) - lists.PrependStr(options.lazyPaths, p) + lists.prependStr(options.lazyPaths, p) proc addPathWithNimFiles(p: string, info: TLineInfo) = proc hasNimFile(dir: string): bool = diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 495c342ed1..22a00cf292 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -436,7 +436,7 @@ proc binaryArithOverflow(p: BProc, e: PNode, d: var TLoc, m: TMagic) = else: var storage: PRope var size = getSize(t) - if size < platform.IntSize: + if size < platform.intSize: storage = toRope("NI") else: storage = getTypeDesc(p.module, t) @@ -444,7 +444,7 @@ proc binaryArithOverflow(p: BProc, e: PNode, d: var TLoc, m: TMagic) = linefmt(p, cpsLocals, "$1 $2;$n", storage, tmp) lineCg(p, cpsStmts, "$1 = #$2($3, $4);$n", tmp, toRope(prc[m]), rdLoc(a), rdLoc(b)) - if size < platform.IntSize or t.kind in {tyRange, tyEnum, tySet}: + if size < platform.intSize or t.kind in {tyRange, tyEnum, tySet}: linefmt(p, cpsStmts, "if ($1 < $2 || $1 > $3) #raiseOverflow();$n", tmp, intLiteral(firstOrd(t)), intLiteral(lastOrd(t))) putIntoDest(p, d, e.typ, ropef("(NI$1)($2)", [toRope(getSize(t)*8), tmp])) @@ -838,7 +838,7 @@ proc genAndOr(p: BProc, e: PNode, d: var TLoc, m: TMagic) = proc genEcho(p: BProc, n: PNode) = # this unusal way of implementing it ensures that e.g. ``echo("hallo", 45)`` # is threadsafe. - discard lists.IncludeStr(p.module.headerFiles, "<stdio.h>") + discard lists.includeStr(p.module.headerFiles, "<stdio.h>") var args: PRope = nil var a: TLoc for i in countup(1, n.len-1): @@ -872,7 +872,7 @@ proc genStrConcat(p: BProc, e: PNode, d: var TLoc) = for i in countup(0, sonsLen(e) - 2): # compute the length expression: initLocExpr(p, e.sons[i + 1], a) - if skipTypes(e.sons[i + 1].Typ, abstractVarRange).kind == tyChar: + if skipTypes(e.sons[i + 1].typ, abstractVarRange).kind == tyChar: inc(L) app(appends, rfmt(p.module, "#appendChar($1, $2);$n", tmp.r, rdLoc(a))) else: @@ -910,7 +910,7 @@ proc genStrAppend(p: BProc, e: PNode, d: var TLoc) = for i in countup(0, sonsLen(e) - 3): # compute the length expression: initLocExpr(p, e.sons[i + 2], a) - if skipTypes(e.sons[i + 2].Typ, abstractVarRange).kind == tyChar: + if skipTypes(e.sons[i + 2].typ, abstractVarRange).kind == tyChar: inc(L) app(appends, rfmt(p.module, "#appendChar($1, $2);$n", rdLoc(dest), rdLoc(a))) @@ -940,7 +940,7 @@ proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) = lineCg(p, cpsStmts, seqAppendPattern, [ rdLoc(a), getTypeDesc(p.module, skipTypes(e.sons[1].typ, abstractVar)), - getTypeDesc(p.module, skipTypes(e.sons[2].Typ, abstractVar))]) + getTypeDesc(p.module, skipTypes(e.sons[2].typ, abstractVar))]) keepAlive(p, a) initLoc(dest, locExpr, b.t, OnHeap) dest.r = rfmt(nil, "$1->data[$1->$2-1]", rdLoc(a), lenField()) @@ -1191,7 +1191,7 @@ proc genDollar(p: BProc, n: PNode, d: var TLoc, frmt: string) = proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) = var a = e.sons[1] if a.kind == nkHiddenAddr: a = a.sons[0] - var typ = skipTypes(a.Typ, abstractVar) + var typ = skipTypes(a.typ, abstractVar) case typ.kind of tyOpenArray, tyVarargs: if op == mHigh: unaryExpr(p, e, d, "($1Len0-1)") @@ -1259,7 +1259,7 @@ proc fewCmps(s: PNode): bool = if s.kind != nkCurly: internalError(s.info, "fewCmps") if (getSize(s.typ) <= platform.intSize) and (nfAllConst in s.flags): result = false # it is better to emit the set generation code - elif elemType(s.typ).Kind in {tyInt, tyInt16..tyInt64}: + elif elemType(s.typ).kind in {tyInt, tyInt16..tyInt64}: result = true # better not emit the set if int is basetype! else: result = sonsLen(s) <= 8 # 8 seems to be a good value @@ -1284,7 +1284,7 @@ proc binaryStmtInExcl(p: BProc, e: PNode, d: var TLoc, frmt: string) = proc genInOp(p: BProc, e: PNode, d: var TLoc) = var a, b, x, y: TLoc - if (e.sons[1].Kind == nkCurly) and fewCmps(e.sons[1]): + if (e.sons[1].kind == nkCurly) and fewCmps(e.sons[1]): # a set constructor but not a constant set: # do not emit the set, but generate a bunch of comparisons; and if we do # so, we skip the unnecessary range check: This is a semantical extension @@ -1298,7 +1298,7 @@ proc genInOp(p: BProc, e: PNode, d: var TLoc) = b.r = toRope("(") var length = sonsLen(e.sons[1]) for i in countup(0, length - 1): - if e.sons[1].sons[i].Kind == nkRange: + if e.sons[1].sons[i].kind == nkRange: initLocExpr(p, e.sons[1].sons[i].sons[0], x) initLocExpr(p, e.sons[1].sons[i].sons[1], y) appf(b.r, "$1 >= $2 && $1 <= $3", @@ -1326,7 +1326,7 @@ proc genSetOp(p: BProc, e: PNode, d: var TLoc, op: TMagic) = "if ($3) $3 = (memcmp($4, $5, $2) != 0);$n", "&", "|", "& ~", "^"] var a, b, i: TLoc - var setType = skipTypes(e.sons[1].Typ, abstractVar) + var setType = skipTypes(e.sons[1].typ, abstractVar) var size = int(getSize(setType)) case size of 1, 2, 4, 8: @@ -1512,25 +1512,25 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) = of mGetTypeInfo: genGetTypeInfo(p, e, d) of mSwap: genSwap(p, e, d) of mUnaryLt: - if not (optOverflowCheck in p.Options): unaryExpr(p, e, d, "$1 - 1") + if not (optOverflowCheck in p.options): unaryExpr(p, e, d, "$1 - 1") else: unaryExpr(p, e, d, "#subInt($1, 1)") of mPred: # XXX: range checking? - if not (optOverflowCheck in p.Options): binaryExpr(p, e, d, "$1 - $2") + if not (optOverflowCheck in p.options): binaryExpr(p, e, d, "$1 - $2") else: binaryExpr(p, e, d, "#subInt($1, $2)") of mSucc: # XXX: range checking? - if not (optOverflowCheck in p.Options): binaryExpr(p, e, d, "$1 + $2") + if not (optOverflowCheck in p.options): binaryExpr(p, e, d, "$1 + $2") else: binaryExpr(p, e, d, "#addInt($1, $2)") of mInc: - if not (optOverflowCheck in p.Options): + if not (optOverflowCheck in p.options): binaryStmt(p, e, d, "$1 += $2;$n") elif skipTypes(e.sons[1].typ, abstractVar).kind == tyInt64: binaryStmt(p, e, d, "$1 = #addInt64($1, $2);$n") else: binaryStmt(p, e, d, "$1 = #addInt($1, $2);$n") of ast.mDec: - if not (optOverflowCheck in p.Options): + if not (optOverflowCheck in p.options): binaryStmt(p, e, d, "$1 -= $2;$n") elif skipTypes(e.sons[1].typ, abstractVar).kind == tyInt64: binaryStmt(p, e, d, "$1 = #subInt64($1, $2);$n") @@ -1778,7 +1778,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = case n.kind of nkSym: var sym = n.sym - case sym.Kind + case sym.kind of skMethod: if sym.getBody.kind == nkEmpty or sfDispatcher in sym.flags: # we cannot produce code for the dispatcher yet: @@ -1990,7 +1990,7 @@ proc genConstSeq(p: BProc, n: PNode, t: PType): PRope = result = ropef("(($1)&$2)", [getTypeDesc(p.module, t), result]) proc genConstExpr(p: BProc, n: PNode): PRope = - case n.Kind + case n.kind of nkHiddenStdConv, nkHiddenSubConv: result = genConstExpr(p, n.sons[1]) of nkCurly: diff --git a/compiler/ccgmerge.nim b/compiler/ccgmerge.nim index 0ea30bd04a..514b77b731 100644 --- a/compiler/ccgmerge.nim +++ b/compiler/ccgmerge.nim @@ -108,7 +108,7 @@ proc genMergeInfo*(m: BModule): PRope = s.add("labels:") encodeVInt(m.labels, s) s.add(" hasframe:") - encodeVInt(ord(m.FrameDeclared), s) + encodeVInt(ord(m.frameDeclared), s) s.add(tnl) s.add("*/") result = s.toRope @@ -119,8 +119,8 @@ proc skipWhite(L: var TBaseLexer) = var pos = L.bufpos while true: case ^pos - of CR: pos = nimlexbase.HandleCR(L, pos) - of LF: pos = nimlexbase.HandleLF(L, pos) + of CR: pos = nimlexbase.handleCR(L, pos) + of LF: pos = nimlexbase.handleLF(L, pos) of ' ': inc pos else: break L.bufpos = pos @@ -129,8 +129,8 @@ proc skipUntilCmd(L: var TBaseLexer) = var pos = L.bufpos while true: case ^pos - of CR: pos = nimlexbase.HandleCR(L, pos) - of LF: pos = nimlexbase.HandleLF(L, pos) + of CR: pos = nimlexbase.handleCR(L, pos) + of LF: pos = nimlexbase.handleLF(L, pos) of '\0': break of '/': if ^(pos+1) == '*' and ^(pos+2) == '\t': @@ -179,11 +179,11 @@ proc readVerbatimSection(L: var TBaseLexer): PRope = while true: case buf[pos] of CR: - pos = nimlexbase.HandleCR(L, pos) + pos = nimlexbase.handleCR(L, pos) buf = L.buf r.add(tnl) of LF: - pos = nimlexbase.HandleLF(L, pos) + pos = nimlexbase.handleLF(L, pos) buf = L.buf r.add(tnl) of '\0': @@ -249,7 +249,7 @@ proc processMergeInfo(L: var TBaseLexer, m: BModule) = of "declared": readIntSet(L, m.declaredThings) of "typeInfo": readIntSet(L, m.typeInfoMarker) of "labels": m.labels = decodeVInt(L.buf, L.bufpos) - of "hasframe": m.FrameDeclared = decodeVInt(L.buf, L.bufpos) != 0 + of "hasframe": m.frameDeclared = decodeVInt(L.buf, L.bufpos) != 0 else: internalError("ccgmerge: unkown key: " & k) when not defined(nimhygiene): diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index e9291edc56..af0d657f1c 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -126,7 +126,7 @@ proc genGotoState(p: BProc, n: PNode) = var a: TLoc initLocExpr(p, n.sons[0], a) lineF(p, cpsStmts, "switch ($1) {$n", [rdLoc(a)]) - p.BeforeRetNeeded = true + p.beforeRetNeeded = true lineF(p, cpsStmts, "case -1: goto BeforeRet;$n", []) for i in 0 .. lastOrd(n.sons[0].typ): lineF(p, cpsStmts, "case $1: goto STATE$1;$n", [toRope(i)]) @@ -588,7 +588,7 @@ proc genStringCase(p: BProc, t: PNode, d: var TLoc) = proc branchHasTooBigRange(b: PNode): bool = for i in countup(0, sonsLen(b)-2): # last son is block - if (b.sons[i].Kind == nkRange) and + if (b.sons[i].kind == nkRange) and b.sons[i].sons[1].intVal - b.sons[i].sons[0].intVal > RangeExpandLimit: return true @@ -706,7 +706,7 @@ proc genTryCpp(p: BProc, t: PNode, d: var TLoc) = expr(p, t.sons[0], d) length = sonsLen(t) endBlock(p, ropecg(p.module, "} catch (NimException& $1) {$n", [exc])) - if optStackTrace in p.Options: + if optStackTrace in p.options: linefmt(p, cpsStmts, "#setFrame((TFrame*)&F);$n") inc p.inExceptBlock i = 1 @@ -779,7 +779,7 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) = # if not isEmptyType(t.typ) and d.k == locNone: getTemp(p, t.typ, d) - discard lists.IncludeStr(p.module.headerFiles, "<setjmp.h>") + discard lists.includeStr(p.module.headerFiles, "<setjmp.h>") genLineDir(p, t) var safePoint = getTempName() discard cgsym(p.module, "E_Base") @@ -794,7 +794,7 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) = endBlock(p) startBlock(p, "else {$n") linefmt(p, cpsStmts, "#popSafePoint();$n") - if optStackTrace in p.Options: + if optStackTrace in p.options: linefmt(p, cpsStmts, "#setFrame((TFrame*)&F);$n") inc p.inExceptBlock var i = 1 @@ -833,7 +833,7 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) = proc genAsmOrEmitStmt(p: BProc, t: PNode, isAsmStmt=false): PRope = var res = "" for i in countup(0, sonsLen(t) - 1): - case t.sons[i].Kind + case t.sons[i].kind of nkStrLit..nkTripleStrLit: res.add(t.sons[i].strVal) of nkSym: @@ -892,7 +892,7 @@ var proc genBreakPoint(p: BProc, t: PNode) = var name: string - if optEndb in p.Options: + if optEndb in p.options: if t.kind == nkExprColonExpr: assert(t.sons[1].kind in {nkStrLit..nkTripleStrLit}) name = normalize(t.sons[1].strVal) @@ -906,7 +906,7 @@ proc genBreakPoint(p: BProc, t: PNode) = makeCString(name)]) proc genWatchpoint(p: BProc, n: PNode) = - if optEndb notin p.Options: return + if optEndb notin p.options: return var a: TLoc initLocExpr(p, n.sons[1], a) let typ = skipTypes(n.sons[1].typ, abstractVarRange) diff --git a/compiler/ccgthreadvars.nim b/compiler/ccgthreadvars.nim index ee01972fce..c00b931ef8 100644 --- a/compiler/ccgthreadvars.nim +++ b/compiler/ccgthreadvars.nim @@ -16,7 +16,7 @@ proc emulatedThreadVars(): bool = result = {optThreads, optTlsEmulation} <= gGlobalOptions proc accessThreadLocalVar(p: BProc, s: PSym) = - if emulatedThreadVars() and not p.ThreadVarAccessed: + if emulatedThreadVars() and not p.threadVarAccessed: p.threadVarAccessed = true p.module.usesThreadVars = true appf(p.procSec(cpsLocals), "\tNimThreadVars* NimTV;$n") diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index f1e824e14a..79f10b9818 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -246,7 +246,7 @@ proc ccgIntroducedPtr(s: PSym): bool = assert skResult != s.kind if tfByRef in pt.flags: return true elif tfByCopy in pt.flags: return false - case pt.Kind + case pt.kind of tyObject: if (optByRef in s.options) or (getSize(pt) > platform.floatSize * 2): result = true # requested anyway @@ -305,7 +305,7 @@ proc genProcParams(m: BModule, t: PType, rettype, params: var PRope, var arr = param.typ if arr.kind == tyVar: arr = arr.sons[0] var j = 0 - while arr.Kind in {tyOpenArray, tyVarargs}: + while arr.kind in {tyOpenArray, tyVarargs}: # this fixes the 'sort' bug: if param.typ.kind == tyVar: param.loc.s = OnUnknown # need to pass hidden parameter: @@ -344,7 +344,7 @@ proc getSimpleTypeDesc(m: BModule, typ: PType): PRope = "NI", "NI8", "NI16", "NI32", "NI64", "NF", "NF32", "NF64", "NF128", "NU", "NU8", "NU16", "NU32", "NU64",] - case typ.Kind + case typ.kind of tyPointer: result = typeNameOrLiteral(typ, "void*") of tyEnum: @@ -367,7 +367,7 @@ proc getSimpleTypeDesc(m: BModule, typ: PType): PRope = of tyChar: result = typeNameOrLiteral(typ, "NIM_CHAR") of tyNil: result = typeNameOrLiteral(typ, "0") of tyInt..tyUInt64: - result = typeNameOrLiteral(typ, NumericalTypeToStr[typ.Kind]) + result = typeNameOrLiteral(typ, NumericalTypeToStr[typ.kind]) of tyRange: result = getSimpleTypeDesc(m, typ.sons[0]) else: result = nil @@ -509,14 +509,14 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope = # XXX: this BUG is hard to fix -> we need to introduce helper structs, # but determining when this needs to be done is hard. We should split # C type generation into an analysis and a code generation phase somehow. - case t.Kind + case t.kind of tyRef, tyPtr, tyVar: et = getUniqueType(t.sons[0]) if et.kind in {tyArrayConstr, tyArray, tyOpenArray, tyVarargs}: # this is correct! sets have no proper base type, so we treat # ``var set[char]`` in `getParamTypeDesc` et = getUniqueType(elemType(et)) - case et.Kind + case et.kind of tyObject, tyTuple: # no restriction! We have a forward declaration for structs name = getTypeForward(m, et) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 97965def02..c74f0807de 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -75,12 +75,12 @@ proc isSimpleConst(typ: PType): bool = proc useStringh(m: BModule) = if not m.includesStringh: m.includesStringh = true - discard lists.IncludeStr(m.headerFiles, "<string.h>") + discard lists.includeStr(m.headerFiles, "<string.h>") proc useHeader(m: BModule, sym: PSym) = - if lfHeader in sym.loc.Flags: + if lfHeader in sym.loc.flags: assert(sym.annex != nil) - discard lists.IncludeStr(m.headerFiles, getStr(sym.annex.path)) + discard lists.includeStr(m.headerFiles, getStr(sym.annex.path)) proc cgsym(m: BModule, name: string): PRope @@ -279,11 +279,11 @@ proc genLineDir(p: BProc, t: PNode) = if optEmbedOrigSrc in gGlobalOptions: app(p.s(cpsStmts), con(~"//", t.info.sourceLine, rnl)) genCLineDir(p.s(cpsStmts), t.info.toFullPath, line) - if ({optStackTrace, optEndb} * p.Options == {optStackTrace, optEndb}) and + if ({optStackTrace, optEndb} * p.options == {optStackTrace, optEndb}) and (p.prc == nil or sfPure notin p.prc.flags): linefmt(p, cpsStmts, "#endb($1, $2);$n", line.toRope, makeCString(toFilename(t.info))) - elif ({optLineTrace, optStackTrace} * p.Options == + elif ({optLineTrace, optStackTrace} * p.options == {optLineTrace, optStackTrace}) and (p.prc == nil or sfPure notin p.prc.flags): linefmt(p, cpsStmts, "nimln($1, $2);$n", @@ -724,7 +724,7 @@ proc generateHeaders(m: BModule) = appf(m.s[cfsHeaders], "$N#include \"$1\"$N", [toRope(it.data)]) else: appf(m.s[cfsHeaders], "$N#include $1$N", [toRope(it.data)]) - it = PStrEntry(it.Next) + it = PStrEntry(it.next) proc retIsNotVoid(s: PSym): bool = result = (s.typ.sons[0] != nil) and not isInvalidReturnType(s.typ.sons[0]) @@ -784,7 +784,7 @@ proc genProcAux(m: BModule, prc: PSym) = genStmts(p, prc.getBody) # modifies p.locals, p.init, etc. var generatedProc: PRope if sfPure in prc.flags: - if hasNakedDeclspec in extccomp.CC[extccomp.ccompiler].props: + if hasNakedDeclspec in extccomp.CC[extccomp.cCompiler].props: header = con("__declspec(naked) ", header) generatedProc = rfmt(nil, "$N$1 {$n$2$3$4}$N$N", header, p.s(cpsLocals), p.s(cpsInit), p.s(cpsStmts)) @@ -811,8 +811,8 @@ proc genProcAux(m: BModule, prc: PSym) = proc genProcPrototype(m: BModule, sym: PSym) = useHeader(m, sym) - if lfNoDecl in sym.loc.Flags: return - if lfDynamicLib in sym.loc.Flags: + if lfNoDecl in sym.loc.flags: return + if lfDynamicLib in sym.loc.flags: if getModule(sym).id != m.module.id and not containsOrIncl(m.declaredThings, sym.id): app(m.s[cfsVars], rfmt(nil, "extern $1 $2;$n", @@ -832,7 +832,7 @@ proc genProcNoForward(m: BModule, prc: PSym) = discard cgsym(m, prc.name.s) return genProcPrototype(m, prc) - if lfNoDecl in prc.loc.Flags: nil + if lfNoDecl in prc.loc.flags: nil elif prc.typ.callConv == ccInline: # We add inline procs to the calling module to enable C based inlining. # This also means that a check with ``q.declaredThings`` is wrong, we need @@ -854,7 +854,7 @@ proc requestConstImpl(p: BProc, sym: PSym) = useHeader(m, sym) if sym.loc.k == locNone: fillLoc(sym.loc, locData, sym.typ, mangleName(sym), OnUnknown) - if lfNoDecl in sym.loc.Flags: return + if lfNoDecl in sym.loc.flags: return # declare implementation: var q = findPendingModule(m, sym) if q != nil and not containsOrIncl(q.declaredThings, sym.id): @@ -879,7 +879,7 @@ proc genProc(m: BModule, prc: PSym) = else: genProcNoForward(m, prc) if {sfExportc, sfCompilerProc} * prc.flags == {sfExportc} and - generatedHeader != nil and lfNoDecl notin prc.loc.Flags: + generatedHeader != nil and lfNoDecl notin prc.loc.flags: genProcPrototype(generatedHeader, prc) if prc.typ.callConv == ccInline: if not containsOrIncl(generatedHeader.declaredThings, prc.id): @@ -889,7 +889,7 @@ proc genVarPrototypeAux(m: BModule, sym: PSym) = assert(sfGlobal in sym.flags) useHeader(m, sym) fillLoc(sym.loc, locGlobalVar, sym.typ, mangleName(sym), OnHeap) - if (lfNoDecl in sym.loc.Flags) or containsOrIncl(m.declaredThings, sym.id): + if (lfNoDecl in sym.loc.flags) or containsOrIncl(m.declaredThings, sym.id): return if sym.owner.id != m.module.id: # else we already have the symbol generated! @@ -930,7 +930,7 @@ proc getCopyright(cfilenoext: string): PRope = "; Command for LLVM compiler:$n $5$n", [toRope(VersionAsString), toRope(platform.OS[targetOS].name), toRope(platform.CPU[targetCPU].name), - toRope(extccomp.CC[extccomp.ccompiler].name), + toRope(extccomp.CC[extccomp.cCompiler].name), toRope(getCompileCFileCmd(cfilenoext))]) proc getFileHeader(cfilenoext: string): PRope = @@ -990,7 +990,7 @@ proc genMainProc(m: BModule) = else: nimMain = WinNimDllMain otherMain = WinCDllMain - discard lists.IncludeStr(m.headerFiles, "<windows.h>") + discard lists.includeStr(m.headerFiles, "<windows.h>") elif optGenDynLib in gGlobalOptions: nimMain = PosixNimDllMain otherMain = PosixCDllMain @@ -1053,11 +1053,11 @@ proc genInitCode(m: BModule) = app(prc, m.postInitProc.s(cpsLocals)) app(prc, genSectionEnd(cpsLocals)) - if optStackTrace in m.initProc.options and not m.FrameDeclared: + if optStackTrace in m.initProc.options and not m.frameDeclared: # BUT: the generated init code might depend on a current frame, so # declare it nevertheless: - m.FrameDeclared = true - if not m.PreventStackTrace: + m.frameDeclared = true + if not m.preventStackTrace: var procname = cstringLit(m.initProc, prc, m.module.name.s) app(prc, initFrame(m.initProc, procname, m.module.info.quotedFilename)) else: @@ -1074,7 +1074,7 @@ proc genInitCode(m: BModule) = app(prc, m.initProc.s(cpsStmts)) app(prc, m.postInitProc.s(cpsStmts)) app(prc, genSectionEnd(cpsStmts)) - if optStackTrace in m.initProc.options and not m.PreventStackTrace: + if optStackTrace in m.initProc.options and not m.preventStackTrace: app(prc, deinitFrame(m.initProc)) app(prc, deinitGCFrame(m.initProc)) appf(prc, "}$N$N") @@ -1148,7 +1148,7 @@ proc rawNewModule(module: PSym, filename: string): BModule = # no line tracing for the init sections of the system module so that we # don't generate a TFrame which can confuse the stack botton initialization: if sfSystemModule in module.flags: - result.PreventStackTrace = true + result.preventStackTrace = true excl(result.preInitProc.options, optStackTrace) excl(result.postInitProc.options, optStackTrace) @@ -1171,7 +1171,7 @@ proc resetModule*(m: var BModule) = m.forwardedProcs = @[] m.typeNodesName = getTempName() m.nimTypesName = getTempName() - m.PreventStackTrace = sfSystemModule in m.module.flags + m.preventStackTrace = sfSystemModule in m.module.flags nullify m.s m.usesThreadVars = false m.typeNodes = 0 @@ -1275,7 +1275,7 @@ proc shouldRecompile(code: PRope, cfile, cfilenoext: string): bool = if optForceFullMake notin gGlobalOptions: var objFile = toObjFile(cfilenoext) if writeRopeIfNotEqual(code, cfile): return - if existsFile(objFile) and os.FileNewer(objFile, cfile): result = false + if existsFile(objFile) and os.fileNewer(objFile, cfile): result = false else: writeRope(code, cfile) diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index 58584552d9..d72f9fa4d0 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -61,8 +61,8 @@ type TCProc{.final.} = object # represents C proc that is currently generated prc*: PSym # the Nimrod proc that this C proc belongs to - BeforeRetNeeded*: bool # true iff 'BeforeRet' label for proc is needed - ThreadVarAccessed*: bool # true if the proc already accessed some threadvar + beforeRetNeeded*: bool # true iff 'BeforeRet' label for proc is needed + threadVarAccessed*: bool # true if the proc already accessed some threadvar nestedTryStmts*: seq[PNode] # in how many nested try statements we are # (the vars must be volatile then) inExceptBlock*: int # are we currently inside an except block? @@ -86,9 +86,9 @@ type module*: PSym filename*: string s*: TCFileSections # sections of the C file - PreventStackTrace*: bool # true if stack traces need to be prevented + preventStackTrace*: bool # true if stack traces need to be prevented usesThreadVars*: bool # true if the module uses a thread var - FrameDeclared*: bool # hack for ROD support so that we don't declare + frameDeclared*: bool # hack for ROD support so that we don't declare # a frame var twice in an init proc isHeaderFile*: bool # C source file is the header file includesStringh*: bool # C source file already includes ``<string.h>`` diff --git a/compiler/commands.nim b/compiler/commands.nim index 96fa34ae06..03c71ff5ad 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -35,7 +35,7 @@ const AdvancedUsage = slurp"doc/advopt.txt".replace("//", "") proc getCommandLineDesc(): string = - result = (HelpMessage % [VersionAsString, platform.os[platform.hostOS].name, + result = (HelpMessage % [VersionAsString, platform.OS[platform.hostOS].name, CPU[platform.hostCPU].name]) & Usage proc helpOnError(pass: TCmdLinePass) = @@ -46,14 +46,14 @@ proc helpOnError(pass: TCmdLinePass) = proc writeAdvancedUsage(pass: TCmdLinePass) = if pass == passCmd1: msgWriteln(`%`(HelpMessage, [VersionAsString, - platform.os[platform.hostOS].name, + platform.OS[platform.hostOS].name, CPU[platform.hostCPU].name]) & AdvancedUsage) quit(0) proc writeVersionInfo(pass: TCmdLinePass) = if pass == passCmd1: msgWriteln(`%`(HelpMessage, [VersionAsString, - platform.os[platform.hostOS].name, + platform.OS[platform.hostOS].name, CPU[platform.hostCPU].name])) quit(0) @@ -256,8 +256,8 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = of "excludepath": expectArg(switch, arg, pass, info) let path = processPath(arg) - lists.ExcludeStr(options.searchPaths, path) - lists.ExcludeStr(options.lazyPaths, path) + lists.excludeStr(options.searchPaths, path) + lists.excludeStr(options.lazyPaths, path) of "nimcache": expectArg(switch, arg, pass, info) options.nimcacheDir = processPath(arg) @@ -425,19 +425,19 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = of "os": expectArg(switch, arg, pass, info) if pass in {passCmd1, passPP}: - theOS = platform.NameToOS(arg) + theOS = platform.nameToOS(arg) if theOS == osNone: localError(info, errUnknownOS, arg) elif theOS != platform.hostOS: setTarget(theOS, targetCPU) - condsyms.InitDefines() + condsyms.initDefines() of "cpu": expectArg(switch, arg, pass, info) if pass in {passCmd1, passPP}: - cpu = platform.NameToCPU(arg) + cpu = platform.nameToCPU(arg) if cpu == cpuNone: localError(info, errUnknownCPU, arg) elif cpu != platform.hostCPU: setTarget(targetOS, cpu) - condsyms.InitDefines() + condsyms.initDefines() of "run", "r": expectNoArg(switch, arg, pass, info) incl(gGlobalOptions, optRun) diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index e74ab5853c..c79fda13e2 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -83,6 +83,6 @@ proc initDefines*() = defineSymbol("cpu" & $CPU[targetCPU].bit) defineSymbol(normalize(EndianToStr[CPU[targetCPU].endian])) defineSymbol(CPU[targetCPU].name) - defineSymbol(platform.os[targetOS].name) + defineSymbol(platform.OS[targetOS].name) if platform.OS[targetOS].props.contains(ospLacksThreadVars): defineSymbol("emulatedthreadvars") diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 031b7d429b..343f415b37 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -46,13 +46,13 @@ proc parseRst(text, filename: string, line, column: int, hasToc: var bool, rstOptions: TRstParseOptions): PRstNode = result = rstParse(text, filename, line, column, hasToc, rstOptions, - options.FindFile, compilerMsgHandler) + options.findFile, compilerMsgHandler) proc newDocumentor*(filename: string, config: PStringTable): PDoc = new(result) initRstGenerator(result[], (if gCmd != cmdRst2tex: outHtml else: outLatex), options.gConfigVars, filename, {roSupportRawDirective}, - options.FindFile, compilerMsgHandler) + options.findFile, compilerMsgHandler) result.id = 100 proc dispA(dest: var PRope, xml, tex: string, args: openArray[PRope]) = diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index afcba8b4b8..95778941e0 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -335,8 +335,8 @@ proc getConfigVar(c: TSystemCC, suffix: string): string = # for niminst support if (platform.hostOS != targetOS or platform.hostCPU != targetCPU) and optCompileOnly notin gGlobalOptions: - let fullCCname = platform.cpu[targetCPU].name & '.' & - platform.os[targetOS].name & '.' & + let fullCCname = platform.CPU[targetCPU].name & '.' & + platform.OS[targetOS].name & '.' & CC[c].name & suffix result = getConfigVar(fullCCname) if result.len == 0: @@ -406,7 +406,7 @@ proc execExternalProgram*(cmd: string) = proc generateScript(projectFile: string, script: PRope) = let (dir, name, ext) = splitFile(projectFile) writeRope(script, dir / addFileExt("compile_" & name, - platform.os[targetOS].scriptExt)) + platform.OS[targetOS].scriptExt)) proc getOptSpeed(c: TSystemCC): string = result = getConfigVar(c, ".options.speed") @@ -517,7 +517,7 @@ proc footprint(filename: string): TCrc32 = result = crcFromFile(filename) >< platform.OS[targetOS].name >< platform.CPU[targetCPU].name >< - extccomp.CC[extccomp.ccompiler].name >< + extccomp.CC[extccomp.cCompiler].name >< getCompileCFileCmd(filename, true) proc externalFileChanged(filename: string): bool = @@ -608,10 +608,10 @@ proc callCCompiler*(projectfile: string) = else: buildgui = "" var exefile: string if optGenDynLib in gGlobalOptions: - exefile = platform.os[targetOS].dllFrmt % splitFile(projectfile).name + exefile = platform.OS[targetOS].dllFrmt % splitFile(projectfile).name builddll = CC[c].buildDll else: - exefile = splitFile(projectfile).name & platform.os[targetOS].exeExt + exefile = splitFile(projectfile).name & platform.OS[targetOS].exeExt builddll = "" if options.outFile.len > 0: exefile = options.outFile diff --git a/compiler/filter_tmpl.nim b/compiler/filter_tmpl.nim index 749d38b341..8067541221 100644 --- a/compiler/filter_tmpl.nim +++ b/compiler/filter_tmpl.nim @@ -27,7 +27,7 @@ type indent, emitPar: int x: string # the current input line outp: PLLStream # the ouput will be parsed by pnimsyn - subsChar, NimDirective: char + subsChar, nimDirective: char emit, conc, toStr: string curly, bracket, par: int pendingExprLine: bool @@ -67,9 +67,9 @@ proc parseLine(p: var TTmplParser) = keyw: string j = 0 while p.x[j] == ' ': inc(j) - if (p.x[0] == p.NimDirective) and (p.x[0 + 1] == '!'): + if (p.x[0] == p.nimDirective) and (p.x[0 + 1] == '!'): newLine(p) - elif (p.x[j] == p.NimDirective): + elif (p.x[j] == p.nimDirective): newLine(p) inc(j) while p.x[j] == ' ': inc(j) diff --git a/compiler/importer.nim b/compiler/importer.nim index 24779f2ae6..078a90c989 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -63,8 +63,8 @@ proc rawImportSymbol(c: PContext, s: PSym) = if check != nil and check.id != s.id: if s.kind notin OverloadableSyms: # s and check need to be qualified: - incl(c.AmbiguousSymbols, s.id) - incl(c.AmbiguousSymbols, check.id) + incl(c.ambiguousSymbols, s.id) + incl(c.ambiguousSymbols, check.id) # thanks to 'export' feature, it could be we import the same symbol from # multiple sources, so we need to call 'StrTableAdd' here: strTableAdd(c.importTable.symbols, s) @@ -73,7 +73,7 @@ proc rawImportSymbol(c: PContext, s: PSym) = if etyp.kind in {tyBool, tyEnum} and sfPure notin s.flags: for j in countup(0, sonsLen(etyp.n) - 1): var e = etyp.n.sons[j].sym - if e.Kind != skEnumField: + if e.kind != skEnumField: internalError(s.info, "rawImportSymbol") # BUGFIX: because of aliases for enums the symbol may already # have been put into the symbol table @@ -99,16 +99,16 @@ proc importSymbol(c: PContext, n: PNode, fromMod: PSym) = localError(n.info, errUndeclaredIdentifier, ident.s) else: if s.kind == skStub: loadStub(s) - if s.Kind notin ExportableSymKinds: + if s.kind notin ExportableSymKinds: internalError(n.info, "importSymbol: 2") # for an enumeration we have to add all identifiers - case s.Kind + case s.kind of skProc, skMethod, skIterator, skMacro, skTemplate, skConverter: # for a overloadable syms add all overloaded routines var it: TIdentIter var e = initIdentIter(it, fromMod.tab, s.name) while e != nil: - if e.name.id != s.Name.id: internalError(n.info, "importSymbol: 3") + if e.name.id != s.name.id: internalError(n.info, "importSymbol: 3") rawImportSymbol(c, e) e = nextIdentIter(it, fromMod.tab) else: rawImportSymbol(c, s) @@ -119,7 +119,7 @@ proc importAllSymbolsExcept(c: PContext, fromMod: PSym, exceptSet: TIntSet) = while s != nil: if s.kind != skModule: if s.kind != skEnumField: - if s.Kind notin ExportableSymKinds: + if s.kind notin ExportableSymKinds: internalError(s.info, "importAllSymbols: " & $s.kind) if exceptSet.empty or s.name.id notin exceptSet: rawImportSymbol(c, s) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 1ba40f95d8..c6b0b194ff 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -64,7 +64,7 @@ type options: TOptions module: BModule g: PGlobals - BeforeRetNeeded: bool + beforeRetNeeded: bool target: TTarget # duplicated here for faster dispatching unique: int # for temp identifier generation blocks: seq[TBlock] @@ -485,14 +485,14 @@ proc arith(p: PProc, n: PNode, r: var TCompRes, op: TMagic) = proc genLineDir(p: PProc, n: PNode) = let line = toLinenumber(n.info) - if optLineDir in p.Options: + if optLineDir in p.options: appf(p.body, "// line $2 \"$1\"$n" | "-- line $2 \"$1\"$n", [toRope(toFilename(n.info)), toRope(line)]) - if {optStackTrace, optEndb} * p.Options == {optStackTrace, optEndb} and + if {optStackTrace, optEndb} * p.options == {optStackTrace, optEndb} and ((p.prc == nil) or sfPure notin p.prc.flags): useMagic(p, "endb") appf(p.body, "endb($1);$n", [toRope(line)]) - elif ({optLineTrace, optStackTrace} * p.Options == + elif ({optLineTrace, optStackTrace} * p.options == {optLineTrace, optStackTrace}) and ((p.prc == nil) or not (sfPure in p.prc.flags)): appf(p.body, "F.line = $1;$n", [toRope(line)]) @@ -555,7 +555,7 @@ proc genTry(p: PProc, n: PNode, r: var TCompRes) = "var $1 = {prev: excHandler, exc: null};$nexcHandler = $1;$n" | "local $1 = pcall(", [safePoint]) - if optStackTrace in p.Options: app(p.body, "framePtr = F;" & tnl) + if optStackTrace in p.options: app(p.body, "framePtr = F;" & tnl) appf(p.body, "try {$n" | "function()$n") var length = sonsLen(n) var a: TCompRes @@ -747,7 +747,7 @@ proc genAsmStmt(p: PProc, n: PNode) = genLineDir(p, n) assert(n.kind == nkAsmStmt) for i in countup(0, sonsLen(n) - 1): - case n.sons[i].Kind + case n.sons[i].kind of nkStrLit..nkTripleStrLit: app(p.body, n.sons[i].strVal) of nkSym: app(p.body, mangleName(n.sons[i].sym)) else: internalError(n.sons[i].info, "jsgen: genAsmStmt()") @@ -1298,15 +1298,15 @@ proc genMagic(p: PProc, n: PNode, r: var TCompRes) = of mSwap: genSwap(p, n) of mUnaryLt: # XXX: range checking? - if not (optOverflowCheck in p.Options): unaryExpr(p, n, r, "", "$1 - 1") + if not (optOverflowCheck in p.options): unaryExpr(p, n, r, "", "$1 - 1") else: unaryExpr(p, n, r, "subInt", "subInt($1, 1)") of mPred: # XXX: range checking? - if not (optOverflowCheck in p.Options): binaryExpr(p, n, r, "", "$1 - $2") + if not (optOverflowCheck in p.options): binaryExpr(p, n, r, "", "$1 - $2") else: binaryExpr(p, n, r, "subInt", "subInt($1, $2)") of mSucc: # XXX: range checking? - if not (optOverflowCheck in p.Options): binaryExpr(p, n, r, "", "$1 - $2") + if not (optOverflowCheck in p.options): binaryExpr(p, n, r, "", "$1 - $2") else: binaryExpr(p, n, r, "addInt", "addInt($1, $2)") of mAppendStrCh: binaryExpr(p, n, r, "addChar", "addChar($1, $2)") of mAppendStrStr: @@ -1335,10 +1335,10 @@ proc genMagic(p: PProc, n: PNode, r: var TCompRes) = else: unaryExpr(p, n, r, "", "($1.length-1)") of mInc: - if not (optOverflowCheck in p.Options): binaryExpr(p, n, r, "", "$1 += $2") + if not (optOverflowCheck in p.options): binaryExpr(p, n, r, "", "$1 += $2") else: binaryExpr(p, n, r, "addInt", "$1 = addInt($1, $2)") of ast.mDec: - if not (optOverflowCheck in p.Options): binaryExpr(p, n, r, "", "$1 -= $2") + if not (optOverflowCheck in p.options): binaryExpr(p, n, r, "", "$1 -= $2") else: binaryExpr(p, n, r, "subInt", "$1 = subInt($1, $2)") of mSetLengthStr: binaryExpr(p, n, r, "", "$1.length = ($2)-1") of mSetLengthSeq: binaryExpr(p, n, r, "", "$1.length = $2") @@ -1470,7 +1470,7 @@ proc convCStrToStr(p: PProc, n: PNode, r: var TCompRes) = proc genReturnStmt(p: PProc, n: PNode) = if p.procDef == nil: internalError(n.info, "genReturnStmt") - p.BeforeRetNeeded = true + p.beforeRetNeeded = true if (n.sons[0].kind != nkEmpty): genStmt(p, n.sons[0]) else: diff --git a/compiler/jstypes.nim b/compiler/jstypes.nim index cbe87bbc19..6d14076e11 100644 --- a/compiler/jstypes.nim +++ b/compiler/jstypes.nim @@ -119,7 +119,7 @@ proc genTypeInfo(p: PProc, typ: PType): PRope = var t = typ if t.kind == tyGenericInst: t = lastSon(t) result = ropef("NTI$1", [toRope(t.id)]) - if containsOrIncl(p.g.TypeInfoGenerated, t.id): return + if containsOrIncl(p.g.typeInfoGenerated, t.id): return case t.kind of tyDistinct: result = genTypeInfo(p, typ.sons[0]) diff --git a/compiler/lexer.nim b/compiler/lexer.nim index a258765cf9..93aea7f61f 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -180,18 +180,18 @@ proc printTok*(tok: TToken) = var dummyIdent: PIdent proc initToken*(L: var TToken) = - L.TokType = tkInvalid + L.tokType = tkInvalid L.iNumber = 0 - L.Indent = 0 + L.indent = 0 L.literal = "" L.fNumber = 0.0 L.base = base10 L.ident = dummyIdent proc fillToken(L: var TToken) = - L.TokType = tkInvalid + L.tokType = tkInvalid L.iNumber = 0 - L.Indent = 0 + L.indent = 0 setLen(L.literal, 0) L.fNumber = 0.0 L.base = base10 @@ -201,24 +201,24 @@ proc openLexer(lex: var TLexer, fileIdx: int32, inputstream: PLLStream) = openBaseLexer(lex, inputstream) lex.fileIdx = fileidx lex.indentAhead = - 1 - inc(lex.Linenumber, inputstream.lineOffset) + inc(lex.lineNumber, inputstream.lineOffset) proc closeLexer(lex: var TLexer) = - inc(gLinesCompiled, lex.LineNumber) + inc(gLinesCompiled, lex.lineNumber) closeBaseLexer(lex) proc getColumn(L: TLexer): int = - result = getColNumber(L, L.bufPos) + result = getColNumber(L, L.bufpos) proc getLineInfo(L: TLexer): TLineInfo = - result = newLineInfo(L.fileIdx, L.linenumber, getColNumber(L, L.bufpos)) + result = newLineInfo(L.fileIdx, L.lineNumber, getColNumber(L, L.bufpos)) proc lexMessage(L: TLexer, msg: TMsgKind, arg = "") = - msgs.Message(getLineInfo(L), msg, arg) + msgs.message(getLineInfo(L), msg, arg) proc lexMessagePos(L: var TLexer, msg: TMsgKind, pos: int, arg = "") = - var info = newLineInfo(L.fileIdx, L.linenumber, pos - L.lineStart) - msgs.Message(info, msg, arg) + var info = newLineInfo(L.fileIdx, L.lineNumber, pos - L.lineStart) + msgs.message(info, msg, arg) proc matchUnderscoreChars(L: var TLexer, tok: var TToken, chars: TCharSet) = var pos = L.bufpos # use registers for pos, buf @@ -235,7 +235,7 @@ proc matchUnderscoreChars(L: var TLexer, tok: var TToken, chars: TCharSet) = break add(tok.literal, '_') inc(pos) - L.bufPos = pos + L.bufpos = pos proc matchTwoChars(L: TLexer, first: char, second: TCharSet): bool = result = (L.buf[L.bufpos] == first) and (L.buf[L.bufpos + 1] in second) @@ -408,7 +408,7 @@ proc getNumber(L: var TLexer): TToken = else: internalError(getLineInfo(L), "getNumber") elif isFloatLiteral(result.literal) or (result.tokType == tkFloat32Lit) or (result.tokType == tkFloat64Lit): - result.fnumber = parseFloat(result.literal) + result.fNumber = parseFloat(result.literal) if result.tokType == tkIntLit: result.tokType = tkFloatLit else: result.iNumber = parseBiggestInt(result.literal) @@ -445,7 +445,7 @@ proc getEscapedChar(L: var TLexer, tok: var TToken) = inc(L.bufpos) # skip '\' case L.buf[L.bufpos] of 'n', 'N': - if tok.toktype == tkCharLit: lexMessage(L, errNnotAllowedInCharacter) + if tok.tokType == tkCharLit: lexMessage(L, errNnotAllowedInCharacter) add(tok.literal, tnl) inc(L.bufpos) of 'r', 'R', 'c', 'C': @@ -514,16 +514,16 @@ proc handleCRLF(L: var TLexer, pos: int): int = case L.buf[pos] of CR: registerLine() - result = nimlexbase.HandleCR(L, pos) + result = nimlexbase.handleCR(L, pos) of LF: registerLine() - result = nimlexbase.HandleLF(L, pos) + result = nimlexbase.handleLF(L, pos) else: result = pos proc getString(L: var TLexer, tok: var TToken, rawMode: bool) = - var pos = L.bufPos + 1 # skip " + var pos = L.bufpos + 1 # skip " var buf = L.buf # put `buf` in a register - var line = L.linenumber # save linenumber for better error message + var line = L.lineNumber # save linenumber for better error message if buf[pos] == '\"' and buf[pos+1] == '\"': tok.tokType = tkTripleStrLit # long string literal: inc(pos, 2) # skip "" @@ -544,10 +544,10 @@ proc getString(L: var TLexer, tok: var TToken, rawMode: bool) = buf = L.buf add(tok.literal, tnl) of nimlexbase.EndOfFile: - var line2 = L.linenumber - L.LineNumber = line + var line2 = L.lineNumber + L.lineNumber = line lexMessagePos(L, errClosingTripleQuoteExpected, L.lineStart) - L.LineNumber = line2 + L.lineNumber = line2 break else: add(tok.literal, buf[pos]) @@ -569,9 +569,9 @@ proc getString(L: var TLexer, tok: var TToken, rawMode: bool) = lexMessage(L, errClosingQuoteExpected) break elif (c == '\\') and not rawMode: - L.bufPos = pos + L.bufpos = pos getEscapedChar(L, tok) - pos = L.bufPos + pos = L.bufpos else: add(tok.literal, c) inc(pos) @@ -707,7 +707,7 @@ proc rawGetTok(L: var TLexer, tok: var TToken) = tok.indent = -1 skip(L, tok) var c = L.buf[L.bufpos] - tok.line = L.linenumber + tok.line = L.lineNumber tok.col = getColNumber(L, L.bufpos) if c in SymStartChars - {'r', 'R', 'l'}: getSymbol(L, tok) @@ -724,7 +724,7 @@ proc rawGetTok(L: var TLexer, tok: var TToken) = else: getOperator(L, tok) of ',': - tok.toktype = tkComma + tok.tokType = tkComma inc(L.bufpos) of 'l': # if we parsed exactly one character and its a small L (l), this @@ -733,55 +733,55 @@ proc rawGetTok(L: var TLexer, tok: var TToken) = lexMessage(L, warnSmallLshouldNotBeUsed) getSymbol(L, tok) of 'r', 'R': - if L.buf[L.bufPos + 1] == '\"': - inc(L.bufPos) + if L.buf[L.bufpos + 1] == '\"': + inc(L.bufpos) getString(L, tok, true) else: getSymbol(L, tok) of '(': inc(L.bufpos) - if L.buf[L.bufPos] == '.' and L.buf[L.bufPos+1] != '.': - tok.toktype = tkParDotLe + if L.buf[L.bufpos] == '.' and L.buf[L.bufpos+1] != '.': + tok.tokType = tkParDotLe inc(L.bufpos) else: - tok.toktype = tkParLe + tok.tokType = tkParLe of ')': - tok.toktype = tkParRi + tok.tokType = tkParRi inc(L.bufpos) of '[': inc(L.bufpos) - if L.buf[L.bufPos] == '.' and L.buf[L.bufPos+1] != '.': - tok.toktype = tkBracketDotLe + if L.buf[L.bufpos] == '.' and L.buf[L.bufpos+1] != '.': + tok.tokType = tkBracketDotLe inc(L.bufpos) else: - tok.toktype = tkBracketLe + tok.tokType = tkBracketLe of ']': - tok.toktype = tkBracketRi + tok.tokType = tkBracketRi inc(L.bufpos) of '.': - if L.buf[L.bufPos+1] == ']': + if L.buf[L.bufpos+1] == ']': tok.tokType = tkBracketDotRi inc(L.bufpos, 2) - elif L.buf[L.bufPos+1] == '}': + elif L.buf[L.bufpos+1] == '}': tok.tokType = tkCurlyDotRi inc(L.bufpos, 2) - elif L.buf[L.bufPos+1] == ')': + elif L.buf[L.bufpos+1] == ')': tok.tokType = tkParDotRi inc(L.bufpos, 2) else: getOperator(L, tok) of '{': inc(L.bufpos) - if L.buf[L.bufPos] == '.' and L.buf[L.bufPos+1] != '.': - tok.toktype = tkCurlyDotLe + if L.buf[L.bufpos] == '.' and L.buf[L.bufpos+1] != '.': + tok.tokType = tkCurlyDotLe inc(L.bufpos) else: - tok.toktype = tkCurlyLe + tok.tokType = tkCurlyLe of '}': - tok.toktype = tkCurlyRi + tok.tokType = tkCurlyRi inc(L.bufpos) of ';': - tok.toktype = tkSemiColon + tok.tokType = tkSemiColon inc(L.bufpos) of '`': tok.tokType = tkAccent @@ -804,7 +804,7 @@ proc rawGetTok(L: var TLexer, tok: var TToken) = if c in OpChars: getOperator(L, tok) elif c == nimlexbase.EndOfFile: - tok.toktype = tkEof + tok.tokType = tkEof tok.indent = 0 else: tok.literal = $c diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 379e00b0e4..57c420d3b1 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -135,14 +135,14 @@ proc wrongRedefinition*(info: TLineInfo, s: string) = proc addDecl*(c: PContext, sym: PSym) = if c.currentScope.addUniqueSym(sym) == Failure: - wrongRedefinition(sym.info, sym.Name.s) + wrongRedefinition(sym.info, sym.name.s) proc addPrelimDecl*(c: PContext, sym: PSym) = discard c.currentScope.addUniqueSym(sym) proc addDeclAt*(scope: PScope, sym: PSym) = if scope.addUniqueSym(sym) == Failure: - wrongRedefinition(sym.info, sym.Name.s) + wrongRedefinition(sym.info, sym.name.s) proc addInterfaceDeclAux(c: PContext, sym: PSym) = if sfExported in sym.flags: @@ -159,8 +159,8 @@ proc addOverloadableSymAt*(scope: PScope, fn: PSym) = internalError(fn.info, "addOverloadableSymAt") return var check = strTableGet(scope.symbols, fn.name) - if check != nil and check.Kind notin OverloadableSyms: - wrongRedefinition(fn.info, fn.Name.s) + if check != nil and check.kind notin OverloadableSyms: + wrongRedefinition(fn.info, fn.name.s) else: scope.addSym(fn) @@ -193,7 +193,7 @@ proc lookUp*(c: PContext, n: PNode): PSym = else: internalError(n.info, "lookUp") return - if contains(c.AmbiguousSymbols, result.id): + if contains(c.ambiguousSymbols, result.id): localError(n.info, errUseQualifier, result.name.s) if result.kind == skStub: loadStub(result) @@ -210,11 +210,11 @@ proc qualifiedLookUp*(c: PContext, n: PNode, flags = {checkUndeclared}): PSym = localError(n.info, errUndeclaredIdentifier, ident.s) result = errorSym(c, n) elif checkAmbiguity in flags and result != nil and - contains(c.AmbiguousSymbols, result.id): + contains(c.ambiguousSymbols, result.id): localError(n.info, errUseQualifier, ident.s) of nkSym: result = n.sym - if checkAmbiguity in flags and contains(c.AmbiguousSymbols, result.id): + if checkAmbiguity in flags and contains(c.ambiguousSymbols, result.id): localError(n.info, errUseQualifier, n.sym.name.s) of nkDotExpr: result = nil diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim index 281c642b70..b4f6e043d4 100644 --- a/compiler/magicsys.nim +++ b/compiler/magicsys.nim @@ -134,7 +134,7 @@ proc addSonSkipIntLit*(father, son: PType) = proc setIntLitType*(result: PNode) = let i = result.intVal - case platform.IntSize + case platform.intSize of 8: result.typ = getIntLitType(result) of 4: if i >= low(int32) and i <= high(int32): diff --git a/compiler/main.nim b/compiler/main.nim index 3571e6a4ee..4cea24f9da 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -18,7 +18,7 @@ import tables, docgen2, service, parser, modules, ccgutils, sigmatch, ropes, lists, pretty -from magicsys import SystemModule, resetSysTypes +from magicsys import systemModule, resetSysTypes const hasLLVM_Backend = false @@ -73,7 +73,7 @@ proc commandCompileToC = compileProject() cgenWriteModules() if gCmd != cmdRun: - extccomp.CallCCompiler(changeFileExt(gProjectFull, "")) + extccomp.callCCompiler(changeFileExt(gProjectFull, "")) if isServing: # caas will keep track only of the compilation commands diff --git a/compiler/modules.nim b/compiler/modules.nim index 1775599a91..6a14916829 100644 --- a/compiler/modules.nim +++ b/compiler/modules.nim @@ -164,7 +164,7 @@ proc importModule*(s: PSym, fileIdx: int32): PSym {.procvar.} = result = compileModule(fileIdx, {}) if optCaasEnabled in gGlobalOptions: addDep(s, fileIdx) if sfSystemModule in result.flags: - localError(result.info, errAttemptToRedefine, result.Name.s) + localError(result.info, errAttemptToRedefine, result.name.s) proc includeModule*(s: PSym, fileIdx: int32): PNode {.procvar.} = result = syntaxes.parseFile(fileIdx) @@ -180,7 +180,7 @@ proc `==^`(a, b: string): bool = result = false proc compileSystemModule* = - if magicsys.SystemModule == nil: + if magicsys.systemModule == nil: systemFileIdx = fileInfoIdx(options.libpath/"system.nim") discard compileModule(systemFileIdx, {sfSystemModule}) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index cdfbc3ece1..cc76f857df 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -845,7 +845,7 @@ proc quotedFilename*(i: TLineInfo): PRope = internalAssert i.fileIndex >= 0 result = fileInfos[i.fileIndex].quotedName -ropes.ErrorHandler = proc (err: TRopesError, msg: string, useWarning: bool) = +ropes.errorHandler = proc (err: TRopesError, msg: string, useWarning: bool) = case err of rInvalidFormatStr: internalError("ropes: invalid format string: " & msg) diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index fee96a54a1..2bdfbe0b81 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -121,7 +121,7 @@ proc parseDirective(L: var TLexer, tok: var TToken) = of wEnd: doEnd(L, tok) of wWrite: ppGetTok(L, tok) - msgs.MsgWriteln(tokToStr(tok)) + msgs.msgWriteln(tokToStr(tok)) ppGetTok(L, tok) else: case tok.ident.s.normalize @@ -135,13 +135,13 @@ proc parseDirective(L: var TLexer, tok: var TToken) = ppGetTok(L, tok) var key = tokToStr(tok) ppGetTok(L, tok) - os.putEnv(key, tokToStr(tok) & os.getenv(key)) + os.putEnv(key, tokToStr(tok) & os.getEnv(key)) ppGetTok(L, tok) of "appendenv": ppGetTok(L, tok) var key = tokToStr(tok) ppGetTok(L, tok) - os.putEnv(key, os.getenv(key) & tokToStr(tok)) + os.putEnv(key, os.getEnv(key) & tokToStr(tok)) ppGetTok(L, tok) else: lexMessage(L, errInvalidDirectiveX, tokToStr(tok)) diff --git a/compiler/nimlexbase.nim b/compiler/nimlexbase.nim index e6dcd8ce74..038573c358 100644 --- a/compiler/nimlexbase.nim +++ b/compiler/nimlexbase.nim @@ -42,7 +42,7 @@ type buf*: cstring bufLen*: int # length of buffer in characters stream*: PLLStream # we read from this stream - LineNumber*: int # the current line number + lineNumber*: int # the current line number # private data: sentinel*: int lineStart*: int # index of last line start in buffer @@ -80,7 +80,7 @@ proc fillBuffer(L: var TBaseLexer) = # we know here that pos == L.sentinel, but not if this proc # is called the first time by initBaseLexer() assert(L.sentinel < L.bufLen) - toCopy = L.BufLen - L.sentinel - 1 + toCopy = L.bufLen - L.sentinel - 1 assert(toCopy >= 0) if toCopy > 0: moveMem(L.buf, addr(L.buf[L.sentinel + 1]), toCopy * chrSize) @@ -104,8 +104,8 @@ proc fillBuffer(L: var TBaseLexer) = else: # rather than to give up here because the line is too long, # double the buffer's size and try again: - oldBufLen = L.BufLen - L.bufLen = L.BufLen * 2 + oldBufLen = L.bufLen + L.bufLen = L.bufLen * 2 L.buf = cast[cstring](realloc(L.buf, L.bufLen * chrSize)) assert(L.bufLen - oldBufLen == oldBufLen) charsRead = llStreamRead(L.stream, addr(L.buf[oldBufLen]), @@ -128,14 +128,14 @@ proc fillBaseLexer(L: var TBaseLexer, pos: int): int = proc handleCR(L: var TBaseLexer, pos: int): int = assert(L.buf[pos] == CR) - inc(L.linenumber) + inc(L.lineNumber) result = fillBaseLexer(L, pos) if L.buf[result] == LF: result = fillBaseLexer(L, result) proc handleLF(L: var TBaseLexer, pos: int): int = assert(L.buf[pos] == LF) - inc(L.linenumber) + inc(L.lineNumber) result = fillBaseLexer(L, pos) #L.lastNL := result-1; // BUGFIX: was: result; proc skipUTF8BOM(L: var TBaseLexer) = @@ -150,7 +150,7 @@ proc openBaseLexer(L: var TBaseLexer, inputstream: PLLStream, bufLen = 8192) = L.buf = cast[cstring](alloc(bufLen * chrSize)) L.sentinel = bufLen - 1 L.lineStart = 0 - L.linenumber = 1 # lines start at 1 + L.lineNumber = 1 # lines start at 1 L.stream = inputstream fillBuffer(L) skipUTF8BOM(L) diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim index 60124e3350..38d440adeb 100644 --- a/compiler/nimrod.nim +++ b/compiler/nimrod.nim @@ -81,7 +81,7 @@ when defined(GC_setMaxPause): when compileOption("gc", "v2") or compileOption("gc", "refc"): # the new correct mark&sweet collector is too slow :-/ GC_disableMarkAndSweep() -condsyms.InitDefines() +condsyms.initDefines() when not defined(selftest): handleCmdLine() diff --git a/compiler/nimsets.nim b/compiler/nimsets.nim index f24d3a3560..d65618e0a5 100644 --- a/compiler/nimsets.nim +++ b/compiler/nimsets.nim @@ -58,7 +58,7 @@ proc overlap(a, b: PNode): bool = else: result = sameValue(a, b) -proc SomeInSet(s: PNode, a, b: PNode): bool = +proc someInSet(s: PNode, a, b: PNode): bool = # checks if some element of a..b is in the set s if s.kind != nkCurly: internalError(s.info, "SomeInSet") diff --git a/compiler/options.nim b/compiler/options.nim index 640f70f28c..f184deb698 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -254,11 +254,11 @@ proc completeGeneratedFilePath*(f: string, createSubDir: bool = true): string = result = joinPath(subdir, tail) #echo "completeGeneratedFilePath(", f, ") = ", result -iterator iterSearchPath*(SearchPaths: TLinkedList): string = - var it = PStrEntry(SearchPaths.head) +iterator iterSearchPath*(searchPaths: TLinkedList): string = + var it = PStrEntry(searchPaths.head) while it != nil: yield it.data - it = PStrEntry(it.Next) + it = PStrEntry(it.next) proc rawFindFile(f: string): string = for it in iterSearchPath(searchPaths): @@ -274,7 +274,7 @@ proc rawFindFile2(f: string): string = if existsFile(result): bringToFront(lazyPaths, it) return result.canonicalizePath - it = PStrEntry(it.Next) + it = PStrEntry(it.next) result = "" proc findFile*(f: string): string {.procvar.} = diff --git a/compiler/parser.nim b/compiler/parser.nim index 49fdd57038..b3a4e69632 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -61,7 +61,7 @@ proc newIdentNodeP*(ident: PIdent, p: TParser): PNode proc expectIdentOrKeyw*(p: TParser) proc expectIdent*(p: TParser) proc parLineInfo*(p: TParser): TLineInfo -proc eat*(p: var TParser, TokType: TTokType) +proc eat*(p: var TParser, tokType: TTokType) proc skipInd*(p: var TParser) proc optPar*(p: var TParser) proc optInd*(p: var TParser, n: PNode) @@ -139,9 +139,9 @@ proc expectIdent(p: TParser) = if p.tok.tokType != tkSymbol: lexMessage(p.lex, errIdentifierExpected, prettyTok(p.tok)) -proc eat(p: var TParser, TokType: TTokType) = - if p.tok.TokType == TokType: getTok(p) - else: lexMessage(p.lex, errTokenExpected, TokTypeToStr[TokType]) +proc eat(p: var TParser, tokType: TTokType) = + if p.tok.tokType == tokType: getTok(p) + else: lexMessage(p.lex, errTokenExpected, TokTypeToStr[tokType]) proc parLineInfo(p: TParser): TLineInfo = result = getLineInfo(p.lex, p.tok) @@ -1060,7 +1060,7 @@ proc parseExprStmt(p: var TParser): PNode = result = makeCall(result) getTok(p) skipComment(p, result) - if p.tok.TokType notin {tkOf, tkElif, tkElse, tkExcept}: + if p.tok.tokType notin {tkOf, tkElif, tkElse, tkExcept}: let body = parseStmt(p) addSon(result, newProcNode(nkDo, body.info, body)) while sameInd(p): @@ -1638,7 +1638,7 @@ proc parseTypeClass(p: var TParser): PNode = var args = newNode(nkArgList) addSon(result, args) addSon(args, p.parseTypeClassParam) - while p.tok.TokType == tkComma: + while p.tok.tokType == tkComma: getTok(p) addSon(args, p.parseTypeClassParam) if p.tok.tokType == tkCurlyDotLe and p.validInd: @@ -1818,7 +1818,7 @@ proc parseStmt(p: var TParser): PNode = if p.tok.indent > p.currInd: parMessage(p, errInvalidIndentation) break - if p.tok.toktype in {tkCurlyRi, tkParRi, tkCurlyDotRi, tkBracketRi}: + if p.tok.tokType in {tkCurlyRi, tkParRi, tkCurlyDotRi, tkBracketRi}: # XXX this ensures tnamedparamanonproc still compiles; # deprecate this syntax later break diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index b313e49f54..d9ed50cfeb 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -209,13 +209,13 @@ proc getLib(c: PContext, kind: TLibKind, path: PNode): PLib = var it = PLib(c.libs.head) while it != nil: if it.kind == kind: - if trees.ExprStructuralEquivalent(it.path, path): return it + if trees.exprStructuralEquivalent(it.path, path): return it it = PLib(it.next) result = newLib(kind) result.path = path append(c.libs, result) if path.kind in {nkStrLit..nkTripleStrLit}: - result.isOverriden = options.isDynLibOverride(path.strVal) + result.isOverriden = options.isDynlibOverride(path.strVal) proc expectDynlibNode(c: PContext, n: PNode): PNode = if n.kind != nkExprColonExpr: @@ -505,11 +505,11 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, if key.kind == nkIdent: var userPragma = strTableGet(c.userPragmas, key.ident) if userPragma != nil: - inc c.InstCounter - if c.InstCounter > 100: + inc c.instCounter + if c.instCounter > 100: globalError(it.info, errRecursiveDependencyX, userPragma.name.s) pragma(c, sym, userPragma.ast, validPragmas) - dec c.InstCounter + dec c.instCounter else: var k = whichKeyword(key.ident) if k in validPragmas: @@ -547,7 +547,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, sym.typ.size = size of wNodecl: noVal(it) - incl(sym.loc.Flags, lfNoDecl) + incl(sym.loc.flags, lfNoDecl) of wPure, wNoStackFrame: noVal(it) if sym != nil: incl(sym.flags, sfPure) @@ -566,7 +566,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wCompileTime: noVal(it) incl(sym.flags, sfCompileTime) - incl(sym.loc.Flags, lfNoDecl) + incl(sym.loc.flags, lfNoDecl) of wGlobal: noVal(it) incl(sym.flags, sfGlobal) @@ -579,7 +579,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, addToLib(lib, sym) incl(sym.flags, sfImportc) incl(sym.loc.flags, lfHeader) - incl(sym.loc.Flags, lfNoDecl) + incl(sym.loc.flags, lfNoDecl) # implies nodecl, because otherwise header would not make sense if sym.loc.r == nil: sym.loc.r = toRope(sym.name.s) of wDestructor: @@ -735,7 +735,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, proc implictPragmas*(c: PContext, sym: PSym, n: PNode, validPragmas: TSpecialWords) = if sym != nil and sym.kind != skModule: - var it = POptionEntry(c.optionstack.head) + var it = POptionEntry(c.optionStack.head) while it != nil: let o = it.otherPragmas if not o.isNil: @@ -746,7 +746,7 @@ proc implictPragmas*(c: PContext, sym: PSym, n: PNode, if lfExportLib in sym.loc.flags and sfExportc notin sym.flags: localError(n.info, errDynlibRequiresExportc) - var lib = POptionEntry(c.optionstack.tail).dynlib + var lib = POptionEntry(c.optionStack.tail).dynlib if {lfDynamicLib, lfHeader} * sym.loc.flags == {} and sfImportc in sym.flags and lib != nil: incl(sym.loc.flags, lfDynamicLib) diff --git a/compiler/pretty.nim b/compiler/pretty.nim index 54d47393e5..3a5bfe1970 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -20,7 +20,6 @@ const type TGen = object of TPassContext module*: PSym - checkExtern: bool PGen = ref TGen TSourceFile = object @@ -30,6 +29,7 @@ type var gSourceFiles: seq[TSourceFile] = @[] + gCheckExtern: bool rules: PStringTable proc loadFile(info: TLineInfo) = @@ -118,8 +118,7 @@ proc beautifyName(s: string, k: TSymKind): string = proc checkStyle*(info: TLineInfo, s: string, k: TSymKind) = let beau = beautifyName(s, k) if s != beau: - message(info, errGenerated, - "name does not adhere to naming convention; should be: " & beau) + message(info, errGenerated, "name should be: " & beau) const Letters = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF', '_'} @@ -138,17 +137,18 @@ proc differ(line: string, a, b: int, x: string): bool = inc j return false -proc checkDef(c: PGen; n: PNode) = - if n.kind != nkSym: return - let s = n.sym - +proc checkDef*(n: PNode; s: PSym) = # operators stay as they are: if s.kind in {skResult, skTemp} or s.name.s[0] notin Letters: return if s.kind in {skType, skGenericParam} and sfAnon in s.flags: return - if {sfImportc, sfExportc} * s.flags == {} or c.checkExtern: + if {sfImportc, sfExportc} * s.flags == {} or gCheckExtern: checkStyle(n.info, s.name.s, s.kind) +proc checkDef(c: PGen; n: PNode) = + if n.kind != nkSym: return + checkDef(n, n.sym) + proc checkUse*(n: PNode, s: PSym) = if n.info.fileIndex < 0: return # we simply convert it to what it looks like in the definition @@ -306,7 +306,7 @@ proc myOpen(module: PSym): PPassContext = var g: PGen new(g) g.module = module - g.checkExtern = options.getConfigVar("pretty.checkextern").normalize == "on" + gCheckExtern = options.getConfigVar("pretty.checkextern").normalize == "on" result = g if rules.isNil: rules = newStringTable(modeStyleInsensitive) diff --git a/compiler/procfind.nim b/compiler/procfind.nim index a59df11784..51bd7b937b 100644 --- a/compiler/procfind.nim +++ b/compiler/procfind.nim @@ -35,13 +35,13 @@ proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = # in the symbol table. If the parameter lists are exactly # the same the sym in the symbol table is returned, else nil. var it: TIdentIter - result = initIdentIter(it, scope.symbols, fn.Name) + result = initIdentIter(it, scope.symbols, fn.name) if isGenericRoutine(fn): # we simply check the AST; this is imprecise but nearly the best what # can be done; this doesn't work either though as type constraints are # not kept in the AST .. while result != nil: - if result.Kind == fn.kind and isGenericRoutine(result): + if result.kind == fn.kind and isGenericRoutine(result): let genR = result.ast.sons[genericParamsPos] let genF = fn.ast.sons[genericParamsPos] if exprStructuralEquivalent(genR, genF) and @@ -52,7 +52,7 @@ proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = result = nextIdentIter(it, scope.symbols) else: while result != nil: - if result.Kind == fn.kind and not isGenericRoutine(result): + if result.kind == fn.kind and not isGenericRoutine(result): case equalParams(result.typ.n, fn.typ.n) of paramsEqual: return diff --git a/compiler/rodread.nim b/compiler/rodread.nim index c3083852a1..7a35f0c848 100644 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -658,7 +658,7 @@ proc newRodReader(modfilename: string, crc: TCrc32, readerIndex: int): PRodReader = new(result) try: - result.memFile = memfiles.open(modfilename) + result.memfile = memfiles.open(modfilename) except EOS: return nil result.files = @[] @@ -673,7 +673,7 @@ proc newRodReader(modfilename: string, crc: TCrc32, initIdTable(r.syms) # we terminate the file explicitely with ``\0``, so the cast to `cstring` # is safe: - r.s = cast[cstring](r.memFile.mem) + r.s = cast[cstring](r.memfile.mem) if startsWith(r.s, "NIM:"): initIiTable(r.index.tab) initIiTable(r.imports.tab) # looks like a ROD file @@ -736,7 +736,7 @@ proc getReader(moduleId: int): PRodReader = # problems: for i in 0 .. <gMods.len: result = gMods[i].rd - if result != nil and result.moduleId == moduleId: return result + if result != nil and result.moduleID == moduleId: return result return nil proc rrGetSym(r: PRodReader, id: int, info: TLineInfo): PSym = @@ -845,7 +845,7 @@ proc checkDep(fileIdx: int32): TReasonForRecompile = rawMessage(hintProcessing, reasonToFrmt[result] % filename) if result != rrNone or optForceFullMake in gGlobalOptions: # recompilation is necessary: - if r != nil: memfiles.close(r.memFile) + if r != nil: memfiles.close(r.memfile) r = nil gMods[fileIdx].rd = r gMods[fileIdx].reason = result # now we know better diff --git a/compiler/sem.nim b/compiler/sem.nim index 72b06da65e..a5b72e2b86 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -15,7 +15,7 @@ import magicsys, parser, nversion, nimsets, semfold, importer, procfind, lookups, rodread, pragmas, passes, semdata, semtypinst, sigmatch, semthreads, intsets, transf, vmdef, vm, idgen, aliases, cgmeth, lambdalifting, - evaltempl, patterns, parampatterns, sempass2 + evaltempl, patterns, parampatterns, sempass2, pretty # implementation @@ -47,7 +47,7 @@ proc indexTypesMatch(c: PContext, f, a: PType, arg: PNode): PNode proc typeMismatch(n: PNode, formal, actual: PType) = if formal.kind != tyError and actual.kind != tyError: - localError(n.Info, errGenerated, msgKindToString(errTypeMismatch) & + localError(n.info, errGenerated, msgKindToString(errTypeMismatch) & typeToString(actual) & ") " & `%`(msgKindToString(errButExpectedX), [typeToString(formal)])) @@ -291,10 +291,10 @@ proc myOpen(module: PSym): PPassContext = c.importTable = openScope(c) c.importTable.addSym(module) # a module knows itself if sfSystemModule in module.flags: - magicsys.SystemModule = module # set global variable! + magicsys.systemModule = module # set global variable! else: - c.importTable.addSym magicsys.SystemModule # import the "System" identifier - importAllSymbols(c, magicsys.SystemModule) + c.importTable.addSym magicsys.systemModule # import the "System" identifier + importAllSymbols(c, magicsys.systemModule) c.topLevelScope = openScope(c) result = c @@ -332,12 +332,12 @@ proc myProcess(context: PPassContext, n: PNode): PNode = result = semStmtAndGenerateGenerics(c, n) else: let oldContextLen = msgs.getInfoContextLen() - let oldInGenericInst = c.InGenericInst + let oldInGenericInst = c.inGenericInst try: result = semStmtAndGenerateGenerics(c, n) except ERecoverableError, ESuggestDone: recoverContext(c) - c.InGenericInst = oldInGenericInst + c.inGenericInst = oldInGenericInst msgs.setInfoContextLen(oldContextLen) if getCurrentException() of ESuggestDone: result = nil else: result = ast.emptyNode @@ -346,7 +346,7 @@ proc myProcess(context: PPassContext, n: PNode): PNode = proc checkThreads(c: PContext) = if not needsGlobalAnalysis(): return for i in 0 .. c.threadEntries.len-1: - semthreads.AnalyseThreadProc(c.threadEntries[i]) + semthreads.analyseThreadProc(c.threadEntries[i]) proc myClose(context: PPassContext, n: PNode): PNode = var c = PContext(context) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index bc4e8cd05b..6140d83110 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -93,7 +93,7 @@ proc notFoundError*(c: PContext, n: PNode, errors: seq[string]) = if candidates != "": add(result, "\n" & msgKindToString(errButExpected) & "\n" & candidates) - localError(n.Info, errGenerated, result) + localError(n.info, errGenerated, result) proc gatherUsedSyms(c: PContext, usedSyms: var seq[PNode]) = for scope in walkScopes(c.currentScope): @@ -169,7 +169,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode, #writeMatches(alt) if c.inCompilesContext > 0: # quick error message for performance of 'compiles' built-in: - globalError(n.Info, errGenerated, "ambiguous call") + globalError(n.info, errGenerated, "ambiguous call") elif gErrorCounter == 0: # don't cascade errors var args = "(" @@ -178,7 +178,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode, add(args, typeToString(n.sons[i].typ)) add(args, ")") - localError(n.Info, errGenerated, msgKindToString(errAmbiguousCallXYZ) % [ + localError(n.info, errGenerated, msgKindToString(errAmbiguousCallXYZ) % [ getProcHeader(result.calleeSym), getProcHeader(alt.calleeSym), args]) diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 8f00d91c61..924224fee7 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -160,7 +160,7 @@ proc newOptionEntry(): POptionEntry = proc newContext(module: PSym): PContext = new(result) - result.AmbiguousSymbols = initIntSet() + result.ambiguousSymbols = initIntSet() initLinkedList(result.optionStack) initLinkedList(result.libs) append(result.optionStack, newOptionEntry()) @@ -172,7 +172,7 @@ proc newContext(module: PSym): PContext = result.includedFiles = initIntSet() initStrTable(result.userPragmas) result.generics = @[] - result.UnknownIdents = initIntSet() + result.unknownIdents = initIntSet() proc inclSym(sq: var TSymSeq, s: PSym) = var L = len(sq) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 46902e776c..082ee75836 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -151,15 +151,15 @@ proc checkConvertible(castDest, src: PType): TConvStatus = return var d = skipTypes(castDest, abstractVar) var s = skipTypes(src, abstractVar-{tyTypeDesc}) - while (d != nil) and (d.Kind in {tyPtr, tyRef}) and (d.Kind == s.Kind): + while (d != nil) and (d.kind in {tyPtr, tyRef}) and (d.kind == s.kind): d = base(d) s = base(s) if d == nil: result = convNotLegal - elif d.Kind == tyObject and s.Kind == tyObject: + elif d.kind == tyObject and s.kind == tyObject: result = checkConversionBetweenObjects(d, s) - elif (skipTypes(castDest, abstractVarRange).Kind in IntegralTypes) and - (skipTypes(src, abstractVarRange-{tyTypeDesc}).Kind in IntegralTypes): + elif (skipTypes(castDest, abstractVarRange).kind in IntegralTypes) and + (skipTypes(src, abstractVarRange-{tyTypeDesc}).kind in IntegralTypes): # accept conversion between integral types else: # we use d, s here to speed up that operation a bit: @@ -228,9 +228,9 @@ proc semCast(c: PContext, n: PNode): PNode = result.typ = semTypeNode(c, n.sons[0], nil) addSon(result, copyTree(n.sons[0])) addSon(result, semExprWithType(c, n.sons[1])) - if not isCastable(result.typ, result.sons[1].Typ): + if not isCastable(result.typ, result.sons[1].typ): localError(result.info, errExprCannotBeCastedToX, - typeToString(result.Typ)) + typeToString(result.typ)) proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = const @@ -240,7 +240,7 @@ proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = else: n.sons[1] = semExprWithType(c, n.sons[1], {efDetermineType}) var typ = skipTypes(n.sons[1].typ, abstractVarRange) - case typ.Kind + case typ.kind of tySequence, tyString, tyOpenArray, tyVarargs: n.typ = getSysType(tyInt) of tyArrayConstr, tyArray: @@ -711,7 +711,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = if m.state != csMatch: if c.inCompilesContext > 0: # speed up error generation: - globalError(n.Info, errTypeMismatch, "") + globalError(n.info, errTypeMismatch, "") return emptyNode else: var hasErrorType = false @@ -726,7 +726,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = if not hasErrorType: add(msg, ")\n" & msgKindToString(errButExpected) & "\n" & typeToString(n.sons[0].typ)) - localError(n.Info, errGenerated, msg) + localError(n.info, errGenerated, msg) return errorNode(c, n) result = nil else: @@ -771,7 +771,7 @@ proc afterCallActions(c: PContext; n, orig: PNode, flags: TExprFlags): PNode = analyseIfAddressTakenInCall(c, result) if callee.magic != mNone: result = magicsAfterOverloadResolution(c, result, flags) - if c.InTypeClass == 0: + if c.inTypeClass == 0: result = evalAtCompileTime(c, result) proc semDirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = @@ -810,7 +810,7 @@ proc semEcho(c: PContext, n: PNode): PNode = proc buildEchoStmt(c: PContext, n: PNode): PNode = # we MUST not check 'n' for semantics again here! result = newNodeI(nkCall, n.info) - var e = strTableGet(magicsys.systemModule.Tab, getIdent"echo") + var e = strTableGet(magicsys.systemModule.tab, getIdent"echo") if e != nil: addSon(result, newSymNode(e)) else: @@ -908,6 +908,7 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = var s = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared}) if s != nil: + markUsed(n.sons[1], s) return semSym(c, n, s, flags) n.sons[0] = semExprWithType(c, n.sons[0], flags+{efDetermineType}) @@ -950,7 +951,7 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = return # XXX: This is probably not relevant any more # reset to prevent 'nil' bug: see "tests/reject/tenumitems.nim": - ty = n.sons[0].Typ + ty = n.sons[0].typ ty = skipTypes(ty, {tyGenericInst, tyVar, tyPtr, tyRef}) var check: PNode = nil @@ -1446,7 +1447,7 @@ proc tryExpr(c: PContext, n: PNode, # watch out, hacks ahead: let oldErrorCount = msgs.gErrorCounter let oldErrorMax = msgs.gErrorMax - inc c.InCompilesContext + inc c.inCompilesContext # do not halt after first error: msgs.gErrorMax = high(int) @@ -1459,9 +1460,9 @@ proc tryExpr(c: PContext, n: PNode, errorOutputs = if bufferErrors: {eInMemory} else: {} let oldContextLen = msgs.getInfoContextLen() - let oldInGenericContext = c.InGenericContext - let oldInUnrolledContext = c.InUnrolledContext - let oldInGenericInst = c.InGenericInst + let oldInGenericContext = c.inGenericContext + let oldInUnrolledContext = c.inUnrolledContext + let oldInGenericInst = c.inGenericInst let oldProcCon = c.p c.generics = @[] try: @@ -1471,14 +1472,14 @@ proc tryExpr(c: PContext, n: PNode, nil # undo symbol table changes (as far as it's possible): c.generics = oldGenerics - c.InGenericContext = oldInGenericContext - c.InUnrolledContext = oldInUnrolledContext - c.InGenericInst = oldInGenericInst + c.inGenericContext = oldInGenericContext + c.inUnrolledContext = oldInUnrolledContext + c.inGenericInst = oldInGenericInst c.p = oldProcCon msgs.setInfoContextLen(oldContextLen) setLen(gOwners, oldOwnerLen) c.currentScope = oldScope - dec c.InCompilesContext + dec c.inCompilesContext errorOutputs = oldErrorOutputs msgs.gErrorCounter = oldErrorCount msgs.gErrorMax = oldErrorMax @@ -1893,6 +1894,8 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = let mode = if nfDelegate in n.flags: {} else: {checkUndeclared} var s = qualifiedLookUp(c, n.sons[0], mode) if s != nil: + if gCmd == cmdPretty and n.sons[0].kind == nkDotExpr: + pretty.checkUse(n.sons[0].sons[1], s) case s.kind of skMacro: if sfImmediate notin s.flags: @@ -1912,7 +1915,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result = semConv(c, n) elif n.len == 1: result = semObjConstr(c, n, flags) - elif contains(c.AmbiguousSymbols, s.id): + elif contains(c.ambiguousSymbols, s.id): localError(n.info, errUseQualifier, s.name.s) elif s.magic == mNone: result = semDirectOp(c, n, flags) else: result = semMagic(c, n, s, flags) diff --git a/compiler/seminst.nim b/compiler/seminst.nim index faf0aae117..1025457fdc 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -88,7 +88,7 @@ proc addParamOrResult(c: PContext, param: PSym, kind: TSymKind) proc instantiateBody(c: PContext, n: PNode, result: PSym) = if n.sons[bodyPos].kind != nkEmpty: - inc c.InGenericInst + inc c.inGenericInst # add it here, so that recursive generic procs are possible: addDecl(c, result) pushProcCon(c, result) @@ -109,7 +109,7 @@ proc instantiateBody(c: PContext, n: PNode, result: PSym) = #echo "code instantiated ", result.name.s excl(result.flags, sfForward) popProcCon(c) - dec c.InGenericInst + dec c.inGenericInst proc fixupInstantiatedSymbols(c: PContext, s: PSym) = for i in countup(0, c.generics.len - 1): @@ -265,8 +265,8 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, if fn.kind in {skTemplate, skMacro}: return fn # generates an instantiated proc - if c.InstCounter > 1000: internalError(fn.ast.info, "nesting too deep") - inc(c.InstCounter) + if c.instCounter > 1000: internalError(fn.ast.info, "nesting too deep") + inc(c.instCounter) # careful! we copy the whole AST including the possibly nil body! var n = copyTree(fn.ast) # NOTE: for access of private fields within generics from a different module @@ -309,5 +309,5 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, popOwner() #c.currentScope = oldScope c.friendModule = oldFriend - dec(c.InstCounter) + dec(c.instCounter) if result.kind == skMethod: finishMethod(c, result) diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index c9d5036d80..fb266ae3a6 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -367,7 +367,7 @@ proc trackCase(tracked: PEffects, n: PNode) = for i in oldState.. <tracked.init.len: addToIntersection(inter, tracked.init[i]) - let exh = case skipTypes(n.sons[0].Typ, abstractVarRange-{tyTypeDesc}).Kind + let exh = case skipTypes(n.sons[0].typ, abstractVarRange-{tyTypeDesc}).kind of tyFloat..tyFloat128, tyString: lastSon(n).kind == nkElse else: diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 137f409b2f..1766c4446b 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -142,7 +142,7 @@ proc discardCheck(c: PContext, result: PNode) = while n.kind in skipForDiscardable: n = n.lastSon n.typ = nil - elif c.InTypeClass > 0 and result.typ.kind == tyBool: + elif c.inTypeClass > 0 and result.typ.kind == tyBool: let verdict = semConstExpr(c, result) if verdict.intVal == 0: localError(result.info, "type class predicate failed.") @@ -193,7 +193,7 @@ proc semCase(c: PContext, n: PNode): PNode = var covered: BiggestInt = 0 var typ = commonTypeBegin var hasElse = false - case skipTypes(n.sons[0].Typ, abstractVarRange-{tyTypeDesc}).Kind + case skipTypes(n.sons[0].typ, abstractVarRange-{tyTypeDesc}).kind of tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt32: chckCovered = true of tyFloat..tyFloat128, tyString, tyError: @@ -375,7 +375,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = var v = semIdentDef(c, a.sons[j], symkind) if sfGenSym notin v.flags: addInterfaceDecl(c, v) when oKeepVariableNames: - if c.InUnrolledContext > 0: v.flags.incl(sfShadowed) + if c.inUnrolledContext > 0: v.flags.incl(sfShadowed) else: let shadowed = findShadowedVar(c, v) if shadowed != nil: @@ -496,10 +496,10 @@ proc semForObjectFields(c: TFieldsCtx, typ, forLoop, father: PNode) = fc.field = typ.sym fc.replaceByFieldName = c.m == mFieldPairs openScope(c.c) - inc c.c.InUnrolledContext + inc c.c.inUnrolledContext let body = instFieldLoopBody(fc, lastSon(forLoop), forLoop) father.add(semStmt(c.c, body)) - dec c.c.InUnrolledContext + dec c.c.inUnrolledContext closeScope(c.c) of nkNilLit: discard of nkRecCase: @@ -535,7 +535,7 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = # so that 'break' etc. work as expected, we produce # a 'while true: stmt; break' loop ... result = newNodeI(nkWhileStmt, n.info, 2) - var trueSymbol = strTableGet(magicsys.systemModule.Tab, getIdent"true") + var trueSymbol = strTableGet(magicsys.systemModule.tab, getIdent"true") if trueSymbol == nil: localError(n.info, errSystemNeeds, "true") trueSymbol = newSym(skUnknown, getIdent"true", getCurrOwner(), n.info) @@ -570,9 +570,9 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = fc.tupleIndex = i fc.replaceByFieldName = m == mFieldPairs var body = instFieldLoopBody(fc, loopBody, n) - inc c.InUnrolledContext + inc c.inUnrolledContext stmts.add(semStmt(c, body)) - dec c.InUnrolledContext + dec c.inUnrolledContext closeScope(c) else: var fc: TFieldsCtx @@ -744,9 +744,9 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) = var body: PType = nil s.typScope = c.currentScope.parent else: - inc c.InGenericContext + inc c.inGenericContext var body = semTypeNode(c, a.sons[2], nil) - dec c.InGenericContext + dec c.inGenericContext if body != nil: body.sym = s body.size = -1 # could not be computed properly @@ -1267,7 +1267,7 @@ proc semStmtList(c: PContext, n: PNode): PNode = # "Last expression must be explicitly returned if it " & # "is discardable or discarded") -proc SemStmt(c: PContext, n: PNode): PNode = +proc semStmt(c: PContext, n: PNode): PNode = # now: simply an alias: result = semExprNoType(c, n) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 69649a58c8..4fdd84841c 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -153,7 +153,7 @@ proc semRangeAux(c: PContext, n: PNode, prev: PType): PType = result = newOrPrevType(tyRange, prev, c) result.n = newNodeI(nkRange, n.info) if (n[1].kind == nkEmpty) or (n[2].kind == nkEmpty): - localError(n.Info, errRangeIsEmpty) + localError(n.info, errRangeIsEmpty) var a = semConstExpr(c, n[1]) var b = semConstExpr(c, n[2]) if not sameType(a.typ, b.typ): @@ -163,7 +163,7 @@ proc semRangeAux(c: PContext, n: PNode, prev: PType): PType = localError(n.info, errOrdinalTypeExpected) elif enumHasHoles(a.typ): localError(n.info, errEnumXHasHoles, a.typ.sym.name.s) - elif not leValue(a, b): localError(n.Info, errRangeIsEmpty) + elif not leValue(a, b): localError(n.info, errRangeIsEmpty) addSon(result.n, a) addSon(result.n, b) addSonSkipIntLit(result, b.typ) @@ -198,7 +198,7 @@ proc semArray(c: PContext, n: PNode, prev: PType): PType = indx = makeRangeType(c, 0, e.intVal-1, n.info, e.typ) elif e.kind == nkSym and e.typ.kind == tyExpr: if e.sym.ast != nil: return semArray(c, e.sym.ast, nil) - internalAssert c.InGenericContext > 0 + internalAssert c.inGenericContext > 0 if not isOrdinalType(e.typ.lastSon): localError(n[1].info, errOrdinalTypeExpected) indx = e.typ @@ -240,7 +240,7 @@ proc semTypeIdent(c: PContext, n: PNode): PSym = # This is a typedesc param. is it already bound? # it's not bound when it's used multiple times in the # proc signature for example - if c.InGenericInst > 0: + if c.inGenericInst > 0: let bound = result.typ.sons[0].sym if bound != nil: return bound return result @@ -300,6 +300,7 @@ proc semTuple(c: PContext, n: PNode, prev: PType): PType = else: addSon(result.n, newSymNode(field)) addSonSkipIntLit(result, typ) + if gCmd == cmdPretty: checkDef(a.sons[j], field) proc semIdentVis(c: PContext, kind: TSymKind, n: PNode, allowed: TSymFlags): PSym = @@ -334,6 +335,7 @@ proc semIdentWithPragma(c: PContext, kind: TSymKind, n: PNode, else: discard else: result = semIdentVis(c, kind, n, allowed) + if gCmd == cmdPretty: checkDef(n, result) proc checkForOverlap(c: PContext, t: PNode, currentEx, branchIndex: int) = let ex = t[branchIndex][currentEx].skipConv @@ -412,7 +414,7 @@ proc semRecordCase(c: PContext, n: PNode, check: var TIntSet, pos: var int, return incl(a.sons[0].sym.flags, sfDiscriminant) var covered: BiggestInt = 0 - var typ = skipTypes(a.sons[0].Typ, abstractVar-{tyTypeDesc}) + var typ = skipTypes(a.sons[0].typ, abstractVar-{tyTypeDesc}) if not isOrdinalType(typ): localError(n.info, errSelectorMustBeOrdinal) elif firstOrd(typ) < 0: @@ -450,7 +452,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var TIntSet, pos: var int, case it.kind of nkElifBranch: checkSonsLen(it, 2) - if c.InGenericContext == 0: + if c.inGenericContext == 0: var e = semConstBoolExpr(c, it.sons[0]) if e.kind != nkIntLit: internalError(e.info, "semRecordNodeAux") elif e.intVal != 0 and branch == nil: branch = it.sons[1] @@ -461,7 +463,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var TIntSet, pos: var int, if branch == nil: branch = it.sons[0] idx = 0 else: illFormedAst(n) - if c.InGenericContext > 0: + if c.inGenericContext > 0: # use a new check intset here for each branch: var newCheck: TIntSet assign(newCheck, check) @@ -469,7 +471,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var TIntSet, pos: var int, var newf = newNodeI(nkRecList, n.info) semRecordNodeAux(c, it.sons[idx], newCheck, newPos, newf, rectype) it.sons[idx] = if newf.len == 1: newf[0] else: newf - if c.InGenericContext > 0: + if c.inGenericContext > 0: addSon(father, n) elif branch != nil: semRecordNodeAux(c, branch, check, pos, father, rectype) @@ -761,6 +763,8 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode, addSon(result.n, newSymNode(arg)) rawAddSon(result, finalType) addParamOrResult(c, arg, kind) + if gCmd == cmdPretty: checkDef(a.sons[j], arg) + if n.sons[0].kind != nkEmpty: var r = semTypeNode(c, n.sons[0], nil) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 6940af7b78..2e2d54b5b1 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -226,7 +226,7 @@ proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = for i in countup(0, sonsLen(result) - 1): result.sons[i] = replaceTypeVarsT(cl, result.sons[i]) result.n = replaceTypeVarsN(cl, result.n) - if result.Kind in GenericTypes: + if result.kind in GenericTypes: localError(cl.info, errCannotInstantiateX, typeToString(t, preferName)) if result.kind == tyProc and result.sons[0] != nil: if result.sons[0].kind == tyEmpty: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 3b1f3e7153..201f61dec4 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -354,9 +354,9 @@ proc procTypeRel(c: var TCandidate, f, a: PType): TTypeRelation = return isNone elif f.flags * {tfIterator} != a.flags * {tfIterator}: return isNone - elif f.callconv != a.callconv: + elif f.callConv != a.callConv: # valid to pass a 'nimcall' thingie to 'closure': - if f.callconv == ccClosure and a.callconv == ccDefault: + if f.callConv == ccClosure and a.callConv == ccDefault: result = isConvertible else: return isNone @@ -509,7 +509,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = elif lengthOrd(fRange) != lengthOrd(a): result = isNone else: nil of tyOpenArray, tyVarargs: - case a.Kind + case a.kind of tyOpenArray, tyVarargs: result = typeRel(c, base(f), base(a)) if result < isGeneric: result = isNone @@ -530,7 +530,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = result = isConvertible else: nil of tySequence: - case a.Kind + case a.kind of tySequence: if (f.sons[0].kind != tyGenericParam) and (a.sons[0].kind == tyEmpty): result = isSubtype @@ -620,7 +620,7 @@ proc typeRel(c: var TCandidate, f, a: PType, doBind = true): TTypeRelation = else: nil of tyCString: # conversion from string to cstring is automatic: - case a.Kind + case a.kind of tyCString: if tfNotNil in f.flags and tfNotNil notin a.flags: result = isNilConversion @@ -849,10 +849,10 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, # pushInfoContext(arg.info) openScope(c) - inc c.InTypeClass + inc c.inTypeClass finally: - dec c.InTypeClass + dec c.inTypeClass closeScope(c) for param in f.n[0]: @@ -894,7 +894,7 @@ proc paramTypesMatchAux(c: PContext, m: var TCandidate, f, argType: PType, arg = argSemantized let - a = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) + a = if c.inTypeClass > 0: argType.skipTypes({tyTypeDesc}) else: argType fMaybeExpr = f.skipTypes({tyDistinct}) diff --git a/compiler/suggest.nim b/compiler/suggest.nim index c88687f2ce..06d1b28d25 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -151,7 +151,7 @@ proc suggestEverything(c: PContext, n: PNode, outputs: var int) = proc suggestFieldAccess(c: PContext, n: PNode, outputs: var int) = # special code that deals with ``myObj.``. `n` is NOT the nkDotExpr-node, but # ``myObj``. - var typ = n.Typ + var typ = n.typ if typ == nil: # a module symbol has no type for example: if n.kind == nkSym and n.sym.kind == skModule: @@ -338,8 +338,8 @@ proc suggestExpr*(c: PContext, node: PNode) = if cp == cpNone: return var outputs = 0 # This keeps semExpr() from coming here recursively: - if c.InCompilesContext > 0: return - inc(c.InCompilesContext) + if c.inCompilesContext > 0: return + inc(c.inCompilesContext) if optSuggest in gGlobalOptions: var n = findClosestDot(node) @@ -369,7 +369,7 @@ proc suggestExpr*(c: PContext, node: PNode) = addSon(a, x) suggestCall(c, a, n, outputs) - dec(c.InCompilesContext) + dec(c.inCompilesContext) if outputs > 0 and optUsages notin gGlobalOptions: suggestQuit() proc suggestStmt*(c: PContext, n: PNode) = diff --git a/compiler/transf.nim b/compiler/transf.nim index 936cf89ae8..2332d0b48f 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -513,7 +513,7 @@ proc transformCase(c: PTransf, n: PNode): PTransNode = elseBranch[0] = ifs result.add(elseBranch) elif result.PNode.lastSon.kind != nkElse and not ( - skipTypes(n.sons[0].Typ, abstractVarRange).Kind in + skipTypes(n.sons[0].typ, abstractVarRange).kind in {tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt32}): # fix a stupid code gen bug by normalizing: var elseBranch = newTransNode(nkElse, n.info, 1) @@ -533,7 +533,7 @@ proc getMergeOp(n: PNode): PSym = case n.kind of nkCall, nkHiddenCallConv, nkCommand, nkInfix, nkPrefix, nkPostfix, nkCallStrLit: - if (n.sons[0].Kind == nkSym) and (n.sons[0].sym.kind == skProc) and + if (n.sons[0].kind == nkSym) and (n.sons[0].sym.kind == skProc) and (sfMerge in n.sons[0].sym.flags): result = n.sons[0].sym else: nil diff --git a/compiler/trees.nim b/compiler/trees.nim index ea2f8fbf11..35e9334cc8 100644 --- a/compiler/trees.nim +++ b/compiler/trees.nim @@ -88,13 +88,13 @@ proc getOpSym*(op: PNode): PSym = result = nil else: if sonsLen(op) <= 0: internalError(op.info, "getOpSym") - elif op.sons[0].Kind == nkSym: result = op.sons[0].sym + elif op.sons[0].kind == nkSym: result = op.sons[0].sym else: result = nil proc getMagic*(op: PNode): TMagic = case op.kind of nkCallKinds: - case op.sons[0].Kind + case op.sons[0].kind of nkSym: result = op.sons[0].sym.magic else: result = mNone else: result = mNone diff --git a/compiler/types.nim b/compiler/types.nim index a921c59ba3..779a649a73 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -155,14 +155,14 @@ proc skipTypes(t: PType, kinds: TTypeKinds): PType = proc isOrdinalType(t: PType): bool = assert(t != nil) # caution: uint, uint64 are no ordinal types! - result = t.Kind in {tyChar,tyInt..tyInt64,tyUInt8..tyUInt32,tyBool,tyEnum} or - (t.Kind in {tyRange, tyOrdinal, tyConst, tyMutable, tyGenericInst}) and + result = t.kind in {tyChar,tyInt..tyInt64,tyUInt8..tyUInt32,tyBool,tyEnum} or + (t.kind in {tyRange, tyOrdinal, tyConst, tyMutable, tyGenericInst}) and isOrdinalType(t.sons[0]) proc enumHasHoles(t: PType): bool = var b = t while b.kind in {tyConst, tyMutable, tyRange, tyGenericInst}: b = b.sons[0] - result = b.Kind == tyEnum and tfEnumHasHoles in b.flags + result = b.kind == tyEnum and tfEnumHasHoles in b.flags proc iterOverTypeAux(marker: var TIntSet, t: PType, iter: TTypeIter, closure: PObject): bool @@ -429,9 +429,9 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = if t == nil: return if prefer == preferName and t.sym != nil and sfAnon notin t.sym.flags: if t.kind == tyInt and isIntLit(t): - return t.sym.Name.s & " literal(" & $t.n.intVal & ")" - return t.sym.Name.s - case t.Kind + return t.sym.name.s & " literal(" & $t.n.intVal & ")" + return t.sym.name.s + case t.kind of tyInt: if not isIntLit(t) or prefer == preferExported: result = typeToStr[t.kind] @@ -746,7 +746,7 @@ template ifFastObjectTypeCheckFailed(a, b: PType, body: stmt) {.immediate.} = # TA[T] = object # TB[T] = object # --> TA[int] != TB[int] - if tfFromGeneric in a.flags * b.flags and a.sym.Id == b.sym.Id: + if tfFromGeneric in a.flags * b.flags and a.sym.id == b.sym.id: # ok, we need the expensive structural check body @@ -827,7 +827,7 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = of dcEqOrDistinctOf: while a.kind == tyDistinct: a = a.sons[0] if a.kind != b.kind: return false - case a.Kind + case a.kind of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCString, tyInt..tyBigNum, tyStmt: result = sameFlags(a, b) diff --git a/compiler/vm.nim b/compiler/vm.nim index 215b3486e4..0a1ee0a1aa 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -144,7 +144,7 @@ proc copyValue(src: PNode): PNode = when defined(useNodeIds): if result.id == nodeIdToDebug: echo "COMES FROM ", src.id - case src.Kind + case src.kind of nkCharLit..nkUInt64Lit: result.intVal = src.intVal of nkFloatLit..nkFloat128Lit: result.floatVal = src.floatVal of nkSym: result.sym = src.sym diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim index 1c0c59a7c7..ee05ad7e2c 100644 --- a/lib/pure/hashes.nim +++ b/lib/pure/hashes.nim @@ -32,16 +32,16 @@ proc `!$`*(h: THash): THash {.inline.} = result = result xor (result shr 11) result = result +% result shl 15 -proc hashData*(Data: pointer, Size: int): THash = +proc hashData*(data: pointer, size: int): THash = ## hashes an array of bytes of size `size` var h: THash = 0 when defined(js): var p: cstring asm """`p` = `Data`;""" else: - var p = cast[cstring](Data) + var p = cast[cstring](data) var i = 0 - var s = Size + var s = size while s > 0: h = h !& ord(p[i]) inc(i) diff --git a/lib/pure/json.nim b/lib/pure/json.nim index c79e6e6da4..360a3a5e7e 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -151,11 +151,11 @@ proc kind*(my: TJsonParser): TJsonEventKind {.inline.} = proc getColumn*(my: TJsonParser): int {.inline.} = ## get the current column the parser has arrived at. - result = getColNumber(my, my.bufPos) + result = getColNumber(my, my.bufpos) proc getLine*(my: TJsonParser): int {.inline.} = ## get the current line the parser has arrived at. - result = my.linenumber + result = my.lineNumber proc getFilename*(my: TJsonParser): string {.inline.} = ## get the filename of the file that the parser processes. @@ -227,11 +227,11 @@ proc parseString(my: var TJsonParser): TTokKind = add(my.a, buf[pos]) inc(pos) of '\c': - pos = lexbase.HandleCR(my, pos) + pos = lexbase.handleCR(my, pos) buf = my.buf add(my.a, '\c') of '\L': - pos = lexbase.HandleLF(my, pos) + pos = lexbase.handleLF(my, pos) buf = my.buf add(my.a, '\L') else: @@ -253,11 +253,11 @@ proc skip(my: var TJsonParser) = of '\0': break of '\c': - pos = lexbase.HandleCR(my, pos) + pos = lexbase.handleCR(my, pos) buf = my.buf break of '\L': - pos = lexbase.HandleLF(my, pos) + pos = lexbase.handleLF(my, pos) buf = my.buf break else: @@ -271,10 +271,10 @@ proc skip(my: var TJsonParser) = my.err = errEOC_Expected break of '\c': - pos = lexbase.HandleCR(my, pos) + pos = lexbase.handleCR(my, pos) buf = my.buf of '\L': - pos = lexbase.HandleLF(my, pos) + pos = lexbase.handleLF(my, pos) buf = my.buf of '*': inc(pos) @@ -288,10 +288,10 @@ proc skip(my: var TJsonParser) = of ' ', '\t': inc(pos) of '\c': - pos = lexbase.HandleCR(my, pos) + pos = lexbase.handleCR(my, pos) buf = my.buf of '\L': - pos = lexbase.HandleLF(my, pos) + pos = lexbase.handleLF(my, pos) buf = my.buf else: break diff --git a/lib/pure/lexbase.nim b/lib/pure/lexbase.nim index 81f53b8743..eee95e2e6d 100644 --- a/lib/pure/lexbase.nim +++ b/lib/pure/lexbase.nim @@ -31,7 +31,7 @@ type buf*: cstring ## the buffer itself bufLen*: int ## length of buffer in characters input: PStream ## the input stream - LineNumber*: int ## the current line number + lineNumber*: int ## the current line number sentinel: int lineStart: int # index of last line start in buffer fileOpened: bool @@ -75,7 +75,7 @@ proc fillBuffer(L: var TBaseLexer) = # we know here that pos == L.sentinel, but not if this proc # is called the first time by initBaseLexer() assert(L.sentinel < L.bufLen) - toCopy = L.BufLen - L.sentinel - 1 + toCopy = L.bufLen - L.sentinel - 1 assert(toCopy >= 0) if toCopy > 0: moveMem(L.buf, addr(L.buf[L.sentinel + 1]), toCopy * chrSize) @@ -99,8 +99,8 @@ proc fillBuffer(L: var TBaseLexer) = else: # rather than to give up here because the line is too long, # double the buffer's size and try again: - oldBufLen = L.BufLen - L.bufLen = L.BufLen * 2 + oldBufLen = L.bufLen + L.bufLen = L.bufLen * 2 L.buf = cast[cstring](realloc(L.buf, L.bufLen * chrSize)) assert(L.bufLen - oldBufLen == oldBufLen) charsRead = readData(L.input, addr(L.buf[oldBufLen]), @@ -123,14 +123,14 @@ proc fillBaseLexer(L: var TBaseLexer, pos: int): int = proc handleCR(L: var TBaseLexer, pos: int): int = assert(L.buf[pos] == '\c') - inc(L.linenumber) + inc(L.lineNumber) result = fillBaseLexer(L, pos) if L.buf[result] == '\L': result = fillBaseLexer(L, result) proc handleLF(L: var TBaseLexer, pos: int): int = assert(L.buf[pos] == '\L') - inc(L.linenumber) + inc(L.lineNumber) result = fillBaseLexer(L, pos) #L.lastNL := result-1; // BUGFIX: was: result; proc skipUtf8Bom(L: var TBaseLexer) = @@ -147,7 +147,7 @@ proc open(L: var TBaseLexer, input: PStream, bufLen: int = 8192) = L.buf = cast[cstring](alloc(bufLen * chrSize)) L.sentinel = bufLen - 1 L.lineStart = 0 - L.linenumber = 1 # lines start at 1 + L.lineNumber = 1 # lines start at 1 fillBuffer(L) skipUtf8Bom(L) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index c1b71c2023..9b08fea6f1 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -356,8 +356,8 @@ when defined(windows): proc skipFindData(f: TWIN32_FIND_DATA): bool {.inline.} = const dot = ord('.') - result = f.cFilename[0].int == dot and(f.cFilename[1].int == 0 or - f.cFilename[1].int == dot and f.cFilename[2].int == 0) + result = f.cFileName[0].int == dot and(f.cFileName[1].int == 0 or + f.cFileName[1].int == dot and f.cFileName[2].int == 0) proc existsFile*(filename: string): bool {.rtl, extern: "nos$1", tags: [FReadDir].} = diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 1be30f006c..76765ff8e9 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -23,7 +23,7 @@ else: type TProcess = object of TObject when defined(windows): - FProcessHandle: THandle + fProcessHandle: THandle inHandle, outHandle, errHandle: TFileHandle id: THandle else: @@ -336,7 +336,7 @@ when defined(Windows) and not defined(useNimRtl): var s = PFileHandleStream(s) if s.atTheEnd: return 0 var br: int32 - var a = winlean.ReadFile(s.handle, buffer, bufLen.cint, br, nil) + var a = winlean.readFile(s.handle, buffer, bufLen.cint, br, nil) # TRUE and zero bytes returned (EOF). # TRUE and n (>0) bytes returned (good data). # FALSE and bytes returned undefined (system error). @@ -383,12 +383,12 @@ when defined(Windows) and not defined(useNimRtl): # O_WRONLY {.importc: "_O_WRONLY", header: "<fcntl.h>".}: int # O_RDONLY {.importc: "_O_RDONLY", header: "<fcntl.h>".}: int - proc createPipeHandles(Rdhandle, WrHandle: var THandle) = + proc createPipeHandles(rdHandle, wrHandle: var THandle) = var piInheritablePipe: TSECURITY_ATTRIBUTES - piInheritablePipe.nlength = sizeof(TSECURITY_ATTRIBUTES).cint + piInheritablePipe.nLength = sizeof(TSECURITY_ATTRIBUTES).cint piInheritablePipe.lpSecurityDescriptor = nil - piInheritablePipe.Binherithandle = 1 - if createPipe(Rdhandle, WrHandle, piInheritablePipe, 1024) == 0'i32: + piInheritablePipe.bInheritHandle = 1 + if createPipe(rdHandle, wrHandle, piInheritablePipe, 1024) == 0'i32: osError(osLastError()) proc fileClose(h: THandle) {.inline.} = @@ -440,11 +440,11 @@ when defined(Windows) and not defined(useNimRtl): var tmp = newWideCString(cmdl) var ee = newWideCString(e) var wwd = newWideCString(wd) - success = winlean.CreateProcessW(nil, + success = winlean.createProcessW(nil, tmp, nil, nil, 1, NORMAL_PRIORITY_CLASS or CREATE_UNICODE_ENVIRONMENT, ee, wwd, si, procInfo) else: - success = winlean.CreateProcessA(nil, + success = winlean.createProcessA(nil, cmdl, nil, nil, 1, NORMAL_PRIORITY_CLASS, e, wd, SI, ProcInfo) let lastError = osLastError() @@ -459,45 +459,45 @@ when defined(Windows) and not defined(useNimRtl): if success == 0: osError(lastError) # Close the handle now so anyone waiting is woken: discard closeHandle(procInfo.hThread) - result.FProcessHandle = procInfo.hProcess - result.id = procInfo.dwProcessID + result.fProcessHandle = procInfo.hProcess + result.id = procInfo.dwProcessId proc close(p: PProcess) = when false: # somehow this does not work on Windows: - discard CloseHandle(p.inHandle) - discard CloseHandle(p.outHandle) - discard CloseHandle(p.errHandle) - discard CloseHandle(p.FProcessHandle) + discard closeHandle(p.inHandle) + discard closeHandle(p.outHandle) + discard closeHandle(p.errHandle) + discard closeHandle(p.FProcessHandle) proc suspend(p: PProcess) = - discard suspendThread(p.FProcessHandle) + discard suspendThread(p.fProcessHandle) proc resume(p: PProcess) = - discard resumeThread(p.FProcessHandle) + discard resumeThread(p.fProcessHandle) proc running(p: PProcess): bool = - var x = waitForSingleObject(p.FProcessHandle, 50) + var x = waitForSingleObject(p.fProcessHandle, 50) return x == WAIT_TIMEOUT proc terminate(p: PProcess) = if running(p): - discard terminateProcess(p.FProcessHandle, 0) + discard terminateProcess(p.fProcessHandle, 0) proc waitForExit(p: PProcess, timeout: int = -1): int = - discard waitForSingleObject(p.FProcessHandle, timeout.int32) + discard waitForSingleObject(p.fProcessHandle, timeout.int32) var res: int32 - discard getExitCodeProcess(p.FProcessHandle, res) + discard getExitCodeProcess(p.fProcessHandle, res) result = res - discard closeHandle(p.FProcessHandle) + discard closeHandle(p.fProcessHandle) proc peekExitCode(p: PProcess): int = - var b = waitForSingleObject(p.FProcessHandle, 50) == WAIT_TIMEOUT + var b = waitForSingleObject(p.fProcessHandle, 50) == WAIT_TIMEOUT if b: result = -1 else: var res: int32 - discard getExitCodeProcess(p.FProcessHandle, res) + discard getExitCodeProcess(p.fProcessHandle, res) return res proc inputStream(p: PProcess): PStream = @@ -521,10 +521,10 @@ when defined(Windows) and not defined(useNimRtl): si.hStdOutput = getStdHandle(STD_OUTPUT_HANDLE) when useWinUnicode: var c = newWideCString(command) - var res = winlean.CreateProcessW(nil, c, nil, nil, 0, + var res = winlean.createProcessW(nil, c, nil, nil, 0, NORMAL_PRIORITY_CLASS, nil, nil, si, procInfo) else: - var res = winlean.CreateProcessA(nil, command, nil, nil, 0, + var res = winlean.createProcessA(nil, command, nil, nil, 0, NORMAL_PRIORITY_CLASS, nil, nil, SI, ProcInfo) if res == 0: osError(osLastError()) @@ -542,7 +542,7 @@ when defined(Windows) and not defined(useNimRtl): assert readfds.len <= MAXIMUM_WAIT_OBJECTS var rfds: TWOHandleArray for i in 0..readfds.len()-1: - rfds[i] = readfds[i].FProcessHandle + rfds[i] = readfds[i].fProcessHandle var ret = waitForMultipleObjects(readfds.len.int32, addr(rfds), 0'i32, timeout.int32) diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index 5076d72fdd..6b2ee62825 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -37,7 +37,7 @@ type ## or the argument, ``value`` is not "" if ## the option was given a value -when defined(os.ParamCount): +when defined(os.paramCount): # we cannot provide this for NimRtl creation on Posix, because we can't # access the command line arguments then! diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index dee45cbd66..61df82640b 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -445,7 +445,7 @@ proc bindAddr*(socket: TSocket, port = TPort(0), address = "") {. hints.ai_socktype = toInt(SOCK_STREAM) hints.ai_protocol = toInt(IPPROTO_TCP) gaiNim(address, port, hints, aiList) - if bindSocket(socket.fd, aiList.ai_addr, aiList.ai_addrLen.TSockLen) < 0'i32: + if bindSocket(socket.fd, aiList.ai_addr, aiList.ai_addrlen.TSockLen) < 0'i32: osError(osLastError()) proc getSockName*(socket: TSocket): TPort = @@ -628,7 +628,7 @@ proc accept*(server: TSocket): TSocket {.deprecated, tags: [FReadIO].} = proc close*(socket: TSocket) = ## closes a socket. when defined(windows): - discard winlean.closeSocket(socket.fd) + discard winlean.closesocket(socket.fd) else: discard posix.close(socket.fd) # TODO: These values should not be discarded. An EOS should be raised. @@ -687,7 +687,7 @@ proc getHostByAddr*(ip: string): Thostent {.tags: [FReadIO].} = result.name = $s.h_name result.aliases = cstringArrayToSeq(s.h_aliases) when defined(windows): - result.addrType = TDomain(s.h_addrtype) + result.addrtype = TDomain(s.h_addrtype) else: if s.h_addrtype == posix.AF_INET: result.addrType = AF_INET @@ -708,7 +708,7 @@ proc getHostByName*(name: string): Thostent {.tags: [FReadIO].} = result.name = $s.h_name result.aliases = cstringArrayToSeq(s.h_aliases) when defined(windows): - result.addrType = TDomain(s.h_addrtype) + result.addrtype = TDomain(s.h_addrtype) else: if s.h_addrtype == posix.AF_INET: result.addrType = AF_INET @@ -1058,7 +1058,7 @@ proc readIntoBuf(socket: TSocket, flags: int32): int = else: result = recv(socket.fd, addr(socket.buffer), cint(socket.buffer.high), flags) if result <= 0: - socket.buflen = 0 + socket.bufLen = 0 socket.currPos = 0 return result socket.bufLen = result diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 246126828f..be3e5d6da5 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -345,11 +345,11 @@ when not defined(JS): monthday: int(tm.monthday), month: TMonth(tm.month), year: tm.year + 1900'i32, - weekday: weekDays[int(tm.weekDay)], + weekday: weekDays[int(tm.weekday)], yearday: int(tm.yearday), - isDST: tm.isDST > 0, + isDST: tm.isdst > 0, tzname: if local: - if tm.isDST > 0: + if tm.isdst > 0: getTzname().DST else: getTzname().nonDST @@ -367,7 +367,7 @@ when not defined(JS): result.monthday = t.monthday result.month = ord(t.month) result.year = t.year - 1900 - result.weekday = weekDays[t.weekDay] + result.weekday = weekDays[t.weekday] result.yearday = t.yearday result.isdst = if t.isDST: 1 else: 0 @@ -532,7 +532,7 @@ proc getDateStr*(): string {.rtl, extern: "nt$1", tags: [FTime].} = ## gets the current date as a string of the format ``YYYY-MM-DD``. var ti = getLocalTime(getTime()) result = $ti.year & '-' & intToStr(ord(ti.month)+1, 2) & - '-' & intToStr(ti.monthDay, 2) + '-' & intToStr(ti.monthday, 2) proc getClockStr*(): string {.rtl, extern: "nt$1", tags: [FTime].} = ## gets the current clock time as a string of the format ``HH:MM:SS``. diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 6d6be33d0f..0fb9bb4827 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -132,9 +132,9 @@ when BitsPerPage mod (sizeof(int)*8) != 0: template color(c): expr = c.refCount and colorMask template setColor(c, col) = when col == rcBlack: - c.refcount = c.refCount and not colorMask + c.refcount = c.refcount and not colorMask else: - c.refcount = c.refCount and not colorMask or col + c.refcount = c.refcount and not colorMask or col proc writeCell(msg: cstring, c: PCell) = var kind = -1 @@ -211,7 +211,7 @@ proc decRef(c: PCell) {.inline.} = proc incRef(c: PCell) {.inline.} = gcAssert(isAllocatedPtr(gch.region, c), "incRef: interiorPtr") - c.refcount = c.refCount +% rcIncrement + c.refcount = c.refcount +% rcIncrement # and not colorMask #writeCell("incRef", c) if canbeCycleRoot(c): @@ -582,7 +582,7 @@ proc markRoots(gch: var TGcHeap) = for s in elements(gch.cycleRoots): #writeCell("markRoot", s) inc tabSize - if s.color == rcPurple and s.refCount >=% rcIncrement: + if s.color == rcPurple and s.refcount >=% rcIncrement: markGray(s) else: excl(gch.cycleRoots, s) From 286f166304f8d7ed59673c148541da41044637b2 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 29 Dec 2013 03:32:46 +0100 Subject: [PATCH 171/326] case consistency for linux --- lib/posix/posix.nim | 468 ++++++++++++++++++++-------------------- lib/pure/memfiles.nim | 14 +- lib/pure/os.nim | 24 +-- lib/pure/osproc.nim | 54 ++--- lib/pure/sockets.nim | 80 +++---- lib/system/dyncalls.nim | 4 +- 6 files changed, 322 insertions(+), 322 deletions(-) diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index 806c255ee9..685a1dafce 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -85,15 +85,15 @@ type Tdirent* {.importc: "struct dirent", header: "<dirent.h>", final, pure.} = object ## dirent_t struct - d_ino*: TIno ## File serial number. + d_ino*: Tino ## File serial number. d_name*: array [0..255, char] ## Name of entry. Tflock* {.importc: "flock", final, pure, header: "<fcntl.h>".} = object ## flock type 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_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. @@ -172,7 +172,7 @@ type TPasswd* {.importc: "struct passwd", header: "<pwd.h>", final, pure.} = object ## struct passwd pw_name*: cstring ## User's login name. - pw_uid*: TUid ## Numerical user ID. + 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. @@ -240,20 +240,20 @@ type TSem* {.importc: "sem_t", header: "<semaphore.h>", final, pure.} = object Tipc_perm* {.importc: "struct ipc_perm", header: "<sys/ipc.h>", final, pure.} = object ## struct ipc_perm - uid*: tuid ## Owner's user ID. - gid*: tgid ## Owner's group ID. + uid*: Tuid ## Owner's user ID. + gid*: TGid ## Owner's group ID. cuid*: Tuid ## Creator's user ID. - cgid*: Tgid ## Creator's group ID. + cgid*: TGid ## Creator's group ID. mode*: TMode ## Read/write permission. TStat* {.importc: "struct stat", header: "<sys/stat.h>", final, pure.} = object ## struct stat st_dev*: TDev ## Device ID of device containing file. - st_ino*: TIno ## File serial number. + 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_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 @@ -262,9 +262,9 @@ type ## 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_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. @@ -305,12 +305,12 @@ type tm_isdst*: cint ## Daylight Savings flag. Ttimespec* {.importc: "struct timespec", header: "<time.h>", final, pure.} = object ## struct timespec - tv_sec*: Ttime ## Seconds. + tv_sec*: TTime ## Seconds. tv_nsec*: int ## Nanoseconds. titimerspec* {.importc: "struct itimerspec", header: "<time.h>", final, pure.} = object ## struct itimerspec - it_interval*: ttimespec ## Timer period. - it_value*: ttimespec ## Timer expiration. + 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 @@ -322,9 +322,9 @@ type header: "<signal.h>", final, pure.} = object ## struct sigevent sigev_notify*: cint ## Notification type. sigev_signo*: cint ## Signal number. - sigev_value*: Tsigval ## Signal value. - sigev_notify_function*: proc (x: TSigval) {.noconv.} ## Notification func. - sigev_notify_attributes*: ptr Tpthreadattr ## Notification attributes. + sigev_value*: TsigVal ## Signal value. + sigev_notify_function*: proc (x: TsigVal) {.noconv.} ## Notification func. + sigev_notify_attributes*: ptr Tpthread_attr ## Notification attributes. TsigVal* {.importc: "union sigval", header: "<signal.h>", final, pure.} = object ## struct sigval @@ -335,10 +335,10 @@ type 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 + 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.} + sa_sigaction*: proc (x: cint, y: var TsigInfo, z: pointer) {.noconv.} TStack* {.importc: "stack_t", header: "<signal.h>", final, pure.} = object ## stack_t @@ -357,12 +357,12 @@ type 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_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. + 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 @@ -373,9 +373,9 @@ type sched_priority*: cint sched_ss_low_priority*: cint ## Low scheduling priority for ## sporadic server. - sched_ss_repl_period*: ttimespec ## Replenishment period for + sched_ss_repl_period*: Ttimespec ## Replenishment period for ## sporadic server. - sched_ss_init_budget*: ttimespec ## Initial budget for sporadic server. + sched_ss_init_budget*: Ttimespec ## Initial budget for sporadic server. sched_ss_max_repl*: cint ## Maximum pending replenishments for ## sporadic server. @@ -383,8 +383,8 @@ type final, pure.} = object ## struct timeval tv_sec*: int ## Seconds. tv_usec*: int ## Microseconds. - Tfd_set* {.importc: "fd_set", header: "<sys/select.h>", - final, pure.} = object + TFdSet* {.importc: "fd_set", header: "<sys/select.h>", + final, pure.} = object Tmcontext* {.importc: "mcontext_t", header: "<ucontext.h>", final, pure.} = object Tucontext* {.importc: "ucontext_t", header: "<ucontext.h>", @@ -406,7 +406,7 @@ when hasAioH: 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_sigevent*: TsigEvent ## Signal number and value. aio_lio_opcode: cint ## Operation to be performed. when hasSpawnH: @@ -422,13 +422,13 @@ type TSockAddr* {.importc: "struct sockaddr", header: "<sys/socket.h>", pure, final.} = object ## struct sockaddr - sa_family*: Tsa_family ## Address family. + sa_family*: TSa_Family ## Address family. sa_data*: array [0..255, char] ## Socket address (variable-length data). Tsockaddr_storage* {.importc: "struct sockaddr_storage", header: "<sys/socket.h>", pure, final.} = object ## struct sockaddr_storage - ss_family*: Tsa_family ## Address family. + ss_family*: TSa_Family ## Address family. Tif_nameindex* {.importc: "struct if_nameindex", final, pure, header: "<net/if.h>".} = object ## struct if_nameindex @@ -444,17 +444,17 @@ type Tmsghdr* {.importc: "struct msghdr", pure, final, header: "<sys/socket.h>".} = object ## struct msghdr msg_name*: pointer ## Optional address. - msg_namelen*: TSockLen ## Size of address. + msg_namelen*: TSocklen ## Size of address. msg_iov*: ptr TIOVec ## Scatter/gather array. msg_iovlen*: cint ## Members in msg_iov. msg_control*: pointer ## Ancillary data; see below. - msg_controllen*: TSockLen ## Ancillary data buffer len. + msg_controllen*: TSocklen ## Ancillary data buffer len. msg_flags*: cint ## Flags on received message. Tcmsghdr* {.importc: "struct cmsghdr", pure, final, header: "<sys/socket.h>".} = object ## struct cmsghdr - cmsg_len*: TSockLen ## Data byte count, including the cmsghdr. + cmsg_len*: TSocklen ## Data byte count, including the cmsghdr. cmsg_level*: cint ## Originating protocol. cmsg_type*: cint ## Protocol-specific type. @@ -475,7 +475,7 @@ type Tsockaddr_in* {.importc: "struct sockaddr_in", pure, final, header: "<netinet/in.h>".} = object ## struct sockaddr_in - sin_family*: TSa_family ## AF_INET. + sin_family*: TSa_Family ## AF_INET. sin_port*: TInPort ## Port number. sin_addr*: TInAddr ## IP address. @@ -485,10 +485,10 @@ type Tsockaddr_in6* {.importc: "struct sockaddr_in6", pure, final, header: "<netinet/in.h>".} = object ## struct sockaddr_in6 - sin6_family*: TSa_family ## AF_INET6. + sin6_family*: TSa_Family ## AF_INET6. sin6_port*: TInPort ## Port number. sin6_flowinfo*: int32 ## IPv6 traffic class and flow information. - sin6_addr*: Tin6Addr ## IPv6 address. + sin6_addr*: TIn6Addr ## IPv6 address. sin6_scope_id*: int32 ## Set of interfaces for a scope. Tipv6_mreq* {.importc: "struct ipv6_mreq", pure, final, @@ -543,10 +543,10 @@ type ai_family*: cint ## Address family of socket. ai_socktype*: cint ## Socket type. ai_protocol*: cint ## Protocol of socket. - ai_addrlen*: TSockLen ## Length of socket address. + ai_addrlen*: TSocklen ## Length of socket address. ai_addr*: ptr TSockAddr ## Socket address of socket. ai_canonname*: cstring ## Canonical name of service location. - ai_next*: ptr TAddrInfo ## Pointer to next in list. + ai_next*: ptr Taddrinfo ## Pointer to next in list. TPollfd* {.importc: "struct pollfd", pure, final, header: "<poll.h>".} = object ## struct pollfd @@ -1616,9 +1616,9 @@ var IPPROTO_UDP* {.importc, header: "<netinet/in.h>".}: cint ## User datagram protocol. - INADDR_ANY* {.importc, header: "<netinet/in.h>".}: TinAddrScalar + INADDR_ANY* {.importc, header: "<netinet/in.h>".}: TInAddrScalar ## IPv4 local host address. - INADDR_BROADCAST* {.importc, header: "<netinet/in.h>".}: TinAddrScalar + INADDR_BROADCAST* {.importc, header: "<netinet/in.h>".}: TInAddrScalar ## IPv4 broadcast address. INET_ADDRSTRLEN* {.importc, header: "<netinet/in.h>".}: cint @@ -1726,7 +1726,7 @@ var ## Invalid fd member (revents only). -when hasSpawnh: +when hasSpawnH: var POSIX_SPAWN_RESETIDS* {.importc, header: "<spawn.h>".}: cint POSIX_SPAWN_SETPGROUP* {.importc, header: "<spawn.h>".}: cint @@ -1750,11 +1750,11 @@ when hasAioH: 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 {. + 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>".} + a4: ptr TsigEvent): cint {.importc, header: "<aio.h>".} # arpa/inet.h proc htonl*(a1: int32): int32 {.importc, header: "<arpa/inet.h>".} @@ -1778,9 +1778,9 @@ proc IN6ADDR_LOOPBACK_INIT* (): TIn6Addr {.importc, header: "<netinet/in.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 {. +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>".} @@ -1792,12 +1792,12 @@ 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 creat*(a1: cstring, a2: TMode): cint {.importc, header: "<fcntl.h>".} proc fcntl*(a1: cint | TSocketHandle, 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 {. +proc posix_fadvise*(a1: cint, a2, a3: TOff, a4: cint): cint {. importc, header: "<fcntl.h>".} -proc posix_fallocate*(a1: cint, a2, a3: Toff): cint {. +proc posix_fallocate*(a1: cint, a2, a3: TOff): cint {. importc, header: "<fcntl.h>".} proc feclearexcept*(a1: cint): cint {.importc, header: "<fenv.h>".} @@ -1812,7 +1812,7 @@ 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 feupdateenv*(a1: ptr Tfenv): cint {.importc, header: "<fenv.h>".} when not defined(haiku): proc fmtmsg*(a1: int, a2: cstring, a3: cint, @@ -1830,12 +1830,12 @@ proc nftw*(a1: cstring, proc glob*(a1: cstring, a2: cint, a3: proc (x1: cstring, x2: cint): cint {.noconv.}, - a4: ptr Tglob): cint {.importc, header: "<glob.h>".} + 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, +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 {. @@ -1845,7 +1845,7 @@ 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_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>".} @@ -1862,33 +1862,33 @@ proc setlocale*(a1: cint, a2: cstring): cstring {. 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 {. +proc mq_close*(a1: TMqd): cint {.importc, header: "<mqueue.h>".} +proc mq_getattr*(a1: TMqd, a2: ptr TMqAttr): cint {. importc, header: "<mqueue.h>".} -proc mq_notify*(a1: Tmqd, a2: ptr Tsigevent): cint {. +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 {. +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 {. +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 {. +proc mq_setattr*(a1: TMqd, a2, a3: ptr TMqAttr): 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_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 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>".} @@ -1933,9 +1933,9 @@ 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 {. +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 {. +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>".} @@ -1949,9 +1949,9 @@ proc pthread_barrierattr_destroy*(a1: ptr Tpthread_barrierattr): cint {. 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 {. +proc pthread_barrierattr_init*(a1: ptr Tpthread_barrierattr): cint {. importc, header: "<pthread.h>".} -proc pthread_barrierattr_setpshared*(a1: ptr TPthread_barrierattr, +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) {. @@ -1970,13 +1970,13 @@ 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>".} + 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_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>".} @@ -1984,7 +1984,7 @@ 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_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>".} @@ -2016,7 +2016,7 @@ 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_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>".} @@ -2069,7 +2069,7 @@ 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 chown*(a1: cstring, a2: Tuid, a3: TGid): cint {.importc, header: "<unistd.h>".} proc close*(a1: cint | TSocketHandle): 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>".} @@ -2085,19 +2085,19 @@ 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 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 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 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 geteuid*(): Tuid {.importc, header: "<unistd.h>".} proc getgid*(): TGid {.importc, header: "<unistd.h>".} -proc getgroups*(a1: cint, a2: ptr array[0..255, Tgid]): cint {. +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>".} @@ -2106,105 +2106,105 @@ 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 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 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 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 {. +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 {. +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 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 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 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 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 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 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 {. +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 {. +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 {. +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_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 sem_wait*(a1: ptr TSem): cint {.importc, header: "<semaphore.h>".} -proc ftok*(a1: cstring, a2: cint): Tkey {.importc, header: "<sys/ipc.h>".} +proc ftok*(a1: cstring, a2: cint): TKey {.importc, header: "<sys/ipc.h>".} -proc statvfs*(a1: cstring, a2: var Tstatvfs): cint {. +proc statvfs*(a1: cstring, a2: var TStatvfs): cint {. importc, header: "<sys/statvfs.h>".} -proc fstatvfs*(a1: cint, a2: var Tstatvfs): cint {. +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 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 {. +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 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>".} +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>".} +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>".} +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>".} +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>".} +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>".} +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>".} +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>".} @@ -2219,7 +2219,7 @@ proc S_TYPEISTMO*(buf: var TStat): bool {.importc, header: "<sys/stat.h>".} 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 {. +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>".} @@ -2229,75 +2229,75 @@ 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, +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 {. +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*(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 {. +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 {. +proc clock_getres*(a1: TClockId, a2: var Ttimespec): cint {. importc, header: "<time.h>".} -proc clock_gettime*(a1: Tclockid, a2: var Ttimespec): cint {. +proc clock_gettime*(a1: TClockId, a2: var Ttimespec): cint {. importc, header: "<time.h>".} -proc clock_nanosleep*(a1: Tclockid, a2: cint, a3: var Ttimespec, +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 {. +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 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 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, + 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 {. +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, +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 {. +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 {. +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 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 {. +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 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>".} @@ -2308,20 +2308,20 @@ 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 {. +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 {. +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 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 {. +proc sigwaitinfo*(a1: var Tsigset, a2: var TsigInfo): cint {. importc, header: "<signal.h>".} @@ -2333,81 +2333,81 @@ proc catopen*(a1: cstring, a2: cint): Tnl_catd {. 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 {. +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 {. +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 {. +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 {. +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 hstrerror*(herrnum: cint): cstring {.importc, header: "<netdb.h>".} -proc FD_CLR*(a1: cint, a2: var Tfd_set) {.importc, header: "<sys/select.h>".} -proc FD_ISSET*(a1: cint | TSocketHandle, a2: var Tfd_set): cint {. +proc FD_CLR*(a1: cint, a2: var TFdSet) {.importc, header: "<sys/select.h>".} +proc FD_ISSET*(a1: cint | TSocketHandle, a2: var TFdSet): cint {. importc, header: "<sys/select.h>".} -proc FD_SET*(a1: cint | TSocketHandle, a2: var Tfd_set) {.importc, header: "<sys/select.h>".} -proc FD_ZERO*(a1: var Tfd_set) {.importc, header: "<sys/select.h>".} +proc FD_SET*(a1: cint | TSocketHandle, a2: var TFdSet) {.importc, header: "<sys/select.h>".} +proc FD_ZERO*(a1: var TFdSet) {.importc, header: "<sys/select.h>".} -proc pselect*(a1: cint, a2, a3, a4: ptr Tfd_set, a5: ptr ttimespec, +proc pselect*(a1: cint, a2, a3, a4: ptr TFdSet, a5: ptr Ttimespec, a6: var Tsigset): cint {.importc, header: "<sys/select.h>".} -proc select*(a1: cint, a2, a3, a4: ptr Tfd_set, a5: ptr ttimeval): cint {. +proc select*(a1: cint, a2, a3, a4: ptr TFdSet, a5: ptr Ttimeval): cint {. importc, header: "<sys/select.h>".} when hasSpawnH: - proc posix_spawn*(a1: var tpid, a2: cstring, + 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, + 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, + 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 {. + 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>".} + 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 {. + 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, + proc posix_spawnattr_getsigdefault*(a1: var Tposix_spawnattr, a2: var Tsigset): cint {.importc, header: "<spawn.h>".} - proc posix_spawnattr_getflags*(a1: var tposix_spawnattr, + 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, + 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_getsigmask*(a1: var Tposix_spawnattr, + a2: var Tsigset): cint {.importc, header: "<spawn.h>".} - proc posix_spawnattr_init*(a1: var tposix_spawnattr): cint {. + 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: cint): cint {. + 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: cint): cint {. importc, header: "<spawn.h>".} - proc posix_spawnattr_setpgroup*(a1: var tposix_spawnattr, a2: tpid): cint {. + 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, + 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, + 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>".} @@ -2424,10 +2424,10 @@ proc writev*(a1: cint, a2: ptr TIOVec, a3: cint): int {. proc CMSG_DATA*(cmsg: ptr Tcmsghdr): cstring {. importc, header: "<sys/socket.h>".} -proc CMSG_NXTHDR*(mhdr: ptr TMsgHdr, cmsg: ptr TCMsgHdr): ptr TCmsgHdr {. +proc CMSG_NXTHDR*(mhdr: ptr Tmsghdr, cmsg: ptr Tcmsghdr): ptr Tcmsghdr {. importc, header: "<sys/socket.h>".} -proc CMSG_FIRSTHDR*(mhdr: ptr TMsgHdr): ptr TCMsgHdr {. +proc CMSG_FIRSTHDR*(mhdr: ptr Tmsghdr): ptr Tcmsghdr {. importc, header: "<sys/socket.h>".} const @@ -2435,21 +2435,21 @@ const proc `==`*(x, y: TSocketHandle): bool {.borrow.} -proc accept*(a1: TSocketHandle, a2: ptr Tsockaddr, a3: ptr Tsocklen): TSocketHandle {. +proc accept*(a1: TSocketHandle, a2: ptr TSockAddr, a3: ptr TSocklen): TSocketHandle {. importc, header: "<sys/socket.h>".} -proc bindSocket*(a1: TSocketHandle, a2: ptr Tsockaddr, a3: Tsocklen): cint {. +proc bindSocket*(a1: TSocketHandle, a2: ptr TSockAddr, a3: TSocklen): cint {. importc: "bind", header: "<sys/socket.h>".} ## is Posix's ``bind``, because ``bind`` is a reserved word -proc connect*(a1: TSocketHandle, a2: ptr Tsockaddr, a3: Tsocklen): cint {. +proc connect*(a1: TSocketHandle, a2: ptr TSockAddr, a3: TSocklen): cint {. importc, header: "<sys/socket.h>".} -proc getpeername*(a1: TSocketHandle, a2: ptr Tsockaddr, a3: ptr Tsocklen): cint {. +proc getpeername*(a1: TSocketHandle, a2: ptr TSockAddr, a3: ptr TSocklen): cint {. importc, header: "<sys/socket.h>".} -proc getsockname*(a1: TSocketHandle, a2: ptr Tsockaddr, a3: ptr Tsocklen): cint {. +proc getsockname*(a1: TSocketHandle, a2: ptr TSockAddr, a3: ptr TSocklen): cint {. importc, header: "<sys/socket.h>".} -proc getsockopt*(a1: TSocketHandle, a2, a3: cint, a4: pointer, a5: ptr Tsocklen): cint {. +proc getsockopt*(a1: TSocketHandle, a2, a3: cint, a4: pointer, a5: ptr TSocklen): cint {. importc, header: "<sys/socket.h>".} proc listen*(a1: TSocketHandle, a2: cint): cint {. @@ -2457,7 +2457,7 @@ proc listen*(a1: TSocketHandle, a2: cint): cint {. proc recv*(a1: TSocketHandle, a2: pointer, a3: int, a4: cint): int {. importc, header: "<sys/socket.h>".} proc recvfrom*(a1: TSocketHandle, a2: pointer, a3: int, a4: cint, - a5: ptr Tsockaddr, a6: ptr Tsocklen): int {. + a5: ptr TSockAddr, a6: ptr TSocklen): int {. importc, header: "<sys/socket.h>".} proc recvmsg*(a1: TSocketHandle, a2: ptr Tmsghdr, a3: cint): int {. importc, header: "<sys/socket.h>".} @@ -2465,10 +2465,10 @@ proc send*(a1: TSocketHandle, a2: pointer, a3: int, a4: cint): int {. importc, header: "<sys/socket.h>".} proc sendmsg*(a1: TSocketHandle, a2: ptr Tmsghdr, a3: cint): int {. importc, header: "<sys/socket.h>".} -proc sendto*(a1: TSocketHandle, a2: pointer, a3: int, a4: cint, a5: ptr Tsockaddr, - a6: Tsocklen): int {. +proc sendto*(a1: TSocketHandle, a2: pointer, a3: int, a4: cint, a5: ptr TSockAddr, + a6: TSocklen): int {. importc, header: "<sys/socket.h>".} -proc setsockopt*(a1: TSocketHandle, a2, a3: cint, a4: pointer, a5: Tsocklen): cint {. +proc setsockopt*(a1: TSocketHandle, a2, a3: cint, a4: pointer, a5: TSocklen): cint {. importc, header: "<sys/socket.h>".} proc shutdown*(a1: TSocketHandle, a2: cint): cint {. importc, header: "<sys/socket.h>".} @@ -2530,21 +2530,21 @@ proc freeaddrinfo*(a1: ptr Taddrinfo) {.importc, header: "<netdb.h>".} proc gai_strerror*(a1: cint): cstring {.importc, header: "<netdb.h>".} -proc getaddrinfo*(a1, a2: cstring, a3: ptr TAddrInfo, - a4: var ptr TAddrInfo): cint {.importc, header: "<netdb.h>".} +proc getaddrinfo*(a1, a2: cstring, a3: ptr Taddrinfo, + a4: var ptr Taddrinfo): cint {.importc, header: "<netdb.h>".} -proc gethostbyaddr*(a1: pointer, a2: Tsocklen, a3: cint): ptr THostent {. +proc gethostbyaddr*(a1: pointer, a2: TSocklen, a3: cint): ptr Thostent {. importc, header: "<netdb.h>".} -proc gethostbyname*(a1: cstring): ptr THostent {.importc, header: "<netdb.h>".} -proc gethostent*(): ptr THostent {.importc, header: "<netdb.h>".} +proc gethostbyname*(a1: cstring): ptr Thostent {.importc, header: "<netdb.h>".} +proc gethostent*(): ptr Thostent {.importc, header: "<netdb.h>".} -proc getnameinfo*(a1: ptr Tsockaddr, a2: Tsocklen, - a3: cstring, a4: Tsocklen, a5: cstring, - a6: Tsocklen, a7: cint): cint {.importc, header: "<netdb.h>".} +proc getnameinfo*(a1: ptr TSockAddr, a2: TSocklen, + a3: cstring, a4: TSocklen, a5: cstring, + a6: TSocklen, a7: cint): cint {.importc, header: "<netdb.h>".} -proc getnetbyaddr*(a1: int32, a2: cint): ptr TNetent {.importc, header: "<netdb.h>".} -proc getnetbyname*(a1: cstring): ptr TNetent {.importc, header: "<netdb.h>".} -proc getnetent*(): ptr TNetent {.importc, header: "<netdb.h>".} +proc getnetbyaddr*(a1: int32, a2: cint): ptr Tnetent {.importc, header: "<netdb.h>".} +proc getnetbyname*(a1: cstring): ptr Tnetent {.importc, header: "<netdb.h>".} +proc getnetent*(): ptr Tnetent {.importc, header: "<netdb.h>".} proc getprotobyname*(a1: cstring): ptr TProtoent {.importc, header: "<netdb.h>".} proc getprotobynumber*(a1: cint): ptr TProtoent {.importc, header: "<netdb.h>".} @@ -2560,10 +2560,10 @@ proc setnetent*(a1: cint) {.importc, header: "<netdb.h>".} proc setprotoent*(a1: cint) {.importc, header: "<netdb.h>".} proc setservent*(a1: cint) {.importc, header: "<netdb.h>".} -proc poll*(a1: ptr Tpollfd, a2: Tnfds, a3: int): cint {. +proc poll*(a1: ptr TPollfd, a2: Tnfds, a3: int): cint {. importc, header: "<poll.h>".} -proc realpath*(name, resolved: CString): CString {. +proc realpath*(name, resolved: cstring): cstring {. importc: "realpath", header: "<stdlib.h>".} diff --git a/lib/pure/memfiles.nim b/lib/pure/memfiles.nim index d8a27fde39..8c404abe84 100644 --- a/lib/pure/memfiles.nim +++ b/lib/pure/memfiles.nim @@ -122,7 +122,7 @@ proc open*(filename: string, mode: TFileMode = fmRead, template fail(errCode: TOSErrorCode, msg: expr) = rollback() if result.handle != 0: discard close(result.handle) - OSError(errCode) + osError(errCode) var flags = if readonly: O_RDONLY else: O_RDWR @@ -133,22 +133,22 @@ proc open*(filename: string, mode: TFileMode = fmRead, if result.handle == -1: # XXX: errno is supposed to be set here # Is there an exception that wraps it? - fail(OSLastError(), "error opening file") + fail(osLastError(), "error opening file") if newFileSize != -1: if ftruncate(result.handle, newFileSize) == -1: - fail(OSLastError(), "error setting file size") + fail(osLastError(), "error setting file size") if mappedSize != -1: result.size = mappedSize else: - var stat: Tstat + var stat: TStat if fstat(result.handle, stat) != -1: # XXX: Hmm, this could be unsafe # Why is mmap taking int anyway? result.size = int(stat.st_size) else: - fail(OSLastError(), "error getting file size") + fail(osLastError(), "error getting file size") result.mem = mmap( nil, @@ -159,7 +159,7 @@ proc open*(filename: string, mode: TFileMode = fmRead, offset) if result.mem == cast[pointer](MAP_FAILED): - fail(OSLastError(), "file mapping failed") + fail(osLastError(), "file mapping failed") proc close*(f: var TMemFile) = ## closes the memory mapped file `f`. All changes are written back to the @@ -176,7 +176,7 @@ proc close*(f: var TMemFile) = error = (closeHandle(f.fHandle) == 0) or error else: if f.handle != 0: - lastErr = OSLastError() + lastErr = osLastError() error = munmap(f.mem, f.size) != 0 error = (close(f.handle) != 0) or error diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 9b08fea6f1..504343d676 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -157,7 +157,7 @@ else: # UNIX-like operating system CurDir* = '.' ParDir* = ".." DirSep* = '/' - AltSep* = Dirsep + AltSep* = DirSep PathSep* = ':' FileSystemCaseSensitive* = true ExeExt* = "" @@ -448,7 +448,7 @@ proc getCurrentDir*(): string {.rtl, extern: "nos$1", tags: [].} = else: result = newString(bufsize) if getcwd(result, bufsize) != nil: - setlen(result, c_strlen(result)) + setLen(result, c_strlen(result)) else: osError(osLastError()) @@ -687,7 +687,7 @@ proc expandFilename*(filename: string): string {.rtl, extern: "nos$1", result = newString(pathMax) var r = realpath(filename, result) if r.isNil: osError(osLastError()) - setlen(result, c_strlen(result)) + setLen(result, c_strlen(result)) proc changeFileExt*(filename, ext: string): string {. noSideEffect, rtl, extern: "nos$1".} = @@ -939,12 +939,12 @@ proc copyFile*(source, dest: string) {.rtl, extern: "nos$1", if not open(d, dest, fmWrite): close(s) osError(osLastError()) - var buf = alloc(bufsize) + var buf = alloc(bufSize) while true: - var bytesread = readBuffer(s, buf, bufsize) + var bytesread = readBuffer(s, buf, bufSize) if bytesread > 0: var byteswritten = writeBuffer(d, buf, bytesread) - if bytesread != bytesWritten: + if bytesread != byteswritten: dealloc(buf) close(s) close(d) @@ -992,7 +992,7 @@ proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir].} = if deleteFile(f) == 0: osError(osLastError()) else: - if cremove(file) != 0'i32 and errno != ENOENT: + if c_remove(file) != 0'i32 and errno != ENOENT: raise newException(EOS, $strerror(errno)) proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", @@ -1124,7 +1124,7 @@ proc putEnv*(key, val: string) {.tags: [FWriteEnv].} = add environment, (key & '=' & val) indx = high(environment) when defined(unix): - if cputenv(environment[indx]) != 0'i32: + if c_putenv(environment[indx]) != 0'i32: osError(osLastError()) else: when useWinUnicode: @@ -1217,10 +1217,10 @@ iterator walkDir*(dir: string): tuple[kind: TPathComponent, path: string] {. if findNextFile(h, f) == 0'i32: break findClose(h) else: - var d = openDir(dir) + var d = opendir(dir) if d != nil: while true: - var x = readDir(d) + var x = readdir(d) if x == nil: break var y = $x.d_name if y != "." and y != "..": @@ -1231,7 +1231,7 @@ iterator walkDir*(dir: string): tuple[kind: TPathComponent, path: string] {. if S_ISDIR(s.st_mode): k = pcDir if S_ISLNK(s.st_mode): k = succ(k) yield (k, y) - discard closeDir(d) + discard closedir(d) iterator walkDirRec*(dir: string, filter={pcFile, pcDir}): string {. tags: [FReadDir].} = @@ -1524,7 +1524,7 @@ when defined(linux) or defined(solaris) or defined(bsd) or defined(aix): if len > 256: result = newString(len+1) len = readlink(procPath, result, len) - setlen(result, len) + setLen(result, len) when defined(macosx): type diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 76765ff8e9..fe4303d8a7 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -561,13 +561,13 @@ elif not defined(useNimRtl): readIdx = 0 writeIdx = 1 - proc addCmdArgs(command: string, args: openarray[string]): string = + proc addCmdArgs(command: string, args: openArray[string]): string = result = quoteShell(command) for i in 0 .. high(args): add(result, " ") add(result, quoteShell(args[i])) - proc toCStringArray(b, a: openarray[string]): cstringArray = + proc toCStringArray(b, a: openArray[string]): cstringArray = result = cast[cstringArray](alloc0((a.len + b.len + 1) * sizeof(cstring))) for i in 0..high(b): result[i] = cast[cstring](alloc(b[i].len+1)) @@ -576,7 +576,7 @@ elif not defined(useNimRtl): result[i+b.len] = cast[cstring](alloc(a[i].len+1)) copyMem(result[i+b.len], cstring(a[i]), a[i].len+1) - proc ToCStringArray(t: PStringTable): cstringArray = + proc toCStringArray(t: PStringTable): cstringArray = result = cast[cstringArray](alloc0((t.len + 1) * sizeof(cstring))) var i = 0 for key, val in pairs(t): @@ -585,7 +585,7 @@ elif not defined(useNimRtl): copyMem(result[i], addr(x[0]), x.len+1) inc(i) - proc EnvToCStringArray(): cstringArray = + proc envToCStringArray(): cstringArray = var counter = 0 for key, val in envPairs(): inc counter result = cast[cstringArray](alloc0((counter + 1) * sizeof(cstring))) @@ -598,16 +598,16 @@ elif not defined(useNimRtl): proc startProcess(command: string, workingDir: string = "", - args: openarray[string] = [], + args: openArray[string] = [], env: PStringTable = nil, options: set[TProcessOption] = {poStdErrToStdOut}): PProcess = var - p_stdin, p_stdout, p_stderr: array [0..1, cint] + pStdin, pStdout, pStderr: array [0..1, cint] new(result) result.exitCode = -3 # for ``waitForExit`` if poParentStreams notin options: - if pipe(p_stdin) != 0'i32 or pipe(p_stdout) != 0'i32 or - pipe(p_stderr) != 0'i32: + if pipe(pStdin) != 0'i32 or pipe(pStdout) != 0'i32 or + pipe(pStderr) != 0'i32: osError(osLastError()) var pid: TPid @@ -631,17 +631,17 @@ elif not defined(useNimRtl): POSIX_SPAWN_SETPGROUP) if poParentStreams notin options: - chck posix_spawn_file_actions_addclose(fops, p_stdin[writeIdx]) - chck posix_spawn_file_actions_adddup2(fops, p_stdin[readIdx], readIdx) - chck posix_spawn_file_actions_addclose(fops, p_stdout[readIdx]) - chck posix_spawn_file_actions_adddup2(fops, p_stdout[writeIdx], writeIdx) - chck posix_spawn_file_actions_addclose(fops, p_stderr[readIdx]) + chck posix_spawn_file_actions_addclose(fops, pStdin[writeIdx]) + chck posix_spawn_file_actions_adddup2(fops, pStdin[readIdx], readIdx) + chck posix_spawn_file_actions_addclose(fops, pStdout[readIdx]) + chck posix_spawn_file_actions_adddup2(fops, pStdout[writeIdx], writeIdx) + chck posix_spawn_file_actions_addclose(fops, pStderr[readIdx]) if poStdErrToStdOut in options: - chck posix_spawn_file_actions_adddup2(fops, p_stdout[writeIdx], 2) + chck posix_spawn_file_actions_adddup2(fops, pStdout[writeIdx], 2) else: - chck posix_spawn_file_actions_adddup2(fops, p_stderr[writeIdx], 2) + chck posix_spawn_file_actions_adddup2(fops, pStderr[writeIdx], 2) - var e = if env == nil: EnvToCStringArray() else: ToCStringArray(env) + var e = if env == nil: envToCStringArray() else: toCStringArray(env) var a: cstringArray var res: cint if workingDir.len > 0: os.setCurrentDir(workingDir) @@ -709,16 +709,16 @@ elif not defined(useNimRtl): else: result.errHandle = 2 else: - result.inHandle = p_stdin[writeIdx] - result.outHandle = p_stdout[readIdx] + result.inHandle = pStdin[writeIdx] + result.outHandle = pStdout[readIdx] if poStdErrToStdOut in options: result.errHandle = result.outHandle - discard close(p_stderr[readIdx]) + discard close(pStderr[readIdx]) else: - result.errHandle = p_stderr[readIdx] - discard close(p_stderr[writeIdx]) - discard close(p_stdin[readIdx]) - discard close(p_stdout[writeIdx]) + result.errHandle = pStderr[readIdx] + discard close(pStderr[writeIdx]) + discard close(pStdin[readIdx]) + discard close(pStdout[writeIdx]) proc close(p: PProcess) = if p.inStream != nil: close(p.inStream) @@ -735,7 +735,7 @@ elif not defined(useNimRtl): if kill(-p.id, SIGCONT) != 0'i32: osError(osLastError()) proc running(p: PProcess): bool = - var ret = waitPid(p.id, p.exitCode, WNOHANG) + var ret = waitpid(p.id, p.exitCode, WNOHANG) if ret == 0: return true # Can't establish status. Assume running. result = ret == int(p.id) @@ -751,14 +751,14 @@ elif not defined(useNimRtl): # ``running`` probably set ``p.exitCode`` for us. Since ``p.exitCode`` is # initialized with -3, wrong success exit codes are prevented. if p.exitCode != -3: return p.exitCode - if waitPid(p.id, p.exitCode, 0) < 0: + if waitpid(p.id, p.exitCode, 0) < 0: p.exitCode = -3 osError(osLastError()) result = int(p.exitCode) shr 8 proc peekExitCode(p: PProcess): int = if p.exitCode != -3: return p.exitCode - var ret = waitPid(p.id, p.exitCode, WNOHANG) + var ret = waitpid(p.id, p.exitCode, WNOHANG) var b = ret == int(p.id) if b: result = -1 if p.exitCode == -3: result = -1 @@ -808,7 +808,7 @@ elif not defined(useNimRtl): setLen(s, L) proc select(readfds: var seq[PProcess], timeout = 500): int = - var tv: TTimeVal + var tv: Ttimeval tv.tv_sec = 0 tv.tv_usec = timeout * 1000 diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index 61df82640b..de445dd368 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -230,7 +230,7 @@ proc socket*(domain: TDomain = AF_INET, typ: TType = SOCK_STREAM, when defined(Windows): result = newTSocket(winlean.socket(ord(domain), ord(typ), ord(protocol)), buffered) else: - result = newTSocket(posix.socket(ToInt(domain), ToInt(typ), ToInt(protocol)), buffered) + result = newTSocket(posix.socket(toInt(domain), toInt(typ), toInt(protocol)), buffered) when defined(ssl): CRYPTO_malloc_init() @@ -371,7 +371,7 @@ proc socketError*(socket: TSocket, err: int = -1, async = false) = else: if lastError.int32 == EAGAIN or lastError.int32 == EWOULDBLOCK: return - else: OSError(lastError) + else: osError(lastError) else: osError(lastError) proc listen*(socket: TSocket, backlog = SOMAXCONN) {.tags: [FReadIO].} = @@ -436,16 +436,16 @@ proc bindAddr*(socket: TSocket, port = TPort(0), address = "") {. name.sin_port = sockets.htons(int16(port)) name.sin_addr.s_addr = sockets.htonl(INADDR_ANY) if bindSocket(socket.fd, cast[ptr TSockAddr](addr(name)), - sizeof(name).TSockLen) < 0'i32: + sizeof(name).TSocklen) < 0'i32: osError(osLastError()) else: - var hints: TAddrInfo - var aiList: ptr TAddrInfo = nil + var hints: Taddrinfo + var aiList: ptr Taddrinfo = nil hints.ai_family = toInt(AF_INET) hints.ai_socktype = toInt(SOCK_STREAM) hints.ai_protocol = toInt(IPPROTO_TCP) gaiNim(address, port, hints, aiList) - if bindSocket(socket.fd, aiList.ai_addr, aiList.ai_addrlen.TSockLen) < 0'i32: + if bindSocket(socket.fd, aiList.ai_addr, aiList.ai_addrlen.TSocklen) < 0'i32: osError(osLastError()) proc getSockName*(socket: TSocket): TPort = @@ -457,7 +457,7 @@ proc getSockName*(socket: TSocket): TPort = name.sin_family = posix.AF_INET #name.sin_port = htons(cint16(port)) #name.sin_addr.s_addr = htonl(INADDR_ANY) - var namelen = sizeof(name).TSockLen + var namelen = sizeof(name).TSocklen if getsockname(socket.fd, cast[ptr TSockAddr](addr(name)), addr(namelen)) == -1'i32: osError(osLastError()) @@ -467,7 +467,7 @@ template acceptAddrPlain(noClientRet, successRet: expr, sslImplementation: stmt): stmt {.immediate.} = assert(client != nil) var sockAddress: Tsockaddr_in - var addrLen = sizeof(sockAddress).TSockLen + var addrLen = sizeof(sockAddress).TSocklen var sock = accept(server.fd, cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen)) @@ -679,10 +679,10 @@ proc getHostByAddr*(ip: string): Thostent {.tags: [FReadIO].} = cint(sockets.AF_INET)) if s == nil: osError(osLastError()) else: - var s = posix.gethostbyaddr(addr(myaddr), sizeof(myaddr).TSockLen, + var s = posix.gethostbyaddr(addr(myaddr), sizeof(myaddr).TSocklen, cint(posix.AF_INET)) if s == nil: - raise newException(EOS, $hStrError(h_errno)) + raise newException(EOS, $hstrerror(h_errno)) result.name = $s.h_name result.aliases = cstringArrayToSeq(s.h_aliases) @@ -690,9 +690,9 @@ proc getHostByAddr*(ip: string): Thostent {.tags: [FReadIO].} = result.addrtype = TDomain(s.h_addrtype) else: if s.h_addrtype == posix.AF_INET: - result.addrType = AF_INET + result.addrtype = AF_INET elif s.h_addrtype == posix.AF_INET6: - result.addrType = AF_INET6 + result.addrtype = AF_INET6 else: raise newException(EOS, "unknown h_addrtype") result.addrList = cstringArrayToSeq(s.h_addr_list) @@ -711,9 +711,9 @@ proc getHostByName*(name: string): Thostent {.tags: [FReadIO].} = result.addrtype = TDomain(s.h_addrtype) else: if s.h_addrtype == posix.AF_INET: - result.addrType = AF_INET + result.addrtype = AF_INET elif s.h_addrtype == posix.AF_INET6: - result.addrType = AF_INET6 + result.addrtype = AF_INET6 else: raise newException(EOS, "unknown h_addrtype") result.addrList = cstringArrayToSeq(s.h_addr_list) @@ -723,7 +723,7 @@ proc getSockOptInt*(socket: TSocket, level, optname: int): int {. tags: [FReadIO].} = ## getsockopt for integer options. var res: cint - var size = sizeof(res).TSockLen + var size = sizeof(res).TSocklen if getsockopt(socket.fd, cint(level), cint(optname), addr(res), addr(size)) < 0'i32: osError(osLastError()) @@ -734,7 +734,7 @@ proc setSockOptInt*(socket: TSocket, level, optname, optval: int) {. ## setsockopt for integer options. var value = cint(optval) if setsockopt(socket.fd, cint(level), cint(optname), addr(value), - sizeof(value).TSockLen) < 0'i32: + sizeof(value).TSocklen) < 0'i32: osError(osLastError()) proc toCInt(opt: TSOBool): cint = @@ -751,7 +751,7 @@ proc getSockOpt*(socket: TSocket, opt: TSOBool, level = SOL_SOCKET): bool {. tags: [FReadIO].} = ## Retrieves option ``opt`` as a boolean value. var res: cint - var size = sizeof(res).TSockLen + var size = sizeof(res).TSocklen if getsockopt(socket.fd, cint(level), toCInt(opt), addr(res), addr(size)) < 0'i32: osError(osLastError()) @@ -762,7 +762,7 @@ proc setSockOpt*(socket: TSocket, opt: TSOBool, value: bool, level = SOL_SOCKET) ## Sets option ``opt`` to a boolean value specified by ``value``. var valuei = cint(if value: 1 else: 0) if setsockopt(socket.fd, cint(level), toCInt(opt), addr(valuei), - sizeof(valuei).TSockLen) < 0'i32: + sizeof(valuei).TSocklen) < 0'i32: osError(osLastError()) proc connect*(socket: TSocket, address: string, port = TPort(0), @@ -773,8 +773,8 @@ proc connect*(socket: TSocket, address: string, port = TPort(0), ## not do it. ## ## If ``socket`` is an SSL socket a handshake will be automatically performed. - var hints: TAddrInfo - var aiList: ptr TAddrInfo = nil + var hints: Taddrinfo + var aiList: ptr Taddrinfo = nil hints.ai_family = toInt(af) hints.ai_socktype = toInt(SOCK_STREAM) hints.ai_protocol = toInt(IPPROTO_TCP) @@ -784,7 +784,7 @@ proc connect*(socket: TSocket, address: string, port = TPort(0), var lastError: TOSErrorCode var it = aiList while it != nil: - if connect(socket.fd, it.ai_addr, it.ai_addrlen.TSockLen) == 0'i32: + if connect(socket.fd, it.ai_addr, it.ai_addrlen.TSocklen) == 0'i32: success = true break else: lastError = osLastError() @@ -836,8 +836,8 @@ proc connectAsync*(socket: TSocket, name: string, port = TPort(0), ## ## **Note**: For SSL sockets, the ``handshake`` procedure must be called ## whenever the socket successfully connects to a server. - var hints: TAddrInfo - var aiList: ptr TAddrInfo = nil + var hints: Taddrinfo + var aiList: ptr Taddrinfo = nil hints.ai_family = toInt(af) hints.ai_socktype = toInt(SOCK_STREAM) hints.ai_protocol = toInt(IPPROTO_TCP) @@ -847,7 +847,7 @@ proc connectAsync*(socket: TSocket, name: string, port = TPort(0), var lastError: TOSErrorCode var it = aiList while it != nil: - var ret = connect(socket.fd, it.ai_addr, it.ai_addrlen.TSockLen) + var ret = connect(socket.fd, it.ai_addr, it.ai_addrlen.TSocklen) if ret == 0'i32: success = true break @@ -912,7 +912,7 @@ when defined(ssl): else: SSLError("Socket is not an SSL socket.") -proc timeValFromMilliseconds(timeout = 500): TTimeval = +proc timeValFromMilliseconds(timeout = 500): Ttimeval = if timeout != -1: var seconds = timeout div 1000 result.tv_sec = seconds.int32 @@ -970,7 +970,7 @@ proc select*(readfds, writefds, exceptfds: var seq[TSocket], if buffersFilled > 0: return buffersFilled - var tv {.noInit.}: TTimeval = timeValFromMilliseconds(timeout) + var tv {.noInit.}: Ttimeval = timeValFromMilliseconds(timeout) var rd, wr, ex: TFdSet var m = 0 @@ -993,7 +993,7 @@ proc select*(readfds, writefds: var seq[TSocket], let buffersFilled = checkBuffer(readfds) if buffersFilled > 0: return buffersFilled - var tv {.noInit.}: TTimeval = timeValFromMilliseconds(timeout) + var tv {.noInit.}: Ttimeval = timeValFromMilliseconds(timeout) var rd, wr: TFdSet var m = 0 @@ -1017,7 +1017,7 @@ proc selectWrite*(writefds: var seq[TSocket], ## ## ``timeout`` is specified in miliseconds and ``-1`` can be specified for ## an unlimited time. - var tv {.noInit.}: TTimeval = timeValFromMilliseconds(timeout) + var tv {.noInit.}: Ttimeval = timeValFromMilliseconds(timeout) var wr: TFdSet var m = 0 @@ -1035,7 +1035,7 @@ proc select*(readfds: var seq[TSocket], timeout = 500): int = let buffersFilled = checkBuffer(readfds) if buffersFilled > 0: return buffersFilled - var tv {.noInit.}: TTimeval = timeValFromMilliseconds(timeout) + var tv {.noInit.}: Ttimeval = timeValFromMilliseconds(timeout) var rd: TFdSet var m = 0 @@ -1461,8 +1461,8 @@ proc recvAsync*(socket: TSocket, s: var TaintedString): bool {. else: osError(err) else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: - return False - else: OSError(err) + return false + else: osError(err) setLen(s.string, pos + bytesRead) if bytesRead != bufSize-1: break @@ -1488,7 +1488,7 @@ proc recvFrom*(socket: TSocket, data: var string, length: int, # TODO: Buffered sockets data.setLen(length) var sockAddress: Tsockaddr_in - var addrLen = sizeof(sockAddress).TSockLen + var addrLen = sizeof(sockAddress).TSocklen result = recvfrom(socket.fd, cstring(data), length.cint, flags.cint, cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen)) @@ -1514,8 +1514,8 @@ proc recvFromAsync*(socket: TSocket, data: var string, length: int, else: osError(err) else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: - return False - else: OSError(err) + return false + else: osError(err) proc skip*(socket: TSocket) {.tags: [FReadIO], deprecated.} = ## skips all the data that is pending for the socket @@ -1606,7 +1606,7 @@ proc sendAsync*(socket: TSocket, data: string): int {.tags: [FWriteIO].} = else: if err.int32 == EAGAIN or err.int32 == EWOULDBLOCK: return 0 - else: OSError(err) + else: osError(err) proc trySend*(socket: TSocket, data: string): bool {.tags: [FWriteIO].} = @@ -1622,8 +1622,8 @@ proc sendTo*(socket: TSocket, address: string, port: TPort, data: pointer, ## this function will try each IP of that hostname. ## ## **Note:** This proc is not available for SSL sockets. - var hints: TAddrInfo - var aiList: ptr TAddrInfo = nil + var hints: Taddrinfo + var aiList: ptr Taddrinfo = nil hints.ai_family = toInt(af) hints.ai_socktype = toInt(SOCK_STREAM) hints.ai_protocol = toInt(IPPROTO_TCP) @@ -1634,7 +1634,7 @@ proc sendTo*(socket: TSocket, address: string, port: TPort, data: pointer, var it = aiList while it != nil: result = sendto(socket.fd, data, size.cint, flags.cint, it.ai_addr, - it.ai_addrlen.TSockLen) + it.ai_addrlen.TSocklen) if result != -1'i32: success = true break @@ -1666,11 +1666,11 @@ proc setBlocking(s: TSocket, blocking: bool) = else: # BSD sockets var x: int = fcntl(s.fd, F_GETFL, 0) if x == -1: - OSError(OSLastError()) + osError(osLastError()) else: var mode = if blocking: x and not O_NONBLOCK else: x or O_NONBLOCK if fcntl(s.fd, F_SETFL, mode) == -1: - OSError(OSLastError()) + osError(osLastError()) s.nonblocking = not blocking discard """ proc setReuseAddr*(s: TSocket) = diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim index 65f8cbb092..9ef1a99ca6 100644 --- a/lib/system/dyncalls.nim +++ b/lib/system/dyncalls.nim @@ -56,7 +56,7 @@ when defined(posix): RTLD_NOW {.importc: "RTLD_NOW", header: "<dlfcn.h>".}: int proc dlclose(lib: TLibHandle) {.importc, header: "<dlfcn.h>".} - proc dlopen(path: CString, mode: int): TLibHandle {. + proc dlopen(path: cstring, mode: int): TLibHandle {. importc, header: "<dlfcn.h>".} proc dlsym(lib: TLibHandle, name: cstring): TProcAddr {. importc, header: "<dlfcn.h>".} @@ -72,7 +72,7 @@ when defined(posix): proc nimGetProcAddr(lib: TLibHandle, name: cstring): TProcAddr = result = dlsym(lib, name) - if result == nil: ProcAddrError(name) + if result == nil: procAddrError(name) elif defined(windows) or defined(dos): # From 4ed8cec7ca03e3dbcfcbd5db171ee79b6e279525 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 29 Dec 2013 03:42:20 +0100 Subject: [PATCH 172/326] case consistency: niminst --- lib/impure/zipfiles.nim | 4 +- lib/pure/parsecfg.nim | 20 +++---- lib/wrappers/zip/libzip.nim | 108 ++++++++++++++++++------------------ tools/niminst/niminst.nim | 18 +++--- 4 files changed, 75 insertions(+), 75 deletions(-) diff --git a/lib/impure/zipfiles.nim b/lib/impure/zipfiles.nim index de73b500de..1726449d8a 100644 --- a/lib/impure/zipfiles.nim +++ b/lib/impure/zipfiles.nim @@ -71,7 +71,7 @@ proc addFile*(z: var TZipArchive, file: string) = addFile(z, file, file) proc mySourceCallback(state, data: pointer, len: int, - cmd: Tzip_source_cmd): int {.cdecl.} = + cmd: TZipSourceCmd): int {.cdecl.} = var src = cast[PStream](state) case cmd of ZIP_SOURCE_OPEN: @@ -108,7 +108,7 @@ proc addFile*(z: var TZipArchive, dest: string, src: PStream) = type TZipFileStream = object of TStream - f: Pzip_file + f: PZipFile PZipFileStream* = ref TZipFileStream ## a reader stream of a file within a zip archive diff --git a/lib/pure/parsecfg.nim b/lib/pure/parsecfg.nim index b8f4bcae1c..f3249b1073 100644 --- a/lib/pure/parsecfg.nim +++ b/lib/pure/parsecfg.nim @@ -82,7 +82,7 @@ proc open*(c: var TCfgParser, input: PStream, filename: string, c.filename = filename c.tok.kind = tkInvalid c.tok.literal = "" - inc(c.linenumber, lineOffset) + inc(c.lineNumber, lineOffset) rawGetTok(c, c.tok) proc close*(c: var TCfgParser) {.rtl, extern: "npc$1".} = @@ -91,11 +91,11 @@ proc close*(c: var TCfgParser) {.rtl, extern: "npc$1".} = proc getColumn*(c: TCfgParser): int {.rtl, extern: "npc$1".} = ## get the current column the parser has arrived at. - result = getColNumber(c, c.bufPos) + result = getColNumber(c, c.bufpos) proc getLine*(c: TCfgParser): int {.rtl, extern: "npc$1".} = ## get the current line the parser has arrived at. - result = c.linenumber + result = c.lineNumber proc getFilename*(c: TCfgParser): string {.rtl, extern: "npc$1".} = ## get the filename of the file that the parser processes. @@ -176,7 +176,7 @@ proc handleCRLF(c: var TCfgParser, pos: int): int = else: result = pos proc getString(c: var TCfgParser, tok: var TToken, rawMode: bool) = - var pos = c.bufPos + 1 # skip " + var pos = c.bufpos + 1 # skip " var buf = c.buf # put `buf` in a register tok.kind = tkSymbol if (buf[pos] == '"') and (buf[pos + 1] == '"'): @@ -213,9 +213,9 @@ proc getString(c: var TCfgParser, tok: var TToken, rawMode: bool) = tok.kind = tkInvalid break if (ch == '\\') and not rawMode: - c.bufPos = pos + c.bufpos = pos getEscapedChar(c, tok) - pos = c.bufPos + pos = c.bufpos else: add(tok.literal, ch) inc(pos) @@ -257,8 +257,8 @@ proc rawGetTok(c: var TCfgParser, tok: var TToken) = inc(c.bufpos) tok.literal = "=" of '-': - inc(c.bufPos) - if c.buf[c.bufPos] == '-': inc(c.bufPos) + inc(c.bufpos) + if c.buf[c.bufpos] == '-': inc(c.bufpos) tok.kind = tkDashDash tok.literal = "--" of ':': @@ -266,8 +266,8 @@ proc rawGetTok(c: var TCfgParser, tok: var TToken) = inc(c.bufpos) tok.literal = ":" of 'r', 'R': - if c.buf[c.bufPos + 1] == '\"': - inc(c.bufPos) + if c.buf[c.bufpos + 1] == '\"': + inc(c.bufpos) getString(c, tok, true) else: getSymbol(c, tok) diff --git a/lib/wrappers/zip/libzip.nim b/lib/wrappers/zip/libzip.nim index c3d1784a5c..0b8d2b3ecd 100644 --- a/lib/wrappers/zip/libzip.nim +++ b/lib/wrappers/zip/libzip.nim @@ -59,28 +59,28 @@ else: {.pragma: mydll.} type - Tzip_source_cmd* = int32 + TZipSourceCmd* = int32 - Tzip_source_callback* = proc (state: pointer, data: pointer, length: int, - cmd: Tzip_source_cmd): int {.cdecl.} - Pzip_stat* = ptr Tzip_stat - Tzip_stat* = object ## the 'zip_stat' struct + TZipSourceCallback* = proc (state: pointer, data: pointer, length: int, + cmd: TZipSourceCmd): int {.cdecl.} + PZipStat* = ptr TZipStat + TZipStat* = object ## the 'zip_stat' struct name*: cstring ## name of the file index*: int32 ## index within archive crc*: int32 ## crc of file data mtime*: TTime ## modification time size*: int ## size of file (uncompressed) - comp_size*: int ## size of file (compressed) - comp_method*: int16 ## compression method used - encryption_method*: int16 ## encryption method used + compSize*: int ## size of file (compressed) + compMethod*: int16 ## compression method used + encryptionMethod*: int16 ## encryption method used - Tzip = object - Tzip_source = object - Tzip_file = object + TZip = object + TZipSource = object + TZipFile = object - Pzip* = ptr Tzip ## represents a zip archive - Pzip_file* = ptr Tzip_file ## represents a file within an archive - Pzip_source* = ptr Tzip_source ## represents a source for an archive + PZip* = ptr TZip ## represents a zip archive + PZipFile* = ptr TZipFile ## represents a file within an archive + PZipSource* = ptr TZipSource ## represents a source for an archive # flags for zip_name_locate, zip_fopen, zip_stat, ... @@ -166,84 +166,84 @@ const ZIP_SOURCE_ERROR* = 4'i32 ## get error information constZIP_SOURCE_FREE* = 5'i32 ## cleanup and free resources -proc zip_add*(para1: Pzip, para2: cstring, para3: Pzip_source): int32 {.cdecl, +proc zip_add*(para1: PZip, para2: cstring, para3: PZipSource): int32 {.cdecl, importc: "zip_add", mydll.} -proc zip_add_dir*(para1: Pzip, para2: cstring): int32 {.cdecl, +proc zip_add_dir*(para1: PZip, para2: cstring): int32 {.cdecl, importc: "zip_add_dir", mydll.} -proc zip_close*(para1: Pzip) {.cdecl, importc: "zip_close", mydll.} -proc zip_delete*(para1: Pzip, para2: int32): int32 {.cdecl, mydll, +proc zip_close*(para1: PZip) {.cdecl, importc: "zip_close", mydll.} +proc zip_delete*(para1: PZip, para2: int32): int32 {.cdecl, mydll, importc: "zip_delete".} -proc zip_error_clear*(para1: Pzip) {.cdecl, importc: "zip_error_clear", mydll.} -proc zip_error_get*(para1: Pzip, para2: ptr int32, para3: ptr int32) {.cdecl, +proc zip_error_clear*(para1: PZip) {.cdecl, importc: "zip_error_clear", mydll.} +proc zip_error_get*(para1: PZip, para2: ptr int32, para3: ptr int32) {.cdecl, importc: "zip_error_get", mydll.} proc zip_error_get_sys_type*(para1: int32): int32 {.cdecl, mydll, importc: "zip_error_get_sys_type".} proc zip_error_to_str*(para1: cstring, para2: int, para3: int32, para4: int32): int32 {.cdecl, mydll, importc: "zip_error_to_str".} -proc zip_fclose*(para1: Pzip_file) {.cdecl, mydll, +proc zip_fclose*(para1: PZipFile) {.cdecl, mydll, importc: "zip_fclose".} -proc zip_file_error_clear*(para1: Pzip_file) {.cdecl, mydll, +proc zip_file_error_clear*(para1: PZipFile) {.cdecl, mydll, importc: "zip_file_error_clear".} -proc zip_file_error_get*(para1: Pzip_file, para2: ptr int32, para3: ptr int32) {. +proc zip_file_error_get*(para1: PZipFile, para2: ptr int32, para3: ptr int32) {. cdecl, mydll, importc: "zip_file_error_get".} -proc zip_file_strerror*(para1: Pzip_file): cstring {.cdecl, mydll, +proc zip_file_strerror*(para1: PZipFile): cstring {.cdecl, mydll, importc: "zip_file_strerror".} -proc zip_fopen*(para1: Pzip, para2: cstring, para3: int32): Pzip_file {.cdecl, +proc zip_fopen*(para1: PZip, para2: cstring, para3: int32): PZipFile {.cdecl, mydll, importc: "zip_fopen".} -proc zip_fopen_index*(para1: Pzip, para2: int32, para3: int32): Pzip_file {. +proc zip_fopen_index*(para1: PZip, para2: int32, para3: int32): PZipFile {. cdecl, mydll, importc: "zip_fopen_index".} -proc zip_fread*(para1: Pzip_file, para2: pointer, para3: int): int {. +proc zip_fread*(para1: PZipFile, para2: pointer, para3: int): int {. cdecl, mydll, importc: "zip_fread".} -proc zip_get_archive_comment*(para1: Pzip, para2: ptr int32, para3: int32): cstring {. +proc zip_get_archive_comment*(para1: PZip, para2: ptr int32, para3: int32): cstring {. cdecl, mydll, importc: "zip_get_archive_comment".} -proc zip_get_archive_flag*(para1: Pzip, para2: int32, para3: int32): int32 {. +proc zip_get_archive_flag*(para1: PZip, para2: int32, para3: int32): int32 {. cdecl, mydll, importc: "zip_get_archive_flag".} -proc zip_get_file_comment*(para1: Pzip, para2: int32, para3: ptr int32, +proc zip_get_file_comment*(para1: PZip, para2: int32, para3: ptr int32, para4: int32): cstring {.cdecl, mydll, importc: "zip_get_file_comment".} -proc zip_get_name*(para1: Pzip, para2: int32, para3: int32): cstring {.cdecl, +proc zip_get_name*(para1: PZip, para2: int32, para3: int32): cstring {.cdecl, mydll, importc: "zip_get_name".} -proc zip_get_num_files*(para1: Pzip): int32 {.cdecl, +proc zip_get_num_files*(para1: PZip): int32 {.cdecl, mydll, importc: "zip_get_num_files".} -proc zip_name_locate*(para1: Pzip, para2: cstring, para3: int32): int32 {.cdecl, +proc zip_name_locate*(para1: PZip, para2: cstring, para3: int32): int32 {.cdecl, mydll, importc: "zip_name_locate".} -proc zip_open*(para1: cstring, para2: int32, para3: ptr int32): Pzip {.cdecl, +proc zip_open*(para1: cstring, para2: int32, para3: ptr int32): PZip {.cdecl, mydll, importc: "zip_open".} -proc zip_rename*(para1: Pzip, para2: int32, para3: cstring): int32 {.cdecl, +proc zip_rename*(para1: PZip, para2: int32, para3: cstring): int32 {.cdecl, mydll, importc: "zip_rename".} -proc zip_replace*(para1: Pzip, para2: int32, para3: Pzip_source): int32 {.cdecl, +proc zip_replace*(para1: PZip, para2: int32, para3: PZipSource): int32 {.cdecl, mydll, importc: "zip_replace".} -proc zip_set_archive_comment*(para1: Pzip, para2: cstring, para3: int32): int32 {. +proc zip_set_archive_comment*(para1: PZip, para2: cstring, para3: int32): int32 {. cdecl, mydll, importc: "zip_set_archive_comment".} -proc zip_set_archive_flag*(para1: Pzip, para2: int32, para3: int32): int32 {. +proc zip_set_archive_flag*(para1: PZip, para2: int32, para3: int32): int32 {. cdecl, mydll, importc: "zip_set_archive_flag".} -proc zip_set_file_comment*(para1: Pzip, para2: int32, para3: cstring, +proc zip_set_file_comment*(para1: PZip, para2: int32, para3: cstring, para4: int32): int32 {.cdecl, mydll, importc: "zip_set_file_comment".} -proc zip_source_buffer*(para1: Pzip, para2: pointer, para3: int, para4: int32): Pzip_source {. +proc zip_source_buffer*(para1: PZip, para2: pointer, para3: int, para4: int32): PZipSource {. cdecl, mydll, importc: "zip_source_buffer".} -proc zip_source_file*(para1: Pzip, para2: cstring, para3: int, para4: int): Pzip_source {. +proc zip_source_file*(para1: PZip, para2: cstring, para3: int, para4: int): PZipSource {. cdecl, mydll, importc: "zip_source_file".} -proc zip_source_filep*(para1: Pzip, para2: TFile, para3: int, para4: int): Pzip_source {. +proc zip_source_filep*(para1: PZip, para2: TFile, para3: int, para4: int): PZipSource {. cdecl, mydll, importc: "zip_source_filep".} -proc zip_source_free*(para1: Pzip_source) {.cdecl, mydll, +proc zip_source_free*(para1: PZipSource) {.cdecl, mydll, importc: "zip_source_free".} -proc zip_source_function*(para1: Pzip, para2: Tzip_source_callback, - para3: pointer): Pzip_source {.cdecl, mydll, +proc zip_source_function*(para1: PZip, para2: TZipSourceCallback, + para3: pointer): PZipSource {.cdecl, mydll, importc: "zip_source_function".} -proc zip_source_zip*(para1: Pzip, para2: Pzip, para3: int32, para4: int32, - para5: int, para6: int): Pzip_source {.cdecl, mydll, +proc zip_source_zip*(para1: PZip, para2: PZip, para3: int32, para4: int32, + para5: int, para6: int): PZipSource {.cdecl, mydll, importc: "zip_source_zip".} -proc zip_stat*(para1: Pzip, para2: cstring, para3: int32, para4: Pzip_stat): int32 {. +proc zip_stat*(para1: PZip, para2: cstring, para3: int32, para4: PZipStat): int32 {. cdecl, mydll, importc: "zip_stat".} -proc zip_stat_index*(para1: Pzip, para2: int32, para3: int32, para4: Pzip_stat): int32 {. +proc zip_stat_index*(para1: PZip, para2: int32, para3: int32, para4: PZipStat): int32 {. cdecl, mydll, importc: "zip_stat_index".} -proc zip_stat_init*(para1: Pzip_stat) {.cdecl, mydll, importc: "zip_stat_init".} -proc zip_strerror*(para1: Pzip): cstring {.cdecl, mydll, importc: "zip_strerror".} -proc zip_unchange*(para1: Pzip, para2: int32): int32 {.cdecl, mydll, +proc zip_stat_init*(para1: PZipStat) {.cdecl, mydll, importc: "zip_stat_init".} +proc zip_strerror*(para1: PZip): cstring {.cdecl, mydll, importc: "zip_strerror".} +proc zip_unchange*(para1: PZip, para2: int32): int32 {.cdecl, mydll, importc: "zip_unchange".} -proc zip_unchange_all*(para1: Pzip): int32 {.cdecl, mydll, +proc zip_unchange_all*(para1: PZip): int32 {.cdecl, mydll, importc: "zip_unchange_all".} -proc zip_unchange_archive*(para1: Pzip): int32 {.cdecl, mydll, +proc zip_unchange_archive*(para1: PZip): int32 {.cdecl, mydll, importc: "zip_unchange_archive".} diff --git a/tools/niminst/niminst.nim b/tools/niminst/niminst.nim index efedcf19d9..da0815aa25 100644 --- a/tools/niminst/niminst.nim +++ b/tools/niminst/niminst.nim @@ -111,7 +111,7 @@ proc skipRoot(f: string): string = # "abc/def/xyz" --> "def/xyz" var i = 0 result = "" - for component in split(f, {dirsep, altsep}): + for component in split(f, {DirSep, AltSep}): if i > 0: result = result / component inc i if result.len == 0: result = f @@ -126,7 +126,7 @@ include "deinstall.tmpl" const Version = "0.9" - Usage = "niminst - Nimrod Installation Generator Version " & version & """ + Usage = "niminst - Nimrod Installation Generator Version " & Version & """ (c) 2013 Andreas Rumpf Usage: @@ -168,7 +168,7 @@ proc parseCmdLine(c: var TConfigData) = c.infile = addFileExt(key.string, "ini") c.nimrodArgs = cmdLineRest(p).string break - of cmdLongOption, cmdShortOption: + of cmdLongoption, cmdShortOption: case normalize(key.string) of "help", "h": stdout.write(Usage) @@ -312,7 +312,7 @@ proc parseIniFile(c: var TConfigData) = of "uninstallscript": c.uninstallScript = yesno(p, v) else: quit(errorStr(p, "unknown variable: " & k.key)) of "unixbin": filesOnly(p, k.key, v, c.cat[fcUnixBin]) - of "innosetup": pathFlags(p, k.key, v, c.innoSetup) + of "innosetup": pathFlags(p, k.key, v, c.innosetup) of "ccompiler": pathFlags(p, k.key, v, c.ccompiler) of "linker": pathFlags(p, k.key, v, c.linker) of "deb": @@ -483,11 +483,11 @@ proc setupDist(c: var TConfigData) = var n = "build" / "install_$#_$#.iss" % [toLower(c.name), c.version] writeFile(n, scrpt, "\13\10") when defined(windows): - if c.innoSetup.path.len == 0: - c.innoSetup.path = "iscc.exe" + if c.innosetup.path.len == 0: + c.innosetup.path = "iscc.exe" var outcmd = if c.outdir.len == 0: "build" else: c.outdir - var cmd = "$# $# /O$# $#" % [quoteShell(c.innoSetup.path), - c.innoSetup.flags, outcmd, n] + var cmd = "$# $# /O$# $#" % [quoteShell(c.innosetup.path), + c.innosetup.flags, outcmd, n] echo(cmd) if execShellCmd(cmd) == 0: removeFile(n) @@ -582,7 +582,7 @@ if actionScripts in c.actions: writeInstallScripts(c) if actionZip in c.actions: when haveZipLib: - zipdist(c) + zipDist(c) else: quit("libzip is not installed") if actionDeb in c.actions: From 437cfa73abd8fdf878cc2af2c44acbc4b6ec3a56 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 29 Dec 2013 03:45:10 +0100 Subject: [PATCH 173/326] todo.txt updated --- todo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo.txt b/todo.txt index 59d18429ab..4a2ab4c708 100644 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,7 @@ version 0.9.4 ============= -- convert all with "nimrod pretty": macosx and linux versions +- Aporia doesn't compile under devel - document new templating symbol binding rules - make '--implicitStatic:on' the default - test&finish first class iterators: From 72291875bf895e8e0d22ab3f375752417b07ed25 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sun, 29 Dec 2013 16:08:33 +0200 Subject: [PATCH 174/326] integrate the logic of fixupProcType into ReplaceTypeVars --- compiler/ast.nim | 20 ++++++++--- compiler/semdata.nim | 14 ++++---- compiler/seminst.nim | 3 +- compiler/semtypes.nim | 19 +++++++---- compiler/semtypinst.nim | 42 ++++++++++++++--------- compiler/sigmatch.nim | 15 ++++++--- compiler/types.nim | 5 +-- tests/compile/tbindtypedesc.nim | 60 ++++++++++++++++----------------- tests/reject/tenummix.nim | 2 +- tests/run/tfailedassert.nim | 2 +- 10 files changed, 108 insertions(+), 74 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 45784bbcbf..92f3ce8d37 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -351,9 +351,12 @@ const tyPureObject* = tyTuple GcTypeKinds* = {tyRef, tySequence, tyString} tyError* = tyProxy # as an errornous node should match everything + tyTypeClasses* = {tyTypeClass, tyBuiltInTypeClass, tyCompositeTypeClass, tyParametricTypeClass, tyAnd, tyOr, tyNot, tyAnything} + tyMetaTypes* = {tyGenericParam, tyTypeDesc, tyStatic, tyExpr} + tyTypeClasses + type TTypeKinds* = set[TTypeKind] @@ -397,7 +400,8 @@ type tfNeedsInit, # type constains a "not nil" constraint somewhere or some # other type so that it requires inititalization tfHasShared, # type constains a "shared" constraint modifier somewhere - tfHasMeta, # type has "typedesc" or "expr" somewhere; or uses '|' + tfHasMeta, # type contains "wildcard" sub-types such as generic params + # or other type classes tfHasGCedMem, # type contains GC'ed memory tfGenericTypeParam tfHasStatic @@ -777,9 +781,11 @@ const GenericTypes*: TTypeKinds = {tyGenericInvokation, tyGenericBody, tyGenericParam} + StructuralEquivTypes*: TTypeKinds = {tyArrayConstr, tyNil, tyTuple, tyArray, tySet, tyRange, tyPtr, tyRef, tyVar, tySequence, tyProc, tyOpenArray, tyVarargs} + ConcreteTypes*: TTypeKinds = { # types of the expr that may occur in:: # var x = expr tyBool, tyChar, tyEnum, tyArray, tyObject, @@ -1222,7 +1228,7 @@ proc newSons(father: PNode, length: int) = proc propagateToOwner*(owner, elem: PType) = const HaveTheirOwnEmpty = {tySequence, tySet} owner.flags = owner.flags + (elem.flags * {tfHasShared, tfHasMeta, - tfHasGCedMem}) + tfHasStatic, tfHasGCedMem}) if tfNotNil in elem.flags: if owner.kind in {tyGenericInst, tyGenericBody, tyGenericInvokation}: owner.flags.incl tfNotNil @@ -1235,10 +1241,14 @@ proc propagateToOwner*(owner, elem: PType) = if tfShared in elem.flags: owner.flags.incl tfHasShared - - if elem.kind in {tyExpr, tyStatic, tyTypeDesc}: + + if elem.kind in tyMetaTypes: owner.flags.incl tfHasMeta - elif elem.kind in {tyString, tyRef, tySequence} or + + if elem.kind == tyStatic: + owner.flags.incl tfHasStatic + + if elem.kind in {tyString, tyRef, tySequence} or elem.kind == tyProc and elem.callConv == ccClosure: owner.flags.incl tfHasGCedMem diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 874e5dab46..687140ce98 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -217,23 +217,21 @@ proc makeTypeSymNode*(c: PContext, typ: PType, info: TLineInfo): PNode = proc makeAndType*(c: PContext, t1, t2: PType): PType = result = newTypeS(tyAnd, c) result.sons = @[t1, t2] - result.flags.incl tfHasMeta - if tfHasStatic in t1.flags or tfHasStatic in t2.flags: - result.flags.incl tfHasStatic + propagateToOwner(result, t1) + propagateToOwner(result, t2) proc makeOrType*(c: PContext, t1, t2: PType): PType = result = newTypeS(tyOr, c) result.sons = @[t1, t2] - result.flags.incl tfHasMeta - if tfHasStatic in t1.flags or tfHasStatic in t2.flags: - result.flags.incl tfHasStatic + propagateToOwner(result, t1) + propagateToOwner(result, t2) proc makeNotType*(c: PContext, t1: PType): PType = result = newTypeS(tyNot, c) result.sons = @[t1] - result.flags.incl tfHasMeta + propagateToOwner(result, t1) -proc newTypeS(kind: TTypeKind, c: PContext): PType = +proc newTypeS(kind: TTypeKind, c: PContext): PType = result = newType(kind, getCurrOwner()) proc newTypeWithSons*(c: PContext, kind: TTypeKind, diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 969ff2d590..cfa099d3fe 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -310,7 +310,8 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, var entry = TInstantiation.new entry.sym = result instantiateGenericParamList(c, n.sons[genericParamsPos], pt, entry[]) - result.typ = fixupProcType(c, fn.typ, entry[]) + # let t1 = fixupProcType(c, fn.typ, entry[]) + result.typ = generateTypeInstance(c, pt, info, fn.typ) n.sons[genericParamsPos] = ast.emptyNode var oldPrc = GenericCacheGet(fn, entry[]) if oldPrc == nil: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 29fad00599..0562509db4 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -591,6 +591,10 @@ proc addParamOrResult(c: PContext, param: PSym, kind: TSymKind) = let typedescId = getIdent"typedesc" +template shouldHaveMeta(t) = + InternalAssert tfHasMeta in result.lastSon.flags + # result.lastSon.flags.incl tfHasMeta + proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, paramType: PType, paramName: string, info: TLineInfo, anon = false): PType = @@ -615,7 +619,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, s.position = genericParams.len genericParams.addSon(newSymNode(s)) result = typeClass - + # XXX: There are codegen errors if this is turned into a nested proc template liftingWalk(typ: PType, anonFlag = false): expr = liftParamType(c, procKind, genericParams, typ, paramName, info, anonFlag) @@ -674,24 +678,22 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, result.rawAddSon(copyType(paramType.sons[i], getCurrOwner(), true)) result = instGenericContainer(c, paramType.sym.info, result, allowMetaTypes = true) - result.lastSon.flags.incl tfHasMeta + result.lastSon.shouldHaveMeta result = newTypeWithSons(c, tyCompositeTypeClass, @[paramType, result]) result = addImplicitGeneric(result) of tyGenericInst: - # XXX: It should be possible to set tfHasMeta in semtypinst, when the - # instance was generated for i in 1 .. (paramType.sons.len - 2): var lifted = liftingWalk(paramType.sons[i]) if lifted != nil: paramType.sons[i] = lifted result = paramType - paramType.lastSon.flags.incl tfHasMeta + result.lastSon.shouldHaveMeta let liftBody = liftingWalk(paramType.lastSon) if liftBody != nil: result = liftBody - result.flags.incl tfHasMeta + result.shouldHaveMeta of tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: result = addImplicitGeneric(copyType(paramType, getCurrOwner(), true)) @@ -884,7 +886,10 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = when oUseLateInstantiation: result = lateInstantiateGeneric(c, result, n.info) else: - result = instGenericContainer(c, n, result) + result = instGenericContainer(c, n.info, result, + allowMetaTypes = not isConcrete) + if not isConcrete and result.kind == tyGenericInst: + result.lastSon.shouldHaveMeta proc semTypeExpr(c: PContext, n: PNode): PType = var n = semExprWithType(c, n, {efDetermineType}) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 1bd6e23d5e..1a4bdd9e3e 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -135,7 +135,7 @@ proc ReplaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym = proc lookupTypeVar(cl: TReplTypeVars, t: PType): PType = result = PType(idTableGet(cl.typeMap, t)) if result == nil: - if cl.allowMetaTypes: return + if cl.allowMetaTypes or tfRetType in t.flags: return LocalError(t.sym.info, errCannotInstantiateX, typeToString(t)) result = errorType(cl.c) elif result.kind == tyGenericParam and not cl.allowMetaTypes: @@ -184,7 +184,7 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = # if one of the params is not concrete, we cannot do anything # but we already raised an error! rawAddSon(result, header.sons[i]) - + var newbody = ReplaceTypeVarsT(cl, lastSon(body)) newbody.flags = newbody.flags + t.flags + body.flags result.flags = result.flags + newbody.flags @@ -205,20 +205,29 @@ proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = return if s != nil: s else: t case t.kind - of tyTypeClass, tyBuiltInTypeClass: nil - of tyGenericParam, tyCompositeTypeClass: - result = lookupTypeVar(cl, t) - if result == nil: return t - if result.kind == tyGenericInvokation: - result = handleGenericInvokation(cl, result) - of tyGenericInvokation: + of tyGenericParam, tyTypeClasses: + let lookup = lookupTypeVar(cl, t) + if lookup != nil: + result = lookup + if result.kind == tyGenericInvokation: + result = handleGenericInvokation(cl, result) + of tyGenericInvokation: result = handleGenericInvokation(cl, t) of tyGenericBody: - InternalError(cl.info, "ReplaceTypeVarsT: tyGenericBody") + InternalError(cl.info, "ReplaceTypeVarsT: tyGenericBody" ) result = ReplaceTypeVarsT(cl, lastSon(t)) of tyInt: result = skipIntLit(t) # XXX now there are also float literals + of tyTypeDesc: + let lookup = PType(idTableGet(cl.typeMap, t)) # lookupTypeVar(cl, t) + if lookup != nil: + result = lookup + if tfUnresolved in t.flags: result = result.base + of tyGenericInst: + result = copyType(t, t.owner, true) + for i in 1 .. <result.sonsLen: + result.sons[i] = ReplaceTypeVarsT(cl, result.sons[i]) else: if t.kind == tyArray: let idxt = t.sons[0] @@ -238,15 +247,18 @@ proc ReplaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = if result.kind == tyProc and result.sons[0] != nil: if result.sons[0].kind == tyEmpty: result.sons[0] = nil - -proc generateTypeInstance*(p: PContext, pt: TIdTable, arg: PNode, - t: PType): PType = + +proc generateTypeInstance*(p: PContext, pt: TIdTable, info: TLineInfo, + t: PType): PType = var cl: TReplTypeVars InitIdTable(cl.symMap) copyIdTable(cl.typeMap, pt) - cl.info = arg.info + cl.info = info cl.c = p - pushInfoContext(arg.info) + pushInfoContext(info) result = ReplaceTypeVarsT(cl, t) popInfoContext() +template generateTypeInstance*(p: PContext, pt: TIdTable, arg: PNode, + t: PType): expr = + generateTypeInstance(p, pt, arg.info, t) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 27be1b7d59..20c348f17d 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -418,7 +418,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = if a.kind == tyGenericInst and skipTypes(f, {tyVar}).kind notin { tyGenericBody, tyGenericInvokation, - tyGenericParam} + tyTypeClasses: + tyGenericInst, tyGenericParam} + tyTypeClasses: return typeRel(c, f, lastSon(a)) template bindingRet(res) = @@ -649,7 +649,14 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = if a.kind == tyEmpty: result = isEqual of tyGenericInst: - result = typeRel(c, lastSon(f), a) + if a.kind == tyGenericInst: + if a.base != f.base: return isNone + for i in 1 .. f.sonsLen-2: + result = typeRel(c, f.sons[i], a.sons[i]) + if result == isNone: return + result = isGeneric + else: + result = typeRel(c, lastSon(f), a) of tyGenericBody: if a.kind == tyGenericInst and a.sons[0] == f: @@ -937,9 +944,9 @@ proc ParamTypesMatchAux(m: var TCandidate, f, argType: PType, var fMaybeStatic = f.skipTypes({tyDistinct}) arg = argSemantized - c = m.c argType = argType - + c = m.c + if tfHasStatic in fMaybeStatic.flags: # XXX: When implicit statics are the default # this will be done earlier - we just have to diff --git a/compiler/types.nim b/compiler/types.nim index a2869f0da5..f0b5939967 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1220,8 +1220,9 @@ proc getSize(typ: PType): biggestInt = result = computeSize(typ) if result < 0: InternalError("getSize: " & $typ.kind) -proc containsGenericTypeIter(t: PType, closure: PObject): bool = - result = t.kind in GenericTypes +proc containsGenericTypeIter(t: PType, closure: PObject): bool = + result = t.kind in GenericTypes + tyTypeClasses + + {tyTypeDesc, tyStatic} proc containsGenericType*(t: PType): bool = result = iterOverType(t, containsGenericTypeIter, nil) diff --git a/tests/compile/tbindtypedesc.nim b/tests/compile/tbindtypedesc.nim index dd4ef854cc..dc0e20f463 100644 --- a/tests/compile/tbindtypedesc.nim +++ b/tests/compile/tbindtypedesc.nim @@ -16,10 +16,10 @@ type TBar = tuple x, y: int -template good(e: expr) = +template accept(e: expr) = static: assert(compiles(e)) -template bad(e: expr) = +template reject(e: expr) = static: assert(not compiles(e)) proc genericParamRepeated[T: typedesc](a: T, b: T) = @@ -27,61 +27,61 @@ proc genericParamRepeated[T: typedesc](a: T, b: T) = echo a.name echo b.name -good(genericParamRepeated(int, int)) -good(genericParamRepeated(float, float)) +accept genericParamRepeated(int, int) +accept genericParamRepeated(float, float) -bad(genericParamRepeated(string, int)) -bad(genericParamRepeated(int, float)) +reject genericParamRepeated(string, int) +reject genericParamRepeated(int, float) proc genericParamOnce[T: typedesc](a, b: T) = static: echo a.name echo b.name -good(genericParamOnce(int, int)) -good(genericParamOnce(TFoo, TFoo)) +accept genericParamOnce(int, int) +accept genericParamOnce(TFoo, TFoo) -bad(genericParamOnce(string, int)) -bad(genericParamOnce(TFoo, float)) +reject genericParamOnce(string, int) +reject genericParamOnce(TFoo, float) proc typePairs(A, B: type1; C, D: type2) = nil -good(typePairs(int, int, TFoo, TFOO)) -good(typePairs(TBAR, TBar, TBAR, TBAR)) -good(typePairs(int, int, string, string)) +accept typePairs(int, int, TFoo, TFOO) +accept typePairs(TBAR, TBar, TBAR, TBAR) +accept typePairs(int, int, string, string) -bad(typePairs(TBAR, TBar, TBar, TFoo)) -bad(typePairs(string, int, TBAR, TBAR)) +reject typePairs(TBAR, TBar, TBar, TFoo) +reject typePairs(string, int, TBAR, TBAR) proc typePairs2[T: typedesc, U: typedesc](A, B: T; C, D: U) = nil -good(typePairs2(int, int, TFoo, TFOO)) -good(typePairs2(TBAR, TBar, TBAR, TBAR)) -good(typePairs2(int, int, string, string)) +accept typePairs2(int, int, TFoo, TFOO) +accept typePairs2(TBAR, TBar, TBAR, TBAR) +accept typePairs2(int, int, string, string) -bad(typePairs2(TBAR, TBar, TBar, TFoo)) -bad(typePairs2(string, int, TBAR, TBAR)) +reject typePairs2(TBAR, TBar, TBar, TFoo) +reject typePairs2(string, int, TBAR, TBAR) proc dontBind(a: typedesc, b: typedesc) = static: echo a.name echo b.name -good(dontBind(int, float)) -good(dontBind(TFoo, TFoo)) +accept dontBind(int, float) +accept dontBind(TFoo, TFoo) proc dontBind2(a, b: typedesc) = nil -good(dontBind2(int, float)) -good(dontBind2(TBar, int)) +accept dontBind2(int, float) +accept dontBind2(TBar, int) proc bindArg(T: typedesc, U: typedesc, a, b: T, c, d: U) = nil -good(bindArg(int, string, 10, 20, "test", "nest")) -good(bindArg(int, int, 10, 20, 30, 40)) +accept bindArg(int, string, 10, 20, "test", "nest") +accept bindArg(int, int, 10, 20, 30, 40) -bad(bindArg(int, string, 10, "test", "test", "nest")) -bad(bindArg(int, int, 10, 20, 30, "test")) -bad(bindArg(int, string, 10.0, 20, "test", "nest")) -bad(bindArg(int, string, "test", "nest", 10, 20)) +reject bindArg(int, string, 10, "test", "test", "nest") +reject bindArg(int, int, 10, 20, 30, "test") +reject bindArg(int, string, 10.0, 20, "test", "nest") +reject bindArg(int, string, "test", "nest", 10, 20) diff --git a/tests/reject/tenummix.nim b/tests/reject/tenummix.nim index f58e7989de..0638658cd3 100644 --- a/tests/reject/tenummix.nim +++ b/tests/reject/tenummix.nim @@ -1,6 +1,6 @@ discard """ file: "system.nim" - line: 696 + line: 698 errormsg: "type mismatch" """ diff --git a/tests/run/tfailedassert.nim b/tests/run/tfailedassert.nim index 0e536cffd4..d99e6dc608 100644 --- a/tests/run/tfailedassert.nim +++ b/tests/run/tfailedassert.nim @@ -3,7 +3,7 @@ discard """ WARNING: false first asseertion from bar ERROR: false second assertion from bar -1 -tests/run/tfailedassert.nim:40 false assertion from foo +tests/run/tfailedassert.nim:27 false assertion from foo ''' """ From 723efe7cfb6cb6ea4147cb5ba407ad3f39ac9032 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sun, 29 Dec 2013 19:26:52 +0200 Subject: [PATCH 175/326] fix the filtering of void params in procs' signatures --- compiler/semtypinst.nim | 24 ++++++++++++++++++++---- tests/reject/mbind4.nim | 9 --------- tests/reject/tactiontable2.nim | 14 +++++++------- tests/reject/tbind4.nim | 13 ------------- tests/reject/teffects1.nim | 2 +- 5 files changed, 28 insertions(+), 34 deletions(-) delete mode 100644 tests/reject/mbind4.nim delete mode 100644 tests/reject/tbind4.nim diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 0bb27946f1..04d2577075 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -189,14 +189,32 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = newbody.flags = newbody.flags + t.flags + body.flags result.flags = result.flags + newbody.flags newbody.callConv = body.callConv - newbody.n = replaceTypeVarsN(cl, lastSon(body).n) # This type may be a generic alias and we want to resolve it here. # One step is enough, because the recursive nature of # handleGenericInvokation will handle the alias-to-alias-to-alias case if newbody.isGenericAlias: newbody = newbody.skipGenericAlias rawAddSon(result, newbody) checkPartialConstructedType(cl.info, newbody) + +proc normalizeProcType(t: PType) = + if t.sons[0] != nil and t.sons[0].kind == tyEmpty: + t.sons[0] = nil + for i in 1 .. <t.sonsLen: + if t.sons[i].kind == tyEmpty: + # the nested loops are here in order to avoid + # touching any memory and callign setLen unless + # it's really necessary + var pos = i + for j in i+1 .. <t.sonsLen: + if t.sons[j].kind != tyEmpty: + t.sons[pos] = t.sons[j] + t.n.sons[pos] = t.n.sons[j] + inc pos + setLen t.sons, pos + setLen t.n.sons, pos + return + proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = result = t if t == nil: return @@ -244,9 +262,7 @@ proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = result.n = replaceTypeVarsN(cl, result.n) if result.kind in GenericTypes: localError(cl.info, errCannotInstantiateX, typeToString(t, preferName)) - if result.kind == tyProc and result.sons[0] != nil: - if result.sons[0].kind == tyEmpty: - result.sons[0] = nil + if result.kind == tyProc: normalizeProcType(result) proc generateTypeInstance*(p: PContext, pt: TIdTable, info: TLineInfo, t: PType): PType = diff --git a/tests/reject/mbind4.nim b/tests/reject/mbind4.nim deleted file mode 100644 index 53b8331cd6..0000000000 --- a/tests/reject/mbind4.nim +++ /dev/null @@ -1,9 +0,0 @@ -# Module A -var - lastId = 0 - -template genId*: expr = - inc(lastId) - lastId - - diff --git a/tests/reject/tactiontable2.nim b/tests/reject/tactiontable2.nim index dbfa42f182..00b4276032 100644 --- a/tests/reject/tactiontable2.nim +++ b/tests/reject/tactiontable2.nim @@ -5,23 +5,23 @@ discard """ import tables -proc action1(arg: string) = +proc action1(arg: string) = echo "action 1 ", arg -proc action2(arg: string) = +proc action2(arg: string) = echo "action 2 ", arg -proc action3(arg: string) = +proc action3(arg: string) = echo "action 3 ", arg -proc action4(arg: string) = +proc action4(arg: string) = echo "action 4 ", arg const actionTable = { - "A": action1, - "B": action2, - "C": action3, + "A": action1, + "B": action2, + "C": action3, "D": action4}.toTable actionTable["C"]("arg") diff --git a/tests/reject/tbind4.nim b/tests/reject/tbind4.nim deleted file mode 100644 index a0ba88e7c8..0000000000 --- a/tests/reject/tbind4.nim +++ /dev/null @@ -1,13 +0,0 @@ -discard """ - file: "mbind4.nim" - line: 6 - errormsg: "undeclared identifier: \'lastId\'" -""" -# Module B -import mbind4 - -echo genId() - - - - diff --git a/tests/reject/teffects1.nim b/tests/reject/teffects1.nim index f5eb56dc80..340acc6eac 100644 --- a/tests/reject/teffects1.nim +++ b/tests/reject/teffects1.nim @@ -1,5 +1,5 @@ discard """ - line: 1840 + line: 1847 file: "system.nim" errormsg: "can raise an unlisted exception: ref EIO" """ From fa3bb8d66bfa18c3a497db2945df43703d809adc Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 30 Dec 2013 00:03:57 +0200 Subject: [PATCH 176/326] restore return type inference --- compiler/ast.nim | 3 +++ compiler/semexprs.nim | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 6f30522a20..22b17f673a 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -905,6 +905,9 @@ template `{}=`*(n: PNode, i: int, s: PNode): stmt = var emptyNode* = newNode(nkEmpty) # There is a single empty node that is shared! Do not overwrite it! +proc isMetaType*(t: PType): bool = + return t.kind in tyMetaTypes or tfHasMeta in t.flags + proc linkTo*(t: PType, s: PSym): PType {.discardable.} = t.sym = s s.typ = t diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 4e53a5389c..14f611c5cd 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1164,7 +1164,7 @@ proc semAsgn(c: PContext, n: PNode): PNode = if lhsIsResult: {efAllowDestructor} else: {}) if lhsIsResult: n.typ = enforceVoidContext - if lhs.sym.typ.kind == tyGenericParam: + if lhs.sym.typ.isMetaType: if cmpTypes(c, lhs.typ, rhs.typ) == isGeneric: internalAssert c.p.resultSym != nil lhs.typ = rhs.typ From e3f53409f64a74e2f672a1624de17efc84be55ed Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 30 Dec 2013 02:13:50 +0200 Subject: [PATCH 177/326] proc redefinition search based on the type system instead of on sloppy AST matching This will work the same for procs/templates/macros/etc, having arbitrary mix of implicit and explicit generics (as long as the symbols are equivalent for the purposes of overload resolution, they will be detected as redefinitions) fixes tgeneric --- compiler/procfind.nim | 26 +++++++++++++++++++++++++- compiler/semtypes.nim | 16 ---------------- compiler/types.nim | 36 +++++++++++++++++++++++------------- 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/compiler/procfind.nim b/compiler/procfind.nim index f02e7aed40..eb0cbca3f6 100644 --- a/compiler/procfind.nim +++ b/compiler/procfind.nim @@ -30,7 +30,7 @@ proc equalGenericParams(procA, procB: PNode): bool = if not exprStructuralEquivalent(a.ast, b.ast): return result = true -proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = +proc searchForProcOld*(c: PContext, scope: PScope, fn: PSym): PSym = # Searchs for a forward declaration or a "twin" symbol of fn # in the symbol table. If the parameter lists are exactly # the same the sym in the symbol table is returned, else nil. @@ -63,6 +63,30 @@ proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = nil result = nextIdentIter(it, scope.symbols) +proc searchForProcNew(c: PContext, scope: PScope, fn: PSym): PSym = + const flags = {ExactGenericParams, ExactTypeDescValues, + ExactConstraints, IgnoreCC} + + var it: TIdentIter + result = initIdentIter(it, scope.symbols, fn.name) + while result != nil: + if result.kind in skProcKinds and + sameType(result.typ, fn.typ, flags): return + + result = nextIdentIter(it, scope.symbols) + + return nil + +proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = + result = searchForProcNew(c, scope, fn) + when false: + let old = searchForProcOld(c, scope, fn) + if old != result: + echo "Mismatch in searchForProc: ", fn.info + debug fn.typ + debug if result != nil: result.typ else: nil + debug if old != nil: old.typ else: nil + when false: proc paramsFitBorrow(child, parent: PNode): bool = var length = sonsLen(child) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 03d8b7095b..175901057d 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -827,22 +827,6 @@ proc semBlockType(c: PContext, n: PNode, prev: PType): PType = dec(c.p.nestedBlockCounter) proc semGenericParamInInvokation(c: PContext, n: PNode): PType = - # XXX hack 1022 for generics ... would have been nice if the compiler had - # been designed with them in mind from start ... - when false: - if n.kind == nkSym: - # for generics we need to lookup the type var again: - var s = searchInScopes(c, n.sym.name) - if s != nil: - if s.kind == skType and s.typ != nil: - var t = n.sym.typ - echo "came here" - return t - else: - echo "s is crap:" - debug(s) - else: - echo "s is nil!!!!" result = semTypeNode(c, n, nil) proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = diff --git a/compiler/types.nim b/compiler/types.nim index 024cf45491..7403e29f9d 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -606,8 +606,10 @@ type TTypeCmpFlag* = enum IgnoreTupleFields + IgnoreCC ExactTypeDescValues ExactGenericParams + ExactConstraints AllowCommonBase TTypeCmpFlags* = set[TTypeCmpFlag] @@ -637,15 +639,17 @@ proc sameTypeOrNilAux(a, b: PType, c: var TSameTypeClosure): bool = if a == nil or b == nil: result = false else: result = sameTypeAux(a, b, c) +proc sameType*(a, b: PType, flags: TTypeCmpFlags = {}): bool = + var c = initSameTypeClosure() + c.flags = flags + result = sameTypeAux(a, b, c) + proc sameTypeOrNil*(a, b: PType, flags: TTypeCmpFlags = {}): bool = if a == b: result = true - else: + else: if a == nil or b == nil: result = false - else: - var c = initSameTypeClosure() - c.flags = flags - result = sameTypeAux(a, b, c) + else: result = sameType(a, b, flags) proc equalParam(a, b: PSym): TParamsEquality = if sameTypeOrNil(a.typ, b.typ, {ExactTypeDescValues}) and @@ -661,7 +665,15 @@ proc equalParam(a, b: PSym): TParamsEquality = result = paramsIncompatible else: result = paramsNotEqual - + +proc sameConstraints(a, b: PNode): bool = + internalAssert a.len == b.len + for i in 1 .. <a.len: + if not exprStructuralEquivalent(a[i].sym.constraint, + b[i].sym.constraint): + return false + return true + proc equalParams(a, b: PNode): TParamsEquality = result = paramsEqual var length = sonsLen(a) @@ -860,8 +872,9 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = else: result = sameFlags(a, b) of tyGenericParam: - result = if ExactGenericParams in c.flags: a.id == b.id - else: sameChildrenAux(a, b, c) and sameFlags(a, b) + result = sameChildrenAux(a, b, c) and sameFlags(a, b) + if result and ExactGenericParams in c.flags: + result = a.sym.position == b.sym.position of tyGenericInvokation, tyGenericBody, tySequence, tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr, tyArray, tyProc, tyConst, tyMutable, tyVarargs, tyIter, @@ -869,7 +882,8 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = cycleCheck() result = sameChildrenAux(a, b, c) and sameFlags(a, b) if result and a.kind == tyProc: - result = a.callConv == b.callConv + result = ((IgnoreCC in c.flags) or a.callConv == b.callConv) and + ((ExactConstraints notin c.flags) or sameConstraints(a.n, b.n)) of tyRange: cycleCheck() result = sameTypeOrNilAux(a.sons[0], b.sons[0], c) and @@ -877,10 +891,6 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = sameValue(a.n.sons[1], b.n.sons[1]) of tyNone: result = false -proc sameType*(x, y: PType): bool = - var c = initSameTypeClosure() - result = sameTypeAux(x, y, c) - proc sameBackendType*(x, y: PType): bool = var c = initSameTypeClosure() c.flags.incl IgnoreTupleFields From 046d829e5d9c07cd829de9fa4ec2c9a07bbcf859 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 30 Dec 2013 11:02:48 +0200 Subject: [PATCH 178/326] Introduce a PreMain proc in the C codegen The rationale here is that it has become too hard to step into a program when #line directives are enabled. You have to skip over many lines of init code that doesn't have corresponding lines in the nimrod program. Now, you can just step-out of PreMain and go straight to the useful code in NimMain. --- compiler/cgen.nim | 98 ++++++++++++++++++++++++++----------------- compiler/cgendata.nim | 3 +- 2 files changed, 62 insertions(+), 39 deletions(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 3aef60fa6e..b08647512a 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -943,44 +943,60 @@ proc genFilenames(m: BModule): PRope = for i in 0.. <fileInfos.len: result.appf("dbgRegisterFilename($1);$n", fileInfos[i].projPath.makeCString) -proc genMainProc(m: BModule) = +proc genMainProc(m: BModule) = const - CommonMainBody = - "\tsystemDatInit();$n" & - "\tsystemInit();$n" & - "$1" & - "$2" & - "$3" & - "$4" - PosixNimMain = - "int cmdCount;$n" & - "char** cmdLine;$n" & - "char** gEnv;$n" & - "N_CDECL(void, NimMain)(void) {$n" & - CommonMainBody & "}$n" + PreMainBody = + "\tsystemDatInit();$n" & + "\tsystemInit();$n" & + "$1" & + "$2" & + "$3" & + "$4" + + MainProcs = + "\tPreMain();$n" & + "\tNimMain();$n" + + MainProcsWithResult = + MainProcs & "\treturn nim_program_result;$n" + + PosixNimMain = + "int cmdCount;$n" & + "char** cmdLine;$n" & + "char** gEnv;$n" & + "N_CDECL(void, NimMain)(void) {$n$1}$n" + PosixCMain = "int main(int argc, char** args, char** env) {$n" & - "\tcmdLine = args;$n" & "\tcmdCount = argc;$n" & "\tgEnv = env;$n" & - "\tNimMain();$n" & "\treturn nim_program_result;$n" & "}$n" + "\tcmdLine = args;$n" & "\tcmdCount = argc;$n" & "\tgEnv = env;$n" & + MainProcsWithResult & + "}$n" + StandaloneCMain = "int main(void) {$n" & - "\tNimMain();$n" & - "\treturn 0;$n" & "}$n" - WinNimMain = "N_CDECL(void, NimMain)(void) {$n" & - CommonMainBody & "}$n" + MainProcs & + "\treturn 0;$n" & "}$n" + + WinNimMain = "N_CDECL(void, NimMain)(void) {$n$1}$n" + WinCMain = "N_STDCALL(int, WinMain)(HINSTANCE hCurInstance, $n" & - " HINSTANCE hPrevInstance, $n" & - " LPSTR lpCmdLine, int nCmdShow) {$n" & - "\tNimMain();$n" & "\treturn nim_program_result;$n" & "}$n" - WinNimDllMain = "N_LIB_EXPORT N_CDECL(void, NimMain)(void) {$n" & - CommonMainBody & "}$n" - WinCDllMain = - "BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, $n" & - " LPVOID lpvReserved) {$n" & - "\tif(fwdreason == DLL_PROCESS_ATTACH) NimMain();$n" & - "\treturn 1;$n" & "}$n" + " HINSTANCE hPrevInstance, $n" & + " LPSTR lpCmdLine, int nCmdShow) {$n" & + MainProcsWithResult & "}$n" + + WinNimDllMain = "N_LIB_EXPORT N_CDECL(void, NimMain)(void) {$n$1}$n" + + WinCDllMain = + "BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, $n" & + " LPVOID lpvReserved) {$n" & + "\tif(fwdreason == DLL_PROCESS_ATTACH) {" & MainProcs & "}$n" & + "\treturn 1;$n}$n" + PosixNimDllMain = WinNimDllMain - PosixCDllMain = - "void NIM_POSIX_INIT NimMainInit(void) {$n" & - "\tNimMain();$n}$n" + + PosixCDllMain = + "void NIM_POSIX_INIT NimMainInit(void) {$n" & + MainProcs & + "}$n" + var nimMain, otherMain: TFormatStr if platform.targetOS == osWindows and gGlobalOptions * {optGenGuiApp, optGenDynLib} != {}: @@ -1008,8 +1024,10 @@ proc genMainProc(m: BModule) = platform.targetOS == osStandalone: "".toRope else: ropecg(m, "\t#initStackBottom();$n") inc(m.labels) - appcg(m, m.s[cfsProcs], nimMain, [mainDatInit, initStackBottomCall, - gBreakpoints, mainModInit, toRope(m.labels)]) + appcg(m, m.s[cfsProcs], "void PreMain() {$n" & PreMainBody & "}$n", [ + mainDatInit, initStackBottomCall, gBreakpoints, otherModsInit]) + + appcg(m, m.s[cfsProcs], nimMain, [mainModInit, toRope(m.labels)]) if optNoMain notin gGlobalOptions: appcg(m, m.s[cfsProcs], otherMain, []) @@ -1030,10 +1048,14 @@ proc registerModuleToMain(m: PSym) = "declare void $1() noinline$N", [init]) appff(mainModProcs, "N_NOINLINE(void, $1)(void);$N", "declare void $1() noinline$N", [datInit]) - if not (sfSystemModule in m.flags): - appff(mainModInit, "\t$1();$n", "call void ()* $1$n", [init]) + if sfSystemModule notin m.flags: appff(mainDatInit, "\t$1();$n", "call void ()* $1$n", [datInit]) - + let initCall = ropeff("\t$1();$n", "call void ()* $1$n", [init]) + if sfMainModule in m.flags: + app(mainModInit, initCall) + else: + app(otherModsInit, initCall) + proc genInitCode(m: BModule) = var initname = getInitName(m.module) var prc = ropeff("N_NOINLINE(void, $1)(void) {$n", diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index d72f9fa4d0..9cd2c0d87f 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -114,7 +114,8 @@ type injectStmt*: PRope var - mainModProcs*, mainModInit*, mainDatInit*: PRope # parts of the main module + mainModProcs*, mainModInit*, otherModsInit*, mainDatInit*: PRope + # varuious parts of the main module gMapping*: PRope # the generated mapping file (if requested) gModules*: seq[BModule] = @[] # list of all compiled modules gForwardedProcsCounter*: int = 0 From 88873f7965d04cc2bea56f2b957e3b506442c582 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 30 Dec 2013 14:25:05 +0200 Subject: [PATCH 179/326] add incl/excl for sets accepting accepting other sets --- lib/system.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/system.nim b/lib/system.nim index 978fae1a6e..241b0bd034 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -422,10 +422,18 @@ proc incl*[T](x: var set[T], y: T) {.magic: "Incl", noSideEffect.} ## includes element ``y`` to the set ``x``. This is the same as ## ``x = x + {y}``, but it might be more efficient. +template incl*[T](s: var set[T], flags: set[T]) = + ## includes the set of flags to the set ``x``. + s = s + flags + proc excl*[T](x: var set[T], y: T) {.magic: "Excl", noSideEffect.} ## excludes element ``y`` to the set ``x``. This is the same as ## ``x = x - {y}``, but it might be more efficient. +template excl*[T](s: var set[T], flags: set[T]) = + ## excludes the set of flags to ``x``. + s = s - flags + 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. From 7e24cf26dec34a85d7551946f546f32e30b27f42 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 30 Dec 2013 14:30:36 +0200 Subject: [PATCH 180/326] handle recursive types during the instantiation of meta types; propagate tfHasMeta more carefully --- compiler/ast.nim | 8 +++- compiler/seminst.nim | 1 + compiler/semtypinst.nim | 98 +++++++++++++++++++++++++++++++++-------- compiler/types.nim | 5 --- 4 files changed, 86 insertions(+), 26 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 22b17f673a..8699d17151 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -404,8 +404,8 @@ type tfHasMeta, # type contains "wildcard" sub-types such as generic params # or other type classes tfHasGCedMem, # type contains GC'ed memory - tfGenericTypeParam tfHasStatic + tfGenericTypeParam TTypeFlags* = set[TTypeFlag] @@ -1229,6 +1229,10 @@ proc newSons(father: PNode, length: int) = else: setLen(father.sons, length) +proc skipTypes*(t: PType, kinds: TTypeKinds): PType = + result = t + while result.kind in kinds: result = lastSon(result) + proc propagateToOwner*(owner, elem: PType) = const HaveTheirOwnEmpty = {tySequence, tySet} owner.flags = owner.flags + (elem.flags * {tfHasShared, tfHasMeta, @@ -1245,7 +1249,7 @@ proc propagateToOwner*(owner, elem: PType) = if tfShared in elem.flags: owner.flags.incl tfHasShared - + if elem.kind in tyMetaTypes: owner.flags.incl tfHasMeta diff --git a/compiler/seminst.nim b/compiler/seminst.nim index f7f836644c..cec3567e27 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -173,6 +173,7 @@ proc instGenericContainer(c: PContext, info: TLineInfo, header: PType, var cl: TReplTypeVars initIdTable(cl.symMap) initIdTable(cl.typeMap) + initIdTable(cl.localCache) cl.info = info cl.c = c cl.allowMetaTypes = allowMetaTypes diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 04d2577075..0c185b09ab 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -11,6 +11,9 @@ import ast, astalgo, msgs, types, magicsys, semdata, renderer +const + tfInstClearedFlags = {tfHasMeta} + proc checkPartialConstructedType(info: TLineInfo, t: PType) = if tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject: localError(info, errInvalidPragmaX, "acyclic") @@ -67,14 +70,30 @@ type c*: PContext typeMap*: TIdTable # map PType to PType symMap*: TIdTable # map PSym to PSym + localCache*: TIdTable # local cache for remembering alraedy replaced + # types during instantiation of meta types + # (they are not stored in the global cache) info*: TLineInfo allowMetaTypes*: bool # allow types such as seq[Number] # i.e. the result contains unresolved generics -proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType +proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType proc replaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode +template checkMetaInvariants(cl: TReplTypeVars, t: PType) = + when false: + if t != nil and tfHasMeta in t.flags and + cl.allowMetaTypes == false: + echo "UNEXPECTED META ", t.id, " ", instantiationInfo(-1) + debug t + writeStackTrace() + quit 1 + +proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = + result = replaceTypeVarsTAux(cl, t) + checkMetaInvariants(cl, result) + proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode = result = copyNode(n) result.typ = replaceTypeVarsT(cl, n.typ) @@ -87,7 +106,9 @@ proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode = proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = if n == nil: return result = copyNode(n) - result.typ = replaceTypeVarsT(cl, n.typ) + if n.typ != nil: + result.typ = replaceTypeVarsT(cl, n.typ) + checkMetaInvariants(cl, result.typ) case n.kind of nkNone..pred(nkSym), succ(nkSym)..nkNilLit: discard @@ -140,7 +161,12 @@ proc lookupTypeVar(cl: TReplTypeVars, t: PType): PType = result = errorType(cl.c) elif result.kind == tyGenericParam and not cl.allowMetaTypes: internalError(cl.info, "substitution with generic parameter") - + +proc instCopyType(t: PType): PType = + result = copyType(t, t.owner, false) + result.flags.incl tfFromGeneric + result.flags.excl tfInstClearedFlags + proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = # tyGenericInvokation[A, tyGenericInvokation[A, B]] # is difficult to handle: @@ -148,14 +174,17 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = if body.kind != tyGenericBody: internalError(cl.info, "no generic body") var header: PType = nil # search for some instantiation here: - result = searchInstTypes(t) + if cl.allowMetaTypes: + result = PType(idTableGet(cl.localCache, t)) + else: + result = searchInstTypes(t) if result != nil: return for i in countup(1, sonsLen(t) - 1): var x = t.sons[i] if x.kind == tyGenericParam: x = lookupTypeVar(cl, x) if x != nil: - if header == nil: header = copyType(t, t.owner, false) + if header == nil: header = instCopyType(t) header.sons[i] = x propagateToOwner(header, x) @@ -164,14 +193,18 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = result = searchInstTypes(header) if result != nil: return else: - header = copyType(t, t.owner, false) + header = instCopyType(t) + + result = newType(tyGenericInst, t.sons[0].owner) + # be careful not to propagate unnecessary flags here (don't use rawAddSon) + result.sons = @[header.sons[0]] # ugh need another pass for deeply recursive generic types (e.g. PActor) # we need to add the candidate here, before it's fully instantiated for # recursive instantions: - result = newType(tyGenericInst, t.sons[0].owner) - result.rawAddSon(header.sons[0]) if not cl.allowMetaTypes: cacheTypeInst(result) + else: + idTablePut(cl.localCache, t, result) for i in countup(1, sonsLen(t) - 1): var x = replaceTypeVarsT(cl, t.sons[i]) @@ -180,13 +213,13 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = propagateToOwner(header, x) idTablePut(cl.typeMap, body.sons[i-1], x) - for i in countup(1, sonsLen(t) - 1): + for i in countup(1, sonsLen(t) - 1): # if one of the params is not concrete, we cannot do anything # but we already raised an error! rawAddSon(result, header.sons[i]) - + var newbody = replaceTypeVarsT(cl, lastSon(body)) - newbody.flags = newbody.flags + t.flags + body.flags + newbody.flags = newbody.flags + (t.flags + body.flags - tfInstClearedFlags) result.flags = result.flags + newbody.flags newbody.callConv = body.callConv # This type may be a generic alias and we want to resolve it here. @@ -215,9 +248,22 @@ proc normalizeProcType(t: PType) = setLen t.n.sons, pos return -proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = +proc propagateFieldFlags(t: PType, n: PNode) = + # This is meant for objects and tuples + # The type must be fully instantiated! + internalAssert n.kind != nkRecWhen + case n.kind + of nkSym: + propagateToOwner(t, n.sym.typ) + of nkRecList, nkRecCase, nkOfBranch, nkElse: + for son in n.sons: + propagateFieldFlags(t, son) + else: discard + +proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = result = t if t == nil: return + if t.kind == tyStatic and t.sym != nil and t.sym.kind == skGenericParam: let s = lookupTypeVar(cl, t) return if s != nil: s else: t @@ -243,9 +289,10 @@ proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = result = lookup if tfUnresolved in t.flags: result = result.base of tyGenericInst: - result = copyType(t, t.owner, true) + result = instCopyType(t) for i in 1 .. <result.sonsLen: result.sons[i] = ReplaceTypeVarsT(cl, result.sons[i]) + propagateToOwner(result, result.lastSon) else: if t.kind == tyArray: let idxt = t.sons[0] @@ -253,22 +300,35 @@ proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType = idxt.sym != nil and idxt.sym.kind == skGenericParam: let value = lookupTypeVar(cl, idxt).n t.sons[0] = makeRangeType(cl.c, 0, value.intVal - 1, value.info) + if containsGenericType(t): - result = copyType(t, t.owner, false) - incl(result.flags, tfFromGeneric) + result = instCopyType(t) result.size = -1 # needs to be recomputed + for i in countup(0, sonsLen(result) - 1): - result.sons[i] = replaceTypeVarsT(cl, result.sons[i]) + if result.sons[i] != nil: + result.sons[i] = replaceTypeVarsT(cl, result.sons[i]) + propagateToOwner(result, result.sons[i]) + result.n = replaceTypeVarsN(cl, result.n) - if result.kind in GenericTypes: - localError(cl.info, errCannotInstantiateX, typeToString(t, preferName)) - if result.kind == tyProc: normalizeProcType(result) + + # XXX: This is not really needed? + # if result.kind in GenericTypes: + # localError(cl.info, errCannotInstantiateX, typeToString(t, preferName)) + + case result.kind + of tyObject, tyTuple: + propagateFieldFlags(result, result.n) + of tyProc: + normalizeProcType(result) + else: discard proc generateTypeInstance*(p: PContext, pt: TIdTable, info: TLineInfo, t: PType): PType = var cl: TReplTypeVars initIdTable(cl.symMap) copyIdTable(cl.typeMap, pt) + initIdTable(cl.localCache) cl.info = info cl.c = p pushInfoContext(info) diff --git a/compiler/types.nim b/compiler/types.nim index 7403e29f9d..a24adb17e3 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -64,7 +64,6 @@ const typedescPtrs* = abstractPtrs + {tyTypeDesc} typedescInst* = abstractInst + {tyTypeDesc} -proc skipTypes*(t: PType, kinds: TTypeKinds): PType proc containsObject*(t: PType): bool proc containsGarbageCollectedRef*(typ: PType): bool proc containsHiddenPointer*(typ: PType): bool @@ -148,10 +147,6 @@ proc skipGeneric(t: PType): PType = result = t while result.kind == tyGenericInst: result = lastSon(result) -proc skipTypes(t: PType, kinds: TTypeKinds): PType = - result = t - while result.kind in kinds: result = lastSon(result) - proc isOrdinalType(t: PType): bool = assert(t != nil) # caution: uint, uint64 are no ordinal types! From af7c3251cd2b349e9d423a0c5871f37703122dfd Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 30 Dec 2013 17:07:49 +0200 Subject: [PATCH 181/326] properly remove intLiterals from proc signatures; fixes trettypeinference --- compiler/semtypinst.nim | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 0c185b09ab..029bf6c8c6 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -229,15 +229,13 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = rawAddSon(result, newbody) checkPartialConstructedType(cl.info, newbody) -proc normalizeProcType(t: PType) = +proc eraseVoidParams(t: PType) = if t.sons[0] != nil and t.sons[0].kind == tyEmpty: t.sons[0] = nil for i in 1 .. <t.sonsLen: + # don't touch any memory unless necessary if t.sons[i].kind == tyEmpty: - # the nested loops are here in order to avoid - # touching any memory and callign setLen unless - # it's really necessary var pos = i for j in i+1 .. <t.sonsLen: if t.sons[j].kind != tyEmpty: @@ -248,6 +246,15 @@ proc normalizeProcType(t: PType) = setLen t.n.sons, pos return +proc skipIntLiteralParams(t: PType) = + for i in 0 .. <t.sonsLen: + let p = t.sons[i] + if p == nil: continue + let skipped = p.skipIntLit + if skipped != p: + t.sons[i] = skipped + if i > 0: t.n.sons[i].sym.typ = skipped + proc propagateFieldFlags(t: PType, n: PNode) = # This is meant for objects and tuples # The type must be fully instantiated! @@ -320,7 +327,8 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = of tyObject, tyTuple: propagateFieldFlags(result, result.n) of tyProc: - normalizeProcType(result) + eraseVoidParams(result) + skipIntLiteralParams(result) else: discard proc generateTypeInstance*(p: PContext, pt: TIdTable, info: TLineInfo, From fc68a7d880fd1319ed55065743d2a3359ae4c18b Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 17:58:05 +0100 Subject: [PATCH 182/326] Removes generated .dot file uploaded by mistake. --- .gitignore | 1 + compiler/nimrod.dot | 591 -------------------------------------------- 2 files changed, 1 insertion(+), 591 deletions(-) delete mode 100644 compiler/nimrod.dot diff --git a/.gitignore b/.gitignore index f5719848bf..15272385fe 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ examples/cross_calculator/android/tags # Generated files. /compile.json /compiler/c2nim/c2nim +/compiler/nimrod.dot /compiler/pas2nim/pas2nim /compiler/service /examples/allany diff --git a/compiler/nimrod.dot b/compiler/nimrod.dot deleted file mode 100644 index e9663d7c5d..0000000000 --- a/compiler/nimrod.dot +++ /dev/null @@ -1,591 +0,0 @@ -digraph nimrod { -times -> strutils; -os -> strutils; -os -> times; -posix -> times; -os -> posix; -nhashes -> strutils; -nstrtabs -> os; -nstrtabs -> nhashes; -nstrtabs -> strutils; -options -> os; -options -> lists; -options -> strutils; -options -> nstrtabs; -msgs -> options; -msgs -> strutils; -msgs -> os; -crc -> strutils; -platform -> strutils; -ropes -> msgs; -ropes -> strutils; -ropes -> platform; -ropes -> nhashes; -ropes -> crc; -idents -> nhashes; -idents -> strutils; -ast -> msgs; -ast -> nhashes; -ast -> nversion; -ast -> options; -ast -> strutils; -ast -> crc; -ast -> ropes; -ast -> idents; -ast -> lists; -astalgo -> ast; -astalgo -> nhashes; -astalgo -> strutils; -astalgo -> options; -astalgo -> msgs; -astalgo -> ropes; -astalgo -> idents; -condsyms -> ast; -condsyms -> astalgo; -condsyms -> msgs; -condsyms -> nhashes; -condsyms -> platform; -condsyms -> strutils; -condsyms -> idents; -hashes -> strutils; -strtabs -> os; -strtabs -> hashes; -strtabs -> strutils; -osproc -> strutils; -osproc -> os; -osproc -> strtabs; -osproc -> streams; -osproc -> posix; -extccomp -> lists; -extccomp -> ropes; -extccomp -> os; -extccomp -> strutils; -extccomp -> osproc; -extccomp -> platform; -extccomp -> condsyms; -extccomp -> options; -extccomp -> msgs; -wordrecg -> nhashes; -wordrecg -> strutils; -wordrecg -> idents; -commands -> os; -commands -> msgs; -commands -> options; -commands -> nversion; -commands -> condsyms; -commands -> strutils; -commands -> extccomp; -commands -> platform; -commands -> lists; -commands -> wordrecg; -llstream -> strutils; -lexbase -> llstream; -lexbase -> strutils; -scanner -> nhashes; -scanner -> options; -scanner -> msgs; -scanner -> strutils; -scanner -> platform; -scanner -> idents; -scanner -> lexbase; -scanner -> llstream; -scanner -> wordrecg; -nimconf -> llstream; -nimconf -> nversion; -nimconf -> commands; -nimconf -> os; -nimconf -> strutils; -nimconf -> msgs; -nimconf -> platform; -nimconf -> condsyms; -nimconf -> scanner; -nimconf -> options; -nimconf -> idents; -nimconf -> wordrecg; -pnimsyn -> llstream; -pnimsyn -> scanner; -pnimsyn -> idents; -pnimsyn -> strutils; -pnimsyn -> ast; -pnimsyn -> msgs; -pbraces -> llstream; -pbraces -> scanner; -pbraces -> idents; -pbraces -> strutils; -pbraces -> ast; -pbraces -> msgs; -pbraces -> pnimsyn; -rnimsyn -> scanner; -rnimsyn -> options; -rnimsyn -> idents; -rnimsyn -> strutils; -rnimsyn -> ast; -rnimsyn -> msgs; -rnimsyn -> lists; -filters -> llstream; -filters -> os; -filters -> wordrecg; -filters -> idents; -filters -> strutils; -filters -> ast; -filters -> astalgo; -filters -> msgs; -filters -> options; -filters -> rnimsyn; -ptmplsyn -> llstream; -ptmplsyn -> os; -ptmplsyn -> wordrecg; -ptmplsyn -> idents; -ptmplsyn -> strutils; -ptmplsyn -> ast; -ptmplsyn -> astalgo; -ptmplsyn -> msgs; -ptmplsyn -> options; -ptmplsyn -> rnimsyn; -ptmplsyn -> filters; -syntaxes -> strutils; -syntaxes -> llstream; -syntaxes -> ast; -syntaxes -> astalgo; -syntaxes -> idents; -syntaxes -> scanner; -syntaxes -> options; -syntaxes -> msgs; -syntaxes -> pnimsyn; -syntaxes -> pbraces; -syntaxes -> ptmplsyn; -syntaxes -> filters; -syntaxes -> rnimsyn; -paslex -> nhashes; -paslex -> options; -paslex -> msgs; -paslex -> strutils; -paslex -> platform; -paslex -> idents; -paslex -> lexbase; -paslex -> wordrecg; -paslex -> scanner; -pasparse -> os; -pasparse -> llstream; -pasparse -> scanner; -pasparse -> paslex; -pasparse -> idents; -pasparse -> wordrecg; -pasparse -> strutils; -pasparse -> ast; -pasparse -> astalgo; -pasparse -> msgs; -pasparse -> options; -rodread -> os; -rodread -> options; -rodread -> strutils; -rodread -> nversion; -rodread -> ast; -rodread -> astalgo; -rodread -> msgs; -rodread -> platform; -rodread -> condsyms; -rodread -> ropes; -rodread -> idents; -rodread -> crc; -trees -> ast; -trees -> astalgo; -trees -> scanner; -trees -> msgs; -trees -> strutils; -types -> ast; -types -> astalgo; -types -> trees; -types -> msgs; -types -> strutils; -types -> platform; -magicsys -> ast; -magicsys -> astalgo; -magicsys -> nhashes; -magicsys -> msgs; -magicsys -> platform; -magicsys -> nversion; -magicsys -> times; -magicsys -> idents; -magicsys -> rodread; -nimsets -> ast; -nimsets -> astalgo; -nimsets -> trees; -nimsets -> nversion; -nimsets -> msgs; -nimsets -> platform; -nimsets -> bitsets; -nimsets -> types; -nimsets -> rnimsyn; -passes -> strutils; -passes -> lists; -passes -> options; -passes -> ast; -passes -> astalgo; -passes -> llstream; -passes -> msgs; -passes -> platform; -passes -> os; -passes -> condsyms; -passes -> idents; -passes -> rnimsyn; -passes -> types; -passes -> extccomp; -passes -> math; -passes -> magicsys; -passes -> nversion; -passes -> nimsets; -passes -> syntaxes; -passes -> times; -passes -> rodread; -treetab -> nhashes; -treetab -> ast; -treetab -> astalgo; -treetab -> types; -semdata -> strutils; -semdata -> lists; -semdata -> options; -semdata -> scanner; -semdata -> ast; -semdata -> astalgo; -semdata -> trees; -semdata -> treetab; -semdata -> wordrecg; -semdata -> ropes; -semdata -> msgs; -semdata -> platform; -semdata -> os; -semdata -> condsyms; -semdata -> idents; -semdata -> rnimsyn; -semdata -> types; -semdata -> extccomp; -semdata -> math; -semdata -> magicsys; -semdata -> nversion; -semdata -> nimsets; -semdata -> pnimsyn; -semdata -> times; -semdata -> passes; -semdata -> rodread; -lookups -> ast; -lookups -> astalgo; -lookups -> idents; -lookups -> semdata; -lookups -> types; -lookups -> msgs; -lookups -> options; -lookups -> rodread; -lookups -> rnimsyn; -importer -> strutils; -importer -> os; -importer -> ast; -importer -> astalgo; -importer -> msgs; -importer -> options; -importer -> idents; -importer -> rodread; -importer -> lookups; -importer -> semdata; -importer -> passes; -rodwrite -> os; -rodwrite -> options; -rodwrite -> strutils; -rodwrite -> nversion; -rodwrite -> ast; -rodwrite -> astalgo; -rodwrite -> msgs; -rodwrite -> platform; -rodwrite -> condsyms; -rodwrite -> ropes; -rodwrite -> idents; -rodwrite -> crc; -rodwrite -> rodread; -rodwrite -> passes; -rodwrite -> importer; -semfold -> strutils; -semfold -> lists; -semfold -> options; -semfold -> ast; -semfold -> astalgo; -semfold -> trees; -semfold -> treetab; -semfold -> nimsets; -semfold -> times; -semfold -> nversion; -semfold -> platform; -semfold -> math; -semfold -> msgs; -semfold -> os; -semfold -> condsyms; -semfold -> idents; -semfold -> rnimsyn; -semfold -> types; -evals -> strutils; -evals -> magicsys; -evals -> lists; -evals -> options; -evals -> ast; -evals -> astalgo; -evals -> trees; -evals -> treetab; -evals -> nimsets; -evals -> msgs; -evals -> os; -evals -> condsyms; -evals -> idents; -evals -> rnimsyn; -evals -> types; -evals -> passes; -evals -> semfold; -procfind -> ast; -procfind -> astalgo; -procfind -> msgs; -procfind -> semdata; -procfind -> types; -procfind -> trees; -pragmas -> os; -pragmas -> platform; -pragmas -> condsyms; -pragmas -> ast; -pragmas -> astalgo; -pragmas -> idents; -pragmas -> semdata; -pragmas -> msgs; -pragmas -> rnimsyn; -pragmas -> wordrecg; -pragmas -> ropes; -pragmas -> options; -pragmas -> strutils; -pragmas -> lists; -pragmas -> extccomp; -pragmas -> math; -pragmas -> magicsys; -pragmas -> trees; -sem -> strutils; -sem -> nhashes; -sem -> lists; -sem -> options; -sem -> scanner; -sem -> ast; -sem -> astalgo; -sem -> trees; -sem -> treetab; -sem -> wordrecg; -sem -> ropes; -sem -> msgs; -sem -> os; -sem -> condsyms; -sem -> idents; -sem -> rnimsyn; -sem -> types; -sem -> platform; -sem -> math; -sem -> magicsys; -sem -> pnimsyn; -sem -> nversion; -sem -> nimsets; -sem -> semdata; -sem -> evals; -sem -> semfold; -sem -> importer; -sem -> procfind; -sem -> lookups; -sem -> rodread; -sem -> pragmas; -sem -> passes; -rst -> os; -rst -> msgs; -rst -> strutils; -rst -> platform; -rst -> nhashes; -rst -> ropes; -rst -> options; -highlite -> nhashes; -highlite -> options; -highlite -> msgs; -highlite -> strutils; -highlite -> platform; -highlite -> idents; -highlite -> lexbase; -highlite -> wordrecg; -highlite -> scanner; -docgen -> ast; -docgen -> astalgo; -docgen -> strutils; -docgen -> nhashes; -docgen -> options; -docgen -> nversion; -docgen -> msgs; -docgen -> os; -docgen -> ropes; -docgen -> idents; -docgen -> wordrecg; -docgen -> math; -docgen -> syntaxes; -docgen -> rnimsyn; -docgen -> scanner; -docgen -> rst; -docgen -> times; -docgen -> highlite; -ccgutils -> ast; -ccgutils -> astalgo; -ccgutils -> ropes; -ccgutils -> lists; -ccgutils -> nhashes; -ccgutils -> strutils; -ccgutils -> types; -ccgutils -> msgs; -cgmeth -> options; -cgmeth -> ast; -cgmeth -> astalgo; -cgmeth -> msgs; -cgmeth -> idents; -cgmeth -> rnimsyn; -cgmeth -> types; -cgmeth -> magicsys; -cgen -> ast; -cgen -> astalgo; -cgen -> strutils; -cgen -> nhashes; -cgen -> trees; -cgen -> platform; -cgen -> magicsys; -cgen -> extccomp; -cgen -> options; -cgen -> nversion; -cgen -> nimsets; -cgen -> msgs; -cgen -> crc; -cgen -> bitsets; -cgen -> idents; -cgen -> lists; -cgen -> types; -cgen -> ccgutils; -cgen -> os; -cgen -> times; -cgen -> ropes; -cgen -> math; -cgen -> passes; -cgen -> rodread; -cgen -> wordrecg; -cgen -> rnimsyn; -cgen -> treetab; -cgen -> cgmeth; -jsgen -> ast; -jsgen -> astalgo; -jsgen -> strutils; -jsgen -> nhashes; -jsgen -> trees; -jsgen -> platform; -jsgen -> magicsys; -jsgen -> extccomp; -jsgen -> options; -jsgen -> nversion; -jsgen -> nimsets; -jsgen -> msgs; -jsgen -> crc; -jsgen -> bitsets; -jsgen -> idents; -jsgen -> lists; -jsgen -> types; -jsgen -> os; -jsgen -> times; -jsgen -> ropes; -jsgen -> math; -jsgen -> passes; -jsgen -> ccgutils; -jsgen -> wordrecg; -jsgen -> rnimsyn; -jsgen -> rodread; -interact -> llstream; -interact -> strutils; -interact -> ropes; -interact -> nstrtabs; -interact -> msgs; -passaux -> strutils; -passaux -> ast; -passaux -> astalgo; -passaux -> passes; -passaux -> msgs; -passaux -> options; -depends -> os; -depends -> options; -depends -> ast; -depends -> astalgo; -depends -> msgs; -depends -> ropes; -depends -> idents; -depends -> passes; -depends -> importer; -transf -> strutils; -transf -> lists; -transf -> options; -transf -> ast; -transf -> astalgo; -transf -> trees; -transf -> treetab; -transf -> evals; -transf -> msgs; -transf -> os; -transf -> idents; -transf -> rnimsyn; -transf -> types; -transf -> passes; -transf -> semfold; -transf -> magicsys; -transf -> cgmeth; -main -> llstream; -main -> strutils; -main -> ast; -main -> astalgo; -main -> scanner; -main -> syntaxes; -main -> rnimsyn; -main -> options; -main -> msgs; -main -> os; -main -> lists; -main -> condsyms; -main -> paslex; -main -> pasparse; -main -> rodread; -main -> rodwrite; -main -> ropes; -main -> trees; -main -> wordrecg; -main -> sem; -main -> semdata; -main -> idents; -main -> passes; -main -> docgen; -main -> extccomp; -main -> cgen; -main -> jsgen; -main -> platform; -main -> interact; -main -> nimconf; -main -> importer; -main -> passaux; -main -> depends; -main -> transf; -main -> evals; -main -> types; -parseopt -> os; -parseopt -> strutils; -nimrod -> times; -nimrod -> commands; -nimrod -> scanner; -nimrod -> condsyms; -nimrod -> options; -nimrod -> msgs; -nimrod -> nversion; -nimrod -> nimconf; -nimrod -> ropes; -nimrod -> extccomp; -nimrod -> strutils; -nimrod -> os; -nimrod -> platform; -nimrod -> main; -nimrod -> parseopt; -} From 754e2ef1db61610cba1b96752fa37c6e923e2808 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 30 Dec 2013 19:11:42 +0200 Subject: [PATCH 183/326] migrate the static param handling to ReplaceTypeVars; fix tgenericvariant --- compiler/sem.nim | 11 +++++++---- compiler/semtypes.nim | 23 +++++++++++++++++------ compiler/semtypinst.nim | 21 ++++++++++----------- compiler/sigmatch.nim | 3 +-- compiler/types.nim | 4 ++-- tests/reject/teffects1.nim | 2 +- 6 files changed, 38 insertions(+), 26 deletions(-) diff --git a/compiler/sem.nim b/compiler/sem.nim index df37a6384f..e9c2de6572 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -204,12 +204,15 @@ proc tryConstExpr(c: PContext, n: PNode): PNode = result = getConstExpr(c.module, e) if result != nil: return - result = evalConstExpr(c.module, e) - if result == nil or result.kind == nkEmpty: + try: + result = evalConstExpr(c.module, e) + if result == nil or result.kind == nkEmpty: + return nil + + result = fixupTypeAfterEval(c, result, e) + except: return nil - result = fixupTypeAfterEval(c, result, e) - proc semConstExpr(c: PContext, n: PNode): PNode = var e = semExprWithType(c, n) if e == nil: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 175901057d..fb05469615 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -594,7 +594,7 @@ proc addParamOrResult(c: PContext, param: PSym, kind: TSymKind) = let typedescId = getIdent"typedesc" template shouldHaveMeta(t) = - InternalAssert tfHasMeta in result.lastSon.flags + InternalAssert tfHasMeta in t.flags # result.lastSon.flags.incl tfHasMeta proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, @@ -677,7 +677,8 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, result = newTypeS(tyGenericInvokation, c) result.rawAddSon(paramType) for i in 0 .. paramType.sonsLen - 2: - result.rawAddSon(copyType(paramType.sons[i], getCurrOwner(), true)) + result.rawAddSon newTypeS(tyAnything, c) + # result.rawAddSon(copyType(paramType.sons[i], getCurrOwner(), true)) result = instGenericContainer(c, paramType.sym.info, result, allowMetaTypes = true) result.lastSon.shouldHaveMeta @@ -696,20 +697,29 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, if liftBody != nil: result = liftBody result.shouldHaveMeta - + + of tyGenericInvokation: + for i in 1 .. <paramType.sonsLen: + let lifted = liftingWalk(paramType.sons[i]) + if lifted != nil: paramType.sons[i] = lifted + + let expanded = instGenericContainer(c, info, paramType, + allowMetaTypes = true) + result = liftingWalk(expanded) + of tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: result = addImplicitGeneric(copyType(paramType, getCurrOwner(), true)) of tyExpr: if procKind notin {skMacro, skTemplate}: - result = addImplicitGeneric(newTypeS(tyGenericParam, c)) + result = addImplicitGeneric(newTypeS(tyAnything, c)) of tyGenericParam: if tfGenericTypeParam in paramType.flags and false: if paramType.sonsLen > 0: result = liftingWalk(paramType.lastSon) else: - result = addImplicitGeneric(newTypeS(tyGenericParam, c)) + result = addImplicitGeneric(newTypeS(tyAnything, c)) else: nil @@ -860,7 +870,7 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = return newOrPrevType(tyError, prev, c) var isConcrete = true - + for i in 1 .. <m.call.len: let typ = m.call[i].typ.skipTypes({tyTypeDesc}) if containsGenericType(typ): isConcrete = false @@ -878,6 +888,7 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = allowMetaTypes = not isConcrete) if not isConcrete and result.kind == tyGenericInst: result.lastSon.shouldHaveMeta + proc semTypeExpr(c: PContext, n: PNode): PType = var n = semExprWithType(c, n, {efDetermineType}) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 029bf6c8c6..fb7be3a385 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -263,25 +263,24 @@ proc propagateFieldFlags(t: PType, n: PNode) = of nkSym: propagateToOwner(t, n.sym.typ) of nkRecList, nkRecCase, nkOfBranch, nkElse: - for son in n.sons: - propagateFieldFlags(t, son) + if n.sons != nil: + for son in n.sons: + propagateFieldFlags(t, son) else: discard proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = result = t if t == nil: return - if t.kind == tyStatic and t.sym != nil and t.sym.kind == skGenericParam: - let s = lookupTypeVar(cl, t) - return if s != nil: s else: t + #if t.kind == tyStatic and t.sym != nil and t.sym.kind == skGenericParam: + # let s = lookupTypeVar(cl, t) + # return if s != nil: s else: t + + if t.kind in {tyStatic, tyGenericParam} + tyTypeClasses: + let lookup = PType(idTableGet(cl.typeMap, t)) + if lookup != nil: return lookup case t.kind - of tyGenericParam, tyTypeClasses: - let lookup = lookupTypeVar(cl, t) - if lookup != nil: - result = lookup - if result.kind == tyGenericInvokation: - result = handleGenericInvokation(cl, result) of tyGenericInvokation: result = handleGenericInvokation(cl, t) of tyGenericBody: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 13546eae2f..9a00a308b1 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -649,8 +649,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = if a.kind == tyEmpty: result = isEqual of tyGenericInst: - if a.kind == tyGenericInst: - if a.base != f.base: return isNone + if a.kind == tyGenericInst and a.base == f.base: for i in 1 .. f.sonsLen-2: result = typeRel(c, f.sons[i], a.sons[i]) if result == isNone: return diff --git a/compiler/types.nim b/compiler/types.nim index a24adb17e3..1bf18fbe29 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1227,8 +1227,8 @@ proc getSize(typ: PType): BiggestInt = if result < 0: internalError("getSize: " & $typ.kind) proc containsGenericTypeIter(t: PType, closure: PObject): bool = - result = t.kind in GenericTypes + tyTypeClasses + - {tyTypeDesc, tyStatic} + result = t.kind in GenericTypes + tyTypeClasses + {tyTypeDesc} or + t.kind == tyStatic and t.n == nil proc containsGenericType*(t: PType): bool = result = iterOverType(t, containsGenericTypeIter, nil) diff --git a/tests/reject/teffects1.nim b/tests/reject/teffects1.nim index 340acc6eac..b72e8b00c0 100644 --- a/tests/reject/teffects1.nim +++ b/tests/reject/teffects1.nim @@ -1,5 +1,5 @@ discard """ - line: 1847 + line: 1855 file: "system.nim" errormsg: "can raise an unlisted exception: ref EIO" """ From 8f3d5a25a692f1630bb24fbaf4951e68c9c99e28 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Tue, 31 Dec 2013 03:58:31 +0200 Subject: [PATCH 184/326] Templates will pick the candidate in the nearest scope when symbols are mixed-in --- compiler/ast.nim | 4 ++++ compiler/semexprs.nim | 2 +- compiler/semtempl.nim | 1 + compiler/semtypinst.nim | 15 ++++++++------- compiler/sigmatch.nim | 23 ++++++++++++++++------- compiler/types.nim | 3 ++- 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 8699d17151..e25f10a669 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1430,6 +1430,10 @@ proc skipGenericOwner*(s: PSym): PSym = result = if sfFromGeneric in s.flags: s.owner.owner else: s.owner +proc originatingModule*(s: PSym): PSym = + result = s.owner + while result.kind != skModule: result = result.owner + proc isRoutine*(s: PSym): bool {.inline.} = result = s.kind in {skProc, skTemplate, skMacro, skIterator, skMethod, skConverter} diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 14f611c5cd..00c0e0f78b 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1164,7 +1164,7 @@ proc semAsgn(c: PContext, n: PNode): PNode = if lhsIsResult: {efAllowDestructor} else: {}) if lhsIsResult: n.typ = enforceVoidContext - if lhs.sym.typ.isMetaType: + if lhs.sym.typ.isMetaType and lhs.sym.typ.kind != tyTypeDesc: if cmpTypes(c, lhs.typ, rhs.typ) == isGeneric: internalAssert c.p.resultSym != nil lhs.typ = rhs.typ diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index da38f8625a..569d92d33f 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -421,6 +421,7 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = else: s = semIdentVis(c, skTemplate, n.sons[0], {}) # check parameter list: + s.scope = c.currentScope pushOwner(s) openScope(c) n.sons[namePos] = newSymNode(s, n.sons[namePos].info) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index fb7be3a385..ec56f75e41 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -162,8 +162,9 @@ proc lookupTypeVar(cl: TReplTypeVars, t: PType): PType = elif result.kind == tyGenericParam and not cl.allowMetaTypes: internalError(cl.info, "substitution with generic parameter") -proc instCopyType(t: PType): PType = - result = copyType(t, t.owner, false) +proc instCopyType(cl: var TReplTypeVars, t: PType): PType = + # XXX: relying on allowMetaTypes is a kludge + result = copyType(t, t.owner, cl.allowMetaTypes) result.flags.incl tfFromGeneric result.flags.excl tfInstClearedFlags @@ -184,7 +185,7 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = if x.kind == tyGenericParam: x = lookupTypeVar(cl, x) if x != nil: - if header == nil: header = instCopyType(t) + if header == nil: header = instCopyType(cl, t) header.sons[i] = x propagateToOwner(header, x) @@ -193,7 +194,7 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = result = searchInstTypes(header) if result != nil: return else: - header = instCopyType(t) + header = instCopyType(cl, t) result = newType(tyGenericInst, t.sons[0].owner) # be careful not to propagate unnecessary flags here (don't use rawAddSon) @@ -279,7 +280,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = if t.kind in {tyStatic, tyGenericParam} + tyTypeClasses: let lookup = PType(idTableGet(cl.typeMap, t)) if lookup != nil: return lookup - + case t.kind of tyGenericInvokation: result = handleGenericInvokation(cl, t) @@ -295,7 +296,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = result = lookup if tfUnresolved in t.flags: result = result.base of tyGenericInst: - result = instCopyType(t) + result = instCopyType(cl, t) for i in 1 .. <result.sonsLen: result.sons[i] = ReplaceTypeVarsT(cl, result.sons[i]) propagateToOwner(result, result.lastSon) @@ -308,7 +309,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = t.sons[0] = makeRangeType(cl.c, 0, value.intVal - 1, value.info) if containsGenericType(t): - result = instCopyType(t) + result = instCopyType(cl, t) result.size = -1 # needs to be recomputed for i in countup(0, sonsLen(result) - 1): diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 9a00a308b1..96975c9178 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -31,7 +31,8 @@ type state*: TCandidateState callee*: PType # may not be nil! calleeSym*: PSym # may be nil - calleeScope: int # may be -1 for unknown scope + calleeScope*: int # scope depth: + # is this a top-level symbol or a nested proc? call*: PNode # modified call bindings*: TIdTable # maps types to types baseTypeMatch: bool # needed for conversions from T to openarray[T] @@ -86,7 +87,15 @@ proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PSym, binding: PNode, calleeScope = -1) = initCandidateAux(ctx, c, callee.typ) c.calleeSym = callee - c.calleeScope = calleeScope + if callee.kind in skProcKinds and calleeScope == -1: + if callee.originatingModule == ctx.module: + let rootSym = if sfFromGeneric notin callee.flags: callee + else: callee.owner + c.calleeScope = rootSym.scope.depthLevel + else: + c.calleeScope = 1 + else: + c.calleeScope = calleeScope initIdTable(c.bindings) c.errors = nil if binding != nil and callee.kind in routineKinds: @@ -166,9 +175,8 @@ proc cmpCandidates*(a, b: TCandidate): int = if result != 0: return result = a.convMatches - b.convMatches if result != 0: return - if (a.calleeScope != -1) and (b.calleeScope != -1): - result = a.calleeScope - b.calleeScope - if result != 0: return + result = a.calleeScope - b.calleeScope + if result != 0: return # the other way round because of other semantics: result = b.inheritancePenalty - a.inheritancePenalty if result != 0: return @@ -566,8 +574,9 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = if a.kind == tyTuple: result = recordRel(c, f, a) of tyObject: if a.kind == tyObject: - if sameObjectTypes(f, a): result = isEqual - elif tfHasMeta in f.flags: result = recordRel(c, f, a) + if sameObjectTypes(f, a): + result = isEqual + # elif tfHasMeta in f.flags: result = recordRel(c, f, a) else: var depth = isObjectSubtype(a, f) if depth > 0: diff --git a/compiler/types.nim b/compiler/types.nim index 1bf18fbe29..68e816c13c 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -874,7 +874,8 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr, tyArray, tyProc, tyConst, tyMutable, tyVarargs, tyIter, tyOrdinal, tyTypeClasses: - cycleCheck() + cycleCheck() + if a.kind == tyTypeClass and a.n != nil: return a.n == b.n result = sameChildrenAux(a, b, c) and sameFlags(a, b) if result and a.kind == tyProc: result = ((IgnoreCC in c.flags) or a.callConv == b.callConv) and From ed3ab6539dde803eef0c91d5b8edd58408ba86d8 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Tue, 31 Dec 2013 04:13:51 +0200 Subject: [PATCH 185/326] close #517 --- tests/compile/tcompositetypeclasses.nim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/compile/tcompositetypeclasses.nim b/tests/compile/tcompositetypeclasses.nim index 4ba92fed1a..3e6f0d6ae1 100644 --- a/tests/compile/tcompositetypeclasses.nim +++ b/tests/compile/tcompositetypeclasses.nim @@ -33,3 +33,13 @@ accept baz(vbaz) reject baz(vnotbaz) reject bar(vfoo) +# https://github.com/Araq/Nimrod/issues/517 +type + TVecT*[T] = array[0..1, T]|array[0..2, T]|array[0..3, T] + TVec2* = array[0..1, float32] + +proc f[T](a: TVecT[T], b: TVecT[T]): T = discard + +var x: float = f([0.0'f32, 0.0'f32], [0.0'f32, 0.0'f32]) +var y = f(TVec2([0.0'f32, 0.0'f32]), TVec2([0.0'f32, 0.0'f32])) + From 8e0941576fc30643a4cdcb532e180d0ca973ed85 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Tue, 31 Dec 2013 12:39:43 +0200 Subject: [PATCH 186/326] clean-up some obsolete code; close #602 --- compiler/options.nim | 2 - compiler/seminst.nim | 154 ++---------------------- compiler/semstmts.nim | 16 +-- compiler/semtypes.nim | 22 ++-- compiler/sigmatch.nim | 70 +++++------ tests/compile/tcompositetypeclasses.nim | 14 +++ 6 files changed, 73 insertions(+), 205 deletions(-) diff --git a/compiler/options.nim b/compiler/options.nim index f184deb698..9b0cbf0c9c 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -158,8 +158,6 @@ var const oKeepVariableNames* = true -const oUseLateInstantiation* = false - proc mainCommandArg*: string = ## This is intended for commands like check or parse ## which will work on the main project file unless diff --git a/compiler/seminst.nim b/compiler/seminst.nim index cec3567e27..370d59b107 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -131,157 +131,20 @@ proc sideEffectsCheck(c: PContext, s: PSym) = s.ast.sons[genericParamsPos].kind == nkEmpty: c.threadEntries.add(s) -proc lateInstantiateGeneric(c: PContext, invocation: PType, info: TLineInfo): PType = - internalAssert invocation.kind == tyGenericInvokation - - let cacheHit = searchInstTypes(invocation) - if cacheHit != nil: - result = cacheHit - else: - let s = invocation.sons[0].sym - let oldScope = c.currentScope - c.currentScope = s.typScope - openScope(c) - pushInfoContext(info) - for i in 0 .. <s.typ.n.sons.len: - let genericParam = s.typ.n[i].sym - let symKind = if genericParam.typ.kind == tyStatic: skConst - else: skType - - var boundSym = newSym(symKind, s.typ.n[i].sym.name, s, info) - boundSym.typ = invocation.sons[i+1].skipTypes({tyStatic}) - boundSym.ast = invocation.sons[i+1].n - addDecl(c, boundSym) - # XXX: copyTree would have been unnecessary here if semTypeNode - # didn't modify its input parameters. Currently, it does modify - # at least the record lists of the passed object and tuple types - var instantiated = semTypeNode(c, copyTree(s.ast[2]), nil) - popInfoContext() - closeScope(c) - c.currentScope = oldScope - if instantiated != nil: - result = invocation - result.kind = tyGenericInst - result.sons.add instantiated - cacheTypeInst result - proc instGenericContainer(c: PContext, info: TLineInfo, header: PType, allowMetaTypes = false): PType = - when oUseLateInstantiation: - lateInstantiateGeneric(c, header, info) - else: - var cl: TReplTypeVars - initIdTable(cl.symMap) - initIdTable(cl.typeMap) - initIdTable(cl.localCache) - cl.info = info - cl.c = c - cl.allowMetaTypes = allowMetaTypes - result = replaceTypeVarsT(cl, header) + var cl: TReplTypeVars + initIdTable(cl.symMap) + initIdTable(cl.typeMap) + initIdTable(cl.localCache) + cl.info = info + cl.c = c + cl.allowMetaTypes = allowMetaTypes + result = replaceTypeVarsT(cl, header) proc instGenericContainer(c: PContext, n: PNode, header: PType): PType = result = instGenericContainer(c, n.info, header) -proc fixupProcType(c: PContext, genericType: PType, - inst: TInstantiation): PType = - # XXX: This is starting to look suspiciously like ReplaceTypeVarsT - # there are few apparent differences, but maybe the code could be - # moved over. - # * the code here uses the new genericSym.position property when - # doing lookups. - # * the handling of tyTypeDesc seems suspicious in ReplaceTypeVarsT - # typedesc params were previously handled in the second pass of - # semParamList - # * void (nkEmpty) params doesn't seem to be stripped in ReplaceTypeVarsT - result = genericType - if result == nil: return - - case genericType.kind - of tyGenericParam, tyTypeClasses: - result = inst.concreteTypes[genericType.sym.position] - - of tyTypeDesc: - result = inst.concreteTypes[genericType.sym.position] - if tfUnresolved in genericType.flags: - result = result.sons[0] - - of tyStatic: - result = inst.concreteTypes[genericType.sym.position] - - of tyGenericInst: - result = fixupProcType(c, result.lastSon, inst) - - of tyObject: - var recList = genericType.n - for i in 0 .. <recList.sonsLen: - let field = recList[i].sym - let changed = fixupProcType(c, field.typ, inst) - if field.typ != changed: - if result == genericType: - result = copyType(genericType, genericType.owner, false) - result.n = copyTree(recList) - result.n.sons[i].sym = copySym(recList[i].sym, true) - result.n.sons[i].typ = changed - result.n.sons[i].sym.typ = changed - - of tyOpenArray, tyArray, tySet, tySequence, tyTuple, tyProc, - tyPtr, tyVar, tyRef, tyOrdinal, tyRange, tyVarargs: - if genericType.sons == nil: return - var head = 0 - for i in 0 .. <genericType.sons.len: - let origType = genericType.sons[i] - var changed = fixupProcType(c, origType, inst) - if changed != genericType.sons[i]: - var changed = changed.skipIntLit - if result == genericType: - # the first detected change initializes the result - result = copyType(genericType, genericType.owner, false) - if genericType.n != nil: - result.n = copyTree(genericType.n) - - # XXX: doh, we have to treat seq and arrays as special case - # because sometimes the `@` magic will be applied to an empty - # sequence having the type tySequence(tyEmpty) - if changed.kind == tyEmpty and - genericType.kind notin {tyArray, tySequence}: - if genericType.kind == tyProc and i == 0: - # return types of procs are overwritten with nil - changed = nil - else: - # otherwise, `empty` is just erased from the signature - result.sons[i..i] = [] - if result.n != nil: result.n.sons[i..i] = [] - continue - - result.sons[head] = changed - result.size = 0 - - if result.n != nil: - if result.n.kind == nkRecList: - for son in result.n.sons: - if son.typ == origType: - son.typ = changed - son.sym = copySym(son.sym, true) - son.sym.typ = changed - if result.n.kind == nkFormalParams: - if i != 0: - let origParam = result.n.sons[head].sym - var param = copySym(origParam) - param.typ = changed - param.ast = origParam.ast - result.n.sons[head] = newSymNode(param) - - # won't be advanced on empty (void) nodes - inc head - - of tyGenericInvokation: - result = newTypeWithSons(c, tyGenericInvokation, genericType.sons) - for i in 1 .. <genericType.sons.len: - result.sons[i] = fixupProcType(c, result.sons[i], inst) - result = instGenericContainer(c, getInfoContext(-1), result) - - else: discard - proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, info: TLineInfo): PSym = # no need to instantiate generic templates/macros: @@ -311,7 +174,6 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, var entry = TInstantiation.new entry.sym = result instantiateGenericParamList(c, n.sons[genericParamsPos], pt, entry[]) - # let t1 = fixupProcType(c, fn.typ, entry[]) result.typ = generateTypeInstance(c, pt, info, fn.typ) n.sons[genericParamsPos] = ast.emptyNode var oldPrc = genericCacheGet(fn, entry[]) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 3cc338d8a8..80327e7ebf 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -740,16 +740,12 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) = # like: mydata.seq rawAddSon(s.typ, newTypeS(tyEmpty, c)) s.ast = a - when oUseLateInstantiation: - var body: PType = nil - s.typScope = c.currentScope.parent - else: - inc c.inGenericContext - var body = semTypeNode(c, a.sons[2], nil) - dec c.inGenericContext - if body != nil: - body.sym = s - body.size = -1 # could not be computed properly + inc c.inGenericContext + var body = semTypeNode(c, a.sons[2], nil) + dec c.inGenericContext + if body != nil: + body.sym = s + body.size = -1 # could not be computed properly s.typ.sons[sonsLen(s.typ) - 1] = body popOwner() closeScope(c) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index fb05469615..3ce504d2cb 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -600,7 +600,8 @@ template shouldHaveMeta(t) = proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, paramType: PType, paramName: string, info: TLineInfo, anon = false): PType = - + if paramType == nil: return # (e.g. proc return type) + proc addImplicitGenericImpl(typeClass: PType, typId: PIdent): PType = let finalTypId = if typId != nil: typId else: getIdent(paramName & ":type") @@ -621,7 +622,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, s.position = genericParams.len genericParams.addSon(newSymNode(s)) result = typeClass - + # XXX: There are codegen errors if this is turned into a nested proc template liftingWalk(typ: PType, anonFlag = false): expr = liftParamType(c, procKind, genericParams, typ, paramName, info, anonFlag) @@ -655,14 +656,15 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, # disable the bindOnce behavior for the type class result = liftingWalk(paramType.sons[0], true) - of tySequence, tySet, tyArray, tyOpenArray: + of tySequence, tySet, tyArray, tyOpenArray, + tyVar, tyPtr, tyRef, tyProc: # XXX: this is a bit strange, but proc(s: seq) # produces tySequence(tyGenericParam, null). # This also seems to be true when creating aliases # like: type myseq = distinct seq. # Maybe there is another better place to associate # the seq type class with the seq identifier. - if paramType.lastSon == nil: + if paramType.kind == tySequence and paramType.lastSon == nil: let typ = c.newTypeWithSons(tyBuiltInTypeClass, @[newTypeS(paramType.kind, c)]) result = addImplicitGeneric(typ) @@ -720,7 +722,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, result = liftingWalk(paramType.lastSon) else: result = addImplicitGeneric(newTypeS(tyAnything, c)) - + else: nil # result = liftingWalk(paramType) @@ -881,14 +883,8 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = localError(n.info, errCannotInstantiateX, s.name.s) result = newOrPrevType(tyError, prev, c) else: - when oUseLateInstantiation: - result = lateInstantiateGeneric(c, result, n.info) - else: - result = instGenericContainer(c, n.info, result, - allowMetaTypes = not isConcrete) - if not isConcrete and result.kind == tyGenericInst: - result.lastSon.shouldHaveMeta - + result = instGenericContainer(c, n.info, result, + allowMetaTypes = false) proc semTypeExpr(c: PContext, n: PNode): PType = var n = semExprWithType(c, n, {efDetermineType}) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 96975c9178..2e314d115e 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -432,7 +432,12 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = template bindingRet(res) = when res == isGeneric: put(c.bindings, f, aOrig) return res - + + template considerPreviousT(body: stmt) {.immediate.} = + var prev = PType(idTableGet(c.bindings, f)) + if prev == nil: body + else: return typeRel(c, prev, a) + case a.kind of tyOr: # seq[int|string] vs seq[number] @@ -658,19 +663,22 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = if a.kind == tyEmpty: result = isEqual of tyGenericInst: - if a.kind == tyGenericInst and a.base == f.base: - for i in 1 .. f.sonsLen-2: - result = typeRel(c, f.sons[i], a.sons[i]) + let roota = a.skipGenericAlias + let rootf = f.skipGenericAlias + if a.kind == tyGenericInst and roota.base == rootf.base: + for i in 1 .. rootf.sonsLen-2: + result = typeRel(c, rootf.sons[i], roota.sons[i]) if result == isNone: return result = isGeneric else: result = typeRel(c, lastSon(f), a) of tyGenericBody: - if a.kind == tyGenericInst and a.sons[0] == f: - return isGeneric - let ff = lastSon(f) - if ff != nil: result = typeRel(c, ff, a) + considerPreviousT: + if a.kind == tyGenericInst and a.sons[0] == f: + bindingRet isGeneric + let ff = lastSon(f) + if ff != nil: result = typeRel(c, ff, a) of tyGenericInvokation: var x = a.skipGenericAlias @@ -697,39 +705,38 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = put(c.bindings, f.sons[i], x) of tyAnd: - for branch in f.sons: - if typeRel(c, branch, aOrig) == isNone: - return isNone + considerPreviousT: + for branch in f.sons: + if typeRel(c, branch, aOrig) == isNone: + return isNone - bindingRet isGeneric + bindingRet isGeneric of tyOr: - for branch in f.sons: - if typeRel(c, branch, aOrig) != isNone: - bindingRet isGeneric - - return isNone + considerPreviousT: + for branch in f.sons: + if typeRel(c, branch, aOrig) != isNone: + bindingRet isGeneric + + return isNone of tyNot: - for branch in f.sons: - if typeRel(c, branch, aOrig) != isNone: - return isNone - - bindingRet isGeneric + considerPreviousT: + for branch in f.sons: + if typeRel(c, branch, aOrig) != isNone: + return isNone + + bindingRet isGeneric of tyAnything: - var prev = PType(idTableGet(c.bindings, f)) - if prev == nil: + considerPreviousT: var concrete = concreteType(c, a) if concrete != nil and doBind: put(c.bindings, f, concrete) return isGeneric - else: - return typeRel(c, prev, a) of tyBuiltInTypeClass: - var prev = PType(idTableGet(c.bindings, f)) - if prev == nil: + considerPreviousT: let targetKind = f.sons[0].kind if targetKind == a.skipTypes({tyRange, tyGenericInst}).kind or (targetKind in {tyProc, tyPointer} and a.kind == tyNil): @@ -737,19 +744,14 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = return isGeneric else: return isNone - else: - result = typeRel(c, prev, a) of tyCompositeTypeClass: - var prev = PType(idTableGet(c.bindings, f)) - if prev == nil: + considerPreviousT: if typeRel(c, f.sons[1], a) != isNone: put(c.bindings, f, a) return isGeneric else: return isNone - else: - result = typeRel(c, prev, a) of tyGenericParam, tyTypeClass: var x = PType(idTableGet(c.bindings, f)) diff --git a/tests/compile/tcompositetypeclasses.nim b/tests/compile/tcompositetypeclasses.nim index 3e6f0d6ae1..a2db73769c 100644 --- a/tests/compile/tcompositetypeclasses.nim +++ b/tests/compile/tcompositetypeclasses.nim @@ -43,3 +43,17 @@ proc f[T](a: TVecT[T], b: TVecT[T]): T = discard var x: float = f([0.0'f32, 0.0'f32], [0.0'f32, 0.0'f32]) var y = f(TVec2([0.0'f32, 0.0'f32]), TVec2([0.0'f32, 0.0'f32])) +# https://github.com/Araq/Nimrod/issues/602 +type + TTest = object + TTest2* = object + TUnion = TTest | TTest2 + +proc f(src: ptr TUnion, dst: ptr TUnion) = + echo("asd") + +var tx: TTest +var ty: TTest2 + +accept f(addr tx, addr tx) +reject f(addr tx, addr ty) From e0fc07df89a2bc9a9472b08c4003be7b2ff6498b Mon Sep 17 00:00:00 2001 From: Erik O'Leary <erik.m.oleary@gmail.com> Date: Tue, 31 Dec 2013 19:37:20 -0600 Subject: [PATCH 187/326] Added docgen documentation --- doc/docgen.txt | 182 +++++++++++++++++++++ doc/docgen_samples/sample.html | 282 ++++++++++++++++++++++++++++++++ doc/docgen_samples/sample2.html | 282 ++++++++++++++++++++++++++++++++ 3 files changed, 746 insertions(+) create mode 100644 doc/docgen.txt create mode 100644 doc/docgen_samples/sample.html create mode 100644 doc/docgen_samples/sample2.html diff --git a/doc/docgen.txt b/doc/docgen.txt new file mode 100644 index 0000000000..998cde8391 --- /dev/null +++ b/doc/docgen.txt @@ -0,0 +1,182 @@ +=================================== + Nimrod DocGen Tools Guide +=================================== + +:Author: Erik O'Leary +:Version: |nimrodversion| + +.. contents:: + + +Introduction +============ + +This document describes the documentation generation tools built into the *Nimrod compiler*, +which can generate HTML and JSON output from input .nim files and projects, as well as HTML +and LaTex from input RST (reStructuredText) files. The output documentation will include +module dependencies (``import``), any top-level documentation comments (##), and exported +symbols (*), including procedures, types, and variables. + + +Documentation Comments +---------------------- +Any comments which are preceeded by a double-hash (##), are interpreted as documentation. +Comments are parsed as RST +(see `reference <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_), providing +Nimrod module authors the ability to easily generate richly formatted documentation with only +their well-documented code. + +Example: + +.. code-block:: nimrod + type TPerson* = object + ## This type contains a description of a person + name: string + age: int + +Outputs:: + TPerson* = object + name: string + age: int + +This type contains a description of a person + +Field documentation comments can be added to fields like so: + +.. code-block:: nimrod + var numValues: int ## \ + ## `numValues` stores the number of values + +Note that without the `*` following the name of the type, the documentation for this type +would not be generated. Documentation will only be generated for *exported* types/procedures/etc. + + +Nimrod file input +----------------- + +The following examples will generate documentation for the below contrived +*Nimrod* module, aptly named 'sample.nim' + +sample.nim: + +.. code-block:: nimrod + ## This module is a sample. + + import strutils + + proc helloWorld*(times: int) = + ## Takes an integer and outputs + ## as many "hello world!"s + + for i in 0 .. times-1: + echo "hello world!" + + helloWorld(5) + + +Document Types +============== + + +HTML +---- +Generation of HTML documents is done via both the ``doc`` and ``doc2`` commands. These +command take either a single .nim file, outputting a single .html file with the same base filename, +or multiple .nim files, outputting multiple .html files and, optionally, +an index file. + +The ``doc`` command:: + nimrod doc sample + +Partial Output:: + ... + proc helloWorld*(times: int) + ... + +Output can be viewed in full here `sample.html <docgen_samples/sample.html>`_. The next command, +called ``doc2``, is very similar to the ``doc`` command, but will be run after the +compiler performs semantic checking on the input nimrod module(s), which allows it to process macros. + +The ``doc2`` command:: + nimrod doc2 sample + +Partial Output:: + ... + proc helloWorld(times: int) {.raises: [], tags: [].} + ... + +The full output can be seen here `sample2.html <docgen_samples/sample2.html>`_. As you can see, the tool has +extracted additional information provided to it by the compiler beyond what the ``doc`` +command provides, such as pragmas attached implicitly by the compiler. This type of information +is not available from looking at the AST (Abstract Syntax Tree) prior to semantic checking, +as the ``doc`` command does. + + +JSON +---- +Generation of JSON documents is done via the ``jsondoc`` command. This command takes +in a .nim file, and outputs a .json file with the same base filename. Note that this +tool is built off of the ``doc`` command, and therefore is performed before semantic +checking. + +The ``jsondoc`` command:: + nimrod jsondoc sample + +Output:: + [ + { + "comment": "This module is a sample." + }, + { + "name": "helloWorld", + "type": "skProc", + "description": "Takes an integer and outputs as many &quot;hello world!&quot;s", + "code": "proc helloWorld*(times: int)" + } + ] + + +Related Options +=============== + +``--project`` switch +:: + nimrod doc2 --project sample + +This will recursively generate documentation of all nimrod modules imported into the input module, +including system modules. Be careful with this command, as it may end up sprinkling html files all +over your filesystem! + + +``--index`` switch +:: + nimrod doc2 --index:on sample + +This will generate an index of all the exported symbols in the input Nimrod module, and put it into +a neighboring file with the extension of `.idx`. + + +Other Input Formats +=================== + +The *Nimrod compiler* also has support for RST (reStructuredText) files with the ``rst2html`` and ``rst2tex`` +commands. Documents like this one are initially written in a dialect of RST which adds support for nimrod +sourcecode highlighting with the ``.. code-block:: nimrod`` prefix. ``code-block`` also supports highlighting +of C++ and some other c-like languages. + +Usage:: + nimrod rst2html docgen.txt + +Output:: + You're reading it! + +The input can be viewed here `docgen.txt <docgen.txt>`_. The ``rst2tex`` command is invoked identically to +``rst2html``, but outputs a .tex file instead of .html. + + +Additional Resources +========= + +`Nimrod Compiler User Guide <nimrodc.html#command-line-switches>`_ + +`RST Quick Reference <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_ diff --git a/doc/docgen_samples/sample.html b/doc/docgen_samples/sample.html new file mode 100644 index 0000000000..4efa40905e --- /dev/null +++ b/doc/docgen_samples/sample.html @@ -0,0 +1,282 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- This file is generated by Nimrod. --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Module sample</title> +<style type="text/css"> + +span.DecNumber {color: blue} +span.BinNumber {color: blue} +span.HexNumber {color: blue} +span.OctNumber {color: blue} +span.FloatNumber {color: blue} +span.Identifier {color: black} +span.Keyword {font-weight: bold} +span.StringLit {color: blue} +span.LongStringLit {color: blue} +span.CharLit {color: blue} +span.EscapeSequence {color: black} +span.Operator {color: black} +span.Punctation {color: black} +span.Comment, span.LongComment {font-style:italic; color: green} +span.RegularExpression {color: DarkViolet} +span.TagStart {color: DarkViolet} +span.TagEnd {color: DarkViolet} +span.Key {color: blue} +span.Value {color: black} +span.RawData {color: blue} +span.Assembler {color: blue} +span.Preprocessor {color: DarkViolet} +span.Directive {color: DarkViolet} +span.Command, span.Rule, span.Hyperlink, span.Label, span.Reference, +span.Other {color: black} + +div.navigation { + -moz-border-radius: 5px 5px 5px 5px; + float: left; + width: 30%; + margin: 0; padding: 0; + border: 3px outset #7F7F7F; + background-color: #7F7F7F; +} + +div.navigation ul { + list-style-type: none; + padding-left: 1em; +} +div.navigation ul li a, div.navigation ul li a:visited { + font-weight: bold; + color: #FFFFFF; + text-decoration: none; +} +div.navigation ul li a:hover { + font-weight: bold; + text-decoration: none; + color: gold; +} + +div.content { + margin-left: 30%; + padding: 0 1em; + border-left: 4em; +} + +dl.item dd, dl.item dd p { + margin-top:3px; +} +dl.item dd pre { + margin-left: 15pt; + border: 0px; +} +dl.item dt, dl.item dt pre { + margin: 20pt 0 0 5pt; +} + +pre, span.tok { + background-color: #F9F9F9; + border-color: #C4C4C4; + border-style: solid; + border-width: 1px 1px 1px 2px; + color: black; + line-spacing: 110%; + padding: 2px; +} + +span.red { + color: #A80000; +} + +hr {background-color:#9D9D9D; border:0 none; color:#9D9D9D; height:1px; width:100%;} + +/* +:Author: David Goodger +:Contact: goodger@python.org +:Date: Date: 2006-05-21 22:44:42 +0200 (Sun, 21 May 2006) +:Revision: Revision: 4564 +:Copyright: This stylesheet has been placed in the public domain. + +Default cascading style sheet for the HTML output of Docutils. + +See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to +customize this style sheet. +*/ +/* used to remove borders from tables and images */ +.borderless, table.borderless td, table.borderless th { border: 0 } + +table.borderless td, table.borderless th { + /* Override padding for "table.docutils td" with "! important". + The right padding separates the table cells. */ + padding: 0 0.5em 0 0 ! important } + +.first { margin-top: 0 ! important } +.last, .with-subtitle { margin-bottom: 0 ! important } +.hidden { display: none } +a.toc-backref { text-decoration: none ; color: black } +blockquote.epigraph { margin: 2em 5em ; } +dl.docutils dd { margin-bottom: 0.5em } +div.abstract { margin: 2em 5em } +div.abstract p.topic-title { font-weight: bold ; text-align: center } +div.admonition, div.attention, div.caution, div.danger, div.error, +div.hint, div.important, div.note, div.tip, div.warning { + margin: 2em ; border: medium outset ; padding: 1em } +div.admonition p.admonition-title, div.hint p.admonition-title, +div.important p.admonition-title, div.note p.admonition-title, +div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title { color: red ; font-weight: bold ; + font-family: sans-serif } + +/* Uncomment (and remove this text!) to get reduced vertical space in + compound paragraphs. +div.compound .compound-first, div.compound .compound-middle { + margin-bottom: 0.5em } + +div.compound .compound-last, div.compound .compound-middle { + margin-top: 0.5em } +*/ + +div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } +div.dedication p.topic-title { font-weight: bold ; font-style: normal } +div.figure { margin-left: 2em ; margin-right: 2em } +div.footer, div.header { clear: both; font-size: smaller } +div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } +div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; + margin-left: 1.5em } +div.sidebar { margin-left: 1em ; border: medium outset ; + padding: 1em ; background-color: #ffffee ; /*width: 40% ;*/ float: right ; + clear: right } + +div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } +div.system-messages { margin: 5em } +div.system-messages h1 { color: red } +div.system-message { border: medium outset ; padding: 1em } +div.system-message p.system-message-title { color: red ; font-weight: bold } +div.topic { margin: 2em;} +h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, +h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { + margin-top: 0.4em } +h1.title { text-align: center } +h2.subtitle { text-align: center } +/* hr.docutils { width: 75% } */ +img.align-left { clear: left } +img.align-right { clear: right } +ol.simple, ul.simple { margin-bottom: 1em } +ol.arabic { list-style: decimal } +ol.loweralpha { list-style: lower-alpha } +ol.upperalpha { list-style: upper-alpha } +ol.lowerroman { list-style: lower-roman } +ol.upperroman { list-style: upper-roman } +p.attribution { text-align: right ; margin-left: 50% } +p.caption { font-style: italic } +p.credits { font-style: italic ; font-size: smaller } +p.label { white-space: nowrap } +p.rubric { font-weight:bold;font-size:larger;color:maroon;text-align:center} +p.sidebar-title {font-family: sans-serif ;font-weight: bold ;font-size: larger } +p.sidebar-subtitle {font-family: sans-serif ; font-weight: bold } +p.topic-title { +font-weight: bold; +background-color: #6D6D6D; +border-bottom: 1px solid #000000; +border-top: 1px solid black; +color: white; +text-align: center; +margin: 0; +} +pre.address { margin-bottom: 0;margin-top:0;font-family:serif;font-size:100% } +pre.literal-block, pre.doctest-block {margin-left: 2em ;margin-right: 2em } +span.classifier {font-family: sans-serif;font-style: oblique } +span.classifier-delimiter {font-family: sans-serif;font-weight: bold } +span.interpreted {font-family: sans-serif } +span.option {white-space: nowrap } +span.pre {white-space: pre } +span.problematic {color: red } +span.section-subtitle { + /* font-size relative to parent (h1..h6 element) */ + font-size: 80% } + +table.citation { border-left: solid 1px gray; margin-left: 1px } +table.docinfo {margin: 2em 4em } +table.docutils {margin-top: 0.5em;margin-bottom: 0.5em; border: 0 solid #9d9d9d; border-collapse: collapse; } +table.footnote {border-left: solid 1px black;margin-left: 1px } + +table.docutils td, table.docutils th, +table.docinfo td, table.docinfo th {padding-left: 0.5em;padding-right: 0.5em; + vertical-align: top;} + +table.docutils td, table.docutils th { border-bottom:1px solid #9D9D9D; } +/* color: #4d4d4d} */ + +/* table.docutils td:hover, table.docinfo td:hover {color: #000000} */ + + +table.docutils th.field-name, table.docinfo th.docinfo-name { + font-weight: bold;text-align: left;white-space: nowrap;padding-left: 0 } + +table.docutils th +{ +color: black; +font-weight:normal; +background-color: #E3E3E3; +border-top: 1px solid #1d1d1d; +border-bottom: 1px solid #1d1d1d; +} + +h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, +h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {font-size: 100% } +ul.auto-toc { list-style-type: none } +/*a.reference { color: #E00000; font-weight:bold;} +a.reference:hover {color: #E00000;background-color: #ffff00;display: margin; + font-weight:bold;}*/ + +</style> + +</head> +<body> +<div class="document" id="documentId"> +<h1 class="title">Module sample</h1> +<div class="navigation" id="navigation"> +<ul class="simple"> +<li> + <a class="reference" href="#6" id="56">Imports</a> + <ul class="simple"> + + </ul> +</li> +<li> + <a class="reference" href="#12" id="62">Procs</a> + <ul class="simple"> + <li><a class="reference" href="#101"><wbr />hello<wbr />World</a></li> + + </ul> +</li> + +</ul> +</div> +<div class="content" id="content"> +This module is a sample. +<div class="section" id="6"> +<h1><a class="toc-backref" href="#56">Imports</a></h1> +<dl class="item"> +<a class="reference external" href="strutils.html">strutils</a> +</dl></div> +<div class="section" id="12"> +<h1><a class="toc-backref" href="#62">Procs</a></h1> +<dl class="item"> +<dt id="101"><pre><span class="Keyword">proc</span> <span class="Identifier">helloWorld</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">times</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span></pre></dt> +<dd> +Takes an integer and outputs as many &quot;hello world!&quot;s +</dd> + +</dl></div> + +</div> + +<small>Generated: 2013-12-21 11:45:42 UTC</small> +</div> +</body> +</html> diff --git a/doc/docgen_samples/sample2.html b/doc/docgen_samples/sample2.html new file mode 100644 index 0000000000..3ff5e27e54 --- /dev/null +++ b/doc/docgen_samples/sample2.html @@ -0,0 +1,282 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- This file is generated by Nimrod. --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Module sample</title> +<style type="text/css"> + +span.DecNumber {color: blue} +span.BinNumber {color: blue} +span.HexNumber {color: blue} +span.OctNumber {color: blue} +span.FloatNumber {color: blue} +span.Identifier {color: black} +span.Keyword {font-weight: bold} +span.StringLit {color: blue} +span.LongStringLit {color: blue} +span.CharLit {color: blue} +span.EscapeSequence {color: black} +span.Operator {color: black} +span.Punctation {color: black} +span.Comment, span.LongComment {font-style:italic; color: green} +span.RegularExpression {color: DarkViolet} +span.TagStart {color: DarkViolet} +span.TagEnd {color: DarkViolet} +span.Key {color: blue} +span.Value {color: black} +span.RawData {color: blue} +span.Assembler {color: blue} +span.Preprocessor {color: DarkViolet} +span.Directive {color: DarkViolet} +span.Command, span.Rule, span.Hyperlink, span.Label, span.Reference, +span.Other {color: black} + +div.navigation { + -moz-border-radius: 5px 5px 5px 5px; + float: left; + width: 30%; + margin: 0; padding: 0; + border: 3px outset #7F7F7F; + background-color: #7F7F7F; +} + +div.navigation ul { + list-style-type: none; + padding-left: 1em; +} +div.navigation ul li a, div.navigation ul li a:visited { + font-weight: bold; + color: #FFFFFF; + text-decoration: none; +} +div.navigation ul li a:hover { + font-weight: bold; + text-decoration: none; + color: gold; +} + +div.content { + margin-left: 30%; + padding: 0 1em; + border-left: 4em; +} + +dl.item dd, dl.item dd p { + margin-top:3px; +} +dl.item dd pre { + margin-left: 15pt; + border: 0px; +} +dl.item dt, dl.item dt pre { + margin: 20pt 0 0 5pt; +} + +pre, span.tok { + background-color: #F9F9F9; + border-color: #C4C4C4; + border-style: solid; + border-width: 1px 1px 1px 2px; + color: black; + line-spacing: 110%; + padding: 2px; +} + +span.red { + color: #A80000; +} + +hr {background-color:#9D9D9D; border:0 none; color:#9D9D9D; height:1px; width:100%;} + +/* +:Author: David Goodger +:Contact: goodger@python.org +:Date: Date: 2006-05-21 22:44:42 +0200 (Sun, 21 May 2006) +:Revision: Revision: 4564 +:Copyright: This stylesheet has been placed in the public domain. + +Default cascading style sheet for the HTML output of Docutils. + +See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to +customize this style sheet. +*/ +/* used to remove borders from tables and images */ +.borderless, table.borderless td, table.borderless th { border: 0 } + +table.borderless td, table.borderless th { + /* Override padding for "table.docutils td" with "! important". + The right padding separates the table cells. */ + padding: 0 0.5em 0 0 ! important } + +.first { margin-top: 0 ! important } +.last, .with-subtitle { margin-bottom: 0 ! important } +.hidden { display: none } +a.toc-backref { text-decoration: none ; color: black } +blockquote.epigraph { margin: 2em 5em ; } +dl.docutils dd { margin-bottom: 0.5em } +div.abstract { margin: 2em 5em } +div.abstract p.topic-title { font-weight: bold ; text-align: center } +div.admonition, div.attention, div.caution, div.danger, div.error, +div.hint, div.important, div.note, div.tip, div.warning { + margin: 2em ; border: medium outset ; padding: 1em } +div.admonition p.admonition-title, div.hint p.admonition-title, +div.important p.admonition-title, div.note p.admonition-title, +div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title { color: red ; font-weight: bold ; + font-family: sans-serif } + +/* Uncomment (and remove this text!) to get reduced vertical space in + compound paragraphs. +div.compound .compound-first, div.compound .compound-middle { + margin-bottom: 0.5em } + +div.compound .compound-last, div.compound .compound-middle { + margin-top: 0.5em } +*/ + +div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } +div.dedication p.topic-title { font-weight: bold ; font-style: normal } +div.figure { margin-left: 2em ; margin-right: 2em } +div.footer, div.header { clear: both; font-size: smaller } +div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } +div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; + margin-left: 1.5em } +div.sidebar { margin-left: 1em ; border: medium outset ; + padding: 1em ; background-color: #ffffee ; /*width: 40% ;*/ float: right ; + clear: right } + +div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } +div.system-messages { margin: 5em } +div.system-messages h1 { color: red } +div.system-message { border: medium outset ; padding: 1em } +div.system-message p.system-message-title { color: red ; font-weight: bold } +div.topic { margin: 2em;} +h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, +h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { + margin-top: 0.4em } +h1.title { text-align: center } +h2.subtitle { text-align: center } +/* hr.docutils { width: 75% } */ +img.align-left { clear: left } +img.align-right { clear: right } +ol.simple, ul.simple { margin-bottom: 1em } +ol.arabic { list-style: decimal } +ol.loweralpha { list-style: lower-alpha } +ol.upperalpha { list-style: upper-alpha } +ol.lowerroman { list-style: lower-roman } +ol.upperroman { list-style: upper-roman } +p.attribution { text-align: right ; margin-left: 50% } +p.caption { font-style: italic } +p.credits { font-style: italic ; font-size: smaller } +p.label { white-space: nowrap } +p.rubric { font-weight:bold;font-size:larger;color:maroon;text-align:center} +p.sidebar-title {font-family: sans-serif ;font-weight: bold ;font-size: larger } +p.sidebar-subtitle {font-family: sans-serif ; font-weight: bold } +p.topic-title { +font-weight: bold; +background-color: #6D6D6D; +border-bottom: 1px solid #000000; +border-top: 1px solid black; +color: white; +text-align: center; +margin: 0; +} +pre.address { margin-bottom: 0;margin-top:0;font-family:serif;font-size:100% } +pre.literal-block, pre.doctest-block {margin-left: 2em ;margin-right: 2em } +span.classifier {font-family: sans-serif;font-style: oblique } +span.classifier-delimiter {font-family: sans-serif;font-weight: bold } +span.interpreted {font-family: sans-serif } +span.option {white-space: nowrap } +span.pre {white-space: pre } +span.problematic {color: red } +span.section-subtitle { + /* font-size relative to parent (h1..h6 element) */ + font-size: 80% } + +table.citation { border-left: solid 1px gray; margin-left: 1px } +table.docinfo {margin: 2em 4em } +table.docutils {margin-top: 0.5em;margin-bottom: 0.5em; border: 0 solid #9d9d9d; border-collapse: collapse; } +table.footnote {border-left: solid 1px black;margin-left: 1px } + +table.docutils td, table.docutils th, +table.docinfo td, table.docinfo th {padding-left: 0.5em;padding-right: 0.5em; + vertical-align: top;} + +table.docutils td, table.docutils th { border-bottom:1px solid #9D9D9D; } +/* color: #4d4d4d} */ + +/* table.docutils td:hover, table.docinfo td:hover {color: #000000} */ + + +table.docutils th.field-name, table.docinfo th.docinfo-name { + font-weight: bold;text-align: left;white-space: nowrap;padding-left: 0 } + +table.docutils th +{ +color: black; +font-weight:normal; +background-color: #E3E3E3; +border-top: 1px solid #1d1d1d; +border-bottom: 1px solid #1d1d1d; +} + +h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, +h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {font-size: 100% } +ul.auto-toc { list-style-type: none } +/*a.reference { color: #E00000; font-weight:bold;} +a.reference:hover {color: #E00000;background-color: #ffff00;display: margin; + font-weight:bold;}*/ + +</style> + +</head> +<body> +<div class="document" id="documentId"> +<h1 class="title">Module sample</h1> +<div class="navigation" id="navigation"> +<ul class="simple"> +<li> + <a class="reference" href="#6" id="56">Imports</a> + <ul class="simple"> + + </ul> +</li> +<li> + <a class="reference" href="#12" id="62">Procs</a> + <ul class="simple"> + <li><a class="reference" href="#101"><wbr />hello<wbr />World</a></li> + + </ul> +</li> + +</ul> +</div> +<div class="content" id="content"> +This module is a sample. +<div class="section" id="6"> +<h1><a class="toc-backref" href="#56">Imports</a></h1> +<dl class="item"> +<a class="reference external" href="strutils.html">strutils</a> +</dl></div> +<div class="section" id="12"> +<h1><a class="toc-backref" href="#62">Procs</a></h1> +<dl class="item"> +<dt id="101"><pre><span class="Keyword">proc</span> <span class="Identifier">helloWorld</span><span class="Other">(</span><span class="Identifier">times</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span> <span class="Other">{.</span><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">.}</span></pre></dt> +<dd> +Takes an integer and outputs as many &quot;hello world!&quot;s +</dd> + +</dl></div> + +</div> + +<small>Generated: 2013-12-21 11:45:52 UTC</small> +</div> +</body> +</html> From 02533c260b16ce7b16a47781d104b46b36544749 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Thu, 2 Jan 2014 17:55:18 +0200 Subject: [PATCH 188/326] fixed #597 --- compiler/astalgo.nim | 2 + compiler/msgs.nim | 3 ++ compiler/semdestruct.nim | 80 ++++++++++++++++++++++++++------------- compiler/semstmts.nim | 2 +- tests/run/tdestructor.nim | 76 ++++++++++++++++++++++++++++++++----- 5 files changed, 126 insertions(+), 37 deletions(-) diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 4b73485667..110ee191f9 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -432,6 +432,8 @@ proc debugTree(n: PNode, indent: int, maxRecDepth: int): PRope = proc debug(n: PSym) = if n == nil: writeln(stdout, "null") + elif n.kind == skUnknown: + writeln(stdout, "skUnknown") else: #writeln(stdout, ropeToStr(symToYaml(n, 0, 1))) writeln(stdout, ropeToStr(ropef("$1_$2: $3, $4", [ diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 1b4d8e47a1..d7944a1823 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -93,6 +93,7 @@ type errNewSectionExpected, errWhitespaceExpected, errXisNoValidIndexFile, errCannotRenderX, errVarVarTypeNotAllowed, errInstantiateXExplicitely, errOnlyACallOpCanBeDelegator, errUsingNoSymbol, + errDestructorNotGenericEnough, errXExpectsTwoArguments, errXExpectsObjectTypes, errXcanNeverBeOfThisSubtype, errTooManyIterations, @@ -322,6 +323,8 @@ const errInstantiateXExplicitely: "instantiate '$1' explicitely", errOnlyACallOpCanBeDelegator: "only a call operator can be a delegator", errUsingNoSymbol: "'$1' is not a variable, constant or a proc name", + errDestructorNotGenericEnough: "Destructor signarue is too specific. " & + "A destructor must be associated will all instantiations of a generic type", errXExpectsTwoArguments: "\'$1\' expects two arguments", errXExpectsObjectTypes: "\'$1\' expects object types", errXcanNeverBeOfThisSubtype: "\'$1\' can never be of this subtype", diff --git a/compiler/semdestruct.nim b/compiler/semdestruct.nim index 6965b36bc9..9dbbf29402 100644 --- a/compiler/semdestruct.nim +++ b/compiler/semdestruct.nim @@ -9,6 +9,7 @@ ## This module implements destructors. +# included from sem.nim # special marker values that indicates that we are # 1) AnalyzingDestructor: currently analyzing the type for destructor @@ -25,10 +26,22 @@ var destructorPragma = newIdentNode(getIdent"destructor", unknownLineInfo()) rangeDestructorProc*: PSym -proc instantiateDestructor(c: PContext, typ: PType): bool +proc instantiateDestructor(c: PContext, typ: PType): PType proc doDestructorStuff(c: PContext, s: PSym, n: PNode) = - let t = s.typ.sons[1].skipTypes({tyVar}) + var t = s.typ.sons[1].skipTypes({tyVar}) + if t.kind == tyGenericInvokation: + for i in 1 .. <t.sonsLen: + if t.sons[i].kind != tyGenericParam: + localError(n.info, errDestructorNotGenericEnough) + return + t = t.base + elif t.kind == tyCompositeTypeClass: + t = t.base + if t.kind != tyGenericBody: + localError(n.info, errDestructorNotGenericEnough) + return + t.destructor = s # automatically insert calls to base classes' destructors if n.sons[bodyPos].kind != nkEmpty: @@ -36,15 +49,17 @@ proc doDestructorStuff(c: PContext, s: PSym, n: PNode) = # when inheriting directly from object # there will be a single nil son if t.sons[i] == nil: continue - if instantiateDestructor(c, t.sons[i]): + let destructableT = instantiateDestructor(c, t.sons[i]) + if destructableT != nil: n.sons[bodyPos].addSon(newNode(nkCall, t.sym.info, @[ - useSym(t.sons[i].destructor), + useSym(destructableT.destructor), n.sons[paramsPos][1][0]])) proc destroyField(c: PContext, field: PSym, holder: PNode): PNode = - if instantiateDestructor(c, field.typ): + let destructableT = instantiateDestructor(c, field.typ) + if destructableT != nil: result = newNode(nkCall, field.info, @[ - useSym(field.typ.destructor), + useSym(destructableT.destructor), newNode(nkDotExpr, field.info, @[holder, useSym(field)])]) proc destroyCase(c: PContext, n: PNode, holder: PNode): PNode = @@ -105,26 +120,35 @@ proc generateDestructor(c: PContext, t: PType): PNode = # base classes' destructors will be automatically called by # semProcAux for both auto-generated and user-defined destructors -proc instantiateDestructor(c: PContext, typ: PType): bool = - # returns true if the type already had a user-defined - # destructor or if the compiler generated a default - # member-wise one - var t = skipTypes(typ, {tyConst, tyMutable}) +proc instantiateDestructor(c: PContext, typ: PType): PType = + # returns nil if a variable of type `typ` doesn't require a + # destructor. Otherwise, returns the type, which holds the + # destructor that must be used for the varialbe. + # The destructor is either user-defined or automatically + # generated by the compiler in a member-wise fashion. + var t = skipTypes(typ, {tyConst, tyMutable}).skipGenericAlias + let typeHoldingUserDefinition = if t.kind == tyGenericInst: t.base + else: t - if t.destructor != nil: + if typeHoldingUserDefinition.destructor != nil: # XXX: This is not entirely correct for recursive types, but we need # it temporarily to hide the "destroy is already defined" problem - return t.destructor notin [analyzingDestructor, destructorIsTrivial] + if typeHoldingUserDefinition.destructor notin + [analyzingDestructor, destructorIsTrivial]: + return typeHoldingUserDefinition + else: + return nil + t = t.skipTypes({tyGenericInst}) case t.kind of tySequence, tyArray, tyArrayConstr, tyOpenArray, tyVarargs: - if instantiateDestructor(c, t.sons[0]): + if instantiateDestructor(c, t.sons[0]) != nil: if rangeDestructorProc == nil: rangeDestructorProc = searchInScopes(c, getIdent"nimDestroyRange") t.destructor = rangeDestructorProc - return true + return t else: - return false + return nil of tyTuple, tyObject: t.destructor = analyzingDestructor let generated = generateDestructor(c, t) @@ -139,21 +163,21 @@ proc instantiateDestructor(c: PContext, typ: PType): bool = emptyNode, newNode(nkIdentDefs, i, @[ newIdentNode(destructorParam, i), - useSym(t.sym), + symNodeFromType(c, makeVarType(c, t), t.sym.info), emptyNode]), ]), newNode(nkPragma, i, @[destructorPragma]), emptyNode, generated ]) - discard semProc(c, fullDef) - internalAssert t.destructor != nil - return true + let semantizedDef = semProc(c, fullDef) + t.destructor = semantizedDef[namePos].sym + return t else: t.destructor = destructorIsTrivial - return false + return nil else: - return false + return nil proc insertDestructors(c: PContext, varSection: PNode): tuple[outer, inner: PNode] = @@ -179,9 +203,11 @@ proc insertDestructors(c: PContext, varId = varSection[j][0] varTyp = varId.sym.typ info = varId.info - - if varTyp != nil and instantiateDestructor(c, varTyp) and - sfGlobal notin varId.sym.flags: + + if varTyp == nil or sfGlobal in varId.sym.flags: continue + let destructableT = instantiateDestructor(c, varTyp) + + if destructableT != nil: var tryStmt = newNodeI(nkTryStmt, info) if j < totalVars - 1: @@ -198,11 +224,11 @@ proc insertDestructors(c: PContext, else: result.inner = newNodeI(nkStmtList, info) tryStmt.addSon(result.inner) - + tryStmt.addSon( newNode(nkFinally, info, @[ semStmt(c, newNode(nkCall, info, @[ - useSym(varTyp.destructor), + useSym(destructableT.destructor), useSym(varId.sym)]))])) result.outer = newNodeI(nkStmtList, info) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 80327e7ebf..f0007d01e8 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -86,7 +86,7 @@ include semdestruct proc semDestructorCheck(c: PContext, n: PNode, flags: TExprFlags) {.inline.} = if efAllowDestructor notin flags and n.kind in nkCallKinds+{nkObjConstr}: - if instantiateDestructor(c, n.typ): + if instantiateDestructor(c, n.typ) != nil: localError(n.info, errGenerated, "usage of a type with a destructor in a non destructible context") # This still breaks too many things: diff --git a/tests/run/tdestructor.nim b/tests/run/tdestructor.nim index 8aae2fce20..9b90995c74 100644 --- a/tests/run/tdestructor.nim +++ b/tests/run/tdestructor.nim @@ -1,26 +1,84 @@ discard """ - output: '''some text -Destructor called!''' + output: '''---- +myobj constructed +myobj destructed +---- +mygeneric1 constructed +mygeneric1 destroyed +---- +mygeneric2 constructed +mygeneric2 destroyed +myobj destroyed +---- +mygeneric3 constructed +mygeneric1 destroyed +''' """ type TMyObj = object x, y: int p: pointer - + + TMyGeneric1[T] = object + x: T + + TMyGeneric2[A, B] = object + x: A + y: B + + TMyGeneric3[A, B, C] = object + x: A + y: B + z: C + proc destruct(o: var TMyObj) {.destructor.} = if o.p != nil: dealloc o.p - echo "Destructor called!" - + echo "myobj destroyed" + +proc destroy(o: var TMyGeneric1) {.destructor.} = + echo "mygeneric1 destroyed" + +proc destroy[A, B](o: var TMyGeneric2[A, B]) {.destructor.} = + echo "mygeneric2 destroyed" + proc open: TMyObj = # allow for superfluous () result = (TMyObj(x: 1, y: 2, p: alloc(3))) - proc `$`(x: TMyObj): string = $x.y -proc main() = +proc myobj() = var x = open() - echo "some text" + echo "myobj constructed" + +proc mygeneric1() = + var x = TMyGeneric1[int](x: 10) + echo "mygeneric1 constructed" + +proc mygeneric2[T](val: T) = + var + a = open() + b = TMyGeneric2[int, T](x: 10, y: val) + c = TMyGeneric3[int, int, string](x: 10, y: 20, z: "test") + + echo "mygeneric2 constructed" + +proc mygeneric3 = + var x = TMyGeneric3[int, string, TMyGeneric1[int]]( + x: 10, y: "test", z: TMyGeneric1[int](x: 10)) + + echo "mygeneric3 constructed" + +echo "----" +myobj() + +echo "----" +mygeneric1() + +echo "----" +mygeneric2[int](10) + +echo "----" +mygeneric3() -main() From 789ba107cf3bcc1a87d896fc7cbfa11e151898c2 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sat, 4 Jan 2014 12:28:25 +0200 Subject: [PATCH 189/326] introduce tyFromExpr; fixes #618 --- compiler/ast.nim | 28 +++++++++++++++------- compiler/ccgutils.nim | 5 ++-- compiler/jsgen.nim | 5 ++-- compiler/sem.nim | 8 +++++++ compiler/semdata.nim | 4 ++++ compiler/semgnrc.nim | 7 ------ compiler/semtypes.nim | 6 +++++ compiler/semtypinst.nim | 4 ++++ compiler/sigmatch.nim | 10 +++++--- compiler/types.nim | 11 +++++---- tests/compile/compilehelpers.nim | 6 +++++ tests/compile/tmatrix3.nim | 41 ++++++++++++++++++++++++++++++++ tests/run/tdestructor.nim | 2 +- 13 files changed, 109 insertions(+), 28 deletions(-) create mode 100644 tests/compile/compilehelpers.nim create mode 100644 tests/compile/tmatrix3.nim diff --git a/compiler/ast.nim b/compiler/ast.nim index e25f10a669..2f6b6fc9f1 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -339,19 +339,31 @@ type tyTypeClass tyParametricTypeClass # structured similarly to tyGenericInst # lastSon is the body of the type class - tyBuiltInTypeClass - tyCompositeTypeClass - tyAnd - tyOr - tyNot - tyAnything - tyStatic + + tyBuiltInTypeClass # Type such as the catch-all object, tuple, seq, etc + + tyCompositeTypeClass # + + tyAnd, tyOr, tyNot # boolean type classes such as `string|int`,`not seq`, + # `Sortable and Enumable`, etc + + tyAnything # a type class matching any type + + tyStatic # a value known at compile type (the underlying type is .base) + + tyFromExpr # This is a type representing an expression that depends + # on generic parameters (the exprsesion is stored in t.n) + # It will be converted to a real type only during generic + # instantiation and prior to this it has the potential to + # be any type. const tyPureObject* = tyTuple GcTypeKinds* = {tyRef, tySequence, tyString} tyError* = tyProxy # as an errornous node should match everything - + + tyUnknownTypes* = {tyError, tyFromExpr} + tyTypeClasses* = {tyTypeClass, tyBuiltInTypeClass, tyCompositeTypeClass, tyParametricTypeClass, tyAnd, tyOr, tyNot, tyAnything} diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index b07047ec43..fe349174fd 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -86,9 +86,8 @@ proc getUniqueType*(key: PType): PType = if result == nil: gCanonicalTypes[k] = key result = key - of tyTypeDesc, tyTypeClasses: - internalError("value expected, but got a type") - of tyGenericParam, tyStatic: + of tyTypeDesc, tyTypeClasses, tyGenericParam, + tyFromExpr, tyStatic: internalError("GetUniqueType") of tyGenericInst, tyDistinct, tyOrdinal, tyMutable, tyConst, tyIter: result = getUniqueType(lastSon(key)) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index ddfc189dda..b4e696d0a5 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -129,8 +129,9 @@ proc mapType(typ: PType): TJSTypeKind = tyVarargs: result = etyObject of tyNil: result = etyNull - of tyGenericInst, tyGenericParam, tyGenericBody, tyGenericInvokation, tyNone, - tyForward, tyEmpty, tyExpr, tyStmt, tyStatic, tyTypeDesc, tyTypeClasses: + of tyGenericInst, tyGenericParam, tyGenericBody, tyGenericInvokation, + tyNone, tyFromExpr, tyForward, tyEmpty, + tyExpr, tyStmt, tyStatic, tyTypeDesc, tyTypeClasses: result = etyNone of tyProc: result = etyProc of tyCString: result = etyString diff --git a/compiler/sem.nim b/compiler/sem.nim index e9c2de6572..b53e7335c8 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -293,6 +293,14 @@ proc semConstBoolExpr(c: PContext, n: PNode): PNode = localError(n.info, errConstExprExpected) result = nn +type + TSemGenericFlag = enum + withinBind, withinTypeDesc, withinMixin + TSemGenericFlags = set[TSemGenericFlag] + +proc semGenericStmt(c: PContext, n: PNode, flags: TSemGenericFlags, + ctx: var TIntSet): PNode + include semtypes, semtempl, semgnrc, semstmts, semexprs proc addCodeForGenerics(c: PContext, n: PNode) = diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 3020a6af16..2e920d9cff 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -214,6 +214,10 @@ proc makeTypeSymNode*(c: PContext, typ: PType, info: TLineInfo): PNode = let sym = newSym(skType, idAnon, getCurrOwner(), info).linkTo(typedesc) return newSymNode(sym, info) +proc makeTypeFromExpr*(c: PContext, n: PNode): PType = + result = newTypeS(tyFromExpr, c) + result.n = n + proc makeAndType*(c: PContext, t1, t2: PType): PType = result = newTypeS(tyAnd, c) result.sons = @[t1, t2] diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index 9f477492c6..b40e86cbfc 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -17,11 +17,6 @@ # included from sem.nim -type - TSemGenericFlag = enum - withinBind, withinTypeDesc, withinMixin - TSemGenericFlags = set[TSemGenericFlag] - proc getIdentNode(n: PNode): PNode = case n.kind of nkPostfix: result = getIdentNode(n.sons[1]) @@ -31,8 +26,6 @@ proc getIdentNode(n: PNode): PNode = illFormedAst(n) result = n -proc semGenericStmt(c: PContext, n: PNode, flags: TSemGenericFlags, - ctx: var TIntSet): PNode proc semGenericStmtScope(c: PContext, n: PNode, flags: TSemGenericFlags, ctx: var TIntSet): PNode = diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 3ce504d2cb..79147ab825 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -988,6 +988,12 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = result.rawAddSon(semTypeNode(c, n.sons[i], nil)) else: result = semGeneric(c, n, s, prev) of nkIdent, nkDotExpr, nkAccQuoted: + if n.kind == nkDotExpr: + let head = qualifiedLookUp(c, n[0], {checkAmbiguity, checkUndeclared}) + if head.kind in {skType}: + var toBind = initIntSet() + var preprocessed = semGenericStmt(c, n, {}, toBind) + return makeTypeFromExpr(c, preprocessed) var s = semTypeIdent(c, n) if s.typ == nil: if s.kind != skError: localError(n.info, errTypeExpected) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index ec56f75e41..75d2666795 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -287,6 +287,10 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = of tyGenericBody: internalError(cl.info, "ReplaceTypeVarsT: tyGenericBody" ) result = replaceTypeVarsT(cl, lastSon(t)) + of tyFromExpr: + var n = prepareNode(cl, t.n) + n = cl.c.semExpr(cl.c, n, {}) + result = n.typ.skipTypes({tyTypeDesc}) of tyInt: result = skipIntLit(t) # XXX now there are also float literals diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 2e314d115e..43f1cded92 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -665,10 +665,14 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = of tyGenericInst: let roota = a.skipGenericAlias let rootf = f.skipGenericAlias - if a.kind == tyGenericInst and roota.base == rootf.base: + if a.kind == tyGenericInst and roota.base == rootf.base : for i in 1 .. rootf.sonsLen-2: - result = typeRel(c, rootf.sons[i], roota.sons[i]) - if result == isNone: return + let ff = rootf.sons[i] + let aa = roota.sons[i] + result = typeRel(c, ff, aa) + if result == isNone: return + if ff.kind == tyRange and result != isEqual: return isNone + result = isGeneric else: result = typeRel(c, lastSon(f), a) diff --git a/compiler/types.nim b/compiler/types.nim index 68e816c13c..dd808915e0 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -10,7 +10,7 @@ # this module contains routines for accessing and iterating over types import - intsets, ast, astalgo, trees, msgs, strutils, platform + intsets, ast, astalgo, trees, msgs, strutils, platform, renderer proc firstOrd*(t: PType): BiggestInt proc lastOrd*(t: PType): BiggestInt @@ -406,7 +406,7 @@ const "bignum", "const ", "!", "varargs[$1]", "iter[$1]", "Error Type", "TypeClass", "ParametricTypeClass", "BuiltInTypeClass", "CompositeTypeClass", - "and", "or", "not", "any", "static"] + "and", "or", "not", "any", "static", "TypeFromExpr"] proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = var t = typ @@ -448,6 +448,8 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = of tyExpr: InternalAssert t.len == 0 result = "expr" + of tyFromExpr: + result = renderTree(t.n) of tyArray: if t.sons[0].kind == tyRange: result = "array[" & rangeToStr(t.sons[0].n) & ", " & @@ -837,7 +839,7 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCString, tyInt..tyBigNum, tyStmt, tyExpr: result = sameFlags(a, b) - of tyStatic: + of tyStatic, tyFromExpr: result = exprStructuralEquivalent(a.n, b.n) and sameFlags(a, b) of tyObject: ifFastObjectTypeCheckFailed(a, b): @@ -1018,7 +1020,8 @@ proc typeAllowedAux(marker: var TIntSet, typ: PType, kind: TSymKind, result = taField in flags of tyTypeClasses: result = true - of tyGenericBody, tyGenericParam, tyForward, tyNone, tyGenericInvokation: + of tyGenericBody, tyGenericParam, tyGenericInvokation, + tyNone, tyForward, tyFromExpr: result = false of tyNil: result = kind == skConst diff --git a/tests/compile/compilehelpers.nim b/tests/compile/compilehelpers.nim new file mode 100644 index 0000000000..cb26ca5b5a --- /dev/null +++ b/tests/compile/compilehelpers.nim @@ -0,0 +1,6 @@ +template accept(e: expr) = + static: assert(compiles(e)) + +template reject(e: expr) = + static: assert(not compiles(e)) + diff --git a/tests/compile/tmatrix3.nim b/tests/compile/tmatrix3.nim new file mode 100644 index 0000000000..9004045249 --- /dev/null +++ b/tests/compile/tmatrix3.nim @@ -0,0 +1,41 @@ +discard """ + output: '''0.0000000000000000e+00 +0.0000000000000000e+00 +0 +0 +0 +''' +""" + +include compilehelpers + +type + Matrix*[M, N, T] = object + aij*: array[M, array[N, T]] + + Matrix2*[T] = Matrix[range[0..1], range[0..1], T] + + Matrix3*[T] = Matrix[range[0..2], range[0..2], T] + +proc mn(x: Matrix): Matrix.T = x.aij[0][0] + +proc m2(x: Matrix2): Matrix2.T = x.aij[0][0] + +proc m3(x: Matrix3): auto = x.aij[0][0] + +var + matn: Matrix[range[0..3], range[0..2], int] + mat2: Matrix2[int] + mat3: Matrix3[float] + +echo m3(mat3) +echo mn(mat3) +echo m2(mat2) +echo mn(mat2) +echo mn(matn) + +reject m3(mat2) +reject m3(matn) +reject m2(mat3) +reject m2(matn) + diff --git a/tests/run/tdestructor.nim b/tests/run/tdestructor.nim index 9b90995c74..bb1410d92d 100644 --- a/tests/run/tdestructor.nim +++ b/tests/run/tdestructor.nim @@ -1,7 +1,7 @@ discard """ output: '''---- myobj constructed -myobj destructed +myobj destroyed ---- mygeneric1 constructed mygeneric1 destroyed From 1ffae7cbafd63ed5d8546dcda1a0e5ec883fd00b Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 6 Jan 2014 00:15:55 +0200 Subject: [PATCH 190/326] progress towards fixing tgenericshardcases --- compiler/ast.nim | 1 + compiler/semdata.nim | 15 ++-- compiler/semexprs.nim | 10 +-- compiler/seminst.nim | 3 +- compiler/semtypes.nim | 28 +++++++- compiler/semtypinst.nim | 104 ++++++++++++++++++++++----- compiler/types.nim | 2 +- lib/system.nim | 2 +- tests/compile/tgenericshardcases.nim | 24 ++++--- 9 files changed, 146 insertions(+), 43 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 2f6b6fc9f1..1d356b6d89 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -418,6 +418,7 @@ type tfHasGCedMem, # type contains GC'ed memory tfHasStatic tfGenericTypeParam + tfImplicitTypeParam TTypeFlags* = set[TTypeFlag] diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 2e920d9cff..980abb865e 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -218,6 +218,16 @@ proc makeTypeFromExpr*(c: PContext, n: PNode): PType = result = newTypeS(tyFromExpr, c) result.n = n +proc newTypeWithSons*(c: PContext, kind: TTypeKind, + sons: seq[PType]): PType = + result = newType(kind, getCurrOwner()) + result.sons = sons + +proc makeStaticExpr*(c: PContext, n: PNode): PNode = + result = newNodeI(nkStaticExpr, n.info) + result.sons = @[n] + result.typ = newTypeWithSons(c, tyStatic, @[n.typ]) + proc makeAndType*(c: PContext, t1, t2: PType): PType = result = newTypeS(tyAnd, c) result.sons = @[t1, t2] @@ -238,11 +248,6 @@ proc makeNotType*(c: PContext, t1: PType): PType = proc newTypeS(kind: TTypeKind, c: PContext): PType = result = newType(kind, getCurrOwner()) -proc newTypeWithSons*(c: PContext, kind: TTypeKind, - sons: seq[PType]): PType = - result = newType(kind, getCurrOwner()) - result.sons = sons - proc errorType*(c: PContext): PType = ## creates a type representing an error state result = newTypeS(tyError, c) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 00c0e0f78b..1f7803c95d 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -231,7 +231,7 @@ proc semCast(c: PContext, n: PNode): PNode = if not isCastable(result.typ, result.sons[1].typ): localError(result.info, errExprCannotBeCastedToX, typeToString(result.typ)) - + proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = const opToStr: array[mLow..mHigh, string] = ["low", "high"] @@ -239,7 +239,7 @@ proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = localError(n.info, errXExpectsTypeOrValue, opToStr[m]) else: n.sons[1] = semExprWithType(c, n.sons[1], {efDetermineType}) - var typ = skipTypes(n.sons[1].typ, abstractVarRange) + var typ = skipTypes(n.sons[1].typ, abstractVarRange+{tyTypeDesc}) case typ.kind of tySequence, tyString, tyOpenArray, tyVarargs: n.typ = getSysType(tyInt) @@ -249,8 +249,10 @@ proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = # do not skip the range! n.typ = n.sons[1].typ.skipTypes(abstractVar) of tyGenericParam: - # leave it for now, it will be resolved in semtypinst - n.typ = getSysType(tyInt) + # prepare this for resolving in semtypinst: + # we must use copyTree here in order to avoid creating a cycle + # that could easily turn into an infinite recursion in semtypinst + n.typ = makeTypeFromExpr(c, n.copyTree) else: localError(n.info, errInvalidArgForX, opToStr[m]) result = n diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 370d59b107..8faf1d21a5 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -167,8 +167,7 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, result.ast = n pushOwner(result) openScope(c) - if n.sons[genericParamsPos].kind == nkEmpty: - internalError(n.info, "generateInstance") + internalAssert n.sons[genericParamsPos].kind != nkEmpty n.sons[namePos] = newSymNode(result) pushInfoContext(info) var entry = TInstantiation.new diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 79147ab825..64c8f81e26 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -186,6 +186,11 @@ proc semRange(c: PContext, n: PNode, prev: PType): PType = localError(n.info, errXExpectsOneTypeParam, "range") result = newOrPrevType(tyError, prev, c) +proc nMinusOne(n: PNode): PNode = + result = newNode(nkCall, n.info, @[ + newSymNode(getSysMagic("<", mUnaryLt)), + n]) + proc semArray(c: PContext, n: PNode, prev: PType): PType = var indx, base: PType result = newOrPrevType(tyArray, prev, c) @@ -194,7 +199,9 @@ proc semArray(c: PContext, n: PNode, prev: PType): PType = if isRange(n[1]): indx = semRangeAux(c, n[1], nil) else: let e = semExprWithType(c, n.sons[1], {efDetermineType}) - if e.kind in {nkIntLit..nkUInt64Lit}: + if e.typ.kind == tyFromExpr: + indx = e.typ + elif e.kind in {nkIntLit..nkUInt64Lit}: indx = makeRangeType(c, 0, e.intVal-1, n.info, e.typ) elif e.kind == nkSym and e.typ.kind == tyStatic: if e.sym.ast != nil: return semArray(c, e.sym.ast, nil) @@ -202,11 +209,25 @@ proc semArray(c: PContext, n: PNode, prev: PType): PType = if not isOrdinalType(e.typ.lastSon): localError(n[1].info, errOrdinalTypeExpected) indx = e.typ + elif e.kind in nkCallKinds and hasGenericArguments(e): + if not isOrdinalType(e.typ): + localError(n[1].info, errOrdinalTypeExpected) + # This is an int returning call, depending on an + # yet unknown generic param (see tgenericshardcases). + # We are going to construct a range type that will be + # properly filled-out in semtypinst (see how tyStaticExpr + # is handled there). + let intType = getSysType(tyInt) + indx = newTypeS(tyRange, c) + indx.sons = @[intType] + indx.n = newNode(nkRange, n.info, @[ + newIntTypeNode(nkIntLit, 0, intType), + makeStaticExpr(c, e.nMinusOne)]) else: indx = e.typ.skipTypes({tyTypeDesc}) addSonSkipIntLit(result, indx) if indx.kind == tyGenericInst: indx = lastSon(indx) - if indx.kind notin {tyGenericParam, tyStatic}: + if indx.kind notin {tyGenericParam, tyStatic, tyFromExpr}: if not isOrdinalType(indx): localError(n.sons[1].info, errOrdinalTypeExpected) elif enumHasHoles(indx): @@ -619,6 +640,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, var s = newSym(skType, finalTypId, owner, info) if typId == nil: s.flags.incl(sfAnon) s.linkTo(typeClass) + typeClass.flags.incl tfImplicitTypeParam s.position = genericParams.len genericParams.addSon(newSymNode(s)) result = typeClass @@ -844,7 +866,7 @@ proc semGenericParamInInvokation(c: PContext, n: PNode): PType = proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = result = newOrPrevType(tyGenericInvokation, prev, c) addSonSkipIntLit(result, s.typ) - + template addToResult(typ) = if typ.isNil: internalAssert false diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 75d2666795..b08119d4a7 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -98,11 +98,50 @@ proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode = result = copyNode(n) result.typ = replaceTypeVarsT(cl, n.typ) if result.kind == nkSym: result.sym = replaceTypeVarsS(cl, n.sym) - for i in 0 .. safeLen(n)-1: - # XXX HACK: ``f(a, b)``, avoid to instantiate `f` - if i == 0: result.add(n[i]) + let isCall = result.kind in nkCallKinds + for i in 0 .. <n.safeLen: + # XXX HACK: ``f(a, b)``, avoid to instantiate `f` + if isCall and i == 0: result.add(n[i]) else: result.add(prepareNode(cl, n[i])) +proc isTypeParam(n: PNode): bool = + # XXX: generic params should use skGenericParam instead of skType + return n.kind == nkSym and + (n.sym.kind == skGenericParam or + (n.sym.kind == skType and sfFromGeneric in n.sym.flags)) + +proc hasGenericArguments*(n: PNode): bool = + if n.kind == nkSym: + return n.sym.kind == skGenericParam or + (n.sym.kind == skType and + n.sym.typ.flags * {tfGenericTypeParam, tfImplicitTypeParam} != {}) + else: + for s in n.sons: + if hasGenericArguments(s): return true + return false + +proc reResolveCallsWithTypedescParams(cl: var TReplTypeVars, n: PNode): PNode = + # This is needed fo tgenericshardcases + # It's possible that a generic param will be used in a proc call to a + # typedesc accepting proc. After generic param substitution, such procs + # should be optionally instantiated with the correct type. In order to + # perform this instantiation, we need to re-run the generateInstance path + # in the compiler, but it's quite complicated to do so at the moment so we + # resort to a mild hack; the head symbol of the call is temporary reset and + # overload resolution is executed again (which may trigger generateInstance). + if n.kind in nkCallKinds and sfFromGeneric in n[0].sym.flags: + var needsFixing = false + for i in 1 .. <n.safeLen: + if isTypeParam(n[i]): needsFixing = true + if needsFixing: + n.sons[0] = newSymNode(n.sons[0].sym.owner) + return cl.c.semOverloadedCall(cl.c, n, n, {skProc}) + + for i in 0 .. <n.safeLen: + n.sons[i] = reResolveCallsWithTypedescParams(cl, n[i]) + + return n + proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = if n == nil: return result = copyNode(n) @@ -135,6 +174,10 @@ proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode): PNode = result = replaceTypeVarsN(cl, branch) else: result = newNodeI(nkRecList, n.info) + of nkStaticExpr: + var n = prepareNode(cl, n) + n = reResolveCallsWithTypedescParams(cl, n) + result = cl.c.semExpr(cl.c, n) else: var length = sonsLen(n) if length > 0: @@ -273,45 +316,58 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = result = t if t == nil: return - #if t.kind == tyStatic and t.sym != nil and t.sym.kind == skGenericParam: - # let s = lookupTypeVar(cl, t) - # return if s != nil: s else: t - if t.kind in {tyStatic, tyGenericParam} + tyTypeClasses: let lookup = PType(idTableGet(cl.typeMap, t)) if lookup != nil: return lookup - + case t.kind of tyGenericInvokation: result = handleGenericInvokation(cl, t) + of tyGenericBody: internalError(cl.info, "ReplaceTypeVarsT: tyGenericBody" ) result = replaceTypeVarsT(cl, lastSon(t)) + of tyFromExpr: var n = prepareNode(cl, t.n) - n = cl.c.semExpr(cl.c, n, {}) - result = n.typ.skipTypes({tyTypeDesc}) + n = cl.c.semConstExpr(cl.c, n) + if n.typ.kind == tyTypeDesc: + # XXX: sometimes, chained typedescs enter here. + # It may be worth investigating why this is happening, + # because it may cause other bugs elsewhere. + result = n.typ.skipTypes({tyTypeDesc}) + # result = n.typ.base + else: + if n.typ.kind != tyStatic: + # XXX: In the future, semConstExpr should + # return tyStatic values to let anyone make + # use of this knowledge. The patching here + # won't be necessary then. + result = newTypeS(tyStatic, cl.c) + result.sons = @[n.typ] + result.n = n + else: + result = n.typ + of tyInt: result = skipIntLit(t) # XXX now there are also float literals + of tyTypeDesc: let lookup = PType(idTableGet(cl.typeMap, t)) # lookupTypeVar(cl, t) if lookup != nil: result = lookup if tfUnresolved in t.flags: result = result.base + elif t.sonsLen > 0: + result = makeTypeDesc(cl.c, replaceTypeVarsT(cl, t.sons[0])) + of tyGenericInst: result = instCopyType(cl, t) for i in 1 .. <result.sonsLen: result.sons[i] = ReplaceTypeVarsT(cl, result.sons[i]) propagateToOwner(result, result.lastSon) + else: - if t.kind == tyArray: - let idxt = t.sons[0] - if idxt.kind == tyStatic and - idxt.sym != nil and idxt.sym.kind == skGenericParam: - let value = lookupTypeVar(cl, idxt).n - t.sons[0] = makeRangeType(cl.c, 0, value.intVal - 1, value.info) - if containsGenericType(t): result = instCopyType(cl, t) result.size = -1 # needs to be recomputed @@ -326,13 +382,25 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = # XXX: This is not really needed? # if result.kind in GenericTypes: # localError(cl.info, errCannotInstantiateX, typeToString(t, preferName)) - + case result.kind + of tyArray: + let idx = result.sons[0] + if idx.kind == tyStatic: + if idx.n == nil: + let lookup = lookupTypeVar(cl, idx) + internalAssert lookup != nil + idx.n = lookup.n + + result.sons[0] = makeRangeType(cl.c, 0, idx.n.intVal - 1, idx.n.info) + of tyObject, tyTuple: propagateFieldFlags(result, result.n) + of tyProc: eraseVoidParams(result) skipIntLiteralParams(result) + else: discard proc generateTypeInstance*(p: PContext, pt: TIdTable, info: TLineInfo, diff --git a/compiler/types.nim b/compiler/types.nim index dd808915e0..36c9f1934d 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1231,7 +1231,7 @@ proc getSize(typ: PType): BiggestInt = if result < 0: internalError("getSize: " & $typ.kind) proc containsGenericTypeIter(t: PType, closure: PObject): bool = - result = t.kind in GenericTypes + tyTypeClasses + {tyTypeDesc} or + result = t.kind in GenericTypes + tyTypeClasses + {tyTypeDesc,tyFromExpr} or t.kind == tyStatic and t.n == nil proc containsGenericType*(t: PType): bool = diff --git a/lib/system.nim b/lib/system.nim index 241b0bd034..dbec610347 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -144,7 +144,7 @@ proc reset*[T](obj: var T) {.magic: "Reset", noSideEffect.} ## be called before any possible `object branch transition`:idx:. # for low and high the return type T may not be correct, but -# we handle that with compiler magic in SemLowHigh() +# 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 diff --git a/tests/compile/tgenericshardcases.nim b/tests/compile/tgenericshardcases.nim index 90981c7014..2ef63bc207 100644 --- a/tests/compile/tgenericshardcases.nim +++ b/tests/compile/tgenericshardcases.nim @@ -1,6 +1,6 @@ discard """ file: "tgenericshardcases.nim" - output: "int\nfloat\nint\nstring" + output: "2\n5\n126\n3" """ import typetraits @@ -13,18 +13,24 @@ macro selectType(a, b: typedesc): typedesc = type Foo[T] = object - data1: array[high(T), int] - data2: array[1..typeNameLen(T), selectType(float, string)] + data1: array[T.high, int] + data2: array[typeNameLen(T), float] # data3: array[0..T.typeNameLen, selectType(float, int)] - MyEnum = enum A, B, C,D + MyEnum = enum A, B, C, D var f1: Foo[MyEnum] var f2: Foo[int8] -static: - assert high(f1.data1) == D - assert high(f1.data2) == 6 # length of MyEnum +echo high(f1.data1) # (D = 3) - 1 == 2 +echo high(f1.data2) # (MyEnum.len = 6) - 1 == 5 - assert high(f2.data1) == 127 - assert high(f2.data2) == 4 # length of int8 +echo high(f2.data1) # 127 - 1 == 126 +echo high(f2.data2) # int8.len - 1 == 3 + +#static: +# assert high(f1.data1) == ord(D) +# assert high(f1.data2) == 6 # length of MyEnum + +# assert high(f2.data1) == 127 +# assert high(f2.data2) == 4 # length of int8 From 1280c56f386111b542c8f0effdd3e5cbc5e84622 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 6 Jan 2014 00:16:16 +0200 Subject: [PATCH 191/326] fix bootstrapping on windows --- compiler/sigmatch.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 43f1cded92..7066c5afdb 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -430,7 +430,9 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = return typeRel(c, f, lastSon(a)) template bindingRet(res) = - when res == isGeneric: put(c.bindings, f, aOrig) + when res == isGeneric: + let bound = aOrig.skipTypes({tyRange}).skipIntLit + put(c.bindings, f, bound) return res template considerPreviousT(body: stmt) {.immediate.} = From 0b6c9d7d75db7b3a9b93c465ba8a99c559fc305c Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 6 Jan 2014 13:18:27 +0100 Subject: [PATCH 192/326] Fixes two minor typos. --- doc/docgen.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/docgen.txt b/doc/docgen.txt index 998cde8391..e287e48251 100644 --- a/doc/docgen.txt +++ b/doc/docgen.txt @@ -13,14 +13,14 @@ Introduction This document describes the documentation generation tools built into the *Nimrod compiler*, which can generate HTML and JSON output from input .nim files and projects, as well as HTML -and LaTex from input RST (reStructuredText) files. The output documentation will include +and LaTeX from input RST (reStructuredText) files. The output documentation will include module dependencies (``import``), any top-level documentation comments (##), and exported symbols (*), including procedures, types, and variables. Documentation Comments ---------------------- -Any comments which are preceeded by a double-hash (##), are interpreted as documentation. +Any comments which are preceded by a double-hash (##), are interpreted as documentation. Comments are parsed as RST (see `reference <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_), providing Nimrod module authors the ability to easily generate richly formatted documentation with only From fd6bb131b87c740e843f1615af85d217018fe9c7 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 6 Jan 2014 13:22:44 +0100 Subject: [PATCH 193/326] Reformats text to fit width of 80 columns. --- doc/docgen.txt | 90 ++++++++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/doc/docgen.txt b/doc/docgen.txt index e287e48251..0e897dcd59 100644 --- a/doc/docgen.txt +++ b/doc/docgen.txt @@ -11,20 +11,22 @@ Introduction ============ -This document describes the documentation generation tools built into the *Nimrod compiler*, -which can generate HTML and JSON output from input .nim files and projects, as well as HTML -and LaTeX from input RST (reStructuredText) files. The output documentation will include -module dependencies (``import``), any top-level documentation comments (##), and exported -symbols (*), including procedures, types, and variables. +This document describes the documentation generation tools built into the +*Nimrod compiler*, which can generate HTML and JSON output from input .nim +files and projects, as well as HTML and LaTeX from input RST (reStructuredText) +files. The output documentation will include module dependencies (``import``), +any top-level documentation comments (##), and exported symbols (*), including +procedures, types, and variables. Documentation Comments ---------------------- -Any comments which are preceded by a double-hash (##), are interpreted as documentation. -Comments are parsed as RST -(see `reference <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_), providing -Nimrod module authors the ability to easily generate richly formatted documentation with only -their well-documented code. + +Any comments which are preceded by a double-hash (##), are interpreted as +documentation. Comments are parsed as RST (see `reference +<http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_), providing +Nimrod module authors the ability to easily generate richly formatted +documentation with only their well-documented code. Example: @@ -47,8 +49,9 @@ Field documentation comments can be added to fields like so: var numValues: int ## \ ## `numValues` stores the number of values -Note that without the `*` following the name of the type, the documentation for this type -would not be generated. Documentation will only be generated for *exported* types/procedures/etc. +Note that without the `*` following the name of the type, the documentation for +this type would not be generated. Documentation will only be generated for +*exported* types/procedures/etc. Nimrod file input @@ -80,10 +83,11 @@ Document Types HTML ---- -Generation of HTML documents is done via both the ``doc`` and ``doc2`` commands. These -command take either a single .nim file, outputting a single .html file with the same base filename, -or multiple .nim files, outputting multiple .html files and, optionally, -an index file. + +Generation of HTML documents is done via both the ``doc`` and ``doc2`` +commands. These command take either a single .nim file, outputting a single +.html file with the same base filename, or multiple .nim files, outputting +multiple .html files and, optionally, an index file. The ``doc`` command:: nimrod doc sample @@ -93,9 +97,10 @@ Partial Output:: proc helloWorld*(times: int) ... -Output can be viewed in full here `sample.html <docgen_samples/sample.html>`_. The next command, -called ``doc2``, is very similar to the ``doc`` command, but will be run after the -compiler performs semantic checking on the input nimrod module(s), which allows it to process macros. +Output can be viewed in full here `sample.html <docgen_samples/sample.html>`_. +The next command, called ``doc2``, is very similar to the ``doc`` command, but +will be run after the compiler performs semantic checking on the input nimrod +module(s), which allows it to process macros. The ``doc2`` command:: nimrod doc2 sample @@ -105,19 +110,21 @@ Partial Output:: proc helloWorld(times: int) {.raises: [], tags: [].} ... -The full output can be seen here `sample2.html <docgen_samples/sample2.html>`_. As you can see, the tool has -extracted additional information provided to it by the compiler beyond what the ``doc`` -command provides, such as pragmas attached implicitly by the compiler. This type of information -is not available from looking at the AST (Abstract Syntax Tree) prior to semantic checking, -as the ``doc`` command does. +The full output can be seen here `sample2.html <docgen_samples/sample2.html>`_. +As you can see, the tool has extracted additional information provided to it by +the compiler beyond what the ``doc`` command provides, such as pragmas attached +implicitly by the compiler. This type of information is not available from +looking at the AST (Abstract Syntax Tree) prior to semantic checking, as the +``doc`` command does. JSON ---- -Generation of JSON documents is done via the ``jsondoc`` command. This command takes -in a .nim file, and outputs a .json file with the same base filename. Note that this -tool is built off of the ``doc`` command, and therefore is performed before semantic -checking. + +Generation of JSON documents is done via the ``jsondoc`` command. This command +takes in a .nim file, and outputs a .json file with the same base filename. +Note that this tool is built off of the ``doc`` command, and therefore is +performed before semantic checking. The ``jsondoc`` command:: nimrod jsondoc sample @@ -143,26 +150,27 @@ Related Options :: nimrod doc2 --project sample -This will recursively generate documentation of all nimrod modules imported into the input module, -including system modules. Be careful with this command, as it may end up sprinkling html files all -over your filesystem! +This will recursively generate documentation of all nimrod modules imported +into the input module, including system modules. Be careful with this command, +as it may end up sprinkling html files all over your filesystem! ``--index`` switch :: nimrod doc2 --index:on sample -This will generate an index of all the exported symbols in the input Nimrod module, and put it into -a neighboring file with the extension of `.idx`. +This will generate an index of all the exported symbols in the input Nimrod +module, and put it into a neighboring file with the extension of `.idx`. Other Input Formats =================== -The *Nimrod compiler* also has support for RST (reStructuredText) files with the ``rst2html`` and ``rst2tex`` -commands. Documents like this one are initially written in a dialect of RST which adds support for nimrod -sourcecode highlighting with the ``.. code-block:: nimrod`` prefix. ``code-block`` also supports highlighting -of C++ and some other c-like languages. +The *Nimrod compiler* also has support for RST (reStructuredText) files with +the ``rst2html`` and ``rst2tex`` commands. Documents like this one are +initially written in a dialect of RST which adds support for nimrod sourcecode +highlighting with the ``.. code-block:: nimrod`` prefix. ``code-block`` also +supports highlighting of C++ and some other c-like languages. Usage:: nimrod rst2html docgen.txt @@ -170,8 +178,9 @@ Usage:: Output:: You're reading it! -The input can be viewed here `docgen.txt <docgen.txt>`_. The ``rst2tex`` command is invoked identically to -``rst2html``, but outputs a .tex file instead of .html. +The input can be viewed here `docgen.txt <docgen.txt>`_. The ``rst2tex`` +command is invoked identically to ``rst2html``, but outputs a .tex file instead +of .html. Additional Resources @@ -179,4 +188,5 @@ Additional Resources `Nimrod Compiler User Guide <nimrodc.html#command-line-switches>`_ -`RST Quick Reference <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_ +`RST Quick Reference +<http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_ From 5844697aa6875b03fb4b7df4ccbcb824a3c1e1c1 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 6 Jan 2014 13:31:21 +0100 Subject: [PATCH 194/326] Adds docgen to list of documentation to build. --- web/nimrod.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/nimrod.ini b/web/nimrod.ini index f10a4b2f21..b3e8594459 100644 --- a/web/nimrod.ini +++ b/web/nimrod.ini @@ -37,7 +37,7 @@ UNIX. We don't believe this to be a coincidence. - Jeremy S. Anderson.""" [Documentation] doc: "endb;intern;apis;lib;manual;tut1;tut2;nimrodc;overview;filters;trmacros" -doc: "tools;c2nim;niminst;nimgrep;gc;estp;idetools" +doc: "tools;c2nim;niminst;nimgrep;gc;estp;idetools;docgen" pdf: "manual;lib;tut1;tut2;nimrodc;c2nim;niminst;gc" srcdoc2: "system.nim;impure/graphics;wrappers/sdl" srcdoc2: "core/macros;pure/marshal;core/typeinfo;core/unsigned" From 91ae5a3585d93c94d1dba45c9c607496945bce0e Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 6 Jan 2014 13:40:11 +0100 Subject: [PATCH 195/326] Adds some cross references to docgen manual. --- doc/docgen.txt | 12 ++++++------ doc/nimrodc.txt | 7 +++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/docgen.txt b/doc/docgen.txt index 0e897dcd59..2ef06e578f 100644 --- a/doc/docgen.txt +++ b/doc/docgen.txt @@ -11,12 +11,12 @@ Introduction ============ -This document describes the documentation generation tools built into the -*Nimrod compiler*, which can generate HTML and JSON output from input .nim -files and projects, as well as HTML and LaTeX from input RST (reStructuredText) -files. The output documentation will include module dependencies (``import``), -any top-level documentation comments (##), and exported symbols (*), including -procedures, types, and variables. +This document describes the `documentation generation tools`:idx: built into +the `Nimrod compiler <nimrodc.html>`_, which can generate HTML and JSON output +from input .nim files and projects, as well as HTML and LaTeX from input RST +(reStructuredText) files. The output documentation will include module +dependencies (``import``), any top-level documentation comments (##), and +exported symbols (*), including procedures, types, and variables. Documentation Comments diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt index f5fbf3ebbe..52e0a6eaf4 100644 --- a/doc/nimrodc.txt +++ b/doc/nimrodc.txt @@ -538,6 +538,13 @@ on Linux:: nimrod c --dynlibOverride:lua --passL:liblua.lib program.nim +Nimrod documentation tools +========================== + +Nimrod provides the `doc`:idx: and `doc2`:idx: commands to generate HTML +documentation from ``.nim`` source files. Only exported symbols will appear in +the output. For more details `see the docgen documentation <docgen.html>`_. + Nimrod idetools integration =========================== From 2ed7849921f0413c175094ff15b1cf71d931ed1c Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 6 Jan 2014 14:55:03 +0100 Subject: [PATCH 196/326] Transforms docgen sample to be generated from source. --- doc/docgen.txt | 4 +- doc/docgen_sample.nim | 12 ++ doc/docgen_samples/sample.html | 282 -------------------------------- doc/docgen_samples/sample2.html | 282 -------------------------------- tools/nimweb.nim | 14 ++ 5 files changed, 28 insertions(+), 566 deletions(-) create mode 100644 doc/docgen_sample.nim delete mode 100644 doc/docgen_samples/sample.html delete mode 100644 doc/docgen_samples/sample2.html diff --git a/doc/docgen.txt b/doc/docgen.txt index 2ef06e578f..acd09f2eb1 100644 --- a/doc/docgen.txt +++ b/doc/docgen.txt @@ -97,7 +97,7 @@ Partial Output:: proc helloWorld*(times: int) ... -Output can be viewed in full here `sample.html <docgen_samples/sample.html>`_. +Output can be viewed in full here: `docgen_sample.html <docgen_sample.html>`_. The next command, called ``doc2``, is very similar to the ``doc`` command, but will be run after the compiler performs semantic checking on the input nimrod module(s), which allows it to process macros. @@ -110,7 +110,7 @@ Partial Output:: proc helloWorld(times: int) {.raises: [], tags: [].} ... -The full output can be seen here `sample2.html <docgen_samples/sample2.html>`_. +The full output can be seen here: `docgen_sample2.html <docgen_sample2.html>`_. As you can see, the tool has extracted additional information provided to it by the compiler beyond what the ``doc`` command provides, such as pragmas attached implicitly by the compiler. This type of information is not available from diff --git a/doc/docgen_sample.nim b/doc/docgen_sample.nim new file mode 100644 index 0000000000..8759931873 --- /dev/null +++ b/doc/docgen_sample.nim @@ -0,0 +1,12 @@ +## This module is a sample. + +import strutils + +proc helloWorld*(times: int) = + ## Takes an integer and outputs + ## as many "hello world!"s + + for i in 0 .. times-1: + echo "hello world!" + +helloWorld(5) diff --git a/doc/docgen_samples/sample.html b/doc/docgen_samples/sample.html deleted file mode 100644 index 4efa40905e..0000000000 --- a/doc/docgen_samples/sample.html +++ /dev/null @@ -1,282 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<!-- This file is generated by Nimrod. --> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Module sample</title> -<style type="text/css"> - -span.DecNumber {color: blue} -span.BinNumber {color: blue} -span.HexNumber {color: blue} -span.OctNumber {color: blue} -span.FloatNumber {color: blue} -span.Identifier {color: black} -span.Keyword {font-weight: bold} -span.StringLit {color: blue} -span.LongStringLit {color: blue} -span.CharLit {color: blue} -span.EscapeSequence {color: black} -span.Operator {color: black} -span.Punctation {color: black} -span.Comment, span.LongComment {font-style:italic; color: green} -span.RegularExpression {color: DarkViolet} -span.TagStart {color: DarkViolet} -span.TagEnd {color: DarkViolet} -span.Key {color: blue} -span.Value {color: black} -span.RawData {color: blue} -span.Assembler {color: blue} -span.Preprocessor {color: DarkViolet} -span.Directive {color: DarkViolet} -span.Command, span.Rule, span.Hyperlink, span.Label, span.Reference, -span.Other {color: black} - -div.navigation { - -moz-border-radius: 5px 5px 5px 5px; - float: left; - width: 30%; - margin: 0; padding: 0; - border: 3px outset #7F7F7F; - background-color: #7F7F7F; -} - -div.navigation ul { - list-style-type: none; - padding-left: 1em; -} -div.navigation ul li a, div.navigation ul li a:visited { - font-weight: bold; - color: #FFFFFF; - text-decoration: none; -} -div.navigation ul li a:hover { - font-weight: bold; - text-decoration: none; - color: gold; -} - -div.content { - margin-left: 30%; - padding: 0 1em; - border-left: 4em; -} - -dl.item dd, dl.item dd p { - margin-top:3px; -} -dl.item dd pre { - margin-left: 15pt; - border: 0px; -} -dl.item dt, dl.item dt pre { - margin: 20pt 0 0 5pt; -} - -pre, span.tok { - background-color: #F9F9F9; - border-color: #C4C4C4; - border-style: solid; - border-width: 1px 1px 1px 2px; - color: black; - line-spacing: 110%; - padding: 2px; -} - -span.red { - color: #A80000; -} - -hr {background-color:#9D9D9D; border:0 none; color:#9D9D9D; height:1px; width:100%;} - -/* -:Author: David Goodger -:Contact: goodger@python.org -:Date: Date: 2006-05-21 22:44:42 +0200 (Sun, 21 May 2006) -:Revision: Revision: 4564 -:Copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the HTML output of Docutils. - -See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to -customize this style sheet. -*/ -/* used to remove borders from tables and images */ -.borderless, table.borderless td, table.borderless th { border: 0 } - -table.borderless td, table.borderless th { - /* Override padding for "table.docutils td" with "! important". - The right padding separates the table cells. */ - padding: 0 0.5em 0 0 ! important } - -.first { margin-top: 0 ! important } -.last, .with-subtitle { margin-bottom: 0 ! important } -.hidden { display: none } -a.toc-backref { text-decoration: none ; color: black } -blockquote.epigraph { margin: 2em 5em ; } -dl.docutils dd { margin-bottom: 0.5em } -div.abstract { margin: 2em 5em } -div.abstract p.topic-title { font-weight: bold ; text-align: center } -div.admonition, div.attention, div.caution, div.danger, div.error, -div.hint, div.important, div.note, div.tip, div.warning { - margin: 2em ; border: medium outset ; padding: 1em } -div.admonition p.admonition-title, div.hint p.admonition-title, -div.important p.admonition-title, div.note p.admonition-title, -div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { color: red ; font-weight: bold ; - font-family: sans-serif } - -/* Uncomment (and remove this text!) to get reduced vertical space in - compound paragraphs. -div.compound .compound-first, div.compound .compound-middle { - margin-bottom: 0.5em } - -div.compound .compound-last, div.compound .compound-middle { - margin-top: 0.5em } -*/ - -div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } -div.dedication p.topic-title { font-weight: bold ; font-style: normal } -div.figure { margin-left: 2em ; margin-right: 2em } -div.footer, div.header { clear: both; font-size: smaller } -div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } -div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; - margin-left: 1.5em } -div.sidebar { margin-left: 1em ; border: medium outset ; - padding: 1em ; background-color: #ffffee ; /*width: 40% ;*/ float: right ; - clear: right } - -div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } -div.system-messages { margin: 5em } -div.system-messages h1 { color: red } -div.system-message { border: medium outset ; padding: 1em } -div.system-message p.system-message-title { color: red ; font-weight: bold } -div.topic { margin: 2em;} -h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, -h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { - margin-top: 0.4em } -h1.title { text-align: center } -h2.subtitle { text-align: center } -/* hr.docutils { width: 75% } */ -img.align-left { clear: left } -img.align-right { clear: right } -ol.simple, ul.simple { margin-bottom: 1em } -ol.arabic { list-style: decimal } -ol.loweralpha { list-style: lower-alpha } -ol.upperalpha { list-style: upper-alpha } -ol.lowerroman { list-style: lower-roman } -ol.upperroman { list-style: upper-roman } -p.attribution { text-align: right ; margin-left: 50% } -p.caption { font-style: italic } -p.credits { font-style: italic ; font-size: smaller } -p.label { white-space: nowrap } -p.rubric { font-weight:bold;font-size:larger;color:maroon;text-align:center} -p.sidebar-title {font-family: sans-serif ;font-weight: bold ;font-size: larger } -p.sidebar-subtitle {font-family: sans-serif ; font-weight: bold } -p.topic-title { -font-weight: bold; -background-color: #6D6D6D; -border-bottom: 1px solid #000000; -border-top: 1px solid black; -color: white; -text-align: center; -margin: 0; -} -pre.address { margin-bottom: 0;margin-top:0;font-family:serif;font-size:100% } -pre.literal-block, pre.doctest-block {margin-left: 2em ;margin-right: 2em } -span.classifier {font-family: sans-serif;font-style: oblique } -span.classifier-delimiter {font-family: sans-serif;font-weight: bold } -span.interpreted {font-family: sans-serif } -span.option {white-space: nowrap } -span.pre {white-space: pre } -span.problematic {color: red } -span.section-subtitle { - /* font-size relative to parent (h1..h6 element) */ - font-size: 80% } - -table.citation { border-left: solid 1px gray; margin-left: 1px } -table.docinfo {margin: 2em 4em } -table.docutils {margin-top: 0.5em;margin-bottom: 0.5em; border: 0 solid #9d9d9d; border-collapse: collapse; } -table.footnote {border-left: solid 1px black;margin-left: 1px } - -table.docutils td, table.docutils th, -table.docinfo td, table.docinfo th {padding-left: 0.5em;padding-right: 0.5em; - vertical-align: top;} - -table.docutils td, table.docutils th { border-bottom:1px solid #9D9D9D; } -/* color: #4d4d4d} */ - -/* table.docutils td:hover, table.docinfo td:hover {color: #000000} */ - - -table.docutils th.field-name, table.docinfo th.docinfo-name { - font-weight: bold;text-align: left;white-space: nowrap;padding-left: 0 } - -table.docutils th -{ -color: black; -font-weight:normal; -background-color: #E3E3E3; -border-top: 1px solid #1d1d1d; -border-bottom: 1px solid #1d1d1d; -} - -h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, -h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {font-size: 100% } -ul.auto-toc { list-style-type: none } -/*a.reference { color: #E00000; font-weight:bold;} -a.reference:hover {color: #E00000;background-color: #ffff00;display: margin; - font-weight:bold;}*/ - -</style> - -</head> -<body> -<div class="document" id="documentId"> -<h1 class="title">Module sample</h1> -<div class="navigation" id="navigation"> -<ul class="simple"> -<li> - <a class="reference" href="#6" id="56">Imports</a> - <ul class="simple"> - - </ul> -</li> -<li> - <a class="reference" href="#12" id="62">Procs</a> - <ul class="simple"> - <li><a class="reference" href="#101"><wbr />hello<wbr />World</a></li> - - </ul> -</li> - -</ul> -</div> -<div class="content" id="content"> -This module is a sample. -<div class="section" id="6"> -<h1><a class="toc-backref" href="#56">Imports</a></h1> -<dl class="item"> -<a class="reference external" href="strutils.html">strutils</a> -</dl></div> -<div class="section" id="12"> -<h1><a class="toc-backref" href="#62">Procs</a></h1> -<dl class="item"> -<dt id="101"><pre><span class="Keyword">proc</span> <span class="Identifier">helloWorld</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">times</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span></pre></dt> -<dd> -Takes an integer and outputs as many &quot;hello world!&quot;s -</dd> - -</dl></div> - -</div> - -<small>Generated: 2013-12-21 11:45:42 UTC</small> -</div> -</body> -</html> diff --git a/doc/docgen_samples/sample2.html b/doc/docgen_samples/sample2.html deleted file mode 100644 index 3ff5e27e54..0000000000 --- a/doc/docgen_samples/sample2.html +++ /dev/null @@ -1,282 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<!-- This file is generated by Nimrod. --> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Module sample</title> -<style type="text/css"> - -span.DecNumber {color: blue} -span.BinNumber {color: blue} -span.HexNumber {color: blue} -span.OctNumber {color: blue} -span.FloatNumber {color: blue} -span.Identifier {color: black} -span.Keyword {font-weight: bold} -span.StringLit {color: blue} -span.LongStringLit {color: blue} -span.CharLit {color: blue} -span.EscapeSequence {color: black} -span.Operator {color: black} -span.Punctation {color: black} -span.Comment, span.LongComment {font-style:italic; color: green} -span.RegularExpression {color: DarkViolet} -span.TagStart {color: DarkViolet} -span.TagEnd {color: DarkViolet} -span.Key {color: blue} -span.Value {color: black} -span.RawData {color: blue} -span.Assembler {color: blue} -span.Preprocessor {color: DarkViolet} -span.Directive {color: DarkViolet} -span.Command, span.Rule, span.Hyperlink, span.Label, span.Reference, -span.Other {color: black} - -div.navigation { - -moz-border-radius: 5px 5px 5px 5px; - float: left; - width: 30%; - margin: 0; padding: 0; - border: 3px outset #7F7F7F; - background-color: #7F7F7F; -} - -div.navigation ul { - list-style-type: none; - padding-left: 1em; -} -div.navigation ul li a, div.navigation ul li a:visited { - font-weight: bold; - color: #FFFFFF; - text-decoration: none; -} -div.navigation ul li a:hover { - font-weight: bold; - text-decoration: none; - color: gold; -} - -div.content { - margin-left: 30%; - padding: 0 1em; - border-left: 4em; -} - -dl.item dd, dl.item dd p { - margin-top:3px; -} -dl.item dd pre { - margin-left: 15pt; - border: 0px; -} -dl.item dt, dl.item dt pre { - margin: 20pt 0 0 5pt; -} - -pre, span.tok { - background-color: #F9F9F9; - border-color: #C4C4C4; - border-style: solid; - border-width: 1px 1px 1px 2px; - color: black; - line-spacing: 110%; - padding: 2px; -} - -span.red { - color: #A80000; -} - -hr {background-color:#9D9D9D; border:0 none; color:#9D9D9D; height:1px; width:100%;} - -/* -:Author: David Goodger -:Contact: goodger@python.org -:Date: Date: 2006-05-21 22:44:42 +0200 (Sun, 21 May 2006) -:Revision: Revision: 4564 -:Copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the HTML output of Docutils. - -See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to -customize this style sheet. -*/ -/* used to remove borders from tables and images */ -.borderless, table.borderless td, table.borderless th { border: 0 } - -table.borderless td, table.borderless th { - /* Override padding for "table.docutils td" with "! important". - The right padding separates the table cells. */ - padding: 0 0.5em 0 0 ! important } - -.first { margin-top: 0 ! important } -.last, .with-subtitle { margin-bottom: 0 ! important } -.hidden { display: none } -a.toc-backref { text-decoration: none ; color: black } -blockquote.epigraph { margin: 2em 5em ; } -dl.docutils dd { margin-bottom: 0.5em } -div.abstract { margin: 2em 5em } -div.abstract p.topic-title { font-weight: bold ; text-align: center } -div.admonition, div.attention, div.caution, div.danger, div.error, -div.hint, div.important, div.note, div.tip, div.warning { - margin: 2em ; border: medium outset ; padding: 1em } -div.admonition p.admonition-title, div.hint p.admonition-title, -div.important p.admonition-title, div.note p.admonition-title, -div.tip p.admonition-title { font-weight: bold ; font-family: sans-serif } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { color: red ; font-weight: bold ; - font-family: sans-serif } - -/* Uncomment (and remove this text!) to get reduced vertical space in - compound paragraphs. -div.compound .compound-first, div.compound .compound-middle { - margin-bottom: 0.5em } - -div.compound .compound-last, div.compound .compound-middle { - margin-top: 0.5em } -*/ - -div.dedication { margin: 2em 5em ; text-align: center ; font-style: italic } -div.dedication p.topic-title { font-weight: bold ; font-style: normal } -div.figure { margin-left: 2em ; margin-right: 2em } -div.footer, div.header { clear: both; font-size: smaller } -div.line-block { display: block ; margin-top: 1em ; margin-bottom: 1em } -div.line-block div.line-block { margin-top: 0 ; margin-bottom: 0 ; - margin-left: 1.5em } -div.sidebar { margin-left: 1em ; border: medium outset ; - padding: 1em ; background-color: #ffffee ; /*width: 40% ;*/ float: right ; - clear: right } - -div.sidebar p.rubric { font-family: sans-serif ; font-size: medium } -div.system-messages { margin: 5em } -div.system-messages h1 { color: red } -div.system-message { border: medium outset ; padding: 1em } -div.system-message p.system-message-title { color: red ; font-weight: bold } -div.topic { margin: 2em;} -h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, -h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { - margin-top: 0.4em } -h1.title { text-align: center } -h2.subtitle { text-align: center } -/* hr.docutils { width: 75% } */ -img.align-left { clear: left } -img.align-right { clear: right } -ol.simple, ul.simple { margin-bottom: 1em } -ol.arabic { list-style: decimal } -ol.loweralpha { list-style: lower-alpha } -ol.upperalpha { list-style: upper-alpha } -ol.lowerroman { list-style: lower-roman } -ol.upperroman { list-style: upper-roman } -p.attribution { text-align: right ; margin-left: 50% } -p.caption { font-style: italic } -p.credits { font-style: italic ; font-size: smaller } -p.label { white-space: nowrap } -p.rubric { font-weight:bold;font-size:larger;color:maroon;text-align:center} -p.sidebar-title {font-family: sans-serif ;font-weight: bold ;font-size: larger } -p.sidebar-subtitle {font-family: sans-serif ; font-weight: bold } -p.topic-title { -font-weight: bold; -background-color: #6D6D6D; -border-bottom: 1px solid #000000; -border-top: 1px solid black; -color: white; -text-align: center; -margin: 0; -} -pre.address { margin-bottom: 0;margin-top:0;font-family:serif;font-size:100% } -pre.literal-block, pre.doctest-block {margin-left: 2em ;margin-right: 2em } -span.classifier {font-family: sans-serif;font-style: oblique } -span.classifier-delimiter {font-family: sans-serif;font-weight: bold } -span.interpreted {font-family: sans-serif } -span.option {white-space: nowrap } -span.pre {white-space: pre } -span.problematic {color: red } -span.section-subtitle { - /* font-size relative to parent (h1..h6 element) */ - font-size: 80% } - -table.citation { border-left: solid 1px gray; margin-left: 1px } -table.docinfo {margin: 2em 4em } -table.docutils {margin-top: 0.5em;margin-bottom: 0.5em; border: 0 solid #9d9d9d; border-collapse: collapse; } -table.footnote {border-left: solid 1px black;margin-left: 1px } - -table.docutils td, table.docutils th, -table.docinfo td, table.docinfo th {padding-left: 0.5em;padding-right: 0.5em; - vertical-align: top;} - -table.docutils td, table.docutils th { border-bottom:1px solid #9D9D9D; } -/* color: #4d4d4d} */ - -/* table.docutils td:hover, table.docinfo td:hover {color: #000000} */ - - -table.docutils th.field-name, table.docinfo th.docinfo-name { - font-weight: bold;text-align: left;white-space: nowrap;padding-left: 0 } - -table.docutils th -{ -color: black; -font-weight:normal; -background-color: #E3E3E3; -border-top: 1px solid #1d1d1d; -border-bottom: 1px solid #1d1d1d; -} - -h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, -h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {font-size: 100% } -ul.auto-toc { list-style-type: none } -/*a.reference { color: #E00000; font-weight:bold;} -a.reference:hover {color: #E00000;background-color: #ffff00;display: margin; - font-weight:bold;}*/ - -</style> - -</head> -<body> -<div class="document" id="documentId"> -<h1 class="title">Module sample</h1> -<div class="navigation" id="navigation"> -<ul class="simple"> -<li> - <a class="reference" href="#6" id="56">Imports</a> - <ul class="simple"> - - </ul> -</li> -<li> - <a class="reference" href="#12" id="62">Procs</a> - <ul class="simple"> - <li><a class="reference" href="#101"><wbr />hello<wbr />World</a></li> - - </ul> -</li> - -</ul> -</div> -<div class="content" id="content"> -This module is a sample. -<div class="section" id="6"> -<h1><a class="toc-backref" href="#56">Imports</a></h1> -<dl class="item"> -<a class="reference external" href="strutils.html">strutils</a> -</dl></div> -<div class="section" id="12"> -<h1><a class="toc-backref" href="#62">Procs</a></h1> -<dl class="item"> -<dt id="101"><pre><span class="Keyword">proc</span> <span class="Identifier">helloWorld</span><span class="Other">(</span><span class="Identifier">times</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span> <span class="Other">{.</span><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">.}</span></pre></dt> -<dd> -Takes an integer and outputs as many &quot;hello world!&quot;s -</dd> - -</dl></div> - -</div> - -<small>Generated: 2013-12-21 11:45:52 UTC</small> -</div> -</body> -</html> diff --git a/tools/nimweb.nim b/tools/nimweb.nim index c5d510eacc..0e519b4b82 100644 --- a/tools/nimweb.nim +++ b/tools/nimweb.nim @@ -204,6 +204,18 @@ proc Exec(cmd: string) = echo(cmd) if os.execShellCmd(cmd) != 0: quit("external program failed") +proc buildDocSamples(c: var TConfigData, destPath: string) = + ## Special case documentation sample proc. + ## + ## The docgen sample needs to be generated twice with different commands, so + ## it didn't make much sense to integrate into the existing generic + ## documentation builders. + const src = "doc"/"docgen_sample.nim" + Exec("nimrod doc $# -o:$# $#" % + [c.nimrodArgs, destPath / "docgen_sample.html", src]) + Exec("nimrod doc2 $# -o:$# $#" % + [c.nimrodArgs, destPath / "docgen_sample2.html", src]) + proc buildDoc(c: var TConfigData, destPath: string) = # call nim for the documentation: for d in items(c.doc): @@ -352,7 +364,9 @@ proc main(c: var TConfigData) = copyDir("web/assets", "web/upload/assets") buildNewsRss(c, "web/upload") buildAddDoc(c, "web/upload") + buildDocSamples(c, "web/upload") buildDoc(c, "web/upload") + buildDocSamples(c, "doc") buildDoc(c, "doc") buildPdfDoc(c, "doc") From 346443d1b552574c1f259cd9e6080c2d0063fa9c Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 11 Jan 2014 21:56:05 +0100 Subject: [PATCH 197/326] case consistency improvements --- compiler/parampatterns.nim | 2 +- koch.nim | 4 +- lib/core/locks.nim | 50 +++++++++++----------- lib/impure/db_mongo.nim | 6 +-- lib/impure/db_mysql.nim | 24 +++++------ lib/impure/db_postgres.nim | 22 +++++----- lib/impure/graphics.nim | 2 +- lib/impure/osinfo_win.nim | 44 ++++++++++---------- lib/impure/rdstdin.nim | 2 +- lib/pure/collections/LockFreeHash.nim | 3 +- lib/system.nim | 2 +- lib/system/atomics.nim | 16 +++---- lib/system/channels.nim | 26 ++++++------ lib/system/syslocks.nim | 3 ++ lib/system/threads.nim | 60 +++++++++++++-------------- lib/wrappers/mysql.nim | 4 +- tests/compile/toptions.nim | 4 -- todo.txt | 2 + 18 files changed, 139 insertions(+), 137 deletions(-) diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim index be0f995b6d..e94068776c 100644 --- a/compiler/parampatterns.nim +++ b/compiler/parampatterns.nim @@ -216,7 +216,7 @@ proc isAssignable*(owner: PSym, n: PNode): TAssignableResult = of nkObjUpConv, nkObjDownConv, nkCheckedFieldExpr: result = isAssignable(owner, n.sons[0]) else: - nil + discard proc matchNodeKinds*(p, n: PNode): bool = # matches the parameter constraint 'p' against the concrete AST 'n'. diff --git a/koch.nim b/koch.nim index 2dac27fbf2..1b5c96b234 100644 --- a/koch.nim +++ b/koch.nim @@ -178,9 +178,9 @@ proc cleanAux(dir: string) = of "nimcache": echo "removing dir: ", path removeDir(path) - of "dist", ".git", "icons": nil + of "dist", ".git", "icons": discard else: cleanAux(path) - else: nil + else: discard proc removePattern(pattern: string) = for f in walkFiles(pattern): diff --git a/lib/core/locks.nim b/lib/core/locks.nim index 071bde93a5..894965a85f 100644 --- a/lib/core/locks.nim +++ b/lib/core/locks.nim @@ -45,28 +45,28 @@ when noDeadlocks: locksLen {.threadvar.}: int locks {.threadvar.}: array [0..MaxLocksPerThread-1, pointer] - proc OrderedLocks(): bool = + proc orderedLocks(): bool = for i in 0 .. locksLen-2: if locks[i] >= locks[i+1]: return false result = true -proc InitLock*(lock: var TLock) {.inline.} = +proc initLock*(lock: var TLock) {.inline.} = ## Initializes the given lock. - InitSysLock(lock) + initSysLock(lock) -proc DeinitLock*(lock: var TLock) {.inline.} = +proc deinitLock*(lock: var TLock) {.inline.} = ## Frees the resources associated with the lock. - DeinitSys(lock) + deinitSys(lock) -proc TryAcquire*(lock: var TLock): bool {.tags: [FAquireLock].} = +proc tryAcquire*(lock: var TLock): bool {.tags: [FAquireLock].} = ## Tries to acquire the given lock. Returns `true` on success. - result = TryAcquireSys(lock) + result = tryAcquireSys(lock) when noDeadlocks: if not result: return # we have to add it to the ordered list. Oh, and we might fail if # there is no space in the array left ... if locksLen >= len(locks): - ReleaseSys(lock) + releaseSys(lock) raise newException(EResourceExhausted, "cannot acquire additional lock") # find the position to add: var p = addr(lock) @@ -83,14 +83,14 @@ proc TryAcquire*(lock: var TLock): bool {.tags: [FAquireLock].} = dec L locks[i] = p inc(locksLen) - assert OrderedLocks() + assert orderedLocks() return # simply add to the end: locks[locksLen] = p inc(locksLen) - assert OrderedLocks() + assert orderedLocks() -proc Acquire*(lock: var TLock) {.tags: [FAquireLock].} = +proc acquire*(lock: var TLock) {.tags: [FAquireLock].} = ## Acquires the given lock. when nodeadlocks: var p = addr(lock) @@ -106,36 +106,36 @@ proc Acquire*(lock: var TLock) {.tags: [FAquireLock].} = raise newException(EResourceExhausted, "cannot acquire additional lock") while L >= i: - ReleaseSys(cast[ptr TSysLock](locks[L])[]) + releaseSys(cast[ptr TSysLock](locks[L])[]) locks[L+1] = locks[L] dec L # acquire the current lock: - AcquireSys(lock) + acquireSys(lock) locks[i] = p inc(locksLen) # acquire old locks in proper order again: L = locksLen-1 inc i while i <= L: - AcquireSys(cast[ptr TSysLock](locks[i])[]) + acquireSys(cast[ptr TSysLock](locks[i])[]) inc(i) # DANGER: We can only modify this global var if we gained every lock! # NO! We need an atomic increment. Crap. discard system.atomicInc(deadlocksPrevented, 1) - assert OrderedLocks() + assert orderedLocks() return # simply add to the end: if locksLen >= len(locks): raise newException(EResourceExhausted, "cannot acquire additional lock") - AcquireSys(lock) + acquireSys(lock) locks[locksLen] = p inc(locksLen) - assert OrderedLocks() + assert orderedLocks() else: - AcquireSys(lock) + acquireSys(lock) -proc Release*(lock: var TLock) {.tags: [FReleaseLock].} = +proc release*(lock: var TLock) {.tags: [FReleaseLock].} = ## Releases the given lock. when nodeadlocks: var p = addr(lock) @@ -145,20 +145,20 @@ proc Release*(lock: var TLock) {.tags: [FReleaseLock].} = for j in i..L-2: locks[j] = locks[j+1] dec locksLen break - ReleaseSys(lock) + releaseSys(lock) -proc InitCond*(cond: var TCond) {.inline.} = +proc initCond*(cond: var TCond) {.inline.} = ## Initializes the given condition variable. - InitSysCond(cond) + initSysCond(cond) -proc DeinitCond*(cond: var TCond) {.inline.} = +proc deinitCond*(cond: var TCond) {.inline.} = ## Frees the resources associated with the lock. - DeinitSysCond(cond) + deinitSysCond(cond) proc wait*(cond: var TCond, lock: var TLock) {.inline.} = ## waits on the condition variable `cond`. - WaitSysCond(cond, lock) + waitSysCond(cond, lock) proc signal*(cond: var TCond) {.inline.} = ## sends a signal to the condition variable `cond`. diff --git a/lib/impure/db_mongo.nim b/lib/impure/db_mongo.nim index b11db78f88..d012f677f8 100644 --- a/lib/impure/db_mongo.nim +++ b/lib/impure/db_mongo.nim @@ -47,12 +47,12 @@ proc dbError*(db: TDbConn, msg: string) {.noreturn.} = e.msg = $db.err & " " & msg raise e -proc Close*(db: var TDbConn) {.tags: [FDB].} = +proc close*(db: var TDbConn) {.tags: [FDB].} = ## closes the database connection. disconnect(db) destroy(db) -proc Open*(host: string = defaultHost, port: int = defaultPort): TDbConn {. +proc open*(host: string = defaultHost, port: int = defaultPort): TDbConn {. tags: [FDB].} = ## opens a database connection. Raises `EDb` if the connection could not ## be established. @@ -113,7 +113,7 @@ proc getId*(obj: var TBSon): TOid = else: raise newException(EInvalidIndex, "_id not in object") -proc insertID*(db: var TDbConn, namespace: string, data: PJsonNode): TOid {. +proc insertId*(db: var TDbConn, namespace: string, data: PJsonNode): TOid {. tags: [FWriteDb].} = ## converts `data` to BSON format and inserts it in `namespace`. Returns ## the generated OID for the ``_id`` field. diff --git a/lib/impure/db_mysql.nim b/lib/impure/db_mysql.nim index 91cf8a5ebd..8cdccda018 100644 --- a/lib/impure/db_mysql.nim +++ b/lib/impure/db_mysql.nim @@ -65,7 +65,7 @@ proc dbFormat(formatstr: TSqlQuery, args: varargs[string]): string = else: add(result, c) -proc TryExec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): bool {. +proc tryExec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): bool {. tags: [FReadDB, FWriteDb].} = ## tries to execute the query and returns true if successful, false otherwise. var q = dbFormat(query, args) @@ -75,7 +75,7 @@ proc rawExec(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]) = var q = dbFormat(query, args) if mysql.RealQuery(db, q, q.len) != 0'i32: dbError(db) -proc Exec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]) {. +proc exec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]) {. tags: [FReadDB, FWriteDb].} = ## executes the query and raises EDB if not successful. var q = dbFormat(query, args) @@ -90,7 +90,7 @@ proc properFreeResult(sqlres: mysql.PRES, row: cstringArray) = while mysql.FetchRow(sqlres) != nil: nil mysql.FreeResult(sqlres) -iterator FastRows*(db: TDbConn, query: TSqlQuery, +iterator fastRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = ## executes the query and iterates over the result dataset. This is very ## fast, but potenially dangerous: If the for-loop-body executes another @@ -126,7 +126,7 @@ proc getRow*(db: TDbConn, query: TSqlQuery, add(result[i], row[i]) properFreeResult(sqlres, row) -proc GetAllRows*(db: TDbConn, query: TSqlQuery, +proc getAllRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): seq[TRow] {.tags: [FReadDB].} = ## executes the query and returns the whole result dataset. result = @[] @@ -145,12 +145,12 @@ proc GetAllRows*(db: TDbConn, query: TSqlQuery, inc(j) mysql.FreeResult(sqlres) -iterator Rows*(db: TDbConn, query: TSqlQuery, +iterator rows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = ## same as `FastRows`, but slower and safe. for r in items(GetAllRows(db, query, args)): yield r -proc GetValue*(db: TDbConn, query: TSqlQuery, +proc getValue*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): string {.tags: [FReadDB].} = ## executes the query and returns the first column of the first row of the ## result dataset. Returns "" if the dataset contains no rows or the database @@ -160,7 +160,7 @@ proc GetValue*(db: TDbConn, query: TSqlQuery, result = row[0] break -proc TryInsertID*(db: TDbConn, query: TSqlQuery, +proc tryInsertId*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} = ## executes the query (typically "INSERT") and returns the ## generated ID for the row or -1 in case of an error. @@ -170,14 +170,14 @@ proc TryInsertID*(db: TDbConn, query: TSqlQuery, else: result = mysql.InsertId(db) -proc InsertID*(db: TDbConn, query: TSqlQuery, +proc insertId*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} = ## executes the query (typically "INSERT") and returns the ## generated ID for the row. result = TryInsertID(db, query, args) if result < 0: dbError(db) -proc ExecAffectedRows*(db: TDbConn, query: TSqlQuery, +proc execAffectedRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {. tags: [FReadDB, FWriteDb].} = ## runs the query (typically "UPDATE") and returns the @@ -185,11 +185,11 @@ proc ExecAffectedRows*(db: TDbConn, query: TSqlQuery, rawExec(db, query, args) result = mysql.AffectedRows(db) -proc Close*(db: TDbConn) {.tags: [FDb].} = +proc close*(db: TDbConn) {.tags: [FDb].} = ## closes the database connection. - if db != nil: mysql.Close(db) + if db != nil: mysql.close(db) -proc Open*(connection, user, password, database: string): TDbConn {. +proc open*(connection, user, password, database: string): TDbConn {. tags: [FDb].} = ## opens a database connection. Raises `EDb` if the connection could not ## be established. diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim index 157d58c7cf..f6ae933030 100644 --- a/lib/impure/db_postgres.nim +++ b/lib/impure/db_postgres.nim @@ -64,7 +64,7 @@ proc dbFormat(formatstr: TSqlQuery, args: varargs[string]): string = else: add(result, c) -proc TryExec*(db: TDbConn, query: TSqlQuery, +proc tryExec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): bool {.tags: [FReadDB, FWriteDb].} = ## tries to execute the query and returns true if successful, false otherwise. var q = dbFormat(query, args) @@ -72,7 +72,7 @@ proc TryExec*(db: TDbConn, query: TSqlQuery, result = PQresultStatus(res) == PGRES_COMMAND_OK PQclear(res) -proc Exec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]) {. +proc exec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]) {. tags: [FReadDB, FWriteDb].} = ## executes the query and raises EDB if not successful. var q = dbFormat(query, args) @@ -96,7 +96,7 @@ proc setRow(res: PPGresult, r: var TRow, line, cols: int32) = var x = PQgetvalue(res, line, col) add(r[col], x) -iterator FastRows*(db: TDbConn, query: TSqlQuery, +iterator fastRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = ## executes the query and iterates over the result dataset. This is very ## fast, but potenially dangerous: If the for-loop-body executes another @@ -119,19 +119,19 @@ proc getRow*(db: TDbConn, query: TSqlQuery, setRow(res, result, 0, L) PQclear(res) -proc GetAllRows*(db: TDbConn, query: TSqlQuery, +proc getAllRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): seq[TRow] {.tags: [FReadDB].} = ## executes the query and returns the whole result dataset. result = @[] for r in FastRows(db, query, args): result.add(r) -iterator Rows*(db: TDbConn, query: TSqlQuery, +iterator rows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = ## same as `FastRows`, but slower and safe. for r in items(GetAllRows(db, query, args)): yield r -proc GetValue*(db: TDbConn, query: TSqlQuery, +proc getValue*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): string {.tags: [FReadDB].} = ## executes the query and returns the first column of the first row of the ## result dataset. Returns "" if the dataset contains no rows or the database @@ -139,7 +139,7 @@ proc GetValue*(db: TDbConn, query: TSqlQuery, var x = PQgetvalue(setupQuery(db, query, args), 0, 0) result = if isNil(x): "" else: $x -proc TryInsertID*(db: TDbConn, query: TSqlQuery, +proc tryInsertID*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {.tags: [FWriteDb].}= ## executes the query (typically "INSERT") and returns the ## generated ID for the row or -1 in case of an error. For Postgre this adds @@ -152,7 +152,7 @@ proc TryInsertID*(db: TDbConn, query: TSqlQuery, else: result = -1 -proc InsertID*(db: TDbConn, query: TSqlQuery, +proc insertID*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} = ## executes the query (typically "INSERT") and returns the ## generated ID for the row. For Postgre this adds @@ -161,7 +161,7 @@ proc InsertID*(db: TDbConn, query: TSqlQuery, result = TryInsertID(db, query, args) if result < 0: dbError(db) -proc ExecAffectedRows*(db: TDbConn, query: TSqlQuery, +proc execAffectedRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {.tags: [ FReadDB, FWriteDb].} = ## executes the query (typically "UPDATE") and returns the @@ -172,11 +172,11 @@ proc ExecAffectedRows*(db: TDbConn, query: TSqlQuery, result = parseBiggestInt($PQcmdTuples(res)) PQclear(res) -proc Close*(db: TDbConn) {.tags: [FDb].} = +proc close*(db: TDbConn) {.tags: [FDb].} = ## closes the database connection. if db != nil: PQfinish(db) -proc Open*(connection, user, password, database: string): TDbConn {. +proc open*(connection, user, password, database: string): TDbConn {. tags: [FDb].} = ## opens a database connection. Raises `EDb` if the connection could not ## be established. diff --git a/lib/impure/graphics.nim b/lib/impure/graphics.nim index 85eeaed421..2c8e964605 100644 --- a/lib/impure/graphics.nim +++ b/lib/impure/graphics.nim @@ -343,7 +343,7 @@ proc fillRect*(sur: PSurface, r: TRect, col: TColor) = if sdl.FillRect(sur.s, addr(rect), sur.createSdlColor(col)) == -1: raiseEGraphics() -proc Plot4EllipsePoints(sur: PSurface, CX, CY, X, Y: Natural, col: TColor) = +proc plot4EllipsePoints(sur: PSurface, CX, CY, X, Y: Natural, col: TColor) = var video = cast[PPixels](sur.s.pixels) var pitch = sur.s.pitch.int div ColSize if CX+X <= sur.s.w-1: diff --git a/lib/impure/osinfo_win.nim b/lib/impure/osinfo_win.nim index 208ef7114c..572e50273a 100644 --- a/lib/impure/osinfo_win.nim +++ b/lib/impure/osinfo_win.nim @@ -151,7 +151,7 @@ const # GetSystemMetrics SM_SERVERR2 = 89 -proc GlobalMemoryStatusEx*(lpBuffer: var TMEMORYSTATUSEX){.stdcall, dynlib: "kernel32", +proc globalMemoryStatusEx*(lpBuffer: var TMEMORYSTATUSEX){.stdcall, dynlib: "kernel32", importc: "GlobalMemoryStatusEx".} proc getMemoryInfo*(): TMemoryInfo = @@ -159,7 +159,7 @@ proc getMemoryInfo*(): TMemoryInfo = var statex: TMEMORYSTATUSEX statex.dwLength = sizeof(statex).int32 - GlobalMemoryStatusEx(statex) + globalMemoryStatusEx(statex) result.MemoryLoad = statex.dwMemoryLoad result.TotalPhysMem = statex.ullTotalPhys result.AvailablePhysMem = statex.ullAvailPhys @@ -168,20 +168,20 @@ proc getMemoryInfo*(): TMemoryInfo = result.TotalVirtualMem = statex.ullTotalVirtual result.AvailableVirtualMem = statex.ullAvailExtendedVirtual -proc GetVersionEx*(lpVersionInformation: var TOSVERSIONINFOEX): WINBOOL{.stdcall, +proc getVersionEx*(lpVersionInformation: var TOSVERSIONINFOEX): WINBOOL{.stdcall, dynlib: "kernel32", importc: "GetVersionExA".} -proc GetProcAddress*(hModule: int, lpProcName: cstring): pointer{.stdcall, +proc getProcAddress*(hModule: int, lpProcName: cstring): pointer{.stdcall, dynlib: "kernel32", importc: "GetProcAddress".} -proc GetModuleHandleA*(lpModuleName: cstring): int{.stdcall, - dynlib: "kernel32", importc.} +proc getModuleHandleA*(lpModuleName: cstring): int{.stdcall, + dynlib: "kernel32", importc: "GetModuleHandleA".} proc getVersionInfo*(): TVersionInfo = ## Retrieves operating system info var osvi: TOSVERSIONINFOEX osvi.dwOSVersionInfoSize = sizeof(osvi).int32 - discard GetVersionEx(osvi) + discard getVersionEx(osvi) result.majorVersion = osvi.dwMajorVersion result.minorVersion = osvi.dwMinorVersion result.buildNumber = osvi.dwBuildNumber @@ -197,8 +197,8 @@ proc getProductInfo*(majorVersion, minorVersion, SPMajorVersion, ## Retrieves Windows' ProductInfo, this function only works in Vista and 7 var pGPI = cast[proc (dwOSMajorVersion, dwOSMinorVersion, - dwSpMajorVersion, dwSpMinorVersion: int32, outValue: Pint32)](GetProcAddress( - GetModuleHandleA("kernel32.dll"), "GetProductInfo")) + dwSpMajorVersion, dwSpMinorVersion: int32, outValue: Pint32)](getProcAddress( + getModuleHandleA("kernel32.dll"), "GetProductInfo")) if pGPI != nil: var dwType: int32 @@ -207,25 +207,25 @@ proc getProductInfo*(majorVersion, minorVersion, SPMajorVersion, else: return PRODUCT_UNDEFINED -proc GetSystemInfo*(lpSystemInfo: LPSYSTEM_INFO){.stdcall, dynlib: "kernel32", +proc getSystemInfo*(lpSystemInfo: LPSYSTEM_INFO){.stdcall, dynlib: "kernel32", importc: "GetSystemInfo".} proc getSystemInfo*(): TSYSTEM_INFO = ## Returns the SystemInfo # Use GetNativeSystemInfo if it's available - var pGNSI = cast[proc (lpSystemInfo: LPSYSTEM_INFO)](GetProcAddress( - GetModuleHandleA("kernel32.dll"), "GetNativeSystemInfo")) + var pGNSI = cast[proc (lpSystemInfo: LPSYSTEM_INFO)](getProcAddress( + getModuleHandleA("kernel32.dll"), "GetNativeSystemInfo")) var systemi: TSYSTEM_INFO if pGNSI != nil: pGNSI(addr(systemi)) else: - GetSystemInfo(addr(systemi)) + getSystemInfo(addr(systemi)) return systemi -proc GetSystemMetrics*(nIndex: int32): int32{.stdcall, dynlib: "user32", +proc getSystemMetrics*(nIndex: int32): int32{.stdcall, dynlib: "user32", importc: "GetSystemMetrics".} proc `$`*(osvi: TVersionInfo): string = @@ -283,11 +283,11 @@ proc `$`*(osvi: TVersionInfo): string = of PRODUCT_WEB_SERVER: result.add("Web Server Edition") else: - nil + discard # End of Windows 6.* if osvi.majorVersion == 5 and osvi.minorVersion == 2: - if GetSystemMetrics(SM_SERVERR2) != 0: + if getSystemMetrics(SM_SERVERR2) != 0: result.add("Windows Server 2003 R2, ") elif (osvi.SuiteMask and VER_SUITE_PERSONAL) != 0: # Not sure if this will work result.add("Windows Storage Server 2003") @@ -365,21 +365,21 @@ proc `$`*(osvi: TVersionInfo): string = result = "Unknown version of windows[Kernel version <= 4]" -proc getFileSize*(file: string): biggestInt = +proc getFileSize*(file: string): BiggestInt = var fileData: TWIN32_FIND_DATA when useWinUnicode: var aa = newWideCString(file) - var hFile = FindFirstFileW(aa, fileData) + var hFile = findFirstFileW(aa, fileData) else: - var hFile = FindFirstFileA(file, fileData) + var hFile = findFirstFileA(file, fileData) if hFile == INVALID_HANDLE_VALUE: - raise newException(EIO, $GetLastError()) + raise newException(EIO, $getLastError()) return fileData.nFileSizeLow -proc GetDiskFreeSpaceEx*(lpDirectoryName: cstring, lpFreeBytesAvailableToCaller, +proc getDiskFreeSpaceEx*(lpDirectoryName: cstring, lpFreeBytesAvailableToCaller, lpTotalNumberOfBytes, lpTotalNumberOfFreeBytes: var TFiletime): WINBOOL{. stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".} @@ -387,7 +387,7 @@ proc GetDiskFreeSpaceEx*(lpDirectoryName: cstring, lpFreeBytesAvailableToCaller, proc getPartitionInfo*(partition: string): TPartitionInfo = ## Retrieves partition info, for example ``partition`` may be ``"C:\"`` var FreeBytes, TotalBytes, TotalFreeBytes: TFiletime - var res = GetDiskFreeSpaceEx(r"C:\", FreeBytes, TotalBytes, + var res = getDiskFreeSpaceEx(r"C:\", FreeBytes, TotalBytes, TotalFreeBytes) return (FreeBytes, TotalBytes) diff --git a/lib/impure/rdstdin.nim b/lib/impure/rdstdin.nim index c32a59b243..1037d3bda5 100644 --- a/lib/impure/rdstdin.nim +++ b/lib/impure/rdstdin.nim @@ -56,7 +56,7 @@ else: # initialization: # disable auto-complete: - proc doNothing(a, b: cint): cint {.cdecl, procvar.} = nil + proc doNothing(a, b: cint): cint {.cdecl, procvar.} = discard discard readline.bind_key('\t'.ord, doNothing) diff --git a/lib/pure/collections/LockFreeHash.nim b/lib/pure/collections/LockFreeHash.nim index d3a91763a4..b94b542ff0 100644 --- a/lib/pure/collections/LockFreeHash.nim +++ b/lib/pure/collections/LockFreeHash.nim @@ -23,7 +23,8 @@ elif sizeof(int) == 8: # 64bit TRaw = range[0..4611686018427387903] ## The range of uint values that can be stored directly in a value slot ## when on a 64 bit platform -else: echo("unsupported platform") +else: + {.error: "unsupported platform".} type TEntry = tuple diff --git a/lib/system.nim b/lib/system.nim index dddf77858f..2c27645e28 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -588,7 +588,7 @@ proc `<` *(x, y: int64): bool {.magic: "LtI64", noSideEffect.} ## Returns true iff `x` is less than `y`. type - IntMax32 = bool|int|int8|int16|int32 + IntMax32 = int|int8|int16|int32 proc `+%` *(x, y: IntMax32): IntMax32 {.magic: "AddU", noSideEffect.} proc `+%` *(x, y: int64): int64 {.magic: "AddU", noSideEffect.} diff --git a/lib/system/atomics.nim b/lib/system/atomics.nim index 68ee74e84e..b1a96b2097 100644 --- a/lib/system/atomics.nim +++ b/lib/system/atomics.nim @@ -36,7 +36,7 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: ## This proc implements an atomic load operation. It returns the contents at p. ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_ACQUIRE, ATOMIC_CONSUME. - proc atomicLoad*[T: TAtomType](p: ptr T, ret: ptr T, mem: AtomMemModel) {. + proc atomicLoad*[T: TAtomType](p, ret: ptr T, mem: AtomMemModel) {. importc: "__atomic_load", nodecl.} ## This is the generic version of an atomic load. It returns the contents at p in ret. @@ -45,7 +45,7 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: ## This proc implements an atomic store operation. It writes val at p. ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, and ATOMIC_RELEASE. - proc atomicStore*[T: TAtomType](p: ptr T, val: ptr T, mem: AtomMemModel) {. + proc atomicStore*[T: TAtomType](p, val: ptr T, mem: AtomMemModel) {. importc: "__atomic_store", nodecl.} ## This is the generic version of an atomic store. It stores the value of val at p @@ -55,12 +55,12 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: ## and returns the previous contents at p. ## ATOMIC_RELAXED, ATOMIC_SEQ_CST, ATOMIC_ACQUIRE, ATOMIC_RELEASE, ATOMIC_ACQ_REL - proc atomicExchange*[T: TAtomType](p: ptr T, val: ptr T, ret: ptr T, mem: AtomMemModel) {. + proc atomicExchange*[T: TAtomType](p, val, ret: ptr T, mem: AtomMemModel) {. importc: "__atomic_exchange", nodecl.} ## This is the generic version of an atomic exchange. It stores the contents at val at p. ## The original value at p is copied into ret. - proc atomicCompareExchangeN*[T: TAtomType](p: ptr T, expected: ptr T, desired: T, + proc atomicCompareExchangeN*[T: TAtomType](p, expected: ptr T, desired: T, weak: bool, success_memmodel: AtomMemModel, failure_memmodel: AtomMemModel): bool {. importc: "__atomic_compare_exchange_n ", nodecl.} ## This proc implements an atomic compare and exchange operation. This compares the @@ -76,7 +76,7 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: ## cannot be __ATOMIC_RELEASE nor __ATOMIC_ACQ_REL. It also cannot be a stronger model ## than that specified by success_memmodel. - proc atomicCompareExchange*[T: TAtomType](p: ptr T, expected: ptr T, desired: ptr T, + proc atomicCompareExchange*[T: TAtomType](p, expected, desired: ptr T, weak: bool, success_memmodel: AtomMemModel, failure_memmodel: AtomMemModel): bool {. importc: "__atomic_compare_exchange_n ", nodecl.} ## This proc implements the generic version of atomic_compare_exchange. @@ -108,7 +108,7 @@ when (defined(gcc) or defined(llvm_gcc)) and hasThreadSupport: importc: "__atomic_fetch_and", nodecl.} proc atomicFetchXor*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_fetch_xor", nodecl.} - proc atomicFetchAand*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. + proc atomicFetchNand*[T: TAtomType](p: ptr T, val: T, mem: AtomMemModel): T {. importc: "__atomic_fetch_nand", nodecl.} proc atomicTestAndSet*(p: pointer, mem: AtomMemModel): bool {. @@ -176,7 +176,7 @@ else: #elif not hasThreadSupport: # proc compareAndSwap*[T](mem: ptr T, -# expected: T, newValue: T): bool {.inline.} = +# expected: T, newValue: T): bool {.inline.} = # ## Returns true if successfully set value at mem to newValue when value # ## at mem == expected # var oldval = mem[] @@ -202,4 +202,4 @@ proc atomicDec*(memLoc: var int, x: int = 1): int = result = atomic_add_fetch(memLoc.addr, -x, ATOMIC_RELAXED) else: dec(memLoc, x) - result = memLoc + result = memLoc diff --git a/lib/system/channels.nim b/lib/system/channels.nim index 9c3cc93e0b..bf949529bc 100644 --- a/lib/system/channels.nim +++ b/lib/system/channels.nim @@ -48,9 +48,9 @@ proc deinitRawChannel(p: pointer) = deinitSys(c.lock) deinitSysCond(c.cond) -proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel, +proc storeAux(dest, src: pointer, mt: PNimType, t: PRawChannel, mode: TLoadStoreMode) -proc storeAux(dest, src: Pointer, n: ptr TNimNode, t: PRawChannel, +proc storeAux(dest, src: pointer, n: ptr TNimNode, t: PRawChannel, mode: TLoadStoreMode) = var d = cast[TAddress](dest) @@ -67,7 +67,7 @@ proc storeAux(dest, src: Pointer, n: ptr TNimNode, t: PRawChannel, if m != nil: storeAux(dest, src, m, t, mode) of nkNone: sysAssert(false, "storeAux") -proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel, +proc storeAux(dest, src: pointer, mt: PNimType, t: PRawChannel, mode: TLoadStoreMode) = var d = cast[TAddress](dest) @@ -82,7 +82,7 @@ proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel, x[] = nil else: var ss = cast[NimString](s2) - var ns = cast[NimString](Alloc(t.region, ss.len+1 + GenericSeqSize)) + var ns = cast[NimString](alloc(t.region, ss.len+1 + GenericSeqSize)) copyMem(ns, ss, ss.len+1 + GenericSeqSize) x[] = ns else: @@ -92,7 +92,7 @@ proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel, unsureAsgnRef(x, s2) else: unsureAsgnRef(x, copyString(cast[NimString](s2))) - Dealloc(t.region, s2) + dealloc(t.region, s2) of tySequence: var s2 = cast[ppointer](src)[] var seq = cast[PGenericSeq](s2) @@ -105,7 +105,7 @@ proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel, else: sysAssert(dest != nil, "dest == nil") if mode == mStore: - x[] = Alloc(t.region, seq.len *% mt.base.size +% GenericSeqSize) + x[] = alloc(t.region, seq.len *% mt.base.size +% GenericSeqSize) else: unsureAsgnRef(x, newObj(mt, seq.len * mt.base.size + GenericSeqSize)) var dst = cast[taddress](cast[ppointer](dest)[]) @@ -118,7 +118,7 @@ proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel, var dstseq = cast[PGenericSeq](dst) dstseq.len = seq.len dstseq.reserved = seq.len - if mode != mStore: Dealloc(t.region, s2) + if mode != mStore: dealloc(t.region, s2) of tyObject: # copy type field: var pint = cast[ptr PNimType](dest) @@ -143,7 +143,7 @@ proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel, unsureAsgnRef(x, nil) else: if mode == mStore: - x[] = Alloc(t.region, mt.base.size) + x[] = alloc(t.region, mt.base.size) else: # XXX we should use the dynamic type here too, but that is not stored # in the inbox at all --> use source[]'s object type? but how? we need @@ -151,7 +151,7 @@ proc storeAux(dest, src: Pointer, mt: PNimType, t: PRawChannel, var obj = newObj(mt, mt.base.size) unsureAsgnRef(x, obj) storeAux(x[], s, mt.base, t, mode) - if mode != mStore: Dealloc(t.region, s) + if mode != mStore: dealloc(t.region, s) else: copyMem(dest, src, mt.size) # copy raw bits @@ -161,7 +161,7 @@ proc rawSend(q: PRawChannel, data: pointer, typ: PNimType) = if q.count >= cap: # start with capacity for 2 entries in the queue: if cap == 0: cap = 1 - var n = cast[pbytes](Alloc0(q.region, cap*2*typ.size)) + var n = cast[pbytes](alloc0(q.region, cap*2*typ.size)) var z = 0 var i = q.rd var c = q.count @@ -170,7 +170,7 @@ proc rawSend(q: PRawChannel, data: pointer, typ: PNimType) = copyMem(addr(n[z*typ.size]), addr(q.data[i*typ.size]), typ.size) i = (i + 1) and q.mask inc z - if q.data != nil: Dealloc(q.region, q.data) + if q.data != nil: dealloc(q.region, q.data) q.data = n q.mask = cap*2 - 1 q.wr = q.count @@ -200,7 +200,7 @@ template sendImpl(q: expr) {.immediate.} = rawSend(q, addr(m), typ) q.elemType = typ releaseSys(q.lock) - SignalSysCond(q.cond) + signalSysCond(q.cond) proc send*[TMsg](c: var TChannel[TMsg], msg: TMsg) = ## sends a message to a thread. `msg` is deeply copied. @@ -212,7 +212,7 @@ proc llRecv(q: PRawChannel, res: pointer, typ: PNimType) = acquireSys(q.lock) q.ready = true while q.count <= 0: - WaitSysCond(q.cond, q.lock) + waitSysCond(q.cond, q.lock) q.ready = false if typ != q.elemType: releaseSys(q.lock) diff --git a/lib/system/syslocks.nim b/lib/system/syslocks.nim index 0f67af40c9..5e3b04b7f1 100644 --- a/lib/system/syslocks.nim +++ b/lib/system/syslocks.nim @@ -66,6 +66,9 @@ when defined(Windows): discard waitForSingleObject(cond, -1'i32) acquireSys(lock) + proc waitSysCondWindows(cond: var TSysCond) = + discard waitForSingleObject(cond, -1'i32) + else: type TSysLock {.importc: "pthread_mutex_t", pure, final, diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 80420d7917..ff9ab6cc03 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -29,11 +29,11 @@ ## ## proc threadFunc(interval: tuple[a,b: int]) {.thread.} = ## for i in interval.a..interval.b: -## Acquire(L) # lock stdout +## acquire(L) # lock stdout ## echo i -## Release(L) +## release(L) ## -## InitLock(L) +## initLock(L) ## ## for i in 0..high(thr): ## createThread(thr[i], threadFunc, (i*10, i*10+5)) @@ -54,9 +54,9 @@ when defined(windows): TSysThread = THandle TWinThreadProc = proc (x: pointer): int32 {.stdcall.} - proc CreateThread(lpThreadAttributes: Pointer, dwStackSize: int32, + proc createThread(lpThreadAttributes: pointer, dwStackSize: int32, lpStartAddress: TWinThreadProc, - lpParameter: Pointer, + lpParameter: pointer, dwCreationFlags: int32, lpThreadId: var int32): TSysThread {. stdcall, dynlib: "kernel32", importc: "CreateThread".} @@ -67,23 +67,23 @@ when defined(windows): proc winResumeThread(hThread: TSysThread): int32 {. stdcall, dynlib: "kernel32", importc: "ResumeThread".} - proc WaitForMultipleObjects(nCount: int32, + proc waitForMultipleObjects(nCount: int32, lpHandles: ptr TSysThread, bWaitAll: int32, dwMilliseconds: int32): int32 {. stdcall, dynlib: "kernel32", importc: "WaitForMultipleObjects".} - proc TerminateThread(hThread: TSysThread, dwExitCode: int32): int32 {. + proc terminateThread(hThread: TSysThread, dwExitCode: int32): int32 {. stdcall, dynlib: "kernel32", importc: "TerminateThread".} type TThreadVarSlot = distinct int32 - proc ThreadVarAlloc(): TThreadVarSlot {. + proc threadVarAlloc(): TThreadVarSlot {. importc: "TlsAlloc", stdcall, dynlib: "kernel32".} - proc ThreadVarSetValue(dwTlsIndex: TThreadVarSlot, lpTlsValue: pointer) {. + proc threadVarSetValue(dwTlsIndex: TThreadVarSlot, lpTlsValue: pointer) {. importc: "TlsSetValue", stdcall, dynlib: "kernel32".} - proc ThreadVarGetValue(dwTlsIndex: TThreadVarSlot): pointer {. + proc threadVarGetValue(dwTlsIndex: TThreadVarSlot): pointer {. importc: "TlsGetValue", stdcall, dynlib: "kernel32".} else: @@ -116,14 +116,14 @@ else: proc pthread_cancel(a1: TSysThread): cint {. importc: "pthread_cancel", header: "<pthread.h>".} - proc AcquireSysTimeoutAux(L: var TSysLock, timeout: var Ttimespec): cint {. + proc acquireSysTimeoutAux(L: var TSysLock, timeout: var Ttimespec): cint {. importc: "pthread_mutex_timedlock", header: "<time.h>".} - proc AcquireSysTimeout(L: var TSysLock, msTimeout: int) {.inline.} = + proc acquireSysTimeout(L: var TSysLock, msTimeout: int) {.inline.} = var a: Ttimespec a.tv_sec = msTimeout div 1000 a.tv_nsec = (msTimeout mod 1000) * 1000 - var res = AcquireSysTimeoutAux(L, a) + var res = acquireSysTimeoutAux(L, a) if res != 0'i32: raise newException(EResourceExhausted, $strerror(res)) type @@ -141,11 +141,11 @@ else: proc pthread_setspecific(a1: TThreadVarSlot, a2: pointer): int32 {. importc: "pthread_setspecific", header: "<pthread.h>".} - proc ThreadVarAlloc(): TThreadVarSlot {.inline.} = + proc threadVarAlloc(): TThreadVarSlot {.inline.} = discard pthread_key_create(addr(result), nil) - proc ThreadVarSetValue(s: TThreadVarSlot, value: pointer) {.inline.} = + proc threadVarSetValue(s: TThreadVarSlot, value: pointer) {.inline.} = discard pthread_setspecific(s, value) - proc ThreadVarGetValue(s: TThreadVarSlot): pointer {.inline.} = + proc threadVarGetValue(s: TThreadVarSlot): pointer {.inline.} = result = pthread_getspecific(s) when useStackMaskHack: @@ -159,7 +159,7 @@ const when emulatedThreadVars: # the compiler generates this proc for us, so that we can get the size of # the thread local var block; we use this only for sanity checking though - proc NimThreadVarsSize(): int {.noconv, importc: "NimThreadVarsSize".} + proc nimThreadVarsSize(): int {.noconv, importc: "NimThreadVarsSize".} # we preallocate a fixed size for thread local storage, so that no heap # allocations are needed. Currently less than 7K are used on a 64bit machine. @@ -184,7 +184,7 @@ type # XXX it'd be more efficient to not use a global variable for the # thread storage slot, but to rely on the implementation to assign slot X # for us... ;-) -var globalsSlot = ThreadVarAlloc() +var globalsSlot = threadVarAlloc() #const globalsSlot = TThreadVarSlot(0) #sysAssert checkSlot.int == globalsSlot.int @@ -193,7 +193,7 @@ when emulatedThreadVars: result = addr(cast[PGcThread](ThreadVarGetValue(globalsSlot)).tls) when useStackMaskHack: - proc MaskStackPointer(offset: int): pointer {.compilerRtl, inl.} = + proc maskStackPointer(offset: int): pointer {.compilerRtl, inl.} = var x {.volatile.}: pointer x = addr(x) result = cast[pointer]((cast[int](x) and not ThreadStackMask) +% @@ -205,7 +205,7 @@ when not defined(useNimRtl): when not useStackMaskHack: var mainThread: TGcThread - ThreadVarSetValue(globalsSlot, addr(mainThread)) + threadVarSetValue(globalsSlot, addr(mainThread)) when not defined(createNimRtl): initStackBottom() initGC() @@ -220,18 +220,18 @@ when not defined(useNimRtl): proc registerThread(t: PGcThread) = # we need to use the GC global lock here! - AcquireSys(HeapLock) + acquireSys(HeapLock) t.prev = nil t.next = threadList if threadList != nil: sysAssert(threadList.prev == nil, "threadList.prev == nil") threadList.prev = t threadList = t - ReleaseSys(HeapLock) + releaseSys(HeapLock) proc unregisterThread(t: PGcThread) = # we need to use the GC global lock here! - AcquireSys(HeapLock) + acquireSys(HeapLock) if t == threadList: threadList = t.next if t.next != nil: t.next.prev = t.prev if t.prev != nil: t.prev.next = t.next @@ -239,7 +239,7 @@ when not defined(useNimRtl): # code executes `destroyThread`: t.next = nil t.prev = nil - ReleaseSys(HeapLock) + releaseSys(HeapLock) # on UNIX, the GC uses ``SIGFREEZE`` to tell every thread to stop so that # the GC can examine the stacks? @@ -266,7 +266,7 @@ type when not defined(boehmgc) and not hasSharedHeap: proc deallocOsPages() -template ThreadProcWrapperBody(closure: expr) {.immediate.} = +template threadProcWrapperBody(closure: expr) {.immediate.} = when defined(globalsSlot): ThreadVarSetValue(globalsSlot, closure) var t = cast[ptr TThread[TArg]](closure) when useStackMaskHack: @@ -294,11 +294,11 @@ template ThreadProcWrapperBody(closure: expr) {.immediate.} = {.push stack_trace:off.} when defined(windows): proc threadProcWrapper[TArg](closure: pointer): int32 {.stdcall.} = - ThreadProcWrapperBody(closure) + threadProcWrapperBody(closure) # implicitly return 0 else: proc threadProcWrapper[TArg](closure: pointer) {.noconv.} = - ThreadProcWrapperBody(closure) + threadProcWrapperBody(closure) {.pop.} proc running*[TArg](t: TThread[TArg]): bool {.inline.} = @@ -308,7 +308,7 @@ proc running*[TArg](t: TThread[TArg]): bool {.inline.} = proc joinThread*[TArg](t: TThread[TArg]) {.inline.} = ## waits for the thread `t` to finish. when hostOS == "windows": - discard WaitForSingleObject(t.sys, -1'i32) + discard waitForSingleObject(t.sys, -1'i32) else: discard pthread_join(t.sys, nil) @@ -318,7 +318,7 @@ proc joinThreads*[TArg](t: varargs[TThread[TArg]]) = var a: array[0..255, TSysThread] sysAssert a.len >= t.len, "a.len >= t.len" for i in 0..t.high: a[i] = t[i].sys - discard WaitForMultipleObjects(t.len.int32, + discard waitForMultipleObjects(t.len.int32, cast[ptr TSysThread](addr(a)), 1, -1) else: for i in 0..t.high: joinThread(t[i]) @@ -346,7 +346,7 @@ proc createThread*[TArg](t: var TThread[TArg], when hasSharedHeap: t.stackSize = ThreadStackSize when hostOS == "windows": var dummyThreadId: int32 - t.sys = CreateThread(nil, ThreadStackSize, threadProcWrapper[TArg], + t.sys = createThread(nil, ThreadStackSize, threadProcWrapper[TArg], addr(t), 0'i32, dummyThreadId) if t.sys <= 0: raise newException(EResourceExhausted, "cannot create thread") diff --git a/lib/wrappers/mysql.nim b/lib/wrappers/mysql.nim index 5a8d4c98b0..84d70287f0 100644 --- a/lib/wrappers/mysql.nim +++ b/lib/wrappers/mysql.nim @@ -19,7 +19,7 @@ when defined(Windows): type my_bool* = bool Pmy_bool* = ptr my_bool - PVIO* = Pointer + PVIO* = pointer Pgptr* = ptr gptr gptr* = cstring Pmy_socket* = ptr my_socket @@ -645,7 +645,7 @@ type next_slave*: Pst_mysql last_used_slave*: Pst_mysql # needed for round-robin slave pick last_used_con*: Pst_mysql # needed for send/read/store/use result to work correctly with replication - stmts*: Pointer # was PList, list of all statements + stmts*: pointer # was PList, list of all statements methods*: Pst_mysql_methods thd*: pointer # Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag # from mysql_stmt_close if close had to cancel result set of this object. diff --git a/tests/compile/toptions.nim b/tests/compile/toptions.nim index 95bb5cfbc3..3c841de2c1 100644 --- a/tests/compile/toptions.nim +++ b/tests/compile/toptions.nim @@ -1,7 +1,3 @@ -# Converted by Pas2mor v1.54 -# Used command line arguments: -# -m -q -o bootstrap\options.mor options.pas -# type # please make sure we have under 32 options (improves code efficiency!) diff --git a/todo.txt b/todo.txt index 4a2ab4c708..6c76019f83 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,8 @@ version 0.9.4 ============= +- better tester +- ensure (ref T)(a, b) works as a type conversion and type constructor - Aporia doesn't compile under devel - document new templating symbol binding rules - make '--implicitStatic:on' the default From fb4a96ff78e85537f248fe96d6508f1dffead297 Mon Sep 17 00:00:00 2001 From: Josh Girvin <josh@jgirvin.com> Date: Mon, 13 Jan 2014 02:43:50 +1000 Subject: [PATCH 198/326] Koch now uses PATH/nimrod correctly --- koch.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koch.nim b/koch.nim index 97fcf5b2c9..3b13690fab 100644 --- a/koch.nim +++ b/koch.nim @@ -111,7 +111,7 @@ proc findStartNimrod: string = result = "bin" / nimrod if ExistsFile(result): return for dir in split(getEnv("PATH"), PathSep): - if ExistsFile(dir / nimrod): return nimrod + if ExistsFile(dir / nimrod): return dir / nimrod when defined(Posix): const buildScript = "build.sh" if ExistsFile(buildScript): From 0a0fec4a5c6dcd3c6ac007877ef297914657b7f2 Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Sun, 12 Jan 2014 12:48:06 -0500 Subject: [PATCH 199/326] Added spliceHeader option to c2nim parse a header file first, then the source. completing a c 'module' --- compiler/c2nim/c2nim.nim | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/compiler/c2nim/c2nim.nim b/compiler/c2nim/c2nim.nim index 1c701a386c..c4fc8ad672 100644 --- a/compiler/c2nim/c2nim.nim +++ b/compiler/c2nim/c2nim.nim @@ -34,25 +34,36 @@ Options: --skipcomments do not copy comments --ignoreRValueRefs translate C++'s ``T&&`` to ``T`` instead ``of var T`` --keepBodies keep C++'s method bodies + --spliceHeader parse and emit header before source file -v, --version write c2nim's version -h, --help show this help """ -proc main(infile, outfile: string, options: PParserOptions) = - var start = getTime() +proc parse(infile: string, options: PParserOptions): PNode = var stream = llStreamOpen(infile, fmRead) if stream == nil: rawMessage(errCannotOpenFile, infile) var p: TParser openParser(p, infile, stream, options) - var module = parseUnit(p) + result = parseUnit(p) closeParser(p) - renderModule(module, outfile) + +proc main(infile, outfile: string, options: PParserOptions, spliceHeader: bool) = + var start = getTime() + if spliceHeader and infile[infile.len-2 .. infile.len] == ".c" and existsFile(infile[0 .. infile.len-2] & "h"): + var header_module = parse(infile[0 .. infile.len-2] & "h", options) + var source_module = parse(infile, options) + for n in source_module: + addson(header_module, n) + renderModule(header_module, outfile) + else: + renderModule(parse(infile, options), outfile) rawMessage(hintSuccessX, [$gLinesCompiled, $(getTime() - start), formatSize(getTotalMem())]) var infile = "" outfile = "" + spliceHeader = false parserOptions = newParserOptions() for kind, key, val in getopt(): case kind @@ -66,6 +77,7 @@ for kind, key, val in getopt(): stdout.write(Version & "\n") quit(0) of "o", "out": outfile = val + of "spliceheader": spliceHeader = true else: if not parserOptions.setOption(key, val): stdout.writeln("[Error] unknown option: " & key) @@ -77,4 +89,4 @@ else: if outfile.len == 0: outfile = changeFileExt(infile, "nim") infile = addFileExt(infile, "h") - main(infile, outfile, parserOptions) + main(infile, outfile, parserOptions, spliceHeader) From 2dc91cb4d51a628aff300116c1f7a377b310a198 Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Sun, 12 Jan 2014 12:53:25 -0500 Subject: [PATCH 200/326] Lex '\xHH' character constants --- compiler/c2nim/clex.nim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/compiler/c2nim/clex.nim b/compiler/c2nim/clex.nim index 7e5526a10f..fe7fe92d32 100644 --- a/compiler/c2nim/clex.nim +++ b/compiler/c2nim/clex.nim @@ -382,6 +382,23 @@ proc escape(L: var TLexer, tok: var TToken, allowEmpty=false) = xi = (xi shl 3) or (ord(L.buf[L.bufpos]) - ord('0')) inc(L.bufpos) add(tok.s, chr(xi)) + of 'x': + var xi = 0 + inc(L.bufpos) + while true: + case L.buf[L.bufpos] + of '0'..'9': + xi = `shl`(xi, 4) or (ord(L.buf[L.bufpos]) - ord('0')) + inc(L.bufpos) + of 'a'..'f': + xi = `shl`(xi, 4) or (ord(L.buf[L.bufpos]) - ord('a') + 10) + inc(L.bufpos) + of 'A'..'F': + xi = `shl`(xi, 4) or (ord(L.buf[L.bufpos]) - ord('A') + 10) + inc(L.bufpos) + else: + break + add(tok.s, chr(xi)) elif not allowEmpty: lexMessage(L, errInvalidCharacterConstant) From c5bd98b7dba674b43ddff9ef9b4ff8358d327f3a Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Sun, 12 Jan 2014 13:23:52 -0500 Subject: [PATCH 201/326] Properly lex floating constants digit-sequence? '.' digit-sequence exponent-part? digit-sequence '.' exponent-part? exponent-part: [eE] [+-]? digit-sequence --- compiler/c2nim/clex.nim | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/compiler/c2nim/clex.nim b/compiler/c2nim/clex.nim index fe7fe92d32..3934eea63d 100644 --- a/compiler/c2nim/clex.nim +++ b/compiler/c2nim/clex.nim @@ -315,13 +315,28 @@ proc getNumber16(L: var TLexer, tok: var TToken) = else: tok.xkind = pxIntLit L.bufpos = pos +proc getFloating(L: var TLexer, tok: var TToken) = + matchUnderscoreChars(L, tok, {'0'..'9'}) + if L.buf[L.bufpos] in {'e', 'E'}: + add(tok.s, L.buf[L.bufpos]) + inc(L.bufpos) + if L.buf[L.bufpos] in {'+', '-'}: + add(tok.s, L.buf[L.bufpos]) + inc(L.bufpos) + matchUnderscoreChars(L, tok, {'0'..'9'}) + proc getNumber(L: var TLexer, tok: var TToken) = tok.base = base10 - matchUnderscoreChars(L, tok, {'0'..'9'}) - if (L.buf[L.bufpos] == '.') and (L.buf[L.bufpos + 1] in {'0'..'9'}): - add(tok.s, '.') + if L.buf[L.bufpos] == '.': + add(tok.s, "0.") inc(L.bufpos) - matchUnderscoreChars(L, tok, {'e', 'E', '+', '-', '0'..'9'}) + getFloating(L, tok) + else: + matchUnderscoreChars(L, tok, {'0'..'9'}) + if L.buf[L.bufpos] == '.': + add(tok.s, '.') + inc(L.bufpos) + getFloating(L, tok) try: if isFloatLiteral(tok.s): tok.fnumber = parseFloat(tok.s) @@ -576,7 +591,7 @@ proc getTok(L: var TLexer, tok: var TToken) = of 'b', 'B': getNumber2(L, tok) of '1'..'7': getNumber8(L, tok) else: getNumber(L, tok) - elif c in {'1'..'9'}: + elif c in {'1'..'9'} or (c == '.' and L.buf[L.bufpos+1] in {'0'..'9'}): getNumber(L, tok) else: case c From e27e873b7b3658ad193b1b68cc818a0ad88dffb3 Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Sun, 12 Jan 2014 20:13:26 +0000 Subject: [PATCH 202/326] Add info about twitter and bootstrapping from github to website. --- install.txt | 6 ++++++ web/community.txt | 2 ++ 2 files changed, 8 insertions(+) diff --git a/install.txt b/install.txt index 11c502235a..2883c8495d 100644 --- a/install.txt +++ b/install.txt @@ -62,3 +62,9 @@ Currently, the following C compilers are supported under Windows: | http://www.digitalmars.com/download/freecompiler.html However, most testing is done with GCC. + +Bootstrapping from Github +------------------------- + +Take a look at the readme file on github `here <https://github.com/Araq/Nimrod#readme>`_ +for instructions. diff --git a/web/community.txt b/web/community.txt index 6e2306f8f7..b9a0a4196b 100644 --- a/web/community.txt +++ b/web/community.txt @@ -9,6 +9,8 @@ Bug reports: http://github.com/Araq/Nimrod/issues. For quickest feedback, join our IRC channel: irc://irc.freenode.net/nimrod (logs at `<http://build.nimrod-code.org/irclogs/>`_). +Check out our Twitter account for latest news and announcements: `@nimrodlang <http://twitter.com/nimrodlang>`_. + How to help =========== From 137e97154729726d650d1aa75042e7604fb266f9 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 12 Jan 2014 21:40:24 +0100 Subject: [PATCH 203/326] new vm: bugfix --- compiler/vm.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/vm.nim b/compiler/vm.nim index 0a1ee0a1aa..94891feb29 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -427,7 +427,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra].intVal = regs[rb].skipMeta.len - imm of opcLenStr: decodeBImm(nkIntLit) - assert regs[rb].kind == nkStrLit + assert regs[rb].kind in {nkStrLit..nkTripleStrLit} regs[ra].intVal = regs[rb].strVal.len - imm of opcIncl: decodeB(nkCurly) From 616434c4922373db8072a47d0d8cd1a2e129ab95 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 12 Jan 2014 21:41:52 +0100 Subject: [PATCH 204/326] bugfix: renderer supports 'ptr' etc. as type constraint --- compiler/renderer.nim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 99891df25e..6c7d9cae34 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -421,10 +421,11 @@ proc lsub(n: PNode): int = of nkElifExpr: result = lsons(n) + len("_elif_:_") of nkElseExpr: result = lsub(n.sons[0]) + len("_else:_") # type descriptions of nkTypeOfExpr: result = lsub(n.sons[0]) + len("type_") - of nkRefTy: result = lsub(n.sons[0]) + len("ref_") - of nkPtrTy: result = lsub(n.sons[0]) + len("ptr_") - of nkVarTy: result = lsub(n.sons[0]) + len("var_") - of nkDistinctTy: result = lsub(n.sons[0]) + len("Distinct_") + of nkRefTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + len("ref") + of nkPtrTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + len("ptr") + of nkVarTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + len("var") + of nkDistinctTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + + len("Distinct") of nkTypeDef: result = lsons(n) + 3 of nkOfInherit: result = lsub(n.sons[0]) + len("of_") of nkProcTy: result = lsons(n) + len("proc_") From 429d337ef6f812ce976c903d500c7d4f0d616501 Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Sun, 12 Jan 2014 21:48:57 +0000 Subject: [PATCH 205/326] Rename C sources dir to c_code. --- tools/niminst/buildbat.tmpl | 4 ++-- tools/niminst/buildsh.tmpl | 4 ++-- tools/niminst/niminst.nim | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/niminst/buildbat.tmpl b/tools/niminst/buildbat.tmpl index 36e1a3e796..712ebc794f 100644 --- a/tools/niminst/buildbat.tmpl +++ b/tools/niminst/buildbat.tmpl @@ -17,8 +17,8 @@ REM call the compiler: # var linkCmd = "" # for ff in items(c.cfiles[winIndex][cpuIndex]): # let f = ff.toWin -ECHO %CC% %COMP_FLAGS% -Inimcache -c ?{f} -o ?{changeFileExt(f, "o")} -%CC% %COMP_FLAGS% -Inimcache -c ?{f} -o ?{changeFileExt(f, "o")} +ECHO %CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")} +%CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")} # linkCmd.add(" " & changeFileExt(f, "o")) # end for diff --git a/tools/niminst/buildsh.tmpl b/tools/niminst/buildsh.tmpl index 0fb4907cfb..8fe5fea9f4 100644 --- a/tools/niminst/buildsh.tmpl +++ b/tools/niminst/buildsh.tmpl @@ -128,8 +128,8 @@ case $myos in # var linkCmd = "" # for ff in items(c.cfiles[osA][cpuA]): # let f = ff.toUnix - echo "$CC $COMP_FLAGS -Inimcache -c ?{f} -o ?{changeFileExt(f, "o")}" - $CC $COMP_FLAGS -Inimcache -c ?{f} -o ?{changeFileExt(f, "o")} + echo "$CC $COMP_FLAGS -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}" + $CC $COMP_FLAGS -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")} # add(linkCmd, " \\\n" & changeFileExt(f, "o")) # end for echo "$LINKER -o ?{"$binDir/" & toLower(c.name)} ?linkCmd $LINK_FLAGS" diff --git a/tools/niminst/niminst.nim b/tools/niminst/niminst.nim index 0c9717e12e..96815ebe4a 100644 --- a/tools/niminst/niminst.nim +++ b/tools/niminst/niminst.nim @@ -392,7 +392,7 @@ proc readCFiles(c: var TConfigData, osA, cpuA: int) = quit("Cannot open: " & f) proc buildDir(os, cpu: int): string = - return "nimcache" / ($os & "_" & $cpu) + return "c_code" / ($os & "_" & $cpu) proc getOutputDir(c: var TConfigData): string = if c.outdir.len > 0: c.outdir else: "build" @@ -432,11 +432,11 @@ proc writeInstallScripts(c: var TConfigData) = writeFile(deinstallShFile, generateDeinstallScript(c), "\10") proc srcdist(c: var TConfigData) = - if not existsDir(getOutputDir(c) / "nimcache"): - createDir(getOutputDir(c) / "nimcache") + if not existsDir(getOutputDir(c) / "c_code"): + createDir(getOutputDir(c) / "c_code") for x in walkFiles(c.libpath / "lib/*.h"): - echo(getOutputDir(c) / "nimcache" / extractFilename(x)) - copyFile(dest=getOutputDir(c) / "nimcache" / extractFilename(x), source=x) + echo(getOutputDir(c) / "c_code" / extractFilename(x)) + copyFile(dest=getOutputDir(c) / "c_code" / extractFilename(x), source=x) var winIndex = -1 var intel32Index = -1 var intel64Index = -1 From 570f8b21e196d8f8046e1e4c4d59db2aef2f0ea9 Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Sun, 12 Jan 2014 17:13:23 -0500 Subject: [PATCH 206/326] New expression parser tests pass --- compiler/c2nim/cparse.nim | 620 +++++++++++++++++--------------------- 1 file changed, 272 insertions(+), 348 deletions(-) diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index 3adab0f44e..bf785b13fa 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -420,9 +420,9 @@ proc markTypeIdent(p: var TParser, typ: PNode) = # avoids to build a symbol table, which can't be done reliably anyway for our # purposes. -proc expression(p: var TParser): PNode -proc constantExpression(p: var TParser): PNode -proc assignmentExpression(p: var TParser): PNode +proc expression(p: var TParser, rbp: int = 0): PNode +proc constantExpression(p: var TParser): PNode = expression(p, 40) +proc assignmentExpression(p: var TParser): PNode = expression(p, 30) proc compoundStatement(p: var TParser): PNode proc statement(p: var TParser): PNode @@ -1134,224 +1134,27 @@ proc setBaseFlags(n: PNode, base: TNumericalBase) = of base8: incl(n.flags, nfBase8) of base16: incl(n.flags, nfBase16) -proc unaryExpression(p: var TParser): PNode - -proc isDefinitelyAType(p: var TParser): bool = - var starFound = false - var words = 0 - while true: - case p.tok.xkind - of pxSymbol: - if declKeyword(p, p.tok.s): return true - elif starFound: return false - else: inc(words) - of pxStar, pxAmp, pxAmpAmp: - starFound = true - of pxParRi: return words == 0 or words > 1 or starFound - else: return false - getTok(p, nil) - -proc castExpression(p: var TParser): PNode = - if p.tok.xkind == pxParLe: - saveContext(p) - result = newNodeP(nkCast, p) - getTok(p, result) - var t = isDefinitelyAType(p) - backtrackContext(p) - if t: - eat(p, pxParLe, result) - var a = typeDesc(p) - eat(p, pxParRi, result) - addSon(result, a) - addSon(result, castExpression(p)) - else: - # else it is just an expression in (): - result = newNodeP(nkPar, p) - eat(p, pxParLe, result) - addSon(result, expression(p)) - if p.tok.xkind != pxParRi: - # ugh, it is a cast, even though it does not look like one: - result.kind = nkCast - addSon(result, castExpression(p)) - eat(p, pxParRi, result) - #result = unaryExpression(p) - else: - result = unaryExpression(p) - -proc primaryExpression(p: var TParser): PNode = - case p.tok.xkind - of pxSymbol: - if p.tok.s == "NULL": - result = newNodeP(nkNilLit, p) - else: - result = mangledIdent(p.tok.s, p) - getTok(p, result) - result = optScope(p, result) - of pxIntLit: - result = newIntNodeP(nkIntLit, p.tok.iNumber, p) - setBaseFlags(result, p.tok.base) - getTok(p, result) - of pxInt64Lit: - result = newIntNodeP(nkInt64Lit, p.tok.iNumber, p) - setBaseFlags(result, p.tok.base) - getTok(p, result) - of pxFloatLit: - result = newFloatNodeP(nkFloatLit, p.tok.fNumber, p) - setBaseFlags(result, p.tok.base) - getTok(p, result) - of pxStrLit: - # Ansi C allows implicit string literal concatenations: - result = newStrNodeP(nkStrLit, p.tok.s, p) - getTok(p, result) - while p.tok.xkind == pxStrLit: - add(result.strVal, p.tok.s) - getTok(p, result) - of pxCharLit: - result = newIntNodeP(nkCharLit, ord(p.tok.s[0]), p) - getTok(p, result) - of pxParLe: - result = castExpression(p) - else: - result = ast.emptyNode - -proc multiplicativeExpression(p: var TParser): PNode = - result = castExpression(p) - while true: - case p.tok.xkind - of pxStar: - var a = result - result = newNodeP(nkInfix, p) - addSon(result, newIdentNodeP("*", p), a) - getTok(p, result) - var b = castExpression(p) - addSon(result, b) - of pxSlash: - var a = result - result = newNodeP(nkInfix, p) - addSon(result, newIdentNodeP("div", p), a) - getTok(p, result) - var b = castExpression(p) - addSon(result, b) - of pxMod: - var a = result - result = newNodeP(nkInfix, p) - addSon(result, newIdentNodeP("mod", p), a) - getTok(p, result) - var b = castExpression(p) - addSon(result, b) - else: break - -proc additiveExpression(p: var TParser): PNode = - result = multiplicativeExpression(p) - while true: - case p.tok.xkind - of pxPlus: - var a = result - result = newNodeP(nkInfix, p) - addSon(result, newIdentNodeP("+", p), a) - getTok(p, result) - var b = multiplicativeExpression(p) - addSon(result, b) - of pxMinus: - var a = result - result = newNodeP(nkInfix, p) - addSon(result, newIdentNodeP("-", p), a) - getTok(p, result) - var b = multiplicativeExpression(p) - addSon(result, b) - else: break - -proc incdec(p: var TParser, opr: string): PNode = - result = newNodeP(nkCall, p) - addSon(result, newIdentNodeP(opr, p)) - getTok(p, result) - addSon(result, unaryExpression(p)) - -proc unaryOp(p: var TParser, kind: TNodeKind): PNode = - result = newNodeP(kind, p) - getTok(p, result) - addSon(result, castExpression(p)) - -proc prefixCall(p: var TParser, opr: string): PNode = - result = newNodeP(nkPrefix, p) - addSon(result, newIdentNodeP(opr, p)) - getTok(p, result) - addSon(result, castExpression(p)) - -proc postfixExpression(p: var TParser): PNode = - result = primaryExpression(p) - while true: - case p.tok.xkind - of pxBracketLe: - var a = result - result = newNodeP(nkBracketExpr, p) - addSon(result, a) - getTok(p, result) - var b = expression(p) - addSon(result, b) - eat(p, pxBracketRi, result) - of pxParLe: - var a = result - result = newNodeP(nkCall, p) - addSon(result, a) - getTok(p, result) - if p.tok.xkind != pxParRi: - a = assignmentExpression(p) - addSon(result, a) - while p.tok.xkind == pxComma: - getTok(p, a) - a = assignmentExpression(p) - addSon(result, a) - eat(p, pxParRi, result) - of pxDot, pxArrow: - var a = result - result = newNodeP(nkDotExpr, p) - addSon(result, a) - getTok(p, result) - addSon(result, skipIdent(p)) - of pxPlusPlus: - var a = result - result = newNodeP(nkCall, p) - addSon(result, newIdentNodeP("inc", p)) - getTok(p, result) - addSon(result, a) - of pxMinusMinus: - var a = result - result = newNodeP(nkCall, p) - addSon(result, newIdentNodeP("dec", p)) - getTok(p, result) - addSon(result, a) - of pxLt: - if isTemplateAngleBracket(p): - result = optAngle(p, result) - else: break - else: break - -proc unaryExpression(p: var TParser): PNode = - case p.tok.xkind - of pxPlusPlus: result = incdec(p, "inc") - of pxMinusMinus: result = incdec(p, "dec") - of pxAmp: result = unaryOp(p, nkAddr) - of pxStar: result = unaryOp(p, nkBracketExpr) - of pxPlus: result = prefixCall(p, "+") - of pxMinus: result = prefixCall(p, "-") - of pxTilde: result = prefixCall(p, "not") - of pxNot: result = prefixCall(p, "not") +proc startExpression(p : var TParser, tok : TToken) : PNode = + #echo "nud ", $tok + case tok.xkind: of pxSymbol: - if p.tok.s == "sizeof": + if tok.s == "NULL": + result = newNodeP(nkNilLit, p) + elif tok.s == "sizeof": result = newNodeP(nkCall, p) addSon(result, newIdentNodeP("sizeof", p)) - getTok(p, result) - if p.tok.xkind == pxParLe: - getTok(p, result) + saveContext(p) + try: + addSon(result, expression(p, 139)) + closeContext(p) + except: + backtrackContext(p) + eat(p, pxParLe) addSon(result, typeDesc(p)) - eat(p, pxParRi, result) - else: - addSon(result, unaryExpression(p)) - elif p.tok.s == "new" or p.tok.s == "delete" and pfCpp in p.options.flags: - var opr = p.tok.s + eat(p, pxParRi) + elif tok.s == "new" or tok.s == "delete" and pfCpp in p.options.flags: + var opr = tok.s result = newNodeP(nkCall, p) - getTok(p, result) if p.tok.xkind == pxBracketLe: getTok(p) eat(p, pxBracketRi) @@ -1362,148 +1165,269 @@ proc unaryExpression(p: var TParser): PNode = addSon(result, typeDesc(p)) eat(p, pxParRi, result) else: - addSon(result, unaryExpression(p)) + addSon(result, expression(p, 139)) else: - result = postfixExpression(p) - else: result = postfixExpression(p) - -proc expression(p: var TParser): PNode = - # we cannot support C's ``,`` operator - result = assignmentExpression(p) - if p.tok.xkind == pxComma: - getTok(p, result) - parMessage(p, errOperatorExpected, ",") - -proc conditionalExpression(p: var TParser): PNode - -proc constantExpression(p: var TParser): PNode = - result = conditionalExpression(p) - -proc lvalue(p: var TParser): PNode = - result = unaryExpression(p) - -proc asgnExpr(p: var TParser, opr: string, a: PNode): PNode = - closeContext(p) - getTok(p, a) - var b = assignmentExpression(p) - result = newNodeP(nkAsgn, p) - addSon(result, a, newBinary(opr, copyTree(a), b, p)) - -proc incdec(p: var TParser, opr: string, a: PNode): PNode = - closeContext(p) - getTok(p, a) - var b = assignmentExpression(p) - result = newNodeP(nkCall, p) - addSon(result, newIdentNodeP(getIdent(opr), p), a, b) - -proc assignmentExpression(p: var TParser): PNode = - saveContext(p) - var a = lvalue(p) - case p.tok.xkind - of pxAsgn: - closeContext(p) - getTok(p, a) - var b = assignmentExpression(p) - result = newNodeP(nkAsgn, p) - addSon(result, a, b) - of pxPlusAsgn: result = incdec(p, "inc", a) - of pxMinusAsgn: result = incdec(p, "dec", a) - of pxStarAsgn: result = asgnExpr(p, "*", a) - of pxSlashAsgn: result = asgnExpr(p, "/", a) - of pxModAsgn: result = asgnExpr(p, "mod", a) - of pxShlAsgn: result = asgnExpr(p, "shl", a) - of pxShrAsgn: result = asgnExpr(p, "shr", a) - of pxAmpAsgn: result = asgnExpr(p, "and", a) - of pxHatAsgn: result = asgnExpr(p, "xor", a) - of pxBarAsgn: result = asgnExpr(p, "or", a) + result = mangledIdent(tok.s, p) + result = optScope(p, result) + result = optAngle(p, result) + of pxIntLit: + result = newIntNodeP(nkIntLit, tok.iNumber, p) + setBaseFlags(result, tok.base) + of pxInt64Lit: + result = newIntNodeP(nkInt64Lit, tok.iNumber, p) + setBaseFlags(result, tok.base) + of pxFloatLit: + result = newFloatNodeP(nkFloatLit, tok.fNumber, p) + setBaseFlags(result, tok.base) + of pxStrLit: + result = newStrNodeP(nkStrLit, tok.s, p) + while p.tok.xkind == pxStrLit: + add(result.strVal, p.tok.s) + getTok(p, result) + of pxCharLit: + result = newIntNodeP(nkCharLit, ord(tok.s[0]), p) + of pxParLe: + try: + saveContext(p) + result = newNodeP(nkPar, p) + addSon(result, expression(p, 0)) + if p.tok.xkind != pxParRi: + raise + getTok(p, result) + if p.tok.xkind in {pxSymbol, pxIntLit, pxFloatLit, pxStrLit, pxCharLit}: + raise + closeContext(p) + except: + backtrackContext(p) + result = newNodeP(nkCast, p) + addSon(result, typeDesc(p)) + eat(p, pxParRi, result) + addSon(result, expression(p, 139)) + of pxPlusPlus: + result = newNodeP(nkCall, p) + addSon(result, newIdentNodeP("inc", p)) + addSon(result, expression(p, 139)) + of pxMinusMinus: + result = newNodeP(nkCall, p) + addSon(result, newIdentNodeP("dec", p)) + addSon(result, expression(p, 139)) + of pxAmp: + result = newNodeP(nkAddr, p) + addSon(result, expression(p, 139)) + of pxStar: + result = newNodeP(nkBracketExpr, p) + addSon(result, expression(p, 139)) + of pxPlus: + result = newNodeP(nkPrefix, p) + addSon(result, newIdentNodeP("+", p)) + addSon(result, expression(p, 139)) + of pxMinus: + result = newNodeP(nkPrefix, p) + addSon(result, newIdentNodeP("-", p)) + addSon(result, expression(p, 139)) + of pxTilde: + result = newNodeP(nkPrefix, p) + addSon(result, newIdentNodeP("not", p)) + addSon(result, expression(p, 139)) + of pxNot: + result = newNodeP(nkPrefix, p) + addSon(result, newIdentNodeP("not", p)) + addSon(result, expression(p, 139)) else: - backtrackContext(p) - result = conditionalExpression(p) - -proc shiftExpression(p: var TParser): PNode = - result = additiveExpression(p) - while p.tok.xkind in {pxShl, pxShr}: - var op = if p.tok.xkind == pxShl: "shl" else: "shr" - getTok(p, result) - var a = result - var b = additiveExpression(p) - result = newBinary(op, a, b, p) + # probably from a failed sub expression attempt, try a type cast + raise newException(E_Base, "not " & $tok) -proc relationalExpression(p: var TParser): PNode = - result = shiftExpression(p) - # Nimrod uses ``<`` and ``<=``, etc. too: - while p.tok.xkind in {pxLt, pxLe, pxGt, pxGe}: - var op = tokKindToStr(p.tok.xkind) - getTok(p, result) - var a = result - var b = shiftExpression(p) - result = newBinary(op, a, b, p) +proc leftBindingPower(p : var TParser, tok : ref TToken) : int = + #echo "lbp ", $tok[] + case tok.xkind: + of pxComma: + return 10 + # throw == 20 + of pxAsgn, pxPlusAsgn, pxMinusAsgn, pxStarAsgn, pxSlashAsgn, pxModAsgn, pxShlAsgn, pxShrAsgn, pxAmpAsgn, pxHatAsgn, pxBarAsgn: + return 30 + of pxConditional: + return 40 + of pxBarBar: + return 50 + of pxAmpAmp: + return 60 + of pxBar: + return 70 + of pxHat: + return 80 + of pxAmp: + return 90 + of pxEquals, pxNeq: + return 100 + of pxLt, pxLe, pxGt, pxGe: + return 110 + of pxShl, pxShr: + return 120 + of pxPlus, pxMinus: + return 130 + of pxStar, pxSlash, pxMod: + return 140 + # .* ->* == 150 + of pxPlusPlus, pxMinusMinus, pxParLe, pxDot, pxArrow, pxBracketLe: + return 160 + # :: == 170 + else: + return 0 -proc equalityExpression(p: var TParser): PNode = - result = relationalExpression(p) - # Nimrod uses ``==`` and ``!=`` too: - while p.tok.xkind in {pxEquals, pxNeq}: - var op = tokKindToStr(p.tok.xkind) - getTok(p, result) - var a = result - var b = relationalExpression(p) - result = newBinary(op, a, b, p) +proc buildStmtList(a: PNode): PNode -proc andExpression(p: var TParser): PNode = - result = equalityExpression(p) - while p.tok.xkind == pxAmp: - getTok(p, result) - var a = result - var b = equalityExpression(p) - result = newBinary("and", a, b, p) - -proc exclusiveOrExpression(p: var TParser): PNode = - result = andExpression(p) - while p.tok.xkind == pxHat: - getTok(p, result) - var a = result - var b = andExpression(p) - result = newBinary("^", a, b, p) - -proc inclusiveOrExpression(p: var TParser): PNode = - result = exclusiveOrExpression(p) - while p.tok.xkind == pxBar: - getTok(p, result) - var a = result - var b = exclusiveOrExpression(p) - result = newBinary("or", a, b, p) - -proc logicalAndExpression(p: var TParser): PNode = - result = inclusiveOrExpression(p) - while p.tok.xkind == pxAmpAmp: - getTok(p, result) - var a = result - var b = inclusiveOrExpression(p) - result = newBinary("and", a, b, p) - -proc logicalOrExpression(p: var TParser): PNode = - result = logicalAndExpression(p) - while p.tok.xkind == pxBarBar: - getTok(p, result) - var a = result - var b = logicalAndExpression(p) - result = newBinary("or", a, b, p) - -proc conditionalExpression(p: var TParser): PNode = - result = logicalOrExpression(p) - if p.tok.xkind == pxConditional: - getTok(p, result) # skip '?' - var a = result - var b = expression(p) - eat(p, pxColon, b) - var c = conditionalExpression(p) +proc leftExpression(p : var TParser, tok : TToken, left : PNode) : PNode = + #echo "led ", $tok + case tok.xkind: + of pxComma: # 10 + # not supported as an expression, turns into a statement list + result = buildStmtList(left) + addSon(result, expression(p, 0)) + # throw == 20 + of pxAsgn: # 30 + result = newNodeP(nkAsgn, p) + addSon(result, left, expression(p, 29)) + of pxPlusAsgn: # 30 + result = newNodeP(nkCall, p) + addSon(result, newIdentNodeP(getIdent("inc"), p), left, expression(p, 29)) + of pxMinusAsgn: # 30 + result = newNodeP(nkCall, p) + addSon(result, newIdentNodeP(getIdent("dec"), p), left, expression(p, 29)) + of pxStarAsgn: # 30 + result = newNodeP(nkAsgn, p) + var right = expression(p, 29) + addSon(result, left, newBinary("*", copyTree(left), right, p)) + of pxSlashAsgn: # 30 + result = newNodeP(nkAsgn, p) + var right = expression(p, 29) + addSon(result, left, newBinary("/", copyTree(left), right, p)) + of pxModAsgn: # 30 + result = newNodeP(nkAsgn, p) + var right = expression(p, 29) + addSon(result, left, newBinary("mod", copyTree(left), right, p)) + of pxShlAsgn: # 30 + result = newNodeP(nkAsgn, p) + var right = expression(p, 29) + addSon(result, left, newBinary("shl", copyTree(left), right, p)) + of pxShrAsgn: # 30 + result = newNodeP(nkAsgn, p) + var right = expression(p, 29) + addSon(result, left, newBinary("shr", copyTree(left), right, p)) + of pxAmpAsgn: # 30 + result = newNodeP(nkAsgn, p) + var right = expression(p, 29) + addSon(result, left, newBinary("and", copyTree(left), right, p)) + of pxHatAsgn: # 30 + result = newNodeP(nkAsgn, p) + var right = expression(p, 29) + addSon(result, left, newBinary("xor", copyTree(left), right, p)) + of pxBarAsgn: # 30 + result = newNodeP(nkAsgn, p) + var right = expression(p, 29) + addSon(result, left, newBinary("or", copyTree(left), right, p)) + of pxConditional: # 40 + var a = expression(p, 0) + eat(p, pxColon, a) + var b = expression(p, 39) result = newNodeP(nkIfExpr, p) var branch = newNodeP(nkElifExpr, p) - addSon(branch, a, b) + addSon(branch, left, a) addSon(result, branch) branch = newNodeP(nkElseExpr, p) - addSon(branch, c) + addSon(branch, b) addSon(result, branch) + of pxBarBar: # 50 + result = newBinary("or", left, expression(p, 50), p) + of pxAmpAmp: # 60 + result = newBinary("and", left, expression(p, 60), p) + of pxBar: # 70 + result = newBinary("or", left, expression(p, 70), p) + of pxHat: # 80 + result = newBinary("^", left, expression(p, 80), p) + of pxAmp: # 90 + result = newBinary("and", left, expression(p, 90), p) + of pxEquals: # 100 + result = newBinary("==", left, expression(p, 100), p) + of pxNeq: # 100 + result = newBinary("!=", left, expression(p, 100), p) + of pxLt: # 110 + result = newBinary("<", left, expression(p, 110), p) + of pxLe: # 110 + result = newBinary("<=", left, expression(p, 110), p) + of pxGt: # 110 + result = newBinary(">", left, expression(p, 110), p) + of pxGe: # 110 + result = newBinary(">=", left, expression(p, 110), p) + of pxShl: # 120 + result = newBinary("shl", left, expression(p, 120), p) + of pxShr: # 120 + result = newBinary("shr", left, expression(p, 120), p) + of pxPlus: # 130 + result = newNodeP(nkInfix, p) + addSon(result, newIdentNodeP("+", p), left) + addSon(result, expression(p, 130)) + of pxMinus: # 130 + result = newNodeP(nkInfix, p) + addSon(result, newIdentNodeP("+", p), left) + addSon(result, expression(p, 130)) + of pxStar: # 140 + result = newNodeP(nkInfix, p) + addSon(result, newIdentNodeP("*", p), left) + addSon(result, expression(p, 140)) + of pxSlash: # 140 + result = newNodeP(nkInfix, p) + addSon(result, newIdentNodeP("div", p), left) + addSon(result, expression(p, 140)) + of pxMod: # 140 + result = newNodeP(nkInfix, p) + addSon(result, newIdentNodeP("mod", p), left) + addSon(result, expression(p, 140)) + # .* ->* == 150 + of pxPlusPlus: # 160 + result = newNodeP(nkCall, p) + addSon(result, newIdentNodeP("inc", p), left) + of pxMinusMinus: # 160 + result = newNodeP(nkCall, p) + addSon(result, newIdentNodeP("dec", p), left) + of pxParLe: # 160 + result = newNodeP(nkCall, p) + addSon(result, left) + while p.tok.xkind != pxParRi: + var a = expression(p, 29) + addSon(result, a) + while p.tok.xkind == pxComma: + getTok(p, a) + a = expression(p, 29) + addSon(result, a) + eat(p, pxParRi, result) + of pxDot: # 160 + result = newNodeP(nkDotExpr, p) + addSon(result, left) + addSon(result, skipIdent(p)) + of pxArrow: # 160 + result = newNodeP(nkDotExpr, p) + addSon(result, left) + addSon(result, skipIdent(p)) + of pxBracketLe: # 160 + result = newNodeP(nkBracketExpr, p) + addSon(result, left, expression(p)) + eat(p, pxBracketRi, result) + # :: == 170 + else: + result = left + +proc expression*(p : var TParser, rbp : int = 0) : PNode = + var tok : TToken + + tok = p.tok[] + getTok(p, result) + + result = startExpression(p, tok) + + while rbp < leftBindingPower(p, p.tok): + tok = p.tok[] + getTok(p, result) + result = leftExpression(p, tok, result) # Statements From 9ab1a3c7248993769a752526139424017c913ffa Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 13 Jan 2014 01:05:09 +0100 Subject: [PATCH 207/326] added test cases from strange loop event --- tests/showoff/tformatopt.nim | 57 +++++++++++++++++++++++++++++++++++ tests/showoff/thello2.nim | 11 +++++++ tests/showoff/thtml1.nim | 11 +++++++ tests/showoff/thtml2.nim | 37 +++++++++++++++++++++++ tests/showoff/tonce.nim | 22 ++++++++++++++ tests/showoff/tquasiquote.nim | 14 +++++++++ 6 files changed, 152 insertions(+) create mode 100644 tests/showoff/tformatopt.nim create mode 100644 tests/showoff/thello2.nim create mode 100644 tests/showoff/thtml1.nim create mode 100644 tests/showoff/thtml2.nim create mode 100644 tests/showoff/tonce.nim create mode 100644 tests/showoff/tquasiquote.nim diff --git a/tests/showoff/tformatopt.nim b/tests/showoff/tformatopt.nim new file mode 100644 index 0000000000..f33ed6921e --- /dev/null +++ b/tests/showoff/tformatopt.nim @@ -0,0 +1,57 @@ +discard """ + output: '''(a: 3 +b: 4 +s: abc +)''' +""" + +import macros + +proc invalidFormatString() = + echo "invalidFormatString" + +template formatImpl(handleChar: expr) = + var i = 0 + while i < f.len: + if f[i] == '$': + case f[i+1] + of '1'..'9': + var j = 0 + i += 1 + while f[i] in {'0'..'9'}: + j = j * 10 + ord(f[i]) - ord('0') + i += 1 + result.add(a[j-1]) + else: + invalidFormatString() + else: + result.add(handleChar(f[i])) + i += 1 + +proc `%`*(f: string, a: openArray[string]): string = + template identity(x: expr): expr = x + result = "" + formatImpl(identity) + +macro optFormat{`%`(f, a)}(f: string{lit}, a: openArray[string]): expr = + result = newNimNode(nnkBracket) + let f = f.strVal + formatImpl(newLit) + result = nestList(!"&", result) + +template optAdd1{x = y; add(x, z)}(x, y, z: string) = + x = y & z + +proc `/&` [T: object](x: T): string = + result = "(" + for name, value in fieldPairs(x): + result.add("$1: $2\n" % [name, $value]) + result.add(")") + +type + MyObject = object + a, b: int + s: string + +let obj = MyObject(a: 3, b: 4, s: "abc") +echo(/&obj) diff --git a/tests/showoff/thello2.nim b/tests/showoff/thello2.nim new file mode 100644 index 0000000000..d2e2f62271 --- /dev/null +++ b/tests/showoff/thello2.nim @@ -0,0 +1,11 @@ +discard """ + output: '''(a: 3, b: 4, s: abc)''' +""" + +type + MyObject = object + a, b: int + s: string + +let obj = MyObject(a: 3, b: 4, s: "abc") +echo obj diff --git a/tests/showoff/thtml1.nim b/tests/showoff/thtml1.nim new file mode 100644 index 0000000000..cd95c7971a --- /dev/null +++ b/tests/showoff/thtml1.nim @@ -0,0 +1,11 @@ +discard """ + output: "<br>" +""" + +template htmlTag(tag: expr) {.immediate.} = + proc tag(): string = "<" & astToStr(tag) & ">" + +htmlTag(br) +htmlTag(html) + +echo br() diff --git a/tests/showoff/thtml2.nim b/tests/showoff/thtml2.nim new file mode 100644 index 0000000000..8a451ebf13 --- /dev/null +++ b/tests/showoff/thtml2.nim @@ -0,0 +1,37 @@ +discard """ + output: "<html><head><title>now look at this</title></head><body><ul><li>Nimrod is quite capable</li></ul></body></html>" +""" + +import strutils + +template html(name: expr, matter: stmt) {.immediate.} = + proc name(): string = + result = "<html>" + matter + result.add("</html>") + +template nestedTag(tag: expr) {.immediate.} = + template tag(matter: stmt) {.immediate.} = + result.add("<" & astToStr(tag) & ">") + matter + result.add("</" & astToStr(tag) & ">") + +template simpleTag(tag: expr) {.immediate.} = + template tag(matter: expr) {.immediate.} = + result.add("<$1>$2</$1>" % [astToStr(tag), matter]) + +nestedTag body +nestedTag head +nestedTag ul +simpleTag title +simpleTag li + + +html mainPage: + head: + title "now look at this" + body: + ul: + li "Nimrod is quite capable" + +echo mainPage() diff --git a/tests/showoff/tonce.nim b/tests/showoff/tonce.nim new file mode 100644 index 0000000000..6fc372e875 --- /dev/null +++ b/tests/showoff/tonce.nim @@ -0,0 +1,22 @@ +discard """ + output: '''first call of p +some call of p +new instantiation +some call of p''' +""" + +template once(body: stmt) = + var x {.global.} = false + if not x: + x = true + body + +proc p() = + once: + echo "first call of p" + echo "some call of p" + +p() +once: + echo "new instantiation" +p() diff --git a/tests/showoff/tquasiquote.nim b/tests/showoff/tquasiquote.nim new file mode 100644 index 0000000000..df7fccc333 --- /dev/null +++ b/tests/showoff/tquasiquote.nim @@ -0,0 +1,14 @@ +discard """ + outputsub: '''tquasiquote.nim(14,8): Check failed: 1 > 2''' +""" + +import macros + +macro check(ex: expr): stmt = + var info = ex.lineInfo + var expString = ex.toStrLit + result = quote do: + if not `ex`: + echo `info`, ": Check failed: ", `expString` + +check 1 > 2 From 1e4c4d62e4d4ccda50d657fbd761da36a462f00d Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 13 Jan 2014 01:08:57 +0100 Subject: [PATCH 208/326] bugfix: doc generation for actors.nim works again --- compiler/renderer.nim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index f6fb0f8c0b..61babed66f 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -421,10 +421,11 @@ proc lsub(n: PNode): int = of nkElifExpr: result = lsons(n) + len("_elif_:_") of nkElseExpr: result = lsub(n.sons[0]) + len("_else:_") # type descriptions of nkTypeOfExpr: result = lsub(n.sons[0]) + len("type_") - of nkRefTy: result = lsub(n.sons[0]) + len("ref_") - of nkPtrTy: result = lsub(n.sons[0]) + len("ptr_") - of nkVarTy: result = lsub(n.sons[0]) + len("var_") - of nkDistinctTy: result = lsub(n.sons[0]) + len("Distinct_") + of nkRefTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + len("ref") + of nkPtrTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + len("ptr") + of nkVarTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + len("var") + of nkDistinctTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + + len("Distinct") of nkTypeDef: result = lsons(n) + 3 of nkOfInherit: result = lsub(n.sons[0]) + len("of_") of nkProcTy: result = lsons(n) + len("proc_") From 4045d7829b0ab9c8749aa701515a53c279db9958 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 13 Jan 2014 01:21:46 +0100 Subject: [PATCH 209/326] fixes db_sqlite --- lib/impure/db_sqlite.nim | 40 ++++++++++++++++++++-------------------- todo.txt | 1 - 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lib/impure/db_sqlite.nim b/lib/impure/db_sqlite.nim index 6930775533..c27efc3582 100644 --- a/lib/impure/db_sqlite.nim +++ b/lib/impure/db_sqlite.nim @@ -64,7 +64,7 @@ proc dbFormat(formatstr: TSqlQuery, args: varargs[string]): string = else: add(result, c) -proc TryExec*(db: TDbConn, query: TSqlQuery, +proc tryExec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): bool {.tags: [FReadDB, FWriteDb].} = ## tries to execute the query and returns true if successful, false otherwise. var q = dbFormat(query, args) @@ -73,7 +73,7 @@ proc TryExec*(db: TDbConn, query: TSqlQuery, if step(stmt) == SQLITE_DONE: result = finalize(stmt) == SQLITE_OK -proc Exec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]) {. +proc exec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]) {. tags: [FReadDB, FWriteDb].} = ## executes the query and raises EDB if not successful. if not TryExec(db, query, args): dbError(db) @@ -94,7 +94,7 @@ proc setRow(stmt: PStmt, r: var TRow, cols: cint) = let x = column_text(stmt, col) if not isNil(x): add(r[col], x) -iterator FastRows*(db: TDbConn, query: TSqlQuery, +iterator fastRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = ## executes the query and iterates over the result dataset. This is very ## fast, but potenially dangerous: If the for-loop-body executes another @@ -118,19 +118,19 @@ proc getRow*(db: TDbConn, query: TSqlQuery, setRow(stmt, result, L) if finalize(stmt) != SQLITE_OK: dbError(db) -proc GetAllRows*(db: TDbConn, query: TSqlQuery, +proc getAllRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): seq[TRow] {.tags: [FReadDB].} = ## executes the query and returns the whole result dataset. result = @[] - for r in FastRows(db, query, args): + for r in fastRows(db, query, args): result.add(r) -iterator Rows*(db: TDbConn, query: TSqlQuery, +iterator rows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = ## same as `FastRows`, but slower and safe. - for r in FastRows(db, query, args): yield r + for r in fastRows(db, query, args): yield r -proc GetValue*(db: TDbConn, query: TSqlQuery, +proc getValue*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): string {.tags: [FReadDB].} = ## executes the query and returns the first column of the first row of the ## result dataset. Returns "" if the dataset contains no rows or the database @@ -143,44 +143,44 @@ proc GetValue*(db: TDbConn, query: TSqlQuery, else: result = newStringOfCap(cb) add(result, column_text(stmt, 0)) - if finalize(stmt) != SQLITE_OK: dbError(db) else: result = "" + if finalize(stmt) != SQLITE_OK: dbError(db) -proc TryInsertID*(db: TDbConn, query: TSqlQuery, +proc tryInsertID*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} = ## executes the query (typically "INSERT") and returns the ## generated ID for the row or -1 in case of an error. var q = dbFormat(query, args) var stmt: sqlite3.PStmt + result = -1 if prepare_v2(db, q, q.len.cint, stmt, nil) == SQLITE_OK: if step(stmt) == SQLITE_DONE: - if finalize(stmt) == SQLITE_OK: - return last_insert_rowid(db) - result = -1 + result = last_insert_rowid(db) + if finalize(stmt) != SQLITE_OK: dbError(db) -proc InsertID*(db: TDbConn, query: TSqlQuery, +proc insertID*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} = ## executes the query (typically "INSERT") and returns the ## generated ID for the row. For Postgre this adds ## ``RETURNING id`` to the query, so it only works if your primary key is ## named ``id``. - result = TryInsertID(db, query, args) + result = tryInsertID(db, query, args) if result < 0: dbError(db) -proc ExecAffectedRows*(db: TDbConn, query: TSqlQuery, +proc execAffectedRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {. tags: [FReadDB, FWriteDb].} = ## executes the query (typically "UPDATE") and returns the ## number of affected rows. - Exec(db, query, args) + exec(db, query, args) result = changes(db) -proc Close*(db: TDbConn) {.tags: [FDB].} = +proc close*(db: TDbConn) {.tags: [FDB].} = ## closes the database connection. if sqlite3.close(db) != SQLITE_OK: dbError(db) -proc Open*(connection, user, password, database: string): TDbConn {. +proc open*(connection, user, password, database: string): TDbConn {. tags: [FDB].} = ## opens a database connection. Raises `EDb` if the connection could not ## be established. Only the ``connection`` parameter is used for ``sqlite``. @@ -192,7 +192,7 @@ proc Open*(connection, user, password, database: string): TDbConn {. when isMainModule: var db = open("db.sql", "", "", "") - Exec(db, sql"create table tbl1(one varchar(10), two smallint)", []) + exec(db, sql"create table tbl1(one varchar(10), two smallint)", []) exec(db, sql"insert into tbl1 values('hello!',10)", []) exec(db, sql"insert into tbl1 values('goodbye', 20)", []) #db.query("create table tbl1(one varchar(10), two smallint)") diff --git a/todo.txt b/todo.txt index 6c76019f83..c4e355c9cc 100644 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,6 @@ version 0.9.4 ============= -- better tester - ensure (ref T)(a, b) works as a type conversion and type constructor - Aporia doesn't compile under devel - document new templating symbol binding rules From 20b5f31c03fb556ec0aa2428a40adbac004d8987 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 13 Jan 2014 02:10:03 +0100 Subject: [PATCH 210/326] new tester; all tests categorized --- koch.nim | 9 +- tests/{run => actiontable}/tactiontable.nim | 0 .../{reject => actiontable}/tactiontable2.nim | 0 tests/{compile => alias}/talias.nim | 0 tests/{reject => ambsym}/mambsym1.nim | 0 tests/{reject => ambsym}/mambsym2.nim | 0 tests/{run => ambsym}/mambsys1.nim | 0 tests/{run => ambsym}/mambsys2.nim | 0 tests/{reject => ambsym}/tambsym.nim | 0 tests/{run => ambsym}/tambsym2.nim | 0 tests/{reject => ambsym}/tambsym3.nim | 0 tests/{run => ambsym}/tambsys.nim | 0 tests/{run => array}/tarray.nim | 0 tests/{run => array}/tarray2.nim | 0 tests/{run => array}/tarray3.nim | 0 tests/{reject => array}/tarraycons.nim | 0 .../tarraycons.nim => array/tarraycons2.nim} | 0 tests/{reject => array}/tarrayplus.nim | 0 tests/{compile => array}/tarrindx.nim | 0 tests/{run => assert}/tassert.nim | 0 tests/{run => assert}/tfailedassert.nim | 0 tests/{run => assert}/tunittests.nim | 0 tests/{run => assert}/tuserassert.nim | 0 tests/{compile => assign}/tassign.nim | 0 tests/{run => assign}/tcopy.nim | 0 tests/{run => assign}/tgenericassign.nim | 0 .../{run => assign}/tgenericassigntuples.nim | 0 tests/{run => assign}/tobjasgn.nim | 0 tests/{run => assign}/tvariantasgn.nim | 0 tests/{run => astoverload}/tastoverload1.nim | 0 tests/{run => async}/tasynciossl.nim | 0 tests/{run => async}/tasyncudp.nim | 0 tests/{run => bind}/mbind3.nim | 0 tests/{run => bind}/tbind1.nim | 0 tests/{reject => bind}/tbind2.nim | 0 tests/{run => bind}/tbind3.nim | 0 tests/{compile => bind}/tbindoverload.nim | 0 tests/{reject => bind}/tbindtypedesc.nim | 0 tests/{compile => bind}/tdatabind.nim | 0 tests/{run => bind}/tmixin.nim | 0 .../tnicerrorforsymchoice.nim | 0 tests/{reject => block}/tblock1.nim | 0 tests/{run => borrow}/tborrow.nim | 0 tests/{reject => borrow}/tinvalidborrow.nim | 0 tests/{run => casestmt}/tcase_setconstr.nim | 0 tests/{reject => casestmt}/tcaseexpr1.nim | 0 .../tcaseoverlaprange.nim | 0 .../tcaseoverlaprange2.nim | 0 tests/{run => casestmt}/tcasestm.nim | 0 tests/{compile => casestmt}/tcomputedgoto.nim | 0 .../{compile => casestmt}/tlinearscanend.nim | 0 tests/{compile => ccgbugs}/tccgen1.nim | 0 tests/{run => ccgbugs}/tcgbug.nim | 0 tests/{compile => ccgbugs}/tcodegenbug1.nim | 0 tests/{run => closure}/tclosure.nim | 0 tests/{run => closure}/tclosure2.nim | 0 tests/{run => closure}/tclosure3.nim | 0 tests/{compile => closure}/tclosure4.nim | 0 tests/{compile => closure}/tclosurebug2.nim | 0 tests/{run => closure}/tinterf.nim | 0 tests/{reject => closure}/tinvalidclosure.nim | 0 .../{reject => closure}/tinvalidclosure2.nim | 0 .../tnamedparamanonproc.nim | 0 tests/{compile => closure}/tnestedproc.nim | 0 tests/{run => closure}/uclosures.nim | 0 tests/{run => cnstseq}/tcnstseq.nim | 0 tests/{run => cnstseq}/tcnstseq2.nim | 0 tests/{run => cnstseq}/tcnstseq3.nim | 0 tests/compile/mvarious.nim | 6 - tests/compile/sunset.tmpl | 68 ---- tests/compile/tambsym2.nim | 6 - tests/compile/tcmdline.nim | 14 - tests/compile/tcolonisproc.nim | 12 - tests/compile/tdllvar.nim | 16 - tests/compile/temptyecho.nim | 2 - tests/compile/tendian.nim | 3 - tests/compile/tfib.nim | 11 - tests/compile/tgetstartmilsecs.nim | 7 - tests/compile/tgtk.nim | 51 --- tests/compile/thallo.nim | 85 ----- tests/compile/theaproots.nim | 71 ---- tests/compile/tlastmod.nim | 18 - tests/compile/tlibs.nim | 24 -- tests/compile/tloops.nim | 87 ----- tests/compile/tmandelbrot.nim | 57 ---- tests/compile/tnew.nim | 49 --- tests/compile/tnewlibs.nim | 17 - tests/compile/tnewsets.nim | 6 - tests/compile/tnewuns.nim | 12 - tests/compile/tnoforward.nim | 10 - tests/compile/tparedef.nim | 4 - tests/compile/tprep.nim | 30 -- tests/compile/tquicksort.nim | 26 -- tests/compile/tradix.nim | 319 ------------------ tests/compile/treadln.nim | 12 - tests/compile/treadx.nim | 14 - tests/compile/tshadow_magic_type.nim | 24 -- tests/compile/tsizeof.nim | 10 - tests/compile/tstrace.nim | 16 - tests/compile/tstrdesc.nim | 14 - tests/compile/tstrdist.nim | 26 -- tests/compile/tvarious.nim | 63 ---- tests/{compile => compiles}/tcompiles.nim | 0 tests/{run => concat}/tconcat.nim | 0 tests/{run => concurrency}/tnodeadlocks.nim | 0 tests/{reject => constr}/tconstr1.nim | 0 tests/{run => constr}/tconstr2.nim | 0 .../{reject => constraints}/tconstraints.nim | 0 tests/{run => controlflow}/tcontinue.nim | 0 tests/{reject => controlflow}/tstatret.nim | 0 tests/{compile => converter}/tconvcolors.nim | 0 tests/{compile => converter}/tconvert.nim | 0 .../{run => converter}/tgenericconverter.nim | 0 .../ttypeconverter1.nim | 0 .../mdefaultprocparam.nim | 0 .../tdefaultprocparam.nim | 0 tests/{reject => deprecated}/tdeprecated.nim | 0 tests/{run => destructor}/tdestructor.nim | 0 .../tdestructor2.nim} | 0 .../{compile => destructor}/tdictdestruct.nim | 0 tests/{compile => discard}/tdiscardable.nim | 0 tests/{reject => discard}/tneedsdiscard.nim | 0 tests/{run => distinct}/tcurrncy.nim | 0 tests/{reject => effects}/teffects1.nim | 0 tests/{reject => effects}/teffects2.nim | 0 tests/{reject => effects}/teffects3.nim | 0 tests/{reject => effects}/teffects4.nim | 0 tests/{reject => effects}/teffects5.nim | 0 .../teffects1.nim => effects/teffects6.nim} | 0 tests/{reject => effects}/tsidee1.nim | 0 tests/{run => effects}/tsidee2.nim | 0 tests/{run => effects}/tsidee3.nim | 0 tests/{reject => effects}/tsidee4.nim | 0 tests/{compile => enum}/tenum.nim | 0 tests/{compile => enum}/tenum2.nim | 0 tests/{compile => enum}/tenum3.nim | 0 tests/{run => enum}/tenumhole.nim | 0 tests/{reject => enum}/tenumitems.nim | 0 .../tenumitems.nim => enum/tenumitems2.nim} | 0 tests/{reject => enum}/tenummix.nim | 0 tests/{run => enum}/tnamedenumfields.nim | 0 tests/{compile => enum}/toptions.nim | 0 tests/{run => exception}/tcontinuexc.nim | 0 tests/{run => exception}/texceptions.nim | 0 tests/{run => exception}/texcpt1.nim | 0 tests/{run => exception}/texcsub.nim | 0 tests/{run => exception}/tfinally.nim | 0 tests/{run => exception}/tfinally2.nim | 0 tests/{run => exception}/tfinally3.nim | 0 tests/{run => exception}/tonraise.nim | 0 tests/{run => exception}/treraise.nim | 0 tests/{run => exception}/tunhandledexc.nim | 0 tests/{run => exception}/twrongexc.nim | 0 tests/{reject => exprs}/texprstmt.nim | 0 tests/{reject => exprs}/tstmtexp.nim | 0 tests/{run => exprs}/tstmtexprs.nim | 0 tests/{run => fields}/tfieldindex.nim | 0 tests/{run => fields}/tfielditerator.nim | 0 tests/{run => fields}/tfielditerator2.nim | 0 tests/{run => float}/tfloat1.nim | 0 tests/{run => float}/tfloat2.nim | 0 tests/{run => float}/tfloat3.nim | 0 tests/{run => friends}/mfriends.nim | 0 tests/{run => friends}/tfriends.nim | 0 tests/{run => generics}/tbintre2.nim | 0 tests/{run => generics}/tbintree.nim | 0 .../tcan_alias_generic.nim | 0 .../tcan_alias_specialised_generic.nim | 0 .../tcan_inherit_generic.nim | 0 .../tcan_specialise_generic.nim | 0 tests/{run => generics}/texplicitgeneric1.nim | 0 tests/{run => generics}/texplicitgeneric2.nim | 0 .../{compile => generics}/tforwardgeneric.nim | 0 .../tgeneric.nim => generics/tgeneric0.nim} | 0 .../tgenerics1.nim => generics/tgeneric1.nim} | 0 tests/{compile => generics}/tgeneric2.nim | 0 tests/{compile => generics}/tgeneric3.nim | 0 tests/{compile => generics}/tgeneric4.nim | 0 .../tgenericdefaults.nim | 0 .../{compile => generics}/tgenericmatcher.nim | 0 .../tgenericmatcher2.nim | 0 tests/{run => generics}/tgenericprocvar.nim | 0 tests/{compile => generics}/tgenericprop.nim | 0 tests/{compile => generics}/tgenericrefs.nim | 0 .../tgenericshardcases.nim | 0 tests/{compile => generics}/tgenerictmpl.nim | 0 .../{compile => generics}/tgenericvariant.nim | 0 .../tspecialised_is_equivalent.nim | 0 .../{compile => generics}/tthread_generic.nim | 0 .../{run => generics}/tvarargs_vs_generic.nim | 0 tests/{run => gensym}/tgensym.nim | 0 tests/{compile => gensym}/tgensymgeneric.nim | 0 tests/{run => global}/tglobal.nim | 0 tests/{compile => global}/tglobalforvar.nim | 0 tests/{run => ifstmt}/tnestif.nim | 0 .../{compile => implicit}/timplicititems.nim | 0 tests/{compile => implicit}/timplictderef.nim | 0 .../{run => important}/tdrdobbs_examples.nim | 0 tests/{reject => init}/tuninit1.nim | 0 tests/{run => init}/tzeroarray.nim | 0 tests/{run => iter}/tcountup.nim | 0 tests/{compile => iter}/titer.nim | 0 tests/{compile => iter}/titer2.nim | 0 tests/{run => iter}/titer3.nim | 0 tests/{reject => iter}/titer4.nim | 0 tests/{run => iter}/titer5.nim | 0 tests/{run => iter}/titer6.nim | 0 tests/{run => iter}/titer7.nim | 0 tests/{run => iter}/titer8.nim | 0 tests/{run => iter}/titer9.nim | 0 .../titer_no_tuple_unpack.nim | 0 tests/{compile => iter}/titerovl.nim | 0 tests/{run => iter}/titerslice.nim | 0 tests/{run => iter}/titervaropenarray.nim | 0 tests/{run => iter}/tmoditer.nim | 0 tests/{reject => iter}/treciter.nim | 0 tests/{reject => iter}/twrongiter.nim | 0 tests/{reject => let}/tlet.nim | 0 tests/{reject => let}/tlet2.nim | 0 tests/{run => lexer}/thexlit.nim | 0 tests/{compile => lexer}/thexrange.nim | 0 tests/{compile => lexer}/tident.nim | 0 tests/{reject => lexer}/tind1.nim | 0 tests/{run => lexer}/tindent1.nim | 0 tests/{compile => lexer}/tlexer.nim | 0 tests/{reject => lexer}/tmissingnl.nim | 0 tests/{run => lexer}/tstrlits.nim | 0 tests/{reject => lexer}/tunderscores.nim | 0 tests/{compile => lookup}/tredef.nim | 0 tests/{run => lookups}/tkoeniglookup.nim | 0 tests/{compile => macro}/tmacro1.nim | 0 tests/{run => macro}/tmacro2.nim | 0 tests/{run => macro}/tmacro3.nim | 0 tests/{run => macro}/tmacro4.nim | 0 .../tmacro2.nim => macro/tmacro5.nim} | 0 tests/{compile => macro}/tmacroaspragma.nim | 0 tests/{run => macro}/tmacrogenerics.nim | 0 tests/{run => macro}/tmacros1.nim | 0 tests/{compile => macro}/tmacrostmt.nim | 0 tests/{compile => macro}/tmacrotypes.nim | 0 .../tnimrodnode_for_runtime.nim | 0 tests/{run => macro}/tprintf.nim | 0 tests/{run => macro}/tquotewords.nim | 0 tests/{reject => macro}/trecmacro.nim | 0 tests/{run => macro}/tstringinterp.nim | 0 tests/{run => macro}/tvtable.nim | 0 tests/{compile => macros}/tdumpast.nim | 0 tests/{compile => macros}/tdumpast2.nim | 0 tests/{run => macros}/tdumptree.nim | 0 tests/{run => macros}/tidgen.nim | 0 tests/{run => magics}/tlowhigh.nim | 0 tests/{run => matrix}/tmatrix.nim | 0 tests/{compile => matrix}/tmatrix1.nim | 0 tests/{compile => matrix}/tmatrix2.nim | 0 tests/{compile => metatype}/tbindtypedesc.nim | 0 .../tcompositetypeclasses.nim | 0 tests/{compile => metatype}/tconstraints.nim | 0 tests/{run => metatype}/tsemistatic.nim | 0 tests/metatype/ttypebar.nim | 14 + tests/{compile => metatype}/ttypeclasses.nim | 0 tests/{run => metatype}/ttypedesc1.nim | 0 .../{compile => metatype}/ttypeselectors.nim | 0 tests/{run => metatype}/ttypetraits.nim | 0 tests/{run => metatype}/tusertypeclasses.nim | 0 tests/{run => metatype}/utypeclasses.nim | 0 tests/{run => method}/mmultim3.nim | 0 tests/{reject => method}/tmethod.nim | 0 tests/{run => method}/tmethods1.nim | 0 tests/{run => method}/tmultim1.nim | 0 tests/{run => method}/tmultim2.nim | 0 tests/{run => method}/tmultim3.nim | 0 tests/{run => method}/tmultim4.nim | 0 tests/{run => method}/tmultim6.nim | 0 tests/{run => method}/tsimmeth.nim | 0 tests/{reject => module}/mopaque.nim | 0 tests/{compile => module}/mrecmod.nim | 0 tests/{compile => module}/mrecmod2.nim | 0 tests/{reject => module}/topaque.nim | 0 tests/{reject => module}/trecinca.nim | 0 tests/{reject => module}/trecincb.nim | 0 tests/{compile => module}/trecmod.nim | 0 tests/{compile => module}/trecmod2.nim | 0 tests/{compile => modules}/mexporta.nim | 0 tests/{compile => modules}/mexportb.nim | 0 tests/{compile => modules}/texport.nim | 0 tests/{reject => modules}/timportexcept.nim | 0 .../{reject => namedparams}/tnamedparams.nim | 0 .../tnamedparams2.nim} | 0 tests/{reject => namspc}/mnamspc1.nim | 0 tests/{reject => namspc}/mnamspc2.nim | 0 tests/{reject => namspc}/tnamspc.nim | 0 tests/{reject => notnil}/tnotnil.nim | 0 tests/{reject => notnil}/tnotnil1.nim | 0 tests/{reject => notnil}/tnotnil2.nim | 0 tests/{run => object}/tobjconstr.nim | 0 tests/{compile => object}/tobjconstr2.nim | 0 tests/{compile => object}/tobjcov.nim | 0 tests/{run => object}/tobject.nim | 0 tests/{compile => object}/tobject2.nim | 0 tests/{compile => object}/tobject3.nim | 0 tests/{compile => object}/toop.nim | 0 tests/{run => object}/toop1.nim | 0 tests/{compile => objects}/tobjects.nim | 0 tests/{reject => objvariant}/tadrdisc.nim | 0 .../{reject => objvariant}/tcheckedfield1.nim | 0 .../{reject => objvariant}/temptycaseobj.nim | 0 tests/{run => objvariant}/tvariantstack.nim | 0 tests/{reject => openarray}/topena1.nim | 0 tests/{run => openarray}/topenarrayrepr.nim | 0 tests/{run => openarray}/topenlen.nim | 0 tests/{run => operator}/tofopr.nim | 0 tests/{run => operator}/toprprec.nim | 0 tests/{run => operator}/tprecedence.nim | 0 tests/{run => overflw}/toverflw.nim | 0 tests/{run => overflw}/toverflw2.nim | 0 tests/{run => overflw}/tovfint.nim | 0 tests/{reject => overload}/toverl.nim | 0 tests/{run => overload}/toverl2.nim | 0 tests/{run => overload}/toverl3.nim | 0 tests/{compile => overload}/toverprc.nim | 0 tests/{run => overload}/toverwr.nim | 0 tests/{run => pattern}/tpatterns.nim | 0 tests/{compile => pragma}/tuserpragma.nim | 0 tests/{compile => pragmas}/tpush.nim | 0 tests/{run => proc}/tnestprc.nim | 0 tests/{reject => proc}/tprocredef.nim | 0 .../{compile => procvar}/tgenericprocvar.nim | 0 tests/{reject => procvar}/tprocvar.nim | 0 .../tprocvar.nim => procvar/tprocvar2.nim} | 0 tests/{compile => procvar}/tprocvars.nim | 0 tests/{compile => range}/compilehelpers.nim | 0 tests/{run => range}/tbug499771.nim | 0 tests/{compile => range}/tcolors.nim | 0 tests/{compile => range}/tmatrix3.nim | 0 tests/{reject => range}/tsubrange.nim | 0 tests/{run => range}/tsubrange2.nim | 0 .../tsubrange.nim => range/tsubrange3.nim} | 0 tests/reject/99bottles.nim | 1 - tests/reject/t99bott.nim | 36 -- tests/reject/tatomic.nim | 12 - tests/reject/tgenconstraints.nim | 30 -- tests/reject/tinc.nim | 12 - tests/reject/tinout.nim | 16 - tests/reject/tinvalidarrayaccess.nim | 14 - tests/reject/tinvalidnewseq.nim | 27 -- tests/reject/tinvwhen.nim | 15 - tests/reject/tnoinst.nim | 16 - tests/reject/tnolen.nim | 9 - tests/reject/tnoop.nim | 12 - tests/reject/tnot.nim | 22 -- tests/reject/trawstr.nim | 12 - tests/reject/tsimtych.nim | 12 - tests/run/globalaux.nim | 15 - tests/run/globalaux2.nim | 4 - tests/run/minit.nim | 2 - tests/run/tack.nim | 21 -- tests/run/tbug511622.nim | 16 - tests/run/tdomulttest.nim | 17 - tests/run/temit.nim | 20 -- tests/run/teventemitter.nim | 33 -- tests/run/tevents.nim | 48 --- tests/run/tfilter.nim | 41 --- tests/run/thintoff.nim | 12 - tests/run/tinit.nim | 12 - tests/run/tints.nim | 45 --- tests/run/tlocals.nim | 11 - tests/run/tmemoization.nim | 17 - tests/run/tnewderef.nim | 11 - tests/run/tpos.nim | 35 -- tests/run/tromans.nim | 71 ---- tests/run/tsimplesort.nim | 313 ----------------- tests/run/tslices.nim | 59 ---- tests/run/tsortdev.nim | 59 ---- tests/run/tstrange.nim | 23 -- tests/run/tvarious1.nim | 41 --- tests/run/tvarnums.nim | 142 -------- tests/{compile => seq}/tseq2.nim | 0 tests/{run => seq}/tseqcon.nim | 0 tests/{compile => seq}/tseqcon2.nim | 0 tests/{run => seq}/tseqtuple.nim | 0 tests/{run => seq}/tsequtils.nim | 0 tests/{run => seq}/ttoseq.nim | 0 tests/{run => sets}/tsets.nim | 0 tests/{run => sets}/tsets2.nim | 0 tests/{run => static}/tstaticparams.nim | 0 tests/{compile => stdlib}/tcputime.nim | 0 tests/{run => stdlib}/tcritbits.nim | 0 tests/{compile => stdlib}/tdialogs.nim | 0 tests/{compile => stdlib}/techo.nim | 0 tests/{run => stdlib}/tformat.nim | 0 tests/{run => stdlib}/thashes.nim | 0 tests/{compile => stdlib}/tio.nim | 0 tests/{compile => stdlib}/tircbot.nim | 0 tests/{run => stdlib}/tlists.nim | 0 tests/{compile => stdlib}/tmarshal.nim | 0 tests/{run => stdlib}/tmath.nim | 0 .../{compile/tmath.nim => stdlib/tmath2.nim} | 0 tests/{compile => stdlib}/tmongo.nim | 0 tests/{compile => stdlib}/tos.nim | 0 tests/{compile => stdlib}/tparscfg.nim | 0 tests/{compile => stdlib}/tparsefloat.nim | 0 tests/{compile => stdlib}/tparsopt.nim | 0 tests/{run => stdlib}/tpegs.nim | 0 tests/{compile => stdlib}/tposix.nim | 0 tests/{compile => stdlib}/tquit.nim | 0 tests/{run => stdlib}/tregex.nim | 0 tests/{run => stdlib}/treguse.nim | 0 tests/{run => stdlib}/trepr.nim | 0 .../{compile/trepr.nim => stdlib/trepr2.nim} | 0 tests/{compile => stdlib}/tsockets.nim | 0 tests/{compile => stdlib}/tsortcall.nim | 0 tests/{run => stdlib}/tsplit.nim | 0 tests/{compile => stdlib}/tstreams.nim | 0 tests/{compile => stdlib}/tstrset.nim | 0 tests/{compile => stdlib}/tstrtabs.nim | 0 tests/{run => stdlib}/tstrutil.nim | 0 tests/{compile => stdlib}/ttime.nim | 0 tests/{run => stdlib}/tunidecode.nim | 0 tests/{compile => stdlib}/twalker.nim | 0 tests/{run => stdlib}/txmlgen.nim | 0 tests/{run => stdlib}/txmltree.nim | 0 tests/{compile => table}/ttableconstr.nim | 0 tests/{run => table}/ttables.nim | 0 tests/{run => table}/ttables2.nim | 0 .../mcan_access_hidden_field.nim | 0 tests/{compile => template}/mtempl5.nim | 0 .../tcan_access_hidden_field.nim | 0 .../{compile => template}/thygienictempl.nim | 0 tests/{compile => template}/tmodulealias.nim | 0 tests/{run => template}/tstempl.nim | 0 tests/{compile => template}/ttempl.nim | 0 tests/{reject => template}/ttempl2.nim | 0 tests/{compile => template}/ttempl3.nim | 0 tests/{compile => template}/ttempl4.nim | 0 tests/{compile => template}/ttempl5.nim | 0 .../ttemplreturntype.nim | 0 tests/{run => template}/utemplates.nim | 0 tests/testament/backend.nim | 120 +++++++ tests/testament/categories.nim | 256 ++++++++++++++ tests/testament/specs.nim | 130 +++++++ tests/testament/tester.nim | 267 +++++++++++++++ tests/{reject => trmacros}/tdisallowif.nim | 0 tests/{run => tuples}/tanontuples.nim | 0 .../{reject => tuples}/twrongtupleaccess.nim | 0 tests/{compile => typerel}/tcommontype.nim | 0 .../tno_int_in_bool_context.nim | 0 .../{compile => typerel}/tnoargopenarray.nim | 0 tests/{reject => typerel}/tnocontains.nim | 0 tests/{compile => typerel}/trectuple.nim | 0 tests/{compile => typerel}/trectuples.nim | 0 tests/{reject => typerel}/trectype.nim | 0 tests/{reject => typerel}/trefs.nim | 0 tests/{run => typerel}/trettypeinference.nim | 0 .../tsecondarrayproperty.nim | 0 tests/{compile => typerel}/ttuple1.nim | 0 .../{reject => typerel}/ttypelessemptyset.nim | 0 tests/{reject => typerel}/ttypenoval.nim | 0 tests/{reject => typerel}/ttypenovalue.nim | 0 tests/{compile => typerel}/tvoid.nim | 0 tests/{compile => typerel}/typalias.nim | 0 tests/{reject => typerel}/typredef.nim | 0 tests/{run => types}/tfinalobj.nim | 0 tests/{compile => types}/tforwty.nim | 0 tests/{compile => types}/tforwty2.nim | 0 .../tillegaltyperecursion.nim | 0 tests/{reject => types}/tillrec.nim | 0 tests/{compile => types}/tinheritref.nim | 0 tests/{compile => types}/tisop.nim | 0 tests/{run => types}/tisopr.nim | 0 tests/{run => usingstmt}/tusingstatement.nim | 0 tests/{reject => varres}/tvarres1.nim | 0 tests/{reject => varres}/tvarres2.nim | 0 .../{run/tvarres1.nim => varres/tvarres3.nim} | 0 .../{run/tvarres2.nim => varres/tvarres4.nim} | 0 tests/{run => varres}/tvartup.nim | 0 tests/{run => varstmt}/tlet.nim | 0 tests/{run => varstmt}/tvardecl.nim | 0 tests/{compile => vm}/tconsteval.nim | 0 tests/{compile => vm}/teval1.nim | 0 tests/{compile => vm}/tslurp.nim | 0 tests/{reject => vm}/twrongconst.nim | 0 481 files changed, 794 insertions(+), 2506 deletions(-) rename tests/{run => actiontable}/tactiontable.nim (100%) rename tests/{reject => actiontable}/tactiontable2.nim (100%) rename tests/{compile => alias}/talias.nim (100%) rename tests/{reject => ambsym}/mambsym1.nim (100%) rename tests/{reject => ambsym}/mambsym2.nim (100%) rename tests/{run => ambsym}/mambsys1.nim (100%) rename tests/{run => ambsym}/mambsys2.nim (100%) rename tests/{reject => ambsym}/tambsym.nim (100%) rename tests/{run => ambsym}/tambsym2.nim (100%) rename tests/{reject => ambsym}/tambsym3.nim (100%) rename tests/{run => ambsym}/tambsys.nim (100%) rename tests/{run => array}/tarray.nim (100%) rename tests/{run => array}/tarray2.nim (100%) rename tests/{run => array}/tarray3.nim (100%) rename tests/{reject => array}/tarraycons.nim (100%) rename tests/{run/tarraycons.nim => array/tarraycons2.nim} (100%) rename tests/{reject => array}/tarrayplus.nim (100%) rename tests/{compile => array}/tarrindx.nim (100%) rename tests/{run => assert}/tassert.nim (100%) rename tests/{run => assert}/tfailedassert.nim (100%) rename tests/{run => assert}/tunittests.nim (100%) rename tests/{run => assert}/tuserassert.nim (100%) rename tests/{compile => assign}/tassign.nim (100%) rename tests/{run => assign}/tcopy.nim (100%) rename tests/{run => assign}/tgenericassign.nim (100%) rename tests/{run => assign}/tgenericassigntuples.nim (100%) rename tests/{run => assign}/tobjasgn.nim (100%) rename tests/{run => assign}/tvariantasgn.nim (100%) rename tests/{run => astoverload}/tastoverload1.nim (100%) rename tests/{run => async}/tasynciossl.nim (100%) rename tests/{run => async}/tasyncudp.nim (100%) rename tests/{run => bind}/mbind3.nim (100%) rename tests/{run => bind}/tbind1.nim (100%) rename tests/{reject => bind}/tbind2.nim (100%) rename tests/{run => bind}/tbind3.nim (100%) rename tests/{compile => bind}/tbindoverload.nim (100%) rename tests/{reject => bind}/tbindtypedesc.nim (100%) rename tests/{compile => bind}/tdatabind.nim (100%) rename tests/{run => bind}/tmixin.nim (100%) rename tests/{reject => bind}/tnicerrorforsymchoice.nim (100%) rename tests/{reject => block}/tblock1.nim (100%) rename tests/{run => borrow}/tborrow.nim (100%) rename tests/{reject => borrow}/tinvalidborrow.nim (100%) rename tests/{run => casestmt}/tcase_setconstr.nim (100%) rename tests/{reject => casestmt}/tcaseexpr1.nim (100%) rename tests/{reject => casestmt}/tcaseoverlaprange.nim (100%) rename tests/{reject => casestmt}/tcaseoverlaprange2.nim (100%) rename tests/{run => casestmt}/tcasestm.nim (100%) rename tests/{compile => casestmt}/tcomputedgoto.nim (100%) rename tests/{compile => casestmt}/tlinearscanend.nim (100%) rename tests/{compile => ccgbugs}/tccgen1.nim (100%) rename tests/{run => ccgbugs}/tcgbug.nim (100%) rename tests/{compile => ccgbugs}/tcodegenbug1.nim (100%) rename tests/{run => closure}/tclosure.nim (100%) rename tests/{run => closure}/tclosure2.nim (100%) rename tests/{run => closure}/tclosure3.nim (100%) rename tests/{compile => closure}/tclosure4.nim (100%) rename tests/{compile => closure}/tclosurebug2.nim (100%) rename tests/{run => closure}/tinterf.nim (100%) rename tests/{reject => closure}/tinvalidclosure.nim (100%) rename tests/{reject => closure}/tinvalidclosure2.nim (100%) rename tests/{compile => closure}/tnamedparamanonproc.nim (100%) rename tests/{compile => closure}/tnestedproc.nim (100%) rename tests/{run => closure}/uclosures.nim (100%) rename tests/{run => cnstseq}/tcnstseq.nim (100%) rename tests/{run => cnstseq}/tcnstseq2.nim (100%) rename tests/{run => cnstseq}/tcnstseq3.nim (100%) delete mode 100644 tests/compile/mvarious.nim delete mode 100644 tests/compile/sunset.tmpl delete mode 100644 tests/compile/tambsym2.nim delete mode 100644 tests/compile/tcmdline.nim delete mode 100644 tests/compile/tcolonisproc.nim delete mode 100644 tests/compile/tdllvar.nim delete mode 100644 tests/compile/temptyecho.nim delete mode 100644 tests/compile/tendian.nim delete mode 100644 tests/compile/tfib.nim delete mode 100644 tests/compile/tgetstartmilsecs.nim delete mode 100644 tests/compile/tgtk.nim delete mode 100644 tests/compile/thallo.nim delete mode 100644 tests/compile/theaproots.nim delete mode 100644 tests/compile/tlastmod.nim delete mode 100644 tests/compile/tlibs.nim delete mode 100644 tests/compile/tloops.nim delete mode 100644 tests/compile/tmandelbrot.nim delete mode 100644 tests/compile/tnew.nim delete mode 100644 tests/compile/tnewlibs.nim delete mode 100644 tests/compile/tnewsets.nim delete mode 100644 tests/compile/tnewuns.nim delete mode 100644 tests/compile/tnoforward.nim delete mode 100644 tests/compile/tparedef.nim delete mode 100644 tests/compile/tprep.nim delete mode 100644 tests/compile/tquicksort.nim delete mode 100644 tests/compile/tradix.nim delete mode 100644 tests/compile/treadln.nim delete mode 100644 tests/compile/treadx.nim delete mode 100644 tests/compile/tshadow_magic_type.nim delete mode 100644 tests/compile/tsizeof.nim delete mode 100644 tests/compile/tstrace.nim delete mode 100644 tests/compile/tstrdesc.nim delete mode 100644 tests/compile/tstrdist.nim delete mode 100644 tests/compile/tvarious.nim rename tests/{compile => compiles}/tcompiles.nim (100%) rename tests/{run => concat}/tconcat.nim (100%) rename tests/{run => concurrency}/tnodeadlocks.nim (100%) rename tests/{reject => constr}/tconstr1.nim (100%) rename tests/{run => constr}/tconstr2.nim (100%) rename tests/{reject => constraints}/tconstraints.nim (100%) rename tests/{run => controlflow}/tcontinue.nim (100%) rename tests/{reject => controlflow}/tstatret.nim (100%) rename tests/{compile => converter}/tconvcolors.nim (100%) rename tests/{compile => converter}/tconvert.nim (100%) rename tests/{run => converter}/tgenericconverter.nim (100%) rename tests/{compile => converter}/ttypeconverter1.nim (100%) rename tests/{compile => defaultprocparam}/mdefaultprocparam.nim (100%) rename tests/{compile => defaultprocparam}/tdefaultprocparam.nim (100%) rename tests/{reject => deprecated}/tdeprecated.nim (100%) rename tests/{run => destructor}/tdestructor.nim (100%) rename tests/{reject/tdestructor.nim => destructor/tdestructor2.nim} (100%) rename tests/{compile => destructor}/tdictdestruct.nim (100%) rename tests/{compile => discard}/tdiscardable.nim (100%) rename tests/{reject => discard}/tneedsdiscard.nim (100%) rename tests/{run => distinct}/tcurrncy.nim (100%) rename tests/{reject => effects}/teffects1.nim (100%) rename tests/{reject => effects}/teffects2.nim (100%) rename tests/{reject => effects}/teffects3.nim (100%) rename tests/{reject => effects}/teffects4.nim (100%) rename tests/{reject => effects}/teffects5.nim (100%) rename tests/{compile/teffects1.nim => effects/teffects6.nim} (100%) rename tests/{reject => effects}/tsidee1.nim (100%) rename tests/{run => effects}/tsidee2.nim (100%) rename tests/{run => effects}/tsidee3.nim (100%) rename tests/{reject => effects}/tsidee4.nim (100%) rename tests/{compile => enum}/tenum.nim (100%) rename tests/{compile => enum}/tenum2.nim (100%) rename tests/{compile => enum}/tenum3.nim (100%) rename tests/{run => enum}/tenumhole.nim (100%) rename tests/{reject => enum}/tenumitems.nim (100%) rename tests/{run/tenumitems.nim => enum/tenumitems2.nim} (100%) rename tests/{reject => enum}/tenummix.nim (100%) rename tests/{run => enum}/tnamedenumfields.nim (100%) rename tests/{compile => enum}/toptions.nim (100%) rename tests/{run => exception}/tcontinuexc.nim (100%) rename tests/{run => exception}/texceptions.nim (100%) rename tests/{run => exception}/texcpt1.nim (100%) rename tests/{run => exception}/texcsub.nim (100%) rename tests/{run => exception}/tfinally.nim (100%) rename tests/{run => exception}/tfinally2.nim (100%) rename tests/{run => exception}/tfinally3.nim (100%) rename tests/{run => exception}/tonraise.nim (100%) rename tests/{run => exception}/treraise.nim (100%) rename tests/{run => exception}/tunhandledexc.nim (100%) rename tests/{run => exception}/twrongexc.nim (100%) rename tests/{reject => exprs}/texprstmt.nim (100%) rename tests/{reject => exprs}/tstmtexp.nim (100%) rename tests/{run => exprs}/tstmtexprs.nim (100%) rename tests/{run => fields}/tfieldindex.nim (100%) rename tests/{run => fields}/tfielditerator.nim (100%) rename tests/{run => fields}/tfielditerator2.nim (100%) rename tests/{run => float}/tfloat1.nim (100%) rename tests/{run => float}/tfloat2.nim (100%) rename tests/{run => float}/tfloat3.nim (100%) rename tests/{run => friends}/mfriends.nim (100%) rename tests/{run => friends}/tfriends.nim (100%) rename tests/{run => generics}/tbintre2.nim (100%) rename tests/{run => generics}/tbintree.nim (100%) rename tests/{compile => generics}/tcan_alias_generic.nim (100%) rename tests/{compile => generics}/tcan_alias_specialised_generic.nim (100%) rename tests/{compile => generics}/tcan_inherit_generic.nim (100%) rename tests/{compile => generics}/tcan_specialise_generic.nim (100%) rename tests/{run => generics}/texplicitgeneric1.nim (100%) rename tests/{run => generics}/texplicitgeneric2.nim (100%) rename tests/{compile => generics}/tforwardgeneric.nim (100%) rename tests/{compile/tgeneric.nim => generics/tgeneric0.nim} (100%) rename tests/{run/tgenerics1.nim => generics/tgeneric1.nim} (100%) rename tests/{compile => generics}/tgeneric2.nim (100%) rename tests/{compile => generics}/tgeneric3.nim (100%) rename tests/{compile => generics}/tgeneric4.nim (100%) rename tests/{compile => generics}/tgenericdefaults.nim (100%) rename tests/{compile => generics}/tgenericmatcher.nim (100%) rename tests/{compile => generics}/tgenericmatcher2.nim (100%) rename tests/{run => generics}/tgenericprocvar.nim (100%) rename tests/{compile => generics}/tgenericprop.nim (100%) rename tests/{compile => generics}/tgenericrefs.nim (100%) rename tests/{compile => generics}/tgenericshardcases.nim (100%) rename tests/{compile => generics}/tgenerictmpl.nim (100%) rename tests/{compile => generics}/tgenericvariant.nim (100%) rename tests/{compile => generics}/tspecialised_is_equivalent.nim (100%) rename tests/{compile => generics}/tthread_generic.nim (100%) rename tests/{run => generics}/tvarargs_vs_generic.nim (100%) rename tests/{run => gensym}/tgensym.nim (100%) rename tests/{compile => gensym}/tgensymgeneric.nim (100%) rename tests/{run => global}/tglobal.nim (100%) rename tests/{compile => global}/tglobalforvar.nim (100%) rename tests/{run => ifstmt}/tnestif.nim (100%) rename tests/{compile => implicit}/timplicititems.nim (100%) rename tests/{compile => implicit}/timplictderef.nim (100%) rename tests/{run => important}/tdrdobbs_examples.nim (100%) rename tests/{reject => init}/tuninit1.nim (100%) rename tests/{run => init}/tzeroarray.nim (100%) rename tests/{run => iter}/tcountup.nim (100%) rename tests/{compile => iter}/titer.nim (100%) rename tests/{compile => iter}/titer2.nim (100%) rename tests/{run => iter}/titer3.nim (100%) rename tests/{reject => iter}/titer4.nim (100%) rename tests/{run => iter}/titer5.nim (100%) rename tests/{run => iter}/titer6.nim (100%) rename tests/{run => iter}/titer7.nim (100%) rename tests/{run => iter}/titer8.nim (100%) rename tests/{run => iter}/titer9.nim (100%) rename tests/{compile => iter}/titer_no_tuple_unpack.nim (100%) rename tests/{compile => iter}/titerovl.nim (100%) rename tests/{run => iter}/titerslice.nim (100%) rename tests/{run => iter}/titervaropenarray.nim (100%) rename tests/{run => iter}/tmoditer.nim (100%) rename tests/{reject => iter}/treciter.nim (100%) rename tests/{reject => iter}/twrongiter.nim (100%) rename tests/{reject => let}/tlet.nim (100%) rename tests/{reject => let}/tlet2.nim (100%) rename tests/{run => lexer}/thexlit.nim (100%) rename tests/{compile => lexer}/thexrange.nim (100%) rename tests/{compile => lexer}/tident.nim (100%) rename tests/{reject => lexer}/tind1.nim (100%) rename tests/{run => lexer}/tindent1.nim (100%) rename tests/{compile => lexer}/tlexer.nim (100%) rename tests/{reject => lexer}/tmissingnl.nim (100%) rename tests/{run => lexer}/tstrlits.nim (100%) rename tests/{reject => lexer}/tunderscores.nim (100%) rename tests/{compile => lookup}/tredef.nim (100%) rename tests/{run => lookups}/tkoeniglookup.nim (100%) rename tests/{compile => macro}/tmacro1.nim (100%) rename tests/{run => macro}/tmacro2.nim (100%) rename tests/{run => macro}/tmacro3.nim (100%) rename tests/{run => macro}/tmacro4.nim (100%) rename tests/{compile/tmacro2.nim => macro/tmacro5.nim} (100%) rename tests/{compile => macro}/tmacroaspragma.nim (100%) rename tests/{run => macro}/tmacrogenerics.nim (100%) rename tests/{run => macro}/tmacros1.nim (100%) rename tests/{compile => macro}/tmacrostmt.nim (100%) rename tests/{compile => macro}/tmacrotypes.nim (100%) rename tests/{compile => macro}/tnimrodnode_for_runtime.nim (100%) rename tests/{run => macro}/tprintf.nim (100%) rename tests/{run => macro}/tquotewords.nim (100%) rename tests/{reject => macro}/trecmacro.nim (100%) rename tests/{run => macro}/tstringinterp.nim (100%) rename tests/{run => macro}/tvtable.nim (100%) rename tests/{compile => macros}/tdumpast.nim (100%) rename tests/{compile => macros}/tdumpast2.nim (100%) rename tests/{run => macros}/tdumptree.nim (100%) rename tests/{run => macros}/tidgen.nim (100%) rename tests/{run => magics}/tlowhigh.nim (100%) rename tests/{run => matrix}/tmatrix.nim (100%) rename tests/{compile => matrix}/tmatrix1.nim (100%) rename tests/{compile => matrix}/tmatrix2.nim (100%) rename tests/{compile => metatype}/tbindtypedesc.nim (100%) rename tests/{compile => metatype}/tcompositetypeclasses.nim (100%) rename tests/{compile => metatype}/tconstraints.nim (100%) rename tests/{run => metatype}/tsemistatic.nim (100%) create mode 100644 tests/metatype/ttypebar.nim rename tests/{compile => metatype}/ttypeclasses.nim (100%) rename tests/{run => metatype}/ttypedesc1.nim (100%) rename tests/{compile => metatype}/ttypeselectors.nim (100%) rename tests/{run => metatype}/ttypetraits.nim (100%) rename tests/{run => metatype}/tusertypeclasses.nim (100%) rename tests/{run => metatype}/utypeclasses.nim (100%) rename tests/{run => method}/mmultim3.nim (100%) rename tests/{reject => method}/tmethod.nim (100%) rename tests/{run => method}/tmethods1.nim (100%) rename tests/{run => method}/tmultim1.nim (100%) rename tests/{run => method}/tmultim2.nim (100%) rename tests/{run => method}/tmultim3.nim (100%) rename tests/{run => method}/tmultim4.nim (100%) rename tests/{run => method}/tmultim6.nim (100%) rename tests/{run => method}/tsimmeth.nim (100%) rename tests/{reject => module}/mopaque.nim (100%) rename tests/{compile => module}/mrecmod.nim (100%) rename tests/{compile => module}/mrecmod2.nim (100%) rename tests/{reject => module}/topaque.nim (100%) rename tests/{reject => module}/trecinca.nim (100%) rename tests/{reject => module}/trecincb.nim (100%) rename tests/{compile => module}/trecmod.nim (100%) rename tests/{compile => module}/trecmod2.nim (100%) rename tests/{compile => modules}/mexporta.nim (100%) rename tests/{compile => modules}/mexportb.nim (100%) rename tests/{compile => modules}/texport.nim (100%) rename tests/{reject => modules}/timportexcept.nim (100%) rename tests/{reject => namedparams}/tnamedparams.nim (100%) rename tests/{compile/tnamedparams.nim => namedparams/tnamedparams2.nim} (100%) rename tests/{reject => namspc}/mnamspc1.nim (100%) rename tests/{reject => namspc}/mnamspc2.nim (100%) rename tests/{reject => namspc}/tnamspc.nim (100%) rename tests/{reject => notnil}/tnotnil.nim (100%) rename tests/{reject => notnil}/tnotnil1.nim (100%) rename tests/{reject => notnil}/tnotnil2.nim (100%) rename tests/{run => object}/tobjconstr.nim (100%) rename tests/{compile => object}/tobjconstr2.nim (100%) rename tests/{compile => object}/tobjcov.nim (100%) rename tests/{run => object}/tobject.nim (100%) rename tests/{compile => object}/tobject2.nim (100%) rename tests/{compile => object}/tobject3.nim (100%) rename tests/{compile => object}/toop.nim (100%) rename tests/{run => object}/toop1.nim (100%) rename tests/{compile => objects}/tobjects.nim (100%) rename tests/{reject => objvariant}/tadrdisc.nim (100%) rename tests/{reject => objvariant}/tcheckedfield1.nim (100%) rename tests/{reject => objvariant}/temptycaseobj.nim (100%) rename tests/{run => objvariant}/tvariantstack.nim (100%) rename tests/{reject => openarray}/topena1.nim (100%) rename tests/{run => openarray}/topenarrayrepr.nim (100%) rename tests/{run => openarray}/topenlen.nim (100%) rename tests/{run => operator}/tofopr.nim (100%) rename tests/{run => operator}/toprprec.nim (100%) rename tests/{run => operator}/tprecedence.nim (100%) rename tests/{run => overflw}/toverflw.nim (100%) rename tests/{run => overflw}/toverflw2.nim (100%) rename tests/{run => overflw}/tovfint.nim (100%) rename tests/{reject => overload}/toverl.nim (100%) rename tests/{run => overload}/toverl2.nim (100%) rename tests/{run => overload}/toverl3.nim (100%) rename tests/{compile => overload}/toverprc.nim (100%) rename tests/{run => overload}/toverwr.nim (100%) rename tests/{run => pattern}/tpatterns.nim (100%) rename tests/{compile => pragma}/tuserpragma.nim (100%) rename tests/{compile => pragmas}/tpush.nim (100%) rename tests/{run => proc}/tnestprc.nim (100%) rename tests/{reject => proc}/tprocredef.nim (100%) rename tests/{compile => procvar}/tgenericprocvar.nim (100%) rename tests/{reject => procvar}/tprocvar.nim (100%) rename tests/{run/tprocvar.nim => procvar/tprocvar2.nim} (100%) rename tests/{compile => procvar}/tprocvars.nim (100%) rename tests/{compile => range}/compilehelpers.nim (100%) rename tests/{run => range}/tbug499771.nim (100%) rename tests/{compile => range}/tcolors.nim (100%) rename tests/{compile => range}/tmatrix3.nim (100%) rename tests/{reject => range}/tsubrange.nim (100%) rename tests/{run => range}/tsubrange2.nim (100%) rename tests/{run/tsubrange.nim => range/tsubrange3.nim} (100%) delete mode 100644 tests/reject/99bottles.nim delete mode 100644 tests/reject/t99bott.nim delete mode 100644 tests/reject/tatomic.nim delete mode 100644 tests/reject/tgenconstraints.nim delete mode 100644 tests/reject/tinc.nim delete mode 100644 tests/reject/tinout.nim delete mode 100644 tests/reject/tinvalidarrayaccess.nim delete mode 100644 tests/reject/tinvalidnewseq.nim delete mode 100644 tests/reject/tinvwhen.nim delete mode 100644 tests/reject/tnoinst.nim delete mode 100644 tests/reject/tnolen.nim delete mode 100644 tests/reject/tnoop.nim delete mode 100644 tests/reject/tnot.nim delete mode 100644 tests/reject/trawstr.nim delete mode 100644 tests/reject/tsimtych.nim delete mode 100644 tests/run/globalaux.nim delete mode 100644 tests/run/globalaux2.nim delete mode 100644 tests/run/minit.nim delete mode 100644 tests/run/tack.nim delete mode 100644 tests/run/tbug511622.nim delete mode 100644 tests/run/tdomulttest.nim delete mode 100644 tests/run/temit.nim delete mode 100644 tests/run/teventemitter.nim delete mode 100644 tests/run/tevents.nim delete mode 100644 tests/run/tfilter.nim delete mode 100644 tests/run/thintoff.nim delete mode 100644 tests/run/tinit.nim delete mode 100644 tests/run/tints.nim delete mode 100644 tests/run/tlocals.nim delete mode 100644 tests/run/tmemoization.nim delete mode 100644 tests/run/tnewderef.nim delete mode 100644 tests/run/tpos.nim delete mode 100644 tests/run/tromans.nim delete mode 100644 tests/run/tsimplesort.nim delete mode 100644 tests/run/tslices.nim delete mode 100644 tests/run/tsortdev.nim delete mode 100644 tests/run/tstrange.nim delete mode 100644 tests/run/tvarious1.nim delete mode 100644 tests/run/tvarnums.nim rename tests/{compile => seq}/tseq2.nim (100%) rename tests/{run => seq}/tseqcon.nim (100%) rename tests/{compile => seq}/tseqcon2.nim (100%) rename tests/{run => seq}/tseqtuple.nim (100%) rename tests/{run => seq}/tsequtils.nim (100%) rename tests/{run => seq}/ttoseq.nim (100%) rename tests/{run => sets}/tsets.nim (100%) rename tests/{run => sets}/tsets2.nim (100%) rename tests/{run => static}/tstaticparams.nim (100%) rename tests/{compile => stdlib}/tcputime.nim (100%) rename tests/{run => stdlib}/tcritbits.nim (100%) rename tests/{compile => stdlib}/tdialogs.nim (100%) rename tests/{compile => stdlib}/techo.nim (100%) rename tests/{run => stdlib}/tformat.nim (100%) rename tests/{run => stdlib}/thashes.nim (100%) rename tests/{compile => stdlib}/tio.nim (100%) rename tests/{compile => stdlib}/tircbot.nim (100%) rename tests/{run => stdlib}/tlists.nim (100%) rename tests/{compile => stdlib}/tmarshal.nim (100%) rename tests/{run => stdlib}/tmath.nim (100%) rename tests/{compile/tmath.nim => stdlib/tmath2.nim} (100%) rename tests/{compile => stdlib}/tmongo.nim (100%) rename tests/{compile => stdlib}/tos.nim (100%) rename tests/{compile => stdlib}/tparscfg.nim (100%) rename tests/{compile => stdlib}/tparsefloat.nim (100%) rename tests/{compile => stdlib}/tparsopt.nim (100%) rename tests/{run => stdlib}/tpegs.nim (100%) rename tests/{compile => stdlib}/tposix.nim (100%) rename tests/{compile => stdlib}/tquit.nim (100%) rename tests/{run => stdlib}/tregex.nim (100%) rename tests/{run => stdlib}/treguse.nim (100%) rename tests/{run => stdlib}/trepr.nim (100%) rename tests/{compile/trepr.nim => stdlib/trepr2.nim} (100%) rename tests/{compile => stdlib}/tsockets.nim (100%) rename tests/{compile => stdlib}/tsortcall.nim (100%) rename tests/{run => stdlib}/tsplit.nim (100%) rename tests/{compile => stdlib}/tstreams.nim (100%) rename tests/{compile => stdlib}/tstrset.nim (100%) rename tests/{compile => stdlib}/tstrtabs.nim (100%) rename tests/{run => stdlib}/tstrutil.nim (100%) rename tests/{compile => stdlib}/ttime.nim (100%) rename tests/{run => stdlib}/tunidecode.nim (100%) rename tests/{compile => stdlib}/twalker.nim (100%) rename tests/{run => stdlib}/txmlgen.nim (100%) rename tests/{run => stdlib}/txmltree.nim (100%) rename tests/{compile => table}/ttableconstr.nim (100%) rename tests/{run => table}/ttables.nim (100%) rename tests/{run => table}/ttables2.nim (100%) rename tests/{templates => template}/mcan_access_hidden_field.nim (100%) rename tests/{compile => template}/mtempl5.nim (100%) rename tests/{templates => template}/tcan_access_hidden_field.nim (100%) rename tests/{compile => template}/thygienictempl.nim (100%) rename tests/{compile => template}/tmodulealias.nim (100%) rename tests/{run => template}/tstempl.nim (100%) rename tests/{compile => template}/ttempl.nim (100%) rename tests/{reject => template}/ttempl2.nim (100%) rename tests/{compile => template}/ttempl3.nim (100%) rename tests/{compile => template}/ttempl4.nim (100%) rename tests/{compile => template}/ttempl5.nim (100%) rename tests/{compile => template}/ttemplreturntype.nim (100%) rename tests/{run => template}/utemplates.nim (100%) create mode 100644 tests/testament/backend.nim create mode 100644 tests/testament/categories.nim create mode 100644 tests/testament/specs.nim create mode 100644 tests/testament/tester.nim rename tests/{reject => trmacros}/tdisallowif.nim (100%) rename tests/{run => tuples}/tanontuples.nim (100%) rename tests/{reject => tuples}/twrongtupleaccess.nim (100%) rename tests/{compile => typerel}/tcommontype.nim (100%) rename tests/{reject => typerel}/tno_int_in_bool_context.nim (100%) rename tests/{compile => typerel}/tnoargopenarray.nim (100%) rename tests/{reject => typerel}/tnocontains.nim (100%) rename tests/{compile => typerel}/trectuple.nim (100%) rename tests/{compile => typerel}/trectuples.nim (100%) rename tests/{reject => typerel}/trectype.nim (100%) rename tests/{reject => typerel}/trefs.nim (100%) rename tests/{run => typerel}/trettypeinference.nim (100%) rename tests/{compile => typerel}/tsecondarrayproperty.nim (100%) rename tests/{compile => typerel}/ttuple1.nim (100%) rename tests/{reject => typerel}/ttypelessemptyset.nim (100%) rename tests/{reject => typerel}/ttypenoval.nim (100%) rename tests/{reject => typerel}/ttypenovalue.nim (100%) rename tests/{compile => typerel}/tvoid.nim (100%) rename tests/{compile => typerel}/typalias.nim (100%) rename tests/{reject => typerel}/typredef.nim (100%) rename tests/{run => types}/tfinalobj.nim (100%) rename tests/{compile => types}/tforwty.nim (100%) rename tests/{compile => types}/tforwty2.nim (100%) rename tests/{reject => types}/tillegaltyperecursion.nim (100%) rename tests/{reject => types}/tillrec.nim (100%) rename tests/{compile => types}/tinheritref.nim (100%) rename tests/{compile => types}/tisop.nim (100%) rename tests/{run => types}/tisopr.nim (100%) rename tests/{run => usingstmt}/tusingstatement.nim (100%) rename tests/{reject => varres}/tvarres1.nim (100%) rename tests/{reject => varres}/tvarres2.nim (100%) rename tests/{run/tvarres1.nim => varres/tvarres3.nim} (100%) rename tests/{run/tvarres2.nim => varres/tvarres4.nim} (100%) rename tests/{run => varres}/tvartup.nim (100%) rename tests/{run => varstmt}/tlet.nim (100%) rename tests/{run => varstmt}/tvardecl.nim (100%) rename tests/{compile => vm}/tconsteval.nim (100%) rename tests/{compile => vm}/teval1.nim (100%) rename tests/{compile => vm}/tslurp.nim (100%) rename tests/{reject => vm}/twrongconst.nim (100%) diff --git a/koch.nim b/koch.nim index 1b5c96b234..22e30ac5e2 100644 --- a/koch.nim +++ b/koch.nim @@ -1,7 +1,7 @@ # # # Maintenance program for Nimrod -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -26,7 +26,7 @@ const +-----------------------------------------------------------------+ | Maintenance program for Nimrod | | Version $1| -| (c) 2013 Andreas Rumpf | +| (c) 2014 Andreas Rumpf | +-----------------------------------------------------------------+ Build time: $2, $3 @@ -268,6 +268,11 @@ proc tests(args: string) = exec(getCurrentDir() / "tests/tester".exe & " compile") exec(getCurrentDir() / "tests/tester".exe & " run") exec(getCurrentDir() / "tests/tester".exe & " merge") + when false: + # activate real soon: + exec("nimrod cc --taintMode:on tests/testament/tester") + exec(getCurrentDir() / "tests/testament/tester".exe & " all") + proc temp(args: string) = var output = "compiler" / "nimrod".exe diff --git a/tests/run/tactiontable.nim b/tests/actiontable/tactiontable.nim similarity index 100% rename from tests/run/tactiontable.nim rename to tests/actiontable/tactiontable.nim diff --git a/tests/reject/tactiontable2.nim b/tests/actiontable/tactiontable2.nim similarity index 100% rename from tests/reject/tactiontable2.nim rename to tests/actiontable/tactiontable2.nim diff --git a/tests/compile/talias.nim b/tests/alias/talias.nim similarity index 100% rename from tests/compile/talias.nim rename to tests/alias/talias.nim diff --git a/tests/reject/mambsym1.nim b/tests/ambsym/mambsym1.nim similarity index 100% rename from tests/reject/mambsym1.nim rename to tests/ambsym/mambsym1.nim diff --git a/tests/reject/mambsym2.nim b/tests/ambsym/mambsym2.nim similarity index 100% rename from tests/reject/mambsym2.nim rename to tests/ambsym/mambsym2.nim diff --git a/tests/run/mambsys1.nim b/tests/ambsym/mambsys1.nim similarity index 100% rename from tests/run/mambsys1.nim rename to tests/ambsym/mambsys1.nim diff --git a/tests/run/mambsys2.nim b/tests/ambsym/mambsys2.nim similarity index 100% rename from tests/run/mambsys2.nim rename to tests/ambsym/mambsys2.nim diff --git a/tests/reject/tambsym.nim b/tests/ambsym/tambsym.nim similarity index 100% rename from tests/reject/tambsym.nim rename to tests/ambsym/tambsym.nim diff --git a/tests/run/tambsym2.nim b/tests/ambsym/tambsym2.nim similarity index 100% rename from tests/run/tambsym2.nim rename to tests/ambsym/tambsym2.nim diff --git a/tests/reject/tambsym3.nim b/tests/ambsym/tambsym3.nim similarity index 100% rename from tests/reject/tambsym3.nim rename to tests/ambsym/tambsym3.nim diff --git a/tests/run/tambsys.nim b/tests/ambsym/tambsys.nim similarity index 100% rename from tests/run/tambsys.nim rename to tests/ambsym/tambsys.nim diff --git a/tests/run/tarray.nim b/tests/array/tarray.nim similarity index 100% rename from tests/run/tarray.nim rename to tests/array/tarray.nim diff --git a/tests/run/tarray2.nim b/tests/array/tarray2.nim similarity index 100% rename from tests/run/tarray2.nim rename to tests/array/tarray2.nim diff --git a/tests/run/tarray3.nim b/tests/array/tarray3.nim similarity index 100% rename from tests/run/tarray3.nim rename to tests/array/tarray3.nim diff --git a/tests/reject/tarraycons.nim b/tests/array/tarraycons.nim similarity index 100% rename from tests/reject/tarraycons.nim rename to tests/array/tarraycons.nim diff --git a/tests/run/tarraycons.nim b/tests/array/tarraycons2.nim similarity index 100% rename from tests/run/tarraycons.nim rename to tests/array/tarraycons2.nim diff --git a/tests/reject/tarrayplus.nim b/tests/array/tarrayplus.nim similarity index 100% rename from tests/reject/tarrayplus.nim rename to tests/array/tarrayplus.nim diff --git a/tests/compile/tarrindx.nim b/tests/array/tarrindx.nim similarity index 100% rename from tests/compile/tarrindx.nim rename to tests/array/tarrindx.nim diff --git a/tests/run/tassert.nim b/tests/assert/tassert.nim similarity index 100% rename from tests/run/tassert.nim rename to tests/assert/tassert.nim diff --git a/tests/run/tfailedassert.nim b/tests/assert/tfailedassert.nim similarity index 100% rename from tests/run/tfailedassert.nim rename to tests/assert/tfailedassert.nim diff --git a/tests/run/tunittests.nim b/tests/assert/tunittests.nim similarity index 100% rename from tests/run/tunittests.nim rename to tests/assert/tunittests.nim diff --git a/tests/run/tuserassert.nim b/tests/assert/tuserassert.nim similarity index 100% rename from tests/run/tuserassert.nim rename to tests/assert/tuserassert.nim diff --git a/tests/compile/tassign.nim b/tests/assign/tassign.nim similarity index 100% rename from tests/compile/tassign.nim rename to tests/assign/tassign.nim diff --git a/tests/run/tcopy.nim b/tests/assign/tcopy.nim similarity index 100% rename from tests/run/tcopy.nim rename to tests/assign/tcopy.nim diff --git a/tests/run/tgenericassign.nim b/tests/assign/tgenericassign.nim similarity index 100% rename from tests/run/tgenericassign.nim rename to tests/assign/tgenericassign.nim diff --git a/tests/run/tgenericassigntuples.nim b/tests/assign/tgenericassigntuples.nim similarity index 100% rename from tests/run/tgenericassigntuples.nim rename to tests/assign/tgenericassigntuples.nim diff --git a/tests/run/tobjasgn.nim b/tests/assign/tobjasgn.nim similarity index 100% rename from tests/run/tobjasgn.nim rename to tests/assign/tobjasgn.nim diff --git a/tests/run/tvariantasgn.nim b/tests/assign/tvariantasgn.nim similarity index 100% rename from tests/run/tvariantasgn.nim rename to tests/assign/tvariantasgn.nim diff --git a/tests/run/tastoverload1.nim b/tests/astoverload/tastoverload1.nim similarity index 100% rename from tests/run/tastoverload1.nim rename to tests/astoverload/tastoverload1.nim diff --git a/tests/run/tasynciossl.nim b/tests/async/tasynciossl.nim similarity index 100% rename from tests/run/tasynciossl.nim rename to tests/async/tasynciossl.nim diff --git a/tests/run/tasyncudp.nim b/tests/async/tasyncudp.nim similarity index 100% rename from tests/run/tasyncudp.nim rename to tests/async/tasyncudp.nim diff --git a/tests/run/mbind3.nim b/tests/bind/mbind3.nim similarity index 100% rename from tests/run/mbind3.nim rename to tests/bind/mbind3.nim diff --git a/tests/run/tbind1.nim b/tests/bind/tbind1.nim similarity index 100% rename from tests/run/tbind1.nim rename to tests/bind/tbind1.nim diff --git a/tests/reject/tbind2.nim b/tests/bind/tbind2.nim similarity index 100% rename from tests/reject/tbind2.nim rename to tests/bind/tbind2.nim diff --git a/tests/run/tbind3.nim b/tests/bind/tbind3.nim similarity index 100% rename from tests/run/tbind3.nim rename to tests/bind/tbind3.nim diff --git a/tests/compile/tbindoverload.nim b/tests/bind/tbindoverload.nim similarity index 100% rename from tests/compile/tbindoverload.nim rename to tests/bind/tbindoverload.nim diff --git a/tests/reject/tbindtypedesc.nim b/tests/bind/tbindtypedesc.nim similarity index 100% rename from tests/reject/tbindtypedesc.nim rename to tests/bind/tbindtypedesc.nim diff --git a/tests/compile/tdatabind.nim b/tests/bind/tdatabind.nim similarity index 100% rename from tests/compile/tdatabind.nim rename to tests/bind/tdatabind.nim diff --git a/tests/run/tmixin.nim b/tests/bind/tmixin.nim similarity index 100% rename from tests/run/tmixin.nim rename to tests/bind/tmixin.nim diff --git a/tests/reject/tnicerrorforsymchoice.nim b/tests/bind/tnicerrorforsymchoice.nim similarity index 100% rename from tests/reject/tnicerrorforsymchoice.nim rename to tests/bind/tnicerrorforsymchoice.nim diff --git a/tests/reject/tblock1.nim b/tests/block/tblock1.nim similarity index 100% rename from tests/reject/tblock1.nim rename to tests/block/tblock1.nim diff --git a/tests/run/tborrow.nim b/tests/borrow/tborrow.nim similarity index 100% rename from tests/run/tborrow.nim rename to tests/borrow/tborrow.nim diff --git a/tests/reject/tinvalidborrow.nim b/tests/borrow/tinvalidborrow.nim similarity index 100% rename from tests/reject/tinvalidborrow.nim rename to tests/borrow/tinvalidborrow.nim diff --git a/tests/run/tcase_setconstr.nim b/tests/casestmt/tcase_setconstr.nim similarity index 100% rename from tests/run/tcase_setconstr.nim rename to tests/casestmt/tcase_setconstr.nim diff --git a/tests/reject/tcaseexpr1.nim b/tests/casestmt/tcaseexpr1.nim similarity index 100% rename from tests/reject/tcaseexpr1.nim rename to tests/casestmt/tcaseexpr1.nim diff --git a/tests/reject/tcaseoverlaprange.nim b/tests/casestmt/tcaseoverlaprange.nim similarity index 100% rename from tests/reject/tcaseoverlaprange.nim rename to tests/casestmt/tcaseoverlaprange.nim diff --git a/tests/reject/tcaseoverlaprange2.nim b/tests/casestmt/tcaseoverlaprange2.nim similarity index 100% rename from tests/reject/tcaseoverlaprange2.nim rename to tests/casestmt/tcaseoverlaprange2.nim diff --git a/tests/run/tcasestm.nim b/tests/casestmt/tcasestm.nim similarity index 100% rename from tests/run/tcasestm.nim rename to tests/casestmt/tcasestm.nim diff --git a/tests/compile/tcomputedgoto.nim b/tests/casestmt/tcomputedgoto.nim similarity index 100% rename from tests/compile/tcomputedgoto.nim rename to tests/casestmt/tcomputedgoto.nim diff --git a/tests/compile/tlinearscanend.nim b/tests/casestmt/tlinearscanend.nim similarity index 100% rename from tests/compile/tlinearscanend.nim rename to tests/casestmt/tlinearscanend.nim diff --git a/tests/compile/tccgen1.nim b/tests/ccgbugs/tccgen1.nim similarity index 100% rename from tests/compile/tccgen1.nim rename to tests/ccgbugs/tccgen1.nim diff --git a/tests/run/tcgbug.nim b/tests/ccgbugs/tcgbug.nim similarity index 100% rename from tests/run/tcgbug.nim rename to tests/ccgbugs/tcgbug.nim diff --git a/tests/compile/tcodegenbug1.nim b/tests/ccgbugs/tcodegenbug1.nim similarity index 100% rename from tests/compile/tcodegenbug1.nim rename to tests/ccgbugs/tcodegenbug1.nim diff --git a/tests/run/tclosure.nim b/tests/closure/tclosure.nim similarity index 100% rename from tests/run/tclosure.nim rename to tests/closure/tclosure.nim diff --git a/tests/run/tclosure2.nim b/tests/closure/tclosure2.nim similarity index 100% rename from tests/run/tclosure2.nim rename to tests/closure/tclosure2.nim diff --git a/tests/run/tclosure3.nim b/tests/closure/tclosure3.nim similarity index 100% rename from tests/run/tclosure3.nim rename to tests/closure/tclosure3.nim diff --git a/tests/compile/tclosure4.nim b/tests/closure/tclosure4.nim similarity index 100% rename from tests/compile/tclosure4.nim rename to tests/closure/tclosure4.nim diff --git a/tests/compile/tclosurebug2.nim b/tests/closure/tclosurebug2.nim similarity index 100% rename from tests/compile/tclosurebug2.nim rename to tests/closure/tclosurebug2.nim diff --git a/tests/run/tinterf.nim b/tests/closure/tinterf.nim similarity index 100% rename from tests/run/tinterf.nim rename to tests/closure/tinterf.nim diff --git a/tests/reject/tinvalidclosure.nim b/tests/closure/tinvalidclosure.nim similarity index 100% rename from tests/reject/tinvalidclosure.nim rename to tests/closure/tinvalidclosure.nim diff --git a/tests/reject/tinvalidclosure2.nim b/tests/closure/tinvalidclosure2.nim similarity index 100% rename from tests/reject/tinvalidclosure2.nim rename to tests/closure/tinvalidclosure2.nim diff --git a/tests/compile/tnamedparamanonproc.nim b/tests/closure/tnamedparamanonproc.nim similarity index 100% rename from tests/compile/tnamedparamanonproc.nim rename to tests/closure/tnamedparamanonproc.nim diff --git a/tests/compile/tnestedproc.nim b/tests/closure/tnestedproc.nim similarity index 100% rename from tests/compile/tnestedproc.nim rename to tests/closure/tnestedproc.nim diff --git a/tests/run/uclosures.nim b/tests/closure/uclosures.nim similarity index 100% rename from tests/run/uclosures.nim rename to tests/closure/uclosures.nim diff --git a/tests/run/tcnstseq.nim b/tests/cnstseq/tcnstseq.nim similarity index 100% rename from tests/run/tcnstseq.nim rename to tests/cnstseq/tcnstseq.nim diff --git a/tests/run/tcnstseq2.nim b/tests/cnstseq/tcnstseq2.nim similarity index 100% rename from tests/run/tcnstseq2.nim rename to tests/cnstseq/tcnstseq2.nim diff --git a/tests/run/tcnstseq3.nim b/tests/cnstseq/tcnstseq3.nim similarity index 100% rename from tests/run/tcnstseq3.nim rename to tests/cnstseq/tcnstseq3.nim diff --git a/tests/compile/mvarious.nim b/tests/compile/mvarious.nim deleted file mode 100644 index 333b34d338..0000000000 --- a/tests/compile/mvarious.nim +++ /dev/null @@ -1,6 +0,0 @@ -# Test a submodule - -#type -# TStringArr = array [0.. *] of string - -proc exportme* = nil diff --git a/tests/compile/sunset.tmpl b/tests/compile/sunset.tmpl deleted file mode 100644 index 6475bac4ec..0000000000 --- a/tests/compile/sunset.tmpl +++ /dev/null @@ -1,68 +0,0 @@ -#! stdtmpl -#proc sunsetTemplate*(current, ticker, content: string, -# tabs: openarray[array[0..1, string]]): string = -# result = "" -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> - -<head> - <title>Nimrod Programming System</title> - <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> - <link rel="stylesheet" type="text/css" href="style/style.css" /> -</head> - -<body> - <div id="main"> - <div id="links"> - <!-- **** INSERT LINKS HERE **** --> - </div> - <div id="logo"><h1>Nimrod Programming System</h1></div> - <div id="content"> - <div id="menu"> - <ul> - #for item in items(tabs): - #var name = item[0] - #var t = item[1] - #if t == current: - <li><a id="selected" href="${t}.html" title = "Nimrod - $name">$name</a></li> - #else: - <li><a href="${t}.html" title = "Nimrod - $name">$name</a></li> - #end if - #end for - </ul> - </div> - <div id="column1"> - <div class="sidebaritem"> - <div class="sbihead"> - <h1>latest news</h1> - </div> - <div class="sbicontent"> - $ticker - </div> - </div> - <div class="sidebaritem"> - <div class="sbihead"> - <h1>additional links</h1> - </div> - <div class="sbilinks"> - <!-- **** INSERT ADDITIONAL LINKS HERE **** --> - <ul> - <li><a class="reference" href="http://llvm.org">LLVM</a></li> - <li><a class="reference" href="http://gcc.gnu.org">GCC</a></li> - </ul> - </div> - </div> - </div> - <div id="column2"> - $content - </div> - </div> - <div id="footer"> - copyright &copy; 2008 Andreas Rumpf | Last update: ${getDateStr()} - | <a class="reference" href="http://validator.w3.org/check?uri=referer">XHTML 1.1</a> - | <a class="reference" href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> - | <a class="reference" href="http://www.dcarter.co.uk">design by dcarter</a> - </div> - </div> -</body> -</html> diff --git a/tests/compile/tambsym2.nim b/tests/compile/tambsym2.nim deleted file mode 100644 index 7758cc31a6..0000000000 --- a/tests/compile/tambsym2.nim +++ /dev/null @@ -1,6 +0,0 @@ - -from sdl import PSurface - -discard SDL.CreateRGBSurface(SDL.SWSURFACE, 23, 34, - 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xff000000'i32) - diff --git a/tests/compile/tcmdline.nim b/tests/compile/tcmdline.nim deleted file mode 100644 index f4ee20d311..0000000000 --- a/tests/compile/tcmdline.nim +++ /dev/null @@ -1,14 +0,0 @@ -# Test the command line - -import - os, strutils - -var - i: int - params = paramCount() -i = 0 -writeln(stdout, "This exe: " & getAppFilename()) -writeln(stdout, "Number of parameters: " & $params) -while i <= params: - writeln(stdout, paramStr(i)) - i = i + 1 diff --git a/tests/compile/tcolonisproc.nim b/tests/compile/tcolonisproc.nim deleted file mode 100644 index e55587dfcb..0000000000 --- a/tests/compile/tcolonisproc.nim +++ /dev/null @@ -1,12 +0,0 @@ - -proc p(a, b: int, c: proc ()) = - c() - - -p(1, 3): - echo 1 - echo 3 - -p(1, 1, proc() = - echo 1 - echo 2) diff --git a/tests/compile/tdllvar.nim b/tests/compile/tdllvar.nim deleted file mode 100644 index ab767770c0..0000000000 --- a/tests/compile/tdllvar.nim +++ /dev/null @@ -1,16 +0,0 @@ -import os - -proc getDllName: string = - result = "mylib.dll" - if ExistsFile(result): return - result = "mylib2.dll" - if ExistsFile(result): return - quit("could not load dynamic library") - -proc myImport(s: cstring) {.cdecl, importc, dynlib: getDllName().} -proc myImport2(s: int) {.cdecl, importc, dynlib: getDllName().} - -myImport("test2") -myImport2(12) - - diff --git a/tests/compile/temptyecho.nim b/tests/compile/temptyecho.nim deleted file mode 100644 index 5f1aa65152..0000000000 --- a/tests/compile/temptyecho.nim +++ /dev/null @@ -1,2 +0,0 @@ -echo() - diff --git a/tests/compile/tendian.nim b/tests/compile/tendian.nim deleted file mode 100644 index 256e2653c4..0000000000 --- a/tests/compile/tendian.nim +++ /dev/null @@ -1,3 +0,0 @@ -# test the new endian magic - -writeln(stdout, repr(system.cpuEndian)) diff --git a/tests/compile/tfib.nim b/tests/compile/tfib.nim deleted file mode 100644 index 09a4d5038e..0000000000 --- a/tests/compile/tfib.nim +++ /dev/null @@ -1,11 +0,0 @@ - -iterator fibonacci(): int = - var a = 0 - var b = 1 - while true: - yield a - var c = b - b = a - a = a + c - - diff --git a/tests/compile/tgetstartmilsecs.nim b/tests/compile/tgetstartmilsecs.nim deleted file mode 100644 index 5a3368e0f1..0000000000 --- a/tests/compile/tgetstartmilsecs.nim +++ /dev/null @@ -1,7 +0,0 @@ -# -import times, os - -var start = epochTime() -os.sleep(1000) - -echo epochTime() - start #OUT 1000 diff --git a/tests/compile/tgtk.nim b/tests/compile/tgtk.nim deleted file mode 100644 index 7febb0ab84..0000000000 --- a/tests/compile/tgtk.nim +++ /dev/null @@ -1,51 +0,0 @@ - -import - gtk2, glib2, atk, gdk2, gdk2pixbuf, libglade2, pango, - pangoutils - -proc hello(widget: PWidget, data: pointer) {.cdecl.} = - write(stdout, "Hello World\n") - -proc delete_event(widget: PWidget, event: PEvent, - data: pointer): bool {.cdecl.} = - # If you return FALSE in the "delete_event" signal handler, - # GTK will emit the "destroy" signal. Returning TRUE means - # you don't want the window to be destroyed. - # This is useful for popping up 'are you sure you want to quit?' - # type dialogs. - write(stdout, "delete event occurred\n") - # Change TRUE to FALSE and the main window will be destroyed with - # a "delete_event". - return false - -# Another callback -proc mydestroy(widget: PWidget, data: pointer) {.cdecl.} = - gtk2.main_quit() - -proc mymain() = - # GtkWidget is the storage type for widgets - gtk2.nimrod_init() - var window = window_new(gtk2.WINDOW_TOPLEVEL) - discard g_signal_connect(window, "delete_event", - Gcallback(delete_event), nil) - discard g_signal_connect(window, "destroy", Gcallback(mydestroy), nil) - # Sets the border width of the window. - set_border_width(window, 10) - - # Creates a new button with the label "Hello World". - var button = button_new("Hello World") - - discard g_signal_connect(button, "clicked", Gcallback(hello), nil) - - # This packs the button into the window (a gtk container). - add(window, button) - - # The final step is to display this newly created widget. - show(button) - - # and the window - show(window) - - gtk2.main() - -mymain() diff --git a/tests/compile/thallo.nim b/tests/compile/thallo.nim deleted file mode 100644 index 7244c27a14..0000000000 --- a/tests/compile/thallo.nim +++ /dev/null @@ -1,85 +0,0 @@ -# Hallo - -import - os, strutils, macros - -type - TMyEnum = enum - meA, meB, meC, meD - -when isMainModule: - {.hint: "this is the main file".} - -proc fac[T](x: T): T = - # test recursive generic procs - if x <= 1: return 1 - else: return x.`*`(fac(x-1)) - -macro macrotest(n: expr): stmt {.immediate.} = - let n = callsite() - expectKind(n, nnkCall) - expectMinLen(n, 2) - result = newNimNode(nnkStmtList, n) - for i in 2..n.len-1: - result.add(newCall("write", n[1], n[i])) - result.add(newCall("writeln", n[1], newStrLitNode(""))) - -macro debug(n: expr): stmt {.immediate.} = - let n = callsite() - result = newNimNode(nnkStmtList, n) - for i in 1..n.len-1: - result.add(newCall("write", newIdentNode("stdout"), toStrLit(n[i]))) - result.add(newCall("write", newIdentNode("stdout"), newStrLitNode(": "))) - result.add(newCall("writeln", newIdentNode("stdout"), n[i])) - -macrotest(stdout, "finally", 4, 5, "variable", "argument lists") -macrotest(stdout) - -#GC_disable() - -echo("This was compiled by Nimrod version " & system.nimrodVersion) -writeln(stdout, "Hello", " World", "!") - -echo(["a", "b", "c", "d"].len) -for x in items(["What's", "your", "name", "?", ]): - echo(x) -var `name` = readLine(stdin) -{.breakpoint.} -echo("Hi " & thallo.name & "!\n") -debug(name) - -var testseq: seq[string] = @[ - "a", "b", "c", "d", "e" -] -echo(repr(testseq)) - -var dummy = "hello" -echo(substr(dummy, 2, 3)) - -echo($meC) - -# test tuples: -for x, y in items([(1, 2), (3, 4), (6, 1), (5, 2)]): - echo x - echo y - -proc simpleConst(): int = return 34 - -# test constant evaluation: -const - constEval3 = simpleConst() - constEval = "abc".contains('b') - constEval2 = fac(7) - -echo(constEval3) -echo(constEval) -echo(constEval2) -echo(1.`+`(2)) - -for i in 2..6: - for j in countdown(i+4, 2): - echo(fac(i * j)) - -when isMainModule: - {.hint: "this is the main file".} - diff --git a/tests/compile/theaproots.nim b/tests/compile/theaproots.nim deleted file mode 100644 index aec140f421..0000000000 --- a/tests/compile/theaproots.nim +++ /dev/null @@ -1,71 +0,0 @@ -type - Bar = object - x: int - - Foo = object - rheap: ref Bar - rmaybe: ref Bar - rstack: ref Bar - list: seq[ref Bar] - listarr: array[0..5, ref Bar] - nestedtup: Tup - inner: TInner - inref: ref TInner - - TInner = object - inref: ref Bar - - Tup = tuple - tupbar: ref Bar - inner: TInner - -proc acc(x: var Foo): var ref Bar = - result = x.rheap - -proc test(maybeFoo: var Foo, - maybeSeq: var seq[ref Bar], - bars: var openarray[ref Bar], - maybeTup: var Tup) = - var bb: ref Bar - maybeFoo.rmaybe = bb - maybeFoo.list[3] = bb - maybeFoo.listarr[3] = bb - acc(maybeFoo) = bb - - var localFoo: Foo - localFoo.rstack = bb - localFoo.list[3] = bb - localFoo.listarr[3] = bb - acc(localFoo) = bb - - var heapFoo: ref Foo - heapFoo.rheap = bb - heapFoo.list[3] = bb - heapFoo.listarr[3] = bb - acc(heapFoo[]) = bb - - heapFoo.nestedtup.tupbar = bb - heapFoo.nestedtup.inner.inref = bb - heapFoo.inner.inref = bb - heapFoo.inref.inref = bb - - var locseq: seq[ref Bar] - locseq[3] = bb - - var locarr: array[0..4, ref Bar] - locarr[3] = bb - - maybeSeq[3] = bb - - bars[3] = bb - - maybeTup[0] = bb - -var - ff: ref Foo - tt: Tup - gseq: seq[ref Bar] - -new(ff) - -test(ff[], gseq, gseq, tt) diff --git a/tests/compile/tlastmod.nim b/tests/compile/tlastmod.nim deleted file mode 100644 index 75b047fc8d..0000000000 --- a/tests/compile/tlastmod.nim +++ /dev/null @@ -1,18 +0,0 @@ -# test the new LastModificationTime() proc - -import - os, times, strutils - -proc main() = - var - a, b: TTime - a = getLastModificationTime(ParamStr(1)) - b = getLastModificationTime(ParamStr(2)) - writeln(stdout, $a) - writeln(stdout, $b) - if a < b: - Write(stdout, "$2 is newer than $1\n" % [ParamStr(1), ParamStr(2)]) - else: - Write(stdout, "$1 is newer than $2\n" % [ParamStr(1), ParamStr(2)]) - -main() diff --git a/tests/compile/tlibs.nim b/tests/compile/tlibs.nim deleted file mode 100644 index 971b2b8367..0000000000 --- a/tests/compile/tlibs.nim +++ /dev/null @@ -1,24 +0,0 @@ -# Test wether the bindings at least compile... - -import - unicode, cgi, terminal, libcurl, - parsexml, parseopt, parsecfg, - osproc, complex, - sdl, smpeg, sdl_gfx, sdl_net, sdl_mixer, sdl_ttf, - sdl_image, sdl_mixer_nosmpeg, - cursorfont, xatom, xf86vmode, xkb, xrandr, xshm, xvlib, keysym, xcms, xi, - xkblib, xrender, xutil, x, xf86dga, xinerama, xlib, xresource, xv, - gtk2, glib2, pango, gdk2, - cairowin32, cairoxlib, - odbcsql, - gl, glut, glu, glx, glext, wingl, - lua, lualib, lauxlib, mysql, sqlite3, python, tcl, - db_postgres, db_mysql, db_sqlite, ropes, sockets, browsers, httpserver, - httpclient, parseutils, unidecode, xmldom, xmldomparser, xmltree, xmlparser, - htmlparser, re, graphics, colors, pegs, subexes, dialogs - -when defined(linux): - import - zlib, zipfiles - -writeln(stdout, "test compilation of binding modules") diff --git a/tests/compile/tloops.nim b/tests/compile/tloops.nim deleted file mode 100644 index f6f9397698..0000000000 --- a/tests/compile/tloops.nim +++ /dev/null @@ -1,87 +0,0 @@ -# Test nested loops and some other things - -proc andTest() = - var a = 0 == 5 and 6 == 6 - -proc incx(x: var int) = # is built-in proc - x = x + 1 - -proc decx(x: var int) = - x = x - 1 - -proc First(y: var int) = - var x: int - i_ncx(x) - if x == 10: - y = 0 - else: - if x == 0: - incx(x) - else: - x=11 - -proc TestLoops() = - var i, j: int - while i >= 0: - if i mod 3 == 0: - break - i = i + 1 - while j == 13: - j = 13 - break - break - - while True: - break - - -proc Foo(n: int): int = - var - a, old: int - b, c: bool - F_irst(a) - if a == 10: - a = 30 - elif a == 11: - a = 22 - elif a == 12: - a = 23 - elif b: - old = 12 - else: - a = 40 - - # - b = false or 2 == 0 and 3 == 9 - a = 0 + 3 * 5 + 6 + 7 + +8 # 36 - while b: - a = a + 3 - a = a + 5 - write(stdout, "Hello!") - - -# We should come till here :-) -discard Foo(345) - -# test the new type symbol lookup feature: - -type - MyType[T] = tuple[ - x, y, z: T] - MyType2 = tuple[x, y: float] - -proc main[T]() = - var myType: MyType[T] - var b: MyType[T] - b = (1, 2, 3) - myType = b - echo myType - - var myType2: MyType2 - var c: MyType2 - c = (1.0, 2.0) - myType2 = c - echo myType2 - -main[int]() - diff --git a/tests/compile/tmandelbrot.nim b/tests/compile/tmandelbrot.nim deleted file mode 100644 index 1e39c8756d..0000000000 --- a/tests/compile/tmandelbrot.nim +++ /dev/null @@ -1,57 +0,0 @@ -discard """ - cmd: "nimrod cc --hints:on -d:release $# $#" -""" - -# -*- nimrod -*- - -import math -import os -import strutils - -type TComplex = tuple[re, im: float] - -proc `+` (a, b: TComplex): TComplex = - return (a.re + b.re, a.im + b.im) - -proc `*` (a, b: TComplex): TComplex = - result.re = a.re * b.re - a.im * b.im - result.im = a.re * b.im + a.im * b.re - -proc abs2 (a: TComplex): float = - return a.re * a.re + a.im * a.im - -var size = parseInt (paramStr (1)) -var bit = 128 -var byteAcc = 0 - -stdout.writeln ("P4") -stdout.write ($size) -stdout.write (" ") -stdout.writeln ($size) - -var fsize = float (size) -for y in 0 .. size-1: - var fy = 2.0 * float (y) / fsize - 1.0 - for x in 0 .. size-1: - var z = (0.0, 0.0) - var c = (float (2*x) / fsize - 1.5, fy) - - block iter: - for i in 0 .. 49: - z = z*z + c - if abs2 (z) >= 4.0: - break iter - byteAcc = byteAcc + bit - - if bit > 1: - bit = bit div 2 - else: - stdout.write (chr (byteAcc)) - bit = 128 - byteAcc = 0 - - if bit != 128: - stdout.write (chr (byteAcc)) - bit = 128 - byteAcc = 0 - diff --git a/tests/compile/tnew.nim b/tests/compile/tnew.nim deleted file mode 100644 index 6527541a2a..0000000000 --- a/tests/compile/tnew.nim +++ /dev/null @@ -1,49 +0,0 @@ -# Test the implementation of the new operator -# and the code generation for gc walkers -# (and the garbage collector): - -type - PNode = ref TNode - TNode = object - data: int - str: string - le, ri: PNode - - TStressTest = ref array [0..45, array [1..45, TNode]] - -proc finalizer(n: PNode) = - write(stdout, n.data) - write(stdout, " is now freed\n") - -proc newNode(data: int, le, ri: PNode): PNode = - new(result, finalizer) - result.le = le - result.ri = ri - result.data = data - -# now loop and build a tree -proc main() = - var - i = 0 - p: TStressTest - while i < 1000: - var n: PNode - - n = newNode(i, nil, newNode(i + 10000, nil, nil)) - inc(i) - new(p) - - write(stdout, "Simple tree node allocation worked!\n") - i = 0 - while i < 1000: - var m = newNode(i + 20000, nil, nil) - var k = newNode(i + 30000, nil, nil) - m.le = m - m.ri = k - k.le = m - k.ri = k - inc(i) - - write(stdout, "Simple cycle allocation worked!\n") - -main() diff --git a/tests/compile/tnewlibs.nim b/tests/compile/tnewlibs.nim deleted file mode 100644 index bdb53ae0b1..0000000000 --- a/tests/compile/tnewlibs.nim +++ /dev/null @@ -1,17 +0,0 @@ -# Test wether the bindings at least compile... - -import - tcl, - sdl, smpeg, sdl_gfx, sdl_net, sdl_mixer, sdl_ttf, - sdl_image, sdl_mixer_nosmpeg, - gtk2, glib2, pango, gdk2, - unicode, cgi, terminal, libcurl, - parsexml, parseopt, parsecfg, - osproc, - cairowin32, cairoxlib, - gl, glut, glu, glx, glext, wingl, - lua, lualib, lauxlib, mysql, sqlite3, db_mongo, md5, asyncio, mimetypes, - cookies, events, ftpclient, scgi, irc - - -writeln(stdout, "test compilation of binding modules") diff --git a/tests/compile/tnewsets.nim b/tests/compile/tnewsets.nim deleted file mode 100644 index 415fe8f7e0..0000000000 --- a/tests/compile/tnewsets.nim +++ /dev/null @@ -1,6 +0,0 @@ -# new test for sets: - -const elem = ' ' - -var s: set[char] = {elem} -assert(elem in s and 'a' not_in s and 'c' not_in s ) diff --git a/tests/compile/tnewuns.nim b/tests/compile/tnewuns.nim deleted file mode 100644 index 5181e467c1..0000000000 --- a/tests/compile/tnewuns.nim +++ /dev/null @@ -1,12 +0,0 @@ -# test the new unsigned operations: - -import - strutils - -var - x, y: int - -x = 1 -y = high(int) - -writeln(stdout, $ ( x +% y ) ) diff --git a/tests/compile/tnoforward.nim b/tests/compile/tnoforward.nim deleted file mode 100644 index 0359ff3487..0000000000 --- a/tests/compile/tnoforward.nim +++ /dev/null @@ -1,10 +0,0 @@ -{. noforward: on .} - -proc foo(x: int) = - bar x - -proc bar(x: int) = - echo x - -foo(10) - diff --git a/tests/compile/tparedef.nim b/tests/compile/tparedef.nim deleted file mode 100644 index dedebf6b7c..0000000000 --- a/tests/compile/tparedef.nim +++ /dev/null @@ -1,4 +0,0 @@ -# This test is now superfluous: - -proc a(a: int) = - return diff --git a/tests/compile/tprep.nim b/tests/compile/tprep.nim deleted file mode 100644 index 4ef9e25439..0000000000 --- a/tests/compile/tprep.nim +++ /dev/null @@ -1,30 +0,0 @@ -# Test the features that used to belong to the preprocessor - -import - times - -#{.warning: "This is only a test warning!".} - -const - case2 = true - case3 = true - -when defined(case1): - {.hint: "Case 1".} - when case3: - {.hint: "Case 1.3".} -elif case2: - {.hint: "Case 2".} - when case3: - {.hint: "Case 2.3".} -elif case3: - {.hint: "Case 3".} -else: - {.hint: "unknown case".} - -var - s: string -write(stdout, "compiled at " & system.compileDate & - " " & compileTime & "\n") -echo getDateStr() -echo getClockStr() diff --git a/tests/compile/tquicksort.nim b/tests/compile/tquicksort.nim deleted file mode 100644 index 6706a185ee..0000000000 --- a/tests/compile/tquicksort.nim +++ /dev/null @@ -1,26 +0,0 @@ -proc QuickSort(list: seq[int]): seq[int] = - if len(list) == 0: - return @[] - var pivot = list[0] - var left: seq[int] = @[] - var right: seq[int] = @[] - for i in low(list)..high(list): - if list[i] < pivot: - left.add(list[i]) - elif list[i] > pivot: - right.add(list[i]) - result = QuickSort(left) & - pivot & - QuickSort(right) - -proc echoSeq(a: seq[int]) = - for i in low(a)..high(a): - echo(a[i]) - -var - list: seq[int] - -list = QuickSort(@[89,23,15,23,56,123,356,12,7,1,6,2,9,4,3]) -echoSeq(list) - - diff --git a/tests/compile/tradix.nim b/tests/compile/tradix.nim deleted file mode 100644 index e5998ee12f..0000000000 --- a/tests/compile/tradix.nim +++ /dev/null @@ -1,319 +0,0 @@ -# implements and tests an efficient radix tree - -## another method to store an efficient array of pointers: -## We use a radix tree with node compression. -## There are two node kinds: - -const bitsPerUnit = 8*sizeof(int) - -type - TRadixNodeKind = enum rnLinear, rnFull, rnLeafBits, rnLeafLinear - PRadixNode = ptr TRadixNode - TRadixNode {.pure, inheritable.} = object - kind: TRadixNodeKind - TRadixNodeLinear = object of TRadixNode - len: int8 - keys: array [0..31, int8] - vals: array [0..31, PRadixNode] - - TRadixNodeFull = object of TRadixNode - b: array [0..255, PRadixNode] - TRadixNodeLeafBits = object of TRadixNode - b: array [0..7, int] - TRadixNodeLeafLinear = object of TRadixNode - len: int8 - keys: array [0..31, int8] - -var - root: PRadixNode - -proc searchInner(r: PRadixNode, a: int): PRadixNode = - case r.kind - of rnLinear: - var x = cast[ptr TRadixNodeLinear](r) - for i in 0..ze(x.len)-1: - if ze(x.keys[i]) == a: return x.vals[i] - of rnFull: - var x = cast[ptr TRadixNodeFull](r) - return x.b[a] - else: assert(false) - -proc testBit(w, i: int): bool {.inline.} = - result = (w and (1 shl (i %% BitsPerUnit))) != 0 - -proc setBit(w: var int, i: int) {.inline.} = - w = w or (1 shl (i %% bitsPerUnit)) - -proc resetBit(w: var int, i: int) {.inline.} = - w = w and not (1 shl (i %% bitsPerUnit)) - -proc testOrSetBit(w: var int, i: int): bool {.inline.} = - var x = (1 shl (i %% bitsPerUnit)) - if (w and x) != 0: return true - w = w or x - -proc searchLeaf(r: PRadixNode, a: int): bool = - case r.kind - of rnLeafBits: - var x = cast[ptr TRadixNodeLeafBits](r) - return testBit(x.b[a /% BitsPerUnit], a) - of rnLeafLinear: - var x = cast[ptr TRadixNodeLeafLinear](r) - for i in 0..ze(x.len)-1: - if ze(x.keys[i]) == a: return true - else: assert(false) - -proc exclLeaf(r: PRadixNode, a: int) = - case r.kind - of rnLeafBits: - var x = cast[ptr TRadixNodeLeafBits](r) - resetBit(x.b[a /% BitsPerUnit], a) - of rnLeafLinear: - var x = cast[ptr TRadixNodeLeafLinear](r) - var L = ze(x.len) - for i in 0..L-1: - if ze(x.keys[i]) == a: - x.keys[i] = x.keys[L-1] - dec(x.len) - return - else: assert(false) - -proc contains*(r: PRadixNode, a: TAddress): bool = - if r == nil: return false - var x = searchInner(r, a shr 24 and 0xff) - if x == nil: return false - x = searchInner(x, a shr 16 and 0xff) - if x == nil: return false - x = searchInner(x, a shr 8 and 0xff) - if x == nil: return false - return searchLeaf(x, a and 0xff) - -proc excl*(r: PRadixNode, a: TAddress): bool = - if r == nil: return false - var x = searchInner(r, a shr 24 and 0xff) - if x == nil: return false - x = searchInner(x, a shr 16 and 0xff) - if x == nil: return false - x = searchInner(x, a shr 8 and 0xff) - if x == nil: return false - exclLeaf(x, a and 0xff) - -proc addLeaf(r: var PRadixNode, a: int): bool = - if r == nil: - # a linear node: - var x = cast[ptr TRadixNodeLinear](alloc(sizeof(TRadixNodeLinear))) - x.kind = rnLeafLinear - x.len = 1'i8 - x.keys[0] = toU8(a) - r = x - return false # not already in set - case r.kind - of rnLeafBits: - var x = cast[ptr TRadixNodeLeafBits](r) - return testOrSetBit(x.b[a /% BitsPerUnit], a) - of rnLeafLinear: - var x = cast[ptr TRadixNodeLeafLinear](r) - var L = ze(x.len) - for i in 0..L-1: - if ze(x.keys[i]) == a: return true - if L <= high(x.keys): - x.keys[L] = toU8(a) - inc(x.len) - else: - # transform into a full node: - var y = cast[ptr TRadixNodeLeafBits](alloc0(sizeof(TRadixNodeLeafBits))) - y.kind = rnLeafBits - for i in 0..ze(x.len)-1: - var u = ze(x.keys[i]) - setBit(y.b[u /% BitsPerUnit], u) - setBit(y.b[a /% BitsPerUnit], a) - dealloc(r) - r = y - else: assert(false) - -proc addInner(r: var PRadixNode, a: int, d: int): bool = - if d == 0: - return addLeaf(r, a and 0xff) - var k = a shr d and 0xff - if r == nil: - # a linear node: - var x = cast[ptr TRadixNodeLinear](alloc(sizeof(TRadixNodeLinear))) - x.kind = rnLinear - x.len = 1'i8 - x.keys[0] = toU8(k) - r = x - return addInner(x.vals[0], a, d-8) - case r.kind - of rnLinear: - var x = cast[ptr TRadixNodeLinear](r) - var L = ze(x.len) - for i in 0..L-1: - if ze(x.keys[i]) == k: # already exists - return addInner(x.vals[i], a, d-8) - if L <= high(x.keys): - x.keys[L] = toU8(k) - inc(x.len) - return addInner(x.vals[L], a, d-8) - else: - # transform into a full node: - var y = cast[ptr TRadixNodeFull](alloc0(sizeof(TRadixNodeFull))) - y.kind = rnFull - for i in 0..L-1: y.b[ze(x.keys[i])] = x.vals[i] - dealloc(r) - r = y - return addInner(y.b[k], a, d-8) - of rnFull: - var x = cast[ptr TRadixNodeFull](r) - return addInner(x.b[k], a, d-8) - else: assert(false) - -proc incl*(r: var PRadixNode, a: TAddress) {.inline.} = - discard addInner(r, a, 24) - -proc testOrIncl*(r: var PRadixNode, a: TAddress): bool {.inline.} = - return addInner(r, a, 24) - -iterator innerElements(r: PRadixNode): tuple[prefix: int, n: PRadixNode] = - if r != nil: - case r.kind - of rnFull: - var r = cast[ptr TRadixNodeFull](r) - for i in 0..high(r.b): - if r.b[i] != nil: - yield (i, r.b[i]) - of rnLinear: - var r = cast[ptr TRadixNodeLinear](r) - for i in 0..ze(r.len)-1: - yield (ze(r.keys[i]), r.vals[i]) - else: assert(false) - -iterator leafElements(r: PRadixNode): int = - if r != nil: - case r.kind - of rnLeafBits: - var r = cast[ptr TRadixNodeLeafBits](r) - # iterate over any bit: - for i in 0..high(r.b): - if r.b[i] != 0: # test all bits for zero - for j in 0..BitsPerUnit-1: - if testBit(r.b[i], j): - yield i*BitsPerUnit+j - of rnLeafLinear: - var r = cast[ptr TRadixNodeLeafLinear](r) - for i in 0..ze(r.len)-1: - yield ze(r.keys[i]) - else: assert(false) - -iterator elements*(r: PRadixNode): TAddress {.inline.} = - for p1, n1 in innerElements(r): - for p2, n2 in innerElements(n1): - for p3, n3 in innerElements(n2): - for p4 in leafElements(n3): - yield p1 shl 24 or p2 shl 16 or p3 shl 8 or p4 - -proc main() = - const - numbers = [128, 1, 2, 3, 4, 255, 17, -8, 45, 19_000] - var - r: PRadixNode = nil - for x in items(numbers): - echo testOrIncl(r, x) - for x in elements(r): echo(x) - -main() - - -when false: - proc traverse(r: PRadixNode, prefix: int, d: int) = - if r == nil: return - case r.kind - of rnLeafBits: - assert(d == 0) - var x = cast[ptr TRadixNodeLeafBits](r) - # iterate over any bit: - for i in 0..high(x.b): - if x.b[i] != 0: # test all bits for zero - for j in 0..BitsPerUnit-1: - if testBit(x.b[i], j): - visit(prefix or i*BitsPerUnit+j) - of rnLeafLinear: - assert(d == 0) - var x = cast[ptr TRadixNodeLeafLinear](r) - for i in 0..ze(x.len)-1: - visit(prefix or ze(x.keys[i])) - of rnFull: - var x = cast[ptr TRadixNodeFull](r) - for i in 0..high(r.b): - if r.b[i] != nil: - traverse(r.b[i], prefix or (i shl d), d-8) - of rnLinear: - var x = cast[ptr TRadixNodeLinear](r) - for i in 0..ze(x.len)-1: - traverse(x.vals[i], prefix or (ze(x.keys[i]) shl d), d-8) - - type - TRadixIter {.final.} = object - r: PRadixNode - p: int - x: int - - proc init(i: var TRadixIter, r: PRadixNode) = - i.r = r - i.x = 0 - i.p = 0 - - proc nextr(i: var TRadixIter): PRadixNode = - if i.r == nil: return nil - case i.r.kind - of rnFull: - var r = cast[ptr TRadixNodeFull](i.r) - while i.x <= high(r.b): - if r.b[i.x] != nil: - i.p = i.x - return r.b[i.x] - inc(i.x) - of rnLinear: - var r = cast[ptr TRadixNodeLinear](i.r) - if i.x < ze(r.len): - i.p = ze(r.keys[i.x]) - result = r.vals[i.x] - inc(i.x) - else: assert(false) - - proc nexti(i: var TRadixIter): int = - result = -1 - case i.r.kind - of rnLeafBits: - var r = cast[ptr TRadixNodeLeafBits](i.r) - # iterate over any bit: - for i in 0..high(r.b): - if x.b[i] != 0: # test all bits for zero - for j in 0..BitsPerUnit-1: - if testBit(x.b[i], j): - visit(prefix or i*BitsPerUnit+j) - of rnLeafLinear: - var r = cast[ptr TRadixNodeLeafLinear](i.r) - if i.x < ze(r.len): - result = ze(r.keys[i.x]) - inc(i.x) - - iterator elements(r: PRadixNode): TAddress {.inline.} = - var - a, b, c, d: TRadixIter - init(a, r) - while true: - var x = nextr(a) - if x != nil: - init(b, x) - while true: - var y = nextr(b) - if y != nil: - init(c, y) - while true: - var z = nextr(c) - if z != nil: - init(d, z) - while true: - var q = nexti(d) - if q != -1: - yield a.p shl 24 or b.p shl 16 or c.p shl 8 or q diff --git a/tests/compile/treadln.nim b/tests/compile/treadln.nim deleted file mode 100644 index 1117ab5f9d..0000000000 --- a/tests/compile/treadln.nim +++ /dev/null @@ -1,12 +0,0 @@ -# test the improved readline handling that does not care whether its -# Macintosh, Unix or Windows text format. - -var - inp: TFile - line: string - -if open(inp, "readme.txt"): - while not EndOfFile(inp): - line = readLine(inp) - echo("#" & line & "#") - close(inp) diff --git a/tests/compile/treadx.nim b/tests/compile/treadx.nim deleted file mode 100644 index 49b6ad6912..0000000000 --- a/tests/compile/treadx.nim +++ /dev/null @@ -1,14 +0,0 @@ - -when not defined(windows): - import posix - - var inp = "" - var buf: array[0..10, char] - while true: - var r = read(0, addr(buf), sizeof(buf)-1) - add inp, $buf - if r != sizeof(buf)-1: break - - echo inp - #dafkladskölklödsaf ölksdakölfölksfklwe4iojr389wr 89uweokf sdlkf jweklr jweflksdj fioewjfsdlfsd - diff --git a/tests/compile/tshadow_magic_type.nim b/tests/compile/tshadow_magic_type.nim deleted file mode 100644 index 5cd27435e1..0000000000 --- a/tests/compile/tshadow_magic_type.nim +++ /dev/null @@ -1,24 +0,0 @@ -type - TListItemType* = enum - RedisNil, RedisString - - TListItem* = object - case kind*: TListItemType - of RedisString: - str*: string - else: nil - TRedisList* = seq[TListItem] - -# Caused by this. -proc seq*() = - nil - -proc lrange*(key: string): TRedisList = - var foo: TListItem - foo.kind = RedisNil - result = @[foo] - -when isMainModule: - var p = lrange("mylist") - for i in items(p): - echo(i.str) diff --git a/tests/compile/tsizeof.nim b/tests/compile/tsizeof.nim deleted file mode 100644 index f7b70dd4d0..0000000000 --- a/tests/compile/tsizeof.nim +++ /dev/null @@ -1,10 +0,0 @@ -# Test the sizeof proc - -type - TMyRecord {.final.} = object - x, y: int - b: bool - r: float - s: string - -write(stdout, sizeof(TMyRecord)) diff --git a/tests/compile/tstrace.nim b/tests/compile/tstrace.nim deleted file mode 100644 index 3032a34a35..0000000000 --- a/tests/compile/tstrace.nim +++ /dev/null @@ -1,16 +0,0 @@ -# Test the new stacktraces (great for debugging!) - -{.push stack_trace: on.} - -proc recTest(i: int) = - # enter - if i < 10: - recTest(i+1) - else: # should printStackTrace() - var p: ptr int = nil - p[] = 12 - # leave - -{.pop.} - -recTest(0) diff --git a/tests/compile/tstrdesc.nim b/tests/compile/tstrdesc.nim deleted file mode 100644 index 1c2e85b4bf..0000000000 --- a/tests/compile/tstrdesc.nim +++ /dev/null @@ -1,14 +0,0 @@ -var - x: array [0..2, int] - -x = [0, 1, 2] - -type - TStringDesc {.final.} = object - len, space: int # len and space without counting the terminating zero - data: array [0..0, char] # for the '\0' character - -var - emptyString {.exportc: "emptyString".}: TStringDesc - - diff --git a/tests/compile/tstrdist.nim b/tests/compile/tstrdist.nim deleted file mode 100644 index 3e1939e737..0000000000 --- a/tests/compile/tstrdist.nim +++ /dev/null @@ -1,26 +0,0 @@ -# compute the edit distance between two strings - -proc editDistance(a, b: string): int = - var - c: seq[int] - n = a.len - m = b.len - newSeq(c, (n+1)*(m+1)) - for i in 0..n: - c[i*n] = i # [i,0] - for j in 0..m: - c[j] = j # [0,j] - - for i in 1..n: - for j in 1..m: - var x = c[(i-1)*n + j]+1 - var y = c[i*n + j-1]+1 - var z: int - if a[i-1] == b[j-1]: - z = c[(i-1)*n + j-1] - else: - z = c[(i-1)*n + j-1]+1 - c[(i-1)*n + (j-1)] = min(x,min(y,z)) - return c[n*m] - -write(stdout, editDistance("abc", "abd")) diff --git a/tests/compile/tvarious.nim b/tests/compile/tvarious.nim deleted file mode 100644 index 5883ba62f2..0000000000 --- a/tests/compile/tvarious.nim +++ /dev/null @@ -1,63 +0,0 @@ -# Test various aspects - -# bug #572 -var a=12345678901'u64 - -var x = (x: 42, y: (a: 8, z: 10)) -echo x.y - -import - mvarious - -type - PA = ref TA - PB = ref TB - - TB = object - a: PA - - TA = object - b: TB - x: int - -proc getPA(): PA = - var - b: bool - b = not false - return nil - -# bug #501 -proc f(): int = 54 - -var - global: int - -var - s: string - i: int - r: TA - -r.b.a.x = 0 -global = global + 1 -exportme() -write(stdout, "Hallo wie heißt du? ") -write(stdout, getPA().x) -s = readLine(stdin) -i = 0 -while i < s.len: - if s[i] == 'c': write(stdout, "'c' in deinem Namen gefunden\n") - i = i + 1 - -write(stdout, "Du heißt " & s) - -# bug #544 - -type Bar [T; I:range] = array[I, T] -proc foo*[T; I:range](a, b: Bar[T, I]): Bar[T, I] = - when len(a) != 3: - # Error: constant expression expected - {.fatal:"Dimensions have to be 3".} - #... -block: - var a, b: Bar[int, 0..2] - discard foo(a, b) diff --git a/tests/compile/tcompiles.nim b/tests/compiles/tcompiles.nim similarity index 100% rename from tests/compile/tcompiles.nim rename to tests/compiles/tcompiles.nim diff --git a/tests/run/tconcat.nim b/tests/concat/tconcat.nim similarity index 100% rename from tests/run/tconcat.nim rename to tests/concat/tconcat.nim diff --git a/tests/run/tnodeadlocks.nim b/tests/concurrency/tnodeadlocks.nim similarity index 100% rename from tests/run/tnodeadlocks.nim rename to tests/concurrency/tnodeadlocks.nim diff --git a/tests/reject/tconstr1.nim b/tests/constr/tconstr1.nim similarity index 100% rename from tests/reject/tconstr1.nim rename to tests/constr/tconstr1.nim diff --git a/tests/run/tconstr2.nim b/tests/constr/tconstr2.nim similarity index 100% rename from tests/run/tconstr2.nim rename to tests/constr/tconstr2.nim diff --git a/tests/reject/tconstraints.nim b/tests/constraints/tconstraints.nim similarity index 100% rename from tests/reject/tconstraints.nim rename to tests/constraints/tconstraints.nim diff --git a/tests/run/tcontinue.nim b/tests/controlflow/tcontinue.nim similarity index 100% rename from tests/run/tcontinue.nim rename to tests/controlflow/tcontinue.nim diff --git a/tests/reject/tstatret.nim b/tests/controlflow/tstatret.nim similarity index 100% rename from tests/reject/tstatret.nim rename to tests/controlflow/tstatret.nim diff --git a/tests/compile/tconvcolors.nim b/tests/converter/tconvcolors.nim similarity index 100% rename from tests/compile/tconvcolors.nim rename to tests/converter/tconvcolors.nim diff --git a/tests/compile/tconvert.nim b/tests/converter/tconvert.nim similarity index 100% rename from tests/compile/tconvert.nim rename to tests/converter/tconvert.nim diff --git a/tests/run/tgenericconverter.nim b/tests/converter/tgenericconverter.nim similarity index 100% rename from tests/run/tgenericconverter.nim rename to tests/converter/tgenericconverter.nim diff --git a/tests/compile/ttypeconverter1.nim b/tests/converter/ttypeconverter1.nim similarity index 100% rename from tests/compile/ttypeconverter1.nim rename to tests/converter/ttypeconverter1.nim diff --git a/tests/compile/mdefaultprocparam.nim b/tests/defaultprocparam/mdefaultprocparam.nim similarity index 100% rename from tests/compile/mdefaultprocparam.nim rename to tests/defaultprocparam/mdefaultprocparam.nim diff --git a/tests/compile/tdefaultprocparam.nim b/tests/defaultprocparam/tdefaultprocparam.nim similarity index 100% rename from tests/compile/tdefaultprocparam.nim rename to tests/defaultprocparam/tdefaultprocparam.nim diff --git a/tests/reject/tdeprecated.nim b/tests/deprecated/tdeprecated.nim similarity index 100% rename from tests/reject/tdeprecated.nim rename to tests/deprecated/tdeprecated.nim diff --git a/tests/run/tdestructor.nim b/tests/destructor/tdestructor.nim similarity index 100% rename from tests/run/tdestructor.nim rename to tests/destructor/tdestructor.nim diff --git a/tests/reject/tdestructor.nim b/tests/destructor/tdestructor2.nim similarity index 100% rename from tests/reject/tdestructor.nim rename to tests/destructor/tdestructor2.nim diff --git a/tests/compile/tdictdestruct.nim b/tests/destructor/tdictdestruct.nim similarity index 100% rename from tests/compile/tdictdestruct.nim rename to tests/destructor/tdictdestruct.nim diff --git a/tests/compile/tdiscardable.nim b/tests/discard/tdiscardable.nim similarity index 100% rename from tests/compile/tdiscardable.nim rename to tests/discard/tdiscardable.nim diff --git a/tests/reject/tneedsdiscard.nim b/tests/discard/tneedsdiscard.nim similarity index 100% rename from tests/reject/tneedsdiscard.nim rename to tests/discard/tneedsdiscard.nim diff --git a/tests/run/tcurrncy.nim b/tests/distinct/tcurrncy.nim similarity index 100% rename from tests/run/tcurrncy.nim rename to tests/distinct/tcurrncy.nim diff --git a/tests/reject/teffects1.nim b/tests/effects/teffects1.nim similarity index 100% rename from tests/reject/teffects1.nim rename to tests/effects/teffects1.nim diff --git a/tests/reject/teffects2.nim b/tests/effects/teffects2.nim similarity index 100% rename from tests/reject/teffects2.nim rename to tests/effects/teffects2.nim diff --git a/tests/reject/teffects3.nim b/tests/effects/teffects3.nim similarity index 100% rename from tests/reject/teffects3.nim rename to tests/effects/teffects3.nim diff --git a/tests/reject/teffects4.nim b/tests/effects/teffects4.nim similarity index 100% rename from tests/reject/teffects4.nim rename to tests/effects/teffects4.nim diff --git a/tests/reject/teffects5.nim b/tests/effects/teffects5.nim similarity index 100% rename from tests/reject/teffects5.nim rename to tests/effects/teffects5.nim diff --git a/tests/compile/teffects1.nim b/tests/effects/teffects6.nim similarity index 100% rename from tests/compile/teffects1.nim rename to tests/effects/teffects6.nim diff --git a/tests/reject/tsidee1.nim b/tests/effects/tsidee1.nim similarity index 100% rename from tests/reject/tsidee1.nim rename to tests/effects/tsidee1.nim diff --git a/tests/run/tsidee2.nim b/tests/effects/tsidee2.nim similarity index 100% rename from tests/run/tsidee2.nim rename to tests/effects/tsidee2.nim diff --git a/tests/run/tsidee3.nim b/tests/effects/tsidee3.nim similarity index 100% rename from tests/run/tsidee3.nim rename to tests/effects/tsidee3.nim diff --git a/tests/reject/tsidee4.nim b/tests/effects/tsidee4.nim similarity index 100% rename from tests/reject/tsidee4.nim rename to tests/effects/tsidee4.nim diff --git a/tests/compile/tenum.nim b/tests/enum/tenum.nim similarity index 100% rename from tests/compile/tenum.nim rename to tests/enum/tenum.nim diff --git a/tests/compile/tenum2.nim b/tests/enum/tenum2.nim similarity index 100% rename from tests/compile/tenum2.nim rename to tests/enum/tenum2.nim diff --git a/tests/compile/tenum3.nim b/tests/enum/tenum3.nim similarity index 100% rename from tests/compile/tenum3.nim rename to tests/enum/tenum3.nim diff --git a/tests/run/tenumhole.nim b/tests/enum/tenumhole.nim similarity index 100% rename from tests/run/tenumhole.nim rename to tests/enum/tenumhole.nim diff --git a/tests/reject/tenumitems.nim b/tests/enum/tenumitems.nim similarity index 100% rename from tests/reject/tenumitems.nim rename to tests/enum/tenumitems.nim diff --git a/tests/run/tenumitems.nim b/tests/enum/tenumitems2.nim similarity index 100% rename from tests/run/tenumitems.nim rename to tests/enum/tenumitems2.nim diff --git a/tests/reject/tenummix.nim b/tests/enum/tenummix.nim similarity index 100% rename from tests/reject/tenummix.nim rename to tests/enum/tenummix.nim diff --git a/tests/run/tnamedenumfields.nim b/tests/enum/tnamedenumfields.nim similarity index 100% rename from tests/run/tnamedenumfields.nim rename to tests/enum/tnamedenumfields.nim diff --git a/tests/compile/toptions.nim b/tests/enum/toptions.nim similarity index 100% rename from tests/compile/toptions.nim rename to tests/enum/toptions.nim diff --git a/tests/run/tcontinuexc.nim b/tests/exception/tcontinuexc.nim similarity index 100% rename from tests/run/tcontinuexc.nim rename to tests/exception/tcontinuexc.nim diff --git a/tests/run/texceptions.nim b/tests/exception/texceptions.nim similarity index 100% rename from tests/run/texceptions.nim rename to tests/exception/texceptions.nim diff --git a/tests/run/texcpt1.nim b/tests/exception/texcpt1.nim similarity index 100% rename from tests/run/texcpt1.nim rename to tests/exception/texcpt1.nim diff --git a/tests/run/texcsub.nim b/tests/exception/texcsub.nim similarity index 100% rename from tests/run/texcsub.nim rename to tests/exception/texcsub.nim diff --git a/tests/run/tfinally.nim b/tests/exception/tfinally.nim similarity index 100% rename from tests/run/tfinally.nim rename to tests/exception/tfinally.nim diff --git a/tests/run/tfinally2.nim b/tests/exception/tfinally2.nim similarity index 100% rename from tests/run/tfinally2.nim rename to tests/exception/tfinally2.nim diff --git a/tests/run/tfinally3.nim b/tests/exception/tfinally3.nim similarity index 100% rename from tests/run/tfinally3.nim rename to tests/exception/tfinally3.nim diff --git a/tests/run/tonraise.nim b/tests/exception/tonraise.nim similarity index 100% rename from tests/run/tonraise.nim rename to tests/exception/tonraise.nim diff --git a/tests/run/treraise.nim b/tests/exception/treraise.nim similarity index 100% rename from tests/run/treraise.nim rename to tests/exception/treraise.nim diff --git a/tests/run/tunhandledexc.nim b/tests/exception/tunhandledexc.nim similarity index 100% rename from tests/run/tunhandledexc.nim rename to tests/exception/tunhandledexc.nim diff --git a/tests/run/twrongexc.nim b/tests/exception/twrongexc.nim similarity index 100% rename from tests/run/twrongexc.nim rename to tests/exception/twrongexc.nim diff --git a/tests/reject/texprstmt.nim b/tests/exprs/texprstmt.nim similarity index 100% rename from tests/reject/texprstmt.nim rename to tests/exprs/texprstmt.nim diff --git a/tests/reject/tstmtexp.nim b/tests/exprs/tstmtexp.nim similarity index 100% rename from tests/reject/tstmtexp.nim rename to tests/exprs/tstmtexp.nim diff --git a/tests/run/tstmtexprs.nim b/tests/exprs/tstmtexprs.nim similarity index 100% rename from tests/run/tstmtexprs.nim rename to tests/exprs/tstmtexprs.nim diff --git a/tests/run/tfieldindex.nim b/tests/fields/tfieldindex.nim similarity index 100% rename from tests/run/tfieldindex.nim rename to tests/fields/tfieldindex.nim diff --git a/tests/run/tfielditerator.nim b/tests/fields/tfielditerator.nim similarity index 100% rename from tests/run/tfielditerator.nim rename to tests/fields/tfielditerator.nim diff --git a/tests/run/tfielditerator2.nim b/tests/fields/tfielditerator2.nim similarity index 100% rename from tests/run/tfielditerator2.nim rename to tests/fields/tfielditerator2.nim diff --git a/tests/run/tfloat1.nim b/tests/float/tfloat1.nim similarity index 100% rename from tests/run/tfloat1.nim rename to tests/float/tfloat1.nim diff --git a/tests/run/tfloat2.nim b/tests/float/tfloat2.nim similarity index 100% rename from tests/run/tfloat2.nim rename to tests/float/tfloat2.nim diff --git a/tests/run/tfloat3.nim b/tests/float/tfloat3.nim similarity index 100% rename from tests/run/tfloat3.nim rename to tests/float/tfloat3.nim diff --git a/tests/run/mfriends.nim b/tests/friends/mfriends.nim similarity index 100% rename from tests/run/mfriends.nim rename to tests/friends/mfriends.nim diff --git a/tests/run/tfriends.nim b/tests/friends/tfriends.nim similarity index 100% rename from tests/run/tfriends.nim rename to tests/friends/tfriends.nim diff --git a/tests/run/tbintre2.nim b/tests/generics/tbintre2.nim similarity index 100% rename from tests/run/tbintre2.nim rename to tests/generics/tbintre2.nim diff --git a/tests/run/tbintree.nim b/tests/generics/tbintree.nim similarity index 100% rename from tests/run/tbintree.nim rename to tests/generics/tbintree.nim diff --git a/tests/compile/tcan_alias_generic.nim b/tests/generics/tcan_alias_generic.nim similarity index 100% rename from tests/compile/tcan_alias_generic.nim rename to tests/generics/tcan_alias_generic.nim diff --git a/tests/compile/tcan_alias_specialised_generic.nim b/tests/generics/tcan_alias_specialised_generic.nim similarity index 100% rename from tests/compile/tcan_alias_specialised_generic.nim rename to tests/generics/tcan_alias_specialised_generic.nim diff --git a/tests/compile/tcan_inherit_generic.nim b/tests/generics/tcan_inherit_generic.nim similarity index 100% rename from tests/compile/tcan_inherit_generic.nim rename to tests/generics/tcan_inherit_generic.nim diff --git a/tests/compile/tcan_specialise_generic.nim b/tests/generics/tcan_specialise_generic.nim similarity index 100% rename from tests/compile/tcan_specialise_generic.nim rename to tests/generics/tcan_specialise_generic.nim diff --git a/tests/run/texplicitgeneric1.nim b/tests/generics/texplicitgeneric1.nim similarity index 100% rename from tests/run/texplicitgeneric1.nim rename to tests/generics/texplicitgeneric1.nim diff --git a/tests/run/texplicitgeneric2.nim b/tests/generics/texplicitgeneric2.nim similarity index 100% rename from tests/run/texplicitgeneric2.nim rename to tests/generics/texplicitgeneric2.nim diff --git a/tests/compile/tforwardgeneric.nim b/tests/generics/tforwardgeneric.nim similarity index 100% rename from tests/compile/tforwardgeneric.nim rename to tests/generics/tforwardgeneric.nim diff --git a/tests/compile/tgeneric.nim b/tests/generics/tgeneric0.nim similarity index 100% rename from tests/compile/tgeneric.nim rename to tests/generics/tgeneric0.nim diff --git a/tests/run/tgenerics1.nim b/tests/generics/tgeneric1.nim similarity index 100% rename from tests/run/tgenerics1.nim rename to tests/generics/tgeneric1.nim diff --git a/tests/compile/tgeneric2.nim b/tests/generics/tgeneric2.nim similarity index 100% rename from tests/compile/tgeneric2.nim rename to tests/generics/tgeneric2.nim diff --git a/tests/compile/tgeneric3.nim b/tests/generics/tgeneric3.nim similarity index 100% rename from tests/compile/tgeneric3.nim rename to tests/generics/tgeneric3.nim diff --git a/tests/compile/tgeneric4.nim b/tests/generics/tgeneric4.nim similarity index 100% rename from tests/compile/tgeneric4.nim rename to tests/generics/tgeneric4.nim diff --git a/tests/compile/tgenericdefaults.nim b/tests/generics/tgenericdefaults.nim similarity index 100% rename from tests/compile/tgenericdefaults.nim rename to tests/generics/tgenericdefaults.nim diff --git a/tests/compile/tgenericmatcher.nim b/tests/generics/tgenericmatcher.nim similarity index 100% rename from tests/compile/tgenericmatcher.nim rename to tests/generics/tgenericmatcher.nim diff --git a/tests/compile/tgenericmatcher2.nim b/tests/generics/tgenericmatcher2.nim similarity index 100% rename from tests/compile/tgenericmatcher2.nim rename to tests/generics/tgenericmatcher2.nim diff --git a/tests/run/tgenericprocvar.nim b/tests/generics/tgenericprocvar.nim similarity index 100% rename from tests/run/tgenericprocvar.nim rename to tests/generics/tgenericprocvar.nim diff --git a/tests/compile/tgenericprop.nim b/tests/generics/tgenericprop.nim similarity index 100% rename from tests/compile/tgenericprop.nim rename to tests/generics/tgenericprop.nim diff --git a/tests/compile/tgenericrefs.nim b/tests/generics/tgenericrefs.nim similarity index 100% rename from tests/compile/tgenericrefs.nim rename to tests/generics/tgenericrefs.nim diff --git a/tests/compile/tgenericshardcases.nim b/tests/generics/tgenericshardcases.nim similarity index 100% rename from tests/compile/tgenericshardcases.nim rename to tests/generics/tgenericshardcases.nim diff --git a/tests/compile/tgenerictmpl.nim b/tests/generics/tgenerictmpl.nim similarity index 100% rename from tests/compile/tgenerictmpl.nim rename to tests/generics/tgenerictmpl.nim diff --git a/tests/compile/tgenericvariant.nim b/tests/generics/tgenericvariant.nim similarity index 100% rename from tests/compile/tgenericvariant.nim rename to tests/generics/tgenericvariant.nim diff --git a/tests/compile/tspecialised_is_equivalent.nim b/tests/generics/tspecialised_is_equivalent.nim similarity index 100% rename from tests/compile/tspecialised_is_equivalent.nim rename to tests/generics/tspecialised_is_equivalent.nim diff --git a/tests/compile/tthread_generic.nim b/tests/generics/tthread_generic.nim similarity index 100% rename from tests/compile/tthread_generic.nim rename to tests/generics/tthread_generic.nim diff --git a/tests/run/tvarargs_vs_generic.nim b/tests/generics/tvarargs_vs_generic.nim similarity index 100% rename from tests/run/tvarargs_vs_generic.nim rename to tests/generics/tvarargs_vs_generic.nim diff --git a/tests/run/tgensym.nim b/tests/gensym/tgensym.nim similarity index 100% rename from tests/run/tgensym.nim rename to tests/gensym/tgensym.nim diff --git a/tests/compile/tgensymgeneric.nim b/tests/gensym/tgensymgeneric.nim similarity index 100% rename from tests/compile/tgensymgeneric.nim rename to tests/gensym/tgensymgeneric.nim diff --git a/tests/run/tglobal.nim b/tests/global/tglobal.nim similarity index 100% rename from tests/run/tglobal.nim rename to tests/global/tglobal.nim diff --git a/tests/compile/tglobalforvar.nim b/tests/global/tglobalforvar.nim similarity index 100% rename from tests/compile/tglobalforvar.nim rename to tests/global/tglobalforvar.nim diff --git a/tests/run/tnestif.nim b/tests/ifstmt/tnestif.nim similarity index 100% rename from tests/run/tnestif.nim rename to tests/ifstmt/tnestif.nim diff --git a/tests/compile/timplicititems.nim b/tests/implicit/timplicititems.nim similarity index 100% rename from tests/compile/timplicititems.nim rename to tests/implicit/timplicititems.nim diff --git a/tests/compile/timplictderef.nim b/tests/implicit/timplictderef.nim similarity index 100% rename from tests/compile/timplictderef.nim rename to tests/implicit/timplictderef.nim diff --git a/tests/run/tdrdobbs_examples.nim b/tests/important/tdrdobbs_examples.nim similarity index 100% rename from tests/run/tdrdobbs_examples.nim rename to tests/important/tdrdobbs_examples.nim diff --git a/tests/reject/tuninit1.nim b/tests/init/tuninit1.nim similarity index 100% rename from tests/reject/tuninit1.nim rename to tests/init/tuninit1.nim diff --git a/tests/run/tzeroarray.nim b/tests/init/tzeroarray.nim similarity index 100% rename from tests/run/tzeroarray.nim rename to tests/init/tzeroarray.nim diff --git a/tests/run/tcountup.nim b/tests/iter/tcountup.nim similarity index 100% rename from tests/run/tcountup.nim rename to tests/iter/tcountup.nim diff --git a/tests/compile/titer.nim b/tests/iter/titer.nim similarity index 100% rename from tests/compile/titer.nim rename to tests/iter/titer.nim diff --git a/tests/compile/titer2.nim b/tests/iter/titer2.nim similarity index 100% rename from tests/compile/titer2.nim rename to tests/iter/titer2.nim diff --git a/tests/run/titer3.nim b/tests/iter/titer3.nim similarity index 100% rename from tests/run/titer3.nim rename to tests/iter/titer3.nim diff --git a/tests/reject/titer4.nim b/tests/iter/titer4.nim similarity index 100% rename from tests/reject/titer4.nim rename to tests/iter/titer4.nim diff --git a/tests/run/titer5.nim b/tests/iter/titer5.nim similarity index 100% rename from tests/run/titer5.nim rename to tests/iter/titer5.nim diff --git a/tests/run/titer6.nim b/tests/iter/titer6.nim similarity index 100% rename from tests/run/titer6.nim rename to tests/iter/titer6.nim diff --git a/tests/run/titer7.nim b/tests/iter/titer7.nim similarity index 100% rename from tests/run/titer7.nim rename to tests/iter/titer7.nim diff --git a/tests/run/titer8.nim b/tests/iter/titer8.nim similarity index 100% rename from tests/run/titer8.nim rename to tests/iter/titer8.nim diff --git a/tests/run/titer9.nim b/tests/iter/titer9.nim similarity index 100% rename from tests/run/titer9.nim rename to tests/iter/titer9.nim diff --git a/tests/compile/titer_no_tuple_unpack.nim b/tests/iter/titer_no_tuple_unpack.nim similarity index 100% rename from tests/compile/titer_no_tuple_unpack.nim rename to tests/iter/titer_no_tuple_unpack.nim diff --git a/tests/compile/titerovl.nim b/tests/iter/titerovl.nim similarity index 100% rename from tests/compile/titerovl.nim rename to tests/iter/titerovl.nim diff --git a/tests/run/titerslice.nim b/tests/iter/titerslice.nim similarity index 100% rename from tests/run/titerslice.nim rename to tests/iter/titerslice.nim diff --git a/tests/run/titervaropenarray.nim b/tests/iter/titervaropenarray.nim similarity index 100% rename from tests/run/titervaropenarray.nim rename to tests/iter/titervaropenarray.nim diff --git a/tests/run/tmoditer.nim b/tests/iter/tmoditer.nim similarity index 100% rename from tests/run/tmoditer.nim rename to tests/iter/tmoditer.nim diff --git a/tests/reject/treciter.nim b/tests/iter/treciter.nim similarity index 100% rename from tests/reject/treciter.nim rename to tests/iter/treciter.nim diff --git a/tests/reject/twrongiter.nim b/tests/iter/twrongiter.nim similarity index 100% rename from tests/reject/twrongiter.nim rename to tests/iter/twrongiter.nim diff --git a/tests/reject/tlet.nim b/tests/let/tlet.nim similarity index 100% rename from tests/reject/tlet.nim rename to tests/let/tlet.nim diff --git a/tests/reject/tlet2.nim b/tests/let/tlet2.nim similarity index 100% rename from tests/reject/tlet2.nim rename to tests/let/tlet2.nim diff --git a/tests/run/thexlit.nim b/tests/lexer/thexlit.nim similarity index 100% rename from tests/run/thexlit.nim rename to tests/lexer/thexlit.nim diff --git a/tests/compile/thexrange.nim b/tests/lexer/thexrange.nim similarity index 100% rename from tests/compile/thexrange.nim rename to tests/lexer/thexrange.nim diff --git a/tests/compile/tident.nim b/tests/lexer/tident.nim similarity index 100% rename from tests/compile/tident.nim rename to tests/lexer/tident.nim diff --git a/tests/reject/tind1.nim b/tests/lexer/tind1.nim similarity index 100% rename from tests/reject/tind1.nim rename to tests/lexer/tind1.nim diff --git a/tests/run/tindent1.nim b/tests/lexer/tindent1.nim similarity index 100% rename from tests/run/tindent1.nim rename to tests/lexer/tindent1.nim diff --git a/tests/compile/tlexer.nim b/tests/lexer/tlexer.nim similarity index 100% rename from tests/compile/tlexer.nim rename to tests/lexer/tlexer.nim diff --git a/tests/reject/tmissingnl.nim b/tests/lexer/tmissingnl.nim similarity index 100% rename from tests/reject/tmissingnl.nim rename to tests/lexer/tmissingnl.nim diff --git a/tests/run/tstrlits.nim b/tests/lexer/tstrlits.nim similarity index 100% rename from tests/run/tstrlits.nim rename to tests/lexer/tstrlits.nim diff --git a/tests/reject/tunderscores.nim b/tests/lexer/tunderscores.nim similarity index 100% rename from tests/reject/tunderscores.nim rename to tests/lexer/tunderscores.nim diff --git a/tests/compile/tredef.nim b/tests/lookup/tredef.nim similarity index 100% rename from tests/compile/tredef.nim rename to tests/lookup/tredef.nim diff --git a/tests/run/tkoeniglookup.nim b/tests/lookups/tkoeniglookup.nim similarity index 100% rename from tests/run/tkoeniglookup.nim rename to tests/lookups/tkoeniglookup.nim diff --git a/tests/compile/tmacro1.nim b/tests/macro/tmacro1.nim similarity index 100% rename from tests/compile/tmacro1.nim rename to tests/macro/tmacro1.nim diff --git a/tests/run/tmacro2.nim b/tests/macro/tmacro2.nim similarity index 100% rename from tests/run/tmacro2.nim rename to tests/macro/tmacro2.nim diff --git a/tests/run/tmacro3.nim b/tests/macro/tmacro3.nim similarity index 100% rename from tests/run/tmacro3.nim rename to tests/macro/tmacro3.nim diff --git a/tests/run/tmacro4.nim b/tests/macro/tmacro4.nim similarity index 100% rename from tests/run/tmacro4.nim rename to tests/macro/tmacro4.nim diff --git a/tests/compile/tmacro2.nim b/tests/macro/tmacro5.nim similarity index 100% rename from tests/compile/tmacro2.nim rename to tests/macro/tmacro5.nim diff --git a/tests/compile/tmacroaspragma.nim b/tests/macro/tmacroaspragma.nim similarity index 100% rename from tests/compile/tmacroaspragma.nim rename to tests/macro/tmacroaspragma.nim diff --git a/tests/run/tmacrogenerics.nim b/tests/macro/tmacrogenerics.nim similarity index 100% rename from tests/run/tmacrogenerics.nim rename to tests/macro/tmacrogenerics.nim diff --git a/tests/run/tmacros1.nim b/tests/macro/tmacros1.nim similarity index 100% rename from tests/run/tmacros1.nim rename to tests/macro/tmacros1.nim diff --git a/tests/compile/tmacrostmt.nim b/tests/macro/tmacrostmt.nim similarity index 100% rename from tests/compile/tmacrostmt.nim rename to tests/macro/tmacrostmt.nim diff --git a/tests/compile/tmacrotypes.nim b/tests/macro/tmacrotypes.nim similarity index 100% rename from tests/compile/tmacrotypes.nim rename to tests/macro/tmacrotypes.nim diff --git a/tests/compile/tnimrodnode_for_runtime.nim b/tests/macro/tnimrodnode_for_runtime.nim similarity index 100% rename from tests/compile/tnimrodnode_for_runtime.nim rename to tests/macro/tnimrodnode_for_runtime.nim diff --git a/tests/run/tprintf.nim b/tests/macro/tprintf.nim similarity index 100% rename from tests/run/tprintf.nim rename to tests/macro/tprintf.nim diff --git a/tests/run/tquotewords.nim b/tests/macro/tquotewords.nim similarity index 100% rename from tests/run/tquotewords.nim rename to tests/macro/tquotewords.nim diff --git a/tests/reject/trecmacro.nim b/tests/macro/trecmacro.nim similarity index 100% rename from tests/reject/trecmacro.nim rename to tests/macro/trecmacro.nim diff --git a/tests/run/tstringinterp.nim b/tests/macro/tstringinterp.nim similarity index 100% rename from tests/run/tstringinterp.nim rename to tests/macro/tstringinterp.nim diff --git a/tests/run/tvtable.nim b/tests/macro/tvtable.nim similarity index 100% rename from tests/run/tvtable.nim rename to tests/macro/tvtable.nim diff --git a/tests/compile/tdumpast.nim b/tests/macros/tdumpast.nim similarity index 100% rename from tests/compile/tdumpast.nim rename to tests/macros/tdumpast.nim diff --git a/tests/compile/tdumpast2.nim b/tests/macros/tdumpast2.nim similarity index 100% rename from tests/compile/tdumpast2.nim rename to tests/macros/tdumpast2.nim diff --git a/tests/run/tdumptree.nim b/tests/macros/tdumptree.nim similarity index 100% rename from tests/run/tdumptree.nim rename to tests/macros/tdumptree.nim diff --git a/tests/run/tidgen.nim b/tests/macros/tidgen.nim similarity index 100% rename from tests/run/tidgen.nim rename to tests/macros/tidgen.nim diff --git a/tests/run/tlowhigh.nim b/tests/magics/tlowhigh.nim similarity index 100% rename from tests/run/tlowhigh.nim rename to tests/magics/tlowhigh.nim diff --git a/tests/run/tmatrix.nim b/tests/matrix/tmatrix.nim similarity index 100% rename from tests/run/tmatrix.nim rename to tests/matrix/tmatrix.nim diff --git a/tests/compile/tmatrix1.nim b/tests/matrix/tmatrix1.nim similarity index 100% rename from tests/compile/tmatrix1.nim rename to tests/matrix/tmatrix1.nim diff --git a/tests/compile/tmatrix2.nim b/tests/matrix/tmatrix2.nim similarity index 100% rename from tests/compile/tmatrix2.nim rename to tests/matrix/tmatrix2.nim diff --git a/tests/compile/tbindtypedesc.nim b/tests/metatype/tbindtypedesc.nim similarity index 100% rename from tests/compile/tbindtypedesc.nim rename to tests/metatype/tbindtypedesc.nim diff --git a/tests/compile/tcompositetypeclasses.nim b/tests/metatype/tcompositetypeclasses.nim similarity index 100% rename from tests/compile/tcompositetypeclasses.nim rename to tests/metatype/tcompositetypeclasses.nim diff --git a/tests/compile/tconstraints.nim b/tests/metatype/tconstraints.nim similarity index 100% rename from tests/compile/tconstraints.nim rename to tests/metatype/tconstraints.nim diff --git a/tests/run/tsemistatic.nim b/tests/metatype/tsemistatic.nim similarity index 100% rename from tests/run/tsemistatic.nim rename to tests/metatype/tsemistatic.nim diff --git a/tests/metatype/ttypebar.nim b/tests/metatype/ttypebar.nim new file mode 100644 index 0000000000..304dfffcb3 --- /dev/null +++ b/tests/metatype/ttypebar.nim @@ -0,0 +1,14 @@ + +# bug #602 + +type + TTest = object + TTest2* = object + TFoo = TTest | TTest2 + +proc f(src: ptr TFoo, dst: ptr TFoo) = + echo("asd") + +var x: TTest +f(addr x, addr x) + diff --git a/tests/compile/ttypeclasses.nim b/tests/metatype/ttypeclasses.nim similarity index 100% rename from tests/compile/ttypeclasses.nim rename to tests/metatype/ttypeclasses.nim diff --git a/tests/run/ttypedesc1.nim b/tests/metatype/ttypedesc1.nim similarity index 100% rename from tests/run/ttypedesc1.nim rename to tests/metatype/ttypedesc1.nim diff --git a/tests/compile/ttypeselectors.nim b/tests/metatype/ttypeselectors.nim similarity index 100% rename from tests/compile/ttypeselectors.nim rename to tests/metatype/ttypeselectors.nim diff --git a/tests/run/ttypetraits.nim b/tests/metatype/ttypetraits.nim similarity index 100% rename from tests/run/ttypetraits.nim rename to tests/metatype/ttypetraits.nim diff --git a/tests/run/tusertypeclasses.nim b/tests/metatype/tusertypeclasses.nim similarity index 100% rename from tests/run/tusertypeclasses.nim rename to tests/metatype/tusertypeclasses.nim diff --git a/tests/run/utypeclasses.nim b/tests/metatype/utypeclasses.nim similarity index 100% rename from tests/run/utypeclasses.nim rename to tests/metatype/utypeclasses.nim diff --git a/tests/run/mmultim3.nim b/tests/method/mmultim3.nim similarity index 100% rename from tests/run/mmultim3.nim rename to tests/method/mmultim3.nim diff --git a/tests/reject/tmethod.nim b/tests/method/tmethod.nim similarity index 100% rename from tests/reject/tmethod.nim rename to tests/method/tmethod.nim diff --git a/tests/run/tmethods1.nim b/tests/method/tmethods1.nim similarity index 100% rename from tests/run/tmethods1.nim rename to tests/method/tmethods1.nim diff --git a/tests/run/tmultim1.nim b/tests/method/tmultim1.nim similarity index 100% rename from tests/run/tmultim1.nim rename to tests/method/tmultim1.nim diff --git a/tests/run/tmultim2.nim b/tests/method/tmultim2.nim similarity index 100% rename from tests/run/tmultim2.nim rename to tests/method/tmultim2.nim diff --git a/tests/run/tmultim3.nim b/tests/method/tmultim3.nim similarity index 100% rename from tests/run/tmultim3.nim rename to tests/method/tmultim3.nim diff --git a/tests/run/tmultim4.nim b/tests/method/tmultim4.nim similarity index 100% rename from tests/run/tmultim4.nim rename to tests/method/tmultim4.nim diff --git a/tests/run/tmultim6.nim b/tests/method/tmultim6.nim similarity index 100% rename from tests/run/tmultim6.nim rename to tests/method/tmultim6.nim diff --git a/tests/run/tsimmeth.nim b/tests/method/tsimmeth.nim similarity index 100% rename from tests/run/tsimmeth.nim rename to tests/method/tsimmeth.nim diff --git a/tests/reject/mopaque.nim b/tests/module/mopaque.nim similarity index 100% rename from tests/reject/mopaque.nim rename to tests/module/mopaque.nim diff --git a/tests/compile/mrecmod.nim b/tests/module/mrecmod.nim similarity index 100% rename from tests/compile/mrecmod.nim rename to tests/module/mrecmod.nim diff --git a/tests/compile/mrecmod2.nim b/tests/module/mrecmod2.nim similarity index 100% rename from tests/compile/mrecmod2.nim rename to tests/module/mrecmod2.nim diff --git a/tests/reject/topaque.nim b/tests/module/topaque.nim similarity index 100% rename from tests/reject/topaque.nim rename to tests/module/topaque.nim diff --git a/tests/reject/trecinca.nim b/tests/module/trecinca.nim similarity index 100% rename from tests/reject/trecinca.nim rename to tests/module/trecinca.nim diff --git a/tests/reject/trecincb.nim b/tests/module/trecincb.nim similarity index 100% rename from tests/reject/trecincb.nim rename to tests/module/trecincb.nim diff --git a/tests/compile/trecmod.nim b/tests/module/trecmod.nim similarity index 100% rename from tests/compile/trecmod.nim rename to tests/module/trecmod.nim diff --git a/tests/compile/trecmod2.nim b/tests/module/trecmod2.nim similarity index 100% rename from tests/compile/trecmod2.nim rename to tests/module/trecmod2.nim diff --git a/tests/compile/mexporta.nim b/tests/modules/mexporta.nim similarity index 100% rename from tests/compile/mexporta.nim rename to tests/modules/mexporta.nim diff --git a/tests/compile/mexportb.nim b/tests/modules/mexportb.nim similarity index 100% rename from tests/compile/mexportb.nim rename to tests/modules/mexportb.nim diff --git a/tests/compile/texport.nim b/tests/modules/texport.nim similarity index 100% rename from tests/compile/texport.nim rename to tests/modules/texport.nim diff --git a/tests/reject/timportexcept.nim b/tests/modules/timportexcept.nim similarity index 100% rename from tests/reject/timportexcept.nim rename to tests/modules/timportexcept.nim diff --git a/tests/reject/tnamedparams.nim b/tests/namedparams/tnamedparams.nim similarity index 100% rename from tests/reject/tnamedparams.nim rename to tests/namedparams/tnamedparams.nim diff --git a/tests/compile/tnamedparams.nim b/tests/namedparams/tnamedparams2.nim similarity index 100% rename from tests/compile/tnamedparams.nim rename to tests/namedparams/tnamedparams2.nim diff --git a/tests/reject/mnamspc1.nim b/tests/namspc/mnamspc1.nim similarity index 100% rename from tests/reject/mnamspc1.nim rename to tests/namspc/mnamspc1.nim diff --git a/tests/reject/mnamspc2.nim b/tests/namspc/mnamspc2.nim similarity index 100% rename from tests/reject/mnamspc2.nim rename to tests/namspc/mnamspc2.nim diff --git a/tests/reject/tnamspc.nim b/tests/namspc/tnamspc.nim similarity index 100% rename from tests/reject/tnamspc.nim rename to tests/namspc/tnamspc.nim diff --git a/tests/reject/tnotnil.nim b/tests/notnil/tnotnil.nim similarity index 100% rename from tests/reject/tnotnil.nim rename to tests/notnil/tnotnil.nim diff --git a/tests/reject/tnotnil1.nim b/tests/notnil/tnotnil1.nim similarity index 100% rename from tests/reject/tnotnil1.nim rename to tests/notnil/tnotnil1.nim diff --git a/tests/reject/tnotnil2.nim b/tests/notnil/tnotnil2.nim similarity index 100% rename from tests/reject/tnotnil2.nim rename to tests/notnil/tnotnil2.nim diff --git a/tests/run/tobjconstr.nim b/tests/object/tobjconstr.nim similarity index 100% rename from tests/run/tobjconstr.nim rename to tests/object/tobjconstr.nim diff --git a/tests/compile/tobjconstr2.nim b/tests/object/tobjconstr2.nim similarity index 100% rename from tests/compile/tobjconstr2.nim rename to tests/object/tobjconstr2.nim diff --git a/tests/compile/tobjcov.nim b/tests/object/tobjcov.nim similarity index 100% rename from tests/compile/tobjcov.nim rename to tests/object/tobjcov.nim diff --git a/tests/run/tobject.nim b/tests/object/tobject.nim similarity index 100% rename from tests/run/tobject.nim rename to tests/object/tobject.nim diff --git a/tests/compile/tobject2.nim b/tests/object/tobject2.nim similarity index 100% rename from tests/compile/tobject2.nim rename to tests/object/tobject2.nim diff --git a/tests/compile/tobject3.nim b/tests/object/tobject3.nim similarity index 100% rename from tests/compile/tobject3.nim rename to tests/object/tobject3.nim diff --git a/tests/compile/toop.nim b/tests/object/toop.nim similarity index 100% rename from tests/compile/toop.nim rename to tests/object/toop.nim diff --git a/tests/run/toop1.nim b/tests/object/toop1.nim similarity index 100% rename from tests/run/toop1.nim rename to tests/object/toop1.nim diff --git a/tests/compile/tobjects.nim b/tests/objects/tobjects.nim similarity index 100% rename from tests/compile/tobjects.nim rename to tests/objects/tobjects.nim diff --git a/tests/reject/tadrdisc.nim b/tests/objvariant/tadrdisc.nim similarity index 100% rename from tests/reject/tadrdisc.nim rename to tests/objvariant/tadrdisc.nim diff --git a/tests/reject/tcheckedfield1.nim b/tests/objvariant/tcheckedfield1.nim similarity index 100% rename from tests/reject/tcheckedfield1.nim rename to tests/objvariant/tcheckedfield1.nim diff --git a/tests/reject/temptycaseobj.nim b/tests/objvariant/temptycaseobj.nim similarity index 100% rename from tests/reject/temptycaseobj.nim rename to tests/objvariant/temptycaseobj.nim diff --git a/tests/run/tvariantstack.nim b/tests/objvariant/tvariantstack.nim similarity index 100% rename from tests/run/tvariantstack.nim rename to tests/objvariant/tvariantstack.nim diff --git a/tests/reject/topena1.nim b/tests/openarray/topena1.nim similarity index 100% rename from tests/reject/topena1.nim rename to tests/openarray/topena1.nim diff --git a/tests/run/topenarrayrepr.nim b/tests/openarray/topenarrayrepr.nim similarity index 100% rename from tests/run/topenarrayrepr.nim rename to tests/openarray/topenarrayrepr.nim diff --git a/tests/run/topenlen.nim b/tests/openarray/topenlen.nim similarity index 100% rename from tests/run/topenlen.nim rename to tests/openarray/topenlen.nim diff --git a/tests/run/tofopr.nim b/tests/operator/tofopr.nim similarity index 100% rename from tests/run/tofopr.nim rename to tests/operator/tofopr.nim diff --git a/tests/run/toprprec.nim b/tests/operator/toprprec.nim similarity index 100% rename from tests/run/toprprec.nim rename to tests/operator/toprprec.nim diff --git a/tests/run/tprecedence.nim b/tests/operator/tprecedence.nim similarity index 100% rename from tests/run/tprecedence.nim rename to tests/operator/tprecedence.nim diff --git a/tests/run/toverflw.nim b/tests/overflw/toverflw.nim similarity index 100% rename from tests/run/toverflw.nim rename to tests/overflw/toverflw.nim diff --git a/tests/run/toverflw2.nim b/tests/overflw/toverflw2.nim similarity index 100% rename from tests/run/toverflw2.nim rename to tests/overflw/toverflw2.nim diff --git a/tests/run/tovfint.nim b/tests/overflw/tovfint.nim similarity index 100% rename from tests/run/tovfint.nim rename to tests/overflw/tovfint.nim diff --git a/tests/reject/toverl.nim b/tests/overload/toverl.nim similarity index 100% rename from tests/reject/toverl.nim rename to tests/overload/toverl.nim diff --git a/tests/run/toverl2.nim b/tests/overload/toverl2.nim similarity index 100% rename from tests/run/toverl2.nim rename to tests/overload/toverl2.nim diff --git a/tests/run/toverl3.nim b/tests/overload/toverl3.nim similarity index 100% rename from tests/run/toverl3.nim rename to tests/overload/toverl3.nim diff --git a/tests/compile/toverprc.nim b/tests/overload/toverprc.nim similarity index 100% rename from tests/compile/toverprc.nim rename to tests/overload/toverprc.nim diff --git a/tests/run/toverwr.nim b/tests/overload/toverwr.nim similarity index 100% rename from tests/run/toverwr.nim rename to tests/overload/toverwr.nim diff --git a/tests/run/tpatterns.nim b/tests/pattern/tpatterns.nim similarity index 100% rename from tests/run/tpatterns.nim rename to tests/pattern/tpatterns.nim diff --git a/tests/compile/tuserpragma.nim b/tests/pragma/tuserpragma.nim similarity index 100% rename from tests/compile/tuserpragma.nim rename to tests/pragma/tuserpragma.nim diff --git a/tests/compile/tpush.nim b/tests/pragmas/tpush.nim similarity index 100% rename from tests/compile/tpush.nim rename to tests/pragmas/tpush.nim diff --git a/tests/run/tnestprc.nim b/tests/proc/tnestprc.nim similarity index 100% rename from tests/run/tnestprc.nim rename to tests/proc/tnestprc.nim diff --git a/tests/reject/tprocredef.nim b/tests/proc/tprocredef.nim similarity index 100% rename from tests/reject/tprocredef.nim rename to tests/proc/tprocredef.nim diff --git a/tests/compile/tgenericprocvar.nim b/tests/procvar/tgenericprocvar.nim similarity index 100% rename from tests/compile/tgenericprocvar.nim rename to tests/procvar/tgenericprocvar.nim diff --git a/tests/reject/tprocvar.nim b/tests/procvar/tprocvar.nim similarity index 100% rename from tests/reject/tprocvar.nim rename to tests/procvar/tprocvar.nim diff --git a/tests/run/tprocvar.nim b/tests/procvar/tprocvar2.nim similarity index 100% rename from tests/run/tprocvar.nim rename to tests/procvar/tprocvar2.nim diff --git a/tests/compile/tprocvars.nim b/tests/procvar/tprocvars.nim similarity index 100% rename from tests/compile/tprocvars.nim rename to tests/procvar/tprocvars.nim diff --git a/tests/compile/compilehelpers.nim b/tests/range/compilehelpers.nim similarity index 100% rename from tests/compile/compilehelpers.nim rename to tests/range/compilehelpers.nim diff --git a/tests/run/tbug499771.nim b/tests/range/tbug499771.nim similarity index 100% rename from tests/run/tbug499771.nim rename to tests/range/tbug499771.nim diff --git a/tests/compile/tcolors.nim b/tests/range/tcolors.nim similarity index 100% rename from tests/compile/tcolors.nim rename to tests/range/tcolors.nim diff --git a/tests/compile/tmatrix3.nim b/tests/range/tmatrix3.nim similarity index 100% rename from tests/compile/tmatrix3.nim rename to tests/range/tmatrix3.nim diff --git a/tests/reject/tsubrange.nim b/tests/range/tsubrange.nim similarity index 100% rename from tests/reject/tsubrange.nim rename to tests/range/tsubrange.nim diff --git a/tests/run/tsubrange2.nim b/tests/range/tsubrange2.nim similarity index 100% rename from tests/run/tsubrange2.nim rename to tests/range/tsubrange2.nim diff --git a/tests/run/tsubrange.nim b/tests/range/tsubrange3.nim similarity index 100% rename from tests/run/tsubrange.nim rename to tests/range/tsubrange3.nim diff --git a/tests/reject/99bottles.nim b/tests/reject/99bottles.nim deleted file mode 100644 index 14904ac0fb..0000000000 --- a/tests/reject/99bottles.nim +++ /dev/null @@ -1 +0,0 @@ -# Test if the compiler detects invalid module names diff --git a/tests/reject/t99bott.nim b/tests/reject/t99bott.nim deleted file mode 100644 index d18cb0d5c7..0000000000 --- a/tests/reject/t99bott.nim +++ /dev/null @@ -1,36 +0,0 @@ -discard """ - file: "t99bott.nim" - line: 26 - errormsg: "cannot evaluate at compile time: bn" - disabled: false -""" -## 99 Bottles of Beer -## http://www.99-bottles-of-beer.net/ -## Nimrod version - -## Author: Philippe Lhoste <PhiLho(a)GMX.net> http://Phi.Lho.free.fr -# 2012-11-25 -# Loosely based on my old Lua version... Updated to current official lyrics. - -proc GetBottleNumber(n: int): string = - var bs: string - if n == 0: - bs = "No more bottles" - elif n == 1: - bs = "1 bottle" - else: - bs = $n & " bottles" - return bs & " of beer" - -for bn in countdown(99, 1): - const cur = GetBottleNumber(bn) - echo(cur, " on the wall, ", cur, ".") - echo("Take one down and pass it around, ", GetBottleNumber(bn-1), - " on the wall.\n") - -echo "No more bottles of beer on the wall, no more bottles of beer." -echo "Go to the store and buy some more, 99 bottles of beer on the wall." - - - - diff --git a/tests/reject/tatomic.nim b/tests/reject/tatomic.nim deleted file mode 100644 index 1fa0cff8d0..0000000000 --- a/tests/reject/tatomic.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "tatomic.nim" - line: 7 - errormsg: "identifier expected, but found 'keyword atomic'" -""" -var - atomic: int - -echo atomic - - - diff --git a/tests/reject/tgenconstraints.nim b/tests/reject/tgenconstraints.nim deleted file mode 100644 index e32aa877b3..0000000000 --- a/tests/reject/tgenconstraints.nim +++ /dev/null @@ -1,30 +0,0 @@ -discard """ - file: "tgenconstraints.nim" - line: 25 - errormsg: "cannot instantiate T2" -""" - -type - T1[T: int|string] = object - x: T - - T2[T: Ordinal] = object - x: T - -var x1: T1[int] -var x2: T1[string] -var x3: T2[int] - -proc foo[T](x: T): T2[T] {.discardable.} = - var o: T1[T] - -foo(10) - -proc bar(x: string|TNumber): T1[type(x)] {.discardable.} = - when type(x) is TNumber: - var o: T2[type(x)] - -bar "test" -bar 100 -bar 1.1 - diff --git a/tests/reject/tinc.nim b/tests/reject/tinc.nim deleted file mode 100644 index 8038a2a01b..0000000000 --- a/tests/reject/tinc.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "tinc.nim" - line: 8 - errormsg: "for a \'var\' type a variable needs to be passed" -""" -var x = 0 - -inc(x+1) - - - - diff --git a/tests/reject/tinout.nim b/tests/reject/tinout.nim deleted file mode 100644 index 034c496f5b..0000000000 --- a/tests/reject/tinout.nim +++ /dev/null @@ -1,16 +0,0 @@ -discard """ - file: "tinout.nim" - line: 12 - errormsg: "for a \'var\' type a variable needs to be passed" -""" -# Test in out checking for parameters - -proc abc(x: var int) = - x = 0 - -proc b() = - abc(3) #ERROR - -b() - - diff --git a/tests/reject/tinvalidarrayaccess.nim b/tests/reject/tinvalidarrayaccess.nim deleted file mode 100644 index 03105b41b9..0000000000 --- a/tests/reject/tinvalidarrayaccess.nim +++ /dev/null @@ -1,14 +0,0 @@ -discard """ - errormsg: "index out of bounds" - line: 11 -""" - - -type TTestArr = array[0..1, int16] -var f: TTestArr -f[0] = 30 -f[1] = 40 -f[2] = 50 -f[3] = 60 - -echo(repr(f)) diff --git a/tests/reject/tinvalidnewseq.nim b/tests/reject/tinvalidnewseq.nim deleted file mode 100644 index 957a255604..0000000000 --- a/tests/reject/tinvalidnewseq.nim +++ /dev/null @@ -1,27 +0,0 @@ -discard """ - file: "tinvalidnewseq.nim" - line: 15 - errormsg: "type mismatch: got (array[0..6, string], int literal(7))" -""" -import re, strutils - -type - TURL = tuple[protocol, subdomain, domain, port: string, path: seq[string]] - -proc parseURL(url: string): TURL = - #([a-zA-Z]+://)?(\w+?\.)?(\w+)(\.\w+)(:[0-9]+)?(/.+)? - var pattern: string = r"([a-zA-Z]+://)?(\w+?\.)?(\w+)(\.\w+)(:[0-9]+)?(/.+)?" - var m: array[0..6, string] #Array with the matches - newSeq(m, 7) #ERROR - discard regexprs.match(url, re(pattern), m) - - result = (protocol: m[1], subdomain: m[2], domain: m[3] & m[4], - port: m[5], path: m[6].split('/')) - -var r: TUrl - -r = parseUrl(r"http://google.com/search?var=bleahdhsad") -echo(r.domain) - - - diff --git a/tests/reject/tinvwhen.nim b/tests/reject/tinvwhen.nim deleted file mode 100644 index ea8a7ddf0e..0000000000 --- a/tests/reject/tinvwhen.nim +++ /dev/null @@ -1,15 +0,0 @@ -discard """ - file: "tinvwhen.nim" - line: 11 - errormsg: "invalid indentation" -""" -# This was parsed even though it should not! - -proc chdir(path: CString): cint {.importc: "chdir", header: "dirHeader".} - -proc getcwd(buf: CString, buflen: cint): CString - when defined(unix): {.importc: "getcwd", header: "<unistd.h>".} #ERROR_MSG invalid indentation - elif defined(windows): {.importc: "getcwd", header: "<direct.h>"} - else: {.error: "os library not ported to your OS. Please help!".} - - diff --git a/tests/reject/tnoinst.nim b/tests/reject/tnoinst.nim deleted file mode 100644 index 23a4145e00..0000000000 --- a/tests/reject/tnoinst.nim +++ /dev/null @@ -1,16 +0,0 @@ -discard """ - line: 12 - errormsg: "instantiate 'notConcrete' explicitely" -""" - -proc wrap[T]() = - proc notConcrete[T](x, y: int): int = - var dummy: T - result = x - y - - var x: proc (x, y: T): int - x = notConcrete - - -wrap[int]() - diff --git a/tests/reject/tnolen.nim b/tests/reject/tnolen.nim deleted file mode 100644 index e330865366..0000000000 --- a/tests/reject/tnolen.nim +++ /dev/null @@ -1,9 +0,0 @@ -discard """ - line: 8 - msg: "type mismatch: got (int literal(3))" -""" - -# please finally disallow Len(3) - -echo len(3) - diff --git a/tests/reject/tnoop.nim b/tests/reject/tnoop.nim deleted file mode 100644 index c79403e113..0000000000 --- a/tests/reject/tnoop.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "tnoop.nim" - line: 11 - errormsg: "expression \'a()\' cannot be called" -""" -# Tests the new check in the semantic pass - -var - a: int - -a() #ERROR_MSG expression 'a()' cannot be called - diff --git a/tests/reject/tnot.nim b/tests/reject/tnot.nim deleted file mode 100644 index cd0f538e62..0000000000 --- a/tests/reject/tnot.nim +++ /dev/null @@ -1,22 +0,0 @@ -discard """ - file: "tnot.nim" - line: 14 - errormsg: "type mismatch" -""" -# BUG: following compiles, but should not: - -proc nodeOfDegree(x: Int): bool = - result = false - -proc main = - for j in 0..2: - for i in 0..10: - if not nodeOfDegree(1) >= 0: #ERROR_MSG type mismatch - Echo "Yes" - else: - Echo "No" - -main() - - - diff --git a/tests/reject/trawstr.nim b/tests/reject/trawstr.nim deleted file mode 100644 index ab2aae1593..0000000000 --- a/tests/reject/trawstr.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "trawstr.nim" - line: 10 - errormsg: "closing \" expected" -""" -# Test the new raw strings: - -const - xxx = r"This is a raw string!" - yyy = "This not\" #ERROR - - diff --git a/tests/reject/tsimtych.nim b/tests/reject/tsimtych.nim deleted file mode 100644 index dd969958c5..0000000000 --- a/tests/reject/tsimtych.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "tsimtych.nim" - line: 10 - errormsg: "type mismatch: got (bool) but expected \'string\'" -""" -# Test 2 -# Simple type checking - -var a: string -a = false #ERROR - - diff --git a/tests/run/globalaux.nim b/tests/run/globalaux.nim deleted file mode 100644 index 5f6f727210..0000000000 --- a/tests/run/globalaux.nim +++ /dev/null @@ -1,15 +0,0 @@ -type - TObj*[T] = object - val*: T - -var - totalGlobals* = 0 - -proc makeObj[T](x: T): TObj[T] = - totalGlobals += 1 - result.val = x - -proc globalInstance*[T]: var TObj[T] = - var g {.global.} = when T is int: makeObj(10) else: makeObj("hello") - result = g - diff --git a/tests/run/globalaux2.nim b/tests/run/globalaux2.nim deleted file mode 100644 index 6c77f1f485..0000000000 --- a/tests/run/globalaux2.nim +++ /dev/null @@ -1,4 +0,0 @@ -import globalaux - -echo "in globalaux2: ", globalInstance[int]().val - diff --git a/tests/run/minit.nim b/tests/run/minit.nim deleted file mode 100644 index 75fcebb77e..0000000000 --- a/tests/run/minit.nim +++ /dev/null @@ -1,2 +0,0 @@ -# Test the new initialization for modules -write(stdout, "Hello from module! ") diff --git a/tests/run/tack.nim b/tests/run/tack.nim deleted file mode 100644 index 680ff567e7..0000000000 --- a/tests/run/tack.nim +++ /dev/null @@ -1,21 +0,0 @@ -discard """ - file: "tack.nim" - output: "125" -""" -# the Ackermann function - -proc ack(x, y: int): int = - if x != 0: - if y != 0: - return ack(x-1, ack(x, y-1)) - return ack(x-1, 1) - else: - return y + 1 -# if x == 0: return y + 1 -# elif y == 0: return ack(x-1, 1) -# else: return ack(x-1, ack(x, y-1)) - -# echo(ack(0, 0)) -write(stdout, ack(3, 4)) #OUT 125 - - diff --git a/tests/run/tbug511622.nim b/tests/run/tbug511622.nim deleted file mode 100644 index a5360423dc..0000000000 --- a/tests/run/tbug511622.nim +++ /dev/null @@ -1,16 +0,0 @@ -discard """ - file: "tbug511622.nim" - output: "3" -""" -import StrUtils, Math - -proc FibonacciA(n: int): int64 = - var fn = float64(n) - var p: float64 = (1.0 + sqrt(5.0)) / 2.0 - var q: float64 = 1.0 / p - return int64((pow(p, fn) + pow(q, fn)) / sqrt(5.0)) - -echo FibonacciA(4) #OUT 3 - - - diff --git a/tests/run/tdomulttest.nim b/tests/run/tdomulttest.nim deleted file mode 100644 index 4ee6de128e..0000000000 --- a/tests/run/tdomulttest.nim +++ /dev/null @@ -1,17 +0,0 @@ -discard """ - file: "tdomulttest.nim" - output: "555\ntest\nmulti lines\n99999999\nend" - disabled: true -""" -proc foo(bar, baz: proc (x: int): int) = - echo bar(555) - echo baz(99999999) - -foo do (x: int) -> int: - return x -do (x: int) -> int: - echo("test") - echo("multi lines") - return x - -echo("end") \ No newline at end of file diff --git a/tests/run/temit.nim b/tests/run/temit.nim deleted file mode 100644 index ff8df0585a..0000000000 --- a/tests/run/temit.nim +++ /dev/null @@ -1,20 +0,0 @@ -discard """ - file: "temit.nim" - output: "509" -""" -# Test the new ``emit`` pragma: - -{.emit: """ -static int cvariable = 420; - -""".} - -proc embedsC() = - var nimrodVar = 89 - {.emit: """printf("%d\n", cvariable + (int)`nimrodVar`);""".} - -embedsC() - - - - diff --git a/tests/run/teventemitter.nim b/tests/run/teventemitter.nim deleted file mode 100644 index 9ecf72ea2b..0000000000 --- a/tests/run/teventemitter.nim +++ /dev/null @@ -1,33 +0,0 @@ -discard """ - output: "pie" -""" - -import tables, lists - -type - TEventArgs = object of TObject - TEventEmitter = object of TObject - events*: TTable[string, TDoublyLinkedList[proc(e: TEventArgs) {.nimcall.}]] - -proc emit*(emitter: TEventEmitter, event: string, args: TEventArgs) = - for func in nodes(emitter.events[event]): - func.value(args) #call function with args. - -proc on*(emitter: var TEventEmitter, event: string, - func: proc(e: TEventArgs) {.nimcall.}) = - if not hasKey(emitter.events, event): - var list: TDoublyLinkedList[proc(e: TEventArgs) {.nimcall.}] - add(emitter.events, event, list) #if not, add it. - append(emitter.events.mget(event), func) - -proc initEmitter(emitter: var TEventEmitter) = - emitter.events = initTable[string, - TDoublyLinkedList[proc(e: TEventArgs) {.nimcall.}]]() - -var - ee: TEventEmitter - args: TEventArgs -initEmitter(ee) -ee.on("print", proc(e: TEventArgs) = echo("pie")) -ee.emit("print", args) - diff --git a/tests/run/tevents.nim b/tests/run/tevents.nim deleted file mode 100644 index fb94b1f79a..0000000000 --- a/tests/run/tevents.nim +++ /dev/null @@ -1,48 +0,0 @@ -discard """ -file: "tevents.nim" -output: '''HandlePrintEvent: Output -> Handled print event -HandlePrintEvent2: Output -> printing for ME -HandlePrintEvent2: Output -> printing for ME''' -""" - -import events - -type - TPrintEventArgs = object of TEventArgs - user*: string - -proc handleprintevent*(e: TEventArgs) = - write(stdout, "HandlePrintEvent: Output -> Handled print event\n") - -proc handleprintevent2*(e: TEventArgs) = - var args: TPrintEventArgs = TPrintEventArgs(e) - write(stdout, "HandlePrintEvent2: Output -> printing for " & args.user) - -var ee = initEventEmitter() - -var eventargs: TPrintEventArgs -eventargs.user = "ME\n" - -##method one test - -ee.on("print", handleprintevent) -ee.on("print", handleprintevent2) - -ee.emit("print", eventargs) - -##method two test - -type - TSomeObject = object of TObject - PrintEvent: TEventHandler - -var obj: TSomeObject -obj.PrintEvent = initEventHandler("print") -obj.PrintEvent.addHandler(handleprintevent2) - -ee.emit(obj.PrintEvent, eventargs) - -obj.PrintEvent.removeHandler(handleprintevent2) - -ee.emit(obj.PrintEvent, eventargs) - diff --git a/tests/run/tfilter.nim b/tests/run/tfilter.nim deleted file mode 100644 index 5846d0efb3..0000000000 --- a/tests/run/tfilter.nim +++ /dev/null @@ -1,41 +0,0 @@ -discard """ - output: "02468101214161820\n15" -""" - -proc filter[T](list: seq[T], f: proc (item: T): bool {.closure.}): seq[T] = - result = @[] - for i in items(list): - if f(i): - result.add(i) - -let nums = @[0, 1, 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] - -when true: - let nums2 = filter(nums, - (proc (item: int): bool = - result = (item mod 2) == 0) - ) - -proc outer = - # lets use a proper closure this time: - var modulo = 2 - let nums2 = filter(nums, - (proc (item: int): bool = result = (item mod modulo) == 0) - ) - - for n in nums2: stdout.write(n) - stdout.write("\n") - -outer() - -import math -proc compose[T](f1, f2: proc (x: T): T {.closure.}): proc (x: T): T {.closure.} = - result = (proc (x: T): T = - result = f1(f2(x))) - - -proc add5(x: int): int = result = x + 5 - -var test = compose(add5, add5) -echo test(5) - diff --git a/tests/run/thintoff.nim b/tests/run/thintoff.nim deleted file mode 100644 index 807ff44f38..0000000000 --- a/tests/run/thintoff.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "thintoff.nim" - output: "0" -""" - -{.hint[XDeclaredButNotUsed]: off.} -var - x: int - -echo x #OUT 0 - - diff --git a/tests/run/tinit.nim b/tests/run/tinit.nim deleted file mode 100644 index 5c75567ece..0000000000 --- a/tests/run/tinit.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "tinit.nim" - output: "Hello from module! Hello from main module!" -""" -# Test the new init section in modules - -import minit - -write(stdout, "Hello from main module!\n") -#OUT Hello from module! Hello from main module! - - diff --git a/tests/run/tints.nim b/tests/run/tints.nim deleted file mode 100644 index fb2852af9c..0000000000 --- a/tests/run/tints.nim +++ /dev/null @@ -1,45 +0,0 @@ -discard """ - file: "tints.nim" - output: "Success" -""" -# Test the different integer operations - -var testNumber = 0 - -template test(opr, a, b, c: expr): stmt {.immediate.} = - # test the expression at compile and runtime - block: - const constExpr = opr(a, b) - when constExpr != c: - {.error: "Test failed " & $constExpr & " " & $c.} - inc(testNumber) - #Echo("Test: " & $testNumber) - var aa = a - var bb = b - var varExpr = opr(aa, bb) - assert(varExpr == c) - -test(`+`, 12'i8, -13'i16, -1'i16) -test(`shl`, 0b11, 0b100, 0b110000) -test(`shl`, 0b11'i32, 0b100'i64, 0b110000'i64) -test(`shl`, 0b11'i32, 0b100'i32, 0b110000'i32) - -test(`or`, 0xf0f0'i16, 0x0d0d'i16, 0xfdfd'i16) -test(`and`, 0xf0f0'i16, 0xfdfd'i16, 0xf0f0'i16) - -test(`shr`, 0xffffffffffffffff'i64, 0x4'i64, 0x0fffffffffffffff'i64) -test(`shr`, 0xffff'i16, 0x4'i16, 0x0fff'i16) -test(`shr`, 0xff'i8, 0x4'i8, 0x0f'i8) - -test(`shr`, 0xffffffff'i64, 0x4'i64, 0x0fffffff'i64) -test(`shr`, 0xffffffff'i32, 0x4'i32, 0x0fffffff'i32) - -test(`shl`, 0xffffffffffffffff'i64, 0x4'i64, 0xfffffffffffffff0'i64) -test(`shl`, 0xffff'i16, 0x4'i16, 0xfff0'i16) -test(`shl`, 0xff'i8, 0x4'i8, 0xf0'i8) - -test(`shl`, 0xffffffff'i64, 0x4'i64, 0xffffffff0'i64) -test(`shl`, 0xffffffff'i32, 0x4'i32, 0xfffffff0'i32) - -Echo("Success") #OUT Success - diff --git a/tests/run/tlocals.nim b/tests/run/tlocals.nim deleted file mode 100644 index 94a34139ba..0000000000 --- a/tests/run/tlocals.nim +++ /dev/null @@ -1,11 +0,0 @@ -discard """ - output: "(x: string here, a: 1, b: 3)" -""" - -proc simple[T](a, b: T) = - var - x = "string here" - echo locals() - -simple(1, 3) - diff --git a/tests/run/tmemoization.nim b/tests/run/tmemoization.nim deleted file mode 100644 index 180acd89b6..0000000000 --- a/tests/run/tmemoization.nim +++ /dev/null @@ -1,17 +0,0 @@ -discard """ - msg: "test 1\ntest 2\ntest 3" - output: "TEST 1\nTEST 2\nTEST 3" -""" - -import strutils - -proc foo(s: static[string]): string = - static: echo s - - const R = s.toUpper - return R - -echo foo("test 1") -echo foo("test 2") -echo foo("test " & $3) - diff --git a/tests/run/tnewderef.nim b/tests/run/tnewderef.nim deleted file mode 100644 index 89dc4c8d16..0000000000 --- a/tests/run/tnewderef.nim +++ /dev/null @@ -1,11 +0,0 @@ -discard """ - output: 3 - -""" - -var x: ref int -new(x) -x[] = 3 - -echo x[] - diff --git a/tests/run/tpos.nim b/tests/run/tpos.nim deleted file mode 100644 index 3d72536dd5..0000000000 --- a/tests/run/tpos.nim +++ /dev/null @@ -1,35 +0,0 @@ -discard """ - file: "tpos.nim" - output: "6" -""" -# test this particular function - -proc mypos(sub, s: string, start: int = 0): int = - var - i, j, M, N: int - M = sub.len - N = s.len - 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) or (i >= N): break - if j >= M: - result = i - M - else: - result = -1 - -var sub = "hello" -var s = "world hello" -write(stdout, mypos(sub, s)) -#OUT 6 - - diff --git a/tests/run/tromans.nim b/tests/run/tromans.nim deleted file mode 100644 index fa6a63595f..0000000000 --- a/tests/run/tromans.nim +++ /dev/null @@ -1,71 +0,0 @@ -discard """ - file: "tromans.nim" - output: "success" -""" -import - strutils - -## Convert an integer to a Roman numeral -# See http://en.wikipedia.org/wiki/Roman_numerals for reference - -proc raiseInvalidValue(msg: string) {.noreturn.} = - # Yes, we really need a shorthand for this code... - var e: ref EInvalidValue - new(e) - e.msg = msg - raise e - -# I should use a class, perhaps. -# --> No. Why introduce additional state into such a simple and nice -# interface? State is evil. :D - -proc RomanToDecimal(romanVal: string): int = - result = 0 - var prevVal = 0 - for i in countdown(romanVal.len - 1, 0): - var val = 0 - case romanVal[i] - of 'I', 'i': val = 1 - of 'V', 'v': val = 5 - of 'X', 'x': val = 10 - of 'L', 'l': val = 50 - of 'C', 'c': val = 100 - of 'D', 'd': val = 500 - of 'M', 'm': val = 1000 - else: raiseInvalidValue("Incorrect character in roman numeral! (" & - $romanVal[i] & ")") - if val >= prevVal: - inc(result, val) - else: - dec(result, val) - prevVal = val - -proc DecimalToRoman(decValParam: int): string = - # Apparently numbers cannot be above 4000 - # Well, they can be (using overbar or parenthesis notation) - # but I see little interest (beside coding challenge) in coding them as - # we rarely use huge Roman numeral. - const romanComposites = [ - ("M", 1000), ("CM", 900), - ("D", 500), ("CD", 400), ("C", 100), - ("XC", 90), ("L", 50), ("XL", 40), ("X", 10), ("IX", 9), - ("V", 5), ("IV", 4), ("I", 1)] - if decValParam < 1 or decValParam > 3999: - raiseInvalidValue("number not representable") - result = "" - var decVal = decValParam - for key, val in items(romanComposites): - while decVal >= val: - dec(decVal, val) - result.add(key) - -for i in 1..100: - if RomanToDecimal(DecimalToRoman(i)) != i: quit "BUG" - -for i in items([1238, 1777, 3830, 2401, 379, 33, 940, 3973]): - if RomanToDecimal(DecimalToRoman(i)) != i: quit "BUG" - -echo "success" #OUT success - - - diff --git a/tests/run/tsimplesort.nim b/tests/run/tsimplesort.nim deleted file mode 100644 index 0167ca78a9..0000000000 --- a/tests/run/tsimplesort.nim +++ /dev/null @@ -1,313 +0,0 @@ -discard """ - output: '''true''' -""" - -import hashes, math - - -when defined(shallowADT): - {.pragma: myShallow, shallow.} -else: - {.pragma: myShallow.} - -type - TSlotEnum = enum seEmpty, seFilled, seDeleted - TKeyValuePair[A, B] = tuple[slot: TSlotEnum, key: A, val: B] - TKeyValuePairSeq[A, B] = seq[TKeyValuePair[A, B]] - TTable* {.final, myShallow.}[A, B] = object - data: TKeyValuePairSeq[A, B] - counter: int - -proc len*[A, B](t: TTable[A, B]): int = - ## returns the number of keys in `t`. - result = t.counter - -iterator pairs*[A, B](t: TTable[A, B]): tuple[key: A, val: B] = - ## iterates over any (key, value) pair in the table `t`. - for h in 0..high(t.data): - if t.data[h].slot == seFilled: yield (t.data[h].key, t.data[h].val) - -iterator keys*[A, B](t: TTable[A, B]): A = - ## iterates over any key in the table `t`. - for h in 0..high(t.data): - if t.data[h].slot == seFilled: yield t.data[h].key - -iterator values*[A, B](t: TTable[A, B]): B = - ## iterates over any value in the table `t`. - for h in 0..high(t.data): - if t.data[h].slot == seFilled: yield t.data[h].val - -const - growthFactor = 2 - -proc mustRehash(length, counter: int): bool {.inline.} = - assert(length > counter) - result = (length * 2 < counter * 3) or (length - counter < 4) - -proc nextTry(h, maxHash: THash): THash {.inline.} = - result = ((5 * h) + 1) and maxHash - -template rawGetImpl() = - var h: THash = hash(key) and high(t.data) # start with real hash value - while t.data[h].slot != seEmpty: - if t.data[h].key == key and t.data[h].slot == seFilled: - return h - h = nextTry(h, high(t.data)) - result = -1 - -template rawInsertImpl() = - var h: THash = hash(key) and high(data) - while data[h].slot == seFilled: - h = nextTry(h, high(data)) - data[h].key = key - data[h].val = val - data[h].slot = seFilled - -proc RawGet[A, B](t: TTable[A, B], key: A): int = - rawGetImpl() - -proc `[]`*[A, B](t: TTable[A, B], key: A): B = - ## retrieves the value at ``t[key]``. If `key` is not in `t`, - ## default empty value for the type `B` is returned - ## and no exception is raised. One can check with ``hasKey`` whether the key - ## exists. - var index = RawGet(t, key) - if index >= 0: result = t.data[index].val - -proc hasKey*[A, B](t: TTable[A, B], key: A): bool = - ## returns true iff `key` is in the table `t`. - result = rawGet(t, key) >= 0 - -proc RawInsert[A, B](t: var TTable[A, B], data: var TKeyValuePairSeq[A, B], - key: A, val: B) = - rawInsertImpl() - -proc Enlarge[A, B](t: var TTable[A, B]) = - var n: TKeyValuePairSeq[A, B] - newSeq(n, len(t.data) * growthFactor) - for i in countup(0, high(t.data)): - if t.data[i].slot == seFilled: RawInsert(t, n, t.data[i].key, t.data[i].val) - swap(t.data, n) - -template PutImpl() = - var index = RawGet(t, key) - if index >= 0: - t.data[index].val = val - else: - if mustRehash(len(t.data), t.counter): Enlarge(t) - RawInsert(t, t.data, key, val) - inc(t.counter) - -proc `[]=`*[A, B](t: var TTable[A, B], key: A, val: B) = - ## puts a (key, value)-pair into `t`. - putImpl() - -proc del*[A, B](t: var TTable[A, B], key: A) = - ## deletes `key` from hash table `t`. - var index = RawGet(t, key) - if index >= 0: - t.data[index].slot = seDeleted - dec(t.counter) - -proc initTable*[A, B](initialSize=64): TTable[A, B] = - ## creates a new hash table that is empty. `initialSize` needs to be - ## a power of two. - assert isPowerOfTwo(initialSize) - result.counter = 0 - newSeq(result.data, initialSize) - -proc toTable*[A, B](pairs: openarray[tuple[key: A, - val: B]]): TTable[A, B] = - ## creates a new hash table that contains the given `pairs`. - result = initTable[A, B](nextPowerOfTwo(pairs.len+10)) - for key, val in items(pairs): result[key] = val - -template dollarImpl(): stmt = - if t.len == 0: - result = "{:}" - else: - result = "{" - for key, val in pairs(t): - if result.len > 1: result.add(", ") - result.add($key) - result.add(": ") - result.add($val) - result.add("}") - -proc `$`*[A, B](t: TTable[A, B]): string = - ## The `$` operator for hash tables. - dollarImpl() - -# ------------------------------ count tables ------------------------------- - -type - TCountTable* {.final, myShallow.}[ - A] = object ## table that counts the number of each key - data: seq[tuple[key: A, val: int]] - counter: int - -proc len*[A](t: TCountTable[A]): int = - ## returns the number of keys in `t`. - result = t.counter - -iterator pairs*[A](t: TCountTable[A]): tuple[key: A, val: int] = - ## iterates over any (key, value) pair in the table `t`. - for h in 0..high(t.data): - if t.data[h].val != 0: yield (t.data[h].key, t.data[h].val) - -iterator keys*[A](t: TCountTable[A]): A = - ## iterates over any key in the table `t`. - for h in 0..high(t.data): - if t.data[h].val != 0: yield t.data[h].key - -iterator values*[A](t: TCountTable[A]): int = - ## iterates over any value in the table `t`. - for h in 0..high(t.data): - if t.data[h].val != 0: yield t.data[h].val - -proc RawGet[A](t: TCountTable[A], key: A): int = - var h: THash = hash(key) and high(t.data) # start with real hash value - while t.data[h].val != 0: - if t.data[h].key == key: return h - h = nextTry(h, high(t.data)) - result = -1 - -proc `[]`*[A](t: TCountTable[A], key: A): int = - ## retrieves the value at ``t[key]``. If `key` is not in `t`, - ## 0 is returned. One can check with ``hasKey`` whether the key - ## exists. - var index = RawGet(t, key) - if index >= 0: result = t.data[index].val - -proc hasKey*[A](t: TCountTable[A], key: A): bool = - ## returns true iff `key` is in the table `t`. - result = rawGet(t, key) >= 0 - -proc RawInsert[A](t: TCountTable[A], data: var seq[tuple[key: A, val: int]], - key: A, val: int) = - var h: THash = hash(key) and high(data) - while data[h].val != 0: h = nextTry(h, high(data)) - data[h].key = key - data[h].val = val - -proc Enlarge[A](t: var TCountTable[A]) = - var n: seq[tuple[key: A, val: int]] - newSeq(n, len(t.data) * growthFactor) - for i in countup(0, high(t.data)): - if t.data[i].val != 0: RawInsert(t, n, t.data[i].key, t.data[i].val) - swap(t.data, n) - -proc `[]=`*[A](t: var TCountTable[A], key: A, val: int) = - ## puts a (key, value)-pair into `t`. `val` has to be positive. - assert val > 0 - PutImpl() - -proc initCountTable*[A](initialSize=64): TCountTable[A] = - ## creates a new count table that is empty. `initialSize` needs to be - ## a power of two. - assert isPowerOfTwo(initialSize) - result.counter = 0 - newSeq(result.data, initialSize) - -proc toCountTable*[A](keys: openArray[A]): TCountTable[A] = - ## creates a new count table with every key in `keys` having a count of 1. - result = initCountTable[A](nextPowerOfTwo(keys.len+10)) - for key in items(keys): result[key] = 1 - -proc `$`*[A](t: TCountTable[A]): string = - ## The `$` operator for count tables. - dollarImpl() - -proc inc*[A](t: var TCountTable[A], key: A, val = 1) = - ## increments `t[key]` by `val`. - var index = RawGet(t, key) - if index >= 0: - inc(t.data[index].val, val) - else: - if mustRehash(len(t.data), t.counter): Enlarge(t) - RawInsert(t, t.data, key, val) - inc(t.counter) - -proc Smallest*[A](t: TCountTable[A]): tuple[key: A, val: int] = - ## returns the largest (key,val)-pair. Efficiency: O(n) - assert t.len > 0 - var minIdx = 0 - for h in 1..high(t.data): - if t.data[h].val > 0 and t.data[minIdx].val > t.data[h].val: minIdx = h - result.key = t.data[minIdx].key - result.val = t.data[minIdx].val - -proc Largest*[A](t: TCountTable[A]): tuple[key: A, val: int] = - ## returns the (key,val)-pair with the largest `val`. Efficiency: O(n) - assert t.len > 0 - var maxIdx = 0 - for h in 1..high(t.data): - if t.data[maxIdx].val < t.data[h].val: maxIdx = h - result.key = t.data[maxIdx].key - result.val = t.data[maxIdx].val - -proc sort*[A](t: var TCountTable[A]) = - ## sorts the count table so that the entry with the highest counter comes - ## first. This is destructive! You must not modify `t` afterwards! - ## You can use the iterators `pairs`, `keys`, and `values` to iterate over - ## `t` in the sorted order. - - # we use shellsort here; fast enough and simple - var h = 1 - while true: - h = 3 * h + 1 - if h >= high(t.data): break - while true: - h = h div 3 - for i in countup(h, high(t.data)): - var j = i - while t.data[j-h].val <= t.data[j].val: - var xyz = t.data[j] - t.data[j] = t.data[j-h] - t.data[j-h] = xyz - j = j-h - if j < h: break - if h == 1: break - - -const - data = { - "34": 123456, "12": 789, - "90": 343, "0": 34404, - "1": 344004, "2": 344774, - "3": 342244, "4": 3412344, - "5": 341232144, "6": 34214544, - "7": 3434544, "8": 344544, - "9": 34435644, "---00": 346677844, - "10": 34484, "11": 34474, "19": 34464, - "20": 34454, "30": 34141244, "40": 344114, - "50": 344490, "60": 344491, "70": 344492, - "80": 344497} - -proc countTableTest1 = - var s = initTable[string, int](64) - for key, val in items(data): s[key] = val - var w: tuple[key: string, val: int] #type(otherCountTable.data[0]) - - var t = initCountTable[string]() - for k, v in items(data): t.inc(k) - for k in t.keys: assert t[k] == 1 - t.inc("90", 3) - t.inc("12", 2) - t.inc("34", 1) - assert t.largest()[0] == "90" - t.sort() - - var i = 0 - for k, v in t.pairs: - case i - of 0: assert k == "90" and v == 4 - of 1: assert k == "12" and v == 3 - of 2: assert k == "34" and v == 2 - else: break - inc i - -countTableTest1() -echo true - - diff --git a/tests/run/tslices.nim b/tests/run/tslices.nim deleted file mode 100644 index 0de1171e34..0000000000 --- a/tests/run/tslices.nim +++ /dev/null @@ -1,59 +0,0 @@ -discard """ - file: "tslices.nim" - output: '''456456 -456456 -456456 -Zugr5nd -egerichtetd -verichtetd -''' -""" - -# Test the new slices. - -import strutils - -var mystr = "Abgrund" -mystr[..1] = "Zu" - -mystr[4..4] = "5" - -type - TEnum = enum e1, e2, e3, e4, e5, e6 - -var myarr: array[TEnum, int] = [1, 2, 3, 4, 5, 6] -myarr[e1..e3] = myarr[e4..e6] -myarr[..e3] = myarr[e4..e6] - -for x in items(myarr): stdout.write(x) -echo() - -var myarr2: array[0..5, int] = [1, 2, 3, 4, 5, 6] -myarr2[0..2] = myarr2[3..5] - -for x in items(myarr2): stdout.write(x) -echo() - - -var myseq = @[1, 2, 3, 4, 5, 6] -myseq[0..2] = myseq[-3.. -1] - -for x in items(myseq): stdout.write(x) -echo() - -echo mystr - -mystr[4..4] = "u" - -# test full replacement -mystr[.. -2] = "egerichtet" - -echo mystr - -mystr[0..2] = "ve" -echo mystr - -var s = "abcdef" -s[1 .. -2] = "xyz" -assert s == "axyzf" - diff --git a/tests/run/tsortdev.nim b/tests/run/tsortdev.nim deleted file mode 100644 index d7d42d22c8..0000000000 --- a/tests/run/tsortdev.nim +++ /dev/null @@ -1,59 +0,0 @@ -discard """ - output: "done" -""" - -import algorithm, strutils - -proc cmpPlatforms(a, b: string): int = - if a == b: return 0 - var dashes = a.split('-') - var dashes2 = b.split('-') - if dashes[0] == dashes2[0]: - if dashes[1] == dashes2[1]: return system.cmp(a,b) - case dashes[1] - of "x86": - return 1 - of "x86_64": - if dashes2[1] == "x86": return -1 - else: return 1 - of "ppc64": - if dashes2[1] == "x86" or dashes2[1] == "x86_64": return -1 - else: return 1 - else: - return system.cmp(dashes[1], dashes2[1]) - else: - case dashes[0] - of "linux": - return 1 - of "windows": - if dashes2[0] == "linux": return -1 - else: return 1 - of "macosx": - if dashes2[0] == "linux" or dashes2[0] == "windows": return -1 - else: return 1 - else: - if dashes2[0] == "linux" or dashes2[0] == "windows" or - dashes2[0] == "macosx": return -1 - else: - return system.cmp(a, b) - -proc sorted[T](a: openArray[T]): bool = - result = true - for i in 0 .. < a.high: - if cmpPlatforms(a[i], a[i+1]) > 0: - echo "Out of order: ", a[i], " ", a[i+1] - result = false - -proc main() = - var testData = @["netbsd-x86_64", "windows-x86", "linux-x86_64", "linux-x86", - "linux-ppc64", "macosx-x86-1058", "macosx-x86-1068"] - - sort(testData, cmpPlatforms) - - doAssert sorted(testData) - -for i in 0..1_000: - main() - -echo "done" - diff --git a/tests/run/tstrange.nim b/tests/run/tstrange.nim deleted file mode 100644 index 3947755fcf..0000000000 --- a/tests/run/tstrange.nim +++ /dev/null @@ -1,23 +0,0 @@ -discard """ - file: "tstrange.nim" - output: "hallo4" -""" -# test for extremely strange bug - -proc ack(x: int, y: int): int = - if x != 0: - if y != 5: - return y - return x - return x+y - -proc gen[T](a: T) = - write(stdout, a) - - -gen("hallo") -write(stdout, ack(5, 4)) -#OUT hallo4 - - - diff --git a/tests/run/tvarious1.nim b/tests/run/tvarious1.nim deleted file mode 100644 index 6e4612ae30..0000000000 --- a/tests/run/tvarious1.nim +++ /dev/null @@ -1,41 +0,0 @@ -discard """ - file: "tlenopenarray.nim" - output: '''1 -0 -Whopie -12''' -""" - -echo len([1_000_000]) #OUT 1 - -type - TArray = array[0..3, int] - TVector = distinct array[0..3, int] -proc `[]`(v: TVector; idx: int): int = TArray(v)[idx] -var v: TVector -echo v[2] - -# bug #569 - -import queues - -type - TWidget = object - names: TQueue[string] - -var w = TWidget(names: initQueue[string]()) - -add(w.names, "Whopie") - -for n in w.names: echo(n) - -# bug #681 - -type TSomeRange = object - hour: range[0..23] - -var value: string -var val12 = TSomeRange(hour: 12) - -value = $(if val12.hour > 12: val12.hour - 12 else: val12.hour) -echo value diff --git a/tests/run/tvarnums.nim b/tests/run/tvarnums.nim deleted file mode 100644 index 4f99df8b9b..0000000000 --- a/tests/run/tvarnums.nim +++ /dev/null @@ -1,142 +0,0 @@ -discard """ - file: "tvarnums.nim" - output: "Success!" -""" -# Test variable length binary integers - -import - strutils - -type - TBuffer = array [0..10, int8] - -proc toVarNum(x: int32, b: var TBuffer) = - # encoding: first bit indicates end of number (0 if at end) - # second bit of the first byte denotes the sign (1 --> negative) - var a = x - if x != low(x): - # low(int) is a special case, - # because abs() does not work here! - # we leave x as it is and use the check >% instead of > - # for low(int) this is needed and positive numbers are not affected - # anyway - a = abs(x) - # first 6 bits: - b[0] = toU8(ord(a >% 63'i32) shl 7 or (ord(x < 0'i32) shl 6) or (int(a) and 63)) - a = a shr 6'i32 # skip first 6 bits - var i = 1 - while a != 0'i32: - b[i] = toU8(ord(a >% 127'i32) shl 7 or (int(a) and 127)) - inc(i) - a = a shr 7'i32 - -proc toVarNum64(x: int64, b: var TBuffer) = - # encoding: first bit indicates end of number (0 if at end) - # second bit of the first byte denotes the sign (1 --> negative) - var a = x - if x != low(x): - # low(int) is a special case, - # because abs() does not work here! - # we leave x as it is and use the check >% instead of > - # for low(int) this is needed and positive numbers are not affected - # anyway - a = abs(x) - # first 6 bits: - b[0] = toU8(ord(a >% 63'i64) shl 7 or (ord(x < 0'i64) shl 6) or int(a and 63)) - a = a shr 6 # skip first 6 bits - var i = 1 - while a != 0'i64: - b[i] = toU8(ord(a >% 127'i64) shl 7 or int(a and 127)) - inc(i) - a = a shr 7 - -proc toNum64(b: TBuffer): int64 = - # treat first byte different: - result = ze64(b[0]) and 63 - var - i = 0 - Shift = 6'i64 - while (ze(b[i]) and 128) != 0: - inc(i) - result = result or ((ze64(b[i]) and 127) shl Shift) - inc(Shift, 7) - if (ze(b[0]) and 64) != 0: # sign bit set? - result = not result +% 1 - # this is the same as ``- result`` - # but gives no overflow error for low(int) - -proc toNum(b: TBuffer): int32 = - # treat first byte different: - result = ze(b[0]) and 63 - var - i = 0 - Shift = 6'i32 - while (ze(b[i]) and 128) != 0: - inc(i) - result = result or ((int32(ze(b[i])) and 127'i32) shl Shift) - Shift = shift + 7'i32 - if (ze(b[0]) and (1 shl 6)) != 0: # sign bit set? - result = (not result) +% 1'i32 - # this is the same as ``- result`` - # but gives no overflow error for low(int) - -proc toBinary(x: int64): string = - result = newString(64) - for i in 0..63: - result[63-i] = chr((int(x shr i) and 1) + ord('0')) - -proc t64(i: int64) = - var - b: TBuffer - toVarNum64(i, b) - var x = toNum64(b) - if x != i: - writeln(stdout, $i) - writeln(stdout, toBinary(i)) - writeln(stdout, toBinary(x)) - -proc t32(i: int32) = - var - b: TBuffer - toVarNum(i, b) - var x = toNum(b) - if x != i: - writeln(stdout, toBinary(i)) - writeln(stdout, toBinary(x)) - -proc tm(i: int32) = - var - b: TBuffer - toVarNum64(i, b) - var x = toNum(b) - if x != i: - writeln(stdout, toBinary(i)) - writeln(stdout, toBinary(x)) - -t32(0) -t32(1) -t32(-1) -t32(-100_000) -t32(100_000) -t32(low(int32)) -t32(high(int32)) - -t64(low(int64)) -t64(high(int64)) -t64(0) -t64(-1) -t64(1) -t64(1000_000) -t64(-1000_000) - -tm(0) -tm(1) -tm(-1) -tm(-100_000) -tm(100_000) -tm(low(int32)) -tm(high(int32)) - -writeln(stdout, "Success!") #OUT Success! - - diff --git a/tests/compile/tseq2.nim b/tests/seq/tseq2.nim similarity index 100% rename from tests/compile/tseq2.nim rename to tests/seq/tseq2.nim diff --git a/tests/run/tseqcon.nim b/tests/seq/tseqcon.nim similarity index 100% rename from tests/run/tseqcon.nim rename to tests/seq/tseqcon.nim diff --git a/tests/compile/tseqcon2.nim b/tests/seq/tseqcon2.nim similarity index 100% rename from tests/compile/tseqcon2.nim rename to tests/seq/tseqcon2.nim diff --git a/tests/run/tseqtuple.nim b/tests/seq/tseqtuple.nim similarity index 100% rename from tests/run/tseqtuple.nim rename to tests/seq/tseqtuple.nim diff --git a/tests/run/tsequtils.nim b/tests/seq/tsequtils.nim similarity index 100% rename from tests/run/tsequtils.nim rename to tests/seq/tsequtils.nim diff --git a/tests/run/ttoseq.nim b/tests/seq/ttoseq.nim similarity index 100% rename from tests/run/ttoseq.nim rename to tests/seq/ttoseq.nim diff --git a/tests/run/tsets.nim b/tests/sets/tsets.nim similarity index 100% rename from tests/run/tsets.nim rename to tests/sets/tsets.nim diff --git a/tests/run/tsets2.nim b/tests/sets/tsets2.nim similarity index 100% rename from tests/run/tsets2.nim rename to tests/sets/tsets2.nim diff --git a/tests/run/tstaticparams.nim b/tests/static/tstaticparams.nim similarity index 100% rename from tests/run/tstaticparams.nim rename to tests/static/tstaticparams.nim diff --git a/tests/compile/tcputime.nim b/tests/stdlib/tcputime.nim similarity index 100% rename from tests/compile/tcputime.nim rename to tests/stdlib/tcputime.nim diff --git a/tests/run/tcritbits.nim b/tests/stdlib/tcritbits.nim similarity index 100% rename from tests/run/tcritbits.nim rename to tests/stdlib/tcritbits.nim diff --git a/tests/compile/tdialogs.nim b/tests/stdlib/tdialogs.nim similarity index 100% rename from tests/compile/tdialogs.nim rename to tests/stdlib/tdialogs.nim diff --git a/tests/compile/techo.nim b/tests/stdlib/techo.nim similarity index 100% rename from tests/compile/techo.nim rename to tests/stdlib/techo.nim diff --git a/tests/run/tformat.nim b/tests/stdlib/tformat.nim similarity index 100% rename from tests/run/tformat.nim rename to tests/stdlib/tformat.nim diff --git a/tests/run/thashes.nim b/tests/stdlib/thashes.nim similarity index 100% rename from tests/run/thashes.nim rename to tests/stdlib/thashes.nim diff --git a/tests/compile/tio.nim b/tests/stdlib/tio.nim similarity index 100% rename from tests/compile/tio.nim rename to tests/stdlib/tio.nim diff --git a/tests/compile/tircbot.nim b/tests/stdlib/tircbot.nim similarity index 100% rename from tests/compile/tircbot.nim rename to tests/stdlib/tircbot.nim diff --git a/tests/run/tlists.nim b/tests/stdlib/tlists.nim similarity index 100% rename from tests/run/tlists.nim rename to tests/stdlib/tlists.nim diff --git a/tests/compile/tmarshal.nim b/tests/stdlib/tmarshal.nim similarity index 100% rename from tests/compile/tmarshal.nim rename to tests/stdlib/tmarshal.nim diff --git a/tests/run/tmath.nim b/tests/stdlib/tmath.nim similarity index 100% rename from tests/run/tmath.nim rename to tests/stdlib/tmath.nim diff --git a/tests/compile/tmath.nim b/tests/stdlib/tmath2.nim similarity index 100% rename from tests/compile/tmath.nim rename to tests/stdlib/tmath2.nim diff --git a/tests/compile/tmongo.nim b/tests/stdlib/tmongo.nim similarity index 100% rename from tests/compile/tmongo.nim rename to tests/stdlib/tmongo.nim diff --git a/tests/compile/tos.nim b/tests/stdlib/tos.nim similarity index 100% rename from tests/compile/tos.nim rename to tests/stdlib/tos.nim diff --git a/tests/compile/tparscfg.nim b/tests/stdlib/tparscfg.nim similarity index 100% rename from tests/compile/tparscfg.nim rename to tests/stdlib/tparscfg.nim diff --git a/tests/compile/tparsefloat.nim b/tests/stdlib/tparsefloat.nim similarity index 100% rename from tests/compile/tparsefloat.nim rename to tests/stdlib/tparsefloat.nim diff --git a/tests/compile/tparsopt.nim b/tests/stdlib/tparsopt.nim similarity index 100% rename from tests/compile/tparsopt.nim rename to tests/stdlib/tparsopt.nim diff --git a/tests/run/tpegs.nim b/tests/stdlib/tpegs.nim similarity index 100% rename from tests/run/tpegs.nim rename to tests/stdlib/tpegs.nim diff --git a/tests/compile/tposix.nim b/tests/stdlib/tposix.nim similarity index 100% rename from tests/compile/tposix.nim rename to tests/stdlib/tposix.nim diff --git a/tests/compile/tquit.nim b/tests/stdlib/tquit.nim similarity index 100% rename from tests/compile/tquit.nim rename to tests/stdlib/tquit.nim diff --git a/tests/run/tregex.nim b/tests/stdlib/tregex.nim similarity index 100% rename from tests/run/tregex.nim rename to tests/stdlib/tregex.nim diff --git a/tests/run/treguse.nim b/tests/stdlib/treguse.nim similarity index 100% rename from tests/run/treguse.nim rename to tests/stdlib/treguse.nim diff --git a/tests/run/trepr.nim b/tests/stdlib/trepr.nim similarity index 100% rename from tests/run/trepr.nim rename to tests/stdlib/trepr.nim diff --git a/tests/compile/trepr.nim b/tests/stdlib/trepr2.nim similarity index 100% rename from tests/compile/trepr.nim rename to tests/stdlib/trepr2.nim diff --git a/tests/compile/tsockets.nim b/tests/stdlib/tsockets.nim similarity index 100% rename from tests/compile/tsockets.nim rename to tests/stdlib/tsockets.nim diff --git a/tests/compile/tsortcall.nim b/tests/stdlib/tsortcall.nim similarity index 100% rename from tests/compile/tsortcall.nim rename to tests/stdlib/tsortcall.nim diff --git a/tests/run/tsplit.nim b/tests/stdlib/tsplit.nim similarity index 100% rename from tests/run/tsplit.nim rename to tests/stdlib/tsplit.nim diff --git a/tests/compile/tstreams.nim b/tests/stdlib/tstreams.nim similarity index 100% rename from tests/compile/tstreams.nim rename to tests/stdlib/tstreams.nim diff --git a/tests/compile/tstrset.nim b/tests/stdlib/tstrset.nim similarity index 100% rename from tests/compile/tstrset.nim rename to tests/stdlib/tstrset.nim diff --git a/tests/compile/tstrtabs.nim b/tests/stdlib/tstrtabs.nim similarity index 100% rename from tests/compile/tstrtabs.nim rename to tests/stdlib/tstrtabs.nim diff --git a/tests/run/tstrutil.nim b/tests/stdlib/tstrutil.nim similarity index 100% rename from tests/run/tstrutil.nim rename to tests/stdlib/tstrutil.nim diff --git a/tests/compile/ttime.nim b/tests/stdlib/ttime.nim similarity index 100% rename from tests/compile/ttime.nim rename to tests/stdlib/ttime.nim diff --git a/tests/run/tunidecode.nim b/tests/stdlib/tunidecode.nim similarity index 100% rename from tests/run/tunidecode.nim rename to tests/stdlib/tunidecode.nim diff --git a/tests/compile/twalker.nim b/tests/stdlib/twalker.nim similarity index 100% rename from tests/compile/twalker.nim rename to tests/stdlib/twalker.nim diff --git a/tests/run/txmlgen.nim b/tests/stdlib/txmlgen.nim similarity index 100% rename from tests/run/txmlgen.nim rename to tests/stdlib/txmlgen.nim diff --git a/tests/run/txmltree.nim b/tests/stdlib/txmltree.nim similarity index 100% rename from tests/run/txmltree.nim rename to tests/stdlib/txmltree.nim diff --git a/tests/compile/ttableconstr.nim b/tests/table/ttableconstr.nim similarity index 100% rename from tests/compile/ttableconstr.nim rename to tests/table/ttableconstr.nim diff --git a/tests/run/ttables.nim b/tests/table/ttables.nim similarity index 100% rename from tests/run/ttables.nim rename to tests/table/ttables.nim diff --git a/tests/run/ttables2.nim b/tests/table/ttables2.nim similarity index 100% rename from tests/run/ttables2.nim rename to tests/table/ttables2.nim diff --git a/tests/templates/mcan_access_hidden_field.nim b/tests/template/mcan_access_hidden_field.nim similarity index 100% rename from tests/templates/mcan_access_hidden_field.nim rename to tests/template/mcan_access_hidden_field.nim diff --git a/tests/compile/mtempl5.nim b/tests/template/mtempl5.nim similarity index 100% rename from tests/compile/mtempl5.nim rename to tests/template/mtempl5.nim diff --git a/tests/templates/tcan_access_hidden_field.nim b/tests/template/tcan_access_hidden_field.nim similarity index 100% rename from tests/templates/tcan_access_hidden_field.nim rename to tests/template/tcan_access_hidden_field.nim diff --git a/tests/compile/thygienictempl.nim b/tests/template/thygienictempl.nim similarity index 100% rename from tests/compile/thygienictempl.nim rename to tests/template/thygienictempl.nim diff --git a/tests/compile/tmodulealias.nim b/tests/template/tmodulealias.nim similarity index 100% rename from tests/compile/tmodulealias.nim rename to tests/template/tmodulealias.nim diff --git a/tests/run/tstempl.nim b/tests/template/tstempl.nim similarity index 100% rename from tests/run/tstempl.nim rename to tests/template/tstempl.nim diff --git a/tests/compile/ttempl.nim b/tests/template/ttempl.nim similarity index 100% rename from tests/compile/ttempl.nim rename to tests/template/ttempl.nim diff --git a/tests/reject/ttempl2.nim b/tests/template/ttempl2.nim similarity index 100% rename from tests/reject/ttempl2.nim rename to tests/template/ttempl2.nim diff --git a/tests/compile/ttempl3.nim b/tests/template/ttempl3.nim similarity index 100% rename from tests/compile/ttempl3.nim rename to tests/template/ttempl3.nim diff --git a/tests/compile/ttempl4.nim b/tests/template/ttempl4.nim similarity index 100% rename from tests/compile/ttempl4.nim rename to tests/template/ttempl4.nim diff --git a/tests/compile/ttempl5.nim b/tests/template/ttempl5.nim similarity index 100% rename from tests/compile/ttempl5.nim rename to tests/template/ttempl5.nim diff --git a/tests/compile/ttemplreturntype.nim b/tests/template/ttemplreturntype.nim similarity index 100% rename from tests/compile/ttemplreturntype.nim rename to tests/template/ttemplreturntype.nim diff --git a/tests/run/utemplates.nim b/tests/template/utemplates.nim similarity index 100% rename from tests/run/utemplates.nim rename to tests/template/utemplates.nim diff --git a/tests/testament/backend.nim b/tests/testament/backend.nim new file mode 100644 index 0000000000..65d040b24e --- /dev/null +++ b/tests/testament/backend.nim @@ -0,0 +1,120 @@ +# +# +# The Nimrod Tester +# (c) Copyright 2013 Andreas Rumpf +# +# Look at license.txt for more info. +# All rights reserved. + +import strutils, db_sqlite, os, osproc + +var db: TDbConn + +proc createDb() = + db.exec(sql""" + create table if not exists Machine( + id integer primary key, + name varchar(100) not null, + os varchar(20) not null, + cpu varchar(20) not null + );""") + + db.exec(sql""" + create table if not exists [Commit]( + id integer primary key, + hash varchar(256) not null, + branch varchar(50) not null + );""") + + db.exec(sql""" + create table if not exists TestResult( + id integer primary key, + name varchar(100) not null, + category varchar(100) not null, + target varchar(20) not null, + action varchar(10) not null, + result varchar(30) not null, + [commit] int not null, + machine int not null, + expected varchar(10000) not null, + given varchar(10000) not null, + created timestamp not null default (DATETIME('now')), + + foreign key ([commit]) references [commit](id), + foreign key (machine) references machine(id) + );""") + + #db.exec(sql""" + # --create unique index if not exists TsstNameIx on TestResult(name); + # """, []) + +type + MachineId = distinct int64 + CommitId = distinct int64 + +proc `$`(id: MachineId): string {.borrow.} +proc `$`(id: CommitId): string {.borrow.} + +var + thisMachine: MachineId + thisCommit: CommitId + +proc `()`(cmd: string{lit}): string = cmd.execProcess.string.strip + +proc getMachine: MachineId = + var name = "hostname"() + if name.len == 0: + name = when defined(posix): getenv"HOSTNAME".string + else: getenv"COMPUTERNAME".string + if name.len == 0: + quit "cannot determine the machine name" + + let id = db.getValue(sql"select id from Machine where name = ?", name) + if id.len > 0: + result = id.parseInt.MachineId + else: + result = db.insertId(sql"insert into Machine(name, os, cpu) values (?,?,?)", + name, system.hostOS, system.hostCPU).MachineId + +proc getCommit: CommitId = + let hash = "git log -n 1"() + let branch = "git symbolic-ref --short HEAD"() + if hash.len == 0 or branch.len == 0: quit "cannot determine git HEAD" + + let id = db.getValue(sql"select id from [Commit] where hash = ? and branch = ?", + hash, branch) + if id.len > 0: + result = id.parseInt.CommitId + else: + result = db.insertId(sql"insert into [Commit](hash, branch) values (?, ?)", + hash, branch).CommitId + +proc writeTestResult*(name, category, target, + action, result, expected, given: string) = + let id = db.getValue(sql"""select id from TestResult + where name = ? and category = ? and target = ? and + machine = ? and [commit] = ?""", + name, category, target, + thisMachine, thisCommit) + if id.len > 0: + db.exec(sql"""update TestResult + set action = ?, result = ?, expected = ?, given = ? + where id = ?""", action, result, expected, given, id) + else: + db.exec(sql"""insert into TestResult(name, category, target, + action, + result, expected, given, + [commit], machine) + values (?,?,?,?,?,?,?,?,?) """, name, category, target, + action, + result, expected, given, + thisCommit, thisMachine) + +proc open*() = + db = open(connection="testament.db", user="testament", password="", + database="testament") + createDb() + thisMachine = getMachine() + thisCommit = getCommit() + +proc close*() = close(db) diff --git a/tests/testament/categories.nim b/tests/testament/categories.nim new file mode 100644 index 0000000000..68a61a973f --- /dev/null +++ b/tests/testament/categories.nim @@ -0,0 +1,256 @@ +# +# +# Nimrod Tester +# (c) Copyright 2014 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## Include for the tester that contains test suites that test special features +## of the compiler. + +# included from tester.nim +# ---------------- ROD file tests --------------------------------------------- + +const + rodfilesDir = "tests/rodfiles" + nimcacheDir = rodfilesDir / "nimcache" + +proc delNimCache() = + try: + removeDir(nimcacheDir) + except EOS: + echo "[Warning] could not delete: ", nimcacheDir + +proc runRodFiles(r: var TResults, cat: Category, options: string) = + template test(filename: expr): stmt = + testSpec r, makeTest(rodfilesDir / filename, options, cat, actionRun) + + delNimCache() + + # test basic recompilation scheme: + test "hallo" + test "hallo" + # test incremental type information: + test "hallo2" + delNimCache() + + # test type converters: + test "aconv" + test "bconv" + delNimCache() + + # test G, A, B example from the documentation; test init sections: + test "deada" + test "deada2" + delNimCache() + + # test method generation: + test "bmethods" + test "bmethods2" + delNimCache() + + # test generics: + test "tgeneric1" + test "tgeneric2" + delNimCache() + +proc compileRodFiles(r: var TResults, cat: Category, options: string) = + template test(filename: expr): stmt = + testSpec r, makeTest(rodfilesDir / filename, options, cat) + + delNimCache() + # test DLL interfacing: + test "gtkex1" + test "gtkex2" + delNimCache() + +# --------------------- DLL generation tests ---------------------------------- + +proc safeCopyFile(src, dest: string) = + try: + copyFile(src, dest) + except EOS: + echo "[Warning] could not copy: ", src, " to ", dest + +proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) = + testSpec c, makeTest("lib/nimrtl.nim", + options & " --app:lib -d:createNimRtl", cat) + testSpec c, makeTest("tests/dll/server.nim", + options & " --app:lib -d:useNimRtl", cat) + + when defined(Windows): + # windows looks in the dir of the exe (yay!): + var nimrtlDll = DynlibFormat % "nimrtl" + safeCopyFile("lib" / nimrtlDll, "tests/dll" / nimrtlDll) + else: + # posix relies on crappy LD_LIBRARY_PATH (ugh!): + var libpath = getenv"LD_LIBRARY_PATH".string + if peg"\i '/nimrod' (!'/')* '/lib'" notin libpath: + echo "[Warning] insufficient LD_LIBRARY_PATH" + var serverDll = DynlibFormat % "server" + safeCopyFile("tests/dll" / serverDll, "lib" / serverDll) + + testSpec r, makeTest("tests/dll/client.nim", options & " -d:useNimRtl", + cat, actionRun) + +proc dllTests(r: var TResults, cat: Category, options: string) = + # dummy compile result: + var c = initResults() + + runBasicDLLTest c, r, cat, options + runBasicDLLTest c, r, cat, options & " -d:release" + runBasicDLLTest c, r, cat, options & " --gc:boehm" + runBasicDLLTest c, r, cat, options & " -d:release --gc:boehm" + +# ------------------------------ GC tests ------------------------------------- + +proc gcTests(r: var TResults, cat: Category, options: string) = + template test(filename: expr): stmt = + testSpec r, makeTest("tests/gc" / filename, options, cat, actionRun) + testSpec r, makeTest("tests/gc" / filename, options & + " -d:release", cat, actionRun) + testSpec r, makeTest("tests/gc" / filename, options & + " -d:release -d:useRealtimeGC", cat, actionRun) + testSpec r, makeTest("tests/gc" / filename, options & + " --gc:markAndSweep", cat, actionRun) + testSpec r, makeTest("tests/gc" / filename, options & + " -d:release --gc:markAndSweep", cat, actionRun) + + test "gcbench" + test "gcleak" + test "gcleak2" + test "gctest" + test "gcleak3" + test "weakrefs" + test "cycleleak" + test "closureleak" + +# ------------------------- threading tests ----------------------------------- + +proc threadTests(r: var TResults, cat: Category, options: string) = + template test(filename: expr): stmt = + testSpec r, makeTest("tests/threads" / filename, options, cat, actionRun) + testSpec r, makeTest("tests/threads" / filename, options & + " -d:release", cat, actionRun) + testSpec r, makeTest("tests/threads" / filename, options & + " --tlsEmulation:on", cat, actionRun) + + test "tactors" + test "tactors2" + test "threadex" + # deactivated because output capturing still causes problems sometimes: + #test "trecursive_actor" + #test "threadring" + #test "tthreadanalysis" + #test "tthreadsort" + test "tthreadanalysis2" + test "tthreadanalysis3" + test "tthreadheapviolation1" + +# ------------------------- IO tests ------------------------------------------ + +proc ioTests(r: var TResults, cat: Category, options: string) = + # We need readall_echo to be compiled for this test to run. + # dummy compile result: + var c = initResults() + testSpec c, makeTest("tests/system/helpers/readall_echo", options, cat) + testSpec r, makeTest("tests/system/io", options, cat) + +# ------------------------- debugger tests ------------------------------------ + +proc debuggerTests(r: var TResults, cat: Category, options: string) = + testNoSpec r, makeTest("tools/nimgrep", options & " --debugger:on", cat) + +# ------------------------- JS tests ------------------------------------------ + +proc jsTests(r: var TResults, cat: Category, options: string) = + template test(filename: expr): stmt = + testSpec r, makeTest(filename, options & " -d:nodejs", cat, + actionRun, targetJS) + testSpec r, makeTest(filename, options & " -d:nodejs -d:release", cat, + actionRun, targetJS) + + for t in os.walkFiles("tests/js/t*.nim"): + test(t) + for testfile in ["texceptions", "texcpt1", "texcsub", "tfinally", + "tfinally2", "tfinally3", "tactiontable", "tmultim1", + "tmultim3", "tmultim4"]: + test "tests/run/" & testfile & ".nim" + +# ------------------------- manyloc ------------------------------------------- +#proc runSpecialTests(r: var TResults, options: string) = +# for t in ["lib/packages/docutils/highlite"]: +# testSpec(r, t, options) + +proc findMainFile(dir: string): string = + # finds the file belonging to ".nimrod.cfg"; if there is no such file + # it returns the some ".nim" file if there is only one: + const cfgExt = ".nimrod.cfg" + result = "" + var nimFiles = 0 + for kind, file in os.walkDir(dir): + if kind == pcFile: + if file.endsWith(cfgExt): return file[.. -(cfgExt.len+1)] & ".nim" + elif file.endsWith(".nim"): + if result.len == 0: result = file + inc nimFiles + if nimFiles != 1: result.setlen(0) + +proc manyLoc(r: var TResults, cat: Category, options: string) = + for kind, dir in os.walkDir("tests/manyloc"): + if kind == pcDir: + let mainfile = findMainFile(dir) + if mainfile != ".nim": + testNoSpec r, makeTest(mainfile, options, cat) + +proc compileExample(r: var TResults, pattern, options: string, cat: Category) = + for test in os.walkFiles(pattern): + testNoSpec r, makeTest(test, options, cat) + +proc testStdlib(r: var TResults, pattern, options: string, cat: Category) = + for test in os.walkFiles(pattern): + let contents = readFile(test).string + if contents.contains("when isMainModule"): + testSpec r, makeTest(test, options, cat, actionRun) + else: + testNoSpec r, makeTest(test, options, cat, actionCompile) + +# ---------------------------------------------------------------------------- + +const AdditionalCategories = ["debugger", "tools", "examples", "stdlib"] + +proc processCategory(r: var TResults, cat: Category, options: string) = + case cat.string.normalize + of "rodfiles": + compileRodFiles(r, cat, options) + runRodFiles(r, cat, options) + of "js": + # XXX JS doesn't need to be special anymore + jsTests(r, cat, options) + of "dll": + dllTests(r, cat, options) + of "gc": + gcTests(r, cat, options) + of "debugger": + debuggerTests(r, cat, options) + of "tools": + testSpec r, makeTest("compiler/c2nim/c2nim.nim", options, cat) + testSpec r, makeTest("compiler/pas2nim/pas2nim.nim", options, cat) + of "manyloc": + manyLoc r, cat, options + of "threads": + threadTests r, cat, options & " --threads:on" + of "io": + ioTests r, cat, options + of "stdlib": + testStdlib(r, "lib/pure/*.nim", options, cat) + testStdlib(r, "lib/packages/docutils/highlite", options, cat) + of "examples": + compileExample(r, "examples/*.nim", options, cat) + compileExample(r, "examples/gtk/*.nim", options, cat) + compileExample(r, "examples/talk/*.nim", options, cat) + else: + for name in os.walkFiles(cat.string / "t*.nim"): + testSpec r, makeTest(name, options, cat) diff --git a/tests/testament/specs.nim b/tests/testament/specs.nim new file mode 100644 index 0000000000..e97015946d --- /dev/null +++ b/tests/testament/specs.nim @@ -0,0 +1,130 @@ +# +# +# Nimrod Tester +# (c) Copyright 2014 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +import parseutils, strutils, os, osproc, streams, parsecfg + +const + cmdTemplate* = r"nimrod cc --hints:on $# $#" + +type + TTestAction* = enum + actionCompile = "compile" + actionRun = "run" + actionReject = "reject" + TResultEnum* = enum + reNimrodcCrash, # nimrod compiler seems to have crashed + reMsgsDiffer, # error messages differ + reFilesDiffer, # expected and given filenames differ + reLinesDiffer, # expected and given line numbers differ + reOutputsDiffer, + reExitcodesDiffer, + reInvalidPeg, + reCodegenFailure, + reCodeNotFound, + reExeNotFound, + reIgnored, # test is ignored + reSuccess # test was successful + TTarget* = enum + targetC = "C" + targetCpp = "C++" + targetObjC = "ObjC" + targetJS = "JS" + + TSpec* = object + action*: TTestAction + file*, cmd*: string + outp*: string + line*, exitCode*: int + msg*: string + ccodeCheck*: string + err*: TResultEnum + substr*: bool + targets*: set[TTarget] + +const + targetToExt*: array[TTarget, string] = ["c", "cpp", "m", "js"] + +when not defined(parseCfgBool): + # candidate for the stdlib: + proc parseCfgBool(s: string): bool = + case normalize(s) + of "y", "yes", "true", "1", "on": result = true + of "n", "no", "false", "0", "off": result = false + else: raise newException(EInvalidValue, "cannot interpret as a bool: " & s) + +proc extractSpec(filename: string): string = + const tripleQuote = "\"\"\"" + var x = readFile(filename).string + var a = x.find(tripleQuote) + var b = x.find(tripleQuote, a+3) + # look for """ only in the first section + if a >= 0 and b > a and a < 40: + result = x.substr(a+3, b-1).replace("'''", tripleQuote) + else: + #echo "warning: file does not contain spec: " & filename + result = "" + +when not defined(nimhygiene): + {.pragma: inject.} + +template parseSpecAux(fillResult: stmt) {.immediate.} = + var ss = newStringStream(extractSpec(filename)) + var p {.inject.}: TCfgParser + open(p, ss, filename, 1) + while true: + var e {.inject.} = next(p) + case e.kind + of cfgEof: break + of cfgSectionStart, cfgOption, cfgError: + echo ignoreMsg(p, e) + of cfgKeyValuePair: + fillResult + close(p) + +proc parseSpec*(filename: string): TSpec = + result.file = filename + result.msg = "" + result.outp = "" + result.ccodeCheck = "" + result.cmd = cmdTemplate + parseSpecAux: + case normalize(e.key) + of "action": + case e.value.normalize + of "compile": result.action = actionCompile + of "run": result.action = actionRun + of "reject": result.action = actionReject + else: echo ignoreMsg(p, e) + of "file": result.file = e.value + of "line": discard parseInt(e.value, result.line) + of "output": + result.action = actionRun + result.outp = e.value + of "outputsub": + result.action = actionRun + result.outp = e.value + result.substr = true + of "exitcode": + discard parseInt(e.value, result.exitCode) + of "errormsg", "msg": + result.msg = e.value + result.action = actionReject + of "disabled": + if parseCfgBool(e.value): result.err = reIgnored + of "cmd": result.cmd = e.value + of "ccodecheck": result.ccodeCheck = e.value + of "target", "targets": + for v in e.value.normalize.split: + case v + of "c": result.targets.incl(targetC) + of "cpp", "c++": result.targets.incl(targetCpp) + of "objc": result.targets.incl(targetObjC) + of "js": result.targets.incl(targetJS) + else: echo ignoreMsg(p, e) + else: echo ignoreMsg(p, e) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim new file mode 100644 index 0000000000..2c9a32e5e5 --- /dev/null +++ b/tests/testament/tester.nim @@ -0,0 +1,267 @@ +# +# +# Nimrod Tester +# (c) Copyright 2014 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## This program verifies Nimrod against the testcases. + +import + parseutils, strutils, pegs, os, osproc, streams, parsecfg, browsers, json, + marshal, cgi, backend, parseopt, specs #, caas + +const + resultsFile = "testresults.html" + jsonFile = "testresults.json" + Usage = """Usage: + tester [options] command [arguments] + +Command: + all run all tests + c|category <category> run all the tests of a certain category + html generate $1 from the database +Arguments: + arguments are passed to the compiler +Options: + --print also print results to the console +""" % resultsFile + +type + Category = distinct string + TResults = object + total, passed, skipped: int + data: string + + TTest = object + name: string + cat: Category + options: string + target: TTarget + action: TTestAction + +# ---------------------------------------------------------------------------- + +let + pegLineError = + peg"{[^(]*} '(' {\d+} ', ' \d+ ') ' ('Error'/'Warning') ':' \s* {.*}" + pegOtherError = peg"'Error:' \s* {.*}" + pegSuccess = peg"'Hint: operation successful'.*" + pegOfInterest = pegLineError / pegOtherError + +proc callCompiler(cmdTemplate, filename, options: string): TSpec = + let c = parseCmdLine(cmdTemplate % [options, filename]) + var p = startProcess(command=c[0], args=c[1.. -1], + options={poStdErrToStdOut, poUseShell}) + let outp = p.outputStream + var suc = "" + var err = "" + var x = newStringOfCap(120) + while outp.readLine(x.TaintedString) or running(p): + if x =~ pegOfInterest: + # `err` should contain the last error/warning message + err = x + elif x =~ pegSuccess: + suc = x + close(p) + result.msg = "" + result.file = "" + result.outp = "" + result.line = -1 + if err =~ pegLineError: + result.file = extractFilename(matches[0]) + result.line = parseInt(matches[1]) + result.msg = matches[2] + elif err =~ pegOtherError: + result.msg = matches[0] + elif suc =~ pegSuccess: + result.err = reSuccess + +proc initResults: TResults = + result.total = 0 + result.passed = 0 + result.skipped = 0 + result.data = "" + +proc readResults(filename: string): TResults = + result = marshal.to[TResults](readFile(filename).string) + +proc writeResults(filename: string, r: TResults) = + writeFile(filename, $$r) + +proc `$`(x: TResults): string = + result = ("Tests passed: $1 / $3 <br />\n" & + "Tests skipped: $2 / $3 <br />\n") % + [$x.passed, $x.skipped, $x.total] + +proc addResult(r: var TResults, test: TTest, + expected, given: string, success: TResultEnum) = + let name = test.name.extractFilename & test.options + backend.writeTestResult(name = name, + category = test.cat.string, + target = $test.target, + action = $test.action, + result = $success, + expected = expected, + given = given) + r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success) + +proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) = + if strip(expected.msg) notin strip(given.msg): + r.addResult(test, expected.msg, given.msg, reMsgsDiffer) + elif extractFilename(expected.file) != extractFilename(given.file) and + "internal error:" notin expected.msg: + r.addResult(test, expected.file, given.file, reFilesDiffer) + elif expected.line != given.line and expected.line != 0: + r.addResult(test, $expected.line, $given.line, reLinesDiffer) + else: + r.addResult(test, expected.msg, given.msg, reSuccess) + inc(r.passed) + +proc generatedFile(path, name: string, target: TTarget): string = + let ext = targetToExt[target] + result = path / "nimcache" / + (if target == targetJS: path.splitPath.tail & "_" else: "") & + name.changeFileExt(ext) + +proc codegenCheck(test: TTest, check: string, given: var TSpec) = + if check.len > 0: + try: + let (path, name, ext2) = test.name.splitFile + let genFile = generatedFile(path, name, test.target) + echo genFile + let contents = readFile(genFile).string + if contents.find(check.peg) < 0: + given.err = reCodegenFailure + except EInvalidValue: + given.err = reInvalidPeg + except EIO: + given.err = reCodeNotFound + +proc testSpec(r: var TResults, test: TTest) = + # major entry point for a single test + let tname = test.name.addFileExt(".nim") + inc(r.total) + echo extractFilename(tname) + var expected = parseSpec(tname) + if expected.err == reIgnored: + r.addResult(test, "", "", reIgnored) + inc(r.skipped) + else: + case expected.action + of actionCompile: + var given = callCompiler(expected.cmd, test.name, test.options) + if given.err == reSuccess: + codegenCheck(test, expected.ccodeCheck, given) + r.addResult(test, "", given.msg, given.err) + if given.err == reSuccess: inc(r.passed) + of actionRun: + var given = callCompiler(expected.cmd, test.name, test.options) + if given.err != reSuccess: + r.addResult(test, "", given.msg, given.err) + else: + var exeFile: string + if test.target == targetJS: + let (dir, file, ext) = splitFile(tname) + exeFile = dir / "nimcache" / file & ".js" + else: + exeFile = changeFileExt(tname, ExeExt) + + if existsFile(exeFile): + var (buf, exitCode) = execCmdEx( + (if test.target==targetJS: "node " else: "") & exeFile) + if exitCode != expected.ExitCode: + r.addResult(test, "exitcode: " & $expected.exitCode, + "exitcode: " & $exitCode, reExitCodesDiffer) + else: + if strip(buf.string) != strip(expected.outp): + if not (expected.substr and expected.outp in buf.string): + given.err = reOutputsDiffer + if given.err == reSuccess: + codeGenCheck(test, expected.ccodeCheck, given) + if given.err == reSuccess: inc(r.passed) + r.addResult(test, expected.outp, buf.string, given.err) + else: + r.addResult(test, expected.outp, "executable not found", reExeNotFound) + of actionReject: + var given = callCompiler(expected.cmd, test.name, test.options) + cmpMsgs(r, expected, given, test) + +proc testNoSpec(r: var TResults, test: TTest) = + # does not extract the spec because the file is not supposed to have any + let tname = test.name.addFileExt(".nim") + inc(r.total) + echo extractFilename(tname) + let given = callCompiler(cmdTemplate, test.name, test.options) + r.addResult(test, "", given.msg, given.err) + if given.err == reSuccess: inc(r.passed) + +proc makeTest(test, options: string, cat: Category, action = actionCompile, + target = targetC): TTest = + # start with 'actionCompile', will be overwritten in the spec: + result = TTest(cat: cat, name: test, options: options, + target: target, action: action) + +include categories + +proc toJson(res: TResults): PJsonNode = + result = newJObject() + result["total"] = newJInt(res.total) + result["passed"] = newJInt(res.passed) + result["skipped"] = newJInt(res.skipped) + +proc outputJson(reject, compile, run: TResults) = + var doc = newJObject() + doc["reject"] = toJson(reject) + doc["compile"] = toJson(compile) + doc["run"] = toJson(run) + var s = pretty(doc) + writeFile(jsonFile, s) + +# proc runCaasTests(r: var TResults) = +# for test, output, status, mode in caasTestsRunner(): +# r.addResult(test, "", output & "-> " & $mode, +# if status: reSuccess else: reOutputsDiffer) + +proc main() = + os.putenv "NIMTEST_NO_COLOR", "1" + os.putenv "NIMTEST_OUTPUT_LVL", "PRINT_FAILURES" + + backend.open() + var optPrintResults = false + var p = initOptParser() + p.next() + if p.kind == cmdLongoption: + case p.key.string.normalize + of "print", "verbose": optPrintResults = true + else: quit usage + p.next() + if p.kind != cmdArgument: quit usage + var action = p.key.string.normalize + p.next() + var r = initResults() + case action + of "all": + for kind, dir in walkDir("tests"): + if kind == pcDir and dir != "testament": + processCategory(r, Category(dir), p.cmdLineRest.string) + for a in AdditionalCategories: + processCategory(r, Category(a), p.cmdLineRest.string) + of "c", "category": + var cat = Category(p.key) + p.next + processCategory(r, cat, p.cmdLineRest.string) + of "html": + quit "too implement" + else: + quit usage + + if optPrintResults: echo r, r.data + backend.close() + +if paramCount() == 0: + quit usage +main() + diff --git a/tests/reject/tdisallowif.nim b/tests/trmacros/tdisallowif.nim similarity index 100% rename from tests/reject/tdisallowif.nim rename to tests/trmacros/tdisallowif.nim diff --git a/tests/run/tanontuples.nim b/tests/tuples/tanontuples.nim similarity index 100% rename from tests/run/tanontuples.nim rename to tests/tuples/tanontuples.nim diff --git a/tests/reject/twrongtupleaccess.nim b/tests/tuples/twrongtupleaccess.nim similarity index 100% rename from tests/reject/twrongtupleaccess.nim rename to tests/tuples/twrongtupleaccess.nim diff --git a/tests/compile/tcommontype.nim b/tests/typerel/tcommontype.nim similarity index 100% rename from tests/compile/tcommontype.nim rename to tests/typerel/tcommontype.nim diff --git a/tests/reject/tno_int_in_bool_context.nim b/tests/typerel/tno_int_in_bool_context.nim similarity index 100% rename from tests/reject/tno_int_in_bool_context.nim rename to tests/typerel/tno_int_in_bool_context.nim diff --git a/tests/compile/tnoargopenarray.nim b/tests/typerel/tnoargopenarray.nim similarity index 100% rename from tests/compile/tnoargopenarray.nim rename to tests/typerel/tnoargopenarray.nim diff --git a/tests/reject/tnocontains.nim b/tests/typerel/tnocontains.nim similarity index 100% rename from tests/reject/tnocontains.nim rename to tests/typerel/tnocontains.nim diff --git a/tests/compile/trectuple.nim b/tests/typerel/trectuple.nim similarity index 100% rename from tests/compile/trectuple.nim rename to tests/typerel/trectuple.nim diff --git a/tests/compile/trectuples.nim b/tests/typerel/trectuples.nim similarity index 100% rename from tests/compile/trectuples.nim rename to tests/typerel/trectuples.nim diff --git a/tests/reject/trectype.nim b/tests/typerel/trectype.nim similarity index 100% rename from tests/reject/trectype.nim rename to tests/typerel/trectype.nim diff --git a/tests/reject/trefs.nim b/tests/typerel/trefs.nim similarity index 100% rename from tests/reject/trefs.nim rename to tests/typerel/trefs.nim diff --git a/tests/run/trettypeinference.nim b/tests/typerel/trettypeinference.nim similarity index 100% rename from tests/run/trettypeinference.nim rename to tests/typerel/trettypeinference.nim diff --git a/tests/compile/tsecondarrayproperty.nim b/tests/typerel/tsecondarrayproperty.nim similarity index 100% rename from tests/compile/tsecondarrayproperty.nim rename to tests/typerel/tsecondarrayproperty.nim diff --git a/tests/compile/ttuple1.nim b/tests/typerel/ttuple1.nim similarity index 100% rename from tests/compile/ttuple1.nim rename to tests/typerel/ttuple1.nim diff --git a/tests/reject/ttypelessemptyset.nim b/tests/typerel/ttypelessemptyset.nim similarity index 100% rename from tests/reject/ttypelessemptyset.nim rename to tests/typerel/ttypelessemptyset.nim diff --git a/tests/reject/ttypenoval.nim b/tests/typerel/ttypenoval.nim similarity index 100% rename from tests/reject/ttypenoval.nim rename to tests/typerel/ttypenoval.nim diff --git a/tests/reject/ttypenovalue.nim b/tests/typerel/ttypenovalue.nim similarity index 100% rename from tests/reject/ttypenovalue.nim rename to tests/typerel/ttypenovalue.nim diff --git a/tests/compile/tvoid.nim b/tests/typerel/tvoid.nim similarity index 100% rename from tests/compile/tvoid.nim rename to tests/typerel/tvoid.nim diff --git a/tests/compile/typalias.nim b/tests/typerel/typalias.nim similarity index 100% rename from tests/compile/typalias.nim rename to tests/typerel/typalias.nim diff --git a/tests/reject/typredef.nim b/tests/typerel/typredef.nim similarity index 100% rename from tests/reject/typredef.nim rename to tests/typerel/typredef.nim diff --git a/tests/run/tfinalobj.nim b/tests/types/tfinalobj.nim similarity index 100% rename from tests/run/tfinalobj.nim rename to tests/types/tfinalobj.nim diff --git a/tests/compile/tforwty.nim b/tests/types/tforwty.nim similarity index 100% rename from tests/compile/tforwty.nim rename to tests/types/tforwty.nim diff --git a/tests/compile/tforwty2.nim b/tests/types/tforwty2.nim similarity index 100% rename from tests/compile/tforwty2.nim rename to tests/types/tforwty2.nim diff --git a/tests/reject/tillegaltyperecursion.nim b/tests/types/tillegaltyperecursion.nim similarity index 100% rename from tests/reject/tillegaltyperecursion.nim rename to tests/types/tillegaltyperecursion.nim diff --git a/tests/reject/tillrec.nim b/tests/types/tillrec.nim similarity index 100% rename from tests/reject/tillrec.nim rename to tests/types/tillrec.nim diff --git a/tests/compile/tinheritref.nim b/tests/types/tinheritref.nim similarity index 100% rename from tests/compile/tinheritref.nim rename to tests/types/tinheritref.nim diff --git a/tests/compile/tisop.nim b/tests/types/tisop.nim similarity index 100% rename from tests/compile/tisop.nim rename to tests/types/tisop.nim diff --git a/tests/run/tisopr.nim b/tests/types/tisopr.nim similarity index 100% rename from tests/run/tisopr.nim rename to tests/types/tisopr.nim diff --git a/tests/run/tusingstatement.nim b/tests/usingstmt/tusingstatement.nim similarity index 100% rename from tests/run/tusingstatement.nim rename to tests/usingstmt/tusingstatement.nim diff --git a/tests/reject/tvarres1.nim b/tests/varres/tvarres1.nim similarity index 100% rename from tests/reject/tvarres1.nim rename to tests/varres/tvarres1.nim diff --git a/tests/reject/tvarres2.nim b/tests/varres/tvarres2.nim similarity index 100% rename from tests/reject/tvarres2.nim rename to tests/varres/tvarres2.nim diff --git a/tests/run/tvarres1.nim b/tests/varres/tvarres3.nim similarity index 100% rename from tests/run/tvarres1.nim rename to tests/varres/tvarres3.nim diff --git a/tests/run/tvarres2.nim b/tests/varres/tvarres4.nim similarity index 100% rename from tests/run/tvarres2.nim rename to tests/varres/tvarres4.nim diff --git a/tests/run/tvartup.nim b/tests/varres/tvartup.nim similarity index 100% rename from tests/run/tvartup.nim rename to tests/varres/tvartup.nim diff --git a/tests/run/tlet.nim b/tests/varstmt/tlet.nim similarity index 100% rename from tests/run/tlet.nim rename to tests/varstmt/tlet.nim diff --git a/tests/run/tvardecl.nim b/tests/varstmt/tvardecl.nim similarity index 100% rename from tests/run/tvardecl.nim rename to tests/varstmt/tvardecl.nim diff --git a/tests/compile/tconsteval.nim b/tests/vm/tconsteval.nim similarity index 100% rename from tests/compile/tconsteval.nim rename to tests/vm/tconsteval.nim diff --git a/tests/compile/teval1.nim b/tests/vm/teval1.nim similarity index 100% rename from tests/compile/teval1.nim rename to tests/vm/teval1.nim diff --git a/tests/compile/tslurp.nim b/tests/vm/tslurp.nim similarity index 100% rename from tests/compile/tslurp.nim rename to tests/vm/tslurp.nim diff --git a/tests/reject/twrongconst.nim b/tests/vm/twrongconst.nim similarity index 100% rename from tests/reject/twrongconst.nim rename to tests/vm/twrongconst.nim From 97eaeb3aec42b2bf33190a8949d4673a547cdac6 Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Mon, 13 Jan 2014 01:16:24 -0500 Subject: [PATCH 211/326] for statements support comma expressions --- compiler/c2nim/cparse.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index bf785b13fa..cfda511670 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -1583,6 +1583,8 @@ proc parseStandaloneStruct(p: var TParser, isUnion: bool): PNode = backtrackContext(p) result = declaration(p) +proc embedStmts(sl, a: PNode) + proc parseFor(p: var TParser, result: PNode) = # 'for' '(' expression_statement expression_statement expression? ')' # statement @@ -1590,7 +1592,7 @@ proc parseFor(p: var TParser, result: PNode) = eat(p, pxParLe, result) var initStmt = declarationOrStatement(p) if initStmt.kind != nkEmpty: - addSon(result, initStmt) + embedStmts(result, initStmt) var w = newNodeP(nkWhileStmt, p) var condition = expressionStatement(p) if condition.kind == nkEmpty: condition = newIdentNodeP("true", p) @@ -1600,7 +1602,7 @@ proc parseFor(p: var TParser, result: PNode) = var loopBody = nestedStatement(p) if step.kind != nkEmpty: loopBody = buildStmtList(loopBody) - addSon(loopBody, step) + embedStmts(loopBody, step) addSon(w, loopBody) addSon(result, w) From 58855c2fc71294bd08ca6637473a33389ecc7de5 Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Mon, 13 Jan 2014 01:42:26 -0500 Subject: [PATCH 212/326] Support more proper do..while statements --- compiler/c2nim/cparse.nim | 48 +++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index cfda511670..aa2dfa3e12 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -1498,19 +1498,51 @@ proc parseWhile(p: var TParser): PNode = eat(p, pxParRi, result) addSon(result, nestedStatement(p)) +proc embedStmts(sl, a: PNode) + proc parseDoWhile(p: var TParser): PNode = - # we only support ``do stmt while (0)`` as an idiom for - # ``block: stmt`` - result = newNodeP(nkBlockStmt, p) - getTok(p, result) # skip "do" - addSon(result, ast.emptyNode, nestedStatement(p)) + # parsing + result = newNodeP(nkWhileStmt, p) + getTok(p, result) + var stm = nestedStatement(p) eat(p, "while", result) eat(p, pxParLe, result) - if p.tok.xkind == pxIntLit and p.tok.iNumber == 0: getTok(p, result) - else: parMessage(p, errTokenExpected, "0") + var exp = expression(p) eat(p, pxParRi, result) if p.tok.xkind == pxSemicolon: getTok(p) + # while true: + # stmt + # if not expr: + # break + addSon(result, newIdentNodeP("true", p)) + + stm = buildStmtList(stm) + + # get the last exp if it is a stmtlist + var cleanedExp = exp + if exp.kind == nkStmtList: + cleanedExp = exp.sons[exp.len-1] + exp.sons = exp.sons[0..exp.len-2] + embedStmts(stm, exp) + + var notExp = newNodeP(nkPrefix, p) + addSon(notExp, newIdentNodeP("not", p)) + addSon(notExp, cleanedExp) + + var brkStm = newNodeP(nkBreakStmt, p) + addSon(brkStm, ast.emptyNode) + + var ifStm = newNodeP(nkIfStmt, p) + var ifBranch = newNodeP(nkElifBranch, p) + addSon(ifBranch, notExp) + addSon(ifBranch, brkStm) + addSon(ifStm, ifBranch) + + embedStmts(stm, ifStm) + + addSon(result, stm) + proc declarationOrStatement(p: var TParser): PNode = if p.tok.xkind != pxSymbol: result = expressionStatement(p) @@ -1583,8 +1615,6 @@ proc parseStandaloneStruct(p: var TParser, isUnion: bool): PNode = backtrackContext(p) result = declaration(p) -proc embedStmts(sl, a: PNode) - proc parseFor(p: var TParser, result: PNode) = # 'for' '(' expression_statement expression_statement expression? ')' # statement From 5f905865bed2080c49b29dd48decdd24c4702cc9 Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Mon, 13 Jan 2014 01:51:36 -0500 Subject: [PATCH 213/326] Fix for some comments during if statements added test files --- compiler/c2nim/cparse.nim | 2 +- compiler/c2nim/tests/vincent.c | 21 +++++++++++++++++++++ compiler/c2nim/tests/vincent.h | 3 +++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 compiler/c2nim/tests/vincent.c create mode 100644 compiler/c2nim/tests/vincent.h diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index aa2dfa3e12..30cee180a7 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -1473,12 +1473,12 @@ proc parseIf(p: var TParser): PNode = while true: getTok(p) # skip ``if`` var branch = newNodeP(nkElifBranch, p) - skipCom(p, branch) eat(p, pxParLe, branch) addSon(branch, expression(p)) eat(p, pxParRi, branch) addSon(branch, nestedStatement(p)) addSon(result, branch) + skipCom(p, branch) if p.tok.s == "else": getTok(p, result) if p.tok.s != "if": diff --git a/compiler/c2nim/tests/vincent.c b/compiler/c2nim/tests/vincent.c new file mode 100644 index 0000000000..b9436c39b3 --- /dev/null +++ b/compiler/c2nim/tests/vincent.c @@ -0,0 +1,21 @@ +#include <stdlib.h> +#include <stdio.h> + +int rand(void); + +int main() { + float f = .2, + g = 2., + h = 1.0+rand(), + i = 1.0e+3; + int j, a; + for(j = 0, a = 10; j < 0; j++, a++) ; + do { + printf("howdy"); + } while(--i, 0); + if(1) + printf("1"); // error from this comment + else + printf("2"); + return '\x00'; +} diff --git a/compiler/c2nim/tests/vincent.h b/compiler/c2nim/tests/vincent.h new file mode 100644 index 0000000000..b4e761ee14 --- /dev/null +++ b/compiler/c2nim/tests/vincent.h @@ -0,0 +1,3 @@ +struct foo { + int x,y,z; +}; From d9a61c13dd4a355a3898b4b852d078a2e1b5f0fd Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Mon, 13 Jan 2014 02:01:10 -0500 Subject: [PATCH 214/326] Fix for expression parsing, 'new' is a valid C symbol --- compiler/c2nim/cparse.nim | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index 30cee180a7..df263ee4e8 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -1152,7 +1152,7 @@ proc startExpression(p : var TParser, tok : TToken) : PNode = eat(p, pxParLe) addSon(result, typeDesc(p)) eat(p, pxParRi) - elif tok.s == "new" or tok.s == "delete" and pfCpp in p.options.flags: + elif (tok.s == "new" or tok.s == "delete") and pfCpp in p.options.flags: var opr = tok.s result = newNodeP(nkCall, p) if p.tok.xkind == pxBracketLe: @@ -2096,9 +2096,12 @@ proc statement(p: var TParser): PNode = assert result != nil proc parseUnit(p: var TParser): PNode = - result = newNodeP(nkStmtList, p) - getTok(p) # read first token - while p.tok.xkind != pxEof: - var s = statement(p) - if s.kind != nkEmpty: embedStmts(result, s) + try: + result = newNodeP(nkStmtList, p) + getTok(p) # read first token + while p.tok.xkind != pxEof: + var s = statement(p) + if s.kind != nkEmpty: embedStmts(result, s) + except: + parMessage(p, errGenerated, "Uncaught exception raised during parsing") From c648a5774abc44f14d3fca8bc7e81b60b1d96b46 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Tue, 14 Jan 2014 01:12:56 +0100 Subject: [PATCH 215/326] tester support html generation --- koch.nim | 12 +- tests/{lookup => lookups}/tredef.nim | 0 tests/testament/backend.nim | 10 +- tests/{ => testament}/caasdriver.nim | 0 tests/{ => testament}/css/boilerplate.css | 0 tests/{ => testament}/css/style.css | 0 tests/testament/htmlgen.nim | 127 ++++++++++++++++++++++ tests/testament/tester.nim | 12 +- 8 files changed, 141 insertions(+), 20 deletions(-) rename tests/{lookup => lookups}/tredef.nim (100%) rename tests/{ => testament}/caasdriver.nim (100%) rename tests/{ => testament}/css/boilerplate.css (100%) rename tests/{ => testament}/css/style.css (100%) create mode 100644 tests/testament/htmlgen.nim diff --git a/koch.nim b/koch.nim index 22e30ac5e2..f9eacfbf48 100644 --- a/koch.nim +++ b/koch.nim @@ -263,16 +263,8 @@ when defined(withUpdate): proc tests(args: string) = # we compile the tester with taintMode:on to have a basic # taint mode test :-) - exec("nimrod cc --taintMode:on tests/tester") - exec(getCurrentDir() / "tests/tester".exe & " reject") - exec(getCurrentDir() / "tests/tester".exe & " compile") - exec(getCurrentDir() / "tests/tester".exe & " run") - exec(getCurrentDir() / "tests/tester".exe & " merge") - when false: - # activate real soon: - exec("nimrod cc --taintMode:on tests/testament/tester") - exec(getCurrentDir() / "tests/testament/tester".exe & " all") - + exec("nimrod cc --taintMode:on tests/testament/tester") + exec(getCurrentDir() / "tests/testament/tester".exe & " all") proc temp(args: string) = var output = "compiler" / "nimrod".exe diff --git a/tests/lookup/tredef.nim b/tests/lookups/tredef.nim similarity index 100% rename from tests/lookup/tredef.nim rename to tests/lookups/tredef.nim diff --git a/tests/testament/backend.nim b/tests/testament/backend.nim index 65d040b24e..500535d9b8 100644 --- a/tests/testament/backend.nim +++ b/tests/testament/backend.nim @@ -1,7 +1,7 @@ # # # The Nimrod Tester -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # Look at license.txt for more info. # All rights reserved. @@ -49,10 +49,10 @@ proc createDb() = # """, []) type - MachineId = distinct int64 + MachineId* = distinct int64 CommitId = distinct int64 -proc `$`(id: MachineId): string {.borrow.} +proc `$`*(id: MachineId): string {.borrow.} proc `$`(id: CommitId): string {.borrow.} var @@ -61,7 +61,7 @@ var proc `()`(cmd: string{lit}): string = cmd.execProcess.string.strip -proc getMachine: MachineId = +proc getMachine*: MachineId = var name = "hostname"() if name.len == 0: name = when defined(posix): getenv"HOSTNAME".string @@ -73,7 +73,7 @@ proc getMachine: MachineId = if id.len > 0: result = id.parseInt.MachineId else: - result = db.insertId(sql"insert into Machine(name, os, cpu) values (?,?,?)", + result = db.insertId(sql"insert into Machine(name, os, cpu) values (?,?,?)", name, system.hostOS, system.hostCPU).MachineId proc getCommit: CommitId = diff --git a/tests/caasdriver.nim b/tests/testament/caasdriver.nim similarity index 100% rename from tests/caasdriver.nim rename to tests/testament/caasdriver.nim diff --git a/tests/css/boilerplate.css b/tests/testament/css/boilerplate.css similarity index 100% rename from tests/css/boilerplate.css rename to tests/testament/css/boilerplate.css diff --git a/tests/css/style.css b/tests/testament/css/style.css similarity index 100% rename from tests/css/style.css rename to tests/testament/css/style.css diff --git a/tests/testament/htmlgen.nim b/tests/testament/htmlgen.nim new file mode 100644 index 0000000000..6e3865bab6 --- /dev/null +++ b/tests/testament/htmlgen.nim @@ -0,0 +1,127 @@ +# +# +# Nimrod Tester +# (c) Copyright 2014 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## HTML generator for the tester. + +import db_sqlite, cgi, backend, strutils + +const + TableHeader = """<table border="1"> + <tr><td>Test</td><td>Category</td><td>Target</td> + <td>Action</td> + <td>Expected</td> + <td>Given</td> + <td>Success</td></tr>""" + TableFooter = "</table>" + HtmlBegin = """<html> + <head> + <title>Test results</title> + <style type="text/css"> + <!--""" & slurp("css/boilerplate.css") & "\n" & + slurp("css/style.css") & + """ +ul#tabs { list-style-type: none; margin: 30px 0 0 0; padding: 0 0 0.3em 0; } +ul#tabs li { display: inline; } +ul#tabs li a { color: #42454a; background-color: #dedbde; + border: 1px solid #c9c3ba; border-bottom: none; + padding: 0.3em; text-decoration: none; } +ul#tabs li a:hover { background-color: #f1f0ee; } +ul#tabs li a.selected { color: #000; background-color: #f1f0ee; + font-weight: bold; padding: 0.7em 0.3em 0.38em 0.3em; } +div.tabContent { border: 1px solid #c9c3ba; + padding: 0.5em; background-color: #f1f0ee; } +div.tabContent.hide { display: none; } + --> + </style> + <script> + + var tabLinks = new Array(); + var contentDivs = new Array(); + + function init() { + // Grab the tab links and content divs from the page + var tabListItems = document.getElementById('tabs').childNodes; + for ( var i = 0; i < tabListItems.length; i++ ) { + if ( tabListItems[i].nodeName == "LI" ) { + var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' ); + var id = getHash( tabLink.getAttribute('href') ); + tabLinks[id] = tabLink; + contentDivs[id] = document.getElementById( id ); + } + } + // Assign onclick events to the tab links, and + // highlight the first tab + var i = 0; + for ( var id in tabLinks ) { + tabLinks[id].onclick = showTab; + tabLinks[id].onfocus = function() { this.blur() }; + if ( i == 0 ) tabLinks[id].className = 'selected'; + i++; + } + // Hide all content divs except the first + var i = 0; + for ( var id in contentDivs ) { + if ( i != 0 ) contentDivs[id].className = 'tabContent hide'; + i++; + } + } + </script> + + </head> + <body onload="init()">""" + + HtmlEnd = "</body></html>" + +proc td(s: string): string = + result = "<td>" & s.substr(0, 200).XMLEncode & "</td>" + +proc generateHtml*(filename: string) = + const selRow = """select name, category, target, action, + expected, given, result + from TestResult + where [commit] = ? and machine = ? + order by category""" + var db = open(connection="testament.db", user="testament", password="", + database="testament") + var outfile = open(filename, fmWrite) + outfile.write(HtmlBegin) + let thisMachine = backend.getMachine() + outfile.write() + + let machine = db.getRow(sql"select name, os, cpu from machine where id = ?", + thisMachine) + outfile.write("<p><b>$#</b></p>" % machine.join(" ")) + + outfile.write("""<ul id="tabs">""") + + for lastCommit in db.getRow(sql"select id from [Commit] order by id desc"): + let commit = db.getValue(sql"select hash from [Commit] where id = ?", + lastCommit) + let branch = db.getValue(sql"select branch from [Commit] where id = ?", + lastCommit) + + outfile.writeln """<li><a href="#$#">$#: $#</a></li>""" % [ + lastCommit, branch, commit] + outfile.write("</ul>") + + for lastCommit in db.getRow(sql"select id from [Commit] order by id desc"): + outfile.write("""<div class="tabContent" id="$#">""" % lastCommit) + + outfile.write(TableHeader) + for row in db.rows(sql(selRow), lastCommit, thisMachine): + outfile.write("<tr>") + for x in row: + outfile.write(x.td) + outfile.write("</tr>") + + outfile.write(TableFooter) + outfile.write("</div>") + outfile.write(HtmlEnd) + close(db) + close(outfile) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 2c9a32e5e5..61d0072e32 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -10,8 +10,8 @@ ## This program verifies Nimrod against the testcases. import - parseutils, strutils, pegs, os, osproc, streams, parsecfg, browsers, json, - marshal, cgi, backend, parseopt, specs #, caas + parseutils, strutils, pegs, os, osproc, streams, parsecfg, json, + marshal, backend, parseopt, specs, htmlgen, browsers const resultsFile = "testresults.html" @@ -249,16 +249,18 @@ proc main() = processCategory(r, Category(dir), p.cmdLineRest.string) for a in AdditionalCategories: processCategory(r, Category(a), p.cmdLineRest.string) - of "c", "category": + of "c", "cat", "category": var cat = Category(p.key) p.next processCategory(r, cat, p.cmdLineRest.string) of "html": - quit "too implement" + generateHtml(resultsFile) else: quit usage - if optPrintResults: echo r, r.data + if optPrintResults: + if action == "html": openDefaultBrowser(resultsFile) + else: echo r, r.data backend.close() if paramCount() == 0: From a1713bc2f95ddfa6b042315196607f7d5a01d135 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Tue, 14 Jan 2014 01:28:52 +0100 Subject: [PATCH 216/326] tester: htmlgen almost works --- tests/testament/htmlgen.nim | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/testament/htmlgen.nim b/tests/testament/htmlgen.nim index 6e3865bab6..4abcacbd4a 100644 --- a/tests/testament/htmlgen.nim +++ b/tests/testament/htmlgen.nim @@ -71,6 +71,16 @@ div.tabContent.hide { display: none; } i++; } } + + function getFirstChildWithTagName( element, tagName ) { + for ( var i = 0; i < element.childNodes.length; i++ ) { + if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i]; + } + } + function getHash( url ) { + var hashPos = url.lastIndexOf ( '#' ); + return url.substring( hashPos + 1 ); + } </script> </head> @@ -100,7 +110,8 @@ proc generateHtml*(filename: string) = outfile.write("""<ul id="tabs">""") - for lastCommit in db.getRow(sql"select id from [Commit] order by id desc"): + for thisCommit in db.rows(sql"select id from [Commit] order by id desc"): + let lastCommit = thisCommit[0] let commit = db.getValue(sql"select hash from [Commit] where id = ?", lastCommit) let branch = db.getValue(sql"select branch from [Commit] where id = ?", @@ -110,7 +121,8 @@ proc generateHtml*(filename: string) = lastCommit, branch, commit] outfile.write("</ul>") - for lastCommit in db.getRow(sql"select id from [Commit] order by id desc"): + for thisCommit in db.rows(sql"select id from [Commit] order by id desc"): + let lastCommit = thisCommit[0] outfile.write("""<div class="tabContent" id="$#">""" % lastCommit) outfile.write(TableHeader) From d35dedf041d1ded5843a064c855e8e36dc194221 Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Tue, 14 Jan 2014 11:22:59 -0500 Subject: [PATCH 217/326] Slightly better type parsing for parameters and cast expressions --- compiler/c2nim/cparse.nim | 48 +++++++++++++++++++++++++++++----- compiler/c2nim/tests/vincent.c | 5 ++++ 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index df263ee4e8..aa9929139c 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -651,6 +651,22 @@ proc parseTypeSuffix(p: var TParser, typ: PNode): PNode = proc typeDesc(p: var TParser): PNode = result = pointer(p, typeAtom(p)) +proc abstractDeclarator(p: var TParser, a: PNode): PNode + +proc directAbstractDeclarator(p: var TParser, a: PNode): PNode = + if p.tok.xkind == pxParLe: + getTok(p, a) + if p.tok.xkind in {pxStar, pxAmp, pxAmpAmp}: + result = abstractDeclarator(p, a) + eat(p, pxParRi, result) + return parseTypeSuffix(p, a) + +proc abstractDeclarator(p: var TParser, a: PNode): PNode = + return directAbstractDeclarator(p, pointer(p, a)) + +proc typeName(p: var TParser): PNode = + return abstractDeclarator(p, typeAtom(p)) + proc parseField(p: var TParser, kind: TNodeKind): PNode = if p.tok.xkind == pxParLe: getTok(p, nil) @@ -716,18 +732,36 @@ proc parseStruct(p: var TParser, isUnion: bool): PNode = else: addSon(result, newNodeP(nkRecList, p)) +proc declarator(p: var TParser, a: PNode, ident: ptr PNode): PNode + +proc directDeclarator(p: var TParser, a: PNode, ident: ptr PNode): PNode = + case p.tok.xkind + of pxSymbol: + ident[] = skipIdent(p) + of pxParLe: + getTok(p, a) + if p.tok.xkind in {pxStar, pxAmp, pxAmpAmp, pxSymbol}: + result = declarator(p, a, ident) + eat(p, pxParRi, result) + else: + nil + return parseTypeSuffix(p, a) + +proc declarator(p: var TParser, a: PNode, ident: ptr PNode): PNode = + return directDeclarator(p, pointer(p, a), ident) + +# parameter-declaration +# declaration-specifiers declarator +# declaration-specifiers asbtract-declarator(opt) proc parseParam(p: var TParser, params: PNode) = var typ = typeDesc(p) # support for ``(void)`` parameter list: if typ.kind == nkNilLit and p.tok.xkind == pxParRi: return var name: PNode - if p.tok.xkind == pxSymbol: - name = skipIdent(p) - else: - # generate a name for the formal parameter: + typ = declarator(p, typ, addr name) + if name == nil: var idx = sonsLen(params)+1 name = newIdentNodeP("a" & $idx, p) - typ = parseTypeSuffix(p, typ) var x = newNodeP(nkIdentDefs, p) addSon(x, name, typ) if p.tok.xkind == pxAsgn: @@ -1150,7 +1184,7 @@ proc startExpression(p : var TParser, tok : TToken) : PNode = except: backtrackContext(p) eat(p, pxParLe) - addSon(result, typeDesc(p)) + addSon(result, typeName(p)) eat(p, pxParRi) elif (tok.s == "new" or tok.s == "delete") and pfCpp in p.options.flags: var opr = tok.s @@ -1200,7 +1234,7 @@ proc startExpression(p : var TParser, tok : TToken) : PNode = except: backtrackContext(p) result = newNodeP(nkCast, p) - addSon(result, typeDesc(p)) + addSon(result, typeName(p)) eat(p, pxParRi, result) addSon(result, expression(p, 139)) of pxPlusPlus: diff --git a/compiler/c2nim/tests/vincent.c b/compiler/c2nim/tests/vincent.c index b9436c39b3..a30077f77d 100644 --- a/compiler/c2nim/tests/vincent.c +++ b/compiler/c2nim/tests/vincent.c @@ -3,6 +3,11 @@ int rand(void); +int id(void (*f)(void)) { + f(); + ((void (*)(int))f)(10); +} + int main() { float f = .2, g = 2., From 53953475825e1ab743a8d02ca0fca6b4eeee3ff4 Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Tue, 14 Jan 2014 12:05:14 -0500 Subject: [PATCH 218/326] removed hack for return statement --- compiler/c2nim/cparse.nim | 16 +++++++--------- compiler/c2nim/tests/vincent.c | 7 +++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index aa9929139c..8a8eeeb059 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -2038,6 +2038,10 @@ proc parseStandaloneClass(p: var TParser, isStruct: bool): PNode = result = declaration(p) p.currentClass = oldClass +proc unwrap(a: PNode): PNode = + if a.kind == nkPar: + return a.sons[0] + return a include cpp @@ -2072,16 +2076,10 @@ proc statement(p: var TParser): PNode = of "return": result = newNodeP(nkReturnStmt, p) getTok(p) - # special case for ``return (expr)`` because I hate the redundant - # parenthesis ;-) - if p.tok.xkind == pxParLe: - getTok(p, result) - addSon(result, expression(p)) - eat(p, pxParRi, result) - elif p.tok.xkind != pxSemicolon: - addSon(result, expression(p)) - else: + if p.tok.xkind == pxSemicolon: addSon(result, ast.emptyNode) + else: + addSon(result, unwrap(expression(p))) eat(p, pxSemicolon) of "enum": result = enumSpecifier(p) of "typedef": result = parseTypeDef(p) diff --git a/compiler/c2nim/tests/vincent.c b/compiler/c2nim/tests/vincent.c index a30077f77d..24c6d6425f 100644 --- a/compiler/c2nim/tests/vincent.c +++ b/compiler/c2nim/tests/vincent.c @@ -3,9 +3,16 @@ int rand(void); +int id2(void) { + return (int *)1; +} + int id(void (*f)(void)) { f(); ((void (*)(int))f)(10); + return 10; + return (20+1); + return (int *)id; } int main() { From aec9195c95b62a5f496c878cc3e40c03b0c7104f Mon Sep 17 00:00:00 2001 From: Vincent Burns <discoloda@gmail.com> Date: Tue, 14 Jan 2014 16:35:00 -0500 Subject: [PATCH 219/326] Applied Araq's suggestions for c2nim --- compiler/c2nim/c2nim.nim | 4 ++-- compiler/c2nim/cparse.nim | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/compiler/c2nim/c2nim.nim b/compiler/c2nim/c2nim.nim index c4fc8ad672..9b12b9e47f 100644 --- a/compiler/c2nim/c2nim.nim +++ b/compiler/c2nim/c2nim.nim @@ -49,8 +49,8 @@ proc parse(infile: string, options: PParserOptions): PNode = proc main(infile, outfile: string, options: PParserOptions, spliceHeader: bool) = var start = getTime() - if spliceHeader and infile[infile.len-2 .. infile.len] == ".c" and existsFile(infile[0 .. infile.len-2] & "h"): - var header_module = parse(infile[0 .. infile.len-2] & "h", options) + if spliceHeader and infile.splitFile.ext == ".c" and existsFile(infile.changeFileExt(".h")): + var header_module = parse(infile.changeFileExt(".h"), options) var source_module = parse(infile, options) for n in source_module: addson(header_module, n) diff --git a/compiler/c2nim/cparse.nim b/compiler/c2nim/cparse.nim index 8a8eeeb059..ffab05788f 100644 --- a/compiler/c2nim/cparse.nim +++ b/compiler/c2nim/cparse.nim @@ -61,6 +61,8 @@ type TReplaceTuple* = array[0..1, string] + ERetryParsing = object of ESynch + proc newParserOptions*(): PParserOptions = new(result) result.prefixes = @[] @@ -1181,7 +1183,7 @@ proc startExpression(p : var TParser, tok : TToken) : PNode = try: addSon(result, expression(p, 139)) closeContext(p) - except: + except ERetryParsing: backtrackContext(p) eat(p, pxParLe) addSon(result, typeName(p)) @@ -1226,12 +1228,12 @@ proc startExpression(p : var TParser, tok : TToken) : PNode = result = newNodeP(nkPar, p) addSon(result, expression(p, 0)) if p.tok.xkind != pxParRi: - raise + raise newException(ERetryParsing, "expected a ')'") getTok(p, result) if p.tok.xkind in {pxSymbol, pxIntLit, pxFloatLit, pxStrLit, pxCharLit}: - raise + raise newException(ERetryParsing, "expected a non literal token") closeContext(p) - except: + except ERetryParsing: backtrackContext(p) result = newNodeP(nkCast, p) addSon(result, typeName(p)) @@ -1269,7 +1271,7 @@ proc startExpression(p : var TParser, tok : TToken) : PNode = addSon(result, expression(p, 139)) else: # probably from a failed sub expression attempt, try a type cast - raise newException(E_Base, "not " & $tok) + raise newException(ERetryParsing, "did not expect " & $tok) proc leftBindingPower(p : var TParser, tok : ref TToken) : int = #echo "lbp ", $tok[] @@ -2134,6 +2136,6 @@ proc parseUnit(p: var TParser): PNode = while p.tok.xkind != pxEof: var s = statement(p) if s.kind != nkEmpty: embedStmts(result, s) - except: - parMessage(p, errGenerated, "Uncaught exception raised during parsing") + except ERetryParsing: + parMessage(p, errGenerated, "Uncaught parsing exception raised") From db7d0e6a66f1c9fe45d4e584403f450a22fd90a3 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 12:18:46 +0100 Subject: [PATCH 220/326] Adds using statement to the one and only true index. --- doc/manual.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index 2d8feca17c..88a7f38157 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -2206,12 +2206,12 @@ Instead of: Using statement --------------- -The using statement provides syntactic convenience for procs that heavily use a -single contextual parameter. When applied to a variable or a constant, it will -instruct Nimrod to automatically consider the used symbol as a hidden leading -parameter for any procedure calls, following the using statement in the current -scope. Thus, it behaves much like the hidden `this` parameter available in some -object-oriented programming languages. +The `using statement`:idx: provides syntactic convenience for procs that +heavily use a single contextual parameter. When applied to a variable or a +constant, it will instruct Nimrod to automatically consider the used symbol as +a hidden leading parameter for any procedure calls, following the using +statement in the current scope. Thus, it behaves much like the hidden `this` +parameter available in some object-oriented programming languages. .. code-block:: nimrod From 338a93f1197fe135e31b13865ab0ef6aa9ee9864 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 12:47:01 +0100 Subject: [PATCH 221/326] Adds docstrings to lines() iterators. --- lib/system.nim | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 56bb6fe75c..0257670f4c 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2236,8 +2236,19 @@ when not defined(JS): #and not defined(NimrodVM): when hostOS != "standalone": iterator lines*(filename: string): TaintedString {.tags: [FReadIO].} = - ## Iterate over any line in the file named `filename`. - ## If the file does not exist `EIO` is raised. + ## Iterates over any line in the file named `filename`. + ## + ## If the file does not exist `EIO` is raised. The iterated lines will be + ## stripped off the trailing newline character(s). Example: + ## + ## .. code-block:: nimrod + ## import strutils + ## + ## proc transformLetters(filename: string) = + ## var buffer = "" + ## for line in filename.lines: + ## buffer.add(line.replace("a", "0") & '\x0A') + ## writeFile(filename, buffer) var f = open(filename) var res = TaintedString(newStringOfCap(80)) while f.readLine(res): yield res @@ -2245,6 +2256,17 @@ when not defined(JS): #and not defined(NimrodVM): iterator lines*(f: TFile): TaintedString {.tags: [FReadIO].} = ## Iterate over any line in the file `f`. + ## + ## The iterated lines will be stripped off the trailing newline + ## character(s). Example: + ## + ## .. code-block:: nimrod + ## proc countZeros(filename: TFile): tuple[lines, zeros: int] = + ## for line in filename.lines: + ## for letter in line: + ## if letter == '0': + ## result.zeros += 1 + ## result.lines += 1 var res = TaintedString(newStringOfCap(80)) while f.readLine(res): yield res From 9602349f308dd860f94b720f8f03476edf9cccaf Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 13:11:06 +0100 Subject: [PATCH 222/326] Adds note about procs and multiple variable assignment. --- doc/tut1.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/tut1.txt b/doc/tut1.txt index 2070c69d60..817bc69054 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -202,6 +202,12 @@ statement and all the variables will have the same value: echo "x ", x # outputs "x 42" echo "y ", y # outputs "y 3" +Note that declaring multiple variables with a single assignment which calls a +procedure can have unexpected results: the compiler will *unroll* the +assignments and end up calling the procedure several times. If the result of +the procedure depends on side effects, your variables may end up having +different values! For safety use only constant values. + Constants ========= From 0029832ba1797cf6c78defd9ece3d972929864b6 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 13:29:28 +0100 Subject: [PATCH 223/326] Adds note about iterators having same signature as procs. --- doc/tut1.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/tut1.txt b/doc/tut1.txt index 817bc69054..91bff41d74 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -813,7 +813,11 @@ important differences: However, you can also use a ``closure`` iterator to get a different set of restrictions. See `first class iterators <manual.html#first-class-iterators>`_ -for details. +for details. Iterators can have the same name and parameters as a proc, +essentially they have their own namespace. Therefore it is common practice to +wrap iterators in procs of the same name which accumulate the result of the +iterator and return it as a sequence, like ``split`` from the `strutils module +<strutils.html>`_. Basic types From 3cf46c2defb9ef92c7f7321349e41fdd3f93cc5f Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 13:34:20 +0100 Subject: [PATCH 224/326] Documents wrapping named arguments in curly braces. --- doc/subexes.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/subexes.txt b/doc/subexes.txt index 3565dbf433..10e0f4cc11 100644 --- a/doc/subexes.txt +++ b/doc/subexes.txt @@ -14,7 +14,9 @@ Thanks to its conditional construct ``$[0|1|2|else]`` it supports Notation meaning ===================== ===================================================== ``$#`` use first or next argument -``$name`` use named argument +``$name`` use named argument, you can wrap the named argument + in curly braces (eg. ``${name}``) to separate it from + the next characters. ``$1`` use first argument ``$-1`` use last argument ``${1..3}`` use arguments 1 to 3 From 74f94482cc61956bd61457ba9c7b9fd1b8c67ec9 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 14:01:00 +0100 Subject: [PATCH 225/326] Adds parseopt2 module to documentation index. --- doc/lib.txt | 7 ++++++- lib/pure/parseopt.nim | 4 ++-- web/nimrod.ini | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/lib.txt b/doc/lib.txt index 92a4a7c83c..e9aa9e857d 100644 --- a/doc/lib.txt +++ b/doc/lib.txt @@ -227,7 +227,12 @@ Parsers ------- * `parseopt <parseopt.html>`_ - The ``parseopt`` module implements a command line option parser. This + The ``parseopt`` module implements a command line option parser. + **Deprecated since version 0.9.3:** Use the `parseopt2 + <parseopt2.html>`_ module instead. + +* `parseopt2 <parseopt2.html>`_ + The ``parseopt2`` module implements a command line option parser. This supports long and short command options with optional values and command line arguments. diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index 6b2ee62825..68ae537c77 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -11,8 +11,8 @@ ## It supports one convenience iterator over all command line options and some ## lower-level features. ## -## DEPRECATED. Use parseopt2 instead as this version has issues with spaces -## in arguments. +## **Deprecated since version 0.9.3:** Use the `parseopt2 <parseopt2.html>`_ +## module instead as this version has issues with spaces in arguments. {.deprecated.} {.push debugger: off.} diff --git a/web/nimrod.ini b/web/nimrod.ini index f10a4b2f21..6942f20a99 100644 --- a/web/nimrod.ini +++ b/web/nimrod.ini @@ -45,7 +45,7 @@ srcdoc2: "impure/re;pure/sockets" srcdoc: "system/threads.nim;system/channels.nim;js/dom" srcdoc2: "pure/os;pure/strutils;pure/math;pure/matchers;pure/algorithm" srcdoc2: "pure/complex;pure/times;pure/osproc;pure/pegs;pure/dynlib" -srcdoc2: "pure/parseopt;pure/hashes;pure/strtabs;pure/lexbase" +srcdoc2: "pure/parseopt;pure/parseopt2;pure/hashes;pure/strtabs;pure/lexbase" srcdoc2: "pure/parsecfg;pure/parsexml;pure/parsecsv;pure/parsesql" srcdoc2: "pure/streams;pure/terminal;pure/cgi;impure/web;pure/unicode" srcdoc2: "impure/zipfiles;pure/htmlgen;pure/parseutils;pure/browsers" From 457497980ce9b3ac1c0da7060a65d22b825e1f9c Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 16:34:39 +0100 Subject: [PATCH 226/326] Moves mongodb module to lower level wrapper group. --- doc/lib.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/lib.txt b/doc/lib.txt index e9aa9e857d..dbe8c6a043 100644 --- a/doc/lib.txt +++ b/doc/lib.txt @@ -386,9 +386,6 @@ Database support * `db_mongo <db_mongo.html>`_ A higher level **mongodb** wrapper. -* `mongodb <mongo.html>`_ - Lower level wrapper for the **mongodb** client C library. - Other ----- @@ -588,6 +585,8 @@ Database support Contains a wrapper for the mySQL API. * `sqlite3 <sqlite3.html>`_ Contains a wrapper for SQLite 3 API. +* `mongodb <mongo.html>`_ + Lower level wrapper for the **mongodb** client C library. * `odbcsql <odbcsql.html>`_ interface to the ODBC driver. * `sphinx <sphinx.html>`_ From f3273757ed1a638f89d6b5f16258f929f434db1d Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 30 Dec 2013 16:46:41 +0100 Subject: [PATCH 227/326] Removes links to modules recently removed from stdlib. --- doc/lib.txt | 102 +--------------------------------------------------- 1 file changed, 1 insertion(+), 101 deletions(-) diff --git a/doc/lib.txt b/doc/lib.txt index dbe8c6a043..ba0cb0a905 100644 --- a/doc/lib.txt +++ b/doc/lib.txt @@ -448,45 +448,6 @@ UNIX specific * `posix <posix.html>`_ Contains a wrapper for the POSIX standard. -* `cursorfont <cursorfont.html>`_ - Part of the wrapper for X11. -* `keysym <keysym.html>`_ - Part of the wrapper for X11. -* `x <x.html>`_ - Part of the wrapper for X11. -* `xatom <xatom.html>`_ - Part of the wrapper for X11. -* `xcms <xcms.html>`_ - Part of the wrapper for X11. -* `xf86dga <xf86dga.html>`_ - Part of the wrapper for X11. -* `xf86vmode <xf86vmode.html>`_ - Part of the wrapper for X11. -* `xi <xi.html>`_ - Part of the wrapper for X11. -* `xinerama <xinerama.html>`_ - Part of the wrapper for X11. -* `xkb <xkb.html>`_ - Part of the wrapper for X11. -* `xkblib <xkblib.html>`_ - Part of the wrapper for X11. -* `xlib <xlib.html>`_ - Part of the wrapper for X11. -* `xrandr <xrandr.html>`_ - Part of the wrapper for X11. -* `xrender <xrender.html>`_ - Part of the wrapper for X11. -* `xresource <xresource.html>`_ - Part of the wrapper for X11. -* `xshm <xshm.html>`_ - Part of the wrapper for X11. -* `xutil <xutil.html>`_ - Part of the wrapper for X11. -* `xv <xv.html>`_ - Part of the wrapper for X11. -* `xvlib <xvlib.html>`_ - Part of the wrapper for X11. - * `readline <readline.html>`_ Part of the wrapper for the GNU readline library. * `history <history.html>`_ @@ -507,15 +468,6 @@ Regular expressions Graphics libraries ------------------ -* `cairo <cairo.html>`_ - Wrapper for the cairo library. -* `cairoft <cairoft.html>`_ - Wrapper for the cairoft library. -* `cairowin32 <cairowin32.html>`_ - Wrapper for the cairowin32 library. -* `cairoxlib <cairoxlib.html>`_ - Wrapper for the cairoxlib library. - * `sdl <sdl.html>`_ Part of the wrapper for SDL. * `sdl_gfx <sdl_gfx.html>`_ @@ -531,47 +483,10 @@ Graphics libraries * `smpeg <smpeg.html>`_ Part of the wrapper for SDL. -* `gl <gl.html>`_ - Part of the wrapper for OpenGL. -* `glext <glext.html>`_ - Part of the wrapper for OpenGL. -* `glu <glu.html>`_ - Part of the wrapper for OpenGL. -* `glut <glut.html>`_ - Part of the wrapper for OpenGL. -* `glx <glx.html>`_ - Part of the wrapper for OpenGL. -* `wingl <wingl.html>`_ - Part of the wrapper for OpenGL. - -* `opengl <opengl.html>`_ - New wrapper for OpenGL supporting up to version 4.2. - GUI libraries ------------- -* `atk <atk.html>`_ - Wrapper for the atk library. -* `gdk2 <gdk2.html>`_ - Wrapper for the gdk2 library. -* `gdk2pixbuf <gdk2pixbuf.html>`_ - Wrapper for the gdk2pixbuf library. -* `gdkglext <gdkglext.html>`_ - Wrapper for the gdkglext library. -* `glib2 <glib2.html>`_ - Wrapper for the glib2 library. -* `gtk2 <gtk2.html>`_ - Wrapper for the gtk2 library. -* `gtkglext <gtkglext.html>`_ - Wrapper for the gtkglext library. -* `gtkhtml <gtkhtml.html>`_ - Wrapper for the gtkhtml library. -* `libglade2 <libglade2.html>`_ - Wrapper for the libglade2 library. -* `pango <pango.html>`_ - Wrapper for the pango library. -* `pangoutils <pangoutils.html>`_ - Wrapper for the pangoutils library. + * `iup <iup.html>`_ Wrapper of the IUP GUI library. @@ -616,21 +531,6 @@ Network Programming and Internet Protocols Wrapper for OpenSSL. -Scripting languages -------------------- - -* `lua <lua.html>`_ - Part of the wrapper for Lua. -* `lualib <lualib.html>`_ - Part of the wrapper for Lua. -* `lauxlib <lauxlib.html>`_ - Part of the wrapper for Lua. -* `tcl <tcl.html>`_ - Wrapper for the TCL programming language. -* `python <python.html>`_ - Wrapper for the Python programming language. - - Data Compression and Archiving ------------------------------ From 077b8327ecefb201f0937263fc21e4a9f28c16a8 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Fri, 3 Jan 2014 22:59:57 +0100 Subject: [PATCH 228/326] Documents rstgen index related procs. --- lib/packages/docutils/rstgen.nim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index 988338da19..5afd703192 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -44,7 +44,7 @@ type splitAfter*: int # split too long entries in the TOC tocPart*: seq[TTocEntry] hasToc*: bool - theIndex: string + theIndex: string # Contents of the index file to be dumped at the end. options*: TRstParseOptions findFile*: TFindFileHandler msgHandler*: TMsgHandler @@ -111,6 +111,10 @@ proc initRstGenerator*(g: var TRstGenerator, target: TOutputTarget, for i in low(g.meta)..high(g.meta): g.meta[i] = "" proc writeIndexFile*(g: var TRstGenerator, outfile: string) = + ## Writes the current index buffer to the specified output file. + ## + ## You previously need to add entries to the index with the ``setIndexTerm`` + ## proc. If the index is empty the file won't be created. if g.theIndex.len > 0: writeFile(outfile, g.theIndex) proc addXmlChar(dest: var string, c: char) = @@ -224,6 +228,13 @@ proc renderAux(d: PDoc, n: PRstNode, frmtA, frmtB: string, result: var string) = # ---------------- index handling -------------------------------------------- proc setIndexTerm*(d: var TRstGenerator, id, term: string) = + ## Adds a `term` to the index using the specified hyperlink identifier. + ## + ## The ``d.theIndex`` string will be used to append the term in the format + ## ``term<tab>file#id``. The anchor will be the based on the name of the file + ## currently being parsed plus the `id`, which will be appended after a hash. + ## + ## The index won't be written to disk unless you call ``writeIndexFile``. d.theIndex.add(term) d.theIndex.add('\t') let htmlFile = changeFileExt(extractFilename(d.filename), HtmlExt) From 7aa263bebf946339a71cb7d153ea98d3c8302839 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 6 Jan 2014 20:41:42 +0100 Subject: [PATCH 229/326] Duplicates string literal table for character literals. Hopefully the index spamming will lead more people here. --- doc/manual.txt | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index 88a7f38157..d9849f0441 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -312,13 +312,36 @@ Character literals ------------------ Character literals are enclosed in single quotes ``''`` and can contain the -same escape sequences as strings - with one exception: ``\n`` is not allowed -as it may be wider than one character (often it is the pair CR/LF for example). +same escape sequences as strings - with one exception: `newline`:idx: (``\n``) +is not allowed as it may be wider than one character (often it is the pair +CR/LF for example). Here are the valid `escape sequences`:idx: for character +literals: + +================== =================================================== + Escape sequence Meaning +================== =================================================== + ``\r``, ``\c`` `carriage return`:idx: + ``\l`` `line feed`:idx: + ``\f`` `form feed`:idx: + ``\t`` `tabulator`:idx: + ``\v`` `vertical tabulator`:idx: + ``\\`` `backslash`:idx: + ``\"`` `quotation mark`:idx: + ``\'`` `apostrophe`:idx: + ``\`` '0'..'9'+ `character with decimal value d`:idx:; + all decimal digits directly + following are used for the character + ``\a`` `alert`:idx: + ``\b`` `backspace`:idx: + ``\e`` `escape`:idx: `[ESC]`:idx: + ``\x`` HH `character with hex value HH`:idx:; + exactly two hex digits are allowed +================== =================================================== + A character is not an Unicode character but a single byte. The reason for this is efficiency: for the overwhelming majority of use-cases, the resulting programs will still handle UTF-8 properly as UTF-8 was specially designed for -this. -Another reason is that Nimrod can thus support ``array[char, int]`` or +this. Another reason is that Nimrod can thus support ``array[char, int]`` or ``set[char]`` efficiently as many algorithms rely on this feature. From 63ab238f5d00a7d4c9501ae635efcbb28f2e4e1a Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Mon, 6 Jan 2014 20:52:30 +0100 Subject: [PATCH 230/326] Adds note about conflicts with using as a statement. --- doc/manual.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/manual.txt b/doc/manual.txt index d9849f0441..c8b1c079c2 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -2257,6 +2257,24 @@ from different modules having the same name. import windows, sdl using sdl.SetTimer +Note that ``using`` only *adds* to the current context, it doesn't remove or +replace, **neither** does it create a new scope. What this means is that if you +apply this to multiple variables the compiler will find conflicts in what +variable to use: + +.. code-block:: nimrod + var a, b = "kill it" + using a + add(" with fire") + using b + add(" with water") + echo a + echo b + +When the compiler reaches the second ``add`` call, both ``a`` and ``b`` could +be used with the proc, so you get ``Error: expression '(a|b)' has no type (or +is ambiguous)``. To solve this you would need to nest ``using`` with a +``block`` statement so as to control the reach of the ``using`` statement. If expression ------------- From 2c2174f2d0415f975adb0e1679822afe394eee7d Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Tue, 14 Jan 2014 10:38:03 +0100 Subject: [PATCH 231/326] Clarifies system.lines() docstring. Amends c087f905134b249cf20cbabc4066fbfa62dd668a. --- lib/system.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 0257670f4c..70c8a529a3 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2238,8 +2238,8 @@ when not defined(JS): #and not defined(NimrodVM): iterator lines*(filename: string): TaintedString {.tags: [FReadIO].} = ## Iterates over any line in the file named `filename`. ## - ## If the file does not exist `EIO` is raised. The iterated lines will be - ## stripped off the trailing newline character(s). Example: + ## If the file does not exist `EIO` is raised. The trailing newline + ## character(s) are removed from the iterated lines. Example: ## ## .. code-block:: nimrod ## import strutils @@ -2257,8 +2257,8 @@ when not defined(JS): #and not defined(NimrodVM): iterator lines*(f: TFile): TaintedString {.tags: [FReadIO].} = ## Iterate over any line in the file `f`. ## - ## The iterated lines will be stripped off the trailing newline - ## character(s). Example: + ## The trailing newline character(s) are removed from the iterated lines. + ## Example: ## ## .. code-block:: nimrod ## proc countZeros(filename: TFile): tuple[lines, zeros: int] = From 42f152569db36ea6894caf11189be8f6fd06a482 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Tue, 14 Jan 2014 10:46:31 +0100 Subject: [PATCH 232/326] References TRune, links unicode modules where mentioned. Amends 0f3941b0013ea5d390586719f930fcf02b929f4d. --- doc/manual.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index c8b1c079c2..f6dd1f521e 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -342,7 +342,9 @@ A character is not an Unicode character but a single byte. The reason for this is efficiency: for the overwhelming majority of use-cases, the resulting programs will still handle UTF-8 properly as UTF-8 was specially designed for this. Another reason is that Nimrod can thus support ``array[char, int]`` or -``set[char]`` efficiently as many algorithms rely on this feature. +``set[char]`` efficiently as many algorithms rely on this feature. The `TRune` +type is used for Unicode characters, it can represent any Unicode character. +``TRune`` is declared in the `unicode module <unicode.html>`_. Numerical constants @@ -773,7 +775,8 @@ designed for this. Another reason is that Nimrod can support ``array[char, int]`` or ``set[char]`` efficiently as many algorithms rely on this feature. The `TRune` type is used for Unicode characters, it can represent any Unicode -character. ``TRune`` is declared in the ``unicode`` module. +character. ``TRune`` is declared in the `unicode module <unicode.html>`_. + @@ -870,8 +873,8 @@ arrays, they can be used in case statements: Per convention, all strings are UTF-8 strings, but this is not enforced. For example, when reading strings from binary files, they are merely a sequence of bytes. The index operation ``s[i]`` means the i-th *char* of ``s``, not the -i-th *unichar*. The iterator ``runes`` from the ``unicode`` -module can be used for iteration over all Unicode characters. +i-th *unichar*. The iterator ``runes`` from the `unicode module +<unicode.html>`_ can be used for iteration over all Unicode characters. CString type From 74af6351b2b1888cc1437e158cf29851f8e6465e Mon Sep 17 00:00:00 2001 From: Hitesh Jasani <hitesh@grokken.com> Date: Thu, 16 Jan 2014 14:42:12 -0500 Subject: [PATCH 233/326] Add docs for constraining and qualifying imports. --- doc/tut1.txt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/doc/tut1.txt b/doc/tut1.txt index 2070c69d60..52d46d9bd6 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -1582,6 +1582,17 @@ rules apply: write(stdout, x(3)) # ambiguous: which `x` is to call? +Excluding symbols +----------------- + +The normal ``import`` statement will bring in all exported symbols. +These can be limited by naming symbols which should be excluded with +the ``except`` qualifier. + +.. code-block:: nimrod + import mymodule except y + + From statement -------------- @@ -1592,6 +1603,30 @@ exported symbols. An alternative that only imports listed symbols is the .. code-block:: nimrod from mymodule import x, y, z +The ``from`` statement can also force namespace qualification on +symbols, thereby making symbols available, but needing to be qualified +to be used. + +.. code-block:: nimrod + from mymodule import x, y, z + + x() # use x without any qualification + +.. code-block:: nimrod + from mymodule import nil + + mymodule.x() # must qualify x with the module name as prefix + + x() # using x here without qualification is a compile error + +Since module names are generally long to be descriptive, you can also +define a shorter alias to use when qualifying symbols. + +.. code-block:: nimrod + from mymodule as m import nil + + m.x() # m is aliasing mymodule + Include statement ----------------- From fc452787e7bba3301642c012fe8e2cdea243993b Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 17 Jan 2014 01:18:57 +0100 Subject: [PATCH 234/326] better html generator for the tester; fixes some VM bugs --- compiler/sem.nim | 29 +++++++---- compiler/semexprs.nim | 2 +- compiler/semmacrosanity.nim | 89 +++++++++++++++++++++++++++++++++ compiler/vm.nim | 33 ++++++++---- compiler/vmgen.nim | 30 +++++++++-- lib/pure/collections/tables.nim | 2 +- tests/testament/backend.nim | 3 +- tests/testament/categories.nim | 10 +++- tests/testament/htmlgen.nim | 48 ++++++++++++------ tests/testament/tester.nim | 2 +- 10 files changed, 202 insertions(+), 46 deletions(-) create mode 100644 compiler/semmacrosanity.nim diff --git a/compiler/sem.nim b/compiler/sem.nim index b53e7335c8..e89e32f4e0 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -15,7 +15,7 @@ import magicsys, parser, nversion, nimsets, semfold, importer, procfind, lookups, rodread, pragmas, passes, semdata, semtypinst, sigmatch, semthreads, intsets, transf, vmdef, vm, idgen, aliases, cgmeth, lambdalifting, - evaltempl, patterns, parampatterns, sempass2, pretty + evaltempl, patterns, parampatterns, sempass2, pretty, semmacrosanity # implementation @@ -186,16 +186,23 @@ when false: proc fixupTypeAfterEval(c: PContext, evaluated, eOrig: PNode): PNode = # recompute the types as 'eval' isn't guaranteed to construct types nor # that the types are sound: - result = semExprWithType(c, evaluated) - #result = fitNode(c, e.typ, result) inlined with special case: - let arg = result - result = indexTypesMatch(c, eOrig.typ, arg.typ, arg) - if result == nil: - result = arg - # for 'tcnstseq' we support [] to become 'seq' - if eOrig.typ.skipTypes(abstractInst).kind == tySequence and - arg.typ.skipTypes(abstractInst).kind == tyArrayConstr: - arg.typ = eOrig.typ + when true: + if eOrig.typ.kind in {tyExpr, tyStmt, tyTypeDesc}: + result = semExprWithType(c, evaluated) + else: + result = evaluated + semmacrosanity.annotateType(result, eOrig.typ) + else: + result = semExprWithType(c, evaluated) + #result = fitNode(c, e.typ, result) inlined with special case: + let arg = result + result = indexTypesMatch(c, eOrig.typ, arg.typ, arg) + if result == nil: + result = arg + # for 'tcnstseq' we support [] to become 'seq' + if eOrig.typ.skipTypes(abstractInst).kind == tySequence and + arg.typ.skipTypes(abstractInst).kind == tyArrayConstr: + arg.typ = eOrig.typ proc tryConstExpr(c: PContext, n: PNode): PNode = var e = semExprWithType(c, n) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 1f7803c95d..0d74db1ce4 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1068,7 +1068,7 @@ proc semSubscript(c: PContext, n: PNode, flags: TExprFlags): PNode = else: localError(n.info, errIndexTypesDoNotMatch) result = n - else: nil + else: discard proc semArrayAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = result = semSubscript(c, n, flags) diff --git a/compiler/semmacrosanity.nim b/compiler/semmacrosanity.nim new file mode 100644 index 0000000000..eff944baca --- /dev/null +++ b/compiler/semmacrosanity.nim @@ -0,0 +1,89 @@ +# +# +# The Nimrod Compiler +# (c) Copyright 2014 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## Implements type sanity checking for ASTs resulting from macros. Lots of +## room for improvement here. + +import ast, astalgo, msgs, types + +proc ithField(n: PNode, field: int): PSym = + result = nil + case n.kind + of nkRecList: + for i in countup(0, sonsLen(n) - 1): + result = ithField(n.sons[i], field-i) + if result != nil: return + of nkRecCase: + if n.sons[0].kind != nkSym: internalError(n.info, "ithField") + result = ithField(n.sons[0], field-1) + if result != nil: return + for i in countup(1, sonsLen(n) - 1): + case n.sons[i].kind + of nkOfBranch, nkElse: + result = ithField(lastSon(n.sons[i]), field-1) + if result != nil: return + else: internalError(n.info, "ithField(record case branch)") + of nkSym: + if field == 0: result = n.sym + else: discard + +proc annotateType*(n: PNode, t: PType) = + let x = t.skipTypes(abstractInst) + # Note: x can be unequal to t and we need to be careful to use 't' + # to not to skip tyGenericInst + case n.kind + of nkPar: + if x.kind == tyObject: + n.typ = t + for i in 0 .. <n.len: + let field = x.n.ithField(i) + if field.isNil: globalError n.info, "invalid " & $i & "th field" + else: annotateType(n.sons[i], field.typ) + elif x.kind == tyTuple: + n.typ = t + for i in 0 .. <n.len: + if i >= x.len: globalError n.info, "invalid " & $i & "th field" + else: annotateType(n.sons[i], x.sons[i]) + elif x.kind == tyProc and x.callConv == ccClosure: + n.typ = t + else: + globalError(n.info, "() must have an object or tuple type") + of nkBracket: + if x.kind in {tyArrayConstr, tyArray, tySequence, tyOpenarray}: + n.typ = t + for m in n: annotateType(m, x.elemType) + else: + globalError(n.info, "[] must have some form of array type") + of nkCurly: + if x.kind in {tySet}: + n.typ = t + for m in n: annotateType(m, x.elemType) + else: + globalError(n.info, "{} must have the set type") + of nkFloatLit..nkFloat128Lit: + if x.kind in {tyFloat..tyFloat128}: + n.typ = t + else: + globalError(n.info, "float literal must have some float type") + of nkCharLit..nkUInt64Lit: + if x.kind in {tyInt..tyUInt64, tyBool, tyChar, tyEnum}: + n.typ = t + else: + globalError(n.info, "integer literal must have some int type") + of nkStrLit..nkTripleStrLit: + if x.kind in {tyString, tyCString}: + n.typ = t + else: + globalError(n.info, "string literal must be of some string type") + of nkNilLit: + if x.kind in NilableTypes: + n.typ = t + else: + globalError(n.info, "nil literal must be of some pointer type") + else: discard diff --git a/compiler/vm.nim b/compiler/vm.nim index a670e5bd01..9ed18d29eb 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -172,7 +172,9 @@ proc asgnComplex(x, y: PNode) = else: if x.kind notin {nkEmpty..nkNilLit}: let y = y.copyValue - for i in countup(0, sonsLen(y) - 1): addSon(x, y.sons[i]) + for i in countup(0, sonsLen(y) - 1): + if i < x.len: x.sons[i] = y.sons[i] + else: addSon(x, y.sons[i]) template getstr(a: expr): expr = (if a.kind in {nkStrLit..nkTripleStrLit}: a.strVal else: $chr(int(a.intVal))) @@ -319,8 +321,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = decodeB(nkIntLit) regs[ra].intVal = regs[rb].intVal of opcAsgnStr: - decodeB(nkStrLit) - regs[ra].strVal = regs[rb].strVal + if regs[instr.regB].kind == nkNilLit: + decodeB(nkNilLit) + else: + decodeB(nkStrLit) + regs[ra].strVal = regs[rb].strVal of opcAsgnFloat: decodeB(nkFloatLit) regs[ra].floatVal = regs[rb].floatVal @@ -336,6 +341,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # a = b[c] let rb = instr.regB let rc = instr.regC + if regs[rc].intVal > high(int): + stackTrace(c, tos, pc, errIndexOutOfBounds) let idx = regs[rc].intVal.int # XXX what if the array is not 0-based? -> codegen should insert a sub assert regs[rb].kind != nkMetaNode @@ -373,7 +380,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = let rb = instr.regB let rc = instr.regC # XXX this creates a wrong alias - #Message(c.debug[pc], warnUser, $regs[rb].len & " " & $rc) + #Message(c.debug[pc], warnUser, $regs[rb].safeLen & " " & $rc) asgnComplex(regs[ra], regs[rb].sons[rc]) of opcWrObj: # a.b = c @@ -427,8 +434,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = regs[ra].intVal = regs[rb].skipMeta.len - imm of opcLenStr: decodeBImm(nkIntLit) - assert regs[rb].kind in {nkStrLit..nkTripleStrLit} - regs[ra].intVal = regs[rb].strVal.len - imm + if regs[rb].kind == nkNilLit: + stackTrace(c, tos, pc, errNilAccess) + else: + assert regs[rb].kind in {nkStrLit..nkTripleStrLit} + regs[ra].intVal = regs[rb].strVal.len - imm of opcIncl: decodeB(nkCurly) if not inSet(regs[ra], regs[rb]): addSon(regs[ra], copyTree(regs[rb])) @@ -738,11 +748,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = inc pc ensureKind(nkBracket) let instr2 = c.code[pc] - let rb = instr2.regA + let count = regs[instr2.regA].intVal.int regs[ra].typ = typ - newSeq(regs[ra].sons, rb) - for i in 0 .. <rb: - regs[ra].sons[i] = getNullValue(typ, regs[ra].info) + newSeq(regs[ra].sons, count) + for i in 0 .. <count: + regs[ra].sons[i] = getNullValue(typ.sons[0], regs[ra].info) of opcNewStr: decodeB(nkStrLit) regs[ra].strVal = newString(regs[rb].intVal.int) @@ -1044,7 +1054,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = inc pc proc fixType(result, n: PNode) {.inline.} = - # XXX do it deeply for complex values + # XXX do it deeply for complex values; there seems to be no simple + # solution except to check it deeply here. #if result.typ.isNil: result.typ = n.typ proc execute(c: PCtx, start: int): PNode = diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 6389d05081..af1991badb 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -444,21 +444,43 @@ proc genCall(c: PCtx; n: PNode; dest: var TDest) = c.freeTempRange(x, n.len) clearDest(n, dest) +proc needsAsgnPatch(n: PNode): bool = + n.kind in {nkBracketExpr, nkDotExpr, nkCheckedFieldExpr} + +proc genAsgnPatch(c: PCtx; le: PNode, value: TRegister) = + case le.kind + of nkBracketExpr: + let dest = c.genx(le.sons[0]) + let idx = c.genx(le.sons[1]) + c.gABC(le, opcWrArrRef, dest, idx, value) + of nkDotExpr, nkCheckedFieldExpr: + # XXX field checks here + let left = if le.kind == nkDotExpr: le else: le.sons[0] + let dest = c.genx(left.sons[0]) + let idx = c.genx(left.sons[1]) + c.gABC(left, opcWrObjRef, dest, idx, value) + else: + discard + proc genNew(c: PCtx; n: PNode) = - let dest = c.genx(n.sons[1]) + let dest = if needsAsgnPatch(n.sons[1]): c.getTemp(n.sons[1].typ) + else: c.genx(n.sons[1]) # we use the ref's base type here as the VM conflates 'ref object' # and 'object' since internally we already have a pointer. c.gABx(n, opcNew, dest, c.genType(n.sons[1].typ.skipTypes(abstractVar).sons[0])) + c.genAsgnPatch(n.sons[1], dest) c.freeTemp(dest) proc genNewSeq(c: PCtx; n: PNode) = - let dest = c.genx(n.sons[1]) + let dest = if needsAsgnPatch(n.sons[1]): c.getTemp(n.sons[1].typ) + else: c.genx(n.sons[1]) c.gABx(n, opcNewSeq, dest, c.genType(n.sons[1].typ.skipTypes(abstractVar))) let tmp = c.genx(n.sons[2]) c.gABx(n, opcNewSeq, tmp, 0) - c.freeTemp(dest) c.freeTemp(tmp) + c.genAsgnPatch(n.sons[1], dest) + c.freeTemp(dest) proc genUnaryABC(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode) = let tmp = c.genx(n.sons[1]) @@ -1428,7 +1450,7 @@ proc genProc(c: PCtx; s: PSym): int = c.gABC(body, opcEof, eofInstr.regA) c.optimizeJumps(result) s.offset = c.prc.maxSlots - #if s.name.s == "importImpl_forward" or s.name.s == "importImpl": + #if s.name.s == "rawGet": # c.echoCode(result) # echo renderTree(body) c.prc = oldPrc diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 4b9e8af0e8..73da274b9e 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -153,7 +153,7 @@ proc add*[A, B](t: var TTable[A, B], key: A, val: B) = proc del*[A, B](t: var TTable[A, B], key: A) = ## deletes `key` from hash table `t`. - var index = rawGet(t, key) + let index = rawGet(t, key) if index >= 0: t.data[index].slot = seDeleted dec(t.counter) diff --git a/tests/testament/backend.nim b/tests/testament/backend.nim index 500535d9b8..87ac10b1fd 100644 --- a/tests/testament/backend.nim +++ b/tests/testament/backend.nim @@ -77,7 +77,8 @@ proc getMachine*: MachineId = name, system.hostOS, system.hostCPU).MachineId proc getCommit: CommitId = - let hash = "git log -n 1"() + const commLen = "commit ".len + let hash = "git log -n 1"()[commLen..commLen+10] let branch = "git symbolic-ref --short HEAD"() if hash.len == 0 or branch.len == 0: quit "cannot determine git HEAD" diff --git a/tests/testament/categories.nim b/tests/testament/categories.nim index 68a61a973f..5dd8414470 100644 --- a/tests/testament/categories.nim +++ b/tests/testament/categories.nim @@ -221,6 +221,14 @@ proc testStdlib(r: var TResults, pattern, options: string, cat: Category) = const AdditionalCategories = ["debugger", "tools", "examples", "stdlib"] +proc `&.?`(a, b: string): string = + # candidate for the stdlib? + result = if b.startswith(a): b else: a & b + +proc `&?.`(a, b: string): string = + # candidate for the stdlib? + result = if a.endswith(b): a else: a & b + proc processCategory(r: var TResults, cat: Category, options: string) = case cat.string.normalize of "rodfiles": @@ -252,5 +260,5 @@ proc processCategory(r: var TResults, cat: Category, options: string) = compileExample(r, "examples/gtk/*.nim", options, cat) compileExample(r, "examples/talk/*.nim", options, cat) else: - for name in os.walkFiles(cat.string / "t*.nim"): + for name in os.walkFiles("tests" & DirSep &.? cat.string / "t*.nim"): testSpec r, makeTest(name, options, cat) diff --git a/tests/testament/htmlgen.nim b/tests/testament/htmlgen.nim index 4abcacbd4a..e42b880706 100644 --- a/tests/testament/htmlgen.nim +++ b/tests/testament/htmlgen.nim @@ -47,39 +47,57 @@ div.tabContent.hide { display: none; } function init() { // Grab the tab links and content divs from the page var tabListItems = document.getElementById('tabs').childNodes; - for ( var i = 0; i < tabListItems.length; i++ ) { - if ( tabListItems[i].nodeName == "LI" ) { - var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' ); - var id = getHash( tabLink.getAttribute('href') ); + for (var i = 0; i < tabListItems.length; i++) { + if (tabListItems[i].nodeName == "LI") { + var tabLink = getFirstChildWithTagName(tabListItems[i], 'A'); + var id = getHash(tabLink.getAttribute('href')); tabLinks[id] = tabLink; - contentDivs[id] = document.getElementById( id ); + contentDivs[id] = document.getElementById(id); } } // Assign onclick events to the tab links, and // highlight the first tab var i = 0; - for ( var id in tabLinks ) { + for (var id in tabLinks) { tabLinks[id].onclick = showTab; tabLinks[id].onfocus = function() { this.blur() }; - if ( i == 0 ) tabLinks[id].className = 'selected'; + if (i == 0) tabLinks[id].className = 'selected'; i++; } // Hide all content divs except the first var i = 0; - for ( var id in contentDivs ) { - if ( i != 0 ) contentDivs[id].className = 'tabContent hide'; + for (var id in contentDivs) { + if (i != 0) contentDivs[id].className = 'tabContent hide'; i++; } } - function getFirstChildWithTagName( element, tagName ) { - for ( var i = 0; i < element.childNodes.length; i++ ) { - if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i]; + function showTab() { + var selectedId = getHash(this.getAttribute('href')); + + // Highlight the selected tab, and dim all others. + // Also show the selected content div, and hide all others. + for (var id in contentDivs) { + if (id == selectedId) { + tabLinks[id].className = 'selected'; + contentDivs[id].className = 'tabContent'; + } else { + tabLinks[id].className = ''; + contentDivs[id].className = 'tabContent hide'; + } + } + // Stop the browser following the link + return false; + } + + function getFirstChildWithTagName(element, tagName) { + for (var i = 0; i < element.childNodes.length; i++) { + if (element.childNodes[i].nodeName == tagName) return element.childNodes[i]; } } - function getHash( url ) { - var hashPos = url.lastIndexOf ( '#' ); - return url.substring( hashPos + 1 ); + function getHash(url) { + var hashPos = url.lastIndexOf('#'); + return url.substring(hashPos + 1); } </script> diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 61d0072e32..8abea82248 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -245,7 +245,7 @@ proc main() = case action of "all": for kind, dir in walkDir("tests"): - if kind == pcDir and dir != "testament": + if kind == pcDir and dir notin ["testament", "testdata", "nimcache"]: processCategory(r, Category(dir), p.cmdLineRest.string) for a in AdditionalCategories: processCategory(r, Category(a), p.cmdLineRest.string) From 383fbca27ef4f4e0b5eae0e0e02029fe644248ac Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 17 Jan 2014 08:47:51 +0100 Subject: [PATCH 235/326] better tester --- compiler/semmacrosanity.nim | 4 +- lib/impure/db_sqlite.nim | 2 +- tests/{macro => macros}/tmacro1.nim | 0 tests/{macro => macros}/tmacro2.nim | 0 tests/{macro => macros}/tmacro3.nim | 0 tests/{macro => macros}/tmacro4.nim | 0 tests/{macro => macros}/tmacro5.nim | 0 tests/{macro => macros}/tmacroaspragma.nim | 0 tests/{macro => macros}/tmacrogenerics.nim | 0 tests/{macro => macros}/tmacros1.nim | 0 tests/{macro => macros}/tmacrostmt.nim | 0 tests/{macro => macros}/tmacrotypes.nim | 0 .../tnimrodnode_for_runtime.nim | 0 tests/{macro => macros}/tprintf.nim | 0 tests/{macro => macros}/tquotewords.nim | 0 tests/{macro => macros}/trecmacro.nim | 0 tests/{macro => macros}/tstringinterp.nim | 0 tests/{macro => macros}/tvtable.nim | 0 tests/testament/backend.nim | 6 +-- tests/testament/htmlgen.nim | 50 ++++++++++--------- tests/testament/tester.nim | 8 ++- 21 files changed, 39 insertions(+), 31 deletions(-) rename tests/{macro => macros}/tmacro1.nim (100%) rename tests/{macro => macros}/tmacro2.nim (100%) rename tests/{macro => macros}/tmacro3.nim (100%) rename tests/{macro => macros}/tmacro4.nim (100%) rename tests/{macro => macros}/tmacro5.nim (100%) rename tests/{macro => macros}/tmacroaspragma.nim (100%) rename tests/{macro => macros}/tmacrogenerics.nim (100%) rename tests/{macro => macros}/tmacros1.nim (100%) rename tests/{macro => macros}/tmacrostmt.nim (100%) rename tests/{macro => macros}/tmacrotypes.nim (100%) rename tests/{macro => macros}/tnimrodnode_for_runtime.nim (100%) rename tests/{macro => macros}/tprintf.nim (100%) rename tests/{macro => macros}/tquotewords.nim (100%) rename tests/{macro => macros}/trecmacro.nim (100%) rename tests/{macro => macros}/tstringinterp.nim (100%) rename tests/{macro => macros}/tvtable.nim (100%) diff --git a/compiler/semmacrosanity.nim b/compiler/semmacrosanity.nim index eff944baca..1bece95c20 100644 --- a/compiler/semmacrosanity.nim +++ b/compiler/semmacrosanity.nim @@ -43,12 +43,12 @@ proc annotateType*(n: PNode, t: PType) = n.typ = t for i in 0 .. <n.len: let field = x.n.ithField(i) - if field.isNil: globalError n.info, "invalid " & $i & "th field" + if field.isNil: globalError n.info, "invalid field at index " & $i else: annotateType(n.sons[i], field.typ) elif x.kind == tyTuple: n.typ = t for i in 0 .. <n.len: - if i >= x.len: globalError n.info, "invalid " & $i & "th field" + if i >= x.len: globalError n.info, "invalid field at index " & $i else: annotateType(n.sons[i], x.sons[i]) elif x.kind == tyProc and x.callConv == ccClosure: n.typ = t diff --git a/lib/impure/db_sqlite.nim b/lib/impure/db_sqlite.nim index c27efc3582..a3499a6df6 100644 --- a/lib/impure/db_sqlite.nim +++ b/lib/impure/db_sqlite.nim @@ -76,7 +76,7 @@ proc tryExec*(db: TDbConn, query: TSqlQuery, proc exec*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]) {. tags: [FReadDB, FWriteDb].} = ## executes the query and raises EDB if not successful. - if not TryExec(db, query, args): dbError(db) + if not tryExec(db, query, args): dbError(db) proc newRow(L: int): TRow = newSeq(result, L) diff --git a/tests/macro/tmacro1.nim b/tests/macros/tmacro1.nim similarity index 100% rename from tests/macro/tmacro1.nim rename to tests/macros/tmacro1.nim diff --git a/tests/macro/tmacro2.nim b/tests/macros/tmacro2.nim similarity index 100% rename from tests/macro/tmacro2.nim rename to tests/macros/tmacro2.nim diff --git a/tests/macro/tmacro3.nim b/tests/macros/tmacro3.nim similarity index 100% rename from tests/macro/tmacro3.nim rename to tests/macros/tmacro3.nim diff --git a/tests/macro/tmacro4.nim b/tests/macros/tmacro4.nim similarity index 100% rename from tests/macro/tmacro4.nim rename to tests/macros/tmacro4.nim diff --git a/tests/macro/tmacro5.nim b/tests/macros/tmacro5.nim similarity index 100% rename from tests/macro/tmacro5.nim rename to tests/macros/tmacro5.nim diff --git a/tests/macro/tmacroaspragma.nim b/tests/macros/tmacroaspragma.nim similarity index 100% rename from tests/macro/tmacroaspragma.nim rename to tests/macros/tmacroaspragma.nim diff --git a/tests/macro/tmacrogenerics.nim b/tests/macros/tmacrogenerics.nim similarity index 100% rename from tests/macro/tmacrogenerics.nim rename to tests/macros/tmacrogenerics.nim diff --git a/tests/macro/tmacros1.nim b/tests/macros/tmacros1.nim similarity index 100% rename from tests/macro/tmacros1.nim rename to tests/macros/tmacros1.nim diff --git a/tests/macro/tmacrostmt.nim b/tests/macros/tmacrostmt.nim similarity index 100% rename from tests/macro/tmacrostmt.nim rename to tests/macros/tmacrostmt.nim diff --git a/tests/macro/tmacrotypes.nim b/tests/macros/tmacrotypes.nim similarity index 100% rename from tests/macro/tmacrotypes.nim rename to tests/macros/tmacrotypes.nim diff --git a/tests/macro/tnimrodnode_for_runtime.nim b/tests/macros/tnimrodnode_for_runtime.nim similarity index 100% rename from tests/macro/tnimrodnode_for_runtime.nim rename to tests/macros/tnimrodnode_for_runtime.nim diff --git a/tests/macro/tprintf.nim b/tests/macros/tprintf.nim similarity index 100% rename from tests/macro/tprintf.nim rename to tests/macros/tprintf.nim diff --git a/tests/macro/tquotewords.nim b/tests/macros/tquotewords.nim similarity index 100% rename from tests/macro/tquotewords.nim rename to tests/macros/tquotewords.nim diff --git a/tests/macro/trecmacro.nim b/tests/macros/trecmacro.nim similarity index 100% rename from tests/macro/trecmacro.nim rename to tests/macros/trecmacro.nim diff --git a/tests/macro/tstringinterp.nim b/tests/macros/tstringinterp.nim similarity index 100% rename from tests/macro/tstringinterp.nim rename to tests/macros/tstringinterp.nim diff --git a/tests/macro/tvtable.nim b/tests/macros/tvtable.nim similarity index 100% rename from tests/macro/tvtable.nim rename to tests/macros/tvtable.nim diff --git a/tests/testament/backend.nim b/tests/testament/backend.nim index 87ac10b1fd..bc1f92eba7 100644 --- a/tests/testament/backend.nim +++ b/tests/testament/backend.nim @@ -49,10 +49,10 @@ proc createDb() = # """, []) type - MachineId* = distinct int64 + MachineId = distinct int64 CommitId = distinct int64 -proc `$`*(id: MachineId): string {.borrow.} +proc `$`(id: MachineId): string {.borrow.} proc `$`(id: CommitId): string {.borrow.} var @@ -61,7 +61,7 @@ var proc `()`(cmd: string{lit}): string = cmd.execProcess.string.strip -proc getMachine*: MachineId = +proc getMachine: MachineId = var name = "hostname"() if name.len == 0: name = when defined(posix): getenv"HOSTNAME".string diff --git a/tests/testament/htmlgen.nim b/tests/testament/htmlgen.nim index e42b880706..bc2d8bd37e 100644 --- a/tests/testament/htmlgen.nim +++ b/tests/testament/htmlgen.nim @@ -109,42 +109,46 @@ div.tabContent.hide { display: none; } proc td(s: string): string = result = "<td>" & s.substr(0, 200).XMLEncode & "</td>" -proc generateHtml*(filename: string) = +proc getCommit(db: TDbConn, c: int): string = + var commit = c + for thisCommit in db.rows(sql"select id from [Commit] order by id desc"): + if commit == 0: result = thisCommit[0] + inc commit + if result.isNil: + quit "cannot determine commit " & $c + +proc generateHtml*(filename: string, commit: int) = const selRow = """select name, category, target, action, expected, given, result - from TestResult - where [commit] = ? and machine = ? - order by category""" + from TestResult + where [commit] = ? and machine = ? + order by category""" var db = open(connection="testament.db", user="testament", password="", database="testament") + # search for proper commit: + let lastCommit = db.getCommit(commit) + var outfile = open(filename, fmWrite) outfile.write(HtmlBegin) - let thisMachine = backend.getMachine() - outfile.write() - let machine = db.getRow(sql"select name, os, cpu from machine where id = ?", - thisMachine) - outfile.write("<p><b>$#</b></p>" % machine.join(" ")) + let commit = db.getValue(sql"select hash from [Commit] where id = ?", + lastCommit) + let branch = db.getValue(sql"select branch from [Commit] where id = ?", + lastCommit) + outfile.write("<p><b>$# $#</b></p>" % [branch, commit]) + # generate navigation: outfile.write("""<ul id="tabs">""") - - for thisCommit in db.rows(sql"select id from [Commit] order by id desc"): - let lastCommit = thisCommit[0] - let commit = db.getValue(sql"select hash from [Commit] where id = ?", - lastCommit) - let branch = db.getValue(sql"select branch from [Commit] where id = ?", - lastCommit) - - outfile.writeln """<li><a href="#$#">$#: $#</a></li>""" % [ - lastCommit, branch, commit] + for m in db.rows(sql"select id, name, os, cpu from Machine order by id"): + outfile.writeln """<li><a href="#$#">$#: $#, $#</a></li>""" % m outfile.write("</ul>") - for thisCommit in db.rows(sql"select id from [Commit] order by id desc"): - let lastCommit = thisCommit[0] - outfile.write("""<div class="tabContent" id="$#">""" % lastCommit) + for currentMachine in db.rows(sql"select id from Machine order by id"): + let m = currentMachine[0] + outfile.write("""<div class="tabContent" id="$#">""" % m) outfile.write(TableHeader) - for row in db.rows(sql(selRow), lastCommit, thisMachine): + for row in db.rows(sql(selRow), lastCommit, m): outfile.write("<tr>") for x in row: outfile.write(x.td) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 8abea82248..54a6de2d0b 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -22,7 +22,9 @@ const Command: all run all tests c|category <category> run all the tests of a certain category - html generate $1 from the database + html [commit] generate $1 from the database; uses the latest + commit or a specific one (use -1 for the commit + before latest etc) Arguments: arguments are passed to the compiler Options: @@ -254,7 +256,9 @@ proc main() = p.next processCategory(r, cat, p.cmdLineRest.string) of "html": - generateHtml(resultsFile) + var commit = 0 + discard parseInt(p.cmdLineRest.string, commit) + generateHtml(resultsFile, commit) else: quit usage From 5073914b8697a9fd1dc38bebef434b50850f2861 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 18 Jan 2014 00:58:59 +0100 Subject: [PATCH 236/326] unittest module works again --- compiler/vmgen.nim | 13 +++++++++++-- lib/pure/unittest.nim | 11 ++++++----- lib/windows/windows.nim | 19 ------------------- tests/assert/tunittests.nim | 2 +- tests/template/utemplates.nim | 2 +- todo.txt | 1 + 6 files changed, 20 insertions(+), 28 deletions(-) diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index af1991badb..aea05bb2c1 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -204,10 +204,13 @@ proc gen(c: PCtx; n: PNode) = proc genx(c: PCtx; n: PNode): TRegister = var tmp: TDest = -1 gen(c, n, tmp) + internalAssert tmp >= 0 result = TRegister(tmp) proc clearDest(n: PNode; dest: var TDest) {.inline.} = - if isEmptyType(n.typ): dest = -1 + # stmt is different from 'void' in meta programming contexts. + # So we only set dest to -1 if 'void': + if n.typ.isNil or n.typ.kind == tyEmpty: dest = -1 proc isNotOpr(n: PNode): bool = n.kind in nkCallKinds and n.sons[0].kind == nkSym and @@ -442,7 +445,6 @@ proc genCall(c: PCtx; n: PNode; dest: var TDest) = else: c.gABC(n, opcIndCallAsgn, dest, x, n.len) c.freeTempRange(x, n.len) - clearDest(n, dest) proc needsAsgnPatch(n: PNode): bool = n.kind in {nkBracketExpr, nkDotExpr, nkCheckedFieldExpr} @@ -590,6 +592,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = unused(n, dest) var d = c.genx(n.sons[1]).TDest c.genAddSubInt(n, d, if m == mInc: opcAddInt else: opcSubInt) + c.genAsgnPatch(n.sons[1], d) c.freeTemp(d.TRegister) of mOrd, mChr, mArrToSeq: c.gen(n.sons[1], dest) of mNew, mNewFinalize: @@ -685,6 +688,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = var d = c.genx(n.sons[1]) var tmp = c.genx(n.sons[2]) c.gABC(n, if m == mSetLengthStr: opcSetLenStr else: opcSetLenSeq, d, tmp) + c.genAsgnPatch(n.sons[1], d) c.freeTemp(tmp) of mSwap: unused(n, dest) @@ -838,6 +842,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = of mNGenSym: genBinaryABC(c, n, dest, opcGenSym) of mMinI, mMaxI, mMinI64, mMaxI64, mAbsF64, mMinF64, mMaxF64, mAbsI, mAbsI64: c.genCall(n, dest) + clearDest(n, dest) of mExpandToAst: if n.len != 2: globalError(n.info, errGenerated, "expandToAst requires 1 argument") @@ -845,7 +850,10 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = if arg.kind in nkCallKinds: #if arg[0].kind != nkSym or arg[0].sym.kind notin {skTemplate, skMacro}: # "ExpandToAst: expanded symbol is no macro or template" + if dest < 0: dest = c.getTemp(n.typ) c.genCall(arg, dest) + # do not call clearDest(n, dest) here as getAst has a meta-type as such + # produces a value else: globalError(n.info, "expandToAst requires a call expression") else: @@ -1248,6 +1256,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = genMagic(c, n, dest) else: genCall(c, n, dest) + clearDest(n, dest) of nkCharLit..nkInt64Lit: if isInt16Lit(n): if dest < 0: dest = c.getTemp(n.typ) diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index f847d24f43..f5640a1b4b 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -37,8 +37,8 @@ var checkpoints: seq[string] = @[] -template TestSetupIMPL*: stmt {.immediate, dirty.} = nil -template TestTeardownIMPL*: stmt {.immediate, dirty.} = nil +template TestSetupIMPL*: stmt {.immediate, dirty.} = discard +template TestTeardownIMPL*: stmt {.immediate, dirty.} = discard proc shouldRun(testName: string): bool = result = true @@ -126,7 +126,7 @@ macro check*(conditions: stmt): stmt {.immediate.} = for i in 1 .. <exp.len: if exp[i].kind notin nnkLiterals: inc counter - var arg = newIdentNode(":p" & ($counter)) + var arg = newIdentNode(":p" & $counter) var argStr = exp[i].toStrLit if exp[i].kind in nnkCallKinds: inspectArgs(exp[i]) argsAsgns.add getAst(asgn(arg, exp[i])) @@ -146,7 +146,8 @@ macro check*(conditions: stmt): stmt {.immediate.} = var checkedStr = checked.toStrLit inspectArgs(checked) - result = getAst(rewrite(checked, checked.lineinfo, checkedStr, argsAsgns, argsPrintOuts)) + result = getAst(rewrite(checked, checked.lineinfo, checkedStr, + argsAsgns, argsPrintOuts)) of nnkStmtList: result = newNimNode(nnkStmtList) @@ -176,7 +177,7 @@ macro expect*(exceptions: varargs[expr], body: stmt): stmt {.immediate.} = checkpoint(lineInfoLit & ": Expect Failed, no exception was thrown.") fail() except errorTypes: - nil + discard var body = exp[exp.len - 1] diff --git a/lib/windows/windows.nim b/lib/windows/windows.nim index 9b55b47b92..dd743ffa4c 100644 --- a/lib/windows/windows.nim +++ b/lib/windows/windows.nim @@ -21856,15 +21856,9 @@ 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'; @@ -22362,11 +22356,6 @@ 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, @@ -22476,8 +22465,6 @@ proc TranslateMDISysAccel*(hWndClient: HWND, lpMsg: TMsg): WINBOOL{.stdcall, 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{. @@ -22847,12 +22834,6 @@ proc SUBLANGID*(lgid: int32): int32 = # return type might be wrong result = toU16(lgid) shr 10'i16 -proc LANGIDFROMLCID*(lcid: int32): int16 = - result = toU16(lcid) - -proc SORTIDFROMLCID*(lcid: int32): int16 = - result = toU16((lcid and 0x000FFFFF'i32) shr 16'i32) - proc MAKELCID*(lgid, srtid: int32): DWORD = result = toU32(srtid shl 16'i32 or lgid and 0xffff'i32) diff --git a/tests/assert/tunittests.nim b/tests/assert/tunittests.nim index c77f691d92..cbbfe63c60 100644 --- a/tests/assert/tunittests.nim +++ b/tests/assert/tunittests.nim @@ -1 +1 @@ -import utemplates, uclosures +import "../template/utemplates", "../closure/uclosures" diff --git a/tests/template/utemplates.nim b/tests/template/utemplates.nim index 68fbb23a64..38ad4f5158 100644 --- a/tests/template/utemplates.nim +++ b/tests/template/utemplates.nim @@ -18,7 +18,7 @@ test "previous definitions can be further overloaded or hidden in local scopes": check t("test") == "string" test "templates can be redefined multiple times": - template customAssert(cond: bool, msg: string): stmt = + template customAssert(cond: bool, msg: string): stmt {.immediate, dirty.} = if not cond: fail(msg) template assertion_failed(body: stmt) {.immediate.} = diff --git a/todo.txt b/todo.txt index 88bd070acc..c29638e294 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,7 @@ version 0.9.4 ============= +- ``--gc:none`` should complain about when you use the GC - ensure (ref T)(a, b) works as a type conversion and type constructor - Aporia doesn't compile under devel - document new templating symbol binding rules From d986a5adb5014e1dedf3427399f933f1b898a554 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 19 Jan 2014 01:23:38 +0100 Subject: [PATCH 237/326] make encodings.nim case consistent --- lib/pure/encodings.nim | 64 ++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/lib/pure/encodings.nim b/lib/pure/encodings.nim index bc849bfe86..94d21ed4ee 100644 --- a/lib/pure/encodings.nim +++ b/lib/pure/encodings.nim @@ -1,7 +1,7 @@ # # # Nimrod's Runtime Library -# (c) Copyright 2012 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -28,7 +28,7 @@ type ## for encoding errors when defined(windows): - proc EqEncodingNames(a, b: string): bool = + proc eqEncodingNames(a, b: string): bool = var i = 0 var j = 0 while i < a.len and j < b.len: @@ -208,31 +208,31 @@ when defined(windows): when false: # not needed yet: type - TCpInfo = object {.pure.} - MaxCharSize: int32 - DefaultChar: array[0..1, char] - LeadByte: array[0..12-1, char] + TCpInfo = object + maxCharSize: int32 + defaultChar: array[0..1, char] + leadByte: array[0..12-1, char] - proc GetCPInfo(CodePage: TCodePage, lpCPInfo: var TCpInfo): int32 {. + proc getCPInfo(codePage: TCodePage, lpCPInfo: var TCpInfo): int32 {. stdcall, importc: "GetCPInfo", dynlib: "kernel32".} proc nameToCodePage(name: string): TCodePage = var nameAsInt: int if parseInt(name, nameAsInt) == 0: nameAsInt = -1 for no, na in items(winEncodings): - if no == nameAsInt or EqEncodingNames(na, name): return TCodePage(no) + if no == nameAsInt or eqEncodingNames(na, name): return TCodePage(no) result = TCodePage(-1) proc codePageToName(c: TCodePage): string = for no, na in items(winEncodings): - if no == int(c): + if no == int(c): return if na.len != 0: na else: $no result = "" - proc GetACP(): TCodePage {.stdcall, importc: "GetACP", dynlib: "kernel32".} + proc getACP(): TCodePage {.stdcall, importc: "GetACP", dynlib: "kernel32".} - proc MultiByteToWideChar( - CodePage: TCodePage, + proc multiByteToWideChar( + codePage: TCodePage, dwFlags: int32, lpMultiByteStr: cstring, cbMultiByte: cint, @@ -240,8 +240,8 @@ when defined(windows): cchWideChar: cint): cint {. stdcall, importc: "MultiByteToWideChar", dynlib: "kernel32".} - proc WideCharToMultiByte( - CodePage: TCodePage, + proc wideCharToMultiByte( + codePage: TCodePage, dwFlags: int32, lpWideCharStr: cstring, cchWideChar: cint, @@ -321,7 +321,6 @@ proc close*(c: PConverter) = iconvClose(c) when defined(windows): - proc convert*(c: PConverter, s: string): string = ## converts `s` to `destEncoding` that was given to the converter `c`. It ## assumed that `s` is in `srcEncoding`. @@ -333,26 +332,26 @@ when defined(windows): var cap = s.len + s.len shr 2 result = newStringOfCap(cap*2) # convert to utf-16 LE - var m = MultiByteToWideChar(CodePage = c.src, dwFlags = 0'i32, + var m = multiByteToWideChar(codePage = c.src, dwFlags = 0'i32, lpMultiByteStr = cstring(s), cbMultiByte = cint(s.len), lpWideCharStr = cstring(result), cchWideChar = cint(cap)) if m == 0: # try again; ask for capacity: - cap = MultiByteToWideChar(CodePage = c.src, dwFlags = 0'i32, + cap = multiByteToWideChar(codePage = c.src, dwFlags = 0'i32, lpMultiByteStr = cstring(s), cbMultiByte = cint(s.len), lpWideCharStr = nil, cchWideChar = cint(0)) # and do the conversion properly: result = newStringOfCap(cap*2) - m = MultiByteToWideChar(CodePage = c.src, dwFlags = 0'i32, + m = multiByteToWideChar(codePage = c.src, dwFlags = 0'i32, lpMultiByteStr = cstring(s), cbMultiByte = cint(s.len), lpWideCharStr = cstring(result), cchWideChar = cint(cap)) - if m == 0: OSError() + if m == 0: osError(osLastError()) setLen(result, m*2) elif m <= cap: setLen(result, m*2) @@ -364,8 +363,8 @@ when defined(windows): # otherwise the fun starts again: cap = s.len + s.len shr 2 var res = newStringOfCap(cap) - m = WideCharToMultiByte( - CodePage = c.dest, + m = wideCharToMultiByte( + codePage = c.dest, dwFlags = 0'i32, lpWideCharStr = cstring(result), cchWideChar = cint(result.len div 2), @@ -373,8 +372,8 @@ when defined(windows): cbMultiByte = cap.cint) if m == 0: # try again; ask for capacity: - cap = WideCharToMultiByte( - CodePage = c.dest, + cap = wideCharToMultiByte( + codePage = c.dest, dwFlags = 0'i32, lpWideCharStr = cstring(result), cchWideChar = cint(result.len div 2), @@ -382,14 +381,14 @@ when defined(windows): cbMultiByte = cint(0)) # and do the conversion properly: res = newStringOfCap(cap) - m = WideCharToMultiByte( - CodePage = c.dest, + m = wideCharToMultiByte( + codePage = c.dest, dwFlags = 0'i32, lpWideCharStr = cstring(result), cchWideChar = cint(result.len div 2), lpMultiByteStr = cstring(res), cbMultiByte = cap.cint) - if m == 0: OSError() + if m == 0: osError(osLastError()) setLen(res, m) result = res elif m <= cap: @@ -399,15 +398,14 @@ when defined(windows): assert(false) # cannot happen else: - proc convert*(c: PConverter, s: string): string = result = newString(s.len) - var inLen = len(S) + var inLen = len(s) var outLen = len(result) - var src = cstring(S) + var src = cstring(s) var dst = cstring(result) var iconvres: int - while InLen > 0: + while inLen > 0: iconvres = iconv(c, src, inLen, dst, outLen) if iconvres == -1: var lerr = errno @@ -425,11 +423,11 @@ else: dst = cast[cstring](cast[int](cstring(result)) + offset) outLen = len(result) - offset else: - OSError(lerr.TOSErrorCode) + osError(lerr.TOSErrorCode) # iconv has a buffer that needs flushing, specially if the last char is # not '\0' discard iconv(c, nil, nil, dst, outlen) - if iconvres == Cint(-1) and errno == E2BIG: + if iconvres == cint(-1) and errno == E2BIG: var offset = cast[int](dst) - cast[int](cstring(result)) setLen(result, len(result)+inLen*2+5) # 5 is minimally one utf-8 char @@ -450,7 +448,7 @@ proc convert*(s: string, destEncoding = "UTF-8", finally: close(c) -when IsMainModule: +when isMainModule: let orig = "öäüß" cp1252 = convert(orig, "CP1252", "UTF-8") From 6df259f15b8507b1d7be6f72759daeb537ff7ac5 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 19 Jan 2014 01:25:23 +0100 Subject: [PATCH 238/326] 'inject' for the new symbol binding rules in templates --- compiler/semtempl.nim | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 569d92d33f..5abc3ef332 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -38,7 +38,7 @@ proc symBinding(n: PNode): TSymBinding = case whichKeyword(key.ident) of wGensym: return spGenSym of wInject: return spInject - else: nil + else: discard type TSymChoiceRule = enum @@ -106,7 +106,7 @@ proc replaceIdentBySym(n: var PNode, s: PNode) = type TemplCtx {.pure, final.} = object c: PContext - toBind, toMixin: TIntSet + toBind, toMixin, toInject: TIntSet owner: PSym proc getIdentNode(c: var TemplCtx, n: PNode): PNode = @@ -145,7 +145,18 @@ proc newGenSym(kind: TSymKind, n: PNode, c: var TemplCtx): PSym = proc addLocalDecl(c: var TemplCtx, n: var PNode, k: TSymKind) = # locals default to 'gensym': - if n.kind != nkPragmaExpr or symBinding(n.sons[1]) != spInject: + if n.kind == nkPragmaExpr and symBinding(n.sons[1]) == spInject: + # even if injected, don't produce a sym choice here: + #n = semTemplBody(c, n) + var x = n[0] + while true: + case x.kind + of nkPostfix: x = x[1] + of nkPragmaExpr: x = x[0] + of nkIdent: break + else: illFormedAst(x) + c.toInject.incl(x.ident.id) + else: let ident = getIdentNode(c, n) if not isTemplParam(c, ident): let local = newGenSym(k, ident, c) @@ -153,8 +164,6 @@ proc addLocalDecl(c: var TemplCtx, n: var PNode, k: TSymKind) = replaceIdentBySym(n, newSymNode(local, n.info)) else: replaceIdentBySym(n, ident) - else: - n = semTemplBody(c, n) proc semTemplSymbol(c: PContext, n: PNode, s: PSym): PNode = incl(s.flags, sfUsed) @@ -224,6 +233,7 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = result = n case n.kind of nkIdent: + if n.ident.id in c.toInject: return n let s = qualifiedLookUp(c.c, n, {}) if s != nil: if s.owner == c.owner and s.kind == skParam: @@ -247,7 +257,7 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode = of nkMixinStmt: result = semMixinStmt(c.c, n, c.toMixin) of nkEmpty, nkSym..nkNilLit: - nil + discard of nkIfStmt: for i in countup(0, sonsLen(n)-1): var it = n.sons[i] @@ -457,6 +467,7 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = var ctx: TemplCtx ctx.toBind = initIntSet() ctx.toMixin = initIntSet() + ctx.toInject = initIntSet() ctx.c = c ctx.owner = s if sfDirty in s.flags: @@ -598,6 +609,7 @@ proc semPattern(c: PContext, n: PNode): PNode = var ctx: TemplCtx ctx.toBind = initIntSet() ctx.toMixin = initIntSet() + ctx.toInject = initIntSet() ctx.c = c ctx.owner = getCurrOwner() result = flattenStmts(semPatternBody(ctx, n)) From a59939d29500f7a00cfd45b4990c5e34a9548add Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 19 Jan 2014 01:25:48 +0100 Subject: [PATCH 239/326] it's the year 2014 --- compiler/astalgo.nim | 14 +++++++------- compiler/cgen.nim | 8 ++++---- compiler/commands.nim | 2 +- compiler/jsgen.nim | 4 ++-- compiler/main.nim | 2 +- compiler/semgnrc.nim | 6 +++--- compiler/semthreads.nim | 4 ++-- todo.txt | 10 ++++------ 8 files changed, 24 insertions(+), 26 deletions(-) diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 110ee191f9..2505bc6879 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -455,18 +455,18 @@ proc nextTry(h, maxHash: THash): THash = # generates each int in range(maxHash) exactly once (see any text on # random-number generation for proof). -proc objectSetContains(t: TObjectSet, obj: PObject): bool = +proc objectSetContains(t: TObjectSet, obj: PObject): bool = # returns true whether n is in t var h: THash = hashNode(obj) and high(t.data) # start with real hash value - while t.data[h] != nil: - if (t.data[h] == obj): + while t.data[h] != nil: + if t.data[h] == obj: return true h = nextTry(h, high(t.data)) result = false -proc objectSetRawInsert(data: var TObjectSeq, obj: PObject) = +proc objectSetRawInsert(data: var TObjectSeq, obj: PObject) = var h: THash = hashNode(obj) and high(data) - while data[h] != nil: + while data[h] != nil: assert(data[h] != obj) h = nextTry(h, high(data)) assert(data[h] == nil) @@ -475,7 +475,7 @@ proc objectSetRawInsert(data: var TObjectSeq, obj: PObject) = proc objectSetEnlarge(t: var TObjectSet) = var n: TObjectSeq newSeq(n, len(t.data) * GrowthFactor) - for i in countup(0, high(t.data)): + for i in countup(0, high(t.data)): if t.data[i] != nil: objectSetRawInsert(n, t.data[i]) swap(t.data, n) @@ -699,7 +699,7 @@ proc idTableRawGet(t: TIdTable, key: int): int = var h: THash h = key and high(t.data) # start with real hash value while t.data[h].key != nil: - if (t.data[h].key.id == key): + if t.data[h].key.id == key: return h h = nextTry(h, high(t.data)) result = - 1 diff --git a/compiler/cgen.nim b/compiler/cgen.nim index b08647512a..c7de1091b6 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -914,18 +914,18 @@ proc addIntTypes(result: var PRope) {.inline.} = proc getCopyright(cfilenoext: string): PRope = if optCompileOnly in gGlobalOptions: result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & - "/* (c) 2012 Andreas Rumpf */$n" & + "/* (c) 2014 Andreas Rumpf */$n" & "/* The generated code is subject to the original license. */$n", "; Generated by Nimrod Compiler v$1$n" & "; (c) 2012 Andreas Rumpf$n", [toRope(VersionAsString)]) else: result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & - "/* (c) 2012 Andreas Rumpf */$n" & + "/* (c) 2014 Andreas Rumpf */$n" & "/* The generated code is subject to the original license. */$n" & "/* Compiled for: $2, $3, $4 */$n" & "/* Command for C compiler:$n $5 */$n", "; Generated by Nimrod Compiler v$1$n" & - "; (c) 2012 Andreas Rumpf$n" & + "; (c) 2014 Andreas Rumpf$n" & "; Compiled for: $2, $3, $4$n" & "; Command for LLVM compiler:$n $5$n", [toRope(VersionAsString), toRope(platform.OS[targetOS].name), diff --git a/compiler/commands.nim b/compiler/commands.nim index 7179b07c1a..18bdb54d3a 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -28,7 +28,7 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) const HelpMessage = "Nimrod Compiler Version $1 (" & CompileDate & ") [$2: $3]\n" & - "Copyright (c) 2004-2013 by Andreas Rumpf\n" + "Copyright (c) 2006-2014 by Andreas Rumpf\n" const Usage = slurp"doc/basicopt.txt".replace("//", "") diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index b4e696d0a5..dd06b0235f 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -1652,7 +1652,7 @@ proc newModule(module: PSym): BModule = proc genHeader(): PRope = result = ropef("/* Generated by the Nimrod Compiler v$1 */$n" & - "/* (c) 2013 Andreas Rumpf */$n$n" & + "/* (c) 2014 Andreas Rumpf */$n$n" & "$nvar Globals = this;$n" & "var framePtr = null;$n" & "var excHandler = null;$n", diff --git a/compiler/main.nim b/compiler/main.nim index 4cea24f9da..cdea7b5ca9 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index b40e86cbfc..89a167b960 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -103,7 +103,7 @@ proc semGenericStmt(c: PContext, n: PNode, # not work. Copying the symbol does not work either because we're already # the owner of the symbol! What we need to do is to copy the symbol # in the generic instantiation process... - nil + discard of nkBind: result = semGenericStmt(c, n.sons[0], flags+{withinBind}, ctx) of nkMixinStmt: @@ -271,7 +271,7 @@ proc semGenericStmt(c: PContext, n: PNode, else: illFormedAst(n) addDecl(c, newSymS(skUnknown, getIdentNode(a.sons[i]), c)) of nkObjectTy, nkTupleTy: - nil + discard of nkFormalParams: checkMinSonsLen(n, 1) if n.sons[0].kind != nkEmpty: @@ -304,7 +304,7 @@ proc semGenericStmt(c: PContext, n: PNode, else: body = n.sons[bodyPos] n.sons[bodyPos] = semGenericStmtScope(c, body, flags, ctx) closeScope(c) - of nkPragma, nkPragmaExpr: nil + of nkPragma, nkPragmaExpr: discard of nkExprColonExpr, nkExprEqExpr: checkMinSonsLen(n, 2) result.sons[1] = semGenericStmt(c, n.sons[1], flags, ctx) diff --git a/compiler/semthreads.nim b/compiler/semthreads.nim index c96acf2f18..f7322db80d 100644 --- a/compiler/semthreads.nim +++ b/compiler/semthreads.nim @@ -160,7 +160,7 @@ proc writeAccess(c: PProcCtx, n: PNode, owner: TThreadOwner) = # we could not backtrack to a concrete symbol, but that's fine: var lastOwner = analyse(c, n) case lastOwner - of toNil: nil # fine, toNil can be overwritten + of toNil: discard # fine, toNil can be overwritten of toVoid, toUndefined: internalError(n.info, "writeAccess") of toTheirs: message(n.info, warnWriteToForeignHeap) of toMine: @@ -369,7 +369,7 @@ proc analyse(c: PProcCtx, n: PNode): TThreadOwner = result = toMine of nkAsmStmt, nkPragma, nkIteratorDef, nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, - nkGotoState, nkState, nkBreakState, nkType: + nkGotoState, nkState, nkBreakState, nkType, nkIdent: result = toVoid of nkExprColonExpr: result = analyse(c, n.sons[1]) diff --git a/todo.txt b/todo.txt index c29638e294..067c376ad0 100644 --- a/todo.txt +++ b/todo.txt @@ -1,13 +1,12 @@ version 0.9.4 ============= -- ``--gc:none`` should complain about when you use the GC -- ensure (ref T)(a, b) works as a type conversion and type constructor -- Aporia doesn't compile under devel -- document new templating symbol binding rules -- make '--implicitStatic:on' the default - test&finish first class iterators: * nested iterators +- ``--gc:none`` should complain about when you use the GC +- ensure (ref T)(a, b) works as a type conversion and type constructor +- document new templating symbol binding rules +- make '--implicitStatic:on' the default - special rule for ``[]=`` - ``=`` should be overloadable; requires specialization for ``=``; general @@ -34,7 +33,6 @@ Bugs - blocks can "export" an identifier but the CCG generates {} for them ... - osproc execProcesses can deadlock if all processes fail (as experienced in c++ mode) -- result = result shr 8 for the "system()" wrapper version 0.9.x From 73c6efdf66dd62370cb04f7ce75640743905edc5 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 19 Jan 2014 16:54:59 +0100 Subject: [PATCH 240/326] 'nil' as a statement is deprecated, use an empty 'discard' instead --- compiler/aliases.nim | 8 +++--- compiler/ast.nim | 2 +- compiler/ccgcalls.nim | 2 +- compiler/ccgexprs.nim | 8 +++--- compiler/ccgmerge.nim | 2 +- compiler/ccgtrav.nim | 2 +- compiler/ccgtypes.nim | 4 +-- compiler/cgen.nim | 4 +-- compiler/cgmeth.nim | 2 +- compiler/depends.nim | 2 +- compiler/docgen2.nim | 4 +-- compiler/filter_tmpl.nim | 2 +- compiler/guards.nim | 2 +- compiler/hlo.nim | 2 +- compiler/jsgen.nim | 20 ++++++------- compiler/lambdalifting.nim | 22 +++++++-------- compiler/lexer.nim | 2 +- compiler/lookups.nim | 2 +- compiler/msgs.nim | 12 ++++---- compiler/nimconf.nim | 6 ++-- compiler/nimrod.nimrod.cfg | 2 ++ compiler/parser.nim | 2 +- compiler/passaux.nim | 2 +- compiler/patterns.nim | 4 +-- compiler/procfind.nim | 2 +- compiler/renderer.nim | 8 +++--- compiler/rodread.nim | 2 +- compiler/rodwrite.nim | 2 +- compiler/semcall.nim | 2 +- compiler/semexprs.nim | 45 +++++++++++++++--------------- compiler/semfold.nim | 4 +-- compiler/semmagic.nim | 2 +- compiler/semstmts.nim | 10 ++++--- compiler/semtypes.nim | 12 ++++---- compiler/semtypinst.nim | 4 +-- compiler/sigmatch.nim | 32 ++++++++++----------- compiler/suggest.nim | 2 +- compiler/transf.nim | 4 +-- compiler/types.nim | 8 +++--- doc/manual.txt | 2 +- doc/tut1.txt | 10 +++---- doc/tut2.txt | 25 ++++++++--------- lib/packages/docutils/highlite.nim | 4 +-- lib/packages/docutils/rst.nim | 12 ++++---- lib/packages/docutils/rstgen.nim | 2 +- lib/pure/json.nim | 3 +- lib/pure/osproc.nim | 2 +- lib/pure/parseutils.nim | 2 +- lib/pure/sockets.nim | 2 +- lib/pure/streams.nim | 2 +- lib/pure/strutils.nim | 2 +- lib/pure/times.nim | 2 +- lib/system/gc.nim | 6 +--- web/news.txt | 5 ++-- 54 files changed, 170 insertions(+), 170 deletions(-) diff --git a/compiler/aliases.nim b/compiler/aliases.nim index 5be7b5f124..a26b94303b 100644 --- a/compiler/aliases.nim +++ b/compiler/aliases.nim @@ -54,7 +54,7 @@ proc isPartOfAux(a, b: PType, marker: var TIntSet): TAnalysisResult = for i in countup(0, sonsLen(a) - 1): result = isPartOfAux(a.sons[i], b, marker) if result == arYes: return - else: nil + else: discard proc isPartOf(a, b: PType): TAnalysisResult = ## checks iff 'a' can be part of 'b'. Iterates over VALUE types! @@ -140,7 +140,7 @@ proc isPartOf*(a, b: PNode): TAnalysisResult = result = isPartOf(a[1], b[1]) of nkObjUpConv, nkObjDownConv, nkCheckedFieldExpr: result = isPartOf(a[0], b[0]) - else: nil + else: discard # Calls return a new location, so a default of ``arNo`` is fine. else: # go down recursively; this is quite demanding: @@ -177,6 +177,6 @@ proc isPartOf*(a, b: PNode): TAnalysisResult = if isPartOf(a.typ, b.typ) != arNo: result = isPartOf(a[0], b) if result == arNo: result = arMaybe - else: nil - else: nil + else: discard + else: discard diff --git a/compiler/ast.nim b/compiler/ast.nim index 1d356b6d89..0e351a31ac 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1257,7 +1257,7 @@ proc propagateToOwner*(owner, elem: PType) = owner.flags.incl tfNeedsInit if tfNeedsInit in elem.flags: - if owner.kind in HaveTheirOwnEmpty: nil + if owner.kind in HaveTheirOwnEmpty: discard else: owner.flags.incl tfNeedsInit if tfShared in elem.flags: diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index ec12501559..1c6eea6218 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -73,7 +73,7 @@ proc isInCurrentFrame(p: BProc, n: PNode): bool = result = false of nkObjUpConv, nkObjDownConv, nkCheckedFieldExpr: result = isInCurrentFrame(p, n.sons[0]) - else: nil + else: discard proc openArrayLoc(p: BProc, n: PNode): PRope = var a: TLoc diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 22a00cf292..9554c6b557 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -202,7 +202,7 @@ proc asgnComplexity(n: PNode): int = of nkRecList: for t in items(n): result += asgnComplexity(t) - else: nil + else: discard proc optAsgnLoc(a: TLoc, t: PType, field: PRope): TLoc = result.k = locField @@ -228,7 +228,7 @@ proc genOptAsgnObject(p: BProc, dest, src: TLoc, flags: TAssignmentFlags, optAsgnLoc(src, field.typ, field.loc.r), flags) of nkRecList: for child in items(t): genOptAsgnObject(p, dest, src, flags, child) - else: nil + else: discard proc genGenericAsgn(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = # Consider: @@ -1901,7 +1901,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = of nkClosure: genClosure(p, n, d) of nkMetaNode: expr(p, n.sons[0], d) - of nkEmpty: nil + of nkEmpty: discard of nkWhileStmt: genWhileStmt(p, n) of nkVarSection, nkLetSection: genVarStmt(p, n) of nkConstSection: genConstStmt(p, n) @@ -1931,7 +1931,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = of nkCommentStmt, nkIteratorDef, nkIncludeStmt, nkImportStmt, nkImportExceptStmt, nkExportStmt, nkExportExceptStmt, nkFromStmt, nkTemplateDef, nkMacroDef: - nil + discard of nkPragma: genPragma(p, n) of nkProcDef, nkMethodDef, nkConverterDef: if (n.sons[genericParamsPos].kind == nkEmpty): diff --git a/compiler/ccgmerge.nim b/compiler/ccgmerge.nim index 514b77b731..5b04f13588 100644 --- a/compiler/ccgmerge.nim +++ b/compiler/ccgmerge.nim @@ -285,7 +285,7 @@ proc readMergeSections(cfilename: string, m: var TMergeSections) = withCFile(cfilename): readKey(L, k) if k == "NIM_merge_INFO": - nil + discard elif ^L.bufpos == '*' and ^(L.bufpos+1) == '/': inc(L.bufpos, 2) # read back into section diff --git a/compiler/ccgtrav.nim b/compiler/ccgtrav.nim index ecf1eb152e..26f4746598 100644 --- a/compiler/ccgtrav.nim +++ b/compiler/ccgtrav.nim @@ -83,7 +83,7 @@ proc genTraverseProc(c: var TTraversalClosure, accessor: PRope, typ: PType) = if typ.callConv == ccClosure: lineCg(p, cpsStmts, c.visitorFrmt, rfmt(nil, "$1.ClEnv", accessor)) else: - nil + discard proc genTraverseProcSeq(c: var TTraversalClosure, accessor: PRope, typ: PType) = var p = c.p diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 79f10b9818..c92c15fa91 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -25,7 +25,7 @@ proc mangleField(name: string): string = of 'A'..'Z': add(result, chr(ord(name[i]) - ord('A') + ord('a'))) of '_': - nil + discard of 'a'..'z', '0'..'9': add(result, name[i]) else: @@ -48,7 +48,7 @@ proc mangle(name: string): string = of 'A'..'Z': add(result, chr(ord(name[i]) - ord('A') + ord('a'))) of '_': - nil + discard of 'a'..'z', '0'..'9': add(result, name[i]) else: diff --git a/compiler/cgen.nim b/compiler/cgen.nim index c7de1091b6..0e6e483998 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -319,7 +319,7 @@ proc genObjectInit(p: BProc, section: TCProcSection, t: PType, a: TLoc, takeAddr: bool) = case analyseObjectWithTypeField(t) of frNone: - nil + discard of frHeader: var r = rdLoc(a) if not takeAddr: r = ropef("(*$1)", [r]) @@ -832,7 +832,7 @@ proc genProcNoForward(m: BModule, prc: PSym) = discard cgsym(m, prc.name.s) return genProcPrototype(m, prc) - if lfNoDecl in prc.loc.flags: nil + if lfNoDecl in prc.loc.flags: discard elif prc.typ.callConv == ccInline: # We add inline procs to the calling module to enable C based inlining. # This also means that a check with ``q.declaredThings`` is wrong, we need diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim index 9613eb525e..1c5ce7a215 100644 --- a/compiler/cgmeth.nim +++ b/compiler/cgmeth.nim @@ -66,7 +66,7 @@ proc sameMethodBucket(a, b: PSym): bool = if sameType(aa, bb) or (aa.kind == tyObject) and (bb.kind == tyObject) and (inheritanceDiff(bb, aa) < 0): - nil + discard else: return result = true diff --git a/compiler/depends.nim b/compiler/depends.nim index 5b02275c6a..a43eaf844f 100644 --- a/compiler/depends.nim +++ b/compiler/depends.nim @@ -39,7 +39,7 @@ proc addDotDependency(c: PPassContext, n: PNode): PNode = of nkStmtList, nkBlockStmt, nkStmtListExpr, nkBlockExpr: for i in countup(0, sonsLen(n) - 1): discard addDotDependency(c, n.sons[i]) else: - nil + discard proc generateDot(project: string) = writeRope(ropef("digraph $1 {$n$2}$n", [ diff --git a/compiler/docgen2.nim b/compiler/docgen2.nim index d48f53d151..d76be8e3cb 100644 --- a/compiler/docgen2.nim +++ b/compiler/docgen2.nim @@ -27,7 +27,7 @@ proc close(p: PPassContext, n: PNode): PNode = try: generateIndex(g.doc) except EIO: - nil + discard proc processNode(c: PPassContext, n: PNode): PNode = result = n @@ -46,4 +46,4 @@ proc myOpen(module: PSym): PPassContext = const docgen2Pass* = makePass(open = myOpen, process = processNode, close = close) proc finishDoc2Pass*(project: string) = - nil + discard diff --git a/compiler/filter_tmpl.nim b/compiler/filter_tmpl.nim index 8067541221..0014e9c78d 100644 --- a/compiler/filter_tmpl.nim +++ b/compiler/filter_tmpl.nim @@ -55,7 +55,7 @@ proc scanPar(p: var TTmplParser, d: int) = of ']': dec(p.bracket) of '{': inc(p.curly) of '}': dec(p.curly) - else: nil + else: discard inc(i) proc withInExpr(p: TTmplParser): bool {.inline.} = diff --git a/compiler/guards.nim b/compiler/guards.nim index 3d27c85c9d..607bb074ae 100644 --- a/compiler/guards.nim +++ b/compiler/guards.nim @@ -439,7 +439,7 @@ proc impliesLe(fact, x, c: PNode): TImplication = if leValue(c, fact.sons[1].pred): result = impNo of mNot, mOr, mAnd: internalError(x.info, "impliesLe") - else: nil + else: discard proc impliesLt(fact, x, c: PNode): TImplication = # x < 3 same as x <= 2: diff --git a/compiler/hlo.nim b/compiler/hlo.nim index e3f80ad36d..7982d4aa19 100644 --- a/compiler/hlo.nim +++ b/compiler/hlo.nim @@ -81,7 +81,7 @@ proc hlo(c: PContext, n: PNode): PNode = else: # perform type checking, so that the replacement still fits: if isEmptyType(n.typ) and isEmptyType(result.typ): - nil + discard else: result = fitNode(c, n.typ, result) # optimization has been applied so check again: diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index dd06b0235f..82c45059cb 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -143,7 +143,7 @@ proc mangle(name: string): string = of 'A'..'Z': add(result, chr(ord(name[i]) - ord('A') + ord('a'))) of '_': - nil + discard of 'a'..'z', '0'..'9': add(result, name[i]) else: add(result, 'X' & toHex(ord(name[i]), 2)) @@ -996,10 +996,10 @@ proc genSym(p: PProc, n: PNode, r: var TCompRes) = r.res = s.loc.r if lfNoDecl in s.loc.flags or s.magic != mNone or {sfImportc, sfInfixCall} * s.flags != {}: - nil + discard elif s.kind == skMethod and s.getBody.kind == nkEmpty: # we cannot produce code for the dispatcher yet: - nil + discard elif sfForward in s.flags: p.g.forwarded.add(s) elif not p.g.generatedSyms.containsOrIncl(s.id): @@ -1336,10 +1336,10 @@ proc genMagic(p: PProc, n: PNode, r: var TCompRes) = else: unaryExpr(p, n, r, "", "($1.length-1)") of mInc: - if not (optOverflowCheck in p.options): binaryExpr(p, n, r, "", "$1 += $2") + if optOverflowCheck notin p.options: binaryExpr(p, n, r, "", "$1 += $2") else: binaryExpr(p, n, r, "addInt", "$1 = addInt($1, $2)") of ast.mDec: - if not (optOverflowCheck in p.options): binaryExpr(p, n, r, "", "$1 -= $2") + if optOverflowCheck notin p.options: binaryExpr(p, n, r, "", "$1 -= $2") else: binaryExpr(p, n, r, "subInt", "$1 = subInt($1, $2)") of mSetLengthStr: binaryExpr(p, n, r, "", "$1.length = ($2)-1") of mSetLengthSeq: binaryExpr(p, n, r, "", "$1.length = $2") @@ -1544,7 +1544,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) = r.res = toRope(n.intVal) of nkNilLit: if isEmptyType(n.typ): - nil + discard elif mapType(n.typ) == etyBaseIndex: r.typ = etyBaseIndex r.address = toRope"null" | toRope"nil" @@ -1592,12 +1592,12 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) = of nkChckRange: genRangeChck(p, n, r, "chckRange") of nkStringToCString: convStrToCStr(p, n, r) of nkCStringToString: convCStrToStr(p, n, r) - of nkEmpty: nil + of nkEmpty: discard of nkLambdaKinds: let s = n.sons[namePos].sym discard mangleName(s) r.res = s.loc.r - if lfNoDecl in s.loc.flags or s.magic != mNone: nil + if lfNoDecl in s.loc.flags or s.magic != mNone: discard elif not p.g.generatedSyms.containsOrIncl(s.id): app(p.locals, genProc(p, s)) of nkMetaNode: gen(p, n.sons[0], r) @@ -1614,7 +1614,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) = of nkIfStmt, nkIfExpr: genIf(p, n, r) of nkWhileStmt: genWhileStmt(p, n) of nkVarSection, nkLetSection: genVarStmt(p, n) - of nkConstSection: nil + of nkConstSection: discard of nkForStmt, nkParForStmt: internalError(n.info, "for statement not eliminated") of nkCaseStmt: @@ -1633,7 +1633,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) = of nkRaiseStmt: genRaiseStmt(p, n) of nkTypeSection, nkCommentStmt, nkIteratorDef, nkIncludeStmt, nkImportStmt, nkImportExceptStmt, nkExportStmt, nkExportExceptStmt, - nkFromStmt, nkTemplateDef, nkMacroDef, nkPragma: nil + nkFromStmt, nkTemplateDef, nkMacroDef, nkPragma: discard of nkProcDef, nkMethodDef, nkConverterDef: var s = n.sons[namePos].sym if {sfExportc, sfCompilerProc} * s.flags == {sfExportc}: diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 9e42210c0d..ed92fefb40 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -275,7 +275,7 @@ proc captureVar(o: POuterContext, i: PInnerContext, local: PSym, addCapturedVar(it, local) if it == e: # common case: local directly in current environment: - nil + discard else: # it's in some upper environment: access = indirectAccess(access, addDep(e, it, i.fn), info) @@ -314,7 +314,7 @@ proc gatherVars(o: POuterContext, i: PInnerContext, n: PNode) = if o.currentEnv != env: discard addDep(o.currentEnv, env, i.fn) internalError(n.info, "too complex environment handling required") - of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: nil + of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: discard else: for k in countup(0, sonsLen(n) - 1): gatherVars(o, i, n.sons[k]) @@ -351,7 +351,7 @@ proc makeClosure(prc, env: PSym, info: TLineInfo): PNode = proc transformInnerProc(o: POuterContext, i: PInnerContext, n: PNode): PNode = case n.kind - of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: nil + of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: discard of nkSym: let s = n.sym if s == i.fn: @@ -371,7 +371,7 @@ proc transformInnerProc(o: POuterContext, i: PInnerContext, n: PNode): PNode = of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, nkIteratorDef: # don't recurse here: - nil + discard else: for j in countup(0, sonsLen(n) - 1): let x = transformInnerProc(o, i, n.sons[j]) @@ -386,7 +386,7 @@ proc searchForInnerProcs(o: POuterContext, n: PNode) = if n == nil: return case n.kind of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: - nil + discard of nkSym: if isInnerProc(n.sym, o.fn) and not containsOrIncl(o.processed, n.sym.id): var inner = newInnerContext(n.sym) @@ -422,7 +422,7 @@ proc searchForInnerProcs(o: POuterContext, n: PNode) = # counts, not the block where it is captured! for i in countup(0, sonsLen(n) - 1): var it = n.sons[i] - if it.kind == nkCommentStmt: nil + if it.kind == nkCommentStmt: discard elif it.kind == nkIdentDefs: var L = sonsLen(it) if it.sons[0].kind != nkSym: internalError(it.info, "transformOuter") @@ -441,7 +441,7 @@ proc searchForInnerProcs(o: POuterContext, n: PNode) = nkIteratorDef: # don't recurse here: # XXX recurse here and setup 'up' pointers - nil + discard else: for i in countup(0, sonsLen(n) - 1): searchForInnerProcs(o, n.sons[i]) @@ -500,7 +500,7 @@ proc generateClosureCreation(o: POuterContext, scope: PEnv): PNode = proc transformOuterProc(o: POuterContext, n: PNode): PNode = if n == nil: return nil case n.kind - of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: nil + of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: discard of nkSym: var local = n.sym var closure = PEnv(idTableGet(o.lambdasToEnv, local)) @@ -540,7 +540,7 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, nkIteratorDef: # don't recurse here: - nil + discard of nkHiddenStdConv, nkHiddenSubConv, nkConv: let x = transformOuterProc(o, n.sons[1]) if x != nil: n.sons[1] = x @@ -625,7 +625,7 @@ proc transfIterBody(c: var TIterContext, n: PNode): PNode = if interestingIterVar(s) and c.iter.id == s.owner.id: if not containsOrIncl(c.capturedVars, s.id): addField(c.tup, s) result = indirectAccess(newSymNode(c.closureParam), s, n.info) - of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: nil + of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: discard of nkYieldStmt: inc c.state.typ.n.sons[1].intVal let stateNo = c.state.typ.n.sons[1].intVal diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 93aea7f61f..97414ddb73 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -434,7 +434,7 @@ proc handleHexChar(L: var TLexer, xi: var int) = of 'A'..'F': xi = (xi shl 4) or (ord(L.buf[L.bufpos]) - ord('A') + 10) inc(L.bufpos) - else: nil + else: discard proc handleDecChars(L: var TLexer, xi: var int) = while L.buf[L.bufpos] in {'0'..'9'}: diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 57c420d3b1..6dfd259686 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -286,7 +286,7 @@ proc initOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = o.symChoiceIndex = 1 o.inSymChoice = initIntSet() incl(o.inSymChoice, result.id) - else: nil + else: discard if result != nil and result.kind == skStub: loadStub(result) proc lastOverloadScope*(o: TOverloadIter): int = diff --git a/compiler/msgs.nim b/compiler/msgs.nim index d7944a1823..61336aa872 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -113,7 +113,7 @@ type warnDifferentHeaps, warnWriteToForeignHeap, warnImplicitClosure, warnEachIdentIsTuple, warnShadowIdent, warnProveInit, warnProveField, warnProveIndex, - warnUninit, warnUser, + warnUninit, warnGcMem, warnUser, hintSuccess, hintSuccessX, hintLineTooLong, hintXDeclaredButNotUsed, hintConvToBaseNotNeeded, hintConvFromXtoItselfNotNeeded, hintExprAlwaysX, hintQuitCalled, @@ -370,6 +370,7 @@ const warnProveField: "cannot prove that field '$1' is accessible [ProveField]", warnProveIndex: "cannot prove index '$1' is valid [ProveIndex]", warnUninit: "'$1' might not have been initialized [Uninit]", + warnGcMem: "'$1' uses GC'ed memory [GcMem]", warnUser: "$1 [User]", hintSuccess: "operation successful [Success]", hintSuccessX: "operation successful ($# lines compiled; $# sec total; $#) [SuccessX]", @@ -389,7 +390,7 @@ const hintUser: "$1 [User]"] const - WarningsToStr*: array[0..23, string] = ["CannotOpenFile", "OctalEscape", + WarningsToStr*: array[0..24, string] = ["CannotOpenFile", "OctalEscape", "XIsNeverRead", "XmightNotBeenInit", "Deprecated", "ConfigDeprecated", "SmallLshouldNotBeUsed", "UnknownMagic", @@ -397,7 +398,7 @@ const "CommentXIgnored", "NilStmt", "AnalysisLoophole", "DifferentHeaps", "WriteToForeignHeap", "ImplicitClosure", "EachIdentIsTuple", "ShadowIdent", - "ProveInit", "ProveField", "ProveIndex", "Uninit", "User"] + "ProveInit", "ProveField", "ProveIndex", "Uninit", "GcMem", "User"] HintsToStr*: array[0..15, string] = ["Success", "SuccessX", "LineTooLong", "XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded", @@ -856,6 +857,5 @@ ropes.errorHandler = proc (err: TRopesError, msg: string, useWarning: bool) = of rTokenTooLong: internalError("ropes: token too long: " & msg) of rCannotOpenFile: - rawMessage(if useWarning: warnCannotOpenFile else: errCannotOpenFile, - msg) - + rawMessage(if useWarning: warnCannotOpenFile else: errCannotOpenFile, msg) + diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index 2bdfbe0b81..136a0d4542 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -101,11 +101,11 @@ proc jumpToDirective(L: var TLexer, tok: var TToken, dest: TJumpDest) = break if nestedIfs > 0: dec(nestedIfs) else: - nil + discard ppGetTok(L, tok) - elif tok.tokType == tkEof: + elif tok.tokType == tkEof: lexMessage(L, errTokenExpected, "@end") - else: + else: ppGetTok(L, tok) proc parseDirective(L: var TLexer, tok: var TToken) = diff --git a/compiler/nimrod.nimrod.cfg b/compiler/nimrod.nimrod.cfg index b2ae976860..657c47b280 100644 --- a/compiler/nimrod.nimrod.cfg +++ b/compiler/nimrod.nimrod.cfg @@ -16,3 +16,5 @@ import:testability @if windows: cincludes: "$lib/wrappers/libffi/common" @end + +cs:partial diff --git a/compiler/parser.nim b/compiler/parser.nim index e7a15c8abc..c44036c5f5 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -1817,7 +1817,7 @@ proc parseStmt(p: var TParser): PNode = withInd(p): while true: if p.tok.indent == p.currInd: - nil + discard elif p.tok.tokType == tkSemiColon: getTok(p) if p.tok.indent < 0 or p.tok.indent == p.currInd: discard diff --git a/compiler/passaux.nim b/compiler/passaux.nim index 79d11419b8..0ba9f22d00 100644 --- a/compiler/passaux.nim +++ b/compiler/passaux.nim @@ -41,7 +41,7 @@ proc cleanUp(c: PPassContext, n: PNode): PNode = if sfDeadCodeElim notin getModule(s).flags and not astNeeded(s): s.ast.sons[bodyPos] = ast.emptyNode # free the memory else: - nil + discard const cleanupPass* = makePass(process = cleanUp, close = cleanUp) diff --git a/compiler/patterns.nim b/compiler/patterns.nim index 54f8d3af44..d262790abb 100644 --- a/compiler/patterns.nim +++ b/compiler/patterns.nim @@ -40,7 +40,7 @@ proc canonKind(n: PNode): TNodeKind = of nkCallKinds: result = nkCall of nkStrLit..nkTripleStrLit: result = nkStrLit of nkFastAsgn: result = nkAsgn - else: nil + else: discard proc sameKinds(a, b: PNode): bool {.inline.} = result = a.kind == b.kind or a.canonKind == b.canonKind @@ -267,7 +267,7 @@ proc applyRule*(c: PContext, s: PSym, n: PNode): PNode = var rs = result.sons[i] let param = params.sons[i].sym case whichAlias(param) - of aqNone: nil + of aqNone: discard of aqShouldAlias: # it suffices that it aliases for sure with *some* other param: var ok = false diff --git a/compiler/procfind.nim b/compiler/procfind.nim index eb0cbca3f6..0354d585d3 100644 --- a/compiler/procfind.nim +++ b/compiler/procfind.nim @@ -60,7 +60,7 @@ proc searchForProcOld*(c: PContext, scope: PScope, fn: PSym): PSym = localError(fn.info, errNotOverloadable, fn.name.s) return of paramsNotEqual: - nil + discard result = nextIdentIter(it, scope.symbols) proc searchForProcNew(c: PContext, scope: PScope, fn: PSym): PSym = diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 6c7d9cae34..b5e3c0e74d 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -236,7 +236,7 @@ proc containsNL(s: string): bool = of '\x0D', '\x0A': return true else: - nil + discard result = false proc pushCom(g: var TSrcGen, n: PNode) = @@ -487,7 +487,7 @@ proc hasCom(n: PNode): bool = result = false if n.comment != nil: return true case n.kind - of nkEmpty..nkNilLit: nil + of nkEmpty..nkNilLit: discard else: for i in countup(0, sonsLen(n) - 1): if hasCom(n.sons[i]): return true @@ -769,7 +769,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = if n.comment != nil: pushCom(g, n) case n.kind # atoms: of nkTripleStrLit: putRawStr(g, tkTripleStrLit, n.strVal) - of nkEmpty: nil + of nkEmpty: discard of nkType: put(g, tkInvalid, atom(n)) of nkSym, nkIdent: gident(g, n) of nkIntLit: put(g, tkIntLit, atom(n)) @@ -1273,7 +1273,7 @@ proc renderModule(n: PNode, filename: string, case n.sons[i].kind of nkTypeSection, nkConstSection, nkVarSection, nkLetSection, nkCommentStmt: putNL(g) - else: nil + else: discard gcoms(g) if optStdout in gGlobalOptions: write(stdout, g.buf) diff --git a/compiler/rodread.nim b/compiler/rodread.nim index 7a35f0c848..b53135a959 100644 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -539,7 +539,7 @@ proc cmdChangeTriggersRecompilation(old, new: TCommands): bool = of cmdNone, cmdDoc, cmdInterpret, cmdPretty, cmdGenDepend, cmdDump, cmdCheck, cmdParse, cmdScan, cmdIdeTools, cmdDef, cmdRst2html, cmdRst2tex, cmdInteractive, cmdRun: - nil + discard # else: trigger recompilation: result = true diff --git a/compiler/rodwrite.nim b/compiler/rodwrite.nim index c393ce1dae..4231da2d01 100644 --- a/compiler/rodwrite.nim +++ b/compiler/rodwrite.nim @@ -573,7 +573,7 @@ proc process(c: PPassContext, n: PNode): PNode = of nkPragma: addStmt(w, n) else: - nil + discard proc myOpen(module: PSym): PPassContext = if module.id < 0: internalError("rodwrite: module ID not set") diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 5990f2e968..6b19dc359e 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -71,7 +71,7 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode, var cmp = cmpCandidates(best, z) if cmp < 0: best = z # x is better than the best so far elif cmp == 0: alt = z # x is as good as the best so far - else: nil + else: discard sym = nextOverloadIter(o, c, headSymbol) proc notFoundError*(c: PContext, n: PNode, errors: seq[string]) = diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 0d74db1ce4..6e2d777fb0 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -168,7 +168,7 @@ proc checkConvertible(c: PContext, castDest, src: PType): TConvStatus = if not compareTypes(castDest, src, dcEqIgnoreDistinct): result = convNotLegal else: - nil + discard proc isCastable(dst, src: PType): bool = #const @@ -204,7 +204,7 @@ proc semConv(c: PContext, n: PNode): PNode = if not isSymChoice(op): let status = checkConvertible(c, result.typ, op.typ) case status - of convOK: nil + of convOK: discard of convNotNeedeed: message(n.info, hintConvFromXtoItselfNotNeeded, result.typ.typeToString) of convNotLegal: @@ -397,7 +397,7 @@ proc changeType(n: PNode, newType: PType, check: bool) = of nkPar: if newType.kind != tyTuple: internalError(n.info, "changeType: no tuple type for constructor") - elif newType.n == nil: nil + elif newType.n == nil: discard elif sonsLen(n) > 0 and n.sons[0].kind == nkExprColonExpr: for i in countup(0, sonsLen(n) - 1): var m = n.sons[i].sons[0] @@ -423,7 +423,7 @@ proc changeType(n: PNode, newType: PType, check: bool) = if value < firstOrd(newType) or value > lastOrd(newType): localError(n.info, errGenerated, "cannot convert " & $value & " to " & typeToString(newType)) - else: nil + else: discard n.typ = newType proc arrayConstrType(c: PContext, n: PNode): PType = @@ -513,7 +513,7 @@ proc fixAbstractType(c: PContext, n: PNode) = # an implicitly constructed array (passed to an open array): n.sons[i] = semArrayConstr(c, it, {}) else: - nil + discard #if (it.typ == nil): # InternalError(it.info, "fixAbstractType: " & renderTree(it)) @@ -677,7 +677,7 @@ proc semOverloadedCallAnalyseEffects(c: PContext, n: PNode, nOrig: PNode, return let callee = result.sons[0].sym case callee.kind - of skMacro, skTemplate: nil + of skMacro, skTemplate: discard else: if (callee.kind == skIterator) and (callee.id == c.p.owner.id): localError(n.info, errRecursiveDependencyX, callee.name.s) @@ -1098,7 +1098,7 @@ proc takeImplicitAddr(c: PContext, n: PNode): PNode = of nkHiddenDeref, nkDerefExpr: return n.sons[0] of nkBracketExpr: if len(n) == 1: return n.sons[0] - else: nil + else: discard var valid = isAssignable(c, n) if valid != arLValue: if valid == arLocalLValue: @@ -1207,7 +1207,7 @@ proc semProcBody(c: PContext, n: PNode): PNode = # transform ``expr`` to ``result = expr``, but not if the expr is already # ``result``: if result.kind == nkSym and result.sym == c.p.resultSym: - nil + discard elif result.kind == nkNilLit: # or ImplicitlyDiscardable(result): # new semantic: 'result = x' triggers the void context @@ -1244,7 +1244,7 @@ proc semYieldVarResult(c: PContext, n: PNode, restype: PType) = a.sons[i] = takeImplicitAddr(c, a.sons[i]) else: localError(n.sons[0].info, errXExpected, "tuple constructor") - else: nil + else: discard proc semYield(c: PContext, n: PNode): PNode = result = n @@ -1472,7 +1472,7 @@ proc tryExpr(c: PContext, n: PNode, result = semExpr(c, n, flags) if msgs.gErrorCounter != oldErrorCount: result = nil except ERecoverableError: - nil + discard # undo symbol table changes (as far as it's possible): c.generics = oldGenerics c.inGenericContext = oldInGenericContext @@ -1590,9 +1590,9 @@ proc semSetConstr(c: PContext, n: PNode): PNode = typ = skipTypes(n.sons[i].typ, {tyGenericInst, tyVar, tyOrdinal}) if not isOrdinalType(typ): localError(n.info, errOrdinalTypeExpected) - typ = makeRangeType(c, 0, MaxSetElements - 1, n.info) + typ = makeRangeType(c, 0, MaxSetElements-1, n.info) elif lengthOrd(typ) > MaxSetElements: - typ = makeRangeType(c, 0, MaxSetElements - 1, n.info) + typ = makeRangeType(c, 0, MaxSetElements-1, n.info) addSonSkipIntLit(result.typ, typ) for i in countup(0, sonsLen(n) - 1): var m: PNode @@ -1629,27 +1629,27 @@ proc semTableConstr(c: PContext, n: PNode): PNode = if lastKey != n.len: illFormedAst(n) result = semExpr(c, result) -type - TParKind = enum +type + TParKind = enum paNone, paSingle, paTupleFields, paTuplePositions -proc checkPar(n: PNode): TParKind = +proc checkPar(n: PNode): TParKind = var length = sonsLen(n) if length == 0: result = paTuplePositions # () elif length == 1: result = paSingle # (expr) - else: + else: if n.sons[0].kind == nkExprColonExpr: result = paTupleFields else: result = paTuplePositions - for i in countup(0, length - 1): - if result == paTupleFields: + for i in countup(0, length - 1): + if result == paTupleFields: if (n.sons[i].kind != nkExprColonExpr) or - not (n.sons[i].sons[0].kind in {nkSym, nkIdent}): + not (n.sons[i].sons[0].kind in {nkSym, nkIdent}): localError(n.sons[i].info, errNamedExprExpected) return paNone - else: - if n.sons[i].kind == nkExprColonExpr: + else: + if n.sons[i].kind == nkExprColonExpr: localError(n.sons[i].info, errNamedExprNotAllowed) return paNone @@ -1659,8 +1659,7 @@ proc semTupleFieldsConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = typ.n = newNodeI(nkRecList, n.info) # nkIdentDefs var ids = initIntSet() for i in countup(0, sonsLen(n) - 1): - if (n.sons[i].kind != nkExprColonExpr) or - not (n.sons[i].sons[0].kind in {nkSym, nkIdent}): + if n[i].kind != nkExprColonExpr or n[i][0].kind notin {nkSym, nkIdent}: illFormedAst(n.sons[i]) var id: PIdent if n.sons[i].sons[0].kind == nkIdent: id = n.sons[i].sons[0].ident diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 1d03e6888b..78e5cdd5ec 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -222,7 +222,7 @@ proc getIntervalType*(m: TMagic, n: PNode): PType = commutativeOp(min) of mMaxI, mMaxI64: commutativeOp(max) - else: nil + else: discard discard """ mShlI, mShlI64, @@ -546,7 +546,7 @@ proc foldArrayAccess(m: PSym, n: PNode): PNode = if (idx >= 0) and (idx < len(x.strVal)): result.intVal = ord(x.strVal[int(idx)]) elif idx == len(x.strVal): - nil + discard else: localError(n.info, errIndexOutOfBounds) else: discard diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index a1af94971a..4caf1fb8e2 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -53,7 +53,7 @@ proc semTypeTraits(c: PContext, n: PNode): PNode = if t.sonsLen > 0: # This is either a type known to sem or a typedesc # param to a regular proc (again, known at instantiation) - result = evalTypeTrait(n[0], t, GetCurrOwner()) + result = evalTypeTrait(n[0], t, getCurrOwner()) else: # a typedesc variable, pass unmodified to evals result = n diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index f0007d01e8..1aa6a793ce 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -136,6 +136,7 @@ proc discardCheck(c: PContext, result: PNode) = if result.typ != nil and result.typ.kind notin {tyStmt, tyEmpty}: if result.kind == nkNilLit: result.typ = nil + message(result.info, warnNilStatement) elif implicitlyDiscardable(result): var n = result result.typ = nil @@ -145,10 +146,11 @@ proc discardCheck(c: PContext, result: PNode) = elif c.inTypeClass > 0 and result.typ.kind == tyBool: let verdict = semConstExpr(c, result) if verdict.intVal == 0: - localError(result.info, "type class predicate failed.") + localError(result.info, "type class predicate failed") elif result.typ.kind != tyError and gCmd != cmdInteractive: if result.typ.kind == tyNil: fixNilType(result) + message(result.info, warnNilStatement) else: var n = result while n.kind in skipForDiscardable: n = n.lastSon @@ -996,7 +998,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, if proto == nil: s.typ.callConv = lastOptionEntry(c).defaultCC # add it here, so that recursive procs are possible: - if sfGenSym in s.flags: nil + if sfGenSym in s.flags: discard elif kind in OverloadableSyms: if not typeIsDetermined: addInterfaceOverloadableSymAt(c, s.scope, s) @@ -1252,9 +1254,9 @@ proc semStmtList(c: PContext, n: PNode): PNode = of LastBlockStmts: for j in countup(i + 1, length - 1): case n.sons[j].kind - of nkPragma, nkCommentStmt, nkNilLit, nkEmpty: nil + of nkPragma, nkCommentStmt, nkNilLit, nkEmpty: discard else: localError(n.sons[j].info, errStmtInvalidAfterReturn) - else: nil + else: discard if result.len == 1: result = result.sons[0] when false: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 64c8f81e26..d5a938a12d 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -537,7 +537,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var TIntSet, pos: var int, if a.kind == nkEmpty: addSon(father, newSymNode(f)) else: addSon(a, newSymNode(f)) if a.kind != nkEmpty: addSon(father, a) - of nkEmpty: nil + of nkEmpty: discard else: illFormedAst(n) proc addInheritedFieldsAux(c: PContext, check: var TIntSet, pos: var int, @@ -615,7 +615,7 @@ proc addParamOrResult(c: PContext, param: PSym, kind: TSymKind) = let typedescId = getIdent"typedesc" template shouldHaveMeta(t) = - InternalAssert tfHasMeta in t.flags + internalAssert tfHasMeta in t.flags # result.lastSon.flags.incl tfHasMeta proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, @@ -745,7 +745,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, else: result = addImplicitGeneric(newTypeS(tyAnything, c)) - else: nil + else: discard # result = liftingWalk(paramType) @@ -939,7 +939,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = result = nil if gCmd == cmdIdeTools: suggestExpr(c, n) case n.kind - of nkEmpty: nil + of nkEmpty: discard of nkTypeOfExpr: # for ``type(countup(1,3))``, see ``tests/ttoseq``. checkSonsLen(n, 1) @@ -977,7 +977,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = result = freshType(result, prev) result.flags.incl(tfNotNil) else: - LocalError(n.info, errGenerated, "invalid type") + localError(n.info, errGenerated, "invalid type") of 2: let negated = semTypeNode(c, n.sons[1], prev) result = makeNotType(c, negated) @@ -1137,7 +1137,7 @@ proc processMagicType(c: PContext, m: PSym) = of mSet: setMagicType(m, tySet, 0) of mSeq: setMagicType(m, tySequence, 0) of mOrdinal: setMagicType(m, tyOrdinal, 0) - of mPNimrodNode: nil + of mPNimrodNode: discard else: localError(m.info, errTypeExpected) proc semGenericConstraints(c: PContext, x: PType): PType = diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index b08119d4a7..ac14179cd5 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -22,7 +22,7 @@ proc checkPartialConstructedType(info: TLineInfo, t: PType) = proc checkConstructedType*(info: TLineInfo, typ: PType) = var t = typ.skipTypes({tyDistinct}) - if t.kind in tyTypeClasses: nil + if t.kind in tyTypeClasses: discard elif tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject: localError(info, errInvalidPragmaX, "acyclic") elif t.kind == tyVar and t.sons[0].kind == tyVar: @@ -364,7 +364,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = of tyGenericInst: result = instCopyType(cl, t) for i in 1 .. <result.sonsLen: - result.sons[i] = ReplaceTypeVarsT(cl, result.sons[i]) + result.sons[i] = replaceTypeVarsT(cl, result.sons[i]) propagateToOwner(result, result.lastSon) else: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 7066c5afdb..1fe667a3c4 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -381,7 +381,7 @@ proc procTypeRel(c: var TCandidate, f, a: PType): TTypeRelation = when useEffectSystem: if not compatibleEffects(f, a): return isNone of tyNil: result = f.allowsNil - else: nil + else: discard proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} = let @@ -477,7 +477,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = of tyAnything: return if f.kind == tyAnything: isGeneric else: isNone - else: nil + else: discard case f.kind of tyEnum: @@ -530,7 +530,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = result = typeRel(c, f.sons[1], a.sons[1]) if result < isGeneric: result = isNone elif lengthOrd(fRange) != lengthOrd(a): result = isNone - else: nil + else: discard of tyOpenArray, tyVarargs: case a.kind of tyOpenArray, tyVarargs: @@ -551,7 +551,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = result = isConvertible elif typeRel(c, base(f), a.sons[0]) >= isGeneric: result = isConvertible - else: nil + else: discard of tySequence: case a.kind of tySequence: @@ -563,7 +563,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = elif tfNotNil in f.flags and tfNotNil notin a.flags: result = isNilConversion of tyNil: result = f.allowsNil - else: nil + else: discard of tyOrdinal: if isOrdinalType(a): var x = if a.kind == tyOrdinal: a.sons[0] else: a @@ -607,7 +607,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = elif tfNotNil in f.flags and tfNotNil notin a.flags: result = isNilConversion of tyNil: result = f.allowsNil - else: nil + else: discard of tyRef: case a.kind of tyRef: @@ -616,7 +616,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = elif tfNotNil in f.flags and tfNotNil notin a.flags: result = isNilConversion of tyNil: result = f.allowsNil - else: nil + else: discard of tyProc: result = procTypeRel(c, f, a) if result != isNone and tfNotNil in f.flags and tfNotNil notin a.flags: @@ -632,7 +632,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = of tyProc: if a.callConv != ccClosure: result = isConvertible of tyPtr, tyCString: result = isConvertible - else: nil + else: discard of tyString: case a.kind of tyString: @@ -641,7 +641,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = else: result = isEqual of tyNil: result = f.allowsNil - else: nil + else: discard of tyCString: # conversion from string to cstring is automatic: case a.kind @@ -659,7 +659,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = (skipTypes(a.sons[0], {tyRange}).kind in {tyInt..tyInt64}) and (a.sons[1].kind == tyChar): result = isConvertible - else: nil + else: discard of tyEmpty: if a.kind == tyEmpty: result = isEqual @@ -691,7 +691,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = if x.kind == tyGenericInvokation or f.sons[0].kind != tyGenericBody: #InternalError("typeRel: tyGenericInvokation -> tyGenericInvokation") # simply no match for now: - nil + discard elif x.kind == tyGenericInst and (f.sons[0] == x.sons[0]) and (sonsLen(x) - 1 == sonsLen(f)): @@ -947,10 +947,10 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, if e == nil: return nil case e.kind - of nkReturnStmt: nil - of nkTypeSection: nil - of nkConstDef: nil - else: nil + of nkReturnStmt: discard + of nkTypeSection: discard + of nkConstDef: discard + else: discard result = arg put(m.bindings, f, a) @@ -976,7 +976,7 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType, var r: TTypeRelation - a = if c.InTypeClass > 0: argType.skipTypes({tyTypeDesc}) + a = if c.inTypeClass > 0: argType.skipTypes({tyTypeDesc}) else: argType case fMaybeStatic.kind diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 1fde831b72..49611f6492 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -103,7 +103,7 @@ proc suggestObject(c: PContext, n: PNode, outputs: var int) = suggestObject(c, n.sons[0], outputs) for i in countup(1, L-1): suggestObject(c, lastSon(n.sons[i]), outputs) of nkSym: suggestField(c, n.sym, outputs) - else: nil + else: discard proc nameFits(c: PContext, s: PSym, n: PNode): bool = var op = n.sons[0] diff --git a/compiler/transf.nim b/compiler/transf.nim index 2332d0b48f..f22433972c 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -193,7 +193,7 @@ proc transformConstSection(c: PTransf, v: PNode): PTransNode = proc hasContinue(n: PNode): bool = case n.kind - of nkEmpty..nkNilLit, nkForStmt, nkParForStmt, nkWhileStmt: nil + of nkEmpty..nkNilLit, nkForStmt, nkParForStmt, nkWhileStmt: discard of nkContinueStmt: result = true else: for i in countup(0, sonsLen(n) - 1): @@ -536,7 +536,7 @@ proc getMergeOp(n: PNode): PSym = if (n.sons[0].kind == nkSym) and (n.sons[0].sym.kind == skProc) and (sfMerge in n.sons[0].sym.flags): result = n.sons[0].sym - else: nil + else: discard proc flattenTreeAux(d, a: PNode, op: PSym) = var op2 = getMergeOp(a) diff --git a/compiler/types.nim b/compiler/types.nim index 36c9f1934d..d7310596f8 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -345,7 +345,7 @@ proc canFormAcycleAux(marker: var TIntSet, typ: PType, startId: int): bool = # # damn inheritance may introduce cycles: # result = true of tyProc: result = typ.callConv == ccClosure - else: nil + else: discard proc canFormAcycle(typ: PType): bool = var marker = initIntSet() @@ -432,10 +432,10 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = if t.len == 0: result = "typedesc" else: result = "typedesc[" & typeToString(t.sons[0]) & "]" of tyStatic: - InternalAssert t.len > 0 + internalAssert t.len > 0 result = "static[" & typeToString(t.sons[0]) & "]" of tyTypeClass: - InternalAssert t.sym != nil and t.sym.owner != nil + internalAssert t.sym != nil and t.sym.owner != nil return t.sym.owner.name.s of tyBuiltInTypeClass: return "TypeClass" @@ -446,7 +446,7 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = of tyNot: result = "not " & typeToString(t.sons[0]) of tyExpr: - InternalAssert t.len == 0 + internalAssert t.len == 0 result = "expr" of tyFromExpr: result = renderTree(t.n) diff --git a/doc/manual.txt b/doc/manual.txt index f6dd1f521e..c903732331 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -1333,7 +1333,7 @@ Examples: # has default calling convention echo "x: ", mouseX, " y: ", mouseY - proc setOnMouseMove(mouseMoveEvent: TOnMouseMove) = nil + proc setOnMouseMove(mouseMoveEvent: TOnMouseMove) = discard # ok, 'onMouseMove' has the default calling convention, which is compatible # to 'closure': diff --git a/doc/tut1.txt b/doc/tut1.txt index 2e7f9d27fa..1ba3253c8e 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -324,12 +324,12 @@ the compiler that for every other value nothing should be done: case n of 0..2, 4..7: echo("The number is in the set: {0, 1, 2, 4, 5, 6, 7}") of 3, 8: echo("The number is 3 or 8") - else: nil + else: discard -The ``nil`` statement is a *do nothing* statement. The compiler knows that a -case statement with an else part cannot fail and thus the error disappears. Note -that it is impossible to cover all possible string values: that is why there is -no such check for string cases. +The empty ``discard`` statement is a *do nothing* statement. The compiler knows +that a case statement with an else part cannot fail and thus the error +disappears. Note that it is impossible to cover all possible string values: +that is why there is no such check for string cases. In general the case statement is used for subrange types or enumerations where it is of great help that the compiler checks that you covered any possible diff --git a/doc/tut2.txt b/doc/tut2.txt index f8fa4aef38..581239cc76 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -614,7 +614,7 @@ simple proc for logging: .. code-block:: nimrod const - debug = True + debug = true proc log(msg: string) {.inline.} = if debug: stdout.writeln(msg) @@ -631,7 +631,7 @@ Turning the ``log`` proc into a template solves this problem: .. code-block:: nimrod const - debug = True + debug = true template log(msg: string) = if debug: stdout.writeln(msg) @@ -674,16 +674,15 @@ via a special ``:`` syntax: template withFile(f: expr, filename: string, mode: TFileMode, body: stmt): stmt {.immediate.} = - block: - let fn = filename - var f: TFile - if open(f, fn, mode): - try: - body - finally: - close(f) - else: - quit("cannot open: " & fn) + let fn = filename + var f: TFile + if open(f, fn, mode): + try: + body + finally: + close(f) + else: + quit("cannot open: " & fn) withFile(txt, "ttempl3.txt", fmWrite): txt.writeln("line 1") @@ -784,7 +783,7 @@ regular expressions: macro case_token(n: stmt): stmt = # creates a lexical analyzer from regular expressions # ... (implementation is an exercise for the reader :-) - nil + discard case_token: # this colon tells the parser it is a macro statement of r"[A-Za-z_]+[A-Za-z_0-9]*": diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim index b41a37309e..db7a639281 100644 --- a/lib/packages/docutils/highlite.nim +++ b/lib/packages/docutils/highlite.nim @@ -73,7 +73,7 @@ proc initGeneralTokenizer*(g: var TGeneralTokenizer, buf: string) = g.pos = pos proc deinitGeneralTokenizer*(g: var TGeneralTokenizer) = - nil + discard proc nimGetKeyword(id: string): TTokenClass = for k in nimrodKeywords: @@ -102,7 +102,7 @@ proc nimNumberPostfix(g: var TGeneralTokenizer, position: int): int = if g.buf[pos] in {'0'..'9'}: inc(pos) if g.buf[pos] in {'0'..'9'}: inc(pos) else: - nil + discard result = pos proc nimNumber(g: var TGeneralTokenizer, position: int): int = diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index e6ffadcbd7..bb018bc1e3 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -535,7 +535,7 @@ proc match(p: TRstParser, start: int, expr: string): bool = case p.tok[j].symbol[0] of 'a'..'z', 'A'..'Z': result = len(p.tok[j].symbol) == 1 of '0'..'9': result = allCharsInSet(p.tok[j].symbol, {'0'..'9'}) - else: nil + else: discard else: var c = expr[i] var length = 0 @@ -640,7 +640,7 @@ proc parseUrl(p: var TRstParser, father: PRstNode) = var n = newRstNode(rnStandaloneHyperlink) while true: case p.tok[p.idx].kind - of tkWord, tkAdornment, tkOther: nil + of tkWord, tkAdornment, tkOther: discard of tkPunct: if p.tok[p.idx+1].kind notin {tkWord, tkAdornment, tkOther, tkPunct}: break @@ -806,7 +806,7 @@ proc parseInline(p: var TRstParser, father: PRstNode) = return add(father, newLeaf(p)) inc(p.idx) - else: nil + else: discard proc getDirective(p: var TRstParser): string = if p.tok[p.idx].kind == tkWhite and p.tok[p.idx+1].kind == tkWord: @@ -1339,7 +1339,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) = of rnDirective: a = parseDotDot(p) of rnEnumList: a = parseEnumList(p) of rnLeaf: rstMessage(p, meNewSectionExpected) - of rnParagraph: nil + of rnParagraph: discard of rnDefList: a = parseDefinitionList(p) of rnFieldList: if p.idx > 0: dec(p.idx) @@ -1351,7 +1351,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) = of rnOptionList: a = parseOptionList(p) else: #InternalError("rst.parseSection()") - nil + discard if a == nil and k != rnDirective: a = newRstNode(rnParagraph) parseParagraph(p, a) @@ -1624,7 +1624,7 @@ proc resolveSubs(p: var TRstParser, n: PRstNode): PRstNode = add(result, n) add(result, y) of rnLeaf: - nil + discard of rnContents: p.hasToc = true else: diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index a56f624489..5c09d521eb 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -165,7 +165,7 @@ proc nextSplitPoint*(s: string, start: int): int = of 'a'..'z': if result + 1 < len(s) + 0: if s[result + 1] in {'A'..'Z'}: return - else: nil + else: discard inc(result) dec(result) # last valid index diff --git a/lib/pure/json.nim b/lib/pure/json.nim index 360a3a5e7e..7424bbae95 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -626,7 +626,7 @@ proc len*(n: PJsonNode): int = case n.kind of JArray: result = n.elems.len of JObject: result = n.fields.len - else: nil + else: discard proc `[]`*(node: PJsonNode, name: string): PJsonNode = ## Gets a field from a `JObject`. Returns nil if the key is not found. @@ -646,6 +646,7 @@ proc hasKey*(node: PJsonNode, key: string): bool = assert(node.kind == JObject) for k, item in items(node.fields): if k == key: return true + proc existsKey*(node: PJsonNode, key: string): bool {.deprecated.} = node.hasKey(key) ## Deprecated for `hasKey` diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index fe4303d8a7..7b59deec7a 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -329,7 +329,7 @@ when defined(Windows) and not defined(useNimRtl): handle: THandle atTheEnd: bool - proc hsClose(s: PStream) = nil # nothing to do here + proc hsClose(s: PStream) = discard # nothing to do here proc hsAtEnd(s: PStream): bool = return PFileHandleStream(s).atTheEnd proc hsReadData(s: PStream, buffer: pointer, bufLen: int): int = diff --git a/lib/pure/parseutils.nim b/lib/pure/parseutils.nim index 6423b3ab07..484ba5184d 100644 --- a/lib/pure/parseutils.nim +++ b/lib/pure/parseutils.nim @@ -370,7 +370,7 @@ iterator interpolatedFragments*(s: string): tuple[kind: TInterpolatedKind, of '\0': raise newException(EInvalidValue, "Expected closing '}': " & s[i..s.len]) - else: nil + else: discard inc j inc i, 2 # skip ${ kind = ikExpr diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index de445dd368..b56153cc07 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -1523,7 +1523,7 @@ proc skip*(socket: TSocket) {.tags: [FReadIO], deprecated.} = ## **Deprecated since version 0.9.2**: This function is not safe for use. const bufSize = 1000 var buf = alloc(bufSize) - while recv(socket, buf, bufSize) == bufSize: nil + while recv(socket, buf, bufSize) == bufSize: discard dealloc(buf) proc skip*(socket: TSocket, size: int, timeout = -1) = diff --git a/lib/pure/streams.nim b/lib/pure/streams.nim index 302742eb41..e944dd2fca 100644 --- a/lib/pure/streams.nim +++ b/lib/pure/streams.nim @@ -281,7 +281,7 @@ proc newFileStream*(filename: string, mode: TFileMode): PFileStream = when true: - nil + discard else: type TFileHandle* = cint ## Operating system file handle diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 20109cfa26..de8dc5e51d 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -304,7 +304,7 @@ proc countLines*(s: string): int {.noSideEffect, if s[i+1] == '\l': inc i inc result of '\l': inc result - else: nil + else: discard inc i proc split*(s: string, seps: set[char] = Whitespace): seq[string] {. diff --git a/lib/pure/times.nim b/lib/pure/times.nim index be3e5d6da5..6186fcad8f 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -698,7 +698,7 @@ proc format*(info: TTimeInfo, f: string): string = of "ZZZ": result.add(info.tzname) of "": - nil # Do nothing. + discard else: raise newException(EInvalidValue, "Invalid format string: " & currentF) diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 0fb9bb4827..820093b3e0 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -1029,11 +1029,7 @@ when not defined(useNimRtl): dec(gch.recGcLock) proc GC_setStrategy(strategy: TGC_Strategy) = - case strategy - of gcThroughput: nil - of gcResponsiveness: nil - of gcOptimizeSpace: nil - of gcOptimizeTime: nil + discard proc GC_enableMarkAndSweep() = gch.cycleThreshold = InitialCycleThreshold diff --git a/web/news.txt b/web/news.txt index c518bfc95d..ce5f80fd2f 100644 --- a/web/news.txt +++ b/web/news.txt @@ -3,7 +3,7 @@ News ==== -2013-XX-XX Version 0.9.4 released +2014-XX-XX Version 0.9.4 released ================================= @@ -37,6 +37,7 @@ Changes affecting backwards compatibility passed to shell, instead of just adding double quotes. - ``macros.dumpTree`` and ``macros.dumpLisp`` have been made ``immediate``, ``dumpTreeImm`` and ``dumpLispImm`` are now deprecated. +- The ``nil`` statement has been deprecated, use an empty ``discard`` instead. Compiler Additions @@ -68,7 +69,7 @@ Language Additions fields at compile-time. - The overload resolution now supports ``static[T]`` params that must be evaluatable at compile-time. -- Support for user-defined type classes have been added. +- Support for user-defined type classes has been added. Tools improvements From 5d8d1ed8bc0a08d6e04c3f10c0bdac4118070685 Mon Sep 17 00:00:00 2001 From: Erik O'Leary <erik.m.oleary@gmail.com> Date: Sun, 19 Jan 2014 10:51:21 -0600 Subject: [PATCH 241/326] Corrected prunesocketset and pruneprocessset fd sets passed to select() were pruning ready FDs rather than pruning UN-ready FDs. --- lib/pure/ftpclient.nim | 4 ++-- lib/pure/irc.nim | 2 +- lib/pure/osproc.nim | 2 +- lib/pure/scgi.nim | 2 +- lib/pure/sockets.nim | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/pure/ftpclient.nim b/lib/pure/ftpclient.nim index b6127a9bc6..d9f9dfd3d1 100644 --- a/lib/pure/ftpclient.nim +++ b/lib/pure/ftpclient.nim @@ -298,7 +298,7 @@ proc getLines(ftp: PFTPClient, async: bool = false): bool = var readSocks: seq[TSocket] = @[ftp.getCSock()] # This is only needed here. Asyncio gets this socket... blockingOperation(ftp.getCSock()): - if readSocks.select(1) != 0 and ftp.getCSock() notin readSocks: + if readSocks.select(1) != 0 and ftp.getCSock() in readSocks: assertReply ftp.expectReply(), "226" return true @@ -434,7 +434,7 @@ proc getFile(ftp: PFTPClient, async = false): bool = if not async: var readSocks: seq[TSocket] = @[ftp.getCSock()] blockingOperation(ftp.getCSock()): - if readSocks.select(1) != 0 and ftp.getCSock() notin readSocks: + if readSocks.select(1) != 0 and ftp.getCSock() in readSocks: assertReply ftp.expectReply(), "226" return true diff --git a/lib/pure/irc.nim b/lib/pure/irc.nim index ee85d9c691..d7af0a33a0 100644 --- a/lib/pure/irc.nim +++ b/lib/pure/irc.nim @@ -346,7 +346,7 @@ proc poll*(irc: PIRC, ev: var TIRCEvent, var line = TaintedString"" var socks = @[irc.sock] var ret = socks.select(timeout) - if socks.len() == 0 and ret != 0: + if socks.len() != 0: irc.sock.readLine(line) ev = irc.processLine(line.string) result = true diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 7b59deec7a..6c43dc2d9e 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -800,7 +800,7 @@ elif not defined(useNimRtl): var i = 0 var L = s.len while i < L: - if FD_ISSET(cint(s[i].outHandle), fd) != 0'i32: + if FD_ISSET(cint(s[i].outHandle), fd) == 0'i32: s[i] = s[L-1] dec(L) else: diff --git a/lib/pure/scgi.nim b/lib/pure/scgi.nim index b18fe0094d..04b77fafea 100644 --- a/lib/pure/scgi.nim +++ b/lib/pure/scgi.nim @@ -119,7 +119,7 @@ proc next*(s: var TScgistate, timeout: int = -1): bool = ## request, if ``timeout`` is `-1` then this function will never time out. ## Returns `True` if a new request has been processed. var rsocks = @[s.server] - if select(rsocks, timeout) == 1 and rsocks.len == 0: + if select(rsocks, timeout) == 1 and rsocks.len == 1: new(s.client) accept(s.server, s.client) var L = 0 diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index b56153cc07..b3cc38ee70 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -928,7 +928,7 @@ proc pruneSocketSet(s: var seq[TSocket], fd: var TFdSet) = var i = 0 var L = s.len while i < L: - if FD_ISSET(s[i].fd, fd) != 0'i32: + if FD_ISSET(s[i].fd, fd) == 0'i32: s[i] = s[L-1] dec(L) else: From 34f7eca8f714b6d1c162cde138d1fc1e8f656cfe Mon Sep 17 00:00:00 2001 From: onionhammer <erik.m.oleary@gmail.com> Date: Sun, 19 Jan 2014 10:55:33 -0600 Subject: [PATCH 242/326] Added ret != 0 back --- lib/pure/irc.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/irc.nim b/lib/pure/irc.nim index d7af0a33a0..750c98516b 100644 --- a/lib/pure/irc.nim +++ b/lib/pure/irc.nim @@ -346,7 +346,7 @@ proc poll*(irc: PIRC, ev: var TIRCEvent, var line = TaintedString"" var socks = @[irc.sock] var ret = socks.select(timeout) - if socks.len() != 0: + if socks.len() != 0 and ret != 0: irc.sock.readLine(line) ev = irc.processLine(line.string) result = true From 15859d94ecce40d08520c8b2eaefc015682546c3 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 19 Jan 2014 20:24:44 +0100 Subject: [PATCH 243/326] compiler warns when you use GC'ed memory and '--gc:none' --- compiler/ccgexprs.nim | 16 ++++++++ compiler/vmgen.nim | 5 ++- lib/system/mmdisp.nim | 94 +++++++++++++++++++++---------------------- todo.txt | 1 - web/news.txt | 3 ++ 5 files changed, 69 insertions(+), 50 deletions(-) diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 9554c6b557..ba543039e1 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -847,6 +847,9 @@ proc genEcho(p: BProc, n: PNode) = linefmt(p, cpsStmts, "printf($1$2);$n", makeCString(repeatStr(n.len-1, "%s") & tnl), args) +proc gcUsage(n: PNode) = + if gSelectedGC == gcNone: message(n.info, warnGcMem, n.renderTree) + proc genStrConcat(p: BProc, e: PNode, d: var TLoc) = # <Nimrod code> # s = 'Hello ' & name & ', how do you feel?' & 'z' @@ -888,6 +891,7 @@ proc genStrConcat(p: BProc, e: PNode, d: var TLoc) = keepAlive(p, tmp) else: genAssignment(p, d, tmp, {needToKeepAlive}) # no need for deep copying + gcUsage(e) proc genStrAppend(p: BProc, e: PNode, d: var TLoc) = # <Nimrod code> @@ -925,6 +929,7 @@ proc genStrAppend(p: BProc, e: PNode, d: var TLoc) = rdLoc(dest), lens, toRope(L)) keepAlive(p, dest) app(p.s(cpsStmts), appends) + gcUsage(e) proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) = # seq &= x --> @@ -945,6 +950,7 @@ proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) = initLoc(dest, locExpr, b.t, OnHeap) dest.r = rfmt(nil, "$1->data[$1->$2-1]", rdLoc(a), lenField()) genAssignment(p, dest, b, {needToCopy, afDestIsNil}) + gcUsage(e) proc genReset(p: BProc, n: PNode) = var a: TLoc @@ -987,6 +993,7 @@ proc genNew(p: BProc, e: PNode) = rawGenNew(p, a, se.rdLoc) else: rawGenNew(p, a, nil) + gcUsage(e) proc genNewSeqAux(p: BProc, dest: TLoc, length: PRope) = let seqtype = skipTypes(dest.t, abstractVarRange) @@ -1010,6 +1017,7 @@ proc genNewSeq(p: BProc, e: PNode) = initLocExpr(p, e.sons[1], a) initLocExpr(p, e.sons[2], b) genNewSeqAux(p, a, b.rdLoc) + gcUsage(e) proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = var tmp: TLoc @@ -1021,6 +1029,7 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = rawGenNew(p, tmp, nil) t = t.sons[0].skipTypes(abstractInst) r = ropef("(*$1)", r) + gcUsage(e) discard getTypeDesc(p.module, t) for i in 1 .. <e.len: let it = e.sons[i] @@ -1059,6 +1068,7 @@ proc genSeqConstr(p: BProc, t: PNode, d: var TLoc) = arr.r = rfmt(nil, "$1->data[$2]", rdLoc(d), intLiteral(i)) arr.s = OnHeap # we know that sequences are on the heap expr(p, t.sons[i], arr) + gcUsage(t) proc genArrToSeq(p: BProc, t: PNode, d: var TLoc) = var elem, a, arr: TLoc @@ -1099,6 +1109,7 @@ proc genNewFinalize(p: BProc, e: PNode) = genAssignment(p, a, b, {needToKeepAlive}) # set the object type: bt = skipTypes(refType.sons[0], abstractRange) genObjectInit(p, cpsStmts, bt, a, false) + gcUsage(e) proc genOf(p: BProc, x: PNode, typ: PType, d: var TLoc) = var a: TLoc @@ -1176,6 +1187,7 @@ proc genRepr(p: BProc, e: PNode, d: var TLoc) = else: putIntoDest(p, d, e.typ, ropecg(p.module, "#reprAny($1, $2)", [addrLoc(a), genTypeInfo(p.module, t)])) + gcUsage(e) proc genGetTypeInfo(p: BProc, e: PNode, d: var TLoc) = var t = skipTypes(e.sons[1].typ, abstractVarRange) @@ -1187,6 +1199,7 @@ proc genDollar(p: BProc, n: PNode, d: var TLoc, frmt: string) = a.r = ropecg(p.module, frmt, [rdLoc(a)]) if d.k == locNone: getTemp(p, n.typ, d) genAssignment(p, d, a, {needToKeepAlive}) + gcUsage(n) proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) = var a = e.sons[1] @@ -1227,10 +1240,12 @@ proc genSetLengthSeq(p: BProc, e: PNode, d: var TLoc) = rdLoc(a), rdLoc(b), getTypeDesc(p.module, t), getTypeDesc(p.module, t.sons[0])]) keepAlive(p, a) + gcUsage(e) proc genSetLengthStr(p: BProc, e: PNode, d: var TLoc) = binaryStmt(p, e, d, "$1 = #setLengthStr($1, $2);$n") keepAlive(p, d) + gcUsage(e) proc genSwap(p: BProc, e: PNode, d: var TLoc) = # swap(a, b) --> @@ -1462,6 +1477,7 @@ proc convCStrToStr(p: BProc, n: PNode, d: var TLoc) = initLocExpr(p, n.sons[0], a) putIntoDest(p, d, skipTypes(n.typ, abstractVar), ropecg(p.module, "#cstrToNimstr($1)", [rdLoc(a)])) + gcUsage(n) proc genStrEquals(p: BProc, e: PNode, d: var TLoc) = var x: TLoc diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index aea05bb2c1..a41e60e7d0 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -953,7 +953,7 @@ proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) = c.gABx(le, whichAsgnOpc(le, opcWrGlobal), tmp, s.position) else: internalAssert s.position > 0 or (s.position == 0 and - s.kind in {skParam, skResult}) + s.kind in {skParam,skResult,skForVar}) var dest: TRegister = s.position + ord(s.kind == skParam) gen(c, ri, dest) else: @@ -1014,7 +1014,8 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = else: c.gABx(n, opcLdGlobal, dest, s.position) else: - if s.position > 0 or (s.position == 0 and s.kind in {skParam, skResult}): + if s.position > 0 or (s.position == 0 and + s.kind in {skParam,skResult,skForVar}): if dest < 0: dest = s.position + ord(s.kind == skParam) else: diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index a80fdad8fe..d060cc9a8b 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -114,10 +114,10 @@ when defined(boehmgc): proc alloc0(size: int): pointer = result = alloc(size) zeroMem(result, size) - proc realloc(p: Pointer, newsize: int): pointer = + proc realloc(p: pointer, newsize: int): pointer = result = boehmRealloc(p, newsize) if result == nil: raiseOutOfMem() - proc dealloc(p: Pointer) = boehmDealloc(p) + proc dealloc(p: pointer) = boehmDealloc(p) proc allocShared(size: int): pointer = result = boehmAlloc(size) @@ -125,26 +125,26 @@ when defined(boehmgc): proc allocShared0(size: int): pointer = result = alloc(size) zeroMem(result, size) - proc reallocShared(p: Pointer, newsize: int): pointer = + proc reallocShared(p: pointer, newsize: int): pointer = result = boehmRealloc(p, newsize) if result == nil: raiseOutOfMem() - proc deallocShared(p: Pointer) = boehmDealloc(p) + proc deallocShared(p: pointer) = boehmDealloc(p) #boehmGCincremental() proc GC_disable() = boehmGC_disable() proc GC_enable() = boehmGC_enable() proc GC_fullCollect() = boehmGCfullCollect() - proc GC_setStrategy(strategy: TGC_Strategy) = nil - proc GC_enableMarkAndSweep() = nil - proc GC_disableMarkAndSweep() = nil + proc GC_setStrategy(strategy: TGC_Strategy) = discard + proc GC_enableMarkAndSweep() = discard + proc GC_disableMarkAndSweep() = discard proc GC_getStatistics(): string = return "" proc getOccupiedMem(): int = return boehmGetHeapSize()-boehmGetFreeBytes() proc getFreeMem(): int = return boehmGetFreeBytes() proc getTotalMem(): int = return boehmGetHeapSize() - proc setStackBottom(theStackBottom: pointer) = nil + proc setStackBottom(theStackBottom: pointer) = discard proc initGC() = when defined(macosx): boehmGCinit() @@ -160,8 +160,8 @@ when defined(boehmgc): proc growObj(old: pointer, newsize: int): pointer = result = realloc(old, newsize) - proc nimGCref(p: pointer) {.compilerproc, inline.} = nil - proc nimGCunref(p: pointer) {.compilerproc, inline.} = nil + proc nimGCref(p: pointer) {.compilerproc, inline.} = discard + proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} = dest[] = src @@ -173,15 +173,15 @@ when defined(boehmgc): type TMemRegion = object {.final, pure.} - proc Alloc(r: var TMemRegion, size: int): pointer = + proc alloc(r: var TMemRegion, size: int): pointer = result = boehmAlloc(size) if result == nil: raiseOutOfMem() - proc Alloc0(r: var TMemRegion, size: int): pointer = + proc alloc0(r: var TMemRegion, size: int): pointer = result = alloc(size) zeroMem(result, size) - proc Dealloc(r: var TMemRegion, p: Pointer) = boehmDealloc(p) - proc deallocOsPages(r: var TMemRegion) {.inline.} = nil - proc deallocOsPages() {.inline.} = nil + proc dealloc(r: var TMemRegion, p: Pointer) = boehmDealloc(p) + proc deallocOsPages(r: var TMemRegion) {.inline.} = discard + proc deallocOsPages() {.inline.} = discard include "system/cellsets" elif defined(nogc) and defined(useMalloc): @@ -193,10 +193,10 @@ elif defined(nogc) and defined(useMalloc): proc alloc0(size: int): pointer = result = alloc(size) zeroMem(result, size) - proc realloc(p: Pointer, newsize: int): pointer = + proc realloc(p: pointer, newsize: int): pointer = result = crealloc(p, newsize) if result == nil: raiseOutOfMem() - proc dealloc(p: Pointer) = cfree(p) + proc dealloc(p: pointer) = cfree(p) proc allocShared(size: int): pointer = result = cmalloc(size) @@ -204,26 +204,26 @@ elif defined(nogc) and defined(useMalloc): proc allocShared0(size: int): pointer = result = alloc(size) zeroMem(result, size) - proc reallocShared(p: Pointer, newsize: int): pointer = + proc reallocShared(p: pointer, newsize: int): pointer = result = crealloc(p, newsize) if result == nil: raiseOutOfMem() - proc deallocShared(p: Pointer) = cfree(p) + proc deallocShared(p: pointer) = cfree(p) - proc GC_disable() = nil - proc GC_enable() = nil - proc GC_fullCollect() = nil - proc GC_setStrategy(strategy: TGC_Strategy) = nil - proc GC_enableMarkAndSweep() = nil - proc GC_disableMarkAndSweep() = nil + proc GC_disable() = discard + proc GC_enable() = discard + proc GC_fullCollect() = discard + proc GC_setStrategy(strategy: TGC_Strategy) = discard + proc GC_enableMarkAndSweep() = discard + proc GC_disableMarkAndSweep() = discard proc GC_getStatistics(): string = return "" - proc getOccupiedMem(): int = nil - proc getFreeMem(): int = nil - proc getTotalMem(): int = nil + proc getOccupiedMem(): int = discard + proc getFreeMem(): int = discard + proc getTotalMem(): int = discard - proc setStackBottom(theStackBottom: pointer) = nil + proc setStackBottom(theStackBottom: pointer) = discard - proc initGC() = nil + proc initGC() = discard proc newObj(typ: PNimType, size: int): pointer {.compilerproc.} = result = alloc(size) @@ -235,8 +235,8 @@ elif defined(nogc) and defined(useMalloc): proc growObj(old: pointer, newsize: int): pointer = result = realloc(old, newsize) - proc nimGCref(p: pointer) {.compilerproc, inline.} = nil - proc nimGCunref(p: pointer) {.compilerproc, inline.} = nil + proc nimGCref(p: pointer) {.compilerproc, inline.} = discard + proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} = dest[] = src @@ -248,13 +248,13 @@ elif defined(nogc) and defined(useMalloc): type TMemRegion = object {.final, pure.} - proc Alloc(r: var TMemRegion, size: int): pointer = + proc alloc(r: var TMemRegion, size: int): pointer = result = alloc(size) - proc Alloc0(r: var TMemRegion, size: int): pointer = + proc alloc0(r: var TMemRegion, size: int): pointer = result = alloc0(size) - proc Dealloc(r: var TMemRegion, p: Pointer) = Dealloc(p) - proc deallocOsPages(r: var TMemRegion) {.inline.} = nil - proc deallocOsPages() {.inline.} = nil + proc dealloc(r: var TMemRegion, p: pointer) = dealloc(p) + proc deallocOsPages(r: var TMemRegion) {.inline.} = discard + proc deallocOsPages() {.inline.} = discard elif defined(nogc): # Even though we don't want the GC, we cannot simply use C's memory manager @@ -268,13 +268,13 @@ elif defined(nogc): include "system/alloc" - proc initGC() = nil - proc GC_disable() = nil - proc GC_enable() = nil - proc GC_fullCollect() = nil - proc GC_setStrategy(strategy: TGC_Strategy) = nil - proc GC_enableMarkAndSweep() = nil - proc GC_disableMarkAndSweep() = nil + proc initGC() = discard + proc GC_disable() = discard + proc GC_enable() = discard + proc GC_fullCollect() = discard + proc GC_setStrategy(strategy: TGC_Strategy) = discard + proc GC_enableMarkAndSweep() = discard + proc GC_disableMarkAndSweep() = discard proc GC_getStatistics(): string = return "" @@ -287,9 +287,9 @@ elif defined(nogc): proc growObj(old: pointer, newsize: int): pointer = result = realloc(old, newsize) - proc setStackBottom(theStackBottom: pointer) = nil - proc nimGCref(p: pointer) {.compilerproc, inline.} = nil - proc nimGCunref(p: pointer) {.compilerproc, inline.} = nil + proc setStackBottom(theStackBottom: pointer) = discard + proc nimGCref(p: pointer) {.compilerproc, inline.} = discard + proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} = dest[] = src diff --git a/todo.txt b/todo.txt index 067c376ad0..21416f279d 100644 --- a/todo.txt +++ b/todo.txt @@ -3,7 +3,6 @@ version 0.9.4 - test&finish first class iterators: * nested iterators -- ``--gc:none`` should complain about when you use the GC - ensure (ref T)(a, b) works as a type conversion and type constructor - document new templating symbol binding rules - make '--implicitStatic:on' the default diff --git a/web/news.txt b/web/news.txt index ce5f80fd2f..1ed4470090 100644 --- a/web/news.txt +++ b/web/news.txt @@ -38,6 +38,8 @@ Changes affecting backwards compatibility - ``macros.dumpTree`` and ``macros.dumpLisp`` have been made ``immediate``, ``dumpTreeImm`` and ``dumpLispImm`` are now deprecated. - The ``nil`` statement has been deprecated, use an empty ``discard`` instead. +- ``sockets.select`` now prunes sockets that are **not** ready from the list + of sockets given to it. Compiler Additions @@ -54,6 +56,7 @@ Compiler Additions - The old evaluation engine has been replaced by a proper register based virtual machine. This fixes numerous bugs for ``nimrod i`` and for macro evaluation. +- ``--gc:none`` produces warnings when code uses the GC. Language Additions From 79f59d18f19e8ab2b6878e8ef27c583bdfc16e68 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 20 Jan 2014 08:29:02 +0100 Subject: [PATCH 244/326] command syntax is allowed in expressions --- compiler/parser.nim | 118 ++++++++++++++-------- tests/parser/tcommand_as_expr.nim | 12 +++ tests/{pattern => patterns}/tpatterns.nim | 0 web/news.txt | 7 +- 4 files changed, 90 insertions(+), 47 deletions(-) create mode 100644 tests/parser/tcommand_as_expr.nim rename tests/{pattern => patterns}/tpatterns.nim (100%) diff --git a/compiler/parser.nim b/compiler/parser.nim index c44036c5f5..ff633d157d 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -34,6 +34,7 @@ type firstTok: bool lex*: TLexer # the lexer that is used for parsing tok*: TToken # the current token + inPragma: int proc parseAll*(p: var TParser): PNode proc openParser*(p: var TParser, filename: string, inputstream: PLLStream) @@ -518,14 +519,14 @@ proc parsePar(p: var TParser): PNode = eat(p, tkParRi) proc identOrLiteral(p: var TParser, mode: TPrimaryMode): PNode = + #| literal = | INT_LIT | INT8_LIT | INT16_LIT | INT32_LIT | INT64_LIT + #| | UINT_LIT | UINT8_LIT | UINT16_LIT | UINT32_LIT | UINT64_LIT + #| | FLOAT_LIT | FLOAT32_LIT | FLOAT64_LIT + #| | STR_LIT | RSTR_LIT | TRIPLESTR_LIT + #| | CHAR_LIT + #| | NIL #| generalizedLit = GENERALIZED_STR_LIT | GENERALIZED_TRIPLESTR_LIT - #| identOrLiteral = generalizedLit | symbol - #| | INT_LIT | INT8_LIT | INT16_LIT | INT32_LIT | INT64_LIT - #| | UINT_LIT | UINT8_LIT | UINT16_LIT | UINT32_LIT | UINT64_LIT - #| | FLOAT_LIT | FLOAT32_LIT | FLOAT64_LIT - #| | STR_LIT | RSTR_LIT | TRIPLESTR_LIT - #| | CHAR_LIT - #| | NIL + #| identOrLiteral = generalizedLit | symbol | literal #| | par | arrayConstr | setOrTableConstr #| | castExpr #| tupleConstr = '(' optInd (exprColonEqExpr comma?)* optPar ')' @@ -634,12 +635,15 @@ proc namedParams(p: var TParser, callee: PNode, addSon(result, a) exprColonEqExprListAux(p, endTok, result) +proc parseMacroColon(p: var TParser, x: PNode): PNode proc primarySuffix(p: var TParser, r: PNode): PNode = #| primarySuffix = '(' (exprColonEqExpr comma?)* ')' doBlocks? #| | doBlocks #| | '.' optInd ('type' | 'addr' | symbol) generalizedLit? #| | '[' optInd indexExprList optPar ']' #| | '{' optInd indexExprList optPar '}' + #| | &( '`'|IDENT|literal|'cast') expr ^+ ',' # command syntax + #| (doBlock | macroColon)? result = r while p.tok.indent < 0: case p.tok.tokType @@ -661,8 +665,27 @@ proc primarySuffix(p: var TParser, r: PNode): PNode = result = namedParams(p, result, nkBracketExpr, tkBracketRi) of tkCurlyLe: result = namedParams(p, result, nkCurlyExpr, tkCurlyRi) - else: break - + of tkSymbol, tkAccent, tkIntLit..tkCharLit, tkNil, tkCast: + if p.inPragma == 0: + # actually parsing {.push hints:off.} as {.push(hints:off).} is a sweet + # solution, but pragmas.nim can't handle that + let a = result + result = newNodeP(nkCommand, p) + addSon(result, a) + while p.tok.tokType != tkEof: + let a = parseExpr(p) + addSon(result, a) + if p.tok.tokType != tkComma: break + getTok(p) + optInd(p, a) + if p.tok.tokType == tkDo: + parseDoBlocks(p, result) + else: + result = parseMacroColon(p, result) + break + else: + break + proc primary(p: var TParser, mode: TPrimaryMode): PNode proc simpleExprAux(p: var TParser, limit: int, mode: TPrimaryMode): PNode = @@ -713,6 +736,7 @@ proc parseIfExpr(p: var TParser, kind: TNodeKind): PNode = proc parsePragma(p: var TParser): PNode = #| pragma = '{.' optInd (exprColonExpr comma?)* optPar ('.}' | '}') result = newNodeP(nkPragma, p) + inc p.inPragma getTok(p) optInd(p, result) while p.tok.tokType notin {tkCurlyDotRi, tkCurlyRi, tkEof}: @@ -724,6 +748,7 @@ proc parsePragma(p: var TParser): PNode = optPar(p) if p.tok.tokType in {tkCurlyDotRi, tkCurlyRi}: getTok(p) else: parMessage(p, errTokenExpected, ".}") + dec p.inPragma proc identVis(p: var TParser): PNode = #| identVis = symbol opr? # postfix position @@ -1031,15 +1056,50 @@ proc makeCall(n: PNode): PNode = result = newNodeI(nkCall, n.info) result.add n +proc parseMacroColon(p: var TParser, x: PNode): PNode = + #| macroColon = ':' stmt? ( IND{=} 'of' exprList ':' stmt + #| | IND{=} 'elif' expr ':' stmt + #| | IND{=} 'except' exprList ':' stmt + #| | IND{=} 'else' ':' stmt )* + result = x + if p.tok.tokType == tkColon and p.tok.indent < 0: + result = makeCall(result) + getTok(p) + skipComment(p, result) + if p.tok.tokType notin {tkOf, tkElif, tkElse, tkExcept}: + let body = parseStmt(p) + addSon(result, newProcNode(nkDo, body.info, body)) + while sameInd(p): + var b: PNode + case p.tok.tokType + of tkOf: + b = newNodeP(nkOfBranch, p) + exprList(p, tkColon, b) + of tkElif: + b = newNodeP(nkElifBranch, p) + getTok(p) + optInd(p, b) + addSon(b, parseExpr(p)) + eat(p, tkColon) + of tkExcept: + b = newNodeP(nkExceptBranch, p) + exprList(p, tkColon, b) + skipComment(p, b) + of tkElse: + b = newNodeP(nkElse, p) + getTok(p) + eat(p, tkColon) + else: break + addSon(b, parseStmt(p)) + addSon(result, b) + if b.kind == nkElse: break + proc parseExprStmt(p: var TParser): PNode = #| exprStmt = simpleExpr #| (( '=' optInd expr ) #| / ( expr ^+ comma #| doBlocks - #| / ':' stmt? ( IND{=} 'of' exprList ':' stmt - #| | IND{=} 'elif' expr ':' stmt - #| | IND{=} 'except' exprList ':' stmt - #| | IND{=} 'else' ':' stmt )* + #| / macroColon #| ))? var a = simpleExpr(p) if p.tok.tokType == tkEquals: @@ -1064,37 +1124,7 @@ proc parseExprStmt(p: var TParser): PNode = result = makeCall(result) parseDoBlocks(p, result) return result - if p.tok.tokType == tkColon and p.tok.indent < 0: - result = makeCall(result) - getTok(p) - skipComment(p, result) - if p.tok.tokType notin {tkOf, tkElif, tkElse, tkExcept}: - let body = parseStmt(p) - addSon(result, newProcNode(nkDo, body.info, body)) - while sameInd(p): - var b: PNode - case p.tok.tokType - of tkOf: - b = newNodeP(nkOfBranch, p) - exprList(p, tkColon, b) - of tkElif: - b = newNodeP(nkElifBranch, p) - getTok(p) - optInd(p, b) - addSon(b, parseExpr(p)) - eat(p, tkColon) - of tkExcept: - b = newNodeP(nkExceptBranch, p) - exprList(p, tkColon, b) - skipComment(p, b) - of tkElse: - b = newNodeP(nkElse, p) - getTok(p) - eat(p, tkColon) - else: break - addSon(b, parseStmt(p)) - addSon(result, b) - if b.kind == nkElse: break + result = parseMacroColon(p, result) proc parseModuleName(p: var TParser, kind: TNodeKind): PNode = result = parseExpr(p) diff --git a/tests/parser/tcommand_as_expr.nim b/tests/parser/tcommand_as_expr.nim new file mode 100644 index 0000000000..f6868a2fc7 --- /dev/null +++ b/tests/parser/tcommand_as_expr.nim @@ -0,0 +1,12 @@ +discard """ + output: "12" +""" + +proc foo(x: int): int = x-1 +proc foo(x, y: int): int = x-y + +let x = foo 7.foo, # comment here + foo(1, foo 8) +# 12 = 6 - -6 +echo x + diff --git a/tests/pattern/tpatterns.nim b/tests/patterns/tpatterns.nim similarity index 100% rename from tests/pattern/tpatterns.nim rename to tests/patterns/tpatterns.nim diff --git a/web/news.txt b/web/news.txt index 1ed4470090..01b6d18b9a 100644 --- a/web/news.txt +++ b/web/news.txt @@ -28,8 +28,8 @@ Changes affecting backwards compatibility require an error code to be passed to them. This error code can be retrieved using the new ``OSLastError`` proc. - ``os.parentDir`` now returns "" if there is no parent dir. -- In CGI scripts stacktraces are shown user only if cgi.setStackTraceStdout - is used. +- In CGI scripts stacktraces are shown to the user only + if ``cgi.setStackTraceStdout`` is used. - The symbol binding rules for clean templates changed: ``bind`` for any symbol that's not a parameter is now the default. ``mixin`` can be used to require instantiation scope for a symbol. @@ -71,8 +71,9 @@ Language Additions - Added a new ``delegator pragma`` for handling calls to missing procs and fields at compile-time. - The overload resolution now supports ``static[T]`` params that must be - evaluatable at compile-time. + evaluable at compile-time. - Support for user-defined type classes has been added. +- The *command syntax* is supported in a lot more contexts. Tools improvements From d18f40b4e2ea594d10c654616b95b038f808b8ed Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 20 Jan 2014 08:35:09 +0100 Subject: [PATCH 245/326] updated grammar.txt --- compiler/parser.nim | 4 ++-- doc/grammar.txt | 30 ++++++++++++++++-------------- lib/pure/pegs.nim | 8 ++++---- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/compiler/parser.nim b/compiler/parser.nim index ff633d157d..dd683eb19a 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -18,10 +18,10 @@ # In fact the grammar is generated from this file: when isMainModule: import pegs - var outp = open("compiler/grammar.txt", fmWrite) + var outp = open("doc/grammar.txt", fmWrite) for line in lines("compiler/parser.nim"): if line =~ peg" \s* '#| ' {.*}": - outp.writeln matches[0] + outp.write matches[0], "\L" outp.close import diff --git a/doc/grammar.txt b/doc/grammar.txt index 7fe2b56aa9..b002747fa8 100644 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -42,14 +42,14 @@ par = '(' optInd (&parKeyw complexOrSimpleStmt ^+ ';' | simpleExpr ('=' expr (';' complexOrSimpleStmt ^+ ';' )? )? | (':' expr)? (',' (exprColonEqExpr comma?)*)? )? optPar ')' +literal = | INT_LIT | INT8_LIT | INT16_LIT | INT32_LIT | INT64_LIT + | UINT_LIT | UINT8_LIT | UINT16_LIT | UINT32_LIT | UINT64_LIT + | FLOAT_LIT | FLOAT32_LIT | FLOAT64_LIT + | STR_LIT | RSTR_LIT | TRIPLESTR_LIT + | CHAR_LIT + | NIL generalizedLit = GENERALIZED_STR_LIT | GENERALIZED_TRIPLESTR_LIT -identOrLiteral = generalizedLit | symbol - | INT_LIT | INT8_LIT | INT16_LIT | INT32_LIT | INT64_LIT - | UINT_LIT | UINT8_LIT | UINT16_LIT | UINT32_LIT | UINT64_LIT - | FLOAT_LIT | FLOAT32_LIT | FLOAT64_LIT - | STR_LIT | RSTR_LIT | TRIPLESTR_LIT - | CHAR_LIT - | NIL +identOrLiteral = generalizedLit | symbol | literal | par | arrayConstr | setOrTableConstr | castExpr tupleConstr = '(' optInd (exprColonEqExpr comma?)* optPar ')' @@ -59,6 +59,8 @@ primarySuffix = '(' (exprColonEqExpr comma?)* ')' doBlocks? | '.' optInd ('type' | 'addr' | symbol) generalizedLit? | '[' optInd indexExprList optPar ']' | '{' optInd indexExprList optPar '}' + | &( '`'|IDENT|literal|'cast') expr ^+ ',' # command syntax + (doBlock | macroColon)? condExpr = expr colcom expr optInd ('elif' expr colcom expr optInd)* 'else' colcom expr @@ -95,18 +97,18 @@ primary = typeKeyw typeDescK / 'bind' primary typeDesc = simpleExpr typeDefAux = simpleExpr +macroColon = ':' stmt? ( IND{=} 'of' exprList ':' stmt + | IND{=} 'elif' expr ':' stmt + | IND{=} 'except' exprList ':' stmt + | IND{=} 'else' ':' stmt )* exprStmt = simpleExpr (( '=' optInd expr ) / ( expr ^+ comma doBlocks - / ':' stmt? ( IND{=} 'of' exprList ':' stmt - | IND{=} 'elif' expr ':' stmt - | IND{=} 'except' exprList ':' stmt - | IND{=} 'else' ':' stmt )* + / macroColon ))? -moduleName = expr ('as' expr)? -importStmt = 'import' optInd moduleName - ((comma moduleName)* +importStmt = 'import' optInd expr + ((comma expr)* / 'except' optInd (expr ^+ comma)) includeStmt = 'include' optInd expr ^+ comma fromStmt = 'from' moduleName 'import' optInd expr (comma expr)* diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index a6147a96ca..70b617393a 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -306,7 +306,7 @@ proc backrefIgnoreStyle*(index: range[1..MaxSubPatterns]): TPeg {. proc spaceCost(n: TPeg): int = case n.kind - of pkEmpty: nil + of pkEmpty: discard of pkTerminal, pkTerminalIgnoreCase, pkTerminalIgnoreStyle, pkChar, pkGreedyRepChar, pkCharChoice, pkGreedyRepSet, pkAny..pkWhitespace, pkGreedyAny: @@ -1117,7 +1117,7 @@ proc handleHexChar(c: var TPegLexer, xi: var int) = of 'A'..'F': xi = (xi shl 4) or (ord(c.buf[c.bufpos]) - ord('A') + 10) inc(c.bufpos) - else: nil + else: discard proc getEscapedChar(c: var TPegLexer, tok: var TToken) = inc(c.bufpos) @@ -1347,7 +1347,7 @@ proc getTok(c: var TPegLexer, tok: var TToken) = of "i": tok.modifier = modIgnoreCase of "y": tok.modifier = modIgnoreStyle of "v": tok.modifier = modVerbatim - else: nil + else: discard setLen(tok.literal, 0) if c.buf[c.bufpos] == '$': getDollar(c, tok) @@ -1494,7 +1494,7 @@ proc primary(p: var TPegParser): TPeg = of tkCurlyAt: getTok(p) return !*\primary(p).token(p) - else: nil + else: discard case p.tok.kind of tkIdentifier: if p.identIsVerbatim: From a09ddfa0995db598aa2287d08a5e31ea172fcaba Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Mon, 20 Jan 2014 15:22:44 +0200 Subject: [PATCH 246/326] fix the segfault in #827 --- compiler/sigmatch.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 1fe667a3c4..bb70e0d6b5 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -103,7 +103,7 @@ proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PSym, for i in 1..min(sonsLen(typeParams), sonsLen(binding)-1): var formalTypeParam = typeParams.sons[i-1].typ var bound = binding[i].typ - if formalTypeParam.kind != tyTypeDesc: + if bound != nil and formalTypeParam.kind != tyTypeDesc: bound = bound.skipTypes({tyTypeDesc}) put(c.bindings, formalTypeParam, bound) From 4a0aadef4d1eef2920bd84cbc532b607741a239a Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 20 Jan 2014 20:07:44 +0100 Subject: [PATCH 247/326] parser support anon iterators --- compiler/parser.nim | 5 +++-- compiler/semstmts.nim | 8 ++++++-- lib/core/macros.nim | 18 ++++++++++++------ tests/macros/tmemit.nim | 7 +++++++ tests/parser/tdomulttest.nim | 17 +++++++++++++++++ tests/parser/tinvwhen.nim | 15 +++++++++++++++ tests/{pragma => pragmas}/tuserpragma.nim | 0 todo.txt | 4 +--- 8 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 tests/macros/tmemit.nim create mode 100644 tests/parser/tdomulttest.nim create mode 100644 tests/parser/tinvwhen.nim rename tests/{pragma => pragmas}/tuserpragma.nim (100%) diff --git a/compiler/parser.nim b/compiler/parser.nim index dd683eb19a..d255949a4b 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -990,7 +990,7 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode = of tkTuple: result = parseTuple(p, mode == pmTypeDef) of tkProc: result = parseProcExpr(p, mode notin {pmTypeDesc, pmTypeDef}) of tkIterator: - when true: + when false: if mode in {pmTypeDesc, pmTypeDef}: result = parseProcExpr(p, false) result.kind = nkIteratorTy @@ -1001,7 +1001,8 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode = result = ast.emptyNode else: result = parseProcExpr(p, mode notin {pmTypeDesc, pmTypeDef}) - result.kind = nkIteratorTy + if result.kind == nkLambda: result.kind = nkIteratorDef + else: result.kind = nkIteratorTy of tkEnum: if mode == pmTypeDef: result = parseEnum(p) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 1aa6a793ce..fc1706200e 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -922,7 +922,7 @@ proc activate(c: PContext, n: PNode) = of nkCallKinds: for i in 1 .. <n.len: activate(c, n[i]) else: - nil + discard proc maybeAddResult(c: PContext, s: PSym, n: PNode) = if s.typ.sons[0] != nil and @@ -951,7 +951,11 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, var typeIsDetermined = false if n[namePos].kind != nkSym: assert phase == stepRegisterSymbol - s = semIdentDef(c, n.sons[0], kind) + + if n[namePos].kind == nkEmpty: + s = newSym(kind, idAnon, getCurrOwner(), n.info) + else: + s = semIdentDef(c, n.sons[0], kind) n.sons[namePos] = newSymNode(s) s.ast = n s.scope = c.currentScope diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 0356067f15..7cb084653e 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -300,9 +300,12 @@ when not defined(booting): ## that should be inserted verbatim in the program ## Example: ## + ## .. code-block:: nimrod ## emit("echo " & '"' & "hello world".toUpper & '"') ## - eval: result = e.parseStmt + macro payload: stmt {.gensym.} = + result = e.parseStmt + payload() proc expectKind*(n: PNimrodNode, k: TNimrodNodeKind) {.compileTime.} = ## checks that `n` is of kind `k`. If this is not the case, @@ -645,10 +648,13 @@ iterator children*(n: PNimrodNode): PNimrodNode {.inline.}= for i in 0 .. high(n): yield n[i] -template findChild*(n: PNimrodNode; cond: expr): PNimrodNode {.immediate, dirty.} = - ## Find the first child node matching condition (or nil) - ## var res = findChild(n, it.kind == nnkPostfix and it.basename.ident == !"foo") - +template findChild*(n: PNimrodNode; cond: expr): PNimrodNode {. + immediate, dirty.} = + ## Find the first child node matching condition (or nil). + ## + ## .. code-block:: nimrod + ## var res = findChild(n, it.kind == nnkPostfix and + ## it.basename.ident == !"foo") block: var result: PNimrodNode for it in n.children: @@ -736,6 +742,6 @@ proc addIdentIfAbsent*(dest: PNimrodNode, ident: string) {.compiletime.} = if ident.eqIdent($node): return of nnkExprColonExpr: if ident.eqIdent($node[0]): return - else: nil + else: discard dest.add(ident(ident)) diff --git a/tests/macros/tmemit.nim b/tests/macros/tmemit.nim new file mode 100644 index 0000000000..e4bb2daedc --- /dev/null +++ b/tests/macros/tmemit.nim @@ -0,0 +1,7 @@ +discard """ + out: '''HELLO WORLD''' +""" + +import macros, strutils + +emit("echo " & '"' & "hello world".toUpper & '"') diff --git a/tests/parser/tdomulttest.nim b/tests/parser/tdomulttest.nim new file mode 100644 index 0000000000..4ee6de128e --- /dev/null +++ b/tests/parser/tdomulttest.nim @@ -0,0 +1,17 @@ +discard """ + file: "tdomulttest.nim" + output: "555\ntest\nmulti lines\n99999999\nend" + disabled: true +""" +proc foo(bar, baz: proc (x: int): int) = + echo bar(555) + echo baz(99999999) + +foo do (x: int) -> int: + return x +do (x: int) -> int: + echo("test") + echo("multi lines") + return x + +echo("end") \ No newline at end of file diff --git a/tests/parser/tinvwhen.nim b/tests/parser/tinvwhen.nim new file mode 100644 index 0000000000..5ff94cc6c2 --- /dev/null +++ b/tests/parser/tinvwhen.nim @@ -0,0 +1,15 @@ +discard """ + file: "tinvwhen.nim" + line: 11 + errormsg: "invalid indentation" +""" +# This was parsed even though it should not! + +proc chdir(path: cstring): cint {.importc: "chdir", header: "dirHeader".} + +proc getcwd(buf: cstring, buflen: cint): cstring + when defined(unix): {.importc: "getcwd", header: "<unistd.h>".} #ERROR_MSG invalid indentation + elif defined(windows): {.importc: "getcwd", header: "<direct.h>"} + else: {.error: "os library not ported to your OS. Please help!".} + + diff --git a/tests/pragma/tuserpragma.nim b/tests/pragmas/tuserpragma.nim similarity index 100% rename from tests/pragma/tuserpragma.nim rename to tests/pragmas/tuserpragma.nim diff --git a/todo.txt b/todo.txt index 21416f279d..15ce93df75 100644 --- a/todo.txt +++ b/todo.txt @@ -6,6 +6,7 @@ version 0.9.4 - ensure (ref T)(a, b) works as a type conversion and type constructor - document new templating symbol binding rules - make '--implicitStatic:on' the default +- change comment handling in the AST - special rule for ``[]=`` - ``=`` should be overloadable; requires specialization for ``=``; general @@ -27,8 +28,6 @@ Bugs - docgen: sometimes effects are listed twice - 'result' is not properly cleaned for NRVO --> use uninit checking instead - sneaking with qualifiedLookup() is really broken! -- aporia.nim(968, 5) Error: ambiguous identifier: 'DELETE' -- - use a qualifier - blocks can "export" an identifier but the CCG generates {} for them ... - osproc execProcesses can deadlock if all processes fail (as experienced in c++ mode) @@ -54,7 +53,6 @@ version 0.9.X - implement the missing features wrt inheritance - better support for macros that rewrite procs - macros need access to types and symbols (partially implemented) -- perhaps: change comment handling in the AST - enforce 'simpleExpr' more often --> doesn't work; tkProc is part of primary! - the typeDesc/expr unification is weird and only necessary because of From 37229df7fc044fe108d2f4d88f127141cabeb6a6 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Wed, 22 Jan 2014 17:32:38 +0100 Subject: [PATCH 248/326] next steps for closure iterators --- compiler/ast.nim | 1 + compiler/lambdalifting.nim | 136 +++++++++++------- compiler/lexer.nim | 2 +- compiler/parser.nim | 4 +- compiler/renderer.nim | 5 + compiler/semstmts.nim | 11 +- compiler/transf.nim | 3 + doc/manual.txt | 25 ++-- koch.nim | 9 +- lib/core/macros.nim | 4 +- tests/{block => controlflow}/tblock1.nim | 0 tests/{ifstmt => controlflow}/tnestif.nim | 0 tests/iter/tanoniter1.nim | 32 +++++ tests/iter/titer2.nim | 2 +- tests/{static => metatype}/tstaticparams.nim | 0 tests/{object => objects}/tobjconstr.nim | 0 tests/{object => objects}/tobjconstr2.nim | 0 tests/{object => objects}/tobjcov.nim | 0 tests/{object => objects}/tobject.nim | 0 tests/{object => objects}/tobject2.nim | 0 tests/{object => objects}/tobject3.nim | 0 tests/{operator => objects}/tofopr.nim | 0 tests/{object => objects}/toop.nim | 0 tests/{object => objects}/toop1.nim | 0 tests/{operator => parser}/toprprec.nim | 0 tests/{operator => parser}/tprecedence.nim | 0 .../tdrdobbs_examples.nim | 0 todo.txt | 1 + 28 files changed, 164 insertions(+), 71 deletions(-) rename tests/{block => controlflow}/tblock1.nim (100%) rename tests/{ifstmt => controlflow}/tnestif.nim (100%) create mode 100644 tests/iter/tanoniter1.nim rename tests/{static => metatype}/tstaticparams.nim (100%) rename tests/{object => objects}/tobjconstr.nim (100%) rename tests/{object => objects}/tobjconstr2.nim (100%) rename tests/{object => objects}/tobjcov.nim (100%) rename tests/{object => objects}/tobject.nim (100%) rename tests/{object => objects}/tobject2.nim (100%) rename tests/{object => objects}/tobject3.nim (100%) rename tests/{operator => objects}/tofopr.nim (100%) rename tests/{object => objects}/toop.nim (100%) rename tests/{object => objects}/toop1.nim (100%) rename tests/{operator => parser}/toprprec.nim (100%) rename tests/{operator => parser}/tprecedence.nim (100%) rename tests/{important => showoff}/tdrdobbs_examples.nim (100%) diff --git a/compiler/ast.nim b/compiler/ast.nim index 0e351a31ac..82cc2c96ff 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -287,6 +287,7 @@ const sfNoRoot* = sfBorrow # a local variable is provably no root so it doesn't # require RC ops + sfClosureCreated* = sfDiscriminant # for transf-lambdalifting interaction const # getting ready for the future expr/stmt merge diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index ed92fefb40..2189a1d677 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -116,9 +116,9 @@ type TDep = tuple[e: PEnv, field: PSym] TEnv {.final.} = object of TObject attachedNode: PNode - closure: PSym # if != nil it is a used environment + closure: PSym # if != nil it is a used environment capturedVars: seq[PSym] # captured variables in this environment - deps: seq[TDep] # dependencies + deps: seq[TDep] # dependencies up: PEnv tup: PType @@ -149,7 +149,19 @@ proc newInnerContext(fn: PSym): PInnerContext = new(result) result.fn = fn initIdNodeTable(result.localsToAccess) - + +proc getStateType(iter: PSym): PType = + var n = newNodeI(nkRange, iter.info) + addSon(n, newIntNode(nkIntLit, -1)) + addSon(n, newIntNode(nkIntLit, 0)) + result = newType(tyRange, iter) + result.n = n + rawAddSon(result, getSysType(tyInt)) + +proc createStateField(iter: PSym): PSym = + result = newSym(skField, getIdent(":state"), iter, iter.info) + result.typ = getStateType(iter) + proc newEnv(outerProc: PSym, up: PEnv, n: PNode): PEnv = new(result) result.deps = @[] @@ -170,6 +182,9 @@ proc addField(tup: PType, s: PSym) = proc addCapturedVar(e: PEnv, v: PSym) = for x in e.capturedVars: if x == v: return + # XXX meh, just add the state field for every closure for now, it's too + # hard to figure out if it comes from a closure iterator: + if e.tup.len == 0: addField(e.tup, createStateField(v.owner)) e.capturedVars.add(v) addField(e.tup, v) @@ -189,6 +204,7 @@ proc indirectAccess(a: PNode, b: PSym, info: TLineInfo): PNode = # returns a[].b as a node var deref = newNodeI(nkHiddenDeref, info) deref.typ = a.typ.sons[0] + assert deref.typ.kind == tyTuple let field = getSymFromList(deref.typ.n, b.name) assert field != nil, b.name.s addSon(deref, a) @@ -220,18 +236,30 @@ proc getHiddenParam(routine: PSym): PSym = assert hidden.kind == nkSym result = hidden.sym +proc getEnvParam(routine: PSym): PSym = + let params = routine.ast.sons[paramsPos] + let hidden = lastSon(params) + if hidden.kind == nkSym and hidden.sym.name.s == paramName: + result = hidden.sym + proc isInnerProc(s, outerProc: PSym): bool {.inline.} = - result = s.kind in {skProc, skMethod, skConverter} and + result = (s.kind in {skProc, skMethod, skConverter} or + s.kind == skIterator and s.typ.callConv == ccClosure) and s.skipGenericOwner == outerProc #s.typ.callConv == ccClosure proc addClosureParam(i: PInnerContext, e: PEnv) = - var cp = newSym(skParam, getIdent(paramName), i.fn, i.fn.info) - incl(cp.flags, sfFromGeneric) - cp.typ = newType(tyRef, i.fn) - rawAddSon(cp.typ, e.tup) + var cp = getEnvParam(i.fn) + if cp == nil: + cp = newSym(skParam, getIdent(paramName), i.fn, i.fn.info) + incl(cp.flags, sfFromGeneric) + cp.typ = newType(tyRef, i.fn) + rawAddSon(cp.typ, e.tup) + addHiddenParam(i.fn, cp) + else: + e.tup = cp.typ.sons[0] + assert e.tup.kind == tyTuple i.closureParam = cp - addHiddenParam(i.fn, i.closureParam) #echo "closure param added for ", i.fn.name.s, " ", i.fn.id proc dummyClosureParam(o: POuterContext, i: PInnerContext) = @@ -344,6 +372,7 @@ proc transformOuterConv(n: PNode): PNode = proc makeClosure(prc, env: PSym, info: TLineInfo): PNode = result = newNodeIT(nkClosure, info, prc.typ) result.add(newSymNode(prc)) + if prc.kind == skIterator: incl(prc.flags, sfClosureCreated) if env == nil: result.add(newNodeIT(nkNilLit, info, getSysType(tyNil))) else: @@ -366,10 +395,10 @@ proc transformInnerProc(o: POuterContext, i: PInnerContext, n: PNode): PNode = else: # captured symbol? result = idNodeTableGet(i.localsToAccess, n.sym) - of nkLambdaKinds: - result = transformInnerProc(o, i, n.sons[namePos]) - of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, - nkIteratorDef: + of nkLambdaKinds, nkIteratorDef: + if n.typ != nil: + result = transformInnerProc(o, i, n.sons[namePos]) + of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef: # don't recurse here: discard else: @@ -400,8 +429,9 @@ proc searchForInnerProcs(o: POuterContext, n: PNode) = if inner.closureParam != nil: let ti = transformInnerProc(o, inner, body) if ti != nil: n.sym.ast.sons[bodyPos] = ti - of nkLambdaKinds: - searchForInnerProcs(o, n.sons[namePos]) + of nkLambdaKinds, nkIteratorDef: + if n.typ != nil: + searchForInnerProcs(o, n.sons[namePos]) of nkWhileStmt, nkForStmt, nkParForStmt, nkBlockStmt: # some nodes open a new scope, so they are candidates for the insertion # of closure creation; however for simplicity we merge closures between @@ -437,8 +467,7 @@ proc searchForInnerProcs(o: POuterContext, n: PNode) = searchForInnerProcs(o, it.sons[L-1]) else: internalError(it.info, "transformOuter") - of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, - nkIteratorDef: + of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef: # don't recurse here: # XXX recurse here and setup 'up' pointers discard @@ -535,10 +564,10 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = assert result != nil, "cannot find: " & local.name.s # else it is captured by copy and this means that 'outer' should continue # to access the local as a local. - of nkLambdaKinds: - result = transformOuterProc(o, n.sons[namePos]) - of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, - nkIteratorDef: + of nkLambdaKinds, nkIteratorDef: + if n.typ != nil: + result = transformOuterProc(o, n.sons[namePos]) + of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef: # don't recurse here: discard of nkHiddenStdConv, nkHiddenSubConv, nkConv: @@ -607,11 +636,14 @@ type tup: PType proc newIterResult(iter: PSym): PSym = - result = iter.ast.sons[resultPos].sym - when false: + if resultPos < iter.ast.len: + result = iter.ast.sons[resultPos].sym + else: + # XXX a bit hacky: result = newSym(skResult, getIdent":result", iter, iter.info) result.typ = iter.typ.sons[0] incl(result.flags, sfUsed) + iter.ast.add newSymNode(result) proc interestingIterVar(s: PSym): bool {.inline.} = result = s.kind in {skVar, skLet, skTemp, skForVar} and sfGlobal notin s.flags @@ -663,36 +695,40 @@ proc transfIterBody(c: var TIterContext, n: PNode): PNode = let x = transfIterBody(c, n.sons[i]) if x != nil: n.sons[i] = x -proc getStateType(iter: PSym): PType = - var n = newNodeI(nkRange, iter.info) - addSon(n, newIntNode(nkIntLit, -1)) - addSon(n, newIntNode(nkIntLit, 0)) - result = newType(tyRange, iter) - result.n = n - rawAddSon(result, getSysType(tyInt)) - -proc liftIterator*(iter: PSym, body: PNode): PNode = - var c: TIterContext +proc initIterContext(c: var TIterContext, iter: PSym) = c.iter = iter c.capturedVars = initIntSet() - c.tup = newType(tyTuple, iter) - c.tup.n = newNodeI(nkRecList, iter.info) + var cp = getEnvParam(iter) + if cp == nil: + c.tup = newType(tyTuple, iter) + c.tup.n = newNodeI(nkRecList, iter.info) + + cp = newSym(skParam, getIdent(paramName), iter, iter.info) + incl(cp.flags, sfFromGeneric) + cp.typ = newType(tyRef, iter) + rawAddSon(cp.typ, c.tup) + addHiddenParam(iter, cp) + + c.state = createStateField(iter) + addField(c.tup, c.state) + else: + c.tup = cp.typ.sons[0] + assert c.tup.kind == tyTuple + if c.tup.len > 0: + c.state = c.tup.n[0].sym + else: + c.state = createStateField(iter) + addField(c.tup, c.state) - var cp = newSym(skParam, getIdent(paramName), iter, iter.info) - incl(cp.flags, sfFromGeneric) - cp.typ = newType(tyRef, iter) - rawAddSon(cp.typ, c.tup) c.closureParam = cp - addHiddenParam(iter, cp) - - c.state = newSym(skField, getIdent(":state"), iter, iter.info) - c.state.typ = getStateType(iter) - addField(c.tup, c.state) - if iter.typ.sons[0] != nil: c.resultSym = newIterResult(iter) - iter.ast.add(newSymNode(c.resultSym)) + #iter.ast.add(newSymNode(c.resultSym)) + +proc liftIterator*(iter: PSym, body: PNode): PNode = + var c: TIterContext + initIterContext c, iter result = newNodeI(nkStmtList, iter.info) var gs = newNodeI(nkGotoState, iter.info) @@ -716,12 +752,14 @@ proc liftIterator*(iter: PSym, body: PNode): PNode = proc liftIterSym*(n: PNode): PNode = # transforms (iter) to (let env = newClosure[iter](); (iter, env)) - result = newNodeIT(nkStmtListExpr, n.info, n.typ) let iter = n.sym assert iter.kind == skIterator + if sfClosureCreated in iter.flags: return n + + result = newNodeIT(nkStmtListExpr, n.info, n.typ) + var env = copySym(getHiddenParam(iter)) env.kind = skLet - var v = newNodeI(nkVarSection, n.info) addVar(v, newSymNode(env)) result.add(v) @@ -766,7 +804,7 @@ proc liftForLoop*(body: PNode): PNode = # static binding? var env: PSym if call[0].kind == nkSym and call[0].sym.kind == skIterator: - # createClose() + # createClosure() let iter = call[0].sym assert iter.kind == skIterator env = copySym(getHiddenParam(iter)) diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 97414ddb73..0e7df13cd7 100644 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. diff --git a/compiler/parser.nim b/compiler/parser.nim index d255949a4b..2b845f3da1 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -31,7 +31,7 @@ type TParser*{.final.} = object # a TParser object represents a module that # is being parsed currInd: int # current indentation - firstTok: bool + firstTok, strongSpaces: bool lex*: TLexer # the lexer that is used for parsing tok*: TToken # the current token inPragma: int diff --git a/compiler/renderer.nim b/compiler/renderer.nim index b5e3c0e74d..6588caa049 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -1251,6 +1251,11 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkParLe, "(META|") gsub(g, n.sons[0]) put(g, tkParRi, ")") + of nkGotoState, nkState: + var c: TContext + initContext c + putWithSpace g, tkSymbol, if n.kind == nkState: "state" else: "goto" + gsons(g, n, c) else: #nkNone, nkExplicitTypeListCall: internalError(n.info, "rnimsyn.gsub(" & $n.kind & ')') diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index fc1706200e..a26d898361 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -868,6 +868,8 @@ proc semProcAnnotation(c: PContext, prc: PNode): PNode = return semStmt(c, x) proc semLambda(c: PContext, n: PNode, flags: TExprFlags): PNode = + # XXX semProcAux should be good enough for this now, we will eventually + # remove semLambda result = semProcAnnotation(c, n) if result != nil: return result result = n @@ -949,11 +951,13 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, checkSonsLen(n, bodyPos + 1) var s: PSym var typeIsDetermined = false + var isAnon = false if n[namePos].kind != nkSym: assert phase == stepRegisterSymbol if n[namePos].kind == nkEmpty: s = newSym(kind, idAnon, getCurrOwner(), n.info) + isAnon = true else: s = semIdentDef(c, n.sons[0], kind) n.sons[namePos] = newSymNode(s) @@ -996,11 +1000,13 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, rawAddSon(s.typ, nil) if n.sons[patternPos].kind != nkEmpty: n.sons[patternPos] = semPattern(c, n.sons[patternPos]) - if s.kind == skIterator: s.typ.flags.incl(tfIterator) + if s.kind == skIterator: + s.typ.flags.incl(tfIterator) var proto = searchForProc(c, s.scope, s) if proto == nil: - s.typ.callConv = lastOptionEntry(c).defaultCC + if s.kind == skIterator and isAnon: s.typ.callConv = ccClosure + else: s.typ.callConv = lastOptionEntry(c).defaultCC # add it here, so that recursive procs are possible: if sfGenSym in s.flags: discard elif kind in OverloadableSyms: @@ -1078,6 +1084,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, popOwner() if n.sons[patternPos].kind != nkEmpty: c.patterns.add(s) + if isAnon: result.typ = s.typ proc determineType(c: PContext, s: PSym) = if s.typ != nil: return diff --git a/compiler/transf.nim b/compiler/transf.nim index f22433972c..973e8848a5 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -636,6 +636,8 @@ proc transform(c: PTransf, n: PNode): PTransNode = s.ast.sons[bodyPos] = n.sons[bodyPos] #n.sons[bodyPos] = liftLambdas(s, n) #if n.kind == nkMethodDef: methodDef(s, false) + if n.kind == nkIteratorDef and n.typ != nil: + return liftIterSym(n.sons[namePos]).PTransNode result = PTransNode(n) of nkMacroDef: # XXX no proper closure support yet: @@ -708,6 +710,7 @@ proc transform(c: PTransf, n: PNode): PTransNode = # XXX comment handling really sucks: if importantComments(): PNode(result).comment = n.comment + of nkClosure: return PTransNode(n) else: result = transformSons(c, n) var cnst = getConstExpr(c.module, PNode(result)) diff --git a/doc/manual.txt b/doc/manual.txt index c903732331..9f84bc951f 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -2261,8 +2261,8 @@ from different modules having the same name. using sdl.SetTimer Note that ``using`` only *adds* to the current context, it doesn't remove or -replace, **neither** does it create a new scope. What this means is that if you -apply this to multiple variables the compiler will find conflicts in what +replace, **neither** does it create a new scope. What this means is that if one +applies this to multiple variables the compiler will find conflicts in what variable to use: .. code-block:: nimrod @@ -2275,7 +2275,7 @@ variable to use: echo b When the compiler reaches the second ``add`` call, both ``a`` and ``b`` could -be used with the proc, so you get ``Error: expression '(a|b)' has no type (or +be used with the proc, so one gets ``Error: expression '(a|b)' has no type (or is ambiguous)``. To solve this you would need to nest ``using`` with a ``block`` statement so as to control the reach of the ``using`` statement. @@ -2368,8 +2368,8 @@ The `addr`:idx: operator returns the address of an l-value. If the type of the location is ``T``, the `addr` operator result is of the type ``ptr T``. An address is always an untraced reference. Taking the address of an object that resides on the stack is **unsafe**, as the pointer may live longer than the -object on the stack and can thus reference a non-existing object. You can get -the address of variables, but you can't use it on variables declared through +object on the stack and can thus reference a non-existing object. One can get +the address of variables, but one can't use it on variables declared through ``let`` statements: .. code-block:: nimrod @@ -2764,7 +2764,7 @@ First class iterators There are 2 kinds of iterators in Nimrod: *inline* and *closure* iterators. An `inline iterator`:idx: is an iterator that's always inlined by the compiler leading to zero overhead for the abstraction, but may result in a heavy -increasee in code size. Inline iterators are second class +increase in code size. Inline iterators are second class citizens; one cannot pass them around like first class procs. In contrast to that, a `closure iterator`:idx: can be passed around: @@ -2835,7 +2835,10 @@ a `collaborative tasking`:idx: system: The builtin ``system.finished`` can be used to determine if an iterator has finished its operation; no exception is raised on an attempt to invoke an -iterator that has already finished its work. +iterator that has already finished its work. + +One always has to + Type sections @@ -2923,9 +2926,9 @@ in an implicit try block: finally: close(f) ... -The ``except`` statement has a limitation in this form: you can't specify the -type of the exception, you have to catch everything. Also, if you want to use -both ``finally`` and ``except`` you need to reverse the usual sequence of the +The ``except`` statement has a limitation in this form: one can't specify the +type of the exception, one has to catch everything. Also, if one wants to use +both ``finally`` and ``except`` one needs to reverse the usual sequence of the statements. Example: .. code-block:: nimrod @@ -3353,7 +3356,7 @@ currently matched type. These instances can act both as variables of the type, when used in contexts, where a value is expected, and as the type itself, when used in a contexts, where a type is expected. -Please note that the ``is`` operator allows you to easily verify the precise +Please note that the ``is`` operator allows one to easily verify the precise type signatures of the required operations, but since type inference and default parameters are still applied in the provided block, it's also possible to encode usage protocols that doesn't reveal implementation details. diff --git a/koch.nim b/koch.nim index 1814a0efc3..35a86a597c 100644 --- a/koch.nim +++ b/koch.nim @@ -42,7 +42,7 @@ Possible Commands: csource [options] builds the C sources for installation zip builds the installation ZIP package inno [options] builds the Inno Setup installer (for Windows) - tests run the testsuite + tests [options] run the testsuite update updates nimrod to the latest version from github (compile koch with -d:withUpdate to enable) temp options creates a temporary compiler for testing @@ -260,11 +260,14 @@ when defined(withUpdate): # -------------- tests -------------------------------------------------------- +template `|`(a, b): expr = (if a.len > 0: a else: b) + proc tests(args: string) = # we compile the tester with taintMode:on to have a basic # taint mode test :-) - exec("nimrod cc --taintMode:on tests/testament/tester") - exec(getCurrentDir() / "tests/testament/tester".exe & " all") + exec "nimrod cc --taintMode:on tests/testament/tester" + exec quoteShell(getCurrentDir() / "tests/testament/tester".exe) & " " & + (args|"all") proc temp(args: string) = var output = "compiler" / "nimrod".exe diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 7cb084653e..3b36e31e0b 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -390,7 +390,7 @@ proc treeRepr*(n: PNimrodNode): string {.compileTime.} = res.add(($n.kind).substr(3)) case n.kind - of nnkEmpty: nil # same as nil node in this representation + of nnkEmpty: discard # same as nil node in this representation of nnkNilLit: res.add(" nil") of nnkCharLit..nnkInt64Lit: res.add(" " & $n.intVal) of nnkFloatLit..nnkFloat64Lit: res.add(" " & $n.floatVal) @@ -415,7 +415,7 @@ proc lispRepr*(n: PNimrodNode): string {.compileTime.} = add(result, "(") case n.kind - of nnkEmpty: nil # same as nil node in this representation + of nnkEmpty: discard # same as nil node in this representation of nnkNilLit: add(result, "nil") of nnkCharLit..nnkInt64Lit: add(result, $n.intVal) of nnkFloatLit..nnkFloat64Lit: add(result, $n.floatVal) diff --git a/tests/block/tblock1.nim b/tests/controlflow/tblock1.nim similarity index 100% rename from tests/block/tblock1.nim rename to tests/controlflow/tblock1.nim diff --git a/tests/ifstmt/tnestif.nim b/tests/controlflow/tnestif.nim similarity index 100% rename from tests/ifstmt/tnestif.nim rename to tests/controlflow/tnestif.nim diff --git a/tests/iter/tanoniter1.nim b/tests/iter/tanoniter1.nim new file mode 100644 index 0000000000..9db5ab8eca --- /dev/null +++ b/tests/iter/tanoniter1.nim @@ -0,0 +1,32 @@ +discard """ + output: '''1 +2 +3 +4 +1 +2''' +""" + +proc factory(a, b: int): iterator (): int = + iterator foo(): int = + var x = a + while x <= b: + yield x + inc x + return foo + +proc factory2(a, b: int): iterator (): int = + return iterator (): int = + var x = a + while x <= b: + yield x + inc x + +let foo = factory 1, 4 + +for f in foo(): + echo f + +let foo2 = factory2 1,2 + +for f in foo2(): echo f diff --git a/tests/iter/titer2.nim b/tests/iter/titer2.nim index dab2713e8f..f8967109e2 100644 --- a/tests/iter/titer2.nim +++ b/tests/iter/titer2.nim @@ -1,6 +1,6 @@ discard """ output: '''true''' - cmd: "nimrod cc --gc:none --hints:on $# $#" + cmd: "nimrod cc --gc:none --hints:on --warnings:off $# $#" """ import hashes diff --git a/tests/static/tstaticparams.nim b/tests/metatype/tstaticparams.nim similarity index 100% rename from tests/static/tstaticparams.nim rename to tests/metatype/tstaticparams.nim diff --git a/tests/object/tobjconstr.nim b/tests/objects/tobjconstr.nim similarity index 100% rename from tests/object/tobjconstr.nim rename to tests/objects/tobjconstr.nim diff --git a/tests/object/tobjconstr2.nim b/tests/objects/tobjconstr2.nim similarity index 100% rename from tests/object/tobjconstr2.nim rename to tests/objects/tobjconstr2.nim diff --git a/tests/object/tobjcov.nim b/tests/objects/tobjcov.nim similarity index 100% rename from tests/object/tobjcov.nim rename to tests/objects/tobjcov.nim diff --git a/tests/object/tobject.nim b/tests/objects/tobject.nim similarity index 100% rename from tests/object/tobject.nim rename to tests/objects/tobject.nim diff --git a/tests/object/tobject2.nim b/tests/objects/tobject2.nim similarity index 100% rename from tests/object/tobject2.nim rename to tests/objects/tobject2.nim diff --git a/tests/object/tobject3.nim b/tests/objects/tobject3.nim similarity index 100% rename from tests/object/tobject3.nim rename to tests/objects/tobject3.nim diff --git a/tests/operator/tofopr.nim b/tests/objects/tofopr.nim similarity index 100% rename from tests/operator/tofopr.nim rename to tests/objects/tofopr.nim diff --git a/tests/object/toop.nim b/tests/objects/toop.nim similarity index 100% rename from tests/object/toop.nim rename to tests/objects/toop.nim diff --git a/tests/object/toop1.nim b/tests/objects/toop1.nim similarity index 100% rename from tests/object/toop1.nim rename to tests/objects/toop1.nim diff --git a/tests/operator/toprprec.nim b/tests/parser/toprprec.nim similarity index 100% rename from tests/operator/toprprec.nim rename to tests/parser/toprprec.nim diff --git a/tests/operator/tprecedence.nim b/tests/parser/tprecedence.nim similarity index 100% rename from tests/operator/tprecedence.nim rename to tests/parser/tprecedence.nim diff --git a/tests/important/tdrdobbs_examples.nim b/tests/showoff/tdrdobbs_examples.nim similarity index 100% rename from tests/important/tdrdobbs_examples.nim rename to tests/showoff/tdrdobbs_examples.nim diff --git a/todo.txt b/todo.txt index 15ce93df75..943d982c4d 100644 --- a/todo.txt +++ b/todo.txt @@ -3,6 +3,7 @@ version 0.9.4 - test&finish first class iterators: * nested iterators +- implement strongSpaces:on - ensure (ref T)(a, b) works as a type conversion and type constructor - document new templating symbol binding rules - make '--implicitStatic:on' the default From 9dec669b941b8ebf6d66ec29c3bb9451ad164b51 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Thu, 23 Jan 2014 00:01:15 +0200 Subject: [PATCH 249/326] nest PreMain inside NimMain for easier consumption of static libraries developed in Nimrod fixes many uses of $N instead of $n for new lines that don't affect #line directives --- compiler/cgen.nim | 124 +++++++++++++++++++++++++--------------------- 1 file changed, 67 insertions(+), 57 deletions(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 0e6e483998..5057ae558e 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -911,29 +911,29 @@ proc addIntTypes(result: var PRope) {.inline.} = appf(result, "#define NIM_INTBITS $1", [ platform.CPU[targetCPU].intSize.toRope]) -proc getCopyright(cfilenoext: string): PRope = - if optCompileOnly in gGlobalOptions: - result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & - "/* (c) 2014 Andreas Rumpf */$n" & - "/* The generated code is subject to the original license. */$n", - "; Generated by Nimrod Compiler v$1$n" & - "; (c) 2012 Andreas Rumpf$n", [toRope(VersionAsString)]) - else: - result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & - "/* (c) 2014 Andreas Rumpf */$n" & - "/* The generated code is subject to the original license. */$n" & - "/* Compiled for: $2, $3, $4 */$n" & - "/* Command for C compiler:$n $5 */$n", - "; Generated by Nimrod Compiler v$1$n" & - "; (c) 2014 Andreas Rumpf$n" & - "; Compiled for: $2, $3, $4$n" & - "; Command for LLVM compiler:$n $5$n", [toRope(VersionAsString), - toRope(platform.OS[targetOS].name), - toRope(platform.CPU[targetCPU].name), - toRope(extccomp.CC[extccomp.cCompiler].name), +proc getCopyright(cfilenoext: string): PRope = + if optCompileOnly in gGlobalOptions: + result = ropeff("/* Generated by Nimrod Compiler v$1 */$N" & + "/* (c) 2014 Andreas Rumpf */$N" & + "/* The generated code is subject to the original license. */$N", + "; Generated by Nimrod Compiler v$1$N" & + "; (c) 2012 Andreas Rumpf$N", [toRope(VersionAsString)]) + else: + result = ropeff("/* Generated by Nimrod Compiler v$1 */$N" & + "/* (c) 2014 Andreas Rumpf */$N" & + "/* The generated code is subject to the original license. */$N" & + "/* Compiled for: $2, $3, $4 */$N" & + "/* Command for C compiler:$n $5 */$N", + "; Generated by Nimrod Compiler v$1$N" & + "; (c) 2014 Andreas Rumpf$N" & + "; Compiled for: $2, $3, $4$N" & + "; Command for LLVM compiler:$N $5$N", [toRope(VersionAsString), + toRope(platform.OS[targetOS].name), + toRope(platform.CPU[targetCPU].name), + toRope(extccomp.CC[extccomp.cCompiler].name), toRope(getCompileCFileCmd(cfilenoext))]) -proc getFileHeader(cfilenoext: string): PRope = +proc getFileHeader(cfilenoext: string): PRope = result = getCopyright(cfilenoext) addIntTypes(result) @@ -941,61 +941,71 @@ proc genFilenames(m: BModule): PRope = discard cgsym(m, "dbgRegisterFilename") result = nil for i in 0.. <fileInfos.len: - result.appf("dbgRegisterFilename($1);$n", fileInfos[i].projPath.makeCString) + result.appf("dbgRegisterFilename($1);$N", fileInfos[i].projPath.makeCString) proc genMainProc(m: BModule) = const PreMainBody = - "\tsystemDatInit();$n" & - "\tsystemInit();$n" & + "\tsystemDatInit();$N" & + "\tsystemInit();$N" & "$1" & "$2" & "$3" & "$4" MainProcs = - "\tPreMain();$n" & - "\tNimMain();$n" + "\tNimMain();$N" MainProcsWithResult = - MainProcs & "\treturn nim_program_result;$n" + MainProcs & "\treturn nim_program_result;$N" + + NimMainBody = + "N_CDECL(void, NimMain)(void) {$N" & + "\tPreMain();$N" & + "$1$N" & + "}$N" PosixNimMain = - "int cmdCount;$n" & - "char** cmdLine;$n" & - "char** gEnv;$n" & - "N_CDECL(void, NimMain)(void) {$n$1}$n" + "int cmdCount;$N" & + "char** cmdLine;$N" & + "char** gEnv;$N" & + NimMainBody - PosixCMain = "int main(int argc, char** args, char** env) {$n" & - "\tcmdLine = args;$n" & "\tcmdCount = argc;$n" & "\tgEnv = env;$n" & - MainProcsWithResult & - "}$n" + PosixCMain = + "int main(int argc, char** args, char** env) {$N" & + "\tcmdLine = args;$N" & + "\tcmdCount = argc;$N" & + "\tgEnv = env;$N" & + MainProcsWithResult & + "}$N" - StandaloneCMain = "int main(void) {$n" & - MainProcs & - "\treturn 0;$n" & "}$n" + StandaloneCMain = + "int main(void) {$N" & + MainProcs & + "\treturn 0;$N" & + "}$N" - WinNimMain = "N_CDECL(void, NimMain)(void) {$n$1}$n" + WinNimMain = NimMainBody - WinCMain = "N_STDCALL(int, WinMain)(HINSTANCE hCurInstance, $n" & - " HINSTANCE hPrevInstance, $n" & - " LPSTR lpCmdLine, int nCmdShow) {$n" & - MainProcsWithResult & "}$n" + WinCMain = "N_STDCALL(int, WinMain)(HINSTANCE hCurInstance, $N" & + " HINSTANCE hPrevInstance, $N" & + " LPSTR lpCmdLine, int nCmdShow) {$N" & + MainProcsWithResult & "}$N" - WinNimDllMain = "N_LIB_EXPORT N_CDECL(void, NimMain)(void) {$n$1}$n" + WinNimDllMain = "N_LIB_EXPORT " & NimMainBody WinCDllMain = - "BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, $n" & - " LPVOID lpvReserved) {$n" & - "\tif(fwdreason == DLL_PROCESS_ATTACH) {" & MainProcs & "}$n" & - "\treturn 1;$n}$n" + "BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, $N" & + " LPVOID lpvReserved) {$N" & + "\tif(fwdreason == DLL_PROCESS_ATTACH) {$N" & MainProcs & "}$N" & + "\treturn 1;$N}$N" PosixNimDllMain = WinNimDllMain PosixCDllMain = - "void NIM_POSIX_INIT NimMainInit(void) {$n" & - MainProcs & - "}$n" + "void NIM_POSIX_INIT NimMainInit(void) {$N" & + MainProcs & + "}$N" var nimMain, otherMain: TFormatStr if platform.targetOS == osWindows and @@ -1022,9 +1032,9 @@ proc genMainProc(m: BModule) = let initStackBottomCall = if emulatedThreadVars() or platform.targetOS == osStandalone: "".toRope - else: ropecg(m, "\t#initStackBottom();$n") + else: ropecg(m, "\t#initStackBottom();$N") inc(m.labels) - appcg(m, m.s[cfsProcs], "void PreMain() {$n" & PreMainBody & "}$n", [ + appcg(m, m.s[cfsProcs], "void PreMain() {$N" & PreMainBody & "}$N", [ mainDatInit, initStackBottomCall, gBreakpoints, otherModsInit]) appcg(m, m.s[cfsProcs], nimMain, [mainModInit, toRope(m.labels)]) @@ -1049,8 +1059,8 @@ proc registerModuleToMain(m: PSym) = appff(mainModProcs, "N_NOINLINE(void, $1)(void);$N", "declare void $1() noinline$N", [datInit]) if sfSystemModule notin m.flags: - appff(mainDatInit, "\t$1();$n", "call void ()* $1$n", [datInit]) - let initCall = ropeff("\t$1();$n", "call void ()* $1$n", [init]) + appff(mainDatInit, "\t$1();$N", "call void ()* $1$n", [datInit]) + let initCall = ropeff("\t$1();$N", "call void ()* $1$n", [init]) if sfMainModule in m.flags: app(mainModInit, initCall) else: @@ -1058,7 +1068,7 @@ proc registerModuleToMain(m: PSym) = proc genInitCode(m: BModule) = var initname = getInitName(m.module) - var prc = ropeff("N_NOINLINE(void, $1)(void) {$n", + var prc = ropeff("N_NOINLINE(void, $1)(void) {$N", "define void $1() noinline {$n", [initname]) if m.typeNodes > 0: appcg(m, m.s[cfsTypeInit1], "static #TNimNode $1[$2];$n", @@ -1101,7 +1111,7 @@ proc genInitCode(m: BModule) = app(prc, deinitGCFrame(m.initProc)) appf(prc, "}$N$N") - prc.appff("N_NOINLINE(void, $1)(void) {$n", + prc.appff("N_NOINLINE(void, $1)(void) {$N", "define void $1() noinline {$n", [getDatInitName(m.module)]) for i in cfsTypeInit1..cfsDynLibInit: From d63eca96e5976f9125f89909b1e2db02b69654da Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Wed, 22 Jan 2014 23:01:50 +0100 Subject: [PATCH 250/326] Adds AllChars constant to strutils. --- lib/pure/strutils.nim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index de8dc5e51d..b63224cec4 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -45,6 +45,16 @@ const NewLines* = {'\13', '\10'} ## the set of characters a newline terminator can start with + AllChars* = {'\x00'..'\xFF'} + ## A set with all the possible characters. Not very useful by its own, you + ## can use it to create *inverted* sets to make the ``find()`` proc find + ## **invalid** characters in strings. Example: + ## + ## .. code-block:: nimrod + ## let invalid = AllChars - Digits + ## doAssert "01234".find(invalid) == -1 + ## doAssert "01A34".find(invalid) == 2 + proc toLower*(c: char): char {.noSideEffect, procvar, rtl, extern: "nsuToLowerChar".} = ## Converts `c` into lower case. This works only for the letters A-Z. From 3c840102bcb3daca6f7c275c2c21183be7a145cb Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Thu, 23 Jan 2014 00:02:57 +0200 Subject: [PATCH 251/326] fix the error "only proc headers can feature pragmas" when compiling in JS mode --- lib/system.nim | 58 +++++++++++++++++----------------- lib/system/jssys.nim | 6 ++-- tests/assert/tfailedassert.nim | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 75bebf7025..de23a71fa1 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -447,38 +447,38 @@ proc chr*(u: range[0..255]): char {.magic: "Chr", noSideEffect.} # -------------------------------------------------------------------------- # built-in operators -proc ze*(x: int8): int {.magic: "Ze8ToI", noSideEffect.} - ## zero extends a smaller integer type to ``int``. This treats `x` as - ## unsigned. -proc ze*(x: int16): int {.magic: "Ze16ToI", noSideEffect.} - ## zero extends a smaller integer type to ``int``. This treats `x` as - ## unsigned. +when not defined(JS): + proc ze*(x: int8): int {.magic: "Ze8ToI", noSideEffect.} + ## zero extends a smaller integer type to ``int``. This treats `x` as + ## unsigned. + proc ze*(x: int16): int {.magic: "Ze16ToI", noSideEffect.} + ## zero extends a smaller integer type to ``int``. This treats `x` as + ## unsigned. -proc ze64*(x: int8): int64 {.magic: "Ze8ToI64", noSideEffect.} - ## zero extends a smaller integer type to ``int64``. This treats `x` as - ## unsigned. -proc ze64*(x: int16): int64 {.magic: "Ze16ToI64", noSideEffect.} - ## zero extends a smaller integer type to ``int64``. This treats `x` as - ## unsigned. + proc ze64*(x: int8): int64 {.magic: "Ze8ToI64", noSideEffect.} + ## zero extends a smaller integer type to ``int64``. This treats `x` as + ## unsigned. + proc ze64*(x: int16): int64 {.magic: "Ze16ToI64", noSideEffect.} + ## zero extends a smaller integer type to ``int64``. This treats `x` as + ## unsigned. -proc ze64*(x: int32): int64 {.magic: "Ze32ToI64", noSideEffect.} - ## zero extends a smaller integer type to ``int64``. This treats `x` as - ## unsigned. -proc ze64*(x: int): int64 {.magic: "ZeIToI64", 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 on 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 ze64*(x: int32): int64 {.magic: "Ze32ToI64", noSideEffect.} + ## zero extends a smaller integer type to ``int64``. This treats `x` as + ## unsigned. + proc ze64*(x: int): int64 {.magic: "ZeIToI64", 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 on 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`. # integer calculations: proc `+` *(x: int): int {.magic: "UnaryPlusI", noSideEffect.} diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim index 850dd1e114..4fc5f479b7 100644 --- a/lib/system/jssys.nim +++ b/lib/system/jssys.nim @@ -472,17 +472,17 @@ proc Ze(a: int): int {.compilerproc.} = proc Ze64(a: int64): int64 {.compilerproc.} = result = a -proc toU8(a: int): int8 {.noStackFrame, compilerproc.} = +proc ToU8(a: int): int8 {.noStackFrame, compilerproc.} = asm """ return `a`; """ -proc toU16(a: int): int16 {.noStackFrame, compilerproc.} = +proc ToU16(a: int): int16 {.noStackFrame, compilerproc.} = asm """ return `a`; """ -proc toU32(a: int): int32 {.noStackFrame, compilerproc.} = +proc ToU32(a: int): int32 {.noStackFrame, compilerproc.} = asm """ return `a`; """ diff --git a/tests/assert/tfailedassert.nim b/tests/assert/tfailedassert.nim index d99e6dc608..2638937671 100644 --- a/tests/assert/tfailedassert.nim +++ b/tests/assert/tfailedassert.nim @@ -3,7 +3,7 @@ discard """ WARNING: false first asseertion from bar ERROR: false second assertion from bar -1 -tests/run/tfailedassert.nim:27 false assertion from foo +tests/assert/tfailedassert.nim:27 false assertion from foo ''' """ From 3f87326247b142df4eff99a92c6529b33bb79b81 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 23 Jan 2014 01:41:26 +0100 Subject: [PATCH 252/326] closure iterators almost work --- compiler/lambdalifting.nim | 370 ++++++++++++++++++------------------- compiler/transf.nim | 12 +- 2 files changed, 190 insertions(+), 192 deletions(-) diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 2189a1d677..352b406936 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -130,25 +130,16 @@ type TOuterContext {.final.} = object fn: PSym # may also be a module! currentEnv: PEnv + isIter: bool # first class iterator? capturedVars, processed: TIntSet localsToEnv: TIdTable # PSym->PEnv mapping localsToAccess: TIdNodeTable lambdasToEnv: TIdTable # PSym->PEnv mapping up: POuterContext -proc newOuterContext(fn: PSym, up: POuterContext = nil): POuterContext = - new(result) - result.fn = fn - result.capturedVars = initIntSet() - result.processed = initIntSet() - initIdNodeTable(result.localsToAccess) - initIdTable(result.localsToEnv) - initIdTable(result.lambdasToEnv) - -proc newInnerContext(fn: PSym): PInnerContext = - new(result) - result.fn = fn - initIdNodeTable(result.localsToAccess) + closureParam, state, resultSym: PSym # only if isIter + tup: PType # only if isIter + proc getStateType(iter: PSym): PType = var n = newNodeI(nkRange, iter.info) @@ -162,6 +153,92 @@ proc createStateField(iter: PSym): PSym = result = newSym(skField, getIdent(":state"), iter, iter.info) result.typ = getStateType(iter) +proc newIterResult(iter: PSym): PSym = + if resultPos < iter.ast.len: + result = iter.ast.sons[resultPos].sym + else: + # XXX a bit hacky: + result = newSym(skResult, getIdent":result", iter, iter.info) + result.typ = iter.typ.sons[0] + incl(result.flags, sfUsed) + iter.ast.add newSymNode(result) + +proc addHiddenParam(routine: PSym, param: PSym) = + var params = routine.ast.sons[paramsPos] + # -1 is correct here as param.position is 0 based but we have at position 0 + # some nkEffect node: + param.position = params.len-1 + addSon(params, newSymNode(param)) + incl(routine.typ.flags, tfCapturesEnv) + #echo "produced environment: ", param.id, " for ", routine.name.s + +proc getHiddenParam(routine: PSym): PSym = + let params = routine.ast.sons[paramsPos] + let hidden = lastSon(params) + assert hidden.kind == nkSym + result = hidden.sym + +proc getEnvParam(routine: PSym): PSym = + let params = routine.ast.sons[paramsPos] + let hidden = lastSon(params) + if hidden.kind == nkSym and hidden.sym.name.s == paramName: + result = hidden.sym + +proc addField(tup: PType, s: PSym) = + var field = newSym(skField, s.name, s.owner, s.info) + let t = skipIntLit(s.typ) + field.typ = t + field.position = sonsLen(tup) + addSon(tup.n, newSymNode(field)) + rawAddSon(tup, t) + +proc initIterContext(c: POuterContext, iter: PSym) = + c.fn = iter + c.capturedVars = initIntSet() + + var cp = getEnvParam(iter) + if cp == nil: + c.tup = newType(tyTuple, iter) + c.tup.n = newNodeI(nkRecList, iter.info) + + cp = newSym(skParam, getIdent(paramName), iter, iter.info) + incl(cp.flags, sfFromGeneric) + cp.typ = newType(tyRef, iter) + rawAddSon(cp.typ, c.tup) + addHiddenParam(iter, cp) + + c.state = createStateField(iter) + addField(c.tup, c.state) + else: + c.tup = cp.typ.sons[0] + assert c.tup.kind == tyTuple + if c.tup.len > 0: + c.state = c.tup.n[0].sym + else: + c.state = createStateField(iter) + addField(c.tup, c.state) + + c.closureParam = cp + if iter.typ.sons[0] != nil: + c.resultSym = newIterResult(iter) + #iter.ast.add(newSymNode(c.resultSym)) + +proc newOuterContext(fn: PSym, up: POuterContext = nil): POuterContext = + new(result) + result.fn = fn + result.capturedVars = initIntSet() + result.processed = initIntSet() + initIdNodeTable(result.localsToAccess) + initIdTable(result.localsToEnv) + initIdTable(result.lambdasToEnv) + result.isIter = fn.kind == skIterator and fn.typ.callConv == ccClosure + if result.isIter: initIterContext(result, fn) + +proc newInnerContext(fn: PSym): PInnerContext = + new(result) + result.fn = fn + initIdNodeTable(result.localsToAccess) + proc newEnv(outerProc: PSym, up: PEnv, n: PNode): PEnv = new(result) result.deps = @[] @@ -171,14 +248,6 @@ proc newEnv(outerProc: PSym, up: PEnv, n: PNode): PEnv = result.up = up result.attachedNode = n -proc addField(tup: PType, s: PSym) = - var field = newSym(skField, s.name, s.owner, s.info) - let t = skipIntLit(s.typ) - field.typ = t - field.position = sonsLen(tup) - addSon(tup.n, newSymNode(field)) - rawAddSon(tup, t) - proc addCapturedVar(e: PEnv, v: PSym) = for x in e.capturedVars: if x == v: return @@ -221,27 +290,6 @@ proc newCall(a, b: PSym): PNode = result.add newSymNode(a) result.add newSymNode(b) -proc addHiddenParam(routine: PSym, param: PSym) = - var params = routine.ast.sons[paramsPos] - # -1 is correct here as param.position is 0 based but we have at position 0 - # some nkEffect node: - param.position = params.len-1 - addSon(params, newSymNode(param)) - incl(routine.typ.flags, tfCapturesEnv) - #echo "produced environment: ", param.id, " for ", routine.name.s - -proc getHiddenParam(routine: PSym): PSym = - let params = routine.ast.sons[paramsPos] - let hidden = lastSon(params) - assert hidden.kind == nkSym - result = hidden.sym - -proc getEnvParam(routine: PSym): PSym = - let params = routine.ast.sons[paramsPos] - let hidden = lastSon(params) - if hidden.kind == nkSym and hidden.sym.name.s == paramName: - result = hidden.sym - proc isInnerProc(s, outerProc: PSym): bool {.inline.} = result = (s.kind in {skProc, skMethod, skConverter} or s.kind == skIterator and s.typ.callConv == ccClosure) and @@ -334,7 +382,9 @@ proc gatherVars(o: POuterContext, i: PInnerContext, n: PNode) = var s = n.sym if interestingVar(s) and i.fn.id != s.owner.id: captureVar(o, i, s, n.info) - elif isInnerProc(s, o.fn) and tfCapturesEnv in s.typ.flags and s != i.fn: + elif s.kind in {skProc, skMethod, skConverter} and + s.skipGenericOwner == o.fn and + tfCapturesEnv in s.typ.flags and s != i.fn: # call to some other inner proc; we need to track the dependencies for # this: let env = PEnv(idTableGet(o.lambdasToEnv, i.fn)) @@ -342,7 +392,7 @@ proc gatherVars(o: POuterContext, i: PInnerContext, n: PNode) = if o.currentEnv != env: discard addDep(o.currentEnv, env, i.fn) internalError(n.info, "too complex environment handling required") - of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: discard + of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit, nkClosure: discard else: for k in countup(0, sonsLen(n) - 1): gatherVars(o, i, n.sons[k]) @@ -398,7 +448,8 @@ proc transformInnerProc(o: POuterContext, i: PInnerContext, n: PNode): PNode = of nkLambdaKinds, nkIteratorDef: if n.typ != nil: result = transformInnerProc(o, i, n.sons[namePos]) - of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef: + of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, + nkClosure: # don't recurse here: discard else: @@ -467,7 +518,8 @@ proc searchForInnerProcs(o: POuterContext, n: PNode) = searchForInnerProcs(o, it.sons[L-1]) else: internalError(it.info, "transformOuter") - of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef: + of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, + nkClosure: # don't recurse here: # XXX recurse here and setup 'up' pointers discard @@ -526,12 +578,61 @@ proc generateClosureCreation(o: POuterContext, scope: PEnv): PNode = result.add(newAsgnStmt(indirectAccess(env, field, env.info), newSymNode(getClosureVar(o, e)), env.info)) +proc interestingIterVar(s: PSym): bool {.inline.} = + result = s.kind in {skVar, skLet, skTemp, skForVar} and sfGlobal notin s.flags + +proc transformOuterProc(o: POuterContext, n: PNode): PNode + +proc transformYield(c: POuterContext, n: PNode): PNode = + inc c.state.typ.n.sons[1].intVal + let stateNo = c.state.typ.n.sons[1].intVal + + var stateAsgnStmt = newNodeI(nkAsgn, n.info) + stateAsgnStmt.add(indirectAccess(newSymNode(c.closureParam),c.state,n.info)) + stateAsgnStmt.add(newIntTypeNode(nkIntLit, stateNo, getSysType(tyInt))) + + var retStmt = newNodeI(nkReturnStmt, n.info) + if n.sons[0].kind != nkEmpty: + var a = newNodeI(nkAsgn, n.sons[0].info) + var retVal = transformOuterProc(c, n.sons[0]) + addSon(a, newSymNode(c.resultSym)) + addSon(a, if retVal.isNil: n.sons[0] else: retVal) + retStmt.add(a) + else: + retStmt.add(emptyNode) + + var stateLabelStmt = newNodeI(nkState, n.info) + stateLabelStmt.add(newIntTypeNode(nkIntLit, stateNo, getSysType(tyInt))) + + result = newNodeI(nkStmtList, n.info) + result.add(stateAsgnStmt) + result.add(retStmt) + result.add(stateLabelStmt) + +proc transformReturn(c: POuterContext, n: PNode): PNode = + result = newNodeI(nkStmtList, n.info) + var stateAsgnStmt = newNodeI(nkAsgn, n.info) + stateAsgnStmt.add(indirectAccess(newSymNode(c.closureParam),c.state,n.info)) + stateAsgnStmt.add(newIntTypeNode(nkIntLit, -1, getSysType(tyInt))) + result.add(stateAsgnStmt) + result.add(n) + +proc outerProcSons(o: POuterContext, n: PNode) = + for i in countup(0, sonsLen(n) - 1): + let x = transformOuterProc(o, n.sons[i]) + if x != nil: n.sons[i] = x + proc transformOuterProc(o: POuterContext, n: PNode): PNode = if n == nil: return nil case n.kind of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: discard of nkSym: var local = n.sym + + if o.isIter and interestingIterVar(local) and o.fn.id == local.owner.id: + if not containsOrIncl(o.capturedVars, local.id): addField(o.tup, local) + return indirectAccess(newSymNode(o.closureParam), local, n.info) + var closure = PEnv(idTableGet(o.lambdasToEnv, local)) if closure != nil: # we need to replace the lambda with '(lambda, env)': @@ -567,17 +668,44 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = of nkLambdaKinds, nkIteratorDef: if n.typ != nil: result = transformOuterProc(o, n.sons[namePos]) - of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef: + of nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef, nkTemplateDef, + nkClosure: # don't recurse here: discard of nkHiddenStdConv, nkHiddenSubConv, nkConv: let x = transformOuterProc(o, n.sons[1]) if x != nil: n.sons[1] = x result = transformOuterConv(n) + of nkYieldStmt: + if o.isIter: result = transformYield(o, n) + else: outerProcSons(o, n) + of nkReturnStmt: + if o.isIter: result = transformReturn(o, n) + else: outerProcSons(o, n) else: - for i in countup(0, sonsLen(n) - 1): - let x = transformOuterProc(o, n.sons[i]) - if x != nil: n.sons[i] = x + outerProcSons(o, n) + +proc liftIterator(c: POuterContext, body: PNode): PNode = + let iter = c.fn + result = newNodeI(nkStmtList, iter.info) + var gs = newNodeI(nkGotoState, iter.info) + gs.add(indirectAccess(newSymNode(c.closureParam), c.state, iter.info)) + result.add(gs) + var state0 = newNodeI(nkState, iter.info) + state0.add(newIntNode(nkIntLit, 0)) + result.add(state0) + + let newBody = transformOuterProc(c, body) + if newBody != nil: + result.add(newBody) + else: + result.add(body) + + var stateAsgnStmt = newNodeI(nkAsgn, iter.info) + stateAsgnStmt.add(indirectAccess(newSymNode(c.closureParam), + c.state,iter.info)) + stateAsgnStmt.add(newIntTypeNode(nkIntLit, -1, getSysType(tyInt))) + result.add(stateAsgnStmt) proc liftLambdas*(fn: PSym, body: PNode): PNode = # XXX gCmd == cmdCompileToJS does not suffice! The compiletime stuff needs @@ -601,8 +729,11 @@ proc liftLambdas*(fn: PSym, body: PNode): PNode = if resultPos < sonsLen(ast) and ast.sons[resultPos].kind == nkSym: idTablePut(o.localsToEnv, ast.sons[resultPos].sym, o.currentEnv) searchForInnerProcs(o, body) - discard transformOuterProc(o, body) - result = ex + if o.isIter: + result = liftIterator(o, ex) + else: + discard transformOuterProc(o, body) + result = ex proc liftLambdasForTopLevel*(module: PSym, body: PNode): PNode = if body.kind == nkEmpty or gCmd == cmdCompileToJS: @@ -617,144 +748,11 @@ proc liftLambdasForTopLevel*(module: PSym, body: PNode): PNode = # ------------------- iterator transformation -------------------------------- -discard """ - iterator chain[S, T](a, b: *S->T, args: *S): T = - for x in a(args): yield x - for x in b(args): yield x - - let c = chain(f, g) - for x in c: echo x - - # translated to: - let c = chain( (f, newClosure(f)), (g, newClosure(g)), newClosure(chain)) -""" - -type - TIterContext {.final, pure.} = object - iter, closureParam, state, resultSym: PSym - capturedVars: TIntSet - tup: PType - -proc newIterResult(iter: PSym): PSym = - if resultPos < iter.ast.len: - result = iter.ast.sons[resultPos].sym - else: - # XXX a bit hacky: - result = newSym(skResult, getIdent":result", iter, iter.info) - result.typ = iter.typ.sons[0] - incl(result.flags, sfUsed) - iter.ast.add newSymNode(result) - -proc interestingIterVar(s: PSym): bool {.inline.} = - result = s.kind in {skVar, skLet, skTemp, skForVar} and sfGlobal notin s.flags - -proc transfIterBody(c: var TIterContext, n: PNode): PNode = - # gather used vars for closure generation - if n == nil: return nil - case n.kind - of nkSym: - var s = n.sym - if interestingIterVar(s) and c.iter.id == s.owner.id: - if not containsOrIncl(c.capturedVars, s.id): addField(c.tup, s) - result = indirectAccess(newSymNode(c.closureParam), s, n.info) - of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit: discard - of nkYieldStmt: - inc c.state.typ.n.sons[1].intVal - let stateNo = c.state.typ.n.sons[1].intVal - - var stateAsgnStmt = newNodeI(nkAsgn, n.info) - stateAsgnStmt.add(indirectAccess(newSymNode(c.closureParam),c.state,n.info)) - stateAsgnStmt.add(newIntTypeNode(nkIntLit, stateNo, getSysType(tyInt))) - - var retStmt = newNodeI(nkReturnStmt, n.info) - if n.sons[0].kind != nkEmpty: - var a = newNodeI(nkAsgn, n.sons[0].info) - var retVal = transfIterBody(c, n.sons[0]) - addSon(a, newSymNode(c.resultSym)) - addSon(a, if retVal.isNil: n.sons[0] else: retVal) - retStmt.add(a) - else: - retStmt.add(emptyNode) - - var stateLabelStmt = newNodeI(nkState, n.info) - stateLabelStmt.add(newIntTypeNode(nkIntLit, stateNo, getSysType(tyInt))) - - result = newNodeI(nkStmtList, n.info) - result.add(stateAsgnStmt) - result.add(retStmt) - result.add(stateLabelStmt) - of nkReturnStmt: - result = newNodeI(nkStmtList, n.info) - var stateAsgnStmt = newNodeI(nkAsgn, n.info) - stateAsgnStmt.add(indirectAccess(newSymNode(c.closureParam),c.state,n.info)) - stateAsgnStmt.add(newIntTypeNode(nkIntLit, -1, getSysType(tyInt))) - result.add(stateAsgnStmt) - result.add(n) - else: - for i in countup(0, sonsLen(n)-1): - let x = transfIterBody(c, n.sons[i]) - if x != nil: n.sons[i] = x - -proc initIterContext(c: var TIterContext, iter: PSym) = - c.iter = iter - c.capturedVars = initIntSet() - - var cp = getEnvParam(iter) - if cp == nil: - c.tup = newType(tyTuple, iter) - c.tup.n = newNodeI(nkRecList, iter.info) - - cp = newSym(skParam, getIdent(paramName), iter, iter.info) - incl(cp.flags, sfFromGeneric) - cp.typ = newType(tyRef, iter) - rawAddSon(cp.typ, c.tup) - addHiddenParam(iter, cp) - - c.state = createStateField(iter) - addField(c.tup, c.state) - else: - c.tup = cp.typ.sons[0] - assert c.tup.kind == tyTuple - if c.tup.len > 0: - c.state = c.tup.n[0].sym - else: - c.state = createStateField(iter) - addField(c.tup, c.state) - - c.closureParam = cp - if iter.typ.sons[0] != nil: - c.resultSym = newIterResult(iter) - #iter.ast.add(newSymNode(c.resultSym)) - -proc liftIterator*(iter: PSym, body: PNode): PNode = - var c: TIterContext - initIterContext c, iter - - result = newNodeI(nkStmtList, iter.info) - var gs = newNodeI(nkGotoState, iter.info) - gs.add(indirectAccess(newSymNode(c.closureParam), c.state, iter.info)) - result.add(gs) - var state0 = newNodeI(nkState, iter.info) - state0.add(newIntNode(nkIntLit, 0)) - result.add(state0) - - let newBody = transfIterBody(c, body) - if newBody != nil: - result.add(newBody) - else: - result.add(body) - - var stateAsgnStmt = newNodeI(nkAsgn, iter.info) - stateAsgnStmt.add(indirectAccess(newSymNode(c.closureParam), - c.state,iter.info)) - stateAsgnStmt.add(newIntTypeNode(nkIntLit, -1, getSysType(tyInt))) - result.add(stateAsgnStmt) - proc liftIterSym*(n: PNode): PNode = # transforms (iter) to (let env = newClosure[iter](); (iter, env)) let iter = n.sym assert iter.kind == skIterator - if sfClosureCreated in iter.flags: return n + #if sfClosureCreated in iter.flags: return n result = newNodeIT(nkStmtListExpr, n.info, n.typ) diff --git a/compiler/transf.nim b/compiler/transf.nim index 973e8848a5..cda6110056 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -113,8 +113,8 @@ proc newAsgnStmt(c: PTransf, le: PNode, ri: PTransNode): PTransNode = result[1] = ri proc transformSymAux(c: PTransf, n: PNode): PNode = - if n.sym.kind == skIterator and n.sym.typ.callConv == ccClosure: - return liftIterSym(n) + #if n.sym.kind == skIterator and n.sym.typ.callConv == ccClosure: + # return liftIterSym(n) var b: PNode var tc = c.transCon if sfBorrow in n.sym.flags: @@ -636,8 +636,8 @@ proc transform(c: PTransf, n: PNode): PTransNode = s.ast.sons[bodyPos] = n.sons[bodyPos] #n.sons[bodyPos] = liftLambdas(s, n) #if n.kind == nkMethodDef: methodDef(s, false) - if n.kind == nkIteratorDef and n.typ != nil: - return liftIterSym(n.sons[namePos]).PTransNode + #if n.kind == nkIteratorDef and n.typ != nil: + # return liftIterSym(n.sons[namePos]).PTransNode result = PTransNode(n) of nkMacroDef: # XXX no proper closure support yet: @@ -741,8 +741,8 @@ proc transformBody*(module: PSym, n: PNode, prc: PSym): PNode = var c = openTransf(module, "") result = processTransf(c, n, prc) result = liftLambdas(prc, result) - if prc.kind == skIterator and prc.typ.callConv == ccClosure: - result = lambdalifting.liftIterator(prc, result) + #if prc.kind == skIterator and prc.typ.callConv == ccClosure: + # result = lambdalifting.liftIterator(prc, result) incl(result.flags, nfTransf) when useEffectSystem: trackProc(prc, result) From d01ff8994b8805a6558c87f1f58c789e42c93694 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 23 Jan 2014 08:47:22 +0100 Subject: [PATCH 253/326] closure iterators work --- compiler/lambdalifting.nim | 54 +++++++++++++++++++-------- doc/manual.txt | 16 +++++++- tests/closure/tnamedparamanonproc.nim | 4 +- todo.txt | 35 +++++++++-------- 4 files changed, 76 insertions(+), 33 deletions(-) diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 352b406936..a9c4a87578 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -116,7 +116,7 @@ type TDep = tuple[e: PEnv, field: PSym] TEnv {.final.} = object of TObject attachedNode: PNode - closure: PSym # if != nil it is a used environment + createdVar: PSym # if != nil it is a used environment capturedVars: seq[PSym] # captured variables in this environment deps: seq[TDep] # dependencies up: PEnv @@ -544,19 +544,20 @@ proc addVar*(father, v: PNode) = addSon(vpart, ast.emptyNode) addSon(father, vpart) -proc getClosureVar(o: POuterContext, e: PEnv): PSym = - if e.closure == nil: - result = newSym(skVar, getIdent(envName), o.fn, e.attachedNode.info) - incl(result.flags, sfShadowed) - result.typ = newType(tyRef, o.fn) - result.typ.rawAddSon(e.tup) - e.closure = result +proc newClosureCreationVar(o: POuterContext; e: PEnv): PSym = + result = newSym(skVar, getIdent(envName), o.fn, e.attachedNode.info) + incl(result.flags, sfShadowed) + result.typ = newType(tyRef, o.fn) + result.typ.rawAddSon(e.tup) + +proc getClosureVar(o: POuterContext; e: PEnv): PSym = + if e.createdVar == nil: + result = newClosureCreationVar(o, e) + e.createdVar = result else: - result = e.closure - -proc generateClosureCreation(o: POuterContext, scope: PEnv): PNode = - var env = getClosureVar(o, scope) + result = e.createdVar +proc rawClosureCreation(o: POuterContext, scope: PEnv; env: PSym): PNode = result = newNodeI(nkStmtList, env.info) var v = newNodeI(nkVarSection, env.info) addVar(v, newSymNode(env)) @@ -577,6 +578,21 @@ proc generateClosureCreation(o: POuterContext, scope: PEnv): PNode = # add ``env.up = env2`` result.add(newAsgnStmt(indirectAccess(env, field, env.info), newSymNode(getClosureVar(o, e)), env.info)) + +proc generateClosureCreation(o: POuterContext, scope: PEnv): PNode = + var env = getClosureVar(o, scope) + result = rawClosureCreation(o, scope, env) + +proc generateIterClosureCreation(o: POuterContext; env: PEnv; + scope: PNode): PSym = + result = newClosureCreationVar(o, env) + let cc = rawClosureCreation(o, env, result) + var insertPoint = scope.sons[0] + if insertPoint.kind == nkEmpty: scope.sons[0] = cc + else: + assert cc.kind == nkStmtList and insertPoint.kind == nkStmtList + for x in cc: insertPoint.add(x) + if env.createdVar == nil: env.createdVar = result proc interestingIterVar(s: PSym): bool {.inline.} = result = s.kind in {skVar, skLet, skTemp, skForVar} and sfGlobal notin s.flags @@ -635,8 +651,16 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = var closure = PEnv(idTableGet(o.lambdasToEnv, local)) if closure != nil: - # we need to replace the lambda with '(lambda, env)': - let a = closure.closure + # we need to replace the lambda with '(lambda, env)': + if local.kind == skIterator and local.typ.callConv == ccClosure: + # consider: [i1, i2, i1] Since we merged the iterator's closure + # with the captured owning variables, we need to generate the + # closure generation code again: + let createdVar = generateIterClosureCreation(o, closure, + closure.attachedNode) + return makeClosure(local, createdVar, n.info) + + let a = closure.createdVar if a != nil: return makeClosure(local, a, n.info) else: @@ -646,7 +670,7 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = if scope.sons[0].kind == nkEmpty: # change the empty node to contain the closure construction: scope.sons[0] = generateClosureCreation(o, closure) - let x = closure.closure + let x = closure.createdVar assert x != nil return makeClosure(local, x, n.info) diff --git a/doc/manual.txt b/doc/manual.txt index 9f84bc951f..faf62dcee5 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -2837,8 +2837,22 @@ The builtin ``system.finished`` can be used to determine if an iterator has finished its operation; no exception is raised on an attempt to invoke an iterator that has already finished its work. -One always has to +Closure iterators are *resumable functions* and so one has to provide the +arguments to every call. To get around this limitation one can capture +parameters of an outer factory proc: +.. code-block:: nimrod + proc mycount(a, b: int): iterator (): int = + return iterator (): int = + var x = a + while x <= b: + yield x + inc x + + let foo = mycount 1, 4 + + for f in foo(): + echo f Type sections diff --git a/tests/closure/tnamedparamanonproc.nim b/tests/closure/tnamedparamanonproc.nim index 272b84e914..94e32894f3 100644 --- a/tests/closure/tnamedparamanonproc.nim +++ b/tests/closure/tnamedparamanonproc.nim @@ -4,8 +4,8 @@ type TButtonClicked = proc(button: PButton) {.nimcall.} proc newButton*(onClick: TButtonClicked) = - nil - + discard + proc main() = newButton(onClick = proc(b: PButton) = var requestomat = 12 diff --git a/todo.txt b/todo.txt index 943d982c4d..d0aec9c8cc 100644 --- a/todo.txt +++ b/todo.txt @@ -1,20 +1,8 @@ version 0.9.4 ============= -- test&finish first class iterators: - * nested iterators -- implement strongSpaces:on -- ensure (ref T)(a, b) works as a type conversion and type constructor +- better debugging support for writes to locations - document new templating symbol binding rules -- make '--implicitStatic:on' the default -- change comment handling in the AST - -- special rule for ``[]=`` -- ``=`` should be overloadable; requires specialization for ``=``; general - lift mechanism in the compiler is already implemented for 'fields' -- built-in 'getImpl' -- optimize 'genericReset'; 'newException' leads to code bloat -- stack-less GC - fix eval in macros.nim @@ -37,12 +25,29 @@ Bugs version 0.9.x ============= -- macros as type pragmas +- ensure (ref T)(a, b) works as a type conversion and type constructor +- optimize 'genericReset'; 'newException' leads to code bloat +- stack-less GC +- implement strongSpaces:on +- make '--implicitStatic:on' the default - implicit deref for parameter matching + +- special rule for ``[]=`` +- ``=`` should be overloadable; requires specialization for ``=``; general + lift mechanism in the compiler is already implemented for 'fields' +- built-in 'getImpl' + +- change comment handling in the AST; that's lots of work as c2nim and pas2nim + make use of the fast every node can have a comment! + + +version 0.9.X +============= + +- macros as type pragmas - lazy overloading resolution: * special case ``tyStmt`` - FFI: - * test libffi on windows * test: times.format with the FFI - document NimMain and check whether it works for threading - 'quote' without 'do' doesn't work: parser/grammar issue; could be supported From 1465a7b08096d825f77a85e5594266d78ff022a9 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 23 Jan 2014 12:22:34 +0100 Subject: [PATCH 254/326] small code cleanups --- compiler/ast.nim | 1 - compiler/lambdalifting.nim | 4 +--- web/news.txt | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 82cc2c96ff..0e351a31ac 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -287,7 +287,6 @@ const sfNoRoot* = sfBorrow # a local variable is provably no root so it doesn't # require RC ops - sfClosureCreated* = sfDiscriminant # for transf-lambdalifting interaction const # getting ready for the future expr/stmt merge diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index a9c4a87578..01eb494636 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -422,7 +422,6 @@ proc transformOuterConv(n: PNode): PNode = proc makeClosure(prc, env: PSym, info: TLineInfo): PNode = result = newNodeIT(nkClosure, info, prc.typ) result.add(newSymNode(prc)) - if prc.kind == skIterator: incl(prc.flags, sfClosureCreated) if env == nil: result.add(newNodeIT(nkNilLit, info, getSysType(tyNil))) else: @@ -776,8 +775,7 @@ proc liftIterSym*(n: PNode): PNode = # transforms (iter) to (let env = newClosure[iter](); (iter, env)) let iter = n.sym assert iter.kind == skIterator - #if sfClosureCreated in iter.flags: return n - + result = newNodeIT(nkStmtListExpr, n.info, n.typ) var env = copySym(getHiddenParam(iter)) diff --git a/web/news.txt b/web/news.txt index 01b6d18b9a..a045eb8803 100644 --- a/web/news.txt +++ b/web/news.txt @@ -74,6 +74,8 @@ Language Additions evaluable at compile-time. - Support for user-defined type classes has been added. - The *command syntax* is supported in a lot more contexts. +- Anonymous iterators are now supported and iterators can capture variables + of an outer proc. Tools improvements From 3e5cb6644f4df51c3f3131108fc7836c431b53c2 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 23 Jan 2014 17:19:12 +0100 Subject: [PATCH 255/326] typeClasses now documented in grammar.txt --- compiler/parser.nim | 4 ++++ doc/grammar.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/compiler/parser.nim b/compiler/parser.nim index 2b845f3da1..1084c3b4a3 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -1048,6 +1048,7 @@ proc parseTypeDesc(p: var TParser): PNode = proc parseTypeDefAux(p: var TParser): PNode = #| typeDefAux = simpleExpr + #| | 'generic' typeClass result = simpleExpr(p, pmTypeDef) proc makeCall(n: PNode): PNode = @@ -1672,6 +1673,9 @@ proc parseTypeClassParam(p: var TParser): PNode = result = p.parseSymbol proc parseTypeClass(p: var TParser): PNode = + #| typeClassParam = ('var')? symbol + #| typeClass = typeClassParam ^* ',' (pragma)? ('of' typeDesc ^* ',')? + #| &IND{>} stmt result = newNodeP(nkTypeClassTy, p) getTok(p) var args = newNode(nkArgList) diff --git a/doc/grammar.txt b/doc/grammar.txt index b002747fa8..54c2217d87 100644 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -97,6 +97,7 @@ primary = typeKeyw typeDescK / 'bind' primary typeDesc = simpleExpr typeDefAux = simpleExpr + | 'generic' typeClass macroColon = ':' stmt? ( IND{=} 'of' exprList ':' stmt | IND{=} 'elif' expr ':' stmt | IND{=} 'except' exprList ':' stmt @@ -163,6 +164,9 @@ objectCase = 'case' identWithPragma ':' typeDesc ':'? COMMENT? objectPart = IND{>} objectPart^+IND{=} DED / objectWhen / objectCase / 'nil' / declColonEquals object = 'object' pragma? ('of' typeDesc)? COMMENT? objectPart +typeClassParam = ('var')? symbol +typeClass = typeClassParam ^* ',' (pragma)? ('of' typeDesc ^* ',')? + &IND{>} stmt distinct = 'distinct' optInd typeDesc typeDef = identWithPragma genericParamList? '=' optInd typeDefAux indAndComment? From f332ac1d375cc4e17003ae630a0c6ca28c3f06b7 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 23 Jan 2014 19:23:41 +0100 Subject: [PATCH 256/326] renderer knows about nkStaticTy and nkTypeClassTy --- compiler/renderer.nim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 6588caa049..1afb5961ec 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -426,6 +426,8 @@ proc lsub(n: PNode): int = of nkVarTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + len("var") of nkDistinctTy: result = (if n.len > 0: lsub(n.sons[0])+1 else: 0) + len("Distinct") + of nkStaticTy: result = (if n.len > 0: lsub(n.sons[0]) else: 0) + + len("static[]") of nkTypeDef: result = lsons(n) + 3 of nkOfInherit: result = lsub(n.sons[0]) + len("of_") of nkProcTy: result = lsons(n) + len("proc_") @@ -701,6 +703,19 @@ proc gproc(g: var TSrcGen, n: PNode) = gcoms(g) dedent(g) +proc gTypeClassTy(g: var TSrcGen, n: PNode) = + var c: TContext + initContext(c) + putWithSpace(g, tkGeneric, "generic") + gsons(g, n[0], c) # arglist + gsub(g, n[1]) # pragmas + gsub(g, n[2]) # of + gcoms(g) + indentNL(g) + gcoms(g) + gstmts(g, n[3], c) + dedent(g) + proc gblock(g: var TSrcGen, n: PNode) = var c: TContext initContext(c) @@ -1054,6 +1069,12 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = gsub(g, n.sons[0]) else: put(g, tkShared, "shared") + of nkStaticTy: + put(g, tkStatic, "static") + put(g, tkBracketLe, "[") + if n.len > 0: + gsub(g, n.sons[0]) + put(g, tkBracketRi, "]") of nkEnumTy: if sonsLen(n) > 0: putWithSpace(g, tkEnum, "enum") @@ -1256,6 +1277,8 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = initContext c putWithSpace g, tkSymbol, if n.kind == nkState: "state" else: "goto" gsons(g, n, c) + of nkTypeClassTy: + gTypeClassTy(g, n) else: #nkNone, nkExplicitTypeListCall: internalError(n.info, "rnimsyn.gsub(" & $n.kind & ')') From de538deb7af602130c805661b49d976ab9493613 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 23 Jan 2014 20:43:56 +0100 Subject: [PATCH 257/326] should compile on netbsd --- lib/pure/os.nim | 2 +- lib/pure/osproc.nim | 8 ++++---- lib/pure/sockets.nim | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 448ecc1e38..1f42d0d58e 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1586,7 +1586,7 @@ proc getAppFilename*(): string {.rtl, extern: "nos$1", tags: [FReadIO].} = # little heuristic that may work on other POSIX-like systems: result = string(getEnv("_")) if len(result) == 0: - result = string(ParamStr(0)) + result = string(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? diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 6c43dc2d9e..676707abbc 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -660,8 +660,8 @@ elif not defined(useNimRtl): else: - Pid = fork() - if Pid < 0: osError(osLastError()) + pid = fork() + if pid < 0: osError(osLastError()) if pid == 0: ## child process: @@ -685,14 +685,14 @@ elif not defined(useNimRtl): if env == nil: discard execv(command, a) else: - discard execve(command, a, ToCStringArray(env)) + discard execve(command, a, toCStringArray(env)) else: var x = addCmdArgs(command, args) var a = toCStringArray(["sh", "-c"], [x]) if env == nil: discard execv("/bin/sh", a) else: - discard execve("/bin/sh", a, ToCStringArray(env)) + discard execve("/bin/sh", a, toCStringArray(env)) # too risky to raise an exception here: quit("execve call failed: " & $strerror(errno)) # Parent process. Copy process information. diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index b3cc38ee70..fd64031181 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -192,7 +192,7 @@ when defined(Posix): of AF_UNIX: result = posix.AF_UNIX of AF_INET: result = posix.AF_INET of AF_INET6: result = posix.AF_INET6 - else: nil + else: discard proc toInt(typ: TType): cint = case typ @@ -200,7 +200,7 @@ when defined(Posix): of SOCK_DGRAM: result = posix.SOCK_DGRAM of SOCK_SEQPACKET: result = posix.SOCK_SEQPACKET of SOCK_RAW: result = posix.SOCK_RAW - else: nil + else: discard proc toInt(p: TProtocol): cint = case p @@ -210,7 +210,7 @@ when defined(Posix): of IPPROTO_IPV6: result = posix.IPPROTO_IPV6 of IPPROTO_RAW: result = posix.IPPROTO_RAW of IPPROTO_ICMP: result = posix.IPPROTO_ICMP - else: nil + else: discard else: proc toInt(domain: TDomain): cint = From a6a18be0899ff0445128c614f285be1924ec5281 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Fri, 24 Jan 2014 14:13:32 +0200 Subject: [PATCH 258/326] support for parametric user-defined type classes --- compiler/ast.nim | 21 +++++-- compiler/semexprs.nim | 4 +- compiler/semtypes.nim | 9 ++- compiler/semtypinst.nim | 5 +- compiler/sigmatch.nim | 129 ++++++++++++++++++++++------------------ compiler/types.nim | 5 +- 6 files changed, 102 insertions(+), 71 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 0e351a31ac..4a3f1e8949 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -337,12 +337,20 @@ type tyIter, # unused tyProxy # used as errornous type (for idetools) tyTypeClass - tyParametricTypeClass # structured similarly to tyGenericInst - # lastSon is the body of the type class + tyBuiltInTypeClass # Type such as the catch-all object, tuple, seq, etc + tyUserTypeClass + tyUserTypeClassInst # \ + # Instance of a parametric user-defined type class. + # Structured similarly to tyGenericInst. + # tyGenericInst represents concrete types, while + # this is still a "generic param" that will bind types + # and resolves them during sigmatch and instantiation. - tyBuiltInTypeClass # Type such as the catch-all object, tuple, seq, etc - - tyCompositeTypeClass # + tyCompositeTypeClass # Type such as seq[Number] + # The notes for tyUserTypeClassInst apply here as well + # sons[0]: the original expression used by the user. + # sons[1]: fully expanded and instantiated meta type + # (potentially following aliases) tyAnd, tyOr, tyNot # boolean type classes such as `string|int`,`not seq`, # `Sortable and Enumable`, etc @@ -365,7 +373,8 @@ const tyUnknownTypes* = {tyError, tyFromExpr} tyTypeClasses* = {tyTypeClass, tyBuiltInTypeClass, tyCompositeTypeClass, - tyParametricTypeClass, tyAnd, tyOr, tyNot, tyAnything} + tyUserTypeClass, tyUserTypeClassInst, + tyAnd, tyOr, tyNot, tyAnything} tyMetaTypes* = {tyGenericParam, tyTypeDesc, tyStatic, tyExpr} + tyTypeClasses diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 6e2d777fb0..37fdf8b34b 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -322,12 +322,12 @@ proc isOpImpl(c: PContext, n: PNode): PNode = tfIterator in t.flags)) else: var match: bool - let t2 = n[2].typ + let t2 = n[2].typ.skipTypes({tyTypeDesc}) case t2.kind of tyTypeClasses: var m: TCandidate initCandidate(c, m, t2) - match = matchUserTypeClass(c, m, emptyNode, t2, t1) != nil + match = typeRel(m, t2, t1) != isNone of tyOrdinal: var m: TCandidate initCandidate(c, m, t2) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index d5a938a12d..4bcaf55d6f 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -710,6 +710,11 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, result = addImplicitGeneric(result) of tyGenericInst: + if paramType.lastSon.kind == tyUserTypeClass: + var cp = copyType(paramType, getCurrOwner(), false) + cp.kind = tyUserTypeClassInst + return addImplicitGeneric(cp) + for i in 1 .. (paramType.sons.len - 2): var lifted = liftingWalk(paramType.sons[i]) if lifted != nil: @@ -731,7 +736,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, allowMetaTypes = true) result = liftingWalk(expanded) - of tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: + of tyUserTypeClass, tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: result = addImplicitGeneric(copyType(paramType, getCurrOwner(), true)) of tyExpr: @@ -923,7 +928,7 @@ proc freshType(res, prev: PType): PType {.inline.} = proc semTypeClass(c: PContext, n: PNode, prev: PType): PType = # if n.sonsLen == 0: return newConstraint(c, tyTypeClass) - result = newOrPrevType(tyTypeClass, prev, c) + result = newOrPrevType(tyUserTypeClass, prev, c) result.n = n let diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index ac14179cd5..a9322c1f40 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -360,7 +360,10 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = if tfUnresolved in t.flags: result = result.base elif t.sonsLen > 0: result = makeTypeDesc(cl.c, replaceTypeVarsT(cl, t.sons[0])) - + + of tyUserTypeClass: + result = t + of tyGenericInst: result = instCopyType(cl, t) for i in 1 .. <result.sonsLen: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index bb70e0d6b5..d0a832147a 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -399,6 +399,69 @@ proc typeRangeRel(f, a: PType): TTypeRelation {.noinline.} = else: result = isNone +proc matchUserTypeClass*(c: PContext, m: var TCandidate, + ff, a: PType): TTypeRelation = + #if f.n == nil: + # let r = typeRel(m, f, a) + # return if r == isGeneric: arg else: nil + + var body = ff.skipTypes({tyUserTypeClassInst}) + + # var prev = PType(idTableGet(m.bindings, f)) + # if prev != nil: + # if sameType(prev, a): return arg + # else: return nil + + # pushInfoContext(arg.info) + openScope(c) + inc c.inTypeClass + + finally: + dec c.inTypeClass + closeScope(c) + + if ff.kind == tyUserTypeClassInst: + for i in 1 .. <(ff.len - 1): + var + typeParamName = ff.base.sons[i-1].sym.name + typ = ff.sons[i] + param = newSym(skType, typeParamName, body.sym, body.sym.info) + + param.typ = makeTypeDesc(c, typ) + addDecl(c, param) + + for param in body.n[0]: + var + dummyName: PNode + dummyType: PType + + if param.kind == nkVarTy: + dummyName = param[0] + dummyType = makeVarType(c, a) + else: + dummyName = param + dummyType = a + + internalAssert dummyName.kind == nkIdent + var dummyParam = newSym(skType, dummyName.ident, body.sym, body.sym.info) + dummyParam.typ = dummyType + addDecl(c, dummyParam) + + for stmt in body.n[3]: + var e = c.semTryExpr(c, copyTree(stmt), bufferErrors = false) + m.errors = bufferedMsgs + clearBufferedMsgs() + if e == nil: return isNone + + case e.kind + of nkReturnStmt: discard + of nkTypeSection: discard + of nkConstDef: discard + else: discard + + return isGeneric + # put(m.bindings, f, a) + proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = # typeRel can be used to establish various relationships between types: # @@ -751,6 +814,12 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = else: return isNone + of tyUserTypeClassInst: + considerPreviousT: + result = matchUserTypeClass(c.c, c, f, a) + if result == isGeneric: + put(c.bindings, f, a) + of tyCompositeTypeClass: considerPreviousT: if typeRel(c, f.sons[1], a) != isNone: @@ -904,57 +973,6 @@ proc localConvMatch(c: PContext, m: var TCandidate, f, a: PType, result.typ = getInstantiatedType(c, arg, m, base(f)) m.baseTypeMatch = true -proc matchUserTypeClass*(c: PContext, m: var TCandidate, - arg: PNode, f, a: PType): PNode = - if f.n == nil: - let r = typeRel(m, f, a) - return if r == isGeneric: arg else: nil - - var prev = PType(idTableGet(m.bindings, f)) - if prev != nil: - if sameType(prev, a): return arg - else: return nil - - # pushInfoContext(arg.info) - openScope(c) - inc c.inTypeClass - - finally: - dec c.inTypeClass - closeScope(c) - - for param in f.n[0]: - var - dummyName: PNode - dummyType: PType - - if param.kind == nkVarTy: - dummyName = param[0] - dummyType = makeVarType(c, a) - else: - dummyName = param - dummyType = a - - internalAssert dummyName.kind == nkIdent - var dummyParam = newSym(skType, dummyName.ident, f.sym, f.sym.info) - dummyParam.typ = dummyType - addDecl(c, dummyParam) - - for stmt in f.n[3]: - var e = c.semTryExpr(c, copyTree(stmt), bufferErrors = false) - m.errors = bufferedMsgs - clearBufferedMsgs() - if e == nil: return nil - - case e.kind - of nkReturnStmt: discard - of nkTypeSection: discard - of nkConstDef: discard - else: discard - - result = arg - put(m.bindings, f, a) - proc paramTypesMatchAux(m: var TCandidate, f, argType: PType, argSemantized, argOrig: PNode): PNode = var @@ -980,14 +998,9 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType, else: argType case fMaybeStatic.kind - of tyTypeClass, tyParametricTypeClass: + of tyTypeClass: if fMaybeStatic.n != nil: - let match = matchUserTypeClass(c, m, arg, fMaybeStatic, a) - if match != nil: - r = isGeneric - arg = match - else: - r = isNone + r = matchUserTypeClass(c, m, fMaybeStatic, a) else: r = typeRel(m, f, a) of tyExpr: diff --git a/compiler/types.nim b/compiler/types.nim index d7310596f8..cc066a36d4 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -404,8 +404,9 @@ const "float", "float32", "float64", "float128", "uint", "uint8", "uint16", "uint32", "uint64", "bignum", "const ", - "!", "varargs[$1]", "iter[$1]", "Error Type", "TypeClass", - "ParametricTypeClass", "BuiltInTypeClass", "CompositeTypeClass", + "!", "varargs[$1]", "iter[$1]", "Error Type", + "TypeClass", "BuiltInTypeClass", "UserTypeClass", + "UserTypeClassInst", "CompositeTypeClass", "and", "or", "not", "any", "static", "TypeFromExpr"] proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = From 3f71b7f1f6db5fbe3c61dde0cfd43d1eb0088cb6 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Fri, 24 Jan 2014 17:02:27 +0200 Subject: [PATCH 259/326] implements #766; expressions such as Type.field are now recognised by the compiler. This also fixes a bug, preventing the user-defined to check for the presence of regular fields in addition to procs --- compiler/ast.nim | 56 ++++++++++++++++++++++++++++--------------- compiler/ccgutils.nim | 2 +- compiler/jsgen.nim | 2 +- compiler/semexprs.nim | 14 ++++++++--- compiler/semfold.nim | 3 +-- compiler/semstmts.nim | 2 +- compiler/semtypes.nim | 4 ++-- compiler/sigmatch.nim | 45 ++++++++++++++++------------------ compiler/transf.nim | 2 +- compiler/types.nim | 52 ++++++++++++++++++++++++++++++---------- compiler/vm.nim | 2 +- 11 files changed, 116 insertions(+), 68 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 4a3f1e8949..7138b5f52a 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -336,34 +336,52 @@ type tyConst, tyMutable, tyVarargs, tyIter, # unused tyProxy # used as errornous type (for idetools) - tyTypeClass - tyBuiltInTypeClass # Type such as the catch-all object, tuple, seq, etc - tyUserTypeClass - tyUserTypeClassInst # \ + + tyBuiltInTypeClass #\ + # Type such as the catch-all object, tuple, seq, etc + + tyUserTypeClass #\ + # the body of a user-defined type class + + tyUserTypeClassInst #\ # Instance of a parametric user-defined type class. # Structured similarly to tyGenericInst. # tyGenericInst represents concrete types, while # this is still a "generic param" that will bind types # and resolves them during sigmatch and instantiation. - tyCompositeTypeClass # Type such as seq[Number] - # The notes for tyUserTypeClassInst apply here as well - # sons[0]: the original expression used by the user. - # sons[1]: fully expanded and instantiated meta type - # (potentially following aliases) + tyCompositeTypeClass #\ + # Type such as seq[Number] + # The notes for tyUserTypeClassInst apply here as well + # sons[0]: the original expression used by the user. + # sons[1]: fully expanded and instantiated meta type + # (potentially following aliases) - tyAnd, tyOr, tyNot # boolean type classes such as `string|int`,`not seq`, - # `Sortable and Enumable`, etc + tyAnd, tyOr, tyNot #\ + # boolean type classes such as `string|int`,`not seq`, + # `Sortable and Enumable`, etc - tyAnything # a type class matching any type + tyAnything #\ + # a type class matching any type - tyStatic # a value known at compile type (the underlying type is .base) + tyStatic #\ + # a value known at compile type (the underlying type is .base) - tyFromExpr # This is a type representing an expression that depends - # on generic parameters (the exprsesion is stored in t.n) - # It will be converted to a real type only during generic - # instantiation and prior to this it has the potential to - # be any type. + tyFromExpr #\ + # This is a type representing an expression that depends + # on generic parameters (the exprsesion is stored in t.n) + # It will be converted to a real type only during generic + # instantiation and prior to this it has the potential to + # be any type. + + tyFieldAccessor #\ + # Expressions such as Type.field (valid in contexts such + # as the `is` operator and magics like `high` and `low`). + # Could be lifted to a single argument proc returning the + # field value. + # sons[0]: type of containing object or tuple + # sons[1]: field type + # .n: nkDotExpr storing the field name const tyPureObject* = tyTuple @@ -372,7 +390,7 @@ const tyUnknownTypes* = {tyError, tyFromExpr} - tyTypeClasses* = {tyTypeClass, tyBuiltInTypeClass, tyCompositeTypeClass, + tyTypeClasses* = {tyBuiltInTypeClass, tyCompositeTypeClass, tyUserTypeClass, tyUserTypeClassInst, tyAnd, tyOr, tyNot, tyAnything} diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index fe349174fd..1129ecbefe 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -87,7 +87,7 @@ proc getUniqueType*(key: PType): PType = gCanonicalTypes[k] = key result = key of tyTypeDesc, tyTypeClasses, tyGenericParam, - tyFromExpr, tyStatic: + tyFromExpr, tyStatic, tyFieldAccessor: internalError("GetUniqueType") of tyGenericInst, tyDistinct, tyOrdinal, tyMutable, tyConst, tyIter: result = getUniqueType(lastSon(key)) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 82c45059cb..c0fc4131a7 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -130,7 +130,7 @@ proc mapType(typ: PType): TJSTypeKind = result = etyObject of tyNil: result = etyNull of tyGenericInst, tyGenericParam, tyGenericBody, tyGenericInvokation, - tyNone, tyFromExpr, tyForward, tyEmpty, + tyNone, tyFromExpr, tyForward, tyEmpty, tyFieldAccessor, tyExpr, tyStmt, tyStatic, tyTypeDesc, tyTypeClasses: result = etyNone of tyProc: result = etyProc diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 37fdf8b34b..1096d30292 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -239,7 +239,8 @@ proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = localError(n.info, errXExpectsTypeOrValue, opToStr[m]) else: n.sons[1] = semExprWithType(c, n.sons[1], {efDetermineType}) - var typ = skipTypes(n.sons[1].typ, abstractVarRange+{tyTypeDesc}) + var typ = skipTypes(n.sons[1].typ, abstractVarRange + + {tyTypeDesc, tyFieldAccessor}) case typ.kind of tySequence, tyString, tyOpenArray, tyVarargs: n.typ = getSysType(tyInt) @@ -247,7 +248,7 @@ proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = n.typ = typ.sons[0] # indextype of tyInt..tyInt64, tyChar, tyBool, tyEnum, tyUInt8, tyUInt16, tyUInt32: # do not skip the range! - n.typ = n.sons[1].typ.skipTypes(abstractVar) + n.typ = n.sons[1].typ.skipTypes(abstractVar + {tyFieldAccessor}) of tyGenericParam: # prepare this for resolving in semtypinst: # we must use copyTree here in order to avoid creating a cycle @@ -306,7 +307,7 @@ proc isOpImpl(c: PContext, n: PNode): PNode = n[1].typ != nil and n[1].typ.kind == tyTypeDesc and n[2].kind in {nkStrLit..nkTripleStrLit, nkType} - let t1 = n[1].typ.skipTypes({tyTypeDesc}) + let t1 = n[1].typ.skipTypes({tyTypeDesc, tyFieldAccessor}) if n[2].kind in {nkStrLit..nkTripleStrLit}: case n[2].strVal.normalize @@ -948,6 +949,13 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = let foundTyp = makeTypeDesc(c, rawTyp) return newSymNode(copySym(tParam.sym).linkTo(foundTyp), n.info) return + of tyObject, tyTuple: + if ty.n.kind == nkRecList: + for field in ty.n.sons: + if field.sym.name == i: + n.typ = newTypeWithSons(c, tyFieldAccessor, @[ty, field.sym.typ]) + n.typ.n = copyTree(n) + return n else: # echo "TYPE FIELD ACCESS" # debug ty diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 78e5cdd5ec..4740ddcb3d 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -252,8 +252,7 @@ proc evalIs(n, a: PNode): PNode = else: # XXX semexprs.isOpImpl is slightly different and requires a context. yay. let t2 = n[2].typ - var match = if t2.kind == tyTypeClass: true - else: sameType(t1, t2) + var match = sameType(t1, t2) result = newIntNode(nkIntLit, ord(match)) result.typ = n.typ diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index fc1706200e..d28eaa7798 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1240,7 +1240,7 @@ proc semStmtList(c: PContext, n: PNode): PNode = if n.sons[i].typ == enforceVoidContext or usesResult(n.sons[i]): voidContext = true n.typ = enforceVoidContext - if i != last or voidContext: + if i != last or voidContext or c.inTypeClass > 0: discardCheck(c, n.sons[i]) else: n.typ = n.sons[i].typ diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 4bcaf55d6f..408b1b62e0 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -736,7 +736,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, allowMetaTypes = true) result = liftingWalk(expanded) - of tyUserTypeClass, tyTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: + of tyUserTypeClass, tyBuiltInTypeClass, tyAnd, tyOr, tyNot: result = addImplicitGeneric(copyType(paramType, getCurrOwner(), true)) of tyExpr: @@ -871,7 +871,7 @@ proc semGenericParamInInvokation(c: PContext, n: PNode): PType = proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = result = newOrPrevType(tyGenericInvokation, prev, c) addSonSkipIntLit(result, s.typ) - + template addToResult(typ) = if typ.isNil: internalAssert false diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index d0a832147a..971d526ee8 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -140,7 +140,7 @@ proc sumGeneric(t: PType): int = result = ord(t.kind == tyGenericInvokation) for i in 0 .. <t.len: result += t.sons[i].sumGeneric break - of tyGenericParam, tyExpr, tyStatic, tyStmt, tyTypeDesc, tyTypeClass: break + of tyGenericParam, tyExpr, tyStatic, tyStmt, tyTypeDesc: break else: return 0 proc complexDisambiguation(a, b: PType): int = @@ -447,18 +447,19 @@ proc matchUserTypeClass*(c: PContext, m: var TCandidate, dummyParam.typ = dummyType addDecl(c, dummyParam) - for stmt in body.n[3]: - var e = c.semTryExpr(c, copyTree(stmt), bufferErrors = false) - m.errors = bufferedMsgs - clearBufferedMsgs() - if e == nil: return isNone + var checkedBody = c.semTryExpr(c, copyTree(body.n[3]), bufferErrors = false) + m.errors = bufferedMsgs + clearBufferedMsgs() + if checkedBody == nil: return isNone - case e.kind - of nkReturnStmt: discard - of nkTypeSection: discard - of nkConstDef: discard - else: discard - + if checkedBody.kind == nkStmtList: + for stmt in checkedBody: + case stmt.kind + of nkReturnStmt: discard + of nkTypeSection: discard + of nkConstDef: discard + else: discard + return isGeneric # put(m.bindings, f, a) @@ -481,6 +482,11 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = result = isNone assert(f != nil) + + if f.kind == tyExpr: + put(c.bindings, f, aOrig) + return isGeneric + assert(aOrig != nil) # var and static arguments match regular modifier-free types @@ -828,7 +834,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = else: return isNone - of tyGenericParam, tyTypeClass: + of tyGenericParam: var x = PType(idTableGet(c.bindings, f)) if x == nil: if c.calleeSym != nil and c.calleeSym.kind == skType and @@ -891,7 +897,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = else: a.sons[0] result = typeRel(c, prev.sons[0], toMatch) - of tyExpr, tyStmt: + of tyStmt: result = isGeneric of tyProxy: @@ -993,20 +999,9 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType, argType = arg.typ var - r: TTypeRelation a = if c.inTypeClass > 0: argType.skipTypes({tyTypeDesc}) else: argType - case fMaybeStatic.kind - of tyTypeClass: - if fMaybeStatic.n != nil: - r = matchUserTypeClass(c, m, fMaybeStatic, a) - else: - r = typeRel(m, f, a) - of tyExpr: - r = isGeneric - put(m.bindings, f, arg.typ) - else: r = typeRel(m, f, a) case r diff --git a/compiler/transf.nim b/compiler/transf.nim index f22433972c..b00e0a1439 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -389,7 +389,7 @@ proc transformConv(c: PTransf, n: PNode): PTransNode = result[0] = transform(c, n.sons[1]) else: result = transform(c, n.sons[1]) - of tyGenericParam, tyOrdinal, tyTypeClass: + of tyGenericParam, tyOrdinal: result = transform(c, n.sons[1]) # happens sometimes for generated assignments, etc. else: diff --git a/compiler/types.nim b/compiler/types.nim index cc066a36d4..4a53a84c97 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -405,9 +405,9 @@ const "uint", "uint8", "uint16", "uint32", "uint64", "bignum", "const ", "!", "varargs[$1]", "iter[$1]", "Error Type", - "TypeClass", "BuiltInTypeClass", "UserTypeClass", + "BuiltInTypeClass", "UserTypeClass", "UserTypeClassInst", "CompositeTypeClass", - "and", "or", "not", "any", "static", "TypeFromExpr"] + "and", "or", "not", "any", "static", "TypeFromExpr", "FieldAccessor"] proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = var t = typ @@ -435,11 +435,30 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = of tyStatic: internalAssert t.len > 0 result = "static[" & typeToString(t.sons[0]) & "]" - of tyTypeClass: + of tyUserTypeClass: internalAssert t.sym != nil and t.sym.owner != nil return t.sym.owner.name.s of tyBuiltInTypeClass: - return "TypeClass" + result = case t.base.kind: + of tyVar: "var" + of tyRef: "ref" + of tyPtr: "ptr" + of tySequence: "seq" + of tyArray: "array" + of tySet: "set" + of tyRange: "range" + of tyDistinct: "distinct" + of tyProc: "proc" + of tyObject: "object" + of tyTuple: "tuple" + else: (internalAssert false; "") + of tyUserTypeClassInst: + let body = t.base + result = body.sym.name.s & "[" + for i in countup(1, sonsLen(t) - 2): + if i > 1: add(result, ", ") + add(result, typeToString(t.sons[i])) + result.add "]" of tyAnd: result = typeToString(t.sons[0]) & " and " & typeToString(t.sons[1]) of tyOr: @@ -449,7 +468,7 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = of tyExpr: internalAssert t.len == 0 result = "expr" - of tyFromExpr: + of tyFromExpr, tyFieldAccessor: result = renderTree(t.n) of tyArray: if t.sons[0].kind == tyRange: @@ -547,7 +566,8 @@ proc firstOrd(t: PType): BiggestInt = else: assert(t.n.sons[0].kind == nkSym) result = t.n.sons[0].sym.position - of tyGenericInst, tyDistinct, tyConst, tyMutable, tyTypeDesc: + of tyGenericInst, tyDistinct, tyConst, tyMutable, + tyTypeDesc, tyFieldAccessor: result = firstOrd(lastSon(t)) else: internalError("invalid kind for first(" & $t.kind & ')') @@ -580,7 +600,8 @@ proc lastOrd(t: PType): BiggestInt = of tyEnum: assert(t.n.sons[sonsLen(t.n) - 1].kind == nkSym) result = t.n.sons[sonsLen(t.n) - 1].sym.position - of tyGenericInst, tyDistinct, tyConst, tyMutable, tyTypeDesc: + of tyGenericInst, tyDistinct, tyConst, tyMutable, + tyTypeDesc, tyFieldAccessor: result = lastOrd(lastSon(t)) of tyProxy: result = 0 else: @@ -876,9 +897,9 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = of tyGenericInvokation, tyGenericBody, tySequence, tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyArrayConstr, tyArray, tyProc, tyConst, tyMutable, tyVarargs, tyIter, - tyOrdinal, tyTypeClasses: + tyOrdinal, tyTypeClasses, tyFieldAccessor: cycleCheck() - if a.kind == tyTypeClass and a.n != nil: return a.n == b.n + if a.kind == tyUserTypeClass and a.n != nil: return a.n == b.n result = sameChildrenAux(a, b, c) and sameFlags(a, b) if result and a.kind == tyProc: result = ((IgnoreCC in c.flags) or a.callConv == b.callConv) and @@ -1022,7 +1043,7 @@ proc typeAllowedAux(marker: var TIntSet, typ: PType, kind: TSymKind, of tyTypeClasses: result = true of tyGenericBody, tyGenericParam, tyGenericInvokation, - tyNone, tyForward, tyFromExpr: + tyNone, tyForward, tyFromExpr, tyFieldAccessor: result = false of tyNil: result = kind == skConst @@ -1232,8 +1253,15 @@ proc getSize(typ: PType): BiggestInt = if result < 0: internalError("getSize: " & $typ.kind) proc containsGenericTypeIter(t: PType, closure: PObject): bool = - result = t.kind in GenericTypes + tyTypeClasses + {tyTypeDesc,tyFromExpr} or - t.kind == tyStatic and t.n == nil + if t.kind in GenericTypes + tyTypeClasses + {tyFromExpr}: + return true + + if t.kind == tyTypeDesc: + if t.sonsLen == 0: return true + if containsGenericTypeIter(t.base, closure): return true + return false + + return t.kind == tyStatic and t.n == nil proc containsGenericType*(t: PType): bool = result = iterOverType(t, containsGenericTypeIter, nil) diff --git a/compiler/vm.nim b/compiler/vm.nim index 9ed18d29eb..cd36595ac2 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -802,7 +802,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = let t1 = regs[rb].typ.skipTypes({tyTypeDesc}) let t2 = c.types[regs[rc].intVal.int] # XXX: This should use the standard isOpImpl - let match = if t2.kind == tyTypeClass: true + let match = if t2.kind == tyUserTypeClass: true else: sameType(t1, t2) regs[ra].intVal = ord(match) of opcSetLenSeq: From 869e7d93e07b77f245abb58874234f4cb17445de Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 25 Jan 2014 14:20:40 +0100 Subject: [PATCH 260/326] nativeStackTrace might work again --- lib/system/excpt.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 1964e4d3dc..a3f6669d42 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -11,7 +11,7 @@ # use the heap (and nor exceptions) do not include the GC or memory allocator. var - errorMessageWriter*: (proc(msg: string): void {.tags: [FWriteIO].}) + errorMessageWriter*: (proc(msg: string) {.tags: [FWriteIO].}) ## Function that will be called ## instead of stdmsg.write when printing stacktrace. ## Unstable API. @@ -80,9 +80,9 @@ when defined(nativeStacktrace) and nativeStackTraceSupported: type TDl_info {.importc: "Dl_info", header: "<dlfcn.h>", final, pure.} = object - dli_fname: CString + dli_fname: cstring dli_fbase: pointer - dli_sname: CString + dli_sname: cstring dli_saddr: pointer proc backtrace(symbols: ptr pointer, size: int): int {. From c4cb795081db776fe7ea2b96840c22dafebc2214 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 25 Jan 2014 14:21:27 +0100 Subject: [PATCH 261/326] updated asyncio and ftpclient modules --- lib/pure/asyncio.nim | 18 +++++++++--------- lib/pure/ftpclient.nim | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/pure/asyncio.nim b/lib/pure/asyncio.nim index 3c2a5c17a4..f13cadaa2d 100644 --- a/lib/pure/asyncio.nim +++ b/lib/pure/asyncio.nim @@ -139,27 +139,27 @@ type proc newDelegate*(): PDelegate = ## Creates a new delegate. new(result) - result.handleRead = (proc (h: PObject) = nil) - result.handleWrite = (proc (h: PObject) = nil) - result.handleError = (proc (h: PObject) = nil) + result.handleRead = (proc (h: PObject) = discard) + result.handleWrite = (proc (h: PObject) = discard) + result.handleError = (proc (h: PObject) = discard) result.hasDataBuffered = (proc (h: PObject): bool = return false) - result.task = (proc (h: PObject) = nil) + result.task = (proc (h: PObject) = discard) result.mode = fmRead proc newAsyncSocket(): PAsyncSocket = new(result) result.info = SockIdle - result.handleRead = (proc (s: PAsyncSocket) = nil) + result.handleRead = (proc (s: PAsyncSocket) = discard) result.handleWrite = nil - result.handleConnect = (proc (s: PAsyncSocket) = nil) - result.handleAccept = (proc (s: PAsyncSocket) = nil) - result.handleTask = (proc (s: PAsyncSocket) = nil) + result.handleConnect = (proc (s: PAsyncSocket) = discard) + result.handleAccept = (proc (s: PAsyncSocket) = discard) + result.handleTask = (proc (s: PAsyncSocket) = discard) result.lineBuffer = "".TaintedString result.sendBuffer = "" -proc AsyncSocket*(domain: TDomain = AF_INET, typ: TType = SOCK_STREAM, +proc asyncSocket*(domain: TDomain = AF_INET, typ: TType = SOCK_STREAM, protocol: TProtocol = IPPROTO_TCP, buffered = true): PAsyncSocket = ## Initialises an AsyncSocket object. If a socket cannot be initialised diff --git a/lib/pure/ftpclient.nim b/lib/pure/ftpclient.nim index d9f9dfd3d1..f136e0016b 100644 --- a/lib/pure/ftpclient.nim +++ b/lib/pure/ftpclient.nim @@ -95,7 +95,7 @@ type EInvalidReply* = object of ESynch EFTP* = object of ESynch -proc FTPClient*(address: string, port = TPort(21), +proc ftpClient*(address: string, port = TPort(21), user, pass = ""): PFTPClient = ## Create a ``PFTPClient`` object. new(result) @@ -315,7 +315,7 @@ proc listDirs*(ftp: PFTPClient, dir: string = "", assertReply ftp.send("NLST " & dir.normalizePathSep), ["125", "150"] if not async: - while not ftp.job.prc(ftp, false): nil + while not ftp.job.prc(ftp, false): discard result = splitLines(ftp.job.lines) ftp.deleteJob() else: return @[] @@ -390,7 +390,7 @@ proc list*(ftp: PFTPClient, dir: string = "", async = false): string = assertReply(ftp.send("LIST" & " " & dir.normalizePathSep), ["125", "150"]) if not async: - while not ftp.job.prc(ftp, false): nil + while not ftp.job.prc(ftp, false): discard result = ftp.job.lines ftp.deleteJob() else: @@ -405,7 +405,7 @@ proc retrText*(ftp: PFTPClient, file: string, async = false): string = assertReply ftp.send("RETR " & file.normalizePathSep), ["125", "150"] if not async: - while not ftp.job.prc(ftp, false): nil + while not ftp.job.prc(ftp, false): discard result = ftp.job.lines ftp.deleteJob() else: @@ -460,7 +460,7 @@ proc retrFile*(ftp: PFTPClient, file, dest: string, async = false) = ftp.job.filename = file.normalizePathSep if not async: - while not ftp.job.prc(ftp, false): nil + while not ftp.job.prc(ftp, false): discard ftp.deleteJob() proc doUpload(ftp: PFTPClient, async = false): bool = @@ -518,7 +518,7 @@ proc store*(ftp: PFTPClient, file, dest: string, async = false) = assertReply ftp.send("STOR " & dest.normalizePathSep), ["125", "150"] if not async: - while not ftp.job.prc(ftp, false): nil + while not ftp.job.prc(ftp, false): discard ftp.deleteJob() proc close*(ftp: PFTPClient) = @@ -554,10 +554,10 @@ proc csockHandleRead(s: PAsyncSocket, ftp: PAsyncFTPClient) = ftp.handleEvent(ftp, r) -proc AsyncFTPClient*(address: string, port = TPort(21), +proc asyncFTPClient*(address: string, port = TPort(21), user, pass = "", handleEvent: proc (ftp: PAsyncFTPClient, ev: TFTPEvent) {.closure.} = - (proc (ftp: PAsyncFTPClient, ev: TFTPEvent) = nil)): PAsyncFTPClient = + (proc (ftp: PAsyncFTPClient, ev: TFTPEvent) = discard)): PAsyncFTPClient = ## Create a ``PAsyncFTPClient`` object. ## ## Use this if you want to use asyncio's dispatcher. @@ -604,7 +604,7 @@ when isMainModule: ftp.close() echo d.len else: assert(false) - var ftp = AsyncFTPClient("picheta.me", user = "test", pass = "asf", handleEvent = hev) + var ftp = asyncFTPClient("picheta.me", user = "test", pass = "asf", handleEvent = hev) d.register(ftp) d.len.echo() @@ -618,7 +618,7 @@ when isMainModule: when isMainModule and false: - var ftp = FTPClient("picheta.me", user = "asdasd", pass = "asfwq") + var ftp = ftpClient("picheta.me", user = "asdasd", pass = "asfwq") ftp.connect() echo ftp.pwd() echo ftp.list() From 9af1ab5f4331b4857f6bcc57a8c7318faea36a7e Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 25 Jan 2014 14:22:05 +0100 Subject: [PATCH 262/326] fixes a minor parser bug --- compiler/parser.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/parser.nim b/compiler/parser.nim index 1084c3b4a3..3765557b9d 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -1209,8 +1209,7 @@ proc parseReturnOrRaise(p: var TParser, kind: TNodeKind): PNode = if p.tok.tokType == tkComment: skipComment(p, result) addSon(result, ast.emptyNode) - elif p.tok.indent >= 0 and p.tok.indent <= p.currInd or - p.tok.tokType == tkEof: + elif p.tok.indent >= 0 and p.tok.indent <= p.currInd or not isExprStart(p): # NL terminates: addSon(result, ast.emptyNode) else: From 9d4c4592fa49aa1b571a158025ae3a7155b2414b Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 25 Jan 2014 14:22:38 +0100 Subject: [PATCH 263/326] more efficient calls for closure iterators --- compiler/ccgcalls.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index 1c6eea6218..84c5bf4199 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -146,7 +146,8 @@ proc genClosureCall(p: BProc, le, ri: PNode, d: var TLoc) = proc addComma(r: PRope): PRope = result = if r == nil: r else: con(r, ~", ") - const CallPattern = "$1.ClEnv? $1.ClPrc($3$1.ClEnv) : (($4)($1.ClPrc))($2)" + const PatProc = "$1.ClEnv? $1.ClPrc($3$1.ClEnv):(($4)($1.ClPrc))($2)" + const PatIter = "$1.ClPrc($3$1.ClEnv)" # we know the env exists var op: TLoc initLocExpr(p, ri.sons[0], op) var pl: PRope @@ -164,9 +165,10 @@ proc genClosureCall(p: BProc, le, ri: PNode, d: var TLoc) = if i < length - 1: app(pl, ~", ") template genCallPattern {.dirty.} = - lineF(p, cpsStmts, CallPattern & ";$n", op.r, pl, pl.addComma, rawProc) + lineF(p, cpsStmts, callPattern & ";$n", op.r, pl, pl.addComma, rawProc) let rawProc = getRawProcType(p, typ) + let callPattern = if tfIterator in typ.flags: PatIter else: PatProc if typ.sons[0] != nil: if isInvalidReturnType(typ.sons[0]): if sonsLen(ri) > 1: app(pl, ~", ") @@ -190,7 +192,7 @@ proc genClosureCall(p: BProc, le, ri: PNode, d: var TLoc) = assert(d.t != nil) # generate an assignment to d: var list: TLoc initLoc(list, locCall, d.t, OnUnknown) - list.r = ropef(CallPattern, op.r, pl, pl.addComma, rawProc) + list.r = ropef(callPattern, op.r, pl, pl.addComma, rawProc) genAssignment(p, d, list, {}) # no need for deep copying else: genCallPattern() From f16881ad162a12833aba7598d65684d9e63600c2 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 25 Jan 2014 14:24:33 +0100 Subject: [PATCH 264/326] disable internalError so that nimbuild compiles again --- compiler/lambdalifting.nim | 2 ++ compiler/semdestruct.nim | 5 ++++- lib/system.nim | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 01eb494636..00fa045562 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -655,6 +655,8 @@ proc transformOuterProc(o: POuterContext, n: PNode): PNode = # consider: [i1, i2, i1] Since we merged the iterator's closure # with the captured owning variables, we need to generate the # closure generation code again: + #if local == o.fn: message(n.info, errRecursiveDependencyX, local.name.s) + # XXX why doesn't this work? let createdVar = generateIterClosureCreation(o, closure, closure.attachedNode) return makeClosure(local, createdVar, n.info) diff --git a/compiler/semdestruct.nim b/compiler/semdestruct.nim index 9dbbf29402..fb05826cb7 100644 --- a/compiler/semdestruct.nim +++ b/compiler/semdestruct.nim @@ -116,7 +116,10 @@ proc generateDestructor(c: PContext, t: PType): PNode = let stmt = destroyField(c, t.n.sons[s].sym, destructedObj) if stmt != nil: addLine(stmt) else: - internalAssert false + # XXX just skip it for now so that the compiler doesn't crash, but + # please zahary fix it! arbitrary nesting of nkRecList/nkRecCase is + # possible. Any thread example seems to trigger this. + discard # base classes' destructors will be automatically called by # semProcAux for both auto-generated and user-defined destructors diff --git a/lib/system.nim b/lib/system.nim index de23a71fa1..09e44a45a9 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1330,7 +1330,7 @@ iterator `||`*[S, T](a: S, b: T, annotation=""): T {. ## such isn't aware of the parallelism in your code! Be careful! Later ## versions of ``||`` will get proper support by Nimrod's code generator ## and GC. - nil + discard {.push stackTrace:off.} proc min*(x, y: int): int {.magic: "MinI", noSideEffect.} = From 8a7f50889c18283670801f442d6778fdff362c70 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 25 Jan 2014 23:03:43 +0100 Subject: [PATCH 265/326] fixes #838 --- compiler/semtypinst.nim | 4 ++-- compiler/vm.nim | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index ac14179cd5..9c6421315b 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -116,8 +116,8 @@ proc hasGenericArguments*(n: PNode): bool = (n.sym.kind == skType and n.sym.typ.flags * {tfGenericTypeParam, tfImplicitTypeParam} != {}) else: - for s in n.sons: - if hasGenericArguments(s): return true + for i in 0.. <n.safeLen: + if hasGenericArguments(n.sons[i]): return true return false proc reResolveCallsWithTypedescParams(cl: var TReplTypeVars, n: PNode): PNode = diff --git a/compiler/vm.nim b/compiler/vm.nim index 9ed18d29eb..26aab30680 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1057,6 +1057,7 @@ proc fixType(result, n: PNode) {.inline.} = # XXX do it deeply for complex values; there seems to be no simple # solution except to check it deeply here. #if result.typ.isNil: result.typ = n.typ + discard proc execute(c: PCtx, start: int): PNode = var tos = PStackFrame(prc: nil, comesFrom: 0, next: nil) @@ -1118,6 +1119,7 @@ proc evalConstExprAux(module, prc: PSym, n: PNode, mode: TEvalMode): PNode = var c = globalCtx c.mode = mode let start = genExpr(c, n, requiresValue = mode!=emStaticStmt) + if c.code[start].opcode == opcEof: return emptyNode assert c.code[start].opcode != opcEof var tos = PStackFrame(prc: prc, comesFrom: 0, next: nil) newSeq(tos.slots, c.prc.maxSlots) From 5a6030a16bf74ee7de92117c5b2d7310b8b36d28 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov <zahary@gmail.com> Date: Sun, 26 Jan 2014 00:45:50 +0200 Subject: [PATCH 266/326] the `is` operator now uses exactly the same algorithm as proc signature matching --- compiler/semexprs.nim | 25 +++++++------------------ compiler/sigmatch.nim | 2 +- lib/pure/sockets.nim | 6 +++--- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 1096d30292..84303b6cda 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -322,24 +322,13 @@ proc isOpImpl(c: PContext, n: PNode): PNode = t.callConv == ccClosure and tfIterator in t.flags)) else: - var match: bool - let t2 = n[2].typ.skipTypes({tyTypeDesc}) - case t2.kind - of tyTypeClasses: - var m: TCandidate - initCandidate(c, m, t2) - match = typeRel(m, t2, t1) != isNone - of tyOrdinal: - var m: TCandidate - initCandidate(c, m, t2) - match = isOrdinalType(t1) - of tySequence, tyArray, tySet: - var m: TCandidate - initCandidate(c, m, t2) - match = typeRel(m, t2, t1) != isNone - else: - match = sameType(t1, t2) - + var t2 = n[2].typ.skipTypes({tyTypeDesc}) + let lifted = liftParamType(c, skType, newNodeI(nkArgList, n.info), + t2, ":anon", n.info) + if lifted != nil: t2 = lifted + var m: TCandidate + initCandidate(c, m, t2) + let match = typeRel(m, t2, t1) != isNone result = newIntNode(nkIntLit, ord(match)) result.typ = n.typ diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 971d526ee8..d269e9e693 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -820,7 +820,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = else: return isNone - of tyUserTypeClassInst: + of tyUserTypeClass, tyUserTypeClassInst: considerPreviousT: result = matchUserTypeClass(c.c, c, f, a) if result == isGeneric: diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index b3cc38ee70..fd64031181 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -192,7 +192,7 @@ when defined(Posix): of AF_UNIX: result = posix.AF_UNIX of AF_INET: result = posix.AF_INET of AF_INET6: result = posix.AF_INET6 - else: nil + else: discard proc toInt(typ: TType): cint = case typ @@ -200,7 +200,7 @@ when defined(Posix): of SOCK_DGRAM: result = posix.SOCK_DGRAM of SOCK_SEQPACKET: result = posix.SOCK_SEQPACKET of SOCK_RAW: result = posix.SOCK_RAW - else: nil + else: discard proc toInt(p: TProtocol): cint = case p @@ -210,7 +210,7 @@ when defined(Posix): of IPPROTO_IPV6: result = posix.IPPROTO_IPV6 of IPPROTO_RAW: result = posix.IPPROTO_RAW of IPPROTO_ICMP: result = posix.IPPROTO_ICMP - else: nil + else: discard else: proc toInt(domain: TDomain): cint = From 7956737ef1f4819190dc86e0c7b9434ba58a9390 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Sun, 26 Jan 2014 16:39:20 +0100 Subject: [PATCH 267/326] Adds note about manual memory handling to GC doc. --- doc/gc.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/gc.txt b/doc/gc.txt index 13498afaa1..18fb03b6df 100644 --- a/doc/gc.txt +++ b/doc/gc.txt @@ -107,3 +107,20 @@ that up to 100 objects are traversed and freed before it checks again. Thus ``workPackage`` affects the timing granularity and may need to be tweaked in highly specialized environments or for older hardware. + +Keeping track of memory +----------------------- + +If you need to pass around memory allocated by Nimrod to C, you can use the +procs ``GC_ref`` and ``GC_unref`` to mark objects as referenced to avoid them +being freed by the GC. Other useful procs from `system <system.html>`_ you can +use to keep track of memory are: + +* getTotalMem(): returns the amount of total memory managed by the GC. +* getOccupiedMem(): bytes reserved by the GC and used by objects. +* getFreeMem(): bytes reserved by the GC and not in use. + +In addition to ``GC_ref`` and ``GC_unref`` you can avoid the GC by manually +allocating memory with procs like ``alloc``, ``allocShared``, or +``allocCStringArray``. The GC won't try to free them, you need to call their +respective *dealloc* pairs when you are done with them or they will leak. From 92f7c479b9c8db6fdf5044a61025dd88529ce8b6 Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Mon, 27 Jan 2014 17:48:39 +0000 Subject: [PATCH 268/326] Fixes #848. --- compiler/types.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/types.nim b/compiler/types.nim index 4a53a84c97..cd703474e6 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -451,7 +451,7 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = of tyProc: "proc" of tyObject: "object" of tyTuple: "tuple" - else: (internalAssert false; "") + else: (internalAssert(false); "") of tyUserTypeClassInst: let body = t.base result = body.sym.name.s & "[" From 9344e9fbf7d4c056710c152b8e811632914f8043 Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Mon, 27 Jan 2014 18:20:08 +0000 Subject: [PATCH 269/326] Finished logging module. --- devel/logging.nim | 210 ---------------------------------- doc/lib.txt | 3 + lib/pure/logging.nim | 267 +++++++++++++++++++++++++++++++++++++++++++ web/nimrod.ini | 2 +- 4 files changed, 271 insertions(+), 211 deletions(-) delete mode 100644 devel/logging.nim create mode 100644 lib/pure/logging.nim diff --git a/devel/logging.nim b/devel/logging.nim deleted file mode 100644 index a10478dab4..0000000000 --- a/devel/logging.nim +++ /dev/null @@ -1,210 +0,0 @@ -# -# -# Nimrod's Runtime Library -# (c) Copyright 2012 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -## This module implements a simple logger. It is based on the following design: -## * Runtime log formating is a bug: Sooner or later every log file is parsed. -## * Keep it simple: If this library does not fullfill your needs, write your -## own. Trying to support every logging feature just leads to bloat. -## -## Format is:: -## -## DEBUG|INFO|... (2009-11-02 00:00:00)? (Component: )? Message -## -## - -import strutils, os, times - -type - TLevel* = enum ## logging level - lvlAll, ## all levels active - lvlDebug, ## debug level (and any above) active - lvlInfo, ## info level (and any above) active - lvlWarn, ## warn level (and any above) active - lvlError, ## error level (and any above) active - lvlFatal, ## fatal level (and any above) active - lvlNone - -const - LevelNames*: array [TLevel, string] = [ - "DEBUG", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "NONE" - ] - - defaultFmtStr = "" ## default string between log level and message per logger - verboseFmtStr = "$date $time " - -type - TLogger* = object of TObject ## abstract logger; the base type of all loggers - levelThreshold*: TLevel ## only messages of level >= levelThreshold - ## should be processed - fmtStr: string ## = defaultFmtStr by default, see substituteLog for $date etc. - - TConsoleLogger* = object of TLogger ## logger that writes the messages to the - ## console - - TFileLogger* = object of TLogger ## logger that writes the messages to a file - f: TFile - - # TODO: implement rolling log, will produce filename.1, filename.2 etc. - TRollingFileLogger* = object of TFileLogger ## logger that writes the - ## message to a file - maxLines: int # maximum number of lines - curLine : int - baseName: string # initial filename - logFiles: int # how many log files already created, e.g. basename.1, basename.2... - - - - -proc substituteLog*(frmt: string): string = - ## converts $date to the current date - ## converts $time to the current time - ## converts $app to getAppFilename() - ## converts - result = newStringOfCap(frmt.len + 20) - var i = 0 - while i < frmt.len: - if frmt[i] != '$': - result.add(frmt[i]) - inc(i) - else: - inc(i) - var v = "" - var app = getAppFilename() - while frmt[i] in IdentChars: - v.add(toLower(frmt[i])) - inc(i) - case v - of "date": result.add(getDateStr()) - of "time": result.add(getClockStr()) - of "app": result.add(app) - of "appdir": result.add(app.splitFile.dir) - of "appname": result.add(app.splitFile.name) - - - -method log*(L: ref TLogger, level: TLevel, - frmt: string, args: varargs[string, `$`]) = - ## override this method in custom loggers. Default implementation does - ## nothing. - nil - -method log*(L: ref TConsoleLogger, level: TLevel, - frmt: string, args: varargs[string, `$`]) = - Writeln(stdout, LevelNames[level], " ", substituteLog(L.fmtStr), frmt % args) - -method log*(L: ref TFileLogger, level: TLevel, - frmt: string, args: varargs[string, `$`]) = - Writeln(L.f, LevelNames[level], " ", substituteLog(L.fmtStr), frmt % args) - -proc defaultFilename*(): string = - ## returns the default filename for a logger - var (path, name, ext) = splitFile(getAppFilename()) - result = changeFileExt(path / name & "_" & getDateStr(), "log") - - - - -proc newConsoleLogger*(levelThreshold = lvlAll) : ref TConsoleLogger = - new result - result.fmtStr = defaultFmtStr - result.levelThreshold = levelThreshold - -proc newFileLogger*(filename = defaultFilename(), - mode: TFileMode = fmAppend, - levelThreshold = lvlAll): ref TFileLogger = - new(result) - result.levelThreshold = levelThreshold - result.f = open(filename, mode) - result.fmtStr = defaultFmtStr - -# ------ - -proc readLogLines(logger : ref TRollingFileLogger) = nil - #f.readLine # TODO read all lines, update curLine - - -proc newRollingFileLogger*(filename = defaultFilename(), - mode: TFileMode = fmReadWrite, - levelThreshold = lvlAll, - maxLines = 1000): ref TRollingFileLogger = - new(result) - result.levelThreshold = levelThreshold - result.fmtStr = defaultFmtStr - result.maxLines = maxLines - result.f = open(filename, mode) - result.curLine = 0 - - # TODO count all number files - # count lines in existing filename file - # if >= maxLines then rename to next numbered file and create new file - - #if mode in {fmReadWrite, fmReadWriteExisting}: - # readLogLines(result) - - - -method log*(L: ref TRollingFileLogger, level: TLevel, - frmt: string, args: varargs[string, `$`]) = - # TODO - # if more than maxlines, then set cursor to zero - - Writeln(L.f, LevelNames[level], " ", frmt % args) - -# -------- - -var - level* = lvlAll ## global log filter - handlers*: seq[ref TLogger] = @[] ## handlers with their own log levels - -proc logLoop(level: TLevel, frmt: string, args: varargs[string, `$`]) = - for logger in items(handlers): - if level >= logger.levelThreshold: - log(logger, level, frmt, args) - -template log*(level: TLevel, frmt: string, args: varargs[string, `$`]) = - ## logs a message of the given level - bind logLoop - bind `%` - bind logging.Level - - if level >= logging.Level: - logLoop(level, frmt, args) - -template debug*(frmt: string, args: varargs[string, `$`]) = - ## logs a debug message - log(lvlDebug, frmt, args) - -template info*(frmt: string, args: varargs[string, `$`]) = - ## logs an info message - log(lvlInfo, frmt, args) - -template warn*(frmt: string, args: varargs[string, `$`]) = - ## logs a warning message - log(lvlWarn, frmt, args) - -template error*(frmt: string, args: varargs[string, `$`]) = - ## logs an error message - log(lvlError, frmt, args) - -template fatal*(frmt: string, args: varargs[string, `$`]) = - ## logs a fatal error message - log(lvlFatal, frmt, args) - - -# -------------- - -when isMainModule: - var L = newConsoleLogger() - var fL = newFileLogger("test.log") - fL.fmtStr = verboseFmtStr - handlers.add(L) - handlers.add(fL) - info("hello", []) - - diff --git a/doc/lib.txt b/doc/lib.txt index ba0cb0a905..3214cdae21 100644 --- a/doc/lib.txt +++ b/doc/lib.txt @@ -341,6 +341,9 @@ Miscellaneous * `endians <endians.html>`_ This module contains helpers that deal with different byte orders. +* `logging <logging.html>`_ + This module implements a simple logger. + Database support ---------------- diff --git a/lib/pure/logging.nim b/lib/pure/logging.nim new file mode 100644 index 0000000000..8158cbc2aa --- /dev/null +++ b/lib/pure/logging.nim @@ -0,0 +1,267 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2014 Andreas Rumpf, Dominik Picheta +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## This module implements a simple logger. It has been designed to be as simple +## as possible to avoid bloat, if this library does not fullfill your needs, +## write your own. +## +## Format strings support the following variables which must be prefixed with +## the dollar operator (``$``): +## +## ============ ======================= +## Operator Output +## ============ ======================= +## $date Current date +## $time Current time +## $app ``os.getAppFilename()`` +## ============ ======================= +## +## +## The following example demonstrates logging to three different handlers +## simultaneously: +## +## .. code-block:: nimrod +## +## var L = newConsoleLogger() +## var fL = newFileLogger("test.log", fmtStr = verboseFmtStr) +## var rL = newRollingFileLogger("rolling.log", fmtStr = verboseFmtStr) +## handlers.add(L) +## handlers.add(fL) +## handlers.add(rL) +## info("920410:52 accepted") +## warn("4 8 15 16 23 4-- Error") +## error("922044:16 SYSTEM FAILURE") +## fatal("SYSTEM FAILURE SYSTEM FAILURE") + +import strutils, os, times + +type + TLevel* = enum ## logging level + lvlAll, ## all levels active + lvlDebug, ## debug level (and any above) active + lvlInfo, ## info level (and any above) active + lvlWarn, ## warn level (and any above) active + lvlError, ## error level (and any above) active + lvlFatal, ## fatal level (and any above) active + lvlNone ## no levels active + +const + LevelNames*: array [TLevel, string] = [ + "DEBUG", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "NONE" + ] + + defaultFmtStr* = "" ## default string between log level and message per logger + verboseFmtStr* = "$date $time " + +type + PLogger* = ref object of PObject ## abstract logger; the base type of all loggers + levelThreshold*: TLevel ## only messages of level >= levelThreshold + ## should be processed + fmtStr: string ## = defaultFmtStr by default, see substituteLog for $date etc. + + PConsoleLogger* = ref object of PLogger ## logger that writes the messages to the + ## console + + PFileLogger* = ref object of PLogger ## logger that writes the messages to a file + f: TFile + + PRollingFileLogger* = ref object of PFileLogger ## logger that writes the + ## messages to a file and + ## performs log rotation + maxLines: int # maximum number of lines + curLine : int + baseName: string # initial filename + baseMode: TFileMode # initial file mode + logFiles: int # how many log files already created, e.g. basename.1, basename.2... + +proc substituteLog(frmt: string): string = + ## converts $date to the current date + ## converts $time to the current time + ## converts $app to getAppFilename() + ## converts + result = newStringOfCap(frmt.len + 20) + var i = 0 + while i < frmt.len: + if frmt[i] != '$': + result.add(frmt[i]) + inc(i) + else: + inc(i) + var v = "" + var app = getAppFilename() + while frmt[i] in IdentChars: + v.add(toLower(frmt[i])) + inc(i) + case v + of "date": result.add(getDateStr()) + of "time": result.add(getClockStr()) + of "app": result.add(app) + of "appdir": result.add(app.splitFile.dir) + of "appname": result.add(app.splitFile.name) + +method log*(logger: PLogger, level: TLevel, + frmt: string, args: varargs[string, `$`]) = + ## Override this method in custom loggers. Default implementation does + ## nothing. + nil + +method log*(logger: PConsoleLogger, level: TLevel, + frmt: string, args: varargs[string, `$`]) = + ## Logs to the console using ``logger`` only. + if level >= logger.levelThreshold: + writeln(stdout, LevelNames[level], " ", substituteLog(logger.fmtStr), + frmt % args) + +method log*(logger: PFileLogger, level: TLevel, + frmt: string, args: varargs[string, `$`]) = + ## Logs to a file using ``logger`` only. + if level >= logger.levelThreshold: + writeln(logger.f, LevelNames[level], " ", + substituteLog(logger.fmtStr), frmt % args) + +proc defaultFilename*(): string = + ## Returns the default filename for a logger. + var (path, name, ext) = splitFile(getAppFilename()) + result = changeFileExt(path / name, "log") + +proc newConsoleLogger*(levelThreshold = lvlAll, fmtStr = defaultFmtStr): PConsoleLogger = + ## Creates a new console logger. This logger logs to the console. + new result + result.fmtStr = fmtStr + result.levelThreshold = levelThreshold + +proc newFileLogger*(filename = defaultFilename(), + mode: TFileMode = fmAppend, + levelThreshold = lvlAll, + fmtStr = defaultFmtStr): PFileLogger = + ## Creates a new file logger. This logger logs to a file. + new(result) + result.levelThreshold = levelThreshold + result.f = open(filename, mode) + result.fmtStr = fmtStr + +# ------ + +proc countLogLines(logger: PRollingFileLogger): int = + result = 0 + for line in logger.f.lines(): + result.inc() + +proc countFiles(filename: string): int = + # Example: file.log.1 + result = 0 + let (dir, name, ext) = splitFile(filename) + for kind, path in walkDir(dir): + if kind == pcFile: + let llfn = name & ext & ExtSep + if path.extractFilename.startsWith(llfn): + let numS = path.extractFilename[llfn.len .. -1] + try: + let num = parseInt(numS) + if num > result: + result = num + except EInvalidValue: discard + +proc newRollingFileLogger*(filename = defaultFilename(), + mode: TFileMode = fmReadWrite, + levelThreshold = lvlAll, + fmtStr = defaultFmtStr, + maxLines = 1000): PRollingFileLogger = + ## Creates a new rolling file logger. Once a file reaches ``maxLines`` lines + ## a new log file will be started and the old will be renamed. + new(result) + result.levelThreshold = levelThreshold + result.fmtStr = defaultFmtStr + result.maxLines = maxLines + result.f = open(filename, mode) + result.curLine = 0 + result.baseName = filename + result.baseMode = mode + + result.logFiles = countFiles(filename) + + if mode == fmAppend: + # We need to get a line count because we will be appending to the file. + result.curLine = countLogLines(result) + +proc rotate(logger: PRollingFileLogger) = + let (dir, name, ext) = splitFile(logger.baseName) + for i in countdown(logger.logFiles, 0): + let srcSuff = if i != 0: ExtSep & $i else: "" + moveFile(dir / (name & ext & srcSuff), + dir / (name & ext & ExtSep & $(i+1))) + +method log*(logger: PRollingFileLogger, level: TLevel, + frmt: string, args: varargs[string, `$`]) = + ## Logs to a file using rolling ``logger`` only. + if level >= logger.levelThreshold: + if logger.curLine >= logger.maxLines: + logger.f.close() + rotate(logger) + logger.logFiles.inc + logger.curLine = 0 + logger.f = open(logger.baseName, logger.baseMode) + + writeln(logger.f, LevelNames[level], " ", frmt % args) + logger.curLine.inc + +# -------- + +var + level* = lvlAll ## global log filter + handlers*: seq[PLogger] = @[] ## handlers with their own log levels + +proc logLoop(level: TLevel, frmt: string, args: varargs[string, `$`]) = + for logger in items(handlers): + if level >= logger.levelThreshold: + log(logger, level, frmt, args) + +template log*(level: TLevel, frmt: string, args: varargs[string, `$`]) = + ## Logs a message to all registered handlers at the given level. + bind logLoop + bind `%` + bind logging.Level + + if level >= logging.Level: + logLoop(level, frmt, args) + +template debug*(frmt: string, args: varargs[string, `$`]) = + ## Logs a debug message to all registered handlers. + log(lvlDebug, frmt, args) + +template info*(frmt: string, args: varargs[string, `$`]) = + ## Logs an info message to all registered handlers. + log(lvlInfo, frmt, args) + +template warn*(frmt: string, args: varargs[string, `$`]) = + ## Logs a warning message to all registered handlers. + log(lvlWarn, frmt, args) + +template error*(frmt: string, args: varargs[string, `$`]) = + ## Logs an error message to all registered handlers. + log(lvlError, frmt, args) + +template fatal*(frmt: string, args: varargs[string, `$`]) = + ## Logs a fatal error message to all registered handlers. + log(lvlFatal, frmt, args) + + +# -------------- + +when isMainModule: + var L = newConsoleLogger() + var fL = newFileLogger("test.log", fmtStr = verboseFmtStr) + var rL = newRollingFileLogger("rolling.log", fmtStr = verboseFmtStr) + handlers.add(L) + handlers.add(fL) + handlers.add(rL) + for i in 0 .. 25: + info("hello" & $i, []) + + diff --git a/web/nimrod.ini b/web/nimrod.ini index 9af3bc226e..71e36dcdc3 100644 --- a/web/nimrod.ini +++ b/web/nimrod.ini @@ -62,7 +62,7 @@ srcdoc2: "pure/ftpclient;pure/memfiles;pure/subexes;pure/collections/critbits" srcdoc2: "pure/asyncio;pure/actors;core/locks;pure/oids;pure/endians;pure/uri" srcdoc2: "pure/nimprof;pure/unittest;packages/docutils/highlite" srcdoc2: "packages/docutils/rst;packages/docutils/rstast" -srcdoc2: "packages/docutils/rstgen" +srcdoc2: "packages/docutils/rstgen;pure/logging" webdoc: "wrappers/libcurl;pure/md5;wrappers/mysql;wrappers/iup" webdoc: "wrappers/sqlite3;wrappers/postgres;wrappers/tinyc" From 446ffb548126099dd7f62d058ac2aca0c5e65fe1 Mon Sep 17 00:00:00 2001 From: EXetoC <exetoc@gmail.com> Date: Wed, 29 Jan 2014 02:29:25 +0100 Subject: [PATCH 270/326] Punctation -> punctuation. --- lib/packages/docutils/highlite.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim index db7a639281..4ca0c79e03 100644 --- a/lib/packages/docutils/highlite.nim +++ b/lib/packages/docutils/highlite.nim @@ -19,7 +19,7 @@ type gtEof, gtNone, gtWhitespace, gtDecNumber, gtBinNumber, gtHexNumber, gtOctNumber, gtFloatNumber, gtIdentifier, gtKeyword, gtStringLit, gtLongStringLit, gtCharLit, gtEscapeSequence, # escape sequence like \xff - gtOperator, gtPunctation, gtComment, gtLongComment, gtRegularExpression, + gtOperator, gtPunctuation, gtComment, gtLongComment, gtRegularExpression, gtTagStart, gtTagEnd, gtKey, gtValue, gtRawData, gtAssembler, gtPreprocessor, gtDirective, gtCommand, gtRule, gtHyperlink, gtLabel, gtReference, gtOther @@ -39,7 +39,7 @@ const tokenClassToStr*: array[TTokenClass, string] = ["Eof", "None", "Whitespace", "DecNumber", "BinNumber", "HexNumber", "OctNumber", "FloatNumber", "Identifier", "Keyword", "StringLit", "LongStringLit", "CharLit", - "EscapeSequence", "Operator", "Punctation", "Comment", "LongComment", + "EscapeSequence", "Operator", "Punctuation", "Comment", "LongComment", "RegularExpression", "TagStart", "TagEnd", "Key", "Value", "RawData", "Assembler", "Preprocessor", "Directive", "Command", "Rule", "Hyperlink", "Label", "Reference", "Other"] @@ -258,7 +258,7 @@ proc nimNextToken(g: var TGeneralTokenizer) = else: inc(pos) of '(', ')', '[', ']', '{', '}', '`', ':', ',', ';': inc(pos) - g.kind = gtPunctation + g.kind = gtPunctuation of '\0': g.kind = gtEof else: @@ -473,7 +473,7 @@ proc clikeNextToken(g: var TGeneralTokenizer, keywords: openArray[string], else: inc(pos) of '(', ')', '[', ']', '{', '}', ':', ',', ';', '.': inc(pos) - g.kind = gtPunctation + g.kind = gtPunctuation of '\0': g.kind = gtEof else: From b549ca45175ef53e0990a3289b71051a9fe5349f Mon Sep 17 00:00:00 2001 From: EXetoC <exetoc@gmail.com> Date: Wed, 29 Jan 2014 17:35:11 +0100 Subject: [PATCH 271/326] Punctation -> Punctuation; fix remaining typos. --- config/nimdoc.cfg | 2 +- config/nimdoc.tex.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/nimdoc.cfg b/config/nimdoc.cfg index d47dccb635..63a3c30c4e 100644 --- a/config/nimdoc.cfg +++ b/config/nimdoc.cfg @@ -76,7 +76,7 @@ span.LongStringLit {color: blue} span.CharLit {color: blue} span.EscapeSequence {color: black} span.Operator {color: black} -span.Punctation {color: black} +span.Punctuation {color: black} span.Comment, span.LongComment {font-style:italic; color: green} span.RegularExpression {color: DarkViolet} span.TagStart {color: DarkViolet} diff --git a/config/nimdoc.tex.cfg b/config/nimdoc.tex.cfg index 8b59f2ee95..599ede345a 100644 --- a/config/nimdoc.tex.cfg +++ b/config/nimdoc.tex.cfg @@ -98,7 +98,7 @@ doc.file = """ \newcommand{\spanCharLit}[1]{#1} \newcommand{\spanEscapeSequence}[1]{#1} \newcommand{\spanOperator}[1]{#1} -\newcommand{\spanPunctation}[1]{#1} +\newcommand{\spanPunctuation}[1]{#1} \newcommand{\spanComment}[1]{\emph{#1}} \newcommand{\spanLongComment}[1]{\emph{#1}} \newcommand{\spanRegularExpression}[1]{#1} From d07f86b1597b17bf13ae51cc7912f378b56aa9f3 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Wed, 29 Jan 2014 23:25:21 +0100 Subject: [PATCH 272/326] Avoids raising exceptions in tryInsertID. --- lib/impure/db_sqlite.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/impure/db_sqlite.nim b/lib/impure/db_sqlite.nim index a3499a6df6..809ee70392 100644 --- a/lib/impure/db_sqlite.nim +++ b/lib/impure/db_sqlite.nim @@ -148,7 +148,8 @@ proc getValue*(db: TDbConn, query: TSqlQuery, if finalize(stmt) != SQLITE_OK: dbError(db) proc tryInsertID*(db: TDbConn, query: TSqlQuery, - args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} = + args: varargs[string, `$`]): int64 + {.tags: [FWriteDb], raises: [].} = ## executes the query (typically "INSERT") and returns the ## generated ID for the row or -1 in case of an error. var q = dbFormat(query, args) @@ -157,7 +158,8 @@ proc tryInsertID*(db: TDbConn, query: TSqlQuery, if prepare_v2(db, q, q.len.cint, stmt, nil) == SQLITE_OK: if step(stmt) == SQLITE_DONE: result = last_insert_rowid(db) - if finalize(stmt) != SQLITE_OK: dbError(db) + if finalize(stmt) != SQLITE_OK: + result = -1 proc insertID*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} = From ac0f15379cb0409e47512bcd40af28d1e7816337 Mon Sep 17 00:00:00 2001 From: Simon Hafner <hafnersimon@gmail.com> Date: Thu, 30 Jan 2014 02:07:21 -0600 Subject: [PATCH 273/326] added Cartesian product --- lib/pure/algorithm.nim | 32 ++++++++++++++++++++++++++++++++ tests/stdlib/talgorithm.nim | 9 +++++++++ 2 files changed, 41 insertions(+) create mode 100644 tests/stdlib/talgorithm.nim diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index df7ae6d176..2620f7c901 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -131,3 +131,35 @@ proc sort*[T](a: var openArray[T], dec(m, s*2) s = s*2 +proc product[T](x: openarray[seq[T]]): seq[seq[T]] = + ## produces the Cartesian product of the array. Warning: complexity + ## may explode. + result = @[] + if x.len == 0: + return + if x.len == 1: + result = @x + return + var + indexes = newSeq[int](x.len) + initial = newSeq[int](x.len) + index = 0 + # replace with newSeq as soon as #853 is fixed + var next: seq[T] = @[] + next.setLen(x.len) + for i in 0..(x.len-1): + initial[i] = len(x[i])-1 + indexes = initial + while true: + while indexes[index] == -1: + indexes[index] = initial[index] + index +=1 + if index == x.len: return + indexes[index] -=1 + for ni, i in indexes: + next[ni] = x[ni][i] + var res: seq[T] + shallowCopy(res, next) + result.add(res) + index = 0 + indexes[index] -=1 diff --git a/tests/stdlib/talgorithm.nim b/tests/stdlib/talgorithm.nim new file mode 100644 index 0000000000..ea57883b0f --- /dev/null +++ b/tests/stdlib/talgorithm.nim @@ -0,0 +1,9 @@ +import unittest + +suite "product": + test "a simple case of one element": + check product(@[@[1,2]]) == @[@[1,2]] + test "two elements": + check product(@[@[1,2], @[3,4]]) == @[@[2,4],@[1,4],@[2,3],@[1,3]] + test "three elements": + check product(@[@[1,2], @[3,4], @[5,6]]) == @[@[2,4,6],@[1,4,6],@[2,3,6],@[1,3,6], @[2,4,5],@[1,4,5],@[2,3,5],@[1,3,5]] From f070edb8b91d07bd4ac8fea82317b906cc5ec1c9 Mon Sep 17 00:00:00 2001 From: Simon Hafner <hafnersimon@gmail.com> Date: Thu, 30 Jan 2014 02:09:37 -0600 Subject: [PATCH 274/326] forgot to export product --- lib/pure/algorithm.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index 2620f7c901..b71b2c0fce 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -131,7 +131,7 @@ proc sort*[T](a: var openArray[T], dec(m, s*2) s = s*2 -proc product[T](x: openarray[seq[T]]): seq[seq[T]] = +proc product*[T](x: openarray[seq[T]]): seq[seq[T]] = ## produces the Cartesian product of the array. Warning: complexity ## may explode. result = @[] From e01fb17d023b046b3403a4413a637d24a9dc492f Mon Sep 17 00:00:00 2001 From: Simon Hafner <hafnersimon@gmail.com> Date: Thu, 30 Jan 2014 23:55:43 -0600 Subject: [PATCH 275/326] product more robust against empty input --- lib/pure/algorithm.nim | 1 + tests/stdlib/talgorithm.nim | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index b71b2c0fce..921c659de8 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -148,6 +148,7 @@ proc product*[T](x: openarray[seq[T]]): seq[seq[T]] = var next: seq[T] = @[] next.setLen(x.len) for i in 0..(x.len-1): + if len(x[i]) == 0: return initial[i] = len(x[i])-1 indexes = initial while true: diff --git a/tests/stdlib/talgorithm.nim b/tests/stdlib/talgorithm.nim index ea57883b0f..37de1262f3 100644 --- a/tests/stdlib/talgorithm.nim +++ b/tests/stdlib/talgorithm.nim @@ -1,6 +1,11 @@ import unittest +import algorithm suite "product": + test "empty input": + check product[int](newSeq[seq[int]]()) == newSeq[seq[int]]() + test "bit more empty input": + check product[int](@[newSeq[int](), @[], @[]]) == newSeq[seq[int]]() test "a simple case of one element": check product(@[@[1,2]]) == @[@[1,2]] test "two elements": From 2c5a2d07fb3bb25dcb590d61882f88528ea17e91 Mon Sep 17 00:00:00 2001 From: Simon Hafner <hafnersimon@gmail.com> Date: Fri, 31 Jan 2014 18:22:27 -0600 Subject: [PATCH 276/326] sets equivalence --- lib/pure/collections/sets.nim | 17 +++++++++++++++++ tests/sets/testequivalence.nim | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/sets/testequivalence.nim diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index 7259772aad..e478a2ce19 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -224,3 +224,20 @@ proc toOrderedSet*[A](keys: openArray[A]): TOrderedSet[A] = proc `$`*[A](s: TOrderedSet[A]): string = ## The `$` operator for ordered hash sets. dollarImpl() + +proc `<`*[A](s, t: TSet[A]): bool = + ## Is a a strict subset of b? + s.counter != t.counter and s <= t + +proc `<=`*[A](s, t: TSet[A]): bool = + ## Is a a subset of b? + result = false + if s.counter > t.counter: return + result = true + for item in s: + if not(t.contains(item)): + result = false + return + +proc `==`*[A](s, t: TSet[A]): bool = + s.counter == t.counter and s <= t diff --git a/tests/sets/testequivalence.nim b/tests/sets/testequivalence.nim new file mode 100644 index 0000000000..a1e02fee77 --- /dev/null +++ b/tests/sets/testequivalence.nim @@ -0,0 +1,16 @@ +import unittest +import sets + +suite "sets": + test "equivalent or subset": + check toSet(@[1,2,3]) <= toSet(@[1,2,3,4]) + check toSet(@[1,2,3]) <= toSet(@[1,2,3]) + check(not(toSet(@[1,2,3]) <= toSet(@[1,2]))) + test "strict subset": + check toSet(@[1,2,3]) <= toSet(@[1,2,3,4]) + check(not(toSet(@[1,2,3]) < toSet(@[1,2,3]))) + check(not(toSet(@[1,2,3]) < toSet(@[1,2]))) + test "==": + check(not(toSet(@[1,2,3]) == toSet(@[1,2,3,4]))) + check toSet(@[1,2,3]) == toSet(@[1,2,3]) + check(not(toSet(@[1,2,3]) == toSet(@[1,2]))) From d8d93218fa509b8980d5ecb4b8af4e70e9f4926e Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 1 Feb 2014 11:56:21 +0100 Subject: [PATCH 277/326] bugfix: object constructor doesn't allow 'distinct' types --- compiler/semexprs.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 6e2d777fb0..432443dc69 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1709,8 +1709,8 @@ proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = result = n result.typ = t result.kind = nkObjConstr - t = skipTypes(t, abstractInst) - if t.kind == tyRef: t = skipTypes(t.sons[0], abstractInst) + t = skipTypes(t, {tyGenericInst}) + if t.kind == tyRef: t = skipTypes(t.sons[0], {tyGenericInst}) if t.kind != tyObject: localError(n.info, errGenerated, "object constructor needs an object type") return From 6d62503e5d8d195e3da7d9cb30782410a5d3c3ea Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 1 Feb 2014 13:39:40 +0100 Subject: [PATCH 278/326] documented new symbol binding rules for templates --- doc/manual.txt | 131 ++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 72 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index faf62dcee5..260f0807af 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -12,6 +12,8 @@ Nimrod Manual user to one/some of the other players, but the total amount seems to remain pretty much constant for a given task. -- Ran + + About this document =================== @@ -1479,7 +1481,7 @@ But it seems all this boilerplate code needs to be repeated for the ``TEuro`` currency. This can be solved with templates_. .. code-block:: nimrod - template Additive(typ: typedesc): stmt = + template additive(typ: typedesc): stmt = proc `+` *(x, y: typ): typ {.borrow.} proc `-` *(x, y: typ): typ {.borrow.} @@ -1487,26 +1489,26 @@ currency. This can be solved with templates_. proc `+` *(x: typ): typ {.borrow.} proc `-` *(x: typ): typ {.borrow.} - template Multiplicative(typ, base: typedesc): stmt = + template multiplicative(typ, base: typedesc): stmt = proc `*` *(x: typ, y: base): typ {.borrow.} proc `*` *(x: base, y: typ): typ {.borrow.} proc `div` *(x: typ, y: base): typ {.borrow.} proc `mod` *(x: typ, y: base): typ {.borrow.} - template Comparable(typ: typedesc): stmt = + template comparable(typ: typedesc): stmt = proc `<` * (x, y: typ): bool {.borrow.} proc `<=` * (x, y: typ): bool {.borrow.} proc `==` * (x, y: typ): bool {.borrow.} - template DefineCurrency(typ, base: expr): stmt = + template defineCurrency(typ, base: expr): stmt = type typ* = distinct base - Additive(typ) - Multiplicative(typ, base) - Comparable(typ) + additive(typ) + multiplicative(typ, base) + comparable(typ) - DefineCurrency(TDollar, int) - DefineCurrency(TEuro, int) + defineCurrency(TDollar, int) + defineCurrency(TEuro, int) Void type @@ -3440,13 +3442,41 @@ A symbol can be forced to be open by a `mixin`:idx: declaration: .. code-block:: nimrod proc create*[T](): ref T = - # there is no overloaded 'mixin' here, so we need to state that it's an + # there is no overloaded 'init' here, so we need to state that it's an # open symbol explicitly: mixin init new result init result +Bind statement +-------------- + +The `bind`:idx: statement is the counterpart to the ``mixin`` statement. It +can be used to explicitly declare identifiers that should be bound early (i.e. +the identifiers should be looked up in the scope of the template/generic +definition): + +.. code-block:: nimrod + # Module A + var + lastId = 0 + + template genId*: expr = + bind lastId + inc(lastId) + lastId + +.. code-block:: nimrod + # Module B + import A + + echo genId() + +But a ``bind`` is rarely useful because symbol binding from the definition +scope is the default. + + Templates ========= @@ -3506,28 +3536,6 @@ receive undeclared identifiers: declareInt(x) # valid -Scoping in templates --------------------- - -The template body does not open a new scope. To open a new scope a ``block`` -statement can be used: - -.. code-block:: nimrod - template declareInScope(x: expr, t: typedesc): stmt {.immediate.} = - var x: t - - template declareInNewScope(x: expr, t: typedesc): stmt {.immediate.} = - # open a new scope: - block: - var x: t - - declareInScope(a, int) - a = 42 # works, `a` is known here - - declareInNewScope(b, int) - b = 42 # does not work, `b` is unknown - - Passing a code block to a template ---------------------------------- @@ -3538,26 +3546,28 @@ special ``:`` syntax: .. code-block:: nimrod template withFile(f, fn, mode: expr, actions: stmt): stmt {.immediate.} = - block: - var f: TFile - if open(f, fn, mode): - try: - actions - finally: - close(f) - else: - quit("cannot open: " & fn) + var f: TFile + if open(f, fn, mode): + try: + actions + finally: + close(f) + else: + quit("cannot open: " & fn) withFile(txt, "ttempl3.txt", fmWrite): txt.writeln("line 1") txt.writeln("line 2") In the example the two ``writeln`` statements are bound to the ``actions`` -parameter. +parameter. -**Note:** The symbol binding rules for templates might change! -Symbol binding within templates happens after template instantiation: +Symbol binding in templates +--------------------------- + +A template is a `hygienic`:idx: macro and so opens a new scope. Most symbols are +bound from the definition scope of the template: .. code-block:: nimrod # Module A @@ -3572,34 +3582,11 @@ Symbol binding within templates happens after template instantiation: # Module B import A - echo genId() # Error: undeclared identifier: 'lastId' + echo genId() # Works as 'lastId' has been bound in 'genId's defining scope +As in generics symbol binding can be influenced via ``mixin`` or ``bind`` +statements. -Bind statement --------------- - -Exporting a template is a often a leaky abstraction as it can depend on -symbols that are not visible from a client module. However, to compensate for -this case, a `bind`:idx: statement can be used: It declares all identifiers -that should be bound early (i.e. when the template is parsed): - -.. code-block:: nimrod - # Module A - var - lastId = 0 - - template genId*: expr = - bind lastId - inc(lastId) - lastId - -.. code-block:: nimrod - # Module B - import A - - echo genId() # Works - -A ``bind`` statement can also be used in generics for the same purpose. Identifier construction @@ -3942,13 +3929,13 @@ Static params can also appear in the signatures of generic types: type Matrix[M,N: static[int]; T: Number] = array[0..(M*N - 1), T] - # Please, note how `Number` is just a type constraint here, while + # Note how `Number` is just a type constraint here, while # `static[int]` requires us to supply a compile-time int value AffineTransform2D[T] = Matrix[3, 3, T] AffineTransform3D[T] = Matrix[4, 4, T] - AffineTransform3D[float] # OK + AffineTransform3D[float] # OK AffineTransform2D[string] # Error, `string` is not a `Number` From f9c2ec8d9238afaff285b2ba286f8c5534b05eec Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Sat, 1 Feb 2014 14:57:52 +0000 Subject: [PATCH 279/326] Fixes wrong slurp path in tester. --- tests/tester.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tester.nim b/tests/tester.nim index 0e125b1bbb..9f9da6bfed 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -193,8 +193,8 @@ const <head> <title>Test results</title> <style type="text/css"> - <!--""" & slurp("css/boilerplate.css") & "\n" & - slurp("css/style.css") & + <!--""" & slurp("testament/css/boilerplate.css") & "\n" & + slurp("testament/css/style.css") & """--> </style> From 9f29bb8d9ee01ead64e8af89d471f6fcb67b9712 Mon Sep 17 00:00:00 2001 From: Simon Hafner <hafnersimon@gmail.com> Date: Sat, 1 Feb 2014 16:07:44 -0600 Subject: [PATCH 280/326] corrected docs and tests --- lib/pure/collections/sets.nim | 4 ++-- tests/sets/testequivalence.nim | 22 +++++++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index e478a2ce19..e6ab617e50 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -226,11 +226,11 @@ proc `$`*[A](s: TOrderedSet[A]): string = dollarImpl() proc `<`*[A](s, t: TSet[A]): bool = - ## Is a a strict subset of b? + ## Is s a strict subset of t? s.counter != t.counter and s <= t proc `<=`*[A](s, t: TSet[A]): bool = - ## Is a a subset of b? + ## Is s a subset of t? result = false if s.counter > t.counter: return result = true diff --git a/tests/sets/testequivalence.nim b/tests/sets/testequivalence.nim index a1e02fee77..8a83e2a213 100644 --- a/tests/sets/testequivalence.nim +++ b/tests/sets/testequivalence.nim @@ -1,16 +1,12 @@ import unittest import sets -suite "sets": - test "equivalent or subset": - check toSet(@[1,2,3]) <= toSet(@[1,2,3,4]) - check toSet(@[1,2,3]) <= toSet(@[1,2,3]) - check(not(toSet(@[1,2,3]) <= toSet(@[1,2]))) - test "strict subset": - check toSet(@[1,2,3]) <= toSet(@[1,2,3,4]) - check(not(toSet(@[1,2,3]) < toSet(@[1,2,3]))) - check(not(toSet(@[1,2,3]) < toSet(@[1,2]))) - test "==": - check(not(toSet(@[1,2,3]) == toSet(@[1,2,3,4]))) - check toSet(@[1,2,3]) == toSet(@[1,2,3]) - check(not(toSet(@[1,2,3]) == toSet(@[1,2]))) +doAssert(toSet(@[1,2,3]) <= toSet(@[1,2,3,4]), "equivalent or subset") +doAssert(toSet(@[1,2,3]) <= toSet(@[1,2,3]), "equivalent or subset") +doAssert((not(toSet(@[1,2,3]) <= toSet(@[1,2]))), "equivalent or subset") +doAssert(toSet(@[1,2,3]) <= toSet(@[1,2,3,4]), "strict subset") +doAssert((not(toSet(@[1,2,3]) < toSet(@[1,2,3]))), "strict subset") +doAssert((not(toSet(@[1,2,3]) < toSet(@[1,2]))), "strict subset") +doAssert((not(toSet(@[1,2,3]) == toSet(@[1,2,3,4]))), "==") +doAssert(toSet(@[1,2,3]) == toSet(@[1,2,3]), "==") +doAssert((not(toSet(@[1,2,3]) == toSet(@[1,2]))), "==") From 68d8cd1301b301b4ebfa41dd7ae8714e28cbe721 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 1 Feb 2014 23:56:32 +0100 Subject: [PATCH 281/326] case consistency for evalffi --- compiler/ccgexprs.nim | 2 +- compiler/evalffi.nim | 56 +++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index ba543039e1..be47ac0c4a 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -343,7 +343,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = of tyPtr, tyPointer, tyChar, tyBool, tyEnum, tyCString, tyInt..tyUInt64, tyRange, tyVar: linefmt(p, cpsStmts, "$1 = $2;$n", rdLoc(dest), rdLoc(src)) - else: internalError("genAssignment(" & $ty.kind & ')') + else: internalError("genAssignment: " & $ty.kind) proc getDestLoc(p: BProc, d: var TLoc, typ: PType) = if d.k == locNone: getTemp(p, typ, d) diff --git a/compiler/evalffi.nim b/compiler/evalffi.nim index 74f0663f3c..54be0ccb2a 100644 --- a/compiler/evalffi.nim +++ b/compiler/evalffi.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2012 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -102,7 +102,7 @@ proc mapCallConv(cc: TCallingConvention, info: TLineInfo): TABI = of ccStdCall: result = when defined(windows): STDCALL else: DEFAULT_ABI of ccCDecl: result = DEFAULT_ABI else: - GlobalError(info, "cannot map calling convention to FFI") + globalError(info, "cannot map calling convention to FFI") template rd(T, p: expr): expr {.immediate.} = (cast[ptr T](p))[] template wr(T, p, v: expr) {.immediate.} = (cast[ptr T](p))[] = v @@ -164,7 +164,7 @@ proc packObject(x: PNode, typ: PType, res: pointer) = let field = getField(typ.n, i) pack(it, field.typ, res +! field.offset) else: - GlobalError(x.info, "cannot pack unnamed tuple") + globalError(x.info, "cannot pack unnamed tuple") const maxPackDepth = 20 var packRecCheck = 0 @@ -193,7 +193,7 @@ proc pack(v: PNode, typ: PType, res: pointer) = of 4: awr(int32, v.intVal.int32) of 8: awr(int64, v.intVal.int64) else: - GlobalError(v.info, "cannot map value to FFI (tyEnum, tySet)") + globalError(v.info, "cannot map value to FFI (tyEnum, tySet)") of tyFloat: awr(float, v.floatVal) of tyFloat32: awr(float32, v.floatVal) of tyFloat64: awr(float64, v.floatVal) @@ -207,7 +207,7 @@ proc pack(v: PNode, typ: PType, res: pointer) = elif v.kind in {nkStrLit..nkTripleStrLit}: awr(cstring, cstring(v.strVal)) else: - GlobalError(v.info, "cannot map pointer/proc value to FFI") + globalError(v.info, "cannot map pointer/proc value to FFI") of tyPtr, tyRef, tyVar: if v.kind == nkNilLit: # nothing to do since the memory is 0 initialized anyway @@ -217,7 +217,7 @@ proc pack(v: PNode, typ: PType, res: pointer) = else: if packRecCheck > maxPackDepth: packRecCheck = 0 - GlobalError(v.info, "cannot map value to FFI " & typeToString(v.typ)) + globalError(v.info, "cannot map value to FFI " & typeToString(v.typ)) inc packRecCheck pack(v.sons[0], typ.sons[0], res +! sizeof(pointer)) dec packRecCheck @@ -233,7 +233,7 @@ proc pack(v: PNode, typ: PType, res: pointer) = of tyDistinct, tyGenericInst: pack(v, typ.sons[0], res) else: - GlobalError(v.info, "cannot map value to FFI " & typeToString(v.typ)) + globalError(v.info, "cannot map value to FFI " & typeToString(v.typ)) proc unpack(x: pointer, typ: PType, n: PNode): PNode @@ -243,7 +243,7 @@ proc unpackObjectAdd(x: pointer, n, result: PNode) = for i in countup(0, sonsLen(n) - 1): unpackObjectAdd(x, n.sons[i], result) of nkRecCase: - GlobalError(result.info, "case objects cannot be unpacked") + globalError(result.info, "case objects cannot be unpacked") of nkSym: var pair = newNodeI(nkExprColonExpr, result.info, 2) pair.sons[0] = n @@ -262,14 +262,14 @@ proc unpackObject(x: pointer, typ: PType, n: PNode): PNode = result = newNode(nkPar) result.typ = typ if typ.n.isNil: - InternalError("cannot unpack unnamed tuple") + internalError("cannot unpack unnamed tuple") unpackObjectAdd(x, typ.n, result) else: result = n if result.kind notin {nkObjConstr, nkPar}: - GlobalError(n.info, "cannot map value from FFI") + globalError(n.info, "cannot map value from FFI") if typ.n.isNil: - GlobalError(n.info, "cannot unpack unnamed tuple") + globalError(n.info, "cannot unpack unnamed tuple") for i in countup(ord(n.kind == nkObjConstr), sonsLen(n) - 1): var it = n.sons[i] if it.kind == nkExprColonExpr: @@ -288,7 +288,7 @@ proc unpackArray(x: pointer, typ: PType, n: PNode): PNode = else: result = n if result.kind != nkBracket: - GlobalError(n.info, "cannot map value from FFI") + globalError(n.info, "cannot map value from FFI") let baseSize = typ.sons[1].getSize for i in 0 .. < result.len: result.sons[i] = unpack(x +! i * baseSize, typ.sons[1], result.sons[i]) @@ -312,7 +312,7 @@ proc unpack(x: pointer, typ: PType, n: PNode): PNode = #echo "expected ", k, " but got ", result.kind #debug result return newNodeI(nkExceptBranch, n.info) - #GlobalError(n.info, "cannot map value from FFI") + #globalError(n.info, "cannot map value from FFI") result.field = v template setNil() = @@ -337,19 +337,19 @@ proc unpack(x: pointer, typ: PType, n: PNode): PNode = of tyInt16: awi(nkInt16Lit, rd(int16, x)) of tyInt32: awi(nkInt32Lit, rd(int32, x)) of tyInt64: awi(nkInt64Lit, rd(int64, x)) - of tyUInt: awi(nkUIntLit, rd(uint, x).biggestInt) - of tyUInt8: awi(nkUInt8Lit, rd(uint8, x).biggestInt) - of tyUInt16: awi(nkUInt16Lit, rd(uint16, x).biggestInt) - of tyUInt32: awi(nkUInt32Lit, rd(uint32, x).biggestInt) - of tyUInt64: awi(nkUInt64Lit, rd(uint64, x).biggestInt) + of tyUInt: awi(nkUIntLit, rd(uint, x).BiggestInt) + of tyUInt8: awi(nkUInt8Lit, rd(uint8, x).BiggestInt) + of tyUInt16: awi(nkUInt16Lit, rd(uint16, x).BiggestInt) + of tyUInt32: awi(nkUInt32Lit, rd(uint32, x).BiggestInt) + of tyUInt64: awi(nkUInt64Lit, rd(uint64, x).BiggestInt) of tyEnum: case typ.getSize - of 1: awi(nkIntLit, rd(uint8, x).biggestInt) - of 2: awi(nkIntLit, rd(uint16, x).biggestInt) - of 4: awi(nkIntLit, rd(int32, x).biggestInt) - of 8: awi(nkIntLit, rd(int64, x).biggestInt) + of 1: awi(nkIntLit, rd(uint8, x).BiggestInt) + of 2: awi(nkIntLit, rd(uint16, x).BiggestInt) + of 4: awi(nkIntLit, rd(int32, x).BiggestInt) + of 8: awi(nkIntLit, rd(int64, x).BiggestInt) else: - GlobalError(n.info, "cannot map value from FFI (tyEnum, tySet)") + globalError(n.info, "cannot map value from FFI (tyEnum, tySet)") of tyFloat: awf(nkFloatLit, rd(float, x)) of tyFloat32: awf(nkFloat32Lit, rd(float32, x)) of tyFloat64: awf(nkFloat64Lit, rd(float64, x)) @@ -374,7 +374,7 @@ proc unpack(x: pointer, typ: PType, n: PNode): PNode = n.sons[0] = unpack(p, typ.sons[0], n.sons[0]) result = n else: - GlobalError(n.info, "cannot map value from FFI " & typeToString(typ)) + globalError(n.info, "cannot map value from FFI " & typeToString(typ)) of tyObject, tyTuple: result = unpackObject(x, typ, n) of tyArray, tyArrayConstr: @@ -391,7 +391,7 @@ proc unpack(x: pointer, typ: PType, n: PNode): PNode = result = unpack(x, typ.sons[0], n) else: # XXX what to do with 'array' here? - GlobalError(n.info, "cannot map value from FFI " & typeToString(typ)) + globalError(n.info, "cannot map value from FFI " & typeToString(typ)) proc fficast*(x: PNode, destTyp: PType): PNode = if x.kind == nkPtrLit and x.typ.kind in {tyPtr, tyRef, tyVar, tyPointer, @@ -414,7 +414,7 @@ proc fficast*(x: PNode, destTyp: PType): PNode = dealloc a proc callForeignFunction*(call: PNode): PNode = - InternalAssert call.sons[0].kind == nkPtrLit + internalAssert call.sons[0].kind == nkPtrLit var cif: TCif var sig: TParamList @@ -422,12 +422,12 @@ proc callForeignFunction*(call: PNode): PNode = for i in 1..call.len-1: sig[i-1] = mapType(call.sons[i].typ) if sig[i-1].isNil: - GlobalError(call.info, "cannot map FFI type") + globalError(call.info, "cannot map FFI type") let typ = call.sons[0].typ if prep_cif(cif, mapCallConv(typ.callConv, call.info), cuint(call.len-1), mapType(typ.sons[0]), sig) != OK: - GlobalError(call.info, "error in FFI call") + globalError(call.info, "error in FFI call") var args: TArgList let fn = cast[pointer](call.sons[0].intVal) From 31f3034c3a93a7f056863db51ede65d2ebf66db6 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 1 Feb 2014 23:57:09 +0100 Subject: [PATCH 282/326] case consistency for evalffi --- compiler/main.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/main.nim b/compiler/main.nim index cdea7b5ca9..f6d11d960a 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -135,7 +135,7 @@ proc interactivePasses = #setTarget(osNimrodVM, cpuNimrodVM) initDefines() defineSymbol("nimrodvm") - when hasFFI: DefineSymbol("nimffi") + when hasFFI: defineSymbol("nimffi") registerPass(verbosePass) registerPass(semPass) registerPass(evalPass) @@ -324,7 +324,7 @@ proc mainCommand* = wantMainModule() when hasTinyCBackend: extccomp.setCC("tcc") - CommandCompileToC() + commandCompileToC() else: rawMessage(errInvalidCommandX, command) of "js", "compiletojs": @@ -450,7 +450,8 @@ proc mainCommand* = echo " tries : ", gCacheTries echo " misses: ", gCacheMisses echo " int tries: ", gCacheIntTries - echo " efficiency: ", formatFloat(1-(gCacheMisses.float/gCacheTries.float), ffDecimal, 3) + echo " efficiency: ", formatFloat(1-(gCacheMisses.float/gCacheTries.float), + ffDecimal, 3) when SimiluateCaasMemReset: resetMemory() From 0b8f68def0130ca381c2b2f16cc9b62918e32301 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sat, 1 Feb 2014 23:58:20 +0100 Subject: [PATCH 283/326] tstringinterp almost working --- compiler/vm.nim | 16 ++++++-- compiler/vmdef.nim | 2 + compiler/vmgen.nim | 94 ++++++++++++++++++++++++++++------------------ 3 files changed, 72 insertions(+), 40 deletions(-) diff --git a/compiler/vm.nim b/compiler/vm.nim index 26aab30680..bc5320d9d6 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -337,7 +337,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = asgnRef(c.globals.sons[instr.regBx-wordExcess-1], regs[ra]) of opcWrGlobal: asgnComplex(c.globals.sons[instr.regBx-wordExcess-1], regs[ra]) - of opcLdArr: + of opcLdArr, opcLdArrRef: # a = b[c] let rb = instr.regB let rc = instr.regC @@ -348,7 +348,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = assert regs[rb].kind != nkMetaNode let src = regs[rb] if src.kind notin {nkEmpty..nkNilLit} and idx <% src.len: - asgnComplex(regs[ra], src.sons[idx]) + if instr.opcode == opcLdArrRef and false: + # XXX activate when seqs are fixed + asgnRef(regs[ra], src.sons[idx]) + else: + asgnComplex(regs[ra], src.sons[idx]) else: stackTrace(c, tos, pc, errIndexOutOfBounds) of opcLdStrIdx: @@ -379,9 +383,15 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # a = b.c let rb = instr.regB let rc = instr.regC - # XXX this creates a wrong alias #Message(c.debug[pc], warnUser, $regs[rb].safeLen & " " & $rc) asgnComplex(regs[ra], regs[rb].sons[rc]) + of opcLdObjRef: + # a = b.c + let rb = instr.regB + let rc = instr.regC + # XXX activate when seqs are fixed + asgnComplex(regs[ra], regs[rb].sons[rc]) + #asgnRef(regs[ra], regs[rb].sons[rc]) of opcWrObj: # a.b = c let rb = instr.regB diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 480c7f31b9..87159c8136 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -34,9 +34,11 @@ type opcAsgnComplex, opcLdArr, # a = b[c] + opcLdArrRef, opcWrArr, # a[b] = c opcWrArrRef, opcLdObj, # a = b.c + opcLdObjRef, opcWrObj, # a.b = c opcWrObjRef, opcAddr, diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index a41e60e7d0..ff479b74a3 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -13,9 +13,18 @@ import unsigned, strutils, ast, astalgo, types, msgs, renderer, vmdef, trees, intsets, rodread, magicsys, options +from os import splitFile + when hasFFI: import evalffi +type + TGenFlag = enum gfNone, gfAddrOf + TGenFlags = set[TGenFlag] + +proc debugInfo(info: TLineInfo): string = + result = info.toFilename.splitFile.name & ":" & $info.line + proc codeListing(c: PCtx, result: var string, start=0) = # first iteration: compute all necessary labels: var jumpTargets = initIntSet() @@ -44,7 +53,7 @@ proc codeListing(c: PCtx, result: var string, start=0) = else: result.addf("\t$#\tr$#, $#", ($opc).substr(3), x.regA, x.regBx-wordExcess) result.add("\t#") - result.add(toFileLine(c.debug[i])) + result.add(debugInfo(c.debug[i])) result.add("\n") inc i @@ -190,20 +199,20 @@ template withBlock(labl: PSym; body: stmt) {.immediate, dirty.} = body popBlock(c, oldLen) -proc gen(c: PCtx; n: PNode; dest: var TDest) -proc gen(c: PCtx; n: PNode; dest: TRegister) = +proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) +proc gen(c: PCtx; n: PNode; dest: TRegister; flags: TGenFlags = {}) = var d: TDest = dest - gen(c, n, d) + gen(c, n, d, flags) internalAssert d == dest -proc gen(c: PCtx; n: PNode) = +proc gen(c: PCtx; n: PNode; flags: TGenFlags = {}) = var tmp: TDest = -1 - gen(c, n, tmp) + gen(c, n, tmp, flags) #if n.typ.isEmptyType: InternalAssert tmp < 0 -proc genx(c: PCtx; n: PNode): TRegister = +proc genx(c: PCtx; n: PNode; flags: TGenFlags = {}): TRegister = var tmp: TDest = -1 - gen(c, n, tmp) + gen(c, n, tmp, flags) internalAssert tmp >= 0 result = TRegister(tmp) @@ -477,8 +486,8 @@ proc genNew(c: PCtx; n: PNode) = proc genNewSeq(c: PCtx; n: PNode) = let dest = if needsAsgnPatch(n.sons[1]): c.getTemp(n.sons[1].typ) else: c.genx(n.sons[1]) - c.gABx(n, opcNewSeq, dest, c.genType(n.sons[1].typ.skipTypes(abstractVar))) let tmp = c.genx(n.sons[2]) + c.gABx(n, opcNewSeq, dest, c.genType(n.sons[1].typ.skipTypes(abstractVar))) c.gABx(n, opcNewSeq, tmp, 0) c.freeTemp(tmp) c.genAsgnPatch(n.sons[1], dest) @@ -528,6 +537,14 @@ proc genBinaryStmt(c: PCtx; n: PNode; opc: TOpcode) = c.gABC(n, opc, dest, tmp, 0) c.freeTemp(tmp) +proc genBinaryStmtVar(c: PCtx; n: PNode; opc: TOpcode) = + let + dest = c.genx(n.sons[1], {gfAddrOf}) + tmp = c.genx(n.sons[2]) + c.gABC(n, opc, dest, tmp, 0) + #c.genAsgnPatch(n.sons[1], dest) + c.freeTemp(tmp) + proc genUnaryStmt(c: PCtx; n: PNode; opc: TOpcode) = let tmp = c.genx(n.sons[1]) c.gABC(n, opc, tmp, 0, 0) @@ -754,13 +771,13 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = c.freeTempRange(x, n.len-1) of mAppendStrCh: unused(n, dest) - genBinaryStmt(c, n, opcAddStrCh) + genBinaryStmtVar(c, n, opcAddStrCh) of mAppendStrStr: unused(n, dest) - genBinaryStmt(c, n, opcAddStrStr) + genBinaryStmtVar(c, n, opcAddStrStr) of mAppendSeqElem: unused(n, dest) - genBinaryStmt(c, n, opcAddSeqElem) + genBinaryStmtVar(c, n, opcAddSeqElem) of mParseExprToAst: genUnaryABC(c, n, dest, opcParseExprToAst) of mParseStmtToAst: @@ -890,12 +907,14 @@ proc skipDeref(n: PNode): PNode = else: result = n -proc genAddrDeref(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode) = +proc genAddrDeref(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode; + flags: TGenFlags) = # a nop for certain types + let flags = if opc == opcAddr: flags+{gfAddrOf} else: flags if unneededIndirection(n.sons[0]): - gen(c, n.sons[0], dest) + gen(c, n.sons[0], dest, flags) else: - let tmp = c.genx(n.sons[0]) + let tmp = c.genx(n.sons[0], flags) if dest < 0: dest = c.getTemp(n.typ) gABC(c, n, opc, dest, tmp) c.freeTemp(tmp) @@ -1026,26 +1045,27 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = cannotEval(n) #InternalError(n.info, s.name.s & " " & $s.position) -proc genAccess(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode) = - let a = c.genx(n.sons[0]) - let b = c.genx(n.sons[1]) +proc genAccess(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode; + flags: TGenFlags) = + let a = c.genx(n.sons[0], flags) + let b = c.genx(n.sons[1], {}) if dest < 0: dest = c.getTemp(n.typ) - c.gABC(n, opc, dest, a, b) + c.gABC(n, (if gfAddrOf in flags: succ(opc) else: opc), dest, a, b) c.freeTemp(a) c.freeTemp(b) -proc genObjAccess(c: PCtx; n: PNode; dest: var TDest) = - genAccess(c, n, dest, opcLdObj) +proc genObjAccess(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) = + genAccess(c, n, dest, opcLdObj, flags) -proc genCheckedObjAccess(c: PCtx; n: PNode; dest: var TDest) = +proc genCheckedObjAccess(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) = # XXX implement field checks! - genAccess(c, n.sons[0], dest, opcLdObj) + genAccess(c, n.sons[0], dest, opcLdObj, flags) -proc genArrAccess(c: PCtx; n: PNode; dest: var TDest) = +proc genArrAccess(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) = if n.sons[0].typ.skipTypes(abstractVarRange).kind in {tyString, tyCString}: - genAccess(c, n, dest, opcLdStrIdx) + genAccess(c, n, dest, opcLdStrIdx, {}) else: - genAccess(c, n, dest, opcLdArr) + genAccess(c, n, dest, opcLdArr, flags) proc getNullValue*(typ: PType, info: TLineInfo): PNode proc getNullValueAux(obj: PNode, result: PNode) = @@ -1222,7 +1242,7 @@ proc genTupleConstr(c: PCtx, n: PNode, dest: var TDest) = proc genProc*(c: PCtx; s: PSym): int -proc gen(c: PCtx; n: PNode; dest: var TDest) = +proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) = case n.kind of nkSym: let s = n.sym @@ -1271,11 +1291,11 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = of nkAsgn, nkFastAsgn: unused(n, dest) genAsgn(c, n.sons[0], n.sons[1], n.kind == nkAsgn) - of nkDotExpr: genObjAccess(c, n, dest) - of nkCheckedFieldExpr: genCheckedObjAccess(c, n, dest) - of nkBracketExpr: genArrAccess(c, n, dest) - of nkDerefExpr, nkHiddenDeref: genAddrDeref(c, n, dest, opcDeref) - of nkAddr, nkHiddenAddr: genAddrDeref(c, n, dest, opcAddr) + of nkDotExpr: genObjAccess(c, n, dest, flags) + of nkCheckedFieldExpr: genCheckedObjAccess(c, n, dest, flags) + of nkBracketExpr: genArrAccess(c, n, dest, flags) + of nkDerefExpr, nkHiddenDeref: genAddrDeref(c, n, dest, opcDeref, flags) + of nkAddr, nkHiddenAddr: genAddrDeref(c, n, dest, opcAddr, flags) of nkWhenStmt, nkIfStmt, nkIfExpr: genIf(c, n, dest) of nkCaseStmt: genCase(c, n, dest) of nkWhileStmt: @@ -1298,7 +1318,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest) = of nkStmtListExpr: let L = n.len-1 for i in 0 .. <L: gen(c, n.sons[i]) - gen(c, n.sons[L], dest) + gen(c, n.sons[L], dest, flags) of nkDiscardStmt: unused(n, dest) gen(c, n.sons[0]) @@ -1460,9 +1480,9 @@ proc genProc(c: PCtx; s: PSym): int = c.gABC(body, opcEof, eofInstr.regA) c.optimizeJumps(result) s.offset = c.prc.maxSlots - #if s.name.s == "rawGet": - # c.echoCode(result) - # echo renderTree(body) + if s.name.s == "concatStyleInterpolation": + c.echoCode(result) + echo renderTree(body) c.prc = oldPrc else: c.prc.maxSlots = s.offset From bd9f6505c18a3d90248be49e1146cddc297a66d2 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:00:17 +0100 Subject: [PATCH 284/326] 'discard' instead of 'nil' for system.nim --- lib/system.nim | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 09e44a45a9..2acb989c5f 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2333,29 +2333,29 @@ when not defined(JS): #and not defined(NimrodVM): elif defined(JS): # Stubs: - proc nimGCvisit(d: pointer, op: int) {.compilerRtl.} = nil + proc nimGCvisit(d: pointer, op: int) {.compilerRtl.} = discard - proc GC_disable() = nil - proc GC_enable() = nil - proc GC_fullCollect() = nil - proc GC_setStrategy(strategy: TGC_Strategy) = nil - proc GC_enableMarkAndSweep() = nil - proc GC_disableMarkAndSweep() = nil + proc GC_disable() = discard + proc GC_enable() = discard + proc GC_fullCollect() = discard + proc GC_setStrategy(strategy: TGC_Strategy) = discard + proc GC_enableMarkAndSweep() = discard + proc GC_disableMarkAndSweep() = discard proc GC_getStatistics(): string = return "" proc getOccupiedMem(): int = return -1 proc getFreeMem(): int = return -1 proc getTotalMem(): int = return -1 - proc dealloc(p: pointer) = nil - proc alloc(size: int): pointer = nil - proc alloc0(size: int): pointer = nil - proc realloc(p: Pointer, newsize: int): pointer = nil + proc dealloc(p: pointer) = discard + proc alloc(size: int): pointer = discard + proc alloc0(size: int): pointer = discard + proc realloc(p: Pointer, newsize: int): pointer = discard - proc allocShared(size: int): pointer = nil - proc allocShared0(size: int): pointer = nil - proc deallocShared(p: pointer) = nil - proc reallocShared(p: pointer, newsize: int): pointer = nil + proc allocShared(size: int): pointer = discard + proc allocShared0(size: int): pointer = discard + proc deallocShared(p: pointer) = discard + proc reallocShared(p: pointer, newsize: int): pointer = discard when defined(JS): include "system/jssys" @@ -2490,11 +2490,11 @@ proc staticRead*(filename: string): string {.magic: "Slurp".} ## ``slurp`` is an alias for ``staticRead``. proc gorge*(command: string, input = ""): string {. - magic: "StaticExec".} = nil + magic: "StaticExec".} = discard ## This is an alias for ``staticExec``. proc staticExec*(command: string, input = ""): string {. - magic: "StaticExec".} = nil + magic: "StaticExec".} = discard ## Executes an external process at compile-time. ## if `input` is not an empty string, it will be passed as a standard input ## to the executed program. @@ -2561,7 +2561,7 @@ proc instantiationInfo*(index = -1, fullPaths = false): tuple[ ## $pos.line, astToStr(code)] ## assert false, "A test expecting failure succeeded?" ## except exception: - ## nil + ## discard ## ## proc tester(pos: int): int = ## let From 70eff919cd6fa7a0f1443125ba29706328117046 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:00:56 +0100 Subject: [PATCH 285/326] only 1 argument allowed for command expressions --- compiler/parser.nim | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/compiler/parser.nim b/compiler/parser.nim index 3765557b9d..4497e360aa 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -672,12 +672,14 @@ proc primarySuffix(p: var TParser, r: PNode): PNode = let a = result result = newNodeP(nkCommand, p) addSon(result, a) - while p.tok.tokType != tkEof: - let a = parseExpr(p) - addSon(result, a) - if p.tok.tokType != tkComma: break - getTok(p) - optInd(p, a) + addSon result, parseExpr(p) + when false: + while p.tok.tokType != tkEof: + let a = parseExpr(p) + addSon(result, a) + if p.tok.tokType != tkComma: break + getTok(p) + optInd(p, a) if p.tok.tokType == tkDo: parseDoBlocks(p, result) else: @@ -1103,7 +1105,9 @@ proc parseExprStmt(p: var TParser): PNode = #| doBlocks #| / macroColon #| ))? + inc p.inPragma var a = simpleExpr(p) + dec p.inPragma if p.tok.tokType == tkEquals: getTok(p) optInd(p, result) From e647428539f829b1e761b85739da1af9f1625a2b Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:01:33 +0100 Subject: [PATCH 286/326] case consistency for dynlib.nim --- lib/pure/dynlib.nim | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/pure/dynlib.nim b/lib/pure/dynlib.nim index a64b7f1386..3ed00fdb29 100644 --- a/lib/pure/dynlib.nim +++ b/lib/pure/dynlib.nim @@ -14,15 +14,15 @@ type TLibHandle* = pointer ## a handle to a dynamically loaded library -proc LoadLib*(path: string): TLibHandle +proc loadLib*(path: string): TLibHandle ## loads a library from `path`. Returns nil if the library could not ## be loaded. -proc LoadLib*(): TLibHandle +proc loadLib*(): TLibHandle ## gets the handle from the current executable. Returns nil if the ## library could not be loaded. -proc UnloadLib*(lib: TLibHandle) +proc unloadLib*(lib: TLibHandle) ## unloads the library `lib` proc raiseInvalidLibrary*(name: cstring) {.noinline, noreturn.} = @@ -60,9 +60,9 @@ when defined(posix): proc dlsym(lib: TLibHandle, name: cstring): pointer {. importc, header: "<dlfcn.h>".} - proc LoadLib(path: string): TLibHandle = return dlopen(path, RTLD_NOW) - proc LoadLib(): TLibHandle = return dlopen(nil, RTLD_NOW) - proc UnloadLib(lib: TLibHandle) = dlclose(lib) + proc loadLib(path: string): TLibHandle = return dlopen(path, RTLD_NOW) + proc loadLib(): TLibHandle = return dlopen(nil, RTLD_NOW) + proc unloadLib(lib: TLibHandle) = dlclose(lib) proc symAddr(lib: TLibHandle, name: cstring): pointer = return dlsym(lib, name) @@ -78,14 +78,14 @@ elif defined(windows) or defined(dos): 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): pointer {. + proc getProcAddress(lib: THINSTANCE, name: cstring): pointer {. importc: "GetProcAddress", header: "<windows.h>", stdcall.} - proc LoadLib(path: string): TLibHandle = + proc loadLib(path: string): TLibHandle = result = cast[TLibHandle](winLoadLibrary(path)) - proc LoadLib(): TLibHandle = + proc loadLib(): TLibHandle = result = cast[TLibHandle](winLoadLibrary(nil)) - proc UnloadLib(lib: TLibHandle) = FreeLibrary(cast[THINSTANCE](lib)) + proc unloadLib(lib: TLibHandle) = FreeLibrary(cast[THINSTANCE](lib)) proc symAddr(lib: TLibHandle, name: cstring): pointer = result = GetProcAddress(cast[THINSTANCE](lib), name) From 7fe340e7bc309be4751e9719f9966afd1ef566cb Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:02:08 +0100 Subject: [PATCH 287/326] year 2014 --- copying.txt | 2 +- readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/copying.txt b/copying.txt index 0ff6b7d876..4041ca0272 100644 --- a/copying.txt +++ b/copying.txt @@ -1,7 +1,7 @@ =============================================================================== Nimrod -- a Compiler for Nimrod. http://nimrod-code.org/ -Copyright (C) 2004-2013 Andreas Rumpf. All rights reserved. +Copyright (C) 2004-2014 Andreas Rumpf. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/readme.md b/readme.md index 8d42c66db8..3eaef0b355 100644 --- a/readme.md +++ b/readme.md @@ -61,5 +61,5 @@ allowing you to create commercial applications. Read copying.txt for more details. -Copyright (c) 2004-2013 Andreas Rumpf. +Copyright (c) 2004-2014 Andreas Rumpf. All rights reserved. From 43d1181c0465587f0b354a314b676c1daaec79be Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:02:39 +0100 Subject: [PATCH 288/326] year 2014 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 8d42c66db8..3eaef0b355 100644 --- a/readme.txt +++ b/readme.txt @@ -61,5 +61,5 @@ allowing you to create commercial applications. Read copying.txt for more details. -Copyright (c) 2004-2013 Andreas Rumpf. +Copyright (c) 2004-2014 Andreas Rumpf. All rights reserved. From 4b47bee65407a1ebde5e804cd77fc242c3fa7152 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:02:57 +0100 Subject: [PATCH 289/326] deactivated debug output --- compiler/vmgen.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index ff479b74a3..e0ff5b2350 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1480,9 +1480,9 @@ proc genProc(c: PCtx; s: PSym): int = c.gABC(body, opcEof, eofInstr.regA) c.optimizeJumps(result) s.offset = c.prc.maxSlots - if s.name.s == "concatStyleInterpolation": - c.echoCode(result) - echo renderTree(body) + #if s.name.s == "concatStyleInterpolation": + # c.echoCode(result) + # echo renderTree(body) c.prc = oldPrc else: c.prc.maxSlots = s.offset From 3b5c0b27ce2578eceb97128239112653d592707f Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:03:30 +0100 Subject: [PATCH 290/326] case consistency for excpt.nim --- lib/system/excpt.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index a3f6669d42..e50ba7b9fa 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -23,7 +23,7 @@ else: proc MessageBoxA(hWnd: cint, lpText, lpCaption: cstring, uType: int): int32 {. header: "<windows.h>", nodecl.} - proc writeToStdErr(msg: CString) = + proc writeToStdErr(msg: cstring) = discard MessageBoxA(0, msg, nil, 0) proc showErrorMessage(data: cstring) = From a5098f1fda974ec8420f3a2f6691077e4aa93484 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:03:57 +0100 Subject: [PATCH 291/326] fixed cases --- tests/macros/tstringinterp.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/macros/tstringinterp.nim b/tests/macros/tstringinterp.nim index f030213e0f..a500ed56ec 100644 --- a/tests/macros/tstringinterp.nim +++ b/tests/macros/tstringinterp.nim @@ -9,7 +9,7 @@ proc concat(strings: varargs[string]): string = result = newString(0) for s in items(strings): result.add(s) -template ProcessInterpolations(e: expr) = +template processInterpolations(e: expr) = var s = e[1].strVal for f in interpolatedFragments(s): case f.kind @@ -35,7 +35,7 @@ macro formatStyleInterpolation(e: expr): expr = proc addDollar() = formatString.add("$$") - ProcessInterpolations(e) + processInterpolations(e) result = parseExpr("\"x\" % [y]") result[1].strVal = formatString @@ -50,7 +50,7 @@ macro concatStyleInterpolation(e: expr): expr = proc addExpr(e: PNimrodNode) = args.add(e) proc addDollar() = args.add(newStrLitNode"$") - ProcessInterpolations(e) + processInterpolations(e) result = newCall("concat", args) From 38697234f66f98fad953085412b2ce218521427e Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:35:26 +0100 Subject: [PATCH 292/326] mark and sweep GC compiles with --cs:partial --- lib/system/gc_ms.nim | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/system/gc_ms.nim b/lib/system/gc_ms.nim index 2e35969857..e78a4e5cde 100644 --- a/lib/system/gc_ms.nim +++ b/lib/system/gc_ms.nim @@ -1,7 +1,7 @@ # # # Nimrod's Runtime Library -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -59,11 +59,11 @@ var gch {.rtlThreadVar.}: TGcHeap when not defined(useNimRtl): - InstantiateForRegion(gch.region) + instantiateForRegion(gch.region) template acquire(gch: TGcHeap) = when hasThreadSupport and hasSharedHeap: - AcquireSys(HeapLock) + acquireSys(HeapLock) template release(gch: TGcHeap) = when hasThreadSupport and hasSharedHeap: @@ -90,7 +90,7 @@ proc extGetCellType(c: pointer): PNimType {.compilerproc.} = # used for code generation concerning debugging result = usrToCell(c).typ -proc unsureAsgnRef(dest: ppointer, src: pointer) {.inline.} = +proc unsureAsgnRef(dest: PPointer, src: pointer) {.inline.} = dest[] = src proc internRefcount(p: pointer): int {.exportc: "getRefcount".} = @@ -114,10 +114,10 @@ when BitsPerPage mod (sizeof(int)*8) != 0: # forward declarations: proc collectCT(gch: var TGcHeap) -proc IsOnStack*(p: pointer): bool {.noinline.} +proc isOnStack*(p: pointer): bool {.noinline.} proc forAllChildren(cell: PCell, op: TWalkOp) proc doOperation(p: pointer, op: TWalkOp) -proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) +proc forAllChildrenAux(dest: pointer, mt: PNimType, op: TWalkOp) # we need the prototype here for debugging purposes proc prepareDealloc(cell: PCell) = @@ -162,19 +162,19 @@ proc forAllSlotsAux(dest: pointer, n: ptr TNimNode, op: TWalkOp) = if m != nil: forAllSlotsAux(dest, m, op) of nkNone: sysAssert(false, "forAllSlotsAux") -proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) = +proc forAllChildrenAux(dest: pointer, mt: PNimType, op: TWalkOp) = var d = cast[TAddress](dest) if dest == nil: return # nothing to do if ntfNoRefs notin mt.flags: - case mt.Kind + case mt.kind of tyRef, tyString, tySequence: # leaf: - doOperation(cast[ppointer](d)[], op) + doOperation(cast[PPointer](d)[], op) of tyObject, tyTuple: forAllSlotsAux(dest, mt.node, op) 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) - else: nil + else: discard proc forAllChildren(cell: PCell, op: TWalkOp) = gcAssert(cell != nil, "forAllChildren: 1") @@ -184,7 +184,7 @@ proc forAllChildren(cell: PCell, op: TWalkOp) = if marker != nil: marker(cellToUsr(cell), op.int) else: - case cell.typ.Kind + case cell.typ.kind of tyRef: # common case forAllChildrenAux(cellToUsr(cell), cell.typ.base, op) of tySequence: @@ -194,7 +194,7 @@ proc forAllChildren(cell: PCell, op: TWalkOp) = for i in 0..s.len-1: forAllChildrenAux(cast[pointer](d +% i *% cell.typ.base.size +% GenericSeqSize), cell.typ.base, op) - else: nil + else: discard proc rawNewObj(typ: PNimType, size: int, gch: var TGcHeap): pointer = # generates a new object and sets its reference counter to 0 @@ -466,7 +466,7 @@ else: sp = sp +% sizeof(pointer)*8 # last few entries: while sp <=% max: - gcMark(gch, cast[ppointer](sp)[]) + gcMark(gch, cast[PPointer](sp)[]) sp = sp +% sizeof(pointer) # ---------------------------------------------------------------------------- @@ -505,7 +505,7 @@ when not defined(useNimRtl): else: dec(gch.recGcLock) - proc GC_setStrategy(strategy: TGC_Strategy) = nil + proc GC_setStrategy(strategy: TGC_Strategy) = discard proc GC_enableMarkAndSweep() = gch.cycleThreshold = InitialThreshold From d29aa4c5ac6950a9b8c53bedeb9dd0dd9b4f64a2 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 00:41:04 +0100 Subject: [PATCH 293/326] new tester produces json output --- koch.nim | 5 +- tests/specials.nim | 238 ------------------- tests/testament/backend.nim | 12 +- tests/testament/htmlgen.nim | 19 ++ tests/testament/tester.nim | 15 +- tests/tester.nim | 457 ------------------------------------ todo.txt | 5 +- 7 files changed, 30 insertions(+), 721 deletions(-) delete mode 100644 tests/specials.nim delete mode 100644 tests/tester.nim diff --git a/koch.nim b/koch.nim index 35a86a597c..4d2b3bfb71 100644 --- a/koch.nim +++ b/koch.nim @@ -266,8 +266,9 @@ proc tests(args: string) = # we compile the tester with taintMode:on to have a basic # taint mode test :-) exec "nimrod cc --taintMode:on tests/testament/tester" - exec quoteShell(getCurrentDir() / "tests/testament/tester".exe) & " " & - (args|"all") + let tester = quoteShell(getCurrentDir() / "tests/testament/tester".exe) + exec tester & " " & (args|"all") + exec tester & " html" proc temp(args: string) = var output = "compiler" / "nimrod".exe diff --git a/tests/specials.nim b/tests/specials.nim deleted file mode 100644 index 9ced66bbb9..0000000000 --- a/tests/specials.nim +++ /dev/null @@ -1,238 +0,0 @@ -# -# -# Nimrod Tester -# (c) Copyright 2013 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -## Include for the tester that contains test suites that test special features -## of the compiler. - -# included from tester.nim -# ---------------- ROD file tests --------------------------------------------- - -const - rodfilesDir = "tests/rodfiles" - nimcacheDir = rodfilesDir / "nimcache" - -proc delNimCache() = - try: - removeDir(nimcacheDir) - except EOS: - echo "[Warning] could not delete: ", nimcacheDir - -proc runRodFiles(r: var TResults, options: string) = - template test(filename: expr): stmt = - runSingleTest(r, rodfilesDir / filename, options) - - delNimCache() - - # test basic recompilation scheme: - test "hallo" - test "hallo" - # test incremental type information: - test "hallo2" - delNimCache() - - # test type converters: - test "aconv" - test "bconv" - delNimCache() - - # test G, A, B example from the documentation; test init sections: - test "deada" - test "deada2" - delNimCache() - - # test method generation: - test "bmethods" - test "bmethods2" - delNimCache() - - # test generics: - test "tgeneric1" - test "tgeneric2" - delNimCache() - -proc compileRodFiles(r: var TResults, options: string) = - template test(filename: expr): stmt = - compileSingleTest(r, rodfilesDir / filename, options) - - delNimCache() - # test DLL interfacing: - test "gtkex1" - test "gtkex2" - delNimCache() - -# --------------------- DLL generation tests ---------------------------------- - -proc safeCopyFile(src, dest: string) = - try: - copyFile(src, dest) - except EOS: - echo "[Warning] could not copy: ", src, " to ", dest - -proc runBasicDLLTest(c, r: var TResults, options: string) = - compileSingleTest c, "lib/nimrtl.nim", options & " --app:lib -d:createNimRtl" - compileSingleTest c, "tests/dll/server.nim", - options & " --app:lib -d:useNimRtl" - - when defined(Windows): - # windows looks in the dir of the exe (yay!): - var nimrtlDll = DynlibFormat % "nimrtl" - safeCopyFile("lib" / nimrtlDll, "tests/dll" / nimrtlDll) - else: - # posix relies on crappy LD_LIBRARY_PATH (ugh!): - var libpath = getenv"LD_LIBRARY_PATH".string - if peg"\i '/nimrod' (!'/')* '/lib'" notin libpath: - echo "[Warning] insufficient LD_LIBRARY_PATH" - var serverDll = DynlibFormat % "server" - safeCopyFile("tests/dll" / serverDll, "lib" / serverDll) - - runSingleTest r, "tests/dll/client.nim", options & " -d:useNimRtl" - -proc runDLLTests(r: var TResults, options: string) = - # dummy compile result: - var c = initResults() - - runBasicDLLTest c, r, options - runBasicDLLTest c, r, options & " -d:release" - runBasicDLLTest c, r, options & " --gc:boehm" - runBasicDLLTest c, r, options & " -d:release --gc:boehm" - -proc compileDLLTests(r: var TResults, options: string) = - # dummy run result: - var c = initResults() - - runBasicDLLTest r, c, options - runBasicDLLTest r, c, options & " -d:release" - runBasicDLLTest r, c, options & " --gc:boehm" - runBasicDLLTest r, c, options & " -d:release --gc:boehm" - -# ------------------------------ GC tests ------------------------------------- - -proc runGcTests(r: var TResults, options: string) = - template test(filename: expr): stmt = - runSingleTest(r, "tests/gc" / filename, options) - runSingleTest(r, "tests/gc" / filename, options & " -d:release") - runSingleTest(r, "tests/gc" / filename, options & - " -d:release -d:useRealtimeGC") - runSingleTest(r, "tests/gc" / filename, options & - " --gc:markAndSweep") - runSingleTest(r, "tests/gc" / filename, options & - " -d:release --gc:markAndSweep") - - test "gcbench" - test "gcleak" - test "gcleak2" - test "gctest" - test "gcleak3" - test "weakrefs" - test "cycleleak" - test "closureleak" - -# ------------------------- threading tests ----------------------------------- - -proc runThreadTests(r: var TResults, options: string) = - template test(filename: expr): stmt = - runSingleTest(r, "tests/threads" / filename, options) - runSingleTest(r, "tests/threads" / filename, options & " -d:release") - runSingleTest(r, "tests/threads" / filename, options & " --tlsEmulation:on") - - test "tactors" - test "tactors2" - test "threadex" - # deactivated because output capturing still causes problems sometimes: - #test "trecursive_actor" - #test "threadring" - #test "tthreadanalysis" - #test "tthreadsort" - -proc rejectThreadTests(r: var TResults, options: string) = - rejectSingleTest(r, "tests/threads/tthreadanalysis2", options) - rejectSingleTest(r, "tests/threads/tthreadanalysis3", options) - rejectSingleTest(r, "tests/threads/tthreadheapviolation1", options) - -# ------------------------- IO tests ------------------------------------------ - -proc runIOTests(r: var TResults, options: string) = - # We need readall_echo to be compiled for this test to run. - # dummy compile result: - var c = initResults() - compileSingleTest(c, "tests/system/helpers/readall_echo", options) - runSingleTest(r, "tests/system/io", options) - -# ------------------------- debugger tests ------------------------------------ - -proc compileDebuggerTests(r: var TResults, options: string) = - compileSingleTest(r, "tools/nimgrep", options & - " --debugger:on") - -# ------------------------- JS tests ------------------------------------------ - -proc runJsTests(r: var TResults, options: string) = - template test(filename: expr): stmt = - runSingleTest(r, filename, options & " -d:nodejs", targetJS) - runSingleTest(r, filename, options & " -d:nodejs -d:release", targetJS) - - for t in os.walkFiles("tests/js/t*.nim"): - test(t) - for testfile in ["texceptions", "texcpt1", "texcsub", "tfinally", - "tfinally2", "tfinally3", "tactiontable", "tmultim1", - "tmultim3", "tmultim4"]: - test "tests/run/" & testfile & ".nim" - -# ------------------------- register special tests here ----------------------- -proc runSpecialTests(r: var TResults, options: string) = - runRodFiles(r, options) - #runDLLTests(r, options) - runGCTests(r, options) - runThreadTests(r, options & " --threads:on") - runIOTests(r, options) - - for t in os.walkFiles("tests/patterns/t*.nim"): - runSingleTest(r, t, options) - for t in ["lib/packages/docutils/highlite"]: - runSingleTest(r, t, options) - -proc rejectSpecialTests(r: var TResults, options: string) = - rejectThreadTests(r, options) - -proc findMainFile(dir: string): string = - # finds the file belonging to ".nimrod.cfg"; if there is no such file - # it returns the some ".nim" file if there is only one: - const cfgExt = ".nimrod.cfg" - result = "" - var nimFiles = 0 - for kind, file in os.walkDir(dir): - if kind == pcFile: - if file.endsWith(cfgExt): return file[.. -(cfgExt.len+1)] & ".nim" - elif file.endsWith(".nim"): - if result.len == 0: result = file - inc nimFiles - if nimFiles != 1: result.setlen(0) - -proc compileManyLoc(r: var TResults, options: string) = - for kind, dir in os.walkDir("tests/manyloc"): - if kind == pcDir: - let mainfile = findMainFile(dir) - if mainfile != ".nim": - compileSingleTest(r, mainfile, options) - -proc compileSpecialTests(r: var TResults, options: string) = - compileRodFiles(r, options) - - compileSingleTest(r, "compiler/c2nim/c2nim.nim", options) - compileSingleTest(r, "compiler/pas2nim/pas2nim.nim", options) - - compileDLLTests(r, options) - compileDebuggerTests(r, options) - - compileManyLoc(r, options) - - #var given = callCompiler("nimrod i", "nimrod i", options) - #r.addResult("nimrod i", given.msg, if given.err: reFailure else: reSuccess) - #if not given.err: inc(r.passed) - diff --git a/tests/testament/backend.nim b/tests/testament/backend.nim index bc1f92eba7..5199bb9d6f 100644 --- a/tests/testament/backend.nim +++ b/tests/testament/backend.nim @@ -49,10 +49,10 @@ proc createDb() = # """, []) type - MachineId = distinct int64 + MachineId* = distinct int64 CommitId = distinct int64 -proc `$`(id: MachineId): string {.borrow.} +proc `$`*(id: MachineId): string {.borrow.} proc `$`(id: CommitId): string {.borrow.} var @@ -61,7 +61,7 @@ var proc `()`(cmd: string{lit}): string = cmd.execProcess.string.strip -proc getMachine: MachineId = +proc getMachine*(db: TDbConn): MachineId = var name = "hostname"() if name.len == 0: name = when defined(posix): getenv"HOSTNAME".string @@ -76,7 +76,7 @@ proc getMachine: MachineId = result = db.insertId(sql"insert into Machine(name, os, cpu) values (?,?,?)", name, system.hostOS, system.hostCPU).MachineId -proc getCommit: CommitId = +proc getCommit(db: TDbConn): CommitId = const commLen = "commit ".len let hash = "git log -n 1"()[commLen..commLen+10] let branch = "git symbolic-ref --short HEAD"() @@ -115,7 +115,7 @@ proc open*() = db = open(connection="testament.db", user="testament", password="", database="testament") createDb() - thisMachine = getMachine() - thisCommit = getCommit() + thisMachine = getMachine(db) + thisCommit = getCommit(db) proc close*() = close(db) diff --git a/tests/testament/htmlgen.nim b/tests/testament/htmlgen.nim index bc2d8bd37e..eb674a171a 100644 --- a/tests/testament/htmlgen.nim +++ b/tests/testament/htmlgen.nim @@ -159,3 +159,22 @@ proc generateHtml*(filename: string, commit: int) = outfile.write(HtmlEnd) close(db) close(outfile) + +proc generateJson*(filename: string, commit: int) = + const selRow = """select count(*), + sum(result = 'reSuccess'), + sum(result = 'reIgnored') + from TestResult + where [commit] = ? and machine = ? + order by category""" + var db = open(connection="testament.db", user="testament", password="", + database="testament") + let lastCommit = db.getCommit(commit) + + var outfile = open(filename, fmWrite) + + let data = db.getRow(sql(selRow), lastCommit, $backend.getMachine(db)) + + outfile.writeln("""{"total": $#, "passed": $#, "skipped": $#}""" % data) + close(db) + close(outfile) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 54a6de2d0b..fac97cf2ab 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -208,20 +208,6 @@ proc makeTest(test, options: string, cat: Category, action = actionCompile, include categories -proc toJson(res: TResults): PJsonNode = - result = newJObject() - result["total"] = newJInt(res.total) - result["passed"] = newJInt(res.passed) - result["skipped"] = newJInt(res.skipped) - -proc outputJson(reject, compile, run: TResults) = - var doc = newJObject() - doc["reject"] = toJson(reject) - doc["compile"] = toJson(compile) - doc["run"] = toJson(run) - var s = pretty(doc) - writeFile(jsonFile, s) - # proc runCaasTests(r: var TResults) = # for test, output, status, mode in caasTestsRunner(): # r.addResult(test, "", output & "-> " & $mode, @@ -259,6 +245,7 @@ proc main() = var commit = 0 discard parseInt(p.cmdLineRest.string, commit) generateHtml(resultsFile, commit) + generateJson(jsonFile, commit) else: quit usage diff --git a/tests/tester.nim b/tests/tester.nim deleted file mode 100644 index 0e125b1bbb..0000000000 --- a/tests/tester.nim +++ /dev/null @@ -1,457 +0,0 @@ -# -# -# Nimrod Tester -# (c) Copyright 2013 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -## This program verifies Nimrod against the testcases. - -import - parseutils, strutils, pegs, os, osproc, streams, parsecfg, browsers, json, - marshal, cgi, parseopt #, caas - -const - cmdTemplate = r"nimrod cc --hints:on $# $#" - resultsFile = "testresults.html" - jsonFile = "testresults.json" - Usage = "usage: tester [--print] " & - "reject|compile|run|" & - "merge|special|rodfiles| [nimrod options]\n" & - " or: tester test|comp|rej singleTest" - -type - TTestAction = enum - actionCompile, actionRun, actionReject - TResultEnum = enum - reNimrodcCrash, # nimrod compiler seems to have crashed - reMsgsDiffer, # error messages differ - reFilesDiffer, # expected and given filenames differ - reLinesDiffer, # expected and given line numbers differ - reOutputsDiffer, - reExitcodesDiffer, - reInvalidPeg, - reCodegenFailure, - reCodeNotFound, - reExeNotFound, - reIgnored, # test is ignored - reSuccess # test was successful - - TTarget = enum - targetC, targetCpp, targetObjC, targetJS - - TSpec = object - action: TTestAction - file, cmd: string - outp: string - line, exitCode: int - msg: string - ccodeCheck: string - err: TResultEnum - substr: bool - TResults = object - total, passed, skipped: int - data: string - -# ----------------------- Spec parser ---------------------------------------- - -when not defined(parseCfgBool): - # candidate for the stdlib: - proc parseCfgBool(s: string): bool = - case normalize(s) - of "y", "yes", "true", "1", "on": result = true - of "n", "no", "false", "0", "off": result = false - else: raise newException(EInvalidValue, "cannot interpret as a bool: " & s) - -proc extractSpec(filename: string): string = - const tripleQuote = "\"\"\"" - var x = readFile(filename).string - var a = x.find(tripleQuote) - var b = x.find(tripleQuote, a+3) - # look for """ only in the first section - if a >= 0 and b > a and a < 40: - result = x.substr(a+3, b-1).replace("'''", tripleQuote) - else: - #echo "warning: file does not contain spec: " & filename - result = "" - -when not defined(nimhygiene): - {.pragma: inject.} - -template parseSpecAux(fillResult: stmt) {.immediate.} = - var ss = newStringStream(extractSpec(filename)) - var p {.inject.}: TCfgParser - open(p, ss, filename, 1) - while true: - var e {.inject.} = next(p) - case e.kind - of cfgEof: break - of cfgSectionStart, cfgOption, cfgError: - echo ignoreMsg(p, e) - of cfgKeyValuePair: - fillResult - close(p) - -proc parseSpec(filename: string): TSpec = - result.file = filename - result.msg = "" - result.outp = "" - result.ccodeCheck = "" - result.cmd = cmdTemplate - parseSpecAux: - case normalize(e.key) - of "action": - case e.value.normalize - of "compile": result.action = actionCompile - of "run": result.action = actionRun - of "reject": result.action = actionReject - else: echo ignoreMsg(p, e) - of "file": result.file = e.value - of "line": discard parseInt(e.value, result.line) - of "output": result.outp = e.value - of "outputsub": - result.outp = e.value - result.substr = true - of "exitcode": - discard parseInt(e.value, result.exitCode) - of "errormsg", "msg": result.msg = e.value - of "disabled": - if parseCfgBool(e.value): result.err = reIgnored - of "cmd": result.cmd = e.value - of "ccodecheck": result.ccodeCheck = e.value - else: echo ignoreMsg(p, e) - -# ---------------------------------------------------------------------------- - -let - pegLineError = - peg"{[^(]*} '(' {\d+} ', ' \d+ ') ' ('Error'/'Warning') ':' \s* {.*}" - pegOtherError = peg"'Error:' \s* {.*}" - pegSuccess = peg"'Hint: operation successful'.*" - pegOfInterest = pegLineError / pegOtherError - -proc callCompiler(cmdTemplate, filename, options: string): TSpec = - let c = parseCmdLine(cmdTemplate % [options, filename]) - var p = startProcess(command=c[0], args=c[1.. -1], - options={poStdErrToStdOut, poUseShell}) - let outp = p.outputStream - var suc = "" - var err = "" - var x = newStringOfCap(120) - while outp.readLine(x.TaintedString) or running(p): - if x =~ pegOfInterest: - # `err` should contain the last error/warning message - err = x - elif x =~ pegSuccess: - suc = x - close(p) - result.msg = "" - result.file = "" - result.outp = "" - result.line = -1 - if err =~ pegLineError: - result.file = extractFilename(matches[0]) - result.line = parseInt(matches[1]) - result.msg = matches[2] - elif err =~ pegOtherError: - result.msg = matches[0] - elif suc =~ pegSuccess: - result.err = reSuccess - -proc initResults: TResults = - result.total = 0 - result.passed = 0 - result.skipped = 0 - result.data = "" - -proc readResults(filename: string): TResults = - result = marshal.to[TResults](readFile(filename).string) - -proc writeResults(filename: string, r: TResults) = - writeFile(filename, $$r) - -proc `$`(x: TResults): string = - result = ("Tests passed: $1 / $3 <br />\n" & - "Tests skipped: $2 / $3 <br />\n") % - [$x.passed, $x.skipped, $x.total] - -proc colorResult(r: TResultEnum): string = - case r - of reIgnored: result = "<span style=\"color:fuchsia\">ignored</span>" - of reSuccess: result = "<span style=\"color:green\">yes</span>" - else: result = "<span style=\"color:red\">no</span>" - -const - TableHeader4 = "<table border=\"1\"><tr><td>Test</td><td>Expected</td>" & - "<td>Given</td><td>Success</td></tr>\n" - TableHeader3 = "<table border=\"1\"><tr><td>Test</td>" & - "<td>Given</td><td>Success</td></tr>\n" - TableFooter = "</table>\n" - HtmlBegin = """<html> - <head> - <title>Test results</title> - <style type="text/css"> - <!--""" & slurp("css/boilerplate.css") & "\n" & - slurp("css/style.css") & - """--> - </style> - - </head> - <body>""" - - HtmlEnd = "</body></html>" - -proc td(s: string): string = - result = s.substr(0, 200).XMLEncode - -proc addResult(r: var TResults, test, expected, given: string, - success: TResultEnum) = - r.data.addf("<tr><td>$#</td><td>$#</td><td>$#</td><td>$#</td></tr>\n", [ - XMLEncode(test), td(expected), td(given), success.colorResult]) - -proc addResult(r: var TResults, test, given: string, - success: TResultEnum) = - r.data.addf("<tr><td>$#</td><td>$#</td><td>$#</td></tr>\n", [ - XMLEncode(test), td(given), success.colorResult]) - -proc listResults(reject, compile, run: TResults) = - var s = HtmlBegin - s.add("<h1>Tests to Reject</h1>\n") - s.add($reject) - s.add(TableHeader4 & reject.data & TableFooter) - s.add("<br /><br /><br /><h1>Tests to Compile</h1>\n") - s.add($compile) - s.add(TableHeader3 & compile.data & TableFooter) - s.add("<br /><br /><br /><h1>Tests to Run</h1>\n") - s.add($run) - s.add(TableHeader4 & run.data & TableFooter) - s.add(HtmlEnd) - writeFile(resultsFile, s) - -proc cmpMsgs(r: var TResults, expected, given: TSpec, test: string) = - if strip(expected.msg) notin strip(given.msg): - r.addResult(test, expected.msg, given.msg, reMsgsDiffer) - elif extractFilename(expected.file) != extractFilename(given.file) and - "internal error:" notin expected.msg: - r.addResult(test, expected.file, given.file, reFilesDiffer) - elif expected.line != given.line and expected.line != 0: - r.addResult(test, $expected.line, $given.line, reLinesDiffer) - else: - r.addResult(test, expected.msg, given.msg, reSuccess) - inc(r.passed) - -proc rejectSingleTest(r: var TResults, test, options: string) = - let test = test.addFileExt(".nim") - var t = extractFilename(test) - inc(r.total) - echo t - var expected = parseSpec(test) - if expected.err == reIgnored: - r.addResult(t, "", "", reIgnored) - inc(r.skipped) - else: - var given = callCompiler(expected.cmd, test, options) - cmpMsgs(r, expected, given, t) - -proc reject(r: var TResults, dir, options: string) = - ## handle all the tests that the compiler should reject - for test in os.walkFiles(dir / "t*.nim"): rejectSingleTest(r, test, options) - -proc codegenCheck(test, check, ext: string, given: var TSpec) = - if check.len > 0: - try: - let (path, name, ext2) = test.splitFile - echo path / "nimcache" / name.changeFileExt(ext) - let contents = readFile(path / "nimcache" / name.changeFileExt(ext)).string - if contents.find(check.peg) < 0: - given.err = reCodegenFailure - except EInvalidValue: - given.err = reInvalidPeg - except EIO: - given.err = reCodeNotFound - -proc codegenChecks(test: string, expected: TSpec, given: var TSpec) = - codegenCheck(test, expected.ccodeCheck, ".c", given) - -proc compile(r: var TResults, pattern, options: string) = - for test in os.walkFiles(pattern): - let t = extractFilename(test) - echo t - inc(r.total) - let expected = parseSpec(test) - if expected.err == reIgnored: - r.addResult(t, "", reIgnored) - inc(r.skipped) - else: - var given = callCompiler(expected.cmd, test, options) - if given.err == reSuccess: - codegenChecks(test, expected, given) - r.addResult(t, given.msg, given.err) - if given.err == reSuccess: inc(r.passed) - -proc compileSingleTest(r: var TResults, test, options: string) = - # does not extract the spec because the file is not supposed to have any - let test = test.addFileExt(".nim") - let t = extractFilename(test) - inc(r.total) - echo t - let given = callCompiler(cmdTemplate, test, options) - r.addResult(t, given.msg, given.err) - if given.err == reSuccess: inc(r.passed) - -proc runSingleTest(r: var TResults, test, options: string, target: TTarget) = - var test = test.addFileExt(".nim") - var t = extractFilename(test) - echo t - inc(r.total) - var expected = parseSpec(test) - if expected.err == reIgnored: - r.addResult(t, "", "", reIgnored) - inc(r.skipped) - else: - var given = callCompiler(expected.cmd, test, options) - if given.err != reSuccess: - r.addResult(t, "", given.msg, given.err) - else: - var exeFile: string - if target == targetC: - exeFile = changeFileExt(test, ExeExt) - else: - let (dir, file, ext) = splitFile(test) - exeFile = dir / "nimcache" / file & ".js" - - if existsFile(exeFile): - var (buf, exitCode) = execCmdEx( - (if target==targetJS: "node " else: "") & exeFile) - if exitCode != expected.ExitCode: - r.addResult(t, "exitcode: " & $expected.ExitCode, - "exitcode: " & $exitCode, reExitCodesDiffer) - else: - if strip(buf.string) != strip(expected.outp): - if not (expected.substr and expected.outp in buf.string): - given.err = reOutputsDiffer - if given.err == reSuccess: - codeGenChecks(test, expected, given) - if given.err == reSuccess: inc(r.passed) - r.addResult(t, expected.outp, buf.string, given.err) - else: - r.addResult(t, expected.outp, "executable not found", reExeNotFound) - -proc runSingleTest(r: var TResults, test, options: string) = - runSingleTest(r, test, options, targetC) - -proc run(r: var TResults, dir, options: string) = - for test in os.walkFiles(dir / "t*.nim"): runSingleTest(r, test, options) - -include specials - -proc compileExample(r: var TResults, pattern, options: string) = - for test in os.walkFiles(pattern): compileSingleTest(r, test, options) - -proc toJson(res: TResults): PJsonNode = - result = newJObject() - result["total"] = newJInt(res.total) - result["passed"] = newJInt(res.passed) - result["skipped"] = newJInt(res.skipped) - -proc outputJSON(reject, compile, run: TResults) = - var doc = newJObject() - doc["reject"] = toJson(reject) - doc["compile"] = toJson(compile) - doc["run"] = toJson(run) - var s = pretty(doc) - writeFile(jsonFile, s) - -# proc runCaasTests(r: var TResults) = -# for test, output, status, mode in caasTestsRunner(): -# r.addResult(test, "", output & "-> " & $mode, -# if status: reSuccess else: reOutputsDiffer) - -proc main() = - os.putenv "NIMTEST_NO_COLOR", "1" - os.putenv "NIMTEST_OUTPUT_LVL", "PRINT_FAILURES" - - const - compileJson = "compile.json" - runJson = "run.json" - rejectJson = "reject.json" - - var optPrintResults = false - var p = initOptParser() - p.next() - if p.kind == cmdLongoption: - case p.key.string - of "print": optPrintResults = true - else: quit usage - p.next() - if p.kind != cmdArgument: quit usage - var action = p.key.string.normalize - p.next() - var r = initResults() - case action - of "reject": - reject(r, "tests/reject", p.cmdLineRest.string) - rejectSpecialTests(r, p.cmdLineRest.string) - writeResults(rejectJson, r) - of "compile": - compile(r, "tests/compile/t*.nim", p.cmdLineRest.string) - compile(r, "tests/ccg/t*.nim", p.cmdLineRest.string) - compile(r, "tests/js.nim", p.cmdLineRest.string) - compileExample(r, "lib/pure/*.nim", p.cmdLineRest.string) - compileExample(r, "examples/*.nim", p.cmdLineRest.string) - compileExample(r, "examples/gtk/*.nim", p.cmdLineRest.string) - compileExample(r, "examples/talk/*.nim", p.cmdLineRest.string) - compileSpecialTests(r, p.cmdLineRest.string) - writeResults(compileJson, r) - of "run": - run(r, "tests/run", p.cmdLineRest.string) - runSpecialTests(r, p.cmdLineRest.string) - writeResults(runJson, r) - of "special": - runSpecialTests(r, p.cmdLineRest.string) - # runCaasTests(r) - writeResults(runJson, r) - of "rodfiles": - runRodFiles(r, p.cmdLineRest.string) - writeResults(runJson, r) - of "js": - if existsFile(runJSon): - r = readResults(runJson) - runJsTests(r, p.cmdLineRest.string) - writeResults(runJson, r) - of "merge": - var rejectRes = readResults(rejectJson) - var compileRes = readResults(compileJson) - var runRes = readResults(runJson) - listResults(rejectRes, compileRes, runRes) - outputJSON(rejectRes, compileRes, runRes) - of "dll": - runDLLTests r, p.cmdLineRest.string - of "gc": - runGCTests(r, p.cmdLineRest.string) - of "test": - if p.kind != cmdArgument: quit usage - var testFile = p.key.string - p.next() - runSingleTest(r, testFile, p.cmdLineRest.string) - of "comp", "rej": - if p.kind != cmdArgument: quit usage - var testFile = p.key.string - p.next() - if peg"'/reject/'" in testFile or action == "rej": - rejectSingleTest(r, testFile, p.cmdLineRest.string) - elif peg"'/compile/'" in testFile or action == "comp": - compileSingleTest(r, testFile, p.cmdLineRest.string) - else: - runSingleTest(r, testFile, p.cmdLineRest.string) - else: - quit usage - - if optPrintResults: echo r, r.data - -if paramCount() == 0: - quit usage -main() - diff --git a/todo.txt b/todo.txt index d0aec9c8cc..bad9373a14 100644 --- a/todo.txt +++ b/todo.txt @@ -1,14 +1,11 @@ version 0.9.4 ============= -- better debugging support for writes to locations -- document new templating symbol binding rules -- fix eval in macros.nim - Bugs ==== +- fix eval in macros.nim - new VM: - implement overflow checking - bug: 'type T = ref T' not recognized as illegal recursion From b96aa59aefb5aaf24e839e4419d536a9556953a9 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 01:07:02 +0100 Subject: [PATCH 294/326] merge issue #707 by hand --- doc/manual.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/manual.txt b/doc/manual.txt index 260f0807af..baa0f33668 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -4672,6 +4672,10 @@ These rules ensure that the construction is tied to a variable and can easily be destructed at its scope exit. Later versions of the language will improve the support of destructors. +Be aware that destructors are not called for objects allocated with ``new``. +This may change in future versions of language, but for now use +the ``finalizer`` parameter to ``new``. + delegator pragma ---------------- From 38db9371935f482fb5205124030a3ec25c8ff2d5 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 01:22:31 +0100 Subject: [PATCH 295/326] merged #811 against devel --- lib/pure/os.nim | 2 +- lib/pure/osproc.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 1f42d0d58e..8cb3919a7a 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1013,7 +1013,7 @@ proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", ## the process has finished. To execute a program without having a ## shell involved, use the `execProcess` proc of the `osproc` ## module. - result = c_system(command) + result = c_system(command) shr 8 # Environment handling cannot be put into RTL, because the ``envPairs`` # iterator depends on ``environment``. diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 676707abbc..0714da28e0 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -788,7 +788,7 @@ elif not defined(useNimRtl): proc csystem(cmd: cstring): cint {.nodecl, importc: "system".} proc execCmd(command: string): int = - result = csystem(command) + result = csystem(command) shr 8 proc createFdSet(fd: var TFdSet, s: seq[PProcess], m: var int) = FD_ZERO(fd) From 435610e0afd1fc50d550c48e49f44fc5e9162bd2 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 01:38:19 +0100 Subject: [PATCH 296/326] merged #823 against devel --- lib/pure/sockets.nim | 7 ++++--- lib/wrappers/openssl.nim | 24 ++++++++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim index fd64031181..76d37879b6 100644 --- a/lib/pure/sockets.nim +++ b/lib/pure/sockets.nim @@ -311,7 +311,8 @@ when defined(ssl): newCTX.SSLCTXSetVerify(SSLVerifyNone, nil) if newCTX == nil: SSLError() - + + discard newCTX.SSLCTXSetMode(SSL_MODE_AUTO_RETRY) newCTX.loadCertificates(certFile, keyFile) return PSSLContext(newCTX) @@ -1291,14 +1292,14 @@ proc readLine*(socket: TSocket, line: var TaintedString, timeout = -1) {. var c: char discard waitFor(socket, waited, timeout, 1, "readLine") var n = recv(socket, addr(c), 1) - if n < 0: osError(osLastError()) + if n < 0: socket.socketError() elif n == 0: return if c == '\r': discard waitFor(socket, waited, timeout, 1, "readLine") n = peekChar(socket, c) if n > 0 and c == '\L': discard recv(socket, addr(c), 1) - elif n <= 0: osError(osLastError()) + elif n <= 0: socket.socketError() addNLIfEmpty() return elif c == '\L': diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim index af72d04ebf..90c398dceb 100644 --- a/lib/wrappers/openssl.nim +++ b/lib/wrappers/openssl.nim @@ -268,14 +268,22 @@ proc OpenSSL_add_all_algorithms*(){.cdecl, dynlib: DLLUtilName, importc: "OPENSS proc OPENSSL_config*(configName: cstring){.cdecl, dynlib: DLLSSLName, importc.} -proc CRYPTO_set_mem_functions(a,b,c: pointer){.cdecl, dynlib: DLLSSLName, importc.} +when not defined(windows): + proc CRYPTO_set_mem_functions(a,b,c: pointer){.cdecl, + dynlib: DLLSSLName, importc.} proc CRYPTO_malloc_init*() = when not defined(windows): CRYPTO_set_mem_functions(alloc, realloc, dealloc) -when True: - nil +proc SSL_CTX_ctrl*(ctx: PSSL_CTX, cmd: cInt, larg: int, parg: pointer): int{. + cdecl, dynlib: DLLSSLName, importc.} + +proc SSLCTXSetMode*(ctx: PSSL_CTX, mode: int): int = + result = SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, mode, nil) + +when true: + discard else: proc SslCtxSetCipherList*(arg0: PSSL_CTX, str: cstring): cInt{.cdecl, dynlib: DLLSSLName, importc.} @@ -288,7 +296,6 @@ else: proc SslCTXCtrl*(ctx: PSSL_CTX, cmd: cInt, larg: int, parg: Pointer): int{. cdecl, dynlib: DLLSSLName, importc.} - proc SSLCTXSetMode*(ctx: PSSL_CTX, mode: int): int proc SSLSetMode*(s: PSSL, mode: int): int proc SSLCTXGetMode*(ctx: PSSL_CTX): int proc SSLGetMode*(s: PSSL): int @@ -417,15 +424,12 @@ else: enc: cInt){.cdecl, dynlib: DLLUtilName, importc.} # implementation - proc SSLCTXSetMode(ctx: PSSL_CTX, mode: int): int = - Result = SslCTXCtrl(ctx, SSL_CTRL_MODE, mode, nil) - proc SSLSetMode(s: PSSL, mode: int): int = - Result = SSLctrl(s, SSL_CTRL_MODE, mode, nil) + result = SSLctrl(s, SSL_CTRL_MODE, mode, nil) proc SSLCTXGetMode(ctx: PSSL_CTX): int = - Result = SSLCTXctrl(ctx, SSL_CTRL_MODE, 0, nil) + result = SSLCTXctrl(ctx, SSL_CTRL_MODE, 0, nil) proc SSLGetMode(s: PSSL): int = - Result = SSLctrl(s, SSL_CTRL_MODE, 0, nil) + result = SSLctrl(s, SSL_CTRL_MODE, 0, nil) From 6fda10aed0287d50ebc3c6192d0dd64e710a1f72 Mon Sep 17 00:00:00 2001 From: Simon Hafner <hafnersimon@gmail.com> Date: Sat, 1 Feb 2014 18:39:39 -0600 Subject: [PATCH 297/326] added test specs for the tester --- tests/sets/testequivalence.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/sets/testequivalence.nim b/tests/sets/testequivalence.nim index 8a83e2a213..7c5d9e3e90 100644 --- a/tests/sets/testequivalence.nim +++ b/tests/sets/testequivalence.nim @@ -1,3 +1,6 @@ +discard """ + output: '''''' +""" import unittest import sets From eeae68f9e445154bc9c0e965904478de8ef24ab4 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 01:57:56 +0100 Subject: [PATCH 298/326] added the parts of #541 that I like --- doc/tut1.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/tut1.txt b/doc/tut1.txt index 1ba3253c8e..b70f40f4af 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -1321,6 +1321,30 @@ In this example ``$`` is applied to any argument that is passed to the parameter ``a``. Note that ``$`` applied to strings is a nop. +Slices +------ + +Slices look similar to subranges types in syntax but are used in a different +context. A slice is just an object of type TSlice which contains two bounds, +`a` and `b`. By itself a slice is not very useful, but other collection types +define operators which accept TSlice objects to define ranges. + +.. code-block:: nimrod + + var + a = "Nimrod is a progamming language" + b = "Slices are useless." + + echo a[10..15] # --> 'a prog' + b[11.. -2] = "useful" + echo b # --> 'Slices are useful.' + +In the previous example slices are used to modify a part of a string, and even +a negative index is used. The slice's bounds can hold any value supported by +their type, but it is the proc using the slice object which defines what values +are accepted. + + Tuples ------ From 69bc0779378bf3684d2138d2b6c0a423ae56f2c6 Mon Sep 17 00:00:00 2001 From: Dominik Picheta <dominikpicheta@googlemail.com> Date: Sun, 2 Feb 2014 01:01:12 +0000 Subject: [PATCH 299/326] Fixes docgen for logging module. --- lib/pure/logging.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/logging.nim b/lib/pure/logging.nim index 8158cbc2aa..284384b37e 100644 --- a/lib/pure/logging.nim +++ b/lib/pure/logging.nim @@ -106,10 +106,10 @@ proc substituteLog(frmt: string): string = of "appname": result.add(app.splitFile.name) method log*(logger: PLogger, level: TLevel, - frmt: string, args: varargs[string, `$`]) = + frmt: string, args: varargs[string, `$`]) {.raises: [EBase], tags: [FTime, FWriteIO, FReadIO].} = ## Override this method in custom loggers. Default implementation does ## nothing. - nil + discard method log*(logger: PConsoleLogger, level: TLevel, frmt: string, args: varargs[string, `$`]) = From 798295a9b6611468bf195de602bb0de41d91d1ac Mon Sep 17 00:00:00 2001 From: EXetoC <exetoc@gmail.com> Date: Sun, 2 Feb 2014 02:22:42 +0100 Subject: [PATCH 300/326] A first attempt at fixing the MongoDB modules. --- lib/impure/db_mongo.nim | 4 ++-- lib/wrappers/mongo.nim | 52 +++++++++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/lib/impure/db_mongo.nim b/lib/impure/db_mongo.nim index d012f677f8..dc8a808f24 100644 --- a/lib/impure/db_mongo.nim +++ b/lib/impure/db_mongo.nim @@ -58,7 +58,7 @@ proc open*(host: string = defaultHost, port: int = defaultPort): TDbConn {. ## be established. init(result) - let x = connect(result, host, port.cint) + let x = client(result, host, port.cint) if x != 0'i32: dbError(result, "cannot open: " & host) @@ -119,7 +119,7 @@ proc insertId*(db: var TDbConn, namespace: string, data: PJsonNode): TOid {. ## the generated OID for the ``_id`` field. result = genOid() var x = jsonToBSon(data, result) - insert(db, namespace, x) + insert(db, namespace, x, nil) destroy(x) proc insert*(db: var TDbConn, namespace: string, data: PJsonNode) {. diff --git a/lib/wrappers/mongo.nim b/lib/wrappers/mongo.nim index 6673e8ddf7..098b4f4d3f 100644 --- a/lib/wrappers/mongo.nim +++ b/lib/wrappers/mongo.nim @@ -109,11 +109,12 @@ type cur*: cstring dataSize*: cint finished*: TBsonBool - stack*: array[0..32 - 1, cint] + ownsData*: TBsonBool + err*: cint + stackSize*: cint stackPos*: cint - err*: cint ## Bitfield representing errors or warnings on this buffer - errstr*: cstring ## A string representation of the most recent error - ## or warning. + stackPtr*: ptr csize + stack*: array[0..32 - 1, csize] TDate* = int64 @@ -141,6 +142,7 @@ proc print*(TBson: cstring, depth: cint) {.stdcall, importc: "bson_print_raw", dynlib: bsondll.} ## Print a string representation of a BSON object up to `depth`. + proc data*(b: var TBson): cstring{.stdcall, importc: "bson_data", dynlib: bsondll.} ## Return a pointer to the raw buffer stored by this bson object. @@ -590,19 +592,30 @@ type hosts*: ptr THostPort ## List of host/ports given by the replica set name*: cstring ## Name of the replica set. primary_connected*: TBsonBool ## Primary node connection status. + + TWriteConcern*{.pure, final.} = object ## mongo_write_concern + w*: cint + wtimeout*: cint + j*: cint + fsync*: cint + mode*: cstring + cmd*: TBSon TMongo*{.pure, final.} = object ## mongo - primary*: ptr THostPort ## Primary connection info. - replset*: ptr TReplSet ## replset object if connected to a replica set. - sock*: cint ## Socket file descriptor. - flags*: cint ## Flags on this connection object. - conn_timeout_ms*: cint ## Connection timeout in milliseconds. - op_timeout_ms*: cint ## Read and write timeout in milliseconds. - connected*: TBsonBool ## Connection status. - err*: TError ## Most recent driver error code. - errstr*: array[0..128 - 1, char] ## String version of most recent driver error code. - lasterrcode*: cint ## getlasterror code given by the server on error. - lasterrstr*: cstring ## getlasterror string generated by server. + primary*: ptr THostPort ## Primary connection info. + replset*: ptr TReplSet ## replset object if connected to a replica set. + sock*: cint ## Socket file descriptor. + flags*: cint ## Flags on this connection object. + conn_timeout_ms*: cint ## Connection timeout in milliseconds. + op_timeout_ms*: cint ## Read and write timeout in milliseconds. + max_bson_size*: cint ## Largest BSON object allowed on this connection. + connected*: TBsonBool ## Connection status. + write_concern*: TWriteConcern ## The default write concern. + err*: TError ## Most recent driver error code. + errcode*: cint ## Most recent errno or WSAGetLastError(). + errstr*: array[0..128 - 1, char] ## String version of most recent driver error code. + lasterrcode*: cint ## getlasterror code given by the server on error. + lasterrstr*: array[0..128 - 1, char] ## getlasterror string generated by server. TCursor*{.pure, final.} = object ## cursor reply*: ptr TReply ## reply is owned by cursor @@ -654,7 +667,11 @@ proc init*(conn: var TMongo){.stdcall, importc: "mongo_init", dynlib: mongodll.} proc connect*(conn: var TMongo, host: cstring = defaultHost, port: cint = defaultPort): cint {.stdcall, - importc: "mongo_connect", dynlib: mongodll.} + importc: "mongo_connect", dynlib: mongodll, deprecated.} + ## Connect to a single MongoDB server. +proc client*(conn: var TMongo, host: cstring = defaultHost, + port: cint = defaultPort): cint {.stdcall, + importc: "mongo_client", dynlib: mongodll.} ## Connect to a single MongoDB server. proc replsetInit*(conn: var TMongo, name: cstring){.stdcall, @@ -714,7 +731,8 @@ proc destroy*(conn: var TMongo){.stdcall, importc: "mongo_destroy", ## You must always call this function when finished with the connection ## object. -proc insert*(conn: var TMongo, ns: cstring, data: var TBson): cint{.stdcall, +proc insert*(conn: var TMongo, ns: cstring, data: var TBson, + custom_write_concern: ptr TWriteConcern): cint{.stdcall, importc: "mongo_insert", dynlib: mongodll, discardable.} ## Insert a BSON document into a MongoDB server. This function ## will fail if the supplied BSON struct is not UTF-8 or if From 7cd5e79464c13b6a8047bdc3d58f0ddc4069431b Mon Sep 17 00:00:00 2001 From: Clay Sweetser <clay.sweetser@gmail.com> Date: Sat, 1 Feb 2014 20:56:34 -0500 Subject: [PATCH 301/326] Added symlink procs --- lib/pure/os.nim | 74 +++++++++++++++++++++++++++++++++++++++-- lib/windows/winlean.nim | 18 +++++++++- 2 files changed, 89 insertions(+), 3 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 8cb3919a7a..4bdb0e7e7e 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -287,12 +287,18 @@ proc osLastError*(): TOSErrorCode = result = TOSErrorCode(errno) {.pop.} -proc unixToNativePath*(path: string): string {. +proc unixToNativePath*(path: string, drive=""): string {. noSideEffect, rtl, extern: "nos$1".} = ## Converts an UNIX-like path to a native one. ## ## On an UNIX system this does nothing. Else it converts ## '/', '.', '..' to the appropriate things. + ## + ## On systems with a concept of "drives", `drive` is used to determine + ## which drive label to use during absolute path conversion. + ## `drive` defaults to the drive of the current working directory, and is + ## ignored on systems that do not have a concept of "drives". + when defined(unix): result = path else: @@ -300,7 +306,10 @@ proc unixToNativePath*(path: string): string {. if path[0] == '/': # an absolute path when doslike: - result = r"C:\" + if drive != "": + result = drive & ":" & DirSep + else: + result = $DirSep elif defined(macos): result = "" # must not start with ':' else: @@ -387,6 +396,21 @@ proc existsDir*(dir: string): bool {.rtl, extern: "nos$1", tags: [FReadDir].} = var res: TStat return stat(dir, res) >= 0'i32 and S_ISDIR(res.st_mode) +proc symlinkExists*(link: string): bool {.rtl, extern: "nos$1", + tags: [FReadDir].} = + ## Returns true iff the symlink `link` exists. Will return true + ## regardless of whether the link points to a directory or file. + when defined(windows): + when useWinUnicode: + wrapUnary(a, GetFileAttributesW, link) + else: + var a = GetFileAttributesA(link) + if a != -1'i32: + result = (a and FILE_ATTRIBUTE_REPARSE_POINT) != 0'i32 + else: + var res: TStat + return lstat(link, res) >= 0'i32 and S_ISLNK(res.st_mode) + proc fileExists*(filename: string): bool {.inline.} = ## Synonym for existsFile existsFile(filename) @@ -1221,6 +1245,8 @@ iterator walkDir*(dir: string): tuple[kind: TPathComponent, path: string] {. if not skipFindData(f): if (f.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) != 0'i32: k = pcDir + if (f.dwFileAttributes and FILE_ATTRIBUTE_REPARSE_POINT) != 0'i32: + k = succ(k) yield (k, dir / extractFilename(getFilename(f))) if findNextFile(h, f) == 0'i32: break findClose(h) @@ -1245,6 +1271,10 @@ iterator walkDirRec*(dir: string, filter={pcFile, pcDir}): string {. tags: [FReadDir].} = ## walks over the directory `dir` and yields for each file in `dir`. The ## full path for each file is returned. + ## **Warning**: + ## Modifying the directory structure while the iterator + ## is traversing may result in undefined behavior! + ## ## Walking is recursive. `filter` controls the behaviour of the iterator: ## ## --------------------- --------------------------------------------- @@ -1336,6 +1366,46 @@ proc copyDir*(source, dest: string) {.rtl, extern: "nos$1", copyDir(path, dest / noSource) else: discard +proc createSymlink*(src, dest: string) = + ## Create a symbolic link at `dest` which points to the item specified + ## by `src`. On most operating systems, will fail if a lonk + ## + ## **Warning**: + ## Some OS's (such as Microsoft Windows) restrict the creation + ## of symlinks to root users (administrators). + when defined(Windows): + let flag = dirExists(src).int32 + when useWinUnicode: + var wSrc = newWideCString(src) + var wDst = newWideCString(dest) + if CreateSymbolicLinkW(wDst, wSrc, flag) == 0 or GetLastError() != 0: + osError(osLastError()) + else: + if CreateSymbolicLinkA(dest, src, flag) == 0 or GetLastError() != 0: + osError(osLastError()) + else: + if symlink(src, dest) != 0: + OSError(OSLastError()) + +proc createHardlink*(src, dest: string) = + ## Create a hard link at `dest` which points to the item specified + ## by `src`. + ## + ## **Warning**: Most OS's restrict the creation of hard links to + ## root users (administrators) . + when defined(Windows): + when useWinUnicode: + var wSrc = newWideCString(src) + var wDst = newWideCString(dest) + if createHardLinkW(wDst, wSrc, nil) == 0: + OSError(OSLastError()) + else: + if createHardLinkA(dest, src, nil) == 0: + OSError(OSLastError()) + else: + if link(src, dest) != 0: + OSError(OSLastError()) + proc parseCmdLine*(c: string): seq[string] {. noSideEffect, rtl, extern: "nos$1".} = ## Splits a command line into several components; diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 91c6495cec..3aec2bd525 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -204,7 +204,22 @@ else: proc getModuleFileNameA*(handle: THandle, buf: CString, size: int32): int32 {. importc: "GetModuleFileNameA", dynlib: "kernel32", stdcall.} - + +when useWinUnicode: + proc createSymbolicLinkW*(lpSymlinkFileName, lpTargetFileName: wideCString, + flags: DWORD): int32 {. + importc:"CreateSymbolicLinkW", dynlib: "kernel32", stdcall.} + proc createHardLinkW*(lpFileName, lpExistingFileName: wideCString, + security: Pointer=nil): int32 {. + importc:"CreateHardLinkW", dynlib: "kernel32", stdcall.} +else: + proc createSymbolicLinkA*(lpSymlinkFileName, lpTargetFileName: cstring, + flags: DWORD): int32 {. + importc:"CreateSymbolicLinkA", dynlib: "kernel32", stdcall.} + proc createHardLinkA*(lpFileName, lpExistingFileName: cstring, + security: Pointer=nil): int32 {. + importc:"CreateHardLinkA", dynlib: "kernel32", stdcall.} + const FILE_ATTRIBUTE_ARCHIVE* = 32'i32 FILE_ATTRIBUTE_COMPRESSED* = 2048'i32 @@ -212,6 +227,7 @@ const FILE_ATTRIBUTE_DIRECTORY* = 16'i32 FILE_ATTRIBUTE_HIDDEN* = 2'i32 FILE_ATTRIBUTE_READONLY* = 1'i32 + FILE_ATTRIBUTE_REPARSE_POINT* = 1024'i32 FILE_ATTRIBUTE_SYSTEM* = 4'i32 FILE_ATTRIBUTE_TEMPORARY* = 256'i32 From 4b94aba6de5da797c339dc6645e72b1070b92c31 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 03:03:38 +0100 Subject: [PATCH 302/326] fixes #735 --- lib/pure/smtp.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pure/smtp.nim b/lib/pure/smtp.nim index 6a3f652795..88afeb5895 100644 --- a/lib/pure/smtp.nim +++ b/lib/pure/smtp.nim @@ -66,13 +66,15 @@ proc checkReply(smtp: var TSMTP, reply: string) = if not line.string.startswith(reply): quitExcpt(smtp, "Expected " & reply & " reply, got: " & line.string) +const compiledWithSsl = defined(ssl) + proc connect*(address: string, port = 25, ssl = false, debug = false): TSMTP = ## Establishes a connection with a SMTP server. ## May fail with EInvalidReply or with a socket error. result.sock = socket() if ssl: - when defined(ssl): + when compiledWithSsl: let ctx = newContext(verifyMode = CVerifyNone) ctx.wrapSocket(result.sock) else: From 47e4f9698cca68a96fbffa6acc0c6d39a6f6420b Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 10:00:10 +0100 Subject: [PATCH 303/326] fixes #844 --- compiler/semdata.nim | 2 +- compiler/semexprs.nim | 4 ++-- compiler/semstmts.nim | 10 ++++++---- tests/exprs/tstmtexprs.nim | 12 ++++++++++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 980abb865e..8b97f36859 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -42,7 +42,7 @@ type TExprFlag* = enum efLValue, efWantIterator, efInTypeof, efWantStmt, efDetermineType, - efAllowDestructor + efAllowDestructor, efWantValue TExprFlags* = set[TExprFlag] PContext* = ref TContext diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index a384c41fdc..6c76795780 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -35,7 +35,7 @@ proc semOperand(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result.typ = errorType(c) proc semExprWithType(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = - result = semExpr(c, n, flags) + result = semExpr(c, n, flags+{efWantValue}) if result.isNil or result.kind == nkEmpty: # do not produce another redundant error message: #raiseRecoverableError("") @@ -1993,7 +1993,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result = semStaticExpr(c, n) of nkAsgn: result = semAsgn(c, n) of nkBlockStmt, nkBlockExpr: result = semBlock(c, n) - of nkStmtList, nkStmtListExpr: result = semStmtList(c, n) + of nkStmtList, nkStmtListExpr: result = semStmtList(c, n, flags) of nkRaiseStmt: result = semRaise(c, n) of nkVarSection: result = semVarOrLet(c, n, skVar) of nkLetSection: result = semVarOrLet(c, n, skLet) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index caa719c7e1..25353fdd7b 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1206,7 +1206,7 @@ proc usesResult(n: PNode): bool = for c in n: if usesResult(c): return true -proc semStmtList(c: PContext, n: PNode): PNode = +proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode = # these must be last statements in a block: const LastBlockStmts = {nkRaiseStmt, nkReturnStmt, nkBreakStmt, nkContinueStmt} @@ -1247,12 +1247,14 @@ proc semStmtList(c: PContext, n: PNode): PNode = if n.sons[i].typ == enforceVoidContext or usesResult(n.sons[i]): voidContext = true n.typ = enforceVoidContext - if i != last or voidContext or c.inTypeClass > 0: + if i == last and efWantValue in flags: + n.typ = n.sons[i].typ + if not isEmptyType(n.typ): n.kind = nkStmtListExpr + elif i != last or voidContext or c.inTypeClass > 0: discardCheck(c, n.sons[i]) else: n.typ = n.sons[i].typ - if not isEmptyType(n.typ): - n.kind = nkStmtListExpr + if not isEmptyType(n.typ): n.kind = nkStmtListExpr case n.sons[i].kind of nkVarSection, nkLetSection: let (outer, inner) = insertDestructors(c, n.sons[i]) diff --git a/tests/exprs/tstmtexprs.nim b/tests/exprs/tstmtexprs.nim index 497a2f6d05..8149ec4b88 100644 --- a/tests/exprs/tstmtexprs.nim +++ b/tests/exprs/tstmtexprs.nim @@ -69,3 +69,15 @@ proc semiProblem() = if false: echo "aye"; echo "indeed" semiProblem() + + +# bug #844 + +import json +proc parseResponse(): PJsonNode = + result = % { "key1": % { "key2": % "value" } } + for key, val in result["key1"]: + var excMsg = key & "(" + if (var n=result["key2"]; n != nil): + excMsg &= n.str + raise newException(ESynch, excMsg) From 7196c7637e00581f94ca9c02782f34ef7d480e2f Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 10:07:29 +0100 Subject: [PATCH 304/326] bootstraps again --- lib/pure/os.nim | 20 ++++++++++---------- lib/windows/winlean.nim | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 4bdb0e7e7e..245a8446bb 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -402,9 +402,9 @@ proc symlinkExists*(link: string): bool {.rtl, extern: "nos$1", ## regardless of whether the link points to a directory or file. when defined(windows): when useWinUnicode: - wrapUnary(a, GetFileAttributesW, link) + wrapUnary(a, getFileAttributesW, link) else: - var a = GetFileAttributesA(link) + var a = getFileAttributesA(link) if a != -1'i32: result = (a and FILE_ATTRIBUTE_REPARSE_POINT) != 0'i32 else: @@ -1378,14 +1378,14 @@ proc createSymlink*(src, dest: string) = when useWinUnicode: var wSrc = newWideCString(src) var wDst = newWideCString(dest) - if CreateSymbolicLinkW(wDst, wSrc, flag) == 0 or GetLastError() != 0: - osError(osLastError()) + if createSymbolicLinkW(wDst, wSrc, flag) == 0 or getLastError() != 0: + osError(osLastError()) else: - if CreateSymbolicLinkA(dest, src, flag) == 0 or GetLastError() != 0: - osError(osLastError()) + if createSymbolicLinkA(dest, src, flag) == 0 or getLastError() != 0: + osError(osLastError()) else: if symlink(src, dest) != 0: - OSError(OSLastError()) + osError(osLastError()) proc createHardlink*(src, dest: string) = ## Create a hard link at `dest` which points to the item specified @@ -1398,13 +1398,13 @@ proc createHardlink*(src, dest: string) = var wSrc = newWideCString(src) var wDst = newWideCString(dest) if createHardLinkW(wDst, wSrc, nil) == 0: - OSError(OSLastError()) + osError(osLastError()) else: if createHardLinkA(dest, src, nil) == 0: - OSError(OSLastError()) + osError(osLastError()) else: if link(src, dest) != 0: - OSError(OSLastError()) + osError(osLastError()) proc parseCmdLine*(c: string): seq[string] {. noSideEffect, rtl, extern: "nos$1".} = diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 3aec2bd525..ee5fe06470 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -206,18 +206,18 @@ else: importc: "GetModuleFileNameA", dynlib: "kernel32", stdcall.} when useWinUnicode: - proc createSymbolicLinkW*(lpSymlinkFileName, lpTargetFileName: wideCString, + proc createSymbolicLinkW*(lpSymlinkFileName, lpTargetFileName: WideCString, flags: DWORD): int32 {. importc:"CreateSymbolicLinkW", dynlib: "kernel32", stdcall.} - proc createHardLinkW*(lpFileName, lpExistingFileName: wideCString, - security: Pointer=nil): int32 {. + proc createHardLinkW*(lpFileName, lpExistingFileName: WideCString, + security: pointer=nil): int32 {. importc:"CreateHardLinkW", dynlib: "kernel32", stdcall.} else: proc createSymbolicLinkA*(lpSymlinkFileName, lpTargetFileName: cstring, flags: DWORD): int32 {. importc:"CreateSymbolicLinkA", dynlib: "kernel32", stdcall.} proc createHardLinkA*(lpFileName, lpExistingFileName: cstring, - security: Pointer=nil): int32 {. + security: pointer=nil): int32 {. importc:"CreateHardLinkA", dynlib: "kernel32", stdcall.} const From c30f6cfcf11cf5e61d708db476d7a6fcb62aab23 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Sun, 2 Feb 2014 14:34:37 +0100 Subject: [PATCH 305/326] cleaned up command expressions --- compiler/parser.nim | 11 +++++------ doc/grammar.txt | 3 +-- doc/manual.txt | 18 +++++++++++++----- tests/parser/tcommand_as_expr.nim | 15 ++++++++++----- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/compiler/parser.nim b/compiler/parser.nim index 4497e360aa..7c740559c3 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -642,8 +642,7 @@ proc primarySuffix(p: var TParser, r: PNode): PNode = #| | '.' optInd ('type' | 'addr' | symbol) generalizedLit? #| | '[' optInd indexExprList optPar ']' #| | '{' optInd indexExprList optPar '}' - #| | &( '`'|IDENT|literal|'cast') expr ^+ ',' # command syntax - #| (doBlock | macroColon)? + #| | &( '`'|IDENT|literal|'cast') expr # command syntax result = r while p.tok.indent < 0: case p.tok.tokType @@ -680,10 +679,10 @@ proc primarySuffix(p: var TParser, r: PNode): PNode = if p.tok.tokType != tkComma: break getTok(p) optInd(p, a) - if p.tok.tokType == tkDo: - parseDoBlocks(p, result) - else: - result = parseMacroColon(p, result) + if p.tok.tokType == tkDo: + parseDoBlocks(p, result) + else: + result = parseMacroColon(p, result) break else: break diff --git a/doc/grammar.txt b/doc/grammar.txt index 54c2217d87..63e898e110 100644 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -59,8 +59,7 @@ primarySuffix = '(' (exprColonEqExpr comma?)* ')' doBlocks? | '.' optInd ('type' | 'addr' | symbol) generalizedLit? | '[' optInd indexExprList optPar ']' | '{' optInd indexExprList optPar '}' - | &( '`'|IDENT|literal|'cast') expr ^+ ',' # command syntax - (doBlock | macroColon)? + | &( '`'|IDENT|literal|'cast') expr # command syntax condExpr = expr colcom expr optInd ('elif' expr colcom expr optInd)* 'else' colcom expr diff --git a/doc/manual.txt b/doc/manual.txt index baa0f33668..2ccd4c1e9b 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -1315,12 +1315,9 @@ Examples: .. code-block:: nimrod - type - TCallback = proc (x: int) {.cdecl.} + proc printItem(x: int) = ... - proc printItem(x: Int) = ... - - proc forEach(c: TCallback) = + proc forEach(c: proc (x: int) {.cdecl.}) = ... forEach(printItem) # this will NOT work because calling conventions differ @@ -2459,6 +2456,17 @@ notation. (Thus an operator can have more than two parameters): assert `*+`(3, 4, 6) == `*`(a, `+`(b, c)) + +Command invocation syntax +------------------------- + +Routines can be invoked without the ``()`` if the call is syntactially +a statement. This `command invocation syntax`:idx: also works for +expressions, but then only a single argument may follow. This restriction +means ``echo f 1, f 2`` is parsed as ``echo(f(1), f(2))`` and not as +``echo(f(1, f(2)))``. + + Closures -------- diff --git a/tests/parser/tcommand_as_expr.nim b/tests/parser/tcommand_as_expr.nim index f6868a2fc7..a9747b0acd 100644 --- a/tests/parser/tcommand_as_expr.nim +++ b/tests/parser/tcommand_as_expr.nim @@ -1,12 +1,17 @@ discard """ - output: "12" + output: '''140 +5-120''' """ +proc optarg(x:int):int = x +proc singlearg(x:int):int = 20*x +echo optarg 1, singlearg 2 + + proc foo(x: int): int = x-1 proc foo(x, y: int): int = x-y -let x = foo 7.foo, # comment here - foo(1, foo 8) -# 12 = 6 - -6 -echo x +let x = optarg foo 7.foo +let y = singlearg foo(1, foo 8) +echo x, y From 700f32e81470c16ff65bc83d256ad1368f05e4ad Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Sun, 26 Jan 2014 20:15:29 +0100 Subject: [PATCH 306/326] Adds convenience mapIt templates. --- lib/pure/collections/sequtils.nim | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index 3993f1ccc7..b2f72ee146 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -276,6 +276,38 @@ template foldr*(sequence, operation: expr): expr = result = operation result +template mapIt*(seq1, typ, pred: expr): expr = + ## Convenience template around the ``map`` proc to reduce typing. + ## + ## The template injects the ``it`` variable which you can use directly in an + ## expression. You also need to pass as `typ` the type of the expression, + ## since the new returned sequence can have a different type than the + ## original. Example: + ## + ## .. code-block:: nimrod + ## let + ## nums = @[1, 2, 3, 4] + ## strings = nums.mapIt(string, $(4 * it)) + var result {.gensym.}: seq[typ] = @[] + for it {.inject.} in items(seq1): + result.add(pred) + result + +template mapIt*(varSeq, pred: expr) = + ## Convenience template around the mutable ``map`` proc to reduce typing. + ## + ## The template injects the ``it`` variable which you can use directly in an + ## expression. The expression has to return the same type as the sequence you + ## are mutating. Example: + ## + ## .. code-block:: nimrod + ## var nums = @[1, 2, 3, 4] + ## nums.mapIt(it * 3) + ## assert nums[0] + nums[3] == 15 + for i in 0 .. <len(varSeq): + let it {.inject.} = varSeq[i] + varSeq[i] = pred + when isMainModule: import strutils block: # concat test @@ -381,4 +413,11 @@ when isMainModule: Inserting [2,2,2,2,2,2] into [1,1,1,1,1,1,1,1] at 3 is [1,1,1,2,2,2,2,2,2,1,1,1,1,1]""" + block: # mapIt tests + var + nums = @[1, 2, 3, 4] + strings = nums.mapIt(string, $(4 * it)) + nums.mapIt(it * 3) + assert nums[0] + nums[3] == 15 + echo "Finished doc tests" From 92e3f667bd804b3f03eb09c1077552cdf5107e24 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Sun, 2 Feb 2014 17:59:17 +0100 Subject: [PATCH 307/326] Mentions {.exportc.} limits. Refs #826. --- doc/manual.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index 2ccd4c1e9b..b85c49e037 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -5172,9 +5172,9 @@ the same feature under the same name. Exportc pragma -------------- The `exportc`:idx: pragma provides a means to export a type, a variable, or a -procedure to C. The optional argument is a string containing the C identifier. -If the argument is missing, the C name is the Nimrod -identifier *exactly as spelled*: +procedure to C. Enums and constants can't be exported. The optional argument +is a string containing the C identifier. If the argument is missing, the C +name is the Nimrod identifier *exactly as spelled*: .. code-block:: Nimrod proc callme(formatstr: cstring) {.exportc: "callMe", varargs.} From 52d4e07146f29f9a0af29e99a94ef4f5a1fd1cbf Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz <gradha@imap.cc> Date: Sun, 2 Feb 2014 23:28:17 +0100 Subject: [PATCH 308/326] Adds utimes() importc to posix module. --- lib/posix/posix.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index c3d5b5939e..41260b36fc 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -2566,3 +2566,15 @@ proc poll*(a1: ptr TPollfd, a2: Tnfds, a3: int): cint {. proc realpath*(name, resolved: cstring): cstring {. importc: "realpath", header: "<stdlib.h>".} + +proc utimes*(path: cstring, times: ptr array [2, Ttimeval]): int {. + importc: "utimes", header: "<sys/time.h>".} + ## Sets file access and modification times. + ## + ## Pass the filename and an array of times to set the access and modification + ## times respectively. If you pass nil as the array both attributes will be + ## set to the current time. + ## + ## Returns zero on success. + ## + ## For more information read http://www.unix.com/man-page/posix/3/utimes/. From db031e2b4741f7238433bc8b20beb12da5431b80 Mon Sep 17 00:00:00 2001 From: ReneSac <reneduani@yahoo.com.br> Date: Mon, 3 Feb 2014 01:00:01 -0200 Subject: [PATCH 309/326] Expandeded part about different proc call syntaxes. --- doc/manual.txt | 74 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index b85c49e037..da229d169b 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -2457,14 +2457,80 @@ notation. (Thus an operator can have more than two parameters): assert `*+`(3, 4, 6) == `*`(a, `+`(b, c)) +Method call syntax +------------------ + +For object oriented programming, the syntax ``obj.method(args)`` can be used +instead of ``method(obj, args)``. The parentheses can be omitted if there are no +remaining arguments: ``obj.len`` (instead of ``len(obj)``). + +This `method call syntax`:idx: is not restricted to objects, it can be used +to supply any type of first argument for procedures: + +.. code-block:: nimrod + + echo("abc".len) # is the same as echo(len("abc")) + echo("abc".toUpper()) + echo({'a', 'b', 'c'}.card) + stdout.writeln("Hallo") # the same as writeln(stdout, "Hallo") + +Another way to look at the method call syntax is that it provides the missing +postfix notation. + + +Properties +---------- +Nimrod has no need for *get-properties*: Ordinary get-procedures that are called +with the *method call syntax* achieve the same. But setting a value is +different; for this a special setter syntax is needed: + +.. code-block:: nimrod + + type + TSocket* = object of TObject + FHost: int # cannot be accessed from the outside of the module + # the `F` prefix is a convention to avoid clashes since + # the accessors are named `host` + + proc `host=`*(s: var TSocket, value: int) {.inline.} = + ## setter of hostAddr + s.FHost = value + + proc host*(s: TSocket): int {.inline.} = + ## getter of hostAddr + return s.FHost + + var + s: TSocket + s.host = 34 # same as `host=`(s, 34) + + Command invocation syntax ------------------------- -Routines can be invoked without the ``()`` if the call is syntactially +Routines can be invoked without the ``()`` if the call is syntatically a statement. This `command invocation syntax`:idx: also works for expressions, but then only a single argument may follow. This restriction means ``echo f 1, f 2`` is parsed as ``echo(f(1), f(2))`` and not as -``echo(f(1, f(2)))``. +``echo(f(1, f(2)))``. The method call syntax may be used to provide one +more argument in this case: + +.. code-block:: nimrod + proc optarg(x:int, y:int = 0):int = x + y + proc singlearg(x:int):int = 20*x + + echo optarg 1, " ", singlearg 2 # prints "1 40" + + let fail = optarg 1, optarg 8 # Wrong. Too many arguments for a command call + let x = optarg(1, optarg 8) # traditional procedure call with 2 arguments + let y = 1.optarg optarg 8 # same thing as above, w/o the parenthesis + assert x == y + +The command invocation syntax also can't have complex expressions as arguments. +For example: (`anonymous procs`_), ``if``, ``case`` or ``try``. The (`do +notation`_) is limited, but usable for a single proc (see the example in the +corresponding section). Function calls with no arguments still needs () to +distinguish between a call and the function itself as a first class value. Closures @@ -2479,6 +2545,7 @@ the closure and its enclosing scope (i.e. any modifications made to them are visible in both places). The closure environment may be allocated on the heap or on the stack if the compiler determines that this would be safe. + Anonymous Procs --------------- @@ -2505,6 +2572,9 @@ calls can use the ``do`` keyword: .. code-block:: nimrod sort(cities) do (x,y: string) -> int: cmp(x.len, y.len) + # Less parenthesis using the method plus command syntax: + cities = cities.map do (x:string) -> string: + "City of " & x ``do`` is written after the parentheses enclosing the regular proc params. The proc expression represented by the do block is appended to them. From 300c0376b5a85233dea9b1c9414a60ba585751d1 Mon Sep 17 00:00:00 2001 From: ReneSac <reneduani@yahoo.com.br> Date: Mon, 3 Feb 2014 01:06:19 -0200 Subject: [PATCH 310/326] Fix optarg() and added two more tests. One for 'do notation' in a single function in an expression, another the trick of using the method call syntax to pass two parameters. --- tests/parser/tcommand_as_expr.nim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/parser/tcommand_as_expr.nim b/tests/parser/tcommand_as_expr.nim index a9747b0acd..3c02f8cb3d 100644 --- a/tests/parser/tcommand_as_expr.nim +++ b/tests/parser/tcommand_as_expr.nim @@ -1,9 +1,11 @@ discard """ output: '''140 -5-120''' +5-120-120 +359''' """ +import math -proc optarg(x:int):int = x +proc optarg(x:int, y:int = 0):int = x + 3 * y proc singlearg(x:int):int = 20*x echo optarg 1, singlearg 2 @@ -13,5 +15,9 @@ proc foo(x, y: int): int = x-y let x = optarg foo 7.foo let y = singlearg foo(1, foo 8) +let z = singlearg 1.foo foo 8 + +echo x, y, z -echo x, y +let a = [2,4,8].map do (d:int) -> int: d + 1 +echo a[0], a[1], a[2] \ No newline at end of file From 5bd3ec0bfb77a1a7342a183876e45c333b804345 Mon Sep 17 00:00:00 2001 From: ReneSac <reneduani@yahoo.com.br> Date: Mon, 3 Feb 2014 01:12:27 -0200 Subject: [PATCH 311/326] Remove spurious import added in the last commit. --- tests/parser/tcommand_as_expr.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parser/tcommand_as_expr.nim b/tests/parser/tcommand_as_expr.nim index 3c02f8cb3d..22c49ab3f2 100644 --- a/tests/parser/tcommand_as_expr.nim +++ b/tests/parser/tcommand_as_expr.nim @@ -3,7 +3,7 @@ discard """ 5-120-120 359''' """ -import math +#import math proc optarg(x:int, y:int = 0):int = x + 3 * y proc singlearg(x:int):int = 20*x From 99352c1e4c4889b3b1050ee496818fe25ca7d171 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 3 Feb 2014 17:35:03 +0100 Subject: [PATCH 312/326] macro tests almost green --- compiler/semstmts.nim | 3 +++ compiler/types.nim | 3 ++- compiler/vm.nim | 6 ++++-- compiler/vmgen.nim | 31 +++++++++++++++++-------------- lib/core/macros.nim | 28 ++++++++++++++-------------- tests/macros/tdumpast.nim | 2 +- tests/macros/tdumpast2.nim | 2 +- tests/macros/tmacrogenerics.nim | 6 ++---- tests/macros/tmacrotypes.nim | 4 ++++ tests/macros/tmemit.nim | 2 +- todo.txt | 9 ++++++++- 11 files changed, 57 insertions(+), 39 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 25353fdd7b..d3cc1a12e6 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -972,6 +972,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, else: s = n[namePos].sym typeIsDetermined = s.typ == nil + s.ast = n + s.scope = c.currentScope + # if typeIsDetermined: assert phase == stepCompileBody # else: assert phase == stepDetermineType # before compiling the proc body, set as current the scope diff --git a/compiler/types.nim b/compiler/types.nim index cd703474e6..812cd4e93a 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -47,7 +47,8 @@ proc equalParams*(a, b: PNode): TParamsEquality # returns whether the parameter lists of the procs a, b are exactly the same proc isOrdinalType*(t: PType): bool proc enumHasHoles*(t: PType): bool -const +# XXX it is WRONG to include tyTypeDesc here as that might not have any child! +const abstractPtrs* = {tyVar, tyPtr, tyRef, tyGenericInst, tyDistinct, tyOrdinal, tyConst, tyMutable, tyTypeDesc} abstractVar* = {tyVar, tyGenericInst, tyDistinct, tyOrdinal, diff --git a/compiler/vm.nim b/compiler/vm.nim index aec76f307e..61881a8977 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1047,7 +1047,9 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # XXX only supports 'name' for now; we can use regC to encode the # type trait operation decodeB(nkStrLit) - let typ = regs[rb].sym.typ.skipTypes({tyTypeDesc}) + var typ = regs[rb].typ + internalAssert typ != nil + while typ.kind == tyTypeDesc and typ.len > 0: typ = typ.sons[0] regs[ra].strVal = typ.typeToString(preferExported) of opcGlobalOnce: let rb = instr.regBx @@ -1178,7 +1180,7 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = # doesn't end up in the parameter: #InternalAssert tos.slots.len >= L # return value: - tos.slots[0] = newNodeIT(nkNilLit, n.info, sym.typ.sons[0]) + tos.slots[0] = newNodeIT(nkEmpty, n.info, sym.typ.sons[0]) # setup parameters: for i in 1 .. < min(tos.slots.len, L): tos.slots[i] = setupMacroParam(n.sons[i]) diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index e0ff5b2350..be32f990f0 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -109,7 +109,7 @@ proc patch(c: PCtx, p: TPosition) = uint32(diff+wordExcess) shl 16'u32).TInstr proc getSlotKind(t: PType): TSlotKind = - case t.skipTypes(abstractRange).kind + case t.skipTypes(abstractRange-{tyTypeDesc}).kind of tyBool, tyChar, tyEnum, tyOrdinal, tyInt..tyInt64, tyUInt..tyUInt64: slotTempInt of tyString, tyCString: @@ -409,7 +409,7 @@ proc genTry(c: PCtx; n: PNode; dest: var TDest) = let endExcept = c.xjmp(it, opcExcept, 0) for j in countup(0, blen - 2): assert(it.sons[j].kind == nkType) - let typ = it.sons[j].typ.skipTypes(abstractPtrs) + let typ = it.sons[j].typ.skipTypes(abstractPtrs-{tyTypeDesc}) c.gABx(it, opcExcept, 0, c.genType(typ)) if blen == 1: # general except section: @@ -479,7 +479,7 @@ proc genNew(c: PCtx; n: PNode) = # we use the ref's base type here as the VM conflates 'ref object' # and 'object' since internally we already have a pointer. c.gABx(n, opcNew, dest, - c.genType(n.sons[1].typ.skipTypes(abstractVar).sons[0])) + c.genType(n.sons[1].typ.skipTypes(abstractVar-{tyTypeDesc}).sons[0])) c.genAsgnPatch(n.sons[1], dest) c.freeTemp(dest) @@ -487,7 +487,8 @@ proc genNewSeq(c: PCtx; n: PNode) = let dest = if needsAsgnPatch(n.sons[1]): c.getTemp(n.sons[1].typ) else: c.genx(n.sons[1]) let tmp = c.genx(n.sons[2]) - c.gABx(n, opcNewSeq, dest, c.genType(n.sons[1].typ.skipTypes(abstractVar))) + c.gABx(n, opcNewSeq, dest, c.genType(n.sons[1].typ.skipTypes( + abstractVar-{tyTypeDesc}))) c.gABx(n, opcNewSeq, tmp, 0) c.freeTemp(tmp) c.genAsgnPatch(n.sons[1], dest) @@ -515,7 +516,7 @@ proc genBinaryABC(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode) = c.freeTemp(tmp2) proc genSetType(c: PCtx; n: PNode; dest: TRegister) = - let t = skipTypes(n.typ, abstractInst) + let t = skipTypes(n.typ, abstractInst-{tyTypeDesc}) if t.kind == tySet: c.gABx(n, opcSetType, dest, c.genType(t)) @@ -746,7 +747,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = var tmp = c.genx(n.sons[1]) var idx = c.getTemp(getSysType(tyInt)) var typ = n.sons[2].typ - if m == mOf: typ = typ.skipTypes(abstractPtrs) + if m == mOf: typ = typ.skipTypes(abstractPtrs-{tyTypeDesc}) c.gABx(n, opcLdImmInt, idx, c.genType(typ)) c.gABC(n, if m == mOf: opcOf else: opcIs, dest, tmp, idx) c.freeTemp(tmp) @@ -756,7 +757,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) = of mHigh: if dest < 0: dest = c.getTemp(n.typ) let tmp = c.genx(n.sons[1]) - if n.sons[1].typ.skipTypes(abstractVar).kind == tyString: + if n.sons[1].typ.skipTypes(abstractVar-{tyTypeDesc}).kind == tyString: c.gABI(n, opcLenStr, dest, tmp, 1) else: c.gABI(n, opcLenSeq, dest, tmp, 1) @@ -891,7 +892,7 @@ const tyUInt, tyUInt8, tyUInt16, tyUInt32, tyUInt64} proc requiresCopy(n: PNode): bool = - if n.typ.skipTypes(abstractInst).kind in atomicTypes: + if n.typ.skipTypes(abstractInst-{tyTypeDesc}).kind in atomicTypes: result = false elif n.kind in ({nkCurly, nkBracket, nkPar, nkObjConstr}+nkCallKinds): result = false @@ -899,7 +900,7 @@ proc requiresCopy(n: PNode): bool = result = true proc unneededIndirection(n: PNode): bool = - n.typ.skipTypes(abstractInst).kind == tyRef + n.typ.skipTypes(abstractInst-{tyTypeDesc}).kind == tyRef proc skipDeref(n: PNode): PNode = if n.kind in {nkDerefExpr, nkHiddenDeref} and unneededIndirection(n.sons[0]): @@ -920,7 +921,7 @@ proc genAddrDeref(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode; c.freeTemp(tmp) proc whichAsgnOpc(n: PNode): TOpcode = - case n.typ.skipTypes(abstractRange).kind + case n.typ.skipTypes(abstractRange-{tyTypeDesc}).kind of tyBool, tyChar, tyEnum, tyOrdinal, tyInt..tyInt64, tyUInt..tyUInt64: opcAsgnInt of tyString, tyCString: @@ -932,7 +933,7 @@ proc whichAsgnOpc(n: PNode): TOpcode = else: opcAsgnComplex -proc isRef(t: PType): bool = t.skipTypes(abstractRange).kind == tyRef +proc isRef(t: PType): bool = t.skipTypes(abstractRange-{tyTypeDesc}).kind == tyRef proc whichAsgnOpc(n: PNode; opc: TOpcode): TOpcode = if isRef(n.typ): succ(opc) else: opc @@ -951,7 +952,8 @@ proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) = let dest = c.genx(le.sons[0]) let idx = c.genx(le.sons[1]) let tmp = c.genx(ri) - if le.sons[0].typ.skipTypes(abstractVarRange).kind in {tyString, tyCString}: + if le.sons[0].typ.skipTypes(abstractVarRange-{tyTypeDesc}).kind in { + tyString, tyCString}: c.gABC(le, opcWrStrIdx, dest, idx, tmp) else: c.gABC(le, whichAsgnOpc(le, opcWrArr), dest, idx, tmp) @@ -1062,7 +1064,8 @@ proc genCheckedObjAccess(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) = genAccess(c, n.sons[0], dest, opcLdObj, flags) proc genArrAccess(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) = - if n.sons[0].typ.skipTypes(abstractVarRange).kind in {tyString, tyCString}: + if n.sons[0].typ.skipTypes(abstractVarRange-{tyTypeDesc}).kind in { + tyString, tyCString}: genAccess(c, n, dest, opcLdStrIdx, {}) else: genAccess(c, n, dest, opcLdArr, flags) @@ -1207,7 +1210,7 @@ proc genSetConstr(c: PCtx, n: PNode, dest: var TDest) = proc genObjConstr(c: PCtx, n: PNode, dest: var TDest) = if dest < 0: dest = c.getTemp(n.typ) - let t = n.typ.skipTypes(abstractRange) + let t = n.typ.skipTypes(abstractRange-{tyTypeDesc}) if t.kind == tyRef: c.gABx(n, opcNew, dest, c.genType(t.sons[0])) else: diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 3b36e31e0b..585ccf8692 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -294,19 +294,6 @@ proc quote*(bl: stmt, op = "``"): PNimrodNode {.magic: "QuoteAst".} ## if not `ex`: ## echo `info` & ": Check failed: " & `expString` -when not defined(booting): - template emit*(e: static[string]): stmt = - ## accepts a single string argument and treats it as nimrod code - ## that should be inserted verbatim in the program - ## Example: - ## - ## .. code-block:: nimrod - ## emit("echo " & '"' & "hello world".toUpper & '"') - ## - macro payload: stmt {.gensym.} = - result = e.parseStmt - payload() - proc expectKind*(n: PNimrodNode, k: TNimrodNodeKind) {.compileTime.} = ## checks that `n` is of kind `k`. If this is not the case, ## compilation aborts with an error message. This is useful for writing @@ -421,7 +408,8 @@ proc lispRepr*(n: PNimrodNode): string {.compileTime.} = of nnkFloatLit..nnkFloat64Lit: add(result, $n.floatVal) of nnkStrLit..nnkTripleStrLit: add(result, $n.strVal) of nnkIdent: add(result, "!\"" & $n.ident & '"') - of nnkSym, nnkNone: assert false + of nnkSym: add(result, $n.symbol) + of nnkNone: assert false else: add(result, lispRepr(n[0])) for j in 1..n.len-1: @@ -745,3 +733,15 @@ proc addIdentIfAbsent*(dest: PNimrodNode, ident: string) {.compiletime.} = else: discard dest.add(ident(ident)) +when not defined(booting): + template emit*(e: static[string]): stmt = + ## accepts a single string argument and treats it as nimrod code + ## that should be inserted verbatim in the program + ## Example: + ## + ## .. code-block:: nimrod + ## emit("echo " & '"' & "hello world".toUpper & '"') + ## + macro payload: stmt {.gensym.} = + result = parseStmt(e) + payload() diff --git a/tests/macros/tdumpast.nim b/tests/macros/tdumpast.nim index 55a964327c..160e4e1940 100644 --- a/tests/macros/tdumpast.nim +++ b/tests/macros/tdumpast.nim @@ -2,7 +2,7 @@ import macros -template plus(a, b: expr): expr = +template plus(a, b: expr): expr {.dirty} = a + b macro call(e: expr): expr = diff --git a/tests/macros/tdumpast2.nim b/tests/macros/tdumpast2.nim index c6eab39a9a..2a7024a017 100644 --- a/tests/macros/tdumpast2.nim +++ b/tests/macros/tdumpast2.nim @@ -7,7 +7,7 @@ proc dumpit(n: PNimrodNode): string {.compileTime.} = result = $n.kind add(result, "(") case n.kind - of nnkEmpty: nil # same as nil node in this representation + of nnkEmpty: discard # same as nil node in this representation of nnkNilLit: add(result, "nil") of nnkCharLit..nnkInt64Lit: add(result, $n.intVal) of nnkFloatLit..nnkFloat64Lit: add(result, $n.floatVal) diff --git a/tests/macros/tmacrogenerics.nim b/tests/macros/tmacrogenerics.nim index 5ae59e0da4..b886f4fa54 100644 --- a/tests/macros/tmacrogenerics.nim +++ b/tests/macros/tmacrogenerics.nim @@ -1,10 +1,8 @@ discard """ file: "tmacrogenerics.nim" msg: ''' -instantiation 1 with int and float -instantiation 2 with float and string -instantiation 3 with string and string -counter: 3 +instantiation 1 with typedesc and typedesc +counter: 1 ''' output: "int\nfloat\nint\nstring" """ diff --git a/tests/macros/tmacrotypes.nim b/tests/macros/tmacrotypes.nim index 7697dba27e..f19aa2ddb8 100644 --- a/tests/macros/tmacrotypes.nim +++ b/tests/macros/tmacrotypes.nim @@ -1,3 +1,7 @@ +discard """ + disabled: true +""" + import macros, typetraits macro checkType(ex, expected: expr): stmt {.immediate.} = diff --git a/tests/macros/tmemit.nim b/tests/macros/tmemit.nim index e4bb2daedc..6fb2f3b659 100644 --- a/tests/macros/tmemit.nim +++ b/tests/macros/tmemit.nim @@ -1,5 +1,5 @@ discard """ - out: '''HELLO WORLD''' + output: '''HELLO WORLD''' """ import macros, strutils diff --git a/todo.txt b/todo.txt index bad9373a14..8bf3ff239a 100644 --- a/todo.txt +++ b/todo.txt @@ -1,11 +1,18 @@ version 0.9.4 ============= +- fix macros\tstringinterp.nim +- test and fix showoff; add debug example to showoff +- test and fix stdlib +- test and fix misc +- fix GC issues +- test C source code generation +- test and fix closures +- test and fix exception handling Bugs ==== -- fix eval in macros.nim - new VM: - implement overflow checking - bug: 'type T = ref T' not recognized as illegal recursion From c69d167fa9e6e3bf5aadd8f5910eaf79b3667e70 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Mon, 3 Feb 2014 19:00:05 +0100 Subject: [PATCH 313/326] updated todo.txt --- todo.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/todo.txt b/todo.txt index 8bf3ff239a..fd424ad5e4 100644 --- a/todo.txt +++ b/todo.txt @@ -9,6 +9,8 @@ version 0.9.4 - test C source code generation - test and fix closures - test and fix exception handling +- implement 'union' and 'bits' pragmas + Bugs ==== From 51076a0be6900602e5fc092e52021370937a85f7 Mon Sep 17 00:00:00 2001 From: Charlie Barto <barcharcraz@msn.com> Date: Mon, 3 Feb 2014 23:54:01 -0500 Subject: [PATCH 314/326] added good error for stuff like string[int] or int[int] --- compiler/semtypes.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 408b1b62e0..a434effed2 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -885,6 +885,11 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = for i in countup(1, sonsLen(n)-1): var elem = semGenericParamInInvokation(c, n.sons[i]) addToResult(elem) + elif s.typ.kind != tyGenericBody: + #we likely got code of the form TypeA[TypeB] where TypeA is + #not generic. + localError(n.info, errNoGenericParamsAllowedForX, s.name.s) + return newOrPrevType(tyError, prev, c) else: internalAssert s.typ.kind == tyGenericBody From 7cfec910576c3a9f3401aae99f9209716d02f689 Mon Sep 17 00:00:00 2001 From: Charlie Barto <barcharcraz@msn.com> Date: Tue, 4 Feb 2014 00:07:17 -0500 Subject: [PATCH 315/326] deleted assert that would never fire because it turned into an error message --- compiler/semtypes.nim | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index a434effed2..789ff55f09 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -891,7 +891,6 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = localError(n.info, errNoGenericParamsAllowedForX, s.name.s) return newOrPrevType(tyError, prev, c) else: - internalAssert s.typ.kind == tyGenericBody var m = newCandidate(c, s, n) matches(c, n, copyTree(n), m) From c097acedd30602fba903ed4ee132b5e5bae91017 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Tue, 4 Feb 2014 17:29:34 +0100 Subject: [PATCH 316/326] bugfix: immediate templates are preferred consistently (danger: breaks code) --- compiler/astalgo.nim | 33 +++++++++++++++++++++------- compiler/lookups.nim | 14 +++++++++++- tests/template/tprefer_immediate.nim | 17 ++++++++++++++ todo.txt | 1 - 4 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 tests/template/tprefer_immediate.nim diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 2505bc6879..64c1b717c3 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -561,14 +561,31 @@ proc strTableContains(t: TStrTable, n: PSym): bool = proc strTableRawInsert(data: var TSymSeq, n: PSym) = var h: THash = n.name.h and high(data) - while data[h] != nil: - if data[h] == n: - # allowed for 'export' feature: - #InternalError(n.info, "StrTableRawInsert: " & n.name.s) - return - h = nextTry(h, high(data)) - assert(data[h] == nil) - data[h] = n + if sfImmediate notin n.flags: + # fast path: + while data[h] != nil: + if data[h] == n: + # allowed for 'export' feature: + #InternalError(n.info, "StrTableRawInsert: " & n.name.s) + return + h = nextTry(h, high(data)) + assert(data[h] == nil) + data[h] = n + else: + # slow path; we have to ensure immediate symbols are preferred for + # symbol lookups. + # consider the chain: foo (immediate), foo, bar, bar (immediate) + # then bar (immediate) gets replaced with foo (immediate) and the non + # immediate foo is picked! Thus we need to replace it with the first + # slot that has in fact the same identifier stored in it! + var favPos = -1 + while data[h] != nil: + if data[h] == n: return + if favPos < 0 and data[h].name.id == n.name.id: favPos = h + h = nextTry(h, high(data)) + assert(data[h] == nil) + data[h] = n + if favPos >= 0: swap data[h], data[favPos] proc symTabReplaceRaw(data: var TSymSeq, prevSym: PSym, newSym: PSym) = assert prevSym.name.h == newSym.name.h diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 6dfd259686..c31eb3121d 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -339,4 +339,16 @@ proc nextOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = n.sons[0].sym.name, o.inSymChoice) if result != nil and result.kind == skStub: loadStub(result) - + +when false: + proc qualifiedLookUpPreferImmediate*(c: PContext, n: PNode, + flags = {checkUndeclared}): PSym = + var o: TOverloadIter + result = initOverloadIter(o, c, n) + var a = result + while a != nil: + if sfImmediate in a.flags: return a + a = nextOverloadIter(o, c, n) + if result == nil and checkUndeclared in flags: + localError(n.info, errUndeclaredIdentifier, n.considerAcc.s) + result = errorSym(c, n) diff --git a/tests/template/tprefer_immediate.nim b/tests/template/tprefer_immediate.nim new file mode 100644 index 0000000000..578f447b02 --- /dev/null +++ b/tests/template/tprefer_immediate.nim @@ -0,0 +1,17 @@ +discard """ + output: '''immediate''' +""" + +# Test that immediate templates are preferred over non-immediate templates + +template foo(a, b: expr) = echo "foo expr" + +template foo(a, b: int) = echo "foo int" +template foo(a, b: float) = echo "foo float" +template foo(a, b: string) = echo "foo string" +template foo(a, b: expr) {.immediate.} = echo "immediate" +template foo(a, b: bool) = echo "foo bool" +template foo(a, b: char) = echo "foo char" + +foo(undeclaredIdentifier, undeclaredIdentifier2) + diff --git a/todo.txt b/todo.txt index fd424ad5e4..6f8726199e 100644 --- a/todo.txt +++ b/todo.txt @@ -22,7 +22,6 @@ Bugs - compilation of niminst takes way too long. looks like a regression - docgen: sometimes effects are listed twice - 'result' is not properly cleaned for NRVO --> use uninit checking instead -- sneaking with qualifiedLookup() is really broken! - blocks can "export" an identifier but the CCG generates {} for them ... - osproc execProcesses can deadlock if all processes fail (as experienced in c++ mode) From d912d1837963b11e1df622c7b41e39827f95599c Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Wed, 5 Feb 2014 23:43:13 +0100 Subject: [PATCH 317/326] tyTypeDesc and tyRange always have 1 child; this might be tyNone but it is required for skipTypes --- compiler/ast.nim | 6 +++--- compiler/sem.nim | 4 +++- compiler/semdata.nim | 1 + compiler/semstmts.nim | 4 ++-- compiler/semtypes.nim | 35 +++++++++++++++++++++++------------ compiler/semtypinst.nim | 2 +- compiler/sigmatch.nim | 19 ++++++++++--------- compiler/types.nim | 4 ++-- compiler/vmgen.nim | 23 ++++++++++++----------- tests/macros/tdebugstmt.nim | 29 +++++++++++++++++++++++++++++ todo.txt | 2 +- 11 files changed, 87 insertions(+), 42 deletions(-) create mode 100644 tests/macros/tdebugstmt.nim diff --git a/compiler/ast.nim b/compiler/ast.nim index 7138b5f52a..cd002eef1f 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1129,7 +1129,7 @@ proc newType(kind: TTypeKind, owner: PSym): PType = result.align = 2 # default alignment result.id = getID() when debugIds: - RegisterId(result) + registerId(result) #if result.id < 2000 then # MessageOut(typeKindToStr[kind] & ' has id: ' & toString(result.id)) @@ -1166,7 +1166,7 @@ proc copyType(t: PType, owner: PSym, keepId: bool): PType = if keepId: result.id = t.id else: - when debugIds: RegisterId(result) + when debugIds: registerId(result) result.sym = t.sym # backend-info should not be copied proc copySym(s: PSym, keepId: bool = false): PSym = @@ -1177,7 +1177,7 @@ proc copySym(s: PSym, keepId: bool = false): PSym = result.id = s.id else: result.id = getID() - when debugIds: RegisterId(result) + when debugIds: registerId(result) result.flags = s.flags result.magic = s.magic if s.kind == skModule: diff --git a/compiler/sem.nim b/compiler/sem.nim index e89e32f4e0..00ac79716a 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -83,7 +83,9 @@ proc commonType*(x, y: PType): PType = elif a.kind == tyTypeDesc: # turn any concrete typedesc into the abstract typedesc type if a.sons == nil: result = a - else: result = newType(tyTypeDesc, a.owner) + else: + result = newType(tyTypeDesc, a.owner) + rawAddSon(result, newType(tyNone, a.owner)) elif b.kind in {tyArray, tyArrayConstr, tySet, tySequence} and a.kind == b.kind: # check for seq[empty] vs. seq[int] diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 8b97f36859..c9d95e1bf4 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -211,6 +211,7 @@ proc makeTypeDesc*(c: PContext, typ: PType): PType = proc makeTypeSymNode*(c: PContext, typ: PType, info: TLineInfo): PNode = let typedesc = makeTypeDesc(c, typ) + rawAddSon(typedesc, newTypeS(tyNone, c)) let sym = newSym(skType, idAnon, getCurrOwner(), info).linkTo(typedesc) return newSymNode(sym, info) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index d3cc1a12e6..0871b7fb7a 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -740,7 +740,7 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) = # we fill it out later. For magic generics like 'seq', it won't be filled # so we use tyEmpty instead of nil to not crash for strange conversions # like: mydata.seq - rawAddSon(s.typ, newTypeS(tyEmpty, c)) + rawAddSon(s.typ, newTypeS(tyNone, c)) s.ast = a inc c.inGenericContext var body = semTypeNode(c, a.sons[2], nil) @@ -748,7 +748,7 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) = if body != nil: body.sym = s body.size = -1 # could not be computed properly - s.typ.sons[sonsLen(s.typ) - 1] = body + s.typ.sons[sonsLen(s.typ) - 1] = body popOwner() closeScope(c) elif a.sons[2].kind != nkEmpty: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 408b1b62e0..6f2d9ece9d 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -681,12 +681,12 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode, of tySequence, tySet, tyArray, tyOpenArray, tyVar, tyPtr, tyRef, tyProc: # XXX: this is a bit strange, but proc(s: seq) - # produces tySequence(tyGenericParam, null). + # produces tySequence(tyGenericParam, tyNone). # This also seems to be true when creating aliases # like: type myseq = distinct seq. # Maybe there is another better place to associate # the seq type class with the seq identifier. - if paramType.kind == tySequence and paramType.lastSon == nil: + if paramType.kind == tySequence and paramType.lastSon.kind == tyNone: let typ = c.newTypeWithSons(tyBuiltInTypeClass, @[newTypeS(paramType.kind, c)]) result = addImplicitGeneric(typ) @@ -1133,15 +1133,26 @@ proc processMagicType(c: PContext, m: PSym) = of mNil: setMagicType(m, tyNil, ptrSize) of mExpr: setMagicType(m, tyExpr, 0) of mStmt: setMagicType(m, tyStmt, 0) - of mTypeDesc: setMagicType(m, tyTypeDesc, 0) + of mTypeDesc: + setMagicType(m, tyTypeDesc, 0) + rawAddSon(m.typ, newTypeS(tyNone, c)) of mVoidType: setMagicType(m, tyEmpty, 0) - of mArray: setMagicType(m, tyArray, 0) - of mOpenArray: setMagicType(m, tyOpenArray, 0) - of mVarargs: setMagicType(m, tyVarargs, 0) - of mRange: setMagicType(m, tyRange, 0) - of mSet: setMagicType(m, tySet, 0) - of mSeq: setMagicType(m, tySequence, 0) - of mOrdinal: setMagicType(m, tyOrdinal, 0) + of mArray: + setMagicType(m, tyArray, 0) + of mOpenArray: + setMagicType(m, tyOpenArray, 0) + of mVarargs: + setMagicType(m, tyVarargs, 0) + of mRange: + setMagicType(m, tyRange, 0) + rawAddSon(m.typ, newTypeS(tyNone, c)) + of mSet: + setMagicType(m, tySet, 0) + of mSeq: + setMagicType(m, tySequence, 0) + of mOrdinal: + setMagicType(m, tyOrdinal, 0) + rawAddSon(m.typ, newTypeS(tyNone, c)) of mPNimrodNode: discard else: localError(m.info, errTypeExpected) @@ -1165,8 +1176,8 @@ proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode = typ = semTypeNode(c, constraint, nil) if typ.kind != tyStatic or typ.len == 0: if typ.kind == tyTypeDesc: - if typ.len == 0: - typ = newTypeS(tyTypeDesc, c) + if typ.sons[0].kind == tyNone: + typ = newTypeWithSons(c, tyTypeDesc, @[newTypeS(tyNone, c)]) else: typ = semGenericConstraints(c, typ) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 1158335a85..a07d912414 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -358,7 +358,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = if lookup != nil: result = lookup if tfUnresolved in t.flags: result = result.base - elif t.sonsLen > 0: + elif t.sons[0].kind != tyNone: result = makeTypeDesc(cl.c, replaceTypeVarsT(cl, t.sons[0])) of tyUserTypeClass: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index d269e9e693..f9200ea0c3 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -562,10 +562,11 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = #if result < isGeneric: result = isNone if result notin {isNone, isGeneric}: result = typeRangeRel(f, a) - elif skipTypes(f, {tyRange}).kind == a.kind: - result = isIntConv - elif isConvertibleToRange(skipTypes(f, {tyRange}), a): - result = isConvertible # a convertible to f + else: + if skipTypes(f, {tyRange}).kind == a.kind: + result = isIntConv + elif isConvertibleToRange(skipTypes(f, {tyRange}), a): + result = isConvertible # a convertible to f of tyInt: result = handleRange(f, a, tyInt8, tyInt32) of tyInt8: result = handleRange(f, a, tyInt8, tyInt8) of tyInt16: result = handleRange(f, a, tyInt8, tyInt16) @@ -636,7 +637,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = of tyOrdinal: if isOrdinalType(a): var x = if a.kind == tyOrdinal: a.sons[0] else: a - if f.sonsLen == 0: + if f.sons[0].kind == tyNone: result = isGeneric else: result = typeRel(c, f.sons[0], x) @@ -736,7 +737,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = of tyGenericInst: let roota = a.skipGenericAlias let rootf = f.skipGenericAlias - if a.kind == tyGenericInst and roota.base == rootf.base : + if a.kind == tyGenericInst and roota.base == rootf.base: for i in 1 .. rootf.sonsLen-2: let ff = rootf.sons[i] let aa = roota.sons[i] @@ -845,7 +846,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = # by a tyTypeDesc params. Unfortunately, this requires more substantial # changes in semtypinst and elsewhere. if a.kind == tyTypeDesc: - if f.sons == nil or f.sons.len == 0: + if f.sonsLen == 0: result = isGeneric else: internalAssert a.sons != nil and a.sons.len > 0 @@ -854,7 +855,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = else: result = isNone else: - if f.sonsLen > 0: + if f.sonsLen > 0 and f.sons[0].kind != tyNone: result = typeRel(c, f.lastSon, a) else: result = isGeneric @@ -883,7 +884,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation = var prev = PType(idTableGet(c.bindings, f)) if prev == nil: if a.kind == tyTypeDesc: - if f.sonsLen == 0: + if f.sons[0].kind == tyNone: result = isGeneric else: result = typeRel(c, f.sons[0], a.sons[0]) diff --git a/compiler/types.nim b/compiler/types.nim index 812cd4e93a..db75cd3c0f 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -47,7 +47,7 @@ proc equalParams*(a, b: PNode): TParamsEquality # returns whether the parameter lists of the procs a, b are exactly the same proc isOrdinalType*(t: PType): bool proc enumHasHoles*(t: PType): bool -# XXX it is WRONG to include tyTypeDesc here as that might not have any child! + const abstractPtrs* = {tyVar, tyPtr, tyRef, tyGenericInst, tyDistinct, tyOrdinal, tyConst, tyMutable, tyTypeDesc} @@ -1258,7 +1258,7 @@ proc containsGenericTypeIter(t: PType, closure: PObject): bool = return true if t.kind == tyTypeDesc: - if t.sonsLen == 0: return true + if t.sons[0].kind == tyNone: return true if containsGenericTypeIter(t.base, closure): return true return false diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index be32f990f0..313c43dc44 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -946,6 +946,14 @@ proc genAsgn(c: PCtx; dest: TDest; ri: PNode; requiresCopy: bool) = template isGlobal(s: PSym): bool = sfGlobal in s.flags and s.kind != skForVar +proc setSlot(c: PCtx; v: PSym) = + # XXX generate type initialization here? + if v.position == 0: + v.position = c.prc.maxSlots + c.prc.slots[v.position] = (inUse: true, + kind: if v.kind == skLet: slotFixedLet else: slotFixedVar) + inc c.prc.maxSlots + proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) = case le.kind of nkBracketExpr: @@ -973,8 +981,9 @@ proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) = gen(c, ri, tmp) c.gABx(le, whichAsgnOpc(le, opcWrGlobal), tmp, s.position) else: + if s.kind == skForVar and c.mode == emRepl: c.setSlot s internalAssert s.position > 0 or (s.position == 0 and - s.kind in {skParam,skResult,skForVar}) + s.kind in {skParam,skResult}) var dest: TRegister = s.position + ord(s.kind == skParam) gen(c, ri, dest) else: @@ -1035,8 +1044,9 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = else: c.gABx(n, opcLdGlobal, dest, s.position) else: + if s.kind == skForVar and c.mode == emRepl: c.setSlot s if s.position > 0 or (s.position == 0 and - s.kind in {skParam,skResult,skForVar}): + s.kind in {skParam,skResult}): if dest < 0: dest = s.position + ord(s.kind == skParam) else: @@ -1045,7 +1055,6 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = else: # see tests/t99bott for an example that triggers it: cannotEval(n) - #InternalError(n.info, s.name.s & " " & $s.position) proc genAccess(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode; flags: TGenFlags) = @@ -1123,14 +1132,6 @@ proc getNullValue(typ: PType, info: TLineInfo): PNode = result = newNodeIT(nkCurly, info, t) else: internalError("getNullValue: " & $t.kind) -proc setSlot(c: PCtx; v: PSym) = - # XXX generate type initialization here? - if v.position == 0: - v.position = c.prc.maxSlots - c.prc.slots[v.position] = (inUse: true, - kind: if v.kind == skLet: slotFixedLet else: slotFixedVar) - inc c.prc.maxSlots - proc genVarSection(c: PCtx; n: PNode) = for a in n: if a.kind == nkCommentStmt: continue diff --git a/tests/macros/tdebugstmt.nim b/tests/macros/tdebugstmt.nim new file mode 100644 index 0000000000..865dc436a9 --- /dev/null +++ b/tests/macros/tdebugstmt.nim @@ -0,0 +1,29 @@ +discard """ + output: '''a[0]: 42 +a[1]: 45 +x: some string''' +""" + +import macros + +macro debug(n: varargs[expr]): stmt = + # `n` is a Nimrod AST that contains the whole macro invocation + # this macro returns a list of statements: + result = newNimNode(nnkStmtList, n) + # iterate over any argument that is passed to this macro: + for i in 0..n.len-1: + # add a call to the statement list that writes the expression; + # `toStrLit` converts an AST to its string representation: + add(result, newCall("write", newIdentNode("stdout"), toStrLit(n[i]))) + # add a call to the statement list that writes ": " + add(result, newCall("write", newIdentNode("stdout"), newStrLitNode(": "))) + # add a call to the statement list that writes the expressions value: + add(result, newCall("writeln", newIdentNode("stdout"), n[i])) + +var + a: array [0..10, int] + x = "some string" +a[0] = 42 +a[1] = 45 + +debug(a[0], a[1], x) diff --git a/todo.txt b/todo.txt index 6f8726199e..fef073f90d 100644 --- a/todo.txt +++ b/todo.txt @@ -2,7 +2,7 @@ version 0.9.4 ============= - fix macros\tstringinterp.nim -- test and fix showoff; add debug example to showoff +- test and fix showoff - test and fix stdlib - test and fix misc - fix GC issues From 8215a32eddb10bb6dda056adff3d330baae73fc8 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Wed, 5 Feb 2014 23:46:55 +0100 Subject: [PATCH 318/326] case consistency for -d:useWinAnsi --- lib/pure/os.nim | 4 ++-- lib/pure/osproc.nim | 4 ++-- lib/windows/winlean.nim | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 245a8446bb..bb70f28b66 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1078,9 +1078,9 @@ when defined(windows): while true: var eend = strEnd(e) add(environment, $e) - e = cast[CString](cast[TAddress](eend)+1) + e = cast[cstring](cast[TAddress](eend)+1) if eend[1] == '\0': break - discard FreeEnvironmentStringsA(env) + discard freeEnvironmentStringsA(env) envComputed = true else: diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 9975bfcb3f..6df85bbc6a 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -455,7 +455,7 @@ when defined(Windows) and not defined(useNimRtl): ee, wwd, si, procInfo) else: success = winlean.createProcessA(nil, - cmdl, nil, nil, 1, NORMAL_PRIORITY_CLASS, e, wd, SI, ProcInfo) + cmdl, nil, nil, 1, NORMAL_PRIORITY_CLASS, e, wd, si, procInfo) let lastError = osLastError() if poParentStreams notin options: @@ -534,7 +534,7 @@ when defined(Windows) and not defined(useNimRtl): NORMAL_PRIORITY_CLASS, nil, nil, si, procInfo) else: var res = winlean.createProcessA(nil, command, nil, nil, 0, - NORMAL_PRIORITY_CLASS, nil, nil, SI, ProcInfo) + NORMAL_PRIORITY_CLASS, nil, nil, si, procInfo) if res == 0: osError(osLastError()) else: diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index ee5fe06470..5b641185eb 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -195,14 +195,14 @@ else: importc: "GetCurrentDirectoryA", dynlib: "kernel32", stdcall.} proc setCurrentDirectoryA*(lpPathName: cstring): int32 {. importc: "SetCurrentDirectoryA", dynlib: "kernel32", stdcall.} - proc createDirectoryA*(pathName: cstring, security: Pointer=nil): int32 {. + proc createDirectoryA*(pathName: cstring, security: pointer=nil): int32 {. importc: "CreateDirectoryA", dynlib: "kernel32", stdcall.} proc removeDirectoryA*(lpPathName: cstring): int32 {. importc: "RemoveDirectoryA", dynlib: "kernel32", stdcall.} proc setEnvironmentVariableA*(lpName, lpValue: cstring): int32 {. stdcall, dynlib: "kernel32", importc: "SetEnvironmentVariableA".} - proc getModuleFileNameA*(handle: THandle, buf: CString, size: int32): int32 {. + proc getModuleFileNameA*(handle: THandle, buf: cstring, size: int32): int32 {. importc: "GetModuleFileNameA", dynlib: "kernel32", stdcall.} when useWinUnicode: @@ -300,7 +300,7 @@ else: dwFileAttributes: int32): WINBOOL {. stdcall, dynlib: "kernel32", importc: "SetFileAttributesA".} - proc copyFileA*(lpExistingFileName, lpNewFileName: CString, + proc copyFileA*(lpExistingFileName, lpNewFileName: cstring, bFailIfExists: cint): cint {. importc: "CopyFileA", stdcall, dynlib: "kernel32".} From 550b5d9aeac9afda613406e3fe4bc243ea7f78d4 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 6 Feb 2014 00:27:01 +0100 Subject: [PATCH 319/326] stdlib compiles mostly without warnings again --- lib/pure/asyncio.nim | 2 +- lib/pure/htmlparser.nim | 4 ++-- lib/pure/irc.nim | 4 ++-- lib/pure/matchers.nim | 2 +- lib/pure/oids.nim | 2 +- lib/pure/parsecsv.nim | 2 +- lib/pure/parsesql.nim | 6 +++--- lib/pure/xmlparser.nim | 4 ++-- todo.txt | 4 +--- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/pure/asyncio.nim b/lib/pure/asyncio.nim index f13cadaa2d..96afc6f4f9 100644 --- a/lib/pure/asyncio.nim +++ b/lib/pure/asyncio.nim @@ -689,5 +689,5 @@ when isMainModule: server.listen() d.register(server) - while d.poll(-1): nil + while d.poll(-1): discard diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim index 060f0e3866..c38eb70634 100644 --- a/lib/pure/htmlparser.nim +++ b/lib/pure/htmlparser.nim @@ -480,7 +480,7 @@ proc untilElementEnd(x: var TXmlParser, result: PXmlNode, if htmlTag(x.elemName) in {tagOption, tagOptgroup}: errors.add(expected(x, result)) break - else: nil + else: discard result.addNode(parse(x, errors)) of xmlElementEnd: if cmpIgnoreCase(x.elemName, result.tag) == 0: @@ -547,7 +547,7 @@ proc parse(x: var TXmlParser, errors: var seq[string]): PXmlNode = var u = entityToUtf8(x.rawData) if u.len != 0: result = newText(u) next(x) - of xmlEof: nil + of xmlEof: discard proc parseHtml*(s: PStream, filename: string, errors: var seq[string]): PXmlNode = diff --git a/lib/pure/irc.nim b/lib/pure/irc.nim index 750c98516b..c1b519b0b5 100644 --- a/lib/pure/irc.nim +++ b/lib/pure/irc.nim @@ -476,12 +476,12 @@ when isMainModule: var client = irc("amber.tenthbit.net", nick="TestBot1234", joinChans = @["#flood"]) client.connect() - while True: + while true: var event: TIRCEvent if client.poll(event): case event.typ of EvConnected: - nil + discard of EvDisconnected: break of EvMsg: diff --git a/lib/pure/matchers.nim b/lib/pure/matchers.nim index b57e0c45a5..2db7fa6606 100644 --- a/lib/pure/matchers.nim +++ b/lib/pure/matchers.nim @@ -54,7 +54,7 @@ proc parseInt*(s: string, value: var int, validRange: TSlice[int]) {. try: discard parseutils.parseInt(s, x, 0) except EOverflow: - nil + discard if x in validRange: value = x when isMainModule: diff --git a/lib/pure/oids.nim b/lib/pure/oids.nim index fbe0dda958..b3e74d2a1a 100644 --- a/lib/pure/oids.nim +++ b/lib/pure/oids.nim @@ -28,7 +28,7 @@ proc hexbyte*(hex: char): int = of '0'..'9': result = (ord(hex) - ord('0')) of 'a'..'f': result = (ord(hex) - ord('a') + 10) of 'A'..'F': result = (ord(hex) - ord('A') + 10) - else: nil + else: discard proc parseOid*(str: cstring): TOid = ## parses an OID. diff --git a/lib/pure/parsecsv.nim b/lib/pure/parsecsv.nim index 5970f2090d..4b25babecf 100644 --- a/lib/pure/parsecsv.nim +++ b/lib/pure/parsecsv.nim @@ -149,7 +149,7 @@ proc readRow*(my: var TCsvParser, columns = 0): bool = of '\c': my.bufpos = handleCR(my, my.bufpos) of '\l': my.bufpos = handleLF(my, my.bufpos) else: break - of '\0': nil + of '\0': discard else: error(my, my.bufpos, my.sep & " expected") break diff --git a/lib/pure/parsesql.nim b/lib/pure/parsesql.nim index 31951e9669..3f9686e1ed 100644 --- a/lib/pure/parsesql.nim +++ b/lib/pure/parsesql.nim @@ -79,7 +79,7 @@ proc handleHexChar(c: var TSqlLexer, xi: var int) = xi = (xi shl 4) or (ord(c.buf[c.bufpos]) - ord('A') + 10) inc(c.bufpos) else: - nil + discard proc handleOctChar(c: var TSqlLexer, xi: var int) = if c.buf[c.bufpos] in {'0'..'7'}: @@ -373,7 +373,7 @@ proc getOperator(c: var TSqlLexer, tok: var TToken) = of '+': if not trailingPlusMinus and buf[pos+1] notin operators and tok.literal.len > 0: break - of '*', '<', '>', '=': nil + of '*', '<', '>', '=': discard else: break add(tok.literal, buf[pos]) inc(pos) @@ -1120,7 +1120,7 @@ proc rs(n: PSqlNode, s: var string, indent: int, proc ra(n: PSqlNode, s: var string, indent: int) = if n == nil: return case n.kind - of nkNone: nil + of nkNone: discard of nkIdent: if allCharsInSet(n.strVal, {'\33'..'\127'}): s.add(n.strVal) diff --git a/lib/pure/xmlparser.nim b/lib/pure/xmlparser.nim index 16bbe1455b..8b8bb3b030 100644 --- a/lib/pure/xmlparser.nim +++ b/lib/pure/xmlparser.nim @@ -96,7 +96,7 @@ proc parse(x: var TXmlParser, errors: var seq[string]): PXmlNode = ## &entity; errors.add(errorMsg(x, "unknown entity: " & x.entityName)) next(x) - of xmlEof: nil + of xmlEof: discard proc parseXml*(s: PStream, filename: string, errors: var seq[string]): PXmlNode = @@ -110,7 +110,7 @@ proc parseXml*(s: PStream, filename: string, of xmlElementOpen, xmlElementStart: result = parse(x, errors) break - of xmlComment, xmlWhitespace, xmlSpecial, xmlPI: nil # just skip it + of xmlComment, xmlWhitespace, xmlSpecial, xmlPI: discard # just skip it of xmlError: errors.add(errorMsg(x)) else: diff --git a/todo.txt b/todo.txt index fef073f90d..a9f2e80e5b 100644 --- a/todo.txt +++ b/todo.txt @@ -1,11 +1,9 @@ version 0.9.4 ============= +- fix GC issues - fix macros\tstringinterp.nim - test and fix showoff -- test and fix stdlib -- test and fix misc -- fix GC issues - test C source code generation - test and fix closures - test and fix exception handling From f05acd9612959860cdf55c699e5f097cf6692639 Mon Sep 17 00:00:00 2001 From: superfunc <raspinudo@gmail.com> Date: Wed, 5 Feb 2014 16:56:43 -0800 Subject: [PATCH 320/326] Fixed typo's in tutorial 2 --- doc/tut2.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/tut2.txt b/doc/tut2.txt index 581239cc76..6738c55511 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -528,7 +528,7 @@ containers: proc newNode*[T](data: T): PBinaryTree[T] = # constructor for a node new(result) - result.dat = data + result.data = data proc add*[T](root: var PBinaryTree[T], n: PBinaryTree[T]) = # insert a node into the tree @@ -569,7 +569,7 @@ containers: var root: PBinaryTree[string] # instantiate a PBinaryTree with ``string`` - add(root, newNode("hallo")) # instantiates ``newNode`` and ``add`` + add(root, newNode("hello")) # instantiates ``newNode`` and ``add`` add(root, "world") # instantiates the second ``add`` proc for str in preorder(root): stdout.writeln(str) From 3be07d842a13cde69aeb5e7908ed62907daef4f7 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Thu, 6 Feb 2014 02:41:53 +0100 Subject: [PATCH 321/326] fixes regression: constant fac4 didn't work --- compiler/parser.nim | 23 +++++++++++++++-------- compiler/vm.nim | 5 ++++- compiler/vmgen.nim | 2 +- tests/exprs/tstmtexprs.nim | 7 ++++++- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/compiler/parser.nim b/compiler/parser.nim index 7c740559c3..ff3324b471 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -35,6 +35,7 @@ type lex*: TLexer # the lexer that is used for parsing tok*: TToken # the current token inPragma: int + inSemiStmtList: int proc parseAll*(p: var TParser): PNode proc openParser*(p: var TParser, filename: string, inputstream: PLLStream) @@ -455,11 +456,13 @@ proc complexOrSimpleStmt(p: var TParser): PNode proc simpleExpr(p: var TParser, mode = pmNormal): PNode proc semiStmtList(p: var TParser, result: PNode) = + inc p.inSemiStmtList result.add(complexOrSimpleStmt(p)) while p.tok.tokType == tkSemiColon: getTok(p) optInd(p, result) result.add(complexOrSimpleStmt(p)) + dec p.inSemiStmtList result.kind = nkStmtListExpr proc parsePar(p: var TParser): PNode = @@ -1881,14 +1884,18 @@ proc parseStmt(p: var TParser): PNode = parMessage(p, errComplexStmtRequiresInd) result = ast.emptyNode else: - result = newNodeP(nkStmtList, p) - while true: - if p.tok.indent >= 0: parMessage(p, errInvalidIndentation) - let a = simpleStmt(p) - if a.kind == nkEmpty: parMessage(p, errExprExpected, p.tok) - result.add(a) - if p.tok.tokType != tkSemiColon: break - getTok(p) + if p.inSemiStmtList > 0: + result = simpleStmt(p) + if result.kind == nkEmpty: parMessage(p, errExprExpected, p.tok) + else: + result = newNodeP(nkStmtList, p) + while true: + if p.tok.indent >= 0: parMessage(p, errInvalidIndentation) + let a = simpleStmt(p) + if a.kind == nkEmpty: parMessage(p, errExprExpected, p.tok) + result.add(a) + if p.tok.tokType != tkSemiColon: break + getTok(p) proc parseAll(p: var TParser): PNode = result = newNodeP(nkStmtList, p) diff --git a/compiler/vm.nim b/compiler/vm.nim index 61881a8977..10ac7aaafa 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -14,7 +14,7 @@ import ast except getstr import strutils, astalgo, msgs, vmdef, vmgen, nimsets, types, passes, unsigned, - parser, vmdeps, idents, trees, renderer, options + parser, vmdeps, idents, trees, renderer, options, transf from semfold import leValueConv, ordinalValToString from evaltempl import evalTemplate @@ -1078,6 +1078,7 @@ proc execute(c: PCtx, start: int): PNode = result = rawExecute(c, start, tos) proc evalStmt*(c: PCtx, n: PNode) = + let n = transformExpr(c.module, n) let start = genStmt(c, n) # execute new instructions; this redundant opcEof check saves us lots # of allocations in 'execute': @@ -1085,6 +1086,7 @@ proc evalStmt*(c: PCtx, n: PNode) = discard execute(c, start) proc evalExpr*(c: PCtx, n: PNode): PNode = + let n = transformExpr(c.module, n) let start = genExpr(c, n) assert c.code[start].opcode != opcEof result = execute(c, start) @@ -1127,6 +1129,7 @@ proc myProcess(c: PPassContext, n: PNode): PNode = const evalPass* = makePass(myOpen, nil, myProcess, myProcess) proc evalConstExprAux(module, prc: PSym, n: PNode, mode: TEvalMode): PNode = + let n = transformExpr(module, n) setupGlobalCtx(module) var c = globalCtx c.mode = mode diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 313c43dc44..d0e8dacf32 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1033,7 +1033,7 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) = if s.isGlobal: if sfCompileTime in s.flags or c.mode == emRepl: discard - else: + elif s.position == 0: cannotEval(n) if s.position == 0: if sfImportc in s.flags: c.importcSym(n.info, s) diff --git a/tests/exprs/tstmtexprs.nim b/tests/exprs/tstmtexprs.nim index 8149ec4b88..816e58cb1d 100644 --- a/tests/exprs/tstmtexprs.nim +++ b/tests/exprs/tstmtexprs.nim @@ -1,5 +1,6 @@ discard """ - output: '''(bar: bar) + output: '''24 +(bar: bar) 1244 6 abcdefghijklmnopqrstuvwxyz @@ -8,6 +9,10 @@ abcdefghijklmnopqrstuvwxyz import strutils +const fac4 = (var x = 1; for i in 1..4: x *= i; x) + +echo fac4 + when true: proc test(foo: proc (x, y: int): bool) = echo foo(5, 5) From 38e4dfc164404a601e0556936497e7ee97a88fba Mon Sep 17 00:00:00 2001 From: EXetoC <exetoc@gmail.com> Date: Thu, 6 Feb 2014 14:18:44 +0100 Subject: [PATCH 322/326] Export procs that are useful elsewhere. --- lib/pure/times.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 6186fcad8f..de6c4e4fa2 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -211,7 +211,9 @@ proc initInterval*(miliseconds, seconds, minutes, hours, days, months, result.months = months result.years = years -proc isLeapYear(year: int): bool = +proc isLeapYear*(year: int): bool = + ## returns true if ``year`` is a leap year + if year mod 400 == 0: return true elif year mod 100 == 0: @@ -221,7 +223,9 @@ proc isLeapYear(year: int): bool = else: return false -proc getDaysInMonth(month: TMonth, year: int): int = +proc getDaysInMonth*(month: TMonth, year: int): int = + ## gets the amount of days in a ``month`` of a ``year`` + # http://www.dispersiondesign.com/articles/time/number_of_days_in_a_month case month of mFeb: result = if isLeapYear(year): 29 else: 28 From 75f232eb6efa1d213ca84c524ee9119da128d6e3 Mon Sep 17 00:00:00 2001 From: Simon Hafner <hafnersimon@gmail.com> Date: Thu, 6 Feb 2014 14:55:05 -0600 Subject: [PATCH 323/326] removed unittest from talgorithm --- tests/stdlib/talgorithm.nim | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/stdlib/talgorithm.nim b/tests/stdlib/talgorithm.nim index 37de1262f3..7ab652c82a 100644 --- a/tests/stdlib/talgorithm.nim +++ b/tests/stdlib/talgorithm.nim @@ -1,14 +1,8 @@ -import unittest import algorithm -suite "product": - test "empty input": - check product[int](newSeq[seq[int]]()) == newSeq[seq[int]]() - test "bit more empty input": - check product[int](@[newSeq[int](), @[], @[]]) == newSeq[seq[int]]() - test "a simple case of one element": - check product(@[@[1,2]]) == @[@[1,2]] - test "two elements": - check product(@[@[1,2], @[3,4]]) == @[@[2,4],@[1,4],@[2,3],@[1,3]] - test "three elements": - check product(@[@[1,2], @[3,4], @[5,6]]) == @[@[2,4,6],@[1,4,6],@[2,3,6],@[1,3,6], @[2,4,5],@[1,4,5],@[2,3,5],@[1,3,5]] +doAssert product[int](newSeq[seq[int]]()) == newSeq[seq[int]](), "empty input" +doAssert product[int](@[newSeq[int](), @[], @[]]) == newSeq[seq[int]](), "bit more empty input" +doAssert product(@[@[1,2]]) == @[@[1,2]], "a simple case of one element" +doAssert product(@[@[1,2], @[3,4]]) == @[@[2,4],@[1,4],@[2,3],@[1,3]], "two elements" +doAssert product(@[@[1,2], @[3,4], @[5,6]]) == @[@[2,4,6],@[1,4,6],@[2,3,6],@[1,3,6], @[2,4,5],@[1,4,5],@[2,3,5],@[1,3,5]], "three elements" +doAssert product(@[@[1,2], @[]]) == newSeq[seq[int]](), "two elements, but one empty" From 5498415f3b44048739c9b7116638824713d9c1df Mon Sep 17 00:00:00 2001 From: Simon Hafner <hafnersimon@gmail.com> Date: Thu, 6 Feb 2014 16:11:55 -0600 Subject: [PATCH 324/326] indexBy, which indexes a collection into a hashtable --- lib/pure/collections/tables.nim | 10 ++++++++++ tests/collections/ttables.nim | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/collections/ttables.nim diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 73da274b9e..40ae57b5a5 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -189,6 +189,16 @@ template dollarImpl(): stmt {.dirty.} = proc `$`*[A, B](t: TTable[A, B]): string = ## The `$` operator for hash tables. dollarImpl() + +proc `==`*[A, B](s, t: TTable[A, B]): bool = + s.counter == t.counter and s.data == t.data + +proc indexBy*[A, B, C](collection: A, index: proc(x: B): C): TTable[C, B] = + ## Index the collection with the proc provided. + # TODO: As soon as supported, change collection: A to collection: A[B] + result = initTable[C, B]() + for item in collection: + result[index(item)] = item # ------------------------------ ordered table ------------------------------ diff --git a/tests/collections/ttables.nim b/tests/collections/ttables.nim new file mode 100644 index 0000000000..f374d5504c --- /dev/null +++ b/tests/collections/ttables.nim @@ -0,0 +1,22 @@ +import tables + +doAssert indexBy(newSeq[int](), proc(x: int):int = x) == initTable[int, int](), "empty int table" + +var tbl1 = initTable[int, int]() +tbl1.add(1,1) +tbl1.add(2,2) +doAssert indexBy(@[1,2], proc(x: int):int = x) == tbl1, "int table" + +type + TElem = object + foo: int + bar: string + +let + elem1 = TElem(foo: 1, bar: "bar") + elem2 = TElem(foo: 2, bar: "baz") + +var tbl2 = initTable[string, TElem]() +tbl2.add("bar", elem1) +tbl2.add("baz", elem2) +doAssert indexBy(@[elem1,elem2], proc(x: TElem): string = x.bar) == tbl2, "element table" From a087f6057e70e8b7c57ec9a20ac7f7815afe9327 Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 7 Feb 2014 17:06:20 +0100 Subject: [PATCH 325/326] bugfix: codegen issue that caused getGMTime() to leak memory --- compiler/ccgexprs.nim | 2 +- doc/manual.txt | 2 ++ tests/gc/gcleak4.nim | 2 +- tests/gc/gcleak5.nim | 25 +++++++++++++++++++++++++ tests/testament/categories.nim | 5 +++++ todo.txt | 2 +- 6 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 tests/gc/gcleak5.nim diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index be47ac0c4a..031ab8d704 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -1049,7 +1049,7 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = app(tmp2.r, field.loc.r) tmp2.k = locTemp tmp2.t = field.loc.t - tmp2.s = OnHeap + tmp2.s = if isRef: OnHeap else: OnStack tmp2.heapRoot = tmp.r expr(p, it.sons[1], tmp2) if d.k == locNone: diff --git a/doc/manual.txt b/doc/manual.txt index da229d169b..520e4f62e9 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -2231,6 +2231,8 @@ Instead of: Using statement --------------- +**Warning**: The ``using`` statement is highly experimental! + The `using statement`:idx: provides syntactic convenience for procs that heavily use a single contextual parameter. When applied to a variable or a constant, it will instruct Nimrod to automatically consider the used symbol as diff --git a/tests/gc/gcleak4.nim b/tests/gc/gcleak4.nim index bd7bded283..6f2b8a1fe6 100644 --- a/tests/gc/gcleak4.nim +++ b/tests/gc/gcleak4.nim @@ -6,7 +6,7 @@ when defined(GC_setMaxPause): GC_setMaxPause 2_000 type - TExpr = object ## abstract base class for an expression + TExpr = object {.inheritable.} ## abstract base class for an expression PLiteral = ref TLiteral TLiteral = object of TExpr x: int diff --git a/tests/gc/gcleak5.nim b/tests/gc/gcleak5.nim new file mode 100644 index 0000000000..b9131051b0 --- /dev/null +++ b/tests/gc/gcleak5.nim @@ -0,0 +1,25 @@ +discard """ + output: "success" +""" + +import os, times + +proc main = + var i = 0 + for ii in 0..50_000: + #while true: + var t = getTime() + var g = t.getGMTime() + #echo isOnStack(addr g) + + if i mod 100 == 0: + let om = getOccupiedMem() + echo "memory: ", om + if om > 100_000: quit "leak" + + inc(i) + sleep(1) + + echo "success" + +main() diff --git a/tests/testament/categories.nim b/tests/testament/categories.nim index 5dd8414470..f9f5698bbb 100644 --- a/tests/testament/categories.nim +++ b/tests/testament/categories.nim @@ -123,9 +123,14 @@ proc gcTests(r: var TResults, cat: Category, options: string) = test "gcleak2" test "gctest" test "gcleak3" + test "gcleak4" + test "gcleak5" test "weakrefs" test "cycleleak" test "closureleak" + test "refarrayleak" + rest "stackrefleak" + # ------------------------- threading tests ----------------------------------- diff --git a/todo.txt b/todo.txt index a9f2e80e5b..738e9b3fad 100644 --- a/todo.txt +++ b/todo.txt @@ -5,7 +5,7 @@ version 0.9.4 - fix macros\tstringinterp.nim - test and fix showoff - test C source code generation -- test and fix closures +- fix closures - test and fix exception handling - implement 'union' and 'bits' pragmas From c3adc19f471ddddf0cab9a92908dcdbede26b3eb Mon Sep 17 00:00:00 2001 From: Araq <rumpf_a@web.de> Date: Fri, 7 Feb 2014 18:49:41 +0100 Subject: [PATCH 326/326] tester compiles again --- tests/gc/gcleak5.nim | 2 +- tests/testament/categories.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/gc/gcleak5.nim b/tests/gc/gcleak5.nim index b9131051b0..9e2948729e 100644 --- a/tests/gc/gcleak5.nim +++ b/tests/gc/gcleak5.nim @@ -14,7 +14,7 @@ proc main = if i mod 100 == 0: let om = getOccupiedMem() - echo "memory: ", om + #echo "memory: ", om if om > 100_000: quit "leak" inc(i) diff --git a/tests/testament/categories.nim b/tests/testament/categories.nim index f9f5698bbb..442dd12123 100644 --- a/tests/testament/categories.nim +++ b/tests/testament/categories.nim @@ -129,7 +129,7 @@ proc gcTests(r: var TResults, cat: Category, options: string) = test "cycleleak" test "closureleak" test "refarrayleak" - rest "stackrefleak" + test "stackrefleak" # ------------------------- threading tests -----------------------------------